@fish-under-sea/dsh-client-ui-task-board-fish 1.0.2 → 2.0.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 (125) hide show
  1. package/NOTICE +1 -1
  2. package/README.en.md +6 -4
  3. package/README.md +6 -4
  4. package/README.zh.md +6 -4
  5. package/icon.png +0 -0
  6. package/lib/client.js +4428 -1508
  7. package/lib/client.js.map +1 -1
  8. package/lib/index.js +2670 -496
  9. package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
  10. package/lib/types/client/PluginSettingsCard.d.ts +130 -19
  11. package/lib/types/client/RangeBubble.d.ts +46 -0
  12. package/lib/types/client/SegmentGroup.d.ts +28 -0
  13. package/lib/types/client/TaskBoardSettingsCard.d.ts +63 -0
  14. package/lib/types/client/board/AttachmentField.d.ts +70 -0
  15. package/lib/types/client/board/ExecutionLog.d.ts +24 -0
  16. package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
  17. package/lib/types/client/board/TaskForm.d.ts +4 -0
  18. package/lib/types/client/board/VerificationReport.d.ts +2 -15
  19. package/lib/types/client/board/model-options.d.ts +87 -0
  20. package/lib/types/client/board/preset-label.d.ts +21 -0
  21. package/lib/types/client/board/preset-roster.d.ts +45 -0
  22. package/lib/types/client/board/source-group.d.ts +27 -0
  23. package/lib/types/client/body-mutations.d.ts +45 -0
  24. package/lib/types/client/host-api.d.ts +25 -0
  25. package/lib/types/client/locales.d.ts +87 -9
  26. package/lib/types/client/pending-verify.d.ts +47 -0
  27. package/lib/types/client/plugin-card-seat.d.ts +3 -1
  28. package/lib/types/client/service.d.ts +4 -1
  29. package/lib/types/client/settings-form.d.ts +73 -51
  30. package/lib/types/core/attachment.d.ts +132 -0
  31. package/lib/types/core/card-defaults.d.ts +78 -0
  32. package/lib/types/core/controller.d.ts +57 -8
  33. package/lib/types/core/execution-summary.d.ts +52 -0
  34. package/lib/types/core/extension.d.ts +116 -0
  35. package/lib/types/core/launch-width.d.ts +31 -0
  36. package/lib/types/core/reasoning-effort.d.ts +57 -0
  37. package/lib/types/core/session-reuse.d.ts +7 -1
  38. package/lib/types/core/spend-budget.d.ts +28 -0
  39. package/lib/types/core/subtask.d.ts +100 -37
  40. package/lib/types/core/tasks.d.ts +94 -10
  41. package/lib/types/core/use-cases/task-create.d.ts +10 -5
  42. package/lib/types/core/use-cases/task-tag.d.ts +36 -0
  43. package/lib/types/core/use-cases/task-update.d.ts +22 -1
  44. package/lib/types/core/wire-projection.d.ts +35 -0
  45. package/lib/types/core/workspace-target.d.ts +23 -3
  46. package/lib/types/host/attachments.d.ts +250 -0
  47. package/lib/types/host/extension-registry.d.ts +40 -0
  48. package/lib/types/host/launch-admission.d.ts +71 -0
  49. package/lib/types/host-ledger.d.ts +114 -47
  50. package/lib/types/host-routes.d.ts +63 -0
  51. package/lib/types/host-runner.d.ts +164 -18
  52. package/lib/types/host-service.d.ts +182 -46
  53. package/lib/types/host-spend.d.ts +52 -0
  54. package/lib/types/index.d.ts +173 -54
  55. package/lib/types/loopback.d.ts +41 -1
  56. package/lib/types/protocol.d.ts +52 -11
  57. package/lib/types/tool-surface.d.ts +1 -0
  58. package/locale/en.json +6 -0
  59. package/locale/zh.json +6 -0
  60. package/package.json +36 -29
  61. package/src/client/CardDefaultPresetField.tsx +101 -0
  62. package/src/client/PluginSettingsCard.tsx +385 -111
  63. package/src/client/RangeBubble.tsx +164 -0
  64. package/src/client/SegmentGroup.tsx +93 -0
  65. package/src/client/TaskBoardSettingsCard.tsx +332 -37
  66. package/src/client/board/AttachmentField.tsx +383 -0
  67. package/src/client/board/EditTaskModal.tsx +63 -0
  68. package/src/client/board/ExecutionLog.tsx +154 -0
  69. package/src/client/board/LinkSubtaskModal.tsx +1 -1
  70. package/src/client/board/NewTaskModal.tsx +154 -45
  71. package/src/client/board/ReasoningEffortField.tsx +50 -0
  72. package/src/client/board/TagManagerModal.tsx +151 -2
  73. package/src/client/board/TaskBoard.tsx +47 -10
  74. package/src/client/board/TaskCard.tsx +45 -23
  75. package/src/client/board/TaskDetail.tsx +468 -258
  76. package/src/client/board/TaskForm.tsx +19 -4
  77. package/src/client/board/VerificationReport.tsx +143 -104
  78. package/src/client/board/model-options.ts +208 -0
  79. package/src/client/board/preset-label.ts +32 -0
  80. package/src/client/board/preset-roster.ts +58 -0
  81. package/src/client/board/source-group.ts +94 -0
  82. package/src/client/board/task-markdown.module.css +11 -8
  83. package/src/client/board-settings.module.css +35 -7
  84. package/src/client/board.module.css +1044 -105
  85. package/src/client/body-mutations.ts +133 -0
  86. package/src/client/host-api.ts +70 -0
  87. package/src/client/index.ts +109 -95
  88. package/src/client/locales.ts +205 -48
  89. package/src/client/pending-verify.ts +90 -0
  90. package/src/client/plugin-card-seat.ts +8 -2
  91. package/src/client/service.ts +24 -0
  92. package/src/client/settings-card.module.css +466 -89
  93. package/src/client/settings-entry-form.ts +0 -1
  94. package/src/client/settings-form.ts +102 -60
  95. package/src/core/attachment.ts +287 -0
  96. package/src/core/card-defaults.ts +132 -0
  97. package/src/core/controller.ts +90 -11
  98. package/src/core/execution-summary.ts +96 -0
  99. package/src/core/extension.ts +120 -0
  100. package/src/core/launch-width.ts +38 -0
  101. package/src/core/reasoning-effort.ts +92 -0
  102. package/src/core/session-reuse.ts +7 -1
  103. package/src/core/spend-budget.ts +35 -0
  104. package/src/core/store.ts +19 -1
  105. package/src/core/subtask.ts +144 -68
  106. package/src/core/tasks.ts +117 -10
  107. package/src/core/use-cases/task-create.ts +27 -16
  108. package/src/core/use-cases/task-tag.ts +56 -0
  109. package/src/core/use-cases/task-update.ts +33 -5
  110. package/src/core/wire-projection.ts +81 -0
  111. package/src/core/workspace-target.ts +27 -3
  112. package/src/host/agent-tools.ts +33 -21
  113. package/src/host/attachments.ts +650 -0
  114. package/src/host/extension-registry.ts +150 -5
  115. package/src/host/launch-admission.ts +139 -0
  116. package/src/host-ledger.ts +248 -117
  117. package/src/host-routes.ts +233 -15
  118. package/src/host-runner.ts +395 -61
  119. package/src/host-service.ts +512 -139
  120. package/src/host-spend.ts +105 -0
  121. package/src/index.ts +312 -92
  122. package/src/loopback.ts +57 -1
  123. package/src/protocol.ts +83 -18
  124. package/src/tool-surface.ts +1 -0
  125. package/icon.svg +0 -3
@@ -9,8 +9,10 @@ import type { Context, Volatile } from '@deepseek-ai/cordis';
9
9
  import z from '@deepseek-ai/schemastery';
10
10
  import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
11
11
  import type { LlmRuntime } from '@deepseek-ai/dsh-llm';
12
- import { type HostTimerFace, type TaskBoardTeamDispatcher } from './host-service.ts';
12
+ import { type HostTimerFace } from './host-service.ts';
13
13
  import { type TaskPermission } from './core/tasks.ts';
14
+ import { type TaskBoardConnectionTrust } from './host-routes.ts';
15
+ import type { ModelInfoResolver, TaskBoardAttachmentStore } from './host/attachments.ts';
14
16
  /** Default environment variable holding the authenticated proxy token. */
15
17
  export declare const DEFAULT_PROXY_TOKEN_ENV = "DSH_TASK_BOARD_PROXY_TOKEN";
16
18
  export declare const inject: string[];
@@ -46,6 +48,19 @@ export interface Config {
46
48
  trustedProxyHosts?: string[];
47
49
  /** Environment variable whose value the authenticated proxy injects upstream. */
48
50
  proxyTokenEnv?: string;
51
+ /**
52
+ * Whether the operator's OWN reverse proxy or tunnel may speak for the
53
+ * browser (default OFF). Off keeps the pre-existing fence exactly: a request
54
+ * that carries a forwarding header is never local, so only a direct loopback
55
+ * client or an allowlisted token-injecting proxy reaches the board (issue
56
+ * #1906). On admits one narrower case — a forwarded request whose socket and
57
+ * Host are both this machine's loopback upstream, i.e. the proxy dials the
58
+ * board itself (issue #1918) — and still requires the browser same-origin
59
+ * marker, so a third party's tunnel is only trusted while the operator says
60
+ * it is. Volatile: the fence reads it at each request, so an edit binds the
61
+ * next request without re-registering the routes.
62
+ */
63
+ trustForwardedProxy?: Volatile<boolean>;
49
64
  /**
50
65
  * An explicit baseline for the permission confirmation gate. Left unset, the
51
66
  * board follows the Host's own default permission preset — the value new DSH
@@ -58,8 +73,8 @@ export interface Config {
58
73
  /**
59
74
  * Subtask depth limit, 1..3 (default 1). At 1 a task may carry one level of
60
75
  * subtasks and a subtask cannot be given subtasks of its own; raising it
61
- * allows deeper trees. Every extra level multiplies the sessions one run
62
- * of the root task opens, so the ceiling is deliberately small.
76
+ * allows deeper trees. Every extra level is another tree the card's own
77
+ * session may have to dispatch, so the ceiling is deliberately small.
63
78
  */
64
79
  maxSubtaskDepth?: Volatile<number>;
65
80
  /**
@@ -70,11 +85,25 @@ export interface Config {
70
85
  */
71
86
  sessionPollSeconds?: Volatile<number>;
72
87
  /**
73
- * Continuable-subagent provider the Agent Teams service uses to compose a
74
- * teammate. Matches the Agent Teams tool plugin's `freshProvider` default;
75
- * only team-mode runs use it.
88
+ * How many run launches this board may have in flight at once (1..16,
89
+ * default 3). A run opens one session, so a burst is several cards run at
90
+ * once (several tabs, or a due schedule firing while a manual run starts);
91
+ * without a bound the Host would ask DSH for all of them in the same tick.
92
+ * This is the mechanism that enforces the repository's measured guidance for
93
+ * heavy implementation subagents. Runs wait their turn instead of being
94
+ * dropped, and every one of them still starts. Read at each admission, so an
95
+ * edit bounds the next launch of a run that is still queueing.
96
+ */
97
+ runLaunchWidth?: Volatile<number>;
98
+ /**
99
+ * Daily token ceiling for the work this board dispatches (default 0 = no
100
+ * gate). Tokens, not money: the ledger the board measures against prices
101
+ * DeepSeek's own routes only, so a cost cap would read 0 elsewhere. Read at
102
+ * each gate, so an edit binds the next run without a remount; a manual
103
+ * run/rerun whose day already spent the cap is refused, and a due occurrence
104
+ * is skipped onto the scheduler with its run budget untouched.
76
105
  */
77
- teamProvider?: string;
106
+ spendBudgetTokens?: Volatile<number>;
78
107
  /**
79
108
  * GLOBAL native /goal switch (default OFF), the master control over whether
80
109
  * this board starts a run with dsh's built-in /goal at all. A run uses native
@@ -91,6 +120,33 @@ export interface Config {
91
120
  * becomes a goal run.
92
121
  */
93
122
  goalRunEnabled?: Volatile<boolean>;
123
+ /**
124
+ * Agent preset a NEW card starts from (volatile, default blank = not set).
125
+ * A prefill, never a pin: the create dialog opens with it selected, the
126
+ * caller may override it, and the card stores what it was created with. It
127
+ * reaches the create path only when that caller opts in with
128
+ * `applyCardDefaults`, so the extension provider's own create and the legacy
129
+ * import are untouched.
130
+ */
131
+ cardDefaultMode?: Volatile<string>;
132
+ /**
133
+ * Permission a NEW card starts from (volatile, default blank = not set), one
134
+ * of the three presets. A prefill like the rest: a value above
135
+ * `sessionDefaultPermission` still has to be confirmed by a human before the
136
+ * card may run, because the pre-execution gate is what decides that.
137
+ */
138
+ cardDefaultPermission?: Volatile<TaskPermission | ''>;
139
+ /**
140
+ * Model a NEW card starts from (volatile, default blank = not set).
141
+ */
142
+ cardDefaultModel?: Volatile<string>;
143
+ /**
144
+ * Reasoning level a NEW card starts from (volatile, default blank = not set).
145
+ * Bound to `cardDefaultModel` exactly as a card's own level is bound to its
146
+ * own model: it applies only while the card's final model IS that default
147
+ * model, and a blank `cardDefaultModel` makes it inert.
148
+ */
149
+ cardDefaultReasoningEffort?: Volatile<string>;
94
150
  /**
95
151
  * Goal acceptance for executions this board starts (default ON). When on,
96
152
  * update_goal(action: complete) inside a task execution is refused until an
@@ -134,17 +190,12 @@ export interface Config {
134
190
  */
135
191
  goalVerificationBudgetSeconds?: Volatile<number>;
136
192
  }
137
- /**
138
- * Continuable-subagent provider for fresh teammates, matching the Agent Teams
139
- * tool plugin's own `freshProvider` default.
140
- */
141
- export declare const DEFAULT_TEAM_PROVIDER = "spawn";
142
193
  /**
143
194
  * Profile-patch shape of {@link Config}: what the Host validates the row's
144
195
  * config against, before the schema turns volatile fields into live references
145
196
  * and applies defaults. Declared separately because the two sides no longer
146
197
  * share one shape, so the schema is annotated `z<ConfigInput, Config>` — the
147
- * same split `dsh-git-graph` uses. The annotation is also what keeps the
198
+ * same split the git-family packages use. The annotation is also what keeps the
148
199
  * emitted declaration portable: an unannotated schema holding a nested object
149
200
  * array infers a type that cannot be named without reaching into a transitive
150
201
  * dependency's own types.
@@ -160,16 +211,28 @@ export interface ConfigInput {
160
211
  trustedProxyHosts?: string[];
161
212
  /** Environment variable whose value the authenticated proxy injects. */
162
213
  proxyTokenEnv?: string;
214
+ /** Trust a forwarded request that landed on this machine's loopback upstream; default off. */
215
+ trustForwardedProxy?: boolean;
163
216
  /** Explicit baseline for the permission confirmation gate; unset follows the Host default. */
164
217
  sessionDefaultPermission?: TaskPermission;
165
218
  /** Subtask depth limit, 1..3. */
166
219
  maxSubtaskDepth?: number;
167
220
  /** Roster-poll cadence in seconds while the board has work to reconcile. */
168
221
  sessionPollSeconds?: number;
169
- /** Continuable-subagent provider the Agent Teams service composes a teammate from. */
170
- teamProvider?: string;
222
+ /** Concurrent run launches allowed at once, 1..16. */
223
+ runLaunchWidth?: number;
224
+ /** Daily token ceiling for board runs; 0 disables the gate. */
225
+ spendBudgetTokens?: number;
171
226
  /** Global native /goal switch; default off, frozen per execution. */
172
227
  goalRunEnabled?: boolean;
228
+ /** Agent preset a new card starts from; blank = not set. */
229
+ cardDefaultMode?: string;
230
+ /** Permission a new card starts from; blank = not set. */
231
+ cardDefaultPermission?: TaskPermission | '';
232
+ /** Model a new card starts from; blank = not set. */
233
+ cardDefaultModel?: string;
234
+ /** Reasoning level a new card starts from; blank = not set. */
235
+ cardDefaultReasoningEffort?: string;
173
236
  /** Goal acceptance switch. */
174
237
  goalVerification?: boolean;
175
238
  /** Judge model route for goal acceptance; blank inherits the host default. */
@@ -215,11 +278,45 @@ declare module '@deepseek-ai/cordis' {
215
278
  * @returns the effective field value.
216
279
  */
217
280
  export declare function readConfigField<T>(field: Volatile<T> | T | undefined, fallback: T): T;
218
- /** Resolve proxy access without ever placing the token value in plugin config. */
281
+ /**
282
+ * Resolve proxy access without ever placing the token value in plugin config.
283
+ *
284
+ * The forwarded-proxy switch travels as a reader rather than a value: it is
285
+ * schema-volatile, so the fence must read it when a request arrives instead of
286
+ * when the routes are registered.
287
+ * @param config - the resolved plugin config.
288
+ * @param env - environment holding the proxy token value.
289
+ * @returns the route access handed to {@link makeTaskBoardRoutes}.
290
+ */
219
291
  export declare function resolveProxyAccess(config: Config | undefined, env?: NodeJS.ProcessEnv): {
220
292
  trustedProxyHosts: string[];
221
293
  proxyToken?: string;
294
+ trustForwardedProxy: () => boolean;
222
295
  };
296
+ /**
297
+ /**
298
+ * Schema default for the forwarded-proxy switch, re-read for hand-built
299
+ * contexts. Deliberately false: a deployment that never configured it keeps
300
+ * refusing every forwarded request, which is the #1906 fence.
301
+ */
302
+ export declare const DEFAULT_TRUST_FORWARDED_PROXY = false;
303
+ /**
304
+ * Resolve the composition's optional `connection` service.
305
+ *
306
+ * The service is the Host's own browser-session authority: it fronts every
307
+ * `/api` request with the Host/Origin fence and the signed `dsh-auth-*` cookie,
308
+ * which is what a deployment behind a reverse proxy or ingress validates on the
309
+ * same authority the GUI is served from. The board bridges it instead of
310
+ * repeating that check, so a proxy request the Host already authenticated is
311
+ * admitted without a board-specific host allowlist (issue #1930). It is
312
+ * deliberately resolved like the agent-tool registry rather than injected:
313
+ * a composition that serves no connection keeps mounting the board on the
314
+ * pre-existing loopback fence, and one that mounts the service later is picked
315
+ * up on the next request because the fence asks this resolver each time.
316
+ * @param ctx - the plugin context.
317
+ * @returns the trust face, or undefined when this deployment serves none.
318
+ */
319
+ export declare function resolveConnectionTrust(ctx: Context): TaskBoardConnectionTrust | undefined;
223
320
  /** The registry face the agent tools register into. */
224
321
  interface AgentToolRegistry {
225
322
  register(definition: ToolDefinition): () => void;
@@ -257,53 +354,75 @@ export declare function resolveHostTimers(ctx: Context): HostTimerFace | undefin
257
354
  * @returns the Host default as a board permission, or undefined when unreadable.
258
355
  */
259
356
  export declare function resolveHostDefaultPermission(ctx: Context): TaskPermission | undefined;
260
- /** The subset of the Agent Teams service this plugin drives. */
261
- interface AgentTeamsFace {
262
- spawnTeammate(caller: unknown, request: {
263
- name: string;
264
- description: string;
265
- prompt: Array<{
266
- type: 'text';
267
- text: string;
268
- }>;
269
- context: 'fresh' | 'fork';
270
- provider: string;
271
- signal: AbortSignal;
272
- }): Promise<{
273
- member?: {
274
- id?: string;
275
- phase?: string;
276
- error?: string;
277
- };
278
- }>;
279
- }
280
357
  /**
281
- * Resolve the optional Agent Teams service. Like the tool registry and the llm
282
- * runtime, it is deliberately not injected: a deployment without Agent Teams
283
- * must still mount the whole board and only lose team-mode runs.
358
+ * Read the optional `llm` service. The board deliberately does not inject it:
359
+ * a deployment without a model must still mount the board, and the parse route
360
+ * answers a typed failure instead of the plugin failing to load (issue #1540).
284
361
  * @param ctx - the plugin context.
285
- * @returns the service, or undefined when this deployment serves none.
362
+ * @returns the llm service, or undefined when this deployment serves none.
286
363
  */
287
- export declare function resolveAgentTeams(ctx: Context): AgentTeamsFace | undefined;
364
+ export declare function resolveLlmRuntime(ctx: Context): LlmRuntime | undefined;
288
365
  /**
289
- * Build the team dispatcher: the run's Lead session spawns one teammate per
290
- * subtask through the Agent Teams service, and the teammate's session id is
291
- * attached to that subtask's execution so the ordinary session monitor settles
292
- * it. Returns undefined when the deployment serves no Agent Teams service or
293
- * no live-agent registry, which makes a team run fail closed.
366
+ * Resolve the optional attachment storage.
367
+ *
368
+ * The board does not inject the service: a deployment without one must still
369
+ * mount the board, and every attachment surface then answers with a typed
370
+ * "storage unavailable" failure instead of the plugin failing to load.
294
371
  * @param ctx - the plugin context.
295
- * @param provider - the continuable-subagent provider for fresh teammates.
296
- * @returns the dispatcher, or undefined when team runs cannot be served.
372
+ * @returns the attachment storage, or undefined when this deployment serves none.
297
373
  */
298
- export declare function buildTeamDispatcher(ctx: Context, provider: string): TaskBoardTeamDispatcher | undefined;
374
+ export declare function resolveAttachmentStore(ctx: Context): TaskBoardAttachmentStore | undefined;
299
375
  /**
300
- * Read the optional `llm` service. The board deliberately does not inject it:
301
- * a deployment without a model must still mount the board, and the parse route
302
- * answers a typed failure instead of the plugin failing to load (issue #1540).
376
+ * The model-info reader the image preflight uses.
377
+ *
378
+ * It asks the OFFICIAL model service about one exact route. The model catalog
379
+ * the board already publishes carries no modality information and must not be
380
+ * used to answer that question: only the model's own declared input
381
+ * modalities can refuse an image route, and a route whose modalities cannot be
382
+ * read is UNKNOWN and therefore allowed.
303
383
  * @param ctx - the plugin context.
304
- * @returns the llm service, or undefined when this deployment serves none.
384
+ * @returns the reader, or undefined when the deployment serves no model service.
305
385
  */
306
- export declare function resolveLlmRuntime(ctx: Context): LlmRuntime | undefined;
386
+ export declare function resolveModelInfoReader(ctx: Context): ModelInfoResolver | undefined;
387
+ /**
388
+ * The subset of `sessionController` the board uses to wake a cold persisted
389
+ * session before running a slash command on it (issue #1861).
390
+ */
391
+ interface SessionControllerFace {
392
+ resolveAgent(sessionId: Parameters<Context['agents']['get']>[0]): Promise<{
393
+ readonly agent: Parameters<Context['commands']['execute']>[0];
394
+ } | {
395
+ readonly error: {
396
+ readonly message?: string;
397
+ };
398
+ }>;
399
+ }
400
+ /**
401
+ * Resolve the optional `sessionController` service. Like the tool registry and
402
+ * the llm runtime, it is read dynamically so capture-only test contexts that do
403
+ * not mount the full session controller still activate the board.
404
+ * @param ctx - the plugin context.
405
+ * @returns the session controller face, or undefined when unavailable.
406
+ */
407
+ export declare function resolveSessionController(ctx: Context): SessionControllerFace | undefined;
408
+ /**
409
+ * Resolve the live Agent for an execution session, resuming a cold persisted
410
+ * session through `sessionController.resolveAgent` when it is not yet in
411
+ * `ctx.agents` (issue #1861).
412
+ *
413
+ * A fresh run (`session/create`) or a session the browser is currently
414
+ * following is already in `ctx.agents`, so the fast path returns immediately.
415
+ * A scheduled or manual reuse of a cold session — one that `session/list`
416
+ * reports as idle from disk without activating its Agent — is not in
417
+ * `ctx.agents` when `pinAndPrompt` runs `/permission` ahead of
418
+ * `session/selectModel` and `session/prompt`; delegating to
419
+ * `sessionController.resolveAgent` resumes it with its recorded preset and
420
+ * model-selection state, matching what those gateway endpoints do next.
421
+ * @param ctx - the plugin context.
422
+ * @param sessionId - the target execution session id.
423
+ * @returns the live Agent for `sessionId`.
424
+ */
425
+ export declare function resolveExecutionAgent(ctx: Context, sessionId: Parameters<Context['agents']['get']>[0]): Promise<Parameters<Context['commands']['execute']>[0]>;
307
426
  /**
308
427
  * Activate the board's host half: ledger, routes, cron scheduler, power
309
428
  * inhibitor, and the model-facing announcement.
@@ -7,6 +7,19 @@
7
7
  * Semantics: RFC 5735 IPv4 127/8, ::1, IPv4-mapped ::ffff:127/8 (matching the
8
8
  * remote-web-ui gate), localhost hostnames, plus the browser same-origin
9
9
  * markers (sec-fetch-site and Origin) for the request-level fence.
10
+ *
11
+ * A reverse proxy in front of the host rewrites the Host header to its own
12
+ * upstream literal (a Cloudflare tunnel, frp and an nginx reverse proxy all
13
+ * dial 127.0.0.1:<port>), and the socket the origin sees is the proxy's, which
14
+ * is loopback by construction. Both halves of the fence then hold for a public
15
+ * request. Forwarding headers are the signal that a hop stands in between: a
16
+ * request that carries CF-Connecting-IP or X-Forwarded-For is answered through
17
+ * a proxy and is never treated as a local one (issue #1906).
18
+ *
19
+ * An operator who runs that proxy or tunnel themselves can opt into the
20
+ * narrower case: isForwardedLoopbackRequest describes a forwarded request that
21
+ * still landed on this machine's loopback upstream, and a route family admits
22
+ * it only behind its own default-off switch (issue #1918).
10
23
  * @module dsh-web-shared/host/loopback
11
24
  */
12
25
  import type { IncomingMessage } from 'node:http';
@@ -16,9 +29,36 @@ export declare function isIPv4Loopback(v4: string): boolean;
16
29
  export declare function isLoopbackAddress(address: string | undefined): boolean;
17
30
  /** Whether a normalized URL hostname names the loopback authority (localhost, [::1], 127/8). */
18
31
  export declare function isLoopbackHostname(hostname: string): boolean;
32
+ /**
33
+ * Whether a reverse proxy stood between the client and this host: the request
34
+ * carries CF-Connecting-IP or X-Forwarded-For. Either header is stamped by a
35
+ * hop that forwards traffic, so the request did not originate on this machine.
36
+ * @param request - node HTTP request.
37
+ * @returns true when a forwarding header is present.
38
+ */
39
+ export declare function isProxiedRequest(request: IncomingMessage): boolean;
19
40
  /**
20
41
  * Request-level trust fence: a loopback socket address AND a loopback Host
21
42
  * header, plus browser same-origin markers. The socket address is
22
- * authoritative; X-Forwarded-For is never trusted.
43
+ * authoritative for a direct connection; a request that carries a forwarding
44
+ * header is refused outright, because a proxy in front of the host makes both
45
+ * the socket address and the Host header describe the proxy rather than the
46
+ * client. X-Forwarded-For is therefore never evidence *for* loopback.
23
47
  */
24
48
  export declare function isLoopbackRequest(request: IncomingMessage): boolean;
49
+ /**
50
+ * Whether a forwarded request landed on this machine's loopback upstream: a
51
+ * forwarding header (the proxy's own stamp), a loopback socket address (the
52
+ * proxy dials 127.0.0.1:<port>), and a loopback Host header (the proxy rewrote
53
+ * the authority to its upstream literal).
54
+ *
55
+ * This is a fact about the route, not a trust decision. A public request to a
56
+ * tunnel satisfies all three by construction, because the proxy is the client
57
+ * of this process: only a caller that operates the proxy can decide it stands
58
+ * for the browser, which is why every consumer keeps this behind an explicit
59
+ * default-off switch and its own browser markers. isLoopbackRequest is
60
+ * unchanged and still refuses a forwarded request (issue #1906).
61
+ * @param request - node HTTP request.
62
+ * @returns true when a forwarding header, a loopback socket, and a loopback Host all hold.
63
+ */
64
+ export declare function isForwardedLoopbackRequest(request: IncomingMessage): boolean;
@@ -3,9 +3,11 @@ import type { SetSchedulePatch } from './core/use-cases/task-schedule.ts';
3
3
  import { type NewTaskInput, type TaskPermission, type TaskRecord, type TaskStatus } from './core/tasks.ts';
4
4
  import { type TaskBoardExtensionPayload } from './core/extension.ts';
5
5
  import { type ModelCatalogView, type VerificationContract, type VerificationSettings } from './core/verification.ts';
6
- export declare const TASK_BOARD_SCHEMA_VERSION: 6;
7
- /** Ledger documents written before v6; loaded once and migrated on startup. */
8
- export declare const TASK_BOARD_LEGACY_SCHEMA_VERSION: 5;
6
+ export declare const TASK_BOARD_SCHEMA_VERSION: 7;
7
+ /** Ledger documents written before v7; loaded once and migrated on startup. */
8
+ export declare const TASK_BOARD_LEGACY_SCHEMA_VERSION: 6;
9
+ /** Ledger documents written before v6 (the scheduling mode and run budget). */
10
+ export declare const TASK_BOARD_PRE_RUN_BUDGET_SCHEMA_VERSION: 5;
9
11
  /** Ledger documents written before v5; migrated through the v5 normalization too. */
10
12
  export declare const TASK_BOARD_PRE_ACCEPTANCE_SCHEMA_VERSION: 4;
11
13
  /** Ledger documents written before v4; migrated through the v4 normalization too. */
@@ -21,9 +23,10 @@ export declare const TASK_BOARD_OLDEST_SCHEMA_VERSION: 2;
21
23
  export declare const TASK_BOARD_ZONE_STAMP_SCHEMA_VERSION: 4;
22
24
  /**
23
25
  * Every older generation the loader migrates in place. v5 only added the
24
- * per-execution acceptance block and v6 only added the scheduling mode and run
25
- * budget, so the migration is the normalization pass that re-validates each
26
- * row; a document from any listed generation upgrades losslessly.
26
+ * per-execution acceptance block, v6 only added the scheduling mode and run
27
+ * budget, and v7 only added the card attachment metadata, so the migration is
28
+ * the normalization pass that re-validates each row; a document from any
29
+ * listed generation upgrades losslessly.
27
30
  */
28
31
  export declare const TASK_BOARD_MIGRATABLE_SCHEMA_VERSIONS: readonly number[];
29
32
  export declare const TASK_BOARD_API_PREFIX = "/api/task-board";
@@ -61,11 +64,6 @@ export interface TaskBoardSnapshot {
61
64
  * disable the subtask controls; the Host ledger is the authority.
62
65
  */
63
66
  maxSubtaskDepth?: number;
64
- /**
65
- * Whether this deployment serves the Agent Teams service, so a task may opt
66
- * into team execution (Team Lead session plus one teammate per subtask).
67
- */
68
- teamRunAvailable?: boolean;
69
67
  /**
70
68
  * Live GLOBAL native-/goal switch. The browser uses it to disable the
71
69
  * task-level option (and explain that the global switch must be turned on
@@ -74,11 +72,44 @@ export interface TaskBoardSnapshot {
74
72
  * flight.
75
73
  */
76
74
  goalRunEnabled?: boolean;
75
+ /**
76
+ * New-card defaults this deployment configures: what the create dialog opens
77
+ * with, and what the create path fills an omitted target from when the caller
78
+ * opts in (`applyCardDefaults`). A target the board configures nothing for is
79
+ * omitted rather than published blank, so the browser can tell "no default
80
+ * model" from "a blank one".
81
+ */
82
+ cardDefaults?: {
83
+ mode?: string;
84
+ permission?: TaskPermission;
85
+ model?: string;
86
+ reasoningEffort?: string;
87
+ };
77
88
  /**
78
89
  * Read-only summaries published by running extensions, keyed by extension id.
79
90
  * The board forwards them verbatim; it never interprets their shape.
80
91
  */
81
92
  extensions?: Record<string, unknown>;
93
+ /**
94
+ * The attachment limits this deployment enforces, so the browser can refuse
95
+ * an oversized selection before it uploads anything. The board's own caps
96
+ * are the ceiling; a deployment whose attachment storage publishes stricter
97
+ * image limits lowers the bounds it publishes here.
98
+ */
99
+ attachmentLimits?: {
100
+ /** Maximum number of attachments one card may carry. */
101
+ maxAttachments: number;
102
+ /** Maximum byte length of one attachment. */
103
+ maxBytes: number;
104
+ /** Maximum byte length of all attachments of one card together. */
105
+ maxTotalBytes: number;
106
+ /** Maximum number of IMAGES one card may carry (the official per-message budget). */
107
+ maxImages: number;
108
+ /** Maximum byte length of one image. */
109
+ maxImageBytes: number;
110
+ /** Maximum byte length of all images of one card together (the official per-message budget). */
111
+ maxMessageImageBytes: number;
112
+ };
82
113
  }
83
114
  /**
84
115
  * Body of `GET {TASK_BOARD_API_PREFIX}/verification`: the acceptance settings the
@@ -176,6 +207,16 @@ export type TaskBoardAction = {
176
207
  } | {
177
208
  kind: 'rerun';
178
209
  taskId: string;
210
+ }
211
+ /**
212
+ * Re-run an executed card in its own session, carrying rework instructions as
213
+ * this run's additional input. Every run gate applies exactly as it does to
214
+ * `rerun`, and the card's frozen content is never rewritten.
215
+ */
216
+ | {
217
+ kind: 'rework';
218
+ taskId: string;
219
+ instructions: string;
179
220
  } | {
180
221
  kind: 'confirm-permission';
181
222
  taskId: string;
@@ -30,6 +30,7 @@
30
30
  export declare const PLUGIN_TOOL_SECTION_ORDERS: {
31
31
  readonly ssh: 150;
32
32
  readonly 'task-board': 200;
33
+ readonly agents: 220;
33
34
  };
34
35
  /** One plugin id keyed by {@link PLUGIN_TOOL_SECTION_ORDERS}. */
35
36
  export type PluginToolSectionId = keyof typeof PLUGIN_TOOL_SECTION_ORDERS;
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Task Board",
4
+ "description": "Drag tasks across columns; cron runs them for real."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "任务看板",
4
+ "description": "拖拽管理任务并按 Cron 真实执行"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@fish-under-sea/dsh-client-ui-task-board-fish",
3
3
  "description": "Host-authoritative task board for the DSH Web GUI with real session execution, Host cron scheduling, and optional cross-platform idle-sleep protection; mounted without DSH source changes.",
4
- "version": "1.0.2",
5
- "icon": "icon.svg",
4
+ "version": "2.0.0",
5
+ "icon": "./icon.png",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
8
8
  "types": "lib/types/index.d.ts",
9
+ "engines": {
10
+ "node": ">=24.9.0"
11
+ },
9
12
  "exports": {
10
13
  ".": {
11
14
  "types": "./lib/types/index.d.ts",
@@ -16,11 +19,13 @@
16
19
  "default": "./lib/client.js"
17
20
  },
18
21
  "./src/*": "./src/*",
22
+ "./locale/en.json": "./locale/en.json",
23
+ "./locale/zh.json": "./locale/zh.json",
19
24
  "./package.json": "./package.json"
20
25
  },
21
26
  "dsh": {
22
27
  "engines": {
23
- "dsh": ">=0.2.0-rc.2"
28
+ "dsh": ">=0.2.2-rc.1"
24
29
  },
25
30
  "bundle": {
26
31
  "patch": "./cordis.patch.yml"
@@ -47,37 +52,38 @@
47
52
  "test": "node --experimental-transform-types --test test/*.test.mjs"
48
53
  },
49
54
  "peerDependencies": {
50
- "@deepseek-ai/dsh": ">=0.2.0-rc.2",
55
+ "@deepseek-ai/dsh": ">=0.2.2-rc.1",
51
56
  "react": "^18.2.0"
52
57
  },
53
58
  "dependencies": {
54
- "@deepseek-ai/schemastery": "^3.18.4",
59
+ "@deepseek-ai/schemastery": "^3.19.0",
55
60
  "marked": "^18.0.14"
56
61
  },
57
62
  "devDependencies": {
58
- "@deepseek-ai/cordis": "^4.0.4",
59
- "@deepseek-ai/dsh-agent": "^0.2.0-rc.2",
60
- "@deepseek-ai/dsh-agent-preset-registry": "^0.2.0-rc.2",
61
- "@deepseek-ai/dsh-api-gateway": "^0.2.0-rc.2",
62
- "@deepseek-ai/dsh-api-remotes": "^0.2.0-rc.2",
63
- "@deepseek-ai/dsh-api-session-controller": "^0.2.0-rc.2",
64
- "@deepseek-ai/dsh-api-workspace-controller": "^0.2.0-rc.2",
65
- "@deepseek-ai/dsh-client-connection": "^0.2.0-rc.2",
66
- "@deepseek-ai/dsh-client-locale": "^0.2.0-rc.2",
67
- "@deepseek-ai/dsh-client-store": "^0.2.0-rc.2",
68
- "@deepseek-ai/dsh-client-ui-layout": "^0.2.0-rc.2",
69
- "@deepseek-ai/dsh-client-ui-renderer": "^0.2.0-rc.2",
70
- "@deepseek-ai/dsh-client-ui-settings": "^0.2.0-rc.2",
71
- "@deepseek-ai/dsh-client-ui-sidebar": "^0.2.0-rc.2",
72
- "@deepseek-ai/dsh-client-ui-slots": "^0.2.0-rc.2",
73
- "@deepseek-ai/dsh-client-ui-workspace": "^0.2.0-rc.2",
74
- "@deepseek-ai/dsh-commands": "^0.2.0-rc.2",
75
- "@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.2",
76
- "@deepseek-ai/dsh-llm": "^0.2.0-rc.2",
77
- "@deepseek-ai/dsh-settings": "^0.2.0-rc.2",
78
- "@deepseek-ai/dsh-system-prompt": "^0.2.0-rc.2",
79
- "@deepseek-ai/dsh-tools": "^0.2.0-rc.2",
80
- "@deepseek-ai/dsh-workspace": "^0.2.0-rc.2",
63
+ "@deepseek-ai/cordis": "^4.1.0",
64
+ "@deepseek-ai/dsh-agent": "^0.2.2-rc.1",
65
+ "@deepseek-ai/dsh-agent-preset-registry": "^0.2.2-rc.1",
66
+ "@deepseek-ai/dsh-attachment": "^0.2.2-rc.1",
67
+ "@deepseek-ai/dsh-api-gateway": "^0.2.2-rc.1",
68
+ "@deepseek-ai/dsh-api-remotes": "^0.2.2-rc.1",
69
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.2-rc.1",
70
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.2.2-rc.1",
71
+ "@deepseek-ai/dsh-client-connection": "^0.2.2-rc.1",
72
+ "@deepseek-ai/dsh-client-locale": "^0.2.2-rc.1",
73
+ "@deepseek-ai/dsh-client-store": "^0.2.2-rc.1",
74
+ "@deepseek-ai/dsh-client-ui-layout": "^0.2.2-rc.1",
75
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.1",
76
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.1",
77
+ "@deepseek-ai/dsh-client-ui-sidebar": "^0.2.2-rc.1",
78
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.1",
79
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.2.2-rc.1",
80
+ "@deepseek-ai/dsh-commands": "^0.2.2-rc.1",
81
+ "@deepseek-ai/dsh-host-webserver": "^0.2.2-rc.1",
82
+ "@deepseek-ai/dsh-llm": "^0.2.2-rc.1",
83
+ "@deepseek-ai/dsh-settings": "^0.2.2-rc.1",
84
+ "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.1",
85
+ "@deepseek-ai/dsh-tools": "^0.2.2-rc.1",
86
+ "@deepseek-ai/dsh-workspace": "^0.2.2-rc.1",
81
87
  "@types/node": "^22.20.0",
82
88
  "@types/react": "~18.3.1",
83
89
  "@types/react-dom": "^18.3.5",
@@ -96,7 +102,8 @@
96
102
  "lib/**/*.d.ts.map",
97
103
  "src",
98
104
  "cordis.patch.yml",
99
- "icon.svg",
105
+ "icon.png",
106
+ "locale",
100
107
  "README.en.md",
101
108
  "LICENSE",
102
109
  "NOTICE"