toolclub/dsh-agent-team-gui1

dsh-agent-team-gui

DSH 常驻多模型小队管理插件:在设置中管理团队,并在普通对话中直接使用。

AI 分析

核心用于构建和调度多模型协作团队。适合需要配置多个不同模型(如串行、并行或链式)协同解决复杂任务的用户。

包名
dsh-agent-team-gui
版本
0.1.0
许可证
MIT
最近更新
2026年8月15日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:toolclub/dsh-agent-team-gui

Configuration

The bundle inserts this host row:

- id: agent-team-gui
  name: dsh-agent-team-gui
  config:
    defaultProvider: spawn
    defaultExecutionMode: serial
    defaultContextMode: spawn
FieldTypeDefaultMeaning
defaultProviderstringspawnRegistered dsh subagent provider used unless dispatch/context selection chooses another one.
defaultExecutionModeserial | parallelserialDefault member scheduling.
defaultContextModespawn | fork | chainspawnspawn starts fresh children; fork includes the parent's completed-turn prefix; chain passes each serial member's text to the next.

To override it for one profile, edit $DSH_HOME/profiles//cordis.patch.yml:

- id: agent-team-gui
  config:
    defaultProvider: fork
    defaultExecutionMode: parallel
    defaultContextMode: fork

dsh patch rows replace the complete config object; they are not deep-merged. Restate every field you need whenever overriding the row. chain is valid only with serial execution.

Agent records contain:

FieldRequiredMeaning
nameyesDisplay name.
systemPromptyesRole/persona passed to the child agent.
provideryesExisting dsh provider route name.
modelyesExisting model id for that provider.
maxTokensnoPer-agent token cap.
toolScope.allow / toolScope.denynodsh tool-name restrictions applied to that child.

Squad records contain:

FieldRequiredMeaning
nameyesGlobal display name used by Settings and conversation selectors.
membersyesUnique agent IDs available to the squad.
collabNotenoCollaboration guidance included in member prompts.
executionOrdernoFixed complete ordering of every member. Omit it for lead-model planning.
executionModenoSquad default: serial or parallel; falls back to plugin config.
contextModenoSquad default: spawn, fork, or serial-only chain; falls back to plugin config.

Squad records contain name, an optional collaboration note, a member list, optional executionOrder, and optional executionMode/contextMode defaults. An agent may appear in multiple squads. Settings → Teams edits these global records through a loopback-only host RPC. A fixed executionOrder must contain every member exactly once. With no fixed order, the lead model plans assignments and passes a complete memberOrder when dispatching. The plugin stores route names only; it does not store or copy provider secrets.

In-process service API

Plugin authors can also use the same registry in-process:

const agentId = await ctx.agentTeamGui.createAgent({
  name: 'Reviewer',
  systemPrompt: 'Review for correctness and cite concrete evidence.',
  provider: 'your-configured-provider',
  model: 'your-configured-model',
  toolScope: { allow: ['bash', 'str_replace_editor'] },
})

const squad = await ctx.agentTeamGui.createSquad({
  name: 'Release review',
  collabNote: 'Run independent checks, then consolidate findings.',
  members: [agentId],
})

The service also exposes get/list/update/delete methods for both record types, addMemberToSquad, removeMemberFromSquad, exportDefinitions/importDefinitions, and a programmatic dispatch method. Exact TypeScript signatures are exported by the package declarations.

Usage examples

Natural-language dispatch (available after a squad exists)

User: Give the release-review squad this task: inspect the patch for regressions.
      Have the reviewer check correctness and the test agent run focused tests in parallel.

Assistant: [calls dispatch_to_squad with squadId, task,
            assignments=[...], executionMode="parallel", contextMode="spawn"]

Assistant: The squad completed with two member results. The reviewer found ..., and the focused
           tests .... Any failed member is listed explicitly instead of being omitted.

The model selects dispatch_to_squad; the plugin does not parse the user's text with regular expressions. squadId accepts either the durable ID or an exact squad name (case-insensitive); if names are duplicated, use the durable ID. Tool arguments are squadId, task, optional assignments: [{ agentId, task }], optional executionMode, and optional contextMode. memberOrder is also optional when the squad has no fixed executionOrder; when supplied, it must be a complete, duplicate-free ordering of all squad members. A fixed squad order cannot be overridden per call. The tool renders the complete canonical JSON result—including each member's runId, childId, status, error, stop reason, and output—so the lead model can produce the final summary.

Conversation collaboration toggle

  1. Start dsh --profile web and open Settings → Teams.
  2. Create the agents. Choose each provider/model from the routes already configured in dsh; optionally enter max tokens and comma-separated allowed/denied tools.
  3. Create a global squad, select its members, add an optional collaboration note, and optionally pin a fixed member order. Leave the order unset to let the model plan roles and ordering.
  4. Open any conversation, select Release review in its squad selector, and enable squad collaboration.
  5. Type the task in the normal composer and select Send. Disable the toggle to return that conversation to ordinary single-agent sends.
User types: Inspect this change and prepare a release recommendation.
Conversation control: Release review squad -> Collaboration on
User selects: Send

Assistant: [the selected squad collaborates using the current conversation as parent]
Assistant: The release-review squad recommends ... Reviewer: ... Test agent: ...

The selected squad is conversation-scoped and its mode is durable; both session modes and global agent/squad definitions survive restart. Deleting a selected squad automatically disables affected session modes. Sending does not require a second task box or a separate Dispatch button. Internally, a dynamic system prompt tells the lead model to call dispatch_to_squad once and summarize its result for the normal assistant response. This is a best-effort model instruction, not an API-level forced tool call; see Known limitations.

Export and import definitions

Settings → Teams can dump and restore the durable definitions as a JSON document.

  • Export downloads agent-team-gui-.json containing { "format": "agent-team-gui/definitions", "version": 1, "agents": [...], "squads": [...] } — every record with its durable id, plus model routes (never API keys).
  • Import reads such a file and applies it with merge semantics: document rows are upserted by id, rows already in the store that the document does not mention are kept, and a squad may reference an agent that already exists in the store. The whole document is validated first — shape, duplicate ids, model routes, and squad member references — so a rejected import writes nothing. (The durable writes themselves are not a single transaction: a storage failure mid-import can leave a partial apply.)

The same operations are available in-process as exportDefinitions() and importDefinitions(document, mode); mode is merge (default) or replace. replace makes the document the entire store, and then a squad may only reference agents present in the document.