@odla-ai/cli 0.27.13 → 0.27.15

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/bin.js CHANGED
@@ -1,12 +1,180 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ cliVersion,
4
+ compareVersions,
3
5
  exitCodeFor,
4
- redactSecrets,
5
- runCli
6
- } from "./chunk-3YSCRXPF.js";
6
+ redactSecrets
7
+ } from "./chunk-UKLSRQ5J.js";
8
+
9
+ // src/cli-update.ts
10
+ import { realpathSync } from "fs";
11
+ var DEFAULT_REGISTRY_URL = "https://registry.npmjs.org/@odla-ai%2fcli/latest";
12
+ var VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
13
+ async function requireCurrentCliForProvision(argv2, options = {}) {
14
+ if (argv2[0] !== "provision" || argv2.includes("--dry-run")) return;
15
+ const current = options.currentVersion ?? cliVersion();
16
+ if (!VERSION.test(current)) return;
17
+ const latest = await fetchLatestCliVersion(options);
18
+ if (!latest || compareVersions(current, latest) >= 0) return;
19
+ const entryPath = resolvedEntryPath(options.entryPath ?? process.argv[1]);
20
+ const workspace = isWorkspaceCli(entryPath);
21
+ const rerun = renderReleasedProvisionCommand(latest, argv2);
22
+ const source = workspace ? ` This executable resolves to the workspace build at ${entryPath}; update/rebase that worktree and rebuild it before using the linked CLI again.` : " Update the installed dependency before using its CLI again.";
23
+ throw new Error(
24
+ `provision blocked: @odla-ai/cli ${current} is older than the released ${latest}. Provisioning grant requests are security-sensitive, and a stale client can omit required authority.${source}
25
+ Run the current release now:
26
+ ${rerun}`
27
+ );
28
+ }
29
+ async function fetchLatestCliVersion(options) {
30
+ const controller = new AbortController();
31
+ const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? 2500);
32
+ timeout.unref?.();
33
+ try {
34
+ const response = await (options.fetch ?? fetch)(
35
+ options.registryUrl ?? process.env.ODLA_CLI_REGISTRY_URL ?? DEFAULT_REGISTRY_URL,
36
+ {
37
+ headers: {
38
+ accept: "application/json",
39
+ "user-agent": `odla-ai-cli/${options.currentVersion ?? cliVersion()}`
40
+ },
41
+ signal: controller.signal
42
+ }
43
+ );
44
+ if (!response.ok) return null;
45
+ const body = await response.json();
46
+ return typeof body.version === "string" && VERSION.test(body.version) ? body.version : null;
47
+ } catch {
48
+ return null;
49
+ } finally {
50
+ clearTimeout(timeout);
51
+ }
52
+ }
53
+ function resolvedEntryPath(entryPath) {
54
+ if (!entryPath) return "unknown executable";
55
+ try {
56
+ return realpathSync(entryPath);
57
+ } catch {
58
+ return entryPath;
59
+ }
60
+ }
61
+ function isWorkspaceCli(entryPath) {
62
+ const normalized = entryPath.replaceAll("\\", "/");
63
+ return normalized.includes("/packages/cli/dist/bin.") && !normalized.includes("/node_modules/");
64
+ }
65
+ function renderReleasedProvisionCommand(latest, argv2) {
66
+ const safeArgs = [];
67
+ for (let index = 0; index < argv2.length; index++) {
68
+ const value = argv2[index];
69
+ safeArgs.push(value);
70
+ if (value === "--token" && index + 1 < argv2.length) {
71
+ safeArgs.push("<redacted-token>");
72
+ index++;
73
+ }
74
+ }
75
+ return [
76
+ "npm",
77
+ "exec",
78
+ "--yes",
79
+ `--package=@odla-ai/cli@${latest}`,
80
+ "--",
81
+ "odla-ai",
82
+ ...safeArgs
83
+ ].map(shellQuote).join(" ");
84
+ }
85
+ function shellQuote(value) {
86
+ return /^[A-Za-z0-9_@%+=:,./-]+$/.test(value) ? value : `'${value.replaceAll("'", `'"'"'`)}'`;
87
+ }
88
+
89
+ // src/cli-runtime.ts
90
+ import { createRequire } from "module";
91
+ import { existsSync, readFileSync, realpathSync as realpathSync2 } from "fs";
92
+ import { dirname, isAbsolute, join, parse, resolve } from "path";
93
+ var EXACT_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
94
+ var RUNTIME_MODULES = [
95
+ "@odla-ai/ai",
96
+ "@odla-ai/apps",
97
+ "@odla-ai/brand",
98
+ "@odla-ai/db",
99
+ "@odla-ai/security"
100
+ ];
101
+ function requireCoherentProvisionRuntime(argv2, options = {}) {
102
+ if (argv2[0] !== "provision" || argv2.includes("--dry-run")) return;
103
+ const entryPath = absoluteEntryPath(options.entryPath ?? process.argv[1]);
104
+ const expected = options.expectedVersions ?? expectedRuntimeVersions(entryPath);
105
+ const installed = options.installedModules ?? installedRuntimeModules(entryPath);
106
+ const problems = [];
107
+ for (const name of RUNTIME_MODULES) {
108
+ const wanted = expected[name];
109
+ const loaded = installed[name];
110
+ if (!wanted || !EXACT_VERSION.test(wanted)) {
111
+ problems.push(`${name}: CLI manifest does not pin an exact tested version`);
112
+ } else if (!loaded) {
113
+ problems.push(`${name}: expected ${wanted}, module is not installed`);
114
+ } else if (loaded.version !== wanted) {
115
+ problems.push(`${name}: expected ${wanted}, resolved ${loaded.version} from ${loaded.path}`);
116
+ }
117
+ }
118
+ if (problems.length === 0) return;
119
+ const workspace = isWorkspaceCli(resolvedEntryPath(entryPath));
120
+ const repair = workspace ? "Update/rebase this worktree, run npm ci, and rebuild the CLI before provisioning again." : "Reinstall the CLI so npm replaces its complete pinned runtime dependency graph.";
121
+ throw new Error(
122
+ `provision blocked: the @odla-ai/cli runtime dependency graph is stale or incoherent:
123
+ ${problems.map((problem) => ` - ${problem}`).join("\n")}
124
+ ${repair}
125
+ Run the isolated released graph now:
126
+ ${renderReleasedProvisionCommand(cliVersion(), argv2)}`
127
+ );
128
+ }
129
+ function expectedRuntimeVersions(entryPath) {
130
+ const manifest = findPackageManifest(entryPath, "@odla-ai/cli");
131
+ const dependencies = manifest?.json.dependencies;
132
+ return Object.fromEntries(RUNTIME_MODULES.map((name) => [
133
+ name,
134
+ typeof dependencies?.[name] === "string" ? dependencies[name] : ""
135
+ ]));
136
+ }
137
+ function installedRuntimeModules(entryPath) {
138
+ const require2 = createRequire(entryPath);
139
+ return Object.fromEntries(RUNTIME_MODULES.map((name) => {
140
+ try {
141
+ const moduleEntry = require2.resolve(name);
142
+ const manifest = findPackageManifest(moduleEntry, name);
143
+ return [name, manifest ? { version: manifest.json.version, path: manifest.path } : void 0];
144
+ } catch {
145
+ return [name, void 0];
146
+ }
147
+ }));
148
+ }
149
+ function findPackageManifest(fromPath, expectedName) {
150
+ let directory = dirname(resolvedEntryPath(fromPath));
151
+ const root = parse(directory).root;
152
+ while (true) {
153
+ const path = join(directory, "package.json");
154
+ if (existsSync(path)) {
155
+ try {
156
+ const json = JSON.parse(readFileSync(path, "utf8"));
157
+ if (json?.name === expectedName && typeof json.version === "string") return { path, json };
158
+ } catch {
159
+ }
160
+ }
161
+ if (directory === root) return void 0;
162
+ directory = dirname(directory);
163
+ }
164
+ }
165
+ function absoluteEntryPath(entryPath) {
166
+ const candidate = entryPath || join(process.cwd(), "odla-ai-cli.js");
167
+ const absolute = isAbsolute(candidate) ? candidate : resolve(candidate);
168
+ try {
169
+ return realpathSync2(absolute);
170
+ } catch {
171
+ return absolute;
172
+ }
173
+ }
7
174
 
8
175
  // src/bin.ts
9
- runCli().catch((err) => {
176
+ var argv = process.argv.slice(2);
177
+ requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-2RZFZRRT.js")).runCli()).catch((err) => {
10
178
  console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
11
179
  process.exitCode = exitCodeFor(err);
12
180
  });
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/bin.ts"],"sourcesContent":["import { exitCodeFor, runCli } from \"./cli\";\nimport { redactSecrets } from \"./redact\";\n\nrunCli().catch((err) => {\n console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));\n process.exitCode = exitCodeFor(err);\n});\n"],"mappings":";;;;;;;;AAGA,OAAO,EAAE,MAAM,CAAC,QAAQ;AACtB,UAAQ,MAAM,cAAc,YAAY,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE,CAAC;AAC3F,UAAQ,WAAW,YAAY,GAAG;AACpC,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/cli-update.ts","../src/cli-runtime.ts","../src/bin.ts"],"sourcesContent":["import { realpathSync } from \"node:fs\";\nimport { compareVersions } from \"./runbook-requires\";\nimport { cliVersion } from \"./version\";\n\nconst DEFAULT_REGISTRY_URL = \"https://registry.npmjs.org/@odla-ai%2fcli/latest\";\nconst VERSION = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/;\n\nexport interface CliUpdateCheckOptions {\n currentVersion?: string;\n entryPath?: string;\n fetch?: typeof fetch;\n registryUrl?: string;\n timeoutMs?: number;\n}\n\n/**\n * Provisioning handshakes are security-sensitive protocol requests. Before a\n * real provision run, stop a CLI which is confirmed older than npm's current\n * release so an agent cannot unknowingly submit an obsolete grant shape.\n * Registry unavailability remains fail-open: npm must not become a production\n * availability dependency for an otherwise current CLI.\n */\nexport async function requireCurrentCliForProvision(\n argv: readonly string[],\n options: CliUpdateCheckOptions = {},\n): Promise<void> {\n if (argv[0] !== \"provision\" || argv.includes(\"--dry-run\")) return;\n\n const current = options.currentVersion ?? cliVersion();\n if (!VERSION.test(current)) return;\n const latest = await fetchLatestCliVersion(options);\n if (!latest || compareVersions(current, latest) >= 0) return;\n\n const entryPath = resolvedEntryPath(options.entryPath ?? process.argv[1]);\n const workspace = isWorkspaceCli(entryPath);\n const rerun = renderReleasedProvisionCommand(latest, argv);\n const source = workspace\n ? ` This executable resolves to the workspace build at ${entryPath}; update/rebase that worktree and rebuild it before using the linked CLI again.`\n : \" Update the installed dependency before using its CLI again.\";\n throw new Error(\n `provision blocked: @odla-ai/cli ${current} is older than the released ${latest}. ` +\n `Provisioning grant requests are security-sensitive, and a stale client can omit required authority.${source}\\n` +\n `Run the current release now:\\n ${rerun}`,\n );\n}\n\nasync function fetchLatestCliVersion(\n options: CliUpdateCheckOptions,\n): Promise<string | null> {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? 2_500);\n timeout.unref?.();\n try {\n const response = await (options.fetch ?? fetch)(\n options.registryUrl ?? process.env.ODLA_CLI_REGISTRY_URL ?? DEFAULT_REGISTRY_URL,\n {\n headers: {\n accept: \"application/json\",\n \"user-agent\": `odla-ai-cli/${options.currentVersion ?? cliVersion()}`,\n },\n signal: controller.signal,\n },\n );\n if (!response.ok) return null;\n const body = await response.json() as { version?: unknown };\n return typeof body.version === \"string\" && VERSION.test(body.version)\n ? body.version\n : null;\n } catch {\n return null;\n } finally {\n clearTimeout(timeout);\n }\n}\n\nexport function resolvedEntryPath(entryPath: string | undefined): string {\n if (!entryPath) return \"unknown executable\";\n try {\n return realpathSync(entryPath);\n } catch {\n return entryPath;\n }\n}\n\nexport function isWorkspaceCli(entryPath: string): boolean {\n const normalized = entryPath.replaceAll(\"\\\\\", \"/\");\n return normalized.includes(\"/packages/cli/dist/bin.\") &&\n !normalized.includes(\"/node_modules/\");\n}\n\nexport function renderReleasedProvisionCommand(\n latest: string,\n argv: readonly string[],\n): string {\n const safeArgs: string[] = [];\n for (let index = 0; index < argv.length; index++) {\n const value = argv[index]!;\n safeArgs.push(value);\n if (value === \"--token\" && index + 1 < argv.length) {\n safeArgs.push(\"<redacted-token>\");\n index++;\n }\n }\n return [\n \"npm\", \"exec\", \"--yes\", `--package=@odla-ai/cli@${latest}`,\n \"--\", \"odla-ai\", ...safeArgs,\n ]\n .map(shellQuote)\n .join(\" \");\n}\n\nfunction shellQuote(value: string): string {\n return /^[A-Za-z0-9_@%+=:,./-]+$/.test(value)\n ? value\n : `'${value.replaceAll(\"'\", `'\"'\"'`)}'`;\n}\n","import { createRequire } from \"node:module\";\nimport { existsSync, readFileSync, realpathSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, parse, resolve } from \"node:path\";\nimport {\n isWorkspaceCli,\n renderReleasedProvisionCommand,\n resolvedEntryPath,\n} from \"./cli-update\";\nimport { cliVersion } from \"./version\";\n\nconst EXACT_VERSION = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$/;\nconst RUNTIME_MODULES = [\n \"@odla-ai/ai\",\n \"@odla-ai/apps\",\n \"@odla-ai/brand\",\n \"@odla-ai/db\",\n \"@odla-ai/security\",\n] as const;\n\ninterface InstalledModule {\n version: string;\n path: string;\n}\n\nexport interface CliRuntimeCheckOptions {\n entryPath?: string;\n expectedVersions?: Readonly<Record<string, string>>;\n installedModules?: Readonly<Record<string, InstalledModule | undefined>>;\n}\n\n/**\n * A current CLI version is not sufficient when a workspace symlink or an npm\n * cache can resolve older external modules. Provisioning is allowed only when\n * every module loaded by the command graph has the exact version recorded in\n * the CLI manifest that was packed and tested.\n */\nexport function requireCoherentProvisionRuntime(\n argv: readonly string[],\n options: CliRuntimeCheckOptions = {},\n): void {\n if (argv[0] !== \"provision\" || argv.includes(\"--dry-run\")) return;\n\n const entryPath = absoluteEntryPath(options.entryPath ?? process.argv[1]);\n const expected = options.expectedVersions ?? expectedRuntimeVersions(entryPath);\n const installed = options.installedModules ?? installedRuntimeModules(entryPath);\n const problems: string[] = [];\n\n for (const name of RUNTIME_MODULES) {\n const wanted = expected[name];\n const loaded = installed[name];\n if (!wanted || !EXACT_VERSION.test(wanted)) {\n problems.push(`${name}: CLI manifest does not pin an exact tested version`);\n } else if (!loaded) {\n problems.push(`${name}: expected ${wanted}, module is not installed`);\n } else if (loaded.version !== wanted) {\n problems.push(`${name}: expected ${wanted}, resolved ${loaded.version} from ${loaded.path}`);\n }\n }\n if (problems.length === 0) return;\n\n const workspace = isWorkspaceCli(resolvedEntryPath(entryPath));\n const repair = workspace\n ? \"Update/rebase this worktree, run npm ci, and rebuild the CLI before provisioning again.\"\n : \"Reinstall the CLI so npm replaces its complete pinned runtime dependency graph.\";\n throw new Error(\n `provision blocked: the @odla-ai/cli runtime dependency graph is stale or incoherent:\\n` +\n `${problems.map((problem) => ` - ${problem}`).join(\"\\n\")}\\n` +\n `${repair}\\nRun the isolated released graph now:\\n ${renderReleasedProvisionCommand(cliVersion(), argv)}`,\n );\n}\n\nfunction expectedRuntimeVersions(entryPath: string): Record<string, string> {\n const manifest = findPackageManifest(entryPath, \"@odla-ai/cli\");\n const dependencies = manifest?.json.dependencies;\n return Object.fromEntries(RUNTIME_MODULES.map((name) => [\n name,\n typeof dependencies?.[name] === \"string\" ? dependencies[name] : \"\",\n ]));\n}\n\nfunction installedRuntimeModules(entryPath: string): Record<string, InstalledModule | undefined> {\n const require = createRequire(entryPath);\n return Object.fromEntries(RUNTIME_MODULES.map((name) => {\n try {\n const moduleEntry = require.resolve(name);\n const manifest = findPackageManifest(moduleEntry, name);\n return [name, manifest ? { version: manifest.json.version, path: manifest.path } : undefined];\n } catch {\n return [name, undefined];\n }\n }));\n}\n\nfunction findPackageManifest(\n fromPath: string,\n expectedName: string,\n): { path: string; json: { name?: string; version: string; dependencies?: Record<string, string> } } | undefined {\n let directory = dirname(resolvedEntryPath(fromPath));\n const root = parse(directory).root;\n while (true) {\n const path = join(directory, \"package.json\");\n if (existsSync(path)) {\n try {\n const json = JSON.parse(readFileSync(path, \"utf8\"));\n if (json?.name === expectedName && typeof json.version === \"string\") return { path, json };\n } catch {\n // Keep walking: a consumer package.json is not the module manifest.\n }\n }\n if (directory === root) return undefined;\n directory = dirname(directory);\n }\n}\n\nfunction absoluteEntryPath(entryPath: string | undefined): string {\n const candidate = entryPath || join(process.cwd(), \"odla-ai-cli.js\");\n const absolute = isAbsolute(candidate) ? candidate : resolve(candidate);\n try {\n return realpathSync(absolute);\n } catch {\n return absolute;\n }\n}\n","import { requireCurrentCliForProvision } from \"./cli-update\";\nimport { requireCoherentProvisionRuntime } from \"./cli-runtime\";\nimport { exitCodeFor } from \"./exit-code\";\nimport { redactSecrets } from \"./redact\";\n\nconst argv = process.argv.slice(2);\n\nrequireCurrentCliForProvision(argv)\n .then(() => requireCoherentProvisionRuntime(argv))\n // Keep the full command graph, including its external @odla-ai modules, out\n // of the process until both stale-client checks have had a chance to explain\n // exactly how to repair the executable and dependency graph.\n .then(async () => (await import(\"./cli\")).runCli())\n .catch((err) => {\n console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));\n process.exitCode = exitCodeFor(err);\n });\n"],"mappings":";;;;;;;;;AAAA,SAAS,oBAAoB;AAI7B,IAAM,uBAAuB;AAC7B,IAAM,UAAU;AAiBhB,eAAsB,8BACpBA,OACA,UAAiC,CAAC,GACnB;AACf,MAAIA,MAAK,CAAC,MAAM,eAAeA,MAAK,SAAS,WAAW,EAAG;AAE3D,QAAM,UAAU,QAAQ,kBAAkB,WAAW;AACrD,MAAI,CAAC,QAAQ,KAAK,OAAO,EAAG;AAC5B,QAAM,SAAS,MAAM,sBAAsB,OAAO;AAClD,MAAI,CAAC,UAAU,gBAAgB,SAAS,MAAM,KAAK,EAAG;AAEtD,QAAM,YAAY,kBAAkB,QAAQ,aAAa,QAAQ,KAAK,CAAC,CAAC;AACxE,QAAM,YAAY,eAAe,SAAS;AAC1C,QAAM,QAAQ,+BAA+B,QAAQA,KAAI;AACzD,QAAM,SAAS,YACX,uDAAuD,SAAS,oFAChE;AACJ,QAAM,IAAI;AAAA,IACR,mCAAmC,OAAO,+BAA+B,MAAM,wGACuB,MAAM;AAAA;AAAA,IACzE,KAAK;AAAA,EAC1C;AACF;AAEA,eAAe,sBACb,SACwB;AACxB,QAAM,aAAa,IAAI,gBAAgB;AACvC,QAAM,UAAU,WAAW,MAAM,WAAW,MAAM,GAAG,QAAQ,aAAa,IAAK;AAC/E,UAAQ,QAAQ;AAChB,MAAI;AACF,UAAM,WAAW,OAAO,QAAQ,SAAS;AAAA,MACvC,QAAQ,eAAe,QAAQ,IAAI,yBAAyB;AAAA,MAC5D;AAAA,QACE,SAAS;AAAA,UACP,QAAQ;AAAA,UACR,cAAc,eAAe,QAAQ,kBAAkB,WAAW,CAAC;AAAA,QACrE;AAAA,QACA,QAAQ,WAAW;AAAA,MACrB;AAAA,IACF;AACA,QAAI,CAAC,SAAS,GAAI,QAAO;AACzB,UAAM,OAAO,MAAM,S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