  - id: agent-instructions
    name: '@deepseek-ai/dsh-agent-instructions'
    config:
      maxBytes: 65536
  - id: tool-bash
    name: '@deepseek-ai/dsh-tool-bash'
    disabled: !!js process.platform === 'win32'
  - id: tool-pwsh
    name: '@deepseek-ai/dsh-tool-pwsh'
    disabled: !!js process.platform !== 'win32'
  - id: tool-fs
    name: '@deepseek-ai/dsh-tool-fs'
  - id: tool-fs-search
    name: '@deepseek-ai/dsh-tool-fs-search'
    config:
      sampleOverCapGlobResults: false
  - id: tool-jobs
    name: '@deepseek-ai/dsh-tool-jobs'
  - id: skill-filesystem
    name: '@deepseek-ai/dsh-skill-filesystem'
    config:
      # 随包发放的技能（`dsh-doc` 这些）默认不在扫描范围内，要靠这一条把它们的目录
      # 登记进来；桌面 `standard` 预设从 0.2.2-rc.2 起带上它，手机这份此前漏了 ——
      # 于是手机上「/」菜单里的技能少一截，模型也用不上这套说明。
      #
      # 路径必须相对 `baseUrl`（预设自己所在那一层）算，不能写死绝对路径：包在
      # `pnpm` 的虚拟仓里时位置每台机器都不一样。
      customSkillDirs:
        - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
        # 移动端常见问题知识库，随本包发布、放在预设这一层的 `skills/` 下。用相对
        # `baseUrl` 的 `createRequire(...).resolve('./skills/.../SKILL.md')` 再退两层取
        # 技能根：`baseUrl` 无论是路径还是 file URL 都成立，宿主把预设复制到可写区后
        # 这个相对关系也不变；别按包名 resolve —— 无头宿主里本包按绝对路径挂，裸名可能解析不到。
        - !!js process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('./skills/dsh-mobile-kb/SKILL.md')))
  - id: tool-skill
    name: '@deepseek-ai/dsh-tool-skill'
  - id: command-goal
    name: '@deepseek-ai/dsh-command-goal'
  - id: tool-goal
    name: '@deepseek-ai/dsh-tool-goal'
  - id: planning
    name: cordis:group
    group: true
    isolate:
      planMode: true
    config:
      - id: plan-mode
        name: '@deepseek-ai/dsh-plan-mode'
        config:
          section: >
            You are in plan mode. Stay in plan mode until exit_plan_mode
            succeeds or the user switches the session mode. Imperative
            language to implement changes means plan the implementation, not
            execute it. A user's conversational agreement — including an
            answer confirming something you asked — approves nothing and
            does not end plan mode; fold the confirmed decision into the
            plan and submit it through exit_plan_mode.


            Explore first. Use non-mutating reads, searches, static
            analysis, and checks to ground the plan in the actual
            repository. Do not edit or write files, change configuration,
            run formatters or code generation that rewrites tracked files,
            commit, or otherwise carry out the plan. Prefer existing
            functions and patterns over new machinery.


            The tool catalog stays the same across modes for request-cache
            stability. These plan-mode rules override any later tool
            description or guidance that suggests using mutation tools;
            those tools remain listed to keep the tool catalog unchanged. Do
            not use todo_write to track this planning phase: it tracks
            implementation after an approved plan, while the plan itself
            belongs in exit_plan_mode.


            Resolve discoverable facts by inspection. Use ask_user_question
            only for user-owned choices or material ambiguity that
            inspection cannot answer. Do not ask the user where code lives
            or how current behavior works when you can find out.


            Make the plan decision-complete: state the goal and success
            criteria; group implementation changes by subsystem; identify
            public API, schema, and data-flow changes; cover edge cases,
            failure modes, tests, acceptance criteria, and explicit
            assumptions. Keep it concise enough to review but detailed
            enough that another engineer can implement it without making
            design decisions.


            When ready, call exit_plan_mode with the complete plan markdown,
            starting with a # title. Make exit_plan_mode the only and final
            tool call in that assistant response: it presents the plan for
            approval, and implementation begins only in a later step after
            approval. Do not paste the final plan as a plain reply or ask
            "should I proceed?" through prose or ask_user_question. If
            review rejects it, incorporate the feedback and present again.
            If the review channel is unavailable or aborted, stay in plan
            mode and ask the user to switch modes manually; do not proceed
            with implementation.
  - id: compaction
    name: cordis:group
    group: true
    isolate:
      compaction: true
      toolResultPruner: true
    config:
      - id: compaction-basic
        name: '@deepseek-ai/dsh-compaction-basic'
      - id: command-compact
        name: '@deepseek-ai/dsh-command-compact'
      - id: tool-result-pruner
        name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
        config:
          thresholdChars: 8192
          headChars: 4096
          tailChars: 1024
  - id: delegation
    name: cordis:group
    group: true
    isolate:
      workflowEngine: true
    config:
      - id: tool-subagent-control
        name: '@deepseek-ai/dsh-tool-subagent-control'
      # 独立的 `list_agents` 入口只在 0.2.1 及更早存在；0.2.2 把它并进了主包，
      # 子路径没了。这一行保留是为了老运行时，启动时宿主会按「这一代认不认这个
      # 子路径」把副本里的这一行整行拿掉（见 lib/host-compat.cjs 的 dropRows）。
      - id: tool-subagent-list-agents
        name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
      # 子代理挑模型的开关，两代运行时键名不同：0.2.1 及更早读
      # `modelSelectionSettings`，0.2.2 起改成 `modelSelection`（另加
      # `modelDiscovery` 才让模型查得到可选模型）。两个键都写：各自的 schema 只认
      # 自己那个、另一个原样忽略，所以同一份预设挂到哪一代都对。
      - id: tool-subagent
        name: '@deepseek-ai/dsh-tool-subagent'
        config:
          provider: spawn
          toolName: subagent
          modelSelectionSettings: true
          modelSelection: true
          modelDiscovery: true
          backgroundMode: continuable
      - id: tool-subagent-fork
        name: '@deepseek-ai/dsh-tool-subagent'
        config:
          provider: fork
          toolName: subagent_fork
          backgroundMode: continuable
      - id: tool-subagent-codex
        name: '@deepseek-ai/dsh-tool-subagent'
        disabled: true
        config:
          provider: codex
          toolName: subagent_codex
          backgroundMode: one-shot
          maxDepth: provider-managed
      - id: tool-subagent-claude-code
        name: '@deepseek-ai/dsh-tool-subagent'
        disabled: true
        config:
          provider: claude-code
          toolName: subagent_claude_code
          backgroundMode: one-shot
          maxDepth: provider-managed
      # `tool-workflow` is deliberately absent: it injects `workflowEngine`,
      # which only `@deepseek-ai/dsh-workflow-ptc` provides, and that package
      # has no 0.1.1-rc.2 release (its earliest is 0.1.6-alpha.1). The App's
      # workflow surfaces therefore have nothing to run on this host.
      - id: tool-ralph
        name: '@deepseek-ai/dsh-tool-ralph'
        disabled: true
        config:
          subagentProvider: spawn
          maxRounds: 64
  - id: tool-todo
    name: '@deepseek-ai/dsh-tool-todo'
    config:
      allowParallelInProgress: true
  - id: tool-web
    name: '@deepseek-ai/dsh-tool-web'
    config:
      fetch: true
      searchTimeoutMs: 60000
  # Without this row the mobile host's tool catalog has no `ask_user_question`,
  # so the App's question dock could never appear: the model simply reports that
  # the tool is unavailable. The plugin's `lib/mobile/questions.js` listens on
  # the `user-questions/request` hook (0.2.x shape) and answers it — only the
  # tool row was missing.
  #
  # 这里的 `name` 是**占位**：无头宿主启动时会把同代那一份的入口绝对路径写进
  # 一份副本（`host.js` 的 syncPresetDir），挂载的是运行时自己的那一代。这个包的
  # peerDependencies 逐版本紧咬，对不上时 `dsh-app-boot` 会**整行禁用**（不是降级），
  # 而钉死哪一代都不可能覆盖每台机器上装的 DSH —— 判据交给运行期，别在这里写死。
  - id: tool-ask-user
    name: '@deepseek-ai/dsh-tool-ask-user'
  # `present` 是模型**显式声明交付文件**的那一行。桌面 `standard` preset 里一直有它
  # （`@deepseek-ai/dsh-web-app/presets/standard.patch.yml`），手机这份漏了 —— 于是手机
  # 上的模型完全没有「把文件交付给用户」这个动作，只能写完文件什么也不说；App 那边只好
  # 拿 write/edit 成功去反推，结果「每改一次都冒一张卡、用命令行改的却一张都没有」。
  #
  # 它只做两件事：校验路径是会话文件系统里真实存在的普通文件，然后把
  # `deliverables/presented` 事件追加进会话日志。卡片该不该出现，由**模型叫不叫这个工具**
  # 决定，不由「有没有文件被改」决定 —— 这是桌面的口径。
  #
  # 版本同样由运行期决定（见上面 tool-ask-user 那段）：0.2.1 的 `present` 要
  # `dsh-agent` 恰好是同一代，对不上时 `dsh-app-boot` 会整行禁用，模型只会说
  # 「没有这个工具」。`name` 是占位，宿主启动时换成本次运行时的入口。
  - id: tool-present
    name: '@deepseek-ai/dsh-tool-present'

# Office 三件（`office_render` / `office_convert` / `office_recalculate`）刻意不在这里：
# Office 已经拆成独立的扩展插件（手机侧市场按需安装，见 A1-146），那块能力由扩展自己提供，
# 本包不再挂官方工具行 —— 挂了等于同一件事两份实现，而且它的 peer 精确咬
# `dsh-agent` / `dsh-office-kit`，抬代时还得跟着跑一轮。
