@pleri/olam-cli 0.1.69 → 0.1.72
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/dist/cli-version.d.ts +16 -0
- package/dist/cli-version.d.ts.map +1 -0
- package/dist/cli-version.js +39 -0
- package/dist/cli-version.js.map +1 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +2 -0
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/host-cp.d.ts.map +1 -1
- package/dist/commands/host-cp.js +10 -0
- package/dist/commands/host-cp.js.map +1 -1
- package/dist/commands/runbooks.d.ts +13 -0
- package/dist/commands/runbooks.d.ts.map +1 -0
- package/dist/commands/runbooks.js +189 -0
- package/dist/commands/runbooks.js.map +1 -0
- package/dist/commands/world-snapshot.d.ts +1 -0
- package/dist/commands/world-snapshot.d.ts.map +1 -1
- package/dist/commands/world-snapshot.js +126 -1
- package/dist/commands/world-snapshot.js.map +1 -1
- package/dist/commands/worldspec/compile.d.ts +20 -0
- package/dist/commands/worldspec/compile.d.ts.map +1 -0
- package/dist/commands/worldspec/compile.js +130 -0
- package/dist/commands/worldspec/compile.js.map +1 -0
- package/dist/commands/worldspec/index.d.ts +12 -0
- package/dist/commands/worldspec/index.d.ts.map +1 -0
- package/dist/commands/worldspec/index.js +23 -0
- package/dist/commands/worldspec/index.js.map +1 -0
- package/dist/commands/worldspec/init.d.ts +15 -0
- package/dist/commands/worldspec/init.d.ts.map +1 -0
- package/dist/commands/worldspec/init.js +166 -0
- package/dist/commands/worldspec/init.js.map +1 -0
- package/dist/commands/worldspec/schema.d.ts +11 -0
- package/dist/commands/worldspec/schema.d.ts.map +1 -0
- package/dist/commands/worldspec/schema.js +55 -0
- package/dist/commands/worldspec/schema.js.map +1 -0
- package/dist/commands/worldspec/validate.d.ts +15 -0
- package/dist/commands/worldspec/validate.d.ts.map +1 -0
- package/dist/commands/worldspec/validate.js +66 -0
- package/dist/commands/worldspec/validate.js.map +1 -0
- package/dist/exit-codes.d.ts +32 -0
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +32 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/image-digests.json +5 -5
- package/dist/index.js +4726 -1231
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +1424 -321
- package/host-cp/compose.yaml +6 -0
- package/host-cp/src/global-config-source.mjs +71 -0
- package/host-cp/src/listening-server-poller.mjs +1 -1
- package/host-cp/src/plan-orchestrator.mjs +20 -1
- package/host-cp/src/port-bridge-manager.mjs +1 -1
- package/host-cp/src/server.mjs +46 -7
- package/host-cp/src/version-status.mjs +36 -0
- package/package.json +4 -2
- package/dist/__tests__/audit-publish-deps-contract.test.d.ts +0 -26
- package/dist/__tests__/audit-publish-deps-contract.test.d.ts.map +0 -1
- package/dist/__tests__/audit-publish-deps-contract.test.js +0 -86
- package/dist/__tests__/audit-publish-deps-contract.test.js.map +0 -1
- package/dist/__tests__/auth-status.test.d.ts +0 -2
- package/dist/__tests__/auth-status.test.d.ts.map +0 -1
- package/dist/__tests__/auth-status.test.js +0 -291
- package/dist/__tests__/auth-status.test.js.map +0 -1
- package/dist/__tests__/auth-upgrade.test.d.ts +0 -9
- package/dist/__tests__/auth-upgrade.test.d.ts.map +0 -1
- package/dist/__tests__/auth-upgrade.test.js +0 -397
- package/dist/__tests__/auth-upgrade.test.js.map +0 -1
- package/dist/__tests__/bootstrap-tag-mcp-auth.test.d.ts +0 -22
- package/dist/__tests__/bootstrap-tag-mcp-auth.test.d.ts.map +0 -1
- package/dist/__tests__/bootstrap-tag-mcp-auth.test.js +0 -63
- package/dist/__tests__/bootstrap-tag-mcp-auth.test.js.map +0 -1
- package/dist/__tests__/cli-mcp-revoke.test.d.ts +0 -8
- package/dist/__tests__/cli-mcp-revoke.test.d.ts.map +0 -1
- package/dist/__tests__/cli-mcp-revoke.test.js +0 -124
- package/dist/__tests__/cli-mcp-revoke.test.js.map +0 -1
- package/dist/__tests__/config.test.d.ts +0 -2
- package/dist/__tests__/config.test.d.ts.map +0 -1
- package/dist/__tests__/config.test.js +0 -95
- package/dist/__tests__/config.test.js.map +0 -1
- package/dist/__tests__/create-app-urls.test.d.ts +0 -2
- package/dist/__tests__/create-app-urls.test.d.ts.map +0 -1
- package/dist/__tests__/create-app-urls.test.js +0 -102
- package/dist/__tests__/create-app-urls.test.js.map +0 -1
- package/dist/__tests__/docker-host.test.d.ts +0 -14
- package/dist/__tests__/docker-host.test.d.ts.map +0 -1
- package/dist/__tests__/docker-host.test.js +0 -109
- package/dist/__tests__/docker-host.test.js.map +0 -1
- package/dist/__tests__/enter.test.d.ts +0 -2
- package/dist/__tests__/enter.test.d.ts.map +0 -1
- package/dist/__tests__/enter.test.js +0 -90
- package/dist/__tests__/enter.test.js.map +0 -1
- package/dist/__tests__/help-output.test.d.ts +0 -2
- package/dist/__tests__/help-output.test.d.ts.map +0 -1
- package/dist/__tests__/help-output.test.js +0 -74
- package/dist/__tests__/help-output.test.js.map +0 -1
- package/dist/__tests__/host-cp-gh-token.test.d.ts +0 -9
- package/dist/__tests__/host-cp-gh-token.test.d.ts.map +0 -1
- package/dist/__tests__/host-cp-gh-token.test.js +0 -119
- package/dist/__tests__/host-cp-gh-token.test.js.map +0 -1
- package/dist/__tests__/host-cp.test.d.ts +0 -9
- package/dist/__tests__/host-cp.test.d.ts.map +0 -1
- package/dist/__tests__/host-cp.test.js +0 -327
- package/dist/__tests__/host-cp.test.js.map +0 -1
- package/dist/__tests__/image-presence.test.d.ts +0 -2
- package/dist/__tests__/image-presence.test.d.ts.map +0 -1
- package/dist/__tests__/image-presence.test.js +0 -44
- package/dist/__tests__/image-presence.test.js.map +0 -1
- package/dist/__tests__/install-root.test.d.ts +0 -2
- package/dist/__tests__/install-root.test.d.ts.map +0 -1
- package/dist/__tests__/install-root.test.js +0 -119
- package/dist/__tests__/install-root.test.js.map +0 -1
- package/dist/__tests__/keys.test.d.ts +0 -9
- package/dist/__tests__/keys.test.d.ts.map +0 -1
- package/dist/__tests__/keys.test.js +0 -145
- package/dist/__tests__/keys.test.js.map +0 -1
- package/dist/__tests__/logs.test.d.ts +0 -9
- package/dist/__tests__/logs.test.d.ts.map +0 -1
- package/dist/__tests__/logs.test.js +0 -124
- package/dist/__tests__/logs.test.js.map +0 -1
- package/dist/__tests__/mcp-import.test.d.ts +0 -11
- package/dist/__tests__/mcp-import.test.d.ts.map +0 -1
- package/dist/__tests__/mcp-import.test.js +0 -134
- package/dist/__tests__/mcp-import.test.js.map +0 -1
- package/dist/__tests__/protocol-version.test.d.ts +0 -2
- package/dist/__tests__/protocol-version.test.d.ts.map +0 -1
- package/dist/__tests__/protocol-version.test.js +0 -170
- package/dist/__tests__/protocol-version.test.js.map +0 -1
- package/dist/__tests__/ps.test.d.ts +0 -2
- package/dist/__tests__/ps.test.d.ts.map +0 -1
- package/dist/__tests__/ps.test.js +0 -172
- package/dist/__tests__/ps.test.js.map +0 -1
- package/dist/__tests__/registry-allowlist.test.d.ts +0 -2
- package/dist/__tests__/registry-allowlist.test.d.ts.map +0 -1
- package/dist/__tests__/registry-allowlist.test.js +0 -129
- package/dist/__tests__/registry-allowlist.test.js.map +0 -1
- package/dist/__tests__/services.test.d.ts +0 -8
- package/dist/__tests__/services.test.d.ts.map +0 -1
- package/dist/__tests__/services.test.js +0 -185
- package/dist/__tests__/services.test.js.map +0 -1
- package/dist/__tests__/status-app-urls.test.d.ts +0 -2
- package/dist/__tests__/status-app-urls.test.d.ts.map +0 -1
- package/dist/__tests__/status-app-urls.test.js +0 -125
- package/dist/__tests__/status-app-urls.test.js.map +0 -1
- package/dist/__tests__/upgrade-gh-token-contract.test.d.ts +0 -19
- package/dist/__tests__/upgrade-gh-token-contract.test.d.ts.map +0 -1
- package/dist/__tests__/upgrade-gh-token-contract.test.js +0 -63
- package/dist/__tests__/upgrade-gh-token-contract.test.js.map +0 -1
- package/dist/__tests__/upgrade.test.d.ts +0 -9
- package/dist/__tests__/upgrade.test.d.ts.map +0 -1
- package/dist/__tests__/upgrade.test.js +0 -586
- package/dist/__tests__/upgrade.test.js.map +0 -1
- package/dist/commands/__tests__/__fixtures__/upgrade-helpers.d.ts +0 -6
- package/dist/commands/__tests__/__fixtures__/upgrade-helpers.d.ts.map +0 -1
- package/dist/commands/__tests__/__fixtures__/upgrade-helpers.js +0 -26
- package/dist/commands/__tests__/__fixtures__/upgrade-helpers.js.map +0 -1
- package/dist/commands/__tests__/begin.test.d.ts +0 -7
- package/dist/commands/__tests__/begin.test.d.ts.map +0 -1
- package/dist/commands/__tests__/begin.test.js +0 -72
- package/dist/commands/__tests__/begin.test.js.map +0 -1
- package/dist/commands/__tests__/bootstrap.test.d.ts +0 -2
- package/dist/commands/__tests__/bootstrap.test.d.ts.map +0 -1
- package/dist/commands/__tests__/bootstrap.test.js +0 -370
- package/dist/commands/__tests__/bootstrap.test.js.map +0 -1
- package/dist/commands/__tests__/carry-uncommitted.test.d.ts +0 -14
- package/dist/commands/__tests__/carry-uncommitted.test.d.ts.map +0 -1
- package/dist/commands/__tests__/carry-uncommitted.test.js +0 -83
- package/dist/commands/__tests__/carry-uncommitted.test.js.map +0 -1
- package/dist/commands/__tests__/clean.test.d.ts +0 -9
- package/dist/commands/__tests__/clean.test.d.ts.map +0 -1
- package/dist/commands/__tests__/clean.test.js +0 -105
- package/dist/commands/__tests__/clean.test.js.map +0 -1
- package/dist/commands/__tests__/crystallize.test.d.ts +0 -2
- package/dist/commands/__tests__/crystallize.test.d.ts.map +0 -1
- package/dist/commands/__tests__/crystallize.test.js +0 -133
- package/dist/commands/__tests__/crystallize.test.js.map +0 -1
- package/dist/commands/__tests__/diagnose.test.d.ts +0 -9
- package/dist/commands/__tests__/diagnose.test.d.ts.map +0 -1
- package/dist/commands/__tests__/diagnose.test.js +0 -108
- package/dist/commands/__tests__/diagnose.test.js.map +0 -1
- package/dist/commands/__tests__/openHostCpUrl.test.d.ts +0 -2
- package/dist/commands/__tests__/openHostCpUrl.test.d.ts.map +0 -1
- package/dist/commands/__tests__/openHostCpUrl.test.js +0 -63
- package/dist/commands/__tests__/openHostCpUrl.test.js.map +0 -1
- package/dist/commands/__tests__/refresh.test.d.ts +0 -13
- package/dist/commands/__tests__/refresh.test.d.ts.map +0 -1
- package/dist/commands/__tests__/refresh.test.js +0 -170
- package/dist/commands/__tests__/refresh.test.js.map +0 -1
- package/dist/commands/__tests__/status.test.d.ts +0 -8
- package/dist/commands/__tests__/status.test.d.ts.map +0 -1
- package/dist/commands/__tests__/status.test.js +0 -62
- package/dist/commands/__tests__/status.test.js.map +0 -1
- package/dist/commands/__tests__/stop.test.d.ts +0 -5
- package/dist/commands/__tests__/stop.test.d.ts.map +0 -1
- package/dist/commands/__tests__/stop.test.js +0 -30
- package/dist/commands/__tests__/stop.test.js.map +0 -1
- package/dist/commands/__tests__/update.test.d.ts +0 -7
- package/dist/commands/__tests__/update.test.d.ts.map +0 -1
- package/dist/commands/__tests__/update.test.js +0 -224
- package/dist/commands/__tests__/update.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.all-three.test.d.ts +0 -19
- package/dist/commands/__tests__/upgrade.all-three.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.all-three.test.js +0 -80
- package/dist/commands/__tests__/upgrade.all-three.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.compose-path.test.d.ts +0 -20
- package/dist/commands/__tests__/upgrade.compose-path.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.compose-path.test.js +0 -140
- package/dist/commands/__tests__/upgrade.compose-path.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.history.test.d.ts +0 -15
- package/dist/commands/__tests__/upgrade.history.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.history.test.js +0 -199
- package/dist/commands/__tests__/upgrade.history.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.lock.test.d.ts +0 -15
- package/dist/commands/__tests__/upgrade.lock.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.lock.test.js +0 -253
- package/dist/commands/__tests__/upgrade.lock.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.olam-tag.test.d.ts +0 -21
- package/dist/commands/__tests__/upgrade.olam-tag.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.olam-tag.test.js +0 -114
- package/dist/commands/__tests__/upgrade.olam-tag.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.poll.test.d.ts +0 -14
- package/dist/commands/__tests__/upgrade.poll.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.poll.test.js +0 -136
- package/dist/commands/__tests__/upgrade.poll.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.recreate.test.d.ts +0 -17
- package/dist/commands/__tests__/upgrade.recreate.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.recreate.test.js +0 -83
- package/dist/commands/__tests__/upgrade.recreate.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.rollback.test.d.ts +0 -12
- package/dist/commands/__tests__/upgrade.rollback.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.rollback.test.js +0 -255
- package/dist/commands/__tests__/upgrade.rollback.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.sha-capture.test.d.ts +0 -12
- package/dist/commands/__tests__/upgrade.sha-capture.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.sha-capture.test.js +0 -63
- package/dist/commands/__tests__/upgrade.sha-capture.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.smoke.test.d.ts +0 -19
- package/dist/commands/__tests__/upgrade.smoke.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.smoke.test.js +0 -87
- package/dist/commands/__tests__/upgrade.smoke.test.js.map +0 -1
- package/dist/commands/__tests__/upgrade.swap.test.d.ts +0 -19
- package/dist/commands/__tests__/upgrade.swap.test.d.ts.map +0 -1
- package/dist/commands/__tests__/upgrade.swap.test.js +0 -312
- package/dist/commands/__tests__/upgrade.swap.test.js.map +0 -1
- package/dist/commands/__tests__/world-upgrade.test.d.ts +0 -8
- package/dist/commands/__tests__/world-upgrade.test.d.ts.map +0 -1
- package/dist/commands/__tests__/world-upgrade.test.js +0 -73
- package/dist/commands/__tests__/world-upgrade.test.js.map +0 -1
- package/dist/lib/__tests__/symlink-reconcile.test.d.ts +0 -2
- package/dist/lib/__tests__/symlink-reconcile.test.d.ts.map +0 -1
- package/dist/lib/__tests__/symlink-reconcile.test.js +0 -106
- package/dist/lib/__tests__/symlink-reconcile.test.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/commands/worldspec/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAsD7D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `olam worldspec schema --version 1 [--out <path>]` — emit a composite
|
|
3
|
+
* JSON Schema (Draft 2019-09) for IDE integration (VS Code yaml.schemas,
|
|
4
|
+
* etc). Single-source-of-truth: derived from WorldspecSchema via
|
|
5
|
+
* zod-to-json-schema, so v1.x evolution stays in sync without drift.
|
|
6
|
+
*
|
|
7
|
+
* Defaults to stdout; pass --out to write a file.
|
|
8
|
+
*/
|
|
9
|
+
import { writeFileSync } from 'node:fs';
|
|
10
|
+
import { resolve as resolvePath } from 'node:path';
|
|
11
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
12
|
+
import { WorldspecSchema } from '@olam/core/src/worldspec/index.js';
|
|
13
|
+
import { EXIT_GENERIC_ERROR } from '../../exit-codes.js';
|
|
14
|
+
import { printError, printSuccess } from '../../output.js';
|
|
15
|
+
export function registerWorldspecSchema(parent) {
|
|
16
|
+
parent
|
|
17
|
+
.command('schema')
|
|
18
|
+
.description('Emit composite JSON Schema for the worldspec (IDE / yaml.schemas)')
|
|
19
|
+
.requiredOption('--version <n>', 'Schema version to emit (currently only 1 is supported)')
|
|
20
|
+
.option('--out <path>', 'Write JSON Schema to this path instead of stdout')
|
|
21
|
+
.action((opts) => {
|
|
22
|
+
if (opts.version !== '1') {
|
|
23
|
+
printError(`unsupported schema version "${opts.version}"; only "1" is shipped in this CLI`);
|
|
24
|
+
process.exit(EXIT_GENERIC_ERROR);
|
|
25
|
+
}
|
|
26
|
+
// zod-to-json-schema target — explicit Draft 2019-09 (matches
|
|
27
|
+
// VS Code yaml.schemas + most IDE consumers in the wild;
|
|
28
|
+
// unevaluatedProperties from Draft 2020-12 is not yet broadly
|
|
29
|
+
// supported by JSON-Schema-aware editors). When IDE coverage of
|
|
30
|
+
// 2020-12 catches up, re-evaluate the upgrade. MEDIUM-fix (A3 CP3
|
|
31
|
+
// audit 2026-05-09): aligned header comment + code + test
|
|
32
|
+
// expectation on Draft 2019-09 (was inconsistent across all three).
|
|
33
|
+
const schema = zodToJsonSchema(WorldspecSchema, {
|
|
34
|
+
name: 'Worldspec',
|
|
35
|
+
target: 'jsonSchema2019-09',
|
|
36
|
+
$refStrategy: 'root',
|
|
37
|
+
});
|
|
38
|
+
const json = JSON.stringify(schema, null, 2);
|
|
39
|
+
if (opts.out) {
|
|
40
|
+
const absPath = resolvePath(process.cwd(), opts.out);
|
|
41
|
+
try {
|
|
42
|
+
writeFileSync(absPath, json + '\n', 'utf8');
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
printError(`failed to write ${absPath}: ${err.message}`);
|
|
46
|
+
process.exit(EXIT_GENERIC_ERROR);
|
|
47
|
+
}
|
|
48
|
+
printSuccess(`wrote JSON Schema (v${opts.version}) to ${absPath}`);
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
process.stdout.write(json + '\n');
|
|
52
|
+
process.exit(0);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YACrD,IAAI,CAAC;gBACH,aAAa,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9C,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,UAAU,CACR,mBAAmB,OAAO,KAAM,GAAa,CAAC,OAAO,EAAE,CACxD,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACnC,CAAC;YACD,YAAY,CAAC,uBAAuB,IAAI,CAAC,OAAO,QAAQ,OAAO,EAAE,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `olam worldspec validate <path>` — validate a worldspec YAML against the
|
|
3
|
+
* v1 schema. Exits 0 on valid, 20 on schema violation, 21 on file-not-found,
|
|
4
|
+
* 1 on internal error.
|
|
5
|
+
*
|
|
6
|
+
* Output format:
|
|
7
|
+
* - --format=human (default): location-aware error frames with hints
|
|
8
|
+
* - --format=json: structured ValidationError[] for IDE / CI consumption
|
|
9
|
+
*
|
|
10
|
+
* Pre-rendered errors carry attacker-controlled strings sanitised via
|
|
11
|
+
* stripCtrl from @olam/core/worldspec — see error-formatter.ts header.
|
|
12
|
+
*/
|
|
13
|
+
import type { Command } from 'commander';
|
|
14
|
+
export declare function registerWorldspecValidate(parent: Command): void;
|
|
15
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/worldspec/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA2D/D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `olam worldspec validate <path>` — validate a worldspec YAML against the
|
|
3
|
+
* v1 schema. Exits 0 on valid, 20 on schema violation, 21 on file-not-found,
|
|
4
|
+
* 1 on internal error.
|
|
5
|
+
*
|
|
6
|
+
* Output format:
|
|
7
|
+
* - --format=human (default): location-aware error frames with hints
|
|
8
|
+
* - --format=json: structured ValidationError[] for IDE / CI consumption
|
|
9
|
+
*
|
|
10
|
+
* Pre-rendered errors carry attacker-controlled strings sanitised via
|
|
11
|
+
* stripCtrl from @olam/core/worldspec — see error-formatter.ts header.
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
14
|
+
import { resolve as resolvePath } from 'node:path';
|
|
15
|
+
import { formatValidationErrors, validateWorldspec, } from '@olam/core/src/worldspec/index.js';
|
|
16
|
+
import { EXIT_GENERIC_ERROR, EXIT_WORLDSPEC_FILE_NOT_FOUND, EXIT_WORLDSPEC_INVALID, } from '../../exit-codes.js';
|
|
17
|
+
import { printError, printSuccess } from '../../output.js';
|
|
18
|
+
export function registerWorldspecValidate(parent) {
|
|
19
|
+
parent
|
|
20
|
+
.command('validate <path>')
|
|
21
|
+
.description('Validate a worldspec YAML against the v1 schema')
|
|
22
|
+
.option('--format <format>', 'Output format: human | json', (value) => {
|
|
23
|
+
if (value !== 'human' && value !== 'json') {
|
|
24
|
+
throw new Error(`--format must be 'human' or 'json' (got '${value}')`);
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}, 'human')
|
|
28
|
+
.action(async (pathArg, opts) => {
|
|
29
|
+
const absPath = resolvePath(process.cwd(), pathArg);
|
|
30
|
+
if (!existsSync(absPath)) {
|
|
31
|
+
printError(`worldspec not found at ${absPath}`);
|
|
32
|
+
process.exit(EXIT_WORLDSPEC_FILE_NOT_FOUND);
|
|
33
|
+
}
|
|
34
|
+
let yamlSource;
|
|
35
|
+
try {
|
|
36
|
+
yamlSource = readFileSync(absPath, 'utf8');
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
printError(`failed to read ${absPath}: ${err.message}`);
|
|
40
|
+
process.exit(EXIT_GENERIC_ERROR);
|
|
41
|
+
}
|
|
42
|
+
const result = validateWorldspec(yamlSource);
|
|
43
|
+
if (result.ok) {
|
|
44
|
+
if (opts.format === 'json') {
|
|
45
|
+
process.stdout.write(JSON.stringify({ ok: true }, null, 2) + '\n');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
printSuccess(`${pathArg}: valid worldspec (schemaVersion: 1)`);
|
|
49
|
+
}
|
|
50
|
+
process.exit(0);
|
|
51
|
+
}
|
|
52
|
+
if (opts.format === 'json') {
|
|
53
|
+
process.stdout.write(JSON.stringify({ ok: false, errors: result.errors }, null, 2) + '\n');
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const formatted = formatValidationErrors(result.errors, {
|
|
57
|
+
sourcePath: pathArg,
|
|
58
|
+
yamlSource,
|
|
59
|
+
color: process.stdout.isTTY,
|
|
60
|
+
});
|
|
61
|
+
process.stderr.write(formatted + '\n');
|
|
62
|
+
}
|
|
63
|
+
process.exit(EXIT_WORLDSPEC_INVALID);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/worldspec/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,E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,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAE7C,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;YACd,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;gBAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;YACrE,CAAC;iBAAM,CAAC;gBACN,YAAY,CAAC,GAAG,OAAO,sCAAsC,CAAC,CAAC;YACjE,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CACrE,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE;gBACtD,UAAU,EAAE,OAAO;gBACnB,UAAU;gBACV,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;aAC5B,CAAC,CAAC;YACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;QACzC,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/exit-codes.d.ts
CHANGED
|
@@ -32,4 +32,36 @@ export declare const EXIT_PROTOCOL_MISMATCH = 4;
|
|
|
32
32
|
* attention" — distinct from EXIT_PLERI_NOT_CONFIGURED (= 2).
|
|
33
33
|
*/
|
|
34
34
|
export declare const EXIT_AUTH_NEEDS_ATTENTION = 5;
|
|
35
|
+
/**
|
|
36
|
+
* `olam worldspec validate` failed because the worldspec violates the
|
|
37
|
+
* v1 schema (one or more Zod issues surfaced). Plan AC #4 reserves a
|
|
38
|
+
* worldspec-scoped range (20–29) so future worldspec commands can sub-
|
|
39
|
+
* distinguish without colliding with codes 1–5 which already carry
|
|
40
|
+
* CLI-wide meaning.
|
|
41
|
+
*
|
|
42
|
+
* `olam worldspec validate <path>`:
|
|
43
|
+
* exit 0 → worldspec valid
|
|
44
|
+
* exit 20 → schema violation (one or more issues)
|
|
45
|
+
* exit 21 → worldspec file not found / not readable
|
|
46
|
+
* exit 1 → internal error (parse crash, etc)
|
|
47
|
+
*/
|
|
48
|
+
export declare const EXIT_WORLDSPEC_INVALID = 20;
|
|
49
|
+
export declare const EXIT_WORLDSPEC_FILE_NOT_FOUND = 21;
|
|
50
|
+
/**
|
|
51
|
+
* `olam worldspec compile` failed to resolve image content-digests
|
|
52
|
+
* (Docker unreachable / image not present locally). Distinct from
|
|
53
|
+
* EXIT_GENERIC_ERROR=1 so CI pipelines can fail-fast on lockfile-
|
|
54
|
+
* digest gaps. Decision #13 invariant: lockfile MUST record digests
|
|
55
|
+
* for fail-fast at world-spawn. MEDIUM-fix (A6 CP3 audit 2026-05-09):
|
|
56
|
+
* digest resolution failure now exits 23 by default; `--allow-pending-
|
|
57
|
+
* digests` opts INTO the soft-warning path for dry-run / no-Docker CI.
|
|
58
|
+
*/
|
|
59
|
+
export declare const EXIT_DIGEST_UNRESOLVED = 23;
|
|
60
|
+
/**
|
|
61
|
+
* `olam worldspec init` refused to overwrite an existing default.yaml
|
|
62
|
+
* without `--force`. Distinct from EXIT_GENERIC_ERROR=1 (internal/parse
|
|
63
|
+
* crash) so pipelines can distinguish "user forgot --force" from
|
|
64
|
+
* "something is broken." A3 CP3 audit MEDIUM-fix 2026-05-09.
|
|
65
|
+
*/
|
|
66
|
+
export declare const EXIT_WORLDSPEC_EXISTS = 22;
|
|
35
67
|
//# sourceMappingURL=exit-codes.d.ts.map
|
package/dist/exit-codes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC"}
|
package/dist/exit-codes.js
CHANGED
|
@@ -32,4 +32,36 @@ export const EXIT_PROTOCOL_MISMATCH = 4;
|
|
|
32
32
|
* attention" — distinct from EXIT_PLERI_NOT_CONFIGURED (= 2).
|
|
33
33
|
*/
|
|
34
34
|
export const EXIT_AUTH_NEEDS_ATTENTION = 5;
|
|
35
|
+
/**
|
|
36
|
+
* `olam worldspec validate` failed because the worldspec violates the
|
|
37
|
+
* v1 schema (one or more Zod issues surfaced). Plan AC #4 reserves a
|
|
38
|
+
* worldspec-scoped range (20–29) so future worldspec commands can sub-
|
|
39
|
+
* distinguish without colliding with codes 1–5 which already carry
|
|
40
|
+
* CLI-wide meaning.
|
|
41
|
+
*
|
|
42
|
+
* `olam worldspec validate <path>`:
|
|
43
|
+
* exit 0 → worldspec valid
|
|
44
|
+
* exit 20 → schema violation (one or more issues)
|
|
45
|
+
* exit 21 → worldspec file not found / not readable
|
|
46
|
+
* exit 1 → internal error (parse crash, etc)
|
|
47
|
+
*/
|
|
48
|
+
export const EXIT_WORLDSPEC_INVALID = 20;
|
|
49
|
+
export const EXIT_WORLDSPEC_FILE_NOT_FOUND = 21;
|
|
50
|
+
/**
|
|
51
|
+
* `olam worldspec compile` failed to resolve image content-digests
|
|
52
|
+
* (Docker unreachable / image not present locally). Distinct from
|
|
53
|
+
* EXIT_GENERIC_ERROR=1 so CI pipelines can fail-fast on lockfile-
|
|
54
|
+
* digest gaps. Decision #13 invariant: lockfile MUST record digests
|
|
55
|
+
* for fail-fast at world-spawn. MEDIUM-fix (A6 CP3 audit 2026-05-09):
|
|
56
|
+
* digest resolution failure now exits 23 by default; `--allow-pending-
|
|
57
|
+
* digests` opts INTO the soft-warning path for dry-run / no-Docker CI.
|
|
58
|
+
*/
|
|
59
|
+
export const EXIT_DIGEST_UNRESOLVED = 23;
|
|
60
|
+
/**
|
|
61
|
+
* `olam worldspec init` refused to overwrite an existing default.yaml
|
|
62
|
+
* without `--force`. Distinct from EXIT_GENERIC_ERROR=1 (internal/parse
|
|
63
|
+
* crash) so pipelines can distinguish "user forgot --force" from
|
|
64
|
+
* "something is broken." A3 CP3 audit MEDIUM-fix 2026-05-09.
|
|
65
|
+
*/
|
|
66
|
+
export const EXIT_WORLDSPEC_EXISTS = 22;
|
|
35
67
|
//# sourceMappingURL=exit-codes.js.map
|
package/dist/exit-codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC"}
|
package/dist/image-digests.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"auth": "sha256:
|
|
3
|
-
"devbox": "sha256:
|
|
4
|
-
"host-cp": "sha256:
|
|
5
|
-
"mcp-auth": "sha256:
|
|
2
|
+
"auth": "sha256:ee6b1d1046933c76acc8d28cd83ac3871bc69057d2401014252872dc5ec42db7",
|
|
3
|
+
"devbox": "sha256:f60037e1190fe104e5a69f4bcef0f8e9b219b99cd35c43b7b77fc9f7ef9fb540",
|
|
4
|
+
"host-cp": "sha256:a9f44b660d9387989f72d7852807998a7fab351f68161c4351f20832225a31d0",
|
|
5
|
+
"mcp-auth": "sha256:e47169ad3fbc9cab216248fecbc56874343a5daab84b1f18d67529b7d415cf95",
|
|
6
6
|
"$schema_version": 1,
|
|
7
|
-
"$published_version": "0.1.
|
|
7
|
+
"$published_version": "0.1.72",
|
|
8
8
|
"$registry": "ghcr.io/pleri"
|
|
9
9
|
}
|