# The layer a profile listing this bundle applies over dsh-base.
#
# Two rows, in dependency order: the startup row parses this bundle's flags and
# publishes `tuiStartup` — only on an interactive launch, so a piped run leaves
# the runner unmounted — and the runner row owns the terminal.
- insert:
    - id: dshline-startup
      name: '@dshline/dshline/startup'

    - id: dshline
      name: '@dshline/dshline'

# ── host-plane session infrastructure this surface needs ───────────────────
#
# Whole-log turn/step counts and wall times for `/usage`'s performance section
# (the `sessionStats` projection key). The projection REGISTRY is a `dsh-base`
# row and stays there; this is one more unit registered on it.
#
# Host-plane, and deliberately not behind an agent preset. A preset composes
# what one agent contributes to the host registries — its tools, its prompt
# sections, its delegation backends — and this row contributes none of those:
# it registers a pure fold over the session log, is model-invisible, and is
# keyed by session rather than by agent. Putting it behind a preset would make
# whether `/usage` can report performance a function of which preset a session
# happens to run, and would register the same unit once per mounted preset.
#
# `dsh-base` does not carry this row, so a plain TUI or headless assembly
# serves no `sessionStats` key at all. What upstream demonstrates is that the
# official package is mounted as a host-level bundle row for the surface that
# consumes it: `packages/bundle/web-app/cordis.patch.yml` in deepseek-harness
# inserts this same name in its own host roster for the chat stats strip. This
# row is that same treatment for a different reader — one bounded `/usage`
# section — and the reasoning above is dshline's own.
#
# A profile that drops this row keeps everything else. `/usage` reports its
# tokens, its cache split, and its cost exactly as before, and says in one line
# that this profile does not mount Harness session statistics — dshline
# implements no fallback fold, because a second count of the same events is a
# second authority to disagree with.
- insert:
    - id: session-stats
      name: '@deepseek-ai/dsh-session-stats'

# The whole-log turn outline `/turns` reads (the `turnOutline` projection key).
# Each entry carries the Harness-assigned turn number, that turn's `turn/start`
# seq, and bounded prompt/response previews folded from the complete durable
# log — including a resumed session this process never watched.
#
# Host-plane and unconditional, for exactly the reason above: it is a pure fold
# over the session log, model-invisible, and keyed by session rather than by
# agent, so an agent preset is the wrong owner and would register the same unit
# once per mounted preset. `dsh-base` does not carry this row, so a plain TUI or
# headless assembly serves no `turnOutline` key at all. A profile that drops it
# keeps everything else: `/turns` says in one line that this composition mounts
# no turn outline, rather than folding the log a second time — a second
# transcript model would be a second authority to disagree with.
- insert:
    - id: session-turn-outline
      name: '@deepseek-ai/dsh-session-turn-outline'

# The files each top-level turn changed (`ctx.workspaceChanges`), which `/turns`
# reads in its turn rows and inspects on demand. The plugin snapshots the working
# tree around every turn through the `subprocess` capability, appends one
# `workspace/changes` event naming the turn, and serves the summary and each
# file's comparison from THIS Host process while the Session lives.
#
# Host-plane and unconditional, on the same reasoning as the two rows above: it
# registers no tool and no prompt section, it appends a log-only event no model
# request ever carries, and it is keyed by session rather than by agent, so an
# agent preset is the wrong owner and would record every turn once per mounted
# preset. Upstream mounts it in `packages/bundle/web-app/cordis.patch.yml` in
# the same host roster, beside these two rows, for its own changed-files card;
# this row is that same treatment for a terminal reader.
#
# `dsh-base` does not carry this row, so a plain TUI or headless assembly serves
# no `workspaceChanges` key at all. A profile that drops it keeps everything
# else: `/turns` behaves exactly as it did before, and says in one line that this
# composition mounts no workspace-change records rather than folding the log a
# second time.
#
# WHAT IT COSTS, because it is not free and the choice to make it is a reader's:
# a `git add --all` into a private index and a `write-tree` at each turn's start,
# a `diff-tree` at its end, a whole-file copy around each file-tool edit, a
# temporary directory per Session that is removed when that Session is disposed,
# and one awaited `settled()` before every tool call so a snapshot can never race
# a mutation. All of it runs git in the user's repository through a private index
# — normally leaving the repository's own index, object store, work tree, and
# refs unchanged. "Normally" is upstream's own word: the plugin's README records
# that a `core.splitIndex` repository writes `sharedindex.*` files, and that
# git-lfs runs its clean filter and stores objects under `.git/lfs`. None of it
# enters a model request. A reader who wants none of it disables this one row
# through `/plugins`; the rows above it are not affected.
- insert:
    - id: workspace-changes
      name: '@deepseek-ai/dsh-workspace-changes'

# The authorization seam (`ctx.authorization`): the flows that OBTAIN a
# credential by asking a human, which is the half of provider setup no
# settings document can supply. `/connect` reads it, and reading it is the
# whole reason this row is here.
#
# Host-plane and unconditional, for the same reason `session-stats` is: it is
# a process-wide registry keyed by credential record rather than anything an
# agent contributes, and putting it behind an agent preset would make whether
# a person can sign in a function of which preset a session happens to run.
#
# `dsh-base` does not carry this row, and at the adopted generation NO shipped
# bundle does — not base, not web-app, not headless, not acp-app. The one
# package that registers flows into it, `@deepseek-ai/dsh-llm-pi-ai`, scopes
# that registration to the seam's presence (`ctx.inject(['authorization'],
# …)`), so a composition without this row has no sign-in for any provider at
# all: `/connect`'s Sign-ins section is permanently empty and an account-
# authenticated provider is unreachable from the terminal. That is not a
# capability dshline can add — the seam and every flow are Harness's — it is a
# row dshline has to COMPOSE, exactly as the Web surface composes the rows its
# own pages read.
#
# Safe to mount unconditionally, on the package's own terms: it ships no flows
# of its own, so nothing asks anyone to sign in unless a plugin registered a
# flow, and `AuthorizationService.inject = ['credentials']` leaves the row
# pending rather than failing on a composition with no credential store. The
# alternative — installing it at first run and writing a composition row into
# the profile's `cordis.patch.yml` — was rejected: the package declares no
# `dsh.bundle`, so `dsh plugin add` would install it as a plain dependency
# that composes nothing, and finishing the job would mean dshline editing a
# patch layer no Harness mutation API owns.
- insert:
    - id: authorization
      name: '@deepseek-ai/dsh-authorization'

# ── the agent plane moves behind agent presets ─────────────────────────────
#
# Every row below composes what ONE agent contributes to the host registries:
# its tools, its prompt sections, its delegation backends. `dsh-base` ships
# them mounted process-wide, on the assumption stated in its own upstream
# comment: "the base keeps them for the TUI, which is single-session and
# composes its agent process-wide." That was true before `/plugins` existed.
# A picker that browses, toggles, and switches a composition needs a real
# composition to act on — a process-wide agent has none, only a fixed row
# list — so dshline now takes the same "agent plane moves behind agent
# presets" step deepseek-harness's own Web bundle already took, and for the
# identical reason: everything below is a per-agent tool row a preset also
# lists, and mounting both would double-register it.
#
# Disabling rather than deleting is deliberate, mirroring the upstream
# comment this list is copied from verbatim (`packages/bundle/web-app/
# cordis.patch.yml` in deepseek-harness): the base is shared, and a row
# absent from a surface overlay would silently reappear the day someone
# reorders the composition.
#
# `shell-env` is not in this list: `dsh-base` does not inject it for a plain
# CLI/TUI launch (only `apps/cli/src/web.ts` does, to publish `DSH_WEB_URL`/
# `DSH_WEB_MODE`), so there is nothing here for dshline to keep host-plane by
# exception.

- id: tool-bash
  disabled: true

- id: tool-pwsh
  disabled: true

# The background-job registry stays host-plane; only the model-facing
# `job_*` controls move — a preset row resolves it with `ctx.get`, and the
# registry is keyed by owning agent, so one host instance still serves every
# session exactly as before.

- id: tool-jobs
  disabled: true

- id: tool-fs
  disabled: true

- id: tool-fs-search
  disabled: true

# The skill registry stays host-plane (host+per-scope layered); only the
# per-agent rows move — a preset's own `skill-filesystem` registers into that
# preset's layer, and `tool-skill` is what a preset mounts to give its agent
# the merged catalog at all.

- id: skill-filesystem
  disabled: true

- id: tool-skill
  disabled: true

# The goal service, its session driver, and the `/goal` command stay
# host-plane (session-keyed, shared); only the model-facing tool moves.

- id: tool-goal
  disabled: true

- id: plan-mode
  disabled: true

# The token meter stays host-plane — its context-meter projection table is
# process-wide, so preset ownership would make it a function of which
# presets happen to be mounted rather than a per-session fact. Only the
# compaction backend that reads it moves.

- id: compaction-basic
  disabled: true

- id: command-compact
  disabled: true

- id: tool-result-pruner
  disabled: true

# The subagent registry and its backends stay host-plane: `subagents` is a
# process singleton, and a provider registers under a globally unique name,
# so a per-session copy would collide on the second session. What a preset
# chooses is which delegation TOOLS its agent sees, below. `tool-subagent-
# report` is NOT in this list for the same host-plane reason, not because a
# preset may not want it: it registers a continuable setup on that singleton
# rather than a tool the agent calls, and the setup list is not scope-aware.

- id: tool-subagent-control
  disabled: true

- id: tool-subagent-list-agents
  disabled: true

- id: tool-subagent
  disabled: true

- id: tool-subagent-fork
  disabled: true

- id: tool-workflow
  disabled: true

# The workflow ENGINE is agent-plane too, and this row is the one that was
# missed. The preset's `delegation` group isolates `workflowEngine` and fills
# that realm with its own `workflow-ptc`; a base-plane copy left enabled
# publishes a second engine into the root realm, so two rows provide the same
# service under two different ownership planes. The preset's copy is the one a
# preset session can actually see, so the host row is disabled here and the
# `delegation` group owns the engine outright. This was the row whose absence
# from the preset left `tool-workflow` waiting on `workflowEngine` forever.
- id: workflow-ptc
  disabled: true

# Plugin management stays a human action taken through `/profiles`. The base
# mounts the model-facing tool unconditionally and the shipped `standard`
# declaration carries it disabled, so the host row is disabled here too rather
# than left mounted beside a disabled preset copy of itself.
- id: tool-plugin-manager
  disabled: true

- id: tool-ralph
  disabled: true

- id: agent-instructions
  disabled: true

- id: tool-todo
  disabled: true

- id: tool-web
  disabled: true

# This bundle used to insert `tool-ask-user` itself, "because dsh-base omits
# it and this bundle composed no preset roster." That insert is now REMOVED
# outright — not disabled, since it was never a dsh-base row in the first
# place. Whether an agent gets `ask_user` is now the PRESET's decision, the
# same as any other agent-plane row: `standard` mounts it, `minimal` — a
# deliberately two-tool preset — does not, and neither choice is dshline's
# to override. Keeping a copy here would force it back on for every preset,
# which is exactly the composability `/plugins` exists to let a person turn
# off if a preset says otherwise.

# The shipped `standard` preset's primary delegation row opts into
# model-selectable subagents (`modelSelectionSettings: true`), which reads
# this Host-owned singleton rather than composing its own — a user
# preference sampled once per newly published Agent, not a per-session or
# per-preset fact, so preset ownership would make it a function of which
# preset happens to be mounted. Unconfigured, its own shipped default keeps
# the preference off: this row only makes the key available for the preset
# to read, it does not turn anything on for a session that was not already
# going to see it.
#
# Mounted unconditionally. This row used to carry a `!!js` resolution probe
# on `disabled`, because the two Harness lines dshline supported at the time
# disagreed about whether `@deepseek-ai/dsh-tool-subagent` published this
# subpath at all — `0.1.1-rc.2` did not, and an unconditional row would have
# failed Loader's own import there. dshline now supports ONE Harness
# generation, named exactly in `HARNESS_TARGET` and pinned exactly in every
# `dsh-*` peer range, and that generation publishes the subpath. A capability
# probe whose answer is fixed by the manifest is a compatibility layer for a
# line this bundle no longer installs, so it is deleted rather than kept: if
# the subpath ever fails to resolve, the peer pin is wrong and Loader saying
# so loudly is the correct outcome.
- insert:
    - id: subagent-model-selection-settings
      name: '@deepseek-ai/dsh-tool-subagent/model-selection-settings'

# The preset registry, then the preset declarations themselves.
#
# The adopted generation replaced a directory of preset FILES with rows. A
# preset is now an ordinary `@deepseek-ai/dsh-agent-preset` declaration in a
# Cordis composition, and the registry "neither scans directories nor accepts
# preset paths" — so there is no shipped preset root left to point at. Each
# bundle supplies its own declarations, which is why `dsh.bundle.patch` in
# package.json is an array listing `presets/*.patch.yml` after this file, the
# same treatment upstream's own web bundle takes.
#
# `standard` is the shipped default and the preset a session that recorded none
# resumes under. `minimal` is the deliberately small counterpart a person
# switches to when they want the tools and nothing else. Both are reachable
# through `/plugins`; a profile patch may add or override any declaration by
# row id, which is how upstream says a new preset is authored.
- insert:
    - id: agent-preset-registry
      name: '@deepseek-ai/dsh-agent-preset-registry'
      config:
        default: standard
