@mutagent/sdk 0.3.41 → 0.3.42
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 +14 -8
- package/dist/commonjs/funcs/sandbox-get-api-sandbox-by-id-checkpoints.d.ts +18 -0
- package/dist/commonjs/funcs/sandbox-get-api-sandbox-by-id-checkpoints.d.ts.map +1 -0
- package/dist/commonjs/funcs/sandbox-get-api-sandbox-by-id-checkpoints.js +124 -0
- package/dist/commonjs/funcs/sandbox-get-api-sandbox-by-id-checkpoints.js.map +1 -0
- package/dist/commonjs/funcs/sandbox-get-api-sandbox-by-id-stream.d.ts +1 -1
- package/dist/commonjs/funcs/sandbox-get-api-sandbox-by-id-stream.js +1 -1
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-checkpoint.d.ts +18 -0
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-checkpoint.d.ts.map +1 -0
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-checkpoint.js +125 -0
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-checkpoint.js.map +1 -0
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-restore.d.ts +18 -0
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-restore.d.ts.map +1 -0
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-restore.js +125 -0
- package/dist/commonjs/funcs/sandbox-post-api-sandbox-by-id-restore.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/definition-provider.d.ts +35 -0
- package/dist/commonjs/models/definition-provider.d.ts.map +1 -1
- package/dist/commonjs/models/definition-provider.js +21 -1
- package/dist/commonjs/models/definition-provider.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +5 -3
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +5 -3
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/mode-arm-args.d.ts +62 -0
- package/dist/commonjs/models/mode-arm-args.d.ts.map +1 -0
- package/dist/commonjs/models/mode-arm-args.js +64 -0
- package/dist/commonjs/models/mode-arm-args.js.map +1 -0
- package/dist/commonjs/models/name-image-arch.d.ts +35 -0
- package/dist/commonjs/models/name-image-arch.d.ts.map +1 -1
- package/dist/commonjs/models/name-image-arch.js +21 -1
- package/dist/commonjs/models/name-image-arch.js.map +1 -1
- package/dist/commonjs/models/operations/get-api-sandbox-by-id-checkpoints.d.ts +38 -0
- package/dist/commonjs/models/operations/get-api-sandbox-by-id-checkpoints.d.ts.map +1 -0
- package/dist/commonjs/models/operations/get-api-sandbox-by-id-checkpoints.js +74 -0
- package/dist/commonjs/models/operations/get-api-sandbox-by-id-checkpoints.js.map +1 -0
- package/dist/commonjs/models/operations/get-api-sandbox-by-id.d.ts +1 -1
- package/dist/commonjs/models/operations/get-api-sandbox-by-id.js +1 -1
- package/dist/commonjs/models/operations/get-api-sandbox.d.ts +1 -1
- package/dist/commonjs/models/operations/get-api-sandbox.js +1 -1
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-checkpoint.d.ts +83 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-checkpoint.d.ts.map +1 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-checkpoint.js +77 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-checkpoint.js.map +1 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-restore.d.ts +151 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-restore.d.ts.map +1 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-restore.js +121 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-restore.js.map +1 -0
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-session.d.ts +7 -3
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-session.d.ts.map +1 -1
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-session.js +3 -2
- package/dist/commonjs/models/operations/post-api-sandbox-by-id-session.js.map +1 -1
- package/dist/commonjs/models/operations/post-api-sandbox.d.ts +1 -1
- package/dist/commonjs/models/operations/post-api-sandbox.js +1 -1
- package/dist/commonjs/models/operations/update-organization-member.d.ts +1 -1
- package/dist/commonjs/models/operations/update-organization-member.js +1 -1
- package/dist/commonjs/models/operations/update-workspace-member.d.ts +1 -1
- package/dist/commonjs/models/operations/update-workspace-member.d.ts.map +1 -1
- package/dist/commonjs/models/operations/update-workspace-member.js +1 -1
- package/dist/commonjs/models/operations/update-workspace-member.js.map +1 -1
- package/dist/commonjs/models/preset-timeout-ms-keep2.d.ts +10 -0
- package/dist/commonjs/models/preset-timeout-ms-keep2.d.ts.map +1 -1
- package/dist/commonjs/models/preset-timeout-ms-keep2.js +2 -0
- package/dist/commonjs/models/preset-timeout-ms-keep2.js.map +1 -1
- package/dist/commonjs/models/schemadefaul11.d.ts +9 -0
- package/dist/commonjs/models/schemadefaul11.d.ts.map +1 -0
- package/dist/commonjs/models/{schemadefaul8.js → schemadefaul11.js} +9 -9
- package/dist/commonjs/models/schemadefaul11.js.map +1 -0
- package/dist/commonjs/models/schemadefaul5.d.ts +7 -4
- package/dist/commonjs/models/schemadefaul5.d.ts.map +1 -1
- package/dist/commonjs/models/schemadefaul5.js +8 -5
- package/dist/commonjs/models/schemadefaul5.js.map +1 -1
- package/dist/commonjs/models/schemadefaul6.d.ts +7 -5
- package/dist/commonjs/models/schemadefaul6.d.ts.map +1 -1
- package/dist/commonjs/models/schemadefaul6.js +7 -7
- package/dist/commonjs/models/schemadefaul6.js.map +1 -1
- package/dist/commonjs/models/schemadefaul7.d.ts +13 -0
- package/dist/commonjs/models/schemadefaul7.d.ts.map +1 -0
- package/dist/commonjs/models/{schemadefaul4.js → schemadefaul7.js} +11 -13
- package/dist/commonjs/models/schemadefaul7.js.map +1 -0
- package/dist/commonjs/models/schemadefaul9.d.ts +10 -0
- package/dist/commonjs/models/schemadefaul9.d.ts.map +1 -0
- package/dist/commonjs/models/{mode-args-env.js → schemadefaul9.js} +10 -13
- package/dist/commonjs/models/schemadefaul9.js.map +1 -0
- package/dist/commonjs/models/snapshot-id-definition-partial.d.ts +40 -0
- package/dist/commonjs/models/snapshot-id-definition-partial.d.ts.map +1 -0
- package/dist/commonjs/models/snapshot-id-definition-partial.js +63 -0
- package/dist/commonjs/models/snapshot-id-definition-partial.js.map +1 -0
- package/dist/commonjs/sdk/sandbox.d.ts +34 -13
- package/dist/commonjs/sdk/sandbox.d.ts.map +1 -1
- package/dist/commonjs/sdk/sandbox.js +47 -17
- package/dist/commonjs/sdk/sandbox.js.map +1 -1
- package/dist/esm/funcs/sandbox-get-api-sandbox-by-id-checkpoints.d.ts +18 -0
- package/dist/esm/funcs/sandbox-get-api-sandbox-by-id-checkpoints.d.ts.map +1 -0
- package/dist/esm/funcs/sandbox-get-api-sandbox-by-id-checkpoints.js +88 -0
- package/dist/esm/funcs/sandbox-get-api-sandbox-by-id-checkpoints.js.map +1 -0
- package/dist/esm/funcs/sandbox-get-api-sandbox-by-id-stream.d.ts +1 -1
- package/dist/esm/funcs/sandbox-get-api-sandbox-by-id-stream.js +1 -1
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-checkpoint.d.ts +18 -0
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-checkpoint.d.ts.map +1 -0
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-checkpoint.js +89 -0
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-checkpoint.js.map +1 -0
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-restore.d.ts +18 -0
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-restore.d.ts.map +1 -0
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-restore.js +89 -0
- package/dist/esm/funcs/sandbox-post-api-sandbox-by-id-restore.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/definition-provider.d.ts +35 -0
- package/dist/esm/models/definition-provider.d.ts.map +1 -1
- package/dist/esm/models/definition-provider.js +19 -0
- package/dist/esm/models/definition-provider.js.map +1 -1
- package/dist/esm/models/index.d.ts +5 -3
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +5 -3
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/mode-arm-args.d.ts +62 -0
- package/dist/esm/models/mode-arm-args.d.ts.map +1 -0
- package/dist/esm/models/mode-arm-args.js +26 -0
- package/dist/esm/models/mode-arm-args.js.map +1 -0
- package/dist/esm/models/name-image-arch.d.ts +35 -0
- package/dist/esm/models/name-image-arch.d.ts.map +1 -1
- package/dist/esm/models/name-image-arch.js +19 -0
- package/dist/esm/models/name-image-arch.js.map +1 -1
- package/dist/esm/models/operations/get-api-sandbox-by-id-checkpoints.d.ts +38 -0
- package/dist/esm/models/operations/get-api-sandbox-by-id-checkpoints.d.ts.map +1 -0
- package/dist/esm/models/operations/get-api-sandbox-by-id-checkpoints.js +35 -0
- package/dist/esm/models/operations/get-api-sandbox-by-id-checkpoints.js.map +1 -0
- package/dist/esm/models/operations/get-api-sandbox-by-id.d.ts +1 -1
- package/dist/esm/models/operations/get-api-sandbox-by-id.js +1 -1
- package/dist/esm/models/operations/get-api-sandbox.d.ts +1 -1
- package/dist/esm/models/operations/get-api-sandbox.js +1 -1
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/post-api-sandbox-by-id-checkpoint.d.ts +83 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-checkpoint.d.ts.map +1 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-checkpoint.js +38 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-checkpoint.js.map +1 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-restore.d.ts +151 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-restore.d.ts.map +1 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-restore.js +80 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-restore.js.map +1 -0
- package/dist/esm/models/operations/post-api-sandbox-by-id-session.d.ts +7 -3
- package/dist/esm/models/operations/post-api-sandbox-by-id-session.d.ts.map +1 -1
- package/dist/esm/models/operations/post-api-sandbox-by-id-session.js +3 -2
- package/dist/esm/models/operations/post-api-sandbox-by-id-session.js.map +1 -1
- package/dist/esm/models/operations/post-api-sandbox.d.ts +1 -1
- package/dist/esm/models/operations/post-api-sandbox.js +1 -1
- package/dist/esm/models/operations/update-organization-member.d.ts +1 -1
- package/dist/esm/models/operations/update-organization-member.js +1 -1
- package/dist/esm/models/operations/update-workspace-member.d.ts +1 -1
- package/dist/esm/models/operations/update-workspace-member.d.ts.map +1 -1
- package/dist/esm/models/operations/update-workspace-member.js +1 -1
- package/dist/esm/models/operations/update-workspace-member.js.map +1 -1
- package/dist/esm/models/preset-timeout-ms-keep2.d.ts +10 -0
- package/dist/esm/models/preset-timeout-ms-keep2.d.ts.map +1 -1
- package/dist/esm/models/preset-timeout-ms-keep2.js +2 -0
- package/dist/esm/models/preset-timeout-ms-keep2.js.map +1 -1
- package/dist/esm/models/schemadefaul11.d.ts +9 -0
- package/dist/esm/models/schemadefaul11.d.ts.map +1 -0
- package/dist/esm/models/schemadefaul11.js +13 -0
- package/dist/esm/models/schemadefaul11.js.map +1 -0
- package/dist/esm/models/schemadefaul5.d.ts +7 -4
- package/dist/esm/models/schemadefaul5.d.ts.map +1 -1
- package/dist/esm/models/schemadefaul5.js +7 -4
- package/dist/esm/models/schemadefaul5.js.map +1 -1
- package/dist/esm/models/schemadefaul6.d.ts +7 -5
- package/dist/esm/models/schemadefaul6.d.ts.map +1 -1
- package/dist/esm/models/schemadefaul6.js +6 -6
- package/dist/esm/models/schemadefaul6.js.map +1 -1
- package/dist/esm/models/schemadefaul7.d.ts +13 -0
- package/dist/esm/models/schemadefaul7.d.ts.map +1 -0
- package/dist/esm/models/schemadefaul7.js +15 -0
- package/dist/esm/models/schemadefaul7.js.map +1 -0
- package/dist/esm/models/schemadefaul9.d.ts +10 -0
- package/dist/esm/models/schemadefaul9.d.ts.map +1 -0
- package/dist/esm/models/schemadefaul9.js +14 -0
- package/dist/esm/models/schemadefaul9.js.map +1 -0
- package/dist/esm/models/snapshot-id-definition-partial.d.ts +40 -0
- package/dist/esm/models/snapshot-id-definition-partial.d.ts.map +1 -0
- package/dist/esm/models/snapshot-id-definition-partial.js +26 -0
- package/dist/esm/models/snapshot-id-definition-partial.js.map +1 -0
- package/dist/esm/sdk/sandbox.d.ts +34 -13
- package/dist/esm/sdk/sandbox.d.ts.map +1 -1
- package/dist/esm/sdk/sandbox.js +47 -17
- package/dist/esm/sdk/sandbox.js.map +1 -1
- package/package.json +1 -1
- package/src/funcs/sandbox-get-api-sandbox-by-id-checkpoints.ts +184 -0
- package/src/funcs/sandbox-get-api-sandbox-by-id-stream.ts +1 -1
- package/src/funcs/sandbox-post-api-sandbox-by-id-checkpoint.ts +186 -0
- package/src/funcs/sandbox-post-api-sandbox-by-id-restore.ts +186 -0
- package/src/lib/config.ts +2 -2
- package/src/models/definition-provider.ts +59 -0
- package/src/models/index.ts +5 -3
- package/src/models/mode-arm-args.ts +100 -0
- package/src/models/name-image-arch.ts +59 -0
- package/src/models/operations/get-api-sandbox-by-id-checkpoints.ts +97 -0
- package/src/models/operations/get-api-sandbox-by-id.ts +3 -3
- package/src/models/operations/get-api-sandbox.ts +3 -3
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/post-api-sandbox-by-id-checkpoint.ts +151 -0
- package/src/models/operations/post-api-sandbox-by-id-restore.ts +263 -0
- package/src/models/operations/post-api-sandbox-by-id-session.ts +14 -6
- package/src/models/operations/post-api-sandbox.ts +3 -3
- package/src/models/operations/update-organization-member.ts +3 -3
- package/src/models/operations/update-workspace-member.ts +3 -3
- package/src/models/preset-timeout-ms-keep2.ts +12 -0
- package/src/models/{schemadefaul8.ts → schemadefaul11.ts} +4 -3
- package/src/models/schemadefaul5.ts +7 -7
- package/src/models/schemadefaul6.ts +14 -6
- package/src/models/schemadefaul7.ts +25 -0
- package/src/models/schemadefaul9.ts +16 -0
- package/src/models/snapshot-id-definition-partial.ts +70 -0
- package/src/sdk/sandbox.ts +82 -28
- package/dist/commonjs/models/mode-args-env.d.ts +0 -35
- package/dist/commonjs/models/mode-args-env.d.ts.map +0 -1
- package/dist/commonjs/models/mode-args-env.js.map +0 -1
- package/dist/commonjs/models/schemadefaul4.d.ts +0 -15
- package/dist/commonjs/models/schemadefaul4.d.ts.map +0 -1
- package/dist/commonjs/models/schemadefaul4.js.map +0 -1
- package/dist/commonjs/models/schemadefaul8.d.ts +0 -9
- package/dist/commonjs/models/schemadefaul8.d.ts.map +0 -1
- package/dist/commonjs/models/schemadefaul8.js.map +0 -1
- package/dist/esm/models/mode-args-env.d.ts +0 -35
- package/dist/esm/models/mode-args-env.d.ts.map +0 -1
- package/dist/esm/models/mode-args-env.js +0 -16
- package/dist/esm/models/mode-args-env.js.map +0 -1
- package/dist/esm/models/schemadefaul4.d.ts +0 -15
- package/dist/esm/models/schemadefaul4.d.ts.map +0 -1
- package/dist/esm/models/schemadefaul4.js +0 -17
- package/dist/esm/models/schemadefaul4.js.map +0 -1
- package/dist/esm/models/schemadefaul8.d.ts +0 -9
- package/dist/esm/models/schemadefaul8.d.ts.map +0 -1
- package/dist/esm/models/schemadefaul8.js +0 -13
- package/dist/esm/models/schemadefaul8.js.map +0 -1
- package/src/models/mode-args-env.ts +0 -52
- package/src/models/schemadefaul4.ts +0 -24
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { MutagentCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { MutagentError } from "../models/errors/mutagent-error.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Rebuild this sandbox from a checkpoint, with full state
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* A cloud equivalent of a local `/resume`, and it does NOT require the old box to still exist — a reaped or torn-down sandbox is the ordinary input. In order: a fresh box is spawned for the SAME sandbox id at generation+1 with the same secret NAMES (values are re-minted, never stored); the relay's seq counter is seeded from the persisted high-water mark so a client's `?since=` cursor stays valid; the workspace and `$HOME/.mutagent` are extracted BEFORE Helix starts; a session is started in the checkpoint's cwd; the conversation is written in, its sha256 compared against the box's own, and only then switched onto; the runtime settings and pending queue are replayed; and a `session {status:"restored"}` frame is appended to the stream with a real seq. A digest mismatch is a 422 and the session is NOT switched. 404 if the snapshot is not in this workspace. Read `notRestored` — a restore that carried only the conversation is legitimate and says so there. A DEFAULTED restore uses the newest checkpoint that has a manifest and lists newer rows it passed over in `skippedSnapshots`. `partial: true` restores the incremental transcript prefix beyond the checkpoint when one exists (the frame then carries `partial: true`); its tail may end on a tool call with no result, which the harness answers with a synthetic error on the next turn — the accepted risk of asking for it.
|
|
35
|
+
*/
|
|
36
|
+
export function sandboxPostApiSandboxByIdRestore(
|
|
37
|
+
client: MutagentCore,
|
|
38
|
+
request: operations.PostApiSandboxByIdRestoreRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.PostApiSandboxByIdRestoreResponse,
|
|
43
|
+
| errors.ErrorMessage
|
|
44
|
+
| errors.ErrorMessageStatusCode
|
|
45
|
+
| MutagentError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: MutagentCore,
|
|
64
|
+
request: operations.PostApiSandboxByIdRestoreRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
operations.PostApiSandboxByIdRestoreResponse,
|
|
70
|
+
| errors.ErrorMessage
|
|
71
|
+
| errors.ErrorMessageStatusCode
|
|
72
|
+
| MutagentError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const parsed = safeParse(
|
|
85
|
+
request,
|
|
86
|
+
(value) =>
|
|
87
|
+
z.parse(
|
|
88
|
+
operations.PostApiSandboxByIdRestoreRequest$outboundSchema,
|
|
89
|
+
value,
|
|
90
|
+
),
|
|
91
|
+
"Input validation failed",
|
|
92
|
+
);
|
|
93
|
+
if (!parsed.ok) {
|
|
94
|
+
return [parsed, { status: "invalid" }];
|
|
95
|
+
}
|
|
96
|
+
const payload = parsed.value;
|
|
97
|
+
const body = encodeJSON("body", payload.body, { explode: true });
|
|
98
|
+
|
|
99
|
+
const pathParams = {
|
|
100
|
+
id: encodeSimple("id", payload.id, {
|
|
101
|
+
explode: false,
|
|
102
|
+
charEncoding: "percent",
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
const path = pathToFunc("/api/sandbox/{id}/restore")(pathParams);
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
"Content-Type": "application/json",
|
|
109
|
+
Accept: "application/json",
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "postApiSandboxByIdRestore",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.security,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "POST",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
148
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
operations.PostApiSandboxByIdRestoreResponse,
|
|
163
|
+
| errors.ErrorMessage
|
|
164
|
+
| errors.ErrorMessageStatusCode
|
|
165
|
+
| MutagentError
|
|
166
|
+
| ResponseValidationError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| InvalidRequestError
|
|
171
|
+
| UnexpectedClientError
|
|
172
|
+
| SDKValidationError
|
|
173
|
+
>(
|
|
174
|
+
M.json(200, operations.PostApiSandboxByIdRestoreResponse$inboundSchema),
|
|
175
|
+
M.jsonErr([400, 401, 403, 404], errors.ErrorMessage$inboundSchema),
|
|
176
|
+
M.jsonErr(409, errors.ErrorMessageStatusCode$inboundSchema),
|
|
177
|
+
M.jsonErr(500, errors.ErrorMessageStatusCode$inboundSchema),
|
|
178
|
+
M.fail("4XX"),
|
|
179
|
+
M.fail("5XX"),
|
|
180
|
+
)(response, req, { extraFields: responseFields });
|
|
181
|
+
if (!result.ok) {
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return [result, { status: "complete", request: req, response }];
|
|
186
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "2.0.0",
|
|
68
|
-
sdkVersion: "0.3.
|
|
68
|
+
sdkVersion: "0.3.42",
|
|
69
69
|
genVersion: "2.935.1",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.3.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.3.42 2.935.1 2.0.0 @mutagent/sdk",
|
|
71
71
|
} as const;
|
|
@@ -80,6 +80,28 @@ export type DefinitionProviderNetwork = {
|
|
|
80
80
|
allow?: Array<DefinitionProviderAllow> | undefined;
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Whether the working directory is archived at every consistency point. `auto` (default) archives it whenever an object store exists; `never` records the leg as disabled in the checkpoint manifest, so a restore reports it as disabled rather than as an archive that failed to travel.
|
|
85
|
+
*/
|
|
86
|
+
export enum DefinitionProviderWorkspace {
|
|
87
|
+
Auto = "auto",
|
|
88
|
+
Never = "never",
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Which legs continuous capture carries for sessions on this definition.
|
|
93
|
+
*/
|
|
94
|
+
export type DefinitionProviderCapture = {
|
|
95
|
+
/**
|
|
96
|
+
* Whether the working directory is archived at every consistency point. `auto` (default) archives it whenever an object store exists; `never` records the leg as disabled in the checkpoint manifest, so a restore reports it as disabled rather than as an archive that failed to travel.
|
|
97
|
+
*/
|
|
98
|
+
workspace?: DefinitionProviderWorkspace | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Whether `$HOME/.mutagent` (memory, plans, extension state; never the session transcript) is archived. Defaults to true.
|
|
101
|
+
*/
|
|
102
|
+
home?: boolean | undefined;
|
|
103
|
+
};
|
|
104
|
+
|
|
83
105
|
/**
|
|
84
106
|
* Sandbox configuration. Separate artifact from the image content (R-C20).
|
|
85
107
|
*/
|
|
@@ -124,6 +146,10 @@ export type Definition = {
|
|
|
124
146
|
* Non-secret environment variables. Secret material must come from an Environment.
|
|
125
147
|
*/
|
|
126
148
|
vars?: { [k: string]: string } | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Which legs continuous capture carries for sessions on this definition.
|
|
151
|
+
*/
|
|
152
|
+
capture?: DefinitionProviderCapture | undefined;
|
|
127
153
|
};
|
|
128
154
|
|
|
129
155
|
export type DefinitionProvider = {
|
|
@@ -232,6 +258,37 @@ export function definitionProviderNetworkToJSON(
|
|
|
232
258
|
);
|
|
233
259
|
}
|
|
234
260
|
|
|
261
|
+
/** @internal */
|
|
262
|
+
export const DefinitionProviderWorkspace$outboundSchema: z.ZodMiniEnum<
|
|
263
|
+
typeof DefinitionProviderWorkspace
|
|
264
|
+
> = z.enum(DefinitionProviderWorkspace);
|
|
265
|
+
|
|
266
|
+
/** @internal */
|
|
267
|
+
export type DefinitionProviderCapture$Outbound = {
|
|
268
|
+
workspace: string;
|
|
269
|
+
home?: boolean | undefined;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/** @internal */
|
|
273
|
+
export const DefinitionProviderCapture$outboundSchema: z.ZodMiniType<
|
|
274
|
+
DefinitionProviderCapture$Outbound,
|
|
275
|
+
DefinitionProviderCapture
|
|
276
|
+
> = z.object({
|
|
277
|
+
workspace: z._default(
|
|
278
|
+
DefinitionProviderWorkspace$outboundSchema,
|
|
279
|
+
DefinitionProviderWorkspace.Auto,
|
|
280
|
+
),
|
|
281
|
+
home: z.optional(z.boolean()),
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
export function definitionProviderCaptureToJSON(
|
|
285
|
+
definitionProviderCapture: DefinitionProviderCapture,
|
|
286
|
+
): string {
|
|
287
|
+
return JSON.stringify(
|
|
288
|
+
DefinitionProviderCapture$outboundSchema.parse(definitionProviderCapture),
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
235
292
|
/** @internal */
|
|
236
293
|
export type Definition$Outbound = {
|
|
237
294
|
name: string;
|
|
@@ -244,6 +301,7 @@ export type Definition$Outbound = {
|
|
|
244
301
|
timeoutMs?: number | undefined;
|
|
245
302
|
workdir?: string | undefined;
|
|
246
303
|
vars?: { [k: string]: string } | undefined;
|
|
304
|
+
capture?: DefinitionProviderCapture$Outbound | undefined;
|
|
247
305
|
};
|
|
248
306
|
|
|
249
307
|
/** @internal */
|
|
@@ -266,6 +324,7 @@ export const Definition$outboundSchema: z.ZodMiniType<
|
|
|
266
324
|
timeoutMs: z.optional(z.number()),
|
|
267
325
|
workdir: z.optional(z.string()),
|
|
268
326
|
vars: z.optional(z.record(z.string(), z.string())),
|
|
327
|
+
capture: z.optional(z.lazy(() => DefinitionProviderCapture$outboundSchema)),
|
|
269
328
|
});
|
|
270
329
|
|
|
271
330
|
export function definitionToJSON(definition: Definition): string {
|
package/src/models/index.ts
CHANGED
|
@@ -16,7 +16,7 @@ export * from "./id-name-email.js";
|
|
|
16
16
|
export * from "./id-organization-id-email.js";
|
|
17
17
|
export * from "./id-user-id-role.js";
|
|
18
18
|
export * from "./id-user-id-role2.js";
|
|
19
|
-
export * from "./mode-args
|
|
19
|
+
export * from "./mode-arm-args.js";
|
|
20
20
|
export * from "./name-api-key-credential-fields.js";
|
|
21
21
|
export * from "./name-description-system-prompt.js";
|
|
22
22
|
export * from "./name-email-avatar-url.js";
|
|
@@ -37,13 +37,15 @@ export * from "./provider-config.js";
|
|
|
37
37
|
export * from "./provider-configs-list.js";
|
|
38
38
|
export * from "./provider-success.js";
|
|
39
39
|
export * from "./schemadefaul.js";
|
|
40
|
-
export * from "./
|
|
40
|
+
export * from "./schemadefaul11.js";
|
|
41
41
|
export * from "./schemadefaul5.js";
|
|
42
42
|
export * from "./schemadefaul6.js";
|
|
43
|
-
export * from "./
|
|
43
|
+
export * from "./schemadefaul7.js";
|
|
44
|
+
export * from "./schemadefaul9.js";
|
|
44
45
|
export * from "./security.js";
|
|
45
46
|
export * from "./session-id-line.js";
|
|
46
47
|
export * from "./session-id-signal.js";
|
|
48
|
+
export * from "./snapshot-id-definition-partial.js";
|
|
47
49
|
export * from "./success-message.js";
|
|
48
50
|
export * from "./test-connection-result.js";
|
|
49
51
|
export * from "./user-id-role-status.js";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
Schemadefaul6,
|
|
8
|
+
Schemadefaul6$outboundSchema,
|
|
9
|
+
Schemadefaul6Open,
|
|
10
|
+
} from "./schemadefaul6.js";
|
|
11
|
+
import {
|
|
12
|
+
Schemadefaul7,
|
|
13
|
+
Schemadefaul7$outboundSchema,
|
|
14
|
+
Schemadefaul7Open,
|
|
15
|
+
} from "./schemadefaul7.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Per-session override of what continuous capture carries.
|
|
19
|
+
*/
|
|
20
|
+
export type ModeArmArgsCapture = {
|
|
21
|
+
/**
|
|
22
|
+
* Archive this session's working directory at every consistency point. Overrides the definition's `capture.workspace` for this session only; `false` records the leg as disabled in every checkpoint manifest the session produces, so a restore says "disabled" rather than "did not travel".
|
|
23
|
+
*/
|
|
24
|
+
workspace?: boolean | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type ModeArmArgs = {
|
|
28
|
+
/**
|
|
29
|
+
* Defaults to `oneshot` — the pre-existing behaviour. `rpc` starts a duplex session that emits `rpc` events on the stream and accepts `POST /:id/input`.
|
|
30
|
+
*/
|
|
31
|
+
mode?: Schemadefaul6Open | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Which launcher arm to run. `classic` = `helix …` (orchestrator loaded), `prime` = `helix --prime …`, `agent` = `helix agent …`. Defaults to `agent`.
|
|
34
|
+
*/
|
|
35
|
+
arm?: Schemadefaul7Open | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Arguments for the Helix binary. Omitted starts it with none.
|
|
38
|
+
*/
|
|
39
|
+
args?: Array<string> | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Per-call environment, merged OVER the sandbox's own scoped material. Rides the invocation payload, so it does not mint a new Runtime.
|
|
42
|
+
*/
|
|
43
|
+
env?: { [k: string]: string } | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Working directory for the agent. Omitted, an `rpc` session runs in `$HOME` (writable by construction); `oneshot` inherits the server cwd exactly as it always has.
|
|
46
|
+
*/
|
|
47
|
+
cwd?: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Per-session override of what continuous capture carries.
|
|
50
|
+
*/
|
|
51
|
+
capture?: ModeArmArgsCapture | undefined;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export type ModeArmArgsCapture$Outbound = {
|
|
56
|
+
workspace?: boolean | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const ModeArmArgsCapture$outboundSchema: z.ZodMiniType<
|
|
61
|
+
ModeArmArgsCapture$Outbound,
|
|
62
|
+
ModeArmArgsCapture
|
|
63
|
+
> = z.object({
|
|
64
|
+
workspace: z.optional(z.boolean()),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export function modeArmArgsCaptureToJSON(
|
|
68
|
+
modeArmArgsCapture: ModeArmArgsCapture,
|
|
69
|
+
): string {
|
|
70
|
+
return JSON.stringify(
|
|
71
|
+
ModeArmArgsCapture$outboundSchema.parse(modeArmArgsCapture),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export type ModeArmArgs$Outbound = {
|
|
77
|
+
mode: string;
|
|
78
|
+
arm: string;
|
|
79
|
+
args?: Array<string> | undefined;
|
|
80
|
+
env?: { [k: string]: string } | undefined;
|
|
81
|
+
cwd?: string | undefined;
|
|
82
|
+
capture?: ModeArmArgsCapture$Outbound | undefined;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const ModeArmArgs$outboundSchema: z.ZodMiniType<
|
|
87
|
+
ModeArmArgs$Outbound,
|
|
88
|
+
ModeArmArgs
|
|
89
|
+
> = z.object({
|
|
90
|
+
mode: z._default(Schemadefaul6$outboundSchema, Schemadefaul6.Oneshot),
|
|
91
|
+
arm: z._default(Schemadefaul7$outboundSchema, Schemadefaul7.Classic),
|
|
92
|
+
args: z.optional(z.array(z.string())),
|
|
93
|
+
env: z.optional(z.record(z.string(), z.string())),
|
|
94
|
+
cwd: z.optional(z.string()),
|
|
95
|
+
capture: z.optional(z.lazy(() => ModeArmArgsCapture$outboundSchema)),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export function modeArmArgsToJSON(modeArmArgs: ModeArmArgs): string {
|
|
99
|
+
return JSON.stringify(ModeArmArgs$outboundSchema.parse(modeArmArgs));
|
|
100
|
+
}
|
|
@@ -80,6 +80,28 @@ export type NameImageArchNetwork = {
|
|
|
80
80
|
allow?: Array<NameImageArchAllow> | undefined;
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Whether the working directory is archived at every consistency point. `auto` (default) archives it whenever an object store exists; `never` records the leg as disabled in the checkpoint manifest, so a restore reports it as disabled rather than as an archive that failed to travel.
|
|
85
|
+
*/
|
|
86
|
+
export enum NameImageArchWorkspace {
|
|
87
|
+
Auto = "auto",
|
|
88
|
+
Never = "never",
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Which legs continuous capture carries for sessions on this definition.
|
|
93
|
+
*/
|
|
94
|
+
export type NameImageArchCapture = {
|
|
95
|
+
/**
|
|
96
|
+
* Whether the working directory is archived at every consistency point. `auto` (default) archives it whenever an object store exists; `never` records the leg as disabled in the checkpoint manifest, so a restore reports it as disabled rather than as an archive that failed to travel.
|
|
97
|
+
*/
|
|
98
|
+
workspace?: NameImageArchWorkspace | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Whether `$HOME/.mutagent` (memory, plans, extension state; never the session transcript) is archived. Defaults to true.
|
|
101
|
+
*/
|
|
102
|
+
home?: boolean | undefined;
|
|
103
|
+
};
|
|
104
|
+
|
|
83
105
|
export type NameImageArch = {
|
|
84
106
|
/**
|
|
85
107
|
* Human-readable definition name
|
|
@@ -121,6 +143,10 @@ export type NameImageArch = {
|
|
|
121
143
|
* Non-secret environment variables. Secret material must come from an Environment.
|
|
122
144
|
*/
|
|
123
145
|
vars?: { [k: string]: string } | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Which legs continuous capture carries for sessions on this definition.
|
|
148
|
+
*/
|
|
149
|
+
capture?: NameImageArchCapture | undefined;
|
|
124
150
|
};
|
|
125
151
|
|
|
126
152
|
/** @internal */
|
|
@@ -214,6 +240,37 @@ export function nameImageArchNetworkToJSON(
|
|
|
214
240
|
);
|
|
215
241
|
}
|
|
216
242
|
|
|
243
|
+
/** @internal */
|
|
244
|
+
export const NameImageArchWorkspace$outboundSchema: z.ZodMiniEnum<
|
|
245
|
+
typeof NameImageArchWorkspace
|
|
246
|
+
> = z.enum(NameImageArchWorkspace);
|
|
247
|
+
|
|
248
|
+
/** @internal */
|
|
249
|
+
export type NameImageArchCapture$Outbound = {
|
|
250
|
+
workspace: string;
|
|
251
|
+
home?: boolean | undefined;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/** @internal */
|
|
255
|
+
export const NameImageArchCapture$outboundSchema: z.ZodMiniType<
|
|
256
|
+
NameImageArchCapture$Outbound,
|
|
257
|
+
NameImageArchCapture
|
|
258
|
+
> = z.object({
|
|
259
|
+
workspace: z._default(
|
|
260
|
+
NameImageArchWorkspace$outboundSchema,
|
|
261
|
+
NameImageArchWorkspace.Auto,
|
|
262
|
+
),
|
|
263
|
+
home: z.optional(z.boolean()),
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export function nameImageArchCaptureToJSON(
|
|
267
|
+
nameImageArchCapture: NameImageArchCapture,
|
|
268
|
+
): string {
|
|
269
|
+
return JSON.stringify(
|
|
270
|
+
NameImageArchCapture$outboundSchema.parse(nameImageArchCapture),
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
217
274
|
/** @internal */
|
|
218
275
|
export type NameImageArch$Outbound = {
|
|
219
276
|
name: string;
|
|
@@ -226,6 +283,7 @@ export type NameImageArch$Outbound = {
|
|
|
226
283
|
timeoutMs?: number | undefined;
|
|
227
284
|
workdir?: string | undefined;
|
|
228
285
|
vars?: { [k: string]: string } | undefined;
|
|
286
|
+
capture?: NameImageArchCapture$Outbound | undefined;
|
|
229
287
|
};
|
|
230
288
|
|
|
231
289
|
/** @internal */
|
|
@@ -243,6 +301,7 @@ export const NameImageArch$outboundSchema: z.ZodMiniType<
|
|
|
243
301
|
timeoutMs: z.optional(z.number()),
|
|
244
302
|
workdir: z.optional(z.string()),
|
|
245
303
|
vars: z.optional(z.record(z.string(), z.string())),
|
|
304
|
+
capture: z.optional(z.lazy(() => NameImageArchCapture$outboundSchema)),
|
|
246
305
|
});
|
|
247
306
|
|
|
248
307
|
export function nameImageArchToJSON(nameImageArch: NameImageArch): string {
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type GetApiSandboxByIdCheckpointsRequest = {
|
|
12
|
+
id: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type Snapshot = {
|
|
16
|
+
id: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
harnessSessionId: string;
|
|
19
|
+
bytes: number;
|
|
20
|
+
sha256: string;
|
|
21
|
+
messageCount: number;
|
|
22
|
+
/**
|
|
23
|
+
* ISO-8601.
|
|
24
|
+
*/
|
|
25
|
+
capturedAt: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Checkpoints captured from this sandbox, newest first. Without their bytes — a list route returning every transcript in full would be the most expensive query in the system and would spread conversations into logs and caches nobody chose.
|
|
30
|
+
*/
|
|
31
|
+
export type GetApiSandboxByIdCheckpointsResponse = {
|
|
32
|
+
snapshots: Array<Snapshot>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export type GetApiSandboxByIdCheckpointsRequest$Outbound = {
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const GetApiSandboxByIdCheckpointsRequest$outboundSchema: z.ZodMiniType<
|
|
42
|
+
GetApiSandboxByIdCheckpointsRequest$Outbound,
|
|
43
|
+
GetApiSandboxByIdCheckpointsRequest
|
|
44
|
+
> = z.object({
|
|
45
|
+
id: z.string(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export function getApiSandboxByIdCheckpointsRequestToJSON(
|
|
49
|
+
getApiSandboxByIdCheckpointsRequest: GetApiSandboxByIdCheckpointsRequest,
|
|
50
|
+
): string {
|
|
51
|
+
return JSON.stringify(
|
|
52
|
+
GetApiSandboxByIdCheckpointsRequest$outboundSchema.parse(
|
|
53
|
+
getApiSandboxByIdCheckpointsRequest,
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const Snapshot$inboundSchema: z.ZodMiniType<Snapshot, unknown> = z
|
|
60
|
+
.object({
|
|
61
|
+
id: types.string(),
|
|
62
|
+
sessionId: types.string(),
|
|
63
|
+
harnessSessionId: types.string(),
|
|
64
|
+
bytes: types.number(),
|
|
65
|
+
sha256: types.string(),
|
|
66
|
+
messageCount: types.number(),
|
|
67
|
+
capturedAt: types.string(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export function snapshotFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<Snapshot, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => Snapshot$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'Snapshot' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const GetApiSandboxByIdCheckpointsResponse$inboundSchema: z.ZodMiniType<
|
|
82
|
+
GetApiSandboxByIdCheckpointsResponse,
|
|
83
|
+
unknown
|
|
84
|
+
> = z.object({
|
|
85
|
+
snapshots: z.array(z.lazy(() => Snapshot$inboundSchema)),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export function getApiSandboxByIdCheckpointsResponseFromJSON(
|
|
89
|
+
jsonString: string,
|
|
90
|
+
): SafeParseResult<GetApiSandboxByIdCheckpointsResponse, SDKValidationError> {
|
|
91
|
+
return safeParse(
|
|
92
|
+
jsonString,
|
|
93
|
+
(x) =>
|
|
94
|
+
GetApiSandboxByIdCheckpointsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
95
|
+
`Failed to parse 'GetApiSandboxByIdCheckpointsResponse' from JSON`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -16,7 +16,7 @@ export type GetApiSandboxByIdRequest = {
|
|
|
16
16
|
* Response for status 200
|
|
17
17
|
*/
|
|
18
18
|
export type GetApiSandboxByIdResponse = {
|
|
19
|
-
status: models.
|
|
19
|
+
status: models.Schemadefaul5Open;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/** @internal */
|
|
@@ -46,8 +46,8 @@ export const GetApiSandboxByIdResponse$inboundSchema: z.ZodMiniType<
|
|
|
46
46
|
unknown
|
|
47
47
|
> = z.object({
|
|
48
48
|
status: z._default(
|
|
49
|
-
models.
|
|
50
|
-
models.
|
|
49
|
+
models.Schemadefaul5$inboundSchema,
|
|
50
|
+
models.Schemadefaul5.Pending,
|
|
51
51
|
),
|
|
52
52
|
});
|
|
53
53
|
|
|
@@ -29,7 +29,7 @@ export type GetApiSandboxResponse = {
|
|
|
29
29
|
* CPU architecture the image was built for. Validated against the provider at preflight.
|
|
30
30
|
*/
|
|
31
31
|
arch: models.SchemadefaulOpen;
|
|
32
|
-
status: models.
|
|
32
|
+
status: models.Schemadefaul5Open;
|
|
33
33
|
definitionName: string;
|
|
34
34
|
environmentName?: string | undefined;
|
|
35
35
|
/**
|
|
@@ -51,8 +51,8 @@ export const GetApiSandboxResponse$inboundSchema: z.ZodMiniType<
|
|
|
51
51
|
models.Schemadefaul.X8664,
|
|
52
52
|
),
|
|
53
53
|
status: z._default(
|
|
54
|
-
models.
|
|
55
|
-
models.
|
|
54
|
+
models.Schemadefaul5$inboundSchema,
|
|
55
|
+
models.Schemadefaul5.Pending,
|
|
56
56
|
),
|
|
57
57
|
definitionName: types.string(),
|
|
58
58
|
environmentName: types.optional(types.string()),
|
|
@@ -17,6 +17,7 @@ export * from "./delete-session.js";
|
|
|
17
17
|
export * from "./delete-workspace.js";
|
|
18
18
|
export * from "./get-agent-by-slug.js";
|
|
19
19
|
export * from "./get-agent.js";
|
|
20
|
+
export * from "./get-api-sandbox-by-id-checkpoints.js";
|
|
20
21
|
export * from "./get-api-sandbox-by-id-sessions.js";
|
|
21
22
|
export * from "./get-api-sandbox-by-id-stream.js";
|
|
22
23
|
export * from "./get-api-sandbox-by-id-traces.js";
|
|
@@ -48,8 +49,10 @@ export * from "./list-traces.js";
|
|
|
48
49
|
export * from "./list-workspace-members.js";
|
|
49
50
|
export * from "./list-workspaces.js";
|
|
50
51
|
export * from "./post-api-sandbox-agent-run.js";
|
|
52
|
+
export * from "./post-api-sandbox-by-id-checkpoint.js";
|
|
51
53
|
export * from "./post-api-sandbox-by-id-exec.js";
|
|
52
54
|
export * from "./post-api-sandbox-by-id-input.js";
|
|
55
|
+
export * from "./post-api-sandbox-by-id-restore.js";
|
|
53
56
|
export * from "./post-api-sandbox-by-id-session.js";
|
|
54
57
|
export * from "./post-api-sandbox-by-id-signal.js";
|
|
55
58
|
export * from "./post-api-sandbox-preflight.js";
|