@melite/estate-queue 0.0.0-stage → 0.1.5-pre-alpha

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 (131) hide show
  1. package/LICENSE +557 -0
  2. package/README.md +54 -2
  3. package/lib/bakeParams.d.ts +17 -0
  4. package/lib/bakeParams.js +182 -0
  5. package/lib/bench.d.ts +32 -0
  6. package/lib/bench.js +111 -0
  7. package/lib/cardsArmError.d.ts +61 -0
  8. package/lib/cardsArmError.js +57 -0
  9. package/lib/cardsCompose.d.ts +53 -0
  10. package/lib/cardsCompose.js +295 -0
  11. package/lib/cardsDangling.d.ts +16 -0
  12. package/lib/cardsDangling.js +213 -0
  13. package/lib/cardsFacts.d.ts +87 -0
  14. package/lib/cardsFacts.js +78 -0
  15. package/lib/cardsLanes.d.ts +43 -0
  16. package/lib/cardsLanes.js +178 -0
  17. package/lib/cardsRegistry.d.ts +404 -0
  18. package/lib/cardsRegistry.js +1543 -0
  19. package/lib/cardsVariant.d.ts +37 -0
  20. package/lib/cardsVariant.js +243 -0
  21. package/lib/discloseRegistry.d.ts +95 -0
  22. package/lib/discloseRegistry.js +156 -0
  23. package/lib/filmLead.d.ts +4 -0
  24. package/lib/filmLead.js +17 -0
  25. package/lib/filmMemoryWarn.d.ts +27 -0
  26. package/lib/filmMemoryWarn.js +99 -0
  27. package/lib/flowsData.d.ts +234 -0
  28. package/lib/flowsData.js +673 -0
  29. package/lib/flowsFamilyCompose.d.ts +45 -0
  30. package/lib/flowsFamilyCompose.js +191 -0
  31. package/lib/flowsParamsOverlay.d.ts +55 -0
  32. package/lib/flowsParamsOverlay.js +197 -0
  33. package/lib/flowsRegistryRows.d.ts +12 -0
  34. package/lib/flowsRegistryRows.js +520 -0
  35. package/lib/index.d.ts +47 -0
  36. package/lib/index.js +75 -0
  37. package/lib/ledgerTail.d.ts +20 -0
  38. package/lib/ledgerTail.js +123 -0
  39. package/lib/lifecycleLatch.d.ts +16 -0
  40. package/lib/lifecycleLatch.js +42 -0
  41. package/lib/loadPlane.d.ts +94 -0
  42. package/lib/loadPlane.js +570 -0
  43. package/lib/loadRegistry.d.ts +22 -0
  44. package/lib/loadRegistry.js +55 -0
  45. package/lib/manageOps.d.ts +27 -0
  46. package/lib/manageOps.js +162 -0
  47. package/lib/managePlane.d.ts +151 -0
  48. package/lib/managePlane.js +1790 -0
  49. package/lib/manageProbe.d.ts +48 -0
  50. package/lib/manageProbe.js +165 -0
  51. package/lib/manageRegistry.d.ts +66 -0
  52. package/lib/manageRegistry.js +113 -0
  53. package/lib/managerRail.d.ts +33 -0
  54. package/lib/managerRail.js +91 -0
  55. package/lib/mediaKinds.d.ts +3 -0
  56. package/lib/mediaKinds.js +2 -0
  57. package/lib/queue.d.ts +9 -0
  58. package/lib/queue.js +80 -0
  59. package/lib/queueCore.d.ts +72 -0
  60. package/lib/queueCore.js +128 -0
  61. package/lib/queueLifecycle.d.ts +2 -0
  62. package/lib/queueLifecycle.js +11 -0
  63. package/lib/queueLock.d.ts +60 -0
  64. package/lib/queueLock.js +198 -0
  65. package/lib/queueResurrect.d.ts +59 -0
  66. package/lib/queueResurrect.js +249 -0
  67. package/lib/queueRetry.d.ts +36 -0
  68. package/lib/queueRetry.js +24 -0
  69. package/lib/queueSidecar.d.ts +149 -0
  70. package/lib/queueSidecar.js +183 -0
  71. package/lib/queueSubmit.d.ts +82 -0
  72. package/lib/queueSubmit.js +191 -0
  73. package/lib/queueSweep.d.ts +30 -0
  74. package/lib/queueSweep.js +132 -0
  75. package/lib/resurrect.d.ts +6 -0
  76. package/lib/resurrect.js +18 -0
  77. package/lib/rootsManifest.d.ts +11 -0
  78. package/lib/rootsManifest.js +11 -0
  79. package/lib/runsChange.d.ts +61 -0
  80. package/lib/runsChange.js +79 -0
  81. package/lib/runsErrorCodes.d.ts +2 -0
  82. package/lib/runsErrorCodes.js +48 -0
  83. package/lib/runsExecute.d.ts +52 -0
  84. package/lib/runsExecute.js +494 -0
  85. package/lib/runsGates.d.ts +161 -0
  86. package/lib/runsGates.js +307 -0
  87. package/lib/runsList.d.ts +78 -0
  88. package/lib/runsList.js +574 -0
  89. package/lib/runsRefusalVoices.d.ts +9 -0
  90. package/lib/runsRefusalVoices.js +96 -0
  91. package/lib/runsRegistry.d.ts +351 -0
  92. package/lib/runsRegistry.js +2394 -0
  93. package/lib/runsSourceEcho.d.ts +81 -0
  94. package/lib/runsSourceEcho.js +341 -0
  95. package/lib/runsStart.d.ts +163 -0
  96. package/lib/runsStart.js +667 -0
  97. package/lib/runsTypes.d.ts +218 -0
  98. package/lib/runsTypes.js +289 -0
  99. package/lib/runsValidate.d.ts +5 -0
  100. package/lib/runsValidate.js +31 -0
  101. package/lib/runsValidateArms.d.ts +7 -0
  102. package/lib/runsValidateArms.js +339 -0
  103. package/lib/runsValidateInline.d.ts +6 -0
  104. package/lib/runsValidateInline.js +82 -0
  105. package/lib/runsValidateRefusals.d.ts +7 -0
  106. package/lib/runsValidateRefusals.js +18 -0
  107. package/lib/runsValidateServe.d.ts +15 -0
  108. package/lib/runsValidateServe.js +276 -0
  109. package/lib/runsValidateShared.d.ts +84 -0
  110. package/lib/runsValidateShared.js +88 -0
  111. package/lib/runsValidateStages.d.ts +32 -0
  112. package/lib/runsValidateStages.js +511 -0
  113. package/lib/runsValidateSweeps.d.ts +6 -0
  114. package/lib/runsValidateSweeps.js +143 -0
  115. package/lib/service.d.ts +63 -0
  116. package/lib/service.js +89 -0
  117. package/lib/skillFrontmatter.d.ts +11 -0
  118. package/lib/skillFrontmatter.js +46 -0
  119. package/lib/skillFs.d.ts +24 -0
  120. package/lib/skillFs.js +78 -0
  121. package/lib/skillPlane.d.ts +99 -0
  122. package/lib/skillPlane.js +269 -0
  123. package/lib/skillRegistry.d.ts +23 -0
  124. package/lib/skillRegistry.js +55 -0
  125. package/lib/skillRows.d.ts +127 -0
  126. package/lib/skillRows.js +468 -0
  127. package/lib/toolProjection.d.ts +30 -0
  128. package/lib/toolProjection.js +142 -0
  129. package/lib/vocab.d.ts +6 -0
  130. package/lib/vocab.js +18 -0
  131. package/package.json +48 -4
@@ -0,0 +1,351 @@
1
+ import { Service } from "@deepseek-ai/cordis";
2
+ import type { Context } from "@deepseek-ai/cordis";
3
+ import type { RunId } from "./queueCore.js";
4
+ export { toRemoteError } from "./runsRefusalVoices.js";
5
+ import type { FlowsValidateAnswer } from "./runsValidate.js";
6
+ import type { RunRecord } from "./runsTypes.js";
7
+ /** The runs Remote failure codes, merged into the protocol's ONE
8
+ * vocabulary (cookbook §2: declaration merging, next to the
9
+ * throws). The codes ride kebab-cased; the byte-pinned prose
10
+ * rides the message; loc/expected/got ride the details. */
11
+ /** Refusal detail rows (the envelope's loc/expected/got,
12
+ * present when the door set them). */
13
+ export interface RunsRefusalDetails {
14
+ readonly loc?: string;
15
+ readonly expected?: string;
16
+ readonly got?: string;
17
+ }
18
+
19
+
20
+
21
+
22
+ export interface LaneInputMissingDetails extends RunsRefusalDetails {
23
+ readonly family: string;
24
+ readonly slot: string;
25
+ readonly missing: string;
26
+ readonly folders: readonly string[];
27
+ readonly fetch_url?: string;
28
+ readonly kind: "model" | "extension";
29
+ }
30
+ declare module "@deepseek-ai/dsh-typert-protocol" {
31
+ interface RemoteErrorDetailsMap {
32
+ /** The start body is not a JSON object (bad_envelope/body). */
33
+ "runs/bad-envelope": RunsRefusalDetails;
34
+ /** The draft law failed before any run registered. */
35
+ "runs/draft-required": RunsRefusalDetails;
36
+ "runs/draft-malformed": RunsRefusalDetails;
37
+ "runs/draft-unknown": RunsRefusalDetails;
38
+ /** Structure/policy refusals (strict body, doors, compile). */
39
+ "runs/invalid-request": RunsRefusalDetails;
40
+ /** Beyond the served preview scope — names what's missing. */
41
+ "runs/preview-scope": RunsRefusalDetails;
42
+ /** The inline compile refused (flow.voice, batch rows in
43
+ * details.errors — the validate door's 400 payload). */
44
+ "runs/flow-compile": RunsRefusalDetails & {
45
+ readonly errors?: unknown;
46
+ };
47
+ /** The comfyui workflow pin sweep refused (the validate
48
+ * door's workflow_pin payload). */
49
+ "runs/workflow-pin": RunsRefusalDetails & {
50
+ readonly errors?: unknown;
51
+ };
52
+ "runs/card-compose": RunsRefusalDetails;
53
+
54
+
55
+
56
+
57
+
58
+ "runs/card-compose-incomplete": RunsRefusalDetails;
59
+
60
+
61
+
62
+
63
+
64
+ "runs/lane-input-missing": LaneInputMissingDetails;
65
+
66
+
67
+
68
+ "runs/lifecycle-inflight": RunsRefusalDetails;
69
+
70
+ "runs/unknown-run": {
71
+ readonly runId: string;
72
+ };
73
+
74
+ "runs/run-unknown": {
75
+ readonly runId: string;
76
+ };
77
+ }
78
+ }
79
+ /** The refusal codes this remote serves, folded to the
80
+ * protocol's vocabulary — a literal table, no dynamic key. */
81
+ export declare function enrichDiskRow(row: Record<string, unknown>): Record<string, unknown>;
82
+
83
+
84
+
85
+
86
+
87
+
88
+ export declare function sidecarReaderFor(dir: string): (name: string) => string | null;
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ export declare function withStageReports(row: Record<string, unknown>, read: (name: string) => string | null): Record<string, unknown>;
106
+ export declare function benchWiring(benchDoc: Record<string, unknown>): {
107
+ cross: string[];
108
+ self: string[];
109
+ };
110
+ export declare class RunsRuntimeService extends Service {
111
+
112
+
113
+
114
+ private static readonly PRESS_MEMORY_MAX;
115
+ static inject: string[];
116
+ /** The pump reentrancy guard (door-verbatim — a public field:
117
+ * cordis proxies services, and private #fields do not cross the
118
+ * proxy). */
119
+ pumping: boolean;
120
+ /** The boot-reconcile guard (once per boot; the constructor's
121
+ * fire-and-forget burns it — walls re-arm this PUBLIC field and
122
+ * await bootReconcile directly, the pumping-field precedent:
123
+ * private #fields do not cross cordis proxies). */
124
+ reconciled: boolean;
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+ tearingDown: boolean;
137
+ /** The cached engine seat for the teardown interrupt: a ctx.get
138
+ * from a DYING fiber refuses (the lookup that feeds the stop
139
+ * door works only while this fiber lives), so the pump caches
140
+ * the seat at claim time and the dispose effect rides the
141
+ * cache. Structural type — no engine import cycle. */
142
+ engineSeat: {
143
+ stopForRunDir: (dir: string) => Promise<void>;
144
+ } | undefined;
145
+ constructor(ctx: Context);
146
+ /** Subscribe to run-row movement (the seat face runs/subscribe
147
+ * parks on); returns the unsubscribe. Delegates to the module
148
+ * seam — a listener's fault never breaks the write (the wrapper
149
+ * guards; the law lives at runsChange.ts onRunChange). */
150
+ onRunChange(fn: (runId: string) => void): () => void;
151
+ /** THE BOOT RECONCILE (stroke 83; boot_resurrect reborn as a
152
+ * REPLAY, not a hollow requeue): every usable QUEUED record's
153
+ * _request.json goes back through the START door under its own
154
+ * run id — the recompiled row carries REAL params (the old
155
+ * resurrectRuns requeued hollow stage faces and the pump's
156
+ * splice refused them all: every revived run settled failed
157
+ * "no inline workflow"). Replay = resubmit-with-same-id: the
158
+ * draft probe, the strict body, the compile all re-run against
159
+ * CURRENT truth; a refusal settles that run failed LOUD with
160
+ * the door's own voice. FIFO holds (plan order = created_at).
161
+ * After the replay, bootSweep retires stale RUNNING claims of
162
+ * the dead process (the ledgered dispositions, row-28 law). */
163
+ /** The validate door (delegates to the extracted arms). */
164
+ validate(doc: unknown, signal: AbortSignal): Promise<Record<string, unknown>>;
165
+ /** The model-validate arm (delegates to the extracted arm). */
166
+ modelValidateArm(body: Record<string, unknown>): Promise<FlowsValidateAnswer>;
167
+ bootReconcile(disposed?: () => boolean): Promise<string[]>;
168
+ /** Settle a replay-refused resurrect id: rebuild the row's
169
+ * identity from its own sidecar (the stage faces ride verbatim)
170
+ * and persist failed through the canonical terminal writer. */
171
+ private settleReplayRefusal;
172
+ /** The queue seat's registry (the FIFO SSOT). */
173
+ private get core();
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+ /** ONE card stage, composed (the shared compose core — the bench
192
+ * run and the registry-flow arm both ride it, so a card composes
193
+ * through exactly ONE implementation and one refusal voice).
194
+ * `label` names the seat in a refusal ("bench stage " / "flow
195
+ * stage "). */
196
+ private composeCardStageRow;
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+ private composeRegistryFlowStages;
215
+ private composeBenchStages;
216
+ start(doc: unknown, signal: AbortSignal,
217
+ /** INTERNAL (stroke 83 boot resurrect): reuse a dead process's
218
+ * run id when replaying its _request.json — the remote surface
219
+ * never passes this (two-arg wire calls only). */
220
+ reuse?: {
221
+ runId: RunId;
222
+ }): Promise<{
223
+ run_id: string;
224
+ status: string;
225
+ queue_position: number;
226
+ }>;
227
+
228
+
229
+
230
+
231
+
232
+ private pressReplay;
233
+ /** THE START ARMS under a settled replay/reservation verdict: the
234
+ * bench-composed arm and the flow_inline arm, behavior-verbatim
235
+ * from before the concurrent-press cure split them behind the
236
+ * shell (the split's only edits are the two summary settles). */
237
+ private startReserved;
238
+ /** The list arm (REBUILD-7): the restore-port envelope over the
239
+ * output roots. The raw limit STRING rides from the lane (strict
240
+ * int() semantics: underscores parse, junk refuses). The drafts
241
+ * probe rides the drafts remote. */
242
+ list(rawLimit: string, signal: AbortSignal, test?: boolean): Promise<{
243
+ count: number;
244
+ runs: Record<string, unknown>[];
245
+ }>;
246
+ /** The validate arm (REBUILD-8): the PURE compile pipeline
247
+ * (flowFromBody → compile → pin sweep → the 200 row) over the
248
+ * door's own bodies. The {model}/{flow} arms refuse the
249
+ * preview refusal (their remotes are later strokes); a 4xx
250
+ * answer folds to runs/flow-compile | runs/workflow-pin with
251
+ * the door's payload voices; the 200 serves verbatim. */
252
+ /** F-6(b) — THE ADMISSION MEMORY WARN (the film lane's tool
253
+ * half of the pre-flight): a film admitted while the engine's
254
+ * VRAM sits below the pressure line warns — the caller stamps
255
+ * the returned warnings on the run (they ride run_status, never
256
+ * a refusal). Any telemetry failure (config unreadable, engine
257
+ * unreachable, stats unparseable) returns none — admission never
258
+ * blocks on a stats read. */
259
+ filmAdmissionWarnings(cardId: string, body: Record<string, unknown>): Promise<string[]>;
260
+ status(runId: string, signal: AbortSignal, includeLog?: boolean): Promise<Record<string, unknown>>;
261
+ stop(runId: string, signal: AbortSignal): Promise<Record<string, unknown>>;
262
+ /** The live map (the queue seat's core registry — rich rows). */
263
+ private liveRun;
264
+ /** The durable record under the run tree (F-5's fallback read):
265
+ * the on-disk _flow.json for a run — the SAME file the maker
266
+ * verified byte-by-byte while status answered husks. The
267
+ * manifest roots are probed in order (own first), both
268
+ * out-roots per root (production first, then test) since the
269
+ * fallback may not know the row's testFlag. Unparseable/absent →
270
+ * undefined — never a fabricated row. */
271
+ private diskRunRow;
272
+ /** The envelope walk with the AWAITED draft probe (door order
273
+ * preserved: the probe sits between malformed and unknown). */
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+ private readonly presses;
282
+
283
+
284
+
285
+
286
+
287
+
288
+ private readonly pendingPresses;
289
+ /** The caller's verdict at the press gate: null when it becomes
290
+ * the minter (its entry is registered before this returns); the
291
+ * in-flight promise when a concurrent mint owns the key — the
292
+ * twin awaits and answers with the SAME summary or refusal. */
293
+ private reservePress;
294
+ /** The minter's summary settles the twin (no-op without a press —
295
+ * the door's return sites serve both keyed and keyless starts). */
296
+ private resolvePress;
297
+
298
+
299
+
300
+
301
+ private failPress;
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+ private awaitTwin;
313
+ private rememberPress;
314
+ /** Kick the serial pump (door-verbatim guard). */
315
+ private kick;
316
+ /** The serial worker: claim the FIFO head, execute, settle —
317
+ * one GPU run machine-wide, strict submit order. */
318
+ private pump;
319
+ /** The run's engine id (stroke 53): the first stage's engine,
320
+ * defaulting to 'comfyui' for pre-seam rows (the only engine
321
+ * that ever was). Single-stage gateway = one engine per run. */
322
+ /** The engine read (static delegate to the extracted plane). */
323
+ static runEngine(run: RunRecord): string;
324
+ /** Terminal settle (queue core row + the settle persist). */
325
+ private settle;
326
+ }
327
+ /** THE SETTLE MIRROR (pure — the walls' seam, bench-trail/runs-remote
328
+ * W4–W8): per draft stage, the terminal outcome patch the runs seat
329
+ * mirrors into the draft doc at settle, with no browser tab alive.
330
+ *
331
+ * Identity: the DRAFT row id (benchStageId, the compose's stamp) —
332
+ * the run row's `id` may be the card skeleton's, a namespace the
333
+ * draft doc never heard of (draft.ts's own admission). Legacy rows
334
+ * without the stamp fall back to `id`.
335
+ *
336
+ * Words: the draft row's terminal vocabulary. completed→done (the
337
+ * client's word, cards-resource tileStatusFromVerdict),
338
+ * failed→failed, stopped→stopped; a STOPPED run's untouched
339
+ * (queued/pending/running) stage rows mirror the run's word — the
340
+ * queued-stop arm settles without stamping stages (the defect-hunt
341
+ * §1 P1: the closed-tab row would read running forever).
342
+ *
343
+ * The result face: run_id always; the run-relative media url of the
344
+ * stage's own output when one exists (the husk clobber's other
345
+ * half — a bookkeeping mirror never blanks a hero it can name); the
346
+ * error voice (stage's, else the run's) when the word is failed. */
347
+ export declare function settleMirrorPatches(run: RunRecord): Array<{
348
+ stageId: string;
349
+ patch: Record<string, unknown>;
350
+ }>;
351
+ //# sourceMappingURL=runsRegistry.d.ts.map