@computesdk/cli 2.6.2 → 2.6.3
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/README.md +17 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,23 @@ compute sandboxes exec sb1 uname -a
|
|
|
55
55
|
compute sandboxes spawn sb1 --cwd /app -e NODE_ENV=production -- npm run dev
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
## Managed-agent persistence
|
|
59
|
+
|
|
60
|
+
`compute agents run <agent>` starts a conversation. On platforms with managed
|
|
61
|
+
Archil storage, the first run provisions the agent's disk automatically.
|
|
62
|
+
After its turn finishes, `compute agents stop <sessionId>` flushes storage and
|
|
63
|
+
releases compute. Resume that conversation, including Pi history and workspace:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
compute agents run my-agent --resume <sessionId>
|
|
67
|
+
compute agents run my-agent "Continue the task" --resume <sessionId>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Resume preserves the session ID and event journal but acquires a new sandbox.
|
|
71
|
+
Only one session per agent can be active at a time. Legacy sessions without
|
|
72
|
+
persistent state cannot be recovered retroactively. Requires the platform's
|
|
73
|
+
managed-volume/resume API; no account storage credentials are needed in the CLI.
|
|
74
|
+
|
|
58
75
|
## Migrating from @computesdk/cli 1.x
|
|
59
76
|
|
|
60
77
|
v2 removes the legacy console authentication and its commands:
|
package/dist/index.js
CHANGED
|
@@ -3710,13 +3710,13 @@ function registerAgentsCommands(program2) {
|
|
|
3710
3710
|
}
|
|
3711
3711
|
);
|
|
3712
3712
|
authOpts(
|
|
3713
|
-
cmd.command("run <ref> [message]").description("Start a session on a routed sandbox and optionally send a first message").option("--size <size>", "platform size for the session's sandbox")
|
|
3713
|
+
cmd.command("run <ref> [message]").description("Start a session on a routed sandbox and optionally send a first message").option("--resume <sessionId>", "resume a stopped conversation on a new sandbox using its persistent disk").option("--size <size>", "platform size for the session's sandbox")
|
|
3714
3714
|
).action(async (ref, message, opts) => {
|
|
3715
3715
|
try {
|
|
3716
3716
|
const c = await client(opts);
|
|
3717
3717
|
const res = await c.post(
|
|
3718
3718
|
`/api/v1/agents/${encodeURIComponent(ref)}/sessions`,
|
|
3719
|
-
{ message, size: opts.size }
|
|
3719
|
+
{ message, size: opts.size, resumeSessionId: opts.resume }
|
|
3720
3720
|
);
|
|
3721
3721
|
output(opts, res, (r) => {
|
|
3722
3722
|
printSession(r.session);
|