@agentuity/cli 3.0.0-alpha.6 → 3.0.0-alpha.7
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/build-report.d.ts +1 -1
- package/dist/build-report.d.ts.map +1 -1
- package/dist/build-report.js +0 -1
- package/dist/build-report.js.map +1 -1
- package/dist/cmd/cloud/deploy.d.ts.map +1 -1
- package/dist/cmd/cloud/deploy.js +101 -46
- package/dist/cmd/cloud/deploy.js.map +1 -1
- package/dist/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/index.js +0 -4
- package/dist/cmd/cloud/index.js.map +1 -1
- package/dist/cmd/cloud/sandbox/exec.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/exec.js +41 -24
- package/dist/cmd/cloud/sandbox/exec.js.map +1 -1
- package/dist/cmd/cloud/sandbox/job/logs.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/job/logs.js +1 -0
- package/dist/cmd/cloud/sandbox/job/logs.js.map +1 -1
- package/dist/cmd/cloud/sandbox/run.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/run.js +34 -5
- package/dist/cmd/cloud/sandbox/run.js.map +1 -1
- package/dist/cmd/cloud/sandbox/util.d.ts +9 -0
- package/dist/cmd/cloud/sandbox/util.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/util.js +20 -1
- package/dist/cmd/cloud/sandbox/util.js.map +1 -1
- package/dist/cmd/cloud/session/get.d.ts.map +1 -1
- package/dist/cmd/cloud/session/get.js +1 -41
- package/dist/cmd/cloud/session/get.js.map +1 -1
- package/dist/cmd/coder/start.d.ts.map +1 -1
- package/dist/cmd/coder/start.js +2 -0
- package/dist/cmd/coder/start.js.map +1 -1
- package/dist/cmd/coder/tui-init.js +1 -1
- package/dist/cmd/coder/tui-init.js.map +1 -1
- package/dist/cmd/project/create.d.ts.map +1 -1
- package/dist/cmd/project/create.js +0 -2
- package/dist/cmd/project/create.js.map +1 -1
- package/dist/cmd/project/frameworks.d.ts.map +1 -1
- package/dist/cmd/project/frameworks.js +1 -0
- package/dist/cmd/project/frameworks.js.map +1 -1
- package/dist/cmd/project/index.d.ts.map +1 -1
- package/dist/cmd/project/index.js +0 -3
- package/dist/cmd/project/index.js.map +1 -1
- package/dist/cmd/project/template-flow.d.ts +0 -1
- package/dist/cmd/project/template-flow.d.ts.map +1 -1
- package/dist/cmd/project/template-flow.js +1 -104
- package/dist/cmd/project/template-flow.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/onboarding/agentPrompt.d.ts.map +1 -1
- package/dist/onboarding/agentPrompt.js +5 -8
- package/dist/onboarding/agentPrompt.js.map +1 -1
- package/dist/types.d.ts +0 -167
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -20
- package/src/build-report.ts +0 -1
- package/src/cmd/ai/prompt/web.md +43 -17
- package/src/cmd/cloud/deploy.ts +120 -56
- package/src/cmd/cloud/index.ts +0 -4
- package/src/cmd/cloud/sandbox/exec.ts +49 -23
- package/src/cmd/cloud/sandbox/job/logs.ts +1 -0
- package/src/cmd/cloud/sandbox/run.ts +47 -9
- package/src/cmd/cloud/sandbox/util.ts +20 -1
- package/src/cmd/cloud/session/get.ts +1 -51
- package/src/cmd/coder/start.ts +2 -0
- package/src/cmd/coder/tui-init.ts +1 -1
- package/src/cmd/project/create.ts +0 -2
- package/src/cmd/project/frameworks.ts +1 -0
- package/src/cmd/project/index.ts +0 -3
- package/src/cmd/project/template-flow.ts +0 -127
- package/src/cmd/project/templates/vite-react/vite.config.ts +8 -0
- package/src/index.ts +0 -4
- package/src/onboarding/agentPrompt.ts +5 -8
- package/src/runtime-bootstrap.md +2 -3
- package/src/types.ts +0 -186
- package/dist/cmd/build/app-config-extractor.d.ts +0 -27
- package/dist/cmd/build/app-config-extractor.d.ts.map +0 -1
- package/dist/cmd/build/app-config-extractor.js +0 -152
- package/dist/cmd/build/app-config-extractor.js.map +0 -1
- package/dist/cmd/cloud/eval/get.d.ts +0 -2
- package/dist/cmd/cloud/eval/get.d.ts.map +0 -1
- package/dist/cmd/cloud/eval/get.js +0 -80
- package/dist/cmd/cloud/eval/get.js.map +0 -1
- package/dist/cmd/cloud/eval/index.d.ts +0 -2
- package/dist/cmd/cloud/eval/index.d.ts.map +0 -1
- package/dist/cmd/cloud/eval/index.js +0 -16
- package/dist/cmd/cloud/eval/index.js.map +0 -1
- package/dist/cmd/cloud/eval/list.d.ts +0 -2
- package/dist/cmd/cloud/eval/list.d.ts.map +0 -1
- package/dist/cmd/cloud/eval/list.js +0 -124
- package/dist/cmd/cloud/eval/list.js.map +0 -1
- package/dist/cmd/cloud/eval-run/get.d.ts +0 -2
- package/dist/cmd/cloud/eval-run/get.d.ts.map +0 -1
- package/dist/cmd/cloud/eval-run/get.js +0 -107
- package/dist/cmd/cloud/eval-run/get.js.map +0 -1
- package/dist/cmd/cloud/eval-run/index.d.ts +0 -2
- package/dist/cmd/cloud/eval-run/index.d.ts.map +0 -1
- package/dist/cmd/cloud/eval-run/index.js +0 -16
- package/dist/cmd/cloud/eval-run/index.js.map +0 -1
- package/dist/cmd/cloud/eval-run/list.d.ts +0 -2
- package/dist/cmd/cloud/eval-run/list.d.ts.map +0 -1
- package/dist/cmd/cloud/eval-run/list.js +0 -149
- package/dist/cmd/cloud/eval-run/list.js.map +0 -1
- package/dist/cmd/project/auth/generate.d.ts +0 -5
- package/dist/cmd/project/auth/generate.d.ts.map +0 -1
- package/dist/cmd/project/auth/generate.js +0 -102
- package/dist/cmd/project/auth/generate.js.map +0 -1
- package/dist/cmd/project/auth/index.d.ts +0 -2
- package/dist/cmd/project/auth/index.d.ts.map +0 -1
- package/dist/cmd/project/auth/index.js +0 -21
- package/dist/cmd/project/auth/index.js.map +0 -1
- package/dist/cmd/project/auth/init.d.ts +0 -2
- package/dist/cmd/project/auth/init.d.ts.map +0 -1
- package/dist/cmd/project/auth/init.js +0 -213
- package/dist/cmd/project/auth/init.js.map +0 -1
- package/dist/cmd/project/auth/shared.d.ts +0 -93
- package/dist/cmd/project/auth/shared.d.ts.map +0 -1
- package/dist/cmd/project/auth/shared.js +0 -451
- package/dist/cmd/project/auth/shared.js.map +0 -1
- package/dist/utils/bun-version-checker.d.ts +0 -11
- package/dist/utils/bun-version-checker.d.ts.map +0 -1
- package/dist/utils/bun-version-checker.js +0 -56
- package/dist/utils/bun-version-checker.js.map +0 -1
- package/dist/utils/dependency-checker.d.ts +0 -20
- package/dist/utils/dependency-checker.d.ts.map +0 -1
- package/dist/utils/dependency-checker.js +0 -160
- package/dist/utils/dependency-checker.js.map +0 -1
- package/dist/utils/detectSubagent.d.ts +0 -15
- package/dist/utils/detectSubagent.d.ts.map +0 -1
- package/dist/utils/detectSubagent.js +0 -28
- package/dist/utils/detectSubagent.js.map +0 -1
- package/dist/utils/stream-capture.d.ts +0 -9
- package/dist/utils/stream-capture.d.ts.map +0 -1
- package/dist/utils/stream-capture.js +0 -34
- package/dist/utils/stream-capture.js.map +0 -1
- package/dist/utils/string.d.ts +0 -6
- package/dist/utils/string.d.ts.map +0 -1
- package/dist/utils/string.js +0 -6
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/version-mismatch.d.ts +0 -39
- package/dist/utils/version-mismatch.d.ts.map +0 -1
- package/dist/utils/version-mismatch.js +0 -161
- package/dist/utils/version-mismatch.js.map +0 -1
- package/dist/utils/workbench-notify.d.ts +0 -29
- package/dist/utils/workbench-notify.d.ts.map +0 -1
- package/dist/utils/workbench-notify.js +0 -56
- package/dist/utils/workbench-notify.js.map +0 -1
- package/src/cmd/build/app-config-extractor.ts +0 -186
- package/src/cmd/cloud/eval/get.ts +0 -86
- package/src/cmd/cloud/eval/index.ts +0 -16
- package/src/cmd/cloud/eval/list.ts +0 -135
- package/src/cmd/cloud/eval-run/get.ts +0 -114
- package/src/cmd/cloud/eval-run/index.ts +0 -16
- package/src/cmd/cloud/eval-run/list.ts +0 -160
- package/src/cmd/project/auth/generate.ts +0 -116
- package/src/cmd/project/auth/index.ts +0 -21
- package/src/cmd/project/auth/init.ts +0 -256
- package/src/cmd/project/auth/shared.ts +0 -566
- package/src/utils/bun-version-checker.ts +0 -70
- package/src/utils/dependency-checker.ts +0 -205
- package/src/utils/detectSubagent.ts +0 -36
- package/src/utils/stream-capture.ts +0 -39
- package/src/utils/string.ts +0 -6
- package/src/utils/version-mismatch.ts +0 -204
- package/src/utils/workbench-notify.ts +0 -67
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { Writable } from 'node:stream';
|
|
3
3
|
import { createCommand } from '../../../types';
|
|
4
4
|
import * as tui from '../../../tui';
|
|
5
|
-
import { createSandboxClient, parseFileArgs, cacheSandboxRegion } from './util';
|
|
5
|
+
import { createSandboxClient, parseFileArgs, cacheSandboxRegion, detectNullStream } from './util';
|
|
6
6
|
import { getCommand } from '../../../command-prefix';
|
|
7
7
|
import { sandboxRun } from '@agentuity/server';
|
|
8
8
|
import { validateAptDependencies } from '../../../utils/apt-validator';
|
|
@@ -59,6 +59,11 @@ export const runSubcommand = createCommand({
|
|
|
59
59
|
.default(false)
|
|
60
60
|
.optional()
|
|
61
61
|
.describe('Include timestamps in output (default: true)'),
|
|
62
|
+
quiet: z
|
|
63
|
+
.boolean()
|
|
64
|
+
.default(false)
|
|
65
|
+
.optional()
|
|
66
|
+
.describe('Suppress output (do not create stdout/stderr streams)'),
|
|
62
67
|
snapshot: z.string().optional().describe('Snapshot ID or tag to restore from'),
|
|
63
68
|
dependency: z
|
|
64
69
|
.array(z.string())
|
|
@@ -149,13 +154,46 @@ export const runSubcommand = createCommand({
|
|
|
149
154
|
// Determine if we have stdin data (not a TTY means piped input)
|
|
150
155
|
const hasStdin = !process.stdin.isTTY;
|
|
151
156
|
|
|
152
|
-
//
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
// Detect if stdout/stderr are redirected to /dev/null
|
|
158
|
+
const stdoutIsNull = detectNullStream(1);
|
|
159
|
+
const stderrIsNull = detectNullStream(2);
|
|
160
|
+
|
|
161
|
+
// Detect stream configuration based on TTY status and flags
|
|
162
|
+
const streamConfig: {
|
|
163
|
+
timestamps?: boolean;
|
|
164
|
+
stdin?: string;
|
|
165
|
+
stdout?: string;
|
|
166
|
+
stderr?: string;
|
|
167
|
+
} = {
|
|
168
|
+
timestamps: opts.timestamps,
|
|
169
|
+
// Skip stdin stream when no stdin data available
|
|
170
|
+
stdin: hasStdin ? undefined : 'ignore',
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// --quiet: suppress all output streams (no server streams, no local capture)
|
|
174
|
+
if (opts.quiet) {
|
|
175
|
+
streamConfig.stdout = 'ignore';
|
|
176
|
+
streamConfig.stderr = 'ignore';
|
|
177
|
+
} else if (!options.json) {
|
|
178
|
+
// Auto-detect /dev/null redirection (only when not in JSON mode)
|
|
179
|
+
// In JSON mode we need output for the response, so keep streams even if redirected
|
|
180
|
+
if (stdoutIsNull) {
|
|
181
|
+
streamConfig.stdout = 'ignore';
|
|
182
|
+
}
|
|
183
|
+
if (stderrIsNull) {
|
|
184
|
+
streamConfig.stderr = 'ignore';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// For JSON output or quiet mode, we need to capture output instead of streaming to process
|
|
189
|
+
const stdout =
|
|
190
|
+
options.json || opts.quiet || stdoutIsNull
|
|
191
|
+
? createCaptureStream((chunk) => outputChunks.push(chunk))
|
|
192
|
+
: process.stdout;
|
|
193
|
+
const stderr =
|
|
194
|
+
options.json || opts.quiet || stderrIsNull
|
|
195
|
+
? createCaptureStream((chunk) => outputChunks.push(chunk))
|
|
196
|
+
: process.stderr;
|
|
159
197
|
|
|
160
198
|
try {
|
|
161
199
|
const result = await sandboxRun(client, {
|
|
@@ -180,7 +218,7 @@ export const runSubcommand = createCommand({
|
|
|
180
218
|
network: opts.network ? { enabled: true } : undefined,
|
|
181
219
|
timeout: opts.timeout ? { execution: opts.timeout } : undefined,
|
|
182
220
|
env: Object.keys(envMap).length > 0 ? envMap : undefined,
|
|
183
|
-
stream:
|
|
221
|
+
stream: streamConfig,
|
|
184
222
|
snapshot: opts.snapshot,
|
|
185
223
|
dependencies: opts.dependency,
|
|
186
224
|
scopes: opts.scope,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
1
|
+
import { fstatSync, readFileSync, statSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import type { FileToWrite, Logger } from '@agentuity/core';
|
|
4
4
|
import { APIClient, getServiceUrls, sandboxGet } from '@agentuity/server';
|
|
@@ -8,6 +8,25 @@ import { ErrorCode } from '../../../errors';
|
|
|
8
8
|
import * as tui from '../../../tui';
|
|
9
9
|
import type { AuthData, Config } from '../../../types';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Detect if a file descriptor is redirected to /dev/null (or NUL on Windows).
|
|
13
|
+
* Used to optimize stream creation - when output goes to /dev/null, we can
|
|
14
|
+
* skip creating the stream entirely on the server.
|
|
15
|
+
*
|
|
16
|
+
* @param fd - File descriptor (1 for stdout, 2 for stderr)
|
|
17
|
+
* @returns true if the fd points to /dev/null
|
|
18
|
+
*/
|
|
19
|
+
export function detectNullStream(fd: number): boolean {
|
|
20
|
+
try {
|
|
21
|
+
const fdStat = fstatSync(fd);
|
|
22
|
+
const nullPath = process.platform === 'win32' ? 'NUL' : '/dev/null';
|
|
23
|
+
const nullStat = statSync(nullPath);
|
|
24
|
+
return fdStat.dev === nullStat.dev && fdStat.ino === nullStat.ino;
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
11
30
|
export function createSandboxClient(logger: Logger, auth: AuthData, region: string): APIClient {
|
|
12
31
|
return new APIClient(getServiceUrls(region).catalyst, logger, auth.apiKey);
|
|
13
32
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type AgentInfo,
|
|
3
|
-
APIError,
|
|
4
|
-
type EvalRun,
|
|
5
|
-
type SpanNode,
|
|
6
|
-
sessionGet,
|
|
7
|
-
} from '@agentuity/server';
|
|
1
|
+
import { type AgentInfo, APIError, type SpanNode, sessionGet } from '@agentuity/server';
|
|
8
2
|
import { z } from 'zod';
|
|
9
3
|
import { getCommand } from '../../../command-prefix';
|
|
10
4
|
import { getGlobalCatalystAPIClient } from '../../../config';
|
|
@@ -58,19 +52,6 @@ const SessionGetResponseSchema = z.object({
|
|
|
58
52
|
})
|
|
59
53
|
)
|
|
60
54
|
.describe('Agents'),
|
|
61
|
-
eval_runs: z
|
|
62
|
-
.array(
|
|
63
|
-
z.object({
|
|
64
|
-
id: z.string(),
|
|
65
|
-
created_at: z.string(),
|
|
66
|
-
eval_id: z.string(),
|
|
67
|
-
pending: z.boolean(),
|
|
68
|
-
success: z.boolean(),
|
|
69
|
-
error: z.string().nullable(),
|
|
70
|
-
result: z.record(z.string(), z.unknown()).nullable(),
|
|
71
|
-
})
|
|
72
|
-
)
|
|
73
|
-
.describe('Eval runs'),
|
|
74
55
|
timeline: SpanNodeSchema.nullable().optional().describe('Session timeline'),
|
|
75
56
|
route: RouteInfoSchema.optional().describe('Route information'),
|
|
76
57
|
});
|
|
@@ -160,15 +141,6 @@ export const getSubcommand = createSubcommand({
|
|
|
160
141
|
route_id: session.route_id ?? null,
|
|
161
142
|
thread_id: session.thread_id ?? null,
|
|
162
143
|
agents: enriched.agents,
|
|
163
|
-
eval_runs: enriched.evalRuns.map((run: EvalRun) => ({
|
|
164
|
-
id: run.id,
|
|
165
|
-
eval_id: run.eval_id,
|
|
166
|
-
created_at: run.created_at,
|
|
167
|
-
pending: run.pending,
|
|
168
|
-
success: run.success,
|
|
169
|
-
error: run.error,
|
|
170
|
-
result: run.result,
|
|
171
|
-
})),
|
|
172
144
|
timeline: enriched.timeline,
|
|
173
145
|
route: enriched.route,
|
|
174
146
|
};
|
|
@@ -217,28 +189,6 @@ export const getSubcommand = createSubcommand({
|
|
|
217
189
|
|
|
218
190
|
tui.table([tableData], Object.keys(tableData), { layout: 'vertical', padStart: ' ' });
|
|
219
191
|
|
|
220
|
-
if (enriched.evalRuns.length > 0) {
|
|
221
|
-
console.log('');
|
|
222
|
-
console.log(tui.bold('Eval Runs:'));
|
|
223
|
-
const evalTableData = enriched.evalRuns.map((run: EvalRun) => ({
|
|
224
|
-
ID: run.id,
|
|
225
|
-
'Eval ID': run.eval_id,
|
|
226
|
-
Success: run.success ? tui.colorSuccess('✓') : tui.colorError('✗'),
|
|
227
|
-
Pending: run.pending ? '⏳' : '✓',
|
|
228
|
-
Error: run.error || 'No',
|
|
229
|
-
Created: new Date(run.created_at).toLocaleString(),
|
|
230
|
-
}));
|
|
231
|
-
|
|
232
|
-
tui.table(evalTableData, [
|
|
233
|
-
{ name: 'ID', alignment: 'left' },
|
|
234
|
-
{ name: 'Eval ID', alignment: 'left' },
|
|
235
|
-
{ name: 'Success', alignment: 'center' },
|
|
236
|
-
{ name: 'Pending', alignment: 'center' },
|
|
237
|
-
{ name: 'Error', alignment: 'left' },
|
|
238
|
-
{ name: 'Created', alignment: 'left' },
|
|
239
|
-
]);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
192
|
if (result.timeline) {
|
|
243
193
|
console.log('');
|
|
244
194
|
console.log(tui.bold('Timeline:'));
|
package/src/cmd/coder/start.ts
CHANGED
|
@@ -128,6 +128,8 @@ export const startSubcommand = createSubcommand({
|
|
|
128
128
|
},
|
|
129
129
|
async handler(ctx) {
|
|
130
130
|
const { opts, options } = ctx;
|
|
131
|
+
// Keep Pi's interactive install telemetry disabled for Agentuity CLI sessions.
|
|
132
|
+
process.env.PI_TELEMETRY = '0';
|
|
131
133
|
|
|
132
134
|
// Resolve working directory from optional --dir option
|
|
133
135
|
let cwd = process.cwd();
|
|
@@ -77,7 +77,6 @@ export const createProjectSubcommand = createSubcommand({
|
|
|
77
77
|
.string()
|
|
78
78
|
.optional()
|
|
79
79
|
.describe('Storage action: "skip", "new", or existing bucket name'),
|
|
80
|
-
enableAuth: z.boolean().optional().describe('Enable Agentuity Auth'),
|
|
81
80
|
}),
|
|
82
81
|
response: ProjectCreateResponseSchema,
|
|
83
82
|
},
|
|
@@ -110,7 +109,6 @@ export const createProjectSubcommand = createSubcommand({
|
|
|
110
109
|
region,
|
|
111
110
|
database: opts.database,
|
|
112
111
|
storage: opts.storage,
|
|
113
|
-
enableAuth: opts.enableAuth,
|
|
114
112
|
});
|
|
115
113
|
|
|
116
114
|
// Exit with error code if setup failed and not in JSON mode
|
|
@@ -203,6 +203,7 @@ export const frameworkCatalog: FrameworkScaffold[] = [
|
|
|
203
203
|
description: 'React SPA with Vite bundler',
|
|
204
204
|
createCommand: (dir) => ['bunx', 'create-vite@latest', dir, '--template', 'react-ts'],
|
|
205
205
|
dependencies: ['ai', '@ai-sdk/openai', '@tanstack/react-query'],
|
|
206
|
+
devDependencies: ['tailwindcss', '@tailwindcss/vite'],
|
|
206
207
|
scripts: {
|
|
207
208
|
deploy: 'agentuity deploy',
|
|
208
209
|
},
|
package/src/cmd/project/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { importSubcommand } from './import';
|
|
|
4
4
|
import { listSubcommand } from './list';
|
|
5
5
|
import { deleteSubcommand } from './delete';
|
|
6
6
|
import { showSubcommand } from './show';
|
|
7
|
-
import { authCommand } from './auth';
|
|
8
7
|
import { addCommand } from './add';
|
|
9
8
|
import { hostnameCommand } from './hostname';
|
|
10
9
|
import { domainCommand } from './domain';
|
|
@@ -18,7 +17,6 @@ export const command = createCommand({
|
|
|
18
17
|
{ command: getCommand('project create my-agent'), description: 'Create a new project' },
|
|
19
18
|
{ command: getCommand('project import'), description: 'Import an existing project' },
|
|
20
19
|
{ command: getCommand('project list'), description: 'List all projects' },
|
|
21
|
-
{ command: getCommand('project auth init'), description: 'Set up Agentuity Auth' },
|
|
22
20
|
{ command: getCommand('project add database'), description: 'Link an existing database' },
|
|
23
21
|
{
|
|
24
22
|
command: getCommand('project add storage'),
|
|
@@ -39,7 +37,6 @@ export const command = createCommand({
|
|
|
39
37
|
listSubcommand,
|
|
40
38
|
deleteSubcommand,
|
|
41
39
|
showSubcommand,
|
|
42
|
-
authCommand,
|
|
43
40
|
addCommand,
|
|
44
41
|
hostnameCommand,
|
|
45
42
|
domainCommand,
|
|
@@ -38,13 +38,6 @@ import * as tui from '../../tui';
|
|
|
38
38
|
import { createPrompt, note } from '../../tui';
|
|
39
39
|
import type { AuthData, Config } from '../../types';
|
|
40
40
|
import { getGithubBotIdentity } from '../git/api';
|
|
41
|
-
import {
|
|
42
|
-
ensureAuthDependencies,
|
|
43
|
-
generateAuthFileContent,
|
|
44
|
-
generateAuthSchemaSql,
|
|
45
|
-
printIntegrationExamples,
|
|
46
|
-
runAuthMigrations,
|
|
47
|
-
} from './auth/shared';
|
|
48
41
|
import { scaffoldFramework, setupProject, initGitRepo } from './scaffold';
|
|
49
42
|
import { frameworkCatalog, type FrameworkScaffold } from './frameworks';
|
|
50
43
|
|
|
@@ -64,7 +57,6 @@ interface CreateFlowOptions {
|
|
|
64
57
|
apiClient?: APIClient;
|
|
65
58
|
database?: string;
|
|
66
59
|
storage?: string;
|
|
67
|
-
enableAuth?: boolean;
|
|
68
60
|
}
|
|
69
61
|
|
|
70
62
|
export interface CreateFlowResult {
|
|
@@ -95,7 +87,6 @@ export async function runCreateFlow(options: CreateFlowOptions): Promise<CreateF
|
|
|
95
87
|
domains,
|
|
96
88
|
database: databaseOption,
|
|
97
89
|
storage: storageOption,
|
|
98
|
-
enableAuth: enableAuthOption,
|
|
99
90
|
} = options;
|
|
100
91
|
|
|
101
92
|
const isHeadless = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -306,14 +297,6 @@ export async function runCreateFlow(options: CreateFlowOptions): Promise<CreateF
|
|
|
306
297
|
);
|
|
307
298
|
}
|
|
308
299
|
|
|
309
|
-
if (enableAuthOption && !canProvision) {
|
|
310
|
-
logger.fatal(
|
|
311
|
-
'Cannot enable Agentuity Auth without being authenticated and registering the project.\n' +
|
|
312
|
-
'Remove --no-register or omit --enable-auth flag.',
|
|
313
|
-
ErrorCode.VALIDATION_FAILED
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
300
|
if (canProvision) {
|
|
318
301
|
let resources: Awaited<ReturnType<typeof listResources>> | undefined;
|
|
319
302
|
|
|
@@ -527,94 +510,6 @@ export async function runCreateFlow(options: CreateFlowOptions): Promise<CreateF
|
|
|
527
510
|
}
|
|
528
511
|
}
|
|
529
512
|
|
|
530
|
-
// ─── Auth setup ─────────────────────────────────────────────────────────
|
|
531
|
-
|
|
532
|
-
let authEnabled = false;
|
|
533
|
-
let authDatabaseName: string | undefined;
|
|
534
|
-
let authDatabaseUrl: string | undefined;
|
|
535
|
-
|
|
536
|
-
if (enableAuthOption !== undefined) {
|
|
537
|
-
authEnabled = enableAuthOption;
|
|
538
|
-
} else if (canProvision && isInteractive) {
|
|
539
|
-
const enableAuth = await prompt.select({
|
|
540
|
-
message: 'Enable Agentuity Authentication?',
|
|
541
|
-
options: [
|
|
542
|
-
{ value: 'no', label: "No, I'll add auth later" },
|
|
543
|
-
{ value: 'yes', label: 'Yes, set up Agentuity Auth' },
|
|
544
|
-
],
|
|
545
|
-
});
|
|
546
|
-
|
|
547
|
-
if (enableAuth === 'yes') {
|
|
548
|
-
authEnabled = true;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
if (authEnabled && canProvision) {
|
|
553
|
-
if (resourceEnvVars.DATABASE_URL) {
|
|
554
|
-
authDatabaseUrl = resourceEnvVars.DATABASE_URL;
|
|
555
|
-
try {
|
|
556
|
-
const dbUrl = new URL(authDatabaseUrl);
|
|
557
|
-
const dbName = dbUrl.pathname.replace(/^\/+/, '');
|
|
558
|
-
if (dbName && /^[A-Za-z0-9_-]+$/.test(dbName)) {
|
|
559
|
-
authDatabaseName = dbName;
|
|
560
|
-
}
|
|
561
|
-
} catch {
|
|
562
|
-
// Invalid URL format
|
|
563
|
-
}
|
|
564
|
-
} else {
|
|
565
|
-
const created = await tui.spinner({
|
|
566
|
-
message: 'Provisioning database for auth',
|
|
567
|
-
clearOnSuccess: true,
|
|
568
|
-
callback: async () => {
|
|
569
|
-
return createResources(catalystClient!, orgId!, region!, [{ type: 'db' }]);
|
|
570
|
-
},
|
|
571
|
-
});
|
|
572
|
-
const createdDb = created[0];
|
|
573
|
-
if (!createdDb) {
|
|
574
|
-
logger.fatal('Failed to create database for auth', ErrorCode.RESOURCE_NOT_FOUND);
|
|
575
|
-
return undefined as never;
|
|
576
|
-
}
|
|
577
|
-
authDatabaseName = createdDb.name;
|
|
578
|
-
|
|
579
|
-
if (createdDb.env) {
|
|
580
|
-
authDatabaseUrl = createdDb.env.DATABASE_URL;
|
|
581
|
-
if (!resourceEnvVars.DATABASE_URL) {
|
|
582
|
-
Object.assign(resourceEnvVars, createdDb.env);
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
await ensureAuthDependencies({ projectDir: dest, logger });
|
|
588
|
-
|
|
589
|
-
const authFilePath = resolve(dest, 'src', 'auth.ts');
|
|
590
|
-
if (!existsSync(authFilePath)) {
|
|
591
|
-
const srcDir = resolve(dest, 'src');
|
|
592
|
-
if (!existsSync(srcDir)) {
|
|
593
|
-
await Bun.write(resolve(srcDir, '.gitkeep'), '');
|
|
594
|
-
}
|
|
595
|
-
await Bun.write(authFilePath, generateAuthFileContent());
|
|
596
|
-
tui.success('Created src/auth.ts');
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
if (authDatabaseName) {
|
|
600
|
-
const sql = await tui.spinner({
|
|
601
|
-
message: 'Preparing auth database schema...',
|
|
602
|
-
clearOnSuccess: true,
|
|
603
|
-
callback: () => generateAuthSchemaSql(logger, dest),
|
|
604
|
-
});
|
|
605
|
-
|
|
606
|
-
await runAuthMigrations({
|
|
607
|
-
logger,
|
|
608
|
-
auth,
|
|
609
|
-
orgId,
|
|
610
|
-
region,
|
|
611
|
-
databaseName: authDatabaseName,
|
|
612
|
-
sql,
|
|
613
|
-
config,
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
|
|
618
513
|
// ─── Cloud registration ─────────────────────────────────────────────────
|
|
619
514
|
|
|
620
515
|
let projectId: string | undefined;
|
|
@@ -658,27 +553,9 @@ export async function runCreateFlow(options: CreateFlowOptions): Promise<CreateF
|
|
|
658
553
|
},
|
|
659
554
|
});
|
|
660
555
|
|
|
661
|
-
// Add auth secret
|
|
662
|
-
if (authEnabled && !resourceEnvVars.AGENTUITY_AUTH_SECRET) {
|
|
663
|
-
const devSecret = `dev-${crypto.randomUUID()}`;
|
|
664
|
-
resourceEnvVars.AGENTUITY_AUTH_SECRET = devSecret;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
556
|
// Write resource env vars
|
|
668
557
|
if (Object.keys(resourceEnvVars).length > 0) {
|
|
669
558
|
await addResourceEnvVars(dest, resourceEnvVars);
|
|
670
|
-
|
|
671
|
-
if (authEnabled) {
|
|
672
|
-
if (resourceEnvVars.DATABASE_URL) {
|
|
673
|
-
tui.success('DATABASE_URL added to .env');
|
|
674
|
-
}
|
|
675
|
-
if (resourceEnvVars.AGENTUITY_AUTH_SECRET) {
|
|
676
|
-
tui.success('AGENTUITY_AUTH_SECRET added to .env');
|
|
677
|
-
tui.info(
|
|
678
|
-
`Generate one with: ${tui.muted('npx @better-auth/cli secret')} or ${tui.muted('openssl rand -hex 32')}`
|
|
679
|
-
);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
559
|
}
|
|
683
560
|
|
|
684
561
|
// Sync env vars to cloud
|
|
@@ -772,10 +649,6 @@ export async function runCreateFlow(options: CreateFlowOptions): Promise<CreateF
|
|
|
772
649
|
}
|
|
773
650
|
}
|
|
774
651
|
|
|
775
|
-
if (authEnabled) {
|
|
776
|
-
printIntegrationExamples();
|
|
777
|
-
}
|
|
778
|
-
|
|
779
652
|
return {
|
|
780
653
|
projectId,
|
|
781
654
|
orgId,
|
package/src/index.ts
CHANGED
|
@@ -122,10 +122,6 @@ export type {
|
|
|
122
122
|
AuthData,
|
|
123
123
|
CommandSchemas,
|
|
124
124
|
ResourceSelectionRule,
|
|
125
|
-
BuildPhase,
|
|
126
|
-
BuildContext,
|
|
127
|
-
AgentuityConfig,
|
|
128
|
-
WorkbenchConfig,
|
|
129
125
|
} from './types';
|
|
130
126
|
export { createSubcommand, createCommand } from './types';
|
|
131
127
|
export type { ColorScheme } from './terminal';
|
|
@@ -18,12 +18,12 @@ Agentuity is the full-stack platform for AI agents. Briefly explain to the user:
|
|
|
18
18
|
- **Full-stack agents**: Build agents, APIs, and front-end integrations with end-to-end type safety
|
|
19
19
|
- **Bun/TypeScript SDKs**: First-class developer experience with the fastest JavaScript runtime
|
|
20
20
|
- **AI Gateway**: Unified access to LLMs (OpenAI-compatible SDK) with single billing—no separate API keys needed
|
|
21
|
-
- **Observability**: Logs
|
|
21
|
+
- **Observability**: Logs and tracing built-in so you can debug and improve agents
|
|
22
22
|
- **Production services**: Sandboxes, storage (S3-compatible), Postgres, KV, and enterprise features available as you grow
|
|
23
23
|
|
|
24
24
|
We're going to be setting up the default template quickly.
|
|
25
25
|
|
|
26
|
-
The default template includes AI Gateway integration, thread state persistence, structured logging, Tailwind CSS
|
|
26
|
+
The default template includes AI Gateway integration, thread state persistence, structured logging, and Tailwind CSS.
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
@@ -107,7 +107,6 @@ agentuity dev
|
|
|
107
107
|
|
|
108
108
|
**What happens:**
|
|
109
109
|
- **Local server** starts at \`http://localhost:3500\` — this is where your APIs and agents are served
|
|
110
|
-
- **Workbench** available at \`http://localhost:3500/workbench\` — a built-in UI for testing and interacting with your agents directly, without needing a frontend
|
|
111
110
|
- **Public tunnel URL** is automatically created — the CLI will display a public URL that tunnels to your local server, useful for testing webhooks or sharing with others
|
|
112
111
|
- **Hot reload** enabled — code changes reflect immediately
|
|
113
112
|
|
|
@@ -116,8 +115,7 @@ agentuity dev
|
|
|
116
115
|
> "The dev server is now running! Here's what to try:
|
|
117
116
|
>
|
|
118
117
|
> 1. Open **http://localhost:3500** to see the app
|
|
119
|
-
> 2.
|
|
120
|
-
> 3. The public tunnel URL shown in the terminal can be shared with others
|
|
118
|
+
> 2. The public tunnel URL shown in the terminal can be shared with others
|
|
121
119
|
>
|
|
122
120
|
> Take a few minutes to explore. When you're ready to deploy to production, let me know!"
|
|
123
121
|
|
|
@@ -179,7 +177,6 @@ After deployment, explain what they now have:
|
|
|
179
177
|
| **AI Gateway** | OpenAI-compatible SDK routed through Agentuity—unified billing, no separate API keys |
|
|
180
178
|
| **Thread State** | Conversations and agent state persist automatically for multi-turn flows |
|
|
181
179
|
| **Structured Logging** | Logs and traces captured for debugging and analytics |
|
|
182
|
-
| **Workbench** | Local UI at \`/workbench\` for testing agents without a frontend |
|
|
183
180
|
| **Tailwind CSS** | Pre-configured styling for the frontend |
|
|
184
181
|
| **Type Safety** | End-to-end types from agent schemas to API routes to frontend |
|
|
185
182
|
|
|
@@ -199,7 +196,7 @@ After successful deployment, guide the user through these recommendations:
|
|
|
199
196
|
- Get help, see examples, share what you're building
|
|
200
197
|
|
|
201
198
|
### 3. Explore the Dashboard
|
|
202
|
-
- **Observability**: View logs
|
|
199
|
+
- **Observability**: View logs and traces for your deployment
|
|
203
200
|
- **Deployments**: See version history with rollback options
|
|
204
201
|
- **Analytics**: Monitor usage and performance
|
|
205
202
|
|
|
@@ -240,7 +237,7 @@ The SDK makes it easy to:
|
|
|
240
237
|
**Onboarding is successful when the user has:**
|
|
241
238
|
|
|
242
239
|
1. ✅ **CLI installed** and authenticated
|
|
243
|
-
2. ✅ **Local dev environment running** — they've seen \`localhost:3500\`
|
|
240
|
+
2. ✅ **Local dev environment running** — they've seen \`localhost:3500\`
|
|
244
241
|
3. ✅ **First deployment complete** — they have a live production URL
|
|
245
242
|
4. ✅ **Free credits earned** — they know they've been rewarded and can keep building
|
|
246
243
|
5. ✅ **Clear next steps** — they know about Discord, the dashboard, and how to extend their project
|
package/src/runtime-bootstrap.md
CHANGED
|
@@ -115,8 +115,7 @@ For config files:
|
|
|
115
115
|
|
|
116
116
|
This utility is used by:
|
|
117
117
|
|
|
118
|
-
- `sdk/
|
|
119
|
-
- `sdk/apps/testing/cloud-deployment/app.ts`
|
|
118
|
+
- `sdk/tests/integration/integration-suite/app.ts`
|
|
120
119
|
|
|
121
120
|
It reuses existing infrastructure from the CLI:
|
|
122
121
|
|
|
@@ -149,7 +148,7 @@ To verify it works:
|
|
|
149
148
|
export AGENTUITY_PROFILE=local
|
|
150
149
|
|
|
151
150
|
# Build and run
|
|
152
|
-
cd sdk/
|
|
151
|
+
cd sdk/tests/integration/integration-suite
|
|
153
152
|
bun run build
|
|
154
153
|
cd .agentuity && bun run app.js
|
|
155
154
|
|