@aikdna/kdna-studio-cli 0.13.0 → 0.14.0
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 +15 -2
- package/docs/CREATION_COMMAND_CONTRACT.md +1 -1
- package/docs/TERMINAL_AGENT_CREATION.md +10 -0
- package/package.json +2 -2
- package/src/public-bindings.json +19 -19
- package/src/terminal-workspace.js +53 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# KDNA Studio CLI — typed current creation
|
|
2
2
|
|
|
3
|
-
Studio CLI `0.
|
|
3
|
+
Studio CLI `0.14.0` consumes Studio Core `4.1.0`, Core `0.37.2` and Read `0.11.3`. Ordinary prose and supported mechanism structures share container `0.5.0` / Read grammar `0.6.4`. Core/Read package versions identify implementation bytes and do not establish interchange with NativeSections container `0.6.0` / Read `0.7.0`, or import/reuse of another CLI's output. Installation acceptance is a separate Host decision; exact content checks do not authenticate a provider process.
|
|
4
4
|
|
|
5
5
|
An external Agent records materials and proposes judgment groups with at least two meaningful alternatives. Selection and final adoption arrive through a separately owned live channel. Human-declared review and expressly delegated Agent editorial adoption are distinct modes:
|
|
6
6
|
|
|
@@ -20,10 +20,13 @@ Export exclusively creates a new private directory. It writes exact Studio bytes
|
|
|
20
20
|
```text
|
|
21
21
|
kdna-studio verify --bundle ./new-export
|
|
22
22
|
kdna-studio read --bundle ./new-export --allow-read --judgment 1
|
|
23
|
+
kdna-studio export06 --bundle ./new-export --kdna /path/to/kdna
|
|
23
24
|
```
|
|
24
25
|
|
|
25
26
|
Static reopening keeps `creation_accepted:not_evaluated` and `live_context:unavailable`; JSON cannot restore a one-use capability. `read` requires explicit `--allow-read`, delegates request admission, scope, exact selection and byte budgets to public Read, and grants no action authority. Format1, format-absent legacy evidence and old completion sidecars are noncurrent. Preserve their original accepted releases; never relabel them to this graph.
|
|
26
27
|
|
|
28
|
+
`export06` is the explicit bridge to container `0.6.0`: it invokes the published `kdna` CLI's `convert` on the bundle's `asset.kdna` and writes a new file — the sibling `./new-export.0.6.kdna` unless `--output` names another. `--kdna EXECUTABLE` or `KDNA_CLI_BIN` selects the CLI; when none is found the step is a named refusal with public acquisition guidance, never a fallback conversion path. The sealed bundle — the asset and all detached evidence — is never written, and the converted file belongs to the `0.6.0` read stack, not to this CLI's `read`.
|
|
29
|
+
|
|
27
30
|
The full 12-package dependency graph uses exact registry coordinates and an integrity lock; the committed vendor archives anchor its member receipt. Before loading upstream code or materials, the CLI checks complete installed member sets, bytes, versions and one shared Core resolution, and rejects unbound optional addons. The exact archive/member declarations are in `src/public-bindings.json`.
|
|
28
31
|
|
|
29
32
|
Install with registry access using the locked coordinates:
|
|
@@ -50,7 +53,7 @@ See [command contract](docs/CREATION_COMMAND_CONTRACT.md) and [Agent integration
|
|
|
50
53
|
|
|
51
54
|
## Source and release verification
|
|
52
55
|
|
|
53
|
-
The dependency graph binds Studio Core `4.
|
|
56
|
+
The dependency graph binds Studio Core `4.1.0`, Core `0.37.2`, Read
|
|
54
57
|
`0.11.3` and `fast-uri` `3.1.8`. The current source ledger is
|
|
55
58
|
`fixtures/runtime-candidates/current-sources.json`; `npm run verify:candidate-sources`
|
|
56
59
|
rebuilds its exact Git package trees and compares every installed tar member.
|
|
@@ -67,3 +70,13 @@ published, non-draft, non-prerelease event and exact registry dependency
|
|
|
67
70
|
integrities. Prerelease evidence cannot enter that publisher. Local checks do
|
|
68
71
|
not establish registry availability, verified editorial identity, real human
|
|
69
72
|
acceptance or permission to publish.
|
|
73
|
+
|
|
74
|
+
A stable release commit must already be accepted on `main`: the release gate
|
|
75
|
+
runs `git merge-base --is-ancestor <release-commit> origin/main` and refuses by
|
|
76
|
+
name when `origin/main` is unreadable (`RELEASE_MAIN_REF_UNREADABLE`) or the
|
|
77
|
+
commit is not an ancestor (`RELEASE_COMMIT_NOT_ON_MAIN`). An earlier main commit
|
|
78
|
+
remains acceptable; the current main tip is not required, and the reverse
|
|
79
|
+
relation is never used. The publish workflow fetches `origin/main` explicitly
|
|
80
|
+
before the gate and fails closed if that fetch fails. The candidate/preview
|
|
81
|
+
channel keeps its existing release rule; this main-line requirement is stable
|
|
82
|
+
publication only.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Current command boundary
|
|
2
2
|
|
|
3
|
-
Supported commands: `help`, `--help`, `--version`, `session`, `verify`, `read`. Unknown commands, repeated or unknown options fail before opening materials or output. Package exports expose metadata only; the supported executable is the bin. No deep path, alternate checkout, model, remote server or runtime fallback is selected.
|
|
3
|
+
Supported commands: `help`, `--help`, `--version`, `session`, `verify`, `read`, `export06`. Unknown commands, repeated or unknown options fail before opening materials or output. `export06 --bundle DIRECTORY [--output FILE] [--kdna EXECUTABLE]` is the explicit conversion step to container `0.6.0`: it hashes the bundle's `asset.kdna` itself, invokes the published `kdna` CLI's `convert` with that binding and writes a new sibling file (`<bundle>.0.6.kdna` unless `--output` names another) that never replaces an existing file. The executable is resolved from `--kdna`, then `KDNA_CLI_BIN`, then `PATH`; when none is found the step is the named refusal `CLI_KDNA_CONVERT_MISSING` with public acquisition guidance, never a fallback conversion. Conversion rejections (`MIGRATION_SOURCE_*`, save failures) pass through with their original code and exit status. The sealed bundle is never written. Package exports expose metadata only; the supported executable is the bin. No deep path, alternate checkout, model, remote server or runtime fallback is selected.
|
|
4
4
|
|
|
5
5
|
`session --out NEW_DIRECTORY` accepts repeated `--text FILE` and `--interview FILE`, `--synthetic-fixture`, and exactly one adoption mode. Human mode uses a controlling terminal or `--human-fd N`. Explicit delegated Agent mode requires both `--agent-adoption-fd N` and `--delegation-record FILE`. N is an integer at least 3. Human and Agent fd options cannot be combined. `session` additionally accepts `--password-fd N` (N an integer at least 3, distinct from the adoption fds): the password is read exactly once from that pipe fd. Password values are never accepted in process arguments, and the Agent stream is never the password channel. The delegation file contains only nonempty `coordinate` and `statement`; it is an explicit embedding claim, not an authenticated grant.
|
|
6
6
|
|
|
@@ -12,6 +12,7 @@ Each newline-terminated Agent frame has unique `id`, `op`, and `data`. Wait for
|
|
|
12
12
|
| interview | `{title,question}` |
|
|
13
13
|
| propose | `{localKey,alternatives:[alternative,alternative,...]}` |
|
|
14
14
|
| revise | `{localKey,baseRevision,alternatives,explanation}` |
|
|
15
|
+
| system | `{worldview?,value_order?,relations?,boundaries?}`; declares the system layer. `worldview`/`value_order` are `{statement,items:[text,...]}`; a relation is `{localKey,kind,from,to,statement}` with kind `support|qualify|conflict|complement` and the ordered role pair (support supporter→claim, qualify qualifier→qualified, complement supplement→base; conflict side_a→side_b). Keys resolve against the selected judgments at preview; unknown keys are `CREATION_SYSTEM_JUDGMENT_UNKNOWN`. `boundaries` is refused with `CREATION_BOUNDARIES_ACTOR_REQUIRED` until the actor face opens; nothing is silently dropped |
|
|
15
16
|
| review | `{}`; request actual selection or final adoption |
|
|
16
17
|
| preview | `{}`; show complete current mapping before final adoption |
|
|
17
18
|
| status | `{}` |
|
|
@@ -34,3 +35,12 @@ Select chooses exactly one current alternative for every group. Other supported
|
|
|
34
35
|
The pending review receives its final result after interpretation. There is no separate interpretation success reply. Reusing ids/tickets, changing role/channel, replacing the current review, EOF or input errors reject. Agent termination while waiting abandons the unexported session. Keep one request active; excess queued frames reject. No automatic decision or persistent replay/resume exists.
|
|
35
36
|
|
|
36
37
|
Export creates one exclusive private bundle and obtains `accepted_with_live_context` only after actual saved-byte readback. Static `verify` always retains `live_context:unavailable` and `creation_accepted:not_evaluated`; it cannot resurrect the capability. Core/Read and static evidence consistency remain separate from actual Agent adoption, verified identity, action permission, Authoring Fit/G4B and publication readiness. Legacy format1 and old completion markers require their original accepted graph and cannot be relabeled current.
|
|
38
|
+
|
|
39
|
+
## Export to 0.6: the explicit conversion step
|
|
40
|
+
|
|
41
|
+
Container `0.6.0` is not produced by this CLI. The supported route from a delivered session bundle into `0.6.0` is the explicit step `kdna-studio export06`: it invokes the published `kdna` CLI's `convert` on the bundle's `asset.kdna` (this step supplies the `--expected-a` reading itself, writes a new file, and never changes an existing one) and passes the converter's named results and exit code through unchanged. There is no in-Studio rearrangement of container bytes.
|
|
42
|
+
|
|
43
|
+
- CLI selection: `--kdna EXECUTABLE`, then `KDNA_CLI_BIN`, then `kdna` on `PATH`. When none is found the step is the named refusal `CLI_KDNA_CONVERT_MISSING` with public acquisition guidance; it never falls back to any private or self-implemented conversion path.
|
|
44
|
+
- Default output is the new sibling file `<bundle>.0.6.kdna` (`--output` names another). The delivered bundle is a sealed read-only unit; `asset.kdna` and the detached evidence files are never written.
|
|
45
|
+
- Converter refusals pass through by their own names, for example `MIGRATION_SOURCE_UNSUPPORTED_VERSION` (historical generations), `MIGRATION_SOURCE_PROTECTED_UNSUPPORTED` (protected containers) and `MIGRATION_SOURCE_EXTENSION_UNSUPPORTED` (member extensions such as `checksums.json`). An existing output is refused, not renamed (`KDNA_OUTPUT_EXISTS`).
|
|
46
|
+
- The converted `0.6.0` file belongs to the `0.6.0` read stack (the published `kdna` CLI's `read` and `validate`). This CLI's own `read` remains the container `0.5.0` session path and does not consume the converted file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aikdna/kdna-studio-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Terminal Host for current typed Studio creation and separate human or authorized Agent adoption channels.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@aikdna/kdna-core": "0.37.2",
|
|
56
56
|
"@aikdna/kdna-read": "0.11.3",
|
|
57
|
-
"@aikdna/kdna-studio-core": "4.
|
|
57
|
+
"@aikdna/kdna-studio-core": "4.1.0"
|
|
58
58
|
},
|
|
59
59
|
"directories": {
|
|
60
60
|
"test": "tests"
|
package/src/public-bindings.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"packages": {
|
|
15
15
|
"@aikdna/kdna-core": "0.37.2",
|
|
16
16
|
"@aikdna/kdna-read": "0.11.3",
|
|
17
|
-
"@aikdna/kdna-studio-core": "4.
|
|
17
|
+
"@aikdna/kdna-studio-core": "4.1.0"
|
|
18
18
|
},
|
|
19
19
|
"archives": [
|
|
20
20
|
{
|
|
@@ -3387,7 +3387,7 @@
|
|
|
3387
3387
|
},
|
|
3388
3388
|
{
|
|
3389
3389
|
"name": "@aikdna/kdna-studio-core",
|
|
3390
|
-
"version": "4.
|
|
3390
|
+
"version": "4.1.0",
|
|
3391
3391
|
"files": [
|
|
3392
3392
|
{
|
|
3393
3393
|
"path": "LICENSE",
|
|
@@ -3404,20 +3404,20 @@
|
|
|
3404
3404
|
{
|
|
3405
3405
|
"path": "README.md",
|
|
3406
3406
|
"mode": 420,
|
|
3407
|
-
"bytes":
|
|
3408
|
-
"sha256": "
|
|
3407
|
+
"bytes": 3831,
|
|
3408
|
+
"sha256": "bfe5882f17675d6f9d46bc3fa8c8821462ebb5e0bf3dcd1cc7bdef772fd0e785"
|
|
3409
3409
|
},
|
|
3410
3410
|
{
|
|
3411
3411
|
"path": "docs/CURRENT-CREATION-CONTRACT.md",
|
|
3412
3412
|
"mode": 420,
|
|
3413
|
-
"bytes":
|
|
3414
|
-
"sha256": "
|
|
3413
|
+
"bytes": 19874,
|
|
3414
|
+
"sha256": "ca3fe7ace0410242bd20aac91d45fbd901f0b6863225fe9c3f6b63ac70492d7b"
|
|
3415
3415
|
},
|
|
3416
3416
|
{
|
|
3417
3417
|
"path": "package.json",
|
|
3418
3418
|
"mode": 420,
|
|
3419
|
-
"bytes":
|
|
3420
|
-
"sha256": "
|
|
3419
|
+
"bytes": 3058,
|
|
3420
|
+
"sha256": "3f79d834c4b25ffaa48f6a33d47efc30ad4150a6bdb6e203d83f57c293666f00"
|
|
3421
3421
|
},
|
|
3422
3422
|
{
|
|
3423
3423
|
"path": "src/compile/component-compiler.js",
|
|
@@ -3434,14 +3434,14 @@
|
|
|
3434
3434
|
{
|
|
3435
3435
|
"path": "src/compile/component-materialization.js",
|
|
3436
3436
|
"mode": 420,
|
|
3437
|
-
"bytes":
|
|
3438
|
-
"sha256": "
|
|
3437
|
+
"bytes": 12082,
|
|
3438
|
+
"sha256": "1279ef69ff9a02bb3ec3a6fd65ff37a9f7cb8e5c482f65612400ff9c9f4296a5"
|
|
3439
3439
|
},
|
|
3440
3440
|
{
|
|
3441
3441
|
"path": "src/creation-engine/component-input.js",
|
|
3442
3442
|
"mode": 420,
|
|
3443
|
-
"bytes":
|
|
3444
|
-
"sha256": "
|
|
3443
|
+
"bytes": 9498,
|
|
3444
|
+
"sha256": "fc013a968f7242da85308d4f396d6cc2526207dfdded37cbb53a7087fde6dcc7"
|
|
3445
3445
|
},
|
|
3446
3446
|
{
|
|
3447
3447
|
"path": "src/creation-engine/component-runtime-binding.js",
|
|
@@ -3458,8 +3458,8 @@
|
|
|
3458
3458
|
{
|
|
3459
3459
|
"path": "src/creation-engine/component-session.js",
|
|
3460
3460
|
"mode": 420,
|
|
3461
|
-
"bytes":
|
|
3462
|
-
"sha256": "
|
|
3461
|
+
"bytes": 12341,
|
|
3462
|
+
"sha256": "07e0ea153cca4bd20718ad526a1a57d260b5399bf769ce90768cd89c380e6116"
|
|
3463
3463
|
},
|
|
3464
3464
|
{
|
|
3465
3465
|
"path": "src/creation-engine/creation-context.js",
|
|
@@ -3470,14 +3470,14 @@
|
|
|
3470
3470
|
{
|
|
3471
3471
|
"path": "src/evidence/component-audit.js",
|
|
3472
3472
|
"mode": 420,
|
|
3473
|
-
"bytes":
|
|
3474
|
-
"sha256": "
|
|
3473
|
+
"bytes": 8089,
|
|
3474
|
+
"sha256": "ea8f60a9f83848e5ea8482c9714a9c235db0d8f204ae7f533743d9d52f2918f1"
|
|
3475
3475
|
},
|
|
3476
3476
|
{
|
|
3477
3477
|
"path": "src/evidence/component-evidence.js",
|
|
3478
3478
|
"mode": 420,
|
|
3479
|
-
"bytes":
|
|
3480
|
-
"sha256": "
|
|
3479
|
+
"bytes": 7352,
|
|
3480
|
+
"sha256": "93cf907c1d50b1ba978e7675b8bc0f82578ec22dcb06a164574f32121305930a"
|
|
3481
3481
|
},
|
|
3482
3482
|
{
|
|
3483
3483
|
"path": "src/evidence/component-json.js",
|
|
@@ -3504,7 +3504,7 @@
|
|
|
3504
3504
|
"sha256": "f32003db722d963a2a0fcbcc88954a4c73d75b6f82c46fd89e731f3db2b57f3f"
|
|
3505
3505
|
}
|
|
3506
3506
|
],
|
|
3507
|
-
"sha256": "
|
|
3507
|
+
"sha256": "76a5e7dcca71b28259e5058d241304912713d72e9defba98ce8a03f7e4d1e22a",
|
|
3508
3508
|
"publicEntry": "src/index.js",
|
|
3509
3509
|
"dependencies": {
|
|
3510
3510
|
"cbor-x": "1.6.5",
|
|
@@ -8,6 +8,7 @@ const net = require('node:net');
|
|
|
8
8
|
const os = require('node:os');
|
|
9
9
|
const tty = require('node:tty');
|
|
10
10
|
const { TextDecoder } = require('node:util');
|
|
11
|
+
const { spawnSync } = require('node:child_process');
|
|
11
12
|
const { createRequire } = require('node:module');
|
|
12
13
|
const bindings = require('./public-bindings.json');
|
|
13
14
|
const LIMIT = 1024 * 1024;
|
|
@@ -190,9 +191,10 @@ function dependencies() {
|
|
|
190
191
|
|
|
191
192
|
function options(argv) {
|
|
192
193
|
const command = argv[0] || 'help';
|
|
193
|
-
if (!['help', '--help', '--version', 'session', 'verify', 'read'].includes(command)) fail('CLI_COMMAND_UNSUPPORTED');
|
|
194
|
+
if (!['help', '--help', '--version', 'session', 'verify', 'read', 'export06'].includes(command)) fail('CLI_COMMAND_UNSUPPORTED');
|
|
194
195
|
const opts = { command, materials: [] };
|
|
195
196
|
const allowed = command === 'session' ? ['--out', '--human-fd', '--agent-adoption-fd', '--delegation-record', '--text', '--interview', '--synthetic-fixture', '--password-fd'] :
|
|
197
|
+
command === 'export06' ? ['--bundle', '--output', '--kdna'] :
|
|
196
198
|
['verify', 'read'].includes(command) ? ['--bundle', ...(command === 'read' ? ['--allow-read', '--budget', '--judgment'] : [])] : [];
|
|
197
199
|
const seen = new Set();
|
|
198
200
|
for (let i = 1; i < argv.length; i++) {
|
|
@@ -208,7 +210,7 @@ function options(argv) {
|
|
|
208
210
|
else opts[flag] = value;
|
|
209
211
|
}
|
|
210
212
|
if (command === 'session' && !opts['--out']) fail('CLI_OUTPUT_REQUIRED');
|
|
211
|
-
if (['verify', 'read'].includes(command) && !opts['--bundle']) fail('CLI_BUNDLE_REQUIRED');
|
|
213
|
+
if (['verify', 'read', 'export06'].includes(command) && !opts['--bundle']) fail('CLI_BUNDLE_REQUIRED');
|
|
212
214
|
if (opts['--human-fd'] && (!/^\d+$/.test(opts['--human-fd']) || Number(opts['--human-fd']) < 3)) fail('CLI_HUMAN_CHANNEL_INVALID');
|
|
213
215
|
if (opts['--agent-adoption-fd'] && (!/^\d+$/.test(opts['--agent-adoption-fd']) || Number(opts['--agent-adoption-fd']) < 3)) fail('CLI_AGENT_ADOPTION_CHANNEL_INVALID');
|
|
214
216
|
if (Boolean(opts['--agent-adoption-fd']) !== Boolean(opts['--delegation-record']) || (opts['--agent-adoption-fd'] && opts['--human-fd'])) fail('CLI_ADOPTION_OPTIONS_INVALID');
|
|
@@ -424,6 +426,7 @@ async function session(opts) {
|
|
|
424
426
|
case 'brief': result = workspace.agent.setBrief(value.data); break;
|
|
425
427
|
case 'propose': result = operations.propose(value.data); break;
|
|
426
428
|
case 'revise': result = operations.revise(value.data); break;
|
|
429
|
+
case 'system': result = workspace.agent.declareSystem(value.data); break;
|
|
427
430
|
case 'interview': {
|
|
428
431
|
record(value.data, ['title', 'question']); const question = text(value.data.question);
|
|
429
432
|
phase = 'human';
|
|
@@ -492,6 +495,51 @@ async function consume(opts) {
|
|
|
492
495
|
if (result.channel !== 'read_envelope' || result.envelope.status !== 'ready') process.exitCode = 3;
|
|
493
496
|
}
|
|
494
497
|
|
|
498
|
+
const KDNA_CLI_GUIDANCE =
|
|
499
|
+
'kdna CLI not found: obtain it per the public instructions (the Git channel or the published exact coordinate) and pass --kdna EXECUTABLE or set KDNA_CLI_BIN. This step never falls back to a private conversion path.';
|
|
500
|
+
|
|
501
|
+
function resolveKdnaCli(opts) {
|
|
502
|
+
const candidates = [];
|
|
503
|
+
if (opts['--kdna'] !== undefined) candidates.push(opts['--kdna']);
|
|
504
|
+
else if (process.env.KDNA_CLI_BIN) candidates.push(process.env.KDNA_CLI_BIN);
|
|
505
|
+
else for (const dir of (process.env.PATH || '').split(path.delimiter)) if (dir) candidates.push(path.join(dir, 'kdna'));
|
|
506
|
+
for (const candidate of candidates) {
|
|
507
|
+
try {
|
|
508
|
+
if (fs.statSync(candidate).isFile()) return candidate;
|
|
509
|
+
} catch { /* keep looking */ }
|
|
510
|
+
}
|
|
511
|
+
process.stderr.write(KDNA_CLI_GUIDANCE + '\n');
|
|
512
|
+
fail('CLI_KDNA_CONVERT_MISSING');
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// Explicit export to the 0.6 container: the bundle is read-only here; the
|
|
516
|
+
// conversion is the published kdna CLI's convert step, never a private path.
|
|
517
|
+
function export06(opts) {
|
|
518
|
+
const bundle = path.resolve(opts['--bundle']);
|
|
519
|
+
const asset = path.join(bundle, 'asset.kdna');
|
|
520
|
+
let entry;
|
|
521
|
+
try { entry = fs.statSync(asset); } catch { fail('CLI_BUNDLE_ASSET_MISSING'); }
|
|
522
|
+
if (!entry.isFile()) fail('CLI_BUNDLE_ASSET_MISSING');
|
|
523
|
+
// The delivered bundle is a sealed read-only unit (directory and files);
|
|
524
|
+
// the converted file goes beside it, never inside.
|
|
525
|
+
const output = opts['--output'] === undefined ? bundle + '.0.6.kdna' : path.resolve(opts['--output']);
|
|
526
|
+
if (output === asset) fail('CLI_EXPORT06_OUTPUT_INVALID');
|
|
527
|
+
const kdna = resolveKdnaCli(opts);
|
|
528
|
+
const bytes = fs.readFileSync(asset);
|
|
529
|
+
const expected = 'sha256:' + crypto.createHash('sha256').update(bytes).digest('hex');
|
|
530
|
+
const result = spawnSync(kdna, ['convert', asset, '--expected-a', expected, '--output', output, '--allow-source', '--json'], {
|
|
531
|
+
encoding: 'utf8',
|
|
532
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
533
|
+
});
|
|
534
|
+
if (result.error) {
|
|
535
|
+
if (result.error.code === 'ENOENT') { process.stderr.write(KDNA_CLI_GUIDANCE + '\n'); fail('CLI_KDNA_CONVERT_MISSING'); }
|
|
536
|
+
fail('CLI_EXPORT06_EXECUTION_FAILED');
|
|
537
|
+
}
|
|
538
|
+
if (typeof result.stdout === 'string' && result.stdout) process.stdout.write(result.stdout);
|
|
539
|
+
if (typeof result.stderr === 'string' && result.stderr) process.stderr.write(result.stderr);
|
|
540
|
+
process.exitCode = Number.isInteger(result.status) ? result.status : 1;
|
|
541
|
+
}
|
|
542
|
+
|
|
495
543
|
async function main(argv) {
|
|
496
544
|
const opts = options(argv);
|
|
497
545
|
if (opts.command === '--version') { process.stdout.write(require('../package.json').version + '\n'); return; }
|
|
@@ -499,9 +547,11 @@ async function main(argv) {
|
|
|
499
547
|
process.stdout.write('kdna-studio session --out NEW_DIRECTORY [--text FILE] [--interview FILE] [--human-fd 3 | --agent-adoption-fd 3 --delegation-record FILE] [--password-fd N]\n' +
|
|
500
548
|
'--password-fd N exports the bundle as a password-protected container; the password is read once from pipe fd N (never argv or the agent stream), and the recovery code is displayed exactly once on stderr.\n' +
|
|
501
549
|
'kdna-studio verify --bundle DIRECTORY\nkdna-studio read --bundle DIRECTORY [--allow-read] [--judgment 1] [--budget BYTES]\n' +
|
|
550
|
+
'kdna-studio export06 --bundle DIRECTORY [--output FILE] [--kdna EXECUTABLE]\n' +
|
|
551
|
+
' exports the bundle to the 0.6 container by explicitly invoking the kdna CLI convert step; the default output is the new sibling file DIRECTORY.0.6.kdna, and the sealed bundle contents are never written.\n' +
|
|
502
552
|
'Agent operation JSONL uses stdin/stdout. Adoption replies use the terminal or a separate human/authorized-Agent fd, with explicit channel kind.\n' +
|
|
503
553
|
'Ordinary and component-rich alternatives use the same current live creation graph. See docs/TERMINAL_AGENT_CREATION.md.\n'); return;
|
|
504
554
|
}
|
|
505
|
-
if (opts.command === 'session') await session(opts); else await consume(opts);
|
|
555
|
+
if (opts.command === 'session') await session(opts); else if (opts.command === 'export06') export06(opts); else await consume(opts);
|
|
506
556
|
}
|
|
507
557
|
module.exports = { main };
|