@alexkroman1/aai-cli 7.0.0 → 8.1.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/README.md +1 -0
- package/dist/{_bundler-B4RqNF5Z.mjs → _bundler-CDuYl5Gb.mjs} +1 -1
- package/dist/{_dev-server-CiKFH9qw.mjs → _dev-server-Dt3TCjhj.mjs} +6 -2
- package/dist/{_init-CE4HKdgV.mjs → _init-BhEfQ6Yi.mjs} +1 -1
- package/dist/_resource-commands.d.ts +23 -0
- package/dist/{_slug-api-nRFaBEPJ.mjs → _slug-api-z-USxPtL.mjs} +14 -10
- package/dist/_slug-api.d.ts +5 -2
- package/dist/{_templates-FI3xPEMj.mjs → _templates-4WcKOjS5.mjs} +4 -5
- package/dist/_templates.d.ts +3 -4
- package/dist/{build-6jfaakgc.mjs → build-BBxf8vom.mjs} +2 -2
- package/dist/cli.mjs +338 -346
- package/dist/{deploy-DvYeD8ia.mjs → deploy-DRC8jWr8.mjs} +1 -1
- package/dist/{dev-B59JIfWO.mjs → dev-QuuOOUtv.mjs} +1 -1
- package/dist/eval-DfQ8cm5p.mjs +56 -0
- package/dist/eval.d.ts +43 -0
- package/dist/{init-CpJVjEg0.mjs → init-CUo87gcI.mjs} +2 -2
- package/dist/{logs-9q-psa4q.mjs → logs-CQ2T46dr.mjs} +1 -1
- package/dist/scaffold/CLAUDE.md +409 -68
- package/dist/scaffold/package.json +5 -4
- package/dist/scaffold/server.mjs +10 -3
- package/dist/scaffold/tsconfig.json +0 -1
- package/dist/{secret-CVvSLIDV.mjs → secret-Ct34kdgU.mjs} +1 -1
- package/dist/{storage-BvUrnvM3.mjs → storage-i_79ZwAR.mjs} +1 -1
- package/dist/{studio--MUV0cid.mjs → studio-CzTzPqe1.mjs} +1 -1
- package/dist/templates/briefing-desk/agent.test.ts +350 -0
- package/dist/templates/briefing-desk/agent.ts +30 -0
- package/dist/templates/briefing-desk/shared.ts +200 -0
- package/dist/templates/briefing-desk/system-prompt.md +39 -0
- package/dist/templates/briefing-desk/tools/briefing_so_far.ts +35 -0
- package/dist/templates/briefing-desk/tools/research_topic.ts +88 -0
- package/dist/templates/briefing-desk/tools/verify_claim.ts +77 -0
- package/dist/templates/call-audit/agent.eval.test.ts +474 -0
- package/dist/templates/code-interpreter/agent.eval.test.ts +165 -0
- package/dist/templates/dispatch-center/agent.eval.test.ts +349 -0
- package/dist/templates/embedded-assets/agent.eval.test.ts +138 -0
- package/dist/templates/health-assistant/agent.eval.test.ts +167 -0
- package/dist/templates/infocom-adventure/agent.eval.test.ts +158 -0
- package/dist/templates/infocom-adventure/agent.test.ts +49 -18
- package/dist/templates/infocom-adventure/agent.ts +21 -0
- package/dist/templates/infocom-adventure/shared.ts +20 -9
- package/dist/templates/infocom-adventure/system-prompt.md +1 -1
- package/dist/templates/infocom-adventure/tools/game_state_move.ts +3 -2
- package/dist/templates/link-digest/agent.eval.test.ts +195 -0
- package/dist/templates/math-buddy/agent.eval.test.ts +146 -0
- package/dist/templates/night-owl/agent.eval.test.ts +272 -0
- package/dist/templates/personal-finance/agent.eval.test.ts +168 -0
- package/dist/templates/personal-finance/system-prompt.md +4 -0
- package/dist/templates/pipeline-simple/agent.eval.test.ts +78 -0
- package/dist/templates/pipeline-simple/agent.ts +2 -2
- package/dist/templates/pizza-ordering/agent.eval.test.ts +171 -0
- package/dist/templates/pizza-ordering/agent.test.ts +15 -0
- package/dist/templates/pizza-ordering/shared.ts +20 -1
- package/dist/templates/pizza-ordering/system-prompt.md +6 -0
- package/dist/templates/plan-and-execute/agent.eval.test.ts +209 -0
- package/dist/templates/podcast-digest/agent.eval.test.ts +411 -0
- package/dist/templates/podcast-digest/agent.test.ts +30 -59
- package/dist/templates/podcast-digest/agent.ts +1 -1
- package/dist/templates/podcast-digest/workflows/digest.ts +52 -19
- package/dist/templates/podcast-digest/workflows/slack.ts +48 -169
- package/dist/templates/recap-workflow/agent.eval.test.ts +366 -0
- package/dist/templates/redline/agent.eval.test.ts +209 -0
- package/dist/templates/research-workflow/agent.eval.test.ts +329 -0
- package/dist/templates/retail/address.ts +87 -1
- package/dist/templates/retail/agent.eval.test.ts +314 -0
- package/dist/templates/retail/agent.test.ts +171 -91
- package/dist/templates/retail/agent.ts +35 -1
- package/dist/templates/retail/cancel.ts +116 -0
- package/dist/templates/retail/client.tsx +39 -0
- package/dist/templates/retail/payment.ts +107 -0
- package/dist/templates/retail/pending.test.ts +196 -0
- package/dist/templates/retail/pending.ts +137 -0
- package/dist/templates/retail/registry.test.ts +119 -8
- package/dist/templates/retail/returns.ts +102 -0
- package/dist/templates/retail/shared.test.ts +42 -0
- package/dist/templates/retail/shared.ts +35 -0
- package/dist/templates/retail/store.test.ts +6 -4
- package/dist/templates/retail/store.ts +113 -57
- package/dist/templates/retail/swap.test.ts +4 -4
- package/dist/templates/retail/swap.ts +248 -15
- package/dist/templates/retail/system-prompt.md +62 -30
- package/dist/templates/retail/tools/cancel_change.ts +33 -0
- package/dist/templates/retail/tools/cancel_pending_order.ts +15 -59
- package/dist/templates/retail/tools/confirm_change.ts +42 -0
- package/dist/templates/retail/tools/exchange_delivered_order_items.ts +21 -66
- package/dist/templates/retail/tools/modify_pending_order_address.ts +12 -24
- package/dist/templates/retail/tools/modify_pending_order_items.ts +22 -60
- package/dist/templates/retail/tools/modify_pending_order_payment.ts +15 -77
- package/dist/templates/retail/tools/modify_user_address.ts +12 -15
- package/dist/templates/retail/tools/return_delivered_order_items.ts +16 -71
- package/dist/templates/retail/tools/transfer_to_human_agents.ts +4 -2
- package/dist/templates/simple/agent.eval.test.ts +54 -0
- package/dist/templates/solo-rpg/agent.eval.test.ts +320 -0
- package/dist/templates/spoken-summary/agent.eval.test.ts +342 -0
- package/dist/templates/support-line/agent.eval.test.ts +273 -0
- package/dist/templates/support-line/system-prompt.md +2 -1
- package/dist/templates/support-line/tools/answer_question.ts +56 -7
- package/dist/templates/transcription-workflow/agent.eval.test.ts +234 -0
- package/dist/templates/travel-concierge/agent.eval.test.ts +323 -0
- package/dist/templates/travel-concierge/agent.test.ts +110 -10
- package/dist/templates/travel-concierge/agent.ts +18 -9
- package/dist/templates/travel-concierge/shared.ts +110 -9
- package/dist/templates/travel-concierge/system-prompt.md +7 -1
- package/dist/templates/travel-concierge/tools/book_car_rental.ts +6 -3
- package/dist/templates/travel-concierge/tools/book_excursion.ts +6 -3
- package/dist/templates/travel-concierge/tools/book_hotel.ts +6 -3
- package/dist/templates/travel-concierge/tools/cancel_ticket.ts +6 -3
- package/dist/templates/travel-concierge/tools/search_car_rentals.ts +9 -5
- package/dist/templates/travel-concierge/tools/search_excursions.ts +9 -5
- package/dist/templates/travel-concierge/tools/search_flights.ts +9 -6
- package/dist/templates/travel-concierge/tools/search_hotels.ts +9 -5
- package/dist/templates/travel-concierge/tools/update_ticket.ts +6 -3
- package/dist/templates/web-researcher/agent.eval.test.ts +121 -0
- package/dist/templates/web-researcher/system-prompt.md +15 -4
- package/dist/{test-9kPKJI-w.mjs → test-BvyT6sAc.mjs} +24 -10
- package/dist/test.d.ts +29 -5
- package/dist/{worker-bundler-COxnqstQ.mjs → worker-bundler-CCVEDjm1.mjs} +45 -25
- package/dist/worker-bundler.mjs +1 -1
- package/dist/{workflow-D2AQf2Pl.mjs → workflow-BflATMmU.mjs} +19 -11
- package/package.json +5 -5
- package/dist/eject-C9WJyyr2.mjs +0 -116
- package/dist/eject.d.ts +0 -60
- package/dist/templates/infocom-adventure/tools/game_state_history.ts +0 -14
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ npm i -g @alexkroman1/aai-cli # or: npx @alexkroman1/aai-cli@latest
|
|
|
14
14
|
| `aai templates` | List the shipped project templates |
|
|
15
15
|
| `aai dev` | Local dev server: loads `agent.ts`, rebuilds on change, serves the browser client (`--port`) |
|
|
16
16
|
| `aai test` | Run the project's vitest suite |
|
|
17
|
+
| `aai eval` | Run the project's behaviour evals (`agent.eval.test.ts`) — a real session, a live model with a key, a scripted one without |
|
|
17
18
|
| `aai build` | Bundle without deploying (type-checks first; `--skipTypecheck` opts out) |
|
|
18
19
|
| `aai list` | List your studio projects |
|
|
19
20
|
| `aai pull <project>` | Pull a studio project into a local directory, ready for `aai dev` |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { f as validateAgentExport } from "./_utils-B8QmtFhK.mjs";
|
|
3
3
|
import { t as buildClient } from "./client-bundler-CWnG42cU.mjs";
|
|
4
|
-
import { n as buildWorkflows, t as buildWorker } from "./worker-bundler-
|
|
4
|
+
import { n as buildWorkflows, t as buildWorker } from "./worker-bundler-CCVEDjm1.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import { omitUndefined } from "@alexkroman1/aai/utils";
|
|
@@ -3,9 +3,9 @@ import { i as outputSilenced, r as notify } from "./_ui-u7T4YooX.mjs";
|
|
|
3
3
|
import { i as errorCode, o as errorMessage$1 } from "./_utils-B8QmtFhK.mjs";
|
|
4
4
|
import { n as fallbackHtmlPlugin } from "./client-bundler-CWnG42cU.mjs";
|
|
5
5
|
import { t as DEDUPED_PEERS } from "./_vite-env-BNveawd1.mjs";
|
|
6
|
-
import { n as buildWorkflows, t as buildWorker } from "./worker-bundler-
|
|
6
|
+
import { n as buildWorkflows, t as buildWorker } from "./worker-bundler-CCVEDjm1.mjs";
|
|
7
7
|
import { n as ensureApiKey } from "./_config-CmJOFsAP.mjs";
|
|
8
|
-
import { n as createWorkerEvaluator } from "./_bundler-
|
|
8
|
+
import { n as createWorkerEvaluator } from "./_bundler-CDuYl5Gb.mjs";
|
|
9
9
|
import { t as resolveServerEnv } from "./_server-common-6e0QI4mq.mjs";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
11
11
|
import path from "node:path";
|
|
@@ -195,6 +195,10 @@ function createRestartSupervisor(ops) {
|
|
|
195
195
|
return {
|
|
196
196
|
request,
|
|
197
197
|
adopt(server) {
|
|
198
|
+
if (closed) {
|
|
199
|
+
closeQuietly(server);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
198
202
|
current = server;
|
|
199
203
|
booting = false;
|
|
200
204
|
if (queuedDuringBoot) request();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { c as isEexist, l as readJson, p as writeJson } from "./_utils-B8QmtFhK.mjs";
|
|
3
3
|
import { r as isDevMode, t as getMonorepoRoot } from "./_agent-BTwZJu4P.mjs";
|
|
4
|
-
import { REPO_URL, downloadAndMergeTemplate } from "./_templates-
|
|
4
|
+
import { REPO_URL, downloadAndMergeTemplate } from "./_templates-4WcKOjS5.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
//#region _init.ts
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const secret: import("citty").CommandDef<import("citty").ArgsDef>;
|
|
2
|
+
export declare const logs: import("citty").CommandDef<{
|
|
3
|
+
readonly dir: {
|
|
4
|
+
readonly type: "positional";
|
|
5
|
+
readonly description: "Project directory";
|
|
6
|
+
readonly required: false;
|
|
7
|
+
};
|
|
8
|
+
readonly follow: {
|
|
9
|
+
readonly type: "boolean";
|
|
10
|
+
readonly alias: "f";
|
|
11
|
+
readonly description: "Keep printing new output";
|
|
12
|
+
};
|
|
13
|
+
readonly server: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly alias: "s";
|
|
16
|
+
readonly description: "Platform server URL";
|
|
17
|
+
};
|
|
18
|
+
readonly json: {
|
|
19
|
+
readonly type: "boolean";
|
|
20
|
+
readonly description: "Output JSON (auto-detected in non-TTY)";
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
export declare const storage: import("citty").CommandDef<import("citty").ArgsDef>;
|
|
@@ -13,6 +13,18 @@ import { l as HINT_NOT_DEPLOYED, s as studioProjectApiUrl, u as apiRequest } fro
|
|
|
13
13
|
* stays real — an intra-module call would bypass those mocks.
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
|
+
* The request itself — one definition so the "not deployed" 404 hint this
|
|
17
|
+
* module exists to attach cannot be present on one route and missing on the
|
|
18
|
+
* other. Only the URL differs between the two callers.
|
|
19
|
+
*/
|
|
20
|
+
function deployedAgentRequest(url, init, apiKey) {
|
|
21
|
+
return apiRequest(url, {
|
|
22
|
+
...init,
|
|
23
|
+
apiKey,
|
|
24
|
+
hints: { 404: HINT_NOT_DEPLOYED }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
16
28
|
* A SECRET request, routed to the project when this directory is linked to
|
|
17
29
|
* one and to the bare slug otherwise.
|
|
18
30
|
*
|
|
@@ -27,22 +39,14 @@ import { l as HINT_NOT_DEPLOYED, s as studioProjectApiUrl, u as apiRequest } fro
|
|
|
27
39
|
async function secretRequest(cwd, resourcePath, init, server) {
|
|
28
40
|
const { serverUrl, slug, apiKey, studioProject } = await getServerInfo(cwd, server);
|
|
29
41
|
return {
|
|
30
|
-
data: await
|
|
31
|
-
...init,
|
|
32
|
-
apiKey,
|
|
33
|
-
hints: { 404: HINT_NOT_DEPLOYED }
|
|
34
|
-
}),
|
|
42
|
+
data: await deployedAgentRequest(`${studioProject ? studioProjectApiUrl(serverUrl, studioProject) : `${serverUrl}/${slug}`}/secret${resourcePath}`, init, apiKey),
|
|
35
43
|
target: studioProject ?? slug
|
|
36
44
|
};
|
|
37
45
|
}
|
|
38
46
|
async function slugRequest(cwd, resourcePath, init, server) {
|
|
39
47
|
const { serverUrl, slug, apiKey } = await getServerInfo(cwd, server);
|
|
40
48
|
return {
|
|
41
|
-
data: await
|
|
42
|
-
...init,
|
|
43
|
-
apiKey,
|
|
44
|
-
hints: { 404: HINT_NOT_DEPLOYED }
|
|
45
|
-
}),
|
|
49
|
+
data: await deployedAgentRequest(`${serverUrl}/${slug}${resourcePath}`, init, apiKey),
|
|
46
50
|
slug
|
|
47
51
|
};
|
|
48
52
|
}
|
package/dist/_slug-api.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* stays real — an intra-module call would bypass those mocks.
|
|
10
10
|
*/
|
|
11
11
|
import { type ApiRequestOptions } from "./_api-client.ts";
|
|
12
|
+
/** What both requests below pass through to the API client. */
|
|
13
|
+
type SlugRequestInit = Pick<ApiRequestOptions, "method" | "body" | "action">;
|
|
12
14
|
/**
|
|
13
15
|
* A SECRET request, routed to the project when this directory is linked to
|
|
14
16
|
* one and to the bare slug otherwise.
|
|
@@ -21,11 +23,12 @@ import { type ApiRequestOptions } from "./_api-client.ts";
|
|
|
21
23
|
* user's own `aai publish` had created. An unlinked directory has one agent
|
|
22
24
|
* and keeps the per-slug route, which is the platform primitive underneath.
|
|
23
25
|
*/
|
|
24
|
-
export declare function secretRequest<T = unknown>(cwd: string, resourcePath: string, init:
|
|
26
|
+
export declare function secretRequest<T = unknown>(cwd: string, resourcePath: string, init: SlugRequestInit, server?: string): Promise<{
|
|
25
27
|
data: T;
|
|
26
28
|
target: string;
|
|
27
29
|
}>;
|
|
28
|
-
export declare function slugRequest<T = unknown>(cwd: string, resourcePath: string, init:
|
|
30
|
+
export declare function slugRequest<T = unknown>(cwd: string, resourcePath: string, init: SlugRequestInit, server?: string): Promise<{
|
|
29
31
|
data: T;
|
|
30
32
|
slug: string;
|
|
31
33
|
}>;
|
|
34
|
+
export {};
|
|
@@ -120,10 +120,9 @@ async function readJsonFile(file) {
|
|
|
120
120
|
* Directory holding the base scaffold — the files every project gets
|
|
121
121
|
* underneath its template (package.json, tsconfig, `server.mjs`, …).
|
|
122
122
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* byte-identical output to one `aai init` scaffolded.
|
|
123
|
+
* The scaffold is the single definition of the self-hosted entrypoint, so a
|
|
124
|
+
* caller needing one of its files resolves it here rather than carrying a
|
|
125
|
+
* second copy of that file's contents.
|
|
127
126
|
*/
|
|
128
127
|
function scaffoldDir() {
|
|
129
128
|
return path.join(resolveTemplatesDir(), "scaffold");
|
|
@@ -164,4 +163,4 @@ async function downloadAndMergeTemplate(template, targetDir) {
|
|
|
164
163
|
await layerScaffold(targetDir);
|
|
165
164
|
}
|
|
166
165
|
//#endregion
|
|
167
|
-
export { REPO_URL, downloadAndMergeTemplate, layerScaffold, listTemplates
|
|
166
|
+
export { REPO_URL, downloadAndMergeTemplate, layerScaffold, listTemplates };
|
package/dist/_templates.d.ts
CHANGED
|
@@ -39,10 +39,9 @@ export declare function mergeScaffoldManifest(existing: Manifest, scaffold: Mani
|
|
|
39
39
|
* Directory holding the base scaffold — the files every project gets
|
|
40
40
|
* underneath its template (package.json, tsconfig, `server.mjs`, …).
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* byte-identical output to one `aai init` scaffolded.
|
|
42
|
+
* The scaffold is the single definition of the self-hosted entrypoint, so a
|
|
43
|
+
* caller needing one of its files resolves it here rather than carrying a
|
|
44
|
+
* second copy of that file's contents.
|
|
46
45
|
*/
|
|
47
46
|
export declare function scaffoldDir(): string;
|
|
48
47
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as ok, t as CliError } from "./_output-CKkmWs7i.mjs";
|
|
3
3
|
import { n as log, r as notify } from "./_ui-u7T4YooX.mjs";
|
|
4
|
-
import { r as evalWorkerBundle, t as buildAgentBundle } from "./_bundler-
|
|
4
|
+
import { r as evalWorkerBundle, t as buildAgentBundle } from "./_bundler-CDuYl5Gb.mjs";
|
|
5
5
|
import { assertTypechecks } from "./_typecheck-gate-BXvUNnfs.mjs";
|
|
6
|
-
import { classifyVitestError, runVitest } from "./test-
|
|
6
|
+
import { classifyVitestError, runVitest } from "./test-BvyT6sAc.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
9
9
|
import { agentConfigWarnings } from "@alexkroman1/aai/manifest";
|