@sylphx/sdk 0.32.1 → 0.32.2

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.
Files changed (120) hide show
  1. package/README.md +105 -0
  2. package/dist/access.d.ts +16 -1
  3. package/dist/access.js +1 -1
  4. package/dist/access.js.map +1 -1
  5. package/dist/agents.d.ts +463 -25
  6. package/dist/agents.js +276 -5
  7. package/dist/agents.js.map +1 -1
  8. package/dist/ai.js +1 -1
  9. package/dist/ai.js.map +1 -1
  10. package/dist/analytics.d.ts +232 -0
  11. package/dist/analytics.js +126 -0
  12. package/dist/analytics.js.map +1 -0
  13. package/dist/artifacts.d.ts +47 -1
  14. package/dist/artifacts.js +30 -2
  15. package/dist/artifacts.js.map +1 -1
  16. package/dist/assets.js +1 -1
  17. package/dist/assets.js.map +1 -1
  18. package/dist/auth/client.d.ts +34 -3
  19. package/dist/auth/client.js +42 -5
  20. package/dist/auth/client.js.map +1 -1
  21. package/dist/auth/continue-mock.d.ts +21 -0
  22. package/dist/auth/continue-mock.js +75 -0
  23. package/dist/auth/continue-mock.js.map +1 -0
  24. package/dist/auth/end-user-keys-mock.js +1 -1
  25. package/dist/auth/end-user-keys-mock.js.map +1 -1
  26. package/dist/auth/end-user-keys.js +1 -1
  27. package/dist/auth/end-user-keys.js.map +1 -1
  28. package/dist/auth/verify.js +1 -1
  29. package/dist/auth/verify.js.map +1 -1
  30. package/dist/auth.d.ts +169 -0
  31. package/dist/auth.js +135 -1
  32. package/dist/auth.js.map +1 -1
  33. package/dist/billing.d.ts +13 -6
  34. package/dist/billing.js +3 -1
  35. package/dist/billing.js.map +1 -1
  36. package/dist/broker.d.ts +165 -33
  37. package/dist/broker.js +103 -7
  38. package/dist/broker.js.map +1 -1
  39. package/dist/browser-upload.d.ts +101 -0
  40. package/dist/browser-upload.js +130 -0
  41. package/dist/browser-upload.js.map +1 -0
  42. package/dist/build.js +1 -1
  43. package/dist/build.js.map +1 -1
  44. package/dist/common.d.ts +1 -1
  45. package/dist/common.js +1 -1
  46. package/dist/common.js.map +1 -1
  47. package/dist/config/flags.d.ts +12 -2
  48. package/dist/config/flags.js +54 -6
  49. package/dist/config/flags.js.map +1 -1
  50. package/dist/config.d.ts +24 -0
  51. package/dist/config.js +22 -1
  52. package/dist/config.js.map +1 -1
  53. package/dist/connections.d.ts +128 -25
  54. package/dist/connections.js +72 -25
  55. package/dist/connections.js.map +1 -1
  56. package/dist/data.d.ts +306 -13
  57. package/dist/data.js +110 -9
  58. package/dist/data.js.map +1 -1
  59. package/dist/entitlement.js +1 -1
  60. package/dist/entitlement.js.map +1 -1
  61. package/dist/events/realtime.js +1 -1
  62. package/dist/events/realtime.js.map +1 -1
  63. package/dist/events/webhooks.js +1 -1
  64. package/dist/events/webhooks.js.map +1 -1
  65. package/dist/events.d.ts +36 -0
  66. package/dist/events.js +29 -1
  67. package/dist/events.js.map +1 -1
  68. package/dist/flags.d.ts +2 -0
  69. package/dist/flags.js +5 -1
  70. package/dist/flags.js.map +1 -1
  71. package/dist/hosting.js +1 -1
  72. package/dist/hosting.js.map +1 -1
  73. package/dist/ids.d.ts +40 -0
  74. package/dist/ids.js +9 -1
  75. package/dist/ids.js.map +1 -1
  76. package/dist/index.d.ts +5 -1
  77. package/dist/index.js +14 -2
  78. package/dist/index.js.map +1 -1
  79. package/dist/keys.js +1 -1
  80. package/dist/keys.js.map +1 -1
  81. package/dist/knowledge.d.ts +32 -9
  82. package/dist/knowledge.js +21 -11
  83. package/dist/knowledge.js.map +1 -1
  84. package/dist/localization.js +1 -1
  85. package/dist/localization.js.map +1 -1
  86. package/dist/methods.js +408 -8
  87. package/dist/methods.js.map +1 -1
  88. package/dist/money.d.ts +263 -7
  89. package/dist/money.js +121 -7
  90. package/dist/money.js.map +1 -1
  91. package/dist/network.js +1 -1
  92. package/dist/network.js.map +1 -1
  93. package/dist/notify.d.ts +340 -0
  94. package/dist/notify.js +304 -1
  95. package/dist/notify.js.map +1 -1
  96. package/dist/observability.js +1 -1
  97. package/dist/observability.js.map +1 -1
  98. package/dist/realtime.js +1 -1
  99. package/dist/realtime.js.map +1 -1
  100. package/dist/release.js +1 -1
  101. package/dist/release.js.map +1 -1
  102. package/dist/runners.js +1 -1
  103. package/dist/runners.js.map +1 -1
  104. package/dist/runtime.d.ts +3 -0
  105. package/dist/runtime.js +54 -1
  106. package/dist/runtime.js.map +1 -1
  107. package/dist/sandboxes/stream-mock.d.ts +124 -0
  108. package/dist/sandboxes/stream-mock.js +476 -0
  109. package/dist/sandboxes/stream-mock.js.map +1 -0
  110. package/dist/sandboxes/stream.d.ts +407 -0
  111. package/dist/sandboxes/stream.js +335 -0
  112. package/dist/sandboxes/stream.js.map +1 -0
  113. package/dist/sandboxes.d.ts +94 -17
  114. package/dist/sandboxes.js +33 -4
  115. package/dist/sandboxes.js.map +1 -1
  116. package/dist/secrets.js +1 -1
  117. package/dist/secrets.js.map +1 -1
  118. package/dist/workflows.js +1 -1
  119. package/dist/workflows.js.map +1 -1
  120. package/package.json +1 -1
@@ -0,0 +1,335 @@
1
+ // @generated by sylphx-gen. Do not edit.
2
+ /**
3
+ * The Sylphx Sandboxes mock display-stream protocol, version 1: signalling
4
+ * and four data channels (`control`, `input`, `pointer`, `clipboard`). Every
5
+ * test frame is one JSON object tagged by `t`; behavior is documented in
6
+ * `docs/services/sandboxes/stream.md`. This is not production media wire;
7
+ * ADR-5094's management-rooted protobuf graph owns that API.
8
+ * `contracts/fixtures/sandboxes-stream.json` holds the golden frames this
9
+ * module and the Rust SDK (`sylphx::sandboxes::stream`) both replay.
10
+ *
11
+ * import { parseInput, encodeFrame } from '@sylphx/sdk/sandboxes/stream'
12
+ * const frame = parseInput('{"t":"tx","text":"你好"}') // { t: 'tx', text: '你好' }
13
+ * channel.send(encodeFrame({ t: 'kd', code: 'KeyA', key: 'a', mods: [], repeat: false }))
14
+ *
15
+ * Receivers ignore unknown fields; an unknown `t`, a missing field, or a
16
+ * value outside its set throws `StreamFrameError` (answer `invalid_message`).
17
+ * No dependencies; runs in browsers, Bun, Node 20+ and workers.
18
+ */
19
+ /** The protocol version this module speaks (`hello.v`). */
20
+ export const STREAM_VERSION = 1;
21
+ /** The WebSocket subprotocol prefix that carries the stream token. */
22
+ export const TOKEN_PROTOCOL = 'sbx.v1.';
23
+ /** The data channel labels, in the order the machine opens them. */
24
+ export const CHANNELS = ['control', 'input', 'pointer', 'clipboard'];
25
+ /** The largest clipboard text item, in UTF-8 bytes. */
26
+ export const MAX_CLIP_TEXT_BYTES = 1 << 20;
27
+ /** The largest clipboard PNG item, in decoded bytes. */
28
+ export const MAX_CLIP_IMAGE_BYTES = 8 << 20;
29
+ /** A `clip` whose JSON is longer than this travels as `clip_chunk` frames. */
30
+ export const MAX_FRAME_BYTES = 16 << 10;
31
+ /** The largest slice of a `clip` one `clip_chunk` carries, before base64 (a chunk frame stays under 16 KiB). */
32
+ export const CHUNK_SLICE_BYTES = 12_000;
33
+ /** The most chunks one `clip` may be cut into. */
34
+ export const MAX_CHUNKS = 2048;
35
+ /** The HTTP status of an admission refusal. */
36
+ export function admitStatus(e) {
37
+ return e === 'UNAUTHENTICATED' ? 401 : e === 'NOT_FOUND' ? 404 : 409;
38
+ }
39
+ /** Whether a key types its `key` as Unicode: one character, no modifier but Shift. */
40
+ export function typesUnicode(k) {
41
+ return [...k.key].length === 1 && k.mods.every((m) => m === 'shift');
42
+ }
43
+ // ---- validation ----
44
+ /** A frame that does not parse: answer `invalid_message`. */
45
+ export class StreamFrameError extends Error {
46
+ code;
47
+ constructor(message, code = 'invalid_message') {
48
+ super(message);
49
+ this.code = code;
50
+ this.name = 'StreamFrameError';
51
+ }
52
+ }
53
+ const OPTIONAL = Symbol('optional');
54
+ function fail(at, what) {
55
+ throw new StreamFrameError(`${at}: ${what}`);
56
+ }
57
+ const str = (v, at) => (typeof v === 'string' ? v : fail(at, 'not a string'));
58
+ const bool = (v, at) => (typeof v === 'boolean' ? v : fail(at, 'not a boolean'));
59
+ const num = (v, at) => typeof v === 'number' && Number.isFinite(v) ? v : fail(at, 'not a number');
60
+ function int(min, max) {
61
+ return (v, at) => typeof v === 'number' && Number.isInteger(v) && v >= min && v <= max
62
+ ? v
63
+ : fail(at, `not an integer in ${min}..${max}`);
64
+ }
65
+ const i32 = int(-(2 ** 31), 2 ** 31 - 1);
66
+ const u8 = int(0, 255);
67
+ const u16 = int(0, 65535);
68
+ const u32 = int(0, 2 ** 32 - 1);
69
+ const u64 = int(0, Number.MAX_SAFE_INTEGER);
70
+ const i64 = int(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
71
+ function oneOf(...values) {
72
+ return (v, at) => values.includes(v) ? v : fail(at, `not one of ${values.join(', ')}`);
73
+ }
74
+ function arr(item) {
75
+ return (v, at) => Array.isArray(v) ? v.map((x, i) => item(x, `${at}[${i}]`)) : fail(at, 'not an array');
76
+ }
77
+ function opt(c) {
78
+ const f = (v, at) => c(v, at);
79
+ f[OPTIONAL] = true;
80
+ return f;
81
+ }
82
+ function obj(fields) {
83
+ return (v, at) => {
84
+ if (typeof v !== 'object' || v === null || Array.isArray(v))
85
+ fail(at, 'not an object');
86
+ const src = v;
87
+ const out = {};
88
+ for (const [k, c] of Object.entries(fields)) {
89
+ if (src[k] === undefined) {
90
+ if (c[OPTIONAL])
91
+ continue;
92
+ fail(`${at}.${k}`, 'missing');
93
+ }
94
+ out[k] = c(src[k], `${at}.${k}`);
95
+ }
96
+ return out;
97
+ };
98
+ }
99
+ const ERROR_CODES = [
100
+ 'invalid_message',
101
+ 'unsupported_version',
102
+ 'out_of_order',
103
+ 'unauthenticated',
104
+ 'stale_generation',
105
+ 'control_held',
106
+ 'not_controller',
107
+ 'too_large',
108
+ ];
109
+ const MODIFIERS = ['ctrl', 'alt', 'shift', 'meta'];
110
+ const COMBO_KEYS = [
111
+ ...MODIFIERS,
112
+ 'delete',
113
+ 'tab',
114
+ 'escape',
115
+ 'enter',
116
+ 'backspace',
117
+ 'space',
118
+ 'printscreen',
119
+ ...Array.from({ length: 12 }, (_, i) => `f${i + 1}`),
120
+ ];
121
+ const ice = obj({
122
+ candidate: str,
123
+ sdpMid: opt(str),
124
+ sdpMLineIndex: opt(u16),
125
+ usernameFragment: opt(str),
126
+ });
127
+ const errorFields = { code: oneOf(...ERROR_CODES), message: opt(str) };
128
+ const monitor = obj({
129
+ id: str,
130
+ name: str,
131
+ x: i32,
132
+ y: i32,
133
+ w: u32,
134
+ h: u32,
135
+ scale: num,
136
+ primary: bool,
137
+ });
138
+ const monitorSelection = (v, at) => v === 'all' ? v : Array.isArray(v) ? arr(str)(v, at) : fail(at, "not 'all' or a list");
139
+ const button = { m: str, x: i32, y: i32, button: int(0, 4), ts: opt(u64) };
140
+ const key = { code: str, key: str, mods: arr(oneOf(...MODIFIERS)), repeat: bool, ts: opt(u64) };
141
+ const clipItem = obj({ mime: oneOf('text/plain', 'image/png'), data: str });
142
+ const TABLES = {
143
+ signalClient: {
144
+ hello: {
145
+ v: u32,
146
+ client: obj({ dpr: num, w: u32, h: u32, touch: bool }),
147
+ monitors: opt(monitorSelection),
148
+ },
149
+ answer: { sdp: str },
150
+ ice: { candidate: ice },
151
+ restart: {},
152
+ },
153
+ signalServer: {
154
+ offer: { sdp: str },
155
+ ice: { candidate: ice },
156
+ bye: { reason: oneOf('generation_changed', 'revoked', 'lease_gone') },
157
+ error: errorFields,
158
+ },
159
+ controlClient: { upgrade: { token: str }, downgrade: {} },
160
+ controlServer: {
161
+ role: { role: oneOf('viewer', 'controller'), epoch: i64 },
162
+ control: { holder: oneOf('human', 'agent', 'none'), epoch: i64, label: str },
163
+ monitors: { list: arr(monitor) },
164
+ cursor: { png: str, hx: u32, hy: u32, visible: bool },
165
+ stats: { rtt_ms: u32, fps: u32, kbps: u32, encoder: str },
166
+ error: errorFields,
167
+ },
168
+ input: {
169
+ pd: button,
170
+ pu: button,
171
+ wh: { dx: num, dy: num, unit: oneOf('pixel', 'line'), ts: opt(u64) },
172
+ kd: key,
173
+ ku: key,
174
+ tx: { text: str },
175
+ ime: { phase: oneOf('start', 'update', 'end'), text: str, caret: u32 },
176
+ tc: { id: u32, phase: oneOf('start', 'move', 'end', 'cancel'), m: str, x: i32, y: i32 },
177
+ combo: { keys: arr(oneOf(...COMBO_KEYS)) },
178
+ release_all: {},
179
+ },
180
+ pointer: { pm: { m: str, x: i32, y: i32, b: u8, ts: opt(u64) } },
181
+ clipboard: {
182
+ clip: { seq: u64, items: arr(clipItem) },
183
+ clip_chunk: { seq: u64, i: u32, n: u32, data: str },
184
+ error: errorFields,
185
+ },
186
+ };
187
+ function validate(kind, v) {
188
+ if (typeof v !== 'object' || v === null || Array.isArray(v))
189
+ fail(kind, 'not an object');
190
+ const t = v.t;
191
+ const table = TABLES[kind];
192
+ if (typeof t !== 'string' || !Object.hasOwn(table, t))
193
+ fail(kind, `unknown t ${String(t)}`);
194
+ const body = obj(table[t])(v, `${kind}.${t}`);
195
+ if (kind === 'signalClient' && t === 'hello' && body.monitors === undefined)
196
+ body.monitors = 'all';
197
+ return { t, ...body };
198
+ }
199
+ function decode(kind, input) {
200
+ if (typeof input !== 'string')
201
+ return validate(kind, input);
202
+ let v;
203
+ try {
204
+ v = JSON.parse(input);
205
+ }
206
+ catch {
207
+ fail(kind, 'not JSON');
208
+ }
209
+ return validate(kind, v);
210
+ }
211
+ export function parseFrame(kind, input) {
212
+ return decode(kind, input);
213
+ }
214
+ export const parseSignalClient = (s) => parseFrame('signalClient', s);
215
+ export const parseSignalServer = (s) => parseFrame('signalServer', s);
216
+ export const parseControlClient = (s) => parseFrame('controlClient', s);
217
+ export const parseControlServer = (s) => parseFrame('controlServer', s);
218
+ export const parseInput = (s) => parseFrame('input', s);
219
+ export const parsePointer = (s) => parseFrame('pointer', s);
220
+ export const parseClipboard = (s) => parseFrame('clipboard', s);
221
+ /** Serialises a frame. */
222
+ export function encodeFrame(frame) {
223
+ return JSON.stringify(frame);
224
+ }
225
+ // ---- clipboard limits and chunks ----
226
+ const B64 = /^[A-Za-z0-9+/]*={0,2}$/;
227
+ function isBase64(s) {
228
+ return s.length % 4 === 0 && B64.test(s);
229
+ }
230
+ function base64Encode(bytes) {
231
+ let s = '';
232
+ for (let i = 0; i < bytes.length; i += 0x8000) {
233
+ s += String.fromCharCode(...bytes.subarray(i, i + 0x8000));
234
+ }
235
+ return btoa(s);
236
+ }
237
+ function base64Decode(s) {
238
+ if (!isBase64(s))
239
+ throw new StreamFrameError('not base64');
240
+ const bin = atob(s);
241
+ const out = new Uint8Array(bin.length);
242
+ for (let i = 0; i < bin.length; i++)
243
+ out[i] = bin.charCodeAt(i);
244
+ return out;
245
+ }
246
+ function base64Length(s) {
247
+ return (s.length / 4) * 3 - (s.endsWith('==') ? 2 : s.endsWith('=') ? 1 : 0);
248
+ }
249
+ /**
250
+ * Checks a clip's limits: at most one item per type, text at most 1 MiB of
251
+ * UTF-8, a PNG at most 8 MiB decoded and valid base64. Returns the error
252
+ * code to answer, or null.
253
+ */
254
+ export function checkClip(clip) {
255
+ const seen = new Set();
256
+ for (const item of clip.items) {
257
+ if (seen.has(item.mime))
258
+ return 'invalid_message';
259
+ seen.add(item.mime);
260
+ if (item.mime === 'text/plain') {
261
+ if (new TextEncoder().encode(item.data).length > MAX_CLIP_TEXT_BYTES)
262
+ return 'too_large';
263
+ }
264
+ else {
265
+ // Refuse on length before reading anything large.
266
+ if (item.data.length > (Math.floor(MAX_CLIP_IMAGE_BYTES / 3) + 1) * 4)
267
+ return 'too_large';
268
+ if (!isBase64(item.data))
269
+ return 'invalid_message';
270
+ if (base64Length(item.data) > MAX_CLIP_IMAGE_BYTES)
271
+ return 'too_large';
272
+ }
273
+ }
274
+ return null;
275
+ }
276
+ /** The `clip` frame's UTF-8 cut into `clip_chunk` frames of at most `sliceBytes`. */
277
+ export function chunkClip(clip, sliceBytes = CHUNK_SLICE_BYTES) {
278
+ const bytes = new TextEncoder().encode(JSON.stringify({ t: 'clip', seq: clip.seq, items: clip.items }));
279
+ const n = Math.max(1, Math.ceil(bytes.length / sliceBytes));
280
+ return Array.from({ length: n }, (_, i) => ({
281
+ t: 'clip_chunk',
282
+ seq: clip.seq,
283
+ i,
284
+ n,
285
+ data: base64Encode(bytes.subarray(i * sliceBytes, (i + 1) * sliceBytes)),
286
+ }));
287
+ }
288
+ /** The frames that carry a clip: itself when its JSON is at most 16 KiB, else its chunks. */
289
+ export function clipFrames(clip) {
290
+ const json = JSON.stringify({ t: 'clip', seq: clip.seq, items: clip.items });
291
+ return new TextEncoder().encode(json).length <= MAX_FRAME_BYTES
292
+ ? [{ t: 'clip', seq: clip.seq, items: clip.items }]
293
+ : chunkClip(clip);
294
+ }
295
+ /** Joins `clip_chunk` frames; a chunk of another `seq` drops an unfinished clip. */
296
+ export class ChunkJoiner {
297
+ seq = null;
298
+ parts = [];
299
+ /** Adds one chunk; returns the clip once every slice has arrived. Throws on a bad chunk. */
300
+ push(c) {
301
+ if (c.n === 0 || c.n > MAX_CHUNKS || c.i >= c.n)
302
+ throw new StreamFrameError('bad chunk index');
303
+ if (this.seq !== c.seq || this.parts.length !== c.n) {
304
+ this.seq = c.seq;
305
+ this.parts = new Array(c.n).fill(undefined);
306
+ }
307
+ const bytes = base64Decode(c.data);
308
+ if (bytes.length > CHUNK_SLICE_BYTES)
309
+ throw new StreamFrameError('chunk too large', 'too_large');
310
+ this.parts[c.i] = bytes;
311
+ if (this.parts.some((p) => p === undefined))
312
+ return null;
313
+ const total = this.parts.reduce((a, p) => a + p.length, 0);
314
+ const joined = new Uint8Array(total);
315
+ let o = 0;
316
+ for (const p of this.parts) {
317
+ joined.set(p, o);
318
+ o += p.length;
319
+ }
320
+ this.seq = null;
321
+ this.parts = [];
322
+ let text;
323
+ try {
324
+ text = new TextDecoder('utf-8', { fatal: true }).decode(joined);
325
+ }
326
+ catch {
327
+ throw new StreamFrameError('chunks are not UTF-8');
328
+ }
329
+ const frame = parseFrame('clipboard', text);
330
+ if (frame.t !== 'clip')
331
+ throw new StreamFrameError('chunks are not a clip');
332
+ return frame;
333
+ }
334
+ }
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CAAC,GAAG,CAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QAC3D,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAA;QACpC,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,CAAC,CAAE,EAAE,CAAC,CAAC,CAAA;YACjB,CAAC,IAAI,CAAE,CAAC,MAAM,CAAA;QACf,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAA;QACf,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,IAAY,CAAA;QAChB,IAAI,CAAC;YACJ,IAAI,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAChE,CAAC;QAAC,MAAM,CAAC;YACR,MAAM,IAAI,gBAAgB,CAAC,sBAAsB,CAAC,CAAA;QACnD,CAAC;QACD,MAAM,KAAK,GAAG,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;QAC3C,IAAI,KAAK,CAAC,CAAC,KAAK,MAAM;YAAE,MAAM,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,CAAA;QAC3E,OAAO,KAAK,CAAA;IACb,CAAC;CACD"}
@@ -67,6 +67,40 @@ export interface ActionResult {
67
67
  /** For `take_screenshot` and `zoom`. */
68
68
  image?: Screenshot;
69
69
  }
70
+ /** The request of ArchiveVolume. */
71
+ export interface ArchiveVolumeRequest {
72
+ /** The workspace to archive. Its name and UID remain unchanged. */
73
+ name: string;
74
+ /** Archive only if the current etag matches. */
75
+ etag?: string;
76
+ /**
77
+ * Check eligibility and retained-copy evidence without modifying the Volume,
78
+ * creating archive objects, or releasing its source claim.
79
+ */
80
+ validateOnly?: boolean;
81
+ }
82
+ /**
83
+ * The result of ArchiveVolume. A pending archive can be retried safely; an
84
+ * ambiguous response never authorizes attaching an empty replacement.
85
+ */
86
+ export interface ArchiveVolumeResponse {
87
+ /** The current workspace, including its unchanged resource identity. */
88
+ volume?: Volume;
89
+ /**
90
+ * Whether this attempt passed the eligibility and retained-copy checks.
91
+ * Validation is an observation; execution always checks current state again.
92
+ */
93
+ reclaimable?: boolean;
94
+ /** Requested PVC bytes that archival would release, not physical storage use. */
95
+ requestedBytes?: string;
96
+ /** True only after the source claim has disappeared and its archive is retained. */
97
+ archived?: boolean;
98
+ /**
99
+ * A bounded decision reason, such as within_grace, attached,
100
+ * awaiting_offsite_coverage, coverage_unavailable, pending or archived.
101
+ */
102
+ reason?: string;
103
+ }
70
104
  /** BrowserSpec configures the Chromium of a BROWSER lease. */
71
105
  export interface BrowserSpec {
72
106
  /**
@@ -311,8 +345,8 @@ export interface ExecLeaseRequest {
311
345
  /** Bytes written to standard input. */
312
346
  stdin?: string;
313
347
  /**
314
- * Kill the process after this long; default 60 seconds, at most 10
315
- * minutes.
348
+ * Kill the process after this long; default 60 seconds, at most 30
349
+ * minutes, and never past the lease's `expire_time`.
316
350
  */
317
351
  timeout?: string;
318
352
  /**
@@ -320,6 +354,17 @@ export interface ExecLeaseRequest {
320
354
  * belongs to the lessee.
321
355
  */
322
356
  user?: string;
357
+ /**
358
+ * Dispatches the command at most once per lease and key, 1-255 printable
359
+ * ASCII characters. The first call claims the key before the command
360
+ * starts; a later call with the same key and request returns the recorded
361
+ * result (also after the lease ended), `IDEMPOTENCY_IN_PROGRESS` while the
362
+ * first still runs (the command continues after the call returns), and
363
+ * `EXEC_OUTCOME_UNKNOWN` when the outcome was lost after dispatch. The same
364
+ * key with another request is `IDEMPOTENCY_KEY_REUSED`. A refusal before
365
+ * the command started releases the key.
366
+ */
367
+ idempotencyKey?: string;
323
368
  }
324
369
  /** The response of ExecLease. */
325
370
  export interface ExecLeaseResponse {
@@ -437,7 +482,10 @@ export interface Lease {
437
482
  readonly uid?: string;
438
483
  /** Resource metadata. */
439
484
  meta?: common.ResourceMeta;
440
- /** Desired state. */
485
+ /**
486
+ * Desired state; omit it, or send it empty, for the zero-config lease: the
487
+ * platform resolves and records the shape and `ttl` (see `LeaseSpec`).
488
+ */
441
489
  spec?: LeaseSpec;
442
490
  /** Observed state. */
443
491
  readonly status?: LeaseStatus;
@@ -536,19 +584,35 @@ export interface LeasePort {
536
584
  /** The port's URL. */
537
585
  readonly uri?: string;
538
586
  }
539
- /** LeaseSpec is the caller-writable state of a Lease. */
587
+ /**
588
+ * LeaseSpec is the caller-writable state of a Lease. Every field is optional:
589
+ * an empty spec (or no spec at all) is the zero-config lease — a GENERAL lease
590
+ * of the `base` image on the `linux-s` shape for 300 seconds. Set `kind` for a
591
+ * browser, desktop, or Android machine; set `shape`, `ttl`, or `region` only to
592
+ * go beyond those defaults. The platform records the resolved shape and `ttl`
593
+ * on the created lease.
594
+ */
540
595
  export interface LeaseSpec {
541
- /** The shape. */
596
+ /**
597
+ * The shape; when unset the platform resolves one from `kind` and the image:
598
+ * `linux-s` for a GENERAL lease, `linux-m` for BROWSER, `linux-l` for DESKTOP
599
+ * or ANDROID, and `build-standard` for the `template:build` image. An
600
+ * explicit shape must serve `kind`.
601
+ */
542
602
  shape?: string;
543
603
  /**
544
604
  * The image: an artifact in Sylphx Artifacts, by digest, or `template:<name>`
545
- * (`base`,
546
- * `desktop`, `browser`, `android`). Ignored when `source_snapshot` is set.
605
+ * (`base`, `desktop`, `browser`, `android`,
606
+ * `build`). Default the template of `kind`. Ignored when `source_snapshot` is
607
+ * set.
547
608
  */
548
609
  image?: string;
549
610
  /** What the machine serves; default GENERAL. */
550
611
  kind?: LeaseKind;
551
- /** The region; default the project's home region. */
612
+ /**
613
+ * Optional placement override. Unpinned ephemeral leases use eligible capacity;
614
+ * leases mounting volumes retain the home region unless explicitly pinned.
615
+ */
552
616
  region?: string;
553
617
  /**
554
618
  * The Pool to take a warm machine from; default the platform pool for the
@@ -556,9 +620,10 @@ export interface LeaseSpec {
556
620
  */
557
621
  pool?: string;
558
622
  /**
559
- * The maximum wall time from grant: 1 minute to 24 hours for microVMs, 24
560
- * hours to 30 days for macOS. `:renew` extends it within the shape's bound.
561
- * Reaching it ends the lease EXPIRED.
623
+ * The maximum wall time from grant; default 300 seconds, never past the
624
+ * shape's longest lease (1 minute to 24 hours for microVMs, 24 hours to 30
625
+ * days for macOS). `:renew` extends it within the shape's bound. Reaching it
626
+ * ends the lease EXPIRED.
562
627
  */
563
628
  ttl?: string;
564
629
  /**
@@ -890,7 +955,7 @@ export interface PoolSpec {
890
955
  shape?: string;
891
956
  /** The image: an artifact in Sylphx Artifacts, by digest, or `template:<name>`. */
892
957
  image?: string;
893
- /** Warm machine bounds. */
958
+ /** Optional overrides over warm capacity sized automatically from recent lease demand. */
894
959
  warm?: PoolWarm;
895
960
  /** Warm machines older than this are recycled; 5 minutes to 2 hours. */
896
961
  maxAge?: string;
@@ -908,9 +973,9 @@ export interface PoolStatus {
908
973
  }
909
974
  /** PoolWarm bounds a Pool's warm machines. */
910
975
  export interface PoolWarm {
911
- /** Warm machines kept booted. */
976
+ /** Optional floor over automatic demand sizing; defaults to zero. */
912
977
  min?: number;
913
- /** Warm machines at most; at most 10 on free and 100 on Pro. */
978
+ /** Optional ceiling over automatic demand sizing; zero uses the deployment limit. */
914
979
  max?: number;
915
980
  }
916
981
  /** The request of ReadLeaseFile. */
@@ -1519,12 +1584,14 @@ export declare class LeasesCollection {
1519
1584
  mintToken(request: MintLeaseTokenRequest): Promise<MintLeaseTokenResponse>;
1520
1585
  /**
1521
1586
  * Runs one command in the lease to completion and returns its output, capped
1522
- * at 1 MiB per stream. Long-running or interactive processes use the guest
1523
- * protocol at `status.endpoints.guest_uri`.
1587
+ * at 1 MiB per stream. With `idempotency_key` the command is dispatched at
1588
+ * most once per lease and key, and its recorded result is returned again,
1589
+ * also after the lease ended. Long-running or interactive processes use the
1590
+ * guest protocol at `status.endpoints.guest_uri`.
1524
1591
  *
1525
1592
  * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:exec` · permission `sandboxes:exec` · effect `write`
1526
1593
  *
1527
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `STALE_GENERATION`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1594
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `STALE_GENERATION`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `EXEC_OUTCOME_UNKNOWN`.
1528
1595
  */
1529
1596
  exec(request: ExecLeaseRequest): Promise<ExecLeaseResponse>;
1530
1597
  /**
@@ -1698,6 +1765,16 @@ export declare class VolumesCollection {
1698
1765
  * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
1699
1766
  */
1700
1767
  update(request: UpdateVolumeRequest): Promise<Volume>;
1768
+ /**
1769
+ * Archives an idle standard workspace without changing its identity or
1770
+ * destroying its files. Ordinary attachment restores the retained copy.
1771
+ * Validation reports eligibility and copy coverage without changing state.
1772
+ *
1773
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/volumes/*}:archive` · permission `sandboxes:write` · effect `write`
1774
+ *
1775
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`.
1776
+ */
1777
+ archive(request: ArchiveVolumeRequest): Promise<ArchiveVolumeResponse>;
1701
1778
  /**
1702
1779
  * Deletes a volume and destroys its data. Refused RESOURCE_IN_USE while it
1703
1780
  * is attached.
package/dist/sandboxes.js CHANGED
@@ -1,4 +1,4 @@
1
- // @generated by sylphx-gen 0.1.0 from contracts@c8a7361c53e572321b0ec9fb014fd1e8279b007b62562423038e0d0e5b9d767a. Do not edit.
1
+ // @generated by sylphx-gen. Do not edit.
2
2
  // `sylphx.sandboxes.v1`.
3
3
  import * as runtime from './runtime.js';
4
4
  import './common.js';
@@ -26,6 +26,13 @@ runtime.registerSchemas({
26
26
  ['cursor', 'cursor', 'sylphx.sandboxes.v1.Point'],
27
27
  ['image', 'image', 'sylphx.sandboxes.v1.Screenshot'],
28
28
  ],
29
+ 'sylphx.sandboxes.v1.ArchiveVolumeRequest': [
30
+ ['validateOnly', 'validate_only'],
31
+ ],
32
+ 'sylphx.sandboxes.v1.ArchiveVolumeResponse': [
33
+ ['volume', 'volume', 'sylphx.sandboxes.v1.Volume'],
34
+ ['requestedBytes', 'requested_bytes'],
35
+ ],
29
36
  'sylphx.sandboxes.v1.BrowserSpec': [
30
37
  ['userDataDir', 'user_data_dir'],
31
38
  ['startUrl', 'start_url'],
@@ -102,6 +109,7 @@ runtime.registerSchemas({
102
109
  'sylphx.sandboxes.v1.ExecLeaseRequest': [
103
110
  ['workingDirectory', 'working_directory'],
104
111
  ['env', 'env', undefined, 'map'],
112
+ ['idempotencyKey', 'idempotency_key'],
105
113
  ],
106
114
  'sylphx.sandboxes.v1.ExecLeaseResponse': [
107
115
  ['exitCode', 'exit_code'],
@@ -761,12 +769,14 @@ export class LeasesCollection {
761
769
  }
762
770
  /**
763
771
  * Runs one command in the lease to completion and returns its output, capped
764
- * at 1 MiB per stream. Long-running or interactive processes use the guest
765
- * protocol at `status.endpoints.guest_uri`.
772
+ * at 1 MiB per stream. With `idempotency_key` the command is dispatched at
773
+ * most once per lease and key, and its recorded result is returned again,
774
+ * also after the lease ended. Long-running or interactive processes use the
775
+ * guest protocol at `status.endpoints.guest_uri`.
766
776
  *
767
777
  * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:exec` · permission `sandboxes:exec` · effect `write`
768
778
  *
769
- * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `STALE_GENERATION`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
779
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `STALE_GENERATION`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `EXEC_OUTCOME_UNKNOWN`.
770
780
  */
771
781
  async exec(request) {
772
782
  return this.client.call({
@@ -1127,6 +1137,25 @@ export class VolumesCollection {
1127
1137
  mutation: true,
1128
1138
  });
1129
1139
  }
1140
+ /**
1141
+ * Archives an idle standard workspace without changing its identity or
1142
+ * destroying its files. Ordinary attachment restores the retained copy.
1143
+ * Validation reports eligibility and copy coverage without changing state.
1144
+ *
1145
+ * `POST /v1/{name=orgs/*\/projects/*\/envs/*\/volumes/*}:archive` · permission `sandboxes:write` · effect `write`
1146
+ *
1147
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`.
1148
+ */
1149
+ async archive(request) {
1150
+ return this.client.call({
1151
+ method: 'POST',
1152
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/volumes/*', 'name')}:archive`,
1153
+ body: runtime.omit(request, ['name']),
1154
+ bodyType: 'sylphx.sandboxes.v1.ArchiveVolumeRequest',
1155
+ responseType: 'sylphx.sandboxes.v1.ArchiveVolumeResponse',
1156
+ mutation: true,
1157
+ });
1158
+ }
1130
1159
  /**
1131
1160
  * Deletes a volume and destroys its data. Refused RESOURCE_IN_USE while it
1132
1161
  * is attached.