@stateset/sandbox-cli 3.3.1 → 3.6.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/CHANGELOG.md +140 -0
- package/README.md +467 -41
- package/dist/client.d.ts +131 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +21 -0
- package/dist/client.js.map +1 -1
- package/dist/commands/billing.js +36 -2
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/config.js +8 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +48 -15
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/sandbox.d.ts.map +1 -1
- package/dist/commands/sandbox.js +222 -17
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/swarm.d.ts +18 -0
- package/dist/commands/swarm.d.ts.map +1 -0
- package/dist/commands/swarm.js +379 -0
- package/dist/commands/swarm.js.map +1 -0
- package/dist/commands/terminal.d.ts +3 -1
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +58 -1
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/workbench.d.ts +138 -0
- package/dist/commands/workbench.d.ts.map +1 -0
- package/dist/commands/workbench.js +531 -0
- package/dist/commands/workbench.js.map +1 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/ephemeral-storage.d.ts +12 -0
- package/dist/utils/ephemeral-storage.d.ts.map +1 -0
- package/dist/utils/ephemeral-storage.js +39 -0
- package/dist/utils/ephemeral-storage.js.map +1 -0
- package/dist/utils/swarm-dispatcher.d.ts +50 -0
- package/dist/utils/swarm-dispatcher.d.ts.map +1 -0
- package/dist/utils/swarm-dispatcher.js +137 -0
- package/dist/utils/swarm-dispatcher.js.map +1 -0
- package/dist/utils/swarm-plan.d.ts +69 -0
- package/dist/utils/swarm-plan.d.ts.map +1 -0
- package/dist/utils/swarm-plan.js +321 -0
- package/dist/utils/swarm-plan.js.map +1 -0
- package/dist/utils/template-create.d.ts +36 -0
- package/dist/utils/template-create.d.ts.map +1 -0
- package/dist/utils/template-create.js +118 -0
- package/dist/utils/template-create.js.map +1 -0
- package/dist/workbench/actions.d.ts +1 -1
- package/dist/workbench/actions.d.ts.map +1 -1
- package/dist/workbench/actions.js +1 -0
- package/dist/workbench/actions.js.map +1 -1
- package/dist/workbench/agents.d.ts +96 -0
- package/dist/workbench/agents.d.ts.map +1 -0
- package/dist/workbench/agents.js +370 -0
- package/dist/workbench/agents.js.map +1 -0
- package/dist/workbench/commands.d.ts.map +1 -1
- package/dist/workbench/commands.js +7 -1
- package/dist/workbench/commands.js.map +1 -1
- package/dist/workbench/model.d.ts +5 -1
- package/dist/workbench/model.d.ts.map +1 -1
- package/dist/workbench/model.js +15 -2
- package/dist/workbench/model.js.map +1 -1
- package/dist/workbench/terminal.d.ts +1 -1
- package/dist/workbench/terminal.d.ts.map +1 -1
- package/dist/workbench/terminal.js +108 -78
- package/dist/workbench/terminal.js.map +1 -1
- package/package.json +15 -7
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a swarm plan file, check it, and turn it into the body of
|
|
3
|
+
* `POST /swarms` (docs/API_REFERENCE.md, "Swarms").
|
|
4
|
+
*
|
|
5
|
+
* A plan file is what examples/claude-agent/swarm-plan.mjs writes, and it is
|
|
6
|
+
* not the API's body. A plan task has `id` where the API has `key`. A plan
|
|
7
|
+
* has no name, and the API requires one. A plan may hold more than the API
|
|
8
|
+
* takes: more and longer tasks, and the fields `sandbox`, `union`,
|
|
9
|
+
* `max_local` and a task's `files`, which the API's strict schema refuses.
|
|
10
|
+
* Those fields are left out of the body. Everything else the API would
|
|
11
|
+
* refuse is found here first, so that all of it is named at once, by task.
|
|
12
|
+
*
|
|
13
|
+
* The limits are those of `CreateSwarmSchema` in
|
|
14
|
+
* controller/src/schemas/swarm.ts: that schema decides, and a limit that
|
|
15
|
+
* changes there changes here.
|
|
16
|
+
*/
|
|
17
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
18
|
+
import { basename } from 'node:path';
|
|
19
|
+
import { CliError } from './errors.js';
|
|
20
|
+
import { inertText, limitText } from '../workbench/text.js';
|
|
21
|
+
/** The most tasks the API takes in one swarm. */
|
|
22
|
+
export const MAX_SWARM_TASKS = 50;
|
|
23
|
+
/** The most characters of a swarm's name and of a task's name, after trimming. */
|
|
24
|
+
export const MAX_NAME_LENGTH = 128;
|
|
25
|
+
/** The most characters of a swarm's goal, after trimming. */
|
|
26
|
+
export const MAX_GOAL_LENGTH = 16000;
|
|
27
|
+
/** The most characters of a task's objective, after trimming. */
|
|
28
|
+
export const MAX_OBJECTIVE_LENGTH = 16000;
|
|
29
|
+
/** The most characters of a task's id, which the API calls its key. */
|
|
30
|
+
export const MAX_TASK_ID_LENGTH = 64;
|
|
31
|
+
/** The most characters of `repository` and of `defaults`, each as JSON. */
|
|
32
|
+
export const MAX_SETTINGS_LENGTH = 16_384;
|
|
33
|
+
/** The most problems one check lists; a closing line counts the others. */
|
|
34
|
+
export const MAX_PROBLEMS = 20;
|
|
35
|
+
/** The largest plan file that is read, in bytes: 4 MB. */
|
|
36
|
+
export const MAX_PLAN_BYTES = 4 * 1024 * 1024;
|
|
37
|
+
const KEBAB = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
38
|
+
const CONTROLS = /[\p{Cc}\p{Cs}]/u;
|
|
39
|
+
/** A message shows this much of a value that is wrong. */
|
|
40
|
+
const SHOWN_LENGTH = 80;
|
|
41
|
+
const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
42
|
+
const count = (n, noun) => `${n} ${noun}${n === 1 ? '' : 's'}`;
|
|
43
|
+
/** A value as JSON; undefined for one that has none (a function, a BigInt, an object that holds itself). */
|
|
44
|
+
function asJson(value) {
|
|
45
|
+
try {
|
|
46
|
+
return JSON.stringify(value);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** A value that is wrong, as a message shows it: the start of its JSON, with nothing a terminal acts on. */
|
|
53
|
+
const shown = (value) => inertText(limitText(asJson(value) ?? typeof value, SHOWN_LENGTH));
|
|
54
|
+
/**
|
|
55
|
+
* What is wrong with a text of the plan, as the rest of a sentence that
|
|
56
|
+
* starts with what the text is; undefined when nothing is. The length is
|
|
57
|
+
* that of the trimmed text, which is what the API counts.
|
|
58
|
+
*/
|
|
59
|
+
function textProblem(value, limit, banned) {
|
|
60
|
+
if (typeof value !== 'string') {
|
|
61
|
+
return `${value === undefined ? 'is missing' : `is ${shown(value)}`}; it is a string of 1 to ${limit} characters`;
|
|
62
|
+
}
|
|
63
|
+
const text = value.trim();
|
|
64
|
+
if (text.length === 0)
|
|
65
|
+
return `is empty; it has 1 to ${limit} characters`;
|
|
66
|
+
if (text.length > limit)
|
|
67
|
+
return `is ${text.length} characters long; the limit is ${limit}`;
|
|
68
|
+
if (banned === 'control' && CONTROLS.test(text))
|
|
69
|
+
return 'has a control character in it; it is one line of plain text';
|
|
70
|
+
if (banned === 'NUL' && text.includes('\0'))
|
|
71
|
+
return 'has a NUL character in it; every other character is allowed';
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
/** What is wrong with `repository` or `defaults`, in the same form; undefined when nothing is, or when it is left out. */
|
|
75
|
+
function settingsProblem(value) {
|
|
76
|
+
if (value === undefined)
|
|
77
|
+
return undefined;
|
|
78
|
+
const json = isObject(value) ? asJson(value) : undefined;
|
|
79
|
+
if (json === undefined)
|
|
80
|
+
return `is ${shown(value)}; it is a JSON object, or left out`;
|
|
81
|
+
if (json.length > MAX_SETTINGS_LENGTH)
|
|
82
|
+
return `is ${json.length} characters as JSON; the limit is ${MAX_SETTINGS_LENGTH}`;
|
|
83
|
+
// The schema's own test: it refuses the escape wherever the JSON has it.
|
|
84
|
+
if (json.includes('\\u0000'))
|
|
85
|
+
return 'has a NUL character (\\u0000) in it; every other character is allowed';
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
/** Every dependency cycle a depth-first walk meets, each as the ids along it, the first one repeated at the end. */
|
|
89
|
+
function cycles(edges) {
|
|
90
|
+
const state = new Map();
|
|
91
|
+
const path = [];
|
|
92
|
+
const found = [];
|
|
93
|
+
const visit = (id) => {
|
|
94
|
+
state.set(id, 'open');
|
|
95
|
+
path.push(id);
|
|
96
|
+
for (const next of edges.get(id) ?? []) {
|
|
97
|
+
if (state.get(next) === 'open')
|
|
98
|
+
found.push([...path.slice(path.indexOf(next)), next]);
|
|
99
|
+
else if (!state.has(next))
|
|
100
|
+
visit(next);
|
|
101
|
+
}
|
|
102
|
+
path.pop();
|
|
103
|
+
state.set(id, 'done');
|
|
104
|
+
};
|
|
105
|
+
for (const id of edges.keys())
|
|
106
|
+
if (!state.has(id))
|
|
107
|
+
visit(id);
|
|
108
|
+
return found;
|
|
109
|
+
}
|
|
110
|
+
/** What is wrong with the tasks, task by task in the plan's order, and after them the cycles of their dependencies. */
|
|
111
|
+
function taskProblems(tasks) {
|
|
112
|
+
const problems = [];
|
|
113
|
+
// Every id a task has, usable or not: a dependency on a task whose id is wrong is not one more problem.
|
|
114
|
+
const written = new Set(tasks.map((task) => (isObject(task) ? task.id : undefined)));
|
|
115
|
+
const first = new Map();
|
|
116
|
+
const edges = new Map();
|
|
117
|
+
// False once an id or a dependency is wrong: what the tasks then wait for is not known, so no cycle is looked for.
|
|
118
|
+
let sound = true;
|
|
119
|
+
for (let index = 0; index < tasks.length; index += 1) {
|
|
120
|
+
const task = tasks[index];
|
|
121
|
+
const place = `Task ${index + 1}`;
|
|
122
|
+
if (!isObject(task)) {
|
|
123
|
+
problems.push(`${place} is ${shown(task)}; a task is an object with id, name, objective and depends_on.`);
|
|
124
|
+
sound = false;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const { id } = task;
|
|
128
|
+
const holder = typeof id === 'string' ? first.get(id) : undefined;
|
|
129
|
+
let usable;
|
|
130
|
+
if (typeof id !== 'string' || !KEBAB.test(id)) {
|
|
131
|
+
problems.push(`${place}: id ${id === undefined ? 'is missing; it is' : `${shown(id)} is not`} `
|
|
132
|
+
+ `kebab-case (lowercase letters and digits joined by single hyphens, at most ${MAX_TASK_ID_LENGTH} characters).`);
|
|
133
|
+
}
|
|
134
|
+
else if (id.length > MAX_TASK_ID_LENGTH) {
|
|
135
|
+
problems.push(`${place}: id is ${id.length} characters long; the limit is ${MAX_TASK_ID_LENGTH}.`);
|
|
136
|
+
}
|
|
137
|
+
else if (holder !== undefined) {
|
|
138
|
+
problems.push(`${place}: id "${id}" is already the id of task ${holder + 1}; every task has an id of its own.`);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
first.set(id, index);
|
|
142
|
+
usable = id;
|
|
143
|
+
}
|
|
144
|
+
// A task is named by its id only when the id tells it from every other task.
|
|
145
|
+
const label = usable === undefined ? place : `Task "${usable}"`;
|
|
146
|
+
for (const [field, limit, banned] of [['name', MAX_NAME_LENGTH, 'control'], ['objective', MAX_OBJECTIVE_LENGTH, 'NUL']]) {
|
|
147
|
+
const problem = textProblem(task[field], limit, banned);
|
|
148
|
+
if (problem !== undefined)
|
|
149
|
+
problems.push(`${label}: ${field} ${problem}.`);
|
|
150
|
+
}
|
|
151
|
+
const dependencies = task.depends_on === undefined ? [] : task.depends_on;
|
|
152
|
+
const before = problems.length;
|
|
153
|
+
const known = [];
|
|
154
|
+
if (!Array.isArray(dependencies)) {
|
|
155
|
+
problems.push(`${label}: depends_on is ${shown(dependencies)}; it is a list of task ids, or left out.`);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
for (const dependency of new Set(dependencies)) {
|
|
159
|
+
if (typeof dependency !== 'string') {
|
|
160
|
+
problems.push(`${label}: depends_on holds ${shown(dependency)}; it is a list of task ids.`);
|
|
161
|
+
}
|
|
162
|
+
else if (dependency === id) {
|
|
163
|
+
problems.push(`${label}: depends_on names ${shown(id)}, the task itself; a task depends on other tasks only.`);
|
|
164
|
+
}
|
|
165
|
+
else if (!written.has(dependency)) {
|
|
166
|
+
problems.push(`${label}: depends_on names ${shown(dependency)}, which is not the id of a task in this plan.`);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
known.push(dependency);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (usable === undefined || problems.length > before)
|
|
174
|
+
sound = false;
|
|
175
|
+
else
|
|
176
|
+
edges.set(usable, known);
|
|
177
|
+
}
|
|
178
|
+
if (sound) {
|
|
179
|
+
for (const cycle of cycles(edges)) {
|
|
180
|
+
problems.push(`The dependencies form a cycle: ${cycle.join(' -> ')}; a task cannot wait, directly or not, for itself.`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return problems;
|
|
184
|
+
}
|
|
185
|
+
/** `checkSwarmPlan` with every problem listed, however many there are. */
|
|
186
|
+
function inspectPlan(plan, name) {
|
|
187
|
+
if (!isObject(plan) || !Array.isArray(plan.tasks)) {
|
|
188
|
+
return { request: null, problems: ['A swarm plan is a JSON object with its list of tasks in `tasks`.'] };
|
|
189
|
+
}
|
|
190
|
+
const tasks = plan.tasks;
|
|
191
|
+
const problems = [];
|
|
192
|
+
const check = (subject, problem) => {
|
|
193
|
+
if (problem !== undefined)
|
|
194
|
+
problems.push(`${subject} ${problem}.`);
|
|
195
|
+
};
|
|
196
|
+
check("The swarm's name", textProblem(name, MAX_NAME_LENGTH, 'control'));
|
|
197
|
+
check("The plan's goal", textProblem(plan.goal, MAX_GOAL_LENGTH, 'NUL'));
|
|
198
|
+
check("The plan's repository", settingsProblem(plan.repository));
|
|
199
|
+
check("The plan's defaults", settingsProblem(plan.defaults));
|
|
200
|
+
if (tasks.length < 1 || tasks.length > MAX_SWARM_TASKS) {
|
|
201
|
+
// Too many to be a swarm at all: nothing is gained by listing what is wrong with each.
|
|
202
|
+
problems.push(`The plan has ${count(tasks.length, 'task')}; a swarm has 1 to ${MAX_SWARM_TASKS}.`);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
problems.push(...taskProblems(tasks));
|
|
206
|
+
}
|
|
207
|
+
if (problems.length > 0)
|
|
208
|
+
return { request: null, problems };
|
|
209
|
+
const request = {
|
|
210
|
+
name: name.trim(),
|
|
211
|
+
goal: plan.goal.trim(),
|
|
212
|
+
...(plan.repository === undefined ? {} : { repository: plan.repository }),
|
|
213
|
+
...(plan.defaults === undefined ? {} : { defaults: plan.defaults }),
|
|
214
|
+
tasks: tasks.map((task) => ({
|
|
215
|
+
key: task.id,
|
|
216
|
+
name: task.name.trim(),
|
|
217
|
+
objective: task.objective,
|
|
218
|
+
depends_on: [...new Set(task.depends_on ?? [])],
|
|
219
|
+
})),
|
|
220
|
+
};
|
|
221
|
+
return { request, problems };
|
|
222
|
+
}
|
|
223
|
+
/** At most `MAX_PROBLEMS` of the problems, and after them how many more there are. */
|
|
224
|
+
function listed(problems) {
|
|
225
|
+
if (problems.length <= MAX_PROBLEMS)
|
|
226
|
+
return problems;
|
|
227
|
+
const more = problems.length - MAX_PROBLEMS;
|
|
228
|
+
return [...problems.slice(0, MAX_PROBLEMS), `${count(more, 'more problem')} ${more === 1 ? 'is' : 'are'} not listed.`];
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Check a plan and build the body of `POST /swarms` from it, under the name
|
|
232
|
+
* the caller gives the swarm. Pure: reads nothing but its arguments, and
|
|
233
|
+
* never throws.
|
|
234
|
+
*
|
|
235
|
+
* `request` is null exactly when there are problems. They are listed in the
|
|
236
|
+
* order of a plan file (the name, the goal, `repository`, `defaults`, then
|
|
237
|
+
* the tasks one by one, then the cycles), each as one sentence that names
|
|
238
|
+
* its task: by its id, or by its place when the id is wrong or already
|
|
239
|
+
* another task's.
|
|
240
|
+
*
|
|
241
|
+
* The body has the name and the goal trimmed, `repository` and `defaults` as
|
|
242
|
+
* given when the plan has them, and of every task its id as `key`, its name
|
|
243
|
+
* trimmed, its objective as written and its dependencies once each. Nothing
|
|
244
|
+
* else of the plan is in it.
|
|
245
|
+
*/
|
|
246
|
+
export function checkSwarmPlan(plan, name) {
|
|
247
|
+
const { request, problems } = inspectPlan(plan, name);
|
|
248
|
+
return { request, problems: listed(problems) };
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The name of the swarm of a plan, before it is checked. Pure.
|
|
252
|
+
*
|
|
253
|
+
* It is the name asked for, `options.name`, when there is one: an empty or
|
|
254
|
+
* a blank one is kept, and `checkSwarmPlan` reports it. Else it is the
|
|
255
|
+
* plan's own `name` when that is a string, empty or not. Else it is the name
|
|
256
|
+
* of the plan file, `options.file`, without its directory and without a
|
|
257
|
+
* closing `.json`, when a file is given. Else it is undefined, which
|
|
258
|
+
* `checkSwarmPlan` reports as a name that is missing.
|
|
259
|
+
*
|
|
260
|
+
* An empty file name is a file name: the name it gives is empty, not
|
|
261
|
+
* undefined. A file named exactly `.json` gives an empty name as well when
|
|
262
|
+
* it is given without a directory, and the name `.json` when it is given
|
|
263
|
+
* with one (`plans/.json`).
|
|
264
|
+
*/
|
|
265
|
+
export function swarmPlanName(plan, options = {}) {
|
|
266
|
+
return options.name ?? (isObject(plan) && typeof plan.name === 'string'
|
|
267
|
+
? plan.name
|
|
268
|
+
: options.file === undefined ? undefined : basename(options.file, '.json'));
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Read a plan file and return the body of `POST /swarms` for it. The swarm's
|
|
272
|
+
* name is `options.name`, else the plan's own `name`, else the name of the
|
|
273
|
+
* file without `.json`: see `swarmPlanName`.
|
|
274
|
+
*
|
|
275
|
+
* Throws a `CliError` that names the file as it was given when the file is
|
|
276
|
+
* missing, cannot be read, is over `MAX_PLAN_BYTES`, is not JSON, or holds a
|
|
277
|
+
* plan with problems: then the message has one line per problem.
|
|
278
|
+
*/
|
|
279
|
+
export function readSwarmPlan(file, options = {}) {
|
|
280
|
+
let text;
|
|
281
|
+
let size;
|
|
282
|
+
try {
|
|
283
|
+
// Asked before reading: a file over the limit is refused without being read, let alone parsed.
|
|
284
|
+
size = statSync(file).size;
|
|
285
|
+
if (size <= MAX_PLAN_BYTES) {
|
|
286
|
+
// Counted again once read: a pipe says it holds 0 bytes, whatever comes through it.
|
|
287
|
+
const bytes = readFileSync(file);
|
|
288
|
+
size = bytes.length;
|
|
289
|
+
if (size <= MAX_PLAN_BYTES)
|
|
290
|
+
text = bytes.toString('utf8');
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
const { code, message } = error;
|
|
295
|
+
throw new CliError(code === 'ENOENT'
|
|
296
|
+
? `Plan file "${file}" does not exist.`
|
|
297
|
+
: `Plan file "${file}" cannot be read: ${message}`);
|
|
298
|
+
}
|
|
299
|
+
if (text === undefined) {
|
|
300
|
+
throw new CliError(`Plan file "${file}" is ${size} bytes; a plan file is at most 4 MB (${MAX_PLAN_BYTES} bytes).`);
|
|
301
|
+
}
|
|
302
|
+
let plan;
|
|
303
|
+
try {
|
|
304
|
+
plan = JSON.parse(text);
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
// The parser quotes the file, which may hold anything.
|
|
308
|
+
throw new CliError(`Plan file "${file}" is not JSON: ${inertText(error.message)}`);
|
|
309
|
+
}
|
|
310
|
+
// A string: there is a file, so at the least there is the name the file gives.
|
|
311
|
+
const name = swarmPlanName(plan, { name: options.name, file });
|
|
312
|
+
const { request, problems } = inspectPlan(plan, name);
|
|
313
|
+
if (request === null) {
|
|
314
|
+
throw new CliError([
|
|
315
|
+
`Plan file "${file}" has ${count(problems.length, 'problem')}:`,
|
|
316
|
+
...listed(problems).map((problem) => `- ${problem}`),
|
|
317
|
+
].join('\n'));
|
|
318
|
+
}
|
|
319
|
+
return request;
|
|
320
|
+
}
|
|
321
|
+
//# sourceMappingURL=swarm-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm-plan.js","sourceRoot":"","sources":["../../src/utils/swarm-plan.ts"],"names":[],"mappings":"AA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,IAAI,EAAE,IAAI,CAAC,CAAC;IACtD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,QAAQ,CAAC;YACjB,cAAc,IAAI,SAAS,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG;YAC/D,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;SACrD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SandboxInfo } from '@stateset/sandbox-sdk';
|
|
2
|
+
import type { CliClient } from '../client.js';
|
|
3
|
+
export interface CreateRequest {
|
|
4
|
+
/** The POST /sandbox/create fields, `template` among them when one was asked for. */
|
|
5
|
+
fields: Record<string, unknown>;
|
|
6
|
+
startupTimeoutMs: number;
|
|
7
|
+
/** False when `--startup-timeout` was left at its default; setup then gets its own time on top of it. */
|
|
8
|
+
startupTimeoutChosen: boolean;
|
|
9
|
+
/** Called before the template route is, with how long its answer is waited for. */
|
|
10
|
+
onSetup?: (waitMs: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface CreatedSandbox {
|
|
13
|
+
sandbox: SandboxInfo;
|
|
14
|
+
/** Setup steps the API reported as failed, in its words. The sandbox exists all the same. */
|
|
15
|
+
setupWarnings: string[];
|
|
16
|
+
}
|
|
17
|
+
/** The 400 of POST /sandbox/create for a template that writes files or runs setup commands. */
|
|
18
|
+
export declare function needsTemplateRoute(error: unknown): boolean;
|
|
19
|
+
/** The template route's body for these create fields; throws, naming the flags, if it has no field for one. */
|
|
20
|
+
export declare function templateRouteFields(template: string, fields: Record<string, unknown>): Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* How long the template route's answer is waited for. Setup runs inside the
|
|
23
|
+
* request, so a `--startup-timeout` left at its default is given a setup
|
|
24
|
+
* command's time on top; one the caller chose is kept as the whole wait.
|
|
25
|
+
*/
|
|
26
|
+
export declare function setupWaitMs(startupTimeoutMs: number, startupTimeoutChosen: boolean): number;
|
|
27
|
+
/** Create a sandbox, from the template route when the API asks for it. */
|
|
28
|
+
export declare function createSandbox(client: CliClient, request: CreateRequest): Promise<CreatedSandbox>;
|
|
29
|
+
/** Spinner text while the template route creates the sandbox and runs the template's setup. */
|
|
30
|
+
export declare function setupProgressText(template: string, waitMs: number): string;
|
|
31
|
+
/**
|
|
32
|
+
* Print the setup steps that failed, and what became of the sandbox, to
|
|
33
|
+
* stderr so stdout/JSON output stays clean.
|
|
34
|
+
*/
|
|
35
|
+
export declare function printSetupFailure(warnings: string[], sandboxFate: string): void;
|
|
36
|
+
//# sourceMappingURL=template-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-create.d.ts","sourceRoot":"","sources":["../../src/utils/template-create.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA+B9C,MAAM,WAAW,aAAa;IAC5B,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,yGAAyG;IACzG,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mFAAmF;IACnF,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,6FAA6F;IAC7F,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM1D;AAED,+GAA+G;AAC/G,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkB9G;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,gBAAgB,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,GAAG,MAAM,CAE3F;AAED,0EAA0E;AAC1E,wBAAsB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAuBtG;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG1E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAM/E"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--template <id>` on `sandbox create` and `run`.
|
|
3
|
+
*
|
|
4
|
+
* POST /sandbox/create takes `template` for the templates that only pick an
|
|
5
|
+
* image and defaults. It refuses the ones that write files or run setup
|
|
6
|
+
* commands with a 400 naming POST /sandbox/create-from-template, the route
|
|
7
|
+
* that does both. GET /templates does not say which kind a template is (its
|
|
8
|
+
* list view leaves out `files` and `setup_commands`), so the create is sent
|
|
9
|
+
* first and the template route is used only on that refusal, which made no
|
|
10
|
+
* sandbox. Neither request is sent a second time by the CLI.
|
|
11
|
+
*/
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import { CliError, wrapError } from './errors.js';
|
|
14
|
+
/** What the API allows one setup command (TEMPLATE_SETUP_COMMAND_TIMEOUT_MS); no built-in template has more than one. */
|
|
15
|
+
const SETUP_COMMAND_TIMEOUT_MS = 300_000;
|
|
16
|
+
/** /sandbox/create fields the template route takes, under the name it takes them by. */
|
|
17
|
+
const TEMPLATE_ROUTE_FIELDS = {
|
|
18
|
+
timeout_seconds: 'timeout_seconds',
|
|
19
|
+
env: 'env',
|
|
20
|
+
cpus: 'override_cpus',
|
|
21
|
+
memory: 'override_memory',
|
|
22
|
+
image: 'image',
|
|
23
|
+
durable: 'durable',
|
|
24
|
+
resource_class: 'resource_class',
|
|
25
|
+
egress: 'egress',
|
|
26
|
+
budget: 'budget',
|
|
27
|
+
strict: 'strict',
|
|
28
|
+
};
|
|
29
|
+
/** The flags behind the create fields the template route has no field for. */
|
|
30
|
+
const UNSUPPORTED_FLAGS = {
|
|
31
|
+
isolation: '--isolation',
|
|
32
|
+
desktop_os: '--desktop-os',
|
|
33
|
+
credentials: '--credential',
|
|
34
|
+
ephemeral_storage: '--ephemeral-storage',
|
|
35
|
+
};
|
|
36
|
+
const unconfirmedHint = 'This CLI did not repeat the request. The sandbox may exist, with its setup still running: '
|
|
37
|
+
+ 'inspect `stateset sandbox list` before creating again.';
|
|
38
|
+
/** The 400 of POST /sandbox/create for a template that writes files or runs setup commands. */
|
|
39
|
+
export function needsTemplateRoute(error) {
|
|
40
|
+
const refusal = error;
|
|
41
|
+
return refusal?.status === 400
|
|
42
|
+
&& refusal.code === 'VALIDATION_ERROR'
|
|
43
|
+
&& refusal.details?.field === 'template'
|
|
44
|
+
&& String(refusal.message).includes('/sandbox/create-from-template');
|
|
45
|
+
}
|
|
46
|
+
/** The template route's body for these create fields; throws, naming the flags, if it has no field for one. */
|
|
47
|
+
export function templateRouteFields(template, fields) {
|
|
48
|
+
const body = {};
|
|
49
|
+
const unsupported = [];
|
|
50
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
51
|
+
if (value === undefined || key === 'template')
|
|
52
|
+
continue;
|
|
53
|
+
const name = TEMPLATE_ROUTE_FIELDS[key];
|
|
54
|
+
if (name)
|
|
55
|
+
body[name] = value;
|
|
56
|
+
else
|
|
57
|
+
unsupported.push(UNSUPPORTED_FLAGS[key] ?? key);
|
|
58
|
+
}
|
|
59
|
+
if (unsupported.length > 0) {
|
|
60
|
+
throw new CliError(`${unsupported.join(', ')} cannot be used with template "${template}": it writes files or runs setup commands, `
|
|
61
|
+
+ 'and POST /sandbox/create-from-template, which creates such a template, does not take '
|
|
62
|
+
+ `${unsupported.length > 1 ? 'these options' : 'this option'}`, { hint: `No sandbox was created. Leave out ${unsupported.join(', ')}, or choose a template without setup.` });
|
|
63
|
+
}
|
|
64
|
+
return body;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* How long the template route's answer is waited for. Setup runs inside the
|
|
68
|
+
* request, so a `--startup-timeout` left at its default is given a setup
|
|
69
|
+
* command's time on top; one the caller chose is kept as the whole wait.
|
|
70
|
+
*/
|
|
71
|
+
export function setupWaitMs(startupTimeoutMs, startupTimeoutChosen) {
|
|
72
|
+
return startupTimeoutChosen ? startupTimeoutMs : startupTimeoutMs + SETUP_COMMAND_TIMEOUT_MS;
|
|
73
|
+
}
|
|
74
|
+
/** Create a sandbox, from the template route when the API asks for it. */
|
|
75
|
+
export async function createSandbox(client, request) {
|
|
76
|
+
const { fields, startupTimeoutMs } = request;
|
|
77
|
+
const template = fields.template;
|
|
78
|
+
try {
|
|
79
|
+
return { sandbox: await client.sandbox.create({ startupTimeoutMs, ...fields }), setupWarnings: [] };
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (typeof template !== 'string' || !needsTemplateRoute(error))
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
const body = templateRouteFields(template, fields);
|
|
86
|
+
const waitMs = setupWaitMs(startupTimeoutMs, request.startupTimeoutChosen);
|
|
87
|
+
request.onSetup?.(waitMs);
|
|
88
|
+
try {
|
|
89
|
+
const sandbox = await client.sandbox.createFromTemplate(template, { startupTimeoutMs: waitMs, ...body });
|
|
90
|
+
return { sandbox, setupWarnings: sandbox.warnings ?? [] };
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
const failure = wrapError(error);
|
|
94
|
+
// A 4xx is a refusal. After a timeout, a dropped connection or a 5xx the
|
|
95
|
+
// sandbox may have been made.
|
|
96
|
+
const status = error?.status;
|
|
97
|
+
if (!(typeof status === 'number' && status >= 400 && status < 500))
|
|
98
|
+
failure.hint = unconfirmedHint;
|
|
99
|
+
throw failure;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Spinner text while the template route creates the sandbox and runs the template's setup. */
|
|
103
|
+
export function setupProgressText(template, waitMs) {
|
|
104
|
+
return `Creating sandbox and running the setup of template ${template} (its files and setup commands); `
|
|
105
|
+
+ `waiting up to ${Math.round(waitMs / 1000)}s...`;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Print the setup steps that failed, and what became of the sandbox, to
|
|
109
|
+
* stderr so stdout/JSON output stays clean.
|
|
110
|
+
*/
|
|
111
|
+
export function printSetupFailure(warnings, sandboxFate) {
|
|
112
|
+
console.error(chalk.yellow(`Template setup failed (${warnings.length}):`));
|
|
113
|
+
for (const warning of warnings) {
|
|
114
|
+
console.error(chalk.yellow(` - ${warning}`));
|
|
115
|
+
}
|
|
116
|
+
console.error(sandboxFate);
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=template-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-create.js","sourceRoot":"","sources":["../../src/utils/template-create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAElD,yHAAyH;AACzH,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAEzC,wFAAwF;AACxF,MAAM,qBAAqB,GAA2B;IACpD,eAAe,EAAE,iBAAiB;IAClC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,MAA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2
|
-
export type ActionId = 'create' | 'execute' | 'interpret' | 'files' | 'history' | 'launch' | 'tasks' | 'delegate' | 'workers' | 'pause' | 'resume' | 'extend' | 'stop' | 'details' | 'overview' | 'activity' | 'connection' | 'refresh' | 'credits' | 'subscription' | 'help' | 'registry' | 'inputBatches';
|
|
2
|
+
export type ActionId = 'create' | 'execute' | 'interpret' | 'files' | 'history' | 'launch' | 'tasks' | 'delegate' | 'workers' | 'pause' | 'resume' | 'extend' | 'stop' | 'details' | 'overview' | 'activity' | 'connection' | 'refresh' | 'credits' | 'subscription' | 'help' | 'registry' | 'inputBatches' | 'agents';
|
|
3
3
|
export interface WorkbenchAction {
|
|
4
4
|
id: ActionId;
|
|
5
5
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/workbench/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAC9K,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/workbench/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAC9K,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,GAAG,QAAQ,CAAC;AACtI,MAAM,WAAW,eAAe;IAAG,EAAE,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;AAC9F,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,EAAE,CAgC1E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,KAAK,SAAK,GAAG,eAAe,EAAE,CAIvF"}
|
|
@@ -22,6 +22,7 @@ export function workbenchActions(context) {
|
|
|
22
22
|
{ id: 'stop', key: 'd', label: 'Stop sandbox', reason: target },
|
|
23
23
|
{ id: 'details', key: 'Enter', label: 'Sandbox details', reason: !row ? 'Select an available sandbox.' : undefined },
|
|
24
24
|
{ id: 'overview', key: 'o', label: 'Account overview' },
|
|
25
|
+
{ id: 'agents', key: 'v', label: 'Agents by fleet and workbench' },
|
|
25
26
|
{ id: 'activity', key: 'a', label: 'Session activity' },
|
|
26
27
|
{ id: 'connection', key: 'c', label: 'Connection diagnostics' },
|
|
27
28
|
{ id: 'refresh', key: 'r', label: 'Refresh sandboxes' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/workbench/actions.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,gBAAgB,CAAC,OAAsB;IACrD,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACnE,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClG,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,iDAAiD,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC9J,MAAM,MAAM,GAAG,WAAW,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAClF,MAAM,KAAK,GAAG,GAAG,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;IACxC,OAAO;QACL,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE;QACxE,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;QACtI,EAAE,EAAE,EAAE,W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