@alexkroman1/aai-cli 10.0.0 → 11.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 (45) hide show
  1. package/dist/{_bundler-B31MqYaD.mjs → _bundler-C31rlcYz.mjs} +1 -1
  2. package/dist/{_dev-server-Bo5dSBzQ.mjs → _dev-server-DWvkNoIS.mjs} +3 -3
  3. package/dist/{_vite-env-BNveawd1.mjs → _vite-env-D9Qj6KPX.mjs} +4 -2
  4. package/dist/_workflow-determinism-f9J-5Zlj.mjs +206 -0
  5. package/dist/_workflow-determinism.d.ts +118 -0
  6. package/dist/{build-DKC2e9o_.mjs → build-BLlLOrng.mjs} +4 -2
  7. package/dist/cli.mjs +372 -353
  8. package/dist/{client-bundler-CWnG42cU.mjs → client-bundler-j5c46x0G.mjs} +3 -2
  9. package/dist/client-bundler.mjs +1 -1
  10. package/dist/{deploy-CchW5pmw.mjs → deploy-BzZ-r4iM.mjs} +6 -4
  11. package/dist/{dev-BfVl1uBA.mjs → dev-BDykFvcc.mjs} +1 -1
  12. package/dist/{eval-DwNwdqmS.mjs → eval-0qEOdm0l.mjs} +1 -1
  13. package/dist/{init-BRfoc2EK.mjs → init-BtJI306C.mjs} +1 -1
  14. package/dist/{login-BBuM1sxH.mjs → login-DeUETobb.mjs} +4 -1
  15. package/dist/scaffold/CLAUDE.md +190 -11
  16. package/dist/scaffold/package.json +4 -4
  17. package/dist/{studio-wVWNLREn.mjs → studio-BxAS_FQQ.mjs} +4 -1
  18. package/dist/templates/call-audit/agent.test.ts +105 -26
  19. package/dist/templates/call-audit/workflows/audit.ts +9 -26
  20. package/dist/templates/dispatch-center/client.tsx +36 -2
  21. package/dist/templates/infocom-adventure/client.tsx +37 -9
  22. package/dist/templates/link-digest/agent.eval.test.ts +1 -1
  23. package/dist/templates/link-digest/agent.test.ts +164 -8
  24. package/dist/templates/link-digest/workflows/digest.ts +63 -20
  25. package/dist/templates/podcast-digest/agent.eval.test.ts +7 -4
  26. package/dist/templates/podcast-digest/agent.test.ts +265 -24
  27. package/dist/templates/podcast-digest/workflows/digest.ts +2 -2
  28. package/dist/templates/podcast-digest/workflows/feeds.ts +78 -73
  29. package/dist/templates/recap-workflow/agent.test.ts +206 -20
  30. package/dist/templates/recap-workflow/workflows/recap.ts +17 -14
  31. package/dist/templates/redline/agent.test.ts +137 -11
  32. package/dist/templates/research-workflow/agent.eval.test.ts +1 -1
  33. package/dist/templates/research-workflow/agent.test.ts +131 -9
  34. package/dist/templates/research-workflow/workflows/research.ts +1 -1
  35. package/dist/templates/retail/client.tsx +30 -2
  36. package/dist/templates/spoken-summary/agent.eval.test.ts +4 -1
  37. package/dist/templates/spoken-summary/agent.test.ts +117 -8
  38. package/dist/templates/spoken-summary/workflows/summarize.ts +1 -1
  39. package/dist/templates/transcription-workflow/agent.test.ts +127 -13
  40. package/dist/templates/transcription-workflow/workflows/batch.ts +6 -6
  41. package/dist/templates/transcription-workflow/workflows/stream.ts +4 -3
  42. package/dist/templates/transcription-workflow/workflows/transcribe.ts +4 -23
  43. package/dist/{test-CvwgeVSQ.mjs → test-CiLab-AA.mjs} +2 -1
  44. package/dist/worker-bundler.mjs +1 -1
  45. package/package.json +25 -24
@@ -263,7 +263,7 @@ export async function transcribeFlow(input: { recording: string }, ctx: Workflow
263
263
  // retrying that. It is the two I/O halves that are worth another attempt: this
264
264
  // step reads a whole recording out of the store and writes a whole one back.
265
265
  const [startedAt, ready] = await Promise.all([
266
- ctx.step("startClock", () => startClock()),
266
+ ctx.now(),
267
267
  ctx.step("normalizeRecording", () => normalizeRecording(input.recording), { maxAttempts: 6 }),
268
268
  ]);
269
269
 
@@ -441,34 +441,15 @@ export async function mergeTranscript(
441
441
  source,
442
442
  segments: parts.length,
443
443
  durationMs,
444
- // Wall clock, so the three flows can be compared over one file see
445
- // `startClock`. Measured in a STEP, which is what makes it survive a replay.
444
+ // Wall clock, so the three flows can be compared over one file. Legal HERE
445
+ // and not in the body: a step's internals are not replayed, only its result.
446
+ // `startedAt` is the body's `ctx.now()`, journaled by the engine.
446
447
  elapsedMs: Date.now() - startedAt,
447
448
  words: countWords(transcript),
448
449
  transcript,
449
450
  };
450
451
  }
451
452
 
452
- // ---- The run's own clock ----------------------------------------------------
453
-
454
- /**
455
- * When the run started, as epoch ms.
456
- *
457
- * A STEP, and that is the whole reason this exists rather than a `Date.now()` in the
458
- * body: a body replays from the top on every resume, so a clock read there returns a
459
- * different value each time and every duration derived from it would be a different
460
- * duration. A step's result is journaled, so this is the moment the run really began
461
- * however many times it is replayed.
462
- *
463
- * Shared by all three flows deliberately. A run snapshot carries `createdAt` and no
464
- * end time, so "how long did this take" is not answerable from the outside — and the
465
- * whole point of shipping three flows over one job is that a reader can compare them,
466
- * which needs one number measured one way.
467
- */
468
- export async function startClock(): Promise<number> {
469
- return Date.now();
470
- }
471
-
472
453
  // Re-exported rather than re-declared: `stream.ts` and `batch.ts` already import
473
454
  // these from this module, and the split that let the PAGE stitch a partial
474
455
  // transcript should not ripple through every flow. `clock` and `countWords` used
@@ -154,7 +154,8 @@ function isUnrunSpec(name, rel, ran) {
154
154
  function warnUnrunSpecs(cwd, ran) {
155
155
  const skipped = unrunSpecFiles(cwd, ran === false ? "" : ran);
156
156
  if (skipped.length === 0) return;
157
- notify("warn", `${ran === false ? `\`aai test\` found no agent.test.ts, so it ran nothing. ${skipped.length} spec file(s) exist and were NOT run:` : `\`aai test\` ran ${ran} only. ${skipped.length} other spec file(s) were NOT run:`} ${skipped.join(", ")}. Run them with your own vitest (\`npx vitest run\`); behaviour evals have their own command (\`aai eval\`).`);
157
+ const preamble = ran === false ? `\`aai test\` found no agent.test.ts, so it ran nothing. ${skipped.length} spec file(s) exist and were NOT run:` : `\`aai test\` ran ${ran} only. ${skipped.length} other spec file(s) were NOT run:`;
158
+ notify("warn", `${preamble} ${skipped.join(", ")}. Run them with your own vitest (\`npx vitest run\`); behaviour evals have their own command (\`aai eval\`).`);
158
159
  }
159
160
  /** Execute agent tests and return structured result. */
160
161
  async function executeTest(cwd) {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as errorCode } from "./_utils-B8QmtFhK.mjs";
3
- import { n as withPreservedNodeEnv } from "./_vite-env-BNveawd1.mjs";
3
+ import { n as withPreservedNodeEnv } from "./_vite-env-D9Qj6KPX.mjs";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { invariant } from "@alexkroman1/aai/internal";
package/package.json CHANGED
@@ -1,7 +1,20 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-cli",
3
- "version": "10.0.0",
3
+ "version": "11.0.0",
4
4
  "type": "module",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/alexkroman/agent.git",
9
+ "directory": "packages/aai-cli"
10
+ },
11
+ "engines": {
12
+ "node": ">=24"
13
+ },
14
+ "files": [
15
+ "bin.mjs",
16
+ "dist"
17
+ ],
5
18
  "bin": {
6
19
  "aai": "bin.mjs"
7
20
  },
@@ -27,10 +40,6 @@
27
40
  "import": "./dist/project-config.mjs"
28
41
  }
29
42
  },
30
- "files": [
31
- "bin.mjs",
32
- "dist"
33
- ],
34
43
  "dependencies": {
35
44
  "@clack/prompts": "^1.7.0",
36
45
  "chokidar": "^5.0.0",
@@ -43,16 +52,16 @@
43
52
  "p-timeout": "^7.0.1",
44
53
  "vite": "^8.2.1",
45
54
  "zod": "^4.4.3",
46
- "@alexkroman1/aai": "10.0.0",
47
- "@alexkroman1/aai-runtime": "10.0.0",
48
- "@alexkroman1/aai-ui": "10.0.0"
55
+ "@alexkroman1/aai": "11.0.0",
56
+ "@alexkroman1/aai-runtime": "11.0.0",
57
+ "@alexkroman1/aai-ui": "11.0.0"
49
58
  },
50
59
  "devDependencies": {
51
60
  "playwright": "^1.62.1",
52
61
  "tsdown": "^0.22.14",
53
62
  "verdaccio": "^6.9.2",
54
63
  "vitest": "^4.1.10",
55
- "aai-templates": "0.3.8"
64
+ "aai-templates": "0.3.9"
56
65
  },
57
66
  "peerDependencies": {
58
67
  "vitest": "^4.1.10"
@@ -62,25 +71,17 @@
62
71
  "optional": true
63
72
  }
64
73
  },
65
- "engines": {
66
- "node": ">=24"
67
- },
68
- "repository": {
69
- "type": "git",
70
- "url": "https://github.com/alexkroman/agent.git",
71
- "directory": "packages/aai-cli"
72
- },
73
74
  "scripts": {
74
- "test": "vitest run",
75
- "test:coverage": "vitest run --coverage",
76
75
  "build": "tsdown && tsc -p tsconfig.build.json && node ./bundle-templates.mjs",
77
- "typecheck": "tsc --noEmit",
78
- "lint": "biome check .",
79
- "check:publint": "publint",
80
76
  "check:attw": "attw --pack --profile esm-only",
81
- "test:scenario": "VITEST_PROFILE=scenario VITEST_SETUP=./_test-setup.ts VITEST_INCLUDE=**/*.scenario.test.ts vitest run -c ../../vitest.slow.config.ts",
77
+ "check:e2e": "pnpm run test:e2e",
78
+ "check:publint": "publint",
82
79
  "check:scenario": "pnpm run test:scenario",
80
+ "lint": "biome check .",
81
+ "test": "vitest run",
82
+ "test:coverage": "vitest run --coverage",
83
83
  "test:e2e": "VITEST_PROFILE=e2e VITEST_SETUP=./_test-setup.ts VITEST_INCLUDE=e2e*.test.ts vitest run -c ../../vitest.slow.config.ts",
84
- "check:e2e": "pnpm run test:e2e"
84
+ "test:scenario": "VITEST_PROFILE=scenario VITEST_SETUP=./_test-setup.ts VITEST_INCLUDE=**/*.scenario.test.ts vitest run -c ../../vitest.slow.config.ts",
85
+ "typecheck": "tsc --noEmit"
85
86
  }
86
87
  }