@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,30 @@
1
+ import type { ManifestRow } from "./skillPlane.js";
2
+ import type { CardDefinition } from '@melite/comfyui-card-kit/card-definition';
3
+ /** Py-era card dir names (underscores) -> registry ids (hyphens).
4
+ * The three dirs predate the registry; the mapping is closed (a
5
+ * fourth mismatch refuses LOUD at the walk, never a silent skip).
6
+ * A future dir rename deletes the row here. */
7
+ export declare const DIR_ID_ALIASES: Readonly<Record<string, string>>;
8
+ export interface ToolBaseRow {
9
+ readonly name: string;
10
+ readonly version: number;
11
+ readonly kind: string;
12
+ readonly card: string;
13
+ readonly model: string | null;
14
+ readonly stageTitle: string;
15
+ readonly description: string;
16
+ }
17
+ /** The emitted base table, derived from the card registry (parsed
18
+ * per call, never transcribed, never cached at module scope —
19
+ * stroke 2a law; the derivation is cheap beside the schema
20
+ * emission each row already pays). */
21
+ export declare function toolBaseRows(defs: ReadonlyMap<string, CardDefinition>): Map<string, ToolBaseRow>;
22
+ /** Emitted base row for a registered card — LOUD when the card
23
+ * carries no authored prose or no registry entry (the identity
24
+ * fence fires inside the derivation; this throw is the map
25
+ * fence). */
26
+ export declare function baseRowFor(defs: ReadonlyMap<string, CardDefinition>, card: string): ToolBaseRow;
27
+ /** Project one registered card to its served manifest row: the
28
+ * emitted base fields + live params_schema from the registry. */
29
+ export declare function projectCardRow(def: CardDefinition, base: ToolBaseRow): ManifestRow;
30
+ //# sourceMappingURL=toolProjection.d.ts.map
@@ -0,0 +1,142 @@
1
+ // toolProjection.ts — the registry-native card-tool projection,
2
+
3
+ // gateway's doors/toolProjection.ts (killed with the gateway app).
4
+ // THE CARD EMITS THE TOOL: one source end to end (the primed card
5
+ // registry); refusal law — a registered card without authored
6
+ // prose throws LOUD.
7
+
8
+ // dies).
9
+ //
10
+ // ONE source end to end: the primed card registry.
11
+
12
+ // TOOLS_JSON (the hand-owned frozen prose table) dies now.
13
+ // The emitted tool row derives from the card unit itself.
14
+ // Name comes from the id (hyphens to underscores plus _card, the wire spelling the walls pin).
15
+ // The primary model is the first served style value (the same one source the served model enum defaults to).
16
+ // The authored prose comes from the card identity (label and description, the identity rung).
17
+ // Live params_schema comes from emitParamsSchema over the card carrier (the toolsEmit and flowsCard carrier mirror).
18
+ //
19
+ // Refusal law: a registered card without authored prose throws
20
+ // LOUD — never a silent drop, never a generated title.
21
+ import { emitParamsSchema } from "@melite/comfyui-cordis";
22
+ import { cardWireName } from "@melite/comfyui-cordis";
23
+ import { modelsBooted, modelsService } from "@melite/comfyui-cordis";
24
+ import { semanticModelEntries } from "@melite/comfyui-card-kit/semanticModelKnob";
25
+ /** Py-era card dir names (underscores) -> registry ids (hyphens).
26
+ * The three dirs predate the registry; the mapping is closed (a
27
+ * fourth mismatch refuses LOUD at the walk, never a silent skip).
28
+ * A future dir rename deletes the row here. */
29
+ export const DIR_ID_ALIASES = {
30
+ img_to_mesh: "img-to-mesh",
31
+ input_prep: "input-prep",
32
+ mask_studio: "mask-studio",
33
+ };
34
+ /**
35
+ * Derive the served style entries for a boarded list.
36
+ * An unbooted table yields undefined.
37
+ * An unresolvable boarded id yields undefined.
38
+ */
39
+ function semanticEntriesFor(boarded) {
40
+ // The table read needs a booted registry.
41
+ // A cold test process keeps the bare boarded fallback.
42
+ if (!modelsBooted())
43
+ return undefined;
44
+ try {
45
+ const svc = modelsService();
46
+ const decls = [];
47
+ for (const id of boarded) {
48
+ try {
49
+ decls.push(svc.getModel(id));
50
+ }
51
+ catch {
52
+ // An unresolvable boarded id keeps the bare fallback.
53
+ // The compose door refuses it loud with its own voice.
54
+ return undefined;
55
+ }
56
+ }
57
+ // The one spelling lives in semanticModelKnob.
58
+ // No second derivation is spelled here.
59
+ const entries = semanticModelEntries(decls);
60
+ if (entries.length === 0)
61
+ return undefined;
62
+ return entries;
63
+ }
64
+ catch {
65
+ // A table failure keeps the bare fallback.
66
+ // The caller never throws for a missing style.
67
+ return undefined;
68
+ }
69
+ }
70
+ /** The emitted base table, derived from the card registry (parsed
71
+ * per call, never transcribed, never cached at module scope —
72
+ * stroke 2a law; the derivation is cheap beside the schema
73
+ * emission each row already pays). */
74
+ export function toolBaseRows(defs) {
75
+ const out = new Map();
76
+ for (const [id, def] of defs) {
77
+ const identity = def.identity;
78
+ if (identity === undefined ||
79
+ identity.label === "" ||
80
+ identity.description === "") {
81
+ throw new Error(`[tool_projection] registered card ${id} carries no identity ` +
82
+ "(label/description are the authored prose the emitted tool " +
83
+ "serves — declare identity on the card; a generated title " +
84
+ "is the silent drop this fence exists to refuse)");
85
+ }
86
+ out.set(id, {
87
+ name: cardWireName(id),
88
+ version: 1,
89
+ kind: "card-compose",
90
+ card: id,
91
+ // The served default is the first style value.
92
+ // A missing derivation keeps the bare boarded fallback.
93
+ model: semanticEntriesFor(def.boarded)?.[0]?.value ?? def.boarded[0] ?? null,
94
+ stageTitle: identity.label,
95
+ description: identity.description,
96
+ });
97
+ }
98
+ return out;
99
+ }
100
+ /** Emitted base row for a registered card — LOUD when the card
101
+ * carries no authored prose or no registry entry (the identity
102
+ * fence fires inside the derivation; this throw is the map
103
+ * fence). */
104
+ export function baseRowFor(defs, card) {
105
+ const base = toolBaseRows(defs).get(card);
106
+ if (base === undefined) {
107
+ throw new Error(`[tool_projection] card ${card} has no registry entry ` +
108
+ "(the emission walks defs only — a card id the map lacks " +
109
+ "cannot serve a tool)");
110
+ }
111
+ return base;
112
+ }
113
+ /** Project one registered card to its served manifest row: the
114
+ * emitted base fields + live params_schema from the registry. */
115
+ export function projectCardRow(def, base) {
116
+ const carrier = def.schemaCarrier ?? def.schema;
117
+ // The model knob serves the same style entries as the base row.
118
+ // A missing derivation keeps the bare boarded enum.
119
+ const semantic = semanticEntriesFor(def.boarded);
120
+ const paramsSchema = emitParamsSchema(carrier, def.boarded, semantic);
121
+ return {
122
+ name: base.name,
123
+ version: base.version,
124
+ kind: base.kind,
125
+ card: base.card,
126
+ flow: "",
127
+ model: base.model,
128
+ stageTitle: base.stageTitle,
129
+ description: base.description,
130
+ // Verbatim emitter output (an empty required is OMITTED, not
131
+ // [] — the /v1/tools overlay serves the same object).
132
+ paramsSchema: {
133
+ type: paramsSchema.type,
134
+ properties: paramsSchema.properties,
135
+ ...(paramsSchema.required !== undefined
136
+ ? { required: paramsSchema.required }
137
+ : {}),
138
+ },
139
+ hidden: null,
140
+ };
141
+ }
142
+ //# sourceMappingURL=toolProjection.js.map
package/lib/vocab.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export declare const RETIRED_RUNNER_KNOBS: readonly string[];
2
+
3
+ export declare const RETIRED_CARRY_KEYS: readonly string[];
4
+ /** The door vocabulary _strict_body allows past the `_` gate. */
5
+ export declare const DOOR_KEYS: readonly string[];
6
+ //# sourceMappingURL=vocab.d.ts.map
package/lib/vocab.js ADDED
@@ -0,0 +1,18 @@
1
+ // vocab.ts — the submit-body vocabulary (Vocab SSOT, ledger row 27
2
+
3
+ // ONCE in gateway-core params.ts; that package is dead, and the
4
+
5
+ export const RETIRED_RUNNER_KNOBS = [
6
+ "start_from",
7
+ "stop_after",
8
+ "reuse_run_id",
9
+ "partial_run",
10
+ "overrides",
11
+ "since",
12
+ "from_index",
13
+ ];
14
+
15
+ export const RETIRED_CARRY_KEYS = ["pipe", "stage_id"];
16
+ /** The door vocabulary _strict_body allows past the `_` gate. */
17
+ export const DOOR_KEYS = ["yaml", "flow", "flow_inline", "model"];
18
+ //# sourceMappingURL=vocab.js.map
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@melite/estate-queue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.5-pre-alpha",
4
+ "license": "SSPL-1.0",
5
+ "type": "module",
6
+ "description": "The serial run queue as a host Cordis service (REBUILD-5 of the gateway kill): lock-first single-writer, sidecar/ledger I/O, reproduce/resume refusal arms, run-status probe slot. No doors, no routes, no port — the runs remote exposes the lanes over this seat.",
7
+ "dependencies": {
8
+ "@deepseek-ai/cordis-plugin-timer": "1.1.6",
9
+ "@deepseek-ai/dsh-atomic-write": "0.2.0-rc.1",
10
+ "@deepseek-ai/dsh-brand": "0.2.0-rc.1",
11
+ "@deepseek-ai/dsh-home-paths": "0.2.0-rc.1",
12
+ "@deepseek-ai/dsh-timeout": "0.2.0-rc.1",
13
+ "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.1",
14
+ "@deepseek-ai/dsh-util-values": "0.2.0-rc.1",
15
+ "@deepseek-ai/schemastery": "^3.18.4",
16
+ "@melite/comfyui-card-kit": "0.1.5-pre-alpha",
17
+ "@melite/comfyui-cordis": "0.1.5-pre-alpha",
18
+ "@melite/contracts": "0.1.5-pre-alpha",
19
+ "@melite/engine-contract": "0.1.5-pre-alpha",
20
+ "@melite/estate-drafts": "0.1.5-pre-alpha",
21
+ "@melite/estate-provisioning": "0.1.5-pre-alpha"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^22.20.0",
25
+ "typescript": "^5.9.3",
26
+ "@deepseek-ai/cordis": "^4.0.4"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./lib/index.d.ts",
31
+ "default": "./lib/index.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
35
+ "peerDependencies": {
36
+ "@deepseek-ai/cordis": "^4.0.4"
37
+ },
38
+ "files": [
39
+ "lib/index.js",
40
+ "lib/**/*.js",
41
+ "lib/**/*.d.ts"
42
+ ],
43
+ "scripts": {
44
+ "build": "tsc -p tsconfig.build.json",
45
+ "typecheck": "tsc --noEmit"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ }
50
+ }