@alexkroman1/aai-cli 13.3.0 → 15.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/dist/{_agent-Clbq3a4h.mjs → _agent-BzUeqOdj.mjs} +32 -9
- package/dist/_agent.d.ts +23 -0
- package/dist/_artifacts-BJOYGQPp.mjs +21 -0
- package/dist/_artifacts.d.ts +16 -0
- package/dist/_build-target.d.ts +172 -0
- package/dist/{_bundler-DEkjO1d8.mjs → _bundler-DM0d0M7m.mjs} +8 -7
- package/dist/_cli-common.d.ts +45 -6
- package/dist/{_config-ZY2euhdh.mjs → _config-DYzC6WMD.mjs} +2 -2
- package/dist/_dev-env.d.ts +1 -1
- package/dist/{_dev-server-C13xuGB1.mjs → _dev-server-BzWB6-4y.mjs} +25 -24
- package/dist/_dev-vite-config.d.ts +3 -3
- package/dist/_e2e-test-utils.d.ts +1 -1
- package/dist/{_init-Ci4QGjp8.mjs → _init-Bsi3DZNJ.mjs} +9 -23
- package/dist/{_output-DbJt9gsl.mjs → _output-DBP9Op_d.mjs} +22 -13
- package/dist/_output.d.ts +10 -9
- package/dist/{_preflight-B2laWPdU.mjs → _preflight-CcAR577V.mjs} +2 -2
- package/dist/_resource-commands.d.ts +9 -9
- package/dist/_server-common-De0haHr9.mjs +70 -0
- package/dist/_server-common.d.ts +20 -1
- package/dist/{_slug-api-DlKpj91X.mjs → _slug-api-CGvc2YSQ.mjs} +18 -9
- package/dist/_slug-api.d.ts +19 -0
- package/dist/{_studio-DTi3EdXQ.mjs → _studio-DnR_BqFp.mjs} +7 -3
- package/dist/_studio-commands.d.ts +13 -13
- package/dist/{_templates-V4l5sZJy.mjs → _templates-CIlJ3Vay.mjs} +4 -4
- package/dist/_templates.d.ts +1 -1
- package/dist/{_typecheck-gate-sV4N5F93.mjs → _typecheck-gate-U3jcil8L.mjs} +3 -2
- package/dist/_typecheck-gate.d.ts +3 -1
- package/dist/{_utils-Dhd058D9.mjs → _utils-D5JGcjiW.mjs} +43 -1
- package/dist/_utils.d.ts +35 -0
- package/dist/_vercel-output.d.ts +63 -0
- package/dist/{_workflow-determinism-C9l8uC2R.mjs → _workflow-determinism-CvpqMpdh.mjs} +18 -26
- package/dist/_workflow-determinism.d.ts +3 -3
- package/dist/build-BhEaxBPu.mjs +481 -0
- package/dist/build.d.ts +23 -10
- package/dist/cli.d.ts +1 -2
- package/dist/cli.mjs +155 -138
- package/dist/{client-bundler-CT-_26c5.mjs → client-bundler-6mTLs6ny.mjs} +5 -5
- package/dist/client-bundler.d.ts +1 -1
- package/dist/client-bundler.mjs +1 -1
- package/dist/{delete-RqlQZ6Y_.mjs → delete-BdFnbnVR.mjs} +4 -4
- package/dist/{deploy-B7f3CK7v.mjs → deploy-CGqPU5U-.mjs} +11 -11
- package/dist/{dev-DamXieW_.mjs → dev-Bx9gYBHM.mjs} +3 -3
- package/dist/{eval-h3DTVfRw.mjs → eval-B3I7FqN9.mjs} +3 -3
- package/dist/{init-D-vFrV8h.mjs → init-CFyusRbq.mjs} +48 -20
- package/dist/init.d.ts +14 -0
- package/dist/{login-CDiemNmC.mjs → login-DaLrPOFg.mjs} +4 -6
- package/dist/{logs-DGwPNCzB.mjs → logs-7BRwq0cG.mjs} +21 -14
- package/dist/project-config.mjs +1 -1
- package/dist/scaffold/CLAUDE.md +155 -76
- package/dist/scaffold/package.json +6 -6
- package/dist/{secret-V1w7y9-j.mjs → secret-Cjp912yF.mjs} +5 -5
- package/dist/secret.d.ts +8 -6
- package/dist/start.d.ts +112 -0
- package/dist/start.mjs +156 -0
- package/dist/{studio-BpMCfUNx.mjs → studio-C_zuRC_z.mjs} +13 -15
- package/dist/templates/briefing-desk/agent.eval.test.ts +156 -0
- package/dist/templates/call-audit/agent.test.ts +11 -6
- package/dist/templates/call-audit/agent.ts +2 -2
- package/dist/templates/call-audit/client.tsx +27 -42
- 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/code-interpreter/agent.test.ts +103 -0
- 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/health-assistant/agent.eval.test.ts +4 -2
- package/dist/templates/infocom-adventure/client.tsx +40 -36
- package/dist/templates/link-digest/agent.test.ts +3 -3
- package/dist/templates/link-digest/agent.ts +2 -2
- package/dist/templates/link-digest/client.tsx +81 -19
- package/dist/templates/link-digest/workflows/digest.ts +13 -16
- package/dist/templates/math-buddy/agent.test.ts +126 -0
- package/dist/templates/night-owl/agent.eval.test.ts +4 -2
- package/dist/templates/night-owl/client.tsx +8 -2
- package/dist/templates/personal-finance/agent.test.ts +127 -0
- package/dist/templates/pipeline-simple/agent.test.ts +2 -2
- 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 +20 -11
- package/dist/templates/podcast-digest/client.tsx +16 -22
- 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 +27 -23
- 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 +1 -1
- package/dist/templates/redline/client.tsx +36 -34
- 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 +10 -7
- 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/store.test.ts +5 -5
- package/dist/templates/retail/swap.ts +8 -11
- 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 +9 -9
- package/dist/templates/spoken-summary/agent.ts +3 -3
- package/dist/templates/spoken-summary/client.tsx +23 -30
- 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/agent.ts +8 -0
- 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 +20 -12
- package/dist/templates/transcription-workflow/agent.ts +2 -2
- package/dist/templates/transcription-workflow/client.tsx +15 -14
- 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/routing.ts +64 -55
- package/dist/templates/travel-concierge/shared.ts +10 -14
- package/dist/templates/travel-concierge/tools/cancel_action.ts +3 -1
- package/dist/templates/travel-concierge/tools/complete_or_escalate.ts +3 -1
- package/dist/templates/travel-concierge/tools/confirm_action.ts +3 -1
- 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/templates/web-researcher/agent.test.ts +130 -0
- package/dist/{test-guenJUxi.mjs → test-D032V2cA.mjs} +4 -17
- package/dist/typecheck.mjs +1 -1
- package/dist/worker-bundler.d.ts +1 -1
- package/dist/worker-bundler.mjs +8 -8
- package/dist/{workflow-BZyKLkhV.mjs → workflow-CVioyO3V.mjs} +6 -5
- package/package.json +9 -4
- package/dist/_server-common-BV4_CrP3.mjs +0 -43
- package/dist/build-CWyFGe-W.mjs +0 -69
- package/dist/scaffold/server.mjs +0 -204
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ok } from "./_output-
|
|
2
|
+
import { a as ok } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { n as log } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import { l as writeProjectConfig } from "./_config-
|
|
5
|
-
import {
|
|
6
|
-
import { d as apiTestSeam, l as HINT_NOT_DEPLOYED, s as studioProjectApiUrl, u as apiRequest } from "./_studio-
|
|
4
|
+
import { l as writeProjectConfig } from "./_config-DYzC6WMD.mjs";
|
|
5
|
+
import { i as requireDeployedSlug, o as resolveDeployTarget } from "./_agent-BzUeqOdj.mjs";
|
|
6
|
+
import { d as apiTestSeam, l as HINT_NOT_DEPLOYED, s as studioProjectApiUrl, u as apiRequest } from "./_studio-DnR_BqFp.mjs";
|
|
7
7
|
import { omitUndefined } from "@alexkroman1/aai/utils";
|
|
8
8
|
//#region src/delete.ts
|
|
9
9
|
async function runDelete(opts) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ok } from "./_output-
|
|
2
|
+
import { a as ok } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { n as log, r as notify, t as fmtUrl } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { s as updateProjectConfig } from "./_config-
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import { assertTypechecks } from "./_typecheck-gate-
|
|
10
|
-
import { n as scanWorkflowDeterminism, t as determinismWarnings } from "./_workflow-determinism-
|
|
11
|
-
import { d as apiTestSeam, f as checkedResponse, i as projectNameFromDir, u as apiRequest } from "./_studio-
|
|
4
|
+
import { s as errorMessage$1 } from "./_utils-D5JGcjiW.mjs";
|
|
5
|
+
import { s as updateProjectConfig } from "./_config-DYzC6WMD.mjs";
|
|
6
|
+
import { n as resolveServerEnv } from "./_server-common-De0haHr9.mjs";
|
|
7
|
+
import { i as evalWorkerConfig, t as buildAgentBundle } from "./_bundler-DM0d0M7m.mjs";
|
|
8
|
+
import { o as resolveDeployTarget } from "./_agent-BzUeqOdj.mjs";
|
|
9
|
+
import { assertTypechecks } from "./_typecheck-gate-U3jcil8L.mjs";
|
|
10
|
+
import { n as scanWorkflowDeterminism, t as determinismWarnings } from "./_workflow-determinism-CvpqMpdh.mjs";
|
|
11
|
+
import { d as apiTestSeam, f as checkedResponse, i as projectNameFromDir, u as apiRequest } from "./_studio-DnR_BqFp.mjs";
|
|
12
12
|
import { isRecord, omitUndefined } from "@alexkroman1/aai/utils";
|
|
13
13
|
import { gzipSync } from "node:zlib";
|
|
14
14
|
//#region src/_deploy.ts
|
|
@@ -40,8 +40,8 @@ async function runDeploy(opts) {
|
|
|
40
40
|
async function executeDeploy(opts) {
|
|
41
41
|
const { cwd } = opts;
|
|
42
42
|
const { config: projectConfig, serverUrl, apiKey } = await resolveDeployTarget(cwd, opts.server);
|
|
43
|
-
|
|
44
|
-
const preflightModule = import("./_preflight-
|
|
43
|
+
await assertTypechecks(cwd, { skip: opts.skipTypecheck });
|
|
44
|
+
const preflightModule = import("./_preflight-CcAR577V.mjs");
|
|
45
45
|
const bundle = await buildAgentBundle(cwd, { minify: true });
|
|
46
46
|
const slug = projectConfig?.slug ?? projectNameFromDir(cwd) ?? void 0;
|
|
47
47
|
const uploadEnv = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ok } from "./_output-
|
|
2
|
+
import { a as ok } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { a as parsePort, n as log, r as notify, t as fmtUrl } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { o as errorDetail } from "./_utils-D5JGcjiW.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { styleText } from "node:util";
|
|
7
7
|
//#region src/dev.ts
|
|
@@ -12,7 +12,7 @@ import { styleText } from "node:util";
|
|
|
12
12
|
async function executeDev(opts) {
|
|
13
13
|
const port = parsePort(opts.port);
|
|
14
14
|
const agentName = path.basename(path.resolve(opts.cwd));
|
|
15
|
-
const { startDevServer } = await import("./_dev-server-
|
|
15
|
+
const { startDevServer } = await import("./_dev-server-BzWB6-4y.mjs");
|
|
16
16
|
let cleanup;
|
|
17
17
|
let shuttingDown = false;
|
|
18
18
|
const onSignal = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ok, n as fail } from "./_output-
|
|
2
|
+
import { a as ok, n as fail } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { n as log } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { classifyVitestError, runVitest } from "./test-
|
|
4
|
+
import { n as resolveServerEnv } from "./_server-common-De0haHr9.mjs";
|
|
5
|
+
import { classifyVitestError, runVitest } from "./test-D032V2cA.mjs";
|
|
6
6
|
//#region src/eval.ts
|
|
7
7
|
/**
|
|
8
8
|
* `aai eval` — run the agent's behaviour evals via vitest.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ok } from "./_output-
|
|
2
|
+
import { a as ok } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { n as log, s as unwrapCancel } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as isDevMode, t as getMonorepoRoot } from "./_agent-
|
|
4
|
+
import { c as fileExists, d as readJson, p as resolveCwd, s as errorMessage$1, t as AGENT_ENTRY } from "./_utils-D5JGcjiW.mjs";
|
|
5
|
+
import { r as isDevMode, t as getMonorepoRoot } from "./_agent-BzUeqOdj.mjs";
|
|
6
|
+
import { listTemplates } from "./_templates-CIlJ3Vay.mjs";
|
|
6
7
|
import path from "node:path";
|
|
7
8
|
import { omitUndefined } from "@alexkroman1/aai/utils";
|
|
8
9
|
import { styleText } from "node:util";
|
|
@@ -39,6 +40,41 @@ async function promptProjectName(yes) {
|
|
|
39
40
|
defaultValue: DEFAULT_PROJECT_NAME
|
|
40
41
|
}), "Setup cancelled") || DEFAULT_PROJECT_NAME;
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The template a non-interactive `init` gets, and the entry the selector opens
|
|
45
|
+
* on — so an author who just presses Enter lands where they used to.
|
|
46
|
+
*/
|
|
47
|
+
const DEFAULT_TEMPLATE = "simple";
|
|
48
|
+
/**
|
|
49
|
+
* Ask which template to scaffold, listing what this CLI actually ships.
|
|
50
|
+
*
|
|
51
|
+
* The options are derived from {@link listTemplates} rather than a roster kept
|
|
52
|
+
* here: that function already backs `aai templates` AND the unknown-template
|
|
53
|
+
* error, so a template added to the package shows up in the picker with no
|
|
54
|
+
* second list to update. {@link DEFAULT_TEMPLATE} is hoisted to the top and
|
|
55
|
+
* pre-selected, which is what keeps a bare `aai init` a single Enter away from
|
|
56
|
+
* the project it produced before there was a picker.
|
|
57
|
+
*
|
|
58
|
+
* Callers must not reach here when there is nobody to answer — `--yes` and
|
|
59
|
+
* JSON mode (auto-detected on a pipe) resolve the default without prompting.
|
|
60
|
+
*/
|
|
61
|
+
async function promptTemplate(list = listTemplates) {
|
|
62
|
+
const [first, ...rest] = await list();
|
|
63
|
+
if (first === void 0) return DEFAULT_TEMPLATE;
|
|
64
|
+
if (rest.length === 0) return first;
|
|
65
|
+
const names = [first, ...rest];
|
|
66
|
+
const hasDefault = names.includes(DEFAULT_TEMPLATE);
|
|
67
|
+
const ordered = hasDefault ? [DEFAULT_TEMPLATE, ...names.filter((name) => name !== DEFAULT_TEMPLATE)] : names;
|
|
68
|
+
return unwrapCancel(await p.select({
|
|
69
|
+
message: "Which template?",
|
|
70
|
+
maxItems: 12,
|
|
71
|
+
initialValue: hasDefault ? DEFAULT_TEMPLATE : first,
|
|
72
|
+
options: ordered.map((name) => name === DEFAULT_TEMPLATE ? {
|
|
73
|
+
value: name,
|
|
74
|
+
hint: "the default starting point"
|
|
75
|
+
} : { value: name })
|
|
76
|
+
}), "Setup cancelled");
|
|
77
|
+
}
|
|
42
78
|
/** Best-effort corepack enable so pnpm is available (scaffold declares packageManager: pnpm). */
|
|
43
79
|
async function ensurePnpm() {
|
|
44
80
|
await execa("corepack", ["enable"], { reject: false });
|
|
@@ -106,7 +142,7 @@ function collectWarnings() {
|
|
|
106
142
|
}
|
|
107
143
|
/** Publish after init and return deploy metadata if successful. */
|
|
108
144
|
async function tryPublish(cwd, server, warn) {
|
|
109
|
-
const { executePublish } = await import("./studio-
|
|
145
|
+
const { executePublish } = await import("./studio-C_zuRC_z.mjs");
|
|
110
146
|
try {
|
|
111
147
|
const result = await executePublish({
|
|
112
148
|
cwd,
|
|
@@ -127,7 +163,7 @@ async function tryPublish(cwd, server, warn) {
|
|
|
127
163
|
}
|
|
128
164
|
/** Scaffold the project, optionally showing a spinner. */
|
|
129
165
|
async function scaffoldProject(dir, cwd, template, silent) {
|
|
130
|
-
const { runInit } = await import("./_init-
|
|
166
|
+
const { runInit } = await import("./_init-Bsi3DZNJ.mjs");
|
|
131
167
|
await withSpinner(silent, {
|
|
132
168
|
start: `Creating ${dir}`,
|
|
133
169
|
done: "Project created",
|
|
@@ -150,30 +186,22 @@ async function executeInit(opts, extra) {
|
|
|
150
186
|
const monorepoRoot = getMonorepoRoot();
|
|
151
187
|
const cwd = resolveTargetDir(dir);
|
|
152
188
|
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.`);
|
|
153
|
-
const template = opts.template ??
|
|
189
|
+
const template = opts.template ?? (opts.yes || suppressUi ? DEFAULT_TEMPLATE : await promptTemplate());
|
|
154
190
|
const { warn, warnings } = collectWarnings();
|
|
155
191
|
await scaffoldProject(dir, cwd, template, suppressUi);
|
|
156
192
|
const installed = await installDeps(cwd, warn, suppressUi);
|
|
157
|
-
let deployed = false;
|
|
158
|
-
let slug;
|
|
159
|
-
let url;
|
|
160
193
|
if (!installed) warn("Skipping publish because dependencies were not installed.");
|
|
161
|
-
|
|
162
|
-
const published = await tryPublish(cwd, opts.server, warn);
|
|
163
|
-
if (published) {
|
|
164
|
-
deployed = true;
|
|
165
|
-
slug = published.slug;
|
|
166
|
-
url = published.url;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
194
|
+
const published = installed && !opts.skipDeploy ? await tryPublish(cwd, opts.server, warn) : null;
|
|
169
195
|
if (!suppressUi) printPostInitInfo(cwd, monorepoRoot);
|
|
170
196
|
const data = {
|
|
171
197
|
dir: cwd,
|
|
172
198
|
template,
|
|
173
|
-
deployed
|
|
199
|
+
deployed: published !== null
|
|
174
200
|
};
|
|
175
|
-
if (
|
|
176
|
-
|
|
201
|
+
if (published) {
|
|
202
|
+
data.slug = published.slug;
|
|
203
|
+
data.url = published.url;
|
|
204
|
+
}
|
|
177
205
|
if (warnings.length > 0) data.warnings = warnings;
|
|
178
206
|
return ok(data);
|
|
179
207
|
}
|
package/dist/init.d.ts
CHANGED
|
@@ -17,6 +17,20 @@ type InitData = {
|
|
|
17
17
|
*/
|
|
18
18
|
warnings?: string[];
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Ask which template to scaffold, listing what this CLI actually ships.
|
|
22
|
+
*
|
|
23
|
+
* The options are derived from {@link listTemplates} rather than a roster kept
|
|
24
|
+
* here: that function already backs `aai templates` AND the unknown-template
|
|
25
|
+
* error, so a template added to the package shows up in the picker with no
|
|
26
|
+
* second list to update. {@link DEFAULT_TEMPLATE} is hoisted to the top and
|
|
27
|
+
* pre-selected, which is what keeps a bare `aai init` a single Enter away from
|
|
28
|
+
* the project it produced before there was a picker.
|
|
29
|
+
*
|
|
30
|
+
* Callers must not reach here when there is nobody to answer — `--yes` and
|
|
31
|
+
* JSON mode (auto-detected on a pipe) resolve the default without prompting.
|
|
32
|
+
*/
|
|
33
|
+
export declare function promptTemplate(list?: () => Promise<string[]>): Promise<string>;
|
|
20
34
|
/** Build the command + args for running pnpm, routing through safe-chain when available. */
|
|
21
35
|
export declare function resolvePnpmCommand(checkSafeChain?: () => Promise<boolean>): Promise<{
|
|
22
36
|
cmd: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ok, t as CliError } from "./_output-
|
|
2
|
+
import { a as ok, t as CliError } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { n as log } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import { o as updateGlobalConfig
|
|
5
|
-
import {
|
|
4
|
+
import { o as updateGlobalConfig } from "./_config-DYzC6WMD.mjs";
|
|
5
|
+
import { a as resolveApprovedServer } from "./_agent-BzUeqOdj.mjs";
|
|
6
6
|
import { linkConfirmationCode, sleep } from "@alexkroman1/aai/internal";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
8
|
import { randomBytes } from "node:crypto";
|
|
@@ -133,9 +133,7 @@ function defaultOpenBrowser(url) {
|
|
|
133
133
|
async function executeLogin(opts, deps = {}) {
|
|
134
134
|
const fetchFn = deps.fetchFn ?? globalThis.fetch;
|
|
135
135
|
requireTty();
|
|
136
|
-
const
|
|
137
|
-
const serverUrl = resolveServerUrl(opts.server, void 0, globalConfig.approvedServers ?? []);
|
|
138
|
-
if (opts.server) await approveServer(serverUrl);
|
|
136
|
+
const { serverUrl } = await resolveApprovedServer(null, opts.server);
|
|
139
137
|
if ((await jsonBody(await reachable(fetchFn, `${serverUrl}/studio/auth`, serverUrl), "Reading the server's login configuration")).mode === "none") throw new CliError("login_unavailable", "This server has no browser login configured, so there is no account to link.", "Point `--server` at a platform with browser login configured — linking an account there is the only way to authenticate.");
|
|
140
138
|
const code = randomBytes(32).toString("base64url");
|
|
141
139
|
const linkUrl = `${serverUrl}/?cli-link=${code}`;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ok } from "./_output-
|
|
2
|
+
import { a as ok } from "./_output-DBP9Op_d.mjs";
|
|
3
3
|
import { n as log } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { n as getServerInfo } from "./_agent-BzUeqOdj.mjs";
|
|
5
|
+
import { f as checkedResponse } from "./_studio-DnR_BqFp.mjs";
|
|
6
|
+
import { n as slugRequestOn } from "./_slug-api-CGvc2YSQ.mjs";
|
|
6
7
|
import { isRecord, omitUndefined } from "@alexkroman1/aai/utils";
|
|
7
8
|
import { sleep } from "@alexkroman1/aai/internal";
|
|
8
9
|
function isLogsPage(value) {
|
|
@@ -19,12 +20,16 @@ function formatLine(line) {
|
|
|
19
20
|
const mark = line.stream === "stderr" ? " ERR" : "";
|
|
20
21
|
return `${formatTime(line.at)}${mark} ${line.text}`;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
/**
|
|
24
|
+
* One page, against a target resolved ONCE by the caller.
|
|
25
|
+
*
|
|
26
|
+
* `slugRequestOn` rather than `slugRequest`: under `--follow` this runs every
|
|
27
|
+
* second for the life of the command, and the target is immutable — see that
|
|
28
|
+
* function's doc for what re-resolving it cost.
|
|
29
|
+
*/
|
|
30
|
+
async function readPage(target, after) {
|
|
31
|
+
const data = await slugRequestOn(target, `/logs?after=${after}`, { action: "logs" });
|
|
32
|
+
return checkedResponse(data, isLogsPage, `the logs route for ${target.slug}`);
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
35
|
* Print the agent's buffered output, once or continuously.
|
|
@@ -34,7 +39,9 @@ async function readPage(cwd, after, server) {
|
|
|
34
39
|
* into a result object would duplicate what it just printed.
|
|
35
40
|
*/
|
|
36
41
|
async function executeLogs(cwd, opts = {}) {
|
|
37
|
-
const
|
|
42
|
+
const target = await getServerInfo(cwd, opts.server);
|
|
43
|
+
const { slug } = target;
|
|
44
|
+
const page = await readPage(target, -1);
|
|
38
45
|
let cursor = page.cursor;
|
|
39
46
|
let printed = printPage(page);
|
|
40
47
|
if (!opts.follow) {
|
|
@@ -52,11 +59,11 @@ async function executeLogs(cwd, opts = {}) {
|
|
|
52
59
|
while (!opts.signal?.aborted) {
|
|
53
60
|
await sleep(pollMs, omitUndefined({ signal: opts.signal }));
|
|
54
61
|
if (opts.signal?.aborted) break;
|
|
55
|
-
const next = await readPage(
|
|
62
|
+
const next = await readPage(target, cursor).catch(() => void 0);
|
|
56
63
|
if (!next) continue;
|
|
57
|
-
cursor = next.
|
|
58
|
-
running = next.
|
|
59
|
-
printed += printPage(next
|
|
64
|
+
cursor = next.cursor;
|
|
65
|
+
running = next.running;
|
|
66
|
+
printed += printPage(next);
|
|
60
67
|
}
|
|
61
68
|
return ok({
|
|
62
69
|
slug,
|
package/dist/project-config.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as writeGlobalConfig, s as updateProjectConfig } from "./_config-
|
|
2
|
+
import { c as writeGlobalConfig, s as updateProjectConfig } from "./_config-DYzC6WMD.mjs";
|
|
3
3
|
export { updateProjectConfig, writeGlobalConfig as writeConfigHome };
|