@deepseek-harness-tui/dsh-tui 0.18.0 → 0.19.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.
Files changed (209) hide show
  1. package/README.md +35 -10
  2. package/bin/dsh-tui.js +46 -3
  3. package/guide/dsh-tui-guide/codex-backend.en.md +2 -2
  4. package/guide/dsh-tui-guide/codex-backend.md +2 -2
  5. package/guide/dsh-tui-guide/configuration.en.md +7 -2
  6. package/guide/dsh-tui-guide/configuration.md +7 -2
  7. package/guide/dsh-tui-guide/getting-started.en.md +168 -4
  8. package/guide/dsh-tui-guide/getting-started.md +121 -14
  9. package/guide/dsh-tui-guide/interaction.en.md +11 -10
  10. package/guide/dsh-tui-guide/interaction.md +5 -4
  11. package/guide/dsh-tui-guide/user-guide.en.md +6 -5
  12. package/guide/dsh-tui-guide/user-guide.md +6 -5
  13. package/lib/settings.json +1 -1
  14. package/lib/types/adapter/ports/channel-ui.d.ts +10 -7
  15. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  16. package/lib/types/adapter/ports/channel-view.d.ts +28 -5
  17. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  18. package/lib/types/agent/events.d.ts +12 -5
  19. package/lib/types/agent/events.d.ts.map +1 -1
  20. package/lib/types/agent/session.d.ts +5 -0
  21. package/lib/types/agent/session.d.ts.map +1 -1
  22. package/lib/types/backends/claude/translate/core.d.ts +2 -2
  23. package/lib/types/backends/claude/translate/core.d.ts.map +1 -1
  24. package/lib/types/backends/claude/translate/core.js +10 -6
  25. package/lib/types/backends/codex/session/commands.d.ts +2 -0
  26. package/lib/types/backends/codex/session/commands.d.ts.map +1 -1
  27. package/lib/types/backends/codex/session/commands.js +8 -4
  28. package/lib/types/backends/codex/session/input.d.ts +11 -7
  29. package/lib/types/backends/codex/session/input.d.ts.map +1 -1
  30. package/lib/types/backends/codex/session/input.js +68 -15
  31. package/lib/types/backends/codex/session/session.d.ts.map +1 -1
  32. package/lib/types/backends/codex/session/session.js +2 -3
  33. package/lib/types/channel/projection.d.ts.map +1 -1
  34. package/lib/types/channel/projection.js +78 -10
  35. package/lib/types/channel/questions.d.ts +19 -3
  36. package/lib/types/channel/questions.d.ts.map +1 -1
  37. package/lib/types/channel/sanitize.d.ts.map +1 -1
  38. package/lib/types/channel/sanitize.js +8 -4
  39. package/lib/types/channel/subagent-failure.d.ts +49 -0
  40. package/lib/types/channel/subagent-failure.d.ts.map +1 -0
  41. package/lib/types/channel/subagent-failure.js +59 -0
  42. package/lib/types/channel/transcript.d.ts +17 -0
  43. package/lib/types/channel/transcript.d.ts.map +1 -1
  44. package/lib/types/channel/transcript.js +35 -0
  45. package/lib/types/commands.js +1 -1
  46. package/lib/types/components/MessageList.d.ts.map +1 -1
  47. package/lib/types/components/MessageList.js +11 -7
  48. package/lib/types/components/PromptInput.d.ts.map +1 -1
  49. package/lib/types/components/PromptInput.js +61 -6
  50. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  51. package/lib/types/components/SubagentDashboard.js +7 -1
  52. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  53. package/lib/types/components/messages/AssistantToolUseMessage.js +5 -2
  54. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -8
  55. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  56. package/lib/types/components/questions/AskUserQuestionPanel.js +7 -4
  57. package/lib/types/components/questions/PlanReviewPanel.d.ts +3 -6
  58. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  59. package/lib/types/components/revealScope.d.ts +15 -0
  60. package/lib/types/components/revealScope.d.ts.map +1 -0
  61. package/lib/types/components/revealScope.js +17 -0
  62. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +34 -1
  63. package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
  64. package/lib/types/components/sidePanel/btw/BtwComposer.js +108 -7
  65. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
  66. package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +1 -1
  67. package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
  68. package/lib/types/components/sidePanel/btw/BtwThreadScene.js +1 -1
  69. package/lib/types/components/smoothReveal.d.ts +36 -6
  70. package/lib/types/components/smoothReveal.d.ts.map +1 -1
  71. package/lib/types/components/smoothReveal.js +92 -21
  72. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +4 -14
  73. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
  74. package/lib/types/components/workspaces/HomeWorkspaceRow.js +26 -17
  75. package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
  76. package/lib/types/dsh-adapter/backend/session.js +12 -0
  77. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  78. package/lib/types/dsh-adapter/backend/translate.js +6 -1
  79. package/lib/types/dsh-adapter/channel/attached-context.d.ts +15 -2
  80. package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -1
  81. package/lib/types/dsh-adapter/channel/attached-context.js +26 -3
  82. package/lib/types/dsh-adapter/channel/binding-events.d.ts +3 -0
  83. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  84. package/lib/types/dsh-adapter/channel/binding-events.js +43 -2
  85. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +2 -6
  86. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  87. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +7 -1
  88. package/lib/types/dsh-adapter/channel/core/compose.d.ts +2 -6
  89. package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
  90. package/lib/types/dsh-adapter/channel/core/compose.js +1 -1
  91. package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
  92. package/lib/types/dsh-adapter/channel/core/local-actions.js +3 -26
  93. package/lib/types/dsh-adapter/channel/emitter.js +1 -1
  94. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  95. package/lib/types/dsh-adapter/channel/extensions.js +8 -0
  96. package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
  97. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
  98. package/lib/types/dsh-adapter/channel/input-actions.js +34 -10
  99. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +3 -7
  100. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  101. package/lib/types/dsh-adapter/channel/input-delivery.js +14 -5
  102. package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
  103. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  104. package/lib/types/dsh-adapter/channel/model-actions.js +26 -9
  105. package/lib/types/dsh-adapter/channel/model-selection.d.ts +27 -2
  106. package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
  107. package/lib/types/dsh-adapter/channel/model-selection.js +81 -37
  108. package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -1
  109. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  110. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  111. package/lib/types/dsh-adapter/channel/session-rewind.js +6 -2
  112. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  113. package/lib/types/dsh-adapter/channel/session-tree-actions.js +8 -4
  114. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  115. package/lib/types/dsh-adapter/channel/settings-host.js +6 -3
  116. package/lib/types/dsh-adapter/channel/transcript.d.ts +3 -2
  117. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/channel/transcript.js +13 -4
  119. package/lib/types/dsh-adapter/channel/types.d.ts +11 -2
  120. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/contract.d.ts +26 -3
  122. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  123. package/lib/types/dsh-adapter/contract.js +44 -5
  124. package/lib/types/dsh-adapter/fresh-agent.d.ts +1 -1
  125. package/lib/types/dsh-adapter/fresh-agent.d.ts.map +1 -1
  126. package/lib/types/dsh-adapter/fresh-agent.js +60 -11
  127. package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
  128. package/lib/types/dsh-adapter/host-access.js +60 -11
  129. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  130. package/lib/types/dsh-adapter/host-contract.d.ts.map +1 -1
  131. package/lib/types/dsh-adapter/host-contract.js +4 -2
  132. package/lib/types/dsh-adapter/host-dsh.d.ts +0 -8
  133. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  134. package/lib/types/dsh-adapter/host-dsh.js +27 -6
  135. package/lib/types/dsh-adapter/host-entry.js +4 -0
  136. package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -1
  137. package/lib/types/dsh-adapter/oauth/profiles.js +14 -1
  138. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  139. package/lib/types/dsh-adapter/plugin.js +143 -44
  140. package/lib/types/dsh-adapter/presets.d.ts +38 -11
  141. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  142. package/lib/types/dsh-adapter/presets.js +46 -17
  143. package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
  144. package/lib/types/dsh-adapter/process-exit.js +1 -1
  145. package/lib/types/dsh-adapter/questions.d.ts +3 -4
  146. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  147. package/lib/types/dsh-adapter/questions.js +1 -1
  148. package/lib/types/dsh-adapter/session-list-metadata.js +2 -2
  149. package/lib/types/dsh-adapter/subagents.d.ts +5 -0
  150. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/subagents.js +22 -1
  152. package/lib/types/dsh-adapter/team-mode.d.ts +17 -10
  153. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/team-mode.js +19 -12
  155. package/lib/types/dsh-adapter/tool-scope.d.ts +24 -0
  156. package/lib/types/dsh-adapter/tool-scope.d.ts.map +1 -0
  157. package/lib/types/dsh-adapter/tool-scope.js +127 -0
  158. package/lib/types/dsh-adapter/types.d.ts +2 -1
  159. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  160. package/lib/types/heldInputs.d.ts +55 -16
  161. package/lib/types/heldInputs.d.ts.map +1 -1
  162. package/lib/types/heldInputs.js +277 -41
  163. package/lib/types/i18n.d.ts +227 -11
  164. package/lib/types/i18n.d.ts.map +1 -1
  165. package/lib/types/i18n.js +60 -5
  166. package/lib/types/ink/components/App.d.ts +2 -0
  167. package/lib/types/ink/components/App.d.ts.map +1 -1
  168. package/lib/types/ink/components/App.js +8 -0
  169. package/lib/types/ink/events/input-event.d.ts.map +1 -1
  170. package/lib/types/ink/events/input-event.js +7 -6
  171. package/lib/types/ink/hit-test.d.ts +2 -0
  172. package/lib/types/ink/hit-test.d.ts.map +1 -1
  173. package/lib/types/ink/hit-test.js +10 -0
  174. package/lib/types/ink/hooks/use-program-status.d.ts +1 -1
  175. package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -1
  176. package/lib/types/ink/hooks/use-program-status.js +3 -2
  177. package/lib/types/ink/ink.d.ts +1 -0
  178. package/lib/types/ink/ink.d.ts.map +1 -1
  179. package/lib/types/ink/ink.js +5 -2
  180. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  181. package/lib/types/ink/parse-keypress.js +25 -0
  182. package/lib/types/ink/terminal.d.ts +13 -2
  183. package/lib/types/ink/terminal.d.ts.map +1 -1
  184. package/lib/types/ink/terminal.js +29 -5
  185. package/lib/types/screens/Chat.d.ts.map +1 -1
  186. package/lib/types/screens/Chat.js +43 -2
  187. package/lib/types/screens/SessionSupervisor.d.ts +3 -6
  188. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  189. package/lib/types/screens/SessionSupervisor.js +5 -8
  190. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +1 -2
  191. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
  192. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +2 -2
  193. package/lib/types/screens/sessionSupervisor/model.d.ts +1 -1
  194. package/lib/types/screens/sessionSupervisor/model.js +1 -1
  195. package/lib/types/sessionMounts.d.ts +12 -5
  196. package/lib/types/sessionMounts.d.ts.map +1 -1
  197. package/lib/types/sessionMounts.js +33 -6
  198. package/lib/types/update.d.ts +412 -20
  199. package/lib/types/update.d.ts.map +1 -1
  200. package/lib/types/update.js +2094 -193
  201. package/lib/types/updateHost.d.ts +198 -0
  202. package/lib/types/updateHost.d.ts.map +1 -0
  203. package/lib/types/updateHost.js +608 -0
  204. package/lib/types/utils/processName.d.ts +16 -0
  205. package/lib/types/utils/processName.d.ts.map +1 -0
  206. package/lib/types/utils/processName.js +27 -0
  207. package/package.json +111 -108
  208. package/tui-profile/feed/README.md +1 -1
  209. package/tui-profile/feed/first-party.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"subagents.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAIlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAsC,kBAAkB,EAAE,gBAAgB,EAAsB,MAAM,kCAAkC,CAAA;AACxM,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAQtL;gCACgC;AAChC,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,QAAQ,EAAE,gBAAgB,CAAA;CAC3B;AAaD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAmC;IACjD,OAAO,CAAC,cAAc,CAA6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,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAChE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAE5F,OAAO,CAAC,MAAM;IAwBd;;;kCAG8B;IAC9B,OAAO,CAAC,gBAAgB;IAUxB;;;sDAGkD;IAClD,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,aAAa,EAAE;IAC3B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAC/C,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAC3C,OAAO,CAAC,MAAM;CACf"}
@@ -3,6 +3,10 @@ import { toolResultPayload } from './compat/messages.js';
3
3
  import { toolFailureText } from './channel/transcript.js';
4
4
  const MAX_OUTPUT_EVENTS = 160;
5
5
  const MAX_OUTPUT_LINES = 160;
6
+ /** Settled runs kept per child. A continuable child can open runs forever, so
7
+ * the history is bounded; the banner only needs recent runs to reach its
8
+ * two-failure floor. */
9
+ const MAX_SETTLED_RUNS = 32;
6
10
  /** Keyed labels parked before their row exists (see `earlyLabels`). */
7
11
  const MAX_EARLY_LABELS = 64;
8
12
  export class SubagentActivityStore {
@@ -73,6 +77,7 @@ export class SubagentActivityStore {
73
77
  sessionId: info.sessionId,
74
78
  output: [],
75
79
  outputEvents: [],
80
+ settledRuns: [],
76
81
  toolCalls: [],
77
82
  ...(info.parentAgentId === undefined ? {} : { parentAgentId: info.parentAgentId }),
78
83
  });
@@ -535,8 +540,24 @@ export class SubagentActivityStore {
535
540
  state.summary = summary;
536
541
  if (status === 'failed')
537
542
  state.error = reason;
543
+ this.recordSettledRun(state, status);
538
544
  this.notify();
539
545
  }
546
+ /** Keep this run's outcome before a continuable child opens its next run
547
+ * under the same `agentId`. `finish` accepts only the first terminal edge,
548
+ * so one run records once; the `known` branch only absorbs a durable replay
549
+ * of the same settlement. */
550
+ recordSettledRun(state, status) {
551
+ const runId = state.runId ?? state.agentId;
552
+ const runs = [...(state.settledRuns ?? [])];
553
+ const entry = { runId, provider: state.provider, status };
554
+ const known = runs.findIndex(run => run.runId === runId);
555
+ if (known >= 0)
556
+ runs[known] = entry;
557
+ else
558
+ runs.push(entry);
559
+ state.settledRuns = runs.length > MAX_SETTLED_RUNS ? runs.slice(-MAX_SETTLED_RUNS) : runs;
560
+ }
540
561
  /** Drop all tracked subagents and session links (session swap: the old
541
562
  * session's children were disposed with their parent — nothing may keep
542
563
  * routing events of a session the channel no longer projects). The
@@ -552,7 +573,7 @@ export class SubagentActivityStore {
552
573
  this.earlyLabels.clear();
553
574
  this.notify();
554
575
  }
555
- snapshot() { return Array.from(this.states.values()).map(state => ({ ...state, output: [...state.output], outputEvents: [...state.outputEvents], toolCalls: state.toolCalls.map(tool => ({ ...tool })), tokens: state.tokens ? { ...state.tokens } : undefined })); }
576
+ snapshot() { return Array.from(this.states.values()).map(state => ({ ...state, output: [...state.output], outputEvents: [...state.outputEvents], toolCalls: state.toolCalls.map(tool => ({ ...tool })), tokens: state.tokens ? { ...state.tokens } : undefined, settledRuns: state.settledRuns?.map(run => ({ ...run })) })); }
556
577
  get(agentId) { return this.snapshot().find(state => state.agentId === agentId); }
557
578
  subscribe(listener) { this.listeners.add(listener); return () => this.listeners.delete(listener); }
558
579
  notify() { for (const listener of this.listeners)
@@ -17,7 +17,6 @@
17
17
  * @module
18
18
  */
19
19
  import type { Context } from '@deepseek-ai/cordis';
20
- import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
21
20
  import type { LocalCommand } from '../commands.js';
22
21
  import type { TeamActiveMembers } from './plugin-manage.js';
23
22
  /**
@@ -38,16 +37,24 @@ export declare function teamServiceActive(ctx: Context): boolean;
38
37
  export declare function withTeamCommandVisibility(commands: readonly LocalCommand[], visible: boolean): readonly LocalCommand[];
39
38
  /**
40
39
  * Keep one delegation tool set per request. Presets keep their legacy rows,
41
- * so whether the team replaces them is decided where the tools are known: an
42
- * assembly carrying `spawn_teammate` drops `subagent` / `subagent_fork`. This
43
- * follows a bundle toggled at run time into the sessions already joined (a
44
- * preset revision cannot), and a team service that never activated leaves the
45
- * legacy tools in place. The agent loop diffs these final tools against the
46
- * logged request header, so the model is told about each swap.
47
- * @param assembly - Fully assembled prompt inputs for one model request.
48
- * @returns The original assembly, or a copy without the replaced tools.
40
+ * so whether the team replaces them is decided where the tools are known: a
41
+ * registry carrying `spawn_teammate` drops `subagent` / `subagent_fork` on the
42
+ * agent's own scope (the assembly no longer carries tool declarations since
43
+ * 0.2.2). This follows a bundle toggled at run time into the sessions already
44
+ * joined (a preset revision cannot), and a team service that never activated
45
+ * leaves the legacy tools in place.
46
+ *
47
+ * @param registered - Effective agent tool names, including inherited preset tools.
48
+ * @returns The replaced tool names to deny, empty when the team is inactive.
49
49
  */
50
- export declare function filterTeamReplacedTools(assembly: PromptAssembly): PromptAssembly;
50
+ export declare function teamReplacedToolDeny(registered: ReadonlySet<string>): readonly string[];
51
+ /** Keep the legacy final-assembly seam; new presentations carry no tools. */
52
+ export declare function filterTeamReplacedTools<T extends {
53
+ readonly sections: readonly unknown[];
54
+ readonly tools?: readonly {
55
+ readonly name: string;
56
+ }[];
57
+ }>(assembly: T): T;
51
58
  /** What `/team` was asked. */
52
59
  export type TeamCommand = {
53
60
  readonly kind: 'status';
@@ -1 +1 @@
1
- {"version":3,"file":"team-mode.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/team-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAS3D;;;;GAIG;AACH,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A;KAAE,GAAG,iBAAiB,CAAA;CACvE;AAED,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAA;AAElG;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GAC1D,gBAAgB,CAiBlB"}
@@ -34,21 +34,28 @@ export function withTeamCommandVisibility(commands, visible) {
34
34
  const TEAM_REPLACED_TOOLS = new Set(['subagent', 'subagent_fork']);
35
35
  /**
36
36
  * Keep one delegation tool set per request. Presets keep their legacy rows,
37
- * so whether the team replaces them is decided where the tools are known: an
38
- * assembly carrying `spawn_teammate` drops `subagent` / `subagent_fork`. This
39
- * follows a bundle toggled at run time into the sessions already joined (a
40
- * preset revision cannot), and a team service that never activated leaves the
41
- * legacy tools in place. The agent loop diffs these final tools against the
42
- * logged request header, so the model is told about each swap.
43
- * @param assembly - Fully assembled prompt inputs for one model request.
44
- * @returns The original assembly, or a copy without the replaced tools.
37
+ * so whether the team replaces them is decided where the tools are known: a
38
+ * registry carrying `spawn_teammate` drops `subagent` / `subagent_fork` on the
39
+ * agent's own scope (the assembly no longer carries tool declarations since
40
+ * 0.2.2). This follows a bundle toggled at run time into the sessions already
41
+ * joined (a preset revision cannot), and a team service that never activated
42
+ * leaves the legacy tools in place.
43
+ *
44
+ * @param registered - Effective agent tool names, including inherited preset tools.
45
+ * @returns The replaced tool names to deny, empty when the team is inactive.
45
46
  */
47
+ export function teamReplacedToolDeny(registered) {
48
+ if (!registered.has(TEAM_SPAWN_TOOL))
49
+ return [];
50
+ return [...TEAM_REPLACED_TOOLS].filter(name => registered.has(name));
51
+ }
52
+ /** Keep the legacy final-assembly seam; new presentations carry no tools. */
46
53
  export function filterTeamReplacedTools(assembly) {
47
- if (!assembly.tools.some(tool => tool.name === TEAM_SPAWN_TOOL))
48
- return assembly;
49
- if (!assembly.tools.some(tool => TEAM_REPLACED_TOOLS.has(tool.name)))
54
+ if (assembly.tools === undefined)
50
55
  return assembly;
51
- return { ...assembly, tools: assembly.tools.filter(tool => !TEAM_REPLACED_TOOLS.has(tool.name)) };
56
+ const deny = new Set(teamReplacedToolDeny(new Set(assembly.tools.map(tool => tool.name))));
57
+ const tools = assembly.tools.filter(tool => !deny.has(tool.name));
58
+ return tools.length === assembly.tools.length ? assembly : { ...assembly, tools };
52
59
  }
53
60
  export function parseTeamArgs(args) {
54
61
  const sub = args.trim().split(/\s+/)[0] ?? '';
@@ -0,0 +1,24 @@
1
+ /** Per-agent preset/team tool visibility on the 0.2.2 registry seam.
2
+ * Older hosts retain the final assembly filters in plugin.ts instead.
3
+ */
4
+ import type { Context } from '@deepseek-ai/cordis';
5
+ /** The agent shape the restriction needs; no driver implementation is owned here. */
6
+ export interface ScopedAgentLike {
7
+ readonly ctx: Context;
8
+ readonly session: unknown;
9
+ }
10
+ export interface ToolScope {
11
+ /** Track an existing agent and refresh the composition's live scopes. */
12
+ apply(agent: ScopedAgentLike): void;
13
+ }
14
+ /**
15
+ * Keep one exact restriction per live agent, including background/child agents
16
+ * that never bind to the screen. Agent publication awaits agent/created, so its
17
+ * restriction is installed before the factory releases any queued work.
18
+ *
19
+ * @param ctx - Composition context supplying the registry and lifecycle events.
20
+ * @param own - Channel lifetime funnel; releases listeners and every owned mask.
21
+ * @param currentAgent - Initial/borrowed foreground not necessarily in the registry.
22
+ */
23
+ export declare function createToolScope(ctx: Context, own: (dispose: () => void) => void, currentAgent: () => ScopedAgentLike | undefined): ToolScope;
24
+ //# sourceMappingURL=tool-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-scope.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/tool-scope.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAclD,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,yEAAyE;IACzE,KAAK,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAA;CACpC;AAMD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,IAAI,EAClC,YAAY,EAAE,MAAM,eAAe,GAAG,SAAS,GAC9C,SAAS,CA6FX"}
@@ -0,0 +1,127 @@
1
+ import * as scope from '@deepseek-ai/dsh-scope';
2
+ import { presetToolDeny, runningPresetOf } from './presets.js';
3
+ import { teamReplacedToolDeny } from './team-mode.js';
4
+ // Scope ancestry and definitions arrived after the oldest supported hosts.
5
+ // Probe the public export by shape; the legacy assembly path needs neither.
6
+ const scopeParentOf = scope.scopeParentOf;
7
+ /**
8
+ * Keep one exact restriction per live agent, including background/child agents
9
+ * that never bind to the screen. Agent publication awaits agent/created, so its
10
+ * restriction is installed before the factory releases any queued work.
11
+ *
12
+ * @param ctx - Composition context supplying the registry and lifecycle events.
13
+ * @param own - Channel lifetime funnel; releases listeners and every owned mask.
14
+ * @param currentAgent - Initial/borrowed foreground not necessarily in the registry.
15
+ */
16
+ export function createToolScope(ctx, own, currentAgent) {
17
+ const tools = ctx.get?.('tools');
18
+ // No registry-side work is needed on legacy hosts (or a rosterless fixture).
19
+ // Their assembly filter is still authoritative, with its original lifecycle.
20
+ if (typeof tools?.restrict !== 'function' || typeof tools.definitions !== 'function' || scopeParentOf === undefined)
21
+ return { apply: () => undefined };
22
+ const tracked = new Set();
23
+ const retired = new WeakSet();
24
+ const applied = new Map();
25
+ const listeners = [];
26
+ let closed = false;
27
+ let refreshing = false;
28
+ let refreshQueued = false;
29
+ const release = (agent) => {
30
+ const previous = applied.get(agent);
31
+ applied.delete(agent);
32
+ previous?.dispose();
33
+ };
34
+ own(() => {
35
+ closed = true;
36
+ const failures = [];
37
+ for (const dispose of [...listeners.splice(0), ...[...applied.values()].map(entry => entry.dispose)]) {
38
+ try {
39
+ dispose();
40
+ }
41
+ catch (error) {
42
+ failures.push(error);
43
+ }
44
+ }
45
+ applied.clear();
46
+ tracked.clear();
47
+ if (failures.length > 0)
48
+ throw new AggregateError(failures, 'dsh-tui: tool scope cleanup failed');
49
+ });
50
+ const applyOne = (agent) => {
51
+ const scoped = agent.ctx;
52
+ const service = scoped?.get?.('tools');
53
+ if (typeof service?.restrict !== 'function' || typeof service.definitions !== 'function' || scopeParentOf === undefined)
54
+ return;
55
+ try {
56
+ // The parent view contains inherited/restrictable names before OUR mask.
57
+ // The exact-agent view also contains own-scope Team tools. Using the
58
+ // latter alone would forget already-hidden spawners on the next refresh;
59
+ // using the global view would never see preset or Team registrations.
60
+ const inherited = new Set(service.definitions(scopeParentOf(agent)).map(tool => tool.name));
61
+ const visible = new Set(service.definitions(agent).map(tool => tool.name));
62
+ const deny = [...new Set([
63
+ ...presetToolDeny(runningPresetOf(agent.session)),
64
+ ...teamReplacedToolDeny(new Set([...inherited, ...visible])),
65
+ ])].filter(name => inherited.has(name)).sort();
66
+ const signature = deny.join('\n');
67
+ if (applied.get(agent)?.signature === signature)
68
+ return;
69
+ release(agent);
70
+ // Empty filters are rejected upstream and carry no opinion here.
71
+ if (deny.length > 0)
72
+ applied.set(agent, { signature, dispose: service.restrict({ deny }) });
73
+ }
74
+ catch (error) {
75
+ ctx.logger?.warn?.('dsh-tui: could not restrict tools for the agent', error);
76
+ }
77
+ };
78
+ const refresh = () => {
79
+ if (closed)
80
+ return;
81
+ // Both install AND disposal synchronously emit tools/change. Finish the
82
+ // atomic refresh first, then coalesce those events into one stable pass.
83
+ refreshQueued = true;
84
+ if (refreshing)
85
+ return;
86
+ refreshing = true;
87
+ try {
88
+ do {
89
+ refreshQueued = false;
90
+ const registry = ctx.get?.('agents');
91
+ const foreground = currentAgent();
92
+ for (const agent of registry?.list?.() ?? [])
93
+ if (!retired.has(agent))
94
+ tracked.add(agent);
95
+ if (foreground !== undefined && !retired.has(foreground))
96
+ tracked.add(foreground);
97
+ for (const agent of tracked)
98
+ applyOne(agent);
99
+ } while (refreshQueued && !closed);
100
+ }
101
+ finally {
102
+ refreshing = false;
103
+ }
104
+ };
105
+ const apply = (agent) => {
106
+ if (closed || retired.has(agent))
107
+ return;
108
+ tracked.add(agent);
109
+ refresh();
110
+ };
111
+ listeners.push(ctx.on('tools/change', refresh));
112
+ listeners.push(ctx.on('agent/created', ({ agent }) => {
113
+ apply(agent);
114
+ return undefined;
115
+ }));
116
+ listeners.push(ctx.on('agent/disposed', ({ agent }) => {
117
+ retired.add(agent);
118
+ tracked.delete(agent);
119
+ release(agent);
120
+ }));
121
+ listeners.push(ctx.on('session/event', (_session, event) => {
122
+ if (event.type === 'agent-preset/selected')
123
+ refresh();
124
+ }));
125
+ refresh();
126
+ return { apply };
127
+ }
@@ -7,7 +7,8 @@
7
7
  * breaks exactly one module, never the whole UI.
8
8
  */
9
9
  export type { LlmModelInfo, LlmProviderInfo } from '@deepseek-ai/dsh-llm';
10
- export type { Agent, AgentHandle, AgentStatus, CreateAgentOptions, ModelSelectionRef } from '@deepseek-ai/dsh-agent';
10
+ export type { Agent, AgentHandle, AgentStatus, CreateAgentOptions } from '@deepseek-ai/dsh-agent';
11
+ export type { ModelSelectionRef } from './channel/model-selection.js';
11
12
  export type { SessionId, SessionEvent, SessionHeader } from '@deepseek-ai/dsh-session';
12
13
  export type { CommandRuntime } from '@deepseek-ai/dsh-commands';
13
14
  export type { ApprovalOutcome, ApprovalRequest } from '@deepseek-ai/dsh-user-approval';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/types.ts"],"names":[],"mappings":"AAAA;;;;;;;G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AM,wBAAwB,CAAA;AACxD,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExD;;;;GAIG;AACH,YAAY,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,cAAc,GACf,MAAM,uBAAuB,CAAA"}
@@ -1,36 +1,75 @@
1
- /** env marker naming the file the replacement takes its held texts from. */
1
+ import type { AttachedContext, ChannelImageMediaType, ComposerImageRef, ComposerSubmission, StagedImageHandle, StagedImageInput, TranscriptImage } from './adapter/ports/channel-view.js';
2
+ /** env marker naming the file the replacement takes its held inputs from. */
2
3
  export declare const HELD_INPUTS_ENV = "DSH_TUI_HELD_INPUTS";
4
+ /** One staged image of a carried input: its visible token and its bytes. */
5
+ export interface HeldImage {
6
+ readonly token: string;
7
+ readonly data: Uint8Array;
8
+ readonly mediaType: ChannelImageMediaType;
9
+ readonly name?: string;
10
+ }
11
+ /** One carried "send to Chat" context: the fields a later delivery needs.
12
+ * The composer's chip id is minted per screen and means nothing to the
13
+ * replacement, so it is not carried. */
14
+ export interface HeldContext {
15
+ readonly source: 'panel';
16
+ readonly sourceId: string;
17
+ readonly title: string;
18
+ readonly content: string;
19
+ readonly truncated: boolean;
20
+ }
21
+ /** One carried input. */
22
+ export interface HeldInput {
23
+ readonly text: string;
24
+ readonly images?: readonly HeldImage[];
25
+ readonly contexts?: readonly HeldContext[];
26
+ }
3
27
  /**
4
- * Write the texts for a replacement process to take.
28
+ * The old process's side: the pending rows with their staged images' bytes.
29
+ * Never rejects; an image that cannot be read in time stays behind (its token
30
+ * then sends as text, which the composer warns about).
31
+ */
32
+ export declare function collectHeldInputs(pending: readonly {
33
+ readonly text: string;
34
+ readonly images: readonly ComposerImageRef[];
35
+ readonly contexts?: readonly AttachedContext[];
36
+ }[], stagedImage: (stageId: string) => TranscriptImage | undefined): Promise<HeldInput[]>;
37
+ /**
38
+ * Write the inputs for a replacement process to take.
5
39
  * @returns The env marker to hand the replacement, or undefined when there
6
40
  * is nothing to carry or the write failed (best effort: a restart never
7
41
  * waits on it).
8
42
  */
9
- export declare function writeHeldInputs(texts: readonly string[], dir?: string, pid?: number): Record<string, string> | undefined;
10
- /**
11
- * The replacement's side: park the texts a `/restart` handed this process as
12
- * held rows once the screen's channel is ready (never sent by themselves).
13
- * A pass that cannot reach a ready channel leaves the handoff pending for the
14
- * next `apply()` instead of dropping it.
15
- * @returns What stops waiting for a channel that is not ready yet.
16
- */
17
- export declare function adoptHeldInputs(channel: {
43
+ export declare function writeHeldInputs(inputs: readonly (string | HeldInput)[], dir?: string, pid?: number): Record<string, string> | undefined;
44
+ /** What `adoptHeldInputs` needs from the screen's channel. */
45
+ export interface HeldInputsChannel {
18
46
  readonly ready: boolean;
19
47
  subscribe(listener: () => void): () => void;
20
- holdInputs(texts: readonly string[]): number;
21
- }, env?: NodeJS.ProcessEnv, dir?: string): (() => void) | undefined;
48
+ holdInputs(inputs: readonly (string | ComposerSubmission)[]): number;
49
+ stagedImageGeneration(): number;
50
+ stageComposerImage(input: StagedImageInput, generation: number): Promise<StagedImageHandle>;
51
+ }
52
+ /**
53
+ * The replacement's side: park the inputs a `/restart` handed this process as
54
+ * held rows once the screen's channel is ready (never sent by themselves),
55
+ * their images staged again first. An image the new session refuses is left
56
+ * out; its token stays in the text. A pass that cannot reach a ready channel
57
+ * leaves the handoff pending for the next `apply()` instead of dropping it.
58
+ * @returns What stops the adoption, or undefined when nothing was carried.
59
+ */
60
+ export declare function adoptHeldInputs(channel: HeldInputsChannel, env?: NodeJS.ProcessEnv, dir?: string): (() => void) | undefined;
22
61
  /**
23
62
  * The resume command after a restart that ended before any replacement took
24
- * the held texts (a stall, a failed spawn): their file stays, and the command
63
+ * the held inputs (a stall, a failed spawn): their file stays, and the command
25
64
  * hands it to the next launch. Windows has no shared env-assignment syntax:
26
65
  * PowerShell and cmd.exe each get their own copy-pasteable line.
27
66
  */
28
67
  export declare function heldInputsResumeCommand(command: string, env: Readonly<Record<string, string>> | undefined, platform?: NodeJS.Platform): string;
29
68
  /**
30
- * Take (read and delete) the texts a `/restart` handed this process. One
69
+ * Take (read and delete) the inputs a `/restart` handed this process. One
31
70
  * shot: the env marker is consumed too, so no child inherits it.
32
71
  */
33
- export declare function takeHeldInputs(env?: NodeJS.ProcessEnv, dir?: string): string[];
72
+ export declare function takeHeldInputs(env?: NodeJS.ProcessEnv, dir?: string): HeldInput[];
34
73
  /** Remove held-input files older than the resume window (best effort). */
35
74
  export declare function sweepHeldInputs(dir?: string, now?: number): void;
36
75
  //# sourceMappingURL=heldInputs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"heldInputs.d.ts","sourceRoot":"","sources":["../../src/heldInputs.ts"],"names":[],"mappings":"AAaA,4EAA4E;AAC5E,eAAO,MAAM,eAAe,wBAAwB,CAAA;AAOpD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,GAAE,MAAiB,EAAE,GAAG,GAAE,MAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAc/I;AAyBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAAC,UAAU,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAA;CAAE,EAC/H,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAiB,GACrB,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CA8B1B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,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