@odla-ai/cli 0.34.0 → 0.34.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.
Files changed (32) hide show
  1. package/README.md +130 -119
  2. package/REQUIREMENTS.md +6 -0
  3. package/dist/bin.cjs +50 -37
  4. package/dist/bin.cjs.map +1 -1
  5. package/dist/bin.js +1 -1
  6. package/dist/{chunk-LGNNX6AP.js → chunk-RUEM7ZTA.js} +51 -38
  7. package/dist/chunk-RUEM7ZTA.js.map +1 -0
  8. package/dist/{cli-IN6WGMSY.js → cli-NKNQLWOM.js} +2 -2
  9. package/dist/index.cjs +50 -37
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +1 -1
  12. package/package.json +1 -1
  13. package/skills/odla/SKILL.md +55 -35
  14. package/skills/odla/references/agent-identity.md +5 -5
  15. package/skills/odla/references/build.md +16 -15
  16. package/skills/odla/references/co-owners.md +1 -1
  17. package/skills/odla/references/pm-work-intake.md +12 -12
  18. package/skills/odla/references/pm.md +17 -17
  19. package/skills/odla/references/sdks.md +2 -2
  20. package/skills/odla-migrate/SKILL.md +23 -5
  21. package/skills/odla-migrate/references/phase-2-chapter.md +1 -1
  22. package/skills/odla-migrate/references/phase-2-db.md +11 -10
  23. package/skills/odla-migrate/references/phase-3-auth.md +2 -2
  24. package/skills/odla-migrate/references/phase-3b-user-sync.md +2 -2
  25. package/skills/odla-migrate/references/phase-4-ai.md +3 -3
  26. package/skills/odla-migrate/references/phase-5-cutover.md +5 -5
  27. package/skills/odla-migrate/references/project-state.md +4 -4
  28. package/skills/odla-migrate/references/secrets-map.md +6 -6
  29. package/skills/odla-migrate/references/troubleshooting.md +23 -23
  30. package/skills/odla-o11y-debug/SKILL.md +3 -3
  31. package/dist/chunk-LGNNX6AP.js.map +0 -1
  32. /package/dist/{cli-IN6WGMSY.js.map → cli-NKNQLWOM.js.map} +0 -0
package/dist/bin.js CHANGED
@@ -174,7 +174,7 @@ function absoluteEntryPath(entryPath) {
174
174
 
175
175
  // src/bin.ts
176
176
  var argv = process.argv.slice(2);
177
- requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-IN6WGMSY.js")).runCli()).catch((err) => {
177
+ requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-NKNQLWOM.js")).runCli()).catch((err) => {
178
178
  console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
179
179
  process.exitCode = exitCodeFor(err);
180
180
  });
@@ -40,9 +40,10 @@ function approvalLines(prompt) {
40
40
  lines.push(` No browser was opened (${prompt.browserSkipped}).`);
41
41
  }
42
42
  lines.push("");
43
- lines.push(" AGENTS: use browser control to open the URL above now; do not wait silently.");
44
- lines.push(" If browser control is unavailable, give the exact URL to the human verbatim.");
45
- lines.push(" You cannot approve it yourself, retry it away, or start a substitute handshake.");
43
+ lines.push(" AGENTS: immediately give the human this URL as a clickable approval action and repeat the code.");
44
+ lines.push(" Keep this CLI process running and wait on this same process; the CLI owns protocol polling.");
45
+ lines.push(" Do not use OS open, browser control, curl, a shell wait loop, detached execution, or a substitute handshake.");
46
+ lines.push(" You cannot approve it yourself. If this process exits, a later invocation creates a new code.");
46
47
  lines.push("");
47
48
  return lines;
48
49
  }
@@ -4780,18 +4781,29 @@ For work that creates an odla app or adds odla services, read and follow
4780
4781
  \`.agents/skills/odla-o11y-debug/SKILL.md\`.
4781
4782
 
4782
4783
  Track the work in odla's PM as you go. Before project-mutating work, run
4783
- \`npx @odla-ai/cli pm next --app <appId>\`, confirm alignment to an open goal,
4784
+ \`npx --yes @odla-ai/cli@latest pm next --app <appId>\`, confirm alignment to an open goal,
4784
4785
  and atomically claim a refined Ready task. Record decisions when you make them
4785
4786
  and file bugs when you notice them. The conventions and the full command set are
4786
4787
  in \`.agents/skills/odla/references/pm.md\`.
4787
4788
 
4788
- Use the human's signed-in odla account email for device authorization; never
4789
- infer it from git config, commit metadata, or GitHub. If authorization is not
4790
- already active, run
4791
- \`npx @odla-ai/cli auth login --app <appId> --email <odla-account>\` and open
4792
- the exact Studio URL it prints. Never file an odla project or product defect in
4793
- GitHub Issues: run \`npx @odla-ai/cli bug report --app <appId> ...\` so the bug
4794
- lands in odla PM with the rest of the project's goals, tasks, and decisions.
4789
+ Use the human's known signed-in odla account email for device authorization;
4790
+ never infer it from git config, commit metadata, or GitHub. If authorization is
4791
+ not already active, run this exact command as one foreground process:
4792
+
4793
+ \`npx --yes @odla-ai/cli@latest auth login --app <appId> --email <odla-account> --no-open --wait 600\`
4794
+
4795
+ When it prints the approval URL and code, immediately give the human a clickable
4796
+ link, name the code they must verify, and tell them to click **Approve**. Keep
4797
+ that CLI process running and wait on the same tool process for its result. The
4798
+ CLI owns protocol polling: never call the OS \`open\` command, use browser
4799
+ control, curl a handshake endpoint, build a shell wait/poll loop, detach the
4800
+ process, or start another handshake while it is alive. The device code exists
4801
+ only in that process. If it exits 75 before approval, the old code cannot be
4802
+ collected; start one fresh foreground command and surface its new URL.
4803
+
4804
+ Never file an odla project or product defect in GitHub Issues: run
4805
+ \`npx --yes @odla-ai/cli@latest bug report --app <appId> ...\` so the bug lands
4806
+ in odla PM with the rest of the project's goals, tasks, and decisions.
4795
4807
 
4796
4808
  The setup runbooks and their references are installed in this repository, pinned
4797
4809
  to this CLI version. Use them as your setup context.
@@ -4803,9 +4815,9 @@ When this repository has an \`appId\`, pass it: app-scoped discovery includes
4803
4815
  that project's instructions plus the shared platform procedures.
4804
4816
 
4805
4817
  \`\`\`
4806
- npx odla-ai runbook ask "<what you are about to do>" --app <appId>
4807
- npx odla-ai runbook list
4808
- npx odla-ai runbook get <slug>
4818
+ npx --yes @odla-ai/cli@latest runbook ask "<what you are about to do>" --app <appId>
4819
+ npx --yes @odla-ai/cli@latest runbook list
4820
+ npx --yes @odla-ai/cli@latest runbook get <slug>
4809
4821
  \`\`\`
4810
4822
 
4811
4823
  Never scrape odla.ai HTML for any of this. The CLI reads the same content
@@ -9960,8 +9972,8 @@ Usage:
9960
9972
  odla-ai runbook revert <slug> --version <n> [--app <id>]
9961
9973
  odla-ai runbook rm <slug> [--app <id>]
9962
9974
  odla-ai capabilities [--json]
9963
- odla-ai code connect [--env dev|prod] [--email <odla-account>] [--engine auto|container|podman|docker] [--slots <1-64>] [--once]
9964
- odla-ai admin ai show [--context <name>] [--platform https://odla.ai] [--email <odla-account>] [--json]
9975
+ odla-ai code connect [--env dev|prod] [--email <odla-account>] [--no-open] [--engine auto|container|podman|docker] [--slots <1-64>] [--once]
9976
+ odla-ai admin ai show [--context <name>] [--platform https://odla.ai] [--email <odla-account>] [--no-open] [--json]
9965
9977
  odla-ai admin ai models [--context <name>] [--provider <id>] [--json]
9966
9978
  odla-ai admin ai set <purpose> [--context <name>] [--provider <id>] [--model <id>] [--enabled|--no-enabled]
9967
9979
  [--max-input-bytes <n>] [--max-output-tokens <n>] [--max-calls-per-run <n>] [--json]
@@ -9980,7 +9992,7 @@ Usage:
9980
9992
  odla-ai security report <job-id> [--json]
9981
9993
  odla-ai security run [target] --ack-redacted-source [--env dev] [--profile odla] [--fail-on high]
9982
9994
  odla-ai security run [target] --self --ack-redacted-source
9983
- odla-ai provision [--live] [--config odla.config.mjs] [--email <odla-account>] [--request-grant] [--wait <seconds>] [--dry-run] [--push-secrets] [--rotate-o11y-token] [--write-dev-vars[=path]] [--yes]
9995
+ odla-ai provision [--live] [--config odla.config.mjs] [--email <odla-account>] [--request-grant] [--no-open] [--wait <seconds>] [--dry-run] [--push-secrets] [--rotate-o11y-token] [--write-dev-vars[=path]] [--yes]
9984
9996
  odla-ai credentials list [--config odla.config.mjs] [--env dev] [--all] [--json]
9985
9997
  odla-ai credentials revoke <receipt-id> [--config odla.config.mjs] [--json]
9986
9998
  odla-ai smoke [--config odla.config.mjs] [--env dev] [--runtime] [--email <odla-account>] [--no-open]
@@ -9995,7 +10007,7 @@ function printHelp(output = console) {
9995
10007
  output.log(`odla-ai
9996
10008
  ${USAGE_SECTION}
9997
10009
  Commands:
9998
- auth Start a fresh, exact-project agent authorization in the browser.
10010
+ auth Start a fresh, exact-project agent authorization for human review.
9999
10011
  The email is the signed-in odla account, never git or GitHub
10000
10012
  identity. The approval screen confirms the agent name first.
10001
10013
  agent Inspect durable agent wakeups and explicitly requeue a
@@ -10125,23 +10137,25 @@ Safety:
10125
10137
  the metadata file. Flags and specific ODLA_* scope variables beat a selected
10126
10138
  context, which beats project config. There is no ambient current context.
10127
10139
  "context show" reports only provenance and cache state and never authenticates.
10128
- Every real CLI handshake prints one canonical /studio?code= approval URL and
10129
- attempts to open it \u2014 including in CI, SSH, display-less, and agent-driven
10130
- shells. Only --no-open suppresses the attempt. Browser launch is best-effort:
10131
- agents with browser control must open that exact URL immediately; otherwise
10132
- they must give it to the human verbatim. A device code remains only in the
10133
- running process. Outside an interactive terminal the wait is capped (90s by
10134
- default, --wait <seconds> to change); a still-pending handshake then exits
10135
- with code 75. Rerunning always requests and opens a new code; older clients'
10136
- persisted pending state is discarded.
10140
+ Every real CLI handshake prints one canonical /studio?code= approval URL.
10141
+ Interactive humans may let the CLI attempt its best-effort browser launch.
10142
+ Agent-driven commands must pass --no-open --wait 600, immediately surface the
10143
+ exact URL and code as a clickable human approval action, and keep that CLI
10144
+ process alive. Wait only on that same process: the CLI owns protocol polling.
10145
+ Do not call OS open, use browser control, curl handshake endpoints, build a
10146
+ shell wait loop, detach the command, or start a substitute handshake. The
10147
+ device code remains only in the running process. If the process exits 75, its
10148
+ old code cannot be collected; a later invocation requests a new code. Older
10149
+ clients' persisted pending state is discarded.
10137
10150
  A fresh device handshake requires --email <odla-account> or ODLA_USER_EMAIL.
10138
10151
  The email is a non-secret identity hint: never provide a password or session
10139
10152
  token. It is the email shown by the signed-in odla account \u2014 never infer it
10140
10153
  from git config, a commit author, or GitHub. The matching account must already exist, be signed in, explicitly
10141
10154
  review the exact code, and finish any current request before claiming another.
10142
- Use "auth login --app <id> --email <odla-account>" when an outside agent needs
10143
- a deliberate fresh request; it ignores cached credentials and opens the same
10144
- focused authorization sequence used by every first-time command.
10155
+ Use "auth login --app <id> --email <odla-account> --no-open --wait 600" when
10156
+ an outside agent needs a deliberate fresh request; it ignores cached
10157
+ credentials and uses the same focused authorization sequence as every
10158
+ first-time command.
10145
10159
  If provision reports that the current agent principal has no live app.manage
10146
10160
  grant, run it once with --request-grant. That flag ignores ODLA_DEV_TOKEN and
10147
10161
  the local cache, prints and opens a fresh exact-project owner-review URL, then
@@ -13508,7 +13522,7 @@ async function runbookImpact(ctx, options, deps = {}) {
13508
13522
 
13509
13523
  // src/runbook-lint.ts
13510
13524
  function invocationsIn(body) {
13511
- const re = /(`|npx[^\S\n]+)?(?:@odla-ai\/cli(?:@[\w.-]+)?|odla-ai)((?:[^\S\n]+[a-z][\w-]*)+)/g;
13525
+ const re = /(`|npx[^\S\n]+(?:--yes[^\S\n]+)?)?(?:@odla-ai\/cli(?:@[\w.-]+)?|odla-ai)((?:[^\S\n]+[a-z][\w-]*)+)/g;
13512
13526
  const found = [];
13513
13527
  for (const match of body.matchAll(re)) {
13514
13528
  if (!match[1]) continue;
@@ -13704,7 +13718,8 @@ var ALLOWED2 = [
13704
13718
  "base",
13705
13719
  "requires",
13706
13720
  "platform",
13707
- "context"
13721
+ "context",
13722
+ "open"
13708
13723
  ];
13709
13724
  function requireSlug(slug, action2) {
13710
13725
  if (!slug) throw new Error(`"runbook ${action2}" needs a slug, e.g. "odla-ai runbook ${action2} release"`);
@@ -13732,6 +13747,7 @@ async function buildContext3(parsed, deps, action2) {
13732
13747
  };
13733
13748
  }
13734
13749
  const needsCapability = WRITES2.has(action2) && !dryRun && appId === PLATFORM_SCOPE && !stringOpt(parsed.options.token);
13750
+ const open = parsed.options.open === false ? false : parsed.options.open === true ? true : void 0;
13735
13751
  const token = needsCapability ? await getScopedPlatformToken({
13736
13752
  platform: cfg.platformUrl,
13737
13753
  scope: "platform:runbook:write",
@@ -13739,6 +13755,7 @@ async function buildContext3(parsed, deps, action2) {
13739
13755
  label: `odla CLI (runbook ${action2})`,
13740
13756
  fetch: doFetch,
13741
13757
  stdout: out,
13758
+ open,
13742
13759
  openApprovalUrl: deps.openUrl,
13743
13760
  // A project, named context, or the global operator context owns the
13744
13761
  // exact-scope cache; it never follows an arbitrary shell directory.
@@ -13750,11 +13767,7 @@ async function buildContext3(parsed, deps, action2) {
13750
13767
  configPath: cfg.configPath,
13751
13768
  token: stringOpt(parsed.options.token),
13752
13769
  email: stringOpt(parsed.options.email),
13753
- // Let the normal browser policy decide (it already suppresses tests,
13754
- // CI and SSH). Hardcoding `false` meant a first-time handshake printed
13755
- // a link and opened nothing — the one moment a browser is the whole
13756
- // point.
13757
- open: void 0
13770
+ open
13758
13771
  },
13759
13772
  doFetch,
13760
13773
  out
@@ -14777,4 +14790,4 @@ export {
14777
14790
  isTerminalHostedSecurityStatus,
14778
14791
  runCli
14779
14792
  };
14780
- //# sourceMappingURL=chunk-LGNNX6AP.js.map
14793
+ //# sourceMappingURL=chunk-RUEM7ZTA.js.map