@melite/estate-queue 0.2.0-alpha → 0.2.2-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 +0 -5
- package/lib/cardsCompose.d.ts +31 -0
- package/lib/cardsCompose.js +55 -0
- package/lib/cardsRegistry.d.ts +5 -2
- package/lib/cardsRegistry.js +160 -3
- package/lib/discloseRegistry.d.ts +5 -0
- package/lib/discloseRegistry.js +3 -3
- package/lib/flowsData.d.ts +77 -21
- package/lib/flowsData.js +156 -21
- package/lib/flowsRegistryRows.d.ts +0 -4
- package/lib/flowsRegistryRows.js +137 -351
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -4
- package/lib/loadPlane.d.ts +46 -4
- package/lib/loadPlane.js +107 -7
- package/lib/loadRegistry.js +9 -2
- package/lib/managePlane.d.ts +5 -0
- package/lib/managePlane.js +404 -49
- package/lib/managePreflight.js +38 -6
- package/lib/manageProbe.d.ts +35 -0
- package/lib/manageProbe.js +110 -0
- package/lib/queueLock.js +19 -10
- package/lib/queueResurrect.d.ts +0 -3
- package/lib/queueResurrect.js +0 -3
- package/lib/queueRetry.d.ts +12 -10
- package/lib/queueRetry.js +2 -4
- package/lib/queueSidecar.d.ts +12 -0
- package/lib/queueSidecar.js +15 -0
- package/lib/queueSubmit.d.ts +4 -1
- package/lib/queueSubmit.js +28 -5
- package/lib/runsExecute.d.ts +16 -1
- package/lib/runsExecute.js +63 -45
- package/lib/runsGates.d.ts +11 -3
- package/lib/runsGates.js +11 -3
- package/lib/runsList.d.ts +59 -3
- package/lib/runsList.js +217 -36
- package/lib/runsRegistry.d.ts +58 -3
- package/lib/runsRegistry.js +479 -92
- package/lib/runsStart.d.ts +6 -4
- package/lib/runsStart.js +32 -25
- package/lib/runsTypes.d.ts +19 -1
- package/lib/runsTypes.js +40 -3
- package/lib/runsValidate.d.ts +1 -0
- package/lib/runsValidate.js +5 -0
- package/lib/runsValidateArms.js +25 -0
- package/lib/runsValidateServe.js +15 -12
- package/lib/runsValidateShared.d.ts +8 -10
- package/lib/runsValidateShared.js +41 -15
- package/lib/runsValidateStages.d.ts +1 -1
- package/lib/runsValidateStages.js +90 -50
- package/lib/skillAuthored.d.ts +50 -0
- package/lib/skillAuthored.js +178 -0
- package/lib/skillPlane.d.ts +40 -2
- package/lib/skillPlane.js +63 -13
- package/lib/skillRegistry.d.ts +24 -1
- package/lib/skillRegistry.js +69 -5
- package/lib/skillRows.d.ts +13 -3
- package/lib/skillRows.js +42 -3
- package/package.json +24 -14
- package/lib/resurrect.d.ts +0 -6
- package/lib/resurrect.js +0 -18
package/lib/flowsData.js
CHANGED
|
@@ -22,6 +22,68 @@ import { CARD_PLANE_ENGINE, LEGACY_RUN_MEDIA_PREFIX, RUN_MEDIA_PREFIX } from "@m
|
|
|
22
22
|
import { join, resolve } from "node:path";
|
|
23
23
|
import { mediaVocab } from "./mediaKinds.js";
|
|
24
24
|
import { validateBakeParams } from "./bakeParams.js";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export function flowInitialKeys(flow) {
|
|
37
|
+
const required = flow.requiredInitials ?? [];
|
|
38
|
+
const optional = Object.keys(flow.initialValidators).filter((k) => !required.includes(k));
|
|
39
|
+
return [...required, ...optional];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export function initialKindGloss(kind) {
|
|
58
|
+
switch (kind) {
|
|
59
|
+
case "bake_params":
|
|
60
|
+
return "the preset dialect doc {dialect: 'authored'|'estimated', phenotype: number[11 authored|6 estimated], local_changes?: {morph: number} (authored) | scale: number[139] (estimated)} — send the doc as a JSON OBJECT, never a hand-typed string";
|
|
61
|
+
case "photo":
|
|
62
|
+
case "video":
|
|
63
|
+
case "glb":
|
|
64
|
+
return "file path (or {path})";
|
|
65
|
+
case "text":
|
|
66
|
+
return "bare name";
|
|
67
|
+
case "brief":
|
|
68
|
+
return "non-empty prose";
|
|
69
|
+
case "number":
|
|
70
|
+
return "finite JSON number";
|
|
71
|
+
case "json":
|
|
72
|
+
return "JSON object (or its string spelling)";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** A flow's initial keys → glosses, the same derivation order the
|
|
76
|
+
* validators hold (the bundle's initials record rides both so the
|
|
77
|
+
* open face renders kinds and shapes from one truth).
|
|
78
|
+
* @param flow the registry row
|
|
79
|
+
* @returns the gloss per declared initial key */
|
|
80
|
+
export function flowInitialGlosses(flow) {
|
|
81
|
+
const out = {};
|
|
82
|
+
for (const [key, kind] of Object.entries(flow.initialValidators)) {
|
|
83
|
+
out[key] = initialKindGloss(kind);
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
25
87
|
// ── shared builders ─────────────────────────────────────────────
|
|
26
88
|
export function initial(key) {
|
|
27
89
|
return { initial: key };
|
|
@@ -81,19 +143,15 @@ export function linkedStage(flow, stage, id, inputs) {
|
|
|
81
143
|
* (default unlimited), inputs (the plus-box list). The stage
|
|
82
144
|
* params carry those fields at DRIVE time; the registry row is
|
|
83
145
|
* the template + the agent leaf. */
|
|
84
|
-
import {
|
|
146
|
+
import { ANNY_HMR_ESTIMATOR, ANNY_PARAMS, CHARACTER_FACTORY, FIT_SEAT, IMAGE_UPSCALE, CRAFT_LOOP, OBJECT_FORGE, } from "./flowsRegistryRows.js";
|
|
85
147
|
import { Service } from "@deepseek-ai/cordis";
|
|
86
148
|
const REGISTRY = {
|
|
87
149
|
"craft-loop": CRAFT_LOOP,
|
|
88
150
|
"anny-hmr-estimator": ANNY_HMR_ESTIMATOR,
|
|
89
|
-
"body-to-somax": BODY_TO_SOMAX,
|
|
90
151
|
"character-factory": CHARACTER_FACTORY,
|
|
91
152
|
"anny-params": ANNY_PARAMS,
|
|
92
|
-
"audio-native-tts": AUDIO_NATIVE_TTS,
|
|
93
|
-
"extend-video": VIDEO_EXTEND,
|
|
94
153
|
"fit-seat": FIT_SEAT,
|
|
95
154
|
"image-upscale": IMAGE_UPSCALE,
|
|
96
|
-
"music-native": MUSIC_NATIVE,
|
|
97
155
|
"object-forge": OBJECT_FORGE,
|
|
98
156
|
};
|
|
99
157
|
/** A pure read-only seat over the boot seed (REGISTRY verbatim, no
|
|
@@ -388,8 +446,9 @@ function checkFileInitial(key, kind, value, roots) {
|
|
|
388
446
|
: "";
|
|
389
447
|
// The vocab is TYPED DATA now (mediaKinds.ts, REBUILD-7) — no
|
|
390
448
|
// repo-anchored kindsPath read survives the re-home. The video
|
|
391
|
-
// kind rides the same vocab's video list (
|
|
392
|
-
//
|
|
449
|
+
// kind rides the same vocab's video list (a prior-clip initial —
|
|
450
|
+
// mp4/webm/mkv/mov/m4v/avi; born on the retired extend-video
|
|
451
|
+
// wrapper).
|
|
393
452
|
const kinds = mediaVocab();
|
|
394
453
|
const allowed = kind === "photo" ? kinds.image : kind === "video" ? kinds.video : kinds.model;
|
|
395
454
|
if (!allowed.includes(ext)) {
|
|
@@ -505,6 +564,50 @@ export function registryInitialsError(flow, body, roots) {
|
|
|
505
564
|
}
|
|
506
565
|
continue;
|
|
507
566
|
}
|
|
567
|
+
// A BRIEF initial is PROSE (F58, the craft-loop binding): the
|
|
568
|
+
// brief is data a critique loop reads — no file door ever opens
|
|
569
|
+
// it, so the path law that guards names would mis-refuse honest
|
|
570
|
+
// prose ("a 3/4 view poster"). The door judges emptiness only;
|
|
571
|
+
// length and sense are the critic's problem.
|
|
572
|
+
if (kind === "brief") {
|
|
573
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
574
|
+
return "initial " + JSON.stringify(key) +
|
|
575
|
+
" must be a non-empty brief (got " + (typeof value) + ")";
|
|
576
|
+
}
|
|
577
|
+
continue;
|
|
578
|
+
}
|
|
579
|
+
// A NUMBER initial is a finite JSON number (F58): digit-strings
|
|
580
|
+
// REFUSE — the caller sent JSON, and a silent fold would mask the
|
|
581
|
+
// caller's shape bug until the engine's own numeric gate refused
|
|
582
|
+
// it with a stranger's voice.
|
|
583
|
+
if (kind === "number") {
|
|
584
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
585
|
+
return "initial " + JSON.stringify(key) +
|
|
586
|
+
" must be a finite number (got " + (typeof value) + " — send JSON numbers, not strings)";
|
|
587
|
+
}
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
// A JSON initial is an object or its JSON-string spelling (F58):
|
|
591
|
+
// the door judges parseability + objectness only — the consuming
|
|
592
|
+
// engine's gate owns the inner shape (craft's command row:
|
|
593
|
+
// {engine, params}, refused by the engine's own LOUD voice).
|
|
594
|
+
if (kind === "json") {
|
|
595
|
+
let v = value;
|
|
596
|
+
if (typeof v === "string") {
|
|
597
|
+
try {
|
|
598
|
+
v = JSON.parse(v);
|
|
599
|
+
}
|
|
600
|
+
catch {
|
|
601
|
+
return "initial " + JSON.stringify(key) +
|
|
602
|
+
" is a JSON string that does not parse";
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
if (typeof v !== "object" || v === null || Array.isArray(v)) {
|
|
606
|
+
return "initial " + JSON.stringify(key) +
|
|
607
|
+
" must be a JSON object or its string spelling (got " + (typeof value) + ")";
|
|
608
|
+
}
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
508
611
|
const err = checkFileInitial(key, kind, value, roots);
|
|
509
612
|
if (err !== null)
|
|
510
613
|
return err;
|
|
@@ -526,18 +629,24 @@ export function registryInitialsError(flow, body, roots) {
|
|
|
526
629
|
}
|
|
527
630
|
return null;
|
|
528
631
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
541
650
|
export function normalizedInitialValue(key, kind, value) {
|
|
542
651
|
// A TEXT initial is a BARE NAME: nothing unwraps it and nothing
|
|
543
652
|
// path-shaped reaches it, so the {path: …} arm below never runs
|
|
@@ -546,6 +655,26 @@ export function normalizedInitialValue(key, kind, value) {
|
|
|
546
655
|
// first — this arm makes the extractor honest on its own.)
|
|
547
656
|
if (kind === "text")
|
|
548
657
|
return typeof value === "string" ? value : null;
|
|
658
|
+
if (kind === "brief")
|
|
659
|
+
return typeof value === "string" && value.trim() !== "" ? value : null;
|
|
660
|
+
if (kind === "number")
|
|
661
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
662
|
+
if (kind === "json") {
|
|
663
|
+
if (typeof value === "string") {
|
|
664
|
+
try {
|
|
665
|
+
const parsed = JSON.parse(value);
|
|
666
|
+
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)
|
|
667
|
+
? parsed
|
|
668
|
+
: null;
|
|
669
|
+
}
|
|
670
|
+
catch {
|
|
671
|
+
return null;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
675
|
+
? value
|
|
676
|
+
: null;
|
|
677
|
+
}
|
|
549
678
|
if (typeof value === "string")
|
|
550
679
|
return value;
|
|
551
680
|
if (kind === "bake_params") {
|
|
@@ -588,8 +717,14 @@ export function extractRequestInitials(flow, body) {
|
|
|
588
717
|
(typeof value) + ")"
|
|
589
718
|
: kind === "text"
|
|
590
719
|
? " must be a bare name (got " + (typeof value) + ")"
|
|
591
|
-
:
|
|
592
|
-
(typeof value) + ")"
|
|
720
|
+
: kind === "brief"
|
|
721
|
+
? " must be a non-empty brief (got " + (typeof value) + ")"
|
|
722
|
+
: kind === "number"
|
|
723
|
+
? " must be a finite number (got " + (typeof value) + " — send JSON numbers, not strings)"
|
|
724
|
+
: kind === "json"
|
|
725
|
+
? " must be a JSON object or its string spelling (got " + (typeof value) + ")"
|
|
726
|
+
: " must be a file path string or {path: ...} (got " +
|
|
727
|
+
(typeof value) + ")"),
|
|
593
728
|
};
|
|
594
729
|
}
|
|
595
730
|
initials[key] = normalized;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { RegistryFlow } from "./flowsData.js";
|
|
2
2
|
export declare const ANNY_HMR_ESTIMATOR: RegistryFlow;
|
|
3
3
|
export declare const ANNY_PARAMS: RegistryFlow;
|
|
4
|
-
export declare const AUDIO_NATIVE_TTS: RegistryFlow;
|
|
5
|
-
export declare const BODY_TO_SOMAX: RegistryFlow;
|
|
6
4
|
export declare const FIT_SEAT: RegistryFlow;
|
|
7
5
|
export declare const IMAGE_UPSCALE: RegistryFlow;
|
|
8
|
-
export declare const VIDEO_EXTEND: RegistryFlow;
|
|
9
|
-
export declare const MUSIC_NATIVE: RegistryFlow;
|
|
10
6
|
export declare const CRAFT_LOOP: RegistryFlow;
|
|
11
7
|
export declare const CHARACTER_FACTORY: RegistryFlow;
|
|
12
8
|
export declare const OBJECT_FORGE: RegistryFlow;
|