@linxin666/dsh-client-ui-task-board 0.4.8 → 0.4.10
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 +28 -22
- package/README.zh.md +28 -22
- package/lib/client.js +1435 -682
- package/lib/client.js.map +1 -1
- package/lib/index.js +356 -366
- package/lib/types/client/PluginSettingsCard.d.ts +21 -0
- package/lib/types/client/TaskBoardSettingsCard.d.ts +7 -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 +42 -6
- package/lib/types/client/suppress-schedule-row.d.ts +86 -0
- package/lib/types/core/controller.d.ts +1 -1
- package/lib/types/core/subtask.d.ts +59 -49
- package/lib/types/core/tasks.d.ts +5 -8
- 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 +72 -48
- package/lib/types/host-routes.d.ts +49 -0
- package/lib/types/host-runner.d.ts +20 -10
- package/lib/types/host-service.d.ts +7 -50
- package/lib/types/index.d.ts +61 -63
- package/lib/types/loopback.d.ts +21 -0
- 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 +78 -18
- package/src/client/TaskBoardSettingsCard.tsx +68 -25
- 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 +97 -24
- package/src/client/settings-card.module.css +71 -10
- package/src/client/suppress-schedule-row.ts +198 -0
- package/src/core/controller.ts +1 -3
- package/src/core/subtask.ts +81 -76
- package/src/core/tasks.ts +5 -9
- 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 +158 -125
- package/src/host-routes.ts +65 -2
- package/src/host-runner.ts +53 -28
- package/src/host-service.ts +42 -127
- package/src/index.ts +84 -106
- package/src/loopback.ts +32 -0
- 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
|
|
@@ -78,6 +86,13 @@ export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
|
78
86
|
renderChildrenWhenNotExposed?: boolean;
|
|
79
87
|
/** Hide the 'not exposed' warning banner when the settings namespace is not exposed. */
|
|
80
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';
|
|
81
96
|
/** The plugin's controls. */
|
|
82
97
|
children: ReactNode;
|
|
83
98
|
}
|
|
@@ -95,6 +110,12 @@ export interface FieldProps {
|
|
|
95
110
|
label: string;
|
|
96
111
|
/** One-line explanation rendered under the control. */
|
|
97
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;
|
|
98
119
|
/** Draft text this control renders. */
|
|
99
120
|
text: string;
|
|
100
121
|
/** True when saving would leave a user-layer entry for this field. */
|
|
@@ -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. */
|
|
@@ -67,6 +72,8 @@ export interface TaskBoardSettingsCardState extends CardShell {
|
|
|
67
72
|
announceToAgent: CardFieldState;
|
|
68
73
|
/** Idle-system-sleep protection flag. */
|
|
69
74
|
preventIdleSleep: CardFieldState;
|
|
75
|
+
/** Forwarded-request trust flag. */
|
|
76
|
+
trustForwardedProxy: CardFieldState;
|
|
70
77
|
/** Subtask depth limit field. */
|
|
71
78
|
maxSubtaskDepth: CardFieldState;
|
|
72
79
|
/** Roster-poll cadence field. */
|
|
@@ -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,28 +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;
|
|
301
328
|
'settings.spendBudgetTokens': string;
|
|
302
329
|
'settings.spendBudgetTokensHint': string;
|
|
330
|
+
'settings.spendBudgetTokensHintBrief': string;
|
|
303
331
|
'settings.runBehaviorTitle': string;
|
|
304
332
|
'settings.runBehaviorCardHint': string;
|
|
305
333
|
'settings.goalRunGlobal': string;
|
|
306
334
|
'settings.goalRunGlobalHint': string;
|
|
335
|
+
'settings.goalRunGlobalHintBrief': string;
|
|
307
336
|
'settings.goalRunGlobalDisabledTaskOption': string;
|
|
308
337
|
'settings.goalVerificationTitle': string;
|
|
309
338
|
'settings.goalVerification': string;
|
|
310
339
|
'settings.goalVerificationCardHint': string;
|
|
311
340
|
'settings.goalVerificationHint': string;
|
|
341
|
+
'settings.goalVerificationHintBrief': string;
|
|
312
342
|
'settings.goalVerificationModel': string;
|
|
313
343
|
'settings.goalVerificationModelHint': string;
|
|
344
|
+
'settings.goalVerificationModelHintBrief': string;
|
|
314
345
|
'settings.goalVerificationModelInherit': string;
|
|
315
346
|
'settings.goalVerificationModelInheritUnknown': string;
|
|
316
347
|
'settings.goalVerificationEffort': string;
|
|
317
348
|
'settings.goalVerificationEffortHint': string;
|
|
349
|
+
'settings.goalVerificationEffortHintBrief': string;
|
|
318
350
|
'settings.goalVerificationEffortInherit': string;
|
|
319
351
|
'settings.goalVerificationEffortInheritUnknown': string;
|
|
320
352
|
'settings.goalVerificationResolved': string;
|
|
@@ -331,9 +363,13 @@ export declare const zh: {
|
|
|
331
363
|
'settings.goalVerificationModelInvalid': string;
|
|
332
364
|
'settings.cardDefaultsTitle': string;
|
|
333
365
|
'settings.cardDefaultsCardHint': string;
|
|
366
|
+
'settings.cardDefaultsCardBrief': string;
|
|
334
367
|
'settings.cardDefaultModeHint': string;
|
|
368
|
+
'settings.cardDefaultModeHintBrief': string;
|
|
335
369
|
'settings.cardDefaultPermissionHint': string;
|
|
370
|
+
'settings.cardDefaultPermissionHintBrief': string;
|
|
336
371
|
'settings.cardDefaultModelHint': string;
|
|
372
|
+
'settings.cardDefaultModelHintBrief': string;
|
|
337
373
|
'running.executing': string;
|
|
338
374
|
'running.verifying': string;
|
|
339
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;
|
|
@@ -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[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Subtask lineage: the depth gate, the ancestry/descendant queries, the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* run time.
|
|
3
|
+
* outstanding-descendant decision one run request makes, the deferred
|
|
4
|
+
* settlement of a historical run group, and the execution-target inheritance a
|
|
5
|
+
* subtask resolves at run time.
|
|
6
6
|
*
|
|
7
7
|
* Framework-free (no cordis, no runtime imports) so every rule is
|
|
8
8
|
* unit-testable in isolation. The Host ledger is the only authority; the
|
|
@@ -75,34 +75,61 @@ export interface ParentLinkCheck {
|
|
|
75
75
|
*/
|
|
76
76
|
export declare function checkParentLink(tasks: readonly TaskRecord[], childId: string, parentId: string | null, maxSubtaskDepth: number, lineage?: LineageIndex): ParentLinkCheck;
|
|
77
77
|
/**
|
|
78
|
-
* The tasks one run request opens executions for: the requested
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
78
|
+
* The tasks one run request opens executions for: the requested card ALONE.
|
|
79
|
+
*
|
|
80
|
+
* Running a card never expands into its subtask tree. The card's own session
|
|
81
|
+
* reads its subtasks through the board tools and dispatches subagents itself,
|
|
82
|
+
* so a parent run opens exactly one session. Clicking a subtask runs that
|
|
83
|
+
* subtask as its own root, again without expanding its own descendants. The
|
|
84
|
+
* lineage queries around this one answer questions about the tree the card's
|
|
85
|
+
* agent works with (who is still outstanding, what a historical run group
|
|
86
|
+
* still holds open) — never who gets a session from the Host.
|
|
87
|
+
* @param tasks - the ledger.
|
|
88
|
+
* @param rootId - the task the run request named.
|
|
89
|
+
* @returns the one card this run opens an execution for, or [] when unknown.
|
|
85
90
|
*/
|
|
86
|
-
export declare function cascadeTargets(tasks: readonly TaskRecord[], rootId: string
|
|
91
|
+
export declare function cascadeTargets(tasks: readonly TaskRecord[], rootId: string): TaskRecord[];
|
|
87
92
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
*
|
|
93
|
+
* A task together with every descendant within the configured depth: the
|
|
94
|
+
* subtree a lineage gate (archive, restore, force-close) has to walk.
|
|
95
|
+
*/
|
|
96
|
+
export declare function subtreeTasks(tasks: readonly TaskRecord[], id: string, maxSubtaskDepth: number): TaskRecord[];
|
|
97
|
+
/**
|
|
98
|
+
* Whether a card still has work outstanding: anything outside the `done`
|
|
99
|
+
* column. It keys on the column alone, so it covers both a subtask that ran
|
|
100
|
+
* and one an operator moved to done by hand.
|
|
101
|
+
*/
|
|
102
|
+
export declare function isOutstanding(task: TaskRecord): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* The descendants of a card that still have work outstanding, in breadth-first
|
|
105
|
+
* order: the cards its own session is expected to dispatch. An archived
|
|
106
|
+
* descendant is off the board and cannot be dispatched, so it is not listed.
|
|
107
|
+
*/
|
|
108
|
+
export declare function outstandingDescendants(tasks: readonly TaskRecord[], rootId: string, maxSubtaskDepth: number): TaskRecord[];
|
|
109
|
+
/**
|
|
110
|
+
* Whether any descendant of this card still sits outside the `done` column.
|
|
111
|
+
* This is the ONE decision behind both the forced agent preset and the dispatch
|
|
112
|
+
* section of the execution prompt: a card whose tree still holds work runs as
|
|
113
|
+
* the autonomous dispatcher.
|
|
114
|
+
*/
|
|
115
|
+
export declare function hasOutstandingDescendants(tasks: readonly TaskRecord[], rootId: string, maxSubtaskDepth: number): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Agent preset a run with unfinished subtasks is forced under. The id comes
|
|
118
|
+
* from packages/dsh-liangshen (its own `LIANGSHEN_PRESET_ID`); the force is
|
|
119
|
+
* applied at launch and never written into a card's `mode` field.
|
|
120
|
+
*/
|
|
121
|
+
export declare const LIANGSHEN_PRESET_ID = "liangshen";
|
|
122
|
+
/**
|
|
123
|
+
* Whether a card belongs to a run's dispatch set: the card the request named,
|
|
124
|
+
* or a card whose work is still outstanding. Kept for the browser's subtask
|
|
125
|
+
* preview; the Host run itself opens the clicked card alone
|
|
126
|
+
* ({@link cascadeTargets}).
|
|
127
|
+
* @param task - the candidate card.
|
|
101
128
|
* @param rootId - the task the run request named.
|
|
102
|
-
* @returns false when this
|
|
129
|
+
* @returns false when this card is finished and left alone.
|
|
103
130
|
*/
|
|
104
131
|
export declare function joinsCascadeRun(task: TaskRecord, rootId: string): boolean;
|
|
105
|
-
/** One still-open execution belonging to a
|
|
132
|
+
/** One still-open execution belonging to a stored run group. */
|
|
106
133
|
export interface OpenCascadeChild {
|
|
107
134
|
taskId: string;
|
|
108
135
|
execution: ExecutionRecord;
|
|
@@ -111,14 +138,15 @@ export interface OpenCascadeChild {
|
|
|
111
138
|
export declare function openGroupExecution(task: TaskRecord, runGroupId: string): ExecutionRecord | undefined;
|
|
112
139
|
/**
|
|
113
140
|
* The direct subtasks of parentTaskId whose execution in this run group is
|
|
114
|
-
* still open: the parent remaining waiters.
|
|
115
|
-
*
|
|
141
|
+
* still open: the parent's remaining waiters. A stored multi-member group (a
|
|
142
|
+
* run the Host opened before it stopped spreading one run across a subtree)
|
|
143
|
+
* folds once this list is empty and the parent's own outcome is known.
|
|
116
144
|
*/
|
|
117
145
|
export declare function pendingCascadeChildren(tasks: readonly TaskRecord[], parentTaskId: string, runGroupId: string): OpenCascadeChild[];
|
|
118
146
|
/**
|
|
119
|
-
* Fold a
|
|
120
|
-
* verdict: failure dominates, then cancellation, then success. The error
|
|
121
|
-
* is the first failure, falling back to the first cancellation.
|
|
147
|
+
* Fold a stored run-group parent's own outcome and its children's outcomes into
|
|
148
|
+
* one verdict: failure dominates, then cancellation, then success. The error
|
|
149
|
+
* text is the first failure, falling back to the first cancellation.
|
|
122
150
|
*/
|
|
123
151
|
export declare function combineCascadeOutcome(entries: readonly {
|
|
124
152
|
result: ExecutionOutcome;
|
|
@@ -142,22 +170,4 @@ export declare function effectiveTaskPermission(task: TaskRecord): TaskRecord['p
|
|
|
142
170
|
* elevated card is runnable while a subtask's own unconfirmed binding stays
|
|
143
171
|
* gated.
|
|
144
172
|
*/
|
|
145
|
-
/**
|
|
146
|
-
* The immutable teammate name for one team-mode member. Teammate names are
|
|
147
|
-
* lower-kebab-case and must stay unique for the lifetime of the Team: the
|
|
148
|
-
* run-group token separates two runs of the same tree, and the member
|
|
149
|
-
* discriminator separates two members of one run that reduce to the same slug.
|
|
150
|
-
*
|
|
151
|
-
* The discriminator is not cosmetic. A title with no ASCII word characters (a
|
|
152
|
-
* CJK title, for example) carries no slug at all, so every such title of one
|
|
153
|
-
* run group collides on the generic prefix; Agent Teams answers every member
|
|
154
|
-
* after the first with `teammate name "..." was already used in this Team`,
|
|
155
|
-
* and those subtasks never start. Two ASCII titles that share a slug
|
|
156
|
-
* (`AI 强度预测` next to `AI 配比优化`) collide the same way.
|
|
157
|
-
* @param title - the member task's title.
|
|
158
|
-
* @param token - the run group id (the task id when no group is recorded).
|
|
159
|
-
* @param memberId - the member task's id, which makes the name unique in the run.
|
|
160
|
-
* @returns the teammate name handed to the Agent Teams service.
|
|
161
|
-
*/
|
|
162
|
-
export declare function teammateName(title: string, token: string, memberId?: string): string;
|
|
163
173
|
export declare function resolveExecutionTargets(task: TaskRecord, tasks: readonly TaskRecord[], maxSubtaskDepth?: number): TaskRecord;
|
|
@@ -374,12 +374,11 @@ export interface TaskRecord {
|
|
|
374
374
|
*/
|
|
375
375
|
reuseSession?: boolean;
|
|
376
376
|
/**
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* and a subtask's own permission pin cannot be honored in this mode.
|
|
377
|
+
* Historical Agent Team opt-in. New runs never write it and the Host never
|
|
378
|
+
* reads it to decide how to run: a run with unfinished subtasks opens one
|
|
379
|
+
* session whose own agent dispatches subagents. The field is kept so cards
|
|
380
|
+
* already on disk keep their record, and so the ledger can still fold a team
|
|
381
|
+
* run group it opened before this behavior changed.
|
|
383
382
|
*/
|
|
384
383
|
teamRun?: boolean;
|
|
385
384
|
/**
|
|
@@ -498,8 +497,6 @@ export interface NewTaskInput {
|
|
|
498
497
|
applyCardDefaults?: boolean;
|
|
499
498
|
/** Reuse the previous execution's session for later runs (issue #1419). */
|
|
500
499
|
reuseSession?: boolean;
|
|
501
|
-
/** Run the subtree as an Agent Team (Team Lead session plus one teammate per direct subtask). */
|
|
502
|
-
teamRun?: boolean;
|
|
503
500
|
/**
|
|
504
501
|
* Start the execution with dsh's built-in `/goal`. Absent means the default
|
|
505
502
|
* (one plain turn); only an explicit true joins the goal run.
|
|
@@ -15,7 +15,7 @@ import type { TaskHandoverInput } from '../handover.ts';
|
|
|
15
15
|
* Editable fields on a task (the update patch surface). `freeze` replaces the
|
|
16
16
|
* continuation-card snapshot (restamping frozenAt); an explicit null clears it.
|
|
17
17
|
*/
|
|
18
|
-
export type TaskUpdatePatch = Partial<Pick<TaskRecord, 'title' | 'description' | 'prompt' | 'workspaceId' | 'mode' | 'permission' | 'model' | 'reasoningEffort' | 'reuseSession' | '
|
|
18
|
+
export type TaskUpdatePatch = Partial<Pick<TaskRecord, 'title' | 'description' | 'prompt' | 'workspaceId' | 'mode' | 'permission' | 'model' | 'reasoningEffort' | 'reuseSession' | 'goalRun' | 'skipVerification'>> & {
|
|
19
19
|
freeze?: FreezeSnapshot & {
|
|
20
20
|
redacted?: boolean;
|
|
21
21
|
} | null;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workspace targeting for cards that pin none.
|
|
3
3
|
*
|
|
4
|
-
* The Host answers
|
|
4
|
+
* The Host answers three questions here instead of leaving them to
|
|
5
5
|
* `session.create`, whose own fallback is the Host process working directory
|
|
6
6
|
* (the desktop app's profile directory): which workspace a root card inherits
|
|
7
|
-
* from the session that created it,
|
|
8
|
-
*
|
|
7
|
+
* from the session that created it, which workspace an unpinned run lands in
|
|
8
|
+
* when nothing could be inherited, and — when neither names one — the refusal
|
|
9
|
+
* that stops the run instead of landing it there.
|
|
9
10
|
*
|
|
10
11
|
* Structural types only — the Host's `Workspace` entity satisfies them — so the
|
|
11
12
|
* browser program compiles this module without importing an SDK value.
|
|
@@ -39,3 +40,22 @@ export declare function workspaceOwningSession(items: readonly WorkspaceCandidat
|
|
|
39
40
|
* @returns the most recently used workspace id, or undefined when there is none.
|
|
40
41
|
*/
|
|
41
42
|
export declare function mostRecentWorkspaceId(items: readonly WorkspaceCandidate[]): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The failure text the Host records when a card names no workspace and the
|
|
45
|
+
* deployment has none to resolve it to: the run is refused before any session
|
|
46
|
+
* exists instead of letting `session.create` fall back to the Host process
|
|
47
|
+
* working directory (the desktop app's profile directory), which is never the
|
|
48
|
+
* project the user meant.
|
|
49
|
+
*
|
|
50
|
+
* A finished sentence rather than a code: the ledger stores it as the
|
|
51
|
+
* execution's failure text, which the agent tools serve to a model and which
|
|
52
|
+
* any client prints verbatim. It names the fix, not the mechanism.
|
|
53
|
+
*/
|
|
54
|
+
export declare const MISSING_WORKSPACE_REASON = "this card pins no workspace; choose a workspace on the card before running";
|
|
55
|
+
/**
|
|
56
|
+
* Whether a recorded failure text is the missing-workspace refusal, which the
|
|
57
|
+
* browser half renders in the reader's own language.
|
|
58
|
+
* @param reason - the execution's recorded failure text.
|
|
59
|
+
* @returns true when that run was refused for naming no workspace.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isMissingWorkspaceReason(reason: string): boolean;
|