@linxin666/dsh-client-ui-task-board 0.4.21 → 0.4.23

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 (51) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +7 -6
  3. package/README.zh.md +7 -6
  4. package/lib/client.js +452 -95
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +84 -47
  7. package/lib/types/client/TaskBoardSettingsCard.d.ts +1 -1
  8. package/lib/types/client/board/AttachmentField.d.ts +3 -1
  9. package/lib/types/client/board/NewTaskModal.d.ts +4 -2
  10. package/lib/types/client/board/TaskBoard.d.ts +16 -1
  11. package/lib/types/client/board/model-options.d.ts +2 -2
  12. package/lib/types/client/index.d.ts +1 -1
  13. package/lib/types/client/locales.d.ts +4 -0
  14. package/lib/types/client/native-panel.d.ts +19 -1
  15. package/lib/types/client/session-activity.d.ts +36 -0
  16. package/lib/types/client/user-message-action.d.ts +46 -0
  17. package/lib/types/core/controller.d.ts +16 -0
  18. package/lib/types/core/model-catalog.d.ts +1 -1
  19. package/lib/types/core/tasks.d.ts +9 -0
  20. package/lib/types/core/use-cases/task-update.d.ts +25 -17
  21. package/lib/types/dsh-home.d.ts +13 -3
  22. package/lib/types/host-routes.d.ts +2 -6
  23. package/lib/types/tool-surface.d.ts +6 -2
  24. package/package.json +33 -33
  25. package/src/client/TaskBoardSettingsCard.tsx +2 -2
  26. package/src/client/board/AttachmentField.tsx +6 -1
  27. package/src/client/board/EditTaskModal.tsx +4 -1
  28. package/src/client/board/NewTaskModal.tsx +8 -6
  29. package/src/client/board/TaskBoard.tsx +59 -13
  30. package/src/client/board/TaskDetail.tsx +16 -11
  31. package/src/client/board/model-options.ts +18 -8
  32. package/src/client/board.module.css +32 -0
  33. package/src/client/index.ts +31 -19
  34. package/src/client/locales.ts +8 -0
  35. package/src/client/native-panel.tsx +85 -5
  36. package/src/client/session-activity.tsx +163 -0
  37. package/src/client/user-message-action.tsx +211 -0
  38. package/src/core/controller.ts +30 -0
  39. package/src/core/model-catalog.ts +1 -1
  40. package/src/core/store.ts +2 -0
  41. package/src/core/tasks.ts +13 -0
  42. package/src/core/use-cases/task-update.ts +29 -19
  43. package/src/dsh-home.ts +35 -12
  44. package/src/host/agent-tools.ts +8 -0
  45. package/src/host-ledger.ts +11 -5
  46. package/src/host-routes.ts +7 -16
  47. package/src/host-runner.ts +4 -4
  48. package/src/host-service.ts +6 -1
  49. package/src/index.ts +2 -3
  50. package/src/protocol.ts +4 -0
  51. package/src/tool-surface.ts +17 -2
package/lib/index.js CHANGED
@@ -43,9 +43,9 @@ function spendCapMessage(usedTokens, cap) {
43
43
  //#endregion
44
44
  //#region src/dsh-home.ts
45
45
  /**
46
- * DSH_HOME resolution shared by the plugin family's Host halves: the
47
- * environment override wins, the platform home fallback follows. Mirrors
48
- * what dsh-pet and dsh-liangshen each used to implement locally.
46
+ * DSH_HOME and DSH_AGENTS_HOME resolution shared by the plugin family's Host
47
+ * halves: environment overrides win (blank values treated as unset), then the
48
+ * platform home fallbacks follow — mirroring `@deepseek-ai/dsh-home-paths`.
49
49
  */
50
50
  /** Expand a leading ~ (or ~user) in a path, platform-style. */
51
51
  function expandHome(path, home = homedir()) {
@@ -54,6 +54,16 @@ function expandHome(path, home = homedir()) {
54
54
  if (path.startsWith("~/") || path.startsWith("~\\")) return j(home, path.slice(2));
55
55
  return path;
56
56
  }
57
+ function resolveUserRoot(envValue, defaultDirName, home) {
58
+ const isPosix = home.startsWith("/");
59
+ const j = isPosix ? join$1 : join;
60
+ const isAbs = isPosix ? isAbsolute$1 : isAbsolute;
61
+ if (envValue !== void 0 && envValue.trim() !== "") {
62
+ const expanded = expandHome(envValue.trim(), home);
63
+ return isAbs(expanded) ? expanded : j(process.cwd(), expanded);
64
+ }
65
+ return j(home, defaultDirName);
66
+ }
57
67
  /**
58
68
  * Resolve the DSH home directory.
59
69
  * @param env - process environment to read DSH_HOME from.
@@ -61,15 +71,7 @@ function expandHome(path, home = homedir()) {
61
71
  * @returns the absolute DSH home path.
62
72
  */
63
73
  function resolveDshHome(env = process.env, home = homedir()) {
64
- const isPosix = home.startsWith("/");
65
- const j = isPosix ? join$1 : join;
66
- const isAbs = isPosix ? isAbsolute$1 : isAbsolute;
67
- const raw = env.DSH_HOME;
68
- if (raw !== void 0 && raw.trim() !== "") {
69
- const expanded = expandHome(raw.trim(), home);
70
- return isAbs(expanded) ? expanded : j(process.cwd(), expanded);
71
- }
72
- return j(home, ".dsh");
74
+ return resolveUserRoot(env.DSH_HOME, ".dsh", home);
73
75
  }
74
76
  /** Resolve the DSH home directory from the live environment. */
75
77
  function dshHome() {
@@ -1200,7 +1202,9 @@ function startExecution(task, now, executionId, initiatedBy, runGroupId, rework)
1200
1202
  ...task.freeze === void 0 ? {} : {
1201
1203
  frozenAt: task.freeze.frozenAt,
1202
1204
  ...task.freeze.frozenBy === void 0 ? {} : { frozenBy: task.freeze.frozenBy }
1203
- }
1205
+ },
1206
+ promptSnapshot: task.prompt,
1207
+ titleSnapshot: task.title
1204
1208
  };
1205
1209
  return {
1206
1210
  task: {
@@ -1855,6 +1859,8 @@ function isTaskRecordShape(value) {
1855
1859
  if (entry.initiatedBy !== void 0 && typeof entry.initiatedBy !== "string") return false;
1856
1860
  if (entry.frozenBy !== void 0 && typeof entry.frozenBy !== "string") return false;
1857
1861
  if (entry.frozenAt !== void 0 && typeof entry.frozenAt !== "number") return false;
1862
+ if (entry.promptSnapshot !== void 0 && typeof entry.promptSnapshot !== "string") return false;
1863
+ if (entry.titleSnapshot !== void 0 && typeof entry.titleSnapshot !== "string") return false;
1858
1864
  if (entry.external !== void 0 && typeof entry.external !== "boolean") return false;
1859
1865
  }
1860
1866
  return true;
@@ -2727,26 +2733,23 @@ function applyDeleteTag(tasks, name, now) {
2727
2733
  * back to the runtime default); an unknown permission string is ignored so
2728
2734
  * stale UI can never persist a value the execution service rejects.
2729
2735
  */
2730
- /** The fields that edit the task's content (what the user reads and what the
2731
- * next execution sends). Unlike the execution targets they stay editable only
2732
- * while the task has never started executing — after the first run the
2733
- * recorded prompt is the record of what actually ran, so it becomes read-only.
2736
+ /**
2737
+ * The fields that freeze with the first run. Split by what keeps them honest:
2738
+ *
2739
+ * - The CONTENT fields stay editable between runs because every execution
2740
+ * record captures the prompt/title snapshot it was opened with (see
2741
+ * `startExecution`), so a post-run edit changes only the next run, never
2742
+ * the audit trail.
2743
+ * - The ATTACHMENTS freeze at the first run and stay frozen: they are binary
2744
+ * references the record does not snapshot, and a card whose first run
2745
+ * already consumed an image keeps that image — the record of what ran
2746
+ * stays what it was. `canEditTaskAttachments` owns that boundary.
2734
2747
  */
2735
2748
  const TASK_CONTENT_FIELDS = [
2736
2749
  "title",
2737
2750
  "description",
2738
2751
  "prompt"
2739
2752
  ];
2740
- /**
2741
- * The fields that freeze with the card content: the text the card says AND
2742
- * the attachments it carries.
2743
- *
2744
- * The attachments freeze with the content because they ARE part of what the
2745
- * card hands to its execution: a card whose first run already consumed an
2746
- * image keeps that image, and the record of what ran stays what it was. An
2747
- * executed or archived card therefore refuses an attachment change exactly
2748
- * as it refuses a prompt change.
2749
- */
2750
2753
  const TASK_FROZEN_FIELDS = [...TASK_CONTENT_FIELDS, "attachments"];
2751
2754
  /** Whether an update patch touches any task-content field. */
2752
2755
  function hasContentPatch(patch) {
@@ -2754,12 +2757,25 @@ function hasContentPatch(patch) {
2754
2757
  }
2755
2758
  /**
2756
2759
  * Whether a task's content may still be edited: the task must be on-board
2757
- * (not archived) and must never have started executing. Fail-closed: a task
2758
- * with any execution record — running, settled, or cancelled before launch —
2759
- * keeps its content fixed. The run, not the column, is the trigger: a card
2760
- * parked in 'running' by hand has nothing recorded yet and stays editable.
2760
+ * (not archived) and must not have an open execution. Settled history does
2761
+ * NOT lock the card: new execution records carry the prompt/title snapshot
2762
+ * they were opened with (`promptSnapshot`/`titleSnapshot`), so a
2763
+ * post-run edit changes only the next run, never the audit trail. The run,
2764
+ * not the column, stays the trigger: a card parked in 'running' by hand has
2765
+ * nothing recorded yet and stays editable, and a card mid-run is locked
2766
+ * until its execution settles.
2761
2767
  */
2762
2768
  function canEditTaskContent(task) {
2769
+ return task.archivedAt === void 0 && !hasOpenExecution(task);
2770
+ }
2771
+ /**
2772
+ * Whether a task's attachments may still be edited: unlike the content
2773
+ * fields, attachments are NOT captured on the execution record, so they keep
2774
+ * the historical boundary — editable until the first run opens, frozen for
2775
+ * every executed or archived card afterwards. The record of what ran keeps
2776
+ * referencing exactly what ran.
2777
+ */
2778
+ function canEditTaskAttachments(task) {
2763
2779
  return task.archivedAt === void 0 && task.executions.length === 0;
2764
2780
  }
2765
2781
  /** Keep an unknown permission string from entering the ledger. */
@@ -2915,6 +2931,8 @@ function validImportedKnownFields(value) {
2915
2931
  if (execution.external !== void 0 && typeof execution.external !== "boolean") return false;
2916
2932
  if (execution.frozenBy !== void 0 && typeof execution.frozenBy !== "string") return false;
2917
2933
  if (execution.frozenAt !== void 0 && typeof execution.frozenAt !== "number") return false;
2934
+ if (execution.promptSnapshot !== void 0 && typeof execution.promptSnapshot !== "string") return false;
2935
+ if (execution.titleSnapshot !== void 0 && typeof execution.titleSnapshot !== "string") return false;
2918
2936
  }
2919
2937
  }
2920
2938
  return true;
@@ -2942,7 +2960,9 @@ function importedTask(value) {
2942
2960
  ...execution.initiatedBy === void 0 ? {} : { initiatedBy: execution.initiatedBy },
2943
2961
  ...execution.external === true ? { external: true } : {},
2944
2962
  ...execution.frozenAt === void 0 ? {} : { frozenAt: execution.frozenAt },
2945
- ...execution.frozenBy === void 0 ? {} : { frozenBy: execution.frozenBy }
2963
+ ...execution.frozenBy === void 0 ? {} : { frozenBy: execution.frozenBy },
2964
+ ...execution.promptSnapshot === void 0 ? {} : { promptSnapshot: execution.promptSnapshot },
2965
+ ...execution.titleSnapshot === void 0 ? {} : { titleSnapshot: execution.titleSnapshot }
2946
2966
  })),
2947
2967
  ...task.schedule === void 0 ? {} : { schedule: { ...task.schedule } },
2948
2968
  ...task.parentId === void 0 ? {} : { parentId: task.parentId },
@@ -4318,6 +4338,7 @@ var HostTaskLedger = class {
4318
4338
  const task = this.document.tasks.find((task) => task.id === action.taskId);
4319
4339
  if (task === void 0) throw new Error("task not found");
4320
4340
  if (task.archivedAt !== void 0) throw new Error("archived task is read-only");
4341
+ if ("attachments" in action.patch && !canEditTaskAttachments(task)) throw new Error("task has already been executed");
4321
4342
  if (hasContentPatch(action.patch) && !canEditTaskContent(task)) throw new Error("task has already been executed");
4322
4343
  if ("title" in action.patch && action.patch.title?.trim() === "") throw new Error("title is required");
4323
4344
  const patch = action.patch.freeze === null || action.patch.freeze === void 0 || initiator === void 0 || initiator === "" ? action.patch : {
@@ -5846,7 +5867,7 @@ function nonCompletedTurnEnd(data) {
5846
5867
  */
5847
5868
  function invokeWireArgs(namespace, method, request) {
5848
5869
  if (namespace === "agentPresets" && method === "list") return {};
5849
- if (namespace === "session" && method === "modelCatalog") return {};
5870
+ if (namespace === "models" && method === "catalog") return {};
5850
5871
  if (namespace === "session" && method === "list") return { _request: request };
5851
5872
  return { request };
5852
5873
  }
@@ -6132,9 +6153,9 @@ var HostExecutionRunner = class HostExecutionRunner {
6132
6153
  */
6133
6154
  async modelCatalog() {
6134
6155
  try {
6135
- return await this.invoke("session", "modelCatalog", {});
6156
+ return await this.invoke("models", "catalog", {});
6136
6157
  } catch (error) {
6137
- console.warn("[dsh-task-board] session/modelCatalog failed; the board falls back to the pinned route", error);
6158
+ console.warn("[dsh-task-board] models/catalog failed; the board falls back to the pinned route", error);
6138
6159
  return;
6139
6160
  }
6140
6161
  }
@@ -8162,7 +8183,7 @@ var TaskBoardHostService = class {
8162
8183
  */
8163
8184
  onScheduleFire(target) {
8164
8185
  if (this.disposed || !this.active) return;
8165
- const now = this.now();
8186
+ const now = Math.max(this.now(), target);
8166
8187
  this.scheduleTarget = void 0;
8167
8188
  this.ledger.setScheduler({ lastTickAt: now });
8168
8189
  if (now - target > RECOVERY_TOLERANCE_MS) {
@@ -8781,6 +8802,7 @@ function buildTaskBoardTools(host) {
8781
8802
  function buildSetParentTool(host) {
8782
8803
  return defineTool({
8783
8804
  name: "task_board_set_parent",
8805
+ environment: "independent",
8784
8806
  description: [
8785
8807
  "Attach an existing task under a parent (making it a subtask) or detach it back to the root board by setting its parentId.",
8786
8808
  "Pass an empty parentId to detach.",
@@ -8825,6 +8847,7 @@ function buildSetParentTool(host) {
8825
8847
  function buildRunTool(host) {
8826
8848
  return defineTool({
8827
8849
  name: "task_board_run",
8850
+ environment: "independent",
8828
8851
  description: [
8829
8852
  "Run a task on the board now, or re-run a settled one.",
8830
8853
  "Running a card opens ONE session for that card: no session is opened for its subtasks, and the card agent dispatches them itself with subagent. A card whose subtasks are still unfinished runs under the liangshen agent preset and is told which cards to pick up.",
@@ -8889,6 +8912,7 @@ function buildRunTool(host) {
8889
8912
  function buildManageTool(host) {
8890
8913
  return defineTool({
8891
8914
  name: "task_board_manage",
8915
+ environment: "independent",
8892
8916
  description: [
8893
8917
  "Move, archive, restore, delete, or settle one task board card.",
8894
8918
  "move-backlog, move-todo, move-running, move-done and move-failed are the manual column moves and cover every column; a card the runner is executing (one with an open execution) cannot be moved.",
@@ -9034,6 +9058,7 @@ function buildManageTool(host) {
9034
9058
  function buildScheduleTool(host) {
9035
9059
  return defineTool({
9036
9060
  name: "task_board_schedule",
9061
+ environment: "independent",
9037
9062
  description: [
9038
9063
  "Arm, change, or disarm a task scheduled runs. Two kinds of plan exist: a recurring 5-field cron rule (day-of-month and day-of-week follow Vixie semantics: both restricted means OR, otherwise AND), and a one-shot that runs once at a future instant.",
9039
9064
  "For a one-shot pass mode \"once\" with at (the planned instant, ms since epoch UTC). For a recurring rule pass mode \"cron\" (or omit mode) with a cron expression, optionally capped by maxRuns (a positive whole number of scheduled executions; omit for unlimited, pass 0 to clear a cap).",
@@ -9111,6 +9136,7 @@ function buildScheduleTool(host) {
9111
9136
  function buildListTool(host) {
9112
9137
  return defineTool({
9113
9138
  name: "task_board_list",
9139
+ environment: "independent",
9114
9140
  description: [
9115
9141
  "List tasks on the DSH task board (the Host-authoritative ledger behind the Web GUI task board).",
9116
9142
  "Filters: status column, parentId (direct subtasks), rootsOnly, tag, free-text query, and archived inclusion.",
@@ -9192,6 +9218,7 @@ function buildListTool(host) {
9192
9218
  function buildGetTool(host) {
9193
9219
  return defineTool({
9194
9220
  name: "task_board_get",
9221
+ environment: "independent",
9195
9222
  description: [
9196
9223
  "Read one task board card in full: prompt, description, labels, column, parent link, direct subtasks, execution targets, schedule, permission gate state, and the last ten execution attempts with their session ids and outcomes.",
9197
9224
  "Use it before running or editing a card, after a run to read the settled outcome, and to read each subtask card before dispatching it with subagent.",
@@ -9221,6 +9248,7 @@ function buildGetTool(host) {
9221
9248
  function buildCreateTool(host) {
9222
9249
  return defineTool({
9223
9250
  name: "task_board_create",
9251
+ environment: "independent",
9224
9252
  description: [
9225
9253
  "Create a task on the DSH task board, or a subtask by passing parentId.",
9226
9254
  "A subtask inherits every execution target it does not override (workspace, agent preset, permission, model, reasoning effort) from its parent, and inherits the parent human permission confirmation together with an inherited binding.",
@@ -9372,6 +9400,7 @@ function buildCreateTool(host) {
9372
9400
  function buildUpdateTool(host) {
9373
9401
  return defineTool({
9374
9402
  name: "task_board_update",
9403
+ environment: "independent",
9375
9404
  description: [
9376
9405
  "Edit a task board card: title, description, prompt, labels, and the execution targets (workspace, agent preset, permission, model, reasoning effort, session reuse).",
9377
9406
  "Only the fields you pass change; pass an empty string to clear a target, or an empty labels array to clear the labels.",
@@ -9524,11 +9553,15 @@ const PLUGIN_TOOL_SECTION_ORDERS = {
9524
9553
  agents: 220
9525
9554
  };
9526
9555
  /**
9527
- * Build a section provider that renders \`text\` only while at least one of
9528
- * \`toolNames\` is visible to the rendering scope.
9556
+ * Build a section provider that renders `text` only while at least one of
9557
+ * `toolNames` is visible to the rendering scope.
9529
9558
  *
9530
9559
  * The native convention: a tool that a restriction, a preset, or a missing
9531
9560
  * registry removed must not leave guidance behind telling the model to call it.
9561
+ * Under a 0.2.3-alpha.3+ PTC root registry (`PtcToolRegistry`), `tools.get(name,
9562
+ * scope)` exposes only the `run_code` transport while binding registered tools
9563
+ * inside programs; when `run_code` is active in the rendering scope, fall back
9564
+ * to checking the unscoped registry so guidance does not vanish under PTC.
9532
9565
  * An unreadable registry renders the text unchanged — guidance that outlives a
9533
9566
  * momentary read failure is recoverable; guidance for a tool that is gone is
9534
9567
  * not.
@@ -9545,6 +9578,13 @@ function visibleToolText(tools, toolNames, text) {
9545
9578
  } catch {
9546
9579
  return text;
9547
9580
  }
9581
+ if (context.scope !== void 0 && toolNames.length > 0) try {
9582
+ if (tools.get("run_code", context.scope) !== void 0) {
9583
+ for (const name of toolNames) if (tools.get(name) !== void 0) return text;
9584
+ }
9585
+ } catch {
9586
+ return text;
9587
+ }
9548
9588
  return "";
9549
9589
  };
9550
9590
  }
@@ -9783,11 +9823,9 @@ function matchesToken(candidate, expected) {
9783
9823
  */
9784
9824
  function isTrustedTaskBoardRequest(req, access) {
9785
9825
  const connection = access.connection?.();
9786
- if (connection !== void 0) try {
9787
- if (typeof connection.admit === "function") {
9788
- const admission = connection.admit(req);
9789
- if (admission.rejection === void 0 && "peer" in admission && admission.peer !== void 0) return true;
9790
- } else if (typeof connection.requestRejection === "function" && connection.requestRejection(req) === void 0) return true;
9826
+ if (connection !== void 0 && typeof connection.admit === "function") try {
9827
+ const admission = connection.admit(req);
9828
+ if (admission.rejection === void 0 && "peer" in admission && admission.peer !== void 0) return true;
9791
9829
  } catch {}
9792
9830
  if (!browserSameOriginMarker(req)) return false;
9793
9831
  if (isLoopbackRequest(req)) return true;
@@ -10236,7 +10274,7 @@ function mountOnce(packageName, fn) {
10236
10274
  //#endregion
10237
10275
  //#region src/core/model-catalog.ts
10238
10276
  /**
10239
- * Normalize the raw `session/modelCatalog` reply into the shape the board
10277
+ * Normalize the raw `models/catalog` reply into the shape the board
10240
10278
  * reads. Everything is optional in the wire value, so every level is checked:
10241
10279
  * an unreadable catalog degrades to "unknown", never to a crash.
10242
10280
  * @param value - the raw gateway reply.
@@ -10401,7 +10439,7 @@ function resolveConnectionTrust(ctx) {
10401
10439
  try {
10402
10440
  const connection = ctx.get("connection");
10403
10441
  if (connection === void 0 || connection === null) return void 0;
10404
- return typeof connection.admit === "function" || typeof connection.requestRejection === "function" ? connection : void 0;
10442
+ return typeof connection.admit === "function" ? connection : void 0;
10405
10443
  } catch {
10406
10444
  return;
10407
10445
  }
@@ -10714,8 +10752,7 @@ function applyImpl(ctx, config) {
10714
10752
  * \"connection.authentication\" without inject", which escaped every route
10715
10753
  * handler as a bare 400. The scope keeps the row's own inject list unchanged
10716
10754
  * (the service stays optional: a deployment without it keeps the loopback
10717
- * fence), and a cohort whose connection has no authentication sub-service
10718
- * simply never activates this scope, leaving the `requestRejection` bridge.
10755
+ * fence).
10719
10756
  */
10720
10757
  let admittedConnection;
10721
10758
  const scopedInjectConnection = ctx.inject;
@@ -3,7 +3,7 @@
3
3
  * idle-sleep protection. Registers into the `web-ui.plugin.item` child slot
4
4
  * the Web UI plugin group renders, bound to the `task-board` namespace.
5
5
  */
6
- import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
6
+ import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots/client';
7
7
  import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
8
8
  import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
9
9
  import type { TaskBoardExtensionDispatch } from '../core/extension.ts';
@@ -56,7 +56,7 @@ export declare function attachmentKindOf(file: File): TaskAttachmentKind;
56
56
  * The component owns the local staging only: the selection it reports is what
57
57
  * the card will carry, and the parent uploads the staged files on save.
58
58
  */
59
- export declare function AttachmentField({ selection, onChange, limits, disabled, onError, }: {
59
+ export declare function AttachmentField({ selection, onChange, limits, disabled, lockedHint, onError, }: {
60
60
  /** What the card currently carries and what is staged on top of it. */
61
61
  selection: AttachmentSelection;
62
62
  /** Receives the new selection after every change. */
@@ -65,6 +65,8 @@ export declare function AttachmentField({ selection, onChange, limits, disabled,
65
65
  limits?: AttachmentLimits;
66
66
  /** Whether the field refuses new input. */
67
67
  disabled?: boolean;
68
+ /** Replaces the inviting upload hint when the caller locks the field. */
69
+ lockedHint?: string;
68
70
  /** Receives the reason a selection was refused. */
69
71
  onError?: (message: string) => void;
70
72
  }): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { BoardController } from '../../core/controller.ts';
1
+ import type { BoardController, ComposeTaskDraft } from '../../core/controller.ts';
2
2
  import { type TaskRecord } from '../../core/tasks.ts';
3
3
  import type { OverlayPhase } from './overlay.tsx';
4
4
  export interface NewTaskModalProps {
@@ -6,6 +6,8 @@ export interface NewTaskModalProps {
6
6
  onClose: () => void;
7
7
  /** Optional task template to clone/duplicate from. */
8
8
  initialTask?: TaskRecord;
9
+ /** Optional prefilled draft (creates a fresh card, not a duplicate). */
10
+ initialDraft?: ComposeTaskDraft;
9
11
  /**
10
12
  * Workspace the board's project filter has selected (#1536): a task created
11
13
  * while a project is open belongs to that project unless the user changes it.
@@ -23,4 +25,4 @@ export interface NewTaskModalProps {
23
25
  phase?: OverlayPhase;
24
26
  }
25
27
  /** New-task form overlay. */
26
- export declare function NewTaskModal({ controller, onClose, initialTask, defaultWorkspaceId, onDuplicateSuccess, parentTask, phase }: NewTaskModalProps): import("react").JSX.Element;
28
+ export declare function NewTaskModal({ controller, onClose, initialTask, initialDraft, defaultWorkspaceId, onDuplicateSuccess, parentTask, phase }: NewTaskModalProps): import("react").JSX.Element;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Board view: the multi-column kanban that replaces the middle column while
3
+ * active. Cards open the task detail (never execute directly); the header
4
+ * offers filter, new-task, and a back-to-chat escape.
5
+ */
6
+ import { type ReactNode } from 'react';
1
7
  import { type BoardController } from '../../core/controller.ts';
2
8
  import { type TaskRecord } from '../../core/tasks.ts';
3
9
  /** Sentinel option value of the project row's "register a new project" entry. */
@@ -20,7 +26,16 @@ export declare function matchesFilter(task: TaskRecord, filter: string): boolean
20
26
  export declare function matchesTagFilter(task: TaskRecord, selected: readonly string[]): boolean;
21
27
  /** Cards a grouped column renders before the oldest group folds. */
22
28
  export declare const COLUMN_FOLD_THRESHOLD = 30;
29
+ /** Props accepted by the optional `directory.browser.dialog` slot factory wrapper. */
30
+ export interface ProjectDirectoryDialogProps {
31
+ readonly open: boolean;
32
+ readonly busy: boolean;
33
+ readonly onOpen: (path: string) => void;
34
+ readonly onClose: () => void;
35
+ }
23
36
  /** Board component; subscribes to the controller snapshot. */
24
- export declare function TaskBoard({ controller }: {
37
+ export declare function TaskBoard({ controller, renderDirectoryDialog }: {
25
38
  controller: BoardController;
39
+ /** Optional shell `directory.browser.dialog` factory renderer for choosing a project folder. */
40
+ renderDirectoryDialog?: (props: ProjectDirectoryDialogProps) => ReactNode;
26
41
  }): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Execution model options: the picker rows built from the official
3
- * `session/modelCatalog` reply, and the reasoning-effort derivation both
3
+ * `models/catalog` reply, and the reasoning-effort derivation both
4
4
  * execution-target editors read off them (the create dialog and the detail
5
5
  * page share one contract here, so they cannot promise different levels).
6
6
  *
@@ -19,7 +19,7 @@
19
19
  import type { ExecutionModelOption } from '../../core/controller.ts';
20
20
  import type { TaskBoardKey } from '../locales.ts';
21
21
  /**
22
- * Normalize a `session/modelCatalog` reply into picker rows: one row per model
22
+ * Normalize a `models/catalog` reply into picker rows: one row per model
23
23
  * of every provider group, keyed by the qualified route an execution pins.
24
24
  * @param value - the raw catalog reply.
25
25
  * @returns the rows, empty when the reply is unreadable.
@@ -34,7 +34,7 @@ export interface SettingsFormBinder {
34
34
  /** Bind one family settings namespace. */
35
35
  bind<T>(spec: SettingsFormSpec<T>): ConfigForm<T>;
36
36
  }
37
- declare module '@deepseek-ai/dsh-client-ui-slots' {
37
+ declare module '@deepseek-ai/dsh-client-ui-slots/client' {
38
38
  interface LocaleNamespaceMap {
39
39
  /** Task-board surface copy. */
40
40
  'task-board': TaskBoardKey;
@@ -7,6 +7,7 @@
7
7
  /** zh dictionary (key-set source of truth). */
8
8
  export declare const zh: {
9
9
  'entry.label': string;
10
+ 'activity.title': string;
10
11
  'board.title': string;
11
12
  'board.close': string;
12
13
  'board.new': string;
@@ -41,8 +42,10 @@ export declare const zh: {
41
42
  'board.projectNew': string;
42
43
  'board.projectNewPath': string;
43
44
  'board.projectNewPathPlaceholder': string;
45
+ 'board.projectBrowse': string;
44
46
  'board.projectCreate': string;
45
47
  'board.projectCreateFailed': string;
48
+ 'chat.turnIntoTask': string;
46
49
  'new.aiParse': string;
47
50
  'new.aiParseHint': string;
48
51
  'new.aiParsePlaceholder': string;
@@ -157,6 +160,7 @@ export declare const zh: {
157
160
  'detail.close': string;
158
161
  'edit.title': string;
159
162
  'edit.save': string;
163
+ 'edit.attachmentsLocked': string;
160
164
  'new.duplicateTitle': string;
161
165
  'new.archiveOriginal': string;
162
166
  'detail.prompt': string;
@@ -20,6 +20,18 @@ export declare function TaskBoardPanelIcon({ size }: {
20
20
  size: number;
21
21
  active: boolean;
22
22
  }): React.ReactElement;
23
+ /** Slot factory name owned by `@deepseek-ai/dsh-client-ui-directory-picker-browse`. */
24
+ export declare const DIRECTORY_BROWSER_DIALOG_FACTORY = "directory.browser.dialog";
25
+ type RenderFactorySlotFn = (name: string, props: Record<string, unknown>, options?: {
26
+ readonly fallback?: ReactNode;
27
+ }) => ReactNode;
28
+ /** Minimal slice of `ctx.uiWorkspace` needed to drive `directory.browser.dialog`. */
29
+ export interface WorkspaceDirectorySource {
30
+ readonly listDirectory: (path?: string, signal?: AbortSignal) => Promise<unknown>;
31
+ readonly createDirectory?: (path: string, name: string) => Promise<string>;
32
+ }
33
+ /** Whether the host slot registry currently exposes the reusable `directory.browser.dialog` factory. */
34
+ export declare function hasDirectoryBrowserFactory(slots: unknown): boolean;
23
35
  /**
24
36
  * The main-slot page. The layout mounts it only while the board is the selected
25
37
  * panel, so the conversation keeps the center column untouched the rest of the
@@ -29,10 +41,16 @@ export declare function TaskBoardPanelIcon({ size }: {
29
41
  * @param props - the framework main-slot share plus this entry's injected face.
30
42
  * @returns the board page.
31
43
  */
32
- export declare function TaskBoardPanel({ controller, renderSlot }: {
44
+ export declare function TaskBoardPanel({ controller, renderSlot, renderFactorySlot, directorySource, hasDirectoryDialog }: {
33
45
  controller: BoardController;
34
46
  /** Child-slot renderer the registration declares (detail, card decoration, new-card section). */
35
47
  renderSlot?: SlotRenderBinding;
48
+ /** Factory-slot renderer supplied automatically by the shell slot renderer. */
49
+ renderFactorySlot?: RenderFactorySlotFn;
50
+ /** Optional host directory listing/creation calls from `ctx.uiWorkspace`. */
51
+ directorySource?: WorkspaceDirectorySource;
52
+ /** Live check for whether `directory.browser.dialog` is registered in `ctx.slots`. */
53
+ hasDirectoryDialog?: () => boolean;
36
54
  }): ReactNode;
37
55
  /**
38
56
  * Register the board's sidebar row and center-column page.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Session island activity source for `dsh-task-board`.
3
+ *
4
+ * Reports ongoing task-board executions tied to a Session (either the Session
5
+ * executing a card or the Session that initiated that card's execution) to the
6
+ * official `sessionActivities` service and contributes a matching 16px glyph
7
+ * to `conversation.session.panel.activity.icon`. Reads exclusively from the
8
+ * live {@link BoardController} mirror so observing a Session costs zero extra
9
+ * network traffic.
10
+ */
11
+ import { type ReactNode } from 'react';
12
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
13
+ import type { BoardController } from '../core/controller.ts';
14
+ import type { TaskRecord } from '../core/tasks.ts';
15
+ /** Stable source id shared with the keyed `conversation.session.panel.activity.icon` entry. */
16
+ export declare const TASK_BOARD_ACTIVITY_ID = "dsh-task-board";
17
+ /** Official `SessionActivityStatus` subset reported to `sessionActivities`. */
18
+ export type TaskBoardActivityStatus = 'queued' | 'running' | 'stopping' | 'done' | 'failed' | 'inactive';
19
+ /** One reported activity unit matching `@deepseek-ai/dsh-client-ui-session-panel`. */
20
+ export interface TaskBoardSessionActivity {
21
+ readonly id: string;
22
+ readonly status: TaskBoardActivityStatus;
23
+ }
24
+ /**
25
+ * Derive the ongoing task activities linked to one Session id.
26
+ * A card counts when it has an unsettled execution (`endedAt === undefined`)
27
+ * whose own `sessionId` or `initiatedBy` matches `sessionId`.
28
+ */
29
+ export declare function taskActivitiesForSession(tasks: readonly TaskRecord[], sessionId: string): readonly TaskBoardSessionActivity[];
30
+ /** 16px task-board glyph rendered in the Session island header toggle. */
31
+ export declare function TaskBoardActivityIcon(): ReactNode;
32
+ /**
33
+ * Register the optional `sessionActivities` source and matching island icon.
34
+ * Returns a disposer releasing both when the board UI unmounts or disables.
35
+ */
36
+ export declare function registerTaskBoardSessionActivity(ctx: ClientContext, controller: Pick<BoardController, 'getSnapshot' | 'subscribe'>): () => void;
@@ -0,0 +1,46 @@
1
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
2
+ import type { BoardController, ComposeTaskDraft } from '../core/controller.ts';
3
+ /** Stable slot entry id inside `conversation.chat.user-actions`. */
4
+ export declare const USER_ACTION_CREATE_TASK_ID = "task-board-create-card";
5
+ interface ChatUserNodeLike {
6
+ readonly kind?: string;
7
+ readonly data?: {
8
+ readonly messageId?: unknown;
9
+ readonly content?: unknown;
10
+ };
11
+ readonly messageId?: unknown;
12
+ readonly content?: unknown;
13
+ }
14
+ /** Structural slice of the official `ChatSnapshot` exposed through `useChat`. */
15
+ export interface ChatSnapshotLike {
16
+ readonly nodes?: {
17
+ values?(): readonly ChatUserNodeLike[];
18
+ };
19
+ readonly legacy?: {
20
+ readonly nodes?: readonly ChatUserNodeLike[];
21
+ };
22
+ }
23
+ /** Standard props passed by the shell renderer to a `conversation.chat.user-actions` entry. */
24
+ export interface UserMessageTaskActionProps {
25
+ readonly messageId: unknown;
26
+ readonly sessionId?: unknown;
27
+ readonly useChat?: <T>(selector: (snapshot: ChatSnapshotLike) => T) => T;
28
+ }
29
+ /** Optional resolver mapping a session id to its owning task-board workspace id. */
30
+ export type WorkspaceIdResolver = (sessionId: string) => string | undefined;
31
+ /**
32
+ * Extract the plain text of a durable user message identified by `messageId`
33
+ * from an official `ChatSnapshot`. Returns an empty string when absent.
34
+ */
35
+ export declare function extractUserMessageText(snapshot: ChatSnapshotLike | undefined, messageId: unknown): string;
36
+ /**
37
+ * Build a prefilled {@link ComposeTaskDraft} from a durable user message's text
38
+ * and optional owning workspace id.
39
+ */
40
+ export declare function draftFromUserMessage(text: string, workspaceId?: string): ComposeTaskDraft;
41
+ /**
42
+ * Register the "Turn into task card" icon action into `conversation.chat.user-actions`.
43
+ * When the shell does not declare that slot, nothing registers and nothing fails.
44
+ */
45
+ export declare function registerUserMessageTaskAction(ctx: ClientContext, controller: Pick<BoardController, 'openNewTaskWithDraft'>, resolveWorkspaceId?: WorkspaceIdResolver): () => void;
46
+ export {};
@@ -131,6 +131,13 @@ export interface ExecutionOptionsSnapshot {
131
131
  * constants the UI reads (session default permission, subtask depth).
132
132
  */
133
133
  export type HostMirror = Pick<TaskBoardSnapshot, 'revision' | 'extensionsRevision' | 'scheduler' | 'power' | 'sessionDefaultPermission' | 'maxSubtaskDepth' | 'cardDefaults' | 'extensions' | 'attachmentLimits'>;
134
+ /** Optional prefilled draft handed to the board's create-task modal (e.g. from a chat message action). */
135
+ export interface ComposeTaskDraft {
136
+ readonly title?: string;
137
+ readonly description?: string;
138
+ readonly prompt?: string;
139
+ readonly workspaceId?: string;
140
+ }
134
141
  /** Immutable controller snapshot for UI subscriptions. */
135
142
  export interface ControllerSnapshot {
136
143
  tasks: readonly TaskRecord[];
@@ -171,6 +178,7 @@ export declare class BoardController {
171
178
  private boardOpen;
172
179
  private archiveView;
173
180
  private selectedTaskId;
181
+ private pendingComposeDraft;
174
182
  private executionOptions;
175
183
  private workspaceCreator;
176
184
  private listeners;
@@ -234,6 +242,14 @@ export declare class BoardController {
234
242
  * shows the conversation.
235
243
  */
236
244
  openBoard(): void;
245
+ /**
246
+ * Queue a prefilled draft for the create-task modal and open the board panel.
247
+ * Stored outside {@link BoardSnapshot} so existing snapshot equality holds;
248
+ * the mounted {@link TaskBoard} consumes it once on mount or update.
249
+ */
250
+ openNewTaskWithDraft(draft: ComposeTaskDraft): void;
251
+ /** Read and clear any queued create-task draft. */
252
+ consumeComposeDraft(): ComposeTaskDraft | undefined;
237
253
  /**
238
254
  * Return the center column to the conversation. The layout's own selection is
239
255
  * the source of truth for what the column renders, so this asks for the
@@ -49,7 +49,7 @@ export declare function parseModelRoute(qualified: string | undefined): {
49
49
  model: string;
50
50
  } | undefined;
51
51
  /**
52
- * Normalize the raw `session/modelCatalog` reply into the shape the board
52
+ * Normalize the raw `models/catalog` reply into the shape the board
53
53
  * reads. Everything is optional in the wire value, so every level is checked:
54
54
  * an unreadable catalog degrades to "unknown", never to a crash.
55
55
  * @param value - the raw gateway reply.
@@ -107,6 +107,15 @@ export interface ExecutionRecord {
107
107
  frozenAt?: number;
108
108
  /** Freeze source session captured from the card snapshot when the run opened. */
109
109
  frozenBy?: string;
110
+ /**
111
+ * The prompt this execution was opened with, captured at run start. The
112
+ * card's prompt stays editable between runs; this snapshot — not the live
113
+ * field — is the record of what actually ran. Absent on executions recorded
114
+ * before snapshots were introduced.
115
+ */
116
+ promptSnapshot?: string;
117
+ /** Title captured alongside {@link promptSnapshot} when the run opened. */
118
+ titleSnapshot?: string;
110
119
  /**
111
120
  * Cascade run group shared by the parent execution and every descendant
112
121
  * execution one run request opened. Absent on a plain single-task run.