dsh-cc/dsh-cc--packages-interaction-command-preset ↗★ 4

@dsh-cc/command-preset

Human-facing /preset command: list the agent-preset roster and switch the session/default agent preset 提供 /preset 命令,方便用户在会话中快速查看和切换不同的智能体预设。

パッケージ
@dsh-cc/command-preset
互換性
未検証
Harness ピア範囲
>=0.2.0-rc.2
Cordis ピア範囲
>=0.2.0-rc.2
バージョン
0.9.0-rc.4
ライセンス
Apache-2.0
最終更新
2026/10/13

インストール

検証済み bundle がないか、互換性チェックに失敗しています。先にリポジトリの説明を読んでください。 README 全文を読む ↗

ドキュメント

README 全文を読む ↗

@dsh-cc/command-preset

English | 中文

Human-facing /preset command for the agent-preset registry: list the deployment's roster, and switch the running session and/or the persisted default with /preset . The plugin registers one global command through ctx.commands, so every composed command adapter discovers and executes it without a model turn.

Command contract

InputResult
/presetPrint the roster as presentation text: each preset's id, name, order, description, and availability; the current default is marked.
/preset Switch transaction (pinned order): validate the id against the roster; try hot-activating the zero-turn session via the registry's select; write vwa-preset.selectedDefault through the settings provider; only after a successful action branch, inject a command-preset-sourced announcement to the model.
/preset helpRender the command help with its argument hint.

Partial-success tri-state

  • Full success: the session switched and the default was written.
  • Locked downgrade: the session has already started (agent-preset/locked), so only the default changes — this is not an error.
  • Settings write failed: the hot switch (if any) stands, but hot activation of new sessions is NOT achieved; the result text names the failure and the manual fallback (vwa-preset.selectedDefault in your user settings).

Settings namespace

vwa-preset with the single key selectedDefault (absent ⇒ the deployment default, cc). The namespace is registered at mount through the shared registerNamespaceSafe helper; the settings-provider update semantics perform the write.

Wiring

The agent-preset registry is read at apply time via ctx.get('agentPresets') with a loud throw when absent — deliberately not an inject declaration, which would re-compose the registry inside the preset scope (cordis trap). The command row is mounted by both packages/preset/cc/agent.cordis.yml and agent.vwa.cordis.yml.