spexcode 0.6.6 → 0.6.8
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 +12 -7
- package/node_modules/@spexcode/session-application/dist/index.d.ts +17 -0
- package/node_modules/@spexcode/session-application/dist/index.js +35 -0
- package/node_modules/@spexcode/session-application/dist/migration.d.ts +51 -0
- package/node_modules/@spexcode/session-application/dist/migration.js +694 -0
- package/node_modules/@spexcode/session-application/dist/production.d.ts +109 -0
- package/node_modules/@spexcode/session-application/dist/production.js +438 -0
- package/node_modules/@spexcode/session-application/dist/schema.d.ts +2 -0
- package/node_modules/@spexcode/session-application/dist/schema.js +39 -0
- package/node_modules/@spexcode/session-application/package.json +29 -0
- package/node_modules/@spexcode/session-events/dist/errors.d.ts +6 -0
- package/node_modules/@spexcode/session-events/dist/errors.js +11 -0
- package/node_modules/@spexcode/session-events/dist/index.d.ts +46 -0
- package/node_modules/@spexcode/session-events/dist/index.js +245 -0
- package/node_modules/@spexcode/session-events/dist/schema.d.ts +3 -0
- package/node_modules/@spexcode/session-events/dist/schema.js +44 -0
- package/node_modules/@spexcode/session-events/package.json +24 -0
- package/node_modules/@spexcode/session-protocol/dist/canonical.d.ts +36 -0
- package/node_modules/@spexcode/session-protocol/dist/canonical.js +139 -0
- package/node_modules/@spexcode/session-protocol/dist/engine.d.ts +22 -0
- package/node_modules/@spexcode/session-protocol/dist/engine.js +478 -0
- package/node_modules/@spexcode/session-protocol/dist/errors.d.ts +8 -0
- package/node_modules/@spexcode/session-protocol/dist/errors.js +39 -0
- package/node_modules/@spexcode/session-protocol/dist/index.d.ts +60 -0
- package/node_modules/@spexcode/session-protocol/dist/index.js +4 -0
- package/node_modules/@spexcode/session-protocol/dist/schema.d.ts +36 -0
- package/node_modules/@spexcode/session-protocol/dist/schema.js +192 -0
- package/node_modules/@spexcode/{session-core → session-protocol}/package.json +4 -8
- package/node_modules/@spexcode/session-runtime/dist/errors.d.ts +6 -0
- package/node_modules/@spexcode/session-runtime/dist/errors.js +11 -0
- package/node_modules/@spexcode/session-runtime/dist/index.d.ts +33 -0
- package/node_modules/@spexcode/session-runtime/dist/index.js +193 -0
- package/node_modules/@spexcode/session-runtime/dist/schema.d.ts +2 -0
- package/node_modules/@spexcode/session-runtime/dist/schema.js +37 -0
- package/node_modules/@spexcode/session-runtime/package.json +24 -0
- package/node_modules/@spexcode/session-selflaunch/bin/spex-session.mjs +4 -0
- package/node_modules/@spexcode/session-selflaunch/dist/cli.d.ts +25 -0
- package/node_modules/@spexcode/session-selflaunch/dist/cli.js +156 -0
- package/node_modules/@spexcode/session-selflaunch/dist/index.d.ts +28 -0
- package/node_modules/@spexcode/session-selflaunch/dist/index.js +25 -0
- package/node_modules/@spexcode/session-selflaunch/dist/locality.d.ts +20 -0
- package/node_modules/@spexcode/session-selflaunch/dist/locality.js +83 -0
- package/node_modules/@spexcode/session-selflaunch/dist/path.d.ts +13 -0
- package/node_modules/@spexcode/session-selflaunch/dist/path.js +45 -0
- package/node_modules/@spexcode/session-selflaunch/package.json +35 -0
- package/node_modules/@spexcode/session-topology/dist/errors.d.ts +6 -0
- package/node_modules/@spexcode/session-topology/dist/errors.js +11 -0
- package/node_modules/@spexcode/session-topology/dist/index.d.ts +24 -0
- package/node_modules/@spexcode/session-topology/dist/index.js +173 -0
- package/node_modules/@spexcode/session-topology/dist/schema.d.ts +3 -0
- package/node_modules/@spexcode/session-topology/dist/schema.js +27 -0
- package/node_modules/@spexcode/session-topology/package.json +24 -0
- package/node_modules/@spexcode/spec-cli/bin/spex.mjs +56 -19
- package/node_modules/@spexcode/spec-cli/dist/cli.js +102 -59
- package/node_modules/@spexcode/spec-cli/dist/client.d.ts +1 -3
- package/node_modules/@spexcode/spec-cli/dist/client.js +49 -30
- package/node_modules/@spexcode/spec-cli/dist/codex-runtime-generations.d.ts +11 -0
- package/node_modules/@spexcode/spec-cli/dist/codex-runtime-generations.js +46 -9
- package/node_modules/@spexcode/spec-cli/dist/delivery-lock.d.ts +2 -0
- package/node_modules/@spexcode/spec-cli/dist/delivery-lock.js +58 -0
- package/node_modules/@spexcode/spec-cli/dist/doctor.js +53 -11
- package/node_modules/@spexcode/spec-cli/dist/execution-trace.d.ts +1 -0
- package/node_modules/@spexcode/spec-cli/dist/execution-trace.js +2 -2
- package/node_modules/@spexcode/spec-cli/dist/gateway-hub.js +2 -1
- package/node_modules/@spexcode/spec-cli/dist/gateway.js +6 -3
- package/node_modules/@spexcode/spec-cli/dist/graphCache.js +32 -2
- package/node_modules/@spexcode/spec-cli/dist/graphSnapshot.js +57 -2
- package/node_modules/@spexcode/spec-cli/dist/graphStream.d.ts +2 -0
- package/node_modules/@spexcode/spec-cli/dist/graphStream.js +83 -3
- package/node_modules/@spexcode/spec-cli/dist/guide.js +20 -7
- package/node_modules/@spexcode/spec-cli/dist/harness-select.js +16 -3
- package/node_modules/@spexcode/spec-cli/dist/harness.d.ts +15 -3
- package/node_modules/@spexcode/spec-cli/dist/harness.js +331 -50
- package/node_modules/@spexcode/spec-cli/dist/help.js +11 -8
- package/node_modules/@spexcode/spec-cli/dist/hook-prompts.js +8 -0
- package/node_modules/@spexcode/spec-cli/dist/host-resources.js +29 -8
- package/node_modules/@spexcode/spec-cli/dist/host.d.ts +7 -0
- package/node_modules/@spexcode/spec-cli/dist/host.js +93 -0
- package/node_modules/@spexcode/spec-cli/dist/index.js +324 -22
- package/node_modules/@spexcode/spec-cli/dist/init.js +1 -1
- package/node_modules/@spexcode/spec-cli/dist/lint.js +70 -35
- package/node_modules/@spexcode/spec-cli/dist/listen.d.ts +3 -2
- package/node_modules/@spexcode/spec-cli/dist/listen.js +14 -2
- package/node_modules/@spexcode/spec-cli/dist/machine-peer.js +1 -1
- package/node_modules/@spexcode/spec-cli/dist/materialize.d.ts +2 -2
- package/node_modules/@spexcode/spec-cli/dist/materialize.js +176 -35
- package/node_modules/@spexcode/spec-cli/dist/pty-bridge.js +14 -14
- package/node_modules/@spexcode/spec-cli/dist/reviews.js +12 -7
- package/node_modules/@spexcode/spec-cli/dist/runtime-ownership.d.ts +11 -0
- package/node_modules/@spexcode/spec-cli/dist/runtime-ownership.js +79 -1
- package/node_modules/@spexcode/spec-cli/dist/session-application.d.ts +23 -0
- package/node_modules/@spexcode/spec-cli/dist/session-application.js +189 -0
- package/node_modules/@spexcode/spec-cli/dist/session-declarations.js +13 -1
- package/node_modules/@spexcode/spec-cli/dist/session-files.d.ts +6 -0
- package/node_modules/@spexcode/spec-cli/dist/session-files.js +13 -1
- package/node_modules/@spexcode/spec-cli/dist/session-follow.js +39 -22
- package/node_modules/@spexcode/{session-core/dist/record-lock.d.ts → spec-cli/dist/session-record-lock.d.ts} +0 -4
- package/node_modules/@spexcode/spec-cli/dist/session-record-lock.js +94 -0
- package/node_modules/@spexcode/spec-cli/dist/session-runtime-adapter.d.ts +44 -0
- package/node_modules/@spexcode/spec-cli/dist/session-runtime-adapter.js +37 -0
- package/node_modules/@spexcode/spec-cli/dist/session-timeline.d.ts +25 -2
- package/node_modules/@spexcode/spec-cli/dist/session-timeline.js +68 -11
- package/node_modules/@spexcode/spec-cli/dist/session-web.js +4 -4
- package/node_modules/@spexcode/spec-cli/dist/sessions.d.ts +108 -15
- package/node_modules/@spexcode/spec-cli/dist/sessions.js +1465 -744
- package/node_modules/@spexcode/spec-cli/dist/source-list.d.ts +13 -0
- package/node_modules/@spexcode/spec-cli/dist/source-list.js +99 -0
- package/node_modules/@spexcode/spec-cli/dist/source-read.d.ts +16 -0
- package/node_modules/@spexcode/spec-cli/dist/source-read.js +84 -0
- package/node_modules/@spexcode/spec-cli/dist/spec-attachments.d.ts +7 -0
- package/node_modules/@spexcode/spec-cli/dist/spec-attachments.js +89 -0
- package/node_modules/@spexcode/spec-cli/dist/spec-body-edit.d.ts +23 -0
- package/node_modules/@spexcode/spec-cli/dist/spec-body-edit.js +138 -0
- package/node_modules/@spexcode/spec-cli/dist/supervise.js +15 -6
- package/node_modules/@spexcode/spec-cli/dist/transcript-reader.d.ts +36 -0
- package/node_modules/@spexcode/spec-cli/dist/transcript-reader.js +251 -0
- package/node_modules/@spexcode/spec-cli/hooks/dispatch.sh +19 -31
- package/node_modules/@spexcode/spec-cli/hooks/harness.sh +6 -6
- package/node_modules/@spexcode/spec-cli/package.json +6 -6
- package/node_modules/@spexcode/spec-cli/templates/hooks/post-checkout +4 -2
- package/node_modules/@spexcode/spec-cli/templates/hooks/post-merge +2 -1
- package/node_modules/@spexcode/spec-cli/templates/hooks/pre-commit +5 -3
- package/node_modules/@spexcode/spec-cli/templates/hooks/reference-transaction +5 -3
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/commands/spec.md +2 -7
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/idle/idle.sh +4 -10
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/idle/spec.md +1 -1
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/mark-active/mark-active.sh +22 -24
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/mark-active/spec.md +10 -2
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/session-fail/fail.sh +8 -7
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/session-fail/spec.md +3 -1
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/session-listen/session-listen.sh +133 -0
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/session-listen/spec.md +36 -0
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/spec.md +2 -0
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/stop-gate/spec.md +1 -1
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/core/stop-gate/stop-gate.sh +17 -20
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/skills/merge/spec.md +33 -0
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/skills/spec.md +2 -6
- package/node_modules/@spexcode/spec-cli/templates/spec/project/.plugins/spec.md +7 -0
- package/node_modules/@spexcode/spec-core/dist/anchors.d.ts +13 -2
- package/node_modules/@spexcode/spec-core/dist/anchors.js +311 -15
- package/node_modules/@spexcode/spec-core/dist/git.d.ts +4 -0
- package/node_modules/@spexcode/spec-core/dist/git.js +9 -9
- package/node_modules/@spexcode/spec-core/dist/layout.d.ts +12 -0
- package/node_modules/@spexcode/spec-core/dist/layout.js +4 -2
- package/node_modules/@spexcode/spec-core/dist/resilience.d.ts +1 -0
- package/node_modules/@spexcode/spec-core/dist/resilience.js +8 -0
- package/node_modules/@spexcode/spec-core/dist/review/reviewFilters.d.ts +1 -0
- package/node_modules/@spexcode/spec-core/dist/review/reviewFilters.js +7 -3
- package/node_modules/@spexcode/spec-core/dist/review/reviewQuery.d.ts +1 -0
- package/node_modules/@spexcode/spec-core/dist/review/reviewQuery.js +4 -0
- package/node_modules/@spexcode/spec-core/dist/specs.d.ts +2 -0
- package/node_modules/@spexcode/spec-core/dist/specs.js +30 -0
- package/node_modules/@spexcode/spec-core/package.json +4 -1
- package/node_modules/@spexcode/spec-eval/dist/cli.js +1 -1
- package/node_modules/@spexcode/spec-eval/dist/evaltab.d.ts +1 -0
- package/node_modules/@spexcode/spec-eval/dist/evaltab.js +6 -1
- package/node_modules/@spexcode/spec-eval/dist/freshness.d.ts +1 -1
- package/node_modules/@spexcode/spec-eval/dist/freshness.js +12 -12
- package/node_modules/@spexcode/spec-eval/dist/host.d.ts +2 -1
- package/node_modules/@spexcode/spec-eval/dist/sessioneval.d.ts +2 -1
- package/node_modules/@spexcode/spec-eval/dist/sessioneval.js +20 -3
- package/node_modules/@spexcode/spec-eval/package.json +2 -2
- package/node_modules/@spexcode/spec-forge/package.json +2 -2
- package/node_modules/@vscode/tree-sitter-wasm/LICENSE +21 -0
- package/node_modules/@vscode/tree-sitter-wasm/README.md +36 -0
- package/node_modules/@vscode/tree-sitter-wasm/SECURITY.md +41 -0
- package/node_modules/@vscode/tree-sitter-wasm/cgmanifest.json +16 -0
- package/node_modules/@vscode/tree-sitter-wasm/package.json +42 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-bash.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-c-sharp.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-cpp.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-css.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-go.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-ini.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-java.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-javascript.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-php.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-powershell.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-python.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-regex.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-ruby.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-rust.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-tsx.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.js +4075 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm +0 -0
- package/node_modules/@vscode/tree-sitter-wasm/wasm/web-tree-sitter.d.ts +1027 -0
- package/package.json +9 -3
- package/node_modules/@spexcode/session-core/dist/delivery-queue.d.ts +0 -23
- package/node_modules/@spexcode/session-core/dist/delivery-queue.js +0 -195
- package/node_modules/@spexcode/session-core/dist/index.d.ts +0 -5
- package/node_modules/@spexcode/session-core/dist/index.js +0 -5
- package/node_modules/@spexcode/session-core/dist/internal.d.ts +0 -3
- package/node_modules/@spexcode/session-core/dist/internal.js +0 -3
- package/node_modules/@spexcode/session-core/dist/message.d.ts +0 -22
- package/node_modules/@spexcode/session-core/dist/message.js +0 -52
- package/node_modules/@spexcode/session-core/dist/record-lock.js +0 -152
- package/node_modules/@spexcode/session-core/dist/runtime-session.d.ts +0 -50
- package/node_modules/@spexcode/session-core/dist/runtime-session.js +0 -286
- package/node_modules/@spexcode/session-core/dist/session-cursors.d.ts +0 -14
- package/node_modules/@spexcode/session-core/dist/session-cursors.js +0 -82
- package/node_modules/@spexcode/session-core/dist/session-timeline.d.ts +0 -46
- package/node_modules/@spexcode/session-core/dist/session-timeline.js +0 -216
- package/node_modules/@spexcode/spec-cli/hooks/compat/mark-active-0.5.2-eef1.fixture +0 -53
- package/node_modules/@spexcode/spec-cli/hooks/compat/mark-active-sed-v0.fixture +0 -46
|
@@ -71,8 +71,9 @@ FRONTMATTER (YAML between the opening and closing --- lines; every field optiona
|
|
|
71
71
|
duplicates, globs/directories with a selector, and dead/ambiguous units all error loud. A
|
|
72
72
|
selector-scoped governor claims units, not the file, so it stays out of the \`owners\` bound
|
|
73
73
|
(spex spec owner still displays it, marked "(scoped)"). Anchors are optional.
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
Tree-sitter-backed \`.ts\`/\`.tsx\`/\`.py\`/\`.go\`/\`.rs\`/\`.java\`/\`.rb\` anchors recognize
|
|
75
|
+
structural function, method, class, interface, enum, and type declarations. Methods and nested
|
|
76
|
+
declarations use lexical qualified names such as
|
|
76
77
|
\`Class.method\`, \`outer.inner\`, or \`Outer.Inner.method\`; attached decorators belong to
|
|
77
78
|
the declaration's range. Runtime-created/assigned callables, imported aliases, and generated
|
|
78
79
|
names are outside this declaration extractor and therefore resolve as dead anchors.
|
|
@@ -546,8 +547,15 @@ behavior, decided per KIND (and, for a contract file, by its live CONTENT).
|
|
|
546
547
|
── THE FOUR KINDS (all fixed) ──
|
|
547
548
|
spec data .spec/ (incl .plugins/) + spexcode.json — ALWAYS tracked. Git is the database; there is
|
|
548
549
|
deliberately NO way to say "untrack the spec" in this schema.
|
|
549
|
-
|
|
550
|
-
|
|
550
|
+
(no delivery) \`spex init --harness none\` ("harnesses": []) adopts the spec tree, the lint and the git
|
|
551
|
+
hooks and writes NOTHING into any agent's config — the L0-only footprint.
|
|
552
|
+
machine facts spexcode.local.json, the hook shims, plugin bundles — NEVER tracked; always in the
|
|
553
|
+
per-clone exclude. A shim is a machine fact only while it is WHOLLY OURS: where the harness
|
|
554
|
+
discovers its hooks in a file that is ALSO your project config (.claude/settings.json,
|
|
555
|
+
.codex/hooks.json, .zcode/settings.json), SpexCode co-owns only its own hook entries —
|
|
556
|
+
your permissions/env/statusLine/hooks are merged around, never replaced, and uninstall
|
|
557
|
+
takes back exactly those entries. Such a file stays visible to git (hiding yours would be
|
|
558
|
+
data-loss shaped), so keep our absolute toolchain paths out of your commits.
|
|
551
559
|
artifacts the CLAUDE.md/AGENTS.md contract blocks + materialized skills/agents — derived, NEVER
|
|
552
560
|
tracked; hidden via .git/info/exclude. The host's tracked .gitignore is never touched.
|
|
553
561
|
run residue .worktrees/, the global store (~/.spexcode), .git/spexcode evidence — never tracked;
|
|
@@ -621,15 +629,20 @@ Use the session's file list when an artifact belongs in the human's hands:
|
|
|
621
629
|
spex session files retract <path> withdraw one path
|
|
622
630
|
|
|
623
631
|
Posting resolves a relative path from your current directory and records its absolute path beside the global
|
|
624
|
-
session record. It copies, moves, stages, and uploads NOTHING. The path is live: editing the file after
|
|
632
|
+
session record only after confirming it is a readable regular file. It copies, moves, stages, and uploads NOTHING. The path is live: editing the file after
|
|
625
633
|
posting changes what the human downloads. The reference is host-local; opening the session elsewhere cannot
|
|
626
634
|
make its path point at another machine's file.
|
|
627
635
|
|
|
636
|
+
Put raw run artifacts in a persistent directory OUTSIDE the product repository by default. A worktree artifact
|
|
637
|
+
makes merge readiness report a dirty tree and pressures generated evidence into the product commit. Before review,
|
|
638
|
+
run \`spex session files ls\`: a target that disappeared or became unreadable is printed as \`INVALID\` and must be
|
|
639
|
+
recreated or retracted; a valid path prints normally.
|
|
640
|
+
|
|
628
641
|
The session page's top-right files icon is grey while the list is empty. Once live, it opens the posted list;
|
|
629
642
|
choosing a path previews its current text or raster-image bytes in a pop-out, while the adjacent download tool
|
|
630
643
|
downloads it through the backend at that moment. Previews are limited to 2 MiB, text and PNG/JPEG/GIF/WebP;
|
|
631
|
-
other types and larger files say to download instead. A missing, moved, or unreadable target stays listed
|
|
632
|
-
reports that it no longer exists. The backend refuses a preview or download for any path not on that session's
|
|
644
|
+
other types and larger files say to download instead. A missing, moved, or unreadable target stays listed and is
|
|
645
|
+
marked invalid by the CLI; preview/download reports that it no longer exists. The backend refuses a preview or download for any path not on that session's
|
|
633
646
|
list.
|
|
634
647
|
|
|
635
648
|
This is the reverse of a dashboard attachment: [[file-attach]] sends human bytes to an agent. Files publishes
|
|
@@ -6,11 +6,17 @@ const KNOWN = HARNESSES.map((h) => h.id);
|
|
|
6
6
|
// the one-line repair every missing-selection error carries — the field is REQUIRED, never defaulted,
|
|
7
7
|
// because with many harnesses a silent "deliver everywhere" would litter the adopter's tree with artifacts
|
|
8
8
|
// for tools they never installed.
|
|
9
|
-
const MISSING = `spexcode.json has no "harnesses" field — the delivery targets are an EXPLICIT choice, never a default. Declare it, e.g. "harnesses": ["claude"] — members are native ids (${KNOWN.join(', ')}) or {"plugin":"<folder>"}. Fresh adoption: \`spex init --harness <ids>\` stamps it.`;
|
|
9
|
+
const MISSING = `spexcode.json has no "harnesses" field — the delivery targets are an EXPLICIT choice, never a default. Declare it, e.g. "harnesses": ["claude"] — members are native ids (${KNOWN.join(', ')}) or {"plugin":"<folder>"}, and [] means deliver into NO harness (the L0-only posture, \`spex init --harness none\`). Fresh adoption: \`spex init --harness <ids>\` stamps it.`;
|
|
10
|
+
// the CLI spelling of the empty set. `--harness none` is a whole-selection word, not a member: mixing it with
|
|
11
|
+
// a real target is a contradiction, so it only translates when it IS the entire flag (otherwise it falls
|
|
12
|
+
// through as an unknown id and resolveHarnessTargets says why).
|
|
13
|
+
const NO_DELIVERY = 'none';
|
|
10
14
|
// parse `spex init --harness <spec>` into the raw JSON members the `harnesses` field carries: a comma-
|
|
11
15
|
// separated list where `plugin:<folder>` means a plugin target and anything else is a native id. Pure
|
|
12
16
|
// spelling translation — legality (unknown ids, plugin exclusivity) stays with resolveHarnessTargets.
|
|
13
17
|
export function parseHarnessFlag(spec) {
|
|
18
|
+
if (spec.trim() === NO_DELIVERY)
|
|
19
|
+
return [];
|
|
14
20
|
return spec.split(',').map((s) => s.trim()).filter(Boolean)
|
|
15
21
|
.map((s) => (s.startsWith('plugin:') ? { plugin: s.slice('plugin:'.length) } : s));
|
|
16
22
|
}
|
|
@@ -22,15 +28,22 @@ export function resolveHarnessTargets(raw) {
|
|
|
22
28
|
throw new Error(MISSING);
|
|
23
29
|
if (!Array.isArray(raw))
|
|
24
30
|
throw new Error(`spexcode.json "harnesses" must be an ARRAY of targets (got ${typeof raw}). Members are native ids (${KNOWN.join(', ')}) or {"plugin":"<folder>"}.`);
|
|
31
|
+
// THE EMPTY SET IS A LEGAL, EXPLICIT CHOICE: deliver into no harness at all. That is the L0-only posture —
|
|
32
|
+
// the spec tree, the lint, and the git hooks, with zero artifacts written into any agent's config. It is
|
|
33
|
+
// distinct from a MISSING field (undefined/null, rejected above): [] is somebody saying "none", not
|
|
34
|
+
// somebody forgetting to choose. Everything downstream already handles it — materialize's erase phase
|
|
35
|
+
// prunes whatever a previous selection delivered, and the published allowlist admits nothing.
|
|
25
36
|
if (raw.length === 0)
|
|
26
|
-
|
|
37
|
+
return [];
|
|
27
38
|
const targets = [];
|
|
28
39
|
for (const m of raw) {
|
|
29
40
|
if (typeof m === 'string') {
|
|
30
41
|
if (m === 'plugin')
|
|
31
42
|
throw new Error(`spexcode.json "harnesses": a plugin target needs an EXPLICIT landing folder — write {"plugin":"<folder>"} (e.g. {"plugin":".adopter-a"}), not the bare string "plugin", because each host agent reads a different plugins dir.`);
|
|
43
|
+
if (m === NO_DELIVERY)
|
|
44
|
+
throw new Error(`spexcode.json "harnesses": "${NO_DELIVERY}" is not a member — it is the CLI spelling of the WHOLE selection being empty. Write "harnesses": [] for no delivery, or drop "${NO_DELIVERY}" and keep the real targets (\`spex init --harness none\` cannot be combined with another id).`);
|
|
32
45
|
if (!KNOWN.includes(m))
|
|
33
|
-
throw new Error(`spexcode.json "harnesses": unknown harness id "${m}" — known native ids are ${KNOWN.join(', ')}, or use {"plugin":"<folder>"}.`);
|
|
46
|
+
throw new Error(`spexcode.json "harnesses": unknown harness id "${m}" — known native ids are ${KNOWN.join(', ')}, or use {"plugin":"<folder>"}; [] (\`--harness ${NO_DELIVERY}\`) delivers into no harness at all.`);
|
|
34
47
|
targets.push({ kind: 'native', id: m });
|
|
35
48
|
}
|
|
36
49
|
else if (m && typeof m === 'object' && !Array.isArray(m) && 'plugin' in m) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SlashCommand } from './slash-commands.js';
|
|
2
2
|
import { type ExecutionTrace, type ExecutionTurn } from './execution-trace.js';
|
|
3
|
+
import { type TranscriptRead, type TranscriptRange } from './transcript-reader.js';
|
|
3
4
|
import { type HarnessId } from '@spexcode/spec-core';
|
|
4
5
|
export type { HarnessId } from '@spexcode/spec-core';
|
|
5
6
|
export type HarnessLivenessRecord = {
|
|
@@ -23,6 +24,7 @@ export type TurnFailure = {
|
|
|
23
24
|
export type FailureSubscription = {
|
|
24
25
|
close(): void;
|
|
25
26
|
readonly closed: Promise<string | null>;
|
|
27
|
+
readonly ready?: Promise<boolean>;
|
|
26
28
|
};
|
|
27
29
|
export type DeliveryTransportState = {
|
|
28
30
|
kind: 'reachable';
|
|
@@ -58,7 +60,7 @@ export type SharedRuntimeDescriptor = {
|
|
|
58
60
|
mutationGuard?: (targetReferenceId: string, opts?: {
|
|
59
61
|
coldReceipt?: unknown;
|
|
60
62
|
}) => Promise<SharedRuntimeMutationGuard>;
|
|
61
|
-
probe(): Promise<SharedRuntimeProbe>;
|
|
63
|
+
probe(referenceIds?: readonly string[]): Promise<SharedRuntimeProbe>;
|
|
62
64
|
};
|
|
63
65
|
export type SharedRuntimeMutationGuard = {
|
|
64
66
|
healthy: boolean;
|
|
@@ -122,6 +124,7 @@ export interface Harness {
|
|
|
122
124
|
readonly ownsRendezvous: boolean;
|
|
123
125
|
readonly paneTitleIsSelfSummary: boolean;
|
|
124
126
|
executionTrace(threadId: string, turn: ExecutionTurn | null): ExecutionTrace | null;
|
|
127
|
+
readTranscript(threadId: string, range: TranscriptRange): Promise<TranscriptRead>;
|
|
125
128
|
launchCmd(id: string, runtimeDir?: string, cmd?: string): string;
|
|
126
129
|
baseCmd(cmd?: string): string;
|
|
127
130
|
oneShotTurn?(prompt: string, cmd?: string): {
|
|
@@ -139,8 +142,10 @@ export interface Harness {
|
|
|
139
142
|
agentDir(proj: string): string | null;
|
|
140
143
|
shim(dispatch: string, spex: string): {
|
|
141
144
|
content: string;
|
|
145
|
+
hooks?: Record<string, unknown[]>;
|
|
142
146
|
cmd: (e: string) => string;
|
|
143
147
|
};
|
|
148
|
+
shimOwnership: 'exclusive' | 'shared-json';
|
|
144
149
|
writeTrust(proj: string, cmdFor: (e: string) => string): readonly string[];
|
|
145
150
|
slashCommands(): SlashCommand[];
|
|
146
151
|
liveness(rec: HarnessLivenessRecord, tmuxAlive: boolean, runtimeDir?: string, pane?: PaneProbe, socketLive?: boolean): 'online' | 'offline';
|
|
@@ -226,7 +231,7 @@ export declare const rendezvousListening: (id: string, timeoutMs?: number) => Pr
|
|
|
226
231
|
export declare const codexAppServerSock: (dir?: string) => string;
|
|
227
232
|
export declare const codexAppServerPid: (dir?: string) => string;
|
|
228
233
|
export declare const codexAppServerReceipt: (dir?: string) => string;
|
|
229
|
-
export declare function deliverViaRendezvous(id: string, text: string, mid?: string): Promise<DispatchResult>;
|
|
234
|
+
export declare function deliverViaRendezvous(id: string, text: string, mid?: string, wallMs?: number): Promise<DispatchResult>;
|
|
230
235
|
export declare function deliverViaClaudeRendezvous(id: string, text: string, mid?: string, runtimeDir?: string): Promise<DispatchResult>;
|
|
231
236
|
export declare function deliverViaSocketOrWake(id: string, text: string, mid: string | undefined, coldWake: () => Promise<DispatchResult>, unprovenError: string): Promise<DispatchResult>;
|
|
232
237
|
type JsonRpc = {
|
|
@@ -242,6 +247,7 @@ type JsonRpc = {
|
|
|
242
247
|
export declare function codexHandshakeMessages(threadId: string): JsonRpc[];
|
|
243
248
|
export declare function codexInjectMessage(threadId: string, text: string, cwd: string | undefined, activeTurnId: string | null, id?: number, clientUserMessageId?: string): JsonRpc;
|
|
244
249
|
export declare function activeTurnIdFromThread(readResult: unknown): string | null;
|
|
250
|
+
export declare function codexObservedActiveTurnId(threadId: string): string | null;
|
|
245
251
|
export declare function codexBinary(codexCmd: string): string;
|
|
246
252
|
export type CodexThreadPolicy = {
|
|
247
253
|
approvalPolicy?: 'untrusted' | 'on-request' | 'never';
|
|
@@ -253,6 +259,7 @@ export declare function reportHeadlessTurnExit(id: string, harness: string, code
|
|
|
253
259
|
export declare function headlessTurnFailureShell(harness: string, swallow?: boolean): string;
|
|
254
260
|
export declare function sessionIdentityEnvVars(): string[];
|
|
255
261
|
export declare function codexLaunchCommand(id: string, codexCmd?: string, serverCmd?: string, dir?: string, attachTui?: boolean): string;
|
|
262
|
+
export declare const CODEX_TURN_OBSERVER_SUBSCRIBE_MS = 30000;
|
|
256
263
|
export declare function codexTurnFailureObserver(rec: HarnessDeliveryRecord, onFailure: (failure: TurnFailure) => void): FailureSubscription;
|
|
257
264
|
export declare const CODEX_THREAD_SOURCE_KINDS: readonly ["cli", "vscode", "exec", "appServer", "subAgent", "subAgentReview", "subAgentCompact", "subAgentThreadSpawn", "subAgentOther", "unknown"];
|
|
258
265
|
export declare function codexLoadedReferenceIds(sock: string): Promise<{
|
|
@@ -282,7 +289,7 @@ export declare function codexSharedRuntimeProbe(dir?: string, endpoint?: Readonl
|
|
|
282
289
|
receiptFile: string;
|
|
283
290
|
logFile: string;
|
|
284
291
|
socketPath: string;
|
|
285
|
-
}
|
|
292
|
+
}>, referenceIds?: readonly string[]): Promise<SharedRuntimeProbe>;
|
|
286
293
|
export declare function codexStartThreadParams(cwd?: string, bypassHookTrust?: boolean, shellEnv?: Record<string, string>, policy?: CodexThreadPolicy): Record<string, unknown>;
|
|
287
294
|
export declare function codexStartThread(sock: string, cwd?: string, bypassHookTrust?: boolean, shellEnv?: Record<string, string>, policy?: CodexThreadPolicy): Promise<{
|
|
288
295
|
ok: true;
|
|
@@ -301,6 +308,11 @@ export declare function codexRolloutBytes(threadId: string, root?: string): {
|
|
|
301
308
|
export declare function waitForCodexRollout(threadId: string, timeoutMs?: number): Promise<boolean>;
|
|
302
309
|
export declare function writeManagedBlock(file: string, body: string, comment?: readonly [string, string]): boolean;
|
|
303
310
|
export declare function removeManagedBlock(file: string, comment?: readonly [string, string], deleteIfEmpty?: boolean): void;
|
|
311
|
+
export declare function writeManagedJsonHooks(file: string, hooks: Record<string, unknown[]>): boolean;
|
|
312
|
+
export declare function removeManagedJsonHooks(file: string): void;
|
|
313
|
+
export declare function sharedShimHasHostContent(file: string): boolean;
|
|
314
|
+
export declare const GENERATED_MARK = "<!-- spexcode:generated -->";
|
|
315
|
+
export declare function isGeneratedArtifact(file: string): boolean;
|
|
304
316
|
export declare function codexHookHash(snakeEvent: string, command: string, timeout?: number, asyncFlag?: boolean): string;
|
|
305
317
|
export declare function writeCodexTrust(proj: string, events: readonly string[], cmdFor: (e: string) => string): string;
|
|
306
318
|
export declare function paneTreeRunsCodex(pane?: PaneProbe): boolean;
|