@alexkroman1/aai-cli 9.2.0 → 10.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/{_bundler-CDuYl5Gb.mjs → _bundler-B31MqYaD.mjs} +7 -33
  2. package/dist/_bundler.d.ts +3 -41
  3. package/dist/{_dev-server-BAR8Ya43.mjs → _dev-server-Bo5dSBzQ.mjs} +140 -44
  4. package/dist/_dev-server.d.ts +1 -8
  5. package/dist/_dev-vite-config.d.ts +21 -0
  6. package/dist/{_init-BNotRgV1.mjs → _init-BURbdHNM.mjs} +1 -1
  7. package/dist/{_slug-api--ZBmIGH-.mjs → _slug-api-CfGQq1Tt.mjs} +1 -1
  8. package/dist/{_templates-4WcKOjS5.mjs → _templates-0Zr2z6yA.mjs} +37 -2
  9. package/dist/_templates.d.ts +29 -0
  10. package/dist/{build-DvDdSwAS.mjs → build-DKC2e9o_.mjs} +1 -2
  11. package/dist/cli.mjs +46 -22
  12. package/dist/{delete-8pjH8n8n.mjs → delete-X_CRgCf6.mjs} +1 -1
  13. package/dist/{deploy-CjU3e-3P.mjs → deploy-CchW5pmw.mjs} +2 -2
  14. package/dist/{dev-dFzdvwa7.mjs → dev-BfVl1uBA.mjs} +1 -1
  15. package/dist/{init-DK7GpIF9.mjs → init-BRfoc2EK.mjs} +2 -2
  16. package/dist/{logs-D2Yhqe2w.mjs → logs-hWnJ66Bl.mjs} +2 -2
  17. package/dist/scaffold/CLAUDE.md +162 -54
  18. package/dist/scaffold/package.json +4 -6
  19. package/dist/scaffold/server.mjs +12 -23
  20. package/dist/{secret-CwgDLpSy.mjs → secret-B-3T5tvr.mjs} +2 -2
  21. package/dist/{studio-D3-HWIfk.mjs → studio-wVWNLREn.mjs} +4 -3
  22. package/dist/templates/call-audit/agent.eval.test.ts +1 -1
  23. package/dist/templates/call-audit/agent.test.ts +80 -8
  24. package/dist/templates/call-audit/client.tsx +87 -3
  25. package/dist/templates/call-audit/workflows/audit.ts +52 -32
  26. package/dist/templates/call-audit/workflows/ingest.ts +15 -15
  27. package/dist/templates/call-audit/workflows/media.ts +1 -1
  28. package/dist/templates/call-audit/workflows/summarize.ts +0 -4
  29. package/dist/templates/link-digest/agent.eval.test.ts +4 -2
  30. package/dist/templates/link-digest/agent.test.ts +25 -5
  31. package/dist/templates/link-digest/client.tsx +65 -7
  32. package/dist/templates/link-digest/workflows/digest.ts +39 -29
  33. package/dist/templates/podcast-digest/agent.eval.test.ts +5 -5
  34. package/dist/templates/podcast-digest/agent.test.ts +108 -2
  35. package/dist/templates/podcast-digest/client.tsx +89 -8
  36. package/dist/templates/podcast-digest/workflows/digest.ts +67 -48
  37. package/dist/templates/podcast-digest/workflows/feeds.ts +1 -4
  38. package/dist/templates/podcast-digest/workflows/slack.ts +5 -6
  39. package/dist/templates/recap-workflow/agent.eval.test.ts +72 -8
  40. package/dist/templates/recap-workflow/agent.test.ts +323 -83
  41. package/dist/templates/recap-workflow/shared.ts +4 -3
  42. package/dist/templates/recap-workflow/workflows/recap.ts +322 -86
  43. package/dist/templates/recap-workflow/workflows/tokens.ts +21 -0
  44. package/dist/templates/redline/agent.eval.test.ts +1 -1
  45. package/dist/templates/redline/agent.test.ts +1 -1
  46. package/dist/templates/redline/client.tsx +83 -3
  47. package/dist/templates/redline/workflows/redline.ts +26 -23
  48. package/dist/templates/research-workflow/agent.eval.test.ts +9 -8
  49. package/dist/templates/research-workflow/agent.test.ts +32 -6
  50. package/dist/templates/research-workflow/agent.ts +4 -4
  51. package/dist/templates/research-workflow/shared.ts +4 -3
  52. package/dist/templates/research-workflow/workflows/prompts.ts +1 -1
  53. package/dist/templates/research-workflow/workflows/research.ts +35 -38
  54. package/dist/templates/spoken-summary/agent.eval.test.ts +3 -3
  55. package/dist/templates/spoken-summary/agent.test.ts +10 -8
  56. package/dist/templates/spoken-summary/client.tsx +72 -3
  57. package/dist/templates/spoken-summary/workflows/summarize.ts +25 -21
  58. package/dist/templates/spoken-summary/workflows/transcribe.ts +15 -18
  59. package/dist/templates/transcription-workflow/agent.eval.test.ts +1 -1
  60. package/dist/templates/transcription-workflow/agent.test.ts +626 -14
  61. package/dist/templates/transcription-workflow/agent.ts +6 -4
  62. package/dist/templates/transcription-workflow/client.tsx +106 -308
  63. package/dist/templates/transcription-workflow/recover.test.ts +141 -0
  64. package/dist/templates/transcription-workflow/recover.ts +130 -0
  65. package/dist/templates/transcription-workflow/run-panel.tsx +203 -0
  66. package/dist/templates/transcription-workflow/total-latency.tsx +144 -0
  67. package/dist/templates/transcription-workflow/workflows/batch.ts +21 -24
  68. package/dist/templates/transcription-workflow/workflows/downsample.ts +273 -0
  69. package/dist/templates/transcription-workflow/workflows/normalize.ts +17 -40
  70. package/dist/templates/transcription-workflow/workflows/stream.ts +177 -24
  71. package/dist/templates/transcription-workflow/workflows/transcribe.ts +69 -32
  72. package/dist/templates/transcription-workflow/workflows/wav.ts +15 -4
  73. package/dist/worker-bundler.d.ts +0 -14
  74. package/dist/worker-bundler.mjs +149 -1
  75. package/dist/{workflow-BflATMmU.mjs → workflow-BBu5oEDw.mjs} +84 -10
  76. package/dist/workflow.d.ts +1 -0
  77. package/package.json +4 -6
  78. package/dist/_workflow-scan.d.ts +0 -108
  79. package/dist/worker-bundler-CCVEDjm1.mjs +0 -650
  80. package/dist/workflow-bundler.d.ts +0 -138
  81. package/dist/{_studio-CKrsixd0.mjs → _studio-B1waXMuR.mjs} +1 -1
@@ -1,108 +0,0 @@
1
- /**
2
- * What the BUILT flow bundle carries — the two scans that read it, and the
3
- * checks over them.
4
- *
5
- * Split out of `workflow-bundler.ts` when that file crossed the 500-line cap,
6
- * along the seam the two scans already share: both read the same artifact after
7
- * the builder has written it, both attribute a line to a module through
8
- * esbuild's `// <path>` headers, and neither has anything to do with
9
- * CONFIGURING the build. One of them fails the build (a `require` the workflow
10
- * VM cannot answer) and the other warns (a call that replays differently), which
11
- * is the only real difference between them.
12
- *
13
- * Internal: `workflow-bundler.ts` is the surface the studio and the CLI's own
14
- * build call, and it re-exports nothing from here that they need.
15
- *
16
- * @module _workflow-scan
17
- */
18
- /** One `require` the workflow VM cannot answer, and the module it was written for. */
19
- export type VmRequireSite = {
20
- /** The module specifier — `node:child_process`. */
21
- specifier: string;
22
- /** The bundled file esbuild attributed it to, or `undefined` when it said none. */
23
- module: string | undefined;
24
- };
25
- /**
26
- * Find the Node builtins a flow bundle would `require` at load.
27
- *
28
- * The flow bundle is compiled in a `node:vm` `Script` whose context has
29
- * `module` and `exports` and **no `require`**, so one of these is a run that
30
- * dies at replay with `ReferenceError: require is not defined` — never a build
31
- * failure, and never a symptom before the first run. The WDK's own builder
32
- * bundles everything for exactly this reason and carries
33
- * `createNodeModuleErrorPlugin` to reject a builtin import at build time.
34
- *
35
- * That plugin has two blind spots this scan covers, and both are the DEPLOYED
36
- * shape rather than an exotic one:
37
- *
38
- * - It reports a violation only when it can point at the import LINE in a
39
- * first-party file, matched with a single-line regex — so a multi-line
40
- * `import {\n x,\n} from "pkg"` finds nothing and the builtin is marked
41
- * external in silence.
42
- * - It resolves that file against `process.cwd()`, which is not the project
43
- * being built when the studio builds a workspace, so the read fails and the
44
- * same silent path is taken.
45
- *
46
- * Both were reproduced. What reaches the VM either way is
47
- * `var import_node_child_process = require("node:child_process");` at the top
48
- * of the bundle, i.e. every run of every workflow in the project fails, and the
49
- * stack names a line of generated code inside a dependency.
50
- *
51
- * Restricted to builtin specifiers deliberately: those are the only ones this
52
- * builder leaves external (it marks nothing else so, precisely so nothing can
53
- * need a `require`), and a narrow set is what keeps the scan from reading the
54
- * text of a prompt as a violation.
55
- *
56
- * @internal
57
- */
58
- export declare function findVmRequires(workflowCode: string): VmRequireSite[];
59
- /** One replay-unsafe call the flow bundle carries, and where it came from. */
60
- export type ReplayUnsafeSite = {
61
- /** The call, as written — `Date.now(`. */
62
- call: string;
63
- /** What it does on a replay, and what to do instead. */
64
- fix: string;
65
- /** The project file esbuild attributed it to. */
66
- module: string;
67
- };
68
- /**
69
- * Replay-unsafe calls the flow bundle carries, attributed to the project's OWN
70
- * `workflows/` files.
71
- *
72
- * Attribution is the whole design. The bundle inlines every non-external
73
- * dependency a workflow module imports — zod, a markdown parser, whatever — and
74
- * third-party code is full of `Date.now()` on paths a workflow never reaches, so
75
- * a scan of the bundle's text reports a library and blocks a correct project.
76
- * esbuild writes a `// <path>` header per module (the same one
77
- * {@link findVmRequires} reads), so lines can be charged to the file they were
78
- * written in, and only the project's own workflow sources are read.
79
- *
80
- * Scanning the BUNDLE rather than the sources is what makes a `"use step"` body
81
- * exempt for free: the workflow-mode transform has already removed them, so
82
- * what is left is the part that really does replay.
83
- *
84
- * @internal
85
- */
86
- export declare function findReplayUnsafeCalls(workflowCode: string): ReplayUnsafeSite[];
87
- /**
88
- * The warning `aai build` and `aai dev` print for a replay-unsafe call.
89
- *
90
- * A WARNING and not a build failure, deliberately. The attribution above makes
91
- * the scan accurate about which FILE a call is in, and it cannot know whether a
92
- * plain function in a `workflows/` module is reached from a body (where the
93
- * rule bites) or only from a step (where it does not) — so the one thing it
94
- * must not do is refuse a correct project. A silent build was the actual
95
- * problem; a line naming the file solves it without that risk.
96
- */
97
- export declare function replayWarnings(workflowCode: string): string[];
98
- /**
99
- * Fail the build when the flow bundle carries a `require` — see
100
- * {@link findVmRequires} for what that means and why nothing upstream catches it.
101
- *
102
- * The message has to name the MODULE as well as the specifier, because the
103
- * import that caused it is not in the file an author is looking at: only a
104
- * `"use step"` body is stripped from this bundle, so a value a `workflows/`
105
- * module holds at module scope — an exported helper, a constant — keeps its
106
- * import, and that import's whole graph rides into the VM.
107
- */
108
- export declare function assertNoVmRequires(workflowCode: string): void;