@anna-ai/cli 0.1.21 → 0.1.23

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 (55) hide show
  1. package/dist/{agent-Br6zY2qw.js → agent-DyXJhaZ0.js} +1 -1
  2. package/dist/{app-bundle-upload-DuLalcSt.js → app-bundle-upload-Cd4ci4rB.js} +1 -1
  3. package/dist/{apps-cut-DtEkddIk.js → apps-cut-BG6Ib3x4.js} +6 -4
  4. package/dist/{apps-destructive-DSTrcFUP.js → apps-destructive-DQIFqYE2.js} +1 -1
  5. package/dist/{apps-discard-y3_IwcbQ.js → apps-discard-BveXHAgF.js} +6 -4
  6. package/dist/{apps-publish-DfZTOxBJ.js → apps-publish-D403z305.js} +5 -5
  7. package/dist/{apps-publish-CaTCanDu.js → apps-publish-U_Y7svJw.js} +4 -4
  8. package/dist/{apps-push-B9XT2uwF.js → apps-push-x5reIQHx.js} +20 -6
  9. package/dist/{apps-release-BLH9XSxB.js → apps-release-ByIgz6lx.js} +2 -2
  10. package/dist/{apps-submit-review-DLwCxeAs.js → apps-submit-review-D-cPtZtc.js} +1 -1
  11. package/dist/{apps-sync-meta-D9eKMMUp.js → apps-sync-meta-CTHwGlzI.js} +2 -2
  12. package/dist/{bridge-BuklhzeE.js → bridge-CBew_Ytl.js} +1 -1
  13. package/dist/bridge-DZmZIWG0.js +3 -0
  14. package/dist/cli.js +69 -43
  15. package/dist/{dev-E7mqXj5S.js → dev-CyFATq6R.js} +4 -4
  16. package/dist/dev-DdjwQzJ2.js +3 -0
  17. package/dist/{doctor-DKrt-Kda.js → doctor-oqYeEjLv.js} +1 -1
  18. package/dist/{executa-destructive-COQE4Xqi.js → executa-destructive-Dpo58lxI.js} +1 -1
  19. package/dist/{executa-dev-BvS9zTpO.js → executa-dev-DFp1ckAn.js} +8 -8
  20. package/dist/executa-install-DnBG8UJA.js +90 -0
  21. package/dist/executa-install-viq3kiV7.js +6 -0
  22. package/dist/{executa-publish-Ca5V7MyA.js → executa-publish-BKFq6Hz9.js} +1 -1
  23. package/dist/{executa-publish-B88_9gbp.js → executa-publish-DaYvxbbW.js} +2 -2
  24. package/dist/{manifest-DGwRap2i.js → manifest-hXWnNFHE.js} +73 -14
  25. package/dist/{publish-C1wcf-qI.js → publish-R3JAl9Hm.js} +5 -5
  26. package/dist/{server-_IG8Igje.js → server-BzfmXVJD.js} +1 -1
  27. package/dist/{storage-CTkApNQ9.js → storage-BCj754in.js} +1 -1
  28. package/dist/test/index.js +3 -0
  29. package/dist/{working-orchestration-Dw9u1Vq0.js → working-orchestration-CIpQ_JMY.js} +51 -4
  30. package/package.json +1 -1
  31. package/templates/executa/go/main.go +4 -2
  32. package/templates/executa/node/plugin.mjs +4 -2
  33. package/templates/executa/python/__SLUG_PY___plugin.py +4 -2
  34. package/dist/bridge-Id8K8gr-.js +0 -3
  35. package/dist/dev-BS_8yoSm.js +0 -3
  36. /package/dist/{app-cache-BEM653Th.js → app-cache-TcmbIIuL.js} +0 -0
  37. /package/dist/{apps-BTn9EN0x.js → apps-B57i8xeb.js} +0 -0
  38. /package/dist/{apps-grants-BGWlpee0.js → apps-grants-D3i6GxX_.js} +0 -0
  39. /package/dist/{apps-status-DQ9RvlME.js → apps-status-BYo97Nh5.js} +0 -0
  40. /package/dist/{apps-versions-2Tmk0nsx.js → apps-versions-Ca-AAMLL.js} +0 -0
  41. /package/dist/{confirm-DxHkk9Wn.js → confirm-C-4haiIg.js} +0 -0
  42. /package/dist/{dev-account-qRaET1Cp.js → dev-account-CD6hTr7M.js} +0 -0
  43. /package/dist/{dev-app-cache-D-r6ZpEk.js → dev-app-cache-DMQLQ93-.js} +0 -0
  44. /package/dist/{executa-init-Jp-h9OI7.js → executa-init-By0kMPaF.js} +0 -0
  45. /package/dist/{executa-reads-CQ6S8gHY.js → executa-reads-cd-8ZRjI.js} +0 -0
  46. /package/dist/{executa-register-CulDtwYZ.js → executa-register-BX29VfcD.js} +0 -0
  47. /package/dist/{fixture-CYwxbiQD.js → fixture-C9VLX3os.js} +0 -0
  48. /package/dist/{host_upload-GXVkDM5M.js → host_upload-wKM0jQoL.js} +0 -0
  49. /package/dist/{image-DduR91n5.js → image-CBSlNb-9.js} +0 -0
  50. /package/dist/{login-BGqFjQwH.js → login-D4cU2Jcp.js} +0 -0
  51. /package/dist/{logout-CGIRKH3y.js → logout-DOpL3vXX.js} +0 -0
  52. /package/dist/{runner-B-hIqx5L.js → runner-4-ugGH5e.js} +0 -0
  53. /package/dist/{sampling-CXke7hq1.js → sampling-finZ8aNJ.js} +0 -0
  54. /package/dist/{token-B9JUPelx.js → token-BGjbb2aU.js} +0 -0
  55. /package/dist/{whoami-BoFLEUcp.js → whoami-DarmijoA.js} +0 -0
package/dist/cli.js CHANGED
@@ -137,11 +137,16 @@ function hostApiAllows(manifest, ns, method) {
137
137
  if (!manifest.ui) return false;
138
138
  if (ns === "window") return true;
139
139
  const grants = manifest.ui.host_api ?? {};
140
+ if (ns === "tools" && (method === "invoke" || method === "list")) {
141
+ const tools = grants.tools;
142
+ if (tools && tools.length > 0) return true;
143
+ const declared = (manifest.required_executas?.length ?? 0) + (manifest.optional_executas?.length ?? 0);
144
+ return declared > 0;
145
+ }
140
146
  const methods = grants[ns];
141
147
  if (!methods || methods.length === 0) return false;
142
148
  if (methods.includes("*")) return true;
143
149
  if (methods.includes(method)) return true;
144
- if (ns === "tools" && (method === "invoke" || method === "list")) return true;
145
150
  return false;
146
151
  }
147
152
  function checkHostApiAllowance(usages, manifest, bundleMethods) {
@@ -160,14 +165,22 @@ function checkHostApiAllowance(usages, manifest, bundleMethods) {
160
165
  //#endregion
161
166
  //#region src/validate/ui-section.ts
162
167
  /**
163
- * Static validation of `manifest.ui` — direct port of
168
+ * Static validation of `manifest.ui` — port of
164
169
  * `src/services/anna_app_validator.py::validate_ui_section_static` from
165
170
  * matrix-nexus. Keep these algorithms byte-equivalent: any divergence here
166
171
  * means `anna-app validate` will lie about what production accepts.
172
+ *
173
+ * One intentional divergence: this CLI validates the **source** manifest
174
+ * *before* publish, so it must additionally tolerate the `bundled:<handle>`
175
+ * placeholder form in `host_api.tools` / `required_executas[].tool_id`.
176
+ * Those placeholders are resolved to real tool_ids at publish time by
177
+ * `substituteBundledRefs` (src/publish/bundled-executas.ts); production
178
+ * (the Python validator) only ever sees the substituted manifest, where
179
+ * the `bundled:` prefix is gone.
167
180
  */
168
181
  const VIEW_NAME_PATTERN = /^[a-z0-9_-]{1,40}$/;
169
182
  const BUNDLE_PATH_PATTERN = /^[A-Za-z0-9_./\-]+$/;
170
- const HOST_API_TOOL_REF_PATTERN = /^(?:required:\*|optional:\*|required:[A-Za-z0-9_.\-]+|optional:[A-Za-z0-9_.\-]+|[A-Za-z0-9_.\-]+)$/;
183
+ const HOST_API_TOOL_REF_PATTERN = /^(?:required:\*|optional:\*|(?:required:|optional:)?bundled:[A-Za-z0-9_.\-]+|required:[A-Za-z0-9_.\-]+|optional:[A-Za-z0-9_.\-]+|[A-Za-z0-9_.\-]+)$/;
171
184
  const CSP_OVERRIDABLE_DIRECTIVES = new Set([
172
185
  "connect-src",
173
186
  "img-src",
@@ -211,7 +224,8 @@ function validateUiSectionStatic(manifest) {
211
224
  continue;
212
225
  }
213
226
  if (ref === "required:*" || ref === "optional:*") continue;
214
- const bare = ref.includes(":") ? ref.split(":", 2)[1] : ref;
227
+ const colon = ref.indexOf(":");
228
+ const bare = ref.startsWith("required:") || ref.startsWith("optional:") ? ref.slice(colon + 1) : ref;
215
229
  if (!requiredIds.has(bare) && !optionalIds.has(bare)) errors.push(`host_api.tools 引用未在 manifest 中声明的 tool_id: ${ref}`);
216
230
  }
217
231
  const cspOverrides = ui.csp_overrides ?? {};
@@ -451,7 +465,7 @@ program.command("validate").description("Run schema + ACL checks on a manifest+b
451
465
  process.exit(code);
452
466
  });
453
467
  program.command("dev").description("Run a local harness (in-process dispatcher + iframe + SSE relay)").option("--manifest <path>", "manifest.json path", "manifest.json").option("--bundle <dir>", "bundle directory (default: ./bundle)").option("--slug <slug>", "App slug (overrides manifest.slug/name)").option("--view <name>", "View name to open (default: manifest default)").option("--matrix-nexus-root <path>", "matrix-nexus checkout (auto-detected if omitted; can also use $ANNA_NEXUS_ROOT)").option("--port <number>", "HTTP port", "5180").option("--user-id <id>", "Harness user_id", "1").option("--cwd <dir>", "Project root (default: cwd)").option("--no-watch", "Disable bundle file watcher (default: enabled)").option("--executa <spec>", "Explicit executa registration; repeatable. Spec: comma-separated key=value (dir=<path>[,tool_id=<id>][,type=python|node|go|binary][,command=\"<argv>\"]). When only `dir=` is given, the executa is auto-detected from executa.json / pyproject.toml / package.json / go.mod. Overrides directory auto-discovery under <manifest-dir>/executas/.", (val, prev) => prev ? [...prev, val] : [val]).option("--no-llm", "Disable LLM bridge (anna.llm/agent return llm_disabled)").option("--mock-llm <fixture>", "Serve canned LLM responses from a JSONL fixture").option("--llm-account <host>", "Saved account host to use (default: current)").option("--llm-app-slug <slug>", "Override the manifest slug used to register / look up the dev AnnaApp (default: manifest.slug)").option("--storage <mode>", "Storage backend: \"legacy\" (in-memory runtime_state, default) or \"aps\" (real nexus APS via /api/v1/storage/* — requires `anna-app login`).", "legacy").action(async (opts) => {
454
- const { runDev, parseExecutaSpec } = await import("./dev-BS_8yoSm.js");
468
+ const { runDev, parseExecutaSpec } = await import("./dev-DdjwQzJ2.js");
455
469
  const cwd = opts.cwd ?? process.cwd();
456
470
  let executas;
457
471
  if (opts.executa && opts.executa.length > 0) {
@@ -486,7 +500,7 @@ program.command("dev").description("Run a local harness (in-process dispatcher +
486
500
  });
487
501
  const fixture = program.command("fixture").description("Inspect / replay harness recordings (Phase 6)");
488
502
  fixture.command("verify <file>").description("Schema + invariant checks on a harness JSONL recording").option("--json", "Emit machine-readable JSON", false).action(async (file, opts) => {
489
- const { runFixtureVerify } = await import("./fixture-CYwxbiQD.js");
503
+ const { runFixtureVerify } = await import("./fixture-C9VLX3os.js");
490
504
  const code = await runFixtureVerify({
491
505
  file,
492
506
  json: opts.json
@@ -494,7 +508,7 @@ fixture.command("verify <file>").description("Schema + invariant checks on a har
494
508
  process.exit(code);
495
509
  });
496
510
  fixture.command("summarize <file>").description("Print a human-readable digest of a harness recording").option("--json", "Emit machine-readable JSON", false).action(async (file, opts) => {
497
- const { runFixtureSummarize } = await import("./fixture-CYwxbiQD.js");
511
+ const { runFixtureSummarize } = await import("./fixture-C9VLX3os.js");
498
512
  const code = await runFixtureSummarize({
499
513
  file,
500
514
  json: opts.json
@@ -502,7 +516,7 @@ fixture.command("summarize <file>").description("Print a human-readable digest o
502
516
  process.exit(code);
503
517
  });
504
518
  fixture.command("replay <file>").description("Dry-run replay of a harness recording (Phase 6 MVP)").option("--manifest <path>", "manifest.json path", "manifest.json").action(async (file, opts) => {
505
- const { runFixtureReplay } = await import("./fixture-CYwxbiQD.js");
519
+ const { runFixtureReplay } = await import("./fixture-C9VLX3os.js");
506
520
  const code = await runFixtureReplay({
507
521
  file,
508
522
  manifest: opts.manifest
@@ -510,12 +524,12 @@ fixture.command("replay <file>").description("Dry-run replay of a harness record
510
524
  process.exit(code);
511
525
  });
512
526
  program.command("doctor").description("Check environment for `anna-app dev` (uv, matrix-nexus, dev key)").option("--matrix-nexus-root <path>", "matrix-nexus checkout (optional)").action(async (opts) => {
513
- const { runDoctor } = await import("./doctor-DKrt-Kda.js");
527
+ const { runDoctor } = await import("./doctor-oqYeEjLv.js");
514
528
  const code = await runDoctor({ matrixNexusRoot: opts.matrixNexusRoot });
515
529
  process.exit(code);
516
530
  });
517
531
  program.command("login").description("Device-flow login against a nexus host; saves a PAT to ~/.config/anna/credentials.json").requiredOption("--host <url>", "nexus base URL, e.g. https://nexus.example.com").option("--no-browser", "Do not open a browser window automatically", false).action(async (opts) => {
518
- const { runLogin } = await import("./login-BGqFjQwH.js");
532
+ const { runLogin } = await import("./login-D4cU2Jcp.js");
519
533
  const code = await runLogin({
520
534
  host: opts.host,
521
535
  noBrowser: opts.browser === false
@@ -523,7 +537,7 @@ program.command("login").description("Device-flow login against a nexus host; sa
523
537
  process.exit(code);
524
538
  });
525
539
  program.command("logout").description("Remove a saved PAT entry").option("--host <url>", "Account to remove (default: current)").option("--all", "Remove every saved account", false).action(async (opts) => {
526
- const { runLogout } = await import("./logout-CGIRKH3y.js");
540
+ const { runLogout } = await import("./logout-DOpL3vXX.js");
527
541
  const code = await runLogout({
528
542
  host: opts.host,
529
543
  all: opts.all
@@ -531,7 +545,7 @@ program.command("logout").description("Remove a saved PAT entry").option("--host
531
545
  process.exit(code);
532
546
  });
533
547
  program.command("whoami").description("Show the current account (and any others)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
534
- const { runWhoami } = await import("./whoami-BoFLEUcp.js");
548
+ const { runWhoami } = await import("./whoami-DarmijoA.js");
535
549
  const code = await runWhoami({ json: opts.json });
536
550
  process.exit(code);
537
551
  });
@@ -547,7 +561,7 @@ executa.command("init <dir>").description("Scaffold a standalone Executa plugin
547
561
  console.error(`✗ unknown template "${opts.template}" — expected python | node | go`);
548
562
  process.exit(2);
549
563
  }
550
- const { runExecutaInit } = await import("./executa-init-Jp-h9OI7.js");
564
+ const { runExecutaInit } = await import("./executa-init-By0kMPaF.js");
551
565
  const code = runExecutaInit({
552
566
  targetDir: dir,
553
567
  slug,
@@ -557,13 +571,24 @@ executa.command("init <dir>").description("Scaffold a standalone Executa plugin
557
571
  });
558
572
  process.exit(code);
559
573
  });
560
- executa.command("register").description("Register a HARNESS AnnaApp(kind=executa) so `executa dev --storage real` (and agent / sampling / image / upload real-mode flows) can mint tokens for a local executa subprocess. Does NOT publish the executa itself — use `executa publish` for that. Lists/deletes via `apps list` / `apps delete`.").requiredOption("--tool-id <id>", "Executa tool_id (matches manifest.name)").option("--slug <slug>", "App slug (default: executa-<tool_id>; must be lowercase + hyphens)").option("--name <name>", "Human-readable display name (default: <tool_id>)").option("--account <host>", "Saved account host (default: current)").action(async (opts) => {
561
- const { runExecutaRegister } = await import("./executa-register-CulDtwYZ.js");
574
+ executa.command("register").description("Register a HARNESS AnnaApp(kind=executa) so `executa dev --storage real` (and agent / sampling / image / upload real-mode flows) can mint tokens for a local executa subprocess. Does NOT publish the executa itself — use `executa publish` for that. Lists/deletes via `apps list` / `apps delete`.").requiredOption("--tool-id <id>", "Executa tool_id (matches executa.json tool_id / executable_name)").option("--slug <slug>", "App slug (default: executa-<tool_id>; must be lowercase + hyphens)").option("--name <name>", "Human-readable display name (default: <tool_id>)").option("--account <host>", "Saved account host (default: current)").action(async (opts) => {
575
+ const { runExecutaRegister } = await import("./executa-register-BX29VfcD.js");
562
576
  const code = await runExecutaRegister(opts);
563
577
  process.exit(code);
564
578
  });
579
+ executa.command("install").description("Install a local-dev shim for an Executa under its minted tool_id so the Agent can discover it via 'Rediscover Local' (for distribution_type: local). Resolves the tool_id from .anna/executa.json (written by `executa publish` / `apps push`) unless --tool-id is given.").option("--dir <path>", "Executa project dir (default: CWD)").option("--tool-id <id>", "Install the shim under this exact id (default: minted id from .anna/executa.json, else executa.json tool_id)").option("--bin-dir <path>", "Install dir for the shim (default: ~/.anna/executa/bin)").option("--force", "Overwrite an existing shim of the same name", false).option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
580
+ const { runExecutaInstall } = await import("./executa-install-viq3kiV7.js");
581
+ const code = await runExecutaInstall({
582
+ dir: opts.dir,
583
+ toolId: opts.toolId,
584
+ binDir: opts.binDir,
585
+ force: opts.force,
586
+ json: opts.json
587
+ });
588
+ process.exit(code);
589
+ });
565
590
  executa.command("dev").description("Run one Executa plugin in isolation (REPL or one-shot describe/invoke)").option("--dir <path>", "Executa project dir (default: CWD)").option("--spec <spec>", "Override discovery: comma-separated key=value (tool_id=...,type=...,command=\"...\")").option("--describe", "Print MANIFEST and exit", false).option("--health", "Print health and exit", false).option("--invoke <tool>", "Invoke one tool and exit").option("--args <json>", "JSON object passed as tool arguments", "{}").option("--json", "One-shot: emit compact JSON (no banners)", false).option("--no-sampling", "Hard-disable sampling reverse RPC (returns sampling_disabled)").option("--mock-sampling <fixture>", "Serve canned sampling responses from a JSONL fixture (offline)").option("--app-slug <slug>", "Forward sampling to nexus on behalf of this dev AnnaApp slug").option("--sampling-account <host>", "Saved account host for nexus sampling (default: current)").option("--no-agent", "Hard-disable agent reverse RPC (returns agent_not_granted)").option("--mock-agent <fixture>", "Serve canned agent/* responses from a JSONL fixture (offline)").option("--agent-account <host>", "Saved account host for nexus agent (default: --sampling-account or current)").option("--storage <mode>", "Storage backend: off | memory | mock | real (default: memory)").option("--mock-storage <fixture>", "Serve canned storage/* + files/* responses from a JSONL fixture").option("--storage-account <host>", "Saved account host for nexus storage (default: --sampling-account or current)").option("--storage-scopes <list>", "Comma-separated scopes for real storage tokens (default: user,app,tool)").option("--no-image", "Hard-disable image reverse RPC (returns image_not_granted)").option("--mock-image <fixture>", "Serve canned image/generate + image/edit responses from a JSONL fixture").option("--image-account <host>", "Saved account host for nexus image (default: --sampling-account or current)").option("--no-upload", "Hard-disable host/uploadFile reverse RPC (returns upload_not_granted)").option("--mock-upload <fixture>", "Serve canned host/uploadFile responses from a JSONL fixture").option("--upload-account <host>", "Saved account host for nexus uploads (default: --sampling-account or current)").action(async (opts) => {
566
- const { runExecutaDev } = await import("./executa-dev-BvS9zTpO.js");
591
+ const { runExecutaDev } = await import("./executa-dev-DFp1ckAn.js");
567
592
  const storageMode = opts.storage === void 0 ? void 0 : (() => {
568
593
  const m = opts.storage;
569
594
  if (m === "off" || m === "memory" || m === "mock" || m === "real") return m;
@@ -600,7 +625,7 @@ executa.command("dev").description("Run one Executa plugin in isolation (REPL or
600
625
  });
601
626
  const apps = program.command("apps").description("Anna App publish lifecycle commands");
602
627
  apps.command("list").description("List the Anna Apps you authored, with lifecycle status").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
603
- const { runAppsList } = await import("./apps-BTn9EN0x.js");
628
+ const { runAppsList } = await import("./apps-B57i8xeb.js");
604
629
  process.exit(await runAppsList({
605
630
  account: opts.account,
606
631
  json: opts.json
@@ -615,7 +640,7 @@ apps.command("publish").description("Publish or update an Anna App (manifest.jso
615
640
  console.error(`✗ --bump must be patch|minor|major (got: ${opts.bump})`);
616
641
  process.exit(2);
617
642
  }
618
- const { runAppsPublish } = await import("./apps-publish-DfZTOxBJ.js");
643
+ const { runAppsPublish } = await import("./apps-publish-D403z305.js");
619
644
  process.exit(await runAppsPublish({
620
645
  cwd: opts.cwd,
621
646
  manifest: opts.manifest,
@@ -631,7 +656,7 @@ apps.command("publish").description("Publish or update an Anna App (manifest.jso
631
656
  json: opts.json
632
657
  }));
633
658
  });
634
- apps.command("push").description("Upsert the mutable working draft (manifest + bundle, no freeze)").option("--cwd <dir>", "Project root (default: cwd)").option("--manifest <path>", "manifest.json path", "manifest.json").option("--bump <kind>", "Bump version: patch|minor|major").option("--no-write", "Skip writing the bumped version back to disk", false).option("--dry-run", "Resolve identity + diff but don't upsert", false).option("--executa-id <handle=id>", "Override a bundled executa handle with a real tool_id (repeatable)", (val, prev) => [...prev, val], []).option("--skip-executa-publish", "Use cached/overridden tool_ids; don't recursively register bundled executas", false).option("--no-bundled-executas", "Disable bundled-executa orchestration (legacy behaviour)").option("--no-bundle", "Skip working UI bundle upload even if the manifest declares a UI").option("--bundle-dir <dir>", "UI bundle directory (default: <cwd>/bundle)").option("--if-match <revision>", "Optimistic-lock: require this working revision").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
659
+ apps.command("push").description("Upsert the mutable working draft (manifest + bundle, no freeze)").option("--cwd <dir>", "Project root (default: cwd)").option("--manifest <path>", "manifest.json path", "manifest.json").option("--bump <kind>", "Bump version: patch|minor|major").option("--no-write", "Skip writing the bumped version back to disk", false).option("--dry-run", "Resolve identity + diff but don't upsert", false).option("--executa-id <handle=id>", "Override a bundled executa handle with a real tool_id (repeatable)", (val, prev) => [...prev, val], []).option("--skip-executa-publish", "Use cached/overridden tool_ids; don't recursively register bundled executas", false).option("--no-bundled-executas", "Disable bundled-executa orchestration (legacy behaviour)").option("--no-bundle", "Skip working UI bundle upload even if the manifest declares a UI").option("--bundle-dir <dir>", "UI bundle directory (default: <cwd>/bundle)").option("--no-install-local", "Don't install local-dev shims for bundled `local` executas (skip Rediscover-Local prep)").option("--if-match <revision>", "Optimistic-lock: require this working revision").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
635
660
  if (opts.bump && ![
636
661
  "patch",
637
662
  "minor",
@@ -648,7 +673,7 @@ apps.command("push").description("Upsert the mutable working draft (manifest + b
648
673
  process.exit(2);
649
674
  }
650
675
  }
651
- const { runAppsPush } = await import("./apps-push-B9XT2uwF.js");
676
+ const { runAppsPush } = await import("./apps-push-x5reIQHx.js");
652
677
  process.exit(await runAppsPush({
653
678
  cwd: opts.cwd,
654
679
  manifest: opts.manifest,
@@ -660,13 +685,14 @@ apps.command("push").description("Upsert the mutable working draft (manifest + b
660
685
  noBundledExecutas: opts.bundledExecutas === false,
661
686
  noBundle: opts.bundle === false,
662
687
  bundleDir: opts.bundleDir,
688
+ noInstallLocal: opts.installLocal === false,
663
689
  ifMatch,
664
690
  account: opts.account,
665
691
  json: opts.json
666
692
  }));
667
693
  });
668
694
  apps.command("cut <version>").description("Snapshot the working draft into an immutable version (freeze deps)").option("--changelog <text>", "Override the working draft changelog for this version").option("--slug <slug>", "App slug (default: resolve from .anna/app.json cache)").option("--cwd <dir>", "Project root for identity cache (default: cwd)").option("--dry-run", "Resolve target but don't cut", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (version, opts) => {
669
- const { runAppsCut } = await import("./apps-cut-DtEkddIk.js");
695
+ const { runAppsCut } = await import("./apps-cut-BG6Ib3x4.js");
670
696
  process.exit(await runAppsCut({
671
697
  version,
672
698
  changelog: opts.changelog,
@@ -678,7 +704,7 @@ apps.command("cut <version>").description("Snapshot the working draft into an im
678
704
  }));
679
705
  });
680
706
  apps.command("discard").description("Drop the mutable working draft (leaves cut versions intact)").option("--slug <slug>", "App slug (default: resolve from .anna/app.json cache)").option("--cwd <dir>", "Project root for identity cache (default: cwd)").option("--dry-run", "Resolve target but don't discard", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
681
- const { runAppsDiscard } = await import("./apps-discard-y3_IwcbQ.js");
707
+ const { runAppsDiscard } = await import("./apps-discard-BveXHAgF.js");
682
708
  process.exit(await runAppsDiscard({
683
709
  slug: opts.slug,
684
710
  cwd: opts.cwd,
@@ -688,7 +714,7 @@ apps.command("discard").description("Drop the mutable working draft (leaves cut
688
714
  }));
689
715
  });
690
716
  apps.command("release <version>").description("Freeze & publish an existing remote version (go live)").option("--slug <slug>", "App slug (default: resolve from .anna/app.json cache)").option("--cwd <dir>", "Project root for identity cache (default: cwd)").option("--allow-create", "If the version isn't on the server, run 'apps publish' first, then release", false).option("--dry-run", "Resolve target + pre-flight but don't publish", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (version, opts) => {
691
- const { runAppsRelease } = await import("./apps-release-BLH9XSxB.js");
717
+ const { runAppsRelease } = await import("./apps-release-ByIgz6lx.js");
692
718
  process.exit(await runAppsRelease({
693
719
  version,
694
720
  slug: opts.slug,
@@ -700,7 +726,7 @@ apps.command("release <version>").description("Freeze & publish an existing remo
700
726
  }));
701
727
  });
702
728
  apps.command("sync-meta").description("Push mutable store metadata (name/tagline/…) from the manifest").option("--cwd <dir>", "Project root (default: cwd)").option("--manifest <path>", "manifest.json path", "manifest.json").option("--dry-run", "Print the metadata diff but don't PATCH", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
703
- const { runAppsSyncMeta } = await import("./apps-sync-meta-D9eKMMUp.js");
729
+ const { runAppsSyncMeta } = await import("./apps-sync-meta-CTHwGlzI.js");
704
730
  process.exit(await runAppsSyncMeta({
705
731
  cwd: opts.cwd,
706
732
  manifest: opts.manifest,
@@ -710,7 +736,7 @@ apps.command("sync-meta").description("Push mutable store metadata (name/tagline
710
736
  }));
711
737
  });
712
738
  apps.command("submit-review [slug]").description("Move an app into review (DRAFT/REJECTED → PENDING_REVIEW)").option("--cwd <dir>", "Project root for identity cache (default: cwd)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
713
- const { runAppsSubmitReview } = await import("./apps-submit-review-DLwCxeAs.js");
739
+ const { runAppsSubmitReview } = await import("./apps-submit-review-D-cPtZtc.js");
714
740
  process.exit(await runAppsSubmitReview({
715
741
  slug,
716
742
  cwd: opts.cwd,
@@ -719,7 +745,7 @@ apps.command("submit-review [slug]").description("Move an app into review (DRAFT
719
745
  }));
720
746
  });
721
747
  apps.command("status <slug>").description("Show server-known state for one Anna App").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
722
- const { runAppsStatus } = await import("./apps-status-DQ9RvlME.js");
748
+ const { runAppsStatus } = await import("./apps-status-BYo97Nh5.js");
723
749
  process.exit(await runAppsStatus({
724
750
  slug,
725
751
  account: opts.account,
@@ -727,7 +753,7 @@ apps.command("status <slug>").description("Show server-known state for one Anna
727
753
  }));
728
754
  });
729
755
  apps.command("versions <slug>").description("List all server versions of one Anna App").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
730
- const { runAppsVersions } = await import("./apps-versions-2Tmk0nsx.js");
756
+ const { runAppsVersions } = await import("./apps-versions-Ca-AAMLL.js");
731
757
  process.exit(await runAppsVersions({
732
758
  slug,
733
759
  account: opts.account,
@@ -735,7 +761,7 @@ apps.command("versions <slug>").description("List all server versions of one Ann
735
761
  }));
736
762
  });
737
763
  apps.command("grants <slug>").description("Show currently granted scopes/quota for one Anna App").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
738
- const { runAppsGrants } = await import("./apps-grants-BGWlpee0.js");
764
+ const { runAppsGrants } = await import("./apps-grants-D3i6GxX_.js");
739
765
  process.exit(await runAppsGrants({
740
766
  slug,
741
767
  account: opts.account,
@@ -743,7 +769,7 @@ apps.command("grants <slug>").description("Show currently granted scopes/quota f
743
769
  }));
744
770
  });
745
771
  apps.command("unpublish <slug>").description("Flip a PUBLISHED app back to APPROVED (private)").option("--yes", "Acknowledge the destructive operation", false).option("--confirm <slug>", "Slug confirmation (must match target)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
746
- const { runAppsUnpublish } = await import("./apps-destructive-DSTrcFUP.js");
772
+ const { runAppsUnpublish } = await import("./apps-destructive-DQIFqYE2.js");
747
773
  process.exit(await runAppsUnpublish({
748
774
  slug,
749
775
  yes: opts.yes,
@@ -753,7 +779,7 @@ apps.command("unpublish <slug>").description("Flip a PUBLISHED app back to APPRO
753
779
  }));
754
780
  });
755
781
  apps.command("archive <slug>").description("Archive an Anna App (hides it from end users)").option("--yes", "Acknowledge the destructive operation", false).option("--confirm <slug>", "Slug confirmation (must match target)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
756
- const { runAppsArchive } = await import("./apps-destructive-DSTrcFUP.js");
782
+ const { runAppsArchive } = await import("./apps-destructive-DQIFqYE2.js");
757
783
  process.exit(await runAppsArchive({
758
784
  slug,
759
785
  yes: opts.yes,
@@ -763,7 +789,7 @@ apps.command("archive <slug>").description("Archive an Anna App (hides it from e
763
789
  }));
764
790
  });
765
791
  apps.command("unarchive <slug>").description("Restore an archived Anna App back to APPROVED").option("--yes", "Acknowledge the operation", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
766
- const { runAppsUnarchive } = await import("./apps-destructive-DSTrcFUP.js");
792
+ const { runAppsUnarchive } = await import("./apps-destructive-DQIFqYE2.js");
767
793
  process.exit(await runAppsUnarchive({
768
794
  slug,
769
795
  yes: opts.yes,
@@ -772,7 +798,7 @@ apps.command("unarchive <slug>").description("Restore an archived Anna App back
772
798
  }));
773
799
  });
774
800
  apps.command("delete <slug>").description("Hard-delete an Anna App (refused by server if installs exist)").option("--yes", "Acknowledge the destructive operation", false).option("--confirm <slug>", "Slug confirmation (must match target)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
775
- const { runAppsDelete } = await import("./apps-destructive-DSTrcFUP.js");
801
+ const { runAppsDelete } = await import("./apps-destructive-DQIFqYE2.js");
776
802
  process.exit(await runAppsDelete({
777
803
  slug,
778
804
  yes: opts.yes,
@@ -782,14 +808,14 @@ apps.command("delete <slug>").description("Hard-delete an Anna App (refused by s
782
808
  }));
783
809
  });
784
810
  executa.command("list").description("List Executas owned by the current PAT").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
785
- const { runExecutaList } = await import("./executa-reads-CQ6S8gHY.js");
811
+ const { runExecutaList } = await import("./executa-reads-cd-8ZRjI.js");
786
812
  process.exit(await runExecutaList({
787
813
  account: opts.account,
788
814
  json: opts.json
789
815
  }));
790
816
  });
791
817
  executa.command("status <ref>").description("Show server-known state for one Executa (slug or tool_id)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (ref, opts) => {
792
- const { runExecutaStatus } = await import("./executa-reads-CQ6S8gHY.js");
818
+ const { runExecutaStatus } = await import("./executa-reads-cd-8ZRjI.js");
793
819
  process.exit(await runExecutaStatus({
794
820
  ref,
795
821
  account: opts.account,
@@ -797,7 +823,7 @@ executa.command("status <ref>").description("Show server-known state for one Exe
797
823
  }));
798
824
  });
799
825
  executa.command("versions <ref>").description("List immutable version snapshots for one Executa").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (ref, opts) => {
800
- const { runExecutaVersions } = await import("./executa-reads-CQ6S8gHY.js");
826
+ const { runExecutaVersions } = await import("./executa-reads-cd-8ZRjI.js");
801
827
  process.exit(await runExecutaVersions({
802
828
  ref,
803
829
  account: opts.account,
@@ -813,7 +839,7 @@ executa.command("publish").description("Mint or update an Executa (executa.json
813
839
  console.error(`✗ --bump must be patch|minor|major (got: ${opts.bump})`);
814
840
  process.exit(2);
815
841
  }
816
- const { runExecutaPublish } = await import("./executa-publish-B88_9gbp.js");
842
+ const { runExecutaPublish } = await import("./executa-publish-DaYvxbbW.js");
817
843
  process.exit(await runExecutaPublish({
818
844
  cwd: opts.cwd,
819
845
  manifest: opts.manifest,
@@ -826,7 +852,7 @@ executa.command("publish").description("Mint or update an Executa (executa.json
826
852
  }));
827
853
  });
828
854
  executa.command("unpublish <slug>").description("Flip an Executa's visibility back to private").option("--yes", "Acknowledge the destructive operation", false).option("--confirm <slug>", "Slug confirmation (must match target)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
829
- const { runExecutaUnpublish } = await import("./executa-destructive-COQE4Xqi.js");
855
+ const { runExecutaUnpublish } = await import("./executa-destructive-Dpo58lxI.js");
830
856
  process.exit(await runExecutaUnpublish({
831
857
  slug,
832
858
  yes: opts.yes,
@@ -836,7 +862,7 @@ executa.command("unpublish <slug>").description("Flip an Executa's visibility ba
836
862
  }));
837
863
  });
838
864
  executa.command("yank <ref>").description("Hard-delete one Executa version (<slug>@<version>)").option("--yes", "Acknowledge the destructive operation", false).option("--confirm <slug>", "Slug confirmation (must match target)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (ref, opts) => {
839
- const { runExecutaYank } = await import("./executa-destructive-COQE4Xqi.js");
865
+ const { runExecutaYank } = await import("./executa-destructive-Dpo58lxI.js");
840
866
  process.exit(await runExecutaYank({
841
867
  ref,
842
868
  yes: opts.yes,
@@ -846,7 +872,7 @@ executa.command("yank <ref>").description("Hard-delete one Executa version (<slu
846
872
  }));
847
873
  });
848
874
  executa.command("delete <slug>").description("Hard-delete an Executa").option("--yes", "Acknowledge the destructive operation", false).option("--confirm <slug>", "Slug confirmation (must match target)").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (slug, opts) => {
849
- const { runExecutaDelete } = await import("./executa-destructive-COQE4Xqi.js");
875
+ const { runExecutaDelete } = await import("./executa-destructive-Dpo58lxI.js");
850
876
  process.exit(await runExecutaDelete({
851
877
  slug,
852
878
  yes: opts.yes,
@@ -871,7 +897,7 @@ executa.command("cache-clear").description("Delete the local `.anna/executa.json
871
897
  });
872
898
  const token = program.command("token").description("Manage developer PATs (list / revoke / scopes)");
873
899
  token.command("list").description("List the caller's PATs (most-recent first)").option("--include-revoked", "Also show revoked PATs", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
874
- const { runTokenList } = await import("./token-B9JUPelx.js");
900
+ const { runTokenList } = await import("./token-BGjbb2aU.js");
875
901
  process.exit(await runTokenList({
876
902
  includeRevoked: opts.includeRevoked,
877
903
  account: opts.account,
@@ -884,7 +910,7 @@ token.command("revoke <id>").description("Revoke one of the caller's PATs by id"
884
910
  console.error(`✗ token id must be a positive integer (got: ${id})`);
885
911
  process.exit(2);
886
912
  }
887
- const { runTokenRevoke } = await import("./token-B9JUPelx.js");
913
+ const { runTokenRevoke } = await import("./token-BGjbb2aU.js");
888
914
  process.exit(await runTokenRevoke({
889
915
  id: idNum,
890
916
  account: opts.account,
@@ -892,7 +918,7 @@ token.command("revoke <id>").description("Revoke one of the caller's PATs by id"
892
918
  }));
893
919
  });
894
920
  token.command("scopes").description("Print the available PAT scope catalogue").option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
895
- const { runTokenScopes } = await import("./token-B9JUPelx.js");
921
+ const { runTokenScopes } = await import("./token-BGjbb2aU.js");
896
922
  process.exit(await runTokenScopes({
897
923
  account: opts.account,
898
924
  json: opts.json
@@ -907,7 +933,7 @@ program.command("publish").description("Auto-detect cwd and publish (apps publis
907
933
  console.error(`✗ --bump must be patch|minor|major (got: ${opts.bump})`);
908
934
  process.exit(2);
909
935
  }
910
- const { runTopLevelPublish } = await import("./publish-C1wcf-qI.js");
936
+ const { runTopLevelPublish } = await import("./publish-R3JAl9Hm.js");
911
937
  process.exit(await runTopLevelPublish({
912
938
  cwd: opts.cwd,
913
939
  bump: opts.bump,
@@ -43,8 +43,8 @@ async function runDev(opts) {
43
43
  }
44
44
  process.env.ANNA_APP_RUNTIME_STORAGE_MODE = "aps";
45
45
  }
46
- const { PythonBridge, PINNED_RUNTIME_VERSION } = await import("./bridge-Id8K8gr-.js");
47
- const { HarnessServer } = await import("./server-_IG8Igje.js");
46
+ const { PythonBridge, PINNED_RUNTIME_VERSION } = await import("./bridge-DZmZIWG0.js");
47
+ const { HarnessServer } = await import("./server-BzfmXVJD.js");
48
48
  const bridge = new PythonBridge({
49
49
  mode,
50
50
  matrixNexusRoot: matrixNexusRoot ?? void 0,
@@ -150,7 +150,7 @@ async function runDev(opts) {
150
150
  */
151
151
  async function resolveRealLlm(args) {
152
152
  const { getAccount } = await import("./credentials-DklPMD22.js");
153
- const { ensureDevAppRegistered } = await import("./dev-app-cache-D-r6ZpEk.js");
153
+ const { ensureDevAppRegistered } = await import("./dev-app-cache-DMQLQ93-.js");
154
154
  const acc = getAccount(args.account);
155
155
  if (!acc) {
156
156
  console.error(red("✗ no developer PAT on disk — run `anna-app login --host <nexus-url>` first.\n (or use `--no-llm` / `--mock-llm <fixture>` to develop offline.)"));
@@ -179,7 +179,7 @@ async function resolveRealLlm(args) {
179
179
  account: args.account,
180
180
  appSlug: entry.slug,
181
181
  onAppSlugNotFound: async () => {
182
- const { invalidateDevAppCache } = await import("./dev-app-cache-D-r6ZpEk.js");
182
+ const { invalidateDevAppCache } = await import("./dev-app-cache-DMQLQ93-.js");
183
183
  invalidateDevAppCache(args.cwd);
184
184
  const fresh = getAccount(args.account);
185
185
  if (!fresh) throw new Error("PAT not found while re-registering dev app — run `anna-app login` again");
@@ -0,0 +1,3 @@
1
+ import { parseExecutaSpec, runDev } from "./dev-CyFATq6R.js";
2
+
3
+ export { parseExecutaSpec, runDev };
@@ -1,4 +1,4 @@
1
- import { PINNED_RUNTIME_VERSION } from "./bridge-BuklhzeE.js";
1
+ import { PINNED_RUNTIME_VERSION } from "./bridge-CBew_Ytl.js";
2
2
  import { dirname, isAbsolute, resolve } from "node:path";
3
3
  import { existsSync, statSync } from "node:fs";
4
4
  import { spawnSync } from "node:child_process";
@@ -2,7 +2,7 @@ import "./credentials-BTv2IfUZ.js";
2
2
  import { CliError } from "./client-Dn9zThOd.js";
3
3
  import { deleteMyTool, listMyTools, listToolVersions, unpublishTool, yankToolVersion } from "./executas-Cep6KEo0.js";
4
4
  import { resolveClient, withErrorHandling } from "./_lifecycle-shared-sbea9HtH.js";
5
- import { ensureDestructiveAllowed } from "./confirm-DxHkk9Wn.js";
5
+ import { ensureDestructiveAllowed } from "./confirm-C-4haiIg.js";
6
6
  import { dim, green, yellow } from "kleur/colors";
7
7
 
8
8
  //#region src/commands/executa-destructive.ts
@@ -1,4 +1,4 @@
1
- import { parseExecutaSpec } from "./dev-E7mqXj5S.js";
1
+ import { parseExecutaSpec } from "./dev-CyFATq6R.js";
2
2
  import { isAbsolute, resolve } from "node:path";
3
3
  import { existsSync } from "node:fs";
4
4
  import { bold, cyan, dim, green, red, yellow } from "kleur/colors";
@@ -34,7 +34,7 @@ async function runExecutaDev(opts) {
34
34
  const oneShot = !!(opts.describe || opts.health || opts.invoke);
35
35
  const quiet = oneShot && (opts.json ?? false);
36
36
  const { getAccount } = await import("./credentials-DklPMD22.js");
37
- const { ensureDevExecutaRegistered } = await import("./dev-app-cache-D-r6ZpEk.js");
37
+ const { ensureDevExecutaRegistered } = await import("./dev-app-cache-DMQLQ93-.js");
38
38
  const needsRealMint = !opts.noSampling && !opts.mockSampling || !opts.noAgent && !opts.mockAgent || !opts.noImage && !opts.mockImage || !opts.noUpload && !opts.mockUpload || opts.storage === "real";
39
39
  let effectiveAppSlug = opts.appSlug;
40
40
  let autoRegistered = false;
@@ -56,7 +56,7 @@ async function runExecutaDev(opts) {
56
56
  }
57
57
  }
58
58
  }
59
- const { SamplingBridge } = await import("./sampling-CXke7hq1.js");
59
+ const { SamplingBridge } = await import("./sampling-finZ8aNJ.js");
60
60
  const sampling = opts.noSampling ? new SamplingBridge({ mode: "off" }) : opts.mockSampling ? new SamplingBridge({
61
61
  mode: "mock",
62
62
  mockFile: opts.mockSampling
@@ -65,7 +65,7 @@ async function runExecutaDev(opts) {
65
65
  account: opts.samplingAccount,
66
66
  appSlug: effectiveAppSlug
67
67
  }) : new SamplingBridge({ mode: "off" });
68
- const { AgentBridge } = await import("./agent-Br6zY2qw.js");
68
+ const { AgentBridge } = await import("./agent-DyXJhaZ0.js");
69
69
  const agent = opts.noAgent ? new AgentBridge({ mode: "off" }) : opts.mockAgent ? new AgentBridge({
70
70
  mode: "mock",
71
71
  mockFile: opts.mockAgent
@@ -74,7 +74,7 @@ async function runExecutaDev(opts) {
74
74
  account: opts.agentAccount ?? opts.samplingAccount,
75
75
  appSlug: effectiveAppSlug
76
76
  }) : new AgentBridge({ mode: "off" });
77
- const { StorageBridge } = await import("./storage-CTkApNQ9.js");
77
+ const { StorageBridge } = await import("./storage-BCj754in.js");
78
78
  const storageMode = opts.storage ?? (opts.mockStorage ? "mock" : "memory");
79
79
  const storage = new StorageBridge({
80
80
  mode: storageMode,
@@ -84,8 +84,8 @@ async function runExecutaDev(opts) {
84
84
  scopes: opts.storageScopes ? opts.storageScopes.split(",").map((s) => s.trim()).filter(Boolean) : void 0,
85
85
  pluginName: parsed.tool_id
86
86
  });
87
- const { ExecutaRunner } = await import("./runner-B-hIqx5L.js");
88
- const { ImageBridge } = await import("./image-DduR91n5.js");
87
+ const { ExecutaRunner } = await import("./runner-4-ugGH5e.js");
88
+ const { ImageBridge } = await import("./image-CBSlNb-9.js");
89
89
  const image = opts.noImage ? new ImageBridge({ mode: "off" }) : opts.mockImage ? new ImageBridge({
90
90
  mode: "mock",
91
91
  mockFile: opts.mockImage
@@ -94,7 +94,7 @@ async function runExecutaDev(opts) {
94
94
  account: opts.imageAccount ?? opts.samplingAccount,
95
95
  appSlug: effectiveAppSlug
96
96
  }) : new ImageBridge({ mode: "off" });
97
- const { HostUploadBridge } = await import("./host_upload-GXVkDM5M.js");
97
+ const { HostUploadBridge } = await import("./host_upload-wKM0jQoL.js");
98
98
  const hostUpload = opts.noUpload ? new HostUploadBridge({ mode: "off" }) : opts.mockUpload ? new HostUploadBridge({
99
99
  mode: "mock",
100
100
  mockFile: opts.mockUpload
@@ -0,0 +1,90 @@
1
+ import { readExecutaIdentity } from "./executa-cache-BFoUtb4J.js";
2
+ import { parseExecutaSpec } from "./dev-CyFATq6R.js";
3
+ import { isAbsolute, join, resolve } from "node:path";
4
+ import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
5
+ import { bold, cyan, dim, green, red, yellow } from "kleur/colors";
6
+ import { homedir } from "node:os";
7
+
8
+ //#region src/commands/executa-install.ts
9
+ /** POSIX single-quote one argument for safe embedding in the shim. */
10
+ function shQuote(arg) {
11
+ return `'${arg.replace(/'/g, "'\\''")}'`;
12
+ }
13
+ function buildShim(projectDir, command) {
14
+ const cd = `cd ${shQuote(projectDir)} || exit 1`;
15
+ const exec = `exec ${command.map(shQuote).join(" ")} "$@"`;
16
+ return [
17
+ "#!/bin/sh",
18
+ "# Auto-generated by `anna-app executa install`.",
19
+ "# Local-dev launcher shim — runs the Executa from source so the Agent",
20
+ "# can discover it via 'Rediscover Local'. Safe to delete; regenerate",
21
+ "# with `anna-app executa install`.",
22
+ cd,
23
+ exec,
24
+ ""
25
+ ].join("\n");
26
+ }
27
+ async function runExecutaInstall(opts) {
28
+ const json = opts.json ?? false;
29
+ const cwd = opts.dir ? isAbsolute(opts.dir) ? opts.dir : resolve(process.cwd(), opts.dir) : process.cwd();
30
+ if (!existsSync(cwd)) {
31
+ console.error(red(`✗ executa dir not found: ${cwd}`));
32
+ return 2;
33
+ }
34
+ const parsed = parseExecutaSpec(`dir=${cwd}`, process.cwd());
35
+ if (parsed instanceof Error) {
36
+ console.error(red(`✗ ${parsed.message}`));
37
+ return 2;
38
+ }
39
+ if (!parsed.command || parsed.command.length === 0) {
40
+ console.error(red(`✗ could not derive a launch command for ${cwd}`));
41
+ return 2;
42
+ }
43
+ const identity = readExecutaIdentity(cwd);
44
+ const targetId = opts.toolId ?? identity?.tool_id ?? parsed.tool_id;
45
+ if (!targetId) {
46
+ console.error(red("✗ could not resolve a tool_id — pass --tool-id <id>, or run `anna-app executa publish` / `anna-app apps push` first to mint one."));
47
+ return 2;
48
+ }
49
+ if (/[/\\]/.test(targetId) || targetId.startsWith(".")) {
50
+ console.error(red(`✗ invalid tool_id "${targetId}" (no path separators or leading dot)`));
51
+ return 2;
52
+ }
53
+ const binDir = opts.binDir ? isAbsolute(opts.binDir) ? opts.binDir : resolve(process.cwd(), opts.binDir) : join(homedir(), ".anna", "executa", "bin");
54
+ const shimPath = join(binDir, targetId);
55
+ if (existsSync(shimPath) && !opts.force) {
56
+ console.error(red(`✗ shim already exists: ${shimPath}`) + dim(" (pass --force to overwrite)"));
57
+ return 1;
58
+ }
59
+ try {
60
+ mkdirSync(binDir, { recursive: true });
61
+ writeFileSync(shimPath, buildShim(parsed.project_dir, parsed.command), "utf-8");
62
+ chmodSync(shimPath, 493);
63
+ } catch (e) {
64
+ console.error(red(`✗ failed to write shim: ${e.message}`));
65
+ return 1;
66
+ }
67
+ if (json) {
68
+ console.log(JSON.stringify({
69
+ tool_id: targetId,
70
+ shim_path: shimPath,
71
+ project_dir: parsed.project_dir,
72
+ command: parsed.command,
73
+ source: opts.toolId ? "flag" : identity?.tool_id ? "identity-cache" : "discovered"
74
+ }));
75
+ return 0;
76
+ }
77
+ if (opts.quiet) return 0;
78
+ console.log(bold(cyan("anna-app executa install")));
79
+ console.log(` tool_id ${green(targetId)}`);
80
+ console.log(` shim ${dim(shimPath)}`);
81
+ console.log(` dir ${dim(parsed.project_dir)}`);
82
+ console.log(` command ${dim(parsed.command.join(" "))}`);
83
+ if (!opts.toolId && identity?.tool_id) console.log(` source ${dim("minted tool_id from .anna/executa.json")}`);
84
+ else if (!opts.toolId) console.log(yellow(" ! using the placeholder tool_id from executa.json — run `executa publish`/`apps push` to mint the real one, then re-run with --force (or pass --tool-id)."));
85
+ console.log(dim("\n→ open the Agent's Plugin Details modal and click " + bold("Rediscover Local") + dim(" to load it under this tool_id.")));
86
+ return 0;
87
+ }
88
+
89
+ //#endregion
90
+ export { runExecutaInstall };
@@ -0,0 +1,6 @@
1
+ import "./credentials-BTv2IfUZ.js";
2
+ import "./executa-cache-BFoUtb4J.js";
3
+ import "./dev-CyFATq6R.js";
4
+ import { runExecutaInstall } from "./executa-install-DnBG8UJA.js";
5
+
6
+ export { runExecutaInstall };