@agentuity/cli 0.1.13 → 0.1.14
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/auth.d.ts +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +6 -2
- package/dist/auth.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +44 -91
- package/dist/cli.js.map +1 -1
- package/dist/cmd/auth/index.d.ts.map +1 -1
- package/dist/cmd/auth/index.js +3 -0
- package/dist/cmd/auth/index.js.map +1 -1
- package/dist/cmd/auth/org/index.d.ts +2 -0
- package/dist/cmd/auth/org/index.d.ts.map +1 -0
- package/dist/cmd/auth/org/index.js +121 -0
- package/dist/cmd/auth/org/index.js.map +1 -0
- package/dist/cmd/build/vite/beacon-plugin.d.ts +19 -0
- package/dist/cmd/build/vite/beacon-plugin.d.ts.map +1 -0
- package/dist/cmd/build/vite/beacon-plugin.js +137 -0
- package/dist/cmd/build/vite/beacon-plugin.js.map +1 -0
- package/dist/cmd/build/vite/vite-builder.d.ts +2 -0
- package/dist/cmd/build/vite/vite-builder.d.ts.map +1 -1
- package/dist/cmd/build/vite/vite-builder.js +12 -2
- package/dist/cmd/build/vite/vite-builder.js.map +1 -1
- package/dist/cmd/build/webanalytics-generator.js +25 -9
- package/dist/cmd/build/webanalytics-generator.js.map +1 -1
- package/dist/cmd/cloud/db/get.d.ts.map +1 -1
- package/dist/cmd/cloud/db/get.js +7 -0
- package/dist/cmd/cloud/db/get.js.map +1 -1
- package/dist/cmd/cloud/db/list.d.ts.map +1 -1
- package/dist/cmd/cloud/db/list.js +19 -6
- package/dist/cmd/cloud/db/list.js.map +1 -1
- package/dist/cmd/cloud/deploy.d.ts.map +1 -1
- package/dist/cmd/cloud/deploy.js +24 -1
- package/dist/cmd/cloud/deploy.js.map +1 -1
- package/dist/cmd/cloud/deployment/show.d.ts.map +1 -1
- package/dist/cmd/cloud/deployment/show.js +5 -0
- package/dist/cmd/cloud/deployment/show.js.map +1 -1
- package/dist/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/index.js +3 -0
- package/dist/cmd/cloud/index.js.map +1 -1
- package/dist/cmd/cloud/region/index.d.ts +2 -0
- package/dist/cmd/cloud/region/index.d.ts.map +1 -0
- package/dist/cmd/cloud/region/index.js +136 -0
- package/dist/cmd/cloud/region/index.js.map +1 -0
- package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
- package/dist/cmd/cloud/sandbox/snapshot/build.js +35 -5
- package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
- package/dist/cmd/cloud/scp/download.d.ts.map +1 -1
- package/dist/cmd/cloud/scp/download.js +4 -2
- package/dist/cmd/cloud/scp/download.js.map +1 -1
- package/dist/cmd/cloud/scp/upload.d.ts.map +1 -1
- package/dist/cmd/cloud/scp/upload.js +4 -2
- package/dist/cmd/cloud/scp/upload.js.map +1 -1
- package/dist/cmd/cloud/ssh.d.ts.map +1 -1
- package/dist/cmd/cloud/ssh.js +3 -1
- package/dist/cmd/cloud/ssh.js.map +1 -1
- package/dist/cmd/cloud/storage/get.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/get.js +12 -5
- package/dist/cmd/cloud/storage/get.js.map +1 -1
- package/dist/cmd/cloud/storage/list.d.ts.map +1 -1
- package/dist/cmd/cloud/storage/list.js +10 -0
- package/dist/cmd/cloud/storage/list.js.map +1 -1
- package/dist/cmd/dev/index.d.ts.map +1 -1
- package/dist/cmd/dev/index.js +62 -5
- package/dist/cmd/dev/index.js.map +1 -1
- package/dist/cmd/help/index.d.ts.map +1 -1
- package/dist/cmd/help/index.js +8 -18
- package/dist/cmd/help/index.js.map +1 -1
- package/dist/cmd/project/create.d.ts.map +1 -1
- package/dist/cmd/project/create.js +10 -7
- package/dist/cmd/project/create.js.map +1 -1
- package/dist/cmd/project/import.d.ts +2 -0
- package/dist/cmd/project/import.d.ts.map +1 -0
- package/dist/cmd/project/import.js +88 -0
- package/dist/cmd/project/import.js.map +1 -0
- package/dist/cmd/project/index.d.ts.map +1 -1
- package/dist/cmd/project/index.js +3 -0
- package/dist/cmd/project/index.js.map +1 -1
- package/dist/cmd/project/reconcile.d.ts +67 -0
- package/dist/cmd/project/reconcile.d.ts.map +1 -0
- package/dist/cmd/project/reconcile.js +458 -0
- package/dist/cmd/project/reconcile.js.map +1 -0
- package/dist/cmd/project/template-flow.d.ts +11 -1
- package/dist/cmd/project/template-flow.d.ts.map +1 -1
- package/dist/cmd/project/template-flow.js +25 -7
- package/dist/cmd/project/template-flow.js.map +1 -1
- package/dist/config.d.ts +8 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +50 -21
- package/dist/config.js.map +1 -1
- package/dist/legacy-check.d.ts.map +1 -1
- package/dist/legacy-check.js +8 -0
- package/dist/legacy-check.js.map +1 -1
- package/dist/program-ref.d.ts +4 -0
- package/dist/program-ref.d.ts.map +1 -0
- package/dist/program-ref.js +8 -0
- package/dist/program-ref.js.map +1 -0
- package/dist/regions.d.ts +8 -0
- package/dist/regions.d.ts.map +1 -0
- package/dist/regions.js +77 -0
- package/dist/regions.js.map +1 -0
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +5 -4
- package/dist/tui.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +6 -6
- package/src/auth.ts +8 -8
- package/src/cli.ts +52 -108
- package/src/cmd/auth/index.ts +3 -0
- package/src/cmd/auth/org/index.ts +142 -0
- package/src/cmd/build/vite/beacon-plugin.ts +162 -0
- package/src/cmd/build/vite/vite-builder.ts +15 -2
- package/src/cmd/build/webanalytics-generator.ts +25 -9
- package/src/cmd/cloud/db/get.ts +7 -0
- package/src/cmd/cloud/db/list.ts +20 -6
- package/src/cmd/cloud/deploy.ts +32 -1
- package/src/cmd/cloud/deployment/show.ts +5 -0
- package/src/cmd/cloud/index.ts +3 -0
- package/src/cmd/cloud/region/index.ts +157 -0
- package/src/cmd/cloud/sandbox/snapshot/build.ts +42 -5
- package/src/cmd/cloud/scp/download.ts +6 -2
- package/src/cmd/cloud/scp/upload.ts +6 -2
- package/src/cmd/cloud/ssh.ts +5 -1
- package/src/cmd/cloud/storage/get.ts +12 -5
- package/src/cmd/cloud/storage/list.ts +11 -0
- package/src/cmd/dev/index.ts +62 -5
- package/src/cmd/help/index.ts +8 -22
- package/src/cmd/project/create.ts +10 -7
- package/src/cmd/project/import.ts +98 -0
- package/src/cmd/project/index.ts +3 -0
- package/src/cmd/project/reconcile.ts +606 -0
- package/src/cmd/project/template-flow.ts +37 -7
- package/src/config.ts +58 -22
- package/src/legacy-check.ts +10 -0
- package/src/program-ref.ts +11 -0
- package/src/regions.ts +95 -0
- package/src/tui.ts +6 -4
- package/src/types.ts +1 -0
|
@@ -9,6 +9,7 @@ const ProjectCreateResponseSchema = z.object({
|
|
|
9
9
|
name: z.string().describe('Project name'),
|
|
10
10
|
path: z.string().describe('Project directory path'),
|
|
11
11
|
projectId: z.string().optional().describe('Project ID if registered'),
|
|
12
|
+
orgId: z.string().optional().describe('Organization ID if registered'),
|
|
12
13
|
template: z.string().describe('Template used'),
|
|
13
14
|
installed: z.boolean().describe('Whether dependencies were installed'),
|
|
14
15
|
built: z.boolean().describe('Whether the project was built'),
|
|
@@ -83,7 +84,7 @@ export const createProjectSubcommand = createSubcommand({
|
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
await runCreateFlow({
|
|
87
|
+
const result = await runCreateFlow({
|
|
87
88
|
projectName: opts.name,
|
|
88
89
|
dir: opts.dir,
|
|
89
90
|
domains: opts.domains,
|
|
@@ -101,14 +102,16 @@ export const createProjectSubcommand = createSubcommand({
|
|
|
101
102
|
region,
|
|
102
103
|
});
|
|
103
104
|
|
|
104
|
-
// Return best-effort response (runCreateFlow doesn't return values)
|
|
105
105
|
return {
|
|
106
106
|
success: true,
|
|
107
|
-
name:
|
|
108
|
-
path:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
name: result.name,
|
|
108
|
+
path: result.path,
|
|
109
|
+
projectId: result.projectId,
|
|
110
|
+
orgId: result.orgId,
|
|
111
|
+
template: result.template,
|
|
112
|
+
installed: result.installed,
|
|
113
|
+
built: result.built,
|
|
114
|
+
domains: result.domains,
|
|
112
115
|
};
|
|
113
116
|
},
|
|
114
117
|
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { createSubcommand } from '../../types';
|
|
4
|
+
import { getCommand } from '../../command-prefix';
|
|
5
|
+
import { runProjectImport } from './reconcile';
|
|
6
|
+
import * as tui from '../../tui';
|
|
7
|
+
import { ErrorCode } from '../../errors';
|
|
8
|
+
import { isTTY } from '../../auth';
|
|
9
|
+
|
|
10
|
+
const ProjectImportResponseSchema = z.object({
|
|
11
|
+
success: z.boolean().describe('Whether the import succeeded'),
|
|
12
|
+
projectId: z.string().optional().describe('Project ID if imported'),
|
|
13
|
+
orgId: z.string().optional().describe('Organization ID'),
|
|
14
|
+
region: z.string().optional().describe('Region'),
|
|
15
|
+
status: z
|
|
16
|
+
.enum(['valid', 'imported', 'skipped', 'error'])
|
|
17
|
+
.describe('The result status of the import'),
|
|
18
|
+
message: z.string().optional().describe('Status message'),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const importSubcommand = createSubcommand({
|
|
22
|
+
name: 'import',
|
|
23
|
+
description: 'Import or register a local project with Agentuity Cloud',
|
|
24
|
+
tags: ['mutating', 'creates-resource', 'requires-auth'],
|
|
25
|
+
examples: [
|
|
26
|
+
{ command: getCommand('project import'), description: 'Import project in current directory' },
|
|
27
|
+
{
|
|
28
|
+
command: getCommand('project import --dir ./my-agent'),
|
|
29
|
+
description: 'Import project from specified directory',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
requires: { auth: true, apiClient: true },
|
|
33
|
+
optional: { region: true },
|
|
34
|
+
schema: {
|
|
35
|
+
options: z.object({
|
|
36
|
+
dir: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Directory containing the project (default: current directory)'),
|
|
40
|
+
validateOnly: z
|
|
41
|
+
.boolean()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Only validate the project structure without prompting'),
|
|
44
|
+
}),
|
|
45
|
+
response: ProjectImportResponseSchema,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
async handler(ctx) {
|
|
49
|
+
const { opts, auth, apiClient, config, logger } = ctx;
|
|
50
|
+
|
|
51
|
+
if (!config) {
|
|
52
|
+
tui.fatal('Configuration not loaded. Please try again.', ErrorCode.CONFIG_INVALID);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const dir = opts.dir ? resolve(opts.dir) : process.cwd();
|
|
56
|
+
const validateOnly = opts.validateOnly ?? false;
|
|
57
|
+
|
|
58
|
+
const result = await runProjectImport({
|
|
59
|
+
dir,
|
|
60
|
+
auth,
|
|
61
|
+
apiClient,
|
|
62
|
+
config,
|
|
63
|
+
logger,
|
|
64
|
+
interactive: validateOnly ? false : isTTY(),
|
|
65
|
+
validateOnly,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (result.status === 'error') {
|
|
69
|
+
tui.fatal(result.message ?? 'Failed to import project', ErrorCode.PROJECT_NOT_FOUND);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (result.status === 'skipped') {
|
|
73
|
+
tui.info(result.message || 'Import cancelled.');
|
|
74
|
+
return {
|
|
75
|
+
success: false,
|
|
76
|
+
status: result.status,
|
|
77
|
+
message: result.message,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Show success message for validateOnly mode
|
|
82
|
+
if (validateOnly && result.status === 'valid' && !result.project) {
|
|
83
|
+
tui.success(result.message || 'Project structure is valid.');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
success: result.status === 'valid' || result.status === 'imported',
|
|
88
|
+
projectId: result.project?.projectId,
|
|
89
|
+
orgId: result.project?.orgId,
|
|
90
|
+
region: result.project?.region,
|
|
91
|
+
status: result.status,
|
|
92
|
+
message:
|
|
93
|
+
result.status === 'imported'
|
|
94
|
+
? 'Project imported successfully'
|
|
95
|
+
: result.message || 'Project is already registered',
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
});
|
package/src/cmd/project/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createCommand } from '../../types';
|
|
2
2
|
import { createProjectSubcommand } from './create';
|
|
3
|
+
import { importSubcommand } from './import';
|
|
3
4
|
import { listSubcommand } from './list';
|
|
4
5
|
import { deleteSubcommand } from './delete';
|
|
5
6
|
import { showSubcommand } from './show';
|
|
@@ -12,11 +13,13 @@ export const command = createCommand({
|
|
|
12
13
|
tags: ['fast', 'requires-auth'],
|
|
13
14
|
examples: [
|
|
14
15
|
{ command: getCommand('project create my-agent'), description: 'Create a new project' },
|
|
16
|
+
{ command: getCommand('project import'), description: 'Import an existing project' },
|
|
15
17
|
{ command: getCommand('project list'), description: 'List all projects' },
|
|
16
18
|
{ command: getCommand('project auth init'), description: 'Set up Agentuity Auth' },
|
|
17
19
|
],
|
|
18
20
|
subcommands: [
|
|
19
21
|
createProjectSubcommand,
|
|
22
|
+
importSubcommand,
|
|
20
23
|
listSubcommand,
|
|
21
24
|
deleteSubcommand,
|
|
22
25
|
showSubcommand,
|