@melite/harness-provisioner 0.1.5-pre-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 CHANGED
@@ -1,8 +1,3 @@
1
- ---
2
- description: The vanilla-DSH provisioner — mounts the Melite estate bundle and renders ready-to-boot profiles into any DSH_HOME.
3
- kind: package-bundle
4
- ---
5
-
6
1
  # @melite/harness-provisioner
7
2
 
8
3
  The provisioner mounts the Melite estate into a vanilla DSH installation and
@@ -31,19 +26,21 @@ Declared exports: `.` (the workspace-linked bundle row) and `./package.json`.
31
26
  ```sh
32
27
  node packages/harness/provisioner/bin/infer-provision.mjs all
33
28
  node packages/harness/provisioner/bin/infer-provision.mjs profile melite-test
34
- node packages/harness/provisioner/bin/infer-provision.mjs profile headless --dsh-home /tmp/melite-dsh
29
+ node packages/harness/provisioner/bin/infer-provision.mjs profile estate --dsh-home /tmp/melite-dsh
35
30
  ```
36
31
 
37
- `all` renders `inference`, `headless`, `estate`, and `melite-test`, then runs
38
- pnpm in each rendered profile. The output is machine-local state; the source
39
- of truth is this package and the workspace.
32
+ `all` renders `melite-test` and `estate`, then runs pnpm in each rendered
33
+ profile. The output is machine-local state; the source of truth is this
34
+ package and the workspace.
40
35
 
41
36
  ## Interfaces
42
37
 
43
- - `inference` and `melite-test` mount the web app and the browser card UI.
44
- - `headless` mounts the DSH headless app. `MELITE_HEADLESS=1` selects the
45
- delegated run interface.
46
- - `estate` mounts the SDK app and the headless tool interface.
38
+ - `melite-test` mounts the web app and the browser card UI.
39
+ - `estate` mounts the SDK app as a job-server lane.
40
+ - Headless one-shot runs are DSH's own surface: `dsh headless "task brief"`
41
+ rides DSH's shipped `headless` profile. Melite renders no parallel headless
42
+ mount; the run doors (`melite_flow` / `run_status`) seat from the home's
43
+ persisted `/melite-runs` record in every profile.
47
44
 
48
45
  The tool transport is in-process through the mounted estate row. Do not add a
49
46
  `MELITE_GATEWAY` setting or a second HTTP service.
@@ -61,7 +58,7 @@ profile is not a substitute for reading that reference.
61
58
  ## Verification
62
59
 
63
60
  ```sh
64
- pnpm --dir packages/harness/provisioner exec infer-provision profile headless --dsh-home /tmp/melite-dsh
61
+ pnpm --dir packages/harness/provisioner exec infer-provision profile estate --dsh-home /tmp/melite-dsh
65
62
  pnpm run test
66
63
  pnpm run lint
67
64
  ```
@@ -92,6 +89,6 @@ Independent — no conversation state.
92
89
 
93
90
  - **Rendered profiles are machine-local state** — they are not a source of
94
91
  truth; re-render after manifest or workspace changes.
95
- - **Headless selection is render-time** — `MELITE_HEADLESS` picks the
96
- delegated run interface per profile; there is no per-request interface
97
- switch.
92
+ - **There is no melite headless profile** — HEADLESS IS DSH'S
93
+ (`dsh headless "task"`); `profile headless` refuses loud, and run-door
94
+ seating follows the home's `/melite-runs` record, not a render flag.
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * The bundle patch (cordis.patch.yml) covers the ROWS; this bin covers
6
6
  * the PROFILES: renders ready-to-boot profile dirs (melite-test /
7
- * headless / estate) and installs their link deps. Every render
7
+ * estate) and installs their link deps. Every render
8
8
  * stamps render-provenance.json (F5: who/what/when/flags) and holds
9
9
  * the profile's render lock across render+install (F6).
10
10
  * Self-locating — every path derives from this file's own location
@@ -32,13 +32,14 @@
32
32
  * brain — plus any operator rows spliced verbatim by --profile-rows
33
33
  * (llm provider rows ride the profile layer the same way the web
34
34
  * profile's own patch carries them; the file is never re-serialized).
35
- * The template pins: our bundle + the dsh web base for 'melite-test',
36
- * the plain headless base for 'headless'.
35
+ * The template pins: our bundle + the dsh web base for 'melite-test'.
36
+ * There is no melite headless profile: HEADLESS IS DSH'S (`dsh headless`,
37
+ * its own shipped `headless` profile) — melite renders no parallel mount.
37
38
  */
38
39
 
39
40
  import { execSync } from 'node:child_process'
40
41
  import { createHash } from 'node:crypto'
41
- import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, unlinkSync, writeFileSync } from 'node:fs'
42
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, unlinkSync, writeFileSync } from 'node:fs'
42
43
  import { dirname, join, resolve } from 'node:path'
43
44
  import { fileURLToPath } from 'node:url'
44
45
  import process from 'node:process'
@@ -59,6 +60,13 @@ const ESTATE_AGENT_ROUTE = flag('--estate-agent-route', '')
59
60
  const ESTATE_STATE_ROOT = flag('--estate-state-root', '')
60
61
  const PROFILE_ROWS = flag('--profile-rows', '')
61
62
 
63
+
64
+ // files IT rendered. A package.json with no provenance stamp naming
65
+ // this renderer (a hand-composed profile, another tool's output)
66
+
67
+ // original gone. See the guard at the package.json write.
68
+ const FORCE_RENDER = argv.includes('--force-render')
69
+
62
70
  const log = (...a) => console.log(...a)
63
71
  const die = (msg) => { console.error('infer-provision: ' + msg); process.exit(1) }
64
72
 
@@ -200,24 +208,13 @@ const PROFILE_BASES = {
200
208
  'melite-test': ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app', '@melite/harness-provisioner',
201
209
  '@melite/harness-tools', '@melite-plugin/dsh-estate', '@melite/card-base', '@melite/three-client',
202
210
  '@melite-plugin/dsh-card-view', '@melite-plugin/dsh-card-deck', '@melite-plugin/dsh-gallery',
203
- '@melite/video-h3-timeline', '@melite/motion-motion'],
204
- // headless = the agent server: one-shot task runner + the tools
205
- // plane (harness-tools self-registers its melite-tools row; the
206
- // renderer disables the web-plane doors row in this mount).
207
- // dsh-estate rides here too: a headless task that composes media
208
- // reaches the same runs/queue/drafts seats through melite_flow —
209
- // without the bundle the tool answers ABSENCE (the estate-drive
210
-
211
- // unpinned queue seat refuses loud by design).
212
- headless: ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-headless', '@melite/harness-provisioner',
213
- '@melite/harness-tools', '@melite-plugin/dsh-estate'],
211
+ '@melite/video-h3-timeline', '@melite/motion-motion', '@melite/image-input-prep'],
214
212
  // estate = the job server: the SDK JSON-RPC base (estate-drive
215
213
 
216
214
  // in-process — no second app, no HTTP). dsh-estate bundles the
217
215
  // runs/queue/drafts seats — without it melite_flow answers
218
216
  // ABSENCE ("no seat of that family is mounted on this lane"),
219
217
 
220
- // tools row's HEADLESS interface by its self-registration id.
221
218
  estate: ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-sdk-app', '@melite/harness-provisioner',
222
219
  '@melite/harness-tools', '@melite-plugin/dsh-estate'],
223
220
  }
@@ -268,7 +265,7 @@ function renderProfile(name) { // In-box bundles (@deepseek-ai/*) resolve from
268
265
  // from a registry - only OUR link goes in dependencies. Mirrors what
269
266
  // `dsh plugin` itself initializes (PROFILE_TEMPLATES + reconcile).
270
267
 
271
- // old `|| PROFILE_BASES.headless` fallback turned a typo into a
268
+ // old default-to-first-base fallback turned a typo into a
272
269
  // bootable-looking directory with the wrong rows and exit 0.
273
270
  if (!(name in PROFILE_BASES)) {
274
271
  console.error(`infer-provision: unknown profile '${name}' — known: ${Object.keys(PROFILE_BASES).join(', ')}`)
@@ -283,7 +280,7 @@ function renderProfile(name) { // In-box bundles (@deepseek-ai/*) resolve from
283
280
  // deps — every plugin package the bundle rows name must become a
284
281
  // DIRECT link: dep here. The provisioner's manifest declares them
285
282
  // as workspace:* specs; a link:-only scan dropped them, so the
286
- // headless/estate profiles mounted @melite/harness-tools as a
283
+ // server profile mounted @melite/harness-tools as a
287
284
  // bundle row with NO installed package — the tool lane could not
288
285
  // load (ledger li-headless-profile-deps). workspace specs resolve
289
286
  // by scanning this repository's own pnpm workspace globs
@@ -327,6 +324,24 @@ function renderProfile(name) { // In-box bundles (@deepseek-ai/*) resolve from
327
324
  const pkgPath = join(dst, 'package.json')
328
325
  let pkg = { name: 'dsh-profile-' + name, private: true, dependencies: {} }
329
326
  if (existsSync(pkgPath)) {
327
+ // F1 refuse-or-backup: without a stamp naming THIS renderer the
328
+ // render dies loud; --force-render backs the file up and proceeds.
329
+ // A file with our own stamp re-renders freely — the no-drift law
330
+ // (the renderer owns its output wholesale) is unchanged.
331
+ if (!FORCE_RENDER) {
332
+ let mine = false
333
+ try {
334
+ const prov = JSON.parse(readFileSync(join(dst, 'render-provenance.json'), 'utf8'))
335
+ mine = prov !== null && typeof prov === 'object' && prov.renderer === 'infer-provision'
336
+ } catch { /* no stamp, or unparseable: not provably ours */ }
337
+ if (!mine) {
338
+ die('refusing to overwrite ' + pkgPath + ' — no render-provenance.json names this renderer '
339
+ + '(a hand-composed or foreign file). Move it aside, or pass --force-render to back it up '
340
+ + 'as package.json.prerender.bak and re-render')
341
+ }
342
+ } else {
343
+ copyFileSync(pkgPath, pkgPath + '.prerender.bak')
344
+ }
330
345
  try { pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) } catch { /* re-render */ }
331
346
  }
332
347
  pkg.name = pkg.name || 'dsh-profile-' + name
@@ -359,14 +374,14 @@ function renderProfile(name) { // In-box bundles (@deepseek-ai/*) resolve from
359
374
  pkg.dsh = { profile: { bundles: [...new Set(bundles)] } }
360
375
  writeFileAtomic(join(dst, 'package.json'), JSON.stringify(pkg, null, 2) + String.fromCharCode(10))
361
376
  // The cordis.yml USER layer stays EMPTY — the bundle patch owns every
362
- // melite row (no drift). NON-web mounts (headless/SDK) get the
377
+ // melite row (no drift). NON-web mounts (SDK) get the
363
378
  // web-surface rows mechanically DISABLED in the profile patch (by the
364
379
 
365
380
  // exists to activate them. The bundle owns the rows; the renderer
366
381
  // owns the per-app mount shape and the seat pins below.
367
382
  const webMount = bundles.includes('@deepseek-ai/dsh-web-app')
368
383
  // melite-tools-doors is web-profiles-only by its own contract (the
369
- // ✦ doors need webServer+llm — absent in sdk/headless mounts); the
384
+ // ✦ doors need webServer+llm — absent in sdk mounts); the
370
385
  // renderer disables it with the other web rows in non-web mounts.
371
386
  const webRows = ['melite-tools-doors',
372
387
  'infer-card-view', 'ray-card-deck', 'infer-gallery']
@@ -376,16 +391,33 @@ function renderProfile(name) { // In-box bundles (@deepseek-ai/*) resolve from
376
391
  // render's own repo root), so the runs/drafts seats never boot
377
392
  // unpinned (they refuse loud by design). agentRoute names the agent
378
393
  // brain (provider/model); absent, the estate logs the engine unseated
379
- // — the honest state, never a silent default.
394
+ // — the honest state, never a silent default. acquireStallTimeoutMs
395
+
396
+ // the lane rides a pinned 10s, never the library default by accident.
397
+
398
+ // downloads-stream audit): the lane is the long-lived process that
399
+ // owns fetch lifetimes — its durable claim ticker claims requested
400
+ // rows and stamps the claimer heartbeat, so a task press's
401
+ // wanted download survives its own session dying. A non-web mount
402
+ // (estate job server) is short-lived: a claimer in
403
+ // it would orphan every fetch it died mid-flight, so its presses
404
+ // take their own wire, exactly as before.
380
405
  const estateRow = bundles.includes('@melite-plugin/dsh-estate')
381
406
  ? '# ESTATE SEAT PIN — the estate row config owns every seat:\n'
382
407
  + '# repoRoot pins the runs/drafts seats (unpinned boots refuse loud);\n'
383
408
  + '# stateRoot overrides it (J12: walls render hermetic roots by\n'
384
409
  + '# config — stateRoot wins over repoRoot in the queue seat).\n'
385
410
  + '# agentRoute names the agent brain (absent = unseated, logged loud).\n'
411
+ + '# acquireStallTimeoutMs: the deliberate stall budget (audit F7).\n'
412
+ + (webMount
413
+ ? '# durableDownloads: the lane claims requested rows (the lifetime\n'
414
+ + '# finding) — long-lived web mounts only, never a task process.\n'
415
+ : '')
386
416
  + '- id: melite-estate\n'
387
417
  + ' config:\n'
388
418
  + ' repoRoot: ' + JSON.stringify(resolve(PROVISIONER, '../../..')) + '\n'
419
+ + ' acquireStallTimeoutMs: 10000\n'
420
+ + (webMount ? ' durableDownloads: true\n' : '')
389
421
  + (ESTATE_STATE_ROOT
390
422
  ? ' stateRoot: ' + JSON.stringify(ESTATE_STATE_ROOT) + '\n'
391
423
  : '')
@@ -422,23 +454,7 @@ function renderProfile(name) { // In-box bundles (@deepseek-ai/*) resolve from
422
454
  + '# No webServer service in this mount: the four web-surface rows\n'
423
455
  + '# are disabled so activation cannot pend forever.\n'
424
456
  + webRows.map(id => '- id: ' + id + '\n disabled: true\n').join('')
425
- + estateRow + operatorRows
426
- // DELEGATED-OPERATOR MOUNTS (estate | headless): this mount
427
- // RUNS jobs — the tools row selects the HEADLESS interface
428
- // (the melite_flow + run_status run doors). Pinned in the
429
- // render (not ambient env) because the interface is profile
430
- // state: browser mounts compose, the job server executes.
431
- // The 'headless' agent server rides the same pin — its base
432
- // list promises melite_flow ("a headless task that composes
433
- // media reaches the same runs/queue/drafts seats"), and the
434
-
435
- // compose-only mount: benches composed and validated, every
436
- // execution refused at the absent verb. Every other mount
437
- // keeps the browser default.
438
- + (name === 'estate' || name === 'headless'
439
- ? '# HEADLESS interface: the delegated operator runs jobs here.\n'
440
- + '- id: melite-tools\n config:\n headless: true\n'
441
- : ''))
457
+ + estateRow + operatorRows)
442
458
  writeFileAtomic(join(dst, 'cordis.yml'), '# rendered by infer-provision' + '\n' + '[]' + '\n')
443
459
  const ws = join(dst, 'pnpm-workspace.yaml')
444
460
  if (!existsSync(ws)) writeFileAtomic(ws, 'packages:' + '\n' + ' - node_modules/*' + '\n')
@@ -517,7 +533,7 @@ switch (cmd) {
517
533
  // command renders + installs every profile (the gateway health
518
534
  // check died with the gateway — there is no second process to
519
535
  // probe anymore).
520
- for (const name of ['melite-test', 'headless', 'estate']) {
536
+ for (const name of ['melite-test', 'estate']) {
521
537
  renderInstall(name)
522
538
  }
523
539
  log('boot with:')
@@ -527,13 +543,14 @@ switch (cmd) {
527
543
  log(' launch — binary pin, version floor, home, and unit. The shapes below')
528
544
  log(' are what the door runs UNDER THE HOOD, never a hand-run shortcut:)')
529
545
  log(' dsh --profile melite-test # the studio GUI + TEST lane (one process, no :33081)')
530
- log(' dsh --profile headless "<task>" # one-shot agent with card tools')
531
546
  log(' dsh --profile estate # the SDK job server (estate row)')
547
+ log(' one-shot agents ride DSH itself: dsh headless "<task>" (DSH ships the')
548
+ log(' headless profile; melite maintains no parallel mount)')
532
549
  break
533
550
  }
534
551
  case 'profile': {
535
552
  renderInstall(PROFILE)
536
- log('boot with: dsh --profile ' + PROFILE + (PROFILE === 'melite-test' ? '' : ' "<task>"'))
553
+ log('boot with: dsh --profile ' + PROFILE)
537
554
  break
538
555
  }
539
556
  // the `preset` arm died with installPreset (undefined since the
package/cordis.patch.yml CHANGED
@@ -4,13 +4,16 @@
4
4
  # Installing this bundle into ANY profile (dsh plugin --profile <name>
5
5
  # add <repo>/packages/harness/dsh/provisioner) mounts:
6
6
  #
7
- # infer-tools the tool registry, TWO interfaces (profile
8
- # config / MELITE_HEADLESS selects): BASE = discovery
9
- # (melite_discover, melite_load), the bench
10
- # (melite_construct), management (comfy_manage),
11
- # craft (skill_index, skill_read), audit
12
- # (ledger_tail); HEADLESS adds the run doors
13
- # melite_flow / run_status (queue-native).
7
+ # infer-tools the tool registry, ONE interface: BASE =
8
+ # discovery (melite_discover, melite_load), the
9
+ # bench (melite_construct), management
10
+ # (comfy_manage), craft (skill_index,
11
+ # skill_read), audit (ledger_tail). The run
12
+ # doors melite_flow / run_status seat from the
13
+ # home's persisted /melite-runs record — there
14
+ # is no config or env selector (HEADLESS IS
15
+ # DSH'S: `dsh headless "task"` is DSH's own
16
+ # shipped profile).
14
17
  # enhance_prompt is AD HOC (MELITE_ADHOC), never base.
15
18
  # infer-card-view-* editable action cards rendered in the
16
19
  # conversation (host row serves the editor bundle
@@ -47,8 +50,9 @@
47
50
  # melite_load → skill_read), never a pre-loaded catalog. The pin
48
51
  # silences the HOST layer only: a preset that genuinely wants local
49
52
  # skill discovery still mounts its OWN preset-layer row. Without this
50
- # pin the headless profile auto-injects (only dsh-web-app disables the
51
- # host row, and headless does not bundle it). The row below is an
53
+ # pin the agent-server profiles auto-inject (only dsh-web-app disables
54
+ # the host row, and the server profiles do not bundle it). The row
55
+ # below is an
52
56
  # OVERRIDE (column-0 `- id:`, no `insert:`): it patches the dsh-base
53
57
  # row and mounts nothing.
54
58
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@melite/harness-provisioner",
3
- "version": "0.1.5-pre-alpha",
4
- "license": "SSPL-1.0",
5
- "description": "Vanilla-DSH provisioner for the inference.cpp media stack: one bundle mounts the estate row (in-process seats, no second process), the tool surface, the card view/deck, media previews, and the runs gallery — and the infer-provision bin renders ready-to-boot profiles (inference / headless / estate / melite-test) into any DSH_HOME.",
3
+ "version": "0.2.2-alpha",
4
+ "license": "AGPL-3.0-or-later",
5
+ "description": "The vanilla-DSH provisioner — mounts the Melite estate bundle and renders ready-to-boot profiles into any DSH_HOME.",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
@@ -21,36 +21,45 @@
21
21
  "bin": {
22
22
  "infer-provision": "./bin/infer-provision.mjs"
23
23
  },
24
- "devDependencies": {
25
- "@types/node": "^22.20.0",
26
- "typescript": "^5.9.3"
27
- },
28
24
  "dependencies": {
29
- "@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2",
30
- "@melite-plugin/dsh-card-deck": "0.1.5-pre-alpha",
31
- "@melite-plugin/dsh-card-view": "0.1.5-pre-alpha",
32
- "@melite-plugin/dsh-estate": "0.1.5-pre-alpha",
33
- "@melite-plugin/dsh-gallery": "0.1.5-pre-alpha",
34
- "@melite/harness-tools": "0.1.5-pre-alpha",
35
- "@melite/motion-motion": "0.1.5-pre-alpha",
36
- "@melite/3d-img-to-mesh": "0.1.5-pre-alpha",
37
- "@melite/video-h3-timeline": "0.1.5-pre-alpha"
25
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.1-rc.2",
26
+ "@melite-plugin/dsh-card-deck": "0.2.2-alpha",
27
+ "@melite/3d-img-to-mesh": "0.2.2-alpha",
28
+ "@melite-plugin/dsh-estate": "0.2.2-alpha",
29
+ "@melite/harness-tools": "0.2.2-alpha",
30
+ "@melite-plugin/dsh-card-view": "0.2.2-alpha",
31
+ "@melite-plugin/dsh-gallery": "0.2.2-alpha",
32
+ "@melite/video-h3-timeline": "0.2.2-alpha",
33
+ "@melite/motion-motion": "0.2.2-alpha"
38
34
  },
39
35
  "dsh": {
40
36
  "bundle": {
41
37
  "patch": "./cordis.patch.yml"
42
38
  }
43
39
  },
44
- "engines": {
45
- "dsh": ">=0.1.1-rc.1"
46
- },
47
40
  "peerDependencies": {
48
- "@deepseek-ai/dsh": ">=0.2.0-rc.1 <0.3.0"
41
+ "@deepseek-ai/dsh": ">=0.2.1-rc.2 <0.3.0"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/JayDataEngineer/melite.git",
46
+ "directory": "packages/harness/provisioner"
49
47
  },
48
+ "keywords": [
49
+ "melite",
50
+ "comfyui",
51
+ "cordis",
52
+ "agent",
53
+ "media-generation",
54
+ "dsh-bundle"
55
+ ],
50
56
  "scripts": {
51
57
  "build": "tsc -p tsconfig.build.json",
52
58
  "typecheck": "tsc --noEmit"
53
59
  },
60
+ "engines": {
61
+ "node": ">=22.18.0"
62
+ },
54
63
  "publishConfig": {
55
64
  "access": "public"
56
65
  }