@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,316 @@
1
+ import { Service } from "@deepseek-ai/cordis";
2
+ import type { Context } from "@deepseek-ai/cordis";
3
+ import type { CardDefinition, FactsReads } from "@melite/comfyui-cordis";
4
+ export { CardArmError } from "./cardsArmError.js";
5
+ import type { CardDeclRow, ModelFactsRow } from "./cardsFacts.js";
6
+ export { selectCardVariant, stampCardOverlay, liftCardParams } from "./cardsVariant.js";
7
+ export type { VariantSelection } from "./cardsVariant.js";
8
+ export type { CardDeclRow, ModelFactsRow, VariantCellRow, VariantRow } from "./cardsFacts.js";
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+ export declare const CARD_ENVELOPE_KEYS: readonly string[];
27
+ /** The card-lane refusal: status + the _refusal envelope shape
28
+ * (error, code, then loc/expected/got) — the door maps it through
29
+ * the local refusal path. */
30
+ /** The family's DECL face ("MOSS-SFX v2") — registryModel in a
31
+ * guard (it THROWS on unknown ids); the id is the fallback.
32
+ * Exported for the wall (both arms pin: the face serves, the
33
+ * unknown degrades to the id — never a throw into a serve). */
34
+ export declare function familyFace(fam: string): string;
35
+ export declare class CardRegistryService extends Service {
36
+ /** The primed card definitions (null until prime()). */
37
+ private defs;
38
+ /** The frozen model facts (lazy — strict load, throws LOUD). */
39
+ private facts;
40
+ /** Route address → family owner from the registry-derived facts. */
41
+ private owners;
42
+ /** Registry reads for the row derivation (primed with the models boot). */
43
+ private reads;
44
+ /** The decl projection (lazy — derived from defs + facts). */
45
+ private decls;
46
+ /** The engine's live node-definitions doc (/object_info via the
47
+ * SDK client, cached per process on the engine side; primed by
48
+ * primeObjectInfo before any compose). null = not yet primed or
49
+ * the engine is unreachable. */
50
+ private oi;
51
+ /** The catalog existence set (lazy — strict load, throws LOUD). */
52
+ private mids;
53
+ constructor(ctx: Context);
54
+ /** Prime the registry (service init — replaces the retired
55
+ * primeCardRegistry()): the registry loads async (dynamic
56
+ * card-module imports) but the validate/disclosure rims are sync,
57
+ * so every boot primes and the request path projects
58
+ * synchronously. Safe to call multiple times (unconditional
59
+ * reload — mirrors the old both-boot-sites prime); re-prime
60
+ * drops the defs-derived decls (facts/mids are disk-derived and
61
+ * stay). The provider's apply primes, and both main.ts boot
62
+ * sites re-prime belt-and-braces. */
63
+ prime(): Promise<void>;
64
+ /** Test seam: drop all registry state (walls boot fresh processes;
65
+ * belt-and-braces for in-process reuse — the RunsService behavior). */
66
+ resetForTests(): void;
67
+ /** Sync read of the primed registry (the disclosure projection
68
+ * serves from the registry, and the disclosure doors are sync —
69
+ * unprimed access throws LOUD, never a fallback). */
70
+ defsSync(): Map<string, CardDefinition>;
71
+ /** The frozen model facts (strict — a missing file throws LOUD;
72
+ * the validate door keeps its absent-file degrade by catching
73
+ * this at its own call site). */
74
+ /** Sync read of the primed registry reads (unprimed access throws LOUD). */
75
+ readsSync(): FactsReads;
76
+ modelFacts(): Record<string, ModelFactsRow>;
77
+ /** The decl projection — derived from defs + the strict facts, or
78
+ * from defs + caller-supplied facts (the validate door's
79
+ * degraded read; derived fresh, never cached over foreign facts). */
80
+ cardDecls(facts?: Record<string, ModelFactsRow>): Record<string, CardDeclRow>;
81
+ /** The primed live doc (sync face for the sweeps/spec fakes).
82
+ * null = never primed, or the engine was unreachable at prime. */
83
+ objectInfo(): Record<string, unknown> | null;
84
+ /** Prime the live node-definitions doc off the engine (/object_info
85
+ * via the SDK, cached per process). Never throws: false = the
86
+ * engine is unreachable and the doc stays null (the compose gate
87
+ * refuses CLOSED on that; the serving surfaces degrade). */
88
+ primeObjectInfo(): Promise<boolean>;
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ armWiringFromDoc(doc: Record<string, unknown> | null): void;
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+ modelMids(): Set<string>;
107
+ /** The owning family for mid: mid itself, or the facts model whose
108
+ * variant/cell route owns mid (mirrors _route_family;
109
+ * route-id-as-model is preserved — the graph is addressed by the
110
+ * family). Reads the strict facts unless the caller passes its
111
+ * own (the validate door's degraded read). */
112
+ resolveCardFamily(mid: string, facts?: Record<string, ModelFactsRow>): string;
113
+ /** THE RESOLVED SERVE (hour-26 stroke 15, the 1:1 run law): the
114
+ * map the NEXT RUN composes from a stage row — prepareCardParams'
115
+ * stamped + lifted body (variant resolver_defaults + family
116
+ * defaults injected for absent keys, surface-filtered, envelope
117
+ * keys + variant/quant consumed), the exact input the {model:}
118
+ * door hands compose. The drafts serve carries it on the stage
119
+ * row; the form renders it UNDER the user layer — ONE resolver,
120
+ * served to the visual, never a second client-side truth. Null
121
+ * when the row names no resolvable unit (registry-less lanes and
122
+ * model-less rows fall back to the client derive). */
123
+ /** The card's boarded families WITH PRESENCE (the no-silent-drop
124
+ * law, hour 26 stroke 17: a boarded family the machine has not
125
+ * downloaded is SERVED, marked absent — never silently dropped
126
+ * from any surface). Present = the live catalog offer
127
+ * (buildCatalog's served keys, route-id-as-model). */
128
+ cardFamilies(card: string): Array<{
129
+ id: string;
130
+ present: boolean;
131
+ label: string;
132
+ }>;
133
+ /** ADMISSION (the door half of the no-silent-drop law, re-cut
134
+ * hour 26 stroke 18 per the operator: a BOARDED model is
135
+ * OFFERED — the write lands even when the weights are not yet
136
+ * downloaded; absence is a DOWNLOAD PROMPT on the surfaces, never
137
+ * a block). The model's OWNING family (resolveCardFamily —
138
+ * variant routes resolve to their family) must be BOARDED on the
139
+ * card; anything else refuses AT WRITE TIME with the card's
140
+ * board — the writer (agent or human patch) gets the error the
141
+ * moment it lands, never at run time. Model-less rows pass (they
142
+ * compose on the card's default family). */
143
+ admitStageModel(card: string, model: unknown): {
144
+ ok: true;
145
+ } | {
146
+ ok: false;
147
+ error: string;
148
+ offered: string[];
149
+ };
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ admitStageRelations(card: string, params: Record<string, unknown>): {
169
+ ok: true;
170
+ } | {
171
+ ok: false;
172
+ error: string;
173
+ };
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ /** The draft (model-less) row's verdict: the words EVERY boarded
184
+ * declaring family states, judged over the raw params — the
185
+ * intersection law (see the model-less branch above). Bounds
186
+ * intersect per field (the tightest span all families agree
187
+ * holds); relation rows bind when every family states the row
188
+ * verbatim. A card with no declaring family stays null (the
189
+ * familyless tolerance). */
190
+ private modellessDraftVerdict;
191
+ private laneVerdict;
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+ repairStageModel(card: string, model: string): {
214
+ model: string;
215
+ variant?: string;
216
+ } | null;
217
+ /** The seated mcp:<server> engine ids, sorted — the generic MCP
218
+ * card's LIVE board (the same census the catalog/forms folds
219
+ * serve). The same lane-read spelling runsRegistry's flow_inline
220
+ * compile uses: the implicit seat get returns undefined when no
221
+ * engines service is registered — a registry-only boot (walls,
222
+ * fixtures) folds an empty census and card 'mcp' refuses with its
223
+ * own voice, never a silent pass. */
224
+ private seatedMcpEngines;
225
+ resolveStageParams(body: Record<string, unknown>): Record<string, unknown> | null;
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ composeValidateCard(card: string, fam: string, params: Record<string, unknown>, mid?: string, rawBody?: Record<string, unknown>): Promise<{
235
+ message: string;
236
+ code: string;
237
+ } | null>;
238
+ /** Phase 1 (run_id ""): validates shape/admission/boarding before
239
+ * registration. The $spell branch composes NO graph (the pool
240
+ * passes — the two-card-flow handoff). */
241
+ phase1Card(body: Record<string, unknown>, mid: string): Promise<Phase1Card>;
242
+ /** Phase 2 (the real run id): composes the SAME overlaid body phase
243
+ * 1 validated (submit 1294-1301 — idempotent, absent-keys-only;
244
+ * the editor's seeded stamps pass through byte-identical).
245
+ * A $spell body composes VERBATIM here (run context — the $spell
246
+ * wires into the Load* file slot; the merged path refuses a
247
+ * link-in-file-slot LOUDLY, test_two_card_flow). */
248
+ phase2Card(p1: Phase1Card, runId: string): Promise<ComposedCard>;
249
+ }
250
+ declare module "@deepseek-ai/cordis" {
251
+ interface Context {
252
+ cardRegistry: CardRegistryService;
253
+ }
254
+ }
255
+ /** The provider plugin (fiber-owned): owns the CardRegistryService
256
+ * lifetime and primes it at load, so inject-gated consumers apply
257
+ * only after the registry is primed. Manifest row
258
+ * estate-card-registry rides BEFORE every consumer (validate,
259
+ * flows-start, chrome, planes — the stroke-2b row placement rule).
260
+ * (The DSH leaf discipline — addressed code loads by address,
261
+ * never as a `cordis:` builtin.) */
262
+ /** The host row (estate naming — the gateway manifest died with
263
+ * the app; this is what the estate composition mounts). */
264
+ export declare const cardRegistryProvider: {
265
+ name: string;
266
+ apply(ctx: Context): Promise<void>;
267
+ };
268
+ /** Resolve the service for request-path helpers that take it as an
269
+ * optional trailing param (the stroke-2b shape): an explicit arg
270
+ * wins. Null = the caller forgot to thread ctx.cardRegistry — a
271
+ * bug, so reads throw LOUD (a registry read without a registry is
272
+ * never an empty answer). Door listeners MUST pass
273
+ * ctx.cardRegistry (their inject declares it). */
274
+ export declare function needCardRegistry(cards: CardRegistryService | null | undefined, where: string): CardRegistryService;
275
+ export interface PreparedCard {
276
+ readonly mid: string;
277
+ readonly fam: string;
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+ readonly modelId: string;
289
+ readonly card: string;
290
+ readonly skeleton: string;
291
+ readonly decl: CardDeclRow;
292
+ readonly params: Record<string, unknown>;
293
+
294
+
295
+
296
+
297
+
298
+ readonly familyless?: boolean;
299
+ }
300
+ export interface ComposedCard {
301
+ readonly graph: Record<string, unknown>;
302
+ readonly skeleton: string;
303
+ readonly spell: {
304
+ skeleton: string;
305
+ inputs: Record<string, unknown>;
306
+ } | null;
307
+ readonly outputs: Record<string, string>;
308
+ readonly outputNodes: Record<string, string>;
309
+ }
310
+ export interface Phase1Card extends PreparedCard {
311
+ readonly spell: {
312
+ skeleton: string;
313
+ inputs: Record<string, unknown>;
314
+ } | null;
315
+ }
316
+ //# sourceMappingURL=cardsRegistry.d.ts.map