@odla-ai/cli 0.6.0 → 0.7.1

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/index.d.cts CHANGED
@@ -10,8 +10,9 @@ import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
10
10
  * Recognized commands: `version`/`-v`/`--version` and `help`/`-h`/`--help` print
11
11
  * and return; `init` scaffolds a project (requires `--app-id` and `--name`);
12
12
  * `doctor` validates config offline; `capabilities` prints the responsibility
13
- * boundary; `admin ai` reads/updates purpose-specific platform AI policies and
14
- * write-only credentials through a short-lived exact-scope device grant;
13
+ * boundary; `admin ai` reads/updates purpose-specific platform AI policies,
14
+ * transfers write-only credentials, and reads metadata-only attributed usage
15
+ * through separate short-lived exact-scope device grants;
15
16
  * `security run` performs an explicitly acknowledged, app-attributed hosted
16
17
  * reasoning pass; `provision` runs the full provision (including optional secret
17
18
  * rotation, local vars, and deployed secret push); `smoke` checks a live env;
@@ -26,15 +27,32 @@ import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
26
27
  */
27
28
  declare function runCli(argv?: string[]): Promise<void>;
28
29
 
30
+ /** One exact platform scope obtainable through the admin device flow. */
31
+ type ScopedPlatformScope = "platform:ai:policy:read" | "platform:ai:policy:write" | "platform:ai:credential:read" | "platform:ai:credential:write" | "platform:ai:usage:read" | "platform:ai:audit:read" | "platform:security:self";
32
+ /** Inputs for obtaining one short-lived, exact-scope platform device grant. */
33
+ interface ScopedPlatformTokenOptions {
34
+ platform: string;
35
+ scope: ScopedPlatformScope;
36
+ open?: boolean;
37
+ fetch?: typeof fetch;
38
+ stdout?: Pick<typeof console, "log">;
39
+ openApprovalUrl?: (url: string) => Promise<void>;
40
+ tokenFile?: string;
41
+ }
42
+ /** Obtain/cache one exact platform scope without granting ambient admin. */
43
+ declare function getScopedPlatformToken(options: ScopedPlatformTokenOptions): Promise<string>;
44
+
29
45
  /** Hosted platform purposes whose provider, model, and budgets an admin may route. */
30
46
  declare const SYSTEM_AI_PURPOSES: readonly ["o11y.triage", "security.discovery", "security.validation"];
31
47
  /** One catalog-validated, platform-funded System AI purpose. */
32
48
  type SystemAiPurpose = (typeof SYSTEM_AI_PURPOSES)[number];
33
- /** Inputs for one System AI read, policy update, credential-status read, or
34
- * write-only credential transfer. Provider values may come only from a named
35
- * environment variable or stdin. */
49
+
50
+ /** Inputs for one System AI policy/catalog read, policy update,
51
+ * credential-status read, write-only credential transfer, or metadata-only
52
+ * usage or admin-audit read. Provider values may come only from a named environment variable
53
+ * or stdin. */
36
54
  interface AdminAiOptions {
37
- action: "show" | "set" | "credentials" | "credential-set";
55
+ action: "show" | "models" | "set" | "credentials" | "credential-set" | "usage" | "audit";
38
56
  purpose?: string;
39
57
  provider?: string;
40
58
  model?: string;
@@ -53,22 +71,20 @@ interface AdminAiOptions {
53
71
  fromEnv?: string;
54
72
  stdin?: boolean;
55
73
  readStdin?: () => Promise<string>;
74
+ discoveryProvider?: string;
75
+ discoveryModel?: string;
76
+ validationProvider?: string;
77
+ validationModel?: string;
78
+ /** Optional metadata-only usage filters. */
79
+ appId?: string;
80
+ env?: string;
81
+ runId?: string;
82
+ limit?: number;
56
83
  /** Separate short-lived admin-token cache; never reuses the app developer-token file. */
57
84
  tokenFile?: string;
58
85
  }
59
- /** Inputs for obtaining one short-lived, exact-scope platform device grant. */
60
- interface ScopedPlatformTokenOptions {
61
- platform: string;
62
- scope: "platform:ai:read" | "platform:ai:write" | "platform:security:self";
63
- open?: boolean;
64
- fetch?: typeof fetch;
65
- stdout?: Pick<typeof console, "log">;
66
- openApprovalUrl?: (url: string) => Promise<void>;
67
- tokenFile?: string;
68
- }
69
- /** Obtain/cache one exact platform scope without granting ambient admin. */
70
- declare function getScopedPlatformToken(options: ScopedPlatformTokenOptions): Promise<string>;
71
- /** Read or update platform-funded AI routing. Authentication is a short-lived,
86
+ /** Read or update platform-funded AI routing and inspect attributed usage.
87
+ * Authentication is a short-lived,
72
88
  * explicitly scoped device grant; ordinary app developer tokens never become
73
89
  * platform admins. Credential writes accept values only from a named env var
74
90
  * or stdin, transfer them once, and never place them in argv, output, or the
@@ -78,7 +94,7 @@ declare function adminAi(options: AdminAiOptions): Promise<void>;
78
94
  /** Stable, machine-readable division of work between the CLI, coding agent,
79
95
  * human operator, and Studio. Printed by `odla-ai capabilities --json`. */
80
96
  declare const CAPABILITIES: {
81
- readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "let admins manage system AI routes/credentials through short-lived exact-scope approval"];
97
+ readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "let admins manage system AI policy and credentials, inspect attributed usage, and read immutable admin changes through separate short-lived capability-only approvals"];
82
98
  readonly agent: readonly ["install and import the selected odla SDKs", "wrap the Worker with withObservability and choose useful telemetry", "make application-specific schema, rules, auth, UI, and migration decisions"];
83
99
  readonly human: readonly ["approve the odla device code and one-off third-party logins", "consent to production changes with --yes", "request destructive credential rotation explicitly", "review application semantics, security findings, releases, and merges", "approve redacted-source disclosure before hosted security reasoning"];
84
100
  readonly studio: readonly ["view telemetry and environment state", "perform manual credential recovery when the CLI's local shown-once copy is unavailable", "configure system AI purposes and view app/environment/run-attributed usage"];
package/dist/index.d.ts CHANGED
@@ -10,8 +10,9 @@ import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
10
10
  * Recognized commands: `version`/`-v`/`--version` and `help`/`-h`/`--help` print
11
11
  * and return; `init` scaffolds a project (requires `--app-id` and `--name`);
12
12
  * `doctor` validates config offline; `capabilities` prints the responsibility
13
- * boundary; `admin ai` reads/updates purpose-specific platform AI policies and
14
- * write-only credentials through a short-lived exact-scope device grant;
13
+ * boundary; `admin ai` reads/updates purpose-specific platform AI policies,
14
+ * transfers write-only credentials, and reads metadata-only attributed usage
15
+ * through separate short-lived exact-scope device grants;
15
16
  * `security run` performs an explicitly acknowledged, app-attributed hosted
16
17
  * reasoning pass; `provision` runs the full provision (including optional secret
17
18
  * rotation, local vars, and deployed secret push); `smoke` checks a live env;
@@ -26,15 +27,32 @@ import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
26
27
  */
27
28
  declare function runCli(argv?: string[]): Promise<void>;
28
29
 
30
+ /** One exact platform scope obtainable through the admin device flow. */
31
+ type ScopedPlatformScope = "platform:ai:policy:read" | "platform:ai:policy:write" | "platform:ai:credential:read" | "platform:ai:credential:write" | "platform:ai:usage:read" | "platform:ai:audit:read" | "platform:security:self";
32
+ /** Inputs for obtaining one short-lived, exact-scope platform device grant. */
33
+ interface ScopedPlatformTokenOptions {
34
+ platform: string;
35
+ scope: ScopedPlatformScope;
36
+ open?: boolean;
37
+ fetch?: typeof fetch;
38
+ stdout?: Pick<typeof console, "log">;
39
+ openApprovalUrl?: (url: string) => Promise<void>;
40
+ tokenFile?: string;
41
+ }
42
+ /** Obtain/cache one exact platform scope without granting ambient admin. */
43
+ declare function getScopedPlatformToken(options: ScopedPlatformTokenOptions): Promise<string>;
44
+
29
45
  /** Hosted platform purposes whose provider, model, and budgets an admin may route. */
30
46
  declare const SYSTEM_AI_PURPOSES: readonly ["o11y.triage", "security.discovery", "security.validation"];
31
47
  /** One catalog-validated, platform-funded System AI purpose. */
32
48
  type SystemAiPurpose = (typeof SYSTEM_AI_PURPOSES)[number];
33
- /** Inputs for one System AI read, policy update, credential-status read, or
34
- * write-only credential transfer. Provider values may come only from a named
35
- * environment variable or stdin. */
49
+
50
+ /** Inputs for one System AI policy/catalog read, policy update,
51
+ * credential-status read, write-only credential transfer, or metadata-only
52
+ * usage or admin-audit read. Provider values may come only from a named environment variable
53
+ * or stdin. */
36
54
  interface AdminAiOptions {
37
- action: "show" | "set" | "credentials" | "credential-set";
55
+ action: "show" | "models" | "set" | "credentials" | "credential-set" | "usage" | "audit";
38
56
  purpose?: string;
39
57
  provider?: string;
40
58
  model?: string;
@@ -53,22 +71,20 @@ interface AdminAiOptions {
53
71
  fromEnv?: string;
54
72
  stdin?: boolean;
55
73
  readStdin?: () => Promise<string>;
74
+ discoveryProvider?: string;
75
+ discoveryModel?: string;
76
+ validationProvider?: string;
77
+ validationModel?: string;
78
+ /** Optional metadata-only usage filters. */
79
+ appId?: string;
80
+ env?: string;
81
+ runId?: string;
82
+ limit?: number;
56
83
  /** Separate short-lived admin-token cache; never reuses the app developer-token file. */
57
84
  tokenFile?: string;
58
85
  }
59
- /** Inputs for obtaining one short-lived, exact-scope platform device grant. */
60
- interface ScopedPlatformTokenOptions {
61
- platform: string;
62
- scope: "platform:ai:read" | "platform:ai:write" | "platform:security:self";
63
- open?: boolean;
64
- fetch?: typeof fetch;
65
- stdout?: Pick<typeof console, "log">;
66
- openApprovalUrl?: (url: string) => Promise<void>;
67
- tokenFile?: string;
68
- }
69
- /** Obtain/cache one exact platform scope without granting ambient admin. */
70
- declare function getScopedPlatformToken(options: ScopedPlatformTokenOptions): Promise<string>;
71
- /** Read or update platform-funded AI routing. Authentication is a short-lived,
86
+ /** Read or update platform-funded AI routing and inspect attributed usage.
87
+ * Authentication is a short-lived,
72
88
  * explicitly scoped device grant; ordinary app developer tokens never become
73
89
  * platform admins. Credential writes accept values only from a named env var
74
90
  * or stdin, transfer them once, and never place them in argv, output, or the
@@ -78,7 +94,7 @@ declare function adminAi(options: AdminAiOptions): Promise<void>;
78
94
  /** Stable, machine-readable division of work between the CLI, coding agent,
79
95
  * human operator, and Studio. Printed by `odla-ai capabilities --json`. */
80
96
  declare const CAPABILITIES: {
81
- readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "let admins manage system AI routes/credentials through short-lived exact-scope approval"];
97
+ readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "let admins manage system AI policy and credentials, inspect attributed usage, and read immutable admin changes through separate short-lived capability-only approvals"];
82
98
  readonly agent: readonly ["install and import the selected odla SDKs", "wrap the Worker with withObservability and choose useful telemetry", "make application-specific schema, rules, auth, UI, and migration decisions"];
83
99
  readonly human: readonly ["approve the odla device code and one-off third-party logins", "consent to production changes with --yes", "request destructive credential rotation explicitly", "review application semantics, security findings, releases, and merges", "approve redacted-source disclosure before hosted security reasoning"];
84
100
  readonly studio: readonly ["view telemetry and environment state", "perform manual credential recovery when the CLI's local shown-once copy is unavailable", "configure system AI purposes and view app/environment/run-attributed usage"];
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  runHostedSecurity,
16
16
  secretsPush,
17
17
  smoke
18
- } from "./chunk-OERLHVLH.js";
18
+ } from "./chunk-643B2AKG.js";
19
19
  export {
20
20
  AGENT_HARNESSES,
21
21
  CAPABILITIES,
package/llms.txt CHANGED
@@ -31,8 +31,8 @@ For a project you keep working in, install it as a dev dependency so the
31
31
  shorter `npx odla-ai` form works and the version is pinned by your lockfile:
32
32
 
33
33
  ```bash
34
- npm view @odla-ai/cli@0.6.0 version
35
- npm i -D --save-exact @odla-ai/cli@0.6.0
34
+ npm view @odla-ai/cli@0.7.1 version
35
+ npm i -D --save-exact @odla-ai/cli@0.7.1
36
36
  ```
37
37
 
38
38
  ## Prerequisites
@@ -63,9 +63,12 @@ npx odla-ai smoke --env dev
63
63
  npx odla-ai secrets push --env dev
64
64
  npx odla-ai security run . --env dev --ack-redacted-source
65
65
  npx odla-ai admin ai show
66
- npx odla-ai admin ai set security.discovery --provider anthropic --model claude-opus-4-8 --enabled
66
+ npx odla-ai admin ai models
67
+ npx odla-ai admin ai set security --discovery-provider anthropic --discovery-model claude-opus-4-8 --validation-provider openai --validation-model gpt-5.5 --enabled
67
68
  npx odla-ai admin ai credentials
68
69
  npx odla-ai admin ai credential set anthropic --from-env ANTHROPIC_API_KEY
70
+ npx odla-ai admin ai usage --app-id my-app --env prod --limit 50
71
+ npx odla-ai admin ai audit --limit 25
69
72
  npx odla-ai skill install
70
73
  npx odla-ai version
71
74
  ```
@@ -126,29 +129,59 @@ when provisioning has not written `.odla/credentials.local.json`.
126
129
 
127
130
  The bundled build/migration skills add a passive pre-ship gate with
128
131
  `@odla-ai/security`: after the exact-version availability check, run
129
- `npm i -D --save-exact @odla-ai/security@0.2.0`, then
132
+ `npm i -D --save-exact @odla-ai/security@0.2.1`, then
130
133
  `npx odla-security scan . --profile odla --out .odla/security/pre-ship --fail-on high --fail-on-candidates critical`.
131
134
  The passive scan remains a separate binary: it makes no model calls and does
132
135
  not execute target code. After explicit redacted-source approval,
133
136
  `odla-ai security run . --env dev --ack-redacted-source` adds hosted discovery
134
137
  and independent validation. The CLI obtains/reuses app-owner auth and the
135
138
  platform supplies bounded role grants; it never requests provider keys.
136
- Early-access run ceilings are rolling; a `429` includes the platform's safe
137
- retry hint, which the CLI surfaces without echoing arbitrary response text.
139
+ The CLI schedules within those grants: recon consumes one discovery call,
140
+ first-pass hunts are capped before retries, and validation handles the
141
+ highest-risk candidates first. Used/skipped role calls appear in the summary
142
+ and report. Budget-limited coverage is explicitly incomplete and still fails
143
+ the default gate unless `--allow-incomplete` is supplied after review.
144
+ All hosted-security network calls target the configured odla platform origin.
145
+ The CLI transmits typed redacted security operations only and never contacts a
146
+ model-provider host; odla.ai owns the prompts/schemas, route, credential,
147
+ provider call, attribution, and receipt. Cached/environment tokens are bound to
148
+ their canonical platform audience and are rejected before disclosure on a
149
+ different origin. For a non-default platform, set the matching
150
+ `ODLA_DEV_TOKEN_AUDIENCE` with `ODLA_DEV_TOKEN`.
151
+ Early-access run ceilings are rolling. A platform-ceiling `429` always carries
152
+ a conservative `Retry-After`. A provider-side `429` uses the sanitized
153
+ `provider_rate_limited` code after the provider SDK's bounded retries and
154
+ carries a bounded `Retry-After` only when the upstream supplied one. The CLI
155
+ does not echo arbitrary response text or silently change the admin-selected
156
+ model.
138
157
  Before installing the exact release, require
139
- `npm view @odla-ai/security@0.2.0 version` to succeed before installation. An
158
+ `npm view @odla-ai/security@0.2.1 version` to succeed before installation. An
140
159
  exact-version `E404` means the release is unavailable, not that the security
141
160
  preflight passed, and does not prove the package name is absent. odla's own
142
161
  engineering environment uses an equivalent internal gate; customer projects
143
162
  should use the published `odla-security` command above.
144
163
 
145
- `admin ai show|set|credentials|credential set` manages platform-funded System
164
+ `admin ai show|models|set|credentials|credential set|usage|audit` manages platform-funded System
146
165
  AI (`o11y.triage`, `security.discovery`, `security.validation`). It uses a
147
166
  separate, mode-`0600` `.odla/admin-token.local.json` cache. Studio displays the
148
167
  exact scope, only an admin can approve it, and it expires after ~15 minutes;
149
- the token never becomes ambient admin. Credential writes accept only
168
+ policy, credential, and usage capabilities are separate and cannot act as the
169
+ approver on ordinary app/db/o11y routes. `admin ai models` reads the server
170
+ catalog. `admin ai set security` updates discovery and independent validation
171
+ together with expected revisions; a concurrent edit returns 409 and reloads
172
+ instead of being overwritten. `admin ai usage` requests its own read-only
173
+ capability and lists metadata-only events and status aggregates; filter by
174
+ `--app-id`, `--env`, `--run-id`, and `--limit`, or emit `--json`. Prompts,
175
+ repository source, model output, reports, and provider credentials are never in
176
+ that response.
177
+ `admin ai audit` uses its own read capability for immutable, metadata-only
178
+ policy and credential change events with actor attribution; credential values
179
+ never enter that trail. Credential writes accept only
150
180
  `--from-env <NAME>` or `--stdin` and never place the value in argv, output, or
151
181
  the cache. System AI and each app's BYOK AI are separate vault/funding paths.
182
+ Admin bounds can only narrow hard ceilings of 64 calls per role/run and, for
183
+ each call, 512 KiB input and 32,768 output tokens. A non-default platform environment token
184
+ must declare the matching `ODLA_ADMIN_TOKEN_AUDIENCE`.
152
185
 
153
186
  `secrets push --env <env>` is the narrower recovery/retry command. It moves the
154
187
  configured env's odla-db key and/or o11y ingest token from
@@ -251,7 +284,7 @@ If schema is present and rules are omitted, `defaultRules: "deny"` generates
251
284
  deny-all rules for every schema entity. That is the safe default for Workers
252
285
  that mediate reads and writes with an app key.
253
286
 
254
- ## API reference (generated from dist/index.d.ts, v0.6.0)
287
+ ## API reference (generated from dist/index.d.ts, v0.7.1)
255
288
 
256
289
  ```ts
257
290
  import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
@@ -266,8 +299,9 @@ import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
266
299
  * Recognized commands: `version`/`-v`/`--version` and `help`/`-h`/`--help` print
267
300
  * and return; `init` scaffolds a project (requires `--app-id` and `--name`);
268
301
  * `doctor` validates config offline; `capabilities` prints the responsibility
269
- * boundary; `admin ai` reads/updates purpose-specific platform AI policies and
270
- * write-only credentials through a short-lived exact-scope device grant;
302
+ * boundary; `admin ai` reads/updates purpose-specific platform AI policies,
303
+ * transfers write-only credentials, and reads metadata-only attributed usage
304
+ * through separate short-lived exact-scope device grants;
271
305
  * `security run` performs an explicitly acknowledged, app-attributed hosted
272
306
  * reasoning pass; `provision` runs the full provision (including optional secret
273
307
  * rotation, local vars, and deployed secret push); `smoke` checks a live env;
@@ -282,15 +316,32 @@ import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
282
316
  */
283
317
  declare function runCli(argv?: string[]): Promise<void>;
284
318
 
319
+ /** One exact platform scope obtainable through the admin device flow. */
320
+ type ScopedPlatformScope = "platform:ai:policy:read" | "platform:ai:policy:write" | "platform:ai:credential:read" | "platform:ai:credential:write" | "platform:ai:usage:read" | "platform:ai:audit:read" | "platform:security:self";
321
+ /** Inputs for obtaining one short-lived, exact-scope platform device grant. */
322
+ interface ScopedPlatformTokenOptions {
323
+ platform: string;
324
+ scope: ScopedPlatformScope;
325
+ open?: boolean;
326
+ fetch?: typeof fetch;
327
+ stdout?: Pick<typeof console, "log">;
328
+ openApprovalUrl?: (url: string) => Promise<void>;
329
+ tokenFile?: string;
330
+ }
331
+ /** Obtain/cache one exact platform scope without granting ambient admin. */
332
+ declare function getScopedPlatformToken(options: ScopedPlatformTokenOptions): Promise<string>;
333
+
285
334
  /** Hosted platform purposes whose provider, model, and budgets an admin may route. */
286
335
  declare const SYSTEM_AI_PURPOSES: readonly ["o11y.triage", "security.discovery", "security.validation"];
287
336
  /** One catalog-validated, platform-funded System AI purpose. */
288
337
  type SystemAiPurpose = (typeof SYSTEM_AI_PURPOSES)[number];
289
- /** Inputs for one System AI read, policy update, credential-status read, or
290
- * write-only credential transfer. Provider values may come only from a named
291
- * environment variable or stdin. */
338
+
339
+ /** Inputs for one System AI policy/catalog read, policy update,
340
+ * credential-status read, write-only credential transfer, or metadata-only
341
+ * usage or admin-audit read. Provider values may come only from a named environment variable
342
+ * or stdin. */
292
343
  interface AdminAiOptions {
293
- action: "show" | "set" | "credentials" | "credential-set";
344
+ action: "show" | "models" | "set" | "credentials" | "credential-set" | "usage" | "audit";
294
345
  purpose?: string;
295
346
  provider?: string;
296
347
  model?: string;
@@ -309,22 +360,20 @@ interface AdminAiOptions {
309
360
  fromEnv?: string;
310
361
  stdin?: boolean;
311
362
  readStdin?: () => Promise<string>;
363
+ discoveryProvider?: string;
364
+ discoveryModel?: string;
365
+ validationProvider?: string;
366
+ validationModel?: string;
367
+ /** Optional metadata-only usage filters. */
368
+ appId?: string;
369
+ env?: string;
370
+ runId?: string;
371
+ limit?: number;
312
372
  /** Separate short-lived admin-token cache; never reuses the app developer-token file. */
313
373
  tokenFile?: string;
314
374
  }
315
- /** Inputs for obtaining one short-lived, exact-scope platform device grant. */
316
- interface ScopedPlatformTokenOptions {
317
- platform: string;
318
- scope: "platform:ai:read" | "platform:ai:write" | "platform:security:self";
319
- open?: boolean;
320
- fetch?: typeof fetch;
321
- stdout?: Pick<typeof console, "log">;
322
- openApprovalUrl?: (url: string) => Promise<void>;
323
- tokenFile?: string;
324
- }
325
- /** Obtain/cache one exact platform scope without granting ambient admin. */
326
- declare function getScopedPlatformToken(options: ScopedPlatformTokenOptions): Promise<string>;
327
- /** Read or update platform-funded AI routing. Authentication is a short-lived,
375
+ /** Read or update platform-funded AI routing and inspect attributed usage.
376
+ * Authentication is a short-lived,
328
377
  * explicitly scoped device grant; ordinary app developer tokens never become
329
378
  * platform admins. Credential writes accept values only from a named env var
330
379
  * or stdin, transfer them once, and never place them in argv, output, or the
@@ -334,7 +383,7 @@ declare function adminAi(options: AdminAiOptions): Promise<void>;
334
383
  /** Stable, machine-readable division of work between the CLI, coding agent,
335
384
  * human operator, and Studio. Printed by `odla-ai capabilities --json`. */
336
385
  declare const CAPABILITIES: {
337
- readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "let admins manage system AI routes/credentials through short-lived exact-scope approval"];
386
+ readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "let admins manage system AI policy and credentials, inspect attributed usage, and read immutable admin changes through separate short-lived capability-only approvals"];
338
387
  readonly agent: readonly ["install and import the selected odla SDKs", "wrap the Worker with withObservability and choose useful telemetry", "make application-specific schema, rules, auth, UI, and migration decisions"];
339
388
  readonly human: readonly ["approve the odla device code and one-off third-party logins", "consent to production changes with --yes", "request destructive credential rotation explicitly", "review application semantics, security findings, releases, and merges", "approve redacted-source disclosure before hosted security reasoning"];
340
389
  readonly studio: readonly ["view telemetry and environment state", "perform manual credential recovery when the CLI's local shown-once copy is unavailable", "configure system AI purposes and view app/environment/run-attributed usage"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odla-ai/cli",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Agent-operable CLI for odla provisioning, scoped System AI administration, hosted security runs, Worker secrets, and smoke checks.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://odla.ai/docs/packages/cli",
@@ -59,10 +59,10 @@
59
59
  "prepublishOnly": "npm run build && npm run gen:llms"
60
60
  },
61
61
  "dependencies": {
62
- "@odla-ai/ai": "^0.3.1",
62
+ "@odla-ai/ai": "^0.3.3",
63
63
  "@odla-ai/apps": "^0.7.1",
64
- "@odla-ai/db": "^0.6.1",
65
- "@odla-ai/security": "^0.2.0"
64
+ "@odla-ai/db": "^0.6.2",
65
+ "@odla-ai/security": "^0.2.1"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/node": "^22.10.0",
@@ -66,12 +66,12 @@ re-provision to push it, and retry.
66
66
  Install the passive harness and scan before any production secret or deploy:
67
67
 
68
68
  Before installing the exact release, first verify
69
- `npm view @odla-ai/security@0.2.0 version`. An exact-version `E404` means the
69
+ `npm view @odla-ai/security@0.2.1 version`. An exact-version `E404` means the
70
70
  release is unavailable and blocks this preflight; it is not a clean scan and
71
71
  does not prove the package name is absent.
72
72
 
73
73
  ```
74
- npm i -D --save-exact @odla-ai/security@0.2.0
74
+ npm i -D --save-exact @odla-ai/security@0.2.1
75
75
  npx odla-security scan . --profile odla --out .odla/security/pre-ship --fail-on high --fail-on-candidates critical
76
76
  ```
77
77
 
@@ -90,8 +90,10 @@ npx @odla-ai/cli security run . --env dev --ack-redacted-source
90
90
  Do not ask for Anthropic/OpenAI/Google keys. The CLI obtains app-owner auth;
91
91
  the platform fixes separate discovery/validation grants to the admin-configured
92
92
  routes, attributes usage to this app/env/run, and retains no source or prompts
93
- in its accounting ledger. If a rolling early-access ceiling returns `429`,
94
- surface the CLI's safe retry hint and do not loop or manufacture a provider key.
93
+ in its accounting ledger. A rolling platform-ceiling `429` always carries a
94
+ conservative retry hint. A provider-side `429` uses the sanitized
95
+ `provider_rate_limited` code and carries a bounded hint only when the upstream
96
+ supplied one. Surface either without looping or manufacturing a provider key.
95
97
 
96
98
  ## 6. Ship ⏸ human checkpoint
97
99
 
@@ -70,12 +70,12 @@ Run the passive CLI in local/CI development; do not import it into the running
70
70
  Worker:
71
71
 
72
72
  Before installing the exact release, require
73
- `npm view @odla-ai/security@0.2.0 version` to succeed before installing it. An
73
+ `npm view @odla-ai/security@0.2.1 version` to succeed before installing it. An
74
74
  exact-version `E404` means the release is unavailable, not that the preflight
75
75
  passed, and does not prove the package name is absent.
76
76
 
77
77
  ```
78
- npm i -D --save-exact @odla-ai/security@0.2.0
78
+ npm i -D --save-exact @odla-ai/security@0.2.1
79
79
  npx odla-security scan . --profile odla --out .odla/security/pre-ship --fail-on high --fail-on-candidates critical
80
80
  ```
81
81
 
@@ -10,8 +10,8 @@ in the browser in interactive terminals).
10
10
 
11
11
  ## Steps
12
12
 
13
- 1. Require `npm view @odla-ai/cli@0.6.0 version` to succeed, then run
14
- `npm i -D --save-exact @odla-ai/cli@0.6.0` and `npm i @odla-ai/db`.
13
+ 1. Require `npm view @odla-ai/cli@0.7.1 version` to succeed, then run
14
+ `npm i -D --save-exact @odla-ai/cli@0.7.1` and `npm i @odla-ai/db`.
15
15
  2. `npx @odla-ai/cli init --app-id <id> --name "<Name>" --env dev --services db`
16
16
  Review `odla.config.mjs`. Keep `envs: ["dev"]` — prod is Phase 5. Set
17
17
  `links.dev` to the URL the Phase 1 `wrangler deploy` **actually printed** —
@@ -24,10 +24,10 @@ instance, never a second Clerk app per env; final go/no-go at each step.
24
24
  `secrets push --env prod --yes` only to retry the transfer (see
25
25
  references/secrets-map.md).
26
26
  3. Build, then run the passive pre-cutover security gate:
27
- first require `npm view @odla-ai/security@0.2.0 version` to succeed. An
27
+ first require `npm view @odla-ai/security@0.2.1 version` to succeed. An
28
28
  exact-version `E404` means the release is unavailable and blocks cutover;
29
29
  it is not a clean scan and does not prove the package name is absent. Run
30
- `npm i -D --save-exact @odla-ai/security@0.2.0` followed by
30
+ `npm i -D --save-exact @odla-ai/security@0.2.1` followed by
31
31
  `npx odla-security scan . --profile odla --out .odla/security/pre-cutover --fail-on high --fail-on-candidates critical`.
32
32
  Review `REPORT.md`; a candidate is a lead, not confirmation, and a baseline
33
33
  requires a concrete reason, owner, and expiry.
@@ -10,7 +10,7 @@
10
10
  | LLM provider key | tenant vault | env var in the HUMAN's shell for one provision run; never wrangler vars, never git, never chat |
11
11
  | `odla_sk_…` (tenant db key) | wrangler secret `ODLA_API_KEY` + `.odla/credentials.local.json` (0600) + `.dev.vars` | present when db is enabled; move it only with the pipeline below |
12
12
  | `odla_dev_…` (developer token) | `.odla/dev-token.json` (0600) | ~24h lifetime, provision-time only; never deployed |
13
- | scoped `odla_dev_…` (admin-approved platform action) | `.odla/admin-token.local.json` (0600) | exact visible scope, ~15m lifetime, never ambient admin or deployed |
13
+ | scoped `odla_dev_…` (admin-approved platform capability) | `.odla/admin-token.local.json` (0600) | separate policy/credential/usage/self-audit scope, ~15m lifetime, denied on owner routes, never deployed |
14
14
  | `o11y_…` (o11y ingest token) | wrangler secret `ODLA_O11Y_TOKEN` + `.odla/credentials.local.json` (0600) + `.dev.vars` | only if the app enables o11y; provision issues/reuses it and moves it alongside the db key; never a var, never chat |
15
15
  | `ODLA_ENDPOINT` / `ODLA_TENANT` / `ODLA_PLATFORM` / `ODLA_APP_ID` / `ODLA_ENV` | wrangler `vars` | not secrets; keep them set in every env block |
16
16
  | `ODLA_O11Y_ENDPOINT` / `ODLA_O11Y_SERVICE` | `.dev.vars` from provision or optional wrangler `vars` overrides | not secrets; public ingest defaults to `https://o11y.odla.ai` and `ODLA_APP_ID` when the token is present |