@linxin666/dsh-client-ui-task-board 0.4.7 → 0.4.9
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 +2 -2
- package/README.md +29 -22
- package/README.zh.md +29 -22
- package/lib/client.js +1553 -670
- package/lib/client.js.map +1 -1
- package/lib/index.js +757 -419
- package/lib/types/client/PluginSettingsCard.d.ts +60 -0
- package/lib/types/client/TaskBoardSettingsCard.d.ts +14 -0
- package/lib/types/client/board/ExecutionLog.d.ts +16 -0
- package/lib/types/client/board/TaskForm.d.ts +4 -0
- package/lib/types/client/board/VerificationReport.d.ts +2 -15
- package/lib/types/client/body-mutations.d.ts +45 -0
- package/lib/types/client/locales.d.ts +44 -6
- package/lib/types/client/suppress-schedule-row.d.ts +86 -0
- package/lib/types/client/telemetry.d.ts +14 -2
- package/lib/types/core/controller.d.ts +1 -1
- package/lib/types/core/execution-summary.d.ts +52 -0
- package/lib/types/core/extension.d.ts +34 -0
- package/lib/types/core/spend-budget.d.ts +28 -0
- package/lib/types/core/subtask.d.ts +59 -49
- package/lib/types/core/tasks.d.ts +37 -9
- package/lib/types/core/use-cases/task-update.d.ts +1 -1
- package/lib/types/core/workspace-target.d.ts +23 -3
- package/lib/types/host/launch-admission.d.ts +8 -9
- package/lib/types/host-ledger.d.ts +96 -50
- package/lib/types/host-routes.d.ts +49 -0
- package/lib/types/host-runner.d.ts +24 -11
- package/lib/types/host-service.d.ts +38 -50
- package/lib/types/host-spend.d.ts +52 -0
- package/lib/types/index.d.ts +70 -61
- package/lib/types/loopback.d.ts +41 -1
- package/lib/types/protocol.d.ts +0 -5
- package/lib/types/tool-surface.d.ts +1 -0
- package/package.json +25 -25
- package/src/client/CardDefaultPresetField.tsx +1 -1
- package/src/client/PluginSettingsCard.tsx +140 -20
- package/src/client/TaskBoardSettingsCard.tsx +104 -24
- package/src/client/board/ExecutionLog.tsx +140 -0
- package/src/client/board/LinkSubtaskModal.tsx +1 -9
- package/src/client/board/NewTaskModal.tsx +2 -11
- package/src/client/board/TaskCard.tsx +45 -23
- package/src/client/board/TaskDetail.tsx +407 -261
- package/src/client/board/TaskForm.tsx +19 -4
- package/src/client/board/VerificationReport.tsx +143 -104
- package/src/client/board/task-markdown.module.css +11 -8
- package/src/client/board-settings.module.css +35 -7
- package/src/client/board.module.css +855 -115
- package/src/client/body-mutations.ts +133 -0
- package/src/client/index.ts +10 -0
- package/src/client/locales.ts +101 -24
- package/src/client/settings-card.module.css +141 -11
- package/src/client/suppress-schedule-row.ts +198 -0
- package/src/client/telemetry.ts +47 -2
- package/src/core/controller.ts +1 -3
- package/src/core/execution-summary.ts +96 -0
- package/src/core/extension.ts +34 -0
- package/src/core/spend-budget.ts +35 -0
- package/src/core/store.ts +4 -0
- package/src/core/subtask.ts +81 -76
- package/src/core/tasks.ts +48 -10
- package/src/core/use-cases/task-update.ts +1 -3
- package/src/core/workspace-target.ts +27 -3
- package/src/host/agent-tools.ts +14 -15
- package/src/host/launch-admission.ts +8 -9
- package/src/host-ledger.ts +218 -127
- package/src/host-routes.ts +65 -2
- package/src/host-runner.ts +68 -35
- package/src/host-service.ts +136 -132
- package/src/host-spend.ts +105 -0
- package/src/index.ts +115 -104
- package/src/loopback.ts +57 -1
- package/src/protocol.ts +2 -9
- package/src/tool-surface.ts +1 -0
- package/lib/types/client/board/team-run-promotion.d.ts +0 -26
- package/src/client/board/team-run-promotion.ts +0 -39
|
@@ -24,6 +24,14 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
|
24
24
|
descriptionKey: TKey;
|
|
25
25
|
/** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */
|
|
26
26
|
descriptionNode?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Locale key of the full sentence behind a shortened description: when
|
|
29
|
+
* present, the header's native `title` takes this text while the visible
|
|
30
|
+
* line keeps `descriptionKey`/`descriptionNode`, so a compact card can
|
|
31
|
+
* compress the sentence without keeping a second visible copy of it.
|
|
32
|
+
* Defaults to the description key.
|
|
33
|
+
*/
|
|
34
|
+
descriptionTitleKey?: TKey;
|
|
27
35
|
/**
|
|
28
36
|
* Optional leading mark identifying the plugin. A card without one keeps the
|
|
29
37
|
* plain official header shape, so the chrome stays a readable sibling of the
|
|
@@ -37,6 +45,19 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
|
37
45
|
onSave: () => void;
|
|
38
46
|
/** Drop every staged edit. */
|
|
39
47
|
onDiscard: () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Id applied to the card's title element, so a header control (an immediate
|
|
50
|
+
* toggle in `headerAction`) can name itself through `aria-labelledby`
|
|
51
|
+
* instead of repeating the title as a string.
|
|
52
|
+
*/
|
|
53
|
+
titleId?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Render the header only, with no body region. A card whose whole setting is
|
|
56
|
+
* the header control (a switch whose explanation is the description) has no
|
|
57
|
+
* controls to lay out below it, and an empty body would draw a divider line
|
|
58
|
+
* with nothing under it.
|
|
59
|
+
*/
|
|
60
|
+
headerOnly?: boolean;
|
|
40
61
|
/**
|
|
41
62
|
* Render the controls expanded on arrival (still collapsible). Defaults to
|
|
42
63
|
* true: promoted first-level sections show their settings immediately.
|
|
@@ -54,10 +75,24 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
|
54
75
|
* edits, so the footer would sit there permanently disabled.
|
|
55
76
|
*/
|
|
56
77
|
hideFooter?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Optional control rendered at the header's trailing edge, before the pending
|
|
80
|
+
* badge and the chevron. A card whose setting is one immediate flip (it
|
|
81
|
+
* applies outside the staged form) puts its ToggleSwitch here, so the control
|
|
82
|
+
* is reachable without opening the card and matches a plugin card's shape.
|
|
83
|
+
*/
|
|
84
|
+
headerAction?: ReactNode;
|
|
57
85
|
/** Render children even when the settings namespace is not exposed by the host. */
|
|
58
86
|
renderChildrenWhenNotExposed?: boolean;
|
|
59
87
|
/** Hide the 'not exposed' warning banner when the settings namespace is not exposed. */
|
|
60
88
|
hideNotExposedNotice?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Compact chrome for a topic card rendered inside another card's body: a
|
|
91
|
+
* smaller title, a tighter header and body inset, and a one-line description
|
|
92
|
+
* whose full text stays on the header's own title. Defaults to the
|
|
93
|
+
* first-level chrome, which is unchanged.
|
|
94
|
+
*/
|
|
95
|
+
density?: 'nested';
|
|
61
96
|
/** The plugin's controls. */
|
|
62
97
|
children: ReactNode;
|
|
63
98
|
}
|
|
@@ -75,6 +110,12 @@ export interface FieldProps {
|
|
|
75
110
|
label: string;
|
|
76
111
|
/** One-line explanation rendered under the control. */
|
|
77
112
|
hint: string;
|
|
113
|
+
/**
|
|
114
|
+
* Full sentence behind the visible hint, exposed as the paragraph's native
|
|
115
|
+
* `title` so a card can shorten the line without losing the text. Omitted:
|
|
116
|
+
* the paragraph carries no title attribute at all.
|
|
117
|
+
*/
|
|
118
|
+
hintTitle?: string;
|
|
78
119
|
/** Draft text this control renders. */
|
|
79
120
|
text: string;
|
|
80
121
|
/** True when saving would leave a user-layer entry for this field. */
|
|
@@ -141,4 +182,23 @@ export declare function ChoiceField(props: FieldProps & {
|
|
|
141
182
|
label: string;
|
|
142
183
|
}>;
|
|
143
184
|
}): import("react").JSX.Element;
|
|
185
|
+
/**
|
|
186
|
+
* An immediate boolean toggle drawn as a switch track, for a setting that
|
|
187
|
+
* applies on flip rather than through a staged save. It is a real button with
|
|
188
|
+
* `role="switch"` and `aria-checked`, so keyboard and assistive activation
|
|
189
|
+
* arrive as a click and the state is announced instead of inferred from a
|
|
190
|
+
* checkbox tick.
|
|
191
|
+
*/
|
|
192
|
+
export declare function ToggleSwitch(props: {
|
|
193
|
+
/** Id of the element naming the switch (the card's title). */
|
|
194
|
+
labelledBy?: string;
|
|
195
|
+
/** Accessible name when no element labels it. */
|
|
196
|
+
ariaLabel?: string;
|
|
197
|
+
/** Current state. */
|
|
198
|
+
checked: boolean;
|
|
199
|
+
/** Disables the switch while a write is in flight or the Host refuses writes. */
|
|
200
|
+
disabled?: boolean;
|
|
201
|
+
/** Called with the requested next state. */
|
|
202
|
+
onChange: (next: boolean) => void;
|
|
203
|
+
}): import("react").JSX.Element;
|
|
144
204
|
export {};
|
|
@@ -17,6 +17,11 @@ export interface TaskBoardSettings {
|
|
|
17
17
|
announceToAgent?: boolean;
|
|
18
18
|
/** Prevent host idle sleep while sessions run or schedules are armed. */
|
|
19
19
|
preventIdleSleep?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the operator's own reverse proxy or tunnel may speak for the
|
|
22
|
+
* browser (default off). Volatile, so the board's fence reads it per request.
|
|
23
|
+
*/
|
|
24
|
+
trustForwardedProxy?: boolean;
|
|
20
25
|
/** Subtask depth limit (1..3); 1 means a single level of subtasks. */
|
|
21
26
|
maxSubtaskDepth?: number;
|
|
22
27
|
/** Roster-poll cadence in seconds while the board has work to reconcile. */
|
|
@@ -27,6 +32,11 @@ export interface TaskBoardSettings {
|
|
|
27
32
|
* action creates; members enter the running column in batches, none is dropped.
|
|
28
33
|
*/
|
|
29
34
|
runLaunchWidth?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Daily token ceiling for the work this board dispatches; 0 means no gate.
|
|
37
|
+
* Tokens, not money: only DeepSeek's own routes are priced.
|
|
38
|
+
*/
|
|
39
|
+
spendBudgetTokens?: number;
|
|
30
40
|
/**
|
|
31
41
|
* GLOBAL native /goal switch (default off): the master control over whether
|
|
32
42
|
* this board starts a run with dsh's built-in /goal at all. Frozen per
|
|
@@ -62,12 +72,16 @@ export interface TaskBoardSettingsCardState extends CardShell {
|
|
|
62
72
|
announceToAgent: CardFieldState;
|
|
63
73
|
/** Idle-system-sleep protection flag. */
|
|
64
74
|
preventIdleSleep: CardFieldState;
|
|
75
|
+
/** Forwarded-request trust flag. */
|
|
76
|
+
trustForwardedProxy: CardFieldState;
|
|
65
77
|
/** Subtask depth limit field. */
|
|
66
78
|
maxSubtaskDepth: CardFieldState;
|
|
67
79
|
/** Roster-poll cadence field. */
|
|
68
80
|
sessionPollSeconds: CardFieldState;
|
|
69
81
|
/** Run-launch admission width field. */
|
|
70
82
|
runLaunchWidth: CardFieldState;
|
|
83
|
+
/** Daily token cap field. */
|
|
84
|
+
spendBudgetTokens: CardFieldState;
|
|
71
85
|
/** GLOBAL native /goal switch. */
|
|
72
86
|
goalRunEnabled: CardFieldState;
|
|
73
87
|
/** Goal-acceptance switch. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExecutionRecord } from '../../core/tasks.ts';
|
|
2
|
+
import { type TaskBoardKey } from '../locales.ts';
|
|
3
|
+
/** Rows shown before the history asks to be expanded. */
|
|
4
|
+
export declare const VISIBLE_EXECUTIONS = 5;
|
|
5
|
+
/** Execution outcome → locale key, shared with the history's folded summary. */
|
|
6
|
+
export declare const EXECUTION_RESULT_KEY: Record<NonNullable<ExecutionRecord['result']>, TaskBoardKey>;
|
|
7
|
+
/**
|
|
8
|
+
* Render one card's execution history.
|
|
9
|
+
* @param props - the card's executions, its time zone and the session jump.
|
|
10
|
+
* @returns the newest rows, the disclosure for the rest, and nothing else.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ExecutionLog({ executions, timeZone, onOpenSession }: {
|
|
13
|
+
executions: readonly ExecutionRecord[];
|
|
14
|
+
timeZone?: string;
|
|
15
|
+
onOpenSession: (sessionId: string) => void;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -32,6 +32,10 @@ export declare function ModalShell({ ariaLabel, title, error, pending, submitLab
|
|
|
32
32
|
* region keeps a one-line summary of the values it holds, so nothing is hidden
|
|
33
33
|
* without a trace; a region holding a blocking error is forced open by its
|
|
34
34
|
* owner (forceOpen) rather than reporting the error out of sight.
|
|
35
|
+
*
|
|
36
|
+
* The body is the panel fold's body under another name: it enters and leaves on
|
|
37
|
+
* the same animation pair, and `usePresence` keeps it mounted through the exit
|
|
38
|
+
* leg so collapsing never snaps.
|
|
35
39
|
*/
|
|
36
40
|
export declare function CollapsibleSection({ title, summary, defaultOpen, forceOpen, children, }: {
|
|
37
41
|
title: string;
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One execution's goal-acceptance report.
|
|
3
|
-
*
|
|
4
|
-
* Rendered inside the execution-history row, so a rerun or a scheduled run
|
|
5
|
-
* keeps its OWN report and a later cycle never overwrites an earlier verdict.
|
|
6
|
-
* It shows what the board decided and the evidence it decided on: the verdict,
|
|
7
|
-
* the judge route and reasoning level, the acceptance count, the total and
|
|
8
|
-
* per-criterion scores against their threshold, the findings the judge located,
|
|
9
|
-
* the evidence scope with its truncation, and the token usage.
|
|
10
|
-
*
|
|
11
|
-
* Deliberately adds no new `data-dsh-part` value: the part enum is owned by the
|
|
12
|
-
* cross-repository semantic-attribute contract, and this report reuses the
|
|
13
|
-
* execution row's existing markup instead of extending that enum.
|
|
14
|
-
*/
|
|
15
1
|
import { type ExecutionVerification } from '../../core/verification.ts';
|
|
16
2
|
/**
|
|
17
3
|
* Render one execution's acceptance report.
|
|
18
4
|
* @param props - the execution's persisted acceptance block.
|
|
19
|
-
* @returns the
|
|
5
|
+
* @returns the verdict badge with its fold-out detail, or nothing when
|
|
6
|
+
* acceptance never applied.
|
|
20
7
|
*/
|
|
21
8
|
export declare function VerificationReport({ verification }: {
|
|
22
9
|
verification: ExecutionVerification;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One `document.body` MutationObserver per page, shared by every family
|
|
3
|
+
* plugin bundle.
|
|
4
|
+
*
|
|
5
|
+
* Family plugins that inject at the DOM level must notice when the shell
|
|
6
|
+
* re-renders around their injected node: the aggregate shell's column shims
|
|
7
|
+
* and any plugin surface still extending the shell from outside the official
|
|
8
|
+
* slot seats. Each consumer used to install its OWN `MutationObserver` on
|
|
9
|
+
* `document.body` with
|
|
10
|
+
* `{ childList: true, subtree: true }`, so a page carrying N family plugins
|
|
11
|
+
* paid N native observers and N callback invocations for EVERY mutation batch
|
|
12
|
+
* the app produced — chat token streaming alone produces many per second, and
|
|
13
|
+
* the count grows with the number of installed plugins.
|
|
14
|
+
*
|
|
15
|
+
* This module keeps exactly ONE body observer per page. The registry lives on
|
|
16
|
+
* `globalThis` under a `Symbol.for` key, so the per-package generated copies
|
|
17
|
+
* of this file (scripts/sync-shared.mjs) and separately bundled plugins all
|
|
18
|
+
* reach the same hub at runtime instead of one hub per module instance.
|
|
19
|
+
* Record subscribers receive the mutations accumulated since the last flush.
|
|
20
|
+
* Consumers that only re-check their DOM use subscribeBodyInvalidations:
|
|
21
|
+
* when all subscribers use that path, the hub retains no mutation records
|
|
22
|
+
* (or detached subtrees) while a background page's animation frames pause.
|
|
23
|
+
* Both paths run at most once per frame. The last subscriber disconnects the
|
|
24
|
+
* observer, cancels the pending frame and releases its records.
|
|
25
|
+
*
|
|
26
|
+
* Failure policy: without a DOM or `MutationObserver` the subscription is a
|
|
27
|
+
* no-op disposer (the same silence the per-consumer observers had), and when
|
|
28
|
+
* `requestAnimationFrame` is unavailable the flush runs synchronously so a
|
|
29
|
+
* subscriber is never silently dropped. A throwing subscriber cannot stop the
|
|
30
|
+
* others.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Subscribe to a coalesced DOM re-check without retaining mutation records.
|
|
34
|
+
* The marked wrapper also works with an older hub, which delivers records
|
|
35
|
+
* that it simply ignores until a page reload picks up the updated hub.
|
|
36
|
+
*/
|
|
37
|
+
export declare function subscribeBodyInvalidations(subscriber: () => void): () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Subscribe to body-level childList mutations.
|
|
40
|
+
* @param subscriber - called at most once per animation frame with the records
|
|
41
|
+
* collected since the previous flush; must be safe to run repeatedly.
|
|
42
|
+
* @returns the disposer removing this subscriber (and the observer when it was
|
|
43
|
+
* the last one).
|
|
44
|
+
*/
|
|
45
|
+
export declare function subscribeBodyMutations(subscriber: (records: MutationRecord[]) => void): () => void;
|
|
@@ -129,6 +129,8 @@ export declare const zh: {
|
|
|
129
129
|
'detail.editTags': string;
|
|
130
130
|
'detail.duplicate': string;
|
|
131
131
|
'detail.duplicateAndEdit': string;
|
|
132
|
+
'detail.more': string;
|
|
133
|
+
'detail.moveTo': string;
|
|
132
134
|
'detail.close': string;
|
|
133
135
|
'edit.title': string;
|
|
134
136
|
'edit.save': string;
|
|
@@ -139,6 +141,8 @@ export declare const zh: {
|
|
|
139
141
|
'detail.expand': string;
|
|
140
142
|
'detail.collapse': string;
|
|
141
143
|
'detail.execution': string;
|
|
144
|
+
'detail.execution.showAll': string;
|
|
145
|
+
'detail.execution.summary': string;
|
|
142
146
|
'detail.noExecution': string;
|
|
143
147
|
'detail.run': string;
|
|
144
148
|
'detail.rerun': string;
|
|
@@ -210,6 +214,11 @@ export declare const zh: {
|
|
|
210
214
|
'detail.schedule.runsUnlimited': string;
|
|
211
215
|
'detail.schedule.remaining': string;
|
|
212
216
|
'detail.schedule.cancel': string;
|
|
217
|
+
'detail.schedule.summary.off': string;
|
|
218
|
+
'detail.schedule.summary.on': string;
|
|
219
|
+
'detail.schedule.summary.onFull': string;
|
|
220
|
+
'detail.schedule.summary.planOnce': string;
|
|
221
|
+
'detail.schedule.summary.planCron': string;
|
|
213
222
|
'detail.schedule.ended': string;
|
|
214
223
|
'detail.schedule.skipped': string;
|
|
215
224
|
'detail.schedule.stop.fired': string;
|
|
@@ -251,31 +260,46 @@ export declare const zh: {
|
|
|
251
260
|
'exec.reasoning.hint.unknownModel': string;
|
|
252
261
|
'exec.reasoning.hint.noEfforts': string;
|
|
253
262
|
'exec.reasoning.hint.inherit': string;
|
|
254
|
-
'exec.teamRunAutoHint': string;
|
|
255
263
|
'exec.reuseSession': string;
|
|
256
|
-
'exec.teamRun': string;
|
|
257
|
-
'exec.teamRunHint': string;
|
|
258
|
-
'exec.teamRunUnavailable': string;
|
|
259
264
|
'exec.reuseSessionHint': string;
|
|
265
|
+
'exec.reuseSessionHint.short': string;
|
|
260
266
|
'exec.goalRun': string;
|
|
261
267
|
'exec.goalRunHint': string;
|
|
268
|
+
'exec.goalRunHint.short': string;
|
|
269
|
+
'exec.goalRunGlobalOff': string;
|
|
262
270
|
'exec.skipVerification': string;
|
|
263
271
|
'exec.skipVerificationHint': string;
|
|
272
|
+
'exec.skipVerificationHint.short': string;
|
|
264
273
|
'detail.executionSettings': string;
|
|
274
|
+
'detail.settings.advanced': string;
|
|
275
|
+
'detail.settings.summary.none': string;
|
|
276
|
+
'detail.settings.summary.reuseSession': string;
|
|
277
|
+
'detail.settings.summary.goal': string;
|
|
278
|
+
'detail.settings.summary.skipVerification': string;
|
|
265
279
|
'exec.hint': string;
|
|
280
|
+
'exec.hint.short': string;
|
|
266
281
|
'settings.title': string;
|
|
267
282
|
'settings.description': string;
|
|
268
283
|
'settings.enabled': string;
|
|
269
284
|
'settings.enabledCardHint': string;
|
|
270
285
|
'settings.enabledHint': string;
|
|
286
|
+
'settings.enabledHintBrief': string;
|
|
271
287
|
'settings.announceToAgent': string;
|
|
272
288
|
'settings.announceToAgentHint': string;
|
|
289
|
+
'settings.announceToAgentHintBrief': string;
|
|
273
290
|
'settings.preventIdleSleep': string;
|
|
274
291
|
'settings.preventIdleSleepHint': string;
|
|
275
|
-
'settings.
|
|
292
|
+
'settings.preventIdleSleepHintBrief': string;
|
|
293
|
+
'settings.trustForwardedProxy': string;
|
|
294
|
+
'settings.trustForwardedProxyHint': string;
|
|
295
|
+
'settings.trustForwardedProxyHintBrief': string;
|
|
276
296
|
'settings.powerBoundary': string;
|
|
277
|
-
'settings.powerUnknown': string;
|
|
278
297
|
'settings.powerError': string;
|
|
298
|
+
'settings.powerPhase': string;
|
|
299
|
+
'settings.powerPlatform': string;
|
|
300
|
+
'settings.powerRunning': string;
|
|
301
|
+
'settings.powerSchedules': string;
|
|
302
|
+
'settings.powerUnknown': string;
|
|
279
303
|
'settings.inherit': string;
|
|
280
304
|
'settings.on': string;
|
|
281
305
|
'settings.off': string;
|
|
@@ -293,26 +317,36 @@ export declare const zh: {
|
|
|
293
317
|
'settings.invalidNumber': string;
|
|
294
318
|
'settings.sessionPollSeconds': string;
|
|
295
319
|
'settings.sessionPollSecondsHint': string;
|
|
320
|
+
'settings.sessionPollSecondsHintBrief': string;
|
|
296
321
|
'settings.maxSubtaskDepth': string;
|
|
297
322
|
'settings.maxSubtaskDepthHint': string;
|
|
323
|
+
'settings.maxSubtaskDepthHintBrief': string;
|
|
298
324
|
'settings.maxSubtaskDepthOption': string;
|
|
299
325
|
'settings.runLaunchWidth': string;
|
|
300
326
|
'settings.runLaunchWidthHint': string;
|
|
327
|
+
'settings.runLaunchWidthHintBrief': string;
|
|
328
|
+
'settings.spendBudgetTokens': string;
|
|
329
|
+
'settings.spendBudgetTokensHint': string;
|
|
330
|
+
'settings.spendBudgetTokensHintBrief': string;
|
|
301
331
|
'settings.runBehaviorTitle': string;
|
|
302
332
|
'settings.runBehaviorCardHint': string;
|
|
303
333
|
'settings.goalRunGlobal': string;
|
|
304
334
|
'settings.goalRunGlobalHint': string;
|
|
335
|
+
'settings.goalRunGlobalHintBrief': string;
|
|
305
336
|
'settings.goalRunGlobalDisabledTaskOption': string;
|
|
306
337
|
'settings.goalVerificationTitle': string;
|
|
307
338
|
'settings.goalVerification': string;
|
|
308
339
|
'settings.goalVerificationCardHint': string;
|
|
309
340
|
'settings.goalVerificationHint': string;
|
|
341
|
+
'settings.goalVerificationHintBrief': string;
|
|
310
342
|
'settings.goalVerificationModel': string;
|
|
311
343
|
'settings.goalVerificationModelHint': string;
|
|
344
|
+
'settings.goalVerificationModelHintBrief': string;
|
|
312
345
|
'settings.goalVerificationModelInherit': string;
|
|
313
346
|
'settings.goalVerificationModelInheritUnknown': string;
|
|
314
347
|
'settings.goalVerificationEffort': string;
|
|
315
348
|
'settings.goalVerificationEffortHint': string;
|
|
349
|
+
'settings.goalVerificationEffortHintBrief': string;
|
|
316
350
|
'settings.goalVerificationEffortInherit': string;
|
|
317
351
|
'settings.goalVerificationEffortInheritUnknown': string;
|
|
318
352
|
'settings.goalVerificationResolved': string;
|
|
@@ -329,9 +363,13 @@ export declare const zh: {
|
|
|
329
363
|
'settings.goalVerificationModelInvalid': string;
|
|
330
364
|
'settings.cardDefaultsTitle': string;
|
|
331
365
|
'settings.cardDefaultsCardHint': string;
|
|
366
|
+
'settings.cardDefaultsCardBrief': string;
|
|
332
367
|
'settings.cardDefaultModeHint': string;
|
|
368
|
+
'settings.cardDefaultModeHintBrief': string;
|
|
333
369
|
'settings.cardDefaultPermissionHint': string;
|
|
370
|
+
'settings.cardDefaultPermissionHintBrief': string;
|
|
334
371
|
'settings.cardDefaultModelHint': string;
|
|
372
|
+
'settings.cardDefaultModelHintBrief': string;
|
|
335
373
|
'running.executing': string;
|
|
336
374
|
'running.verifying': string;
|
|
337
375
|
'running.repairing': string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hide the official automation-tasks entry while the board is on.
|
|
3
|
+
*
|
|
4
|
+
* The shell mounts two scheduling surfaces side by side in the sidebar: the
|
|
5
|
+
* official `ui-schedule` client half ("Automation tasks" — the Host Schedule
|
|
6
|
+
* service's own page) and this package's board ("Task board" — a Host ledger
|
|
7
|
+
* that runs real DSH sessions). The board is the family's complete surface, so
|
|
8
|
+
* while it is enabled the official row is hidden and the sidebar offers one
|
|
9
|
+
* scheduling entry instead of two.
|
|
10
|
+
*
|
|
11
|
+
* The shell owns that row: it renders the button, the label, the tooltip, the
|
|
12
|
+
* active highlight and the collapsed rail, and the host's own end-to-end suite
|
|
13
|
+
* addresses the row by its accessible name. The row is therefore located the
|
|
14
|
+
* same way — the shell's global panel list seat (`sidebar.panellist`), whose
|
|
15
|
+
* per-row anchor the slot renderer stamps — and it is identified by the label
|
|
16
|
+
* the shell itself resolves for that entry (`resolveSlotLabel`, exactly the
|
|
17
|
+
* call the shell's panel projection makes), so the match follows the active
|
|
18
|
+
* language instead of a hard-coded translation.
|
|
19
|
+
*
|
|
20
|
+
* The write is one inline `display: none` on the shell's own button: the row
|
|
21
|
+
* stays mounted (React keeps owning it) and the official panel keeps working
|
|
22
|
+
* everywhere else it is reachable — only the duplicate sidebar entry goes
|
|
23
|
+
* away. The board's master switch owns the state, exactly as it owns the
|
|
24
|
+
* board's own row: with the board off, the official row comes back.
|
|
25
|
+
*/
|
|
26
|
+
import { type StoredEntry } from '@deepseek-ai/dsh-client-ui-slots';
|
|
27
|
+
/**
|
|
28
|
+
* The official automation-tasks panel id.
|
|
29
|
+
*
|
|
30
|
+
* The host `ui-schedule` client half registers its sidebar row and its
|
|
31
|
+
* center-column page under this id; the shell's panel projection addresses
|
|
32
|
+
* both by it.
|
|
33
|
+
*/
|
|
34
|
+
export declare const OFFICIAL_SCHEDULE_PANEL_ID = "schedules";
|
|
35
|
+
/** The slot-service slice the guard reads. */
|
|
36
|
+
export interface PanelSlotReader {
|
|
37
|
+
entriesOfSlot?(key: string): readonly StoredEntry[];
|
|
38
|
+
}
|
|
39
|
+
/** The context slice the guard needs. */
|
|
40
|
+
export interface ScheduleRowGuardContext {
|
|
41
|
+
slots?: PanelSlotReader;
|
|
42
|
+
}
|
|
43
|
+
/** The guard's controls. */
|
|
44
|
+
export interface ScheduleRowGuard {
|
|
45
|
+
/** Hide the official row, and keep it hidden while the board is on. */
|
|
46
|
+
hide(): void;
|
|
47
|
+
/** Restore the official row: the board's master switch is off. */
|
|
48
|
+
show(): void;
|
|
49
|
+
/** Release the listeners and restore the row. */
|
|
50
|
+
dispose(): void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The accessible name the shell renders on the official automation-tasks row.
|
|
54
|
+
*
|
|
55
|
+
* The shell projects its panel list with `resolveSlotLabel(options.label) ??
|
|
56
|
+
* id`, and that value becomes the row's accessible name. Reading the same
|
|
57
|
+
* value out of the same ledger is what keeps the DOM match correct in every
|
|
58
|
+
* language.
|
|
59
|
+
* @param entries - the live panel-list ledger.
|
|
60
|
+
* @returns the row's accessible name, or undefined when the official panel is not mounted.
|
|
61
|
+
*/
|
|
62
|
+
export declare function officialScheduleRowLabel(entries: readonly StoredEntry[]): string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* The shell's button for the panel row carrying this accessible name.
|
|
65
|
+
*
|
|
66
|
+
* Every global panel row renders one slot anchor inside the shell's own
|
|
67
|
+
* button, so the anchor is the row's handle and the button is what the user
|
|
68
|
+
* sees. Rows a plugin owns (they carry the family's own entry hook) are
|
|
69
|
+
* skipped.
|
|
70
|
+
* @param root - the document (or a subtree) to search.
|
|
71
|
+
* @param label - the accessible name to match.
|
|
72
|
+
* @returns the row button, or undefined when no row carries that name.
|
|
73
|
+
*/
|
|
74
|
+
export declare function findPanelRow(root: ParentNode, label: string): HTMLElement | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Guard the official automation-tasks row against the board's presence.
|
|
77
|
+
*
|
|
78
|
+
* The guard hides the row while the board is enabled and restores it when the
|
|
79
|
+
* board is switched off. It re-applies its write after every DOM change,
|
|
80
|
+
* because the shell owns the row and may mount or replace it at any time (a
|
|
81
|
+
* re-render, a panel-list change, the official plugin arriving late).
|
|
82
|
+
* @param ctx - client context carrying the slot registry.
|
|
83
|
+
* @param root - the document to search; defaults to the ambient one.
|
|
84
|
+
* @returns the guard's controls.
|
|
85
|
+
*/
|
|
86
|
+
export declare function createScheduleRowGuard(ctx: ScheduleRowGuardContext, root?: ParentNode): ScheduleRowGuard;
|
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
* The payload carries no conversation data and no identifiers beyond a random
|
|
7
7
|
* UUID generated in localStorage; the server hashes it with a deployment salt
|
|
8
8
|
* before storage and never persists IP addresses. Sends are fire-and-forget:
|
|
9
|
-
* failures stay silent and simply retry on a later mount or day.
|
|
10
|
-
* is
|
|
9
|
+
* failures stay silent and simply retry on a later mount or day. Frames where
|
|
10
|
+
* storage is unavailable report nothing.
|
|
11
|
+
*
|
|
12
|
+
* The family-wide opt-out and the browser's Do Not Track signal both suppress
|
|
13
|
+
* the heartbeat; the Web Plugins settings switch writes the same localStorage
|
|
14
|
+
* key. The system is documented in docs/telemetry.md.
|
|
11
15
|
*/
|
|
12
16
|
export type TelemetryChannel = 'market' | 'npm' | 'unknown';
|
|
13
17
|
export interface TelemetryItem {
|
|
@@ -18,6 +22,14 @@ export interface TelemetryItem {
|
|
|
18
22
|
/** Install channel when determinable (market = Workshop install). */
|
|
19
23
|
channel?: TelemetryChannel;
|
|
20
24
|
}
|
|
25
|
+
/** localStorage key carrying the family-wide telemetry opt-out ('1' = off). */
|
|
26
|
+
export declare const TELEMETRY_OPT_OUT_KEY = "dsh-web-ui-telemetry-opt-out";
|
|
27
|
+
/** Whether the user switched the family-wide opt-out on (reads storage only). */
|
|
28
|
+
export declare function isTelemetryOptedOut(): boolean;
|
|
29
|
+
/** Turn the family-wide opt-out on or off (writing '1' / removing the key); never throws. */
|
|
30
|
+
export declare function setTelemetryOptedOut(optedOut: boolean): void;
|
|
31
|
+
/** Whether a heartbeat must be suppressed right now: opt-out stored, or the browser asks not to be tracked. */
|
|
32
|
+
export declare function isTelemetrySuppressed(): boolean;
|
|
21
33
|
/**
|
|
22
34
|
* Fire the daily heartbeat for the given items at most once per UTC day per
|
|
23
35
|
* browser. Never throws and never blocks the caller. Items without an explicit
|
|
@@ -123,7 +123,7 @@ export interface ExecutionOptionsSnapshot {
|
|
|
123
123
|
* (revision/scheduler/power); a full snapshot also carries the deployment
|
|
124
124
|
* constants the UI reads (session default permission, subtask depth).
|
|
125
125
|
*/
|
|
126
|
-
export type HostMirror = Pick<TaskBoardSnapshot, 'revision' | 'scheduler' | 'power' | 'sessionDefaultPermission' | 'maxSubtaskDepth' | '
|
|
126
|
+
export type HostMirror = Pick<TaskBoardSnapshot, 'revision' | 'scheduler' | 'power' | 'sessionDefaultPermission' | 'maxSubtaskDepth' | 'goalRunEnabled' | 'cardDefaults' | 'extensions'>;
|
|
127
127
|
/** Immutable controller snapshot for UI subscriptions. */
|
|
128
128
|
export interface ControllerSnapshot {
|
|
129
129
|
tasks: readonly TaskRecord[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What one execution left behind: the text of its last assistant message,
|
|
3
|
+
* recorded on the execution record next to the verdict it belongs to.
|
|
4
|
+
*
|
|
5
|
+
* A settled execution used to carry only a verdict, so a parent card could see
|
|
6
|
+
* that a subtask succeeded without ever seeing what it produced, and had to
|
|
7
|
+
* guess or redo the work. The card's own content cannot answer that: card
|
|
8
|
+
* content is the plan and freezes at the first execution
|
|
9
|
+
* (`canEditTaskContent`), so the closing words of a run are recorded on the
|
|
10
|
+
* execution record instead.
|
|
11
|
+
*
|
|
12
|
+
* Pure (no cordis, no runtime imports) so the settlement path is unit-testable
|
|
13
|
+
* without a session, and so a text-less run degrades to "no field" rather than
|
|
14
|
+
* to an empty string.
|
|
15
|
+
*/
|
|
16
|
+
import { type ExecutionSummary } from './tasks.ts';
|
|
17
|
+
/** Structural view of one session event, as both readers expose it. */
|
|
18
|
+
export interface SummaryEvent {
|
|
19
|
+
type?: unknown;
|
|
20
|
+
seq?: unknown;
|
|
21
|
+
time?: unknown;
|
|
22
|
+
data?: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Bound one summary, keeping its tail: the closing paragraphs carry the
|
|
26
|
+
* conclusion a reader is after, and the omitted opening is announced instead of
|
|
27
|
+
* silently dropped. Mirrors the evidence reader's tail bound.
|
|
28
|
+
*/
|
|
29
|
+
export declare function truncateExecutionSummary(text: string, limit?: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* The summary one execution's own events support.
|
|
32
|
+
*
|
|
33
|
+
* Only events at or after `startedAt` belong to this run: a reused session
|
|
34
|
+
* carries the history of earlier executions, which must not be reported as this
|
|
35
|
+
* one's output. The last assistant message WITH prose wins — a trailing
|
|
36
|
+
* tool-call or reasoning-only message has nothing to leave behind, so the reader
|
|
37
|
+
* walks back to the last one that speaks.
|
|
38
|
+
* @param events - the session events the inspection already read.
|
|
39
|
+
* @param startedAt - the execution's start instant (ms epoch); 0 means "all".
|
|
40
|
+
* @returns the bounded summary with the seq it came from, or undefined when the
|
|
41
|
+
* run left no usable text.
|
|
42
|
+
*/
|
|
43
|
+
export declare function executionSummaryOf(events: readonly SummaryEvent[], startedAt: number): ExecutionSummary | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Repair one persisted or reported summary.
|
|
46
|
+
*
|
|
47
|
+
* A summary is informational, so an unreadable one is dropped on its own rather
|
|
48
|
+
* than costing the execution (or the task row) it hangs on. A hand-edited
|
|
49
|
+
* overlong text is bounded on the way in, so no reader ever holds more than the
|
|
50
|
+
* limit.
|
|
51
|
+
*/
|
|
52
|
+
export declare function normalizeExecutionSummary(value: unknown): ExecutionSummary | undefined;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @module dsh-task-board/core/extension
|
|
13
13
|
*/
|
|
14
14
|
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
15
|
+
import type { TaskBoardAction, TaskBoardSnapshot, TaskBoardVerificationOptions } from '../protocol.ts';
|
|
15
16
|
import type { ExecutionOutcome, TaskRecord, TaskStatus } from './tasks.ts';
|
|
16
17
|
/** Cordis service name the host and browser halves each publish. */
|
|
17
18
|
export declare const TASK_BOARD_SERVICE_NAME = "taskBoard";
|
|
@@ -255,6 +256,39 @@ export interface TaskBoardHostFace {
|
|
|
255
256
|
registerExtension(extension: TaskBoardExtension): () => void;
|
|
256
257
|
/** Whether the board currently runs a given extension (board x extension). */
|
|
257
258
|
isExtensionEnabled(extensionId: string): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* The whole ledger as the board builds it, tasks included.
|
|
261
|
+
*
|
|
262
|
+
* Part of the read/write face an IN-PROCESS consumer drives the board through
|
|
263
|
+
* (the remote bridge plugin forwarding it to a paired phone); a browser half
|
|
264
|
+
* reads the same document over the board's own HTTP surface. Forwards
|
|
265
|
+
* {@link ../host-service.ts | TaskBoardHostService.snapshot}, so nothing is
|
|
266
|
+
* interpreted between the ledger and the caller.
|
|
267
|
+
*/
|
|
268
|
+
snapshot(): TaskBoardSnapshot;
|
|
269
|
+
/**
|
|
270
|
+
* Apply one action through every gate the board already has — the running
|
|
271
|
+
* lock, the permission confirmation, the subtask depth, the schedule budget —
|
|
272
|
+
* and answer the resulting snapshot.
|
|
273
|
+
*
|
|
274
|
+
* The `requestId` is the ledger's own idempotency key, so a caller that
|
|
275
|
+
* retries one envelope does not apply it twice. Refusals are the ledger's:
|
|
276
|
+
* they throw with the Host's own text, which is why this face adds no code
|
|
277
|
+
* table of its own.
|
|
278
|
+
*/
|
|
279
|
+
apply(requestId: string, action: TaskBoardAction, initiator?: string): TaskBoardSnapshot | Promise<TaskBoardSnapshot>;
|
|
280
|
+
/**
|
|
281
|
+
* Follow the board's change notifications. The listener receives no payload —
|
|
282
|
+
* a consumer that needs the state reads {@link snapshot} — and the returned
|
|
283
|
+
* disposer unsubscribes.
|
|
284
|
+
*/
|
|
285
|
+
subscribe(listener: () => void): () => void;
|
|
286
|
+
/**
|
|
287
|
+
* The acceptance settings, the contract they resolve to right now, and the
|
|
288
|
+
* model catalog the choices come from. The same document the board's own
|
|
289
|
+
* `/verification` route serves.
|
|
290
|
+
*/
|
|
291
|
+
verificationOptions(): Promise<TaskBoardVerificationOptions>;
|
|
258
292
|
}
|
|
259
293
|
declare module '@deepseek-ai/cordis' {
|
|
260
294
|
interface Context {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The daily token ceiling both spend gates share, as pure rules: the cap
|
|
3
|
+
* comparison and the one refusal wording.
|
|
4
|
+
*
|
|
5
|
+
* The unit is tokens, not money. The usage ledger the board reads prices only
|
|
6
|
+
* DeepSeek's own routes, so a cost cap would read 0 on every other route and
|
|
7
|
+
* refuse nothing on exactly the deployments that need it. A cap of 0 is the
|
|
8
|
+
* shipped default and means "no gate": both gates answer before they read a
|
|
9
|
+
* file, subscribe to an event, or compute anything.
|
|
10
|
+
* @module @linxin666/dsh-task-board/core/spend-budget
|
|
11
|
+
*/
|
|
12
|
+
/** Token cap one board day may spend; 0 disables the gate. */
|
|
13
|
+
export declare const DEFAULT_SPEND_BUDGET_TOKENS = 0;
|
|
14
|
+
/**
|
|
15
|
+
* Whether a day's measured spend already reached the cap.
|
|
16
|
+
* @param usedTokens - tokens the day's spend measurement reported.
|
|
17
|
+
* @param cap - the configured cap, 0 for "no gate".
|
|
18
|
+
* @returns true when a run must be refused.
|
|
19
|
+
*/
|
|
20
|
+
export declare function spendCapReached(usedTokens: number, cap: number): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The refusal text both gates report: the thrown message a client sees as
|
|
23
|
+
* board-refused, and the scheduler error a due occurrence records.
|
|
24
|
+
* @param usedTokens - tokens the day's spend measurement reported.
|
|
25
|
+
* @param cap - the configured cap.
|
|
26
|
+
* @returns the refusal message.
|
|
27
|
+
*/
|
|
28
|
+
export declare function spendCapMessage(usedTokens: number, cap: number): string;
|