unity-open-mcp 1.4.0 → 1.6.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/dist/capabilities/cost-hints.js +73 -0
- package/dist/capabilities/cost-hints.js.map +1 -1
- package/dist/capabilities/intent-groups.js +76 -4
- package/dist/capabilities/intent-groups.js.map +1 -1
- package/dist/capabilities/lifecycle.js +9 -0
- package/dist/capabilities/lifecycle.js.map +1 -1
- package/dist/capabilities/tool-groups.js +75 -17
- package/dist/capabilities/tool-groups.js.map +1 -1
- package/dist/compressible-router.d.ts +4 -1
- package/dist/compressible-router.js +27 -11
- package/dist/compressible-router.js.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/event-stream.d.ts +10 -0
- package/dist/event-stream.js +29 -0
- package/dist/event-stream.js.map +1 -1
- package/dist/game-view-settle.d.ts +18 -0
- package/dist/game-view-settle.js +81 -0
- package/dist/game-view-settle.js.map +1 -0
- package/dist/jobs/adapters.d.ts +59 -0
- package/dist/jobs/adapters.js +226 -0
- package/dist/jobs/adapters.js.map +1 -1
- package/dist/live-client.d.ts +17 -60
- package/dist/live-client.js +52 -87
- package/dist/live-client.js.map +1 -1
- package/dist/local-tools.js +3 -0
- package/dist/local-tools.js.map +1 -1
- package/dist/offline/api.d.ts +2 -0
- package/dist/offline/api.js +4 -2
- package/dist/offline/api.js.map +1 -1
- package/dist/offline/model.js +1 -1
- package/dist/offline/model.js.map +1 -1
- package/dist/offline/parse.d.ts +1 -1
- package/dist/offline/parse.js +20 -8
- package/dist/offline/parse.js.map +1 -1
- package/dist/playmode-routes.d.ts +17 -0
- package/dist/playmode-routes.js +50 -0
- package/dist/playmode-routes.js.map +1 -0
- package/dist/playtest/png.d.ts +27 -0
- package/dist/playtest/png.js +248 -0
- package/dist/playtest/png.js.map +1 -0
- package/dist/playtest/recorder.d.ts +203 -0
- package/dist/playtest/recorder.js +945 -0
- package/dist/playtest/recorder.js.map +1 -0
- package/dist/playtest/redact.d.ts +16 -0
- package/dist/playtest/redact.js +124 -0
- package/dist/playtest/redact.js.map +1 -0
- package/dist/playtest/report.d.ts +73 -0
- package/dist/playtest/report.js +477 -0
- package/dist/playtest/report.js.map +1 -0
- package/dist/playtest/session-store.d.ts +78 -0
- package/dist/playtest/session-store.js +224 -0
- package/dist/playtest/session-store.js.map +1 -0
- package/dist/skill/SKILL.md +22 -3
- package/dist/skill/references/senses-and-tests.md +3 -0
- package/dist/skill/references/yaml-and-offline-work.md +1 -1
- package/dist/tool-router.d.ts +44 -0
- package/dist/tool-router.js +249 -7
- package/dist/tool-router.js.map +1 -1
- package/dist/tools/batch-execute.js +5 -1
- package/dist/tools/batch-execute.js.map +1 -1
- package/dist/tools/capture-inline.js +30 -12
- package/dist/tools/capture-inline.js.map +1 -1
- package/dist/tools/capture-series.d.ts +46 -0
- package/dist/tools/capture-series.js +116 -0
- package/dist/tools/capture-series.js.map +1 -0
- package/dist/tools/game-view.d.ts +44 -0
- package/dist/tools/game-view.js +103 -0
- package/dist/tools/game-view.js.map +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +34 -7
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inputsim-gesture.d.ts +46 -0
- package/dist/tools/inputsim-gesture.js +123 -0
- package/dist/tools/inputsim-gesture.js.map +1 -0
- package/dist/tools/inputsim-pointer.js +35 -2
- package/dist/tools/inputsim-pointer.js.map +1 -1
- package/dist/tools/inputsim-touch.js +42 -22
- package/dist/tools/inputsim-touch.js.map +1 -1
- package/dist/tools/jobs.js +1 -1
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/player-state.d.ts +42 -0
- package/dist/tools/player-state.js +142 -0
- package/dist/tools/player-state.js.map +1 -0
- package/dist/tools/playtest-conditions.d.ts +334 -0
- package/dist/tools/playtest-conditions.js +99 -0
- package/dist/tools/playtest-conditions.js.map +1 -0
- package/dist/tools/playtest-session.d.ts +45 -0
- package/dist/tools/playtest-session.js +105 -0
- package/dist/tools/playtest-session.js.map +1 -0
- package/dist/tools/playtest-wait.d.ts +46 -0
- package/dist/tools/playtest-wait.js +86 -0
- package/dist/tools/playtest-wait.js.map +1 -0
- package/dist/tools/screenshot.js +31 -8
- package/dist/tools/screenshot.js.map +1 -1
- package/dist/tools/text-target.d.ts +22 -0
- package/dist/tools/text-target.js +39 -0
- package/dist/tools/text-target.js.map +1 -0
- package/dist/tools/ui-snapshot.d.ts +41 -0
- package/dist/tools/ui-snapshot.js +87 -0
- package/dist/tools/ui-snapshot.js.map +1 -0
- package/package.json +1 -1
package/dist/jobs/adapters.js
CHANGED
|
@@ -2,6 +2,9 @@ import { setTimeout as delay } from "node:timers/promises";
|
|
|
2
2
|
import { ProjectJobHttpError } from "../live-client.js";
|
|
3
3
|
import { validateSchema } from "../tool-contract.js";
|
|
4
4
|
import { runTests } from "../tools/run-tests.js";
|
|
5
|
+
import { inputsimGesture } from "../tools/inputsim-gesture.js";
|
|
6
|
+
import { playtestWait, PLAYTEST_WAIT_DEFAULT_TIMEOUT_MS } from "../tools/playtest-wait.js";
|
|
7
|
+
import { captureSeries, CAPTURE_SERIES_DEFAULT_START_TIMEOUT_MS } from "../tools/capture-series.js";
|
|
5
8
|
import { JobManagerError } from "./job-manager.js";
|
|
6
9
|
function invalid(errors) {
|
|
7
10
|
if (errors.length)
|
|
@@ -144,4 +147,227 @@ export function projectCommandOperation(id, cancellable, client, poll = {}) {
|
|
|
144
147
|
},
|
|
145
148
|
};
|
|
146
149
|
}
|
|
150
|
+
// ---------------------------------------------------------------------------
|
|
151
|
+
// Play-mode operations — one generic adapter for every tool whose work runs on
|
|
152
|
+
// the bridge's shared play-mode scheduler (a player-loop tick that owns timing,
|
|
153
|
+
// cancellation and reload / exit-play cleanup). The tool call starts the
|
|
154
|
+
// operation with the job id as its operation_id and returns at once; status and
|
|
155
|
+
// cancel go through POST /playmode-operations. Records are domain-local: a
|
|
156
|
+
// reload drops them (after releasing held input), which surfaces here as
|
|
157
|
+
// `operation_not_found` and orphans the job — never a restart.
|
|
158
|
+
// ---------------------------------------------------------------------------
|
|
159
|
+
/** Tools served by the generic `playmode_operation` jobs adapter. */
|
|
160
|
+
export const PLAYMODE_OPERATION_TOOLS = new Map([
|
|
161
|
+
[inputsimGesture.name, inputsimGesture.inputSchema],
|
|
162
|
+
[playtestWait.name, playtestWait.inputSchema],
|
|
163
|
+
[captureSeries.name, captureSeries.inputSchema],
|
|
164
|
+
]);
|
|
165
|
+
/** Encoding cost assumed per captured frame (PNG encode of a native frame) for duration estimates. */
|
|
166
|
+
export const PLAYMODE_ENCODE_ESTIMATE_MS = 250;
|
|
167
|
+
const numbers = (v) => Array.isArray(v) ? v.map(Number).filter(Number.isFinite) : [];
|
|
168
|
+
/**
|
|
169
|
+
* Worst-case duration (ms) of a play-mode operation from its arguments: the
|
|
170
|
+
* gesture's last keyframe or capture, a wait's timeout, a series' start_on
|
|
171
|
+
* wait plus its schedule (frames at a conservative 30 fps) plus encoding.
|
|
172
|
+
* Decides inline-vs-job and sizes the job deadline.
|
|
173
|
+
*/
|
|
174
|
+
export function playmodeEstimateMs(tool, args) {
|
|
175
|
+
if (tool === inputsimGesture.name) {
|
|
176
|
+
const fingers = Array.isArray(args.fingers) ? args.fingers : [];
|
|
177
|
+
const keyframes = fingers.flatMap(f => Array.isArray(f?.path) ? f.path.map(k => Number(k?.at_ms) || 0) : []);
|
|
178
|
+
const captures = numbers(args.capture_at_ms);
|
|
179
|
+
return Math.max(0, ...keyframes, ...captures) + captures.length * PLAYMODE_ENCODE_ESTIMATE_MS;
|
|
180
|
+
}
|
|
181
|
+
if (tool === playtestWait.name)
|
|
182
|
+
return typeof args.timeout_ms === "number" ? args.timeout_ms : PLAYTEST_WAIT_DEFAULT_TIMEOUT_MS;
|
|
183
|
+
if (tool === captureSeries.name) {
|
|
184
|
+
const atMs = numbers(args.at_ms), atFrames = numbers(args.at_frames);
|
|
185
|
+
const every = Number(args.every_ms), duration = Number(args.duration_ms);
|
|
186
|
+
let last = 0, count = 0;
|
|
187
|
+
if (atMs.length) {
|
|
188
|
+
last = Math.max(...atMs);
|
|
189
|
+
count = atMs.length;
|
|
190
|
+
}
|
|
191
|
+
else if (atFrames.length) {
|
|
192
|
+
last = Math.max(...atFrames) * 1000 / 30;
|
|
193
|
+
count = atFrames.length;
|
|
194
|
+
}
|
|
195
|
+
else if (every > 0 && duration >= 0) {
|
|
196
|
+
last = duration;
|
|
197
|
+
count = Math.floor(duration / every) + 1;
|
|
198
|
+
}
|
|
199
|
+
const trigger = args.start_on === undefined ? 0
|
|
200
|
+
: typeof args.start_timeout_ms === "number" ? args.start_timeout_ms : CAPTURE_SERIES_DEFAULT_START_TIMEOUT_MS;
|
|
201
|
+
return trigger + last + count * PLAYMODE_ENCODE_ESTIMATE_MS;
|
|
202
|
+
}
|
|
203
|
+
return 0;
|
|
204
|
+
}
|
|
205
|
+
/** Stable failure code of a terminal play-mode snapshot (the operation's own code when it set one). */
|
|
206
|
+
export function playmodeFailureCode(snapshot, fallback = "operation_failed") {
|
|
207
|
+
if (snapshot.state === "failed")
|
|
208
|
+
return typeof snapshot.result?.error_code === "string" ? snapshot.result.error_code : fallback;
|
|
209
|
+
return String(snapshot.reason ?? snapshot.state ?? fallback);
|
|
210
|
+
}
|
|
211
|
+
export const PLAYMODE_JOB_DEFAULT_DEADLINE_MS = 10 * 60_000;
|
|
212
|
+
export const PLAYMODE_JOB_DEFAULT_UNREACHABLE_MS = 2 * 60_000;
|
|
213
|
+
const PLAYMODE_TERMINAL = new Set(["succeeded", "failed", "cancelled", "orphaned"]);
|
|
214
|
+
/** Parsed JSON body of a tool result ({} when it is not JSON). */
|
|
215
|
+
export function toolResultBody(result) {
|
|
216
|
+
const text = result.content.find(item => item.type === "text");
|
|
217
|
+
if (text?.type !== "text")
|
|
218
|
+
return {};
|
|
219
|
+
try {
|
|
220
|
+
return JSON.parse(text.text);
|
|
221
|
+
}
|
|
222
|
+
catch {
|
|
223
|
+
return {};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The tool's own output: registry tools answer inside the gate envelope
|
|
228
|
+
* (`mutation.output` / `mutation.error`); other shapes are returned as-is.
|
|
229
|
+
*/
|
|
230
|
+
export function toolOutput(result) {
|
|
231
|
+
const body = toolResultBody(result);
|
|
232
|
+
const mutation = body.mutation;
|
|
233
|
+
if (mutation && typeof mutation === "object") {
|
|
234
|
+
if (mutation.output && typeof mutation.output === "object")
|
|
235
|
+
return mutation.output;
|
|
236
|
+
if (mutation.error)
|
|
237
|
+
return { error: mutation.error };
|
|
238
|
+
}
|
|
239
|
+
return body;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Poll a scheduler operation to a terminal state. An abort of `signal` sends one
|
|
243
|
+
* cancel and keeps polling for its acknowledgement; at the deadline a cancel is
|
|
244
|
+
* sent once (the bridge then releases held input) before giving up. A cancel
|
|
245
|
+
* counts as sent only once the bridge answered it — a failed one is retried
|
|
246
|
+
* with backoff. An operation the deadline cancel ended is a `deadline`
|
|
247
|
+
* outcome, never a caller-initiated `cancelled`.
|
|
248
|
+
*/
|
|
249
|
+
export async function pollPlaymodeOperation(live, operationId, options = {}) {
|
|
250
|
+
const deadlineMs = options.deadlineMs ?? PLAYMODE_JOB_DEFAULT_DEADLINE_MS;
|
|
251
|
+
const pollIntervalMs = options.pollIntervalMs ?? 250;
|
|
252
|
+
const unreachableMs = options.unreachableMs ?? PLAYMODE_JOB_DEFAULT_UNREACHABLE_MS;
|
|
253
|
+
const startedAt = Date.now();
|
|
254
|
+
let lastAnswer = Date.now();
|
|
255
|
+
let failures = 0;
|
|
256
|
+
let cancelSent = false;
|
|
257
|
+
let deadlineCancel = false;
|
|
258
|
+
let last = null;
|
|
259
|
+
while (true) {
|
|
260
|
+
const overdue = Date.now() - startedAt >= deadlineMs;
|
|
261
|
+
const wantCancel = !cancelSent && (overdue || options.signal?.aborted === true);
|
|
262
|
+
if (!wantCancel || failures > 0) {
|
|
263
|
+
try {
|
|
264
|
+
await delay(pollIntervalMs * 2 ** Math.min(failures, 3), undefined, wantCancel || cancelSent || !options.signal ? undefined : { signal: options.signal });
|
|
265
|
+
}
|
|
266
|
+
catch { /* aborted: send the cancel now */ }
|
|
267
|
+
}
|
|
268
|
+
const action = !cancelSent && (overdue || options.signal?.aborted === true) ? "cancel" : "status";
|
|
269
|
+
let answer;
|
|
270
|
+
try {
|
|
271
|
+
answer = await live.playmodeOperation({ action, operation_id: operationId });
|
|
272
|
+
if (action === "cancel") {
|
|
273
|
+
cancelSent = true;
|
|
274
|
+
deadlineCancel = options.signal?.aborted !== true;
|
|
275
|
+
}
|
|
276
|
+
if (failures)
|
|
277
|
+
options.onTransport?.(true, `Bridge answered again for operation ${operationId}.`);
|
|
278
|
+
failures = 0;
|
|
279
|
+
lastAnswer = Date.now();
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
if (error instanceof ProjectJobHttpError && error.status < 500)
|
|
283
|
+
return { kind: "unreachable", error: String(error) };
|
|
284
|
+
if (failures++ === 0)
|
|
285
|
+
options.onTransport?.(false, `Operation poll failed (${String(error).slice(0, 200)}); retrying.`);
|
|
286
|
+
if (Date.now() - lastAnswer >= unreachableMs)
|
|
287
|
+
return { kind: "unreachable", error: `No answer for ${unreachableMs} ms.` };
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
if (answer.error?.code === "operation_not_found")
|
|
291
|
+
return { kind: "lost", detail: answer };
|
|
292
|
+
if (answer.error)
|
|
293
|
+
return { kind: "unreachable", error: `${answer.error.code}: ${answer.error.message}` };
|
|
294
|
+
last = answer;
|
|
295
|
+
options.onSnapshot?.(answer);
|
|
296
|
+
if (deadlineCancel && answer.state === "cancelled" && answer.reason === "cancelled")
|
|
297
|
+
return { kind: "deadline", snapshot: answer, cancelSent };
|
|
298
|
+
if (PLAYMODE_TERMINAL.has(String(answer.state)))
|
|
299
|
+
return { kind: "terminal", snapshot: answer, cancelSent };
|
|
300
|
+
// A cancel sent at the deadline gets a short grace window for its acknowledgement.
|
|
301
|
+
if (overdue && cancelSent && Date.now() - startedAt >= deadlineMs + 5_000)
|
|
302
|
+
return { kind: "deadline", snapshot: last, cancelSent };
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/** Flatten a terminal scheduler snapshot into a job/tool result. */
|
|
306
|
+
export function playmodeResult(snapshot) {
|
|
307
|
+
const { result, ...meta } = snapshot;
|
|
308
|
+
return { operation: meta, ...(result && typeof result === "object" ? result : {}) };
|
|
309
|
+
}
|
|
310
|
+
export function playmodeOperation(tool, schema, client, poll = {}) {
|
|
311
|
+
return {
|
|
312
|
+
mutating: false, cancellable: true,
|
|
313
|
+
validate(args) {
|
|
314
|
+
if (args.operation_id !== undefined)
|
|
315
|
+
throw new JobManagerError("invalid_arguments", "Jobs own operation_id; use idempotency_key to retry.");
|
|
316
|
+
invalid(validateSchema(args, schema));
|
|
317
|
+
},
|
|
318
|
+
async run(args, context) {
|
|
319
|
+
const live = client(context.owner);
|
|
320
|
+
context.report({ phase: "starting" });
|
|
321
|
+
// Start is idempotent per operation id: a retried POST returns the same record.
|
|
322
|
+
const started = toolOutput(await live.route(tool, { ...args, operation_id: context.jobId }));
|
|
323
|
+
const operation = started.operation;
|
|
324
|
+
if (started.error || !operation)
|
|
325
|
+
return { state: "failed", error: { code: started.error?.code ?? "operation_rejected", message: started.error?.message ?? "Bridge did not start the play-mode operation." }, result: started };
|
|
326
|
+
if (operation.operation_id !== context.jobId)
|
|
327
|
+
throw new Error("Bridge did not confirm play-mode operation ownership.");
|
|
328
|
+
context.lifecycle("connected", `Bridge play-mode scheduler owns operation ${context.jobId}`, true);
|
|
329
|
+
let phase;
|
|
330
|
+
// The deadline outlives the operation's own worst case (a 10-minute wait).
|
|
331
|
+
const deadlineMs = poll.deadlineMs ?? Math.max(PLAYMODE_JOB_DEFAULT_DEADLINE_MS, playmodeEstimateMs(tool, args) + 2 * 60_000);
|
|
332
|
+
const outcome = await pollPlaymodeOperation(live, context.jobId, {
|
|
333
|
+
...poll, deadlineMs, signal: context.signal,
|
|
334
|
+
onSnapshot: snapshot => {
|
|
335
|
+
const expected = Number(snapshot.progress?.expectedMs);
|
|
336
|
+
const elapsed = Number(snapshot.progress?.elapsedMs);
|
|
337
|
+
const fraction = expected > 0 && Number.isFinite(elapsed) ? Math.min(1, Math.max(0, elapsed / expected)) : undefined;
|
|
338
|
+
if (snapshot.phase !== phase || fraction !== undefined) {
|
|
339
|
+
phase = String(snapshot.phase);
|
|
340
|
+
context.report({ phase, ...(fraction === undefined ? {} : { fraction }) });
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
onTransport: (connected, detail) => context.lifecycle(connected ? "connected" : "disconnected", detail, true),
|
|
344
|
+
});
|
|
345
|
+
switch (outcome.kind) {
|
|
346
|
+
case "lost":
|
|
347
|
+
context.lifecycle("disconnected", "Bridge lost the play-mode operation (domain reload or Editor restart); its held input was released by that cleanup.", false);
|
|
348
|
+
return { state: "failed", error: { code: "operation_lost", message: "The bridge no longer knows this operation." }, result: outcome.detail };
|
|
349
|
+
case "unreachable":
|
|
350
|
+
context.lifecycle("disconnected", `Play-mode operation status unavailable: ${outcome.error}`, false);
|
|
351
|
+
return { state: "failed", error: { code: "job_status_unavailable", message: outcome.error } };
|
|
352
|
+
case "deadline":
|
|
353
|
+
context.lifecycle("disconnected", "Play-mode operation reported no terminal state before the deadline; cancel sent.", false);
|
|
354
|
+
return { state: "failed", error: { code: "job_deadline_exceeded", message: "No terminal state before the deadline." }, ...(outcome.snapshot ? { result: outcome.snapshot } : {}) };
|
|
355
|
+
}
|
|
356
|
+
const snapshot = outcome.snapshot;
|
|
357
|
+
const result = playmodeResult(snapshot);
|
|
358
|
+
if (snapshot.state === "succeeded")
|
|
359
|
+
return { state: "succeeded", result };
|
|
360
|
+
if (snapshot.state === "cancelled" && context.signal.aborted)
|
|
361
|
+
return { state: "cancelled", result };
|
|
362
|
+
if (snapshot.state === "orphaned") {
|
|
363
|
+
context.lifecycle("disconnected", `Bridge ended the operation without completing it (${snapshot.reason}).`, false);
|
|
364
|
+
return { state: "failed", error: { code: "operation_lost", message: String(snapshot.reason) }, result };
|
|
365
|
+
}
|
|
366
|
+
// cancelled without our request = play mode exited; failed = operation error
|
|
367
|
+
// (a wait that timed out, a game exception: the operation's own error_code).
|
|
368
|
+
return { state: "failed", error: { code: playmodeFailureCode(snapshot),
|
|
369
|
+
message: String(snapshot.result?.error ?? snapshot.reason ?? "Play-mode operation did not complete.") }, result };
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
}
|
|
147
373
|
//# sourceMappingURL=adapters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/jobs/adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAmB,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAoC,MAAM,kBAAkB,CAAC;AAGrF,SAAS,OAAO,CAAC,MAAgB;IAC/B,IAAI,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,eAAe,CAAC,mBAAmB,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACvF,CAAC;AACD,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,OAAO;QACL,oFAAoF;QACpF,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK;QAClC,QAAQ,CAAC,IAAI;YACX,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;YACpD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;gBAAE,MAAM,IAAI,eAAe,CAAC,mBAAm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CAAC,QAAQ,CAAC;YAClC,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;YACxC,IAAI,QAAQ,CAAC,KAAK,KAAK,WAAW;gBAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;YAC1E,IAAI,QAAQ,CAAC,KAAK,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO;gBAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;YACpG,IAAI,QAAQ,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;gBAClC,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,qDAAqD,QAAQ,CAAC,MAAM,IAAI,EAAE,KAAK,CAAC,CAAC;gBACnH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC;YAC1G,CAAC;YACD,6EAA6E;YAC7E,6EAA6E;YAC7E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC;oBACpE,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,IAAI,QAAQ,CAAC,MAAM,IAAI,uCAAuC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QACtH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/live-client.d.ts
CHANGED
|
@@ -3,36 +3,12 @@ import type { Router } from "./router.js";
|
|
|
3
3
|
import { PingCache, type PingSnapshot } from "./ping-cache.js";
|
|
4
4
|
import type { BridgeToolsInventory } from "./bridge-tools-cache.js";
|
|
5
5
|
import { type PollAndDismissOptions } from "./dialog-dismiss.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* the fetch timeout is floored at BRIDGE_DEFAULT_TIMEOUT_MS + slack).
|
|
11
|
-
*
|
|
12
|
-
* undici (Node's fetch) throws a DISTINGUISHABLE error class for the two
|
|
13
|
-
* failure modes that reach this catch:
|
|
14
|
-
* - `TypeError` ("fetch failed") → CONNECTION failure: the socket never
|
|
15
|
-
* connected, was reset before the request body flushed, or the listen port
|
|
16
|
-
* is dead (ECONNREFUSED). No bytes reached the server → no Work was queued
|
|
17
|
-
* → no side effect is possible. Re-POSTing is ALWAYS safe, even on an
|
|
18
|
-
* unchanged endpoint (the same live bridge never received the first POST).
|
|
19
|
-
* - `AbortError` (AbortController timer) → RESPONSE timeout: the request
|
|
20
|
-
* connected and the server is still processing it. A side effect may have
|
|
21
|
-
* happened or be queued. Re-POSTing is only safe when the endpoint CHANGED
|
|
22
|
-
* during recovery (a restart → new bridge that never saw the original POST);
|
|
23
|
-
* on an unchanged endpoint the original call may still complete there, so
|
|
24
|
-
* re-POSTing would risk running the mutation a second time.
|
|
25
|
-
*
|
|
26
|
-
* This distinction matters because a burst of parallel /tools/* calls can leave
|
|
27
|
-
* a dead/reset connection in the pool: the next POST throws a TypeError on
|
|
28
|
-
* connect, and the old "unchanged endpoint → no retry" guard wedged the whole
|
|
29
|
-
* typed-editor surface even though the bridge was healthy and idle
|
|
30
|
-
* (specs/feedback.md entry 2026-07-02-b). The bug was that the guard conflated
|
|
31
|
-
* "endpoint unchanged" with "request in flight," which is only true when the
|
|
32
|
-
* fetch actually connected (AbortError), not when it failed to connect
|
|
33
|
-
* (TypeError).
|
|
6
|
+
export declare const TOOL_OWNED_TIMEOUT_TOOLS: ReadonlySet<string>;
|
|
7
|
+
/** Retry only when the transport proves the POST could not reach a listener.
|
|
8
|
+
* A socket reset, response timeout, or a changed endpoint cannot rule out an
|
|
9
|
+
* already committed mutation. Aggregate connect failures must all be safe.
|
|
34
10
|
*/
|
|
35
|
-
export declare function shouldRetryPostAfterFailure(err: unknown
|
|
11
|
+
export declare function shouldRetryPostAfterFailure(err: unknown): boolean;
|
|
36
12
|
/** `/project-command-jobs` answered without a job snapshot; `status` is its non-OK HTTP status. */
|
|
37
13
|
export declare class ProjectJobHttpError extends Error {
|
|
38
14
|
readonly status: number;
|
|
@@ -175,15 +151,8 @@ export declare class LiveClient implements Router {
|
|
|
175
151
|
* recovers (re-syncing the endpoint, waiting out a reload, or surfacing
|
|
176
152
|
* the structured offline/dead-bridge error) and re-POSTs only when safe.
|
|
177
153
|
*
|
|
178
|
-
* The
|
|
179
|
-
*
|
|
180
|
-
* counts the POST tries so the postTool → handlePostFailure → postTool loop
|
|
181
|
-
* cannot run forever. `shouldRetryPostAfterFailure` returns true for every
|
|
182
|
-
* `TypeError`, so if POSTs keep failing at the socket level while `/ping`
|
|
183
|
-
* answers during recovery, the previous code re-POSTed the mutation each pass
|
|
184
|
-
* with no depth limit. The bound is `this.retry.transientRetryAttempts + 1`
|
|
185
|
-
* (1 initial attempt + N retries), matching the documented RETRY_CONFIG
|
|
186
|
-
* semantics; once exhausted the offline error is surfaced instead of recursing.
|
|
154
|
+
* The attempt counter caps safe connection retries at one initial POST
|
|
155
|
+
* plus this.retry.transientRetryAttempts. Ambiguous failures never replay.
|
|
187
156
|
*/
|
|
188
157
|
private postTool;
|
|
189
158
|
/**
|
|
@@ -206,28 +175,7 @@ export declare class LiveClient implements Router {
|
|
|
206
175
|
* - unparsable body (bridge_response_unparsable corruption error).
|
|
207
176
|
*/
|
|
208
177
|
private shapeToolResult;
|
|
209
|
-
/**
|
|
210
|
-
* Step 3 of {@link postTool}: classify + recover from a transient POST
|
|
211
|
-
* failure (ECONNREFUSED / timeout during a domain reload). Re-syncs the cached
|
|
212
|
-
* endpoint from the lock first (so a Unity restart self-heals), waits out a
|
|
213
|
-
* reload, and re-POSTs ONLY when safe (endpoint changed during recovery, or a
|
|
214
|
-
* genuine connection failure where no bytes reached the server).
|
|
215
|
-
*
|
|
216
|
-
* Re-POST discipline (specs/feedback.md entry 4A — duplicate side-effects):
|
|
217
|
-
* when the endpoint is unchanged the same live bridge is still processing —
|
|
218
|
-
* or has queued — the original POST's Work; re-POSTing would run the mutation
|
|
219
|
-
* a second time. In that case surface the timeout instead of retrying.
|
|
220
|
-
*
|
|
221
|
-
* M10 (round-2 review) — `attempt` is the 1-based POST attempt counter. When
|
|
222
|
-
* it exceeds the configured retry budget (`this.retry.transientRetryAttempts`
|
|
223
|
-
* retries beyond the initial attempt) the offline error is surfaced instead
|
|
224
|
-
* of recursing. Without this bound `shouldRetryPostAfterFailure` returning
|
|
225
|
-
* true for every `TypeError` made the loop unbounded: POSTs failing at the
|
|
226
|
-
* socket level while `/ping` answers during recovery re-POSTed the mutation
|
|
227
|
-
* each pass forever. The recovery probe inside `handleTransientOffline` is
|
|
228
|
-
* itself bounded (`transientRetryAttempts` iterations of `/ping`); this outer
|
|
229
|
-
* bound caps how many times we re-enter that recovery + re-POST cycle.
|
|
230
|
-
*/
|
|
178
|
+
/** Recover connectivity, but replay only proven pre-connection failures. */
|
|
231
179
|
private handlePostFailure;
|
|
232
180
|
private ensureReady;
|
|
233
181
|
/**
|
|
@@ -307,6 +255,15 @@ export declare class LiveClient implements Router {
|
|
|
307
255
|
readResource(route: string): Promise<Record<string, unknown>>;
|
|
308
256
|
/** Private job transport: one bounded request, never an automatic mutation retry. */
|
|
309
257
|
projectCommandJob(args: Record<string, unknown>): Promise<Record<string, any>>;
|
|
258
|
+
/**
|
|
259
|
+
* Status / cancel for an operation owned by the bridge's shared play-mode
|
|
260
|
+
* scheduler (started through its tool, e.g. inputsim_gesture). One bounded
|
|
261
|
+
* request; a non-2xx answer throws so callers can retry or give up.
|
|
262
|
+
*/
|
|
263
|
+
playmodeOperation(args: {
|
|
264
|
+
action: "status" | "cancel";
|
|
265
|
+
operation_id: string;
|
|
266
|
+
}): Promise<Record<string, any>>;
|
|
310
267
|
/** Fresh authenticated bounded catalog read; no disk/session cache can hide a reload. */
|
|
311
268
|
projectCommands(args: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
312
269
|
/**
|
package/dist/live-client.js
CHANGED
|
@@ -73,6 +73,14 @@ const DIRECT_RESPONSE_TOOLS = new Set([
|
|
|
73
73
|
"unity_senses_profiler_rendering",
|
|
74
74
|
"unity_senses_spatial_query",
|
|
75
75
|
]);
|
|
76
|
+
// Tools whose `timeout_ms` is their OWN parameter (a playtest_wait's wall-clock
|
|
77
|
+
// limit, up to 10 minutes), not the request budget: the value is forwarded as
|
|
78
|
+
// sent — never clamped to the host-safe cap — and the HTTP fetch keeps the
|
|
79
|
+
// default budget, because the call itself only starts an operation on the
|
|
80
|
+
// bridge's play-mode scheduler and answers at once.
|
|
81
|
+
export const TOOL_OWNED_TIMEOUT_TOOLS = new Set([
|
|
82
|
+
"unity_open_mcp_playtest_wait",
|
|
83
|
+
]);
|
|
76
84
|
// M4 — compile-reload tools whose PURPOSE is to trigger or observe a domain
|
|
77
85
|
// reload, so a no-op compile is a meaningful signal worth annotating. This is
|
|
78
86
|
// the annotation target set; it is a strict subset of the lifecycle
|
|
@@ -127,44 +135,21 @@ const COMPILE_REPOST_SENTINEL = { __compileRepost: 0 };
|
|
|
127
135
|
function isCompileRepostSentinel(v) {
|
|
128
136
|
return typeof v === "object" && v !== null && "__compileRepost" in v;
|
|
129
137
|
}
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* isolation (driving a real response-timeout through postTool takes 40s because
|
|
134
|
-
* the fetch timeout is floored at BRIDGE_DEFAULT_TIMEOUT_MS + slack).
|
|
135
|
-
*
|
|
136
|
-
* undici (Node's fetch) throws a DISTINGUISHABLE error class for the two
|
|
137
|
-
* failure modes that reach this catch:
|
|
138
|
-
* - `TypeError` ("fetch failed") → CONNECTION failure: the socket never
|
|
139
|
-
* connected, was reset before the request body flushed, or the listen port
|
|
140
|
-
* is dead (ECONNREFUSED). No bytes reached the server → no Work was queued
|
|
141
|
-
* → no side effect is possible. Re-POSTing is ALWAYS safe, even on an
|
|
142
|
-
* unchanged endpoint (the same live bridge never received the first POST).
|
|
143
|
-
* - `AbortError` (AbortController timer) → RESPONSE timeout: the request
|
|
144
|
-
* connected and the server is still processing it. A side effect may have
|
|
145
|
-
* happened or be queued. Re-POSTing is only safe when the endpoint CHANGED
|
|
146
|
-
* during recovery (a restart → new bridge that never saw the original POST);
|
|
147
|
-
* on an unchanged endpoint the original call may still complete there, so
|
|
148
|
-
* re-POSTing would risk running the mutation a second time.
|
|
149
|
-
*
|
|
150
|
-
* This distinction matters because a burst of parallel /tools/* calls can leave
|
|
151
|
-
* a dead/reset connection in the pool: the next POST throws a TypeError on
|
|
152
|
-
* connect, and the old "unchanged endpoint → no retry" guard wedged the whole
|
|
153
|
-
* typed-editor surface even though the bridge was healthy and idle
|
|
154
|
-
* (specs/feedback.md entry 2026-07-02-b). The bug was that the guard conflated
|
|
155
|
-
* "endpoint unchanged" with "request in flight," which is only true when the
|
|
156
|
-
* fetch actually connected (AbortError), not when it failed to connect
|
|
157
|
-
* (TypeError).
|
|
138
|
+
/** Retry only when the transport proves the POST could not reach a listener.
|
|
139
|
+
* A socket reset, response timeout, or a changed endpoint cannot rule out an
|
|
140
|
+
* already committed mutation. Aggregate connect failures must all be safe.
|
|
158
141
|
*/
|
|
159
|
-
export function shouldRetryPostAfterFailure(err
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
export function shouldRetryPostAfterFailure(err) {
|
|
143
|
+
if (!(err instanceof TypeError))
|
|
144
|
+
return false;
|
|
145
|
+
const isConnectFailure = (cause) => {
|
|
146
|
+
if (cause instanceof AggregateError)
|
|
147
|
+
return cause.errors.length > 0 && cause.errors.every(isConnectFailure);
|
|
148
|
+
if (!cause || typeof cause !== "object" || !("code" in cause))
|
|
149
|
+
return false;
|
|
150
|
+
return ["ECONNREFUSED", "ENOTFOUND", "EAI_AGAIN", "UND_ERR_CONNECT_TIMEOUT"].includes(String(cause.code));
|
|
151
|
+
};
|
|
152
|
+
return isConnectFailure(err.cause);
|
|
168
153
|
}
|
|
169
154
|
const OFFLINE_HINT = "Ensure the Unity Editor is open with the Agent Bridge running. " +
|
|
170
155
|
"The bridge port is per-project (20000 + sha256(projectPath) % 10000), not " +
|
|
@@ -781,15 +766,8 @@ export class LiveClient {
|
|
|
781
766
|
* recovers (re-syncing the endpoint, waiting out a reload, or surfacing
|
|
782
767
|
* the structured offline/dead-bridge error) and re-POSTs only when safe.
|
|
783
768
|
*
|
|
784
|
-
* The
|
|
785
|
-
*
|
|
786
|
-
* counts the POST tries so the postTool → handlePostFailure → postTool loop
|
|
787
|
-
* cannot run forever. `shouldRetryPostAfterFailure` returns true for every
|
|
788
|
-
* `TypeError`, so if POSTs keep failing at the socket level while `/ping`
|
|
789
|
-
* answers during recovery, the previous code re-POSTed the mutation each pass
|
|
790
|
-
* with no depth limit. The bound is `this.retry.transientRetryAttempts + 1`
|
|
791
|
-
* (1 initial attempt + N retries), matching the documented RETRY_CONFIG
|
|
792
|
-
* semantics; once exhausted the offline error is surfaced instead of recursing.
|
|
769
|
+
* The attempt counter caps safe connection retries at one initial POST
|
|
770
|
+
* plus this.retry.transientRetryAttempts. Ambiguous failures never replay.
|
|
793
771
|
*/
|
|
794
772
|
async postTool(toolName, args, retryOn503, attempt = 1, commandLifecycle) {
|
|
795
773
|
try {
|
|
@@ -818,7 +796,8 @@ export class LiveClient {
|
|
|
818
796
|
* caller's catch runs {@link handlePostFailure}.
|
|
819
797
|
*/
|
|
820
798
|
async postToolFetch(toolName, args, retryOn503, commandLifecycle) {
|
|
821
|
-
const
|
|
799
|
+
const toolOwnedTimeout = TOOL_OWNED_TIMEOUT_TOOLS.has(toolName);
|
|
800
|
+
const rawTimeout = toolOwnedTimeout ? undefined : args.timeout_ms;
|
|
822
801
|
const explicitTimeout = typeof rawTimeout === "number";
|
|
823
802
|
const requestedTimeoutMs = explicitTimeout ? rawTimeout : 60_000;
|
|
824
803
|
// feedback S2 — clamp below a typical MCP host request timeout (~60s) so the
|
|
@@ -829,8 +808,9 @@ export class LiveClient {
|
|
|
829
808
|
// own processing deadline agrees) and used for the fetch deadline below.
|
|
830
809
|
const timeoutMs = Math.min(Math.max(requestedTimeoutMs, BRIDGE_MIN_TIMEOUT_MS), BRIDGE_HOST_SAFE_TIMEOUT_CAP_MS);
|
|
831
810
|
const wasClamped = requestedTimeoutMs > timeoutMs;
|
|
832
|
-
// Forward the clamped value so the bridge times out at the same boundary
|
|
833
|
-
|
|
811
|
+
// Forward the clamped value so the bridge times out at the same boundary
|
|
812
|
+
// (a tool-owned timeout_ms travels unchanged).
|
|
813
|
+
const forwardedArgs = wasClamped && !toolOwnedTimeout
|
|
834
814
|
? { ...args, timeout_ms: timeoutMs }
|
|
835
815
|
: args;
|
|
836
816
|
// Floor the client fetch timeout at the bridge's own default wait + slack
|
|
@@ -1163,61 +1143,33 @@ export class LiveClient {
|
|
|
1163
1143
|
isError: parsed.error != null,
|
|
1164
1144
|
};
|
|
1165
1145
|
}
|
|
1166
|
-
/**
|
|
1167
|
-
* Step 3 of {@link postTool}: classify + recover from a transient POST
|
|
1168
|
-
* failure (ECONNREFUSED / timeout during a domain reload). Re-syncs the cached
|
|
1169
|
-
* endpoint from the lock first (so a Unity restart self-heals), waits out a
|
|
1170
|
-
* reload, and re-POSTs ONLY when safe (endpoint changed during recovery, or a
|
|
1171
|
-
* genuine connection failure where no bytes reached the server).
|
|
1172
|
-
*
|
|
1173
|
-
* Re-POST discipline (specs/feedback.md entry 4A — duplicate side-effects):
|
|
1174
|
-
* when the endpoint is unchanged the same live bridge is still processing —
|
|
1175
|
-
* or has queued — the original POST's Work; re-POSTing would run the mutation
|
|
1176
|
-
* a second time. In that case surface the timeout instead of retrying.
|
|
1177
|
-
*
|
|
1178
|
-
* M10 (round-2 review) — `attempt` is the 1-based POST attempt counter. When
|
|
1179
|
-
* it exceeds the configured retry budget (`this.retry.transientRetryAttempts`
|
|
1180
|
-
* retries beyond the initial attempt) the offline error is surfaced instead
|
|
1181
|
-
* of recursing. Without this bound `shouldRetryPostAfterFailure` returning
|
|
1182
|
-
* true for every `TypeError` made the loop unbounded: POSTs failing at the
|
|
1183
|
-
* socket level while `/ping` answers during recovery re-POSTed the mutation
|
|
1184
|
-
* each pass forever. The recovery probe inside `handleTransientOffline` is
|
|
1185
|
-
* itself bounded (`transientRetryAttempts` iterations of `/ping`); this outer
|
|
1186
|
-
* bound caps how many times we re-enter that recovery + re-POST cycle.
|
|
1187
|
-
*/
|
|
1146
|
+
/** Recover connectivity, but replay only proven pre-connection failures. */
|
|
1188
1147
|
async handlePostFailure(toolName, args, err, retryOn503, attempt, commandLifecycle) {
|
|
1189
|
-
const endpointBefore = this.baseUrl;
|
|
1190
1148
|
const recovered = await this.handleTransientOffline("post");
|
|
1191
1149
|
if (recovered !== null)
|
|
1192
1150
|
return recovered;
|
|
1193
|
-
const endpointChanged = this.baseUrl !== endpointBefore;
|
|
1194
1151
|
// M10 — bound the postTool → handlePostFailure → postTool recursion. The
|
|
1195
1152
|
// budget is the initial attempt plus the configured transient retry count.
|
|
1196
1153
|
const maxAttempts = 1 + this.retry.transientRetryAttempts;
|
|
1197
1154
|
const attemptsExhausted = attempt >= maxAttempts;
|
|
1198
1155
|
if (toolName !== "unity_open_mcp_project_commands" &&
|
|
1199
1156
|
!attemptsExhausted &&
|
|
1200
|
-
shouldRetryPostAfterFailure(err
|
|
1157
|
+
shouldRetryPostAfterFailure(err)) {
|
|
1201
1158
|
return this.postTool(toolName, args, retryOn503, attempt + 1, commandLifecycle);
|
|
1202
1159
|
}
|
|
1203
1160
|
const exhaustedNote = attemptsExhausted
|
|
1204
1161
|
? ` The POST retry budget (${maxAttempts} attempt${maxAttempts === 1 ? "" : "s"}) was exhausted after ${attempt} attempt${attempt === 1 ? "" : "s"}; the bridge is reachable by /ping but POSTs keep failing.`
|
|
1205
1162
|
: "";
|
|
1163
|
+
const ambiguity = shouldRetryPostAfterFailure(err)
|
|
1164
|
+
? `The connection was refused before the request reached the bridge, so it was not applied.`
|
|
1165
|
+
: `A socket failure, timeout, or endpoint change does not prove the original ` +
|
|
1166
|
+
`operation was not applied; verify its effect before retrying.`;
|
|
1167
|
+
const message = `Tool '${toolName}' did not return a confirmed result. No further POST was sent. ` +
|
|
1168
|
+
`${ambiguity} Endpoint: ${this.baseUrl}.${exhaustedNote}`;
|
|
1206
1169
|
return makeErrorResult({
|
|
1207
1170
|
code: "bridge_offline",
|
|
1208
|
-
message
|
|
1209
|
-
|
|
1210
|
-
`the failure was a response timeout (not a connection failure), so ` +
|
|
1211
|
-
`the request was NOT retried — re-POSTing would risk running the ` +
|
|
1212
|
-
`mutation twice on the same bridge. If the editor was briefly slow ` +
|
|
1213
|
-
`(unfocused, GC, a long main-thread op), the original call may still ` +
|
|
1214
|
-
`complete there; verify the effect before retrying. Endpoint: ${this.baseUrl}.${exhaustedNote}`,
|
|
1215
|
-
detail: {
|
|
1216
|
-
error: {
|
|
1217
|
-
code: "bridge_offline",
|
|
1218
|
-
message: `Client timeout against unchanged endpoint ${this.baseUrl}; not retried to avoid duplicate side-effects.`,
|
|
1219
|
-
},
|
|
1220
|
-
},
|
|
1171
|
+
message,
|
|
1172
|
+
detail: { error: { code: "bridge_offline", message } },
|
|
1221
1173
|
});
|
|
1222
1174
|
}
|
|
1223
1175
|
async ensureReady() {
|
|
@@ -1718,6 +1670,19 @@ export class LiveClient {
|
|
|
1718
1670
|
throw new ProjectJobHttpError(response.status);
|
|
1719
1671
|
return await response.json();
|
|
1720
1672
|
}
|
|
1673
|
+
/**
|
|
1674
|
+
* Status / cancel for an operation owned by the bridge's shared play-mode
|
|
1675
|
+
* scheduler (started through its tool, e.g. inputsim_gesture). One bounded
|
|
1676
|
+
* request; a non-2xx answer throws so callers can retry or give up.
|
|
1677
|
+
*/
|
|
1678
|
+
async playmodeOperation(args) {
|
|
1679
|
+
const response = await this.fetchWithTimeout("/playmode-operations", {
|
|
1680
|
+
method: "POST", body: JSON.stringify(args), headers: { "Content-Type": "application/json" },
|
|
1681
|
+
}, 10_000);
|
|
1682
|
+
if (!response.ok)
|
|
1683
|
+
throw new ProjectJobHttpError(response.status);
|
|
1684
|
+
return await response.json();
|
|
1685
|
+
}
|
|
1721
1686
|
/** Fresh authenticated bounded catalog read; no disk/session cache can hide a reload. */
|
|
1722
1687
|
async projectCommands(args) {
|
|
1723
1688
|
const query = new URLSearchParams({ catalog: "project_commands" });
|