@sylphx/sdk 0.32.1 → 0.32.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -0
- package/dist/access.d.ts +24 -4
- package/dist/access.js +7 -7
- package/dist/access.js.map +1 -1
- package/dist/agents.d.ts +1048 -26
- package/dist/agents.js +771 -5
- package/dist/agents.js.map +1 -1
- package/dist/ai.js +1 -1
- package/dist/ai.js.map +1 -1
- package/dist/analytics.d.ts +232 -0
- package/dist/analytics.js +126 -0
- package/dist/analytics.js.map +1 -0
- package/dist/artifacts.d.ts +47 -1
- package/dist/artifacts.js +30 -2
- package/dist/artifacts.js.map +1 -1
- package/dist/assets.js +1 -1
- package/dist/assets.js.map +1 -1
- package/dist/auth/client.d.ts +34 -3
- package/dist/auth/client.js +42 -5
- package/dist/auth/client.js.map +1 -1
- package/dist/auth/continue-mock.d.ts +21 -0
- package/dist/auth/continue-mock.js +75 -0
- package/dist/auth/continue-mock.js.map +1 -0
- package/dist/auth/end-user-keys-mock.js +1 -1
- package/dist/auth/end-user-keys-mock.js.map +1 -1
- package/dist/auth/end-user-keys.js +1 -1
- package/dist/auth/end-user-keys.js.map +1 -1
- package/dist/auth/verify.js +1 -1
- package/dist/auth/verify.js.map +1 -1
- package/dist/auth.d.ts +169 -0
- package/dist/auth.js +135 -1
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +13 -6
- package/dist/billing.js +3 -1
- package/dist/billing.js.map +1 -1
- package/dist/broker.d.ts +165 -33
- package/dist/broker.js +103 -7
- package/dist/broker.js.map +1 -1
- package/dist/browser-upload.d.ts +101 -0
- package/dist/browser-upload.js +130 -0
- package/dist/browser-upload.js.map +1 -0
- package/dist/build.js +1 -1
- package/dist/build.js.map +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/common.js.map +1 -1
- package/dist/config/flags.d.ts +12 -2
- package/dist/config/flags.js +54 -6
- package/dist/config/flags.js.map +1 -1
- package/dist/config.d.ts +24 -0
- package/dist/config.js +22 -1
- package/dist/config.js.map +1 -1
- package/dist/connections.d.ts +128 -25
- package/dist/connections.js +72 -25
- package/dist/connections.js.map +1 -1
- package/dist/data.d.ts +306 -13
- package/dist/data.js +110 -9
- package/dist/data.js.map +1 -1
- package/dist/entitlement.js +1 -1
- package/dist/entitlement.js.map +1 -1
- package/dist/events/realtime.js +1 -1
- package/dist/events/realtime.js.map +1 -1
- package/dist/events/webhooks.js +1 -1
- package/dist/events/webhooks.js.map +1 -1
- package/dist/events.d.ts +36 -0
- package/dist/events.js +29 -1
- package/dist/events.js.map +1 -1
- package/dist/flags.d.ts +2 -0
- package/dist/flags.js +5 -1
- package/dist/flags.js.map +1 -1
- package/dist/hosting.d.ts +229 -0
- package/dist/hosting.js +168 -1
- package/dist/hosting.js.map +1 -1
- package/dist/ids.d.ts +75 -0
- package/dist/ids.js +16 -1
- package/dist/ids.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/keys.js +1 -1
- package/dist/keys.js.map +1 -1
- package/dist/knowledge.d.ts +32 -9
- package/dist/knowledge.js +21 -11
- package/dist/knowledge.js.map +1 -1
- package/dist/localization.js +1 -1
- package/dist/localization.js.map +1 -1
- package/dist/methods.js +818 -15
- package/dist/methods.js.map +1 -1
- package/dist/money.d.ts +263 -7
- package/dist/money.js +121 -7
- package/dist/money.js.map +1 -1
- package/dist/network.js +1 -1
- package/dist/network.js.map +1 -1
- package/dist/notify.d.ts +579 -0
- package/dist/notify.js +497 -1
- package/dist/notify.js.map +1 -1
- package/dist/observability.d.ts +303 -0
- package/dist/observability.js +221 -1
- package/dist/observability.js.map +1 -1
- package/dist/realtime.js +1 -1
- package/dist/realtime.js.map +1 -1
- package/dist/release.js +1 -1
- package/dist/release.js.map +1 -1
- package/dist/runners.js +1 -1
- package/dist/runners.js.map +1 -1
- package/dist/runtime.d.ts +5 -1
- package/dist/runtime.js +81 -9
- package/dist/runtime.js.map +1 -1
- package/dist/sandboxes/stream-mock.d.ts +124 -0
- package/dist/sandboxes/stream-mock.js +476 -0
- package/dist/sandboxes/stream-mock.js.map +1 -0
- package/dist/sandboxes/stream.d.ts +407 -0
- package/dist/sandboxes/stream.js +335 -0
- package/dist/sandboxes/stream.js.map +1 -0
- package/dist/sandboxes.d.ts +137 -26
- package/dist/sandboxes.js +46 -4
- package/dist/sandboxes.js.map +1 -1
- package/dist/secrets.js +1 -1
- package/dist/secrets.js.map +1 -1
- package/dist/workflows.d.ts +53 -1
- package/dist/workflows.js +39 -3
- package/dist/workflows.js.map +1 -1
- 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
|
+
}
|
|
335
|
+
//# sourceMappingURL=stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/sandboxes/stream.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;GAgBG;AAEH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAC/B,sEAAsE;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG,SA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AAC,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"}
|
package/dist/sandboxes.d.ts
CHANGED
|
@@ -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
|
/**
|
|
@@ -261,10 +295,17 @@ export interface DeleteVolumeRequest {
|
|
|
261
295
|
* version is refused SHAPE_NOT_OFFERED.
|
|
262
296
|
*/
|
|
263
297
|
export interface DeviceSpec {
|
|
264
|
-
/**
|
|
298
|
+
/**
|
|
299
|
+
* A model from the selected kind's catalog: an Android id such as
|
|
300
|
+
* `pixel_7`, or a Simulator device type such as
|
|
301
|
+
* `com.apple.CoreSimulator.SimDeviceType.iPhone-15-Plus`. Unset selects
|
|
302
|
+
* the kind's default model.
|
|
303
|
+
*/
|
|
265
304
|
model?: string;
|
|
266
305
|
/** The OS version, e.g. `14`; default the newest offered. */
|
|
267
306
|
osVersion?: string;
|
|
307
|
+
/** The required Simulator architecture; unset selects the offered architecture. */
|
|
308
|
+
architecture?: string;
|
|
268
309
|
}
|
|
269
310
|
/** DisplayInfo is a lease's effective display. */
|
|
270
311
|
export interface DisplayInfo {
|
|
@@ -311,8 +352,8 @@ export interface ExecLeaseRequest {
|
|
|
311
352
|
/** Bytes written to standard input. */
|
|
312
353
|
stdin?: string;
|
|
313
354
|
/**
|
|
314
|
-
* Kill the process after this long; default 60 seconds, at most
|
|
315
|
-
* minutes
|
|
355
|
+
* Kill the process after this long; default 60 seconds, at most 30
|
|
356
|
+
* minutes, and never past the lease's `expire_time`.
|
|
316
357
|
*/
|
|
317
358
|
timeout?: string;
|
|
318
359
|
/**
|
|
@@ -320,6 +361,17 @@ export interface ExecLeaseRequest {
|
|
|
320
361
|
* belongs to the lessee.
|
|
321
362
|
*/
|
|
322
363
|
user?: string;
|
|
364
|
+
/**
|
|
365
|
+
* Dispatches the command at most once per lease and key, 1-255 printable
|
|
366
|
+
* ASCII characters. The first call claims the key before the command
|
|
367
|
+
* starts; a later call with the same key and request returns the recorded
|
|
368
|
+
* result (also after the lease ended), `IDEMPOTENCY_IN_PROGRESS` while the
|
|
369
|
+
* first still runs (the command continues after the call returns), and
|
|
370
|
+
* `EXEC_OUTCOME_UNKNOWN` when the outcome was lost after dispatch. The same
|
|
371
|
+
* key with another request is `IDEMPOTENCY_KEY_REUSED`. A refusal before
|
|
372
|
+
* the command started releases the key.
|
|
373
|
+
*/
|
|
374
|
+
idempotencyKey?: string;
|
|
323
375
|
}
|
|
324
376
|
/** The response of ExecLease. */
|
|
325
377
|
export interface ExecLeaseResponse {
|
|
@@ -402,15 +454,27 @@ export interface IceServer {
|
|
|
402
454
|
export interface InstallLeaseAppRequest {
|
|
403
455
|
/** The name of the lease. */
|
|
404
456
|
name: string;
|
|
405
|
-
/**
|
|
406
|
-
apkPath
|
|
407
|
-
/** Grant every runtime permission the app declares. */
|
|
457
|
+
/** An Android APK uploaded to the lease. Exactly one app path is required. */
|
|
458
|
+
apkPath?: string;
|
|
459
|
+
/** Grant every Android runtime permission the app declares. */
|
|
408
460
|
grantPermissions?: boolean;
|
|
409
|
-
|
|
410
|
-
|
|
461
|
+
/** A ZIP containing one Simulator .app, uploaded to an IOS lease. */
|
|
462
|
+
appPath?: string;
|
|
463
|
+
/** The exact ZIP SHA256; required for a Simulator install. */
|
|
464
|
+
artifactSha256?: string;
|
|
465
|
+
/** The caller's immutable source revision, returned in the install receipt. */
|
|
466
|
+
sourceRevision?: string;
|
|
467
|
+
}
|
|
468
|
+
/** The receipt of a successful app install or in-place update. */
|
|
411
469
|
export interface InstallLeaseAppResponse {
|
|
412
|
-
/** The
|
|
470
|
+
/** The Android package or iOS bundle identifier. */
|
|
413
471
|
packageName?: string;
|
|
472
|
+
/** The verified uploaded artifact SHA256. */
|
|
473
|
+
artifactSha256?: string;
|
|
474
|
+
/** The source revision supplied with this exact artifact. */
|
|
475
|
+
sourceRevision?: string;
|
|
476
|
+
/** UTC time of the successful install. */
|
|
477
|
+
installTime?: string;
|
|
414
478
|
}
|
|
415
479
|
/**
|
|
416
480
|
* KeyAction presses a key combination, xdotool syntax: `Return`, `ctrl+c`,
|
|
@@ -437,7 +501,10 @@ export interface Lease {
|
|
|
437
501
|
readonly uid?: string;
|
|
438
502
|
/** Resource metadata. */
|
|
439
503
|
meta?: common.ResourceMeta;
|
|
440
|
-
/**
|
|
504
|
+
/**
|
|
505
|
+
* Desired state; omit it, or send it empty, for the zero-config lease: the
|
|
506
|
+
* platform resolves and records the shape and `ttl` (see `LeaseSpec`).
|
|
507
|
+
*/
|
|
441
508
|
spec?: LeaseSpec;
|
|
442
509
|
/** Observed state. */
|
|
443
510
|
readonly status?: LeaseStatus;
|
|
@@ -536,19 +603,35 @@ export interface LeasePort {
|
|
|
536
603
|
/** The port's URL. */
|
|
537
604
|
readonly uri?: string;
|
|
538
605
|
}
|
|
539
|
-
/**
|
|
606
|
+
/**
|
|
607
|
+
* LeaseSpec is the caller-writable state of a Lease. Every field is optional:
|
|
608
|
+
* an empty spec (or no spec at all) is the zero-config lease — a GENERAL lease
|
|
609
|
+
* of the `base` image on the `linux-s` shape for 300 seconds. Set `kind` for a
|
|
610
|
+
* browser, desktop, or Android machine; set `shape`, `ttl`, or `region` only to
|
|
611
|
+
* go beyond those defaults. The platform records the resolved shape and `ttl`
|
|
612
|
+
* on the created lease.
|
|
613
|
+
*/
|
|
540
614
|
export interface LeaseSpec {
|
|
541
|
-
/**
|
|
615
|
+
/**
|
|
616
|
+
* The shape; when unset the platform resolves one from `kind` and the image:
|
|
617
|
+
* `linux-s` for a GENERAL lease, `linux-m` for BROWSER, `linux-l` for DESKTOP
|
|
618
|
+
* or ANDROID, and `build-standard` for the `template:build` image. An
|
|
619
|
+
* explicit shape must serve `kind`.
|
|
620
|
+
*/
|
|
542
621
|
shape?: string;
|
|
543
622
|
/**
|
|
544
623
|
* The image: an artifact in Sylphx Artifacts, by digest, or `template:<name>`
|
|
545
|
-
* (`base`,
|
|
546
|
-
* `
|
|
624
|
+
* (`base`, `desktop`, `browser`, `android`,
|
|
625
|
+
* `build`). Default the template of `kind`. Ignored when `source_snapshot` is
|
|
626
|
+
* set.
|
|
547
627
|
*/
|
|
548
628
|
image?: string;
|
|
549
629
|
/** What the machine serves; default GENERAL. */
|
|
550
630
|
kind?: LeaseKind;
|
|
551
|
-
/**
|
|
631
|
+
/**
|
|
632
|
+
* Optional placement override. Unpinned ephemeral leases use eligible capacity;
|
|
633
|
+
* leases mounting volumes retain the home region unless explicitly pinned.
|
|
634
|
+
*/
|
|
552
635
|
region?: string;
|
|
553
636
|
/**
|
|
554
637
|
* The Pool to take a warm machine from; default the platform pool for the
|
|
@@ -556,9 +639,10 @@ export interface LeaseSpec {
|
|
|
556
639
|
*/
|
|
557
640
|
pool?: string;
|
|
558
641
|
/**
|
|
559
|
-
* The maximum wall time from grant
|
|
560
|
-
*
|
|
561
|
-
*
|
|
642
|
+
* The maximum wall time from grant, bounded by the selected shape.
|
|
643
|
+
* Default 300 seconds (1800 for IOS); at least 60 seconds. The Simulator
|
|
644
|
+
* shape permits at most 3600 seconds. `:renew` stays within the shape's
|
|
645
|
+
* bound. Reaching it ends the lease EXPIRED.
|
|
562
646
|
*/
|
|
563
647
|
ttl?: string;
|
|
564
648
|
/**
|
|
@@ -595,7 +679,7 @@ export interface LeaseSpec {
|
|
|
595
679
|
*/
|
|
596
680
|
webhook?: LeaseWebhook;
|
|
597
681
|
/**
|
|
598
|
-
* The device of an ANDROID lease: model and OS version
|
|
682
|
+
* The device of an ANDROID or IOS lease: model and OS version
|
|
599
683
|
* (device-farm.md §2.1). The device sets the display; `display` is
|
|
600
684
|
* ignored.
|
|
601
685
|
*/
|
|
@@ -890,7 +974,7 @@ export interface PoolSpec {
|
|
|
890
974
|
shape?: string;
|
|
891
975
|
/** The image: an artifact in Sylphx Artifacts, by digest, or `template:<name>`. */
|
|
892
976
|
image?: string;
|
|
893
|
-
/**
|
|
977
|
+
/** Optional overrides over warm capacity sized automatically from recent lease demand. */
|
|
894
978
|
warm?: PoolWarm;
|
|
895
979
|
/** Warm machines older than this are recycled; 5 minutes to 2 hours. */
|
|
896
980
|
maxAge?: string;
|
|
@@ -908,9 +992,9 @@ export interface PoolStatus {
|
|
|
908
992
|
}
|
|
909
993
|
/** PoolWarm bounds a Pool's warm machines. */
|
|
910
994
|
export interface PoolWarm {
|
|
911
|
-
/**
|
|
995
|
+
/** Optional floor over automatic demand sizing; defaults to zero. */
|
|
912
996
|
min?: number;
|
|
913
|
-
/**
|
|
997
|
+
/** Optional ceiling over automatic demand sizing; zero uses the deployment limit. */
|
|
914
998
|
max?: number;
|
|
915
999
|
}
|
|
916
1000
|
/** The request of ReadLeaseFile. */
|
|
@@ -1091,6 +1175,21 @@ export interface Shape {
|
|
|
1091
1175
|
readonly priceMicrosPerSecond?: string;
|
|
1092
1176
|
/** The lease kinds this shape can serve. */
|
|
1093
1177
|
readonly kinds?: LeaseKind[];
|
|
1178
|
+
/** The offered Simulator toolchain; present only on an iOS shape. */
|
|
1179
|
+
readonly simulator?: SimulatorRuntime;
|
|
1180
|
+
}
|
|
1181
|
+
/** A Simulator toolchain offered by an immutable macOS layer. */
|
|
1182
|
+
export interface SimulatorRuntime {
|
|
1183
|
+
/** Simulator runtime identifier, for example com.apple.CoreSimulator.SimRuntime.iOS-26-2. */
|
|
1184
|
+
runtimeId?: string;
|
|
1185
|
+
/** The installed iOS release. */
|
|
1186
|
+
osVersion?: string;
|
|
1187
|
+
/** The architecture an app must include, for example x86_64. */
|
|
1188
|
+
architecture?: string;
|
|
1189
|
+
/** The Xcode version and build that own this runtime. */
|
|
1190
|
+
xcodeVersion?: string;
|
|
1191
|
+
/** Offered CoreSimulator device type identifiers. */
|
|
1192
|
+
deviceModels?: string[];
|
|
1094
1193
|
}
|
|
1095
1194
|
/**
|
|
1096
1195
|
* A Snapshot is a lease's disk and image captured at one moment. A lease
|
|
@@ -1310,7 +1409,7 @@ export type ImageFormat = 'png' | 'jpeg' | 'webp' | (string & {});
|
|
|
1310
1409
|
/** LeaseEventKind is what a LeaseEvent records. */
|
|
1311
1410
|
export type LeaseEventKind = 'granted' | 'ready' | 'refused' | 'ended' | 'renewed' | 'network_changed' | 'control_acquired' | 'control_released' | 'control_expired' | 'budget_warning' | 'paused' | 'resumed' | (string & {});
|
|
1312
1411
|
/** LeaseKind is what a lease's machine serves. */
|
|
1313
|
-
export type LeaseKind = 'general' | 'browser' | 'desktop' | 'android' | (string & {});
|
|
1412
|
+
export type LeaseKind = 'general' | 'browser' | 'desktop' | 'android' | 'ios' | (string & {});
|
|
1314
1413
|
/**
|
|
1315
1414
|
* LeaseRefusal is the typed reason a lease was not granted. There is no global
|
|
1316
1415
|
* queue: a lease is granted now or refused.
|
|
@@ -1519,12 +1618,14 @@ export declare class LeasesCollection {
|
|
|
1519
1618
|
mintToken(request: MintLeaseTokenRequest): Promise<MintLeaseTokenResponse>;
|
|
1520
1619
|
/**
|
|
1521
1620
|
* Runs one command in the lease to completion and returns its output, capped
|
|
1522
|
-
* at 1 MiB per stream.
|
|
1523
|
-
*
|
|
1621
|
+
* at 1 MiB per stream. With `idempotency_key` the command is dispatched at
|
|
1622
|
+
* most once per lease and key, and its recorded result is returned again,
|
|
1623
|
+
* also after the lease ended. Long-running or interactive processes use the
|
|
1624
|
+
* guest protocol at `status.endpoints.guest_uri`.
|
|
1524
1625
|
*
|
|
1525
1626
|
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/leases/*}:exec` · permission `sandboxes:exec` · effect `write`
|
|
1526
1627
|
*
|
|
1527
|
-
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `STALE_GENERATION`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1628
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_STATE`, `STALE_GENERATION`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `EXEC_OUTCOME_UNKNOWN`.
|
|
1528
1629
|
*/
|
|
1529
1630
|
exec(request: ExecLeaseRequest): Promise<ExecLeaseResponse>;
|
|
1530
1631
|
/**
|
|
@@ -1698,6 +1799,16 @@ export declare class VolumesCollection {
|
|
|
1698
1799
|
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
|
|
1699
1800
|
*/
|
|
1700
1801
|
update(request: UpdateVolumeRequest): Promise<Volume>;
|
|
1802
|
+
/**
|
|
1803
|
+
* Archives an idle standard workspace without changing its identity or
|
|
1804
|
+
* destroying its files. Ordinary attachment restores the retained copy.
|
|
1805
|
+
* Validation reports eligibility and copy coverage without changing state.
|
|
1806
|
+
*
|
|
1807
|
+
* `POST /v1/{name=orgs/*\/projects/*\/envs/*\/volumes/*}:archive` · permission `sandboxes:write` · effect `write`
|
|
1808
|
+
*
|
|
1809
|
+
* Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `INVALID_STATE`, `ETAG_MISMATCH`.
|
|
1810
|
+
*/
|
|
1811
|
+
archive(request: ArchiveVolumeRequest): Promise<ArchiveVolumeResponse>;
|
|
1701
1812
|
/**
|
|
1702
1813
|
* Deletes a volume and destroys its data. Refused RESOURCE_IN_USE while it
|
|
1703
1814
|
* is attached.
|