@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,179 @@
1
+ /** One initial edge: {"initial": key} (the operator-supplied wire). */
2
+ export interface RegistryInitialEdge {
3
+ readonly initial: string;
4
+ }
5
+ /** One stage edge: {"stage": id, "output": name} (an earlier stage). */
6
+ export interface RegistryStageEdge {
7
+ readonly stage: string;
8
+ readonly output: string;
9
+ }
10
+ export type RegistryEdge = RegistryInitialEdge | RegistryStageEdge;
11
+ /** A from_flow row (Stage.from_flow — the live reference): the
12
+ * stage is COPIED from the named flow's stage at expansion time
13
+ * (id overridden, inputs overridden), so the source stays the
14
+ * single truth — never a snapshot. */
15
+ export interface RegistryFromFlow {
16
+ readonly flow: string;
17
+ readonly stage: string;
18
+ }
19
+ /** One authoring-stage row (the Stage(...) fields, JSON-shaped).
20
+ * A stage is composed by exactly one of three planes: a card
21
+ * (card ≠ "" — the card plane's dispatch), a family action
22
+ * (family + action ≠ "" — the family's DECL composes the nodes at
23
+ * expansion; flowsFamilyCompose owns that interpreter), or an
24
+ * engine verb (engine ≠ the card-plane engine — craft/agent
25
+ * stages the runs door drives directly). A card-plane-engine
26
+ * stage naming neither card nor family action is the retired
27
+ * raw-workflow shape: expandRegistryFlow refuses it, named. */
28
+ export interface RegistryStage {
29
+ readonly id: string;
30
+ readonly engine: string;
31
+ readonly card: string;
32
+ readonly family: string;
33
+ readonly action: string;
34
+ readonly description: string;
35
+ readonly inputs: Record<string, RegistryEdge>;
36
+ readonly expected: Record<string, string>;
37
+ readonly outputs: Record<string, string>;
38
+ readonly cardIo: Record<string, string>;
39
+ readonly params: Record<string, unknown>;
40
+ readonly skipWhen: {
41
+ readonly initial: string;
42
+ readonly when: string;
43
+ } | null;
44
+ readonly fromFlow: RegistryFromFlow | null;
45
+ }
46
+ /** The compile-time initial kinds (flow.initial_validators). */
47
+ export type RegistryInitialKind = "photo" | "glb" | "bake_params" | "text";
48
+ /** One headless-tool overlay (FlowToolOverlay: tool param -> the
49
+ * stage doc path it stamps, with the value choices map). */
50
+ export interface RegistryToolOverlay {
51
+ readonly param: string;
52
+ readonly stage: string;
53
+ readonly path: readonly string[];
54
+ readonly choices: Record<string, string> | null;
55
+ }
56
+ /** One headless-tool property (FlowToolProperty). */
57
+ export interface RegistryToolProperty {
58
+ readonly ptype: string;
59
+ readonly description: string;
60
+ readonly default: unknown;
61
+ readonly hasDefault: boolean;
62
+ readonly minimum: number | null;
63
+ readonly maximum: number | null;
64
+ readonly enum: readonly string[] | null;
65
+ }
66
+ /** The headless surface (FlowTool: name + version + schema +
67
+ * required + overlays). Absent (null) on flows with no tool=. */
68
+ export interface RegistryTool {
69
+ readonly name: string;
70
+ readonly version: number;
71
+ readonly description: string;
72
+ readonly properties: Record<string, RegistryToolProperty>;
73
+ readonly required: readonly string[];
74
+ readonly overlays: readonly RegistryToolOverlay[];
75
+ }
76
+ /** One named flow (the Flow(...) declaration, JSON-shaped). */
77
+ export interface RegistryFlow {
78
+ readonly id: string;
79
+ readonly description: string;
80
+ readonly stages: readonly RegistryStage[];
81
+ readonly initialValidators: Record<string, RegistryInitialKind>;
82
+ /** Initial names this flow cannot run without. An OPTIONAL initial
83
+ * rides absent (the $channel/branch arms own it); a REQUIRED one
84
+ * refuses at the door, before a run registers, so a verb whose
85
+ * graph needs the value (the fit verb's bone — the vendor's row
86
+ * gate refuses an empty one) never reaches the engine to fail
87
+ * there. */
88
+ readonly requiredInitials?: readonly string[];
89
+ readonly tool: RegistryTool | null;
90
+ readonly skillRefs: readonly string[];
91
+ }
92
+ export declare function initial(key: string): RegistryInitialEdge;
93
+ export declare function fromStage(stage: string, output: string): RegistryStageEdge;
94
+ export declare function plainStage(row: {
95
+ readonly id: string;
96
+ readonly engine: string;
97
+ readonly card?: string;
98
+ readonly family?: string;
99
+ readonly action?: string;
100
+ readonly description: string;
101
+ readonly inputs: Record<string, RegistryEdge>;
102
+ readonly expected?: Record<string, string>;
103
+ readonly outputs?: Record<string, string>;
104
+ readonly cardIo?: Record<string, string>;
105
+ readonly params: Record<string, unknown>;
106
+ readonly skipWhen?: {
107
+ readonly initial: string;
108
+ readonly when: string;
109
+ } | null;
110
+ }): RegistryStage;
111
+ export declare function linkedStage(flow: string, stage: string, id: string, inputs: Record<string, RegistryEdge>): RegistryStage;
112
+ /** Register one flow into the live seat. LOUD: a duplicate id
113
+ * refuses (one owner per flow id — the same interlock as cards and
114
+ * model families). Returns the disposer; call it and the flow is
115
+ * gone from every read below. */
116
+ export declare function registerRegistryFlow(flow: RegistryFlow): () => void;
117
+ /** All registered flow names (the flow.scan_flow_ids order — sorted;
118
+ * the live seat, so a hot registration is visible at once). */
119
+ export declare function registryFlowNames(): string[];
120
+ /** The raw (unexpanded) declaration, or undefined for unknown names. */
121
+ export declare function getRegistryFlow(name: string): RegistryFlow | undefined;
122
+ /** Resolve every fromFlow row against its source flow (Stage.from_flow
123
+ * verbatim: the source row's engine/card/description/expected/
124
+ * outputs/card_io/params ride; the link's id + inputs win). Throws
125
+ * LOUD on a dangling link (authoring bug — never a silent row). */
126
+ export declare function expandRegistryFlow(flow: RegistryFlow): RegistryFlow;
127
+
128
+
129
+
130
+
131
+ export declare function inlineStagesNameCards(doc: Record<string, unknown>): boolean;
132
+ /** The registry flow as a flow_from_body-shaped inline doc (the
133
+ * validate compile + start shim both ride the EXISTING inline
134
+ * pipelines — no second validator). Card rows ride card/card_io;
135
+ * skip_when rides verbatim. */
136
+ export declare function registryFlowToInline(flow: RegistryFlow): Record<string, unknown>;
137
+ export interface InitialsRoots {
138
+ readonly repoRoot: string;
139
+ readonly stateRoot: string;
140
+ }
141
+ /** The compile-time gate over a registry flow's initial_validators:
142
+ * the first refusal text, or null when every PRESENT initial
143
+ * passes (absent initials ride — the $channel/branch arms own
144
+ * them). Runs BEFORE any run registers, on both doors. */
145
+ export declare function registryInitialsError(flow: RegistryFlow, body: Record<string, unknown>, roots: InitialsRoots): string | null;
146
+ /** The initial VALUE one gate-blessed body entry carries, in the
147
+ * string form the engine merge links a $spell against: file
148
+ * initials give their path ({path: …} unwraps — the two spellings
149
+ * the gate blesses), bake_params gives its params_json string
150
+ * (objects stringify — the dialect the belt validates). Null
151
+ * refuses a shape the gate would have refused, so a mangled
152
+ * durable body fails loud at the door instead of shipping an
153
+ * "[object Object]" literal to the engine.
154
+ * @param key the initial's declared name, for the refusal voice
155
+ * @param kind the declared validator kind
156
+ * @param value the raw body entry
157
+ * @returns the normalized string, or null when the shape is neither */
158
+ export declare function normalizedInitialValue(key: string, kind: RegistryInitialKind, value: unknown): string | null;
159
+ /** The request initials a body carries for a flow's declared
160
+ * validators, normalized per {@link normalizedInitialValue}:
161
+ * declared keys, present values only; absent stays absent (the
162
+ * $channel/branch arms own those). First refusal text, or null
163
+ * when every present value normalizes. Both start doors (the
164
+ * flow arm and the flow_inline replay arm, which recovers the
165
+ * declaration from the inline doc's registry id) call this —
166
+ * the replayed durable body re-extracts the same values the
167
+ * original start extracted, so a queued run that reboots mid-
168
+ * queue keeps its $spells linkable at the engine merge.
169
+ * @param flow the declaration whose initialValidators own the keys
170
+ * @param body the request body
171
+ * @returns the normalized initials record, or a refusal string */
172
+ export declare function extractRequestInitials(flow: RegistryFlow, body: Record<string, unknown>): {
173
+ initials: Record<string, string>;
174
+ } | {
175
+ refusal: string;
176
+ };
177
+ /** Render one registry flow as its skill-body text. */
178
+ export declare function registrySkillBody(flow: RegistryFlow): string;
179
+ //# sourceMappingURL=flowsData.d.ts.map