@melite/estate-queue 0.1.4-alpha → 0.2.0-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 (106) hide show
  1. package/LICENSE +561 -457
  2. package/README.md +55 -0
  3. package/lib/bench.d.ts +19 -11
  4. package/lib/bench.js +47 -57
  5. package/lib/cardsArmError.d.ts +94 -2
  6. package/lib/cardsArmError.js +34 -4
  7. package/lib/cardsCompose.d.ts +13 -1
  8. package/lib/cardsCompose.js +151 -67
  9. package/lib/cardsDangling.d.ts +2 -2
  10. package/lib/cardsDangling.js +82 -37
  11. package/lib/cardsFacts.d.ts +32 -3
  12. package/lib/cardsFacts.js +39 -1
  13. package/lib/cardsLanes.d.ts +62 -4
  14. package/lib/cardsLanes.js +407 -20
  15. package/lib/cardsLanesCopy.d.ts +21 -0
  16. package/lib/cardsLanesCopy.js +22 -0
  17. package/lib/cardsRegistry.d.ts +195 -10
  18. package/lib/cardsRegistry.js +959 -67
  19. package/lib/cardsVariant.d.ts +22 -8
  20. package/lib/cardsVariant.js +243 -52
  21. package/lib/discloseRegistry.d.ts +42 -11
  22. package/lib/discloseRegistry.js +163 -23
  23. package/lib/filmLead.js +5 -3
  24. package/lib/flowsData.d.ts +68 -13
  25. package/lib/flowsData.js +236 -107
  26. package/lib/flowsFamilyCompose.d.ts +5 -8
  27. package/lib/flowsFamilyCompose.js +25 -14
  28. package/lib/flowsParamsOverlay.d.ts +55 -0
  29. package/lib/flowsParamsOverlay.js +197 -0
  30. package/lib/flowsRegistryRows.d.ts +4 -1
  31. package/lib/flowsRegistryRows.js +325 -25
  32. package/lib/index.d.ts +1 -3
  33. package/lib/index.js +20 -5
  34. package/lib/lifecycleLatch.d.ts +16 -0
  35. package/lib/lifecycleLatch.js +42 -0
  36. package/lib/loadPlane.d.ts +3 -2
  37. package/lib/loadPlane.js +34 -8
  38. package/lib/loadRegistry.js +1 -1
  39. package/lib/manageOps.d.ts +8 -2
  40. package/lib/manageOps.js +28 -7
  41. package/lib/managePlane.d.ts +42 -1
  42. package/lib/managePlane.js +911 -101
  43. package/lib/managePreflight.d.ts +26 -0
  44. package/lib/managePreflight.js +179 -0
  45. package/lib/manageProbe.d.ts +15 -7
  46. package/lib/manageProbe.js +79 -8
  47. package/lib/manageRegistry.d.ts +42 -4
  48. package/lib/manageRegistry.js +45 -7
  49. package/lib/mediaKinds.d.ts +1 -1
  50. package/lib/mediaKinds.js +1 -1
  51. package/lib/queue.js +14 -10
  52. package/lib/queueCore.d.ts +21 -5
  53. package/lib/queueCore.js +22 -5
  54. package/lib/queueLifecycle.d.ts +0 -24
  55. package/lib/queueLifecycle.js +9 -63
  56. package/lib/queueLock.d.ts +8 -2
  57. package/lib/queueLock.js +9 -6
  58. package/lib/queueResurrect.d.ts +7 -2
  59. package/lib/queueResurrect.js +25 -6
  60. package/lib/queueSidecar.d.ts +114 -1
  61. package/lib/queueSidecar.js +178 -7
  62. package/lib/queueSubmit.d.ts +124 -10
  63. package/lib/queueSubmit.js +251 -48
  64. package/lib/queueSweep.js +13 -2
  65. package/lib/runsChange.d.ts +8 -0
  66. package/lib/runsChange.js +21 -5
  67. package/lib/runsErrorCodes.d.ts +1 -1
  68. package/lib/runsErrorCodes.js +35 -0
  69. package/lib/runsExecute.d.ts +26 -0
  70. package/lib/runsExecute.js +184 -6
  71. package/lib/runsGates.d.ts +5 -1
  72. package/lib/runsGates.js +10 -5
  73. package/lib/runsList.d.ts +43 -3
  74. package/lib/runsList.js +172 -58
  75. package/lib/runsRefusalVoices.js +101 -0
  76. package/lib/runsRegistry.d.ts +188 -12
  77. package/lib/runsRegistry.js +1233 -179
  78. package/lib/runsSourceEcho.d.ts +27 -0
  79. package/lib/runsSourceEcho.js +84 -18
  80. package/lib/runsStart.d.ts +80 -17
  81. package/lib/runsStart.js +303 -49
  82. package/lib/runsTypes.d.ts +62 -2
  83. package/lib/runsTypes.js +30 -6
  84. package/lib/runsValidateArms.js +61 -7
  85. package/lib/runsValidateServe.d.ts +2 -2
  86. package/lib/runsValidateServe.js +46 -14
  87. package/lib/runsValidateShared.d.ts +10 -1
  88. package/lib/runsValidateShared.js +14 -0
  89. package/lib/runsValidateStages.d.ts +10 -3
  90. package/lib/runsValidateStages.js +44 -12
  91. package/lib/runtimeProvision.d.ts +119 -0
  92. package/lib/runtimeProvision.js +243 -0
  93. package/lib/service.d.ts +24 -6
  94. package/lib/service.js +19 -11
  95. package/lib/skillFs.d.ts +9 -4
  96. package/lib/skillFs.js +12 -14
  97. package/lib/skillPlane.d.ts +3 -2
  98. package/lib/skillPlane.js +12 -6
  99. package/lib/skillRegistry.js +1 -1
  100. package/lib/skillRows.d.ts +4 -3
  101. package/lib/skillRows.js +21 -14
  102. package/lib/toolProjection.d.ts +1 -1
  103. package/lib/toolProjection.js +1 -1
  104. package/package.json +18 -17
  105. package/lib/runStatus.d.ts +0 -7
  106. package/lib/runStatus.js +0 -21
@@ -3,10 +3,13 @@
3
3
  // module of declarations, one line per flow; flowsData.ts keeps the
4
4
  // types, the helpers, and the assembled REGISTRY.
5
5
  import { CARD_PLANE_ENGINE } from '@melite/contracts/benchStage';
6
+ // linkedStage is NOT imported here: no seed row links another flow
7
+ // (the link builder serves drop-in rows and the tests that drive
8
+ // them — a seed row carrying one would be dead authoring surface).
6
9
  import { plainStage, initial, fromStage } from "./flowsData.js";
7
- export const ANNY_HMR_COMMERCIAL = {
8
- id: "anny-hmr-commercial",
9
- description: "The commercial photo→Anny chain: " +
10
+ export const ANNY_HMR_ESTIMATOR = {
11
+ id: "anny-hmr-estimator",
12
+ description: "The estimator photo→Anny chain: " +
10
13
  "SAM 3D Body → MHR → SOMA → anny — every link license-cleared for sale " +
11
14
  "(SAM License operator-accepted; the rest Apache 2.0). Emits a grounded " +
12
15
  "bind-pose body GLB + anny phenotype/local-change params.",
@@ -14,12 +17,12 @@ export const ANNY_HMR_COMMERCIAL = {
14
17
  plainStage({
15
18
  id: "estimate",
16
19
  engine: CARD_PLANE_ENGINE,
17
- // the commercial engine of the same verb — family DECL owns
20
+ // the estimator engine of the same verb — family DECL owns
18
21
  // the nodes (SAM 3D Body → grounded anny), person_index FIXED
19
22
  // at the loudest detection (the verb's chip owns the picker)
20
23
  family: "anny",
21
- action: "estimate_commercial",
22
- description: "SAM 3D Body commercial chain → grounded anny GLB",
24
+ action: "estimate_photo",
25
+ description: "SAM 3D Body estimator → grounded anny GLB",
23
26
  inputs: { photo: initial("photo") },
24
27
  expected: { photo: "image" },
25
28
  params: { photo: "$photo" },
@@ -85,7 +88,13 @@ export const AUDIO_NATIVE_TTS = {
85
88
  expected: { text: "text" },
86
89
  outputs: { wav: "audio" },
87
90
  cardIo: { wav: "audio" },
88
- params: { model: "qwen3-tts", text: "$text", seed: 42 },
91
+ // ONE HOME FOR FLOW DEFAULTS (audit 015 C2): no seed stamp —
92
+ // the tts card's own default (-1, random) rules at compose and
93
+ // the seed-sentinel gate mints a fresh take per run, the same
94
+ // take-freshness a GUI card stage gets. A stated seed rides the
95
+ // declared overlay; the stamp that stood here (seed 42) was a
96
+ // second default-write that locked every flow take to 42.
97
+ params: { model: "qwen3-tts", text: "$text" },
89
98
  }),
90
99
  ],
91
100
  initialValidators: { text: "text" },
@@ -107,11 +116,16 @@ export const AUDIO_NATIVE_TTS = {
107
116
  maximum: null,
108
117
  enum: null,
109
118
  },
119
+ // ONE HOME FOR FLOW DEFAULTS (audit 015 C2): the tool publishes
120
+ // no seed default — the tts card's own default (-1, fresh mint)
121
+ // rules when the caller omits the seed, so a published number
122
+ // here would advertise a take-lock the run never composes. The
123
+ // overlay stays: a stated seed pins the take.
110
124
  seed: {
111
125
  ptype: "integer",
112
- description: "voice sampler seed",
113
- default: 42,
114
- hasDefault: true,
126
+ description: "voice sampler seed (omit for a fresh take — the card mints one)",
127
+ default: null,
128
+ hasDefault: false,
115
129
  minimum: 0,
116
130
  maximum: 2147483647,
117
131
  enum: null,
@@ -138,7 +152,7 @@ export const BODY_TO_SOMAX = {
138
152
  engine: CARD_PLANE_ENGINE,
139
153
  card: "rig",
140
154
  description: "SOMA-77 template weight transfer (barycentric, the autorig pack's " +
141
- "baked function) via the rig card's auto mode — the gem_soma " +
155
+ "baked function) via the rig card's auto mode — the gem-soma " +
142
156
  "family's declared rig action composes the KimodoExportFBX segment",
143
157
  inputs: { glb: initial("glb") },
144
158
  expected: { glb: "mesh" },
@@ -146,7 +160,7 @@ export const BODY_TO_SOMAX = {
146
160
  cardIo: { body: "mesh" },
147
161
  // THE LANE IS THE FAMILY'S (the atom vocabulary, stroke 3): this
148
162
  // stage hand-wired the KimodoExportFBX node in the flow plane —
149
- // a second copy of the gem_soma rig lane. It names the card +
163
+ // a second copy of the gem-soma rig lane. It names the card +
150
164
  // mode; the family's declared action composes the graph.
151
165
  // (out_dir/timeout_s are RAW-stage knobs — a card stage's
152
166
  // params are card-admitted knobs only; the compose door owns
@@ -220,7 +234,12 @@ export const IMAGE_UPSCALE = {
220
234
 
221
235
  expected: { prompt: "text" },
222
236
  cardIo: { image: "image" },
223
- params: { model: "krea-2", prompt: "$prompt", seed: 42 },
237
+ // ONE HOME FOR FLOW DEFAULTS (audit 015 C2): no seed stamp on
238
+ // either stage — the image-gen and upscale-tools cards both
239
+ // default seed -1 (fresh mint per stage), so a stamp here (42)
240
+ // was a second default-write that made every flow-driven gen
241
+ // seed-identical unless the caller stated a seed.
242
+ params: { model: "krea-2", prompt: "$prompt" },
224
243
  }),
225
244
  plainStage({
226
245
  id: "polish",
@@ -231,10 +250,14 @@ export const IMAGE_UPSCALE = {
231
250
  expected: { image: "image" },
232
251
  cardIo: { image: "image" },
233
252
  params: {
234
- model: "seedvr2_ema",
253
+ model: "seedvr2-ema",
235
254
  input_image: "$image",
236
- filename_prefix: "image-upscale",
237
- seed: 42,
255
+
256
+ // upscale-tools card composes its own SaveImage prefix from
257
+ // the run id (seedvr2-ema's action), so the stated key
258
+ // reached NO consumer — dead stage surface the carry wall
259
+ // now refuses. seed left with it (audit 015 C2, the derived
260
+ // sweep's fourth seat): the card's own -1 default mints.
238
261
  },
239
262
  }),
240
263
  ],
@@ -264,11 +287,16 @@ export const IMAGE_UPSCALE = {
264
287
  maximum: null,
265
288
  enum: null,
266
289
  },
290
+ // ONE HOME FOR FLOW DEFAULTS (audit 015 C2): the tool publishes
291
+ // no seed default — the make and polish cards both default -1
292
+ // (fresh mint per stage); a published 42 advertised a take-lock
293
+ // the compose never carried. The overlay stays: a stated seed
294
+ // pins both stages.
267
295
  seed: {
268
296
  ptype: "integer",
269
- description: "sampler seed",
270
- default: 42,
271
- hasDefault: true,
297
+ description: "sampler seed (omit for fresh takes — each stage's card mints one)",
298
+ default: null,
299
+ hasDefault: false,
272
300
  minimum: 0,
273
301
  maximum: 2147483647,
274
302
  enum: null,
@@ -294,6 +322,115 @@ export const IMAGE_UPSCALE = {
294
322
  "model:z-image:prompt-enhance",
295
323
  ],
296
324
  };
325
+ export const VIDEO_EXTEND = {
326
+ id: "extend-video",
327
+ description: "More seconds of coherent motion appended to a prior clip — the " +
328
+ "extend-video flow (report dev_docs/audits/features/" +
329
+ "extend-video-flow-2026-11-12.md): ONE card= stage on h3-timeline " +
330
+ "whose extend arm renders a fresh continuation anchored on the prior " +
331
+ "clip's LAST FRAME (negative batch index, in-graph), at full denoise " +
332
+ "under an all-white mask, then joins prior + new through the film " +
333
+ "tail's own file law (both parts save at SaveVideo prefixes; " +
334
+ "MeliteConcatVideos decodes them back strictly after every save). " +
335
+ "RUNS on the {flow:} door (the 2026-10-04 card-stage cure — the row " +
336
+ "composes through the card plane as one merged run); the {model:} " +
337
+ "door drives the same card with the extend mod armed on the bench.",
338
+ stages: [
339
+ plainStage({
340
+ id: "extend",
341
+ engine: CARD_PLANE_ENGINE,
342
+ card: "h3-timeline",
343
+ description: "The continuation window via the h3-timeline card's extend arm — " +
344
+ "prior clip in (VHS force_rate 24), last-frame anchor, fresh " +
345
+ "denoise-1 window, joined film out",
346
+ inputs: {
347
+ source_clip: initial("source_clip"),
348
+ extend_prompt: initial("extend_prompt"),
349
+ },
350
+ // hand-written ONLY because the card's flowKinds declares
351
+ // none of these slots (the derivation law's exception clause:
352
+ // the row names what the card cannot know about its own
353
+ // initials). The numeric seats (extend_seconds, seed) ride NO
354
+ // initial — the initial kinds are the closed five
355
+ // (photo/video/glb/bake_params/text, flowsData.ts:74) and a
356
+ // number refuses every one; worse, a $spell ALWAYS resolves
357
+ // to its normalized STRING at the merge, so a numeric spell
358
+ // would land "2.33" in the bag and the renderer's typed read
359
+ // would silently snap to the default — the exact silent snap
360
+ // the grid door exists to kill. Numbers state through the
361
+ // WHOLE-BAG params override (applyFlowParamsOverlay: the
362
+ // array value replaces the bag raw, JSON numbers intact).
363
+ expected: { source_clip: "video", extend_prompt: "text" },
364
+ cardIo: { default: "video" },
365
+ params: {
366
+ model: "h3-timeline",
367
+ // THE MOD BAG (params-emit's law: entries ride as an array
368
+ // under params.<param_key>, never flattened): the two string
369
+ // seats are $spells resolved at the merge against this
370
+ // stage's wired initials — both REQUIRED, so every spell
371
+ // always resolves (an optional spell would refuse mid-run;
372
+ // the requiredInitials door guarantees the body carries
373
+ // both). The numeric seats (extend_seconds, seed) ride the
374
+ // renderer's own defaults (2.33s / seed 0); a caller pinning
375
+ // one passes params: {extend: [{…full bag…}]} and the
376
+ // override replaces this stamp wholesale with raw values.
377
+ extend: [
378
+ {
379
+ source_clip: "$source_clip",
380
+ extend_prompt: "$extend_prompt",
381
+ },
382
+ ],
383
+ },
384
+ }),
385
+ ],
386
+ initialValidators: { source_clip: "video", extend_prompt: "text" },
387
+ requiredInitials: ["source_clip", "extend_prompt"],
388
+ tool: {
389
+ name: "extend_video",
390
+ version: 1,
391
+ description: "Append fresh seconds to a prior clip (one call: the prior clip + " +
392
+ "a continuation prompt in, the joined extended film out — the prior " +
393
+ "plays first, new motion and sound follow). The prior clip is a " +
394
+ "stageable video (mp4/webm/mkv/mov/m4v/avi — a /melite-media/runs/ " +
395
+ "artifact URL from an earlier run lands) and rides the flow body's " +
396
+ "source_clip key. The prompt states MOTION and SOUND picking up " +
397
+ "where the clip ends. extend_seconds (default 2.33) must land on " +
398
+ "the engine grid (frames become seconds at the schema fps " +
399
+ "default: 2.33s = 56f, 3.75s = 90f, 5.17s = 124f, 15.08s = 362f " +
400
+ "the largest single window — beyond it the door composes N " +
401
+ "uniform windows under the 39f overlap, exact delivery or a " +
402
+ "loud refusal; off-grid values refuse at the compose door) and " +
403
+ "states " +
404
+ "through params: {extend: [{extend_seconds: …, seed: …}]} — " +
405
+ "numbers ride the bag, never the flow body.",
406
+ properties: {
407
+ source_clip: {
408
+ ptype: "string",
409
+ description: "the prior clip — a stageable video path (a /melite-media/" +
410
+ "runs/<run_id>/<file>.mp4 artifact URL from an earlier run " +
411
+ "lands; a browser-local blob/data URL refuses — upload first)",
412
+ default: null,
413
+ hasDefault: false,
414
+ minimum: null,
415
+ maximum: null,
416
+ enum: null,
417
+ },
418
+ extend_prompt: {
419
+ ptype: "string",
420
+ description: "the continuation text — MOTION and SOUND for the appended " +
421
+ "seconds, picking up exactly where the clip ends",
422
+ default: null,
423
+ hasDefault: false,
424
+ minimum: null,
425
+ maximum: null,
426
+ enum: null,
427
+ },
428
+ },
429
+ required: ["source_clip", "extend_prompt"],
430
+ overlays: [],
431
+ },
432
+ skillRefs: ["card:h3-timeline"],
433
+ };
297
434
  export const MUSIC_NATIVE = {
298
435
  id: "music-native",
299
436
  description: "Music generation as a CARD stage — prompt in, audio out via the music " +
@@ -316,8 +453,20 @@ export const MUSIC_NATIVE = {
316
453
  cardIo: { default: "audio" },
317
454
  params: {
318
455
  prompt: "$prompt",
456
+
457
+ // instrumental default — the card bakes an absent/empty lyric
458
+ // as "" (MiniMax's instrumental convention), never an absent
459
+ // ref, so the seat stays a plain literal (a "$lyrics" spell
460
+ // would refuse unresolved on instrumental calls) and the
461
+ // stated lyric rides the declared overlay.
462
+ lyrics: "",
319
463
  model: "music3",
320
- duration: 120,
464
+ // ONE HOME FOR FLOW DEFAULTS (audit 015 C2): no duration
465
+ // stamp — the music card's own default (30) rules, the same
466
+ // length a GUI card stage gets; the stamp that stood here
467
+ // (120) was a second default-write that made agent music
468
+ // 120 s while human card music stayed 30 s. A stated duration
469
+ // rides the declared overlay.
321
470
  seed: -1,
322
471
  },
323
472
  }),
@@ -327,7 +476,7 @@ export const MUSIC_NATIVE = {
327
476
  name: "compose_music",
328
477
  version: 1,
329
478
  description: "Music generation in one call (MiniMax Music 3 via the music card) — " +
330
- "prompt in, audio out.",
479
+ "prompt in, audio out; state lyrics for sung verses (omit for instrumental).",
331
480
  properties: {
332
481
  prompt: {
333
482
  ptype: "string",
@@ -338,18 +487,35 @@ export const MUSIC_NATIVE = {
338
487
  maximum: null,
339
488
  enum: null,
340
489
  },
490
+ // ONE HOME FOR FLOW DEFAULTS (audit 015 C2): the tool publishes
491
+ // no duration default — the music card's own default (30)
492
+ // rules when the caller omits it, so a published 120 advertised
493
+ // a length the run never composes. The bounds stay (the card's
494
+ // own declared cap, pointed at, not restated as a default).
341
495
  duration: {
342
496
  ptype: "integer",
343
- description: "seconds of music (the card caps 5..360)",
344
- default: 120,
345
- hasDefault: true,
497
+ description: "seconds of music (the card caps 5..360; omit for the card's own default)",
498
+ default: null,
499
+ hasDefault: false,
346
500
  minimum: 5,
347
501
  maximum: 360,
348
502
  enum: null,
349
503
  },
504
+ lyrics: {
505
+ ptype: "string",
506
+ description: "song lyrics (verse-form text sung by the music); omit for instrumental",
507
+ default: null,
508
+ hasDefault: false,
509
+ minimum: null,
510
+ maximum: null,
511
+ enum: null,
512
+ },
350
513
  },
351
514
  required: ["prompt"],
352
- overlays: [{ param: "duration", stage: "music", path: ["duration"], choices: null }],
515
+ overlays: [
516
+ { param: "duration", stage: "music", path: ["duration"], choices: null },
517
+ { param: "lyrics", stage: "music", path: ["lyrics"], choices: null },
518
+ ],
353
519
  },
354
520
  skillRefs: [],
355
521
  };
@@ -375,4 +541,138 @@ export const CRAFT_LOOP = {
375
541
  tool: null,
376
542
  skillRefs: [],
377
543
  };
544
+ export const CHARACTER_FACTORY = {
545
+ id: "character-factory",
546
+ description: "Photo → clothed character → rigged → animated (the AssetFurnace-shape " +
547
+ "chain, estate-native): img-to-mesh lift with the repair knobs ON, rig " +
548
+ "auto (SOMA-77, BODY_TO_SOMAX's lane chained), kimodo text→motion " +
549
+ "skinned onto the rigged mesh (somax bake in-graph). Multi-stage: " +
550
+ "named registry flows DRIVE at start (the curated-lane lift, " +
551
+ "runsRegistry's own law — the refusal is hand-authored inline " +
552
+ "only); stages also drive one card at a time — see " +
553
+ "flows/character-factory/agents/AGENT.md. Creature motion rides the " +
554
+ "MOTION phase instead (unimate dataset clip → rig copy bridge, " +
555
+ "game-profile MCPs) — documented in the leaf, never a registry " +
556
+ "stage (unimate is an MCP, not melite).",
557
+ stages: [
558
+ plainStage({
559
+ id: "lift",
560
+ engine: CARD_PLANE_ENGINE,
561
+ card: "img-to-mesh",
562
+ description: "Photo → textured mesh via the img-to-mesh card (repair knobs ON)",
563
+ inputs: { photo: initial("photo") },
564
+
565
+ expected: { photo: "image" },
566
+ outputs: { mesh: "mesh" },
567
+ cardIo: { mesh: "mesh" },
568
+ params: { model: "pixal3d", input_image: "$photo" },
569
+ }),
570
+ plainStage({
571
+ id: "rig",
572
+ engine: CARD_PLANE_ENGINE,
573
+ card: "rig",
574
+ description: "SOMA-77 auto-rig via the rig card (BODY_TO_SOMAX's lane, chained)",
575
+ inputs: { mesh: fromStage("lift", "mesh") },
576
+ expected: { mesh: "mesh" },
577
+ outputs: { body: "mesh" },
578
+ cardIo: { body: "mesh" },
579
+ // no model pin (BODY_TO_SOMAX's law): mode auto selects the
580
+ // gem-soma family; the card's own contract owns the default
581
+ params: { mesh_glb: "$mesh", mode: "auto", preserve_texture: true },
582
+ }),
583
+ plainStage({
584
+ id: "motion",
585
+ engine: CARD_PLANE_ENGINE,
586
+ card: "motion",
587
+ description: "Kimodo text→motion skinned onto the rigged mesh (somax bake in-graph)",
588
+ inputs: { prompt: initial("prompt"), preview: fromStage("rig", "body") },
589
+ expected: { prompt: "text", preview: "mesh" },
590
+ // the card's two native channels ride verbatim (no rename: the
591
+ // flowOutputBindings bind motion_npz + animated_glb by name)
592
+ outputs: { motion_npz: "data", animated_glb: "mesh" },
593
+ cardIo: { motion_npz: "data", animated_glb: "mesh" },
594
+ params: { model: "kimodo", prompt: "$prompt", preview_glb: "$preview" },
595
+ }),
596
+ ],
597
+ initialValidators: { photo: "photo", prompt: "text" },
598
+ requiredInitials: ["photo", "prompt"],
599
+ tool: null,
600
+ skillRefs: [],
601
+ };
602
+
603
+ // the quad-remesh card and its vendored pack left with the pack the
604
+ // owner removed from the system — object-forge is the lift's tri
605
+ // mesh today.
606
+ export const OBJECT_FORGE = {
607
+ id: "object-forge",
608
+ description: "Prompt → concept render → textured mesh, one card per stage " +
609
+ "(image-gen + img-to-mesh; both card=, so the {flow:} door submits " +
610
+ "one merged run — image-upscale's 2026-10-04 shape). Emits the " +
611
+ "lift's textured tri mesh.",
612
+ stages: [
613
+ plainStage({
614
+ id: "concept",
615
+ engine: CARD_PLANE_ENGINE,
616
+ card: "image-gen",
617
+ description: "Concept render via the image-gen card (z-image default)",
618
+ inputs: { prompt: initial("prompt") },
619
+
620
+ expected: { prompt: "text" },
621
+ cardIo: { image: "image" },
622
+ params: { model: "z-image", prompt: "$prompt" },
623
+ }),
624
+ plainStage({
625
+ id: "lift",
626
+ engine: CARD_PLANE_ENGINE,
627
+ card: "img-to-mesh",
628
+ description: "Image → textured mesh via the img-to-mesh card (trellis2-native, " +
629
+ "no pack; repair knobs ride the card's own defaults)",
630
+ inputs: { concept: fromStage("concept", "image") },
631
+ expected: { concept: "image" },
632
+ cardIo: { mesh: "mesh" },
633
+ params: { model: "trellis2-native", input_image: "$concept" },
634
+ }),
635
+ ],
636
+ initialValidators: { prompt: "text" },
637
+ tool: {
638
+ name: "object_forge",
639
+ version: 1,
640
+ description: "Generate a 3D object from one prompt line: concept render " +
641
+ "(z-image), image-to-mesh lift (trellis2-native). One POST runs " +
642
+ "the whole flow and returns the textured mesh. (The remesh stage " +
643
+ "left 2026-10-13; quad topology is downstream work.)",
644
+ properties: {
645
+ prompt: {
646
+ ptype: "string",
647
+ description: "the object — one clear subject; a plain background reads best",
648
+ default: null,
649
+ hasDefault: false,
650
+ minimum: null,
651
+ maximum: null,
652
+ enum: null,
653
+ },
654
+ image_model: {
655
+ ptype: "string",
656
+ description: "the concept generator family",
657
+ default: "z-image",
658
+ hasDefault: true,
659
+ minimum: null,
660
+ maximum: null,
661
+ enum: ["z-image", "krea-2"],
662
+ },
663
+ },
664
+ required: ["prompt"],
665
+ overlays: [
666
+ {
667
+ param: "image_model",
668
+ stage: "concept",
669
+ path: ["model"],
670
+ choices: { "z-image": "z-image", "krea-2": "krea-2" },
671
+ },
672
+ ],
673
+ },
674
+ // ref would resolve null (the loadPlane null arm, never fired
675
+ // before this row); its craft lives in the leaf skill instead.
676
+ skillRefs: ["card:image-gen", "card:img-to-mesh", "model:z-image:prompt-enhance"],
677
+ };
378
678
  //# sourceMappingURL=flowsRegistryRows.js.map
package/lib/index.d.ts CHANGED
@@ -6,7 +6,6 @@ export { ManageGatewayService } from "./manageRegistry.js";
6
6
  export type { QueueConfig } from "./service.js";
7
7
  export * from "./vocab.js";
8
8
  export * from "./queue.js";
9
- export * from "./runStatus.js";
10
9
  export { bootSweep } from "./resurrect.js";
11
10
  export declare const name = "estate-queue";
12
11
  export declare const inject: string[];
@@ -16,8 +15,6 @@ export default plugin;
16
15
  export * from "./runsGates.js";
17
16
  export { findSkill, disclosureRoot } from "./skillPlane.js";
18
17
  export type { FamilyModelsSeat } from "./flowsFamilyCompose.js";
19
- export { benchPicks, benchFingerprint, benchBootMs, benchDir } from "./bench.js";
20
- export type { StagePick } from "./bench.js";
21
18
  export * from "./runsList.js";
22
19
  export * from "./mediaKinds.js";
23
20
  export * from "./runsTypes.js";
@@ -47,4 +44,5 @@ export declare const runsRegistryPlugin: {
47
44
  inject: readonly ["queue", "draftsRemote", "cardRegistry"];
48
45
  apply(ctx: Context): void;
49
46
  };
47
+ export { engineRootOf, engineOutputDir, resolveRuntimeHome, runtimeEnvView, resolveRuntimeProvision, nodeRuntimeFs, sentinelHit } from "./runtimeProvision.js";
50
48
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -11,14 +11,21 @@ export { RunsRuntimeService } from "./runsRegistry.js";
11
11
  export { ManageGatewayService } from "./manageRegistry.js";
12
12
  export * from "./vocab.js";
13
13
  export * from "./queue.js";
14
- export * from "./runStatus.js";
15
14
  // bootSweep twins (queue.ts core impl + resurrect.ts QueueRoots
16
15
  // wrapper): the explicit export wins over the stars — the wrapper
17
16
  // is the domain seam.
18
17
  export { bootSweep } from "./resurrect.js";
18
+ import { FlowsSeatService } from "./flowsData.js";
19
19
  export const name = "estate-queue";
20
20
  export const inject = ["timer"];
21
21
  export function apply(ctx, config = {}) {
22
+
23
+ // registry's live table is service instance state, its seed rows
24
+ // fiber-owned (ctx.effect in the constructor — the models
25
+ // registerFamily precedent). Every later row reads it through
26
+ // ctx.get("meliteFlows"); the queue itself needs no inject for a
27
+ // same-row service it never property-reads.
28
+ new FlowsSeatService(ctx);
22
29
  new QueueService(ctx, config);
23
30
  }
24
31
  const plugin = { name, inject, apply };
@@ -28,10 +35,12 @@ export * from "./runsGates.js";
28
35
  // the agent engine's spawn-injection reader rides these over the
29
36
  // SAME storage melite_load serves (never a second skill tree).
30
37
  export { findSkill, disclosureRoot } from "./skillPlane.js";
31
- // THE LIVE BENCH (the selection's only source — the catalog law):
32
- // every selection-serving surface reads through these, never its
33
- // own glob (drift between readers is how stale docs leak back).
34
- export { benchPicks, benchFingerprint, benchBootMs, benchDir } from "./bench.js";
38
+ // THE LIVE BENCH (the selection's only source — the catalog law)
39
+ // stays PACKAGE-INTERNAL since the dry-sweep's J18: the only live
40
+ // reader is skillPlane's buildSkillIndex (benchPicksSync, direct
41
+ // src import); the index face's re-exports had zero external
42
+ // importers, and the async twin + fingerprint rode no consumer at
43
+ // all. The spec pins the law through direct src imports.
35
44
  export * from "./runsList.js";
36
45
  export * from "./mediaKinds.js";
37
46
  export * from "./runsTypes.js";
@@ -63,4 +72,10 @@ export const runsRegistryPlugin = {
63
72
  new RunsRuntimeService(ctx);
64
73
  },
65
74
  };
75
+ // THE RUNTIME PRESENCE PROBE (the anny burn's serving cure,
76
+
77
+ // doc's runtimes block rides — one probe, every consumer (the
78
+ // press gate in cardsLanes and the doc's presence rows in
79
+ // melite-tools' discovery), never a second spelling.
80
+ export { engineRootOf, engineOutputDir, resolveRuntimeHome, runtimeEnvView, resolveRuntimeProvision, nodeRuntimeFs, sentinelHit } from "./runtimeProvision.js";
66
81
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Hold the latch for one door; the door releases it in its own finally.
3
+ * Holds nest under the same action name and across names; a release
4
+ * only retires its own hold.
5
+ * @param action the destructive action in flight (the door's own name)
6
+ * @returns the door's release closure, idempotent for its own hold
7
+ */
8
+ export declare function holdLifecycle(action: string): () => void;
9
+ /**
10
+ * The earliest action whose teardown is in flight, or null — read by
11
+ * the run press before its press reserve and record mint, and re-read
12
+ * by the press after its last await (runsStart's enqueue gate).
13
+ * @returns the held action name, or null when no teardown is in flight
14
+ */
15
+ export declare function lifecycleInFlight(): string | null;
16
+ //# sourceMappingURL=lifecycleLatch.d.ts.map
@@ -0,0 +1,42 @@
1
+
2
+ //
3
+ // The guard half (guardLifecycle in manageOps.ts) refuses a teardown
4
+ // when runs are already live, but five of the six destructive doors
5
+ // await on the vendor call as their first act — a run born during
6
+ // that await tears mid-render (round-19 F1: sidecar says running
7
+ // while its engine reboots). The latch is the reservation half: a
8
+ // guarded door holds it across its destructive section and the run
9
+ // press (RunsRegistry.start) refuses while it names an action.
10
+ // Doors overlap (the manage dispatch is unserialized): one slot would
11
+ // let the first finisher's release clear the other's live hold. Each
12
+ // holder counts under its own action name; the read names the earliest
13
+ // holder (Map insertion order).
14
+ const holders = new Map();
15
+ /**
16
+ * Hold the latch for one door; the door releases it in its own finally.
17
+ * Holds nest under the same action name and across names; a release
18
+ * only retires its own hold.
19
+ * @param action the destructive action in flight (the door's own name)
20
+ * @returns the door's release closure, idempotent for its own hold
21
+ */
22
+ export function holdLifecycle(action) {
23
+ holders.set(action, (holders.get(action) ?? 0) + 1);
24
+ return () => {
25
+ const left = (holders.get(action) ?? 1) - 1;
26
+ if (left <= 0)
27
+ holders.delete(action);
28
+ else
29
+ holders.set(action, left);
30
+ };
31
+ }
32
+ /**
33
+ * The earliest action whose teardown is in flight, or null — read by
34
+ * the run press before its press reserve and record mint, and re-read
35
+ * by the press after its last await (runsStart's enqueue gate).
36
+ * @returns the held action name, or null when no teardown is in flight
37
+ */
38
+ export function lifecycleInFlight() {
39
+ const first = holders.keys().next();
40
+ return first.done ? null : first.value;
41
+ }
42
+ //# sourceMappingURL=lifecycleLatch.js.map
@@ -1,6 +1,7 @@
1
1
  import { emitModifierKinds } from "@melite/comfyui-cordis";
2
2
  import type { ModelsService } from "@melite/comfyui-cordis";
3
3
  import type { CardRegistryService } from "./cardsRegistry.js";
4
+ import type { FlowsSeat } from "./flowsData.js";
4
5
  import { toolBaseRows } from "./toolProjection.js";
5
6
  import type { FamilyModelsSeat } from "./flowsFamilyCompose.js";
6
7
  /** A card id → its package dir. The cardPackages rows are package
@@ -63,7 +64,7 @@ export declare function flowLeafDocs(repo: string, flowName: string): Array<{
63
64
  * Dangling refs line null — visible drift, never a refusal. */
64
65
  /** @param modelsSeat the context's models service when mounted (the
65
66
  * same seat-threading law the runs doors ride) */
66
- export declare function skillLineForRef(repo: string, ref: string, modelsSeat?: FamilyModelsSeat | null): Record<string, unknown>;
67
+ export declare function skillLineForRef(repo: string, ref: string, modelsSeat?: FamilyModelsSeat | null, flowsSeat?: FlowsSeat | null): Record<string, unknown>;
67
68
  /** The lane's models seat as the CARD arm reads it: the four
68
69
  * disclosure methods (family rows, path/file presence, catalog
69
70
  * artifacts). ModelsService satisfies it structurally; ctx.get
@@ -88,6 +89,6 @@ export declare function loadCard(repo: string, cards: CardRegistryService, model
88
89
  /** @param modelsSeat the context's models service when mounted — the
89
90
  * flow's skill lines resolve through the seat the runs doors
90
91
  * thread (the lane-seat law); the booted singleton otherwise */
91
- export declare function loadFlow(repo: string, flowName: string, modelsSeat?: FamilyModelsSeat | null): Record<string, unknown>;
92
+ export declare function loadFlow(repo: string, flowName: string, modelsSeat?: FamilyModelsSeat | null, flowsSeat?: FlowsSeat | null): Record<string, unknown>;
92
93
  /** First-non-blank query value (the catalogs qFirst shape). */
93
94
  //# sourceMappingURL=loadPlane.d.ts.map