@eddyskywalker/dsh-chatgpt-subscription 0.99.1 → 1.0.1

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.
Files changed (179) hide show
  1. package/README.md +2 -1
  2. package/lib/client.js +1565 -581
  3. package/lib/client.js.map +1 -1
  4. package/lib/codemode.js +107 -3
  5. package/lib/index.js +3409 -932
  6. package/lib/{preset-sync-CF9xlG1l.js → preset-sync-DWOAwSyl.js} +5 -4
  7. package/lib/reverse-board.js +1726 -0
  8. package/lib/{tool-result-pruner-Ds--y6hJ.js → tool-result-pruner-ClgRVOph.js} +4 -3
  9. package/lib/tool-result-pruner.js +1 -1
  10. package/lib/types/client/common/ModelChecklist.d.ts +3 -3
  11. package/lib/types/client/common/ModelChecklist.d.ts.map +1 -1
  12. package/lib/types/client/common/format.d.ts +10 -0
  13. package/lib/types/client/common/format.d.ts.map +1 -1
  14. package/lib/types/client/features/progress-updates/locales.d.ts +11 -5
  15. package/lib/types/client/features/progress-updates/locales.d.ts.map +1 -1
  16. package/lib/types/client/features/progress-updates/settings-binding.d.ts +3 -1
  17. package/lib/types/client/features/progress-updates/settings-binding.d.ts.map +1 -1
  18. package/lib/types/client/features/progress-updates/settings-section.d.ts +2 -0
  19. package/lib/types/client/features/progress-updates/settings-section.d.ts.map +1 -1
  20. package/lib/types/client/hub/brand-icons.d.ts +1 -1
  21. package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
  22. package/lib/types/client/hub/providers.d.ts.map +1 -1
  23. package/lib/types/client/index.d.ts +2 -0
  24. package/lib/types/client/index.d.ts.map +1 -1
  25. package/lib/types/client/locales-ru/claude-api.d.ts.map +1 -1
  26. package/lib/types/client/locales-ru/claude.d.ts.map +1 -1
  27. package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
  28. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  29. package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
  30. package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
  31. package/lib/types/client/locales-ru/sub2api.d.ts +3 -0
  32. package/lib/types/client/locales-ru/sub2api.d.ts.map +1 -0
  33. package/lib/types/client/providers/claude/ClaudeSection.d.ts.map +1 -1
  34. package/lib/types/client/providers/claude/locales.d.ts +8 -2
  35. package/lib/types/client/providers/claude/locales.d.ts.map +1 -1
  36. package/lib/types/client/providers/claude/useClaudeSection.d.ts +1 -0
  37. package/lib/types/client/providers/claude/useClaudeSection.d.ts.map +1 -1
  38. package/lib/types/client/providers/claude-api/ClaudeApiSection.d.ts.map +1 -1
  39. package/lib/types/client/providers/claude-api/locales.d.ts +5 -1
  40. package/lib/types/client/providers/claude-api/locales.d.ts.map +1 -1
  41. package/lib/types/client/providers/claude-api/useClaudeApiSection.d.ts +1 -0
  42. package/lib/types/client/providers/claude-api/useClaudeApiSection.d.ts.map +1 -1
  43. package/lib/types/client/providers/codex-chatgpt/CodexSubscriptionSection.d.ts.map +1 -1
  44. package/lib/types/client/providers/codex-chatgpt/locales.d.ts +5 -3
  45. package/lib/types/client/providers/codex-chatgpt/locales.d.ts.map +1 -1
  46. package/lib/types/client/providers/codex-chatgpt/styles.d.ts.map +1 -1
  47. package/lib/types/client/providers/command-code/CommandCodeSection.d.ts.map +1 -1
  48. package/lib/types/client/providers/command-code/locales.d.ts +2 -2
  49. package/lib/types/client/providers/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -1
  50. package/lib/types/client/providers/kimi-code/KimiCodeSection.d.ts.map +1 -1
  51. package/lib/types/client/providers/kimi-code/locales.d.ts +8 -2
  52. package/lib/types/client/providers/kimi-code/locales.d.ts.map +1 -1
  53. package/lib/types/client/providers/minimax-code/MinimaxCodeSection.d.ts.map +1 -1
  54. package/lib/types/client/providers/opencode-zen/useZenSection.d.ts +1 -0
  55. package/lib/types/client/providers/opencode-zen/useZenSection.d.ts.map +1 -1
  56. package/lib/types/client/providers/relayone/locales.d.ts +12 -12
  57. package/lib/types/client/providers/step-code/StepCodeSection.d.ts.map +1 -1
  58. package/lib/types/client/providers/sub2api/Sub2ApiSection.d.ts +7 -0
  59. package/lib/types/client/providers/sub2api/Sub2ApiSection.d.ts.map +1 -0
  60. package/lib/types/client/providers/sub2api/locales.d.ts +212 -0
  61. package/lib/types/client/providers/sub2api/locales.d.ts.map +1 -0
  62. package/lib/types/client/providers/sub2api/styles.d.ts +3 -0
  63. package/lib/types/client/providers/sub2api/styles.d.ts.map +1 -0
  64. package/lib/types/compat.d.ts +1 -1
  65. package/lib/types/compat.d.ts.map +1 -1
  66. package/lib/types/entries/reverse-board.d.ts +6 -0
  67. package/lib/types/entries/reverse-board.d.ts.map +1 -0
  68. package/lib/types/entries/tool-result-pruner.d.ts.map +1 -1
  69. package/lib/types/host/common/i18n/zh.d.ts +1 -1
  70. package/lib/types/host/common/model-request-control.d.ts +1 -1
  71. package/lib/types/host/common/model-request-control.d.ts.map +1 -1
  72. package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
  73. package/lib/types/host/common/request-diagnostics.d.ts +1 -1
  74. package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
  75. package/lib/types/host/providers/claude/routes.d.ts.map +1 -1
  76. package/lib/types/host/providers/claude/token-store.d.ts +3 -0
  77. package/lib/types/host/providers/claude/token-store.d.ts.map +1 -1
  78. package/lib/types/host/providers/claude-api/routes.d.ts.map +1 -1
  79. package/lib/types/host/providers/claude-api/token-store.d.ts +3 -0
  80. package/lib/types/host/providers/claude-api/token-store.d.ts.map +1 -1
  81. package/lib/types/host/providers/kimi-code/cache-wait.d.ts +12 -0
  82. package/lib/types/host/providers/kimi-code/cache-wait.d.ts.map +1 -1
  83. package/lib/types/host/providers/kimi-code/routes.d.ts.map +1 -1
  84. package/lib/types/host/providers/kimi-code/token-store.d.ts +4 -0
  85. package/lib/types/host/providers/kimi-code/token-store.d.ts.map +1 -1
  86. package/lib/types/host/providers/relayone/types.d.ts +1 -1
  87. package/lib/types/host/providers/relayone/types.d.ts.map +1 -1
  88. package/lib/types/host/providers/sub2api/account-pool.d.ts +34 -0
  89. package/lib/types/host/providers/sub2api/account-pool.d.ts.map +1 -0
  90. package/lib/types/host/providers/sub2api/adapter.d.ts +59 -0
  91. package/lib/types/host/providers/sub2api/adapter.d.ts.map +1 -0
  92. package/lib/types/host/providers/sub2api/cache-stats.d.ts +19 -0
  93. package/lib/types/host/providers/sub2api/cache-stats.d.ts.map +1 -0
  94. package/lib/types/host/providers/sub2api/client.d.ts +6 -0
  95. package/lib/types/host/providers/sub2api/client.d.ts.map +1 -0
  96. package/lib/types/host/providers/sub2api/mapper-gemini.d.ts +10 -0
  97. package/lib/types/host/providers/sub2api/mapper-gemini.d.ts.map +1 -0
  98. package/lib/types/host/providers/sub2api/mapper-messages.d.ts +14 -0
  99. package/lib/types/host/providers/sub2api/mapper-messages.d.ts.map +1 -0
  100. package/lib/types/host/providers/sub2api/mapper-responses.d.ts +7 -0
  101. package/lib/types/host/providers/sub2api/mapper-responses.d.ts.map +1 -0
  102. package/lib/types/host/providers/sub2api/mapper.d.ts +34 -0
  103. package/lib/types/host/providers/sub2api/mapper.d.ts.map +1 -0
  104. package/lib/types/host/providers/sub2api/model-catalog.d.ts +72 -0
  105. package/lib/types/host/providers/sub2api/model-catalog.d.ts.map +1 -0
  106. package/lib/types/host/providers/sub2api/remote-compaction.d.ts +32 -0
  107. package/lib/types/host/providers/sub2api/remote-compaction.d.ts.map +1 -0
  108. package/lib/types/host/providers/sub2api/routes.d.ts +16 -0
  109. package/lib/types/host/providers/sub2api/routes.d.ts.map +1 -0
  110. package/lib/types/host/providers/sub2api/token-store.d.ts +43 -0
  111. package/lib/types/host/providers/sub2api/token-store.d.ts.map +1 -0
  112. package/lib/types/host/providers/sub2api/types.d.ts +14 -0
  113. package/lib/types/host/providers/sub2api/types.d.ts.map +1 -0
  114. package/lib/types/host/runtime/advisor/catalog-route.d.ts +20 -0
  115. package/lib/types/host/runtime/advisor/catalog-route.d.ts.map +1 -0
  116. package/lib/types/host/runtime/advisor/index.d.ts.map +1 -1
  117. package/lib/types/host/runtime/advisor/selection-store.d.ts +9 -1
  118. package/lib/types/host/runtime/advisor/selection-store.d.ts.map +1 -1
  119. package/lib/types/host/runtime/codemode/transport.d.ts +5 -0
  120. package/lib/types/host/runtime/codemode/transport.d.ts.map +1 -1
  121. package/lib/types/host/runtime/compact-after-turn/index.d.ts +15 -0
  122. package/lib/types/host/runtime/compact-after-turn/index.d.ts.map +1 -1
  123. package/lib/types/host/runtime/compaction-gate.d.ts +67 -0
  124. package/lib/types/host/runtime/compaction-gate.d.ts.map +1 -0
  125. package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts +8 -0
  126. package/lib/types/host/runtime/deepseek-v41-flash/state-anchor.d.ts.map +1 -1
  127. package/lib/types/host/runtime/guards/compaction-policy-guard.d.ts +1 -0
  128. package/lib/types/host/runtime/guards/compaction-policy-guard.d.ts.map +1 -1
  129. package/lib/types/host/runtime/guards/ptc-sdk-cache-guard.d.ts.map +1 -1
  130. package/lib/types/host/runtime/guards/timeline-cache-guard.d.ts.map +1 -1
  131. package/lib/types/host/runtime/open-models/profiles.d.ts.map +1 -1
  132. package/lib/types/host/runtime/open-models/state-anchor.d.ts.map +1 -1
  133. package/lib/types/host/runtime/presets/agent-preset.d.ts +10 -25
  134. package/lib/types/host/runtime/presets/agent-preset.d.ts.map +1 -1
  135. package/lib/types/host/runtime/presets/preset-sync.d.ts +2 -0
  136. package/lib/types/host/runtime/presets/preset-sync.d.ts.map +1 -1
  137. package/lib/types/host/runtime/presets/reverse-persona.d.ts +3 -0
  138. package/lib/types/host/runtime/presets/reverse-persona.d.ts.map +1 -0
  139. package/lib/types/host/runtime/reverse/frontier.d.ts +10 -0
  140. package/lib/types/host/runtime/reverse/frontier.d.ts.map +1 -0
  141. package/lib/types/host/runtime/reverse/ids.d.ts +8 -0
  142. package/lib/types/host/runtime/reverse/ids.d.ts.map +1 -0
  143. package/lib/types/host/runtime/reverse/index.d.ts +20 -0
  144. package/lib/types/host/runtime/reverse/index.d.ts.map +1 -0
  145. package/lib/types/host/runtime/reverse/indexer.d.ts +9 -0
  146. package/lib/types/host/runtime/reverse/indexer.d.ts.map +1 -0
  147. package/lib/types/host/runtime/reverse/policy.d.ts +5 -0
  148. package/lib/types/host/runtime/reverse/policy.d.ts.map +1 -0
  149. package/lib/types/host/runtime/reverse/route-policy.d.ts +10 -0
  150. package/lib/types/host/runtime/reverse/route-policy.d.ts.map +1 -0
  151. package/lib/types/host/runtime/reverse/store.d.ts +91 -0
  152. package/lib/types/host/runtime/reverse/store.d.ts.map +1 -0
  153. package/lib/types/host/runtime/reverse/templates.d.ts +10 -0
  154. package/lib/types/host/runtime/reverse/templates.d.ts.map +1 -0
  155. package/lib/types/host/runtime/reverse/tool.d.ts +25 -0
  156. package/lib/types/host/runtime/reverse/tool.d.ts.map +1 -0
  157. package/lib/types/host/runtime/reverse/types.d.ts +182 -0
  158. package/lib/types/host/runtime/reverse/types.d.ts.map +1 -0
  159. package/lib/types/index.d.ts +13 -0
  160. package/lib/types/index.d.ts.map +1 -1
  161. package/lib/types/shared/claude-api-contracts.d.ts +2 -0
  162. package/lib/types/shared/claude-api-contracts.d.ts.map +1 -1
  163. package/lib/types/shared/claude-contracts.d.ts +3 -0
  164. package/lib/types/shared/claude-contracts.d.ts.map +1 -1
  165. package/lib/types/shared/contracts.d.ts +1 -1
  166. package/lib/types/shared/contracts.d.ts.map +1 -1
  167. package/lib/types/shared/kimi-code-contracts.d.ts +3 -0
  168. package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
  169. package/lib/types/shared/relayone-contracts.d.ts +2 -2
  170. package/lib/types/shared/relayone-contracts.d.ts.map +1 -1
  171. package/lib/types/shared/sub2api-contracts.d.ts +103 -0
  172. package/lib/types/shared/sub2api-contracts.d.ts.map +1 -0
  173. package/package.json +6 -2
  174. package/presets/reverse/README.md +30 -0
  175. package/presets/reverse/agent.cordis.yml +228 -0
  176. package/presets/reverse/preset.yml +3 -0
  177. package/presets/team/README.md +0 -72
  178. package/presets/team/agent.cordis.yml +0 -414
  179. package/presets/team/preset.yml +0 -3
@@ -0,0 +1,228 @@
1
+ # The reverse preset: scoped graph/frontier orchestration for reverse engineering.
2
+ # reverse_board is mounted only by this preset row.
3
+
4
+ - id: persona
5
+ name: '@deepseek-ai/dsh-persona'
6
+ config:
7
+ prefix: |
8
+ [Role Identification] If your first user message is a task brief, you are a subagent. Read your plane from session depth; only depth 0 is Steward. This reverse preset has no dispatch R0-R9 pipeline and no central task assignment.
9
+
10
+ ## R-0 · Human Boundary
11
+
12
+ The operator owns authorization, Goal, artifact roots, resources, deny rules and the final report. Steward initializes with reverse_board init and an explicit authorization reference. Paths outside roots, denied paths, and resources not listed in scope are rejected by the host; never try to bypass that denial.
13
+ Steward is the only human-facing plane. Cells and Workers write Question nodes when a human decision is needed. Jeopardy is supported through engagement:"jeopardy" and flagFormat; AWD/KOH is out of scope.
14
+
15
+ ## R-1 · Planes
16
+
17
+ - Depth 0 = Steward: init, open/close/merge Cells, answer Questions, request handoff, run watchdog, settle finish, report/audit. Do not decompile or trace targets.
18
+ - Depth 1 = Cell: bind to one open Cell on first frontier call, then claim or delegate actions. A later attempt to bind another Cell is denied.
19
+ - Depth 2 = Worker: inherit the parent Cell, claim one action, execute, write evidence, then stop or hand off. May spawn one Subworker for a bounded slice.
20
+ - Depth 3 = Subworker: one bounded slice; never spawn another agent.
21
+
22
+ ## R-2 · Graph
23
+
24
+ Use reverse_board for every graph mutation; Do not edit graph.jsonl, cell shards, claims.jsonl, leases.jsonl or audit.jsonl directly. Run data is under ${DSH_HOME}/reverse/<rootSessionId>/ with run.lock, evidence/ and briefs/.
25
+ Node kinds include Goal, Cell, Step, Fact, Artifact, Segment, Function, Symbol, Hypothesis, Experiment, Finding, Evidence, DeadEnd, Question, Patch, Script and Submission. Facts are atomic and evidence-bearing. Function and Finding ids are deterministic when omitted.
26
+ Edges include contains, calls, xrefs, dataflow, imports, decrypts, validates, supports, contradicts, reproduces, depends_on and supersedes; both endpoints must exist.
27
+
28
+ ## R-3 · Frontier and Claims
29
+
30
+ 1. Call reverse_board {action:"frontier"}; your Cell is enforced by the host. Choose one action by score, evidence value and novelty.
31
+ 2. Call {action:"claim", actionId, operation:"acquire"}. Keep the claimToken and fencing.
32
+ 3. Renew before expiry with operation:"renew", or release with operation:"release". Expired or stale fencing cannot write; reacquire after expiry. Do not use another actor token.
33
+ 4. record and evidence require the active claimToken. Cross-Cell nodes and paths outside scope are denied.
34
+ 5. The producer of a Finding cannot claim its verify action; leave it for an independent verifier.
35
+
36
+ ## R-4 · Route Islands
37
+
38
+ Postures are toolwright, shortest, adversary, deepdive and weaver. Islands are crypto, protocol, anti-debug, packer, JNI, native, dataflow, UI and general. The host scores value, confidence, novelty, cost, risk and duplication plus a UCB exploration bonus, and caps each island elite pool. Mutate one factor per experiment and preserve competing routes.
39
+
40
+ ## R-5 · Evidence Gate
41
+
42
+ A new Finding starts proposed/queued. evidence supplies tool, command, inputHash and outputHash or content; content is persisted under evidence/ with its actual SHA-256. Evidence moves the Finding to observed. After reproduction, record reproduced.
43
+ Only another actor can verify: the verifier claims verify, writes independent evidence with reproduction steps, then records verified. The host rejects self-verification and skipped states. The finish intent cites verified Finding ids only; later facts invalidate it. Steward settles after graph quiet and never self-accepts on behalf of a worker.
44
+
45
+ ## R-6 · Locks, Handoff and Watchdog
46
+
47
+ Lease devices, emulators, IDA/Ghidra projects, Frida servers, ports, certificates and challenge instances before acting. The resource must match scope.resources. Renew or release with its lease token; never steal an unexpired lease.
48
+ To interrupt, Steward calls handoff request for the action. The holder completes with claimToken, factsWritten, leases, nextStep and safeToStop. Completion releases the claim while leaving the action open; no synthetic conclude and no wall-clock kill.
49
+ Steward calls watchdog about every 90 seconds. After three rotations without graph progress the host requests handoff/steering; at most two recovery attempts, then needsHuman is reported. Progress resets the stall cycle.
50
+
51
+ ## R-7 · Report
52
+
53
+ Steward uses report with format:"markdown" or "json". Reports derive from the graph: Goal, Cells, verified findings, evidence hashes/paths, dead ends, open Questions, pending handoffs and residual risk. Cite node ids; never upgrade an unverified hypothesis into a finding. Jeopardy acceptance requires the configured flag format plus independent reproduction.
54
+
55
+ - id: agent-instructions
56
+ name: '@deepseek-ai/dsh-agent-instructions'
57
+ config:
58
+ maxBytes: 65536
59
+
60
+ # ── shell ───────────────────────────────────────────────────────────────────
61
+
62
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
63
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
64
+ # the criterion for host-plane ownership — injection resolves before any session
65
+ # exists, so there is no agent to key by. Behind a preset realm those variables
66
+ # never reached the model's shell at all. Both shell tools consume the host
67
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
68
+ # host-plane too.
69
+ - id: tool-bash
70
+ name: '@deepseek-ai/dsh-tool-bash'
71
+ disabled: !!js process.platform === 'win32'
72
+ - id: tool-pwsh
73
+ name: '@deepseek-ai/dsh-tool-pwsh'
74
+ disabled: !!js process.platform !== 'win32'
75
+
76
+ # ── filesystem ──────────────────────────────────────────────────────────────
77
+
78
+ # Both register into the host `tools` registry and provide nothing, so
79
+ # they need no realm. The `fs` service and its policy stay in the host.
80
+ - id: tool-fs
81
+ name: '@deepseek-ai/dsh-tool-fs'
82
+ - id: tool-fs-search
83
+ name: '@deepseek-ai/dsh-tool-fs-search'
84
+ config:
85
+ sampleOverCapGlobResults: false
86
+
87
+ # ── background jobs ────────────────────────────────────────────────────────
88
+
89
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
90
+ # its producers sit outside any realm this file could put it in — `tool-bash`
91
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
92
+ # to every sibling row, so `run_in_background` would answer "background jobs
93
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
94
+ # owning agent anyway, so one host instance serves every session. What a preset
95
+ # chooses is whether its agent can collect and stop background work at all.
96
+ - id: tool-jobs
97
+ name: '@deepseek-ai/dsh-tool-jobs'
98
+
99
+ # ── skills ──────────────────────────────────────────────────────────────────
100
+
101
+ # The skill REGISTRY lives in the host composition and is layered per scope:
102
+ # these rows register into THIS preset's layer of it, so they need no realm.
103
+ # `skill-filesystem` contributes local-root discovery for agents on this preset, and
104
+ # `tool-skill` gives them the catalog and loader; the merged catalog also
105
+ # carries whatever the deployment registered globally (repository plugins).
106
+ - id: skill-filesystem
107
+ name: '@deepseek-ai/dsh-skill-filesystem'
108
+ - id: tool-skill
109
+ name: '@deepseek-ai/dsh-tool-skill'
110
+
111
+ # ── goals ───────────────────────────────────────────────────────────────────
112
+
113
+ # The goal service and session driver stay on the host plane, where the Gateway
114
+ # can resolve them. The human command and model-facing tool register into this
115
+ # preset's scoped layers.
116
+ - id: compaction
117
+ name: cordis:group
118
+ group: true
119
+ isolate:
120
+ compaction: true
121
+ toolResultPruner: true
122
+ config:
123
+ - id: compaction-basic
124
+ name: '@deepseek-ai/dsh-compaction-basic'
125
+
126
+ - id: command-compact
127
+ name: '@deepseek-ai/dsh-command-compact'
128
+
129
+ # The pruner is this plugin's own fork (src/entry-tool-result-pruner.ts),
130
+ # not the harness package: it is byte-compatible with the official
131
+ # `@deepseek-ai/dsh-compaction-tool-result-pruner` except that it skips
132
+ # cache-prefix providers instead of rewriting their history.
133
+ #
134
+ # The reason the official pruner used to be left out is the reason the fork
135
+ # exists: pruning rewrites a historical tool result, which invalidates the
136
+ # provider's content-prefix cache from that point to the end of the
137
+ # conversation — measured on a real 838k-token session, one pass removed
138
+ # ~418k tokens of context but charged ~414k full-price input tokens to
139
+ # rebuild the prefix. The fork therefore skips `kimi-code` whole-session
140
+ # (the host-level guard enforces that across presets too), so a
141
+ # cache-prefix provider never pays the rebuild.
142
+ #
143
+ # `toolResultPruner` is isolated with the group because `compaction-basic`
144
+ # reads the pruner through `ctx.get`: the instance must be reachable from
145
+ # the realm that owns the compaction service. `compaction-basic` treats a
146
+ # missing pruner as "skip the model-free pass" at both of its call sites, so
147
+ # an installation where this fork's export is absent keeps working — the
148
+ # sync disables that row instead of marking the preset unresolvable.
149
+ - id: tool-result-pruner
150
+ name: '@eddyskywalker/dsh-chatgpt-subscription/tool-result-pruner'
151
+ config:
152
+ thresholdChars: 8192
153
+ headChars: 4096
154
+ tailChars: 1024
155
+
156
+ # ── delegation and workflows ────────────────────────────────────────────────
157
+
158
+ # The `subagents` registry and its spawn/fork backends live in the HOST
159
+ # composition: the registry is a process singleton whose cross-session queries
160
+ # the api-proxy serves to the browser, and a provider name may only be
161
+ # registered once. This preset contributes the delegation TOOLS, which resolve
162
+ # that host registry.
163
+ #
164
+ # `workflows` is different — nothing outside an agent reads it — so every row
165
+ # that reaches it shares one entry-local realm here, and a consumer left
166
+ # outside would resolve a host registry this preset does not populate.
167
+ - id: delegation
168
+ name: cordis:group
169
+ group: true
170
+ isolate:
171
+ workflowEngine: true
172
+ config:
173
+ - id: tool-subagent-control
174
+ name: '@deepseek-ai/dsh-tool-subagent-control'
175
+
176
+ - id: tool-subagent-list-agents
177
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
178
+
179
+ - id: tool-subagent
180
+ name: '@deepseek-ai/dsh-tool-subagent'
181
+ config:
182
+ provider: spawn
183
+ toolName: subagent
184
+ modelSelectionSettings: true
185
+ modelSelection: true
186
+ modelDiscovery: true
187
+ backgroundMode: continuable
188
+
189
+ # Fork omits model selection so provider/model stay equal to the parent and
190
+ # the inherited history remains eligible for KV Cache reuse. This preset
191
+ # keeps fork continuable; parent and child inherit the same messaging tool,
192
+ # while the parent id and return guidance follow the inherited history.
193
+ - id: tool-subagent-fork
194
+ name: '@deepseek-ai/dsh-tool-subagent'
195
+ config:
196
+ provider: fork
197
+ toolName: subagent_fork
198
+ backgroundMode: continuable
199
+
200
+ # ── remaining model-facing rows ─────────────────────────────────────────────
201
+ - id: tool-ask-user
202
+ name: '@deepseek-ai/dsh-tool-ask-user'
203
+ - id: tool-todo
204
+ name: '@deepseek-ai/dsh-tool-todo'
205
+ config:
206
+ allowParallelInProgress: true
207
+
208
+ # The `web` service and its search provider stay in the host composition; only
209
+ # the model-facing tool is per-session.
210
+ - id: tool-web
211
+ name: '@deepseek-ai/dsh-tool-web'
212
+ config:
213
+ fetch: true
214
+ searchTimeoutMs: 60000
215
+
216
+ # ── presentation ────────────────────────────────────────────────────────────
217
+
218
+ # Code Mode for this agent alone: only its explicit native whitelist and
219
+ # `code_run` stay natively callable. Every other registered tool — including
220
+ # ask_user_question and the rows above — remains available from inside
221
+ # `code_run`. The row brings its own root registry/executor, so no
222
+ # `tool-registry-ptc` / `tool-executor-ptc` row is mounted beside it — one root
223
+ # per scope. resolveDispatchPreset swaps this row back to the PTC registry/executor
224
+ # (or the deprecated presentation row) on generations without
225
+ # @deepseek-ai/dsh-tool-registry-native or @deepseek-ai/dsh-tool-executor-native.
226
+
227
+ - id: reverse-board
228
+ name: '@eddyskywalker/dsh-chatgpt-subscription/reverse-board'
@@ -0,0 +1,3 @@
1
+ name: 逆向模式
2
+ description: 图/frontier 驱动的去中心化逆向班组:Goal/Step/Fact 黑板、Cell 自治、Worker 自取 action、证据门与资源租约;只挂载 reverse_board。
3
+ order: 6
@@ -1,72 +0,0 @@
1
- # 班组模式(team)
2
-
3
- 在调度模式之上加一层横向协作:常驻工人共享一块公告板,按名字点名唤醒,验证者只报不修。
4
- **分诊、拓扑选择以外的流程、任务书、验收,全部沿用调度模式**——它不是第二种调度哲学,是同一套
5
- 流程的 Team 拓扑变体。
6
-
7
- ## 什么时候用
8
-
9
- - 3 个以上正交子任务,而且它们**在运行中需要交换信息**(A 的产物是 B 的输入,B 还要回头问 A)——
10
- 纯并行、彼此不说话的活仍然用调度模式的 Fan-out,不要开班组。
11
- - 需要一个和作者分离的验证者,而 Lead 自己读不动那么多 diff。
12
-
13
- ## 与调度模式的三点差异
14
-
15
- | | 调度模式 | 班组模式 |
16
- |---|---|---|
17
- | R1 拓扑 | Lead-Core / Hybrid / Fan-out | 多一个 `Team` 分支 |
18
- | 通信 | 只有父子:任务书下行、报告上行 | 板 + 点名:工人之间可以互相叫醒 |
19
- | 验收 | Lead 独占(R6) | 不变;验证者只是**证据生产者**,验收权仍在 Lead |
20
-
21
- 新增的 R-T 五条规则:板(**两份制品**:任务板管工作与归属,仓库外的 append-only `board.jsonl` 管叙事,按 `#seq` 引用)、点名(`send_message`)、
22
- 挂起(`wait_agent` 有界收件箱等待,不是轮询)、规模(按 `list_agents` 槽位池现算,最后一席留验证者)、
23
- 归约(每 2–4 名工人一个验证者,只报不修)。
24
-
25
- ## 前提与边界
26
-
27
- - 基线是 **harness 0.2.1-rc.2**:拓扑依赖 `@deepseek-ai/dsh-tool-subagent-control` 提供的
28
- `send_message` 与 `wait_agent`;另外两行(`agent-team` + `tool-agent-team`)挂上团队域,
29
- 让任务归属、修订号与 `write_scopes` 跨重启存活,并给新会话默认打开 Team 模式。
30
- 解析不到这两行的代次会被 `resolvePreset` 整对丢掉,预设照常可选,只是没有持久任务板。
31
- - 规模不写死:派发前读 `list_agents` 的 `limit` 与 `running`(根会话不计入),常驻工人 ≤
32
- `limit - running - 1`,最后一个槽位留给验证者;没有剩余槽位就不加人,把活排队。读不到
33
- `list_agents` 的宿主回落到 4。并发靠切任务,不靠加人头。
34
- - `wait_agent` 是有界阻塞(10s–1h),不是零成本睡眠:空转的工人仍占槽位。
35
- - `board.jsonl` 落在 **DSH home 的 `team/<run>/`**(和 `sessions/`、`logs/` 同级),**交付后保留**,供事后复盘;插件加载时把超过 30 天的板剪掉,所以它是有期限的档案,不是无限堆积。任务板不需要清理,它跟着会话存储走。
36
- - 写板只能用 shell 追加(`>>`),**不许**用 `write`/`edit`:后者是覆盖与唯一匹配语义,多个工人并发会丢行、`#seq` 会重号。
37
- - 复盘读的是这块板:交付不再删除,`#seq` 从此是稳定的引用;要清理只靠 30 天保留期,不要手工删当次运行的板。
38
- - 受限沙箱下临时目录可能不可写;那种情况就把叙事留在任务 description 里,别伪造一块板。
39
-
40
- ## 维护
41
-
42
- persona 只有一份增量,写在 `src/host/runtime/presets/agent-preset.ts` 的 `applyTeamDelta()` 里,
43
- 锚点是调度模式 persona 的 `parallel/routing gain`(R1 的 Fan-out 条目)与 `## R2 · Model Routing`。
44
- 本目录的 `agent.cordis.yml` 是「调度模式那份 + 同一份增量」的展开结果,改调度模式后要重新展开;
45
- 测试会比对 YAML 去缩进后的 persona 与 `TEAM_PRESET` 的 persona 是否逐字相等,漂移会直接失败。
46
-
47
- ## 团队任务板:宿主提供,预设不挂
48
-
49
- 试过让本预设挂上 `agent-team` + `tool-agent-team`,宿主直接报:
50
-
51
- ```
52
- agent-team (@deepseek-ai/dsh-agent-team): service "agentTeams" has been registered at <TeamService>
53
- ```
54
-
55
- 也就是说 **`agentTeams` 这个 provider 属于宿主 base 组合**,预设再挂一份就是重复注册,整份预设会变成"加载失败"、在选择器里不可用。
56
- 所以本预设**一行板子都不挂**,挂载形状与调度模式完全一致(这一点有测试钉住)。
57
-
58
- 要用任务板,就在根会话的模型菜单里打开 **Agent teamwork**。打开后宿主会注入 `team:policy`
59
- 段并下发 `team_task_*` 工具;关闭时本预设退化为"只有 `board.jsonl` 一份工作清单"。
60
- T1 写的就是这两态:**有板就镜像过去,没有就只用板文件**。
61
-
62
- 宿主 `team:policy` 里三句与本预设相关的话:
63
-
64
- - 所有成员共享同一个工作目录,`write_scopes` 只是建议、不是锁。
65
- - 流程是 list → get → 用当前 revision claim → 干活 → complete;任务就绪不会自动启动拥有者。
66
- - **"Task changes do not end wait_agent calls, add inbox messages, or start idle agents"**:
67
- 完成任务不叫醒任何人,所以干完的人要自己 `send_message` 点名下一个动作人(T2 记的就是这条)。
68
-
69
- 面板不用我们写:Web 客户端自带 `dsh-client-ui-agent-team`,在会话面板的 Shared tasks 段落里
70
- 按"进行中 → 待办 → 已完成"列出任务板,Team 模式一开就出现。叙事文件不在面板里。
71
-
72
- 上限:单板 256 个任务、`description` 16384 字符、`subject` 200 字符。