@linxin666/dsh-client-ui-task-board 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # node scripts/verify-docs.mjs --write <dir>
5
- README.md: dc528345f1bfd2b1dfce470545bcc73f9331e849
6
- README.zh.md: 847ed5ce0acfb5091f9b9a8380fd3f701777c0c7
5
+ README.md: f2a57e29fc885f288fb7adc5fb0ffde6cbb10d36
6
+ README.zh.md: 20a6aaf47bb912b7bd65e6d144f0006c2cc04f61
package/README.md CHANGED
@@ -115,6 +115,7 @@ This plugin's settings card groups its options into collapsible sections — the
115
115
  | `maxSubtaskDepth` | `1` | Subtask depth limit, 1 to 3. At 1 a task may carry one level of subtasks and a subtask cannot be given subtasks of its own; every extra level multiplies the sessions one run of the root opens. |
116
116
  | `sessionPollSeconds` | `5` | How often, in seconds, the Host re-reads the DSH session roster while the board has something to reconcile: a running card or an open execution. An idle board with neither does not poll at all. Range 1 to 300; a shorter interval settles runs sooner and costs the Host more. |
117
117
  | `runLaunchWidth` | `3` | How many run launches may be in flight at once, 1 to 16. One run opens its whole subtree, so this bounds the burst of sessions one run action creates; the waiting members still start, they just enter the running column in batches. The default follows this repository's measured guidance for heavy implementation subagents (at most three). Read at each admission, so a live edit bounds the launches that have not been admitted yet. |
118
+ | `spendBudgetTokens` | `0` | Daily token ceiling for the work this board dispatches. `0` means no gate, and the board then reads no ledger and counts nothing at all. The unit is tokens because the usage ledger prices only DeepSeek's own routes and reports 0 for every other route. Measured against the family usage ledger's local-date bucket: a manual run or re-run whose day already spent the cap is refused, and the caller sees that message as its board-refused reason; a due schedule records the refusal on the scheduler error and skips the occurrence without spending a planned run, so raising the cap or the local day rolling over admits the next trigger. Read at each gate, so an edit binds the next run without a restart. |
118
119
  | `goalRunEnabled` | `false` | GLOBAL native `/goal` switch. While off, every card runs one plain turn and the board never arms dsh's built-in `/goal`; a run uses native `/goal` only when this is on AND the card's own Start with /goal option is checked (that option is off by default). The value is frozen when an execution starts, so a live edit only affects executions that begin afterwards, and a card's stored `goalRun` preference is never rewritten. Such a run is recorded as `goal-disabled`: it is neither reported as accepted nor failed for lacking a completion call. Independent of `goalVerification`. |
119
120
  | `goalVerification` | `true` | Goal acceptance for executions this board starts. When on, `update_goal(action: complete)` inside a task execution is refused until an acceptance pass is recorded for that execution. Only goal-form executions are affected: plain chat and a card that did not opt into `goalRun` are untouched. A single card can opt out of the gate on its own with the Skip acceptance checkbox (below). |
120
121
  | `goalVerificationModel` | `''` (inherit) | Judge model route as `provider/model`. Blank inherits the HOST model catalog default — never the card's pinned execution model. |
package/README.zh.md CHANGED
@@ -115,6 +115,7 @@ dsh plugin --profile web add link:$(pwd)/packages/dsh-task-board
115
115
  | `maxSubtaskDepth` | `1` | 子任务深度上限,1 到 3。取 1 时一个任务只能有一层子任务,子任务不能再创建或关联子任务;每多一层,执行根任务一次开启的会话数就会成倍增加。 |
116
116
  | `sessionPollSeconds` | `5` | 看板有需要核对的事情(运行中的卡片或未结算执行)时,Host 重新读取 DSH 会话名册的间隔秒数。两者都没有的空闲看板完全不轮询。取值 1 到 300;间隔越短结算越快、Host 负载越高。 |
117
117
  | `runLaunchWidth` | `3` | 同一刻允许在启动中的运行数,1 到 16。一次执行会开启整棵子任务树,因此该值限制一次运行动作创建的会话洪峰;等待中的成员仍会启动,只是分批进入运行列。默认值取自本仓「重型实施子代理并发 ≤ 3」的实测纪律。每次准入时读取,修改只影响尚未入列的启动。 |
118
+ | `spendBudgetTokens` | `0` | 看板派活的每日 token 上限。`0` 表示不设闸,此时看板不读任何账本、也不做任何计数。计量单位是 token,因为使用账本只对 DeepSeek 官方路由计价,其他路由恒为 0。口径是 usage 账本按本地日期分桶的用量:当天已达上限时,手动执行与重新执行被拒绝,调用方拿到的拒绝原因就是这条文本;到点的定时执行把拒绝写进调度错误并跳过本次触发,不消耗计划次数,因此调高上限或跨过本地零点后下一次触发照常执行。每次闸门判定都重新读取,改完即时生效、无需重启。 |
118
119
  | `goalRunEnabled` | `false` | 全局原生 `/goal` 执行开关。关闭时所有卡片都按普通单回合执行,看板不再武装 dsh 内置的 `/goal`;只有它开启、且卡片自身的「以 /goal 开始执行任务」被勾选时(该选项默认关闭),运行才使用原生 /goal。该值在执行启动时冻结,因此实时修改只影响之后新开的执行,卡片存储的 `goalRun` 偏好绝不被改写。这类运行记录为 `goal-disabled`:既不会被报告为已验收通过,也不会因缺少完成调用被判失败。与 `goalVerification` 相互独立。 |
119
120
  | `goalVerification` | `true` | 本插件所开执行的 goal 验收。开启后,任务执行内的 `update_goal(action: complete)` 在该执行取得验收通过记录前一律被拒绝。只影响以 goal 形式执行的运行:普通聊天与未勾选 `goalRun` 的卡片不受影响。单张任务卡可以用「跳过本任务的验收」勾选退出本开关的约束(见下)。 |
120
121
  | `goalVerificationModel` | `''`(继承) | 裁判模型路由,形如 `provider/model`。留空继承宿主模型目录的默认路由,绝不是任务卡钉住的执行模型。 |
package/lib/client.js CHANGED
@@ -81,6 +81,12 @@ window.__ModuleLoader__.load({
81
81
  }
82
82
  //#endregion
83
83
  //#region src/core/tasks.ts
84
+ /**
85
+ * Upper bound of one recorded summary, in characters. The ledger stores a
86
+ * conclusion, not a transcript: a reader that needs the whole message follows
87
+ * {@link ExecutionSummary.seq} into the session history.
88
+ */
89
+ const EXECUTION_SUMMARY_LIMIT = 4e3;
84
90
  /** Every stop reason this build understands; the repair and wire gates share it. */
85
91
  const SCHEDULE_STOP_REASONS = [
86
92
  "fired",
@@ -2369,6 +2375,52 @@ window.__ModuleLoader__.load({
2369
2375
  if (byId === void 0 || byId === null) return void 0;
2370
2376
  for (const row of Object.values(byId)) if (row !== void 0 && (row.retainedBy?.mainView ?? 0) > 0) return row.id;
2371
2377
  }
2378
+ //#endregion
2379
+ //#region src/core/execution-summary.ts
2380
+ /**
2381
+ * What one execution left behind: the text of its last assistant message,
2382
+ * recorded on the execution record next to the verdict it belongs to.
2383
+ *
2384
+ * A settled execution used to carry only a verdict, so a parent card could see
2385
+ * that a subtask succeeded without ever seeing what it produced, and had to
2386
+ * guess or redo the work. The card's own content cannot answer that: card
2387
+ * content is the plan and freezes at the first execution
2388
+ * (`canEditTaskContent`), so the closing words of a run are recorded on the
2389
+ * execution record instead.
2390
+ *
2391
+ * Pure (no cordis, no runtime imports) so the settlement path is unit-testable
2392
+ * without a session, and so a text-less run degrades to "no field" rather than
2393
+ * to an empty string.
2394
+ */
2395
+ /**
2396
+ * Bound one summary, keeping its tail: the closing paragraphs carry the
2397
+ * conclusion a reader is after, and the omitted opening is announced instead of
2398
+ * silently dropped. Mirrors the evidence reader's tail bound.
2399
+ */
2400
+ function truncateExecutionSummary(text, limit = EXECUTION_SUMMARY_LIMIT) {
2401
+ if (text.length <= limit) return text;
2402
+ const notice = "[truncated " + String(text.length - limit) + " chars] ";
2403
+ return notice.length >= limit ? text.slice(-limit) : notice + text.slice(-(limit - notice.length));
2404
+ }
2405
+ /**
2406
+ * Repair one persisted or reported summary.
2407
+ *
2408
+ * A summary is informational, so an unreadable one is dropped on its own rather
2409
+ * than costing the execution (or the task row) it hangs on. A hand-edited
2410
+ * overlong text is bounded on the way in, so no reader ever holds more than the
2411
+ * limit.
2412
+ */
2413
+ function normalizeExecutionSummary(value) {
2414
+ if (typeof value !== "object" || value === null) return void 0;
2415
+ const row = value;
2416
+ if (typeof row.text !== "string" || typeof row.seq !== "number" || !Number.isFinite(row.seq)) return void 0;
2417
+ const text = row.text.trim();
2418
+ if (text === "") return void 0;
2419
+ return {
2420
+ text: truncateExecutionSummary(text),
2421
+ seq: row.seq
2422
+ };
2423
+ }
2372
2424
  /** Marker replacing every sensitive match. */
2373
2425
  const REDACTED_MARKER = "[REDACTED]";
2374
2426
  const BEGIN = "<<<FREEZE";
@@ -3265,6 +3317,7 @@ window.__ModuleLoader__.load({
3265
3317
  runGroupId: normalizeTargetId(execution.runGroupId),
3266
3318
  ownResult: isExecutionOutcome(execution.ownResult) ? execution.ownResult : void 0,
3267
3319
  ownError: typeof execution.ownError === "string" ? execution.ownError : void 0,
3320
+ summary: normalizeExecutionSummary(execution.summary),
3268
3321
  verification: normalizeVerification(execution.verification),
3269
3322
  external: execution.external === true ? true : void 0
3270
3323
  }));
@@ -3665,6 +3718,8 @@ window.__ModuleLoader__.load({
3665
3718
  "settings.maxSubtaskDepthOption": "{depth} 层",
3666
3719
  "settings.runLaunchWidth": "并发启动上限",
3667
3720
  "settings.runLaunchWidthHint": "默认 3。一次执行会开启整棵子任务树,但同一刻最多只有这么多个成员在创建会话并入队 Prompt,其余成员排队等待——全部都会启动,只是分批进入运行列。默认值取自本仓「重型实施子代理并发 ≤ 3」的实测纪律。取值 1–16:越大启动越快,Host 的内存与 swap 压力越高。执行中修改只影响尚未入列的启动。",
3721
+ "settings.spendBudgetTokens": "每日 token 上限",
3722
+ "settings.spendBudgetTokensHint": "默认 0,表示不设闸,行为与没有这项设置时完全一致(不读账本、不计数)。设为正整数后,今日已用 token 达到该值时:手动执行与重新执行被拒绝,调用方看到的拒绝文本就是原因;到点的定时执行把原因写进调度错误并跳过本次触发,不消耗计划次数,因此调高上限或跨过本地零点后下一次触发照常执行。计量单位是 token 而不是金额:使用账本只对 DeepSeek 官方路由计价,其他路由恒为 0。今日已用取自该账本按本地日期分桶的输入、缓存读写与输出之和,与「使用统计」面板的口径一致。",
3668
3723
  "settings.runBehaviorTitle": "运行行为",
3669
3724
  "settings.runBehaviorCardHint": "全局原生 /goal 执行开关(总开关,默认关闭)。",
3670
3725
  "settings.goalRunGlobal": "全局启用 DSH 原生 /goal 执行",
@@ -4105,6 +4160,8 @@ window.__ModuleLoader__.load({
4105
4160
  "settings.maxSubtaskDepthOption": "{depth} levels",
4106
4161
  "settings.runLaunchWidth": "Concurrent run launches",
4107
4162
  "settings.runLaunchWidthHint": "Default 3. A run opens its whole subtree, but only this many members create their session and queue their prompt at the same time; the rest wait their turn. Every member still starts, entering the running column in batches. The default comes from this repository's measured guidance for heavy implementation subagents (at most three). Range 1 to 16: a larger width starts runs sooner and costs the Host more memory and swap. Edited during a run, it bounds the launches that have not been admitted yet.",
4163
+ "settings.spendBudgetTokens": "Daily token cap",
4164
+ "settings.spendBudgetTokensHint": "Default 0 means no gate: behavior is exactly what it was before this setting existed, with no ledger read and no counting. With a positive cap, once today's measured spend reaches it a manual run or re-run is refused and the caller sees that message as the refusal, while a due schedule writes the reason to the scheduler error and skips that occurrence without spending a planned run — raising the cap, or the local day rolling over, lets the next trigger run as usual. The unit is tokens rather than money: the usage ledger prices only DeepSeek's own routes and stays 0 on every other route. Today's spend is that ledger's local-date bucket summed over input, cache read/write and output, the same measure the usage panel shows.",
4108
4165
  "settings.runBehaviorTitle": "Run behavior",
4109
4166
  "settings.runBehaviorCardHint": "The global native /goal switch (master control, off by default).",
4110
4167
  "settings.goalRunGlobal": "Global: run tasks with dsh native /goal",
@@ -11123,7 +11180,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11123
11180
  }
11124
11181
  //#endregion
11125
11182
  //#region \0dsh-css:packages/dsh-task-board/src/client/settings-card.module.css.mjs
11126
- const css$1 = ".Jh0q7G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.Jh0q7G_card:hover{border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_header{appearance:none;box-sizing:border-box;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:13px;padding:16px;display:flex}.Jh0q7G_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.Jh0q7G_headerStatic{box-sizing:border-box;border-radius:12px;align-items:center;gap:13px;width:100%;padding:16px;display:flex}.Jh0q7G_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Jh0q7G_mark{background:var(--dsw-alias-bg-module-platform);width:34px;height:34px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;place-items:center;transition:color .16s;display:grid}.Jh0q7G_header:hover .Jh0q7G_mark,.Jh0q7G_cardOpen .Jh0q7G_mark{color:var(--dsw-alias-label-primary)}.Jh0q7G_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.Jh0q7G_description{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.5}.Jh0q7G_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_chevron{color:var(--dsw-alias-label-tertiary);flex:none;width:16px;height:16px;transition:transform .16s,color .16s}.Jh0q7G_header:hover .Jh0q7G_chevron{color:var(--dsw-alias-label-secondary)}.Jh0q7G_chevronOpen{transform:rotate(180deg)}.Jh0q7G_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.Jh0q7G_readOnly{color:var(--dsw-alias-label-secondary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_notExposed{color:var(--dsw-alias-state-warn-primary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.Jh0q7G_failed{min-width:0;color:var(--dsw-alias-state-error-primary,#b42318);text-overflow:ellipsis;white-space:nowrap;flex:1;margin:0;font-size:12px;line-height:1.5;overflow:hidden}.Jh0q7G_discard,.Jh0q7G_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.Jh0q7G_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.Jh0q7G_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.Jh0q7G_discard:disabled,.Jh0q7G_save:disabled{opacity:.4;cursor:default}.Jh0q7G_discard:focus-visible,.Jh0q7G_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Jh0q7G_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.Jh0q7G_field+.Jh0q7G_field{border-top:1px solid var(--dsw-alias-border-l2)}.Jh0q7G_head{align-items:center;gap:8px;display:flex}.Jh0q7G_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.Jh0q7G_badges{align-items:center;gap:8px;display:inline-flex}.Jh0q7G_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.Jh0q7G_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.Jh0q7G_reset:disabled{cursor:default}.Jh0q7G_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.Jh0q7G_input,.Jh0q7G_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_input:focus-visible,.Jh0q7G_select:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.Jh0q7G_input:disabled,.Jh0q7G_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.Jh0q7G_inputInvalid{border:1px solid var(--dsw-alias-state-error-primary,#b42318);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_inputInvalid:focus-visible{outline:2px solid var(--dsw-alias-state-error-primary,#b42318);outline-offset:1px;border-color:var(--dsw-alias-state-error-primary,#b42318)}.Jh0q7G_selectWrap{position:relative}.Jh0q7G_selectButton{appearance:none;text-align:left;cursor:pointer;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}.Jh0q7G_selectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.Jh0q7G_selectChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.Jh0q7G_selectChevronOpen{transform:rotate(180deg)}.Jh0q7G_selectPopup{z-index:40;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);max-height:240px;box-shadow:0 8px 24px var(--dsw-alias-bg-mask-2);opacity:0;border-radius:8px;flex-direction:column;padding:4px;transition:opacity .1s,transform .1s;display:flex;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;transform:translateY(-4px)}.Jh0q7G_selectPopupOpen{opacity:1;transform:none}.Jh0q7G_selectPopupClose{opacity:0;pointer-events:none;transform:translateY(-4px)}.Jh0q7G_selectOption{color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:6px;flex-shrink:0;padding:6px 10px;font-size:13px;line-height:1.5;overflow:hidden}.Jh0q7G_selectOption:hover,.Jh0q7G_selectOptionActive{background:var(--dsw-alias-interactive-bg-hover)}.Jh0q7G_selectOptionSelected{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 10%, transparent);font-weight:500}.Jh0q7G_invalid{color:var(--dsw-alias-state-error-primary,#b42318);margin:0;font-size:12px;line-height:1.5}.Jh0q7G_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:1.5}@media (prefers-reduced-motion:reduce){.Jh0q7G_card,.Jh0q7G_header,.Jh0q7G_mark,.Jh0q7G_chevron,.Jh0q7G_chevronOpen,.Jh0q7G_discard,.Jh0q7G_save,.Jh0q7G_selectChevron,.Jh0q7G_selectChevronOpen,.Jh0q7G_selectPopup{transition:none}}";
11183
+ const css$1 = ".Jh0q7G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.Jh0q7G_card:hover{border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_header{appearance:none;box-sizing:border-box;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:13px;padding:16px;display:flex}.Jh0q7G_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.Jh0q7G_headerStatic{box-sizing:border-box;border-radius:12px;align-items:center;gap:13px;width:100%;padding:16px;display:flex}.Jh0q7G_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Jh0q7G_mark{background:var(--dsw-alias-bg-module-platform);width:34px;height:34px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;place-items:center;transition:color .16s;display:grid}.Jh0q7G_header:hover .Jh0q7G_mark,.Jh0q7G_cardOpen .Jh0q7G_mark{color:var(--dsw-alias-label-primary)}.Jh0q7G_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.Jh0q7G_description{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.5}.Jh0q7G_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_headerAction{flex:none;align-items:center;display:inline-flex}.Jh0q7G_chevron{color:var(--dsw-alias-label-tertiary);flex:none;width:16px;height:16px;transition:transform .16s,color .16s}.Jh0q7G_header:hover .Jh0q7G_chevron{color:var(--dsw-alias-label-secondary)}.Jh0q7G_chevronOpen{transform:rotate(180deg)}.Jh0q7G_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.Jh0q7G_readOnly{color:var(--dsw-alias-label-secondary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_notExposed{color:var(--dsw-alias-state-warn-primary);margin:12px 0 0;font-size:12px;line-height:1.5}.Jh0q7G_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.Jh0q7G_failed{min-width:0;color:var(--dsw-alias-state-error-primary,#b42318);text-overflow:ellipsis;white-space:nowrap;flex:1;margin:0;font-size:12px;line-height:1.5;overflow:hidden}.Jh0q7G_discard,.Jh0q7G_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.Jh0q7G_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.Jh0q7G_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Jh0q7G_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.Jh0q7G_discard:disabled,.Jh0q7G_save:disabled{opacity:.4;cursor:default}.Jh0q7G_discard:focus-visible,.Jh0q7G_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Jh0q7G_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.Jh0q7G_field+.Jh0q7G_field{border-top:1px solid var(--dsw-alias-border-l2)}.Jh0q7G_head{align-items:center;gap:8px;display:flex}.Jh0q7G_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.Jh0q7G_badges{align-items:center;gap:8px;display:inline-flex}.Jh0q7G_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Jh0q7G_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.Jh0q7G_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.Jh0q7G_reset:disabled{cursor:default}.Jh0q7G_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.Jh0q7G_input,.Jh0q7G_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_input:focus-visible,.Jh0q7G_select:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.Jh0q7G_input:disabled,.Jh0q7G_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.Jh0q7G_inputInvalid{border:1px solid var(--dsw-alias-state-error-primary,#b42318);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Jh0q7G_inputInvalid:focus-visible{outline:2px solid var(--dsw-alias-state-error-primary,#b42318);outline-offset:1px;border-color:var(--dsw-alias-state-error-primary,#b42318)}.Jh0q7G_selectWrap{position:relative}.Jh0q7G_selectButton{appearance:none;text-align:left;cursor:pointer;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}.Jh0q7G_selectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.Jh0q7G_selectChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.Jh0q7G_selectChevronOpen{transform:rotate(180deg)}.Jh0q7G_selectPopup{z-index:40;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);max-height:240px;box-shadow:0 8px 24px var(--dsw-alias-bg-mask-2);opacity:0;border-radius:8px;flex-direction:column;padding:4px;transition:opacity .1s,transform .1s;display:flex;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;transform:translateY(-4px)}.Jh0q7G_selectPopupOpen{opacity:1;transform:none}.Jh0q7G_selectPopupClose{opacity:0;pointer-events:none;transform:translateY(-4px)}.Jh0q7G_selectOption{color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:6px;flex-shrink:0;padding:6px 10px;font-size:13px;line-height:1.5;overflow:hidden}.Jh0q7G_selectOption:hover,.Jh0q7G_selectOptionActive{background:var(--dsw-alias-interactive-bg-hover)}.Jh0q7G_selectOptionSelected{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 10%, transparent);font-weight:500}.Jh0q7G_invalid{color:var(--dsw-alias-state-error-primary,#b42318);margin:0;font-size:12px;line-height:1.5}.Jh0q7G_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:1.5}.Jh0q7G_toggle{appearance:none;cursor:pointer;font:inherit;background:0 0;border:0;border-radius:999px;align-items:center;margin:0;padding:0;display:inline-flex}.Jh0q7G_toggleTrack{background:var(--dsw-alias-label-dimmed);border-radius:999px;flex:none;width:30px;height:16px;transition:background .18s;position:relative}.Jh0q7G_toggleThumb{background:var(--dsw-alias-bg-layer-3);border-radius:50%;width:12px;height:12px;transition:left .18s;position:absolute;top:2px;left:2px}.Jh0q7G_toggle[aria-checked=true] .Jh0q7G_toggleTrack{background:var(--dsw-alias-button-primary-fill,var(--dsw-alias-label-primary))}.Jh0q7G_toggle[aria-checked=true] .Jh0q7G_toggleThumb{background:var(--dsw-alias-label-primary-foreground,var(--dsw-alias-bg-layer-3));left:16px}.Jh0q7G_toggle:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.Jh0q7G_toggle:disabled{opacity:.45;cursor:default}@media (prefers-reduced-motion:reduce){.Jh0q7G_card,.Jh0q7G_header,.Jh0q7G_mark,.Jh0q7G_chevron,.Jh0q7G_chevronOpen,.Jh0q7G_discard,.Jh0q7G_save,.Jh0q7G_selectChevron,.Jh0q7G_selectChevronOpen,.Jh0q7G_selectPopup,.Jh0q7G_toggleTrack,.Jh0q7G_toggleThumb{transition:none}}";
11127
11184
  const tagId$1 = "@linxin666/dsh-client-ui-task-board/packages/dsh-task-board/src/client/settings-card.module.css";
11128
11185
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
11129
11186
  const tag = document.createElement("style");
@@ -11148,6 +11205,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11148
11205
  "head": "Jh0q7G_head",
11149
11206
  "headText": "Jh0q7G_headText",
11150
11207
  "header": "Jh0q7G_header",
11208
+ "headerAction": "Jh0q7G_headerAction",
11151
11209
  "headerStatic": "Jh0q7G_headerStatic",
11152
11210
  "hint": "Jh0q7G_hint",
11153
11211
  "input": "Jh0q7G_input",
@@ -11172,7 +11230,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11172
11230
  "selectPopup": "Jh0q7G_selectPopup",
11173
11231
  "selectPopupClose": "Jh0q7G_selectPopupClose",
11174
11232
  "selectPopupOpen": "Jh0q7G_selectPopupOpen",
11175
- "selectWrap": "Jh0q7G_selectWrap"
11233
+ "selectWrap": "Jh0q7G_selectWrap",
11234
+ "toggle": "Jh0q7G_toggle",
11235
+ "toggleThumb": "Jh0q7G_toggleThumb",
11236
+ "toggleTrack": "Jh0q7G_toggleTrack"
11176
11237
  };
11177
11238
  //#endregion
11178
11239
  //#region src/client/CardDefaultPresetField.tsx
@@ -11287,6 +11348,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11287
11348
  className: settings_card_module_css_default.headText,
11288
11349
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11289
11350
  className: settings_card_module_css_default.name,
11351
+ id: props.titleId,
11290
11352
  title,
11291
11353
  children: title
11292
11354
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -11295,6 +11357,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11295
11357
  children: props.descriptionNode ?? description
11296
11358
  })]
11297
11359
  }),
11360
+ props.headerAction !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11361
+ className: settings_card_module_css_default.headerAction,
11362
+ children: props.headerAction
11363
+ }) : null,
11298
11364
  state.dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11299
11365
  className: settings_card_module_css_default.pending,
11300
11366
  title: props.t("settings.unsaved"),
@@ -11319,6 +11385,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11319
11385
  className: settings_card_module_css_default.headText,
11320
11386
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11321
11387
  className: settings_card_module_css_default.name,
11388
+ id: props.titleId,
11322
11389
  title,
11323
11390
  children: title
11324
11391
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -11327,6 +11394,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11327
11394
  children: props.descriptionNode ?? description
11328
11395
  })]
11329
11396
  }),
11397
+ props.headerAction !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11398
+ className: settings_card_module_css_default.headerAction,
11399
+ children: props.headerAction
11400
+ }) : null,
11330
11401
  state.dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11331
11402
  className: settings_card_module_css_default.pending,
11332
11403
  title: props.t("settings.unsaved"),
@@ -11362,7 +11433,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11362
11433
  }
11363
11434
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
11364
11435
  className: cardClass,
11365
- children: [header, expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11436
+ children: [header, expanded && props.headerOnly !== true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11366
11437
  className: settings_card_module_css_default.body,
11367
11438
  children: [
11368
11439
  !state.writable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
@@ -12121,6 +12192,26 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12121
12192
  };
12122
12193
  }
12123
12194
  /**
12195
+ * The daily token cap field: whole tokens, 0 for "no gate". Every non-negative
12196
+ * whole number is a legal cap, so the draft only has to be one; a blank draft
12197
+ * clears the entry back to the schema default (0).
12198
+ */
12199
+ function spendBudgetField() {
12200
+ return {
12201
+ field: "spendBudgetTokens",
12202
+ format: (value) => typeof value === "number" && Number.isInteger(value) ? String(value) : "",
12203
+ parse: (text) => {
12204
+ const trimmed = text.trim();
12205
+ if (trimmed === "") return { kind: "clear" };
12206
+ if (!/^\d+$/.test(trimmed)) return void 0;
12207
+ return {
12208
+ kind: "set",
12209
+ value: Number(trimmed)
12210
+ };
12211
+ }
12212
+ };
12213
+ }
12214
+ /**
12124
12215
  * The judge-model field: blank inherits the host model catalog default, and a
12125
12216
  * non-blank draft must be a qualified provider/model route. An unparseable
12126
12217
  * draft blocks the save instead of storing a route nothing can resolve.
@@ -12158,6 +12249,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12158
12249
  subtaskDepthField(),
12159
12250
  sessionPollField(),
12160
12251
  runLaunchWidthField(),
12252
+ spendBudgetField(),
12161
12253
  booleanField("goalRunEnabled"),
12162
12254
  booleanField("goalVerification"),
12163
12255
  modelRouteField("goalVerificationModel"),
@@ -12178,6 +12270,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12178
12270
  maxSubtaskDepth: this.form.field("maxSubtaskDepth"),
12179
12271
  sessionPollSeconds: this.form.field("sessionPollSeconds"),
12180
12272
  runLaunchWidth: this.form.field("runLaunchWidth"),
12273
+ spendBudgetTokens: this.form.field("spendBudgetTokens"),
12181
12274
  goalRunEnabled: this.form.field("goalRunEnabled"),
12182
12275
  goalVerification: this.form.field("goalVerification"),
12183
12276
  goalVerificationModel: this.form.field("goalVerificationModel"),
@@ -12460,6 +12553,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12460
12553
  onReset: () => {
12461
12554
  props.resetField("runLaunchWidth");
12462
12555
  }
12556
+ }),
12557
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
12558
+ id: "settings-task-board-spend-budget",
12559
+ label: t("settings.spendBudgetTokens"),
12560
+ hint: t("settings.spendBudgetTokensHint"),
12561
+ numeric: true,
12562
+ ...fieldProps,
12563
+ ...state.spendBudgetTokens,
12564
+ onEdit: (text) => {
12565
+ props.edit("spendBudgetTokens", text);
12566
+ },
12567
+ onReset: () => {
12568
+ props.resetField("spendBudgetTokens");
12569
+ }
12463
12570
  })
12464
12571
  ]
12465
12572
  }),
@@ -13032,17 +13139,39 @@ Please report this to https://github.com/markedjs/marked.`, e) {
13032
13139
  };
13033
13140
  //#endregion
13034
13141
  //#region src/client/telemetry.ts
13142
+ /** localStorage key carrying the family-wide telemetry opt-out ('1' = off). */
13143
+ const TELEMETRY_OPT_OUT_KEY = "dsh-web-ui-telemetry-opt-out";
13035
13144
  const VISITOR_KEY = "dsh-web-ui-telemetry-visitor";
13036
13145
  const DAY_KEY_PREFIX = "dsh-web-ui-telemetry-day:";
13037
13146
  const ENDPOINT = "https://dsh-market.com/api/telemetry/event";
13038
13147
  /** The building package's version, when the bundle carries it. */
13039
13148
  function bakedVersion() {
13040
13149
  try {
13041
- return "0.4.7";
13150
+ return "0.4.8";
13042
13151
  } catch {
13043
13152
  return;
13044
13153
  }
13045
13154
  }
13155
+ /** Whether the user switched the family-wide opt-out on (reads storage only). */
13156
+ function isTelemetryOptedOut() {
13157
+ try {
13158
+ return localStorage.getItem(TELEMETRY_OPT_OUT_KEY) === "1";
13159
+ } catch {
13160
+ return false;
13161
+ }
13162
+ }
13163
+ /** Whether the browser itself asks not to be tracked; a failed read means no signal. */
13164
+ function doNotTrackRequested() {
13165
+ try {
13166
+ return navigator.doNotTrack === "1" || navigator.doNotTrack === "yes";
13167
+ } catch {
13168
+ return false;
13169
+ }
13170
+ }
13171
+ /** Whether a heartbeat must be suppressed right now: opt-out stored, or the browser asks not to be tracked. */
13172
+ function isTelemetrySuppressed() {
13173
+ return isTelemetryOptedOut() || doNotTrackRequested();
13174
+ }
13046
13175
  /** Read or lazily create the anonymous visitor id; null when storage is unavailable. */
13047
13176
  function visitorId() {
13048
13177
  try {
@@ -13071,6 +13200,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
13071
13200
  */
13072
13201
  function reportDailyHeartbeat(items) {
13073
13202
  try {
13203
+ if (isTelemetrySuppressed()) return;
13074
13204
  if (items.length === 0) return;
13075
13205
  const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
13076
13206
  if (navigator.webdriver) return;