@shardflux/sdk 0.8.0 → 0.10.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 +258 -0
- package/README.md +338 -7
- package/dist/account.d.ts +493 -0
- package/dist/account.js +641 -0
- package/dist/cell.d.ts +203 -8
- package/dist/cell.js +457 -32
- package/dist/client.d.ts +120 -5
- package/dist/client.js +142 -6
- package/dist/errors.d.ts +90 -3
- package/dist/errors.js +93 -1
- package/dist/executions.d.ts +120 -0
- package/dist/executions.js +99 -0
- package/dist/feedback.d.ts +67 -0
- package/dist/feedback.js +39 -0
- package/dist/generated/app-api.d.ts +10546 -5855
- package/dist/generated/cell-api.d.ts +501 -9
- package/dist/http.d.ts +7 -1
- package/dist/http.js +26 -7
- package/dist/index.d.ts +18 -7
- package/dist/index.js +5 -1
- package/dist/lifecycle.d.ts +27 -2
- package/dist/lifecycle.js +5 -0
- package/dist/progress.js +4 -2
- package/dist/templates.js +2 -2
- package/dist/tools.d.ts +28 -1
- package/dist/tools.js +172 -21
- package/dist/usage.d.ts +36 -6
- package/dist/usage.js +19 -4
- package/dist/version-check.d.ts +101 -0
- package/dist/version-check.js +191 -0
- package/dist/workspace.d.ts +100 -6
- package/dist/workspace.js +198 -12
- package/package.json +1 -1
|
@@ -66,8 +66,20 @@ export interface paths {
|
|
|
66
66
|
get?: never;
|
|
67
67
|
put?: never;
|
|
68
68
|
/**
|
|
69
|
-
* Start a command (idempotent by session_id)
|
|
69
|
+
* Start a command (idempotent by session_id), or run an execution of a file-first workspace
|
|
70
70
|
* @description Requires tool `exec`. argv is executed directly (no shell).
|
|
71
|
+
*
|
|
72
|
+
* On a file-first workspace (contracts §29.2) this runs an execution:
|
|
73
|
+
* `execution_id` is required (the idempotency key), and the call
|
|
74
|
+
* answers when the command ended with an `ExecutionResult` (`201`
|
|
75
|
+
* when this call ran it; `200` when the execution already existed:
|
|
76
|
+
* its recorded result, after waiting for it if it was still running;
|
|
77
|
+
* a client that gives up waiting retries with the same id or polls
|
|
78
|
+
* `GET /executions/{execution_id}`). Refusals before anything ran
|
|
79
|
+
* leave the id unused: `409 workspace_busy` (`execution_in_progress`),
|
|
80
|
+
* `503 service_unavailable` (`no_execution_host`: no host with
|
|
81
|
+
* protocol feature `file_first` has room; retry), secret resolution
|
|
82
|
+
* errors as for processful starts.
|
|
71
83
|
*/
|
|
72
84
|
post: operations["execStart"];
|
|
73
85
|
delete?: never;
|
|
@@ -198,6 +210,33 @@ export interface paths {
|
|
|
198
210
|
patch?: never;
|
|
199
211
|
trace?: never;
|
|
200
212
|
};
|
|
213
|
+
"/v1/workspaces/{workspace_id}/executions/{execution_id}": {
|
|
214
|
+
parameters: {
|
|
215
|
+
query?: never;
|
|
216
|
+
header?: never;
|
|
217
|
+
path: {
|
|
218
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
219
|
+
execution_id: components["parameters"]["ExecutionId"];
|
|
220
|
+
};
|
|
221
|
+
cookie?: never;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* An execution of a file-first workspace (contracts §29.2)
|
|
225
|
+
* @description Requires tool `exec`. `200` with the result once the execution
|
|
226
|
+
* ended (`succeeded`, `failed` or `lost`), `202` with `state` `queued`
|
|
227
|
+
* or `running` (no output yet) while it runs; `404 not_found` for an
|
|
228
|
+
* unknown id. Results are kept 7 days. Processful workspaces: `409
|
|
229
|
+
* conflict`, `details.reason not_supported_for_mode`.
|
|
230
|
+
*/
|
|
231
|
+
get: operations["executionGet"];
|
|
232
|
+
put?: never;
|
|
233
|
+
post?: never;
|
|
234
|
+
delete?: never;
|
|
235
|
+
options?: never;
|
|
236
|
+
head?: never;
|
|
237
|
+
patch?: never;
|
|
238
|
+
trace?: never;
|
|
239
|
+
};
|
|
201
240
|
"/v1/workspaces/{workspace_id}/pty": {
|
|
202
241
|
parameters: {
|
|
203
242
|
query?: never;
|
|
@@ -431,6 +470,72 @@ export interface paths {
|
|
|
431
470
|
patch?: never;
|
|
432
471
|
trace?: never;
|
|
433
472
|
};
|
|
473
|
+
"/v1/workspaces/{workspace_id}/files/search": {
|
|
474
|
+
parameters: {
|
|
475
|
+
query?: never;
|
|
476
|
+
header?: never;
|
|
477
|
+
path: {
|
|
478
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
479
|
+
};
|
|
480
|
+
cookie?: never;
|
|
481
|
+
};
|
|
482
|
+
get?: never;
|
|
483
|
+
put?: never;
|
|
484
|
+
/**
|
|
485
|
+
* Search file contents under a directory (bounded; read-only)
|
|
486
|
+
* @description Walks `path` (default `/`), skipping `exclude` globs, files above
|
|
487
|
+
* `max_file_bytes`, binary files (a NUL byte in the first 8 KiB) and
|
|
488
|
+
* symbolic links, and returns matching lines in path order until
|
|
489
|
+
* `max_matches` or the time budget. `truncated` says whether the walk
|
|
490
|
+
* stopped early. Served from disk while the workspace sleeps
|
|
491
|
+
* (contracts §26.4). A workspace whose host predates search: `409
|
|
492
|
+
* conflict`, `details.reason host_feature_unavailable`,
|
|
493
|
+
* `details.feature file_search`, not retryable (contracts §26.7).
|
|
494
|
+
* Tool `files`.
|
|
495
|
+
*/
|
|
496
|
+
post: operations["fileSearch"];
|
|
497
|
+
delete?: never;
|
|
498
|
+
options?: never;
|
|
499
|
+
head?: never;
|
|
500
|
+
patch?: never;
|
|
501
|
+
trace?: never;
|
|
502
|
+
};
|
|
503
|
+
"/v1/workspaces/{workspace_id}/files/patch": {
|
|
504
|
+
parameters: {
|
|
505
|
+
query?: never;
|
|
506
|
+
header?: never;
|
|
507
|
+
path: {
|
|
508
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
509
|
+
};
|
|
510
|
+
cookie?: never;
|
|
511
|
+
};
|
|
512
|
+
get?: never;
|
|
513
|
+
put?: never;
|
|
514
|
+
/**
|
|
515
|
+
* Apply text edits to a file atomically, optionally requiring its current revision
|
|
516
|
+
* @description Exactly one of `edits` (each `old_text` must occur exactly once unless
|
|
517
|
+
* `replace_all`; applied in order) or `content` (replace the whole file).
|
|
518
|
+
* With `expected_revision` the file must currently have that revision
|
|
519
|
+
* (`absent`: it must not exist) or the call fails with `409 conflict`,
|
|
520
|
+
* `details.reason revision_mismatch`, `details.current_revision`
|
|
521
|
+
* (`absent` for a missing file). An existing file keeps its mode and
|
|
522
|
+
* owner. Edits that do not apply: `422 validation_failed`,
|
|
523
|
+
* `details.reason edit_not_found` or `edit_ambiguous`, `details.index`.
|
|
524
|
+
* Acknowledged after the file and its parent directory were fsync'd.
|
|
525
|
+
* Send `Idempotency-Key` to make a retry a no-op. Limits: request body
|
|
526
|
+
* up to 7 MiB (`413 payload_too_large`), files up to 64 MiB, a symlink
|
|
527
|
+
* target is refused. A workspace whose host predates patches: `409
|
|
528
|
+
* conflict`, `details.reason host_feature_unavailable`,
|
|
529
|
+
* `details.feature file_patch`, not retryable (contracts §26.7).
|
|
530
|
+
* Tool `files`.
|
|
531
|
+
*/
|
|
532
|
+
post: operations["filePatch"];
|
|
533
|
+
delete?: never;
|
|
534
|
+
options?: never;
|
|
535
|
+
head?: never;
|
|
536
|
+
patch?: never;
|
|
537
|
+
trace?: never;
|
|
538
|
+
};
|
|
434
539
|
"/v1/workspaces/{workspace_id}/files/move": {
|
|
435
540
|
parameters: {
|
|
436
541
|
query?: never;
|
|
@@ -547,6 +652,35 @@ export interface paths {
|
|
|
547
652
|
patch?: never;
|
|
548
653
|
trace?: never;
|
|
549
654
|
};
|
|
655
|
+
"/v1/workspaces/{workspace_id}/wake-hint": {
|
|
656
|
+
parameters: {
|
|
657
|
+
query?: never;
|
|
658
|
+
header?: never;
|
|
659
|
+
path: {
|
|
660
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
661
|
+
};
|
|
662
|
+
cookie?: never;
|
|
663
|
+
};
|
|
664
|
+
get?: never;
|
|
665
|
+
put?: never;
|
|
666
|
+
/**
|
|
667
|
+
* Announce an imminent tool call so a parked workspace is restored ahead of it
|
|
668
|
+
* @description Best effort and cheap: returns immediately. If the workspace is
|
|
669
|
+
* hibernated its host starts restoring it now (contracts §25.5); frozen
|
|
670
|
+
* and resident workspaces need nothing. A hint not followed by a tool
|
|
671
|
+
* call within `WAKE_HINT_HOLD_SECONDS` (default 60) is released. A
|
|
672
|
+
* suspended workspace answers `409 workspace_not_running` (resume it
|
|
673
|
+
* through the application API). A host that predates wake hints does
|
|
674
|
+
* not park: `resident` (contracts §26.7). Not subject to the tool gate
|
|
675
|
+
* and not tool activity; any tool the token grants authorizes it.
|
|
676
|
+
*/
|
|
677
|
+
post: operations["workspaceWakeHint"];
|
|
678
|
+
delete?: never;
|
|
679
|
+
options?: never;
|
|
680
|
+
head?: never;
|
|
681
|
+
patch?: never;
|
|
682
|
+
trace?: never;
|
|
683
|
+
};
|
|
550
684
|
"/v1/workspaces/{workspace_id}/keepalive": {
|
|
551
685
|
parameters: {
|
|
552
686
|
query?: never;
|
|
@@ -589,9 +723,22 @@ export interface paths {
|
|
|
589
723
|
* none is known; in the future while a keepalive or a running command is
|
|
590
724
|
* active). A running exec command counts as work until min(its start +
|
|
591
725
|
* `IDLE_COMMAND_MAX_SECONDS`, its start + `timeout_ms`), and its end is
|
|
592
|
-
* activity (contracts §20.6)
|
|
726
|
+
* activity (contracts §20.6): an end seen without a client call is
|
|
727
|
+
* recorded in `last_attach_at`, which is work but not a tool call.
|
|
728
|
+
* `suspend_at` = `idle_since` + `idle_minutes` when
|
|
593
729
|
* the policy is `suspend_after` and automatic suspend is enabled, else
|
|
594
730
|
* null; the idle loop acts within `2 x ACTIVITY_FLUSH_MS` after it.
|
|
731
|
+
* `suspend_request` is the pending suspend request of the application
|
|
732
|
+
* API's `POST /v1/workspaces/{id}/suspend-when-idle` while it is valid:
|
|
733
|
+
* the workspace is running, `last_tool_at` is not later than
|
|
734
|
+
* `requested_at` + 0.5 s and `running_since` not later than
|
|
735
|
+
* `requested_at` (a tool call or a resume after the request cancels it
|
|
736
|
+
* for good), else null. A valid request applies under every policy
|
|
737
|
+
* (`never` included) unless automatic suspend was disabled after
|
|
738
|
+
* repeated failures; `suspend_at` is then the earlier of the policy's
|
|
739
|
+
* time and max(`idle_since`, `requested_at`) + `after_seconds`, so an
|
|
740
|
+
* attached stream, a keepalive or a running command defers it until
|
|
741
|
+
* `after_seconds` after it ends (contracts §20.6).
|
|
595
742
|
* Activity lags tool traffic by up to `ACTIVITY_FLUSH_MS`. Any
|
|
596
743
|
* tool granted by the token authorizes the call; the tool gate does not
|
|
597
744
|
* apply and the call is not tool activity.
|
|
@@ -693,6 +840,7 @@ export interface components {
|
|
|
693
840
|
env?: {
|
|
694
841
|
[key: string]: string;
|
|
695
842
|
};
|
|
843
|
+
/** @description Absolute working directory; omitted or empty starts in the default (/home/user). A relative path is refused, not resolved: 422 validation_failed, details.reason invalid_cwd, details.field cwd, the message naming the absolute path it likely means. A cwd that is not a directory ends the session failed_to_start (processful) or the execution failed with details.reason exec_failed_to_start (file-first). */
|
|
696
844
|
cwd?: string;
|
|
697
845
|
user?: string;
|
|
698
846
|
/** @description Written to stdin, which is then closed (max 1 MiB decoded). */
|
|
@@ -702,9 +850,82 @@ export interface components {
|
|
|
702
850
|
/** Format: int64 */
|
|
703
851
|
kill_grace_ms?: number;
|
|
704
852
|
secret_refs?: components["schemas"]["SecretRefs"];
|
|
853
|
+
/** @description File-first workspaces (required there, refused otherwise) — the execution's idempotency key. */
|
|
854
|
+
execution_id?: components["schemas"]["ExecutionIdValue"];
|
|
855
|
+
/**
|
|
856
|
+
* Format: int64
|
|
857
|
+
* @description File-first workspaces — stdout and stderr are each captured up to this many bytes.
|
|
858
|
+
* @default 1048576
|
|
859
|
+
*/
|
|
860
|
+
output_limit_bytes?: number;
|
|
705
861
|
};
|
|
706
862
|
/** @description Names of customer secrets (contracts §17) to inject as environment variables NAME=value of this process only. The cell resolves them at session start through the API with the caller's tool token (permission-checked and audited by the API); values are never logged, persisted or returned by the cell. Any name the caller may not use (unknown, not permitted for this workspace/project/tool) refuses the whole start with 403 forbidden (details.reason secret_not_available, details.names); nothing is started. A name that is also a key of `env` is refused (422 validation_failed). Requires a workspace tool token (browser stream tickets cannot resolve secrets: 403, details.reason secret_refs_require_tool_token). Resolution failures: 401 (token revoked/expired), 409 stale_epoch, 429 rate_limited, 503 dependency_unavailable. A retried start with the same session_id re-resolves the names; if a value changed since the first start the host refuses the different request (409 conflict). */
|
|
707
863
|
SecretRefs: string[];
|
|
864
|
+
/** @description A caller-chosen execution id (8..128 characters), unique per workspace. */
|
|
865
|
+
ExecutionIdValue: string;
|
|
866
|
+
/**
|
|
867
|
+
* @description queued/running: in progress. succeeded: the command ran to its end
|
|
868
|
+
* (any exit code; see exit_code, timed_out) and the files it changed
|
|
869
|
+
* were published as tree_revision. failed: the execution could not run
|
|
870
|
+
* the command or its result could not be published (error); nothing
|
|
871
|
+
* was published. lost: the execution's host or cell stopped answering
|
|
872
|
+
* (no heartbeat for EXECUTION_LEASE_SECONDS), the host restarted, or the
|
|
873
|
+
* workspace was deleted; nothing was published. After failed or lost,
|
|
874
|
+
* retry with a new execution_id.
|
|
875
|
+
* @enum {string}
|
|
876
|
+
*/
|
|
877
|
+
ExecutionState: "queued" | "running" | "succeeded" | "failed" | "lost";
|
|
878
|
+
ExecutionChange: {
|
|
879
|
+
/** @description Guest path (under /home/user). */
|
|
880
|
+
path: string;
|
|
881
|
+
/** @enum {string} */
|
|
882
|
+
change: "added" | "modified" | "deleted";
|
|
883
|
+
/**
|
|
884
|
+
* @description The new entry's type (deleted: the removed entry's).
|
|
885
|
+
* @enum {string}
|
|
886
|
+
*/
|
|
887
|
+
type: "file" | "directory" | "symlink";
|
|
888
|
+
};
|
|
889
|
+
ExecutionResult: {
|
|
890
|
+
execution_id: string;
|
|
891
|
+
state: components["schemas"]["ExecutionState"];
|
|
892
|
+
/**
|
|
893
|
+
* Format: int64
|
|
894
|
+
* @description The tree revision the command ran on.
|
|
895
|
+
*/
|
|
896
|
+
base_revision: number;
|
|
897
|
+
/**
|
|
898
|
+
* Format: int64
|
|
899
|
+
* @description The tree revision after the execution (succeeded) — base_revision + 1 when it changed files, else base_revision; null otherwise.
|
|
900
|
+
*/
|
|
901
|
+
tree_revision: number | null;
|
|
902
|
+
/** @description The command's exit status (-1 when terminated by a signal); null unless succeeded. */
|
|
903
|
+
exit_code: number | null;
|
|
904
|
+
term_signal: number | null;
|
|
905
|
+
/** @description The command ran past timeout_ms and was killed. */
|
|
906
|
+
timed_out: boolean;
|
|
907
|
+
/** @description Standard output (base64), at most output_limit_bytes. */
|
|
908
|
+
stdout: string;
|
|
909
|
+
/** @description Standard error (base64), at most output_limit_bytes. */
|
|
910
|
+
stderr: string;
|
|
911
|
+
stdout_truncated: boolean;
|
|
912
|
+
stderr_truncated: boolean;
|
|
913
|
+
/** @description Entries the execution added, modified or deleted under /home/user, sorted by path (at most 10000). */
|
|
914
|
+
changed: components["schemas"]["ExecutionChange"][];
|
|
915
|
+
changed_truncated: boolean;
|
|
916
|
+
/** @description Milliseconds and counts: queue_ms, run_ms, publish_ms, total_ms, and the host's (materialize_ms, boot_ms, exec_ms, collect_ms, blobs_fetched, blobs_uploaded, vm_seconds, ...). */
|
|
917
|
+
timings: {
|
|
918
|
+
[key: string]: number;
|
|
919
|
+
};
|
|
920
|
+
/** @description failed / lost: the ErrorBody.error shape {code (an ErrorCode), message, retryable, details.reason}; reason names the cause: a host refusal (blob_missing, blob_corrupt, exec_failed_to_start, template_missing, layout_unsupported, guest_feature_unavailable, tree_invalid, ...), no_execution_host, lease_expired, host_unreachable, host_restarted, workspace_deleted, tree_moved, result_invalid. retryable: a new execution_id may succeed. */
|
|
921
|
+
error?: {
|
|
922
|
+
[key: string]: unknown;
|
|
923
|
+
} | null;
|
|
924
|
+
/** Format: date-time */
|
|
925
|
+
created_at: string;
|
|
926
|
+
/** Format: date-time */
|
|
927
|
+
finished_at: string | null;
|
|
928
|
+
};
|
|
708
929
|
ExecSession: {
|
|
709
930
|
session_id: string;
|
|
710
931
|
state: components["schemas"]["SessionState"];
|
|
@@ -732,6 +953,7 @@ export interface components {
|
|
|
732
953
|
started_at?: string | null;
|
|
733
954
|
/** Format: date-time */
|
|
734
955
|
ended_at?: string | null;
|
|
956
|
+
/** @description Why the session ended without an exit code. For failed_to_start the command never ran and this names the cause, e.g. `working directory "/home/user/app" is not a directory` or `executable "foo" not found in PATH`. */
|
|
735
957
|
error?: string;
|
|
736
958
|
};
|
|
737
959
|
OutputEvent: {
|
|
@@ -775,6 +997,7 @@ export interface components {
|
|
|
775
997
|
env?: {
|
|
776
998
|
[key: string]: string;
|
|
777
999
|
};
|
|
1000
|
+
/** @description Absolute working directory; omitted or empty starts in the default (/home/user). A relative path is refused: 422 validation_failed, details.reason invalid_cwd, details.field cwd. */
|
|
778
1001
|
cwd?: string;
|
|
779
1002
|
user?: string;
|
|
780
1003
|
/** @default 24 */
|
|
@@ -860,6 +1083,93 @@ export interface components {
|
|
|
860
1083
|
uid?: number;
|
|
861
1084
|
gid?: number;
|
|
862
1085
|
symlink_target?: string;
|
|
1086
|
+
/** @description SHA-256 of the content (regular files; only when requested or returned by a write/patch). */
|
|
1087
|
+
revision?: string;
|
|
1088
|
+
};
|
|
1089
|
+
/** @description A content SHA-256, or `absent` for a path that must not exist. */
|
|
1090
|
+
FileRevision: string;
|
|
1091
|
+
FileSearchRequest: {
|
|
1092
|
+
/** @default / */
|
|
1093
|
+
path?: components["schemas"]["GuestPath"];
|
|
1094
|
+
pattern: string;
|
|
1095
|
+
/**
|
|
1096
|
+
* @description RE2 syntax when true; a literal substring otherwise.
|
|
1097
|
+
* @default false
|
|
1098
|
+
*/
|
|
1099
|
+
regex?: boolean;
|
|
1100
|
+
/** @default false */
|
|
1101
|
+
case_insensitive?: boolean;
|
|
1102
|
+
/** @description Glob patterns (`*`, `**`, `?`, `[...]`), gitignore-style: a pattern without `/` matches the name at any depth (`*.go`); one with `/` matches the path relative to `path` (`src/**\/*.ts`). A file must match one when given. */
|
|
1103
|
+
include?: string[];
|
|
1104
|
+
/** @description Glob patterns skipped (files and whole directories). Default: ["**\/.git/**", "**\/node_modules/**"]; send [] to search everything. */
|
|
1105
|
+
exclude?: string[];
|
|
1106
|
+
/** @default 200 */
|
|
1107
|
+
max_matches?: number;
|
|
1108
|
+
/**
|
|
1109
|
+
* Format: int64
|
|
1110
|
+
* @default 1048576
|
|
1111
|
+
*/
|
|
1112
|
+
max_file_bytes?: number;
|
|
1113
|
+
/** @default 0 */
|
|
1114
|
+
context_lines?: number;
|
|
1115
|
+
};
|
|
1116
|
+
FileSearchMatch: {
|
|
1117
|
+
path: string;
|
|
1118
|
+
/** @description 1-based. */
|
|
1119
|
+
line: number;
|
|
1120
|
+
/** @description 1-based byte column of the first match on the line. */
|
|
1121
|
+
column: number;
|
|
1122
|
+
/** @description The line, without its newline, truncated to 1000 bytes. */
|
|
1123
|
+
text: string;
|
|
1124
|
+
before?: string[];
|
|
1125
|
+
after?: string[];
|
|
1126
|
+
};
|
|
1127
|
+
FileSearchResult: {
|
|
1128
|
+
matches: components["schemas"]["FileSearchMatch"][];
|
|
1129
|
+
/** @description true when the walk stopped early (see stop_reason). */
|
|
1130
|
+
truncated: boolean;
|
|
1131
|
+
/**
|
|
1132
|
+
* @description Why the walk stopped early: max_matches reached, the 10 s budget, or 4 MiB of results.
|
|
1133
|
+
* @enum {string}
|
|
1134
|
+
*/
|
|
1135
|
+
stop_reason?: "max_matches" | "budget" | "max_bytes";
|
|
1136
|
+
/** Format: int64 */
|
|
1137
|
+
files_scanned: number;
|
|
1138
|
+
};
|
|
1139
|
+
FileEdit: {
|
|
1140
|
+
old_text: string;
|
|
1141
|
+
new_text: string;
|
|
1142
|
+
/** @default false */
|
|
1143
|
+
replace_all?: boolean;
|
|
1144
|
+
};
|
|
1145
|
+
FilePatchRequest: {
|
|
1146
|
+
path: components["schemas"]["GuestPath"];
|
|
1147
|
+
edits?: components["schemas"]["FileEdit"][];
|
|
1148
|
+
/** @description Replace the whole file (UTF-8 text) instead of edits. */
|
|
1149
|
+
content?: string;
|
|
1150
|
+
expected_revision?: components["schemas"]["FileRevision"];
|
|
1151
|
+
/** @default false */
|
|
1152
|
+
create_parents?: boolean;
|
|
1153
|
+
/** @description Permission bits for a new file (an existing file keeps its mode). */
|
|
1154
|
+
mode?: string;
|
|
1155
|
+
};
|
|
1156
|
+
FilePatchResult: {
|
|
1157
|
+
path: string;
|
|
1158
|
+
revision: string;
|
|
1159
|
+
previous_revision: components["schemas"]["FileRevision"];
|
|
1160
|
+
/** Format: int64 */
|
|
1161
|
+
bytes_written: number;
|
|
1162
|
+
durable: boolean;
|
|
1163
|
+
/** @description Number of replaced occurrences (edits). */
|
|
1164
|
+
replacements?: number;
|
|
1165
|
+
file?: components["schemas"]["FileInfo"];
|
|
1166
|
+
};
|
|
1167
|
+
WakeHintResult: {
|
|
1168
|
+
/**
|
|
1169
|
+
* @description What the host found when the hint arrived (contracts §25.1).
|
|
1170
|
+
* @enum {string}
|
|
1171
|
+
*/
|
|
1172
|
+
residency: "resident" | "frozen" | "hibernated" | "restoring";
|
|
863
1173
|
};
|
|
864
1174
|
FileList: {
|
|
865
1175
|
entries: components["schemas"]["FileInfo"][];
|
|
@@ -916,6 +1226,8 @@ export interface components {
|
|
|
916
1226
|
/** @description The file and its parent directory were fsync'd before this reply. */
|
|
917
1227
|
durable: boolean;
|
|
918
1228
|
file?: components["schemas"]["FileInfo"];
|
|
1229
|
+
/** @description The file's revision after the write (equals sha256 for a replace; the whole file's hash after an append). */
|
|
1230
|
+
revision?: string;
|
|
919
1231
|
};
|
|
920
1232
|
MkdirRequest: {
|
|
921
1233
|
path: components["schemas"]["GuestPath"];
|
|
@@ -1052,6 +1364,25 @@ export interface components {
|
|
|
1052
1364
|
[key: string]: unknown;
|
|
1053
1365
|
} | null;
|
|
1054
1366
|
};
|
|
1367
|
+
/**
|
|
1368
|
+
* @description A pending suspend request (application API `POST /v1/workspaces/{id}/suspend-when-idle`):
|
|
1369
|
+
* once the workspace has been idle for `after_seconds` after `requested_at`, suspend it.
|
|
1370
|
+
*/
|
|
1371
|
+
IdleSuspendRequest: {
|
|
1372
|
+
/**
|
|
1373
|
+
* Format: date-time
|
|
1374
|
+
* @description When the request was made (database clock); a newer request replaces it.
|
|
1375
|
+
*/
|
|
1376
|
+
requested_at: string;
|
|
1377
|
+
after_seconds: number;
|
|
1378
|
+
/**
|
|
1379
|
+
* Format: date-time
|
|
1380
|
+
* @description requested_at + after_seconds, the earliest suspend (the idle loop acts within
|
|
1381
|
+
* 2 x ACTIVITY_FLUSH_MS after it). A work signal still active then defers it;
|
|
1382
|
+
* suspend_at is the projection.
|
|
1383
|
+
*/
|
|
1384
|
+
not_before: string;
|
|
1385
|
+
};
|
|
1055
1386
|
IdleStatus: {
|
|
1056
1387
|
policy: components["schemas"]["IdlePolicy"];
|
|
1057
1388
|
/** @description Workspace observed_state (contracts §9). */
|
|
@@ -1069,6 +1400,8 @@ export interface components {
|
|
|
1069
1400
|
/** Format: date-time */
|
|
1070
1401
|
suspend_at: string | null;
|
|
1071
1402
|
auto_suspend: components["schemas"]["IdleAutoSuspend"];
|
|
1403
|
+
/** @description The pending suspend request while it is valid, else null. */
|
|
1404
|
+
suspend_request: components["schemas"]["IdleSuspendRequest"] | null;
|
|
1072
1405
|
};
|
|
1073
1406
|
};
|
|
1074
1407
|
responses: {
|
|
@@ -1088,6 +1421,9 @@ export interface components {
|
|
|
1088
1421
|
WorkspaceId: string;
|
|
1089
1422
|
SessionId: components["schemas"]["SessionIdValue"];
|
|
1090
1423
|
FilePath: components["schemas"]["GuestPath"];
|
|
1424
|
+
ExecutionId: components["schemas"]["ExecutionIdValue"];
|
|
1425
|
+
/** @description File-first workspaces only (ignored otherwise): the tree revision the call applies to, e.g. `7` or `"7"`. Another current revision fails the call with 409 conflict, details.reason tree_revision_mismatch, details.current_tree_revision. */
|
|
1426
|
+
IfMatch: string;
|
|
1091
1427
|
};
|
|
1092
1428
|
requestBodies: never;
|
|
1093
1429
|
headers: never;
|
|
@@ -1171,22 +1507,22 @@ export interface operations {
|
|
|
1171
1507
|
};
|
|
1172
1508
|
};
|
|
1173
1509
|
responses: {
|
|
1174
|
-
/** @description The session already existed; nothing was run again. */
|
|
1510
|
+
/** @description The session already existed; nothing was run again (processful), or the recorded result of an existing execution (file-first). */
|
|
1175
1511
|
200: {
|
|
1176
1512
|
headers: {
|
|
1177
1513
|
[name: string]: unknown;
|
|
1178
1514
|
};
|
|
1179
1515
|
content: {
|
|
1180
|
-
"application/json": components["schemas"]["ExecSession"];
|
|
1516
|
+
"application/json": components["schemas"]["ExecSession"] | components["schemas"]["ExecutionResult"];
|
|
1181
1517
|
};
|
|
1182
1518
|
};
|
|
1183
|
-
/** @description Session created and started. */
|
|
1519
|
+
/** @description Session created and started (processful), or the execution ran (file-first, ExecutionResult). */
|
|
1184
1520
|
201: {
|
|
1185
1521
|
headers: {
|
|
1186
1522
|
[name: string]: unknown;
|
|
1187
1523
|
};
|
|
1188
1524
|
content: {
|
|
1189
|
-
"application/json": components["schemas"]["ExecSession"];
|
|
1525
|
+
"application/json": components["schemas"]["ExecSession"] | components["schemas"]["ExecutionResult"];
|
|
1190
1526
|
};
|
|
1191
1527
|
};
|
|
1192
1528
|
default: components["responses"]["Error"];
|
|
@@ -1327,6 +1663,39 @@ export interface operations {
|
|
|
1327
1663
|
default: components["responses"]["Error"];
|
|
1328
1664
|
};
|
|
1329
1665
|
};
|
|
1666
|
+
executionGet: {
|
|
1667
|
+
parameters: {
|
|
1668
|
+
query?: never;
|
|
1669
|
+
header?: never;
|
|
1670
|
+
path: {
|
|
1671
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
1672
|
+
execution_id: components["parameters"]["ExecutionId"];
|
|
1673
|
+
};
|
|
1674
|
+
cookie?: never;
|
|
1675
|
+
};
|
|
1676
|
+
requestBody?: never;
|
|
1677
|
+
responses: {
|
|
1678
|
+
/** @description The execution ended. */
|
|
1679
|
+
200: {
|
|
1680
|
+
headers: {
|
|
1681
|
+
[name: string]: unknown;
|
|
1682
|
+
};
|
|
1683
|
+
content: {
|
|
1684
|
+
"application/json": components["schemas"]["ExecutionResult"];
|
|
1685
|
+
};
|
|
1686
|
+
};
|
|
1687
|
+
/** @description The execution is queued or running. */
|
|
1688
|
+
202: {
|
|
1689
|
+
headers: {
|
|
1690
|
+
[name: string]: unknown;
|
|
1691
|
+
};
|
|
1692
|
+
content: {
|
|
1693
|
+
"application/json": components["schemas"]["ExecutionResult"];
|
|
1694
|
+
};
|
|
1695
|
+
};
|
|
1696
|
+
default: components["responses"]["Error"];
|
|
1697
|
+
};
|
|
1698
|
+
};
|
|
1330
1699
|
ptyOpen: {
|
|
1331
1700
|
parameters: {
|
|
1332
1701
|
query?: never;
|
|
@@ -1563,6 +1932,12 @@ export interface operations {
|
|
|
1563
1932
|
headers: {
|
|
1564
1933
|
/** @description File size when the read started. */
|
|
1565
1934
|
"X-File-Size"?: number;
|
|
1935
|
+
/** @description SHA-256 of the whole file's content, for files of 16 MiB or less (contracts §26.2). */
|
|
1936
|
+
"X-File-Revision"?: string;
|
|
1937
|
+
/** @description disk: read from the suspended or hibernated workspace's disk (contracts §26.4). */
|
|
1938
|
+
"X-Served-From"?: "guest" | "disk";
|
|
1939
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
1940
|
+
"X-Tree-Revision"?: number;
|
|
1566
1941
|
[name: string]: unknown;
|
|
1567
1942
|
};
|
|
1568
1943
|
content: {
|
|
@@ -1573,6 +1948,8 @@ export interface operations {
|
|
|
1573
1948
|
206: {
|
|
1574
1949
|
headers: {
|
|
1575
1950
|
"Content-Range"?: string;
|
|
1951
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
1952
|
+
"X-Tree-Revision"?: number;
|
|
1576
1953
|
[name: string]: unknown;
|
|
1577
1954
|
};
|
|
1578
1955
|
content: {
|
|
@@ -1593,6 +1970,8 @@ export interface operations {
|
|
|
1593
1970
|
};
|
|
1594
1971
|
header?: {
|
|
1595
1972
|
"Idempotency-Key"?: string;
|
|
1973
|
+
/** @description File-first workspaces only (ignored otherwise): the tree revision the call applies to, e.g. `7` or `"7"`. Another current revision fails the call with 409 conflict, details.reason tree_revision_mismatch, details.current_tree_revision. */
|
|
1974
|
+
"If-Match"?: components["parameters"]["IfMatch"];
|
|
1596
1975
|
};
|
|
1597
1976
|
path: {
|
|
1598
1977
|
workspace_id: components["parameters"]["WorkspaceId"];
|
|
@@ -1608,6 +1987,8 @@ export interface operations {
|
|
|
1608
1987
|
/** @description Written and fsync'd. */
|
|
1609
1988
|
200: {
|
|
1610
1989
|
headers: {
|
|
1990
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
1991
|
+
"X-Tree-Revision"?: number;
|
|
1611
1992
|
[name: string]: unknown;
|
|
1612
1993
|
};
|
|
1613
1994
|
content: {
|
|
@@ -1623,7 +2004,10 @@ export interface operations {
|
|
|
1623
2004
|
path: components["parameters"]["FilePath"];
|
|
1624
2005
|
recursive?: boolean;
|
|
1625
2006
|
};
|
|
1626
|
-
header?:
|
|
2007
|
+
header?: {
|
|
2008
|
+
/** @description File-first workspaces only (ignored otherwise): the tree revision the call applies to, e.g. `7` or `"7"`. Another current revision fails the call with 409 conflict, details.reason tree_revision_mismatch, details.current_tree_revision. */
|
|
2009
|
+
"If-Match"?: components["parameters"]["IfMatch"];
|
|
2010
|
+
};
|
|
1627
2011
|
path: {
|
|
1628
2012
|
workspace_id: components["parameters"]["WorkspaceId"];
|
|
1629
2013
|
};
|
|
@@ -1634,6 +2018,8 @@ export interface operations {
|
|
|
1634
2018
|
/** @description Removed. */
|
|
1635
2019
|
204: {
|
|
1636
2020
|
headers: {
|
|
2021
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
2022
|
+
"X-Tree-Revision"?: number;
|
|
1637
2023
|
[name: string]: unknown;
|
|
1638
2024
|
};
|
|
1639
2025
|
content?: never;
|
|
@@ -1645,6 +2031,8 @@ export interface operations {
|
|
|
1645
2031
|
parameters: {
|
|
1646
2032
|
query: {
|
|
1647
2033
|
path: components["parameters"]["FilePath"];
|
|
2034
|
+
/** @description Include `revision` (SHA-256 of the content) for a regular file of up to 256 MiB. Omitted when the workspace's host predates revisions (contracts §26.7). */
|
|
2035
|
+
revision?: boolean;
|
|
1648
2036
|
};
|
|
1649
2037
|
header?: never;
|
|
1650
2038
|
path: {
|
|
@@ -1657,6 +2045,10 @@ export interface operations {
|
|
|
1657
2045
|
/** @description File info. */
|
|
1658
2046
|
200: {
|
|
1659
2047
|
headers: {
|
|
2048
|
+
/** @description disk: read from the suspended or hibernated workspace's disk (contracts §26.4). */
|
|
2049
|
+
"X-Served-From"?: "guest" | "disk";
|
|
2050
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
2051
|
+
"X-Tree-Revision"?: number;
|
|
1660
2052
|
[name: string]: unknown;
|
|
1661
2053
|
};
|
|
1662
2054
|
content: {
|
|
@@ -1683,6 +2075,10 @@ export interface operations {
|
|
|
1683
2075
|
/** @description Entries. */
|
|
1684
2076
|
200: {
|
|
1685
2077
|
headers: {
|
|
2078
|
+
/** @description disk: read from the suspended or hibernated workspace's disk (contracts §26.4). */
|
|
2079
|
+
"X-Served-From"?: "guest" | "disk";
|
|
2080
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
2081
|
+
"X-Tree-Revision"?: number;
|
|
1686
2082
|
[name: string]: unknown;
|
|
1687
2083
|
};
|
|
1688
2084
|
content: {
|
|
@@ -1695,7 +2091,10 @@ export interface operations {
|
|
|
1695
2091
|
fileMkdir: {
|
|
1696
2092
|
parameters: {
|
|
1697
2093
|
query?: never;
|
|
1698
|
-
header?:
|
|
2094
|
+
header?: {
|
|
2095
|
+
/** @description File-first workspaces only (ignored otherwise): the tree revision the call applies to, e.g. `7` or `"7"`. Another current revision fails the call with 409 conflict, details.reason tree_revision_mismatch, details.current_tree_revision. */
|
|
2096
|
+
"If-Match"?: components["parameters"]["IfMatch"];
|
|
2097
|
+
};
|
|
1699
2098
|
path: {
|
|
1700
2099
|
workspace_id: components["parameters"]["WorkspaceId"];
|
|
1701
2100
|
};
|
|
@@ -1710,6 +2109,8 @@ export interface operations {
|
|
|
1710
2109
|
/** @description Directory info. */
|
|
1711
2110
|
200: {
|
|
1712
2111
|
headers: {
|
|
2112
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
2113
|
+
"X-Tree-Revision"?: number;
|
|
1713
2114
|
[name: string]: unknown;
|
|
1714
2115
|
};
|
|
1715
2116
|
content: {
|
|
@@ -1719,7 +2120,7 @@ export interface operations {
|
|
|
1719
2120
|
default: components["responses"]["Error"];
|
|
1720
2121
|
};
|
|
1721
2122
|
};
|
|
1722
|
-
|
|
2123
|
+
fileSearch: {
|
|
1723
2124
|
parameters: {
|
|
1724
2125
|
query?: never;
|
|
1725
2126
|
header?: never;
|
|
@@ -1728,6 +2129,72 @@ export interface operations {
|
|
|
1728
2129
|
};
|
|
1729
2130
|
cookie?: never;
|
|
1730
2131
|
};
|
|
2132
|
+
requestBody: {
|
|
2133
|
+
content: {
|
|
2134
|
+
"application/json": components["schemas"]["FileSearchRequest"];
|
|
2135
|
+
};
|
|
2136
|
+
};
|
|
2137
|
+
responses: {
|
|
2138
|
+
/** @description Matches. */
|
|
2139
|
+
200: {
|
|
2140
|
+
headers: {
|
|
2141
|
+
"X-Served-From"?: "guest" | "disk";
|
|
2142
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
2143
|
+
"X-Tree-Revision"?: number;
|
|
2144
|
+
[name: string]: unknown;
|
|
2145
|
+
};
|
|
2146
|
+
content: {
|
|
2147
|
+
"application/json": components["schemas"]["FileSearchResult"];
|
|
2148
|
+
};
|
|
2149
|
+
};
|
|
2150
|
+
default: components["responses"]["Error"];
|
|
2151
|
+
};
|
|
2152
|
+
};
|
|
2153
|
+
filePatch: {
|
|
2154
|
+
parameters: {
|
|
2155
|
+
query?: never;
|
|
2156
|
+
header?: {
|
|
2157
|
+
"Idempotency-Key"?: string;
|
|
2158
|
+
/** @description File-first workspaces only (ignored otherwise): the tree revision the call applies to, e.g. `7` or `"7"`. Another current revision fails the call with 409 conflict, details.reason tree_revision_mismatch, details.current_tree_revision. */
|
|
2159
|
+
"If-Match"?: components["parameters"]["IfMatch"];
|
|
2160
|
+
};
|
|
2161
|
+
path: {
|
|
2162
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
2163
|
+
};
|
|
2164
|
+
cookie?: never;
|
|
2165
|
+
};
|
|
2166
|
+
requestBody: {
|
|
2167
|
+
content: {
|
|
2168
|
+
"application/json": components["schemas"]["FilePatchRequest"];
|
|
2169
|
+
};
|
|
2170
|
+
};
|
|
2171
|
+
responses: {
|
|
2172
|
+
/** @description Patched and fsync'd. */
|
|
2173
|
+
200: {
|
|
2174
|
+
headers: {
|
|
2175
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
2176
|
+
"X-Tree-Revision"?: number;
|
|
2177
|
+
[name: string]: unknown;
|
|
2178
|
+
};
|
|
2179
|
+
content: {
|
|
2180
|
+
"application/json": components["schemas"]["FilePatchResult"];
|
|
2181
|
+
};
|
|
2182
|
+
};
|
|
2183
|
+
default: components["responses"]["Error"];
|
|
2184
|
+
};
|
|
2185
|
+
};
|
|
2186
|
+
fileMove: {
|
|
2187
|
+
parameters: {
|
|
2188
|
+
query?: never;
|
|
2189
|
+
header?: {
|
|
2190
|
+
/** @description File-first workspaces only (ignored otherwise): the tree revision the call applies to, e.g. `7` or `"7"`. Another current revision fails the call with 409 conflict, details.reason tree_revision_mismatch, details.current_tree_revision. */
|
|
2191
|
+
"If-Match"?: components["parameters"]["IfMatch"];
|
|
2192
|
+
};
|
|
2193
|
+
path: {
|
|
2194
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
2195
|
+
};
|
|
2196
|
+
cookie?: never;
|
|
2197
|
+
};
|
|
1731
2198
|
requestBody: {
|
|
1732
2199
|
content: {
|
|
1733
2200
|
"application/json": components["schemas"]["MoveRequest"];
|
|
@@ -1737,6 +2204,8 @@ export interface operations {
|
|
|
1737
2204
|
/** @description Info of the destination. */
|
|
1738
2205
|
200: {
|
|
1739
2206
|
headers: {
|
|
2207
|
+
/** @description File-first workspaces: the tree revision served or produced (contracts §29.2). */
|
|
2208
|
+
"X-Tree-Revision"?: number;
|
|
1740
2209
|
[name: string]: unknown;
|
|
1741
2210
|
};
|
|
1742
2211
|
content: {
|
|
@@ -1879,6 +2348,29 @@ export interface operations {
|
|
|
1879
2348
|
default: components["responses"]["Error"];
|
|
1880
2349
|
};
|
|
1881
2350
|
};
|
|
2351
|
+
workspaceWakeHint: {
|
|
2352
|
+
parameters: {
|
|
2353
|
+
query?: never;
|
|
2354
|
+
header?: never;
|
|
2355
|
+
path: {
|
|
2356
|
+
workspace_id: components["parameters"]["WorkspaceId"];
|
|
2357
|
+
};
|
|
2358
|
+
cookie?: never;
|
|
2359
|
+
};
|
|
2360
|
+
requestBody?: never;
|
|
2361
|
+
responses: {
|
|
2362
|
+
/** @description Hint accepted. */
|
|
2363
|
+
202: {
|
|
2364
|
+
headers: {
|
|
2365
|
+
[name: string]: unknown;
|
|
2366
|
+
};
|
|
2367
|
+
content: {
|
|
2368
|
+
"application/json": components["schemas"]["WakeHintResult"];
|
|
2369
|
+
};
|
|
2370
|
+
};
|
|
2371
|
+
default: components["responses"]["Error"];
|
|
2372
|
+
};
|
|
2373
|
+
};
|
|
1882
2374
|
workspaceKeepalive: {
|
|
1883
2375
|
parameters: {
|
|
1884
2376
|
query?: never;
|