@alexkroman1/aai-cli 13.2.0 → 14.0.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 (152) hide show
  1. package/bin.mjs +1 -1
  2. package/dist/{_agent-BTwZJu4P.mjs → _agent-BzUeqOdj.mjs} +33 -10
  3. package/dist/_agent.d.ts +23 -0
  4. package/dist/{_bundler-C31rlcYz.mjs → _bundler-DolUCMxu.mjs} +9 -8
  5. package/dist/_cli-common.d.ts +45 -6
  6. package/dist/{_config-CmJOFsAP.mjs → _config-DYzC6WMD.mjs} +7 -4
  7. package/dist/_config.d.ts +25 -1
  8. package/dist/_dev-env.d.ts +1 -1
  9. package/dist/{_dev-server-DWvkNoIS.mjs → _dev-server-CSMqF8PN.mjs} +28 -30
  10. package/dist/_dev-vite-config.d.ts +3 -3
  11. package/dist/_e2e-test-utils.d.ts +15 -7
  12. package/dist/{_init-BURbdHNM.mjs → _init-CQ8idAwo.mjs} +64 -30
  13. package/dist/{_output-CKkmWs7i.mjs → _output-DBP9Op_d.mjs} +43 -3
  14. package/dist/_output.d.ts +24 -7
  15. package/dist/{_preflight-Co1G9Jww.mjs → _preflight-CcAR577V.mjs} +3 -3
  16. package/dist/_resource-commands.d.ts +9 -9
  17. package/dist/{_server-common-6e0QI4mq.mjs → _server-common-vILJp3it.mjs} +3 -3
  18. package/dist/{_slug-api-CfGQq1Tt.mjs → _slug-api-CGvc2YSQ.mjs} +19 -10
  19. package/dist/_slug-api.d.ts +19 -0
  20. package/dist/{_studio-B1waXMuR.mjs → _studio-DnR_BqFp.mjs} +9 -5
  21. package/dist/_studio-commands.d.ts +13 -13
  22. package/dist/{_templates-0Zr2z6yA.mjs → _templates-CK4oKoeX.mjs} +3 -3
  23. package/dist/{_typecheck-gate-BXvUNnfs.mjs → _typecheck-gate-U3jcil8L.mjs} +5 -4
  24. package/dist/_typecheck-gate.d.ts +3 -1
  25. package/dist/{_ui-u7T4YooX.mjs → _ui-DCt4qZrk.mjs} +1 -1
  26. package/dist/{_utils-B8QmtFhK.mjs → _utils-D5JGcjiW.mjs} +44 -2
  27. package/dist/_utils.d.ts +35 -0
  28. package/dist/{_vite-env-D9Qj6KPX.mjs → _vite-env-kejF0p2L.mjs} +1 -1
  29. package/dist/{_workflow-determinism-f9J-5Zlj.mjs → _workflow-determinism-CvpqMpdh.mjs} +19 -27
  30. package/dist/_workflow-determinism.d.ts +3 -3
  31. package/dist/build-Mxk8gWvX.mjs +108 -0
  32. package/dist/build.d.ts +5 -0
  33. package/dist/cli.mjs +172 -116
  34. package/dist/{client-bundler-j5c46x0G.mjs → client-bundler-BJgREAh6.mjs} +4 -4
  35. package/dist/client-bundler.mjs +1 -1
  36. package/dist/{delete-X_CRgCf6.mjs → delete-BdFnbnVR.mjs} +6 -6
  37. package/dist/{deploy-BzZ-r4iM.mjs → deploy-uAJ4NukN.mjs} +14 -14
  38. package/dist/{dev-BDykFvcc.mjs → dev-DApPSaE_.mjs} +5 -5
  39. package/dist/{eval-0qEOdm0l.mjs → eval-BK47A_K5.mjs} +27 -11
  40. package/dist/eval.d.ts +2 -0
  41. package/dist/{init-BtJI306C.mjs → init-DukDxECd.mjs} +13 -21
  42. package/dist/{login-DeUETobb.mjs → login-DaLrPOFg.mjs} +6 -8
  43. package/dist/{logs-hWnJ66Bl.mjs → logs-7BRwq0cG.mjs} +22 -15
  44. package/dist/project-config.mjs +1 -1
  45. package/dist/scaffold/.env.example +17 -1
  46. package/dist/scaffold/CLAUDE.md +84 -56
  47. package/dist/scaffold/package.json +6 -5
  48. package/dist/scaffold/server.mjs +129 -25
  49. package/dist/secret-Cjp912yF.mjs +162 -0
  50. package/dist/secret.d.ts +48 -13
  51. package/dist/{studio-BxAS_FQQ.mjs → studio-CpHlNHUZ.mjs} +15 -17
  52. package/dist/templates/briefing-desk/agent.test.ts +7 -3
  53. package/dist/templates/call-audit/agent.test.ts +25 -9
  54. package/dist/templates/call-audit/agent.ts +2 -2
  55. package/dist/templates/call-audit/client.tsx +40 -58
  56. package/dist/templates/call-audit/workflows/audit.ts +7 -5
  57. package/dist/templates/call-audit/workflows/ingest.ts +7 -7
  58. package/dist/templates/call-audit/workflows/media.ts +12 -37
  59. package/dist/templates/call-audit/workflows/summarize.ts +8 -8
  60. package/dist/templates/call-audit/workflows/sync-api.ts +3 -3
  61. package/dist/templates/dispatch-center/agent.test.ts +7 -7
  62. package/dist/templates/dispatch-center/client.tsx +53 -61
  63. package/dist/templates/dispatch-center/shared.ts +0 -8
  64. package/dist/templates/dispatch-center/tools/ops_dashboard.ts +4 -1
  65. package/dist/templates/embedded-assets/agent.eval.test.ts +4 -2
  66. package/dist/templates/embedded-assets/agent.test.ts +7 -1
  67. package/dist/templates/health-assistant/agent.eval.test.ts +4 -2
  68. package/dist/templates/health-assistant/agent.test.ts +8 -4
  69. package/dist/templates/infocom-adventure/client.tsx +40 -36
  70. package/dist/templates/link-digest/agent.test.ts +10 -4
  71. package/dist/templates/link-digest/agent.ts +2 -2
  72. package/dist/templates/link-digest/client.tsx +42 -36
  73. package/dist/templates/link-digest/workflows/digest.ts +13 -16
  74. package/dist/templates/night-owl/agent.eval.test.ts +4 -2
  75. package/dist/templates/night-owl/agent.test.ts +6 -1
  76. package/dist/templates/night-owl/client.tsx +8 -2
  77. package/dist/templates/pipeline-simple/agent.test.ts +33 -16
  78. package/dist/templates/pizza-ordering/client.tsx +5 -4
  79. package/dist/templates/pizza-ordering/shared.ts +3 -8
  80. package/dist/templates/pizza-ordering/tools/add_pizza.ts +3 -2
  81. package/dist/templates/pizza-ordering/tools/place_order.ts +3 -2
  82. package/dist/templates/pizza-ordering/tools/remove_pizza.ts +3 -2
  83. package/dist/templates/pizza-ordering/tools/update_pizza.ts +3 -2
  84. package/dist/templates/pizza-ordering/tools/view_order.ts +3 -2
  85. package/dist/templates/plan-and-execute/agent.test.ts +10 -5
  86. package/dist/templates/plan-and-execute/client.tsx +2 -2
  87. package/dist/templates/podcast-digest/agent.test.ts +33 -14
  88. package/dist/templates/podcast-digest/client.tsx +27 -36
  89. package/dist/templates/podcast-digest/workflows/digest.ts +21 -19
  90. package/dist/templates/podcast-digest/workflows/feeds.ts +61 -33
  91. package/dist/templates/podcast-digest/workflows/slack.ts +7 -7
  92. package/dist/templates/recap-workflow/agent.eval.test.ts +21 -13
  93. package/dist/templates/recap-workflow/agent.test.ts +49 -32
  94. package/dist/templates/recap-workflow/workflows/recap.ts +24 -28
  95. package/dist/templates/redline/agent.eval.test.ts +5 -8
  96. package/dist/templates/redline/agent.test.ts +8 -2
  97. package/dist/templates/redline/client.tsx +47 -48
  98. package/dist/templates/redline/workflows/redline.ts +17 -17
  99. package/dist/templates/research-workflow/agent.eval.test.ts +5 -5
  100. package/dist/templates/research-workflow/agent.test.ts +17 -8
  101. package/dist/templates/research-workflow/workflows/research.ts +28 -30
  102. package/dist/templates/retail/agent.test.ts +17 -15
  103. package/dist/templates/retail/cancel.ts +7 -6
  104. package/dist/templates/retail/client.tsx +39 -58
  105. package/dist/templates/retail/payment.ts +4 -3
  106. package/dist/templates/retail/pending.test.ts +19 -19
  107. package/dist/templates/retail/registry.test.ts +99 -58
  108. package/dist/templates/retail/store.test.ts +5 -5
  109. package/dist/templates/retail/swap.ts +8 -11
  110. package/dist/templates/simple/agent.test.ts +39 -6
  111. package/dist/templates/solo-rpg/agent.eval.test.ts +2 -16
  112. package/dist/templates/solo-rpg/agent.test.ts +12 -12
  113. package/dist/templates/solo-rpg/client.tsx +3 -3
  114. package/dist/templates/spoken-summary/agent.test.ts +21 -12
  115. package/dist/templates/spoken-summary/agent.ts +3 -3
  116. package/dist/templates/spoken-summary/client.tsx +36 -47
  117. package/dist/templates/spoken-summary/workflows/summarize.ts +11 -11
  118. package/dist/templates/spoken-summary/workflows/transcribe.ts +14 -14
  119. package/dist/templates/support-line/client.tsx +4 -3
  120. package/dist/templates/support-line/prompts.ts +0 -2
  121. package/dist/templates/transcription-workflow/agent.test.ts +36 -20
  122. package/dist/templates/transcription-workflow/agent.ts +2 -2
  123. package/dist/templates/transcription-workflow/client.tsx +34 -40
  124. package/dist/templates/transcription-workflow/recover.ts +1 -1
  125. package/dist/templates/transcription-workflow/run-panel.tsx +34 -14
  126. package/dist/templates/transcription-workflow/total-latency.tsx +46 -20
  127. package/dist/templates/transcription-workflow/workflows/batch.ts +15 -15
  128. package/dist/templates/transcription-workflow/workflows/downsample.ts +1 -1
  129. package/dist/templates/transcription-workflow/workflows/normalize.ts +15 -19
  130. package/dist/templates/transcription-workflow/workflows/stream.ts +12 -12
  131. package/dist/templates/transcription-workflow/workflows/sync-api.ts +3 -3
  132. package/dist/templates/transcription-workflow/workflows/transcribe.ts +23 -34
  133. package/dist/templates/travel-concierge/agent.eval.test.ts +2 -2
  134. package/dist/templates/travel-concierge/agent.test.ts +15 -7
  135. package/dist/templates/travel-concierge/client.tsx +2 -2
  136. package/dist/templates/travel-concierge/shared.ts +10 -14
  137. package/dist/templates/travel-concierge/tools/lookup_booking.ts +4 -3
  138. package/dist/templates/travel-concierge/tools/search_car_rentals.ts +3 -2
  139. package/dist/templates/travel-concierge/tools/search_excursions.ts +3 -2
  140. package/dist/templates/travel-concierge/tools/search_flights.ts +3 -2
  141. package/dist/templates/travel-concierge/tools/search_hotels.ts +3 -2
  142. package/dist/test-D032V2cA.mjs +242 -0
  143. package/dist/test.d.ts +97 -31
  144. package/dist/typecheck.mjs +2 -2
  145. package/dist/worker-bundler.mjs +3 -3
  146. package/dist/{workflow-BBu5oEDw.mjs → workflow-CVioyO3V.mjs} +8 -7
  147. package/package.json +10 -10
  148. package/dist/bin.d.mts +0 -2
  149. package/dist/build-BLlLOrng.mjs +0 -66
  150. package/dist/secret-B-3T5tvr.mjs +0 -61
  151. package/dist/test-CiLab-AA.mjs +0 -182
  152. package/dist/tsdown.config.d.ts +0 -2
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { a as ok } from "./_output-CKkmWs7i.mjs";
3
- import { a as parsePort, n as log, r as notify, t as fmtUrl } from "./_ui-u7T4YooX.mjs";
4
- import { a as errorDetail } from "./_utils-B8QmtFhK.mjs";
2
+ import { a as ok } from "./_output-DBP9Op_d.mjs";
3
+ import { a as parsePort, n as log, r as notify, t as fmtUrl } from "./_ui-DCt4qZrk.mjs";
4
+ import { o as errorDetail } from "./_utils-D5JGcjiW.mjs";
5
5
  import path from "node:path";
6
6
  import { styleText } from "node:util";
7
- //#region dev.ts
7
+ //#region src/dev.ts
8
8
  /**
9
9
  * Start the dev server and return the result.
10
10
  * The process stays alive after this returns — caller handles signals.
@@ -12,7 +12,7 @@ import { styleText } from "node:util";
12
12
  async function executeDev(opts) {
13
13
  const port = parsePort(opts.port);
14
14
  const agentName = path.basename(path.resolve(opts.cwd));
15
- const { startDevServer } = await import("./_dev-server-DWvkNoIS.mjs");
15
+ const { startDevServer } = await import("./_dev-server-CSMqF8PN.mjs");
16
16
  let cleanup;
17
17
  let shuttingDown = false;
18
18
  const onSignal = () => {
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { a as ok, n as fail } from "./_output-CKkmWs7i.mjs";
3
- import { n as log } from "./_ui-u7T4YooX.mjs";
4
- import { t as resolveServerEnv } from "./_server-common-6e0QI4mq.mjs";
5
- import { classifyVitestError, runVitest } from "./test-CiLab-AA.mjs";
6
- //#region eval.ts
2
+ import { a as ok, n as fail } from "./_output-DBP9Op_d.mjs";
3
+ import { n as log } from "./_ui-DCt4qZrk.mjs";
4
+ import { t as resolveServerEnv } from "./_server-common-vILJp3it.mjs";
5
+ import { classifyVitestError, runVitest } from "./test-D032V2cA.mjs";
6
+ //#region src/eval.ts
7
7
  /**
8
8
  * `aai eval` — run the agent's behaviour evals via vitest.
9
9
  *
@@ -29,24 +29,40 @@ import { classifyVitestError, runVitest } from "./test-CiLab-AA.mjs";
29
29
  */
30
30
  /** The files `aai eval` runs, in preference order. */
31
31
  const EVAL_FILES = ["agent.eval.test.ts", "agent.eval.test.js"];
32
+ /**
33
+ * How long one eval case may run.
34
+ *
35
+ * Vitest's default is 5s, which is shorter than a single live model turn on a
36
+ * slow day — so without this every case fails as a timeout and the report says
37
+ * nothing about the agent. Generous rather than tuned: the harness has its own
38
+ * 90s per-turn timeout with a message naming the events it saw, and that is the
39
+ * diagnostic worth reaching. This ceiling only exists so a wedged run ends.
40
+ */
41
+ const EVAL_TEST_TIMEOUT_MS = 3e5;
32
42
  /** Execute the agent's evals and return a structured result. */
33
43
  async function executeEval(cwd) {
34
44
  log.step("Running agent evals");
35
45
  const env = await resolveServerEnv(cwd);
36
46
  try {
37
- if (!runVitest(cwd, {
47
+ const ran = runVitest(cwd, {
38
48
  candidates: EVAL_FILES,
39
- extraArgs: ["--testTimeout", String(3e5)],
40
- env
41
- })) {
49
+ extraArgs: ["--testTimeout", String(EVAL_TEST_TIMEOUT_MS)],
50
+ env,
51
+ announceUnrun: false
52
+ });
53
+ if (!ran) {
42
54
  log.info("No eval file found. Create agent.eval.test.ts to measure what the agent does — see `openEvalSession` in @alexkroman1/aai-runtime/eval.");
43
55
  return ok({
44
56
  passed: true,
45
- skipped: true
57
+ skipped: true,
58
+ ran: []
46
59
  });
47
60
  }
48
61
  log.success("Evals passed");
49
- return ok({ passed: true });
62
+ return ok({
63
+ passed: true,
64
+ ran
65
+ });
50
66
  } catch (err) {
51
67
  const { code, message } = classifyVitestError(err, "Evals");
52
68
  return fail(code, message);
package/dist/eval.d.ts CHANGED
@@ -25,6 +25,8 @@ import { type CommandResult } from "./_output.ts";
25
25
  type EvalData = {
26
26
  passed: boolean;
27
27
  skipped?: boolean;
28
+ /** The eval file(s) this run covered — `aai test`'s result names its set too. */
29
+ ran: string[];
28
30
  };
29
31
  /** The files `aai eval` runs, in preference order. */
30
32
  export declare const EVAL_FILES: readonly ["agent.eval.test.ts", "agent.eval.test.js"];
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { a as ok } from "./_output-CKkmWs7i.mjs";
3
- import { n as log, s as unwrapCancel } from "./_ui-u7T4YooX.mjs";
4
- import { d as resolveCwd, l as readJson, o as errorMessage$1, s as fileExists, t as AGENT_ENTRY } from "./_utils-B8QmtFhK.mjs";
5
- import { r as isDevMode, t as getMonorepoRoot } from "./_agent-BTwZJu4P.mjs";
2
+ import { a as ok } from "./_output-DBP9Op_d.mjs";
3
+ import { n as log, s as unwrapCancel } from "./_ui-DCt4qZrk.mjs";
4
+ import { c as fileExists, d as readJson, p as resolveCwd, s as errorMessage$1, t as AGENT_ENTRY } from "./_utils-D5JGcjiW.mjs";
5
+ import { r as isDevMode, t as getMonorepoRoot } from "./_agent-BzUeqOdj.mjs";
6
6
  import path from "node:path";
7
7
  import { omitUndefined } from "@alexkroman1/aai/utils";
8
8
  import { styleText } from "node:util";
9
9
  import * as p from "@clack/prompts";
10
10
  import { execa } from "execa";
11
- //#region init.ts
11
+ //#region src/init.ts
12
12
  /**
13
13
  * Run `fn` behind a clack spinner, stopping it in EVERY outcome.
14
14
  *
@@ -106,7 +106,7 @@ function collectWarnings() {
106
106
  }
107
107
  /** Publish after init and return deploy metadata if successful. */
108
108
  async function tryPublish(cwd, server, warn) {
109
- const { executePublish } = await import("./studio-BxAS_FQQ.mjs");
109
+ const { executePublish } = await import("./studio-CpHlNHUZ.mjs");
110
110
  try {
111
111
  const result = await executePublish({
112
112
  cwd,
@@ -127,7 +127,7 @@ async function tryPublish(cwd, server, warn) {
127
127
  }
128
128
  /** Scaffold the project, optionally showing a spinner. */
129
129
  async function scaffoldProject(dir, cwd, template, silent) {
130
- const { runInit } = await import("./_init-BURbdHNM.mjs");
130
+ const { runInit } = await import("./_init-CQ8idAwo.mjs");
131
131
  await withSpinner(silent, {
132
132
  start: `Creating ${dir}`,
133
133
  done: "Project created",
@@ -154,26 +154,18 @@ async function executeInit(opts, extra) {
154
154
  const { warn, warnings } = collectWarnings();
155
155
  await scaffoldProject(dir, cwd, template, suppressUi);
156
156
  const installed = await installDeps(cwd, warn, suppressUi);
157
- let deployed = false;
158
- let slug;
159
- let url;
160
157
  if (!installed) warn("Skipping publish because dependencies were not installed.");
161
- else if (!opts.skipDeploy) {
162
- const published = await tryPublish(cwd, opts.server, warn);
163
- if (published) {
164
- deployed = true;
165
- slug = published.slug;
166
- url = published.url;
167
- }
168
- }
158
+ const published = installed && !opts.skipDeploy ? await tryPublish(cwd, opts.server, warn) : null;
169
159
  if (!suppressUi) printPostInitInfo(cwd, monorepoRoot);
170
160
  const data = {
171
161
  dir: cwd,
172
162
  template,
173
- deployed
163
+ deployed: published !== null
174
164
  };
175
- if (slug) data.slug = slug;
176
- if (url) data.url = url;
165
+ if (published) {
166
+ data.slug = published.slug;
167
+ data.url = published.url;
168
+ }
177
169
  if (warnings.length > 0) data.warnings = warnings;
178
170
  return ok(data);
179
171
  }
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import { a as ok, t as CliError } from "./_output-CKkmWs7i.mjs";
3
- import { n as log } from "./_ui-u7T4YooX.mjs";
4
- import { o as updateGlobalConfig, r as readGlobalConfig, t as approveServer } from "./_config-CmJOFsAP.mjs";
5
- import { o as resolveServerUrl } from "./_agent-BTwZJu4P.mjs";
2
+ import { a as ok, t as CliError } from "./_output-DBP9Op_d.mjs";
3
+ import { n as log } from "./_ui-DCt4qZrk.mjs";
4
+ import { o as updateGlobalConfig } from "./_config-DYzC6WMD.mjs";
5
+ import { a as resolveApprovedServer } from "./_agent-BzUeqOdj.mjs";
6
6
  import { linkConfirmationCode, sleep } from "@alexkroman1/aai/internal";
7
7
  import { spawn } from "node:child_process";
8
8
  import { randomBytes } from "node:crypto";
9
- //#region login.ts
9
+ //#region src/login.ts
10
10
  /**
11
11
  * `aai login` — link the CLI to an account that is ALREADY signed in to the
12
12
  * browser studio, ending with the account's AssemblyAI API key stored in
@@ -133,9 +133,7 @@ function defaultOpenBrowser(url) {
133
133
  async function executeLogin(opts, deps = {}) {
134
134
  const fetchFn = deps.fetchFn ?? globalThis.fetch;
135
135
  requireTty();
136
- const globalConfig = await readGlobalConfig();
137
- const serverUrl = resolveServerUrl(opts.server, void 0, globalConfig.approvedServers ?? []);
138
- if (opts.server) await approveServer(serverUrl);
136
+ const { serverUrl } = await resolveApprovedServer(null, opts.server);
139
137
  if ((await jsonBody(await reachable(fetchFn, `${serverUrl}/studio/auth`, serverUrl), "Reading the server's login configuration")).mode === "none") throw new CliError("login_unavailable", "This server has no browser login configured, so there is no account to link.", "Point `--server` at a platform with browser login configured — linking an account there is the only way to authenticate.");
140
138
  const code = randomBytes(32).toString("base64url");
141
139
  const linkUrl = `${serverUrl}/?cli-link=${code}`;
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { a as ok } from "./_output-CKkmWs7i.mjs";
3
- import { n as log } from "./_ui-u7T4YooX.mjs";
4
- import { f as checkedResponse } from "./_studio-B1waXMuR.mjs";
5
- import { n as slugRequest } from "./_slug-api-CfGQq1Tt.mjs";
2
+ import { a as ok } from "./_output-DBP9Op_d.mjs";
3
+ import { n as log } from "./_ui-DCt4qZrk.mjs";
4
+ import { n as getServerInfo } from "./_agent-BzUeqOdj.mjs";
5
+ import { f as checkedResponse } from "./_studio-DnR_BqFp.mjs";
6
+ import { n as slugRequestOn } from "./_slug-api-CGvc2YSQ.mjs";
6
7
  import { isRecord, omitUndefined } from "@alexkroman1/aai/utils";
7
8
  import { sleep } from "@alexkroman1/aai/internal";
8
9
  function isLogsPage(value) {
@@ -19,12 +20,16 @@ function formatLine(line) {
19
20
  const mark = line.stream === "stderr" ? " ERR" : "";
20
21
  return `${formatTime(line.at)}${mark} ${line.text}`;
21
22
  }
22
- async function readPage(cwd, after, server) {
23
- const { data, slug } = await slugRequest(cwd, `/logs?after=${after}`, { action: "logs" }, server);
24
- return {
25
- page: checkedResponse(data, isLogsPage, `the logs route for ${slug}`),
26
- slug
27
- };
23
+ /**
24
+ * One page, against a target resolved ONCE by the caller.
25
+ *
26
+ * `slugRequestOn` rather than `slugRequest`: under `--follow` this runs every
27
+ * second for the life of the command, and the target is immutable — see that
28
+ * function's doc for what re-resolving it cost.
29
+ */
30
+ async function readPage(target, after) {
31
+ const data = await slugRequestOn(target, `/logs?after=${after}`, { action: "logs" });
32
+ return checkedResponse(data, isLogsPage, `the logs route for ${target.slug}`);
28
33
  }
29
34
  /**
30
35
  * Print the agent's buffered output, once or continuously.
@@ -34,7 +39,9 @@ async function readPage(cwd, after, server) {
34
39
  * into a result object would duplicate what it just printed.
35
40
  */
36
41
  async function executeLogs(cwd, opts = {}) {
37
- const { page, slug } = await readPage(cwd, -1, opts.server);
42
+ const target = await getServerInfo(cwd, opts.server);
43
+ const { slug } = target;
44
+ const page = await readPage(target, -1);
38
45
  let cursor = page.cursor;
39
46
  let printed = printPage(page);
40
47
  if (!opts.follow) {
@@ -52,11 +59,11 @@ async function executeLogs(cwd, opts = {}) {
52
59
  while (!opts.signal?.aborted) {
53
60
  await sleep(pollMs, omitUndefined({ signal: opts.signal }));
54
61
  if (opts.signal?.aborted) break;
55
- const next = await readPage(cwd, cursor, opts.server).catch(() => void 0);
62
+ const next = await readPage(target, cursor).catch(() => void 0);
56
63
  if (!next) continue;
57
- cursor = next.page.cursor;
58
- running = next.page.running;
59
- printed += printPage(next.page);
64
+ cursor = next.cursor;
65
+ running = next.running;
66
+ printed += printPage(next);
60
67
  }
61
68
  return ok({
62
69
  slug,
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { c as writeGlobalConfig, s as updateProjectConfig } from "./_config-CmJOFsAP.mjs";
2
+ import { c as writeGlobalConfig, s as updateProjectConfig } from "./_config-DYzC6WMD.mjs";
3
3
  export { updateProjectConfig, writeGlobalConfig as writeConfigHome };
@@ -4,7 +4,23 @@
4
4
  # For production, use `aai secret put <NAME>` to set the same keys on the server.
5
5
  # In both cases, access secrets in agent code via ctx.env.MY_KEY.
6
6
  #
7
- # Add any secrets your agent needs below:
7
+ # --- The one key the default voice pipeline needs --------------------------
8
+ #
9
+ # `aai dev` runs speech-to-text, the LLM gateway and text-to-speech on a single
10
+ # AssemblyAI key, so this is the credential a session cannot start without.
11
+ # Any ONE of these is enough, and the first two need no aai account:
12
+ #
13
+ # 1. Paste your key after the `=` below.
14
+ # 2. Or export it in your shell: export ASSEMBLYAI_API_KEY=<your key>
15
+ # 3. Or run `aai login`, and `aai dev` will use your account's key.
16
+ #
17
+ # Get a key at https://www.assemblyai.com/dashboard.
18
+ #
19
+ # Leaving it blank is safe: a declared-but-empty value is dropped rather than
20
+ # handed to a provider, so options 2 and 3 still work with this line as it is.
21
+ ASSEMBLYAI_API_KEY=
22
+
23
+ # Add any other secrets your agent needs below:
8
24
 
9
25
  # Required only if your agent enables the `web_search` builtin
10
26
  # (free key: https://brave.com/search/api/):