@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/runsList.js
CHANGED
|
@@ -15,7 +15,7 @@ import { servableLeaf } from "@melite/contracts/mediaKinds";
|
|
|
15
15
|
// on their stroke.
|
|
16
16
|
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
17
17
|
import { join } from "node:path";
|
|
18
|
-
import { mediaVocab } from "./mediaKinds.js";
|
|
18
|
+
import { mediaKindOf, mediaVocab } from "./mediaKinds.js";
|
|
19
19
|
import { engineFilmName } from "./filmLead.js";
|
|
20
20
|
/** Leading-int read (sidecar tails): optional space, optional
|
|
21
21
|
* sign, then digits; 0 when no digits lead. */
|
|
@@ -105,22 +105,14 @@ export function sidecarStrFound(raw, key, cap) {
|
|
|
105
105
|
return [true, Buffer.from(out).toString("utf8")];
|
|
106
106
|
}
|
|
107
107
|
export function artifactType(name) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return "video";
|
|
117
|
-
if (kinds.model.includes(ext))
|
|
118
|
-
return "model";
|
|
119
|
-
if (ext === "json")
|
|
120
|
-
return "spec";
|
|
121
|
-
if (ext === "txt" || ext === "md" || ext === "yaml")
|
|
122
|
-
return "text";
|
|
123
|
-
return "file";
|
|
108
|
+
|
|
109
|
+
// ext table (json→spec, txt/md/yaml→text) pre-dated the vocab's
|
|
110
|
+
// text kind and minted types the list loop then DROPPED — a
|
|
111
|
+
// tagger's tags.txt never listed. The contract's mediaKindOf is
|
|
112
|
+
// the one answer now; a non-media name answers "file" and the
|
|
113
|
+
// callers' own gates keep deciding what lists.
|
|
114
|
+
const k = mediaKindOf(name);
|
|
115
|
+
return k ?? "file";
|
|
124
116
|
}
|
|
125
117
|
/** Byte-wise name order (the sort runs on the surrogateescape bytes — for valid UTF-8, Buffer.compare on the re-encoded name is the same bytes; D5). */
|
|
126
118
|
function byteLess(a, b) {
|
|
@@ -218,7 +210,7 @@ export function runArtifacts(runDir, outDirLiteral) {
|
|
|
218
210
|
if (imgs > maxImgs)
|
|
219
211
|
continue;
|
|
220
212
|
}
|
|
221
|
-
else if (t === "video" || t === "audio" || t === "model") {
|
|
213
|
+
else if (t === "video" || t === "audio" || t === "model" || t === "text") {
|
|
222
214
|
mediaTotal++;
|
|
223
215
|
}
|
|
224
216
|
else {
|
|
@@ -275,7 +267,8 @@ export function runDirHasMedia(runDir) {
|
|
|
275
267
|
return (kinds.galleryVideo.includes(ext) ||
|
|
276
268
|
kinds.galleryImage.includes(ext) ||
|
|
277
269
|
kinds.galleryAudio.includes(ext) ||
|
|
278
|
-
kinds.galleryModel.includes(ext)
|
|
270
|
+
kinds.galleryModel.includes(ext) ||
|
|
271
|
+
kinds.galleryText.includes(ext));
|
|
279
272
|
};
|
|
280
273
|
let names;
|
|
281
274
|
try {
|
|
@@ -326,6 +319,7 @@ const ARTIFACT_TYPE = new Set([
|
|
|
326
319
|
"video",
|
|
327
320
|
"audio",
|
|
328
321
|
"model",
|
|
322
|
+
"text",
|
|
329
323
|
]);
|
|
330
324
|
function isIntGe0(v) {
|
|
331
325
|
return typeof v === "number" && Number.isInteger(v) && v >= 0;
|
package/lib/runsRefusalVoices.js
CHANGED
|
@@ -11,8 +11,53 @@ function refusalEnvelopeOf(err) {
|
|
|
11
11
|
p["expected"] = err.expected;
|
|
12
12
|
if (err.got !== undefined)
|
|
13
13
|
p["got"] = err.got;
|
|
14
|
+
if (err.lane !== undefined) {
|
|
15
|
+
const lane = err.lane;
|
|
16
|
+
p["family"] = lane.family;
|
|
17
|
+
p["slot"] = lane.slot;
|
|
18
|
+
p["missing"] = lane.missing;
|
|
19
|
+
p["folders"] = [...lane.folders];
|
|
20
|
+
if (lane.fetchUrl !== undefined)
|
|
21
|
+
p["fetch_url"] = lane.fetchUrl;
|
|
22
|
+
p["kind"] = lane.kind;
|
|
23
|
+
}
|
|
14
24
|
return p;
|
|
15
25
|
}
|
|
26
|
+
/** The lane-miss row's structured details, read back off the
|
|
27
|
+
* envelope. A lane_input_missing refusal without the structured
|
|
28
|
+
* evidence is a bug at the throw site — LOUD, never a popup keyed
|
|
29
|
+
* on prose (the fold's law: unmapped or malformed is thrown,
|
|
30
|
+
* never a silent generic). */
|
|
31
|
+
function laneDetailsOf(p) {
|
|
32
|
+
const family = p["family"];
|
|
33
|
+
const slot = p["slot"];
|
|
34
|
+
const missing = p["missing"];
|
|
35
|
+
const folders = p["folders"];
|
|
36
|
+
const kind = p["kind"];
|
|
37
|
+
if (typeof family !== "string" || typeof slot !== "string"
|
|
38
|
+
|| typeof missing !== "string" || !Array.isArray(folders)
|
|
39
|
+
|| (kind !== "model" && kind !== "extension")) {
|
|
40
|
+
throw new Error("runs remote: lane_input_missing refusal lacks its structured artifact (family/slot/missing/folders/kind)");
|
|
41
|
+
}
|
|
42
|
+
const fetchUrl = p["fetch_url"];
|
|
43
|
+
const loc = p["loc"];
|
|
44
|
+
const expected = p["expected"];
|
|
45
|
+
const got = p["got"];
|
|
46
|
+
return {
|
|
47
|
+
// THE ROW EXTENDS RunsRefusalDetails: the bench arm's loc-carry
|
|
48
|
+
// reads these three off the mapped details — a lane refusal that
|
|
49
|
+
// set them must survive the fold like every other refusal's.
|
|
50
|
+
...(typeof loc === "string" && loc !== "" ? { loc } : {}),
|
|
51
|
+
...(typeof expected === "string" ? { expected } : {}),
|
|
52
|
+
...(typeof got === "string" ? { got } : {}),
|
|
53
|
+
family,
|
|
54
|
+
slot,
|
|
55
|
+
missing,
|
|
56
|
+
folders: folders.filter((f) => typeof f === "string"),
|
|
57
|
+
...(typeof fetchUrl === "string" && fetchUrl !== "" ? { fetch_url: fetchUrl } : {}),
|
|
58
|
+
kind,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
16
61
|
export function cardRefusal(err) {
|
|
17
62
|
return {
|
|
18
63
|
status: err.status,
|
|
@@ -28,6 +73,13 @@ export function toRemoteError(r) {
|
|
|
28
73
|
// a silent generic.
|
|
29
74
|
throw new Error("runs remote: unmapped refusal code " + p["code"]);
|
|
30
75
|
}
|
|
76
|
+
// THE LANE-MISS ROW CARRIES ITS ARTIFACT (the details map's
|
|
77
|
+
// typed row forces the branch): the popup keys on the fields,
|
|
78
|
+
// so the fold reads them back off the envelope and refuses a
|
|
79
|
+
// malformed one loud.
|
|
80
|
+
if (mapped === "runs/lane-input-missing") {
|
|
81
|
+
return new RemoteError(mapped, p["error"], laneDetailsOf(p));
|
|
82
|
+
}
|
|
31
83
|
const details = {};
|
|
32
84
|
if (p["loc"] !== undefined)
|
|
33
85
|
details["loc"] = p["loc"];
|
package/lib/runsRegistry.d.ts
CHANGED
|
@@ -15,6 +15,18 @@ export interface RunsRefusalDetails {
|
|
|
15
15
|
readonly expected?: string;
|
|
16
16
|
readonly got?: string;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export interface LaneInputMissingDetails extends RunsRefusalDetails {
|
|
23
|
+
readonly family: string;
|
|
24
|
+
readonly slot: string;
|
|
25
|
+
readonly missing: string;
|
|
26
|
+
readonly folders: readonly string[];
|
|
27
|
+
readonly fetch_url?: string;
|
|
28
|
+
readonly kind: "model" | "extension";
|
|
29
|
+
}
|
|
18
30
|
declare module "@deepseek-ai/dsh-typert-protocol" {
|
|
19
31
|
interface RemoteErrorDetailsMap {
|
|
20
32
|
/** The start body is not a JSON object (bad_envelope/body). */
|
|
@@ -37,15 +49,23 @@ declare module "@deepseek-ai/dsh-typert-protocol" {
|
|
|
37
49
|
"runs/workflow-pin": RunsRefusalDetails & {
|
|
38
50
|
readonly errors?: unknown;
|
|
39
51
|
};
|
|
40
|
-
"runs/card-compose": RunsRefusalDetails
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
"runs/card-compose": RunsRefusalDetails;
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
"runs/card-compose-incomplete": RunsRefusalDetails;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
"runs/lane-input-missing": LaneInputMissingDetails;
|
|
45
65
|
|
|
46
66
|
|
|
47
67
|
|
|
48
|
-
"runs/
|
|
68
|
+
"runs/lifecycle-inflight": RunsRefusalDetails;
|
|
49
69
|
|
|
50
70
|
"runs/unknown-run": {
|
|
51
71
|
readonly runId: string;
|
|
@@ -88,6 +108,10 @@ export declare function benchWiring(benchDoc: Record<string, unknown>): {
|
|
|
88
108
|
self: string[];
|
|
89
109
|
};
|
|
90
110
|
export declare class RunsRuntimeService extends Service {
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
private static readonly PRESS_MEMORY_MAX;
|
|
91
115
|
static inject: string[];
|
|
92
116
|
/** The pump reentrancy guard (door-verbatim — a public field:
|
|
93
117
|
* cordis proxies services, and private #fields do not cross the
|
|
@@ -200,6 +224,17 @@ export declare class RunsRuntimeService extends Service {
|
|
|
200
224
|
status: string;
|
|
201
225
|
queue_position: number;
|
|
202
226
|
}>;
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
private pressReplay;
|
|
233
|
+
/** THE START ARMS under a settled replay/reservation verdict: the
|
|
234
|
+
* bench-composed arm and the flow_inline arm, behavior-verbatim
|
|
235
|
+
* from before the concurrent-press cure split them behind the
|
|
236
|
+
* shell (the split's only edits are the two summary settles). */
|
|
237
|
+
private startReserved;
|
|
203
238
|
/** The list arm (REBUILD-7): the restore-port envelope over the
|
|
204
239
|
* output roots. The raw limit STRING rides from the lane (strict
|
|
205
240
|
* int() semantics: underscores parse, junk refuses). The drafts
|
|
@@ -236,7 +271,46 @@ export declare class RunsRuntimeService extends Service {
|
|
|
236
271
|
private diskRunRow;
|
|
237
272
|
/** The envelope walk with the AWAITED draft probe (door order
|
|
238
273
|
* preserved: the probe sits between malformed and unknown). */
|
|
239
|
-
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
private readonly presses;
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
private readonly pendingPresses;
|
|
289
|
+
/** The caller's verdict at the press gate: null when it becomes
|
|
290
|
+
* the minter (its entry is registered before this returns); the
|
|
291
|
+
* in-flight promise when a concurrent mint owns the key — the
|
|
292
|
+
* twin awaits and answers with the SAME summary or refusal. */
|
|
293
|
+
private reservePress;
|
|
294
|
+
/** The minter's summary settles the twin (no-op without a press —
|
|
295
|
+
* the door's return sites serve both keyed and keyless starts). */
|
|
296
|
+
private resolvePress;
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
private failPress;
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
private awaitTwin;
|
|
313
|
+
private rememberPress;
|
|
240
314
|
/** Kick the serial pump (door-verbatim guard). */
|
|
241
315
|
private kick;
|
|
242
316
|
/** The serial worker: claim the FIFO head, execute, settle —
|
|
@@ -250,4 +324,28 @@ export declare class RunsRuntimeService extends Service {
|
|
|
250
324
|
/** Terminal settle (queue core row + the settle persist). */
|
|
251
325
|
private settle;
|
|
252
326
|
}
|
|
327
|
+
/** THE SETTLE MIRROR (pure — the walls' seam, bench-trail/runs-remote
|
|
328
|
+
* W4–W8): per draft stage, the terminal outcome patch the runs seat
|
|
329
|
+
* mirrors into the draft doc at settle, with no browser tab alive.
|
|
330
|
+
*
|
|
331
|
+
* Identity: the DRAFT row id (benchStageId, the compose's stamp) —
|
|
332
|
+
* the run row's `id` may be the card skeleton's, a namespace the
|
|
333
|
+
* draft doc never heard of (draft.ts's own admission). Legacy rows
|
|
334
|
+
* without the stamp fall back to `id`.
|
|
335
|
+
*
|
|
336
|
+
* Words: the draft row's terminal vocabulary. completed→done (the
|
|
337
|
+
* client's word, cards-resource tileStatusFromVerdict),
|
|
338
|
+
* failed→failed, stopped→stopped; a STOPPED run's untouched
|
|
339
|
+
* (queued/pending/running) stage rows mirror the run's word — the
|
|
340
|
+
* queued-stop arm settles without stamping stages (the defect-hunt
|
|
341
|
+
* §1 P1: the closed-tab row would read running forever).
|
|
342
|
+
*
|
|
343
|
+
* The result face: run_id always; the run-relative media url of the
|
|
344
|
+
* stage's own output when one exists (the husk clobber's other
|
|
345
|
+
* half — a bookkeeping mirror never blanks a hero it can name); the
|
|
346
|
+
* error voice (stage's, else the run's) when the word is failed. */
|
|
347
|
+
export declare function settleMirrorPatches(run: RunRecord): Array<{
|
|
348
|
+
stageId: string;
|
|
349
|
+
patch: Record<string, unknown>;
|
|
350
|
+
}>;
|
|
253
351
|
//# sourceMappingURL=runsRegistry.d.ts.map
|