@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.
- package/bin.mjs +1 -1
- package/dist/{_agent-BTwZJu4P.mjs → _agent-BzUeqOdj.mjs} +33 -10
- package/dist/_agent.d.ts +23 -0
- package/dist/{_bundler-C31rlcYz.mjs → _bundler-DolUCMxu.mjs} +9 -8
- package/dist/_cli-common.d.ts +45 -6
- package/dist/{_config-CmJOFsAP.mjs → _config-DYzC6WMD.mjs} +7 -4
- package/dist/_config.d.ts +25 -1
- package/dist/_dev-env.d.ts +1 -1
- package/dist/{_dev-server-DWvkNoIS.mjs → _dev-server-CSMqF8PN.mjs} +28 -30
- package/dist/_dev-vite-config.d.ts +3 -3
- package/dist/_e2e-test-utils.d.ts +15 -7
- package/dist/{_init-BURbdHNM.mjs → _init-CQ8idAwo.mjs} +64 -30
- package/dist/{_output-CKkmWs7i.mjs → _output-DBP9Op_d.mjs} +43 -3
- package/dist/_output.d.ts +24 -7
- package/dist/{_preflight-Co1G9Jww.mjs → _preflight-CcAR577V.mjs} +3 -3
- package/dist/_resource-commands.d.ts +9 -9
- package/dist/{_server-common-6e0QI4mq.mjs → _server-common-vILJp3it.mjs} +3 -3
- package/dist/{_slug-api-CfGQq1Tt.mjs → _slug-api-CGvc2YSQ.mjs} +19 -10
- package/dist/_slug-api.d.ts +19 -0
- package/dist/{_studio-B1waXMuR.mjs → _studio-DnR_BqFp.mjs} +9 -5
- package/dist/_studio-commands.d.ts +13 -13
- package/dist/{_templates-0Zr2z6yA.mjs → _templates-CK4oKoeX.mjs} +3 -3
- package/dist/{_typecheck-gate-BXvUNnfs.mjs → _typecheck-gate-U3jcil8L.mjs} +5 -4
- package/dist/_typecheck-gate.d.ts +3 -1
- package/dist/{_ui-u7T4YooX.mjs → _ui-DCt4qZrk.mjs} +1 -1
- package/dist/{_utils-B8QmtFhK.mjs → _utils-D5JGcjiW.mjs} +44 -2
- package/dist/_utils.d.ts +35 -0
- package/dist/{_vite-env-D9Qj6KPX.mjs → _vite-env-kejF0p2L.mjs} +1 -1
- package/dist/{_workflow-determinism-f9J-5Zlj.mjs → _workflow-determinism-CvpqMpdh.mjs} +19 -27
- package/dist/_workflow-determinism.d.ts +3 -3
- package/dist/build-Mxk8gWvX.mjs +108 -0
- package/dist/build.d.ts +5 -0
- package/dist/cli.mjs +172 -116
- package/dist/{client-bundler-j5c46x0G.mjs → client-bundler-BJgREAh6.mjs} +4 -4
- package/dist/client-bundler.mjs +1 -1
- package/dist/{delete-X_CRgCf6.mjs → delete-BdFnbnVR.mjs} +6 -6
- package/dist/{deploy-BzZ-r4iM.mjs → deploy-uAJ4NukN.mjs} +14 -14
- package/dist/{dev-BDykFvcc.mjs → dev-DApPSaE_.mjs} +5 -5
- package/dist/{eval-0qEOdm0l.mjs → eval-BK47A_K5.mjs} +27 -11
- package/dist/eval.d.ts +2 -0
- package/dist/{init-BtJI306C.mjs → init-DukDxECd.mjs} +13 -21
- package/dist/{login-DeUETobb.mjs → login-DaLrPOFg.mjs} +6 -8
- package/dist/{logs-hWnJ66Bl.mjs → logs-7BRwq0cG.mjs} +22 -15
- package/dist/project-config.mjs +1 -1
- package/dist/scaffold/.env.example +17 -1
- package/dist/scaffold/CLAUDE.md +84 -56
- package/dist/scaffold/package.json +6 -5
- package/dist/scaffold/server.mjs +129 -25
- package/dist/secret-Cjp912yF.mjs +162 -0
- package/dist/secret.d.ts +48 -13
- package/dist/{studio-BxAS_FQQ.mjs → studio-CpHlNHUZ.mjs} +15 -17
- package/dist/templates/briefing-desk/agent.test.ts +7 -3
- package/dist/templates/call-audit/agent.test.ts +25 -9
- package/dist/templates/call-audit/agent.ts +2 -2
- package/dist/templates/call-audit/client.tsx +40 -58
- package/dist/templates/call-audit/workflows/audit.ts +7 -5
- package/dist/templates/call-audit/workflows/ingest.ts +7 -7
- package/dist/templates/call-audit/workflows/media.ts +12 -37
- package/dist/templates/call-audit/workflows/summarize.ts +8 -8
- package/dist/templates/call-audit/workflows/sync-api.ts +3 -3
- package/dist/templates/dispatch-center/agent.test.ts +7 -7
- package/dist/templates/dispatch-center/client.tsx +53 -61
- package/dist/templates/dispatch-center/shared.ts +0 -8
- package/dist/templates/dispatch-center/tools/ops_dashboard.ts +4 -1
- package/dist/templates/embedded-assets/agent.eval.test.ts +4 -2
- package/dist/templates/embedded-assets/agent.test.ts +7 -1
- package/dist/templates/health-assistant/agent.eval.test.ts +4 -2
- package/dist/templates/health-assistant/agent.test.ts +8 -4
- package/dist/templates/infocom-adventure/client.tsx +40 -36
- package/dist/templates/link-digest/agent.test.ts +10 -4
- package/dist/templates/link-digest/agent.ts +2 -2
- package/dist/templates/link-digest/client.tsx +42 -36
- package/dist/templates/link-digest/workflows/digest.ts +13 -16
- package/dist/templates/night-owl/agent.eval.test.ts +4 -2
- package/dist/templates/night-owl/agent.test.ts +6 -1
- package/dist/templates/night-owl/client.tsx +8 -2
- package/dist/templates/pipeline-simple/agent.test.ts +33 -16
- package/dist/templates/pizza-ordering/client.tsx +5 -4
- package/dist/templates/pizza-ordering/shared.ts +3 -8
- package/dist/templates/pizza-ordering/tools/add_pizza.ts +3 -2
- package/dist/templates/pizza-ordering/tools/place_order.ts +3 -2
- package/dist/templates/pizza-ordering/tools/remove_pizza.ts +3 -2
- package/dist/templates/pizza-ordering/tools/update_pizza.ts +3 -2
- package/dist/templates/pizza-ordering/tools/view_order.ts +3 -2
- package/dist/templates/plan-and-execute/agent.test.ts +10 -5
- package/dist/templates/plan-and-execute/client.tsx +2 -2
- package/dist/templates/podcast-digest/agent.test.ts +33 -14
- package/dist/templates/podcast-digest/client.tsx +27 -36
- package/dist/templates/podcast-digest/workflows/digest.ts +21 -19
- package/dist/templates/podcast-digest/workflows/feeds.ts +61 -33
- package/dist/templates/podcast-digest/workflows/slack.ts +7 -7
- package/dist/templates/recap-workflow/agent.eval.test.ts +21 -13
- package/dist/templates/recap-workflow/agent.test.ts +49 -32
- package/dist/templates/recap-workflow/workflows/recap.ts +24 -28
- package/dist/templates/redline/agent.eval.test.ts +5 -8
- package/dist/templates/redline/agent.test.ts +8 -2
- package/dist/templates/redline/client.tsx +47 -48
- package/dist/templates/redline/workflows/redline.ts +17 -17
- package/dist/templates/research-workflow/agent.eval.test.ts +5 -5
- package/dist/templates/research-workflow/agent.test.ts +17 -8
- package/dist/templates/research-workflow/workflows/research.ts +28 -30
- package/dist/templates/retail/agent.test.ts +17 -15
- package/dist/templates/retail/cancel.ts +7 -6
- package/dist/templates/retail/client.tsx +39 -58
- package/dist/templates/retail/payment.ts +4 -3
- package/dist/templates/retail/pending.test.ts +19 -19
- package/dist/templates/retail/registry.test.ts +99 -58
- package/dist/templates/retail/store.test.ts +5 -5
- package/dist/templates/retail/swap.ts +8 -11
- package/dist/templates/simple/agent.test.ts +39 -6
- package/dist/templates/solo-rpg/agent.eval.test.ts +2 -16
- package/dist/templates/solo-rpg/agent.test.ts +12 -12
- package/dist/templates/solo-rpg/client.tsx +3 -3
- package/dist/templates/spoken-summary/agent.test.ts +21 -12
- package/dist/templates/spoken-summary/agent.ts +3 -3
- package/dist/templates/spoken-summary/client.tsx +36 -47
- package/dist/templates/spoken-summary/workflows/summarize.ts +11 -11
- package/dist/templates/spoken-summary/workflows/transcribe.ts +14 -14
- package/dist/templates/support-line/client.tsx +4 -3
- package/dist/templates/support-line/prompts.ts +0 -2
- package/dist/templates/transcription-workflow/agent.test.ts +36 -20
- package/dist/templates/transcription-workflow/agent.ts +2 -2
- package/dist/templates/transcription-workflow/client.tsx +34 -40
- package/dist/templates/transcription-workflow/recover.ts +1 -1
- package/dist/templates/transcription-workflow/run-panel.tsx +34 -14
- package/dist/templates/transcription-workflow/total-latency.tsx +46 -20
- package/dist/templates/transcription-workflow/workflows/batch.ts +15 -15
- package/dist/templates/transcription-workflow/workflows/downsample.ts +1 -1
- package/dist/templates/transcription-workflow/workflows/normalize.ts +15 -19
- package/dist/templates/transcription-workflow/workflows/stream.ts +12 -12
- package/dist/templates/transcription-workflow/workflows/sync-api.ts +3 -3
- package/dist/templates/transcription-workflow/workflows/transcribe.ts +23 -34
- package/dist/templates/travel-concierge/agent.eval.test.ts +2 -2
- package/dist/templates/travel-concierge/agent.test.ts +15 -7
- package/dist/templates/travel-concierge/client.tsx +2 -2
- package/dist/templates/travel-concierge/shared.ts +10 -14
- package/dist/templates/travel-concierge/tools/lookup_booking.ts +4 -3
- package/dist/templates/travel-concierge/tools/search_car_rentals.ts +3 -2
- package/dist/templates/travel-concierge/tools/search_excursions.ts +3 -2
- package/dist/templates/travel-concierge/tools/search_flights.ts +3 -2
- package/dist/templates/travel-concierge/tools/search_hotels.ts +3 -2
- package/dist/test-D032V2cA.mjs +242 -0
- package/dist/test.d.ts +97 -31
- package/dist/typecheck.mjs +2 -2
- package/dist/worker-bundler.mjs +3 -3
- package/dist/{workflow-BBu5oEDw.mjs → workflow-CVioyO3V.mjs} +8 -7
- package/package.json +10 -10
- package/dist/bin.d.mts +0 -2
- package/dist/build-BLlLOrng.mjs +0 -66
- package/dist/secret-B-3T5tvr.mjs +0 -61
- package/dist/test-CiLab-AA.mjs +0 -182
- package/dist/tsdown.config.d.ts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { readFile, readdir } from "node:fs/promises";
|
|
4
|
-
//#region _workflow-determinism.ts
|
|
4
|
+
//#region src/_workflow-determinism.ts
|
|
5
5
|
/**
|
|
6
6
|
* A COMPUTED step identity in the project's own `workflows/`.
|
|
7
7
|
*
|
|
@@ -24,12 +24,12 @@ import { readFile, readdir } from "node:fs/promises";
|
|
|
24
24
|
* compiling every fence in this repo's shipped docs:
|
|
25
25
|
*
|
|
26
26
|
* ```ts
|
|
27
|
-
* import type {
|
|
27
|
+
* import type { WorkflowContext } from "@alexkroman1/aai";
|
|
28
28
|
*
|
|
29
29
|
* declare const charge: () => Promise<string>;
|
|
30
30
|
*
|
|
31
|
-
* export async function body(ctx:
|
|
32
|
-
* // No error. The banned shape, against the real `
|
|
31
|
+
* export async function body(ctx: WorkflowContext, coin: string): Promise<void> {
|
|
32
|
+
* // No error. The banned shape, against the real `WorkflowContext`.
|
|
33
33
|
* await ctx.step(`charge-${coin}`, charge);
|
|
34
34
|
* }
|
|
35
35
|
* ```
|
|
@@ -81,19 +81,6 @@ import { readFile, readdir } from "node:fs/promises";
|
|
|
81
81
|
* @module
|
|
82
82
|
*/
|
|
83
83
|
/**
|
|
84
|
-
* The three `ctx` methods whose first argument is a journal identity.
|
|
85
|
-
*
|
|
86
|
-
* All three key a journal row by it — `name#occurrence` for a step,
|
|
87
|
-
* `sleep!<label>#<n>` and `hook!<token>#<n>` for the waits — so a computed one
|
|
88
|
-
* mints a row no earlier walk reached in exactly the same way. Kept as a list
|
|
89
|
-
* so the message can name the method that was called.
|
|
90
|
-
*/
|
|
91
|
-
const IDENTITY_METHODS = [
|
|
92
|
-
"step",
|
|
93
|
-
"sleep",
|
|
94
|
-
"waitFor"
|
|
95
|
-
];
|
|
96
|
-
/**
|
|
97
84
|
* A `ctx.<method>(` immediately followed by a BACKTICK.
|
|
98
85
|
*
|
|
99
86
|
* The whole check, and its narrowness is the point. A quoted literal is
|
|
@@ -104,8 +91,17 @@ const IDENTITY_METHODS = [
|
|
|
104
91
|
* The receiver is not pinned to `ctx` — a body may destructure or rename it —
|
|
105
92
|
* and a `.step(` on anything else taking a template-literal first argument is
|
|
106
93
|
* not a shape worth excluding.
|
|
94
|
+
*
|
|
95
|
+
* Shared rather than built per call, which is safe ONLY because the single
|
|
96
|
+
* reader is `matchAll`: that method species-constructs its own clone and never
|
|
97
|
+
* advances this object's `lastIndex`. A `.exec` or `.test` added against a `/g`
|
|
98
|
+
* regex would carry state between lines — build a fresh one there.
|
|
107
99
|
*/
|
|
108
|
-
const
|
|
100
|
+
const IDENTITY_PATTERN = new RegExp(`\\.(${[
|
|
101
|
+
"step",
|
|
102
|
+
"sleep",
|
|
103
|
+
"waitFor"
|
|
104
|
+
].join("|")})\\(\``, "g");
|
|
109
105
|
/** Whether a template literal actually INTERPOLATES, or is merely quoted oddly. */
|
|
110
106
|
const INTERPOLATES = /\$\{/;
|
|
111
107
|
/**
|
|
@@ -132,7 +128,7 @@ function findComputedIdentities(source, file) {
|
|
|
132
128
|
const findings = [];
|
|
133
129
|
for (const [n, line] of source.split("\n").entries()) {
|
|
134
130
|
if (isCommentOnly(line)) continue;
|
|
135
|
-
for (const match of line.matchAll(
|
|
131
|
+
for (const match of line.matchAll(IDENTITY_PATTERN)) {
|
|
136
132
|
const method = match[1];
|
|
137
133
|
if (method === void 0) continue;
|
|
138
134
|
if (!INTERPOLATES.test(line.slice((match.index ?? 0) + match[0].length))) continue;
|
|
@@ -169,17 +165,13 @@ async function workflowFiles(cwd) {
|
|
|
169
165
|
* warning pass beside a typecheck that has already run on the same tree.
|
|
170
166
|
*/
|
|
171
167
|
async function scanWorkflowDeterminism(cwd) {
|
|
172
|
-
|
|
173
|
-
for (const rel of await workflowFiles(cwd)) {
|
|
174
|
-
let source;
|
|
168
|
+
return (await Promise.all((await workflowFiles(cwd)).map(async (rel) => {
|
|
175
169
|
try {
|
|
176
|
-
|
|
170
|
+
return findComputedIdentities(await readFile(path.join(cwd, rel), "utf-8"), rel);
|
|
177
171
|
} catch {
|
|
178
|
-
|
|
172
|
+
return [];
|
|
179
173
|
}
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
return findings;
|
|
174
|
+
}))).flat();
|
|
183
175
|
}
|
|
184
176
|
/**
|
|
185
177
|
* The remedy, once, however many findings there are.
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
* compiling every fence in this repo's shipped docs:
|
|
21
21
|
*
|
|
22
22
|
* ```ts
|
|
23
|
-
* import type {
|
|
23
|
+
* import type { WorkflowContext } from "@alexkroman1/aai";
|
|
24
24
|
*
|
|
25
25
|
* declare const charge: () => Promise<string>;
|
|
26
26
|
*
|
|
27
|
-
* export async function body(ctx:
|
|
28
|
-
* // No error. The banned shape, against the real `
|
|
27
|
+
* export async function body(ctx: WorkflowContext, coin: string): Promise<void> {
|
|
28
|
+
* // No error. The banned shape, against the real `WorkflowContext`.
|
|
29
29
|
* await ctx.step(`charge-${coin}`, charge);
|
|
30
30
|
* }
|
|
31
31
|
* ```
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { a as ok, t as CliError } from "./_output-DBP9Op_d.mjs";
|
|
3
|
+
import { n as log, r as notify } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
+
import { r as evalWorkerBundle, t as buildAgentBundle } from "./_bundler-DolUCMxu.mjs";
|
|
5
|
+
import { assertTypechecks } from "./_typecheck-gate-U3jcil8L.mjs";
|
|
6
|
+
import { n as scanWorkflowDeterminism, t as determinismWarnings } from "./_workflow-determinism-CvpqMpdh.mjs";
|
|
7
|
+
import { TEST_FILES, classifyVitestError, runVitest } from "./test-D032V2cA.mjs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import fs from "node:fs/promises";
|
|
10
|
+
import { agentConfigWarnings } from "@alexkroman1/aai/manifest";
|
|
11
|
+
import { DEFAULT_SYSTEM_PROMPT } from "@alexkroman1/aai";
|
|
12
|
+
//#region src/build.ts
|
|
13
|
+
/**
|
|
14
|
+
* `aai build` — bundle the agent without deploying, behind the same gates
|
|
15
|
+
* deploy runs (tests, then typecheck), so the command previews the deploy
|
|
16
|
+
* artifact and its failures alike.
|
|
17
|
+
*
|
|
18
|
+
* It also LEAVES that artifact on disk, at {@link WORKER_ARTIFACT_REL}, which is
|
|
19
|
+
* what makes self-hosting work: `server.mjs` loads the built worker rather than
|
|
20
|
+
* `agent.ts`, because a tool is discovered by the bundler enumerating `tools/`
|
|
21
|
+
* and no un-bundled loader can see that directory. See the scaffold's own
|
|
22
|
+
* `server.mjs` and "Self-hosting runs the built worker" in
|
|
23
|
+
* `packages/aai-templates/CLAUDE.md`.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Where the built worker lands, relative to the project root — under `.aai/`,
|
|
27
|
+
* beside the built client, so one gitignore rule covers every build output.
|
|
28
|
+
*
|
|
29
|
+
* `server.mjs` hardcodes this path: it is a plain `.mjs` file in a user's
|
|
30
|
+
* project and may not import from the CLI (which a deployed project does not
|
|
31
|
+
* install at all). The pair is covered end-to-end by the `npm start` leg of
|
|
32
|
+
* `e2e.test.ts` — the only tier that runs both halves as a user does.
|
|
33
|
+
*/
|
|
34
|
+
const WORKER_ARTIFACT_REL = path.join(".aai", "worker.mjs");
|
|
35
|
+
/**
|
|
36
|
+
* The prose slot, named by convention. Mirrors `worker-bundler.ts`'s constant of
|
|
37
|
+
* the same name — the two cannot share one without an import cycle
|
|
38
|
+
* (`build.ts` → `_bundler.ts` → `worker-bundler.ts`), so `_build.test.ts` pins
|
|
39
|
+
* the pair end to end instead: a build whose prompt really came from the file
|
|
40
|
+
* has to report the file.
|
|
41
|
+
*/
|
|
42
|
+
const SYSTEM_PROMPT_FILE = "system-prompt.md";
|
|
43
|
+
/** What {@link systemPromptSource} reports when nothing declared a prompt. */
|
|
44
|
+
const FRAMEWORK_DEFAULT_PROMPT_SOURCE = "the framework default (DEFAULT_SYSTEM_PROMPT)";
|
|
45
|
+
/**
|
|
46
|
+
* Which of the three possible authors of this agent's system prompt actually
|
|
47
|
+
* wrote the one in the bundle.
|
|
48
|
+
*
|
|
49
|
+
* `aai build` reported `name` and `workerBytes` and nothing about the prompt,
|
|
50
|
+
* and the prompt is the one field that can change COMPLETELY without any
|
|
51
|
+
* config changing: deleting `system-prompt.md` swaps in
|
|
52
|
+
* `DEFAULT_SYSTEM_PROMPT` — a total personality change — with exit 0 and no
|
|
53
|
+
* line anywhere. `withSystemPrompt` refuses the case where a file exists and
|
|
54
|
+
* nothing reads it; it cannot refuse a file that is simply GONE, because that
|
|
55
|
+
* is what an agent with no file legitimately looks like. So this is a report
|
|
56
|
+
* rather than a check.
|
|
57
|
+
*
|
|
58
|
+
* Decided by comparing VALUES against the built agent's resolved prompt, which
|
|
59
|
+
* is the same method `withSystemPrompt` uses and for the same reason — the
|
|
60
|
+
* alternative asks the bundler's module graph a question, and the author may
|
|
61
|
+
* have imported the file and composed it, which is neither "the file" nor
|
|
62
|
+
* "agent.ts" alone.
|
|
63
|
+
*/
|
|
64
|
+
async function systemPromptSource(cwd, resolved) {
|
|
65
|
+
if (resolved === DEFAULT_SYSTEM_PROMPT) return FRAMEWORK_DEFAULT_PROMPT_SOURCE;
|
|
66
|
+
const trimmed = (await fs.readFile(path.join(cwd, SYSTEM_PROMPT_FILE), "utf-8").catch(() => void 0))?.trim();
|
|
67
|
+
if (trimmed === void 0 || trimmed === "" || !resolved.includes(trimmed)) return "agent.ts";
|
|
68
|
+
return resolved.trim() === trimmed ? SYSTEM_PROMPT_FILE : `agent.ts (composing ${SYSTEM_PROMPT_FILE})`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Map a {@link runVitest} failure to a CliError — distinguishing a real test
|
|
72
|
+
* failure (test_failed) from the runner not spawning (spawn_failed) instead
|
|
73
|
+
* of a generic command_failed.
|
|
74
|
+
*/
|
|
75
|
+
function testGateError(err) {
|
|
76
|
+
const { code, message } = classifyVitestError(err);
|
|
77
|
+
return new CliError(code, message, "Re-run with --skipTests to build without tests", { cause: err });
|
|
78
|
+
}
|
|
79
|
+
async function executeBuild(opts) {
|
|
80
|
+
const { cwd } = opts;
|
|
81
|
+
if (!opts.skipTests) try {
|
|
82
|
+
runVitest(cwd, {
|
|
83
|
+
candidates: TEST_FILES,
|
|
84
|
+
all: true
|
|
85
|
+
});
|
|
86
|
+
} catch (err) {
|
|
87
|
+
throw testGateError(err);
|
|
88
|
+
}
|
|
89
|
+
await assertTypechecks(cwd, { skip: opts.skipTypecheck });
|
|
90
|
+
const bundle = await buildAgentBundle(cwd, { minify: true });
|
|
91
|
+
const agentDef = await evalWorkerBundle(bundle.worker);
|
|
92
|
+
for (const warning of agentConfigWarnings(agentDef)) notify("warn", warning);
|
|
93
|
+
for (const warning of determinismWarnings(await scanWorkflowDeterminism(cwd))) notify("warn", warning);
|
|
94
|
+
const worker = path.join(cwd, WORKER_ARTIFACT_REL);
|
|
95
|
+
await fs.mkdir(path.dirname(worker), { recursive: true });
|
|
96
|
+
await fs.writeFile(worker, bundle.worker, "utf-8");
|
|
97
|
+
const systemPrompt = await systemPromptSource(cwd, agentDef.systemPrompt);
|
|
98
|
+
log.info(`System prompt: ${systemPrompt}`);
|
|
99
|
+
log.success("Build complete");
|
|
100
|
+
return ok({
|
|
101
|
+
name: agentDef.name,
|
|
102
|
+
workerBytes: bundle.worker.length,
|
|
103
|
+
worker,
|
|
104
|
+
systemPrompt
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { executeBuild };
|
package/dist/build.d.ts
CHANGED
|
@@ -26,6 +26,11 @@ type BuildData = {
|
|
|
26
26
|
workerBytes: number;
|
|
27
27
|
/** Absolute path of the worker written — what `npm start` boots. */
|
|
28
28
|
worker: string;
|
|
29
|
+
/**
|
|
30
|
+
* WHERE the prompt this bundle carries came from — see
|
|
31
|
+
* {@link systemPromptSource}.
|
|
32
|
+
*/
|
|
33
|
+
systemPrompt: string;
|
|
29
34
|
};
|
|
30
35
|
export declare function executeBuild(opts: {
|
|
31
36
|
cwd: string;
|