@melite/estate-queue 0.1.4-alpha → 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.
- package/README.md +55 -0
- package/lib/bench.d.ts +19 -11
- package/lib/bench.js +47 -57
- package/lib/cardsArmError.d.ts +45 -2
- package/lib/cardsArmError.js +28 -4
- package/lib/cardsCompose.d.ts +13 -1
- package/lib/cardsCompose.js +109 -61
- package/lib/cardsDangling.d.ts +2 -2
- package/lib/cardsDangling.js +82 -37
- package/lib/cardsFacts.d.ts +16 -3
- package/lib/cardsFacts.js +14 -0
- package/lib/cardsLanes.d.ts +12 -2
- package/lib/cardsLanes.js +73 -10
- package/lib/cardsRegistry.d.ts +93 -5
- package/lib/cardsRegistry.js +323 -54
- package/lib/cardsVariant.d.ts +10 -1
- package/lib/cardsVariant.js +66 -13
- package/lib/discloseRegistry.d.ts +6 -5
- package/lib/discloseRegistry.js +11 -9
- package/lib/flowsData.d.ts +67 -12
- package/lib/flowsData.js +230 -104
- package/lib/flowsFamilyCompose.d.ts +5 -8
- package/lib/flowsFamilyCompose.js +13 -13
- package/lib/flowsParamsOverlay.d.ts +55 -0
- package/lib/flowsParamsOverlay.js +197 -0
- package/lib/flowsRegistryRows.d.ts +3 -1
- package/lib/flowsRegistryRows.js +148 -6
- package/lib/index.d.ts +0 -3
- package/lib/index.js +14 -5
- package/lib/lifecycleLatch.d.ts +16 -0
- package/lib/lifecycleLatch.js +42 -0
- package/lib/loadPlane.d.ts +3 -2
- package/lib/loadPlane.js +25 -8
- package/lib/loadRegistry.js +1 -1
- package/lib/manageOps.d.ts +8 -2
- package/lib/manageOps.js +26 -6
- package/lib/managePlane.d.ts +31 -0
- package/lib/managePlane.js +360 -85
- package/lib/manageProbe.d.ts +1 -10
- package/lib/manageProbe.js +18 -7
- package/lib/manageRegistry.d.ts +42 -4
- package/lib/manageRegistry.js +45 -7
- package/lib/mediaKinds.d.ts +1 -1
- package/lib/mediaKinds.js +1 -1
- package/lib/queue.js +14 -10
- package/lib/queueCore.d.ts +7 -4
- package/lib/queueCore.js +9 -5
- package/lib/queueLifecycle.d.ts +0 -24
- package/lib/queueLifecycle.js +9 -63
- package/lib/queueLock.d.ts +8 -2
- package/lib/queueLock.js +9 -6
- package/lib/queueSidecar.d.ts +4 -0
- package/lib/queueSidecar.js +1 -0
- package/lib/queueSubmit.d.ts +61 -10
- package/lib/queueSubmit.js +120 -46
- package/lib/queueSweep.js +13 -2
- package/lib/runsChange.d.ts +8 -0
- package/lib/runsChange.js +21 -5
- package/lib/runsErrorCodes.d.ts +1 -1
- package/lib/runsErrorCodes.js +33 -0
- package/lib/runsExecute.d.ts +26 -0
- package/lib/runsExecute.js +143 -5
- package/lib/runsGates.js +4 -3
- package/lib/runsList.js +13 -19
- package/lib/runsRefusalVoices.js +52 -0
- package/lib/runsRegistry.d.ts +105 -7
- package/lib/runsRegistry.js +744 -100
- package/lib/runsSourceEcho.d.ts +27 -0
- package/lib/runsSourceEcho.js +84 -18
- package/lib/runsStart.d.ts +56 -14
- package/lib/runsStart.js +184 -45
- package/lib/runsTypes.d.ts +35 -0
- package/lib/runsTypes.js +7 -0
- package/lib/runsValidateArms.js +61 -7
- package/lib/runsValidateServe.d.ts +2 -2
- package/lib/runsValidateServe.js +26 -4
- package/lib/runsValidateShared.d.ts +1 -1
- package/lib/runsValidateStages.d.ts +10 -3
- package/lib/runsValidateStages.js +23 -3
- package/lib/service.d.ts +24 -6
- package/lib/service.js +19 -11
- package/lib/skillFs.d.ts +9 -4
- package/lib/skillFs.js +12 -14
- package/lib/skillPlane.d.ts +3 -2
- package/lib/skillPlane.js +12 -6
- package/lib/skillRegistry.js +1 -1
- package/lib/skillRows.d.ts +4 -3
- package/lib/skillRows.js +14 -12
- package/lib/toolProjection.d.ts +1 -1
- package/lib/toolProjection.js +1 -1
- package/package.json +8 -7
- package/lib/runStatus.d.ts +0 -7
- package/lib/runStatus.js +0 -21
package/lib/manageOps.js
CHANGED
|
@@ -106,10 +106,19 @@ export function estateOnly(req, cfg) {
|
|
|
106
106
|
throw new Refused(409, "byo endpoint: " + req.action + " orchestrates the estate engine — the estate never touches a user-owned ComfyUI");
|
|
107
107
|
}
|
|
108
108
|
// ── systemd orchestration (estate deployment — TS-native) ──────────
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
|
|
110
|
+
// frozen before any plugin loads; it is now the manage provider's
|
|
111
|
+
// config field, resolved per mount.
|
|
112
|
+
/** Run systemctl for the estate's engine unit.
|
|
113
|
+
* @param req - the manage request (envelope rows).
|
|
114
|
+
* @param verb - the systemctl verb to run.
|
|
115
|
+
* @param unit - the estate deployment's systemd unit (config-pinned).
|
|
116
|
+
* @param signal - aborts the child and maps to the abort reason.
|
|
117
|
+
* @returns [status, envelope] as the manage lane's answer.
|
|
118
|
+
*/
|
|
119
|
+
export async function systemctl(req, verb, unit, signal) {
|
|
111
120
|
try {
|
|
112
|
-
await execFileAsync("systemctl", ["--user", verb,
|
|
121
|
+
await execFileAsync("systemctl", ["--user", verb, unit], {
|
|
113
122
|
timeout: 30 * 1000,
|
|
114
123
|
encoding: "utf8",
|
|
115
124
|
signal,
|
|
@@ -120,12 +129,12 @@ export async function systemctl(req, verb, signal) {
|
|
|
120
129
|
throw abortReason(signal);
|
|
121
130
|
const value = error;
|
|
122
131
|
const why = String(value.stderr ?? value.message).trim().slice(0, 200);
|
|
123
|
-
return [500, { action: req.action, ok: false, detail: "systemctl " + verb + " " +
|
|
132
|
+
return [500, { action: req.action, ok: false, detail: "systemctl " + verb + " " + unit + " failed: " + why }];
|
|
124
133
|
}
|
|
125
134
|
return [200, {
|
|
126
135
|
action: req.action,
|
|
127
136
|
ok: true,
|
|
128
|
-
detail: verb + " issued for " +
|
|
137
|
+
detail: verb + " issued for " + unit,
|
|
129
138
|
next_action: verb === "stop" ? "launch" : "status",
|
|
130
139
|
data: { next_action: verb === "stop" ? "launch" : "status" },
|
|
131
140
|
}];
|
|
@@ -133,10 +142,21 @@ export async function systemctl(req, verb, signal) {
|
|
|
133
142
|
export function guardLifecycle(req, ctx) {
|
|
134
143
|
if (req.force)
|
|
135
144
|
return;
|
|
136
|
-
const active = activeRuns();
|
|
145
|
+
const active = activeRuns(ctx.stateRoots);
|
|
137
146
|
if (active.length > 0) {
|
|
138
147
|
throw new Refused(409, "refused: " + active.length + " active run(s) (" + active.slice(0, 4).join(", ") +
|
|
139
148
|
") — stop them first (the stop door) or pass force=true");
|
|
140
149
|
}
|
|
150
|
+
|
|
151
|
+
// locks — a teardown during an in-flight fetch unloaded VRAM under
|
|
152
|
+
// a landing fetch or failed it mid-stream. The seat's sync census
|
|
153
|
+
// (locks plus pre-lock mints) joins the refusal: a seat without the
|
|
154
|
+
// probe reads as idle (the optional-seat posture). Synchronous by
|
|
155
|
+
// law — the guard never awaits.
|
|
156
|
+
const inflight = ctx.provisioning?.inflightAcquires?.() ?? [];
|
|
157
|
+
if (inflight.length > 0) {
|
|
158
|
+
throw new Refused(409, "refused: " + inflight.length + " in-flight acquisition(s) (" + inflight.slice(0, 4).join(", ") +
|
|
159
|
+
") — wait for the fetch to land (poll acquire_weight) or pass force=true", { state: "conflict", next_action: "status" });
|
|
160
|
+
}
|
|
141
161
|
}
|
|
142
162
|
//# sourceMappingURL=manageOps.js.map
|
package/lib/managePlane.d.ts
CHANGED
|
@@ -22,10 +22,25 @@ export interface ManageEnvelope {
|
|
|
22
22
|
misses?: string[];
|
|
23
23
|
partial?: boolean;
|
|
24
24
|
restart_required?: boolean;
|
|
25
|
+
retry_after_ms?: number;
|
|
25
26
|
}
|
|
26
27
|
export interface ManageCtx {
|
|
27
28
|
/** File-anchored repo root (routing, catalog, runs scan anchor). */
|
|
28
29
|
repoRoot: string;
|
|
30
|
+
/** The §23 cross-roots manifest (own state root first, then the
|
|
31
|
+
* stateRoots config extras): the runs-probe rows (restart
|
|
32
|
+
* guard, status) walk these trees — one law from the queue
|
|
33
|
+
* seat, never the retired env seam (J12). */
|
|
34
|
+
stateRoots: readonly string[];
|
|
35
|
+
/** The estate deployment's systemd unit (V7 cure: the manage
|
|
36
|
+
* provider's config field — systemctl/journalctl/status rows all
|
|
37
|
+
* read this one value, never an import-time env capture). */
|
|
38
|
+
comfyUnit: string;
|
|
39
|
+
/** The lane's provisioning posture (the manage provider's config
|
|
40
|
+
* field): true tells the deck the DECLARED arms run without the
|
|
41
|
+
* operator confirm — the raw-URL arms stay operator-gated in the
|
|
42
|
+
* deck's own gate regardless of this value. */
|
|
43
|
+
autoProvision: boolean;
|
|
29
44
|
/** The endpoint config, re-read per call (fresh — never cached
|
|
30
45
|
* between calls): carries the engine url the manager rail rides.
|
|
31
46
|
* The bridges door passes loadEndpointConfig itself. */
|
|
@@ -66,6 +81,13 @@ export interface ManageCtx {
|
|
|
66
81
|
|
|
67
82
|
|
|
68
83
|
objectInfo?: () => Promise<unknown>;
|
|
84
|
+
/** THE WEIGHT-LANDING RE-ARM (the cards-plane batch): called after
|
|
85
|
+
* a model lands under a living process (provision_model,
|
|
86
|
+
* download_model, an acquire_weight poll observing a terminal
|
|
87
|
+
* state) so the card registry's presence cache re-derives on its
|
|
88
|
+
* next read. Optional: a lane without the estate card registry
|
|
89
|
+
* has no presence face to re-arm. */
|
|
90
|
+
rearmWeights?: () => void;
|
|
69
91
|
}
|
|
70
92
|
|
|
71
93
|
|
|
@@ -86,6 +108,11 @@ export interface Req {
|
|
|
86
108
|
action: ManageAction;
|
|
87
109
|
nodes: string[];
|
|
88
110
|
url: string;
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
ref: string;
|
|
89
116
|
relative_path: string;
|
|
90
117
|
filename: string;
|
|
91
118
|
wait: boolean | null;
|
|
@@ -99,6 +126,10 @@ export interface Req {
|
|
|
99
126
|
target: string;
|
|
100
127
|
extra_args: string[];
|
|
101
128
|
force: boolean;
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
operator_confirmed: boolean;
|
|
102
133
|
snapshot: string;
|
|
103
134
|
path: string;
|
|
104
135
|
data: string;
|