@odla-ai/cli 0.28.2 → 0.30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odla-ai/cli",
3
- "version": "0.28.2",
3
+ "version": "0.30.0",
4
4
  "description": "Agent-operable CLI for odla provisioning, calendar consent and connection lifecycle, System AI administration, Worker secrets, security jobs, and smoke checks.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://odla.ai/docs/packages/cli",
@@ -54,9 +54,10 @@ State which path you're taking and what you'll build in one line; get a nod.
54
54
  a sandbox (env `dev`, tenant `<appId>--dev`) and a live one (env `prod`,
55
55
  tenant `<appId>`). "prod" names the app's live DATABASE, never a different
56
56
  odla — there is only one odla.ai. Keep `envs: ["dev"]` and verify the tenant
57
- before any write or deploy. Add `prod` only at the explicit go-live
58
- checkpoint. That first live `provision --dry-run` review,
59
- `provision --yes --push-secrets`, and deploy are human checkpoints.
57
+ before any write or deploy. At the explicit go-live checkpoint, use
58
+ `provision --live`; add `prod` to `envs` only if normal later provision runs
59
+ should manage both. That first live `provision --live --dry-run` review,
60
+ `provision --live --yes --push-secrets`, and deploy are human checkpoints.
60
61
  3. **Rules are default-deny.** A namespace with no rule is invisible; a write
61
62
  with no rule is rejected. Never widen a rule just to clear a 403 — edit
62
63
  `src/odla/rules.mjs` deliberately, and flag rule changes to the human.
@@ -141,9 +142,10 @@ guessing which platform/credential steps need manual work. Then:
141
142
  --ack-redacted-source`.
142
143
  The source job follows, reports, and gates by default. Never request a PAT or
143
144
  treat GitHub read approval as redacted-snippet disclosure consent.
144
- 6. **ship** ⏸ — after adding `prod`, run `npx @odla-ai/cli provision --dry-run`,
145
- show the human, then `npx @odla-ai/cli provision --yes --push-secrets` and
146
- `npx wrangler deploy`.
145
+ 6. **ship** ⏸ — run `npx @odla-ai/cli provision --live --dry-run`, show the
146
+ human, then `npx @odla-ai/cli provision --live --yes --push-secrets` and
147
+ `npx wrangler deploy`. Add `prod` to `envs` only when future ordinary
148
+ provision runs should target both environments.
147
149
 
148
150
  ## Track the work in PM, as you go
149
151
 
@@ -176,7 +178,10 @@ project id.
176
178
  Before project-mutating work, confirm the request aligns to an open goal and
177
179
  propose/refine a **task** in Backlog. Ready is a planner handoff: an ordinary
178
180
  managed-agent grant has `pm.execute`, so a human owner or `pm.plan` agent must
179
- approve the Ready contract before the executor claims its reviewed revision.
181
+ approve the Ready contract before an unattended executor claims work discovered
182
+ through PM. A direct request from the user actively directing the coding
183
+ session is already authority: record it, but do not stop and ask that user to
184
+ repeat approval by moving the task to Ready.
180
185
  Record a **decision** the moment you make one (with what it rules out), and file
181
186
  a **bug** the moment you notice one. A decision you don't record is one the next
182
187
  agent re-litigates. Full command set, conventions, and recovery procedure:
@@ -167,12 +167,18 @@ supplied one. Surface either without looping or manufacturing a provider key.
167
167
 
168
168
  ## 6. Ship ⏸ human checkpoint
169
169
 
170
- Add `"prod"` to `envs`, provision again (prod tenant = the bare `appId`), then:
170
+ Initialize live after the sandbox is healthy (prod tenant = the bare `appId`), then:
171
171
 
172
172
  ```
173
- npx @odla-ai/cli provision --yes --push-secrets # prod mutation + configured Worker secrets
173
+ npx @odla-ai/cli provision --live --yes --push-secrets # prod mutation + configured Worker secrets
174
174
  npx wrangler deploy
175
175
  ```
176
176
 
177
+ `--live` targets only prod and does not require adding it to the dev-first
178
+ `envs` list. Add `"prod"` to `envs` only if ordinary future provision runs
179
+ should manage sandbox and live together. If calendar is enabled, predeclare
180
+ `calendar.google.availabilityCalendars.prod`; the live Google connection still
181
+ has its own consent checkpoint.
182
+
177
183
  Verify with `npx @odla-ai/cli smoke --env prod`. Point env vars at the service
178
184
  custom domains, never `*.workers.dev` (Workers can't fetch same-account workers.dev).
@@ -39,8 +39,9 @@ Every environment's tenant is the same across all owners (prod's tenant is the
39
39
  bare app id; `dev` is `<appId>--dev`). So multiple co-owners deploying to
40
40
  **production** all read and write the **same** prod database — each with their
41
41
  own key. Treat first-prod provision/deploy as the usual human checkpoint
42
- (`provision --dry-run` review, then `provision --yes --push-secrets`), and never
43
- rotate another owner's credentials on their behalf.
42
+ (`provision --live --dry-run` review, then
43
+ `provision --live --yes --push-secrets`), and never rotate another owner's
44
+ credentials on their behalf.
44
45
 
45
46
  ## If provision says the credential lacks `app.manage`
46
47
 
@@ -43,9 +43,11 @@ An agent must not create a convenient goal merely to authorize itself.
43
43
  Ready is a durable planner-to-executor handoff. A human project owner or an
44
44
  agent holding `pm.plan` may refine the task and mark it Ready. Ordinary managed
45
45
  agent handshakes receive `pm.execute`, not `pm.plan`: they may create a Backlog
46
- proposal or file a bug, but must ask the user/planner to review the contract and
47
- perform the Ready transition. Do not treat a 403 as a reason to widen or bypass
48
- the grant.
46
+ proposal or file a bug. Require the Ready transition only when PM/watch supplied
47
+ the work or the agent is operating unattended. In an interactive coding session,
48
+ the user's direct request is already execution authority; record it in PM and
49
+ continue without asking the same user for a duplicate board click. Do not treat
50
+ a 403 as a reason to widen the grant.
49
51
 
50
52
  Create/refine the task with one alignment source, an actionable description,
51
53
  acceptance criteria, and execution mode:
@@ -106,6 +106,10 @@ Human project owners retain planning authority through ownership. Legacy
106
106
  `pm.write` grants remain executable so existing claims are not stranded, but do
107
107
  not gain planning authority.
108
108
 
109
+ This split coordinates unattended work; it is not an interactive approval
110
+ gate. When a user directly requests work in the active coding session, record
111
+ the request in PM but do not require them to repeat it with a Ready transition.
112
+
109
113
  ## Working with it
110
114
 
111
115
  **At the start of a session**, resolve the exact project and read before you
@@ -25,26 +25,26 @@ not ask the human for Anthropic/OpenAI/Google keys for hosted security.
25
25
 
26
26
  ## Moving the db key (+ o11y token) into the Worker (never through the transcript)
27
27
 
28
- Normal provisioning owns the complete sequence issuance, mode-0600 local
29
- storage, `.dev.vars`, and redacted Wrangler stdin transfer. It pushes
30
- `ODLA_API_KEY` and, when the app enabled o11y, `ODLA_O11Y_TOKEN` too:
28
+ Normal deployment provisioning owns the complete sequence. The handshake
29
+ authorizes one exact Cloudflare target; Registry stages additive DB/o11y
30
+ credentials, the CLI holds plaintext only in memory, and one Wrangler bulk
31
+ stdin call installs `ODLA_API_KEY` plus `ODLA_O11Y_TOKEN`:
31
32
 
32
- npx @odla-ai/cli provision --write-dev-vars --push-secrets
33
- npx @odla-ai/cli provision --yes --push-secrets # Phase 5; includes prod consent
33
+ npx @odla-ai/cli provision --push-secrets
34
+ npx @odla-ai/cli provision --live --yes --push-secrets # Phase 5; prod only
34
35
 
35
- Use the narrower command only to retry one environment's already-saved
36
- credential transfer:
36
+ Each developer and Worker may have a different credential for the same sandbox
37
+ tenant. Revocation is targeted and never rotates siblings. Use
38
+ `credentials list` and `credentials revoke <receipt-id>` to inventory or retire
39
+ one deployed runtime. Use the narrower command below only to transfer an
40
+ already-saved local-development credential:
37
41
 
38
42
  npx @odla-ai/cli secrets push --env dev
39
43
  npx @odla-ai/cli secrets push --env prod --yes
40
44
 
41
- Manual fallback (identical mechanics, if the CLI is unavailable):
42
-
43
- node -e 'const c=require("./.odla/credentials.local.json");process.stdout.write(c.envs.dev.dbKey)' \
44
- | npx wrangler secret put ODLA_API_KEY --env dev
45
-
46
- (For prod, use `c.envs.prod.dbKey` and drop `--env` — the top-level
47
- wrangler env is prod.)
45
+ There is intentionally no production manual-copy fallback. If the CLI is
46
+ unavailable, repair the CLI or Registry session path rather than exporting a
47
+ production key into shell history or chat.
48
48
 
49
49
  ## Moving a tenant-vault secret (never through the transcript)
50
50
 
@@ -68,11 +68,11 @@ Clerk dashboard between two browser tabs). Prod-named envs require `--yes`.
68
68
  - Before every commit: read `git status`; the files above and the build
69
69
  output dir must not be staged. `odla-ai init` gitignores them — trust
70
70
  but verify.
71
- - If a secret value ever does land in the conversation or a committed
72
- file: tell the human immediately, treat it as burned, and rotate it
73
- (`provision --rotate-keys` for the broad credential set, or
74
- `provision --rotate-o11y-token --push-secrets` for o11y only with explicit
75
- human approval; provider dashboard for LLM/Clerk values).
76
- - Studio's o11y token control is manual recovery only. It invalidates the live
77
- token immediately and does not update `.odla/credentials.local.json`; prefer
78
- the CLI rotation above so the saved and deployed values move together.
71
+ - If a secret value ever does land in the conversation or a committed file:
72
+ tell the human immediately and treat it as burned. For a receipt-backed
73
+ Worker, use `credentials revoke <receipt-id>` and run
74
+ `provision --push-secrets` for a fresh independent set. For a legacy local
75
+ credential, use `provision --rotate-keys` or `--rotate-o11y-token` only with
76
+ explicit human approval; use the provider dashboard for LLM/Clerk values.
77
+ - Studio's o11y token control is destructive legacy recovery. Prefer an
78
+ additive deployment credential so unrelated runtimes remain live.
@@ -86,14 +86,12 @@ smoke.
86
86
 
87
87
  ## Provision reports an existing o11y token but no local credential
88
88
 
89
- Cause: the shown-once token was issued elsewhere, or the local credentials file
90
- was lost. Plain provision refuses to invalidate a deployed Worker just to
91
- recover plaintext.
92
- Fix: after explicit human approval, run
93
- `npx @odla-ai/cli provision --rotate-o11y-token --push-secrets` (add `--yes`
94
- when production is in the plan). This persists the replacement before moving it
95
- to the Worker. Do not use the Studio button for routine recovery; it cannot sync
96
- the repository's credential file.
89
+ Cause: an older CLI expected one o11y token per tenant. Current o11y credentials
90
+ are additive, so another developer or Worker's token is not an obstacle.
91
+ Fix: run `npx @odla-ai/cli provision --push-secrets` (add `--yes` when production
92
+ is in the plan). The approved handshake stages a new target-bound token and DB
93
+ key, installs them without a local plaintext cache, and leaves every sibling
94
+ credential intact. Use destructive rotation only for an actual compromise.
97
95
 
98
96
  ## Clerk-verified requests return no email
99
97
 
@@ -118,14 +116,14 @@ Never rotate a key or rewrite the route merely to defeat a cached response.
118
116
 
119
117
  ## Re-running provision — is it safe?
120
118
 
121
- Yes: plain re-runs are idempotent (existing app registration and configured db
122
- and o11y credentials are reused; schema/rules re-push). Destructive rotation is
123
- always explicit: `--rotate-o11y-token` replaces only o11y, while
124
- `--rotate-keys` is the broader credential rotation. Use either only on explicit
125
- human request, and pair rotation with `--push-secrets` so the Worker receives
126
- the replacement in the same run. This is not atomic: if the final Wrangler
127
- transfer fails, the new value is already in the private credentials file. Run
128
- the printed `secrets push --env ...` retry and do not rotate again.
119
+ Yes: plain local re-runs are idempotent (existing app registration and saved db
120
+ and o11y credentials are reused; schema/rules re-push). Each `--push-secrets`
121
+ run intentionally creates a new receipt-backed set for that exact Worker.
122
+ Retire an older deployment with `credentials list` followed by
123
+ `credentials revoke <receipt-id>`. Destructive legacy local rotation is always
124
+ explicit: `--rotate-o11y-token` replaces only o11y, while `--rotate-keys` is
125
+ broader. Rotation flags cannot be combined with `--push-secrets`; a failed
126
+ Wrangler bulk operation automatically revokes its staged set.
129
127
 
130
128
  ## Something not covered here
131
129