@alexkroman1/aai-cli 0.18.1 → 0.19.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.
Files changed (66) hide show
  1. package/dist/{_agent-BN21AHsJ.mjs → _agent-Bj6Q_vDG.mjs} +3 -4
  2. package/dist/{_api-client-Uljj0CQi.mjs → _api-client-BlnLXkZL.mjs} +3 -4
  3. package/dist/{_artifacts-BJOYGQPp.mjs → _artifacts-Drssawoc.mjs} +1 -2
  4. package/dist/{_build-target-C08aM-Es.mjs → _build-target-CWpq0VVa.mjs} +7 -14
  5. package/dist/{_bundler-DvZDEu2p.mjs → _bundler-BLy_GtuH.mjs} +7 -8
  6. package/dist/{_client-plugins-kR43nZnb.mjs → _client-plugins-BWryIN7z.mjs} +3 -4
  7. package/dist/{_config-Dlh8PRRp.mjs → _config-yWqkB0Qz.mjs} +5 -6
  8. package/dist/{_dev-env-D9Uy5wNt.mjs → _dev-env-DP0lLryD.mjs} +1 -2
  9. package/dist/{_dev-server-C_zidzWj.mjs → _dev-server--x-e22KR.mjs} +21 -28
  10. package/dist/_mock-registry.d.ts +5 -0
  11. package/dist/{_preflight-Bv6Ct4ss.mjs → _preflight-JRzjhjeI.mjs} +2 -3
  12. package/dist/{_run-code-deno-C0AtfHeH.mjs → _run-code-deno-D69GatOo.mjs} +3 -4
  13. package/dist/{_server-common-C6j67AcZ.mjs → _server-common-BB_ojN_l.mjs} +4 -5
  14. package/dist/{_slug-api-B9cptz7Q.mjs → _slug-api-Bydkac5S.mjs} +4 -5
  15. package/dist/{_start-workers-BNdOnTal.mjs → _start-workers-DBiICf6o.mjs} +8 -38
  16. package/dist/{_studio-zympBLlD.mjs → _studio-DlJnf9D5.mjs} +5 -6
  17. package/dist/{_templates-ChZuhW66.mjs → _templates-BIzBxGOW.mjs} +5 -6
  18. package/dist/{_typecheck-gate-BNF5cboL.mjs → _typecheck-gate-B60qpe6n.mjs} +3 -4
  19. package/dist/{_ui-C0RufoYZ.mjs → _ui-DOrhK1ET.mjs} +3 -4
  20. package/dist/{_utils-ChU85MEg.mjs → _utils-W_hmhlT5.mjs} +5 -7
  21. package/dist/{_vite-env-BiyJ0GQH.mjs → _vite-env-KVEx9r2_.mjs} +1 -3
  22. package/dist/{_vitest-runner-tzyto9IU.mjs → _vitest-runner-BIh-yKTG.mjs} +4 -5
  23. package/dist/{_workflow-determinism-CLxFQ5ox.mjs → _workflow-determinism-D5xr1EyE.mjs} +2 -3
  24. package/dist/{build-BHgd-QYb.mjs → build-Dab9cZiG.mjs} +23 -29
  25. package/dist/cli.mjs +26 -31
  26. package/dist/{client-bundler-CImhqcp2.mjs → client-bundler-iQhwQ3Y-.mjs} +8 -10
  27. package/dist/client-bundler.mjs +1 -2
  28. package/dist/{console-DwycgRkC.mjs → console-CAlP2e9Z.mjs} +8 -11
  29. package/dist/{delete-ZcA3J_3o.mjs → delete-D28hn7Gp.mjs} +7 -8
  30. package/dist/{deploy-CkfkiZE3.mjs → deploy-DBgwl03r.mjs} +13 -15
  31. package/dist/{dev-BX9g6qcf.mjs → dev-GwaVXLuc.mjs} +8 -10
  32. package/dist/{eval-CUKvfxRq.mjs → eval-K7IDiaYP.mjs} +5 -6
  33. package/dist/{init-B9Uw76-_.mjs → init--gLLPng0.mjs} +9 -11
  34. package/dist/{login-Ct73CqU1.mjs → login-DknFC9Or.mjs} +8 -9
  35. package/dist/{logs-BBsUy96d.mjs → logs-tqX6e7p-.mjs} +7 -8
  36. package/dist/project-config.mjs +1 -2
  37. package/dist/scaffold/CLAUDE.md +2 -2
  38. package/dist/scaffold/agent-guide/AGENT-API.md +1 -1
  39. package/dist/scaffold/agent-guide/HOSTING.md +1 -1
  40. package/dist/scaffold/agent-guide/PROVIDERS.md +6 -2
  41. package/dist/scaffold/package.json +14 -14
  42. package/dist/{secret-CKjHRrVX.mjs → secret-BW0vS0m2.mjs} +9 -11
  43. package/dist/start.mjs +16 -22
  44. package/dist/{studio-U6DvBNAx.mjs → studio-CMT2R7x8.mjs} +11 -12
  45. package/dist/templates/coding-agent/agent.test.ts +1 -1
  46. package/dist/templates/coding-agent/chat.ts +1 -1
  47. package/dist/templates/custom-pipeline-agent/stages.test.ts +3 -1
  48. package/dist/templates/front-desk-agent/agent.test.ts +3 -1
  49. package/dist/templates/front-door-agent/agent.test.ts +9 -12
  50. package/dist/templates/home-assistant-agent/agent.test.ts +9 -6
  51. package/dist/templates/hotel-reception-agent/agent.test.ts +2 -1
  52. package/dist/templates/hotel-reception-agent/booking.ts +5 -1
  53. package/dist/templates/hotel-reception-agent/hotel.ts +15 -5
  54. package/dist/templates/hotel-reception-agent/seed.ts +1 -1
  55. package/dist/templates/kitchen-coach-agent/agent.test.ts +3 -5
  56. package/dist/templates/tabletop-rpg-agent/agent.test.ts +1 -1
  57. package/dist/templates/technical-support-agent/knowledge.ts +3 -1
  58. package/dist/templates/text-adventure-agent/agent.test.ts +4 -1
  59. package/dist/templates/transcription-workflow/agent.test.ts +3 -8
  60. package/dist/templates/transcription-workflow/workflows/stream.ts +1 -1
  61. package/dist/{test-CW5cw5fy.mjs → test-C0YRaetz.mjs} +4 -5
  62. package/dist/typecheck.mjs +4 -5
  63. package/dist/{worker-bundler-D8uCzpYP.mjs → worker-bundler-B3HezfRu.mjs} +8 -10
  64. package/dist/worker-bundler.mjs +1 -2
  65. package/dist/{workflow-5gOZMB2M.mjs → workflow-CYBoqe23.mjs} +6 -7
  66. package/package.json +16 -16
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { p as parseServerFlag, v as serverOrigin, y as stripTrailingSlash } from "./_utils-ChU85MEg.mjs";
3
- import { i as readProjectConfig, n as ensureApiKey, r as readGlobalConfig, t as approveServer } from "./_config-Dlh8PRRp.mjs";
4
2
  import { existsSync } from "node:fs";
5
3
  import path from "node:path";
6
4
  import { fileURLToPath } from "node:url";
7
5
  import { VALID_SLUG_RE } from "@alexkroman1/aai/internal";
8
- //#region src/_agent.ts
6
+ import { i as readProjectConfig, n as ensureApiKey, r as readGlobalConfig, t as approveServer } from "./_config-yWqkB0Qz.mjs";
7
+ import { p as parseServerFlag, v as serverOrigin, y as stripTrailingSlash } from "./_utils-W_hmhlT5.mjs";
8
+ // src/_agent.ts
9
9
  const DEFAULT_SERVER = "https://alexkroman--aai-server-web-server.modal.run";
10
10
  const DEFAULT_DEV_SERVER = "http://localhost:8080";
11
11
  let _cachedMonorepoRoot;
@@ -148,5 +148,4 @@ async function getServerInfo(cwd, explicitServer) {
148
148
  studioProject: config?.studioProject
149
149
  };
150
150
  }
151
- //#endregion
152
151
  export { resolveApprovedServer as a, requireDeployedSlug as i, getServerInfo as n, resolveDeployTarget as o, isDevMode as r, getMonorepoRoot as t };
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { C as CliError } from "./_utils-ChU85MEg.mjs";
3
2
  import { isRecord, omitUndefined } from "@alexkroman1/aai/utils";
4
- import pTimeout from "p-timeout";
5
3
  import { MAX_WORKSPACE_FILES, MAX_WORKSPACE_FILE_BYTES } from "@alexkroman1/aai/workspace-files";
6
4
  import { FetchError, ofetch } from "ofetch";
7
- //#region src/_api-client.ts
5
+ import pTimeout from "p-timeout";
6
+ import { C as CliError } from "./_utils-W_hmhlT5.mjs";
7
+ // src/_api-client.ts
8
8
  /**
9
9
  * Shared HTTP helper for platform API calls (deploy, delete, secrets).
10
10
  *
@@ -308,5 +308,4 @@ function guardError(err, url, action) {
308
308
  return new Error(`${action} failed: the response from ${url} is larger than ${Math.round(err.limit / 2 ** 20)} MiB, so the CLI stopped reading it.
309
309
  No aai response is that large — check that --server points at an aai platform server.`, { cause: err });
310
310
  }
311
- //#endregion
312
311
  export { apiRequest as a, guardedFetch as c, RequestTimeoutError as i, isGuardError as l, HINT_NOT_DEPLOYED as n, apiTestSeam as o, RedirectRefusedError as r, checkedResponse as s, DEFAULT_REQUEST_TIMEOUT_MS as t, isStringArray as u };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import path from "node:path";
3
- //#region src/_artifacts.ts
3
+ // src/_artifacts.ts
4
4
  /**
5
5
  * The `.aai/` layout — where `aai build` leaves what `aai start` and the
6
6
  * deployment targets read back.
@@ -17,5 +17,4 @@ import path from "node:path";
17
17
  const WORKER_ARTIFACT_REL = path.join(".aai", "worker.mjs");
18
18
  /** Where `aai build` leaves the built browser client, relative to the root. */
19
19
  const CLIENT_ARTIFACT_REL = path.join(".aai", "client");
20
- //#endregion
21
20
  export { WORKER_ARTIFACT_REL as n, CLIENT_ARTIFACT_REL as t };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import path from "node:path";
3
- //#region src/_target-drain.ts
3
+ // src/_target-drain.ts
4
4
  /**
5
5
  * The one entry-source fragment the LONG-LIVED targets share.
6
6
  *
@@ -59,8 +59,7 @@ for (const name of ["SIGINT", "SIGTERM"]) {
59
59
  }
60
60
  }
61
61
  `;
62
- //#endregion
63
- //#region src/_target-entry.ts
62
+ // src/_target-entry.ts
64
63
  /**
65
64
  * The LONG-LIVED entry — one source, and every runtime that can run it.
66
65
  *
@@ -143,8 +142,7 @@ await server.listen(Number(${RUNTIME_PORT_SOURCE} ?? ${entry.defaultPort}), "0.0
143
142
 
144
143
  ${drainNote}${TARGET_DRAIN_SOURCE}`;
145
144
  }
146
- //#endregion
147
- //#region src/_deno-target.ts
145
+ // src/_deno-target.ts
148
146
  /**
149
147
  * The **Deno Deploy** target — a self-contained directory under `.aai/deno/`.
150
148
  *
@@ -223,8 +221,7 @@ const DENO_ENTRY_SOURCE = longLivedEntrySource({
223
221
  hostNote: ["Deno Deploy runs this as a long-lived process and expects it to listen."],
224
222
  defaultPort: DENO_PORT
225
223
  });
226
- //#endregion
227
- //#region src/_modal-target.ts
224
+ // src/_modal-target.ts
228
225
  /**
229
226
  * The **Modal** target — a self-contained directory under `.aai/modal/`, plus
230
227
  * the `app.py` that deploys it.
@@ -299,8 +296,7 @@ const MODAL_ENTRY_SOURCE = longLivedEntrySource({
299
296
  defaultPort: MODAL_PORT,
300
297
  drainNote: "app.py forwards the container's stop signal here and waits for this process."
301
298
  });
302
- //#endregion
303
- //#region src/_modal-app.ts
299
+ // src/_modal-app.ts
304
300
  /**
305
301
  * The Modal app definition `aai build --target modal` emits — `app.py`.
306
302
  *
@@ -574,8 +570,7 @@ def server() -> None:
574
570
  _run_node(ENTRY, env)
575
571
  `;
576
572
  }
577
- //#endregion
578
- //#region src/_vercel-target.ts
573
+ // src/_vercel-target.ts
579
574
  /**
580
575
  * The **Vercel** target — a PREBUILT deployment under `.vercel/output/`.
581
576
  *
@@ -827,8 +822,7 @@ const VERCEL_BUILD_CONFIG_SOURCE = `${JSON.stringify({
827
822
  }
828
823
  ]
829
824
  }, null, 2)}\n`;
830
- //#endregion
831
- //#region src/_build-target.ts
825
+ // src/_build-target.ts
832
826
  /**
833
827
  * Deployment TARGETS — what `aai build` emits beside the worker so a host can
834
828
  * run this project without the project holding anything host-specific.
@@ -1115,5 +1109,4 @@ function resolveDeploySteps(target, options) {
1115
1109
  }));
1116
1110
  });
1117
1111
  }
1118
- //#endregion
1119
1112
  export { DENO_CONFIG_FILE as _, resolveDeploySteps as a, DENO_ENTRY_SOURCE as b, VERCEL_FUNCTION_DIR as c, vercelFunctionConfigSource as d, modalAppSource as f, MODAL_OUTPUT_DIR as g, MODAL_ENTRY_SOURCE as h, resolveBuildTarget as i, VERCEL_OUTPUT_DIR as l, MODAL_ENTRY_FILE as m, SECRET_NAME_PLACEHOLDER as n, VERCEL_BUILD_CONFIG_SOURCE as o, MODAL_APP_FILE as p, TARGET_OUTPUTS as r, VERCEL_ENTRY_SOURCE as s, BUILD_TARGETS as t, VERCEL_STATIC_DIR as u, DENO_CONFIG_SOURCE as v, DENO_OUTPUT_DIR as x, DENO_ENTRY_FILE as y };
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { b as validateAgentExport } from "./_utils-ChU85MEg.mjs";
3
- import { t as buildClient } from "./client-bundler-CImhqcp2.mjs";
4
- import { r as vendorsToOmit, t as buildWorker } from "./worker-bundler-D8uCzpYP.mjs";
2
+ import { hash } from "node:crypto";
3
+ import { mkdtemp, rm, writeFile } from "node:fs/promises";
4
+ import { tmpdir } from "node:os";
5
5
  import path from "node:path";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import { omitUndefined } from "@alexkroman1/aai/utils";
8
- import { mkdtemp, rm, writeFile } from "node:fs/promises";
9
- import { tmpdir } from "node:os";
10
- import { hash } from "node:crypto";
11
- //#region src/_bundler.ts
8
+ import { b as validateAgentExport } from "./_utils-W_hmhlT5.mjs";
9
+ import { r as vendorsToOmit, t as buildWorker } from "./worker-bundler-B3HezfRu.mjs";
10
+ import { t as buildClient } from "./client-bundler-iQhwQ3Y-.mjs";
11
+ // src/_bundler.ts
12
12
  /**
13
13
  * Bundle an agent directory: build agent.ts into worker ESM + client files.
14
14
  *
@@ -158,5 +158,4 @@ function createWorkerEvaluator() {
158
158
  return worker;
159
159
  };
160
160
  }
161
- //#endregion
162
161
  export { evalWorkerConfig as i, createWorkerEvaluator as n, evalWorkerBundle as r, buildAgentBundle as t };
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { C as CliError } from "./_utils-ChU85MEg.mjs";
3
- import { createRequire } from "node:module";
4
2
  import { existsSync } from "node:fs";
3
+ import { createRequire } from "node:module";
5
4
  import path from "node:path";
6
5
  import { pathToFileURL } from "node:url";
7
- //#region src/_client-plugins.ts
6
+ import { C as CliError } from "./_utils-W_hmhlT5.mjs";
7
+ // src/_client-plugins.ts
8
8
  /**
9
9
  * The client build's default Vite plugins, for a project with no
10
10
  * `vite.config.*`.
@@ -135,5 +135,4 @@ async function defaultClientPlugins(cwd) {
135
135
  }
136
136
  return [react({ exclude: REACT_REFRESH_EXCLUDE }), tailwind()];
137
137
  }
138
- //#endregion
139
138
  export { defaultClientPlugins as n, CLIENT_ONLY_DEPENDENCIES as t };
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { C as CliError, S as writeJson, m as readJson, s as errorMessage, u as isEexist, v as serverOrigin } from "./_utils-ChU85MEg.mjs";
3
2
  import { mkdtempSync } from "node:fs";
4
- import path from "node:path";
5
3
  import fs from "node:fs/promises";
6
- import { sleep } from "@alexkroman1/aai/internal";
7
4
  import { tmpdir } from "node:os";
5
+ import path from "node:path";
6
+ import { sleep } from "@alexkroman1/aai/internal";
8
7
  import envPaths from "env-paths";
9
8
  import { z } from "zod";
10
- //#region src/_config.ts
9
+ import { C as CliError, S as writeJson, m as readJson, s as errorMessage, u as isEexist, v as serverOrigin } from "./_utils-W_hmhlT5.mjs";
10
+ // src/_config.ts
11
11
  /**
12
12
  * `.aai/project.json` lives in the working tree, so everything in it is
13
13
  * untrusted input — a cloned repo can supply any value.
@@ -138,7 +138,7 @@ async function withGlobalConfigLock(dir, fn) {
138
138
  /** True when this process created the lockfile; false means "proceed unlocked". */
139
139
  async function acquireConfigLock(dir, lockPath) {
140
140
  const deadline = Date.now() + CONFIG_LOCK_TIMEOUT_MS;
141
- for (;;) try {
141
+ while (true) try {
142
142
  await fs.mkdir(dir, {
143
143
  recursive: true,
144
144
  mode: 448
@@ -241,5 +241,4 @@ async function ensureApiKey(configDir, use = "platform") {
241
241
  if (use === "local-session") throw new CliError("missing_assemblyai_key", "ASSEMBLYAI_API_KEY is not set, and this agent's pipeline needs it to start a session.", LOCAL_SESSION_HINT);
242
242
  throw new CliError("not_logged_in", "You're not logged in.", "Run `aai login` to link your account. Non-interactive setups can point AAI_CONFIG_DIR at a config dir holding a logged-in key.");
243
243
  }
244
- //#endregion
245
244
  export { updateGlobalConfig as a, writeProjectConfig as c, readProjectConfig as i, ensureApiKey as n, updateProjectConfig as o, readGlobalConfig as r, writeGlobalConfig as s, approveServer as t };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { consoleLogger } from "@alexkroman1/aai-runtime/internal";
3
- //#region src/_dev-env.ts
3
+ // src/_dev-env.ts
4
4
  /**
5
5
  * The env handed to `createServerForRuntime` for host-mode connections: provider
6
6
  * credentials plus the `AAI_ALLOW_HOST` gate read straight from the shell
@@ -85,5 +85,4 @@ function createDevLogger(silenced) {
85
85
  debug: () => void 0
86
86
  };
87
87
  }
88
- //#endregion
89
88
  export { hostModeEnv as i, devBindHost as n, devWatchEnabled as r, createDevLogger as t };
@@ -1,32 +1,32 @@
1
1
  #!/usr/bin/env node
2
- import { a as errorCode, s as errorMessage$1 } from "./_utils-ChU85MEg.mjs";
3
- import { t as defaultUi } from "./_ui-C0RufoYZ.mjs";
4
- import { n as defaultClientPlugins } from "./_client-plugins-kR43nZnb.mjs";
5
- import { n as fallbackHtmlPlugin } from "./client-bundler-CImhqcp2.mjs";
6
- import { r as devSourceViteConfig, t as DEDUPED_PEERS } from "./_vite-env-BiyJ0GQH.mjs";
7
- import { t as buildWorker } from "./worker-bundler-D8uCzpYP.mjs";
8
- import { typecheckProject } from "./typecheck.mjs";
9
- import { n as ensureApiKey } from "./_config-Dlh8PRRp.mjs";
10
- import { t as resolveDenoRunCode } from "./_run-code-deno-C0AtfHeH.mjs";
11
- import { a as resolveServerEnv } from "./_server-common-C6j67AcZ.mjs";
12
- import { n as createWorkerEvaluator } from "./_bundler-DvZDEu2p.mjs";
13
- import { i as hostModeEnv, n as devBindHost, r as devWatchEnabled, t as createDevLogger } from "./_dev-env-D9Uy5wNt.mjs";
14
2
  import { existsSync, statSync } from "node:fs";
15
3
  import path from "node:path";
16
- import { omitUndefined, plural } from "@alexkroman1/aai/utils";
17
4
  import { agentRequiredEnv, createCoalescingRunner, frontDoorOf, parseWsUpgradeParams, requestPath, sleep, toolUiMap } from "@alexkroman1/aai/internal";
18
- import { isBlankSecret } from "@alexkroman1/aai/host-internal";
5
+ import { omitUndefined, plural } from "@alexkroman1/aai/utils";
19
6
  import { DEFAULT_LISTEN_HOST, createMemoryJournal, createRuntime, createServerForRuntime, ensureSessionStateSchema, ensureWorkflowJournalSchema } from "@alexkroman1/aai-runtime";
20
7
  import { SERVER_ROUTES, WORKFLOW_DATA_DIR_ENV, handleWorkflowRequest, isPathInside, publishClientInboxDefaults, publishStepEnv, requiredProviderEnvVars, withHostCredentialFallback } from "@alexkroman1/aai-runtime/internal";
21
8
  import { defaultClientDir } from "@alexkroman1/aai-ui/client-dir";
22
9
  import { watch } from "chokidar";
23
10
  import getPort, { portNumbers } from "get-port";
11
+ import { n as createWorkerEvaluator } from "./_bundler-BLy_GtuH.mjs";
12
+ import { n as defaultClientPlugins } from "./_client-plugins-BWryIN7z.mjs";
13
+ import { n as ensureApiKey } from "./_config-yWqkB0Qz.mjs";
24
14
  import { agentConfigWarnings } from "@alexkroman1/aai/manifest";
15
+ import { a as resolveServerEnv } from "./_server-common-BB_ojN_l.mjs";
16
+ import { t as defaultUi } from "./_ui-DOrhK1ET.mjs";
17
+ import { i as hostModeEnv, n as devBindHost, r as devWatchEnabled, t as createDevLogger } from "./_dev-env-DP0lLryD.mjs";
25
18
  import { assign, createActor, fromPromise, setup, waitFor } from "xstate";
19
+ import { a as errorCode, s as errorMessage$1 } from "./_utils-W_hmhlT5.mjs";
20
+ import { isBlankSecret } from "@alexkroman1/aai/host-internal";
26
21
  import { CLIENT_CONFIG_PATH, buildClientConfig } from "@alexkroman1/aai/protocol";
27
22
  import { SESSION_SECRET_ENV, createSessionAuth, createSessionToken, verifySessionToken } from "@alexkroman1/aai-runtime/auth";
23
+ import { typecheckProject } from "./typecheck.mjs";
24
+ import { n as fallbackHtmlPlugin } from "./client-bundler-iQhwQ3Y-.mjs";
25
+ import { r as devSourceViteConfig, t as DEDUPED_PEERS } from "./_vite-env-KVEx9r2_.mjs";
28
26
  import pDebounce from "p-debounce";
29
- //#region src/_dev-agent-env.ts
27
+ import { t as resolveDenoRunCode } from "./_run-code-deno-D69GatOo.mjs";
28
+ import { t as buildWorker } from "./worker-bundler-B3HezfRu.mjs";
29
+ // src/_dev-agent-env.ts
30
30
  /**
31
31
  * Warnings about the agent's credentials, computed against the `.env`-derived
32
32
  * env and the shell. Pure so it is directly testable; `resolveAgentEnv` logs
@@ -60,8 +60,7 @@ async function resolveAgentEnv(root, agentDef, ui = defaultUi, deps = { ensureAp
60
60
  for (const warning of agentConfigWarnings(agentDef)) ui.notify("warn", warning);
61
61
  return env;
62
62
  }
63
- //#endregion
64
- //#region src/_dev-restart.ts
63
+ // src/_dev-restart.ts
65
64
  /**
66
65
  * Restart supervision for `aai dev`, as a statechart.
67
66
  *
@@ -361,8 +360,7 @@ function createRestartSupervisor(ops) {
361
360
  }
362
361
  };
363
362
  }
364
- //#endregion
365
- //#region src/_dev-session-ticket.ts
363
+ // src/_dev-session-ticket.ts
366
364
  /** The identity every dev-minted ticket names. */
367
365
  const DEV_TICKET_SUB = "aai-dev";
368
366
  /**
@@ -409,8 +407,7 @@ function devSessionTicketing(env, source) {
409
407
  }
410
408
  };
411
409
  }
412
- //#endregion
413
- //#region src/_dev-typecheck.ts
410
+ // src/_dev-typecheck.ts
414
411
  /**
415
412
  * The background typecheck under `aai dev`.
416
413
  *
@@ -455,8 +452,7 @@ function createDevTypecheck(cwd, report = defaultUi.notify) {
455
452
  });
456
453
  } };
457
454
  }
458
- //#endregion
459
- //#region src/_dev-vite-config.ts
455
+ // src/_dev-vite-config.ts
460
456
  /**
461
457
  * The Vite dev server's config for a project with a `client.tsx`.
462
458
  *
@@ -691,8 +687,7 @@ function publicHost(publicUrl) {
691
687
  return;
692
688
  }
693
689
  }
694
- //#endregion
695
- //#region src/_dev-watch.ts
690
+ // src/_dev-watch.ts
696
691
  /**
697
692
  * `aai dev`'s file watcher: which paths may trigger a restart, and the
698
693
  * debounced chokidar watch that asks for one. Split out of `_dev-server.ts`
@@ -743,8 +738,7 @@ function watchDirectory(dir, onChange, watchFn = watch, notify = defaultUi.notif
743
738
  });
744
739
  return watcher;
745
740
  }
746
- //#endregion
747
- //#region src/_dev-server.ts
741
+ // src/_dev-server.ts
748
742
  /**
749
743
  * Dev server for directory-based agents.
750
744
  *
@@ -920,5 +914,4 @@ async function startDevServer(opts, seams = {}) {
920
914
  }
921
915
  return supervisor.close;
922
916
  }
923
- //#endregion
924
917
  export { loadWorker, startDevServer, resolveAgentEnv as t };
@@ -3,6 +3,11 @@ export interface MockRegistry {
3
3
  registryUrl: string;
4
4
  /** The unique version string used for published workspace packages */
5
5
  testVersion: string;
6
+ /**
7
+ * The registry-minted token every `.npmrc` pointed at it must carry. A
8
+ * made-up token is refused, reads included (verdaccio 7).
9
+ */
10
+ authToken: string;
6
11
  /** Environment variables to set for child processes using this registry */
7
12
  env: Record<string, string>;
8
13
  /** Stop the registry and clean up */
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { plural } from "@alexkroman1/aai/utils";
3
2
  import { TELEPHONY_CARRIERS, agentRequiredEnv } from "@alexkroman1/aai/internal";
3
+ import { plural } from "@alexkroman1/aai/utils";
4
4
  import { CARRIER_PARAM, TELEPHONY_PATH, requiredProviderEnvVars } from "@alexkroman1/aai-runtime/internal";
5
- //#region src/_preflight.ts
5
+ // src/_preflight.ts
6
6
  /**
7
7
  * The deploy-time credential preflight — the classic dev/prod failure, caught
8
8
  * before the upload instead of at the deployed agent's first session.
@@ -145,5 +145,4 @@ function telephonyWebhooks(config, agentUrl) {
145
145
  url: `${agentUrl}${TELEPHONY_PATH}?${CARRIER_PARAM}=${carrier}`
146
146
  }));
147
147
  }
148
- //#endregion
149
148
  export { CARRIER_SIGNING_SECRETS, declaredCarriers, missingCredentialMessage, missingCredentials, missingTelephonySecretWarnings, missingTelephonySecrets, requiredEnvNames, telephonyWebhooks };
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { accessSync, constants } from "node:fs";
3
- import path from "node:path";
4
2
  import { spawn, spawnSync } from "node:child_process";
3
+ import { accessSync, constants } from "node:fs";
5
4
  import os from "node:os";
5
+ import path from "node:path";
6
6
  import pTimeout from "p-timeout";
7
- //#region src/_run-code-deno.ts
7
+ // src/_run-code-deno.ts
8
8
  /**
9
9
  * `AAI_RUN_CODE=deno` — a `run_code` executor for `aai dev` and `aai start`
10
10
  * that runs each snippet in its own `deno` process with NO permissions.
@@ -264,5 +264,4 @@ function resolveDenoRunCode(logger, env = process.env, probe = probeDeno) {
264
264
  });
265
265
  return createDenoRunCode({ deno });
266
266
  }
267
- //#endregion
268
267
  export { resolveDenoRunCode as t };
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { C as CliError, a as errorCode, d as lstatOrNull } from "./_utils-ChU85MEg.mjs";
2
+ import fs from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { parseEnv } from "node:util";
5
- import fs from "node:fs/promises";
6
5
  import { isPathInside } from "@alexkroman1/aai-runtime/internal";
7
- //#region src/_server-common.ts
6
+ import { C as CliError, a as errorCode, d as lstatOrNull } from "./_utils-W_hmhlT5.mjs";
7
+ // src/_server-common.ts
8
8
  /**
9
9
  * One dotenv file's entries, or `{}` when it is not there.
10
10
  *
@@ -143,7 +143,6 @@ async function declaredEnvNames(cwd, files = [".env"]) {
143
143
  if (cwd === void 0) return [];
144
144
  const names = /* @__PURE__ */ new Set();
145
145
  for (const file of files) for (const key of Object.keys(await readDotenv(path.join(cwd, file)))) names.add(key);
146
- return [...names].sort();
146
+ return [...names].sort((a, b) => Number(a > b) - Number(a < b));
147
147
  }
148
- //#endregion
149
148
  export { resolveServerEnv as a, readUploadableEnv as i, DEPLOY_ENV_FILES as n, declaredEnvNames as r, DEPLOY_ENV_DECLARATION_FILE as t };
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { n as getServerInfo } from "./_agent-BN21AHsJ.mjs";
3
- import { a as apiRequest, n as HINT_NOT_DEPLOYED } from "./_api-client-Uljj0CQi.mjs";
4
- import { u as studioProjectApiUrl } from "./_studio-zympBLlD.mjs";
5
- //#region src/_slug-api.ts
2
+ import { n as getServerInfo } from "./_agent-Bj6Q_vDG.mjs";
3
+ import { a as apiRequest, n as HINT_NOT_DEPLOYED } from "./_api-client-BlnLXkZL.mjs";
4
+ import { u as studioProjectApiUrl } from "./_studio-DlJnf9D5.mjs";
5
+ // src/_slug-api.ts
6
6
  /**
7
7
  * Authenticated request against a deployed agent's slug-scoped resource
8
8
  * (`${serverUrl}/${slug}${resourcePath}`) — the one shape every per-agent
@@ -65,5 +65,4 @@ async function slugRequestOn(target, resourcePath, init, platform = REAL_PLATFOR
65
65
  const { serverUrl, slug, apiKey } = target;
66
66
  return deployedAgentRequest(`${serverUrl}/${slug}${resourcePath}`, init, apiKey, platform);
67
67
  }
68
- //#endregion
69
68
  export { secretRequest as n, slugRequestOn as r, REAL_PLATFORM as t };
@@ -1,42 +1,24 @@
1
1
  #!/usr/bin/env node
2
- import { f as parseDecimalInt } from "./_utils-ChU85MEg.mjs";
3
- import "node:module";
4
2
  import { availableParallelism } from "node:os";
5
- //#region \0rolldown/runtime.js
3
+ import { f as parseDecimalInt } from "./_utils-W_hmhlT5.mjs";
4
+ // \0rolldown/runtime.js
6
5
  var __defProp = Object.defineProperty;
7
- var __exportAll = (all, no_symbols) => {
8
- let target = {};
6
+ var __exportAll = (all, flags) => {
7
+ let target = Object.setPrototypeOf({}, null);
9
8
  for (var name in all) __defProp(target, name, {
10
9
  get: all[name],
11
10
  enumerable: true
12
11
  });
13
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
14
- return target;
12
+ if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ return flags & 2 ? target : Object.preventExtensions(target);
15
14
  };
16
- //#endregion
17
- //#region src/_start-workers.ts
15
+ // src/_start-workers.ts
18
16
  var _start_workers_exports = /* @__PURE__ */ __exportAll({
19
- BOOT_TIMEOUT_MS: () => BOOT_TIMEOUT_MS,
20
17
  DEFAULT_DRAIN_TIMEOUT_S: () => 300,
21
18
  DRAIN_TIMEOUT_ENV: () => DRAIN_TIMEOUT_ENV,
22
- LIVENESS_TIMEOUT_MS: () => LIVENESS_TIMEOUT_MS,
23
19
  MAX_CALLS_ENV: () => MAX_CALLS_ENV,
24
- PING_INTERVAL_MS: () => PING_INTERVAL_MS,
25
- SLOTS_ENV: () => SLOTS_ENV,
26
- SLOT_ENV: () => SLOT_ENV,
27
- SLOW_PONG_LOG_EVERY_MS: () => SLOW_PONG_LOG_EVERY_MS,
28
- SLOW_PONG_MS: () => 500,
29
- STOP_GRACE_MS: () => STOP_GRACE_MS,
30
- WORKERS_ENV: () => WORKERS_ENV,
31
- WORKER_STDIO: () => WORKER_STDIO,
32
- isProtocolMessage: () => isProtocolMessage,
33
- isStartWorker: () => isStartWorker,
34
- loadCluster: () => loadCluster,
35
- nodeCluster: () => nodeCluster,
36
- parseWorkers: () => parseWorkers,
37
20
  resolvePositiveInt: () => resolvePositiveInt,
38
- resolveWorkers: () => resolveWorkers,
39
- superviseWorkers: () => superviseWorkers
21
+ resolveWorkers: () => resolveWorkers
40
22
  });
41
23
  /** Process-env override for the worker count, for a container that cannot pass flags. */
42
24
  const WORKERS_ENV = "AAI_WORKERS";
@@ -85,16 +67,6 @@ function resolveWorkers(flag, env = process.env, cpus = availableParallelism) {
85
67
  /** How often the primary pings each listening worker. */
86
68
  const PING_INTERVAL_MS = 2500;
87
69
  /**
88
- * A worker that has not answered a ping for this long has a wedged event loop:
89
- * it is killed and respawned into its slot.
90
- *
91
- * Shorter than LiveKit's 60 s on purpose. Theirs guards ONE call per process;
92
- * a worker here holds hundreds, and a loop blocked for this long has already
93
- * stopped every one of them — their audio stalled at the first missed frame —
94
- * so waiting longer only lengthens the outage before the respawn.
95
- */
96
- const LIVENESS_TIMEOUT_MS = 15e3;
97
- /**
98
70
  * How long a worker may take to start listening before it is killed as hung —
99
71
  * a boot stuck on a database that never answers (`ensure*Schema` behind the
100
72
  * schema lock, a silently partitioned Postgres) would otherwise hold the
@@ -104,7 +76,6 @@ const LIVENESS_TIMEOUT_MS = 15e3;
104
76
  const BOOT_TIMEOUT_MS = 12e4;
105
77
  /** How long a worker told to stop (or done draining) gets before it is SIGKILLed. */
106
78
  const STOP_GRACE_MS = 1e4;
107
- const SLOW_PONG_LOG_EVERY_MS = 3e4;
108
79
  /** One of this protocol's messages (every type is `aai-start:`-prefixed) — either direction. */
109
80
  function isProtocolMessage(message) {
110
81
  const type = message?.type;
@@ -525,5 +496,4 @@ function superviseWorkers(opts) {
525
496
  roll
526
497
  };
527
498
  }
528
- //#endregion
529
499
  export { isProtocolMessage as a, nodeCluster as c, _start_workers_exports as i, superviseWorkers as l, SLOTS_ENV as n, isStartWorker as o, SLOT_ENV as r, loadCluster as s, DEFAULT_DRAIN_TIMEOUT_S as t };
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import { o as resolveDeployTarget } from "./_agent-BN21AHsJ.mjs";
3
- import { a as apiRequest, s as checkedResponse, u as isStringArray } from "./_api-client-Uljj0CQi.mjs";
4
2
  import path from "node:path";
5
- import { isRecord } from "@alexkroman1/aai/utils";
6
3
  import { MAX_SLUG_LENGTH, PREVIEW_SLUG_SUFFIX, VALID_SLUG_RE } from "@alexkroman1/aai/internal";
7
- import { isLocalOnlyFile, snapshotWorkspaceFiles } from "@alexkroman1/aai/workspace-files";
8
4
  import { slugifyName } from "@alexkroman1/aai/slugify";
9
- //#region src/_studio.ts
5
+ import { isRecord } from "@alexkroman1/aai/utils";
6
+ import { isLocalOnlyFile, snapshotWorkspaceFiles } from "@alexkroman1/aai/workspace-files";
7
+ import { o as resolveDeployTarget } from "./_agent-Bj6Q_vDG.mjs";
8
+ import { a as apiRequest, s as checkedResponse, u as isStringArray } from "./_api-client-BlnLXkZL.mjs";
9
+ // src/_studio.ts
10
10
  /**
11
11
  * Internals of the studio-workspace commands (`aai list/pull/push/publish`):
12
12
  * the local source-file walk and the thin clients for the platform's
@@ -136,5 +136,4 @@ function publishStudioProject(serverUrl, apiKey, project, opts = {}, request = a
136
136
  retry: 0
137
137
  });
138
138
  }
139
- //#endregion
140
139
  export { isUsableProjectName as a, publishStudioProject as c, studioProjectUrl as d, isSlugShaped as i, pushStudioSource as l, collectSourceFiles as n, listStudioProjects as o, fetchStudioProject as r, projectNameFromDir as s, REAL_STUDIO_DEPS as t, studioProjectApiUrl as u };
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { C as CliError, d as lstatOrNull, s as errorMessage } from "./_utils-ChU85MEg.mjs";
3
- import { t as getMonorepoRoot } from "./_agent-BN21AHsJ.mjs";
4
- import { constants } from "node:fs";
5
- import path from "node:path";
6
2
  import fs, { mkdir, open } from "node:fs/promises";
3
+ import path from "node:path";
7
4
  import { IGNORED_WORKSPACE_DIRS, isLocalOnlyFile, layerScaffoldFiles, readScaffoldFiles, walkWorkspaceFiles } from "@alexkroman1/aai/workspace-files";
8
- //#region src/_safe-write.ts
5
+ import { t as getMonorepoRoot } from "./_agent-Bj6Q_vDG.mjs";
6
+ import { constants } from "node:fs";
7
+ import { C as CliError, d as lstatOrNull, s as errorMessage } from "./_utils-W_hmhlT5.mjs";
8
+ // src/_safe-write.ts
9
9
  /**
10
10
  * Writing into a directory the CLI does not own — a `--force` pull, an
11
11
  * `aai init` into a directory that already has things in it — without
@@ -237,5 +237,4 @@ async function downloadAndMergeTemplate(template, targetDir, root = resolveTempl
237
237
  });
238
238
  await layerScaffold(targetDir);
239
239
  }
240
- //#endregion
241
240
  export { REPO_URL, downloadAndMergeTemplate, layerScaffold, listTemplates, writeFileNoFollow as n, refuseUnsafeScaffoldTargets, refuseUnsafeTarget as t };
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { C as CliError } from "./_utils-ChU85MEg.mjs";
3
- import { t as defaultUi } from "./_ui-C0RufoYZ.mjs";
2
+ import { C as CliError } from "./_utils-W_hmhlT5.mjs";
3
+ import { t as defaultUi } from "./_ui-DOrhK1ET.mjs";
4
4
  import { typecheckProject } from "./typecheck.mjs";
5
- //#region src/_typecheck-gate.ts
5
+ // src/_typecheck-gate.ts
6
6
  /**
7
7
  * The build/deploy typecheck gate: run the project's own `tsc --noEmit`
8
8
  * (see `typecheck.ts`) and turn a failure into a structured CliError. The
@@ -15,5 +15,4 @@ async function assertTypechecks(cwd, opts = {}) {
15
15
  const result = await typecheckProject(cwd);
16
16
  if (!result.ok) throw new CliError("typecheck_failed", result.output, "Fix the type errors, or pass --skip-typecheck to build anyway");
17
17
  }
18
- //#endregion
19
18
  export { assertTypechecks };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { A as sanitizeTerminalText, C as CliError, f as parseDecimalInt, j as writeLine } from "./_utils-ChU85MEg.mjs";
3
- import { omitUndefined } from "@alexkroman1/aai/utils";
4
2
  import { styleText } from "node:util";
3
+ import { omitUndefined } from "@alexkroman1/aai/utils";
5
4
  import * as clack from "@clack/prompts";
6
- //#region src/_ui.ts
5
+ import { A as sanitizeTerminalText, C as CliError, f as parseDecimalInt, j as writeLine } from "./_utils-W_hmhlT5.mjs";
6
+ // src/_ui.ts
7
7
  /**
8
8
  * The CLI's terminal seam: every human-facing line, every prompt and the one
9
9
  * JSON result line go through a {@link Ui}.
@@ -143,5 +143,4 @@ function parsePort(raw) {
143
143
  if (port === void 0) throw new CliError("usage", `Invalid port: ${raw}. Must be a whole number from 1 to 65535.`, "Pass --port as plain decimal digits, e.g. --port 3000.");
144
144
  return port;
145
145
  }
146
- //#endregion
147
146
  export { unwrapCancel as i, fmtUrl as n, parsePort as r, defaultUi as t };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync } from "node:fs";
3
+ import fs from "node:fs/promises";
3
4
  import path from "node:path";
4
5
  import { errorDetail, errorMessage, errorMessage as errorMessage$1, isRecord, omitUndefined } from "@alexkroman1/aai/utils";
5
- import fs from "node:fs/promises";
6
- //#region src/_output.ts
6
+ // src/_output.ts
7
7
  /**
8
8
  * Structured output support for CLI commands.
9
9
  *
@@ -251,8 +251,7 @@ var CliError = class extends Error {
251
251
  if (hint !== void 0) this.hint = hint;
252
252
  }
253
253
  };
254
- //#endregion
255
- //#region src/_utils.ts
254
+ // src/_utils.ts
256
255
  /**
257
256
  * The file that marks a directory as an agent project — the single source
258
257
  * for the entry filename every command checks or scaffolds.
@@ -355,7 +354,7 @@ async function readJson(filePath) {
355
354
  try {
356
355
  return JSON.parse(raw);
357
356
  } catch (err) {
358
- throw new Error(`Invalid JSON in ${filePath}: ${errorMessage(err)}`, { cause: err });
357
+ throw new Error(`Invalid JSON in ${filePath}: ${errorMessage$1(err)}`, { cause: err });
359
358
  }
360
359
  }
361
360
  /**
@@ -482,5 +481,4 @@ function parseDecimalInt(raw, min, max) {
482
481
  const n = Number(raw);
483
482
  return n >= min && n <= max ? n : void 0;
484
483
  }
485
- //#endregion
486
- export { sanitizeTerminalText as A, CliError as C, ok as D, installStdoutGuard as E, oweExitCode as O, writeJson as S, getOutputMode as T, resolveCwd as _, errorCode as a, validateAgentExport as b, fileExists as c, lstatOrNull as d, parseDecimalInt as f, readTextIfPresent as g, readPackageJson as h, compareCodeUnits as i, writeLine as j, resultLine as k, formatCappedList as l, readJson as m, binFromManifest as n, errorDetail as o, parseServerFlag as p, binFromPackageJson as r, errorMessage$1 as s, AGENT_ENTRY as t, isEexist as u, serverOrigin as v, fail as w, writeFileAtomic as x, stripTrailingSlash as y };
484
+ export { sanitizeTerminalText as A, CliError as C, ok as D, installStdoutGuard as E, oweExitCode as O, writeJson as S, getOutputMode as T, resolveCwd as _, errorCode as a, validateAgentExport as b, fileExists as c, lstatOrNull as d, parseDecimalInt as f, readTextIfPresent as g, readPackageJson as h, compareCodeUnits as i, writeLine as j, resultLine as k, formatCappedList as l, readJson as m, binFromManifest as n, errorDetail as o, parseServerFlag as p, binFromPackageJson as r, errorMessage as s, AGENT_ENTRY as t, isEexist as u, serverOrigin as v, fail as w, writeFileAtomic as x, stripTrailingSlash as y };