@fish-under-sea/dsh-client-ui-task-board-fish 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +4 -4
- package/package.json +5 -4
- package/README.i18n.yaml +0 -6
- package/README.md +0 -31
- package/README.zh.md +0 -31
- package/lib/client.js +0 -15861
- package/lib/client.js.map +0 -1
- package/lib/index.js +0 -12653
- package/lib/types/client/CardDefaultPresetField.d.ts +0 -35
- package/lib/types/client/PluginSettingsCard.d.ts +0 -255
- package/lib/types/client/RangeBubble.d.ts +0 -46
- package/lib/types/client/SegmentGroup.d.ts +0 -28
- package/lib/types/client/TaskBoardSettingsCard.d.ts +0 -155
- package/lib/types/client/apply-guard.d.ts +0 -25
- package/lib/types/client/board/AttachmentField.d.ts +0 -70
- package/lib/types/client/board/ClampedMarkdown.d.ts +0 -3
- package/lib/types/client/board/ConfirmDialog.d.ts +0 -15
- package/lib/types/client/board/EditTaskModal.d.ts +0 -17
- package/lib/types/client/board/ExecutionLog.d.ts +0 -24
- package/lib/types/client/board/LinkSubtaskModal.d.ts +0 -14
- package/lib/types/client/board/NewTaskModal.d.ts +0 -26
- package/lib/types/client/board/ReasoningEffortField.d.ts +0 -25
- package/lib/types/client/board/TagManagerModal.d.ts +0 -26
- package/lib/types/client/board/TaskBoard.d.ts +0 -26
- package/lib/types/client/board/TaskCard.d.ts +0 -36
- package/lib/types/client/board/TaskDetail.d.ts +0 -9
- package/lib/types/client/board/TaskForm.d.ts +0 -76
- package/lib/types/client/board/VerificationReport.d.ts +0 -10
- package/lib/types/client/board/card-view.d.ts +0 -113
- package/lib/types/client/board/icons.d.ts +0 -32
- package/lib/types/client/board/model-options.d.ts +0 -87
- package/lib/types/client/board/overlay.d.ts +0 -69
- package/lib/types/client/board/parse-model-pref.d.ts +0 -4
- package/lib/types/client/board/preset-label.d.ts +0 -43
- package/lib/types/client/board/preset-roster.d.ts +0 -45
- package/lib/types/client/board/source-group.d.ts +0 -27
- package/lib/types/client/board/status-key.d.ts +0 -19
- package/lib/types/client/board/task-markdown.d.ts +0 -19
- package/lib/types/client/body-mutations.d.ts +0 -45
- package/lib/types/client/host-api.d.ts +0 -88
- package/lib/types/client/index.d.ts +0 -128
- package/lib/types/client/locales.d.ts +0 -521
- package/lib/types/client/main-session.d.ts +0 -32
- package/lib/types/client/native-panel.d.ts +0 -48
- package/lib/types/client/pending-verify.d.ts +0 -47
- package/lib/types/client/plugin-card-seat.d.ts +0 -110
- package/lib/types/client/schedule-presets.d.ts +0 -10
- package/lib/types/client/schedule-zone.d.ts +0 -97
- package/lib/types/client/seats.d.ts +0 -18
- package/lib/types/client/service.d.ts +0 -35
- package/lib/types/client/settings-entry-form.d.ts +0 -49
- package/lib/types/client/settings-form.d.ts +0 -235
- package/lib/types/core/attachment.d.ts +0 -132
- package/lib/types/core/card-defaults.d.ts +0 -78
- package/lib/types/core/controller.d.ts +0 -422
- package/lib/types/core/degraded-reason.d.ts +0 -46
- package/lib/types/core/execution-summary.d.ts +0 -52
- package/lib/types/core/extension.d.ts +0 -399
- package/lib/types/core/freeze-snapshot.d.ts +0 -71
- package/lib/types/core/handover.d.ts +0 -70
- package/lib/types/core/issue-form.d.ts +0 -16
- package/lib/types/core/launch-width.d.ts +0 -31
- package/lib/types/core/package-name.d.ts +0 -9
- package/lib/types/core/poll-cadence.d.ts +0 -31
- package/lib/types/core/reasoning-effort.d.ts +0 -57
- package/lib/types/core/schedule.d.ts +0 -124
- package/lib/types/core/session-reuse.d.ts +0 -30
- package/lib/types/core/spend-budget.d.ts +0 -28
- package/lib/types/core/store.d.ts +0 -64
- package/lib/types/core/subtask.d.ts +0 -204
- package/lib/types/core/tasks.d.ts +0 -685
- package/lib/types/core/use-cases/task-archive.d.ts +0 -20
- package/lib/types/core/use-cases/task-create.d.ts +0 -32
- package/lib/types/core/use-cases/task-delete.d.ts +0 -27
- package/lib/types/core/use-cases/task-parent.d.ts +0 -21
- package/lib/types/core/use-cases/task-schedule.d.ts +0 -96
- package/lib/types/core/use-cases/task-tag.d.ts +0 -84
- package/lib/types/core/use-cases/task-update.d.ts +0 -77
- package/lib/types/core/verification-budget.d.ts +0 -52
- package/lib/types/core/verification.d.ts +0 -753
- package/lib/types/core/wire-projection.d.ts +0 -35
- package/lib/types/core/workspace-target.d.ts +0 -61
- package/lib/types/dsh-home.d.ts +0 -16
- package/lib/types/host/agent-tools.d.ts +0 -27
- package/lib/types/host/attachments.d.ts +0 -250
- package/lib/types/host/extension-registry.d.ts +0 -151
- package/lib/types/host/launch-admission.d.ts +0 -71
- package/lib/types/host/llm-dispatch.d.ts +0 -63
- package/lib/types/host/verification-gate.d.ts +0 -95
- package/lib/types/host/verification-runner.d.ts +0 -139
- package/lib/types/host/workspace-evidence.d.ts +0 -53
- package/lib/types/host-ai.d.ts +0 -51
- package/lib/types/host-ledger.d.ts +0 -452
- package/lib/types/host-routes.d.ts +0 -99
- package/lib/types/host-runner.d.ts +0 -401
- package/lib/types/host-service.d.ts +0 -517
- package/lib/types/host-spend.d.ts +0 -52
- package/lib/types/http.d.ts +0 -59
- package/lib/types/index.d.ts +0 -441
- package/lib/types/loopback.d.ts +0 -64
- package/lib/types/mount-once.d.ts +0 -55
- package/lib/types/power-inhibitor.d.ts +0 -73
- package/lib/types/protocol.d.ts +0 -253
- package/lib/types/tool-surface.d.ts +0 -72
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Roster-poll cadence: the one recurring Host timer the board holds.
|
|
3
|
-
*
|
|
4
|
-
* The cadence is a user setting (seconds), so the bounds and the seconds to
|
|
5
|
-
* milliseconds conversion live here rather than in either half: the settings
|
|
6
|
-
* card validates a draft against the same range the Host clamps a hand-edited
|
|
7
|
-
* configuration to, and a programmatic mount that passes no cadence gets the
|
|
8
|
-
* default.
|
|
9
|
-
*
|
|
10
|
-
* @module dsh-task-board/core/poll-cadence
|
|
11
|
-
*/
|
|
12
|
-
/** Cadence used when neither the settings document nor the mount names one. */
|
|
13
|
-
export declare const DEFAULT_SESSION_POLL_SECONDS = 5;
|
|
14
|
-
/** Shortest accepted cadence: a faster poll only burns CPU on the Host. */
|
|
15
|
-
export declare const SESSION_POLL_MIN_SECONDS = 1;
|
|
16
|
-
/** Longest accepted cadence, five minutes. */
|
|
17
|
-
export declare const SESSION_POLL_MAX_SECONDS = 300;
|
|
18
|
-
/**
|
|
19
|
-
* Clamp a configured cadence into the supported range. A value the schema
|
|
20
|
-
* would refuse (non-finite, below the floor, above the ceiling) still leaves
|
|
21
|
-
* the board polling: an out-of-range setting never disables the timer.
|
|
22
|
-
* @param seconds - configured cadence in seconds, or undefined for the default.
|
|
23
|
-
* @returns the effective cadence in seconds.
|
|
24
|
-
*/
|
|
25
|
-
export declare function normalizeSessionPollSeconds(seconds: number | undefined): number;
|
|
26
|
-
/**
|
|
27
|
-
* The cadence in the milliseconds the Host timer face takes.
|
|
28
|
-
* @param seconds - configured cadence in seconds, or undefined for the default.
|
|
29
|
-
* @returns the effective cadence in milliseconds.
|
|
30
|
-
*/
|
|
31
|
-
export declare function sessionPollMs(seconds: number | undefined): number;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which reasoning effort one execution may actually send.
|
|
3
|
-
*
|
|
4
|
-
* The rule lives here, in one pure place, so the launch path cannot drift from
|
|
5
|
-
* what the picker promises: an effort is sent ONLY for the exact model route
|
|
6
|
-
* whose adapter declares that id. An unsupported value is dropped rather than
|
|
7
|
-
* passed through — the Host validates the selection against the same
|
|
8
|
-
* capability (`resolveCallConfig` rejects an unsupported effort) and the whole
|
|
9
|
-
* model selection would fail with it. An absent effort stays absent: the SDK
|
|
10
|
-
* then materializes the model's own default, which is exactly what "inherit
|
|
11
|
-
* the model" means.
|
|
12
|
-
*
|
|
13
|
-
* A card that pins a bare model id also gets its provider resolved here: the
|
|
14
|
-
* session wire contract requires `provider` (ModelSelection), so the catalog is
|
|
15
|
-
* the only place that can complete the documented `provider/model` or model-id
|
|
16
|
-
* pin.
|
|
17
|
-
*/
|
|
18
|
-
import type { CatalogModel, ModelCatalogView } from './verification.ts';
|
|
19
|
-
/** One execution route an effort resolves against: `provider/model`, or a bare model id. */
|
|
20
|
-
export interface ReasoningRoute {
|
|
21
|
-
provider?: string;
|
|
22
|
-
model: string;
|
|
23
|
-
}
|
|
24
|
-
/** The catalog entry a route names, once the catalog can complete it. */
|
|
25
|
-
export interface DeclaredReasoningRoute {
|
|
26
|
-
provider: string;
|
|
27
|
-
model: string;
|
|
28
|
-
/** The adapter's reasoning metadata; absent when it exposes none. */
|
|
29
|
-
reasoning?: CatalogModel['reasoning'];
|
|
30
|
-
}
|
|
31
|
-
/** What one card's effort resolves to for one route. */
|
|
32
|
-
export interface ReasoningEffortDecision {
|
|
33
|
-
/** The effort to send; absent means "send none". */
|
|
34
|
-
effort?: string;
|
|
35
|
-
/** The card's own value when it will NOT be sent. */
|
|
36
|
-
dropped?: string;
|
|
37
|
-
}
|
|
38
|
-
/** Trim one optional effort: blank text means "not set", like every other pinned target. */
|
|
39
|
-
export declare function normalizeReasoningEffort(value: string | undefined): string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Complete one route through the host catalog: a qualified route must match its
|
|
42
|
-
* provider group, and a bare model id matches the first group carrying it —
|
|
43
|
-
* which is the provider the request then names.
|
|
44
|
-
* @param catalog - the host model catalog, when this deployment serves one.
|
|
45
|
-
* @param route - the route as the card pins it.
|
|
46
|
-
* @returns the completed route with its reasoning metadata, or undefined when
|
|
47
|
-
* the catalog declares no such model.
|
|
48
|
-
*/
|
|
49
|
-
export declare function declaredRoute(catalog: ModelCatalogView | undefined, route: ReasoningRoute): DeclaredReasoningRoute | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Resolve the effort one execution sends.
|
|
52
|
-
* @param requested - the card's stored effort (absent or blank = inherit).
|
|
53
|
-
* @param catalog - the host model catalog, when this deployment serves one.
|
|
54
|
-
* @param route - the route the execution will actually run at.
|
|
55
|
-
* @returns the effort to send, or the dropped value that will not be sent.
|
|
56
|
-
*/
|
|
57
|
-
export declare function resolveReasoningEffort(requested: string | undefined, catalog: ModelCatalogView | undefined, route: ReasoningRoute | undefined): ReasoningEffortDecision;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Zone-aware 5-field cron parsing and next-run computation for scheduled task
|
|
3
|
-
* runs. Framework-free and dependency-free (Intl only) so the Host scheduler
|
|
4
|
-
* and the browser next-run preview share one tiny pure module.
|
|
5
|
-
*
|
|
6
|
-
* Grammar: five whitespace-separated fields, 分 时 日 月 周. Every field
|
|
7
|
-
* supports the wildcard, step (wildcard or range + "/n"), single value,
|
|
8
|
-
* inclusive range a-b, and comma lists mixing any of those. Ranges: minutes
|
|
9
|
-
* 0-59, hours 0-23, days 1-31, months 1-12, weekdays 0-7 (0 and 7 both mean
|
|
10
|
-
* Sunday). Invalid expressions parse to null and are rejected by the UI and
|
|
11
|
-
* the Host.
|
|
12
|
-
*
|
|
13
|
-
* Day semantics follow Vixie cron: a field is *starred* when its field text
|
|
14
|
-
* starts with `*`. When day-of-month and day-of-week are both restricted the
|
|
15
|
-
* fields combine with OR; otherwise they combine with AND. The distinction
|
|
16
|
-
* matters for a stepped star such as `*/2`, which still restricts the dates it
|
|
17
|
-
* matches, so `0 0 */2 * 1` means "the Mondays that fall on an even day of
|
|
18
|
-
* month" rather than "every even day, or every Monday".
|
|
19
|
-
*
|
|
20
|
-
* Time zone: every candidate wall clock is interpreted in an explicit IANA
|
|
21
|
-
* zone (the schedule's stored zone, or the Host zone when none is given).
|
|
22
|
-
* A wall clock that does not exist (spring-forward gap) is skipped, and an
|
|
23
|
-
* ambiguous wall clock (fall-back overlap) resolves to the earlier instant, so
|
|
24
|
-
* a repeated local minute fires exactly once. The Host-scheduler semantics are
|
|
25
|
-
* byte-identical to `@deepseek-ai/dsh-schedule`'s resolver, which was verified
|
|
26
|
-
* against it across twelve IANA zones (including 30-minute and 45-minute DST
|
|
27
|
-
* offsets and a date-line jump) and 300k decision instants.
|
|
28
|
-
*
|
|
29
|
-
* That upstream is on the experimental track and is NOT a dependency here (no
|
|
30
|
-
* import, no inject, no peer range), so a change to it fails no test. Re-run the
|
|
31
|
-
* differential check on any `dsh-schedule` release or cohort bump that moves it,
|
|
32
|
-
* and keep this comment honest; the re-verification trigger is recorded in
|
|
33
|
-
* [the owning Agent Note](../../../../.agents/notes/implemented/feature/2026-09-29-task-board-schedule-time-zone.md).
|
|
34
|
-
*/
|
|
35
|
-
/** The parsed match sets of one cron expression. */
|
|
36
|
-
export interface CronSchedule {
|
|
37
|
-
minutes: ReadonlySet<number>;
|
|
38
|
-
hours: ReadonlySet<number>;
|
|
39
|
-
days: ReadonlySet<number>;
|
|
40
|
-
months: ReadonlySet<number>;
|
|
41
|
-
/** Weekdays 0-6, 0 = Sunday (input 7 normalized to 0). */
|
|
42
|
-
weekdays: ReadonlySet<number>;
|
|
43
|
-
/** Whether the day-of-month field text starts with `*` (Vixie starred). */
|
|
44
|
-
dayStarred: boolean;
|
|
45
|
-
/** Whether the weekday field text starts with `*` (Vixie starred). */
|
|
46
|
-
weekdayStarred: boolean;
|
|
47
|
-
}
|
|
48
|
-
/** Fallback zone when the process reports no usable IANA zone. */
|
|
49
|
-
export declare const HOST_TIME_ZONE_FALLBACK = "UTC";
|
|
50
|
-
/** One resolved wall-clock reading in some zone. */
|
|
51
|
-
export interface ZonedParts {
|
|
52
|
-
year: number;
|
|
53
|
-
month: number;
|
|
54
|
-
day: number;
|
|
55
|
-
hour: number;
|
|
56
|
-
minute: number;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* The wall-clock reading of one instant in an explicit zone. Reading through
|
|
60
|
-
* Intl (rather than the process `Date` accessors) is what makes the result
|
|
61
|
-
* independent of the Host's own TZ.
|
|
62
|
-
* @param timeZone - explicit IANA zone.
|
|
63
|
-
* @param epochMs - instant to read.
|
|
64
|
-
* @returns the zone-local calendar and clock fields.
|
|
65
|
-
*/
|
|
66
|
-
export declare function partsInZone(timeZone: string, epochMs: number): ZonedParts;
|
|
67
|
-
/**
|
|
68
|
-
* Resolve a wall clock in an explicit zone to its instant.
|
|
69
|
-
*
|
|
70
|
-
* The offset is probed a day either side of the naive guess so both DST
|
|
71
|
-
* transitions are covered, then every candidate offset whose inverse maps back
|
|
72
|
-
* to the requested wall clock is kept. No survivor means the wall clock does
|
|
73
|
-
* not exist (a spring-forward gap); several means it is ambiguous (a fall-back
|
|
74
|
-
* overlap), and the earliest instant wins so the repeated clock is taken once.
|
|
75
|
-
* @param timeZone - explicit IANA zone.
|
|
76
|
-
* @param year - full calendar year.
|
|
77
|
-
* @param month - 1-12.
|
|
78
|
-
* @param day - day of month.
|
|
79
|
-
* @param hour - 0-23.
|
|
80
|
-
* @param minute - 0-59.
|
|
81
|
-
* @returns the instant in ms epoch, or undefined when the wall clock is skipped.
|
|
82
|
-
*/
|
|
83
|
-
export declare function zonedEpoch(timeZone: string, year: number, month: number, day: number, hour: number, minute: number): number | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* The Host process's IANA zone, used for schedules that store no zone of their
|
|
86
|
-
* own (a ledger written before zones were persisted).
|
|
87
|
-
* @returns a zone name Intl accepts, never empty.
|
|
88
|
-
*/
|
|
89
|
-
export declare function resolveHostTimeZone(): string;
|
|
90
|
-
/**
|
|
91
|
-
* Whether a value names a zone this runtime can actually resolve. A stored
|
|
92
|
-
* zone is trusted only after it round-trips through Intl, so a typo or a zone
|
|
93
|
-
* that this ICU build does not know can never arm a schedule.
|
|
94
|
-
* @param value - candidate zone name.
|
|
95
|
-
* @returns true when the name is usable.
|
|
96
|
-
*/
|
|
97
|
-
export declare function isValidTimeZone(value: string): boolean;
|
|
98
|
-
/**
|
|
99
|
-
* Parse a 5-field cron expression.
|
|
100
|
-
* @returns the match sets, or null when the expression is invalid.
|
|
101
|
-
*/
|
|
102
|
-
export declare function parseCron(expr: string): CronSchedule | null;
|
|
103
|
-
/** Whether the expression parses. */
|
|
104
|
-
export declare function isValidCron(expr: string): boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Compute the next matching instant after `fromMs` strictly greater than it,
|
|
107
|
-
* interpreting the expression's wall clock in `timeZone` (the Host zone when
|
|
108
|
-
* omitted). Returns the ms epoch of the matching minute's start, or undefined
|
|
109
|
-
* when the calendar constraint can never match (for example `0 0 30 2 *`).
|
|
110
|
-
* The five-year horizon includes a full leap cycle, so a valid February 29
|
|
111
|
-
* schedule remains reachable from every non-leap year.
|
|
112
|
-
*
|
|
113
|
-
* Walks candidate year/month/day/hour/minute values straight from the parsed
|
|
114
|
-
* field sets instead of scanning every minute: a sparse expression such as
|
|
115
|
-
* `0 0 29 2 *` used to iterate ~1.5M wall-clock minutes before reaching the
|
|
116
|
-
* next leap day. A candidate wall clock that the zone skips (spring-forward
|
|
117
|
-
* gap) is passed over, which is what makes the gap semantics fall out of the
|
|
118
|
-
* candidate walk rather than needing a separate rule.
|
|
119
|
-
* @param expr - 5-field cron expression.
|
|
120
|
-
* @param fromMs - exclusive lower bound, ms epoch.
|
|
121
|
-
* @param timeZone - explicit IANA zone; defaults to the Host zone.
|
|
122
|
-
* @returns the next trigger instant, or undefined when unreachable.
|
|
123
|
-
*/
|
|
124
|
-
export declare function nextRunAtMs(expr: string, fromMs: number, timeZone?: string): number | undefined;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session-reuse rule (issue #1419): decides which task runs continue in the
|
|
3
|
-
* previous execution's conversation. Pure, so the fail-closed conditions stay
|
|
4
|
-
* unit-testable without a gateway.
|
|
5
|
-
*/
|
|
6
|
-
import type { TaskRecord } from './tasks.ts';
|
|
7
|
-
/**
|
|
8
|
-
* Pick the session a new execution of this task may continue in, or undefined
|
|
9
|
-
* to mint a fresh conversation. Reuse requires ALL of:
|
|
10
|
-
* - the task opted in (`reuseSession === true`);
|
|
11
|
-
* - the task's newest SETTLED execution carries a session id (issue #1587: the
|
|
12
|
-
* launch path calls this after `startExecution` appended this run's own open
|
|
13
|
-
* record, so reading the array tail always found an unsettled row and reuse
|
|
14
|
-
* never happened);
|
|
15
|
-
* - the roster is known and that session is present and idle.
|
|
16
|
-
*
|
|
17
|
-
* An unknown roster (session/list unavailable) never reuses: minting a fresh
|
|
18
|
-
* conversation is always safe, prompting into a session we cannot see is not.
|
|
19
|
-
* @param task - the task about to run.
|
|
20
|
-
* @param idleSessionIds - ids the last roster saw as present and not running;
|
|
21
|
-
* undefined when that roster is unknown.
|
|
22
|
-
* @param options.force - continue the settled session regardless of the card's
|
|
23
|
-
* own `reuseSession` opt-in. A rework is exactly that case: the reviewer read
|
|
24
|
-
* the previous run's session and sent it back. Every condition above still
|
|
25
|
-
* applies — the force waives the opt-in, never the evidence.
|
|
26
|
-
* @returns the session id to continue in, or undefined for a fresh session.
|
|
27
|
-
*/
|
|
28
|
-
export declare function reusableSessionId(task: TaskRecord, idleSessionIds: ReadonlySet<string> | undefined, options?: {
|
|
29
|
-
force?: boolean;
|
|
30
|
-
}): string | undefined;
|
|
@@ -1,28 +0,0 @@
|
|
|
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 @fish-under-sea/dsh-client-ui-task-board-fish/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;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { type TaskRecord } from './tasks.ts';
|
|
2
|
-
/** Persistence seam for the task ledger. */
|
|
3
|
-
export interface TaskStore {
|
|
4
|
-
/** Read the persisted ledger (empty when nothing is stored yet). */
|
|
5
|
-
load(): TaskRecord[];
|
|
6
|
-
/** Persist the whole ledger (replaces the stored document). */
|
|
7
|
-
save(tasks: readonly TaskRecord[]): void;
|
|
8
|
-
/** Drop the persisted ledger (leaves the in-memory state alone). */
|
|
9
|
-
clear(): void;
|
|
10
|
-
/**
|
|
11
|
-
* Subscribe to ledger changes written by ANOTHER tab of the same origin
|
|
12
|
-
* (browser storage events). The board controller reloads the ledger on
|
|
13
|
-
* such a change, so a task deleted in one tab cannot keep firing (or be
|
|
14
|
-
* written back) from the stale in-memory copy of another tab. No-op when
|
|
15
|
-
* the backend has no cross-instance channel (in-memory store).
|
|
16
|
-
*/
|
|
17
|
-
subscribeExternal?(listener: () => void): () => void;
|
|
18
|
-
}
|
|
19
|
-
/** Storage key for the task ledger document. */
|
|
20
|
-
export declare const DEFAULT_STORAGE_KEY = "dsh.taskBoard.v1";
|
|
21
|
-
/** Structural shape of the storage event fired in sibling tabs (DOM-free). */
|
|
22
|
-
export interface StorageChangeEvent {
|
|
23
|
-
key: string | null;
|
|
24
|
-
}
|
|
25
|
-
/** The event-target face the store needs for cross-tab notifications. */
|
|
26
|
-
export interface StorageEvents {
|
|
27
|
-
addEventListener(type: 'storage', listener: (event: StorageChangeEvent) => void): void;
|
|
28
|
-
removeEventListener(type: 'storage', listener: (event: StorageChangeEvent) => void): void;
|
|
29
|
-
}
|
|
30
|
-
/** A task record is structurally valid if it round-trips through the UI. */
|
|
31
|
-
export declare function isTaskRecord(value: unknown): value is TaskRecord;
|
|
32
|
-
/** Parse + validate a persisted ledger document; invalid rows are dropped. */
|
|
33
|
-
export declare function parseLedger(raw: string | null): TaskRecord[];
|
|
34
|
-
/** localStorage-backed store (the browser backend). */
|
|
35
|
-
export declare class LocalStorageTaskStore implements TaskStore {
|
|
36
|
-
private readonly key;
|
|
37
|
-
private readonly storage;
|
|
38
|
-
private readonly events;
|
|
39
|
-
/**
|
|
40
|
-
* @param key - storage key for the ledger document.
|
|
41
|
-
* @param storage - storage backend (defaults to the global localStorage; tests inject fakes).
|
|
42
|
-
* @param events - storage-event target for cross-tab notifications (defaults
|
|
43
|
-
* to the browser global; undefined in non-browser runtimes, where the
|
|
44
|
-
* subscription becomes a no-op).
|
|
45
|
-
*/
|
|
46
|
-
constructor(key?: string, storage?: Pick<Storage, 'getItem' | 'setItem' | 'removeItem'> | undefined, events?: StorageEvents | undefined);
|
|
47
|
-
load(): TaskRecord[];
|
|
48
|
-
save(tasks: readonly TaskRecord[]): void;
|
|
49
|
-
clear(): void;
|
|
50
|
-
/**
|
|
51
|
-
* Cross-tab change subscription (see {@link TaskStore.subscribeExternal}).
|
|
52
|
-
* The browser fires the storage event in every OTHER tab of the same origin
|
|
53
|
-
* when one tab writes; a null key means the whole storage was cleared. Both
|
|
54
|
-
* cases reload the ledger here; unrelated keys are ignored.
|
|
55
|
-
*/
|
|
56
|
-
subscribeExternal(listener: () => void): () => void;
|
|
57
|
-
}
|
|
58
|
-
/** In-memory backend (tests, and a fallback when storage is unavailable). */
|
|
59
|
-
export declare class InMemoryTaskStore implements TaskStore {
|
|
60
|
-
private ledger;
|
|
61
|
-
load(): TaskRecord[];
|
|
62
|
-
save(tasks: readonly TaskRecord[]): void;
|
|
63
|
-
clear(): void;
|
|
64
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Subtask lineage: the depth gate, the ancestry/descendant queries, the
|
|
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
|
-
*
|
|
7
|
-
* Framework-free (no cordis, no runtime imports) so every rule is
|
|
8
|
-
* unit-testable in isolation. The Host ledger is the only authority; the
|
|
9
|
-
* browser mirrors these predicates to enable or disable controls, never to
|
|
10
|
-
* decide them.
|
|
11
|
-
*/
|
|
12
|
-
import type { ExecutionOutcome, ExecutionRecord, TaskRecord } from './tasks.ts';
|
|
13
|
-
/** Lowest configurable subtask depth. */
|
|
14
|
-
export declare const SUBTASK_DEPTH_MIN = 1;
|
|
15
|
-
/** Highest configurable subtask depth. */
|
|
16
|
-
export declare const SUBTASK_DEPTH_MAX = 3;
|
|
17
|
-
/** Deployment default: one level of subtasks, and no subtask of a subtask. */
|
|
18
|
-
export declare const DEFAULT_SUBTASK_DEPTH = 1;
|
|
19
|
-
/**
|
|
20
|
-
* Clamp a configured depth into the supported range. Anything unusable
|
|
21
|
-
* (absent, non-numeric, not finite) falls back to the default, so a bad
|
|
22
|
-
* configuration narrows the tree instead of lifting the guard.
|
|
23
|
-
*/
|
|
24
|
-
export declare function normalizeSubtaskDepth(value: unknown): number;
|
|
25
|
-
/** Whether an unknown value is a settled execution outcome. */
|
|
26
|
-
export declare function isExecutionOutcome(value: unknown): value is ExecutionOutcome;
|
|
27
|
-
/**
|
|
28
|
-
* Reusable lineage index over ONE task list: the id lookup and the direct
|
|
29
|
-
* children per parent. A caller that runs several lineage queries over the same
|
|
30
|
-
* ledger (the link-subtask candidate gate runs one per task) builds this once
|
|
31
|
-
* instead of rescanning the list per query.
|
|
32
|
-
*/
|
|
33
|
-
export interface LineageIndex {
|
|
34
|
-
readonly byId: ReadonlyMap<string, TaskRecord>;
|
|
35
|
-
readonly childrenByParent: ReadonlyMap<string, readonly TaskRecord[]>;
|
|
36
|
-
}
|
|
37
|
-
/** Build the reusable index for a task list (ledger order preserved). */
|
|
38
|
-
export declare function buildLineageIndex(tasks: readonly TaskRecord[]): LineageIndex;
|
|
39
|
-
/**
|
|
40
|
-
* Nearest-first ancestor chain of a task. The walk is cycle-safe and bounded
|
|
41
|
-
* by the ledger size rather than by the deployment maximum: a chain stored
|
|
42
|
-
* under a larger limit survives that limit being lowered, and restore and
|
|
43
|
-
* inheritance must still see all of it.
|
|
44
|
-
*/
|
|
45
|
-
export declare function ancestorChain(tasks: readonly TaskRecord[], task: TaskRecord, lineage?: LineageIndex): TaskRecord[];
|
|
46
|
-
/** Root-to-task depth: a root task is 0, its subtask 1, and so on. */
|
|
47
|
-
export declare function taskDepth(tasks: readonly TaskRecord[], id: string, lineage?: LineageIndex): number;
|
|
48
|
-
/** Direct subtasks of a task, in ledger order. */
|
|
49
|
-
export declare function directSubtasks(tasks: readonly TaskRecord[], id: string, lineage?: LineageIndex): TaskRecord[];
|
|
50
|
-
/**
|
|
51
|
-
* Descendants of a task in breadth-first order, bounded by maxSubtaskDepth
|
|
52
|
-
* total depth. The visited set keeps a malformed ledger from looping.
|
|
53
|
-
*/
|
|
54
|
-
export declare function descendantTasks(tasks: readonly TaskRecord[], id: string, maxSubtaskDepth: number, lineage?: LineageIndex): TaskRecord[];
|
|
55
|
-
/**
|
|
56
|
-
* Height of a task's own subtree (0 for a leaf), bounded by the hard maximum.
|
|
57
|
-
* The visited set makes the walk terminate on a cyclic hand-edited ledger
|
|
58
|
-
* instead of recursing until the stack overflows.
|
|
59
|
-
*/
|
|
60
|
-
export declare function subtreeHeight(tasks: readonly TaskRecord[], id: string, visited?: ReadonlySet<string>, lineage?: LineageIndex): number;
|
|
61
|
-
/** Why a parent link was refused; also the source of the Host error text. */
|
|
62
|
-
export type ParentLinkRejection = 'unknown-task' | 'unknown-parent' | 'archived-parent' | 'self-parent' | 'cycle' | 'depth-exceeded';
|
|
63
|
-
export interface ParentLinkCheck {
|
|
64
|
-
/** True when the link (or the detachment) may be stored. */
|
|
65
|
-
ok: boolean;
|
|
66
|
-
/** Why it was refused; absent when ok. */
|
|
67
|
-
reason?: ParentLinkRejection;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Whether childId may be attached under parentId. A null parent detaches and
|
|
71
|
-
* is always allowed for a known task. Otherwise the link must name an
|
|
72
|
-
* on-board task that is neither the child itself nor one of its descendants,
|
|
73
|
-
* and the resulting depth (parent depth + 1 + the child own subtree height)
|
|
74
|
-
* must stay within maxSubtaskDepth.
|
|
75
|
-
*/
|
|
76
|
-
export declare function checkParentLink(tasks: readonly TaskRecord[], childId: string, parentId: string | null, maxSubtaskDepth: number, lineage?: LineageIndex): ParentLinkCheck;
|
|
77
|
-
/**
|
|
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.
|
|
90
|
-
*/
|
|
91
|
-
export declare function cascadeTargets(tasks: readonly TaskRecord[], rootId: string): TaskRecord[];
|
|
92
|
-
/**
|
|
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
|
-
* The tool a legacy Agent Teams runtime registers, and the one fingerprint
|
|
124
|
-
* this board reads off a deployment: the pre-#7519 generation registers
|
|
125
|
-
* `spawn_teammate` and replaces `send_message` / `list_agents` /
|
|
126
|
-
* `interrupt_agent` with team-scoped variants, so children exist but are
|
|
127
|
-
* unreachable. The current runtime adds a shared task board instead and reuses
|
|
128
|
-
* the coordination tools, so those three names prove nothing and are never
|
|
129
|
-
* gated on (the criterion is the same one
|
|
130
|
-
* `packages/dsh-liangshen/presets/liangshen/dispatcher-rules.mjs` states).
|
|
131
|
-
*/
|
|
132
|
-
export declare const LEGACY_AGENT_TEAMS_TOOL = "spawn_teammate";
|
|
133
|
-
/**
|
|
134
|
-
* The failure text the Host records when a run would have been forced under
|
|
135
|
-
* the dispatcher preset on a deployment that cannot orchestrate.
|
|
136
|
-
*
|
|
137
|
-
* A finished sentence rather than a code (the shape `core/workspace-target.ts`
|
|
138
|
-
* gives its missing-workspace refusal): the ledger stores it as the
|
|
139
|
-
* execution's failure text, the agent tools serve it to a model, and any
|
|
140
|
-
* client prints it verbatim. It names the fix, not the mechanism. The launch
|
|
141
|
-
* is refused before any session exists, because the dispatcher preset would
|
|
142
|
-
* otherwise stop and wait for a human reply that an unattended run never
|
|
143
|
-
* brings.
|
|
144
|
-
*/
|
|
145
|
-
export declare const LEGACY_AGENT_TEAMS_REASON: string;
|
|
146
|
-
/**
|
|
147
|
-
* Whether a recorded failure text is the legacy-runtime refusal, which the
|
|
148
|
-
* browser half renders in the reader's own language.
|
|
149
|
-
* @param reason - the execution's recorded failure text.
|
|
150
|
-
* @returns true when that run was refused for a deployment that cannot orchestrate.
|
|
151
|
-
*/
|
|
152
|
-
export declare function isLegacyAgentTeamsReason(reason: string): boolean;
|
|
153
|
-
/**
|
|
154
|
-
* Whether a card belongs to a run's dispatch set: the card the request named,
|
|
155
|
-
* or a card whose work is still outstanding. Kept for the browser's subtask
|
|
156
|
-
* preview; the Host run itself opens the clicked card alone
|
|
157
|
-
* ({@link cascadeTargets}).
|
|
158
|
-
* @param task - the candidate card.
|
|
159
|
-
* @param rootId - the task the run request named.
|
|
160
|
-
* @returns false when this card is finished and left alone.
|
|
161
|
-
*/
|
|
162
|
-
export declare function joinsCascadeRun(task: TaskRecord, rootId: string): boolean;
|
|
163
|
-
/** One still-open execution belonging to a stored run group. */
|
|
164
|
-
export interface OpenCascadeChild {
|
|
165
|
-
taskId: string;
|
|
166
|
-
execution: ExecutionRecord;
|
|
167
|
-
}
|
|
168
|
-
/** The open execution of a task inside a run group, if it still exists. */
|
|
169
|
-
export declare function openGroupExecution(task: TaskRecord, runGroupId: string): ExecutionRecord | undefined;
|
|
170
|
-
/**
|
|
171
|
-
* The direct subtasks of parentTaskId whose execution in this run group is
|
|
172
|
-
* still open: the parent's remaining waiters. A stored multi-member group (a
|
|
173
|
-
* run the Host opened before it stopped spreading one run across a subtree)
|
|
174
|
-
* folds once this list is empty and the parent's own outcome is known.
|
|
175
|
-
*/
|
|
176
|
-
export declare function pendingCascadeChildren(tasks: readonly TaskRecord[], parentTaskId: string, runGroupId: string): OpenCascadeChild[];
|
|
177
|
-
/**
|
|
178
|
-
* Fold a stored run-group parent's own outcome and its children's outcomes into
|
|
179
|
-
* one verdict: failure dominates, then cancellation, then success. The error
|
|
180
|
-
* text is the first failure, falling back to the first cancellation.
|
|
181
|
-
*/
|
|
182
|
-
export declare function combineCascadeOutcome(entries: readonly {
|
|
183
|
-
result: ExecutionOutcome;
|
|
184
|
-
error?: string;
|
|
185
|
-
}[]): {
|
|
186
|
-
result: ExecutionOutcome;
|
|
187
|
-
error: string | undefined;
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* The permission a task would actually run under: its handover bundle's pin
|
|
191
|
-
* wins over the plain pin field, exactly as the runner resolves it.
|
|
192
|
-
*/
|
|
193
|
-
export declare function effectiveTaskPermission(task: TaskRecord): TaskRecord['permission'];
|
|
194
|
-
/**
|
|
195
|
-
* Resolve the execution targets a (sub)task actually runs with: its own value
|
|
196
|
-
* wins, and an unset target inherits the nearest ancestor up to the root.
|
|
197
|
-
* Workspace, agent preset, model and reasoning effort inherit the ancestor's
|
|
198
|
-
* PIN only — a handover bundle is a per-card continuation artefact and is never
|
|
199
|
-
* inherited. The permission inherits the ancestor's EFFECTIVE binding, and its
|
|
200
|
-
* human confirmation travels with it, so a subtask of an already-confirmed
|
|
201
|
-
* elevated card is runnable while a subtask's own unconfirmed binding stays
|
|
202
|
-
* gated.
|
|
203
|
-
*/
|
|
204
|
-
export declare function resolveExecutionTargets(task: TaskRecord, tasks: readonly TaskRecord[], maxSubtaskDepth?: number): TaskRecord;
|