@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,84 @@
1
+ import type { CardDefinition } from "@melite/comfyui-cordis";
2
+ /** The door's answer (status folds away at the remote seam; the
3
+ * payload rides verbatim). */
4
+ export interface FlowsValidateAnswer {
5
+ status: number;
6
+ payload: Record<string, unknown>;
7
+ }
8
+ /** The card-registry face the pure half touches, STRUCTURAL (the
9
+ * producing service is the cardRegistry stroke's; null = the
10
+ * loud-refusal paths above — never a silent degrade). */
11
+ export interface CardRegistryLike {
12
+ defsSync(): Map<string, CardDefinition>;
13
+ objectInfo(): Record<string, unknown> | null;
14
+ }
15
+ export declare const ENGINE_TABLE: Record<string, {
16
+ plugin: string;
17
+ def: string;
18
+ }>;
19
+ export declare const KIND_VOCAB: readonly string[];
20
+ export declare const SKIP_VOCAB: readonly string[];
21
+ export declare const INLINE_TOP_SORTED: readonly string[];
22
+ export declare const STAGE_KEYS_SORTED: readonly string[];
23
+ export { FLOW_ID_RE } from "./runsGates.js";
24
+ /** needCardRegistry (start-door-verbatim): the LOUD
25
+ * miswire when the card registry is absent — a card= stage
26
+ * refuses until the cardRegistry stroke slots the defs in. */
27
+ export declare function needCardRegistry(cards: CardRegistryLike | null | undefined, where: string): CardRegistryLike;
28
+ export declare class FlowError extends Error {
29
+ constructor(message: string);
30
+ }
31
+ export type Edge = {
32
+ kind: "initial";
33
+ key: string;
34
+ } | {
35
+ kind: "stage";
36
+ stage: string;
37
+ output: string;
38
+ };
39
+ export interface StageSkip {
40
+ initial: string;
41
+ when: string;
42
+ }
43
+ export interface FlowStageRow {
44
+ id: string;
45
+ engine: string;
46
+ description: string;
47
+ params: Record<string, unknown>;
48
+ inputs: Array<{
49
+ name: string;
50
+ edge: Edge;
51
+ }>;
52
+ outputs: Array<{
53
+ name: string;
54
+ kind: string;
55
+ }>;
56
+ expected: Array<{
57
+ name: string;
58
+ kind: string;
59
+ }>;
60
+ card: string;
61
+ cardIo: Array<{
62
+ name: string;
63
+ kind: string;
64
+ }>;
65
+ skipWhen: StageSkip | null;
66
+ }
67
+ export interface Flow {
68
+ id: string;
69
+ description: string;
70
+ stages: FlowStageRow[];
71
+ }
72
+ export interface GraphNode {
73
+ id: string;
74
+ engine: string;
75
+ description: string;
76
+ inputFrom: string[];
77
+ inputNames: string[];
78
+ outputs: Array<{
79
+ name: string;
80
+ kind: string;
81
+ }>;
82
+ params: unknown;
83
+ }
84
+ //# sourceMappingURL=runsValidateShared.d.ts.map
@@ -0,0 +1,88 @@
1
+ // runsValidateShared.ts — shared kernel split from runsValidate.ts (pure move,
2
+ // zero logic changes): closed vocabularies, flow-domain types, FlowError,
3
+ // and the card-registry face.
4
+ import { WIRE_STAGE_KEYS } from "@melite/contracts/benchStage";
5
+ import { INLINE_TOP_KEYS } from "./runsGates.js";
6
+ // ENGINE_TABLE: engine_type -> {plugin_id, default_output kind}.
7
+
8
+ // api caller for comfyui, not having engines anymore"): ComfyUI is
9
+ // the only engine. The old engine tiers (cpp/audio-cpp,
10
+ // cpp/skintokens, cpp/autoremesher, node/anycreature, sim —
11
+ // estate-owned subprocess compute, every card decl-only and never
12
+ // composable) are QUARANTINED to vendor/retired-engines/ pending
13
+ // rebirth as vendored ComfyUI custom nodes. Probed live from
14
+ // scan_engines(); re-derived per run.
15
+ export const ENGINE_TABLE = {
16
+ comfyui: { plugin: "comfyui", def: "image" },
17
+ // Stroke 55 (the engine-generics seam): the craft loop engine +
18
+ // the MCP grammar arm — any mcp:<server> id matching the seat's
19
+ // grammar admits (membership stays the runs door's registry arm).
20
+ craft: { plugin: "craft", def: "image" },
21
+ // Stroke 60 (plan §5): the agent engine — the spawner loop. Its
22
+ // stage is validated like any engine stage (params carry the four
23
+ // pinned fields); outputs are arbitrary (artifacts land in the
24
+ // run dir).
25
+ agent: { plugin: "agent", def: "text" },
26
+ };
27
+ // ── closed vocabularies (Kind / SkipWhen order) ──────
28
+ export const KIND_VOCAB = [
29
+ "text",
30
+ "image",
31
+ "video",
32
+ "audio",
33
+ "mesh",
34
+ "num",
35
+ "lora",
36
+ "seg",
37
+ "data",
38
+ ];
39
+ export const SKIP_VOCAB = ["present", "absent"];
40
+ // _INLINE_TOP_KEYS sorted (dead/allowed messages) — DERIVED, not
41
+
42
+ // hand-typed copy of runsGates' INLINE_TOP_KEYS: equal today, and a
43
+ // SILENT start-vs-validate disagreement the moment either side grew —
44
+ // proven, not predicted. Adding a top-level key to the start door's
45
+ // list alone left the start verdict `ok`, the validate door refusing
46
+ // `unknown keys ["labels"]`, and 115 tests green. The very next line
47
+ // below already DERIVED its sibling from the contract; this one was
48
+ // the copy the same audit had to be shown twice. The members are
49
+ // runsGates'; only the sort is ours.
50
+ export const INLINE_TOP_SORTED = [...INLINE_TOP_KEYS].sort();
51
+ // sorted(WIRE_STAGE_KEYS) — DERIVED, not retyped (the identity law,
52
+
53
+ // equal today, and a silent start-vs-validate disagreement the moment
54
+
55
+ // enumerated twice will disagree with itself the first time it
56
+ // grows). The sort is the only transformation; the members are the
57
+ // contract's.
58
+ export const STAGE_KEYS_SORTED = [...WIRE_STAGE_KEYS].sort();
59
+ // ── strict-body vocab ───────────────────
60
+ // Owned by the admission gate (runsGates — the SSOT shared with the
61
+ // start door); the envelope lift is prepareCardParams' own (the
62
+ // compose seat, one owner for both doors — validate + start
63
+ // compose identical params). The id REs stay here
64
+ // (flow-construction semantics, not envelope admission).
65
+ // THE STAGE/FLOW ID SHAPE IS runsGates.FLOW_ID_RE — the admission
66
+ // law the flow arms test before asking the registry, re-exported
67
+ // here so this module's importers keep one address. One declaration
68
+ // in the tree: a second copy is a second answer to "is this a legal
69
+ // id", which closure-gate RULE 4d fails.
70
+ export { FLOW_ID_RE } from "./runsGates.js";
71
+ /** needCardRegistry (start-door-verbatim): the LOUD
72
+ * miswire when the card registry is absent — a card= stage
73
+ * refuses until the cardRegistry stroke slots the defs in. */
74
+ export function needCardRegistry(cards, where) {
75
+ if (cards === null || cards === undefined) {
76
+ throw new Error("[card_registry] no CardRegistryService for " + where +
77
+ " — the registry rides the cards stroke (REBUILD ledger)");
78
+ }
79
+ return cards;
80
+ }
81
+ // ── flow errors (FlowError — the door's 400 language) ─
82
+ export class FlowError extends Error {
83
+ constructor(message) {
84
+ super(message);
85
+ this.name = "FlowError";
86
+ }
87
+ }
88
+ //# sourceMappingURL=runsValidateShared.js.map
@@ -0,0 +1,25 @@
1
+ import type { CardDefinition } from "@melite/comfyui-cordis";
2
+ import type { CardRegistryLike, Flow, FlowStageRow } from "./runsValidateShared.js";
3
+ export type { FlowStageRow };
4
+ export declare function strictBody(body: Record<string, unknown>): void;
5
+ export declare function buildStageRow(i: number, st: unknown): FlowStageRow;
6
+ export declare function wiresResolve(flowId: string, stages: FlowStageRow[]): void;
7
+ export declare function cardGate(flowId: string, st: FlowStageRow, cards?: CardRegistryLike | null): void;
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+ export declare function coerceSnapshotBody(def: CardDefinition | undefined, body: Record<string, unknown>): Record<string, unknown>;
22
+ export declare function kindsOk(flowId: string, stages: FlowStageRow[], engineDefaults: Record<string, string | null>, cards?: CardRegistryLike | null): void;
23
+ export declare function validateEngines(flow: Flow, cards?: CardRegistryLike | null): Flow;
24
+ export declare function flowFromBody(body: unknown, cards?: CardRegistryLike | null): Flow;
25
+ //# sourceMappingURL=runsValidateStages.d.ts.map