@alexkroman1/aai-cli 5.1.0 → 5.2.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/dist/{_agent-D39qatZJ.mjs → _agent-D8zBb3M5.mjs} +2 -3
- package/dist/_agent.d.ts +39 -0
- package/dist/{_api-client-a6cPMebU.mjs → _api-client-MenP4-O7.mjs} +3 -1
- package/dist/_api-client.d.ts +37 -0
- package/dist/{_bundler-DdmuZzeR.mjs → _bundler-DFS4xxqE.mjs} +3 -13
- package/dist/_bundler.d.ts +46 -0
- package/dist/{_config-Czjhvaax.mjs → _config-D3F9km8X.mjs} +3 -3
- package/dist/_config.d.ts +57 -0
- package/dist/_default-html.d.ts +12 -0
- package/dist/_deploy.d.ts +28 -0
- package/dist/{_dev-server-BCbEUhmv.mjs → _dev-server-BBUWo0sb.mjs} +12 -14
- package/dist/_dev-server.d.ts +74 -0
- package/dist/{_init-H-lw7czL.mjs → _init-DU-sXH6S.mjs} +47 -65
- package/dist/_init.d.ts +7 -0
- package/dist/_mock-api.d.ts +22 -0
- package/dist/_mock-registry.d.ts +17 -0
- package/dist/_output.d.ts +50 -0
- package/dist/{_server-common-B75oco06.mjs → _server-common-CnaP_Urf.mjs} +2 -1
- package/dist/_server-common.d.ts +17 -0
- package/dist/_slug-api-19R5kZ0U.mjs +27 -0
- package/dist/_slug-api.d.ts +15 -0
- package/dist/_templates.d.ts +21 -0
- package/dist/{_typecheck-gate-B1GcKZX-.mjs → _typecheck-gate-9IHWDnl1.mjs} +2 -2
- package/dist/_typecheck-gate.d.ts +7 -0
- package/dist/{_ui-DXZ9prrM.mjs → _ui-8kOEB-JH.mjs} +6 -3
- package/dist/_ui.d.ts +22 -0
- package/dist/{_utils-C502jKo8.mjs → _utils-Ch0J4s6a.mjs} +17 -1
- package/dist/_utils.d.ts +48 -0
- package/dist/_vite-env.d.ts +8 -0
- package/dist/build-Xq1xxoSg.mjs +38 -0
- package/dist/build.d.ts +16 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +35 -52
- package/dist/{client-bundler-DO3GgO6p.mjs → client-bundler-BWDkUeEP.mjs} +5 -6
- package/dist/client-bundler.d.ts +21 -0
- package/dist/client-bundler.mjs +1 -1
- package/dist/{delete-K24hW1ab.mjs → delete-kSXFLxek.mjs} +4 -4
- package/dist/delete.d.ts +18 -0
- package/dist/{deploy-D-dnt9L8.mjs → deploy-Ci0X1gp2.mjs} +8 -8
- package/dist/deploy.d.ts +15 -0
- package/dist/{dev-C8o-p13B.mjs → dev-g7sGt8qX.mjs} +3 -3
- package/dist/dev.d.ts +13 -0
- package/dist/{init-B53rR3yD.mjs → init-BjeK8crW.mjs} +10 -17
- package/dist/init.d.ts +24 -0
- package/dist/scaffold/.env.example +11 -0
- package/dist/scaffold/CLAUDE.md +919 -0
- package/dist/scaffold/global.d.ts +1 -0
- package/dist/scaffold/package.json +32 -0
- package/dist/scaffold/pnpm-workspace.yaml +13 -0
- package/dist/scaffold/tsconfig.json +19 -0
- package/dist/scaffold/vite.config.ts +14 -0
- package/dist/scaffold/vitest.config.ts +24 -0
- package/dist/{secret-C4unwCEw.mjs → secret-DOva9OGk.mjs} +21 -20
- package/dist/secret.d.ts +25 -0
- package/dist/{storage-tZM1J8qj.mjs → storage-vM6HjDZZ.mjs} +6 -13
- package/dist/storage.d.ts +22 -0
- package/dist/templates/code-interpreter/agent.ts +11 -0
- package/dist/templates/code-interpreter/system-prompt.md +18 -0
- package/dist/templates/dispatch-center/agent.test.ts +153 -0
- package/dist/templates/dispatch-center/agent.ts +50 -0
- package/dist/templates/dispatch-center/client.tsx +378 -0
- package/dist/templates/dispatch-center/shared.ts +631 -0
- package/dist/templates/dispatch-center/system-prompt.md +39 -0
- package/dist/templates/dispatch-center/tools/incident_add_note.ts +27 -0
- package/dist/templates/dispatch-center/tools/incident_create.ts +79 -0
- package/dist/templates/dispatch-center/tools/incident_escalate.ts +88 -0
- package/dist/templates/dispatch-center/tools/incident_get.ts +36 -0
- package/dist/templates/dispatch-center/tools/incident_triage.ts +78 -0
- package/dist/templates/dispatch-center/tools/incident_update_status.ts +68 -0
- package/dist/templates/dispatch-center/tools/ops_dashboard.ts +52 -0
- package/dist/templates/dispatch-center/tools/ops_protocols.ts +27 -0
- package/dist/templates/dispatch-center/tools/ops_run_scenario.ts +149 -0
- package/dist/templates/dispatch-center/tools/resources_dispatch.ts +97 -0
- package/dist/templates/dispatch-center/tools/resources_get_available.ts +36 -0
- package/dist/templates/dispatch-center/tools/resources_update_status.ts +62 -0
- package/dist/templates/embedded-assets/agent.ts +55 -0
- package/dist/templates/embedded-assets/knowledge.json +20 -0
- package/dist/templates/health-assistant/agent.ts +174 -0
- package/dist/templates/health-assistant/system-prompt.md +17 -0
- package/dist/templates/infocom-adventure/agent.ts +119 -0
- package/dist/templates/infocom-adventure/client.tsx +279 -0
- package/dist/templates/infocom-adventure/shared.ts +38 -0
- package/dist/templates/infocom-adventure/system-prompt.md +43 -0
- package/dist/templates/math-buddy/agent.ts +16 -0
- package/dist/templates/math-buddy/system-prompt.md +12 -0
- package/dist/templates/night-owl/agent.ts +76 -0
- package/dist/templates/night-owl/client.tsx +130 -0
- package/dist/templates/night-owl/shared.ts +5 -0
- package/dist/templates/personal-finance/agent.ts +11 -0
- package/dist/templates/personal-finance/system-prompt.md +17 -0
- package/dist/templates/pipeline-simple/agent.test.ts +32 -0
- package/dist/templates/pipeline-simple/agent.ts +13 -0
- package/dist/templates/pizza-ordering/agent.test.ts +235 -0
- package/dist/templates/pizza-ordering/agent.ts +174 -0
- package/dist/templates/pizza-ordering/client.tsx +120 -0
- package/dist/templates/pizza-ordering/shared.ts +142 -0
- package/dist/templates/pizza-ordering/system-prompt.md +17 -0
- package/dist/templates/simple/agent.ts +5 -0
- package/dist/templates/solo-rpg/agent.test.ts +477 -0
- package/dist/templates/solo-rpg/agent.ts +37 -0
- package/dist/templates/solo-rpg/client.tsx +809 -0
- package/dist/templates/solo-rpg/shared.ts +747 -0
- package/dist/templates/solo-rpg/system-prompt.md +115 -0
- package/dist/templates/solo-rpg/tools/action_roll.ts +98 -0
- package/dist/templates/solo-rpg/tools/burn_momentum.ts +69 -0
- package/dist/templates/solo-rpg/tools/check_state.ts +11 -0
- package/dist/templates/solo-rpg/tools/load_game.ts +25 -0
- package/dist/templates/solo-rpg/tools/oracle.ts +248 -0
- package/dist/templates/solo-rpg/tools/save_game.ts +20 -0
- package/dist/templates/solo-rpg/tools/setup_character.ts +208 -0
- package/dist/templates/solo-rpg/tools/update_state.ts +170 -0
- package/dist/templates/web-researcher/agent.ts +11 -0
- package/dist/{test-CgWhus_Z.mjs → test-3Gq4pqH_.mjs} +5 -7
- package/dist/test.d.ts +39 -0
- package/dist/tsdown.config.d.ts +2 -0
- package/dist/typecheck.d.ts +26 -0
- package/dist/typecheck.mjs +6 -10
- package/dist/worker-bundler.d.ts +29 -0
- package/package.json +9 -6
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as log, u as ok } from "./_ui-
|
|
3
|
-
import { n as getServerInfo } from "./_agent-
|
|
4
|
-
import {
|
|
2
|
+
import { n as log, u as ok } from "./_ui-8kOEB-JH.mjs";
|
|
3
|
+
import { n as getServerInfo } from "./_agent-D8zBb3M5.mjs";
|
|
4
|
+
import { n as apiRequest, t as HINT_NOT_DEPLOYED } from "./_api-client-MenP4-O7.mjs";
|
|
5
5
|
//#region delete.ts
|
|
6
6
|
async function runDelete(opts) {
|
|
7
7
|
await apiRequest(`${opts.url}/${opts.slug}`, {
|
|
8
8
|
method: "DELETE",
|
|
9
9
|
apiKey: opts.apiKey,
|
|
10
10
|
action: "delete",
|
|
11
|
-
hints: { 404:
|
|
11
|
+
hints: { 404: HINT_NOT_DEPLOYED },
|
|
12
12
|
...opts.fetch ? { fetch: opts.fetch } : {}
|
|
13
13
|
});
|
|
14
14
|
}
|
package/dist/delete.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type CommandResult } from "./_output.ts";
|
|
2
|
+
export type DeleteOpts = {
|
|
3
|
+
url: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
/** Optional fetch implementation for testing. Defaults to globalThis.fetch. */
|
|
7
|
+
fetch?: typeof globalThis.fetch;
|
|
8
|
+
};
|
|
9
|
+
export declare function runDelete(opts: DeleteOpts): Promise<void>;
|
|
10
|
+
type DeleteData = {
|
|
11
|
+
slug: string;
|
|
12
|
+
};
|
|
13
|
+
/** Execute delete and return structured result. */
|
|
14
|
+
export declare function executeDelete(opts: {
|
|
15
|
+
cwd: string;
|
|
16
|
+
server?: string | undefined;
|
|
17
|
+
}): Promise<CommandResult<DeleteData>>;
|
|
18
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as log, t as fmtUrl, u as ok } from "./_ui-
|
|
3
|
-
import {
|
|
4
|
-
import { buildAgentBundle } from "./_bundler-
|
|
5
|
-
import { o as writeProjectConfig } from "./_config-
|
|
6
|
-
import { t as resolveServerEnv } from "./_server-common-
|
|
7
|
-
import { i as resolveDeployTarget } from "./_agent-
|
|
8
|
-
import { assertTypechecks } from "./_typecheck-gate-
|
|
9
|
-
import {
|
|
2
|
+
import { n as log, t as fmtUrl, u as ok } from "./_ui-8kOEB-JH.mjs";
|
|
3
|
+
import { a as errorMessage } from "./_utils-Ch0J4s6a.mjs";
|
|
4
|
+
import { t as buildAgentBundle } from "./_bundler-DFS4xxqE.mjs";
|
|
5
|
+
import { o as writeProjectConfig } from "./_config-D3F9km8X.mjs";
|
|
6
|
+
import { t as resolveServerEnv } from "./_server-common-CnaP_Urf.mjs";
|
|
7
|
+
import { i as resolveDeployTarget } from "./_agent-D8zBb3M5.mjs";
|
|
8
|
+
import { t as assertTypechecks } from "./_typecheck-gate-9IHWDnl1.mjs";
|
|
9
|
+
import { n as apiRequest } from "./_api-client-MenP4-O7.mjs";
|
|
10
10
|
import { gzipSync } from "node:zlib";
|
|
11
11
|
//#region _deploy.ts
|
|
12
12
|
async function runDeploy(opts) {
|
package/dist/deploy.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CommandResult } from "./_output.ts";
|
|
2
|
+
type DeployData = {
|
|
3
|
+
slug: string;
|
|
4
|
+
url: string;
|
|
5
|
+
warnings?: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function executeDeploy(opts: {
|
|
8
|
+
cwd: string;
|
|
9
|
+
server?: string | undefined;
|
|
10
|
+
/** See DeployOpts.allowMissingSecrets (`--allow-missing-secrets`). */
|
|
11
|
+
allowMissingSecrets?: boolean | undefined;
|
|
12
|
+
/** `--skipTypecheck`: deploy without the tsc gate. */
|
|
13
|
+
skipTypecheck?: boolean | undefined;
|
|
14
|
+
}): Promise<CommandResult<DeployData>>;
|
|
15
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as log, r as parsePort, t as fmtUrl, u as ok } from "./_ui-
|
|
3
|
-
import {
|
|
2
|
+
import { n as log, r as parsePort, t as fmtUrl, u as ok } from "./_ui-8kOEB-JH.mjs";
|
|
3
|
+
import { i as errorDetail } from "./_utils-Ch0J4s6a.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { styleText } from "node:util";
|
|
6
6
|
//#region dev.ts
|
|
@@ -11,7 +11,7 @@ import { styleText } from "node:util";
|
|
|
11
11
|
async function executeDev(opts) {
|
|
12
12
|
const port = parsePort(opts.port);
|
|
13
13
|
const agentName = path.basename(path.resolve(opts.cwd));
|
|
14
|
-
const { startDevServer } = await import("./_dev-server-
|
|
14
|
+
const { startDevServer } = await import("./_dev-server-BBUWo0sb.mjs");
|
|
15
15
|
let cleanup;
|
|
16
16
|
let shuttingDown = false;
|
|
17
17
|
const onSignal = () => {
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CommandResult } from "./_output.ts";
|
|
2
|
+
type DevData = {
|
|
3
|
+
url: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Start the dev server and return the result.
|
|
7
|
+
* The process stays alive after this returns — caller handles signals.
|
|
8
|
+
*/
|
|
9
|
+
export declare function executeDev(opts: {
|
|
10
|
+
cwd: string;
|
|
11
|
+
port: string;
|
|
12
|
+
}): Promise<CommandResult<DevData>>;
|
|
13
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as unwrapCancel, n as log, u as ok } from "./_ui-
|
|
3
|
-
import {
|
|
4
|
-
import { r as isDevMode, t as getMonorepoRoot } from "./_agent-
|
|
2
|
+
import { a as unwrapCancel, n as log, u as ok } from "./_ui-8kOEB-JH.mjs";
|
|
3
|
+
import { a as errorMessage, c as readJson, l as resolveCwd, o as fileExists, t as AGENT_ENTRY } from "./_utils-Ch0J4s6a.mjs";
|
|
4
|
+
import { r as isDevMode, t as getMonorepoRoot } from "./_agent-D8zBb3M5.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { styleText } from "node:util";
|
|
7
7
|
import * as p from "@clack/prompts";
|
|
@@ -15,7 +15,7 @@ async function promptProjectName(yes) {
|
|
|
15
15
|
message: "What is your project named?",
|
|
16
16
|
placeholder: DEFAULT_PROJECT_NAME,
|
|
17
17
|
defaultValue: DEFAULT_PROJECT_NAME
|
|
18
|
-
})) || DEFAULT_PROJECT_NAME;
|
|
18
|
+
}), "Setup cancelled") || DEFAULT_PROJECT_NAME;
|
|
19
19
|
}
|
|
20
20
|
/** Enable corepack so pnpm is available (scaffold declares packageManager: pnpm). */
|
|
21
21
|
async function ensurePnpm() {
|
|
@@ -74,7 +74,7 @@ function resolveTargetDir(dir) {
|
|
|
74
74
|
}
|
|
75
75
|
/** Run deploy after init and return deploy metadata if successful. */
|
|
76
76
|
async function tryDeploy(cwd, server) {
|
|
77
|
-
const { executeDeploy } = await import("./deploy-
|
|
77
|
+
const { executeDeploy } = await import("./deploy-Ci0X1gp2.mjs");
|
|
78
78
|
try {
|
|
79
79
|
const result = await executeDeploy({
|
|
80
80
|
cwd,
|
|
@@ -92,21 +92,14 @@ async function tryDeploy(cwd, server) {
|
|
|
92
92
|
}
|
|
93
93
|
/** Scaffold the project, optionally showing a spinner. */
|
|
94
94
|
async function scaffoldProject(dir, cwd, template, silent) {
|
|
95
|
-
const { runInit } = await import("./_init-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
targetDir: cwd,
|
|
99
|
-
template
|
|
100
|
-
});
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const s = p.spinner();
|
|
104
|
-
s.start(`Creating ${dir}`);
|
|
95
|
+
const { runInit } = await import("./_init-DU-sXH6S.mjs");
|
|
96
|
+
const s = silent ? void 0 : p.spinner();
|
|
97
|
+
s?.start(`Creating ${dir}`);
|
|
105
98
|
await runInit({
|
|
106
99
|
targetDir: cwd,
|
|
107
100
|
template
|
|
108
101
|
});
|
|
109
|
-
s
|
|
102
|
+
s?.stop("Project created");
|
|
110
103
|
}
|
|
111
104
|
/** Print post-init instructions. */
|
|
112
105
|
function printPostInitInfo(cwd, monorepoRoot) {
|
|
@@ -120,7 +113,7 @@ async function executeInit(opts, extra) {
|
|
|
120
113
|
const dir = opts.dir ?? await promptProjectName(opts.yes);
|
|
121
114
|
const monorepoRoot = getMonorepoRoot();
|
|
122
115
|
const cwd = resolveTargetDir(dir);
|
|
123
|
-
if (!opts.force && await fileExists(path.join(cwd, "agent.ts"))) throw new Error(
|
|
116
|
+
if (!opts.force && await fileExists(path.join(cwd, "agent.ts"))) throw new Error(`${AGENT_ENTRY} already exists in this directory. Use ${styleText("cyanBright", "--force")} to overwrite.`);
|
|
124
117
|
const template = opts.template ?? "simple";
|
|
125
118
|
await scaffoldProject(dir, cwd, template, suppressUi);
|
|
126
119
|
const installed = await installDeps(cwd, suppressUi);
|
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type CommandResult } from "./_output.ts";
|
|
2
|
+
type InitData = {
|
|
3
|
+
dir: string;
|
|
4
|
+
template: string;
|
|
5
|
+
deployed: boolean;
|
|
6
|
+
slug?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
};
|
|
9
|
+
/** Build the command + args for running pnpm, routing through safe-chain when available. */
|
|
10
|
+
export declare function resolvePnpmCommand(checkSafeChain?: () => Promise<boolean>): Promise<{
|
|
11
|
+
cmd: string;
|
|
12
|
+
args: string[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare function executeInit(opts: {
|
|
15
|
+
dir?: string | undefined;
|
|
16
|
+
force?: boolean | undefined;
|
|
17
|
+
template?: string | undefined;
|
|
18
|
+
yes?: boolean | undefined;
|
|
19
|
+
skipDeploy?: boolean | undefined;
|
|
20
|
+
server?: string | undefined;
|
|
21
|
+
}, extra?: {
|
|
22
|
+
silent?: boolean | undefined;
|
|
23
|
+
}): Promise<CommandResult<InitData>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Secrets for local development — loaded automatically by `aai dev`.
|
|
2
|
+
# Only variables listed here are available via ctx.env (not all of process.env).
|
|
3
|
+
#
|
|
4
|
+
# For production, use `aai secret put <NAME>` to set the same keys on the server.
|
|
5
|
+
# In both cases, access secrets in agent code via ctx.env.MY_KEY.
|
|
6
|
+
#
|
|
7
|
+
# Add any secrets your agent needs below:
|
|
8
|
+
|
|
9
|
+
# Required only if your agent enables the `web_search` builtin
|
|
10
|
+
# (free key: https://brave.com/search/api/):
|
|
11
|
+
# BRAVE_API_KEY=
|