@avantf/dsh-mission 0.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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +249 -0
  3. package/cordis.patch.yml +13 -0
  4. package/lib/client.js +225 -0
  5. package/lib/dsh-build.json +16 -0
  6. package/lib/envinit-bootstrap.js +334 -0
  7. package/lib/index.js +7021 -0
  8. package/lib/interface-version.json +4 -0
  9. package/lib/mission-core/capacity.d.ts +100 -0
  10. package/lib/mission-core/continuation.d.ts +106 -0
  11. package/lib/mission-core/dispatch.d.ts +165 -0
  12. package/lib/mission-core/engine.d.ts +331 -0
  13. package/lib/mission-core/index.d.ts +25 -0
  14. package/lib/mission-core/liveness.d.ts +99 -0
  15. package/lib/mission-core/prompt.d.ts +112 -0
  16. package/lib/mission-core/resources.d.ts +57 -0
  17. package/lib/mission-core/timing.d.ts +37 -0
  18. package/lib/mission-core/tree.d.ts +447 -0
  19. package/lib/mission-core/trouble.d.ts +40 -0
  20. package/lib/mission-core/types.d.ts +409 -0
  21. package/lib/mission-core/wellformed.d.ts +98 -0
  22. package/lib/types/claims.d.ts +3 -0
  23. package/lib/types/claims.d.ts.map +1 -0
  24. package/lib/types/client/MissionTreeView.d.ts +247 -0
  25. package/lib/types/client/MissionTreeView.d.ts.map +1 -0
  26. package/lib/types/client/api.d.ts +184 -0
  27. package/lib/types/client/api.d.ts.map +1 -0
  28. package/lib/types/client/contract.d.ts +209 -0
  29. package/lib/types/client/contract.d.ts.map +1 -0
  30. package/lib/types/client/index.d.ts +48 -0
  31. package/lib/types/client/index.d.ts.map +1 -0
  32. package/lib/types/client/seat.d.ts +26 -0
  33. package/lib/types/client/seat.d.ts.map +1 -0
  34. package/lib/types/client/styles.d.ts +6 -0
  35. package/lib/types/client/styles.d.ts.map +1 -0
  36. package/lib/types/coldResume.d.ts +123 -0
  37. package/lib/types/coldResume.d.ts.map +1 -0
  38. package/lib/types/domain.d.ts +93 -0
  39. package/lib/types/domain.d.ts.map +1 -0
  40. package/lib/types/envinit.d.ts +126 -0
  41. package/lib/types/envinit.d.ts.map +1 -0
  42. package/lib/types/executorSession.d.ts +129 -0
  43. package/lib/types/executorSession.d.ts.map +1 -0
  44. package/lib/types/faces.d.ts +30 -0
  45. package/lib/types/faces.d.ts.map +1 -0
  46. package/lib/types/host.d.ts +752 -0
  47. package/lib/types/host.d.ts.map +1 -0
  48. package/lib/types/index.d.ts +48 -0
  49. package/lib/types/index.d.ts.map +1 -0
  50. package/lib/types/interface_gate.d.ts +51 -0
  51. package/lib/types/interface_gate.d.ts.map +1 -0
  52. package/lib/types/log.d.ts +18 -0
  53. package/lib/types/log.d.ts.map +1 -0
  54. package/lib/types/projectionCache.d.ts +22 -0
  55. package/lib/types/projectionCache.d.ts.map +1 -0
  56. package/lib/types/prompt.d.ts +106 -0
  57. package/lib/types/prompt.d.ts.map +1 -0
  58. package/lib/types/source.d.ts +22 -0
  59. package/lib/types/source.d.ts.map +1 -0
  60. package/lib/types/store.d.ts +20 -0
  61. package/lib/types/store.d.ts.map +1 -0
  62. package/lib/types/timeFormat.d.ts +56 -0
  63. package/lib/types/timeFormat.d.ts.map +1 -0
  64. package/lib/types/tools.d.ts +34 -0
  65. package/lib/types/tools.d.ts.map +1 -0
  66. package/lib/types/wellformed.d.ts +43 -0
  67. package/lib/types/wellformed.d.ts.map +1 -0
  68. package/lib/types/wire.d.ts +178 -0
  69. package/lib/types/wire.d.ts.map +1 -0
  70. package/lib/types/workerEvents.d.ts +36 -0
  71. package/lib/types/workerEvents.d.ts.map +1 -0
  72. package/lib/types/workerSessions.d.ts +256 -0
  73. package/lib/types/workerSessions.d.ts.map +1 -0
  74. package/package.json +145 -0
@@ -0,0 +1,209 @@
1
+ /**
2
+ * The client half's own vocabulary, declared here rather than imported from
3
+ * `@avantf/mission-core`: the browser bundle must not pull the host engine in.
4
+ * @module @avantf/dsh-mission/client/contract
5
+ */
6
+ /**
7
+ * Why a node is queued instead of running, as the host reports it. The browser half's own copy (it
8
+ * must not import the engine); `null`/absent on the node means nothing is holding it back.
9
+ */
10
+ export interface WaitingForView {
11
+ readonly reason: 'capacity' | 'unit' | 'slot' | 'aging';
12
+ /** Which capacity signal, when `reason` is `capacity`: compute units or the free-memory floor. */
13
+ readonly resource?: 'cpu' | 'memory';
14
+ readonly needed?: number;
15
+ readonly available?: number;
16
+ readonly unit?: string;
17
+ }
18
+ export interface MissionNodeView {
19
+ readonly id: string;
20
+ /** Where the node was born; `children` is the dependency edge it is rendered by. */
21
+ readonly parentId: string | null;
22
+ /** The ids this node depends on (a reused prerequisite appears in several parents). */
23
+ readonly children: readonly string[];
24
+ readonly depth: number;
25
+ readonly title: string;
26
+ /** Why this mission exists (written by whoever decomposed its parent). In the ROW projection the
27
+ * texts are no longer carried (a current host sends `[]`); the detail dialog has every one. A
28
+ * non-empty array is what an OLDER host still sends, and {@link contextCount} falls back to it. */
29
+ readonly context: readonly string[];
30
+ /** How many premises the mission carries — the row's marker. The detail dialog renders the texts. */
31
+ readonly contextCount?: number;
32
+ /** The owner's corrections, newest last. A row renders the count as a "steered" marker: the title
33
+ * above is the goal as created, so a corrected mission needs this to be readable at all. Capped to
34
+ * the newest few by a current host; {@link correctionCount} is the true number. */
35
+ readonly corrections: readonly string[];
36
+ /** The owner's FULL correction count, including any past the row cap. Optional so a client built
37
+ * before this field still renders (the badge falls back to `corrections.length`). */
38
+ readonly correctionCount?: number;
39
+ readonly status: string;
40
+ readonly attempts: number;
41
+ readonly createdAt: number;
42
+ /** When this node was FIRST dispatched, or `null` while it is still queued. Optional because an
43
+ * older host does not send it, and absence reads exactly like `null` (= never dispatched). */
44
+ readonly dispatchedAt?: number | null;
45
+ /** When this node reached a terminal status, or `null` while it is still in play. Optional for the
46
+ * same reason as {@link dispatchedAt}. */
47
+ readonly endedAt?: number | null;
48
+ readonly hasResult: boolean;
49
+ readonly resultRef: string | null;
50
+ /** The session that ran this node LAST, or `null` when none ever did. Carried in the ROW
51
+ * projection as well as the detail so a row can offer "open the executor" without a second read.
52
+ * It is a DISPLAY address kept after the session ended (the panel's node-id entry opens it), so it
53
+ * is not the same thing as "is running now" — that is {@link workerLive}. */
54
+ readonly workerSessionId: string | null;
55
+ /** Whether {@link workerSessionId} is still running: the node-id entry uses it to say 进行中 or
56
+ * 已结束. Optional because an older host does not send it, and absence reads as "not live". */
57
+ readonly workerLive?: boolean;
58
+ /** Declared capacity weight (cores-equivalent); an older host omits it and reads as 1. */
59
+ readonly weight?: number;
60
+ /** Why this node is queued; absent/`null` means nothing is holding it back. */
61
+ readonly waitingFor?: WaitingForView | null;
62
+ }
63
+ export interface MissionTreeViewData {
64
+ readonly rootId: string;
65
+ readonly nodes: readonly MissionNodeView[];
66
+ /** Epoch millis when the owner archived the tree; `null` while it is live. */
67
+ readonly closedAt: number | null;
68
+ }
69
+ export interface MissionSnapshot {
70
+ readonly trees: readonly MissionTreeViewData[];
71
+ /**
72
+ * The host's reported wire revision (`wire.ts`'s `SNAPSHOT_WIRE_VERSION`), carried forward so a
73
+ * later click can refuse to call a method this host never registered. `undefined` means the host
74
+ * predates the marker, which is the same vintage as the oldest revision.
75
+ */
76
+ readonly wire?: number;
77
+ /**
78
+ * A version-skew note from the host half — set when the payload's `wire` marker is absent (older
79
+ * host) or unknown (newer host). The trees are still rendered: the marker is a note, not a failure.
80
+ */
81
+ readonly skew?: string;
82
+ }
83
+ export interface MissionSnapshotState {
84
+ readonly data: MissionSnapshot | undefined;
85
+ readonly loading: boolean;
86
+ readonly error: string | undefined;
87
+ readonly refresh: () => Promise<void>;
88
+ }
89
+ export interface MissionNodeDetailView {
90
+ readonly id: string;
91
+ readonly rootId: string;
92
+ readonly title: string;
93
+ readonly description: string;
94
+ /** Why this mission exists — the premise the decomposer attached (the owner's initial judgement,
95
+ * for a root). NOT the same as `description`, which is what the mission must achieve. */
96
+ readonly context: readonly string[];
97
+ /** What this mission's executors recorded with `note_mission` before splitting it: the blocker, the
98
+ * paths ruled out, what the prerequisites have to settle. Oldest first; appended, never replaced. */
99
+ readonly analysisNotes: readonly string[];
100
+ /** The `attempts` value of the dispatch that wrote the LAST analysis note; `0` when there is none. */
101
+ readonly analysisAttempt: number;
102
+ /** The direction changes this mission was given, newest last — rendered between the goal and the
103
+ * result so the two can be read together rather than as a mismatch. */
104
+ readonly corrections: readonly string[];
105
+ readonly status: string;
106
+ readonly attempts: number;
107
+ readonly depth: number;
108
+ /** When this node was accepted into the tree. Optional: an older host does not send it, and the
109
+ * dialog's timing line then prints 「受理 —」 rather than invented epoch time. */
110
+ readonly createdAt?: number | null;
111
+ /** When this node was FIRST dispatched, or `null` while it is still queued. The detail dialog shows
112
+ * the full 受理/派发/结束 line; the row shows the compact form. Optional for the same reason as the
113
+ * row projection's copy. */
114
+ readonly dispatchedAt?: number | null;
115
+ /** When this node reached a terminal status, or `null` while it is still in play. */
116
+ readonly endedAt?: number | null;
117
+ /** The mission's own submitted result, or null while it has not submitted one. */
118
+ readonly result: string | null;
119
+ /** Where an oversized result was spilled, so the reader can still open it. */
120
+ readonly resultPointer: string | null;
121
+ /** The session that ran this node LAST, or `null` when none ever did. This is the NODE's executor
122
+ * — a different id from `id`, which names the mission. A node whose attempt was reclaimed, or one
123
+ * that finished, still carries its LAST executor here on purpose: the panel's node-id entry opens
124
+ * that session, and a finished mission is exactly when a reader wants to look back at it. */
125
+ readonly workerSessionId: string | null;
126
+ /** Whether {@link workerSessionId} is still running (see the row projection's copy). */
127
+ readonly workerLive?: boolean;
128
+ /** Declared capacity weight (cores-equivalent); an older host omits it and reads as 1. */
129
+ readonly weight?: number;
130
+ /** Why this node is queued; absent/`null` means nothing is holding it back. */
131
+ readonly waitingFor?: WaitingForView | null;
132
+ }
133
+ export interface MissionNodeDetailChild {
134
+ readonly id: string;
135
+ readonly title: string;
136
+ readonly status: string;
137
+ readonly result: string | null;
138
+ readonly resultPointer: string | null;
139
+ }
140
+ /** What a clicked row expands into. Read on demand, never part of the snapshot. */
141
+ export interface MissionNodeDetail {
142
+ readonly node: MissionNodeDetailView;
143
+ readonly children: readonly MissionNodeDetailChild[];
144
+ }
145
+ /**
146
+ * One worker session as the host's optional `uiWorkspace.openSession` takes it: the durable
147
+ * parent/child address of a *continuable* subagent — the same target the main UI sends when a child
148
+ * is picked from the "N 个子智能" dropdown. Declared structurally rather than imported from the
149
+ * host's `dsh-api-session-controller` types, like the rest of this file: the browser bundle must not
150
+ * take a dependency on a host package's client types.
151
+ */
152
+ export interface WorkerSessionTarget {
153
+ readonly parentSessionId: string;
154
+ readonly childSessionId: string;
155
+ readonly mode: 'continuable';
156
+ }
157
+ /**
158
+ * What a CLICK-TIME executor lookup answered (W18), as the view consumes it. `resolved` carries the
159
+ * session to open; the other three are the distinguishable ways there is nothing to open, which the
160
+ * view renders as different sentences:
161
+ *
162
+ * - `never-dispatched` — the record proves no session ever ran this node;
163
+ * - `not-found` — it ran once, and the session is gone (cleaned up, or its log is not on this host);
164
+ * - `unsupported` — this host cannot look anything up at all (no session service, or an older host
165
+ * whose Remote face predates the method).
166
+ */
167
+ export interface ExecutorSessionLookup {
168
+ readonly status: 'resolved' | 'never-dispatched' | 'not-found' | 'unsupported';
169
+ /** Present when `status` is `resolved`. */
170
+ readonly sessionId?: string;
171
+ /** The host's own words when it has any (a missing service, a failed listing). */
172
+ readonly error?: string;
173
+ }
174
+ export interface MissionViewProps {
175
+ /** Read the current snapshot and keep it updated. */
176
+ readonly useSnapshot: () => MissionSnapshotState;
177
+ /** Delete one whole finished mission tree by root; rejects with the host's reason, which the view shows. */
178
+ readonly onDeleteTree: (rootId: string) => Promise<void>;
179
+ /**
180
+ * Delete EVERY closed (finish_mission-archived) tree this session owns, in one batch — the panel's
181
+ * "清理已完成". ABSENT when this host has no such call (an older host): the button is then not
182
+ * rendered at all rather than offered and doomed. Rejects with the host's reason, which the view
183
+ * shows; resolves to the two root-id lists the host reported so the panel can say what happened.
184
+ */
185
+ readonly onCleanFinished?: () => Promise<{
186
+ deleted: readonly string[];
187
+ skipped: readonly string[];
188
+ }>;
189
+ readonly loadDetail: (nodeId: string) => Promise<MissionNodeDetail>;
190
+ /** Read the FULL text behind a spilled result; rejects with the host's reason, which the pane shows. */
191
+ readonly loadResult: (nodeId: string) => Promise<string>;
192
+ /** The owner session these trees belong to — the PARENT half of a worker-session address. */
193
+ readonly sessionId: string;
194
+ /**
195
+ * Ask the host to open the session that ran a mission. ABSENT when this host has no `uiWorkspace`
196
+ * service — the id then renders as plain text, never as a dead link, and everything else in the
197
+ * panel keeps working. `uiWorkspace` is fetched optionally for exactly this reason: a host without
198
+ * it must still mount this plugin (see `client/index.ts`, and `inject` there deliberately omits it).
199
+ */
200
+ readonly openWorkerSession?: (target: WorkerSessionTarget) => void;
201
+ /**
202
+ * Find the session that ran a node whose record has no handle (W18). Called ONLY from a click —
203
+ * it is a Remote call whose server side lists sessions and reads a few logs, so nothing on the
204
+ * render path may touch it. Rejecting means "the lookup itself failed"; a `not-found`/`unsupported`
205
+ * ANSWER is a result, not an error.
206
+ */
207
+ readonly resolveWorkerSession?: (nodeId: string) => Promise<ExecutorSessionLookup>;
208
+ }
209
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/client/contract.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;IACvD,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE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this session's mission trees. Inject `remote`, never `remote.avantfMission` (a namespace only
4
+ * exists after its own contribution mounts, and boot's `assertEntriesActive` throws on an
5
+ * entry waiting for a missing service); the hand-written contribution is mounted here.
6
+ * @module @avantf/dsh-mission/client
7
+ */
8
+ import { type ReactNode } from 'react';
9
+ import type { SessionId } from '@deepseek-ai/dsh-session/types';
10
+ /** Cordis plugin name; matches the host half. */
11
+ export declare const name = "avantf-mission";
12
+ /** Required client services; the Remote namespace itself is intentionally absent (see above). */
13
+ export declare const inject: string[];
14
+ /**
15
+ * The slice of the client Context this half uses, declared structurally: an installed dsh
16
+ * ships no `ui-slots` package (the browser shell seeds it into the module table), so the
17
+ * seat's real types are not resolvable from what the running host shares.
18
+ */
19
+ interface ClientContext {
20
+ effect(callback: () => (() => void) | void, label?: string): void;
21
+ logger: {
22
+ error(message: string): void;
23
+ };
24
+ locale: {
25
+ register(namespace: string, dictionaries: Record<'zh' | 'en', Record<string, string>>): () => void;
26
+ bind(namespace: string): (key: string) => string;
27
+ };
28
+ remote: {
29
+ $mount(contribution: unknown): Promise<() => Promise<void>>;
30
+ };
31
+ get(name: string): unknown;
32
+ slots: {
33
+ inject(name: string, register: () => void): void;
34
+ register(options: {
35
+ name: string;
36
+ id: string;
37
+ order: number;
38
+ locale: string;
39
+ label: () => string;
40
+ }, component: (props: {
41
+ sessionId: SessionId;
42
+ }) => ReactNode): void;
43
+ };
44
+ }
45
+ /** Client plugin body: mount this package's Remote face, register the tab. */
46
+ export declare function apply(ctx: ClientContext): void;
47
+ export {};
48
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAyE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAuB/D,iDAAiD;AACjD,eAAO,MAAM,IAA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a,GAAG,IAAI,CAgK9C"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Reading the HOST's seat hooks defensively.
3
+ *
4
+ * The seat hands this plugin the installed runtime's own snapshot shapes, and this plugin only
5
+ * DECLARES them structurally — nothing here is checked against the host at mount time. A field the
6
+ * running dsh no longer has makes the selector throw, and the selectors below are called in a
7
+ * component body: the shell's slot error boundary then renders an empty `<div>` (no text at all) and
8
+ * does not retry within the session, so the panel stays blank while every host-side gate is green.
9
+ *
10
+ * That is not hypothetical: dsh 0.1.6 dropped `SessionSnapshot.queue`, and the declared peer range
11
+ * (`^0.1.5-rc.2 || ^0.1.7-rc.2 || ^0.2.0-rc.2`) admits 0.1.6. The compat gate covers the host half
12
+ * only — services, typert faces, the version table — so the browser half's seat props need their own
13
+ * guard, and it is this file: every field read off a seat hook goes through a reader, and an absent
14
+ * field yields a NEUTRAL constant (not a fresh value per render, so the derived revision stays stable
15
+ * instead of flapping).
16
+ */
17
+ /** What this plugin reads off the seat's session snapshot. Every field is optional: the host owns it. */
18
+ export interface SeatSessionView {
19
+ readonly queue?: readonly unknown[];
20
+ readonly running?: boolean;
21
+ }
22
+ /** How many prompts the session has queued, or -1 when the running dsh exposes no queue. */
23
+ export declare function queuedCount(session: SeatSessionView | undefined): number;
24
+ /** Whether the session is running; an absent (or non-boolean) field reads as "not running". */
25
+ export declare function isRunning(session: SeatSessionView | undefined): boolean;
26
+ //# sourceMappingURL=seat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seat.d.ts","sourceRoot":"","sources":["../../../src/client/seat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,yGAAyG;AACzG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAExE;AAED,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,GAAG,OAAO,CAEvE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Inject once per document: the view remounts on every session switch, and a second
3
+ * `<style>` per mount would grow the document without limit.
4
+ */
5
+ export declare function INSTALL_STYLES(): void;
6
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/client/styles.ts"],"names":[],"mappings":"AAwKA;;;GAGG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAQrC"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * The HOST half of session continuation: waking a session that already knows the mission instead of
3
+ * starting a fresh executor.
4
+ *
5
+ * Two wakes share this file because they share the whole protocol — guard, ADOPT, DELIVER, and a
6
+ * refusal that is never allowed to spawn on top of a live binding:
7
+ *
8
+ * - the PARKED wake — the executor that decomposed a node parked itself on it, and is woken (by the
9
+ * owner's pre-step, the one turn where the authorizing parent is guaranteed materialized) once
10
+ * every child is terminal;
11
+ * - the COLD wake — a restart demoted a `running` node and left `lastWorkerId`, so the engine's
12
+ * dispatch pass first tries to continue that session before reserving a claim for a new one.
13
+ *
14
+ * Why this is its own module rather than four methods on the host: it is a clean, self-contained
15
+ * concern (the core-side `continuation.ts` delta, the `adoptParked`/`adoptContinuation` tree
16
+ * transitions, and this delivery seam are the three halves of one feature), and the host is the
17
+ * plugin's only continuously growing hub. `host.ts` keeps thin delegations and hands in exactly the
18
+ * state below — the same shape `workerSessions.ts` uses for its commands, so "what this needs from
19
+ * the host" is explicit rather than "everything on `this`".
20
+ *
21
+ * The delivery rides `ctx.subagents.sendMessage` to a child that may not be resident: `dsh-subagent`'s
22
+ * `materialize` ("create OR resume one child Agent") calls `agents.resume({ resumeSessionId })`, the
23
+ * same code path for "the residency was released" and "the process restarted and the session is being
24
+ * rebuilt from disk". There is no second protocol here, and no new session API.
25
+ *
26
+ * Host-side state is passed by reference on purpose: the wake guards (`wakingClaims`) and the claim
27
+ * sets are the SAME objects the rest of the host reads, so a wake delivered from here is seen by the
28
+ * sweep exactly as it was before the extraction.
29
+ *
30
+ * @module @avantf/dsh-mission/coldResume
31
+ */
32
+ import type { Agent } from '@deepseek-ai/dsh-agent';
33
+ import type { ContentBlock } from '@deepseek-ai/dsh-llm';
34
+ import { SessionId } from '@deepseek-ai/dsh-session';
35
+ import type { SubagentSendMessageOptions } from '@deepseek-ai/dsh-subagent';
36
+ import { type MissionEngine, type MissionTree, type NodeRecord, type ResumeOutcome, type ResumeWorkerInput, type WellFormedSource } from '../mission-core/index.js';
37
+ import type { MissionLogger } from './log.js';
38
+ /**
39
+ * What the two wakes need from the host. Declared as a narrow port (not `this`) so the module cannot
40
+ * reach into anything else — every member below is read by the moves, and nothing here is a
41
+ * convenience accessor.
42
+ */
43
+ export interface ColdResumeDeps {
44
+ /** The tree, or `undefined` before start-up has opened one (the parked wake's early exit). */
45
+ readonly tree: MissionTree | undefined;
46
+ /** The tree, throwing when start-up has not opened one (the cold wake's precondition). */
47
+ requireTree(): MissionTree;
48
+ /** The engine, read for ONE admission-policy snapshot per parked-wake pass. */
49
+ readonly engine: MissionEngine | undefined;
50
+ /** Live agents, by session id: the owner must be materialized before anything can be delivered. */
51
+ readonly agents: {
52
+ get(id: SessionId): Agent | undefined;
53
+ };
54
+ /** The delivery seam; a non-resident child is materialized (or resumed) by the runtime. */
55
+ readonly subagents: {
56
+ sendMessage(sender: Agent, targetId: SessionId, content: ContentBlock[], options: SubagentSendMessageOptions): Promise<unknown>;
57
+ };
58
+ readonly log: MissionLogger;
59
+ readonly wellFormed: WellFormedSource;
60
+ /** Sessions whose wake is in flight; live from the adoption until the resumed agent is observed. */
61
+ readonly wakingClaims: Set<string>;
62
+ /** Parked nodes the owner has already been told about; dropped when the node is actually woken. */
63
+ readonly parkedSignaled: Set<string>;
64
+ /** Owner sessions this host has dispatched a worker for (hook scoping). */
65
+ readonly dispatchedFor: Set<string>;
66
+ /** Every claim id this process has issued. */
67
+ readonly issuedClaims: Set<string>;
68
+ /** Claims bound but not yet accepted by the child. */
69
+ readonly startingClaims: Set<string>;
70
+ trace(message: string): void;
71
+ /** Publish a change for one tree, by its root id. */
72
+ announceTree(rootId: string): void;
73
+ /** Clear the starting guard for a claim whose start attempt is over. */
74
+ endStartAttempt(claimId: string): void;
75
+ /** Stamp the prompt a session was just handed; tolerant, and defined on the host (`startWorker`
76
+ * uses it too). */
77
+ recordBaseline(nodeId: string, holder: string): Promise<void>;
78
+ /** Start a fresh executor; the callers here deliberately do not await it. */
79
+ startWorker(node: NodeRecord, claimId: string): Promise<void>;
80
+ }
81
+ /**
82
+ * Wake every parked session whose children have landed. Called from the owner's pre-step, and only
83
+ * there: that turn is the one place the owner is guaranteed materialized, and the only Agent the
84
+ * continuation protocol accepts as the authorizing parent (`authorizeLineage`).
85
+ *
86
+ * Order per node is fixed: ADOPT (bind `claimedBy`) before delivering — a woken session can call
87
+ * `submit_mission` immediately, which authorizes on `claimedBy === caller`. A failed delivery gets no
88
+ * retry: undo the adoption (`wake-failed`, charging neither failure counter, no cooldown) and
89
+ * dispatch fresh; `attempts` advances, being the `note_mission` generation marker, not a budget.
90
+ *
91
+ * Both binding paths go through the ENGINE's admission policy (`engine.admissionPolicy()`), not a
92
+ * host-side reading of capacity: the parked wake is the most common binding path there is (an owner's
93
+ * pre-step), and it used to adopt with no policy at all, which means no capacity recheck and a
94
+ * machine that could be oversubscribed by wakes while the dispatch loop carefully respected the
95
+ * gate. A refusal is the same deferral every other path gets: the node stays `ready`, the address
96
+ * stays on it, nothing is charged, and the next pass retries.
97
+ */
98
+ export declare function wakeParkedWorkers(deps: ColdResumeDeps, agent?: Agent): Promise<number>;
99
+ /**
100
+ * Try to continue a node in the session recorded when an interruption demoted it (`lastWorkerId`)
101
+ * instead of starting a fresh executor — the "cold wake" of a mission that survived a restart.
102
+ * Reached from the engine's dispatch pass, before any claim is reserved; returns whether the node
103
+ * was dispatched by this call, must be left alone, or needs the ordinary fresh path.
104
+ *
105
+ * The delivery rides the seam the parked wake already uses: `ctx.subagents.sendMessage` to a
106
+ * non-resident child goes through `dsh-subagent`'s `materialize` ("create OR resume one child
107
+ * Agent"), which calls `agents.resume({ resumeSessionId: ... })`. That is the same code path for
108
+ * "the residency was released" and "the process restarted and the session is being rebuilt from
109
+ * disk", so there is no second protocol to invent here.
110
+ *
111
+ * Order per node is the parked wake's, for the same reason: GUARD → ADOPT → DELIVER. The guard has
112
+ * to land BEFORE the adoption, because the target session is idle/unmaterialized by definition:
113
+ * `heldByLiveWorkers` cannot see it, so the sweep fired by the previous run's own `subagent/end`
114
+ * would strip the binding mid-delivery while the cold resume still lands — two executors for one
115
+ * node, one wasted round, and `failures` charged for it.
116
+ *
117
+ * Failure is not a failure of the mission: the delivery being refused means "that session is
118
+ * gone or not resumable", and a fresh executor is the complete answer (`note_mission` is the
119
+ * hand-off). So the host undoes its own adoption with `wake-failed` — no budget, no cooldown —
120
+ * and answers `failed`, and the engine immediately takes the ordinary path in the same pass.
121
+ */
122
+ export declare function resumeWorker(deps: ColdResumeDeps, input: ResumeWorkerInput): Promise<ResumeOutcome>;
123
+ //# sourceMappingURL=coldResume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coldResume.d.ts","sourceRoot":"","sources":["../../src/coldResume.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,K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qDAAqD;IACrD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,wEAAwE;IACxE,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC;wBACoB;IACpB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7D,6EAA6E;IAC7E,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAiE5F;AAqCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CA2EzG"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Durable layout for the mission tree: one record per tree, opened once per process
3
+ * (`storage-domain` refuses a second open), which is why the plugin owns the handle.
4
+ * @module @avantf/dsh-mission/domain
5
+ */
6
+ import * as z from 'zod';
7
+ import type { TreeDocument as TreeDocumentShape } from '../mission-core/index.js';
8
+ /**
9
+ * Layout version. **Stays 1 while the schema only gains optional-with-default fields**: the
10
+ * `single` layout compares the stamp for exact equality and throws `version-mismatch` on any
11
+ * bump, a failed open that bricks every existing installation. Bump only for a non-backward-
12
+ * readable change, and move to `layout: 'per-record'` in the same change so `compatibleVersions` applies.
13
+ */
14
+ export declare const DOMAIN_VERSION = 1;
15
+ export declare const TREES_TABLE = "trees";
16
+ /**
17
+ * The node and tree schemas, exported so the cross-layer default pin
18
+ * (`test/domain_defaults_pin.spec.ts`) can enumerate EVERY field this module defaults, instead of
19
+ * the pin hard-coding a list that would go stale the moment a field is added.
20
+ */
21
+ export declare const nodeSchema: z.ZodObject<{
22
+ id: z.ZodString;
23
+ rootId: z.ZodString;
24
+ parentId: z.ZodNullable<z.ZodString>;
25
+ title: z.ZodString;
26
+ description: z.ZodString;
27
+ unit: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
28
+ weight: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
29
+ roundMs: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
30
+ context: z.ZodArray<z.ZodString>;
31
+ corrections: z.ZodDefault<z.ZodArray<z.ZodString>>;
32
+ correctionsDeliveredUpTo: z.ZodDefault<z.ZodNumber>;
33
+ analysisNotes: z.ZodDefault<z.ZodArray<z.ZodString>>;
34
+ analysisAttempt: z.ZodDefault<z.ZodNumber>;
35
+ analysisAuthor: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
36
+ status: z.ZodEnum<{
37
+ failed: "failed";
38
+ blocked: "blocked";
39
+ ready: "ready";
40
+ running: "running";
41
+ interrupted: "interrupted";
42
+ done: "done";
43
+ }>;
44
+ createdAt: z.ZodNumber;
45
+ dispatchedAt: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
46
+ endedAt: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodNumber>>>;
47
+ depth: z.ZodNumber;
48
+ claimedBy: z.ZodNullable<z.ZodString>;
49
+ claimedAt: z.ZodNumber;
50
+ attempts: z.ZodNumber;
51
+ failures: z.ZodDefault<z.ZodNumber>;
52
+ spawnFailures: z.ZodDefault<z.ZodNumber>;
53
+ parkedWorker: z.ZodDefault<z.ZodNullable<z.ZodString>>;
54
+ lastWorkerId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
55
+ executorSessionId: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
56
+ dispatchBaseline: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodObject<{
57
+ corrections: z.ZodNumber;
58
+ notes: z.ZodNumber;
59
+ terminalChildren: z.ZodNumber;
60
+ fingerprint: z.ZodString;
61
+ attempts: z.ZodNumber;
62
+ holder: z.ZodCatch<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
63
+ }, z.core.$strip>>>>;
64
+ progressAt: z.ZodDefault<z.ZodNumber>;
65
+ activityAt: z.ZodDefault<z.ZodNumber>;
66
+ stalls: z.ZodDefault<z.ZodNumber>;
67
+ hungCount: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
68
+ stalledNotifiedAt: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
69
+ result: z.ZodNullable<z.ZodString>;
70
+ hasResult: z.ZodBoolean;
71
+ resultReadAt: z.ZodNullable<z.ZodNumber>;
72
+ resultRef: z.ZodNullable<z.ZodString>;
73
+ resultHint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
74
+ children: z.ZodArray<z.ZodString>;
75
+ updatedAt: z.ZodNumber;
76
+ }, z.core.$strip>;
77
+ export declare const treeSchema: z.ZodObject<{
78
+ rootId: z.ZodString;
79
+ ownerSessionId: z.ZodString;
80
+ createdAt: z.ZodNumber;
81
+ closedAt: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
82
+ reportedAt: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
83
+ }, z.core.$strip>;
84
+ export declare const treeDocumentSchema: z.ZodType<TreeDocumentShape>;
85
+ export type TreeDocument = TreeDocumentShape;
86
+ export declare const workDomain: {
87
+ name: string;
88
+ version: number;
89
+ tables: {
90
+ trees: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec<string, TreeDocumentShape>;
91
+ };
92
+ };
93
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/domain.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAK7E;;;;;GAKG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,eAAO,MAAM,WAAW,UAAU,CAAA;AAsBlC;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoFrB,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;iBAQrB,CAAA;AAEF,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAG1D,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAA;AAE5C,eAAO,MAAM,UAAU;;;;;;CAQrB,CAAA"}