@castari/cli 0.3.1 → 0.4.1
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/LICENSE +21 -0
- package/dist/__tests__/utils/errors.test.d.ts +2 -0
- package/dist/__tests__/utils/errors.test.d.ts.map +1 -0
- package/dist/__tests__/utils/errors.test.js +84 -0
- package/dist/__tests__/utils/errors.test.js.map +1 -0
- package/dist/__tests__/utils/output.test.d.ts +2 -0
- package/dist/__tests__/utils/output.test.d.ts.map +1 -0
- package/dist/__tests__/utils/output.test.js +72 -0
- package/dist/__tests__/utils/output.test.js.map +1 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +188 -7
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/apikey.d.ts.map +1 -1
- package/dist/commands/apikey.js +56 -11
- package/dist/commands/apikey.js.map +1 -1
- package/dist/commands/buckets.d.ts +6 -0
- package/dist/commands/buckets.d.ts.map +1 -0
- package/dist/commands/buckets.js +361 -0
- package/dist/commands/buckets.js.map +1 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/files.d.ts +6 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +365 -0
- package/dist/commands/files.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +4 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/invocations.d.ts +6 -0
- package/dist/commands/invocations.d.ts.map +1 -0
- package/dist/commands/invocations.js +69 -0
- package/dist/commands/invocations.js.map +1 -0
- package/dist/commands/invoke.d.ts.map +1 -1
- package/dist/commands/invoke.js.map +1 -1
- package/dist/commands/mounts.d.ts +6 -0
- package/dist/commands/mounts.d.ts.map +1 -0
- package/dist/commands/mounts.js +252 -0
- package/dist/commands/mounts.js.map +1 -0
- package/dist/commands/sessions.d.ts +6 -0
- package/dist/commands/sessions.d.ts.map +1 -0
- package/dist/commands/sessions.js +76 -0
- package/dist/commands/sessions.js.map +1 -0
- package/dist/commands/stop.d.ts.map +1 -1
- package/dist/commands/stop.js +2 -4
- package/dist/commands/stop.js.map +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import Table from 'cli-table3';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import prompts from 'prompts';
|
|
6
|
+
import { CastariClient } from '@castari/sdk';
|
|
7
|
+
import { info, hint, blank, keyValue } from '../utils/output.js';
|
|
8
|
+
import { handleError } from '../utils/errors.js';
|
|
9
|
+
/**
|
|
10
|
+
* Format enabled status with color
|
|
11
|
+
*/
|
|
12
|
+
function formatEnabled(enabled) {
|
|
13
|
+
return enabled ? chalk.green('Enabled') : chalk.gray('Disabled');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Format permission rules
|
|
17
|
+
*/
|
|
18
|
+
function formatPermissions(rules) {
|
|
19
|
+
if (rules.length === 0) {
|
|
20
|
+
return chalk.gray('rw (default)');
|
|
21
|
+
}
|
|
22
|
+
return rules.map((r) => `${r.path}:${r.mode}`).join(', ');
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* cast mounts list <agent-slug>
|
|
26
|
+
*/
|
|
27
|
+
const listCommand = new Command('list')
|
|
28
|
+
.description('List mounts for an agent')
|
|
29
|
+
.argument('<agent-slug>', 'Agent slug')
|
|
30
|
+
.action(async (agentSlug) => {
|
|
31
|
+
const spinner = ora('Fetching mounts...').start();
|
|
32
|
+
try {
|
|
33
|
+
const client = new CastariClient();
|
|
34
|
+
await client.ensureAuthenticated();
|
|
35
|
+
const mounts = await client.mounts.getMounts(agentSlug);
|
|
36
|
+
spinner.stop();
|
|
37
|
+
if (mounts.length === 0) {
|
|
38
|
+
info(`No mounts configured for agent '${agentSlug}'`);
|
|
39
|
+
hint(`Add one with: cast mounts add ${agentSlug}`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const table = new Table({
|
|
43
|
+
head: [
|
|
44
|
+
chalk.white('ID'),
|
|
45
|
+
chalk.white('Bucket'),
|
|
46
|
+
chalk.white('Mount Path'),
|
|
47
|
+
chalk.white('Prefix'),
|
|
48
|
+
chalk.white('Status'),
|
|
49
|
+
],
|
|
50
|
+
style: {
|
|
51
|
+
head: [],
|
|
52
|
+
border: [],
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
for (const mount of mounts) {
|
|
56
|
+
table.push([
|
|
57
|
+
mount.id.substring(0, 8),
|
|
58
|
+
mount.bucket.slug,
|
|
59
|
+
mount.mount_path,
|
|
60
|
+
mount.source_prefix || chalk.gray('-'),
|
|
61
|
+
formatEnabled(mount.enabled),
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
console.log(table.toString());
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
spinner.fail('Failed to list mounts');
|
|
68
|
+
handleError(err);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* cast mounts add <agent-slug>
|
|
73
|
+
*/
|
|
74
|
+
const addCommand = new Command('add')
|
|
75
|
+
.description('Add a mount to an agent')
|
|
76
|
+
.argument('<agent-slug>', 'Agent slug')
|
|
77
|
+
.option('--bucket <bucket-slug>', 'Bucket to mount')
|
|
78
|
+
.option('--path <mount-path>', 'Mount path (e.g., /data)')
|
|
79
|
+
.option('--prefix <source-prefix>', 'Source prefix in bucket')
|
|
80
|
+
.option('--read-only', 'Make the mount read-only')
|
|
81
|
+
.action(async (agentSlug, options) => {
|
|
82
|
+
try {
|
|
83
|
+
const client = new CastariClient();
|
|
84
|
+
await client.ensureAuthenticated();
|
|
85
|
+
let bucketSlug = options.bucket;
|
|
86
|
+
let mountPath = options.path;
|
|
87
|
+
let sourcePrefix = options.prefix;
|
|
88
|
+
// Interactive mode if bucket or path not provided
|
|
89
|
+
if (!bucketSlug || !mountPath) {
|
|
90
|
+
// Fetch available buckets for selection
|
|
91
|
+
const buckets = await client.storage.getBuckets();
|
|
92
|
+
if (buckets.length === 0) {
|
|
93
|
+
info('No buckets available');
|
|
94
|
+
hint('Create one with: cast buckets create <name>');
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const responses = await prompts([
|
|
98
|
+
{
|
|
99
|
+
type: bucketSlug ? null : 'select',
|
|
100
|
+
name: 'bucket',
|
|
101
|
+
message: 'Select bucket to mount',
|
|
102
|
+
choices: buckets.map((b) => ({
|
|
103
|
+
title: `${b.name} (${b.slug})`,
|
|
104
|
+
value: b.slug,
|
|
105
|
+
})),
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: mountPath ? null : 'text',
|
|
109
|
+
name: 'path',
|
|
110
|
+
message: 'Mount path (e.g., /data)',
|
|
111
|
+
initial: '/data',
|
|
112
|
+
validate: (value) => (value.startsWith('/') ? true : 'Mount path must start with /'),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: sourcePrefix !== undefined ? null : 'text',
|
|
116
|
+
name: 'prefix',
|
|
117
|
+
message: 'Source prefix in bucket (optional)',
|
|
118
|
+
initial: '',
|
|
119
|
+
},
|
|
120
|
+
]);
|
|
121
|
+
if ((!responses.bucket && !bucketSlug) || (!responses.path && !mountPath)) {
|
|
122
|
+
info('Mount creation cancelled');
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
bucketSlug = bucketSlug || responses.bucket;
|
|
126
|
+
mountPath = mountPath || responses.path;
|
|
127
|
+
sourcePrefix = sourcePrefix !== undefined ? sourcePrefix : responses.prefix;
|
|
128
|
+
}
|
|
129
|
+
const spinner = ora('Adding mount...').start();
|
|
130
|
+
const mount = await client.mounts.addMount(agentSlug, {
|
|
131
|
+
bucketSlug: bucketSlug,
|
|
132
|
+
mountPath: mountPath,
|
|
133
|
+
sourcePrefix: sourcePrefix || undefined,
|
|
134
|
+
permissionRules: options.readOnly ? [{ path: '/', mode: 'ro' }] : undefined,
|
|
135
|
+
});
|
|
136
|
+
spinner.succeed(`Mount added to agent '${agentSlug}'`);
|
|
137
|
+
blank();
|
|
138
|
+
keyValue('Mount ID', mount.id.substring(0, 8));
|
|
139
|
+
keyValue('Bucket', mount.bucket.slug);
|
|
140
|
+
keyValue('Mount Path', mount.mount_path);
|
|
141
|
+
keyValue('Source Prefix', mount.source_prefix || '-');
|
|
142
|
+
keyValue('Permissions', formatPermissions(mount.permission_rules));
|
|
143
|
+
blank();
|
|
144
|
+
hint('Redeploy the agent to apply changes');
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
handleError(err);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
/**
|
|
151
|
+
* cast mounts remove <agent-slug> <mount-id>
|
|
152
|
+
*/
|
|
153
|
+
const removeCommand = new Command('remove')
|
|
154
|
+
.description('Remove a mount from an agent')
|
|
155
|
+
.argument('<agent-slug>', 'Agent slug')
|
|
156
|
+
.argument('<mount-id>', 'Mount ID (or prefix)')
|
|
157
|
+
.option('-f, --force', 'Skip confirmation')
|
|
158
|
+
.action(async (agentSlug, mountId, options) => {
|
|
159
|
+
try {
|
|
160
|
+
const client = new CastariClient();
|
|
161
|
+
await client.ensureAuthenticated();
|
|
162
|
+
// Find the full mount ID if a prefix was provided
|
|
163
|
+
const mounts = await client.mounts.getMounts(agentSlug);
|
|
164
|
+
const mount = mounts.find((m) => m.id.startsWith(mountId));
|
|
165
|
+
if (!mount) {
|
|
166
|
+
handleError(new Error(`Mount '${mountId}' not found for agent '${agentSlug}'`));
|
|
167
|
+
}
|
|
168
|
+
// Confirm deletion unless --force is used
|
|
169
|
+
if (!options.force) {
|
|
170
|
+
const response = await prompts({
|
|
171
|
+
type: 'confirm',
|
|
172
|
+
name: 'confirm',
|
|
173
|
+
message: `Remove mount at '${mount.mount_path}' from agent '${agentSlug}'?`,
|
|
174
|
+
initial: false,
|
|
175
|
+
});
|
|
176
|
+
if (!response.confirm) {
|
|
177
|
+
info('Removal cancelled');
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const spinner = ora('Removing mount...').start();
|
|
182
|
+
await client.mounts.removeMount(agentSlug, mount.id);
|
|
183
|
+
spinner.succeed(`Mount removed from agent '${agentSlug}'`);
|
|
184
|
+
hint('Redeploy the agent to apply changes');
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
handleError(err);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
/**
|
|
191
|
+
* cast mounts update <agent-slug> <mount-id>
|
|
192
|
+
*/
|
|
193
|
+
const updateCommand = new Command('update')
|
|
194
|
+
.description('Update a mount configuration')
|
|
195
|
+
.argument('<agent-slug>', 'Agent slug')
|
|
196
|
+
.argument('<mount-id>', 'Mount ID (or prefix)')
|
|
197
|
+
.option('--path <mount-path>', 'New mount path')
|
|
198
|
+
.option('--prefix <source-prefix>', 'New source prefix')
|
|
199
|
+
.option('--enable', 'Enable the mount')
|
|
200
|
+
.option('--disable', 'Disable the mount')
|
|
201
|
+
.action(async (agentSlug, mountId, options) => {
|
|
202
|
+
try {
|
|
203
|
+
const client = new CastariClient();
|
|
204
|
+
await client.ensureAuthenticated();
|
|
205
|
+
// Find the full mount ID if a prefix was provided
|
|
206
|
+
const mounts = await client.mounts.getMounts(agentSlug);
|
|
207
|
+
const mount = mounts.find((m) => m.id.startsWith(mountId));
|
|
208
|
+
if (!mount) {
|
|
209
|
+
handleError(new Error(`Mount '${mountId}' not found for agent '${agentSlug}'`));
|
|
210
|
+
}
|
|
211
|
+
// Determine enabled state
|
|
212
|
+
let enabled;
|
|
213
|
+
if (options.enable) {
|
|
214
|
+
enabled = true;
|
|
215
|
+
}
|
|
216
|
+
else if (options.disable) {
|
|
217
|
+
enabled = false;
|
|
218
|
+
}
|
|
219
|
+
// Check if any updates were specified
|
|
220
|
+
if (!options.path && options.prefix === undefined && enabled === undefined) {
|
|
221
|
+
info('No updates specified');
|
|
222
|
+
hint('Use --path, --prefix, --enable, or --disable to update the mount');
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const spinner = ora('Updating mount...').start();
|
|
226
|
+
const updated = await client.mounts.updateMount(agentSlug, mount.id, {
|
|
227
|
+
mountPath: options.path,
|
|
228
|
+
sourcePrefix: options.prefix,
|
|
229
|
+
enabled,
|
|
230
|
+
});
|
|
231
|
+
spinner.succeed(`Mount updated`);
|
|
232
|
+
blank();
|
|
233
|
+
keyValue('Mount Path', updated.mount_path);
|
|
234
|
+
keyValue('Source Prefix', updated.source_prefix || '-');
|
|
235
|
+
keyValue('Status', formatEnabled(updated.enabled));
|
|
236
|
+
blank();
|
|
237
|
+
hint('Redeploy the agent to apply changes');
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
handleError(err);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
/**
|
|
244
|
+
* cast mounts
|
|
245
|
+
*/
|
|
246
|
+
export const mountsCommand = new Command('mounts')
|
|
247
|
+
.description('Manage agent storage mounts')
|
|
248
|
+
.addCommand(listCommand)
|
|
249
|
+
.addCommand(addCommand)
|
|
250
|
+
.addCommand(removeCommand)
|
|
251
|
+
.addCommand(updateCommand);
|
|
252
|
+
//# sourceMappingURL=mounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mounts.js","sourceRoot":"","sources":["../../src/commands/mounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAW,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ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,WAAW,CAAC,SAAS,EAAE,KAAM,CAAC,EAAE,EAAE;YACpE,SAAS,EAAE,OAAO,CAAC,IAAI;YACvB,YAAY,EAAE,OAAO,CAAC,MAAM;YAC5B,OAAO;SACR,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACjC,KAAK,EAAE,CAAC;QACR,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,aAAa,IAAI,GAAG,CAAC,CAAC;QACxD,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,qCAAqC,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,WAAW,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC,CACF,CAAC;AAEJ;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,6BAA6B,CAAC;KAC1C,UAAU,CAAC,WAAW,CAAC;KACvB,UAAU,CAAC,UAAU,CAAC;KACtB,UAAU,CAAC,aAAa,CAAC;KACzB,UAAU,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../src/commands/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6EpC;;GAEG;AACH,eAAO,MAAM,eAAe,SAGA,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import Table from 'cli-table3';
|
|
5
|
+
import { CastariClient } from '@castari/sdk';
|
|
6
|
+
import { info, formatDate } from '../utils/output.js';
|
|
7
|
+
import { handleError } from '../utils/errors.js';
|
|
8
|
+
/**
|
|
9
|
+
* cast sessions list <slug>
|
|
10
|
+
*/
|
|
11
|
+
const listCommand = new Command('list')
|
|
12
|
+
.description('List sessions for an agent')
|
|
13
|
+
.argument('<slug>', 'Agent slug')
|
|
14
|
+
.action(async (slug) => {
|
|
15
|
+
const spinner = ora('Fetching sessions...').start();
|
|
16
|
+
try {
|
|
17
|
+
const client = new CastariClient();
|
|
18
|
+
await client.ensureAuthenticated();
|
|
19
|
+
const sessions = await client.agents.listSessions(slug);
|
|
20
|
+
spinner.stop();
|
|
21
|
+
if (sessions.length === 0) {
|
|
22
|
+
info(`No sessions found for agent '${slug}'`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const table = new Table({
|
|
26
|
+
head: [
|
|
27
|
+
chalk.white('Session ID'),
|
|
28
|
+
chalk.white('Sandbox ID'),
|
|
29
|
+
chalk.white('Created'),
|
|
30
|
+
chalk.white('Last Invocation'),
|
|
31
|
+
],
|
|
32
|
+
style: { head: [], border: [] },
|
|
33
|
+
});
|
|
34
|
+
for (const session of sessions) {
|
|
35
|
+
table.push([
|
|
36
|
+
session.id,
|
|
37
|
+
session.sandbox_id ?? chalk.gray('N/A'),
|
|
38
|
+
formatDate(session.created_at),
|
|
39
|
+
session.last_invocation_at ? formatDate(session.last_invocation_at) : chalk.gray('Never'),
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
console.log(table.toString());
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
spinner.fail('Failed to list sessions');
|
|
46
|
+
handleError(err);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* cast sessions delete <slug> <session-id>
|
|
51
|
+
*/
|
|
52
|
+
const deleteCommand = new Command('delete')
|
|
53
|
+
.description('Delete a session')
|
|
54
|
+
.argument('<slug>', 'Agent slug')
|
|
55
|
+
.argument('<session-id>', 'Session ID to delete')
|
|
56
|
+
.action(async (slug, sessionId) => {
|
|
57
|
+
const spinner = ora('Deleting session...').start();
|
|
58
|
+
try {
|
|
59
|
+
const client = new CastariClient();
|
|
60
|
+
await client.ensureAuthenticated();
|
|
61
|
+
await client.agents.deleteSession(slug, sessionId);
|
|
62
|
+
spinner.succeed(`Session '${sessionId}' deleted`);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
spinner.fail('Failed to delete session');
|
|
66
|
+
handleError(err);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* cast sessions
|
|
71
|
+
*/
|
|
72
|
+
export const sessionsCommand = new Command('sessions')
|
|
73
|
+
.description('Manage agent sessions')
|
|
74
|
+
.addCommand(listCommand)
|
|
75
|
+
.addCommand(deleteCommand);
|
|
76
|
+
//# sourceMappingURL=sessions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/commands/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAS,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KACpC,WAAW,CAAC,4BAA4B,CAAC;KACzC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;KAChC,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE;IAC7B,MAAM,OAAO,GAAG,GAAG,CAAC,sBAAsB,CAAC,CAAC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","sources":["../../src/commands/stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,WAAW,SAkBpB,CAAC"}
|
package/dist/commands/stop.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
import { CastariClient } from '@castari/sdk';
|
|
4
|
-
import {
|
|
4
|
+
import { blank } from '../utils/output.js';
|
|
5
5
|
import { handleError } from '../utils/errors.js';
|
|
6
6
|
export const stopCommand = new Command('stop')
|
|
7
7
|
.description('Stop a running agent')
|
|
@@ -11,11 +11,9 @@ export const stopCommand = new Command('stop')
|
|
|
11
11
|
try {
|
|
12
12
|
const client = new CastariClient();
|
|
13
13
|
await client.ensureAuthenticated();
|
|
14
|
-
|
|
14
|
+
await client.agents.stop(slug);
|
|
15
15
|
spinner.succeed(`Agent '${slug}' stopped`);
|
|
16
16
|
blank();
|
|
17
|
-
keyValue('Status', agent.status);
|
|
18
|
-
blank();
|
|
19
17
|
}
|
|
20
18
|
catch (err) {
|
|
21
19
|
spinner.fail('Failed to stop agent');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../src/commands/stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAW,
|
|
1
|
+
{"version":3,"file":"stop.js","sourceRoot":"","sources":["../../src/commands/stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAW,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,sBAAsB,CAAC;KACnC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;KAChC,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE;IAC7B,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;IAEnD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QACnC,MAAM,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAEnC,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/B,OAAO,CAAC,OAAO,CAAC,UAAU,IAAI,WAAW,CAAC,CAAC;QAC3C,KAAK,EAAE,CAAC;IACV,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACrC,WAAW,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
import { loginCommand } from './commands/login.js';
|
|
4
5
|
import { logoutCommand } from './commands/logout.js';
|
|
5
6
|
import { whoamiCommand } from './commands/whoami.js';
|
|
@@ -11,11 +12,18 @@ import { invokeCommand } from './commands/invoke.js';
|
|
|
11
12
|
import { secretsCommand } from './commands/secrets.js';
|
|
12
13
|
import { usageCommand } from './commands/usage.js';
|
|
13
14
|
import { initCommand } from './commands/init.js';
|
|
15
|
+
import { bucketsCommand } from './commands/buckets.js';
|
|
16
|
+
import { mountsCommand } from './commands/mounts.js';
|
|
17
|
+
import { filesCommand } from './commands/files.js';
|
|
18
|
+
import { sessionsCommand } from './commands/sessions.js';
|
|
19
|
+
import { invocationsCommand } from './commands/invocations.js';
|
|
20
|
+
const require = createRequire(import.meta.url);
|
|
21
|
+
const { version } = require('../package.json');
|
|
14
22
|
const program = new Command();
|
|
15
23
|
program
|
|
16
24
|
.name('cast')
|
|
17
25
|
.description('Castari CLI - Deploy AI agents with one command')
|
|
18
|
-
.version(
|
|
26
|
+
.version(version);
|
|
19
27
|
// Auth commands
|
|
20
28
|
program.addCommand(loginCommand);
|
|
21
29
|
program.addCommand(logoutCommand);
|
|
@@ -34,6 +42,13 @@ program.addCommand(secretsCommand);
|
|
|
34
42
|
program.addCommand(usageCommand);
|
|
35
43
|
// Project initialization
|
|
36
44
|
program.addCommand(initCommand);
|
|
45
|
+
// Storage management
|
|
46
|
+
program.addCommand(bucketsCommand);
|
|
47
|
+
program.addCommand(mountsCommand);
|
|
48
|
+
program.addCommand(filesCommand);
|
|
49
|
+
// Sessions & Invocations
|
|
50
|
+
program.addCommand(sessionsCommand);
|
|
51
|
+
program.addCommand(invocationsCommand);
|
|
37
52
|
// Parse arguments
|
|
38
53
|
program.parse();
|
|
39
54
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;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O,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@castari/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Castari CLI - Deploy AI agents with one command",
|
|
5
5
|
"author": "Castari <founders@castari.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,15 +19,7 @@
|
|
|
19
19
|
"bin": {
|
|
20
20
|
"cast": "./bin/cast.js"
|
|
21
21
|
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "tsc",
|
|
24
|
-
"test": "vitest run --passWithNoTests",
|
|
25
|
-
"test:watch": "vitest",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
27
|
-
"clean": "rm -rf dist"
|
|
28
|
-
},
|
|
29
22
|
"dependencies": {
|
|
30
|
-
"@castari/sdk": "^0.3.1",
|
|
31
23
|
"chalk": "^5.3.0",
|
|
32
24
|
"cli-table3": "^0.6.0",
|
|
33
25
|
"commander": "^12.0.0",
|
|
@@ -35,7 +27,8 @@
|
|
|
35
27
|
"open": "^10.0.0",
|
|
36
28
|
"ora": "^8.0.0",
|
|
37
29
|
"prompts": "^2.4.2",
|
|
38
|
-
"tar": "^7.
|
|
30
|
+
"tar": "^7.5.7",
|
|
31
|
+
"@castari/sdk": "0.4.1"
|
|
39
32
|
},
|
|
40
33
|
"devDependencies": {
|
|
41
34
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -59,5 +52,12 @@
|
|
|
59
52
|
"anthropic",
|
|
60
53
|
"llm",
|
|
61
54
|
"deploy"
|
|
62
|
-
]
|
|
63
|
-
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsc",
|
|
58
|
+
"test": "vitest run --passWithNoTests",
|
|
59
|
+
"test:watch": "vitest",
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"clean": "rm -rf dist"
|
|
62
|
+
}
|
|
63
|
+
}
|