dsh-switchman 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.de.md +61 -29
- package/README.es.md +61 -29
- package/README.fr.md +60 -28
- package/README.it.md +53 -21
- package/README.ja.md +58 -26
- package/README.ko.md +54 -22
- package/README.md +57 -25
- package/README.pt.md +54 -22
- package/README.ru.md +61 -29
- package/README.zh-TW.md +57 -25
- package/README.zh.md +54 -22
- package/client.js +900 -17
- package/cordis.patch.yml +24 -8
- package/host/config.js +23 -0
- package/host/context-watch.js +267 -68
- package/host/dispatch.js +107 -6
- package/host/handover-state.js +38 -0
- package/host/lang.js +211 -36
- package/host/lib/dsh-home.js +18 -0
- package/host/routes.js +138 -7
- package/host/subagent-model.js +147 -0
- package/host/subagents.js +144 -0
- package/host/teams.js +430 -0
- package/host/ui-locale.js +35 -0
- package/host/vision.js +367 -0
- package/index.js +40 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,29 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
**English** | [简体中文](./README.zh.md) | [繁體中文](./README.zh-TW.md) | [日本語](./README.ja.md) | [한국어](./README.ko.md) | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Italiano](./README.it.md) | [Português](./README.pt.md) | [Русский](./README.ru.md)
|
|
4
4
|
|
|
5
|
-
> **The switchman family**, same author, same orchestration: [opencode-switchman](https://github.com/mrzturn/opencode-switchman) (the OpenCode original) · [zcode-switchman](https://github.com/mrzturn/zcode-switchman) (the ZCode port) · **dsh-switchman** (this repo,
|
|
5
|
+
> **The switchman family**, same author, same orchestration: [opencode-switchman](https://github.com/mrzturn/opencode-switchman) (the OpenCode original) · [zcode-switchman](https://github.com/mrzturn/zcode-switchman) (the ZCode port) · **dsh-switchman** (this repo, the DeepSeek Harness edition).
|
|
6
6
|
|
|
7
|
-

|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> Meter the context, and every task finds its own lane.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Why you need it
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Work in DSH long enough and you run into two things:
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
1. **Sessions get heavier the longer they run.** History balloons the context to hundreds of thousands of tokens; the model starts forgetting, slowing down, getting expensive — until a manual /compact is your only option, and the moment it compresses, detail is lost.
|
|
16
|
+
2. **Your primary model does everything itself.** Looking up a file, running a test, reconciling data — it chews through all of it alone, slow and costly, when most of that work really belongs on a cheaper model.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
dsh-switchman is a plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH). Once installed, the primary model goes from "doing everything itself" to working as a dispatcher: measure the water level, pick the lane, hand out the task, check the work. It is not a new model — it is an orchestration doctrine hooked onto DSH plus a settings page. Concretely, it does six things:
|
|
18
19
|
|
|
19
|
-
**
|
|
20
|
+
**1. Context water level: long sessions never burst.** Every turn counts live session tokens against three water marks that ratchet up: 50k (soft, adjustable) nudges "time to delegate"; 90k (hard) tightens the per-read file budget and steers toward wrap-up; 130k (force) hands over automatically — forking a backup of the session, compacting the context, and waking the continuation, so the task never drops. Background subagents still running at that moment are not lost either: their ids, task descriptions, and report paths are written into the handover document, so the resumed session knows where to collect reports instead of dispatching duplicates. Every dispatched subagent carries its own hard cap; on reaching it, the subagent writes its HANDOFF summary and exits.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
**2. Six dispatch pools: the right model for every job.** An economy pool (batch chores), a mechanical pool (templated rewrites), a main pool (day-to-day coding), a hard pool (tough reasoning and large-scale refactors), a vision pool (reading images), and a review pool (independent verification). In the settings page you tick candidates, rank them (optional S/A/B/C tiers), and pin a reasoning effort to each individual route — the effort dropdown lists the levels that model actually supports, not a generic three. Every prompt sent to the primary model carries a `[SWITCHMAN:POOLS]` recommendation table, and it dispatches by that table. Execution mode has three states: off / advice / enforce (enforce = out-of-pool models are rejected outright).
|
|
23
|
+
|
|
24
|
+
**3. Agent Teams mode: from working solo to running a team.** Off by default — right after install you get lightweight subagent dispatch. Two independent toggles live in the settings page:
|
|
25
|
+
|
|
26
|
+
- **Agent teams mode** — turning it on injects the team doctrine (delegate-by-default + tiered verification + shared-task-board discipline) and automatically enables DSH's Agent Teams: the primary model can pull in durable teammates (`spawn_teammate`), assign work on the shared task board (`team_task_*`), and trade messages with teammates (`send_message`). When to build a team follows a clear discipline: parallelizable independent subtasks, bulky self-contained work, a primary context already running high, or a need for role separation; one-off single-point investigations still go through a subagent. DSH's shipped policy is "no team unless the user names one" — here it flips to "use one when it fits". Turning the toggle off again leaves zero residue of the team clauses, and it never strips the team tools from sessions that are already running.
|
|
27
|
+
- **Subagent model whitelist sync** — DSH keeps an authorization whitelist of "models agents may pick for subagents": routes selected in a pool but never authorized get denied when the primary model names them explicitly (in teams mode, the pools table and the settings page flag those routes with ⚠). Flip this toggle and the union of all six pools is written into that whitelist wholesale — no configuring the same thing on both sides, switchman stays the single source of truth, and the fork-dispatch path is covered as well. The whitelist takes effect as a per-new-session snapshot, so the sync only applies to sessions opened afterwards.
|
|
28
|
+
|
|
29
|
+
The session header keeps you posted at a glance: an ⚡ "autonomous team" badge and a ◇ chip showing the session's actual model; while an automatic handover is running, a live "handover in progress · backing up session / compacting context / waking continuation" banner appears.
|
|
30
|
+
|
|
31
|
+
**4. Language preferences: asked once, remembered for good.** One dropdown each for replies, code comments, and documentation, with a scope of global or per project (`.switchman/lang.json`). Leaving them unset is fine — the first time it matters, you are asked once in your DSH UI's language, the answer is remembered, and every session afterwards follows it automatically.
|
|
32
|
+
|
|
33
|
+
**5. Tiered verification: every change gets checked.** Changes over 20 lines go to a tester; over 300 lines, or anything touching core / security / data-consistency logic, also gets an independent reviewer pass. The reviewer's model is chosen to avoid the model used by "the agent that wrote the diff" — as far as the pools allow; when they truly cannot, the conclusion declares DOWNGRADED. Say "don't use teams" once and it instantly drops back to solo.
|
|
34
|
+
|
|
35
|
+
**6. `/vision`: text-only models can still work with images.** When your primary model cannot read images, DSH refuses image-bearing messages right at the gate. Attach the image, type `/vision what's wrong with this image`, and the image is resolved to a file path and handed to a vision-pool model to read, with the findings returned to the current session. A hint appears above the composer early on — "the current model can't read images"; when a plain image send is refused, the draft is rewritten once as `/vision` and resubmitted on its own, no manual redo; if no vision pool is configured, the command refuses with setup guidance.
|
|
36
|
+
|
|
37
|
+
Only one model? Still worth installing — water-level control and tiered verification do not care how many models you have, and long single-model sessions benefit all the same.
|
|
22
38
|
|
|
23
39
|
## Bundled skills
|
|
24
40
|
|
|
25
|
-
- **db-query** — read-only MySQL/Redis verification: run SQL to
|
|
26
|
-
- **git-commit-message** — convention-compliant commit text. Text only; never
|
|
27
|
-
- **requirement-docs** — one spec for requirements / PRD / design
|
|
41
|
+
- **db-query** — read-only MySQL / Redis verification: run SQL to reconcile records, check cache keys / TTLs, and audit cross-store consistency; refuses all writes. One-time setup below.
|
|
42
|
+
- **git-commit-message** — generates convention-compliant commit text. Text only; it never runs git for you.
|
|
43
|
+
- **requirement-docs** — one spec for requirements analysis / PRD / design documents, with output archived to `docs/requirements-and-design/`.
|
|
28
44
|
|
|
29
45
|
## Quick start
|
|
30
46
|
|
|
@@ -40,23 +56,38 @@ Only one model? Still worth it — water-level control and the doctrine don't ca
|
|
|
40
56
|
plugin_manager: install_bundle target=/path/to/dsh-switchman
|
|
41
57
|
```
|
|
42
58
|
|
|
59
|
+
or from a terminal via the `dsh` CLI — pick the profile that matches how you run DSH:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
dsh plugin --profile web add dsh-switchman # Web GUI
|
|
63
|
+
dsh plugin --profile desktop add dsh-switchman # desktop app
|
|
64
|
+
```
|
|
65
|
+
|
|
43
66
|
2. **Restart DSH** — quit the app entirely and reopen (a page reload is not enough) so the client-module table picks up the bundle.
|
|
44
67
|
|
|
45
|
-
3. **
|
|
68
|
+
3. **Language preferences** — Settings → dsh-switchman, or "Switchman Control Center" in the home sidebar. The first screen sets the scope: global (this profile) or per project (each project's `.switchman/lang.json`); then three dropdowns set the reply / comment / doc languages, each with a live "current: …" line underneath. Skipping is fine — you will be asked once on first use and remembered (the question is asked in your DSH UI language).
|
|
69
|
+
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
4. **Fill the dispatch pools** — each pool card lists candidate models grouped by provider; tick the ones you want. Tick "manual order" and the card becomes a numbered priority list you reorder with ↑ ↓ ×; next to each route you can also pin a reasoning effort (it defaults to "follow lane"; pinning it lists the levels that model actually supports). A summary line at the top tracks progress live, e.g. "6/6 pools set · 2 ranked · advice mode".
|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+
The vision and review pools live below; further down sit **capability ranking** (the union of the models selected across the six pools — the index is the capability order, strongest first, with optional S/A/B/C tiers) and **execution mode** (advice / enforce).
|
|
46
77
|
|
|
47
|
-

|
|
48
79
|
|
|
49
|
-
|
|
80
|
+
5. **Agent teams** — both toggles are off by default; start with plain subagent dispatch. To let the model pull teams in on its own, turn on "agent teams mode"; to skip authorizing the same routes twice, turn on "subagent model whitelist sync" — a "synced N routes + time" status line under the toggle confirms what was written.
|
|
50
81
|
|
|
51
|
-

|
|
52
83
|
|
|
53
|
-
|
|
84
|
+
6. **Context water level** — the three thresholds (defaults 50000 / 90000 / 130000), the per-read budget, hard-mode behavior (throttled pass / block), the auto-handover toggle, and the subagent-specific cap all live in this section. The bottom line carries the commands: `/ctx-pause` to pause intervening · `/ctx-resume` to resume · `/ctx-handover` to back up and hand over now (it steers the session to an idle boundary and waits out the compaction retry window, so the result can take a few minutes).
|
|
54
85
|
|
|
55
|
-

|
|
56
87
|
|
|
57
|
-
|
|
88
|
+
7. **Verify** — an ⚡ "autonomous team" badge appears in the session header (with a ◇ beside it showing the current session model); or simply ask the model "what is the heading of the last section of your system prompt" — the answer should mention the dsh-switchman doctrine.
|
|
58
89
|
|
|
59
|
-
**db-query one-time setup** (script dependencies
|
|
90
|
+
**db-query one-time setup** (script dependencies install inside the skill directory — your project stays clean):
|
|
60
91
|
|
|
61
92
|
```bash
|
|
62
93
|
bash <install-dir>/skills/db-query/scripts/setup.sh
|
|
@@ -64,15 +95,16 @@ bash <install-dir>/skills/db-query/scripts/setup.sh
|
|
|
64
95
|
|
|
65
96
|
## How it works
|
|
66
97
|
|
|
67
|
-
- The Host half (`index.js` + `host/`) injects
|
|
68
|
-
- The Client half (`client.js`) renders the ⚡ badge
|
|
69
|
-
-
|
|
98
|
+
- The Host half (`index.js` + `host/`) injects the dynamic system-prompt sections (language / lanes / water level / teams), the read-budget and enforce gates, and four slash commands (the ctx trio + `/vision`). Save a setting and it applies to the next prompt assembly — no restart needed.
|
|
99
|
+
- The Client half (`client.js`) renders the settings page, the ⚡ badge and ◇ model chip in the session header, and the live handover-in-progress banner, through official settings-form services.
|
|
100
|
+
- The "Switchman Control Center" entry in the home sidebar opens the same configuration page (language preferences, dispatch pools & ranking, water level) as a central panel with one click; the original settings entry stays.
|
|
101
|
+
- `cordis.patch.yml` keeps the shipped preset plugin list verbatim and extends only the persona suffix; the Agent Teams tools themselves come from the shipped bundle and are enabled automatically when teams mode is turned on.
|
|
70
102
|
|
|
71
103
|
## Maintenance
|
|
72
104
|
|
|
73
105
|
- After a DSH upgrade that changes shipped preset plugin lists, re-sync `cordis.patch.yml` from the new `presets/*.patch.yml` (keep the doctrine suffix), then reinstall.
|
|
74
|
-
-
|
|
75
|
-
- `npm pack --dry-run` must stay at the audited
|
|
106
|
+
- Protocol lines (`[SWITCHMAN:LANG|POOLS|WATERMARK|TEAMS]`) are deliberately English and byte-stable — do not localize them.
|
|
107
|
+
- `npm pack --dry-run` must stay at the audited 50 files / ~205 kB shape (`docs/` screenshots never ship).
|
|
76
108
|
|
|
77
109
|
## License
|
|
78
110
|
|
package/README.pt.md
CHANGED
|
@@ -6,19 +6,35 @@
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
> Contexto no medidor
|
|
9
|
+
> Contexto no medidor: cada tarefa encontra sozinha a faixa certa.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Por que você precisa disso
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Se você trabalha com o DSH, com o tempo esbarra em duas coisas:
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
1. **A sessão fica cada vez mais pesada.** O histórico empurra o contexto para centenas de milhares de tokens: o modelo começa a esquecer, fica lento e caro, e no fim não sobra opção além do /compact manual — que compacta e perde detalhes no processo.
|
|
16
|
+
2. **O modelo principal faz tudo sozinho.** Consultar um arquivo, rodar um teste, conferir dados: é sempre ele que mastiga tudo — lento e caro, sendo que a maior parte desse trabalho caberia a um modelo barato.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
dsh-switchman é um plugin para o [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH). Depois de instalado, o modelo principal deixa de “fazer tudo sozinho” e vira um dispatcher: mede o nível de água, escolhe a faixa, entrega as tarefas, confere o resultado. Não é um modelo novo: é um regulamento de despacho plugado ao DSH mais uma interface de configuração. Em concreto, ele faz seis coisas:
|
|
18
19
|
|
|
19
|
-
**
|
|
20
|
+
**1. Nível de água do contexto: sessões longas não estouram.** A cada turno ele conta os tokens da sessão em tempo real, e três limiares apertam em degraus: 50k (soft, ajustável) lembra que “é hora de delegar”; 90k (hard) aperta o orçamento de leitura por chamada e empurra para encerrar; 130k (force) dispara o handover automático — fork da sessão como cópia de segurança, contexto compactado, continuação despertada: a tarefa não cai no meio. Nem os subagents em segundo plano que ainda estiverem rodando no momento da entrega se perdem: id, descrição da tarefa e caminho do relatório vão para o documento de handover, e a sessão retomada sabe onde coletar os relatórios em vez de despachar o mesmo trabalho de novo. Cada subagent enviado carrega um teto próprio e independente e, ao atingi-lo, sai depois de escrever o resumo HANDOFF.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
**2. Seis pools de despacho: a cada trabalho, o seu modelo.** Pool leve (economy, trabalho pequeno em lote), pool mecânico (mechanical, reescritas de molde), pool principal (main, codificação do dia a dia), pool difícil (hard, raciocínio pesado e refatoração em grande escala), pool multimodal (vision, leitura de imagens), pool de revisão (review, verificação independente). Na página de configurações você marca os candidatos, ordena as prioridades (com níveis opcionais S/A/B/C) e fixa um reasoning effort por rota — o dropdown lista os níveis que aquele modelo realmente suporta, não três níveis genéricos. A cada turno, o prompt do modelo principal carrega uma tabela de recomendações `[SWITCHMAN:POOLS]`: o trabalho é despachado seguindo a tabela. O modo de execução tem três estados: off / advice / enforce (enforce = modelos fora do pool são recusados na hora).
|
|
23
|
+
|
|
24
|
+
**3. Modo Agent Teams: do trabalho solo para comandar uma equipe.** Desligado por padrão: recém-instalado, o trabalho corre no despacho leve via subagent. Na página de configurações, duas chaves independentes:
|
|
25
|
+
|
|
26
|
+
- **Modo Agent Teams** — ao ligar, injeta a doutrina de equipe (delegar por padrão + verificação em níveis + disciplina do quadro de tarefas compartilhado) e habilita automaticamente os Agent Teams do DSH: o modelo principal pode recrutar colegas permanentes (`spawn_teammate`), despachar trabalho para o quadro compartilhado (`team_task_*`) e trocar mensagens com eles (`send_message`). Há uma disciplina clara sobre quando formar a equipe: subtarefas independentes paralelizáveis, trabalho volumoso e autossuficiente, nível de água do contexto principal já alto, necessidade de separar papéis; investigações pontuais de uma vez só continuam pelo subagent. A política de fábrica do DSH é “sem equipe se o usuário não pedir”: aqui ela se inverte para “use quando fizer sentido”. Desligando a chave de novo, as cláusulas de equipe somem sem resíduo, e as ferramentas de equipe nas sessões em andamento não são recolhidas.
|
|
27
|
+
- **Sincronização da whitelist de modelos de subagent** — o DSH tem uma whitelist de autorização “Permitir que os agents escolham modelos para os subagents”: rotas escolhidas nos pools mas não autorizadas são recusadas quando o modelo principal as nomeia explicitamente (no modo equipe, a tabela de recomendações e a página de configurações marcam essas rotas com ⚠). Com esta chave ligada, a união dos seis pools é gravada de uma vez nessa whitelist — sem configurar dos dois lados: o switchman é a única fonte da verdade, e o caminho de despacho via fork entra junto. A whitelist vale como snapshot por “nova sessão”: a sincronização só alcança as sessões abertas depois.
|
|
28
|
+
|
|
29
|
+
O cabeçalho da sessão dá um retorno imediato: badge ⚡ “Equipe autônoma”, ◇ modelo em uso na sessão atual; durante um handover automático aparece um aviso em tempo real do tipo “Handover em andamento · backup da sessão / compactação do contexto / despertar da continuação”.
|
|
30
|
+
|
|
31
|
+
**4. Preferências de idioma: pergunta uma vez, lembra para sempre.** Um dropdown para cada um dos três idiomas — respostas, comentários de código, documentos — com escopo à escolha: global ou por projeto (`.switchman/lang.json`). Pode deixar em branco: no primeiro uso perguntam uma vez, no idioma da interface do DSH, e daí em diante toda sessão segue sozinha.
|
|
32
|
+
|
|
33
|
+
**5. Verificação em níveis: mudou, testa.** Alterações acima de 20 linhas vão para um tester validar; acima de 300 linhas, ou quando tocam lógica central / segurança / consistência de dados, entra também um reviewer com revisão independente. O modelo do reviewer é escolhido ancorando no modelo do “agent que escreveu o diff”, evitando-o sempre que possível; se no pool não dá para evitá-lo, a conclusão declara DOWNGRADED. Basta dizer “não use equipes” e ele volta na hora a trabalhar sozinho.
|
|
34
|
+
|
|
35
|
+
**6. `/vision`: até modelo somente texto lida com imagens.** Quando o modelo principal não sabe ler imagens, o DSH recusa na entrada as mensagens que as trazem. Você anexa a imagem e digita `/vision onde está o erro nesta imagem`: a imagem é resolvida em um caminho de arquivo e entregue à leitura de um modelo do pool multimodal, e a conclusão volta para a sessão atual. Acima da caixa de entrada aparece antes o aviso “o modelo atual não suporta leitura de imagens”; se um envio direto da imagem for recusado, a mensagem é reescrita uma vez para `/vision` e reenviada sozinha, sem precisar refazer à mão; sem pool multimodal configurado, o comando recusa e indica como configurar.
|
|
36
|
+
|
|
37
|
+
Só um modelo? Ainda vale a pena instalar — o controle do nível de água e a verificação em níveis não ligam para quantos modelos você tem, e sessões longas de modelo único se beneficiam do mesmo jeito.
|
|
22
38
|
|
|
23
39
|
## Skills embutidas
|
|
24
40
|
|
|
@@ -40,23 +56,38 @@ Só um modelo? Ainda vale a pena — o controle de nível de água e a doutrina
|
|
|
40
56
|
plugin_manager: install_bundle target=/path/to/dsh-switchman
|
|
41
57
|
```
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
ou pelo terminal via CLI `dsh` — escolha o perfil que corresponde a como você executa o DSH:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
dsh plugin --profile web add dsh-switchman # Web GUI
|
|
63
|
+
dsh plugin --profile desktop add dsh-switchman # app desktop
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. **Reinicie o DSH** — feche o app por completo e reabra (recarregar a página não basta), para que a tabela de módulos do cliente reconheça o bundle.
|
|
67
|
+
|
|
68
|
+
3. **Preferências de idioma** — Settings → dsh-switchman, ou a entrada “Switchman Control Center” na barra lateral da página inicial. Na primeira tela escolhe-se primeiro o escopo: global (este perfil) ou por projeto (o `.switchman/lang.json` de cada projeto); depois, três dropdowns definem respectivamente o idioma de respostas / comentários / documentos, cada um com uma linha de status “Atual: …” embaixo. Pode pular: no primeiro uso perguntam uma vez e fica guardado (a pergunta segue o idioma da interface do DSH).
|
|
69
|
+
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
4. **Configure os pools de despacho** — em cada card de pool você marca os modelos candidatos agrupados por provider; ao marcar “ordem manual” o card vira uma lista de prioridade numerada, reordenável com ↑ ↓ ×, e ao lado de cada rota dá para fixar o reasoning effort (padrão “seguir a faixa”; ao fixar, ele lista as faixas que aquele modelo realmente suporta). A linha de resumo no topo acompanha o progresso em tempo real, por exemplo “6/6 pools configurados · 2 no ranking · modo advice”.
|
|
73
|
+
|
|
74
|
+

|
|
44
75
|
|
|
45
|
-
|
|
76
|
+
O pool multimodal e o de revisão ficam mais abaixo; ainda mais abaixo vêm o **ranking de capacidade** (a união dos modelos escolhidos nos seis pools: a numeração é a ordem de capacidade, os mais fortes primeiro, com níveis opcionais S/A/B/C) e o **modo de execução** (advice / enforce).
|
|
46
77
|
|
|
47
|
-

|
|
48
79
|
|
|
49
|
-
|
|
80
|
+
5. **Agent Teams** — as duas chaves começam desligadas: rode primeiro no modo puro de subagent. Para deixar que ele recrute a equipe sozinho, ligue “Modo Agent Teams”; para poupar a autorização duplicada dos dois lados, ligue “Sincronização da whitelist de modelos de subagent” — abaixo da chave, uma linha de status do tipo “N registros sincronizados + horário” confirma o resultado da gravação.
|
|
50
81
|
|
|
51
|
-

|
|
52
83
|
|
|
53
|
-
|
|
84
|
+
6. **Nível de água do contexto** — os três limiares (padrão 50000 / 90000 / 130000), o orçamento de leitura por chamada, o comportamento do limiar hard (deixa passar com limitação / bloqueia), a chave do handover automático e o teto independente dos subagents ficam todos nesta área. Uma linha de comandos embaixo: `/ctx-pause` pausa as intervenções · `/ctx-resume` retoma · `/ctx-handover` faz backup e entrega na hora (ele conduz a sessão até o limite de inatividade e espera a janela de nova tentativa da compactação: o resultado pode levar alguns minutos).
|
|
54
85
|
|
|
55
|
-

|
|
56
87
|
|
|
57
|
-
|
|
88
|
+
7. **Verifique** — no cabeçalho da sessão aparece o badge ⚡ “Equipe autônoma” (ao lado, o ◇ mostra o modelo da sessão atual); ou pergunte direto ao modelo “qual é o título da última seção do seu system prompt?” — a resposta deve mencionar a doutrina dsh-switchman.
|
|
58
89
|
|
|
59
|
-
**Configuração única do db-query** (as dependências dos scripts vivem dentro do diretório da skill):
|
|
90
|
+
**Configuração única do db-query** (as dependências dos scripts vivem dentro do diretório da skill, sem sujar o projeto):
|
|
60
91
|
|
|
61
92
|
```bash
|
|
62
93
|
bash <install-dir>/skills/db-query/scripts/setup.sh
|
|
@@ -64,15 +95,16 @@ bash <install-dir>/skills/db-query/scripts/setup.sh
|
|
|
64
95
|
|
|
65
96
|
## Como funciona
|
|
66
97
|
|
|
67
|
-
- A metade Host (`index.js` + `host/`) injeta
|
|
68
|
-
- A metade Client (`client.js`) renderiza o badge ⚡
|
|
69
|
-
-
|
|
98
|
+
- A metade Host (`index.js` + `host/`) injeta as seções dinâmicas do system prompt (idiomas / faixas / nível de água / equipe), a dupla trava de orçamento de leitura + enforce e os quatro comandos slash (o trio ctx mais `/vision`). Toda configuração salva já vale na montagem do prompt seguinte, sem reinício.
|
|
99
|
+
- A metade Client (`client.js`) renderiza a página de configurações, o badge ⚡ e o identificador ◇ do modelo no cabeçalho da sessão e o aviso dinâmico durante o handover, pelos serviços oficiais de settings-form.
|
|
100
|
+
- A entrada “Switchman Control Center” na barra lateral da página inicial abre com um clique a mesma página de configuração (preferências de idioma, pools de despacho e ranking, nível de água) como painel central; a entrada nas configurações permanece.
|
|
101
|
+
- `cordis.patch.yml` conserva integralmente a lista de plugins dos presets de fábrica e intervém só no persona suffix; as ferramentas Agent Teams em si vêm do bundle de fábrica e são habilitadas automaticamente ao ligar o modo equipe.
|
|
70
102
|
|
|
71
103
|
## Manutenção
|
|
72
104
|
|
|
73
|
-
- Depois de um upgrade do DSH que mude
|
|
74
|
-
- As linhas de protocolo
|
|
75
|
-
- `npm pack --dry-run` deve continuar na forma auditada de
|
|
105
|
+
- Depois de um upgrade do DSH que mude a lista de plugins dos presets de fábrica, ressincronize `cordis.patch.yml` a partir dos novos `presets/*.patch.yml` (mantenha o doctrine suffix) e reinstale.
|
|
106
|
+
- As linhas de protocolo (`[SWITCHMAN:LANG|POOLS|WATERMARK|TEAMS]`) ficam deliberadamente em inglês e estáveis a byte — não as localize.
|
|
107
|
+
- `npm pack --dry-run` deve continuar na forma auditada de 50 arquivos / ~205 kB (os screenshots de `docs/` não vão no pacote).
|
|
76
108
|
|
|
77
109
|
## License
|
|
78
110
|
|
package/README.ru.md
CHANGED
|
@@ -2,61 +2,92 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-TW.md) | [日本語](./README.ja.md) | [한국어](./README.ko.md) | [Español](./README.es.md) | [Français](./README.fr.md) | [Deutsch](./README.de.md) | [Italiano](./README.it.md) | [Português](./README.pt.md) | **Русский**
|
|
4
4
|
|
|
5
|
-
> **Семейство switchman**, один автор, одна
|
|
5
|
+
> **Семейство switchman**, один автор, одна и та же философия диспетчеризации: [opencode-switchman](https://github.com/mrzturn/opencode-switchman) (оригинал для OpenCode) · [zcode-switchman](https://github.com/mrzturn/zcode-switchman) (порт для ZCode) · **dsh-switchman** (этот репозиторий, версия для DeepSeek Harness).
|
|
6
6
|
|
|
7
|
-

|
|
8
8
|
|
|
9
|
-
> Контекст под счётчиком. Задачи
|
|
9
|
+
> Контекст под счётчиком. Задачи сами находят свою полосу.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Зачем это нужно
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Если работать в DSH подольше, рано или поздно упираешься в две вещи:
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
1. **Сессия тяжелеет с каждым сообщением.** История раздувает контекст до сотен тысяч токенов — модель начинает забывать, тормозить и дорожать; в конце концов остаётся ручной /compact, а каждое сжатие ещё и теряет детали.
|
|
16
|
+
2. **Главная модель всё делает сама.** Прочитать файл, прогнать тест, сверить данные — всё она грызёт сама: медленно и дорого, хотя большая часть этой работы по праву досталась бы дешёвой модели.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
dsh-switchman — плагин для [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH). После установки главная модель перестаёт «делать всё сама» и становится диспетчером: замеряет уровень воды, выбирает полосу, раздаёт задачи, принимает работу. Это не новая модель, а свод правил диспетчеризации, пристёгнутый к DSH, плюс страница настроек. Конкретно он делает шесть вещей:
|
|
18
19
|
|
|
19
|
-
**
|
|
20
|
+
**1. Уровень воды в контексте: длинная сессия не переполняется.** Каждый ход подсчитывает токены сессии в реальном времени, и три линии уровня ужесточаются по нарастающей: 50k (soft, настраивается) подсказывает «пора делегировать»; 90k (hard) урезает бюджет разового чтения файла и подталкивает к завершению; 130k (force) запускает автоматическую передачу — форкает копию сессии в архив, сжимает контекст и будит продолжение, работа не обрывается. Фоновые субагенты, которые ещё бегут в момент передачи, тоже не теряются: id, описания задач и пути к отчётам записываются в документ передачи, и продолжившаяся сессия знает, куда идти за отчётами, а не раздаёт работу заново. У каждого отправленного субагента свой жёсткий потолок: доработав до него, он завершается резюме HANDOFF.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
**2. Шесть пулов диспетчеризации: под каждую работу — своя модель.** Лёгкий пул (economy — мелкие массовые задачи), механический (mechanical — шаблонные переработки), основной (main — повседневный кодинг), пул высокой сложности (hard — тяжёлые рассуждения и крупные рефакторинги), мультимодальный (vision — чтение картинок), пул ревью (review — независимая проверка). На странице настроек отмечаете кандидатов, расставляете приоритеты (можно с привязкой к ступеням S/A/B/C) и для каждого маршрута отдельно фиксируете reasoning effort — выпадающий список ступеней берётся из уровней, которые модель реально поддерживает, а не из трёх универсальных. Каждый ход промпт главной модели несёт с собой таблицу рекомендаций `[SWITCHMAN:POOLS]`, и работа раздаётся по ней. У режима исполнения три состояния: off / advice / enforce (enforce = модель вне пула просто отклоняется).
|
|
23
|
+
|
|
24
|
+
**3. Режим Agent Teams: от работы в одиночку — к своей команде.** По умолчанию выключен: сразу после установки это просто лёгкая диспетчеризация через subagent. На странице настроек два независимых переключателя:
|
|
25
|
+
|
|
26
|
+
- **Режим команды агентов** — при включении внедряет командный регламент (делегирование по умолчанию + многоуровневая проверка + дисциплина общей доски задач) и автоматически включает Agent Teams в DSH: главная модель может нанимать постоянных товарищей по команде (`spawn_teammate`), ставить им задачи на общей доске (`team_task_*`) и обмениваться с ними сообщениями (`send_message`). Когда заводить команду, решает чёткая дисциплина: параллельные независимые подзадачи, объёмная самодостаточная работа, уже высокий уровень воды в главном контексте, потребность разделить роли; разовая точечная разведка по-прежнему идёт через subagent. Заводская политика DSH — «пока пользователь прямо не попросил, команду не создавать»; здесь она перевёрнута в «когда нужно — создавай». Если выключить переключатель обратно, от командных пунктов не останется и следа, а инструменты команды из уже работающих сессий не изымаются.
|
|
27
|
+
- **Синхронизация белого списка моделей субагентов** — в DSH есть белый список авторизации «разрешить агентам выбирать модели для субагентов»: если маршрут выбран в пуле, но не авторизован, явное назначение его главной моделью будет отклонено (в командном режиме и таблица рекомендаций, и страница настроек помечают такие маршруты ⚠). Включите этот переключатель — и объединение шести пулов целиком запишется в белый список: настраивать дважды не нужно, switchman остаётся единственным источником истины, и путь dispatch через fork тоже охвачен. Белый список применяется по снимку «новая сессия»: синхронизация действует только на сессии, открытые после неё.
|
|
28
|
+
|
|
29
|
+
В шапке сессии — наглядная обратная связь: значок ⚡ «автономная команда», ◇ с фактической моделью текущей сессии; когда идёт автоматическая передача, появляется живая подсказка «идёт передача · резервная сессия / сжатие контекста / пробуждение продолжения».
|
|
30
|
+
|
|
31
|
+
**4. Языковые предпочтения: спросит один раз — запомнит навсегда.** Три выпадающих списка: язык ответов, комментариев в коде и документов; область действия — глобальная или по проекту (`.switchman/lang.json`). Настраивать не обязательно: при первом использовании спросят один раз — на языке интерфейса вашего DSH — и запомнят; дальше каждая сессия соблюдает выбор автоматически.
|
|
32
|
+
|
|
33
|
+
**5. Многоуровневая проверка: изменено — проверено.** Изменения больше 20 строк уходят тестировщику на проверку; изменения больше 300 строк или затрагивающие ядро / безопасность / согласованность данных — дополнительно независимому ревьюеру. Модель ревьюера подбирают, привязываясь к модели агента, написавшего этот diff, и стараются её обойти; если пул другого выхода не оставляет, в заключении прямо заявляется DOWNGRADED. Скажете «не использовать команду» — всё мгновенно вернётся к одиночной работе.
|
|
34
|
+
|
|
35
|
+
**6. `/vision`: картинки по зубам даже чисто текстовой модели.** Когда главная модель не читает изображения, DSH прямо на входе отклоняет сообщения с картинками. Прикрепите картинку и введите `/vision что не так на этой картинке` — изображение будет сведено к пути файла и отдано на чтение модели из мультимодального пула, а вывод вернётся в текущую сессию. Над полем ввода заранее подсказывают: «текущая модель не умеет читать изображения»; если прямая отправка картинки отклонена, она один раз автоматически переоформляется в `/vision` и уходит повторно — вручную ничего переписывать не нужно; если мультимодальный пул не настроен, команда откажется и подскажет, что настроить.
|
|
36
|
+
|
|
37
|
+
Всего одна модель? Всё равно стоит поставить — контроль уровня воды и многоуровневая проверка от числа моделей не зависят, и длинная сессия на одной модели выигрывает от них ничуть не меньше.
|
|
22
38
|
|
|
23
39
|
## Встроенные навыки
|
|
24
40
|
|
|
25
|
-
- **db-query** — верификация MySQL/Redis только на чтение:
|
|
26
|
-
- **git-commit-message** —
|
|
27
|
-
- **requirement-docs** — единая спецификация для требований / PRD /
|
|
41
|
+
- **db-query** — верификация MySQL / Redis только на чтение: выполнить SQL для сверки данных, проверить ключи кэша / TTL и согласованность между хранилищами; любую запись отклоняет. При первом использовании нужна инициализация (см. ниже).
|
|
42
|
+
- **git-commit-message** — генерирует выдержанный в конвенциях текст коммита: только текст, git за вас не трогает.
|
|
43
|
+
- **requirement-docs** — единая спецификация для анализа требований / PRD / проектных документов; результаты архивируются в `docs/requirements-and-design/`.
|
|
28
44
|
|
|
29
45
|
## Быстрый старт
|
|
30
46
|
|
|
31
|
-
1. **Установите** —
|
|
47
|
+
1. **Установите** — попросите agent выполнить установку в любой сессии, или откройте веб-страницу управления плагинами:
|
|
32
48
|
|
|
33
49
|
```
|
|
34
50
|
plugin_manager: install_bundle target=dsh-switchman
|
|
35
51
|
```
|
|
36
52
|
|
|
37
|
-
или из локального checkout'а (
|
|
53
|
+
или установите из локального checkout'а (режим link; после обновления нужно переустановить: `remove_bundle` + `install_bundle`):
|
|
38
54
|
|
|
39
55
|
```
|
|
40
56
|
plugin_manager: install_bundle target=/path/to/dsh-switchman
|
|
41
57
|
```
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
или установите из терминала командой `dsh` — профиль выбирайте по способу запуска:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
dsh plugin --profile web add dsh-switchman # Web GUI
|
|
63
|
+
dsh plugin --profile desktop add dsh-switchman # десктоп-приложение
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. **Перезапустите DSH** — полностью закройте приложение и откройте снова (перезагрузка страницы не считается) — только тогда таблица клиентских модулей распознает этот bundle.
|
|
67
|
+
|
|
68
|
+
3. **Языковые предпочтения** — Настройки → dsh-switchman, или пункт «Диспетчерская Switchman» в боковой панели главной страницы. На первом экране сначала выбирается область действия: глобально (этот profile) или по проектам (`.switchman/lang.json` каждого проекта); затем тремя выпадающими списками задаются языки ответов / комментариев / документов, под каждым — строка состояния «сейчас: …». Пропустить не страшно: при первом использовании спросят один раз и запомнят (вопрос зададут на языке интерфейса DSH).
|
|
69
|
+
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
4. **Настройте пулы диспетчеризации** — на каждой карточке пула отмечайте модели-кандидаты, сгруппированные по поставщикам; отметьте «ручной порядок» — и карточка превратится в нумерованный список приоритетов, порядок меняется кнопками ↑ ↓ ×, а рядом с каждым маршрутом можно зафиксировать reasoning effort (по умолчанию «следовать полосе», после фиксации в списке — ступени, которые эта модель реально поддерживает). Сводная строка сверху отражает прогресс в реальном времени, например: «пулов настроено: 6/6 · позиций в рейтинге: 2 · режим advice».
|
|
73
|
+
|
|
74
|
+

|
|
44
75
|
|
|
45
|
-
|
|
76
|
+
Мультимодальный пул и пул ревью — ниже; ещё ниже — **рейтинг по способностям** (объединение моделей, выбранных в шести пулах; номер в списке и есть место по способности, сильнейшие впереди, с возможной привязкой к ступеням S/A/B/C) и **режим исполнения** (advice / enforce).
|
|
46
77
|
|
|
47
|
-

|
|
48
79
|
|
|
49
|
-
|
|
80
|
+
5. **Команда агентов** — оба переключателя по умолчанию выключены: сначала поработайте в чистом режиме subagent. Хотите, чтобы команда собиралась сама, — включите «режим команды агентов»; хотите избавиться от двойной настройки авторизации, — включите «синхронизацию белого списка моделей субагентов»: под переключателем есть строка состояния «синхронизировано N записей + время», подтверждающая результат записи.
|
|
50
81
|
|
|
51
|
-

|
|
52
83
|
|
|
53
|
-
|
|
84
|
+
6. **Уровень воды в контексте** — три порога (по умолчанию 50000 / 90000 / 130000), бюджет разового чтения, поведение жёсткого порога (пропустить с ограничением / заблокировать), переключатель автоматической передачи и отдельный потолок для субагентов — всё в этом разделе. Внизу строка команд: `/ctx-pause` приостановить вмешательство · `/ctx-resume` возобновить · `/ctx-handover` сделать резервную копию и передать управление прямо сейчас (команда подводит сессию к границе простоя и ждёт окно повторной попытки компакции, результат может занять несколько минут).
|
|
54
85
|
|
|
55
|
-

|
|
56
87
|
|
|
57
|
-
|
|
88
|
+
7. **Проверьте** — в шапке сессии появился значок ⚡ «автономная команда» (рядом ◇ показывает модель текущей сессии); либо спросите модель напрямую: «как называется последний раздел твоего системного промпта?» — в ответе должен прозвучать регламент dsh-switchman.
|
|
58
89
|
|
|
59
|
-
|
|
90
|
+
**Инициализация db-query при первом использовании** (зависимости скриптов ставятся внутрь каталога навыка и не засоряют проект):
|
|
60
91
|
|
|
61
92
|
```bash
|
|
62
93
|
bash <install-dir>/skills/db-query/scripts/setup.sh
|
|
@@ -64,15 +95,16 @@ bash <install-dir>/skills/db-query/scripts/setup.sh
|
|
|
64
95
|
|
|
65
96
|
## Как это работает
|
|
66
97
|
|
|
67
|
-
- Host-половина (`index.js` + `host/`) внедряет
|
|
68
|
-
- Client-половина (`client.js`) отрисовывает значок ⚡
|
|
69
|
-
-
|
|
98
|
+
- Host-половина (`index.js` + `host/`) внедряет динамические секции системного промпта (язык / полосы / уровень воды / команда), двойной шлюз бюджета чтения и enforce и четыре слэш-команды (ctx-тройка + `/vision`). Все настройки после сохранения вступают в силу при следующей сборке промпта — без перезапуска.
|
|
99
|
+
- Client-половина (`client.js`) отрисовывает страницу настроек, значок ⚡ и метку модели ◇ в шапке сессии, живую подсказку во время передачи управления — всё через официальные сервисы settings-form.
|
|
100
|
+
- Пункт «Диспетчерская Switchman» в боковой панели главной страницы: один клик открывает ту же страницу настроек (языковые предпочтения, пулы и рейтинг, уровень воды) в виде центральной панели; прежний вход в настройки остаётся на месте.
|
|
101
|
+
- `cordis.patch.yml` целиком сохраняет список плагинов заводских пресетов и расширяет только persona suffix; сами инструменты Agent Teams приходят из заводского bundle и автоматически включаются вместе с командным режимом.
|
|
70
102
|
|
|
71
103
|
## Обслуживание
|
|
72
104
|
|
|
73
|
-
-
|
|
74
|
-
- Строки
|
|
75
|
-
- `npm pack --dry-run` должен
|
|
105
|
+
- Если после обновления DSH изменился список плагинов заводских пресетов, пересинхронизируйте `cordis.patch.yml` из новых `presets/*.patch.yml` (сохранив doctrine suffix) и переустановите.
|
|
106
|
+
- Строки протокола (`[SWITCHMAN:LANG|POOLS|WATERMARK|TEAMS]`) намеренно оставлены на английском и стабильны побайтово — не локализуйте их.
|
|
107
|
+
- `npm pack --dry-run` должен сохранять аудированную форму: 50 файла / ~205 kB (скриншоты из `docs/` в пакет не входят).
|
|
76
108
|
|
|
77
109
|
## License
|
|
78
110
|
|