@melite/estate-queue 0.0.0-stage → 0.1.4-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 (129) hide show
  1. package/LICENSE +557 -0
  2. package/lib/bakeParams.d.ts +17 -0
  3. package/lib/bakeParams.js +182 -0
  4. package/lib/bench.d.ts +24 -0
  5. package/lib/bench.js +121 -0
  6. package/lib/cardsArmError.d.ts +18 -0
  7. package/lib/cardsArmError.js +33 -0
  8. package/lib/cardsCompose.d.ts +41 -0
  9. package/lib/cardsCompose.js +247 -0
  10. package/lib/cardsDangling.d.ts +16 -0
  11. package/lib/cardsDangling.js +168 -0
  12. package/lib/cardsFacts.d.ts +74 -0
  13. package/lib/cardsFacts.js +64 -0
  14. package/lib/cardsLanes.d.ts +33 -0
  15. package/lib/cardsLanes.js +115 -0
  16. package/lib/cardsRegistry.d.ts +316 -0
  17. package/lib/cardsRegistry.js +1274 -0
  18. package/lib/cardsVariant.d.ts +28 -0
  19. package/lib/cardsVariant.js +190 -0
  20. package/lib/discloseRegistry.d.ts +94 -0
  21. package/lib/discloseRegistry.js +154 -0
  22. package/lib/filmLead.d.ts +4 -0
  23. package/lib/filmLead.js +17 -0
  24. package/lib/filmMemoryWarn.d.ts +27 -0
  25. package/lib/filmMemoryWarn.js +99 -0
  26. package/lib/flowsData.d.ts +179 -0
  27. package/lib/flowsData.js +547 -0
  28. package/lib/flowsFamilyCompose.d.ts +48 -0
  29. package/lib/flowsFamilyCompose.js +191 -0
  30. package/lib/flowsRegistryRows.d.ts +10 -0
  31. package/lib/flowsRegistryRows.js +378 -0
  32. package/lib/index.d.ts +50 -0
  33. package/lib/index.js +66 -0
  34. package/lib/ledgerTail.d.ts +20 -0
  35. package/lib/ledgerTail.js +123 -0
  36. package/lib/loadPlane.d.ts +93 -0
  37. package/lib/loadPlane.js +553 -0
  38. package/lib/loadRegistry.d.ts +22 -0
  39. package/lib/loadRegistry.js +55 -0
  40. package/lib/manageOps.d.ts +21 -0
  41. package/lib/manageOps.js +142 -0
  42. package/lib/managePlane.d.ts +120 -0
  43. package/lib/managePlane.js +1515 -0
  44. package/lib/manageProbe.d.ts +57 -0
  45. package/lib/manageProbe.js +154 -0
  46. package/lib/manageRegistry.d.ts +28 -0
  47. package/lib/manageRegistry.js +75 -0
  48. package/lib/managerRail.d.ts +33 -0
  49. package/lib/managerRail.js +91 -0
  50. package/lib/mediaKinds.d.ts +3 -0
  51. package/lib/mediaKinds.js +2 -0
  52. package/lib/queue.d.ts +9 -0
  53. package/lib/queue.js +76 -0
  54. package/lib/queueCore.d.ts +69 -0
  55. package/lib/queueCore.js +124 -0
  56. package/lib/queueLifecycle.d.ts +26 -0
  57. package/lib/queueLifecycle.js +65 -0
  58. package/lib/queueLock.d.ts +54 -0
  59. package/lib/queueLock.js +195 -0
  60. package/lib/queueResurrect.d.ts +59 -0
  61. package/lib/queueResurrect.js +249 -0
  62. package/lib/queueRetry.d.ts +36 -0
  63. package/lib/queueRetry.js +24 -0
  64. package/lib/queueSidecar.d.ts +145 -0
  65. package/lib/queueSidecar.js +182 -0
  66. package/lib/queueSubmit.d.ts +31 -0
  67. package/lib/queueSubmit.js +117 -0
  68. package/lib/queueSweep.d.ts +30 -0
  69. package/lib/queueSweep.js +121 -0
  70. package/lib/resurrect.d.ts +6 -0
  71. package/lib/resurrect.js +18 -0
  72. package/lib/rootsManifest.d.ts +11 -0
  73. package/lib/rootsManifest.js +11 -0
  74. package/lib/runStatus.d.ts +7 -0
  75. package/lib/runStatus.js +21 -0
  76. package/lib/runsChange.d.ts +53 -0
  77. package/lib/runsChange.js +63 -0
  78. package/lib/runsErrorCodes.d.ts +2 -0
  79. package/lib/runsErrorCodes.js +15 -0
  80. package/lib/runsExecute.d.ts +26 -0
  81. package/lib/runsExecute.js +356 -0
  82. package/lib/runsGates.d.ts +161 -0
  83. package/lib/runsGates.js +306 -0
  84. package/lib/runsList.d.ts +78 -0
  85. package/lib/runsList.js +580 -0
  86. package/lib/runsRefusalVoices.d.ts +9 -0
  87. package/lib/runsRefusalVoices.js +44 -0
  88. package/lib/runsRegistry.d.ts +253 -0
  89. package/lib/runsRegistry.js +1750 -0
  90. package/lib/runsSourceEcho.d.ts +54 -0
  91. package/lib/runsSourceEcho.js +275 -0
  92. package/lib/runsStart.d.ts +121 -0
  93. package/lib/runsStart.js +528 -0
  94. package/lib/runsTypes.d.ts +183 -0
  95. package/lib/runsTypes.js +282 -0
  96. package/lib/runsValidate.d.ts +5 -0
  97. package/lib/runsValidate.js +31 -0
  98. package/lib/runsValidateArms.d.ts +7 -0
  99. package/lib/runsValidateArms.js +285 -0
  100. package/lib/runsValidateInline.d.ts +6 -0
  101. package/lib/runsValidateInline.js +82 -0
  102. package/lib/runsValidateRefusals.d.ts +7 -0
  103. package/lib/runsValidateRefusals.js +18 -0
  104. package/lib/runsValidateServe.d.ts +15 -0
  105. package/lib/runsValidateServe.js +254 -0
  106. package/lib/runsValidateShared.d.ts +84 -0
  107. package/lib/runsValidateShared.js +88 -0
  108. package/lib/runsValidateStages.d.ts +25 -0
  109. package/lib/runsValidateStages.js +491 -0
  110. package/lib/runsValidateSweeps.d.ts +6 -0
  111. package/lib/runsValidateSweeps.js +143 -0
  112. package/lib/service.d.ts +45 -0
  113. package/lib/service.js +81 -0
  114. package/lib/skillFrontmatter.d.ts +11 -0
  115. package/lib/skillFrontmatter.js +46 -0
  116. package/lib/skillFs.d.ts +19 -0
  117. package/lib/skillFs.js +80 -0
  118. package/lib/skillPlane.d.ts +98 -0
  119. package/lib/skillPlane.js +263 -0
  120. package/lib/skillRegistry.d.ts +23 -0
  121. package/lib/skillRegistry.js +55 -0
  122. package/lib/skillRows.d.ts +126 -0
  123. package/lib/skillRows.js +466 -0
  124. package/lib/toolProjection.d.ts +30 -0
  125. package/lib/toolProjection.js +142 -0
  126. package/lib/vocab.d.ts +6 -0
  127. package/lib/vocab.js +18 -0
  128. package/package.json +47 -4
  129. package/README.md +0 -3
@@ -0,0 +1,253 @@
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
+ declare module "@deepseek-ai/dsh-typert-protocol" {
19
+ interface RemoteErrorDetailsMap {
20
+ /** The start body is not a JSON object (bad_envelope/body). */
21
+ "runs/bad-envelope": RunsRefusalDetails;
22
+ /** The draft law failed before any run registered. */
23
+ "runs/draft-required": RunsRefusalDetails;
24
+ "runs/draft-malformed": RunsRefusalDetails;
25
+ "runs/draft-unknown": RunsRefusalDetails;
26
+ /** Structure/policy refusals (strict body, doors, compile). */
27
+ "runs/invalid-request": RunsRefusalDetails;
28
+ /** Beyond the served preview scope — names what's missing. */
29
+ "runs/preview-scope": RunsRefusalDetails;
30
+ /** The inline compile refused (flow.voice, batch rows in
31
+ * details.errors — the validate door's 400 payload). */
32
+ "runs/flow-compile": RunsRefusalDetails & {
33
+ readonly errors?: unknown;
34
+ };
35
+ /** The comfyui workflow pin sweep refused (the validate
36
+ * door's workflow_pin payload). */
37
+ "runs/workflow-pin": RunsRefusalDetails & {
38
+ readonly errors?: unknown;
39
+ };
40
+ "runs/card-compose": RunsRefusalDetails & {
41
+ readonly loc?: string;
42
+ readonly expected?: string;
43
+ readonly got?: string;
44
+ };
45
+
46
+
47
+
48
+ "runs/lane-input-missing": RunsRefusalDetails;
49
+
50
+ "runs/unknown-run": {
51
+ readonly runId: string;
52
+ };
53
+
54
+ "runs/run-unknown": {
55
+ readonly runId: string;
56
+ };
57
+ }
58
+ }
59
+ /** The refusal codes this remote serves, folded to the
60
+ * protocol's vocabulary — a literal table, no dynamic key. */
61
+ export declare function enrichDiskRow(row: Record<string, unknown>): Record<string, unknown>;
62
+
63
+
64
+
65
+
66
+
67
+
68
+ export declare function sidecarReaderFor(dir: string): (name: string) => string | null;
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+ export declare function withStageReports(row: Record<string, unknown>, read: (name: string) => string | null): Record<string, unknown>;
86
+ export declare function benchWiring(benchDoc: Record<string, unknown>): {
87
+ cross: string[];
88
+ self: string[];
89
+ };
90
+ export declare class RunsRuntimeService extends Service {
91
+ static inject: string[];
92
+ /** The pump reentrancy guard (door-verbatim — a public field:
93
+ * cordis proxies services, and private #fields do not cross the
94
+ * proxy). */
95
+ pumping: boolean;
96
+ /** The boot-reconcile guard (once per boot; the constructor's
97
+ * fire-and-forget burns it — walls re-arm this PUBLIC field and
98
+ * await bootReconcile directly, the pumping-field precedent:
99
+ * private #fields do not cross cordis proxies). */
100
+ reconciled: boolean;
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ tearingDown: boolean;
113
+ /** The cached engine seat for the teardown interrupt: a ctx.get
114
+ * from a DYING fiber refuses (the lookup that feeds the stop
115
+ * door works only while this fiber lives), so the pump caches
116
+ * the seat at claim time and the dispose effect rides the
117
+ * cache. Structural type — no engine import cycle. */
118
+ engineSeat: {
119
+ stopForRunDir: (dir: string) => Promise<void>;
120
+ } | undefined;
121
+ constructor(ctx: Context);
122
+ /** Subscribe to run-row movement (the seat face runs/subscribe
123
+ * parks on); returns the unsubscribe. Delegates to the module
124
+ * seam — a listener's fault never breaks the write (the wrapper
125
+ * guards; the law lives at runsChange.ts onRunChange). */
126
+ onRunChange(fn: (runId: string) => void): () => void;
127
+ /** THE BOOT RECONCILE (stroke 83; boot_resurrect reborn as a
128
+ * REPLAY, not a hollow requeue): every usable QUEUED record's
129
+ * _request.json goes back through the START door under its own
130
+ * run id — the recompiled row carries REAL params (the old
131
+ * resurrectRuns requeued hollow stage faces and the pump's
132
+ * splice refused them all: every revived run settled failed
133
+ * "no inline workflow"). Replay = resubmit-with-same-id: the
134
+ * draft probe, the strict body, the compile all re-run against
135
+ * CURRENT truth; a refusal settles that run failed LOUD with
136
+ * the door's own voice. FIFO holds (plan order = created_at).
137
+ * After the replay, bootSweep retires stale RUNNING claims of
138
+ * the dead process (the ledgered dispositions, row-28 law). */
139
+ /** The validate door (delegates to the extracted arms). */
140
+ validate(doc: unknown, signal: AbortSignal): Promise<Record<string, unknown>>;
141
+ /** The model-validate arm (delegates to the extracted arm). */
142
+ modelValidateArm(body: Record<string, unknown>): Promise<FlowsValidateAnswer>;
143
+ bootReconcile(disposed?: () => boolean): Promise<string[]>;
144
+ /** Settle a replay-refused resurrect id: rebuild the row's
145
+ * identity from its own sidecar (the stage faces ride verbatim)
146
+ * and persist failed through the canonical terminal writer. */
147
+ private settleReplayRefusal;
148
+ /** The queue seat's registry (the FIFO SSOT). */
149
+ private get core();
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+ /** ONE card stage, composed (the shared compose core — the bench
168
+ * run and the registry-flow arm both ride it, so a card composes
169
+ * through exactly ONE implementation and one refusal voice).
170
+ * `label` names the seat in a refusal ("bench stage " / "flow
171
+ * stage "). */
172
+ private composeCardStageRow;
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ private composeRegistryFlowStages;
191
+ private composeBenchStages;
192
+ start(doc: unknown, signal: AbortSignal,
193
+ /** INTERNAL (stroke 83 boot resurrect): reuse a dead process's
194
+ * run id when replaying its _request.json — the remote surface
195
+ * never passes this (two-arg wire calls only). */
196
+ reuse?: {
197
+ runId: RunId;
198
+ }): Promise<{
199
+ run_id: string;
200
+ status: string;
201
+ queue_position: number;
202
+ }>;
203
+ /** The list arm (REBUILD-7): the restore-port envelope over the
204
+ * output roots. The raw limit STRING rides from the lane (strict
205
+ * int() semantics: underscores parse, junk refuses). The drafts
206
+ * probe rides the drafts remote. */
207
+ list(rawLimit: string, signal: AbortSignal, test?: boolean): Promise<{
208
+ count: number;
209
+ runs: Record<string, unknown>[];
210
+ }>;
211
+ /** The validate arm (REBUILD-8): the PURE compile pipeline
212
+ * (flowFromBody → compile → pin sweep → the 200 row) over the
213
+ * door's own bodies. The {model}/{flow} arms refuse the
214
+ * preview refusal (their remotes are later strokes); a 4xx
215
+ * answer folds to runs/flow-compile | runs/workflow-pin with
216
+ * the door's payload voices; the 200 serves verbatim. */
217
+ /** F-6(b) — THE ADMISSION MEMORY WARN (the film lane's tool
218
+ * half of the pre-flight): a film admitted while the engine's
219
+ * VRAM sits below the pressure line warns — the caller stamps
220
+ * the returned warnings on the run (they ride run_status, never
221
+ * a refusal). Any telemetry failure (config unreadable, engine
222
+ * unreachable, stats unparseable) returns none — admission never
223
+ * blocks on a stats read. */
224
+ filmAdmissionWarnings(cardId: string, body: Record<string, unknown>): Promise<string[]>;
225
+ status(runId: string, signal: AbortSignal, includeLog?: boolean): Promise<Record<string, unknown>>;
226
+ stop(runId: string, signal: AbortSignal): Promise<Record<string, unknown>>;
227
+ /** The live map (the queue seat's core registry — rich rows). */
228
+ private liveRun;
229
+ /** The durable record under the run tree (F-5's fallback read):
230
+ * the on-disk _flow.json for a run — the SAME file the maker
231
+ * verified byte-by-byte while status answered husks. The
232
+ * manifest roots are probed in order (own first), both
233
+ * out-roots per root (production first, then test) since the
234
+ * fallback may not know the row's testFlag. Unparseable/absent →
235
+ * undefined — never a fabricated row. */
236
+ private diskRunRow;
237
+ /** The envelope walk with the AWAITED draft probe (door order
238
+ * preserved: the probe sits between malformed and unknown). */
239
+ private walkEnvelope;
240
+ /** Kick the serial pump (door-verbatim guard). */
241
+ private kick;
242
+ /** The serial worker: claim the FIFO head, execute, settle —
243
+ * one GPU run machine-wide, strict submit order. */
244
+ private pump;
245
+ /** The run's engine id (stroke 53): the first stage's engine,
246
+ * defaulting to 'comfyui' for pre-seam rows (the only engine
247
+ * that ever was). Single-stage gateway = one engine per run. */
248
+ /** The engine read (static delegate to the extracted plane). */
249
+ static runEngine(run: RunRecord): string;
250
+ /** Terminal settle (queue core row + the settle persist). */
251
+ private settle;
252
+ }
253
+ //# sourceMappingURL=runsRegistry.d.ts.map