@stateset/sandbox-cli 3.4.0 → 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 +52 -0
- package/README.md +119 -43
- package/dist/client.d.ts +103 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +11 -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/sandbox.d.ts.map +1 -1
- package/dist/commands/sandbox.js +160 -1
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/swarm.d.ts +8 -2
- package/dist/commands/swarm.d.ts.map +1 -1
- package/dist/commands/swarm.js +109 -18
- package/dist/commands/swarm.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/template-create.d.ts.map +1 -1
- package/dist/utils/template-create.js +2 -0
- package/dist/utils/template-create.js.map +1 -1
- package/package.json +15 -7
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the status file of a swarm dispatcher and say in one line what the
|
|
3
|
+
* dispatcher is doing, and why it takes nothing from its backlog if it waits
|
|
4
|
+
* (`--dispatcher <home-dir>` on `stateset swarm list|get|watch`).
|
|
5
|
+
*
|
|
6
|
+
* A swarm dispatcher (examples/claude-agent/swarm-dispatch.mjs,
|
|
7
|
+
* docs/guides/SWARM_DISPATCHER_GUIDE.md) is a local process that works through
|
|
8
|
+
* a home directory. It reports nothing to the service: what it does is in
|
|
9
|
+
* `<home-dir>/status.json`, which it replaces by a rename after every change
|
|
10
|
+
* and at every look. That file is the only one read here, and it is read on
|
|
11
|
+
* this machine: the process it names is looked for among this machine's.
|
|
12
|
+
*
|
|
13
|
+
* The file is another program's, and older and newer dispatchers write it:
|
|
14
|
+
* `limit` is any string, fields not named here are not looked at, and a
|
|
15
|
+
* `waiting` without `limit` or `since` is still a reason. Every text taken
|
|
16
|
+
* from the file is printed on one line, with nothing a terminal acts on.
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
19
|
+
import { join, resolve } from 'node:path';
|
|
20
|
+
import { inertText } from '../workbench/text.js';
|
|
21
|
+
/** The name of the status file in a dispatcher's home directory. */
|
|
22
|
+
export const STATUS_FILE = 'status.json';
|
|
23
|
+
/** The largest status file that is read, in bytes: 16 MB. */
|
|
24
|
+
export const MAX_STATUS_BYTES = 16 * 1024 * 1024;
|
|
25
|
+
const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
26
|
+
/** A text of the file on one line, without what a terminal acts on; undefined for what is no text, or a blank one. */
|
|
27
|
+
function oneLine(value) {
|
|
28
|
+
if (typeof value !== 'string')
|
|
29
|
+
return undefined;
|
|
30
|
+
return inertText(value.replace(/\s+/g, ' ').trim()) || undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Whether a process of this machine is alive. Signal 0 sends nothing and
|
|
34
|
+
* asks only whether it could be sent: `EPERM` means that the process is
|
|
35
|
+
* there and belongs to another user.
|
|
36
|
+
*/
|
|
37
|
+
export function processAlive(pid) {
|
|
38
|
+
try {
|
|
39
|
+
process.kill(pid, 0);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return error.code === 'EPERM';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** The status file as text, or why there is none to print: the words that go into the brackets of the line. */
|
|
47
|
+
function readStatusFile(home) {
|
|
48
|
+
const file = join(home, STATUS_FILE);
|
|
49
|
+
try {
|
|
50
|
+
// Asked before reading: what is not a file (a pipe would never end) or is over the limit is not read.
|
|
51
|
+
const stats = statSync(file);
|
|
52
|
+
if (!stats.isFile())
|
|
53
|
+
return { why: `${STATUS_FILE} in that directory is not a file` };
|
|
54
|
+
if (stats.size > MAX_STATUS_BYTES) {
|
|
55
|
+
return { why: `${STATUS_FILE} is ${stats.size} bytes; at most ${MAX_STATUS_BYTES} are read` };
|
|
56
|
+
}
|
|
57
|
+
return { text: readFileSync(file, 'utf8') };
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const { code } = error;
|
|
61
|
+
if (code === 'ENOENT') {
|
|
62
|
+
// Asked of the directory the line names: an empty value is the current directory, and `existsSync('')` is false.
|
|
63
|
+
return { why: existsSync(resolve(home)) ? `no ${STATUS_FILE} in that directory` : 'that directory does not exist' };
|
|
64
|
+
}
|
|
65
|
+
if (code === 'ENOTDIR')
|
|
66
|
+
return { why: 'that is not a directory' };
|
|
67
|
+
// The code and not the message, which names the path: the line has it already.
|
|
68
|
+
return { why: `${STATUS_FILE} cannot be read: ${code ?? 'unknown error'}` };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The line for the dispatcher with this home directory. `<home>` is the
|
|
73
|
+
* directory made absolute:
|
|
74
|
+
*
|
|
75
|
+
* - `Dispatcher <home>: waiting since <since> (<limit>): <reason>` when the
|
|
76
|
+
* file says a dispatcher is running, that process is alive, and `waiting`
|
|
77
|
+
* has a `reason`. These are the words of the dispatcher's own `status`.
|
|
78
|
+
* `since <since>` is left out without `since`, the brackets without
|
|
79
|
+
* `limit`. The reason is printed whole: it says what releases the limit.
|
|
80
|
+
* - `Dispatcher <home>: <state>.` when it is running and alive and `waiting`
|
|
81
|
+
* is `null` or absent, or has no reason.
|
|
82
|
+
* - `Dispatcher <home>: not running (status.json says "<state>", written
|
|
83
|
+
* <updated_at>).` when the file says no dispatcher is running, or the
|
|
84
|
+
* process it names is gone. A reason in the file is not shown: a
|
|
85
|
+
* dispatcher that is gone waits for nothing.
|
|
86
|
+
* - `Dispatcher <home>: no status could be read (<why>).` when the file is
|
|
87
|
+
* missing, cannot be read, is not JSON, or is no status: no object, no
|
|
88
|
+
* `state`, no `dispatcher` object, or a running dispatcher without a
|
|
89
|
+
* process id, which could not be looked for.
|
|
90
|
+
*
|
|
91
|
+
* Never throws. `options.alive` says whether a process is alive (default:
|
|
92
|
+
* `processAlive`); it is asked once, and only for a dispatcher the file calls
|
|
93
|
+
* running.
|
|
94
|
+
*/
|
|
95
|
+
export function dispatcherLine(home, options = {}) {
|
|
96
|
+
const start = `Dispatcher ${inertText(resolve(home))}:`;
|
|
97
|
+
const unreadable = (why) => ({ situation: 'unreadable', line: `${start} no status could be read (${why}).` });
|
|
98
|
+
const read = readStatusFile(home);
|
|
99
|
+
if ('why' in read)
|
|
100
|
+
return unreadable(read.why);
|
|
101
|
+
let status;
|
|
102
|
+
try {
|
|
103
|
+
status = JSON.parse(read.text);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return unreadable(`${STATUS_FILE} is not JSON`);
|
|
107
|
+
}
|
|
108
|
+
const state = isObject(status) ? oneLine(status.state) : undefined;
|
|
109
|
+
if (!isObject(status) || state === undefined || !isObject(status.dispatcher)) {
|
|
110
|
+
return unreadable(`${STATUS_FILE} is not a dispatcher's status`);
|
|
111
|
+
}
|
|
112
|
+
const { running, pid } = status.dispatcher;
|
|
113
|
+
if (running === true) {
|
|
114
|
+
// Nothing but a process id is asked about: 0 and a negative number name groups of processes.
|
|
115
|
+
if (typeof pid !== 'number' || !Number.isSafeInteger(pid) || pid <= 0) {
|
|
116
|
+
return unreadable(`${STATUS_FILE} says a dispatcher is running and names no process`);
|
|
117
|
+
}
|
|
118
|
+
if ((options.alive ?? processAlive)(pid)) {
|
|
119
|
+
const waiting = isObject(status.waiting) ? status.waiting : {};
|
|
120
|
+
const reason = oneLine(waiting.reason);
|
|
121
|
+
if (reason === undefined)
|
|
122
|
+
return { situation: 'running', line: `${start} ${state}.` };
|
|
123
|
+
const since = oneLine(waiting.since);
|
|
124
|
+
const limit = oneLine(waiting.limit);
|
|
125
|
+
return {
|
|
126
|
+
situation: 'waiting',
|
|
127
|
+
line: `${start} waiting${since === undefined ? '' : ` since ${since}`}${limit === undefined ? '' : ` (${limit})`}: ${reason}`,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const written = oneLine(status.updated_at);
|
|
132
|
+
return {
|
|
133
|
+
situation: 'not-running',
|
|
134
|
+
line: `${start} not running (${STATUS_FILE} says "${state}"${written === undefined ? '' : `, written ${written}`}).`,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=swarm-dispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swarm-dispatcher.js","sourceRoot":"","sources":["../../src/utils/swarm-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,oEAAoE;AACpE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAajD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE,sHAAsH;AACtH,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ;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AC,CAAC;IAC3C,OAAO;QACL,SAAS,EAAE,aAAa;QACxB,IAAI,EAAE,GAAG,KAAK,iBAAiB,WAAW,UAAU,KAAK,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,OAAO,EAAE,IAAI;KACrH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +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;
|
|
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"}
|
|
@@ -24,12 +24,14 @@ const TEMPLATE_ROUTE_FIELDS = {
|
|
|
24
24
|
resource_class: 'resource_class',
|
|
25
25
|
egress: 'egress',
|
|
26
26
|
budget: 'budget',
|
|
27
|
+
strict: 'strict',
|
|
27
28
|
};
|
|
28
29
|
/** The flags behind the create fields the template route has no field for. */
|
|
29
30
|
const UNSUPPORTED_FLAGS = {
|
|
30
31
|
isolation: '--isolation',
|
|
31
32
|
desktop_os: '--desktop-os',
|
|
32
33
|
credentials: '--credential',
|
|
34
|
+
ephemeral_storage: '--ephemeral-storage',
|
|
33
35
|
};
|
|
34
36
|
const unconfirmedHint = 'This CLI did not repeat the request. The sandbox may exist, with its setup still running: '
|
|
35
37
|
+ 'inspect `stateset sandbox list` before creating again.';
|
|
@@ -1 +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;AAC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AqC,EAAE,MAAM,CAAC;QAC9D,IAAI,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC;QACnG,MAAM,OAAO,CAAC;IAChB,CAAC;AACH,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,iBAAiB,CAAC,QAAgB,EAAE,MAAc;IAChE,OAAO,sDAAsD,QAAQ,mCAAmC;UACpG,iBAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAkB,EAAE,WAAmB;IACvE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0BAA0B,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;IAC3E,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stateset/sandbox-cli",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.6.0",
|
|
4
|
+
"description": "Create, drive and script StateSet sandboxes and agent sessions from the terminal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"stateset": "./dist/index.js",
|
|
@@ -21,24 +21,26 @@
|
|
|
21
21
|
"typecheck": "npm run check:node && tsc --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@stateset/sandbox-sdk": "^2.
|
|
24
|
+
"@stateset/sandbox-sdk": "^2.17.0",
|
|
25
25
|
"chalk": "^5.4.0",
|
|
26
26
|
"commander": "^14.0.0",
|
|
27
|
-
"conf": "^
|
|
27
|
+
"conf": "^15.1.0",
|
|
28
28
|
"inquirer": "^12.0.0",
|
|
29
29
|
"ora": "^9.1.0",
|
|
30
30
|
"string-width": "^8.1.1",
|
|
31
31
|
"table": "^6.9.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
+
"@eslint/js": "^9.39.5",
|
|
34
35
|
"@types/node": "^22.15.0",
|
|
35
36
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
36
37
|
"@typescript-eslint/parser": "^8.0.0",
|
|
37
|
-
"@vitest/coverage-v8": "^
|
|
38
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
38
39
|
"eslint": "^9.0.0",
|
|
40
|
+
"globals": "^14.0.0",
|
|
39
41
|
"tsx": "^4.19.0",
|
|
40
42
|
"typescript": "^5.7.0",
|
|
41
|
-
"vitest": "^
|
|
43
|
+
"vitest": "^4.1.12"
|
|
42
44
|
},
|
|
43
45
|
"engines": {
|
|
44
46
|
"node": "^20.19.0 || >=22.12.0"
|
|
@@ -60,7 +62,13 @@
|
|
|
60
62
|
"ai",
|
|
61
63
|
"agent",
|
|
62
64
|
"repl",
|
|
63
|
-
"ssh"
|
|
65
|
+
"ssh",
|
|
66
|
+
"claude-code",
|
|
67
|
+
"code-execution",
|
|
68
|
+
"cloud-sandbox",
|
|
69
|
+
"ai-agents",
|
|
70
|
+
"terminal",
|
|
71
|
+
"agent-sandbox"
|
|
64
72
|
],
|
|
65
73
|
"publishConfig": {
|
|
66
74
|
"access": "public"
|