unity-open-mcp 1.0.0 → 1.2.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/dist/batch-spawn.d.ts +26 -0
- package/dist/batch-spawn.js +152 -35
- package/dist/batch-spawn.js.map +1 -1
- package/dist/capabilities/build-capabilities.d.ts +10 -0
- package/dist/capabilities/build-capabilities.js +4 -0
- package/dist/capabilities/build-capabilities.js.map +1 -1
- package/dist/capabilities/capabilities-view.d.ts +48 -0
- package/dist/capabilities/capabilities-view.js +93 -0
- package/dist/capabilities/capabilities-view.js.map +1 -0
- package/dist/child-supervision.d.ts +34 -0
- package/dist/child-supervision.js +110 -0
- package/dist/child-supervision.js.map +1 -0
- package/dist/cli/cli.js +9 -0
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/commands.js +37 -4
- package/dist/cli/commands.js.map +1 -1
- package/dist/compressible-router.js +12 -1
- package/dist/compressible-router.js.map +1 -1
- package/dist/constants.d.ts +17 -7
- package/dist/constants.js +17 -7
- package/dist/constants.js.map +1 -1
- package/dist/dialog-dismiss.d.ts +11 -0
- package/dist/dialog-dismiss.js +59 -4
- package/dist/dialog-dismiss.js.map +1 -1
- package/dist/editor-wedge.d.ts +45 -0
- package/dist/editor-wedge.js +111 -0
- package/dist/editor-wedge.js.map +1 -0
- package/dist/event-stream.d.ts +6 -3
- package/dist/event-stream.js +62 -5
- package/dist/event-stream.js.map +1 -1
- package/dist/gate-error.d.ts +2 -0
- package/dist/gate-error.js +9 -0
- package/dist/gate-error.js.map +1 -1
- package/dist/instance-discovery.d.ts +23 -0
- package/dist/instance-discovery.js +47 -1
- package/dist/instance-discovery.js.map +1 -1
- package/dist/live-client.d.ts +23 -5
- package/dist/live-client.js +132 -31
- package/dist/live-client.js.map +1 -1
- package/dist/process-diagnostics.d.ts +51 -23
- package/dist/process-diagnostics.js +67 -22
- package/dist/process-diagnostics.js.map +1 -1
- package/dist/results.d.ts +8 -0
- package/dist/results.js +4 -1
- package/dist/results.js.map +1 -1
- package/dist/routers.js +4 -1
- package/dist/routers.js.map +1 -1
- package/dist/server.js +8 -2
- package/dist/server.js.map +1 -1
- package/dist/tool-hint.d.ts +36 -0
- package/dist/tool-hint.js +98 -0
- package/dist/tool-hint.js.map +1 -0
- package/dist/tool-router.d.ts +8 -1
- package/dist/tool-router.js +346 -64
- package/dist/tool-router.js.map +1 -1
- package/dist/tools/agent-capabilities.js +27 -1
- package/dist/tools/agent-capabilities.js.map +1 -1
- package/dist/tools/baseline-create.js +1 -1
- package/dist/tools/baseline-create.js.map +1 -1
- package/dist/tools/batch-execute.js +12 -1
- package/dist/tools/batch-execute.js.map +1 -1
- package/dist/tools/bridge-status.js +21 -1
- package/dist/tools/bridge-status.js.map +1 -1
- package/dist/tools/execute-csharp.js +11 -1
- package/dist/tools/execute-csharp.js.map +1 -1
- package/dist/tools/execute-menu.js +33 -2
- package/dist/tools/execute-menu.js.map +1 -1
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/invoke-method.js +15 -1
- package/dist/tools/invoke-method.js.map +1 -1
- package/dist/tools/read-compile-errors.js +30 -9
- package/dist/tools/read-compile-errors.js.map +1 -1
- package/dist/tools/regression-check.js +2 -1
- package/dist/tools/regression-check.js.map +1 -1
- package/dist/tools/resource-pressure.js +27 -17
- package/dist/tools/resource-pressure.js.map +1 -1
- package/dist/tools/run-tests.js +11 -2
- package/dist/tools/run-tests.js.map +1 -1
- package/dist/tools/scan-all.js +2 -2
- package/dist/tools/scan-all.js.map +1 -1
- package/dist/unity-log.d.ts +16 -0
- package/dist/unity-log.js +60 -9
- package/dist/unity-log.js.map +1 -1
- package/package.json +1 -1
|
@@ -46,12 +46,23 @@ export interface FdCountOk {
|
|
|
46
46
|
count: number;
|
|
47
47
|
method: FdCountMethod;
|
|
48
48
|
/**
|
|
49
|
-
* `true` when the
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
49
|
+
* `true` when the number should not be read as an exact fd count. TWO
|
|
50
|
+
* different situations set it, and they need different handling — use
|
|
51
|
+
* `method` / `partial` to tell them apart:
|
|
52
|
+
*
|
|
53
|
+
* - `method: "handle_count"` — a Windows HandleCount, which counts more
|
|
54
|
+
* than fds (kernel + GDI + user objects) and is naturally higher. The
|
|
55
|
+
* headroom math is deliberately looser there.
|
|
56
|
+
* - `partial: true` — a timed-out `lsof` whose captured rows are a
|
|
57
|
+
* LOWER BOUND on the real fd count. Still real fds, so the normal
|
|
58
|
+
* thresholds apply; the true pressure is only ever higher.
|
|
53
59
|
*/
|
|
54
60
|
approximate: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* `true` only for the timed-out-`lsof` lower bound above. Absent/false
|
|
63
|
+
* means the count is complete (or is a HandleCount).
|
|
64
|
+
*/
|
|
65
|
+
partial?: boolean;
|
|
55
66
|
}
|
|
56
67
|
/** Failed fd-count probe. The count is unknown — callers must NOT treat
|
|
57
68
|
* this as "low pressure" (it is "unknown pressure"). */
|
|
@@ -71,16 +82,18 @@ export type FdCountResult = FdCountOk | FdCountFailed;
|
|
|
71
82
|
/**
|
|
72
83
|
* Coarse pressure state derived from `computeFdHeadroom`.
|
|
73
84
|
*
|
|
74
|
-
* `over_ceiling`
|
|
75
|
-
* `lsof` / `/proc`
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
85
|
+
* `over_ceiling` (count >= ceiling) is an ALARM when the count is a real fd
|
|
86
|
+
* count (`lsof` / `/proc`): POSIX allocates the lowest free descriptor
|
|
87
|
+
* number, so with the count at or past the ceiling every NEW descriptor gets
|
|
88
|
+
* a number above it — and the next Mono IOSelector registration (any async
|
|
89
|
+
* pipe/socket, e.g. the Bee build driver's IPC) fails with "Could not
|
|
90
|
+
* register to wait for file descriptor N". A fresh healthy Unity 6 editor
|
|
91
|
+
* sits at ~160 open fds; real counts near 1024 are never legitimate.
|
|
92
|
+
* (`countLsofFdRows` already excludes the cwd/txt/mmap rows that once
|
|
93
|
+
* justified treating this state as informational.) The one soft case is a
|
|
94
|
+
* Windows `HandleCount` probe: handle counts cover kernel/GDI/user objects
|
|
95
|
+
* and routinely exceed 1024 on a healthy process, so the router downgrades
|
|
96
|
+
* over-ceiling to a `pressureNote` there and alarms on the trend instead.
|
|
84
97
|
*/
|
|
85
98
|
export type FdPressureState = "ok" | "warn" | "critical" | "over_ceiling" | "unknown";
|
|
86
99
|
/** Headroom metric against the Mono fd ceiling. */
|
|
@@ -92,7 +105,15 @@ export interface FdHeadroom {
|
|
|
92
105
|
/** The resolved ceiling (Mono ~1024 default, configurable per project). */
|
|
93
106
|
ceiling: number;
|
|
94
107
|
state: FdPressureState;
|
|
95
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* `false` when the underlying metric counts MORE than Unix fds — i.e. the
|
|
110
|
+
* Windows `HandleCount` probe. This is about the metric, not about the
|
|
111
|
+
* count's precision: a timed-out `lsof` yields an imprecise count (a lower
|
|
112
|
+
* bound, flagged `approximate` / `partial` on the probe result) but still a
|
|
113
|
+
* count of real fds, so it stays `reliable: true` and gets the real
|
|
114
|
+
* warn/critical thresholds. Treating a truncated macOS listing as
|
|
115
|
+
* Windows-like was how a partial 900/1024 reported `ok`.
|
|
116
|
+
*/
|
|
96
117
|
reliable: boolean;
|
|
97
118
|
}
|
|
98
119
|
/**
|
|
@@ -106,9 +127,10 @@ export interface FdProbe {
|
|
|
106
127
|
/**
|
|
107
128
|
* Parse the stdout of a successful `lsof -p <pid>` run into an fd count.
|
|
108
129
|
* Pure (no I/O) so it can be unit-tested without spawning lsof. lsof prints
|
|
109
|
-
* a header line ("COMMAND PID USER FD TYPE ...") then one
|
|
110
|
-
*
|
|
111
|
-
* the PID vanished between
|
|
130
|
+
* a header line ("COMMAND PID USER FD TYPE ...") then one row per open file;
|
|
131
|
+
* only rows whose FD column is a numbered descriptor count (see
|
|
132
|
+
* {@link countLsofFdRows}). Empty stdout means the PID vanished between
|
|
133
|
+
* spawn and read.
|
|
112
134
|
*/
|
|
113
135
|
export declare function parseLsofStdout(stdout: string, pid: number): FdCountResult;
|
|
114
136
|
/**
|
|
@@ -161,16 +183,22 @@ export declare function countFileDescriptors(pid: number): FdCountResult;
|
|
|
161
183
|
* agent must NOT treat "unknown" as "ok"; it should surface the trend (if any
|
|
162
184
|
* prior samples exist) and tell the operator the live count could not be read.
|
|
163
185
|
*
|
|
164
|
-
* `over_ceiling` (count >= ceiling)
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
186
|
+
* `over_ceiling` (count >= ceiling) means new descriptor numbers now land
|
|
187
|
+
* above the Mono IOSelector ceiling — see {@link FdPressureState} for why the
|
|
188
|
+
* router treats a real-fd over-ceiling count as critical and only downgrades
|
|
189
|
+
* the Windows HandleCount metric to a note.
|
|
168
190
|
*
|
|
191
|
+
* @param broaderThanFds `true` ONLY when the metric counts more than Unix fds
|
|
192
|
+
* — the Windows `HandleCount` probe. Pass `probe.method === "handle_count"`,
|
|
193
|
+
* NOT `probe.approximate`: a timed-out `lsof` is also flagged approximate,
|
|
194
|
+
* but its count is a LOWER BOUND on real fds, so softening the thresholds
|
|
195
|
+
* for it under-reports pressure (a partial 900/1024 read `ok` instead of
|
|
196
|
+
* `warn`) on exactly the platform this tool targets.
|
|
169
197
|
* @param ceiling the resolved fd ceiling (default {@link FD_CEILING_DEFAULT});
|
|
170
198
|
* passed in by the router from `readFdCeiling` so the math scales with a
|
|
171
199
|
* project-configured override.
|
|
172
200
|
*/
|
|
173
|
-
export declare function computeFdHeadroom(count: number | null,
|
|
201
|
+
export declare function computeFdHeadroom(count: number | null, broaderThanFds?: boolean, ceiling?: number): FdHeadroom;
|
|
174
202
|
/** One fd sample recorded in the session-scoped ring. */
|
|
175
203
|
export interface FdSample {
|
|
176
204
|
/** Wall-clock timestamp (ms since epoch). */
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
//
|
|
23
23
|
// Cross-platform probe:
|
|
24
24
|
// - macOS: `lsof -p <pid>` (no /proc on macOS). Bounded execFileSync
|
|
25
|
-
// timeout;
|
|
25
|
+
// timeout; only rows whose FD column is a numbered descriptor are counted
|
|
26
|
+
// (`countLsofFdRows` — cwd/txt/mmap rows are not fds). Heavy — callers
|
|
27
|
+
// cache briefly.
|
|
26
28
|
// - Linux: `readdirSync(/proc/<pid>/fd).length` (no shell-out).
|
|
27
29
|
// - Windows: `Get-Process -Id <pid>.HandleCount` (approximate — Windows
|
|
28
30
|
// handle count is broader than Unix fds; the threshold differs and the
|
|
@@ -72,12 +74,44 @@ export const FD_PROBE_TIMEOUT_MS = 3_000;
|
|
|
72
74
|
// ---------------------------------------------------------------------------
|
|
73
75
|
// Platform-specific probe implementations.
|
|
74
76
|
// ---------------------------------------------------------------------------
|
|
77
|
+
/**
|
|
78
|
+
* Count the actual file-descriptor rows in an `lsof -p` listing. Not every
|
|
79
|
+
* output row is an fd: `cwd` (working directory), `txt` (mapped executable and
|
|
80
|
+
* shared libraries — often dozens of rows on a loaded Editor), `rtd`, `del`,
|
|
81
|
+
* `ltz`/`ltx` rows describe directories and mmaps that Mono's IOSelector never
|
|
82
|
+
* registers. Counting every row systematically inflated the absolute fd count
|
|
83
|
+
* against the ~1024 Mono ceiling (an asset-heavy Editor maps hundreds of
|
|
84
|
+
* `txt` rows alone), skewing the warn/critical ratio states. The FD column
|
|
85
|
+
* index is located from the header; a row counts when its FD value starts with
|
|
86
|
+
* a digit (real fds are "0u"/"1w"/"255r"-style — number plus optional
|
|
87
|
+
* mode/lock letters). When no recognizable header exists (unusual), fall back
|
|
88
|
+
* to counting all rows so the probe never under-reports to zero.
|
|
89
|
+
*/
|
|
90
|
+
function countLsofFdRows(lines) {
|
|
91
|
+
if (lines.length === 0)
|
|
92
|
+
return 0;
|
|
93
|
+
const header = lines[0].trim().split(/\s+/);
|
|
94
|
+
const fdCol = header.indexOf("FD");
|
|
95
|
+
let count = 0;
|
|
96
|
+
for (let i = 1; i < lines.length; i++) {
|
|
97
|
+
if (fdCol >= 0) {
|
|
98
|
+
const fd = lines[i].trim().split(/\s+/)[fdCol];
|
|
99
|
+
if (fd !== undefined && /^\d/.test(fd))
|
|
100
|
+
count++;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
count++;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return count;
|
|
107
|
+
}
|
|
75
108
|
/**
|
|
76
109
|
* Parse the stdout of a successful `lsof -p <pid>` run into an fd count.
|
|
77
110
|
* Pure (no I/O) so it can be unit-tested without spawning lsof. lsof prints
|
|
78
|
-
* a header line ("COMMAND PID USER FD TYPE ...") then one
|
|
79
|
-
*
|
|
80
|
-
* the PID vanished between
|
|
111
|
+
* a header line ("COMMAND PID USER FD TYPE ...") then one row per open file;
|
|
112
|
+
* only rows whose FD column is a numbered descriptor count (see
|
|
113
|
+
* {@link countLsofFdRows}). Empty stdout means the PID vanished between
|
|
114
|
+
* spawn and read.
|
|
81
115
|
*/
|
|
82
116
|
export function parseLsofStdout(stdout, pid) {
|
|
83
117
|
const lines = stdout.split(/\r?\n/).filter((l) => l.length > 0);
|
|
@@ -89,10 +123,8 @@ export function parseLsofStdout(stdout, pid) {
|
|
|
89
123
|
message: `lsof produced no output for PID ${pid}.`,
|
|
90
124
|
};
|
|
91
125
|
}
|
|
92
|
-
// Header is the first line; its FD column says "FD" literally. The rest are
|
|
93
|
-
// per-fd rows. Subtract 1 for the header.
|
|
94
126
|
return {
|
|
95
|
-
count:
|
|
127
|
+
count: countLsofFdRows(lines),
|
|
96
128
|
method: "lsof",
|
|
97
129
|
approximate: false,
|
|
98
130
|
};
|
|
@@ -133,9 +165,10 @@ export function classifyLsofError(err, pid) {
|
|
|
133
165
|
const capturedLines = capturedStdout.split(/\r?\n/).filter((l) => l.length > 0);
|
|
134
166
|
if (capturedLines.length > 0) {
|
|
135
167
|
return {
|
|
136
|
-
count:
|
|
168
|
+
count: countLsofFdRows(capturedLines),
|
|
137
169
|
method: "lsof",
|
|
138
170
|
approximate: timedOut,
|
|
171
|
+
partial: timedOut,
|
|
139
172
|
};
|
|
140
173
|
}
|
|
141
174
|
if (timedOut) {
|
|
@@ -161,11 +194,15 @@ export function classifyLsofError(err, pid) {
|
|
|
161
194
|
message: `lsof failed for PID ${pid}: ${message}`,
|
|
162
195
|
};
|
|
163
196
|
}
|
|
164
|
-
/** macOS `lsof -p <pid>` scanner. Returns the line count (one line per
|
|
197
|
+
/** macOS `lsof -n -P -p <pid>` scanner. Returns the line count (one line per
|
|
198
|
+
* fd). `-n`/`-P` skip reverse-DNS and port-name resolution — the slowest part
|
|
199
|
+
* of an lsof walk and the main way a healthy editor with a slow resolver
|
|
200
|
+
* blows FD_PROBE_TIMEOUT_MS and degrades to a partial (lower-bound) count.
|
|
201
|
+
* The FD column, the only thing this parser reads, is unaffected. */
|
|
165
202
|
function probeMacos(pid) {
|
|
166
203
|
let stdout;
|
|
167
204
|
try {
|
|
168
|
-
stdout = execFileSync("lsof", ["-p", String(pid)], {
|
|
205
|
+
stdout = execFileSync("lsof", ["-n", "-P", "-p", String(pid)], {
|
|
169
206
|
encoding: "utf8",
|
|
170
207
|
timeout: FD_PROBE_TIMEOUT_MS,
|
|
171
208
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -319,16 +356,22 @@ export function countFileDescriptors(pid) {
|
|
|
319
356
|
* agent must NOT treat "unknown" as "ok"; it should surface the trend (if any
|
|
320
357
|
* prior samples exist) and tell the operator the live count could not be read.
|
|
321
358
|
*
|
|
322
|
-
* `over_ceiling` (count >= ceiling)
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
359
|
+
* `over_ceiling` (count >= ceiling) means new descriptor numbers now land
|
|
360
|
+
* above the Mono IOSelector ceiling — see {@link FdPressureState} for why the
|
|
361
|
+
* router treats a real-fd over-ceiling count as critical and only downgrades
|
|
362
|
+
* the Windows HandleCount metric to a note.
|
|
326
363
|
*
|
|
364
|
+
* @param broaderThanFds `true` ONLY when the metric counts more than Unix fds
|
|
365
|
+
* — the Windows `HandleCount` probe. Pass `probe.method === "handle_count"`,
|
|
366
|
+
* NOT `probe.approximate`: a timed-out `lsof` is also flagged approximate,
|
|
367
|
+
* but its count is a LOWER BOUND on real fds, so softening the thresholds
|
|
368
|
+
* for it under-reports pressure (a partial 900/1024 read `ok` instead of
|
|
369
|
+
* `warn`) on exactly the platform this tool targets.
|
|
327
370
|
* @param ceiling the resolved fd ceiling (default {@link FD_CEILING_DEFAULT});
|
|
328
371
|
* passed in by the router from `readFdCeiling` so the math scales with a
|
|
329
372
|
* project-configured override.
|
|
330
373
|
*/
|
|
331
|
-
export function computeFdHeadroom(count,
|
|
374
|
+
export function computeFdHeadroom(count, broaderThanFds = false, ceiling = FD_CEILING_DEFAULT) {
|
|
332
375
|
if (count === null || !Number.isFinite(count)) {
|
|
333
376
|
return {
|
|
334
377
|
pressureRatio: 0,
|
|
@@ -343,15 +386,17 @@ export function computeFdHeadroom(count, approximate = false, ceiling = FD_CEILI
|
|
|
343
386
|
const headroom = Math.max(0, ceiling - clamped);
|
|
344
387
|
let state;
|
|
345
388
|
if (clamped >= ceiling) {
|
|
346
|
-
//
|
|
347
|
-
//
|
|
348
|
-
//
|
|
349
|
-
//
|
|
389
|
+
// fd count at/past the Mono ceiling: every newly allocated descriptor
|
|
390
|
+
// number now lands above it, so the next IOSelector registration can
|
|
391
|
+
// trip the hang. The router alarms on this for real fd counts and
|
|
392
|
+
// downgrades only the Windows HandleCount approximation to a note.
|
|
350
393
|
state = "over_ceiling";
|
|
351
394
|
}
|
|
352
|
-
else if (
|
|
395
|
+
else if (broaderThanFds) {
|
|
353
396
|
// Windows HandleCount is naturally higher than Unix fds — only flag
|
|
354
|
-
// critical, never warn, so an agent does not over-react.
|
|
397
|
+
// critical, never warn, so an agent does not over-react. Deliberately
|
|
398
|
+
// NOT reached by a partial (timed-out) lsof: that is a lower bound on
|
|
399
|
+
// REAL fds and takes the normal thresholds below.
|
|
355
400
|
state = pressureRatio >= FD_CRITICAL_RATIO ? "critical" : "ok";
|
|
356
401
|
}
|
|
357
402
|
else if (pressureRatio >= FD_CRITICAL_RATIO) {
|
|
@@ -368,7 +413,7 @@ export function computeFdHeadroom(count, approximate = false, ceiling = FD_CEILI
|
|
|
368
413
|
headroom,
|
|
369
414
|
ceiling,
|
|
370
415
|
state,
|
|
371
|
-
reliable: !
|
|
416
|
+
reliable: !broaderThanFds,
|
|
372
417
|
};
|
|
373
418
|
}
|
|
374
419
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-diagnostics.js","sourceRoot":"","sources":["../src/process-diagnostics.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAe;AACf,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,8EAA8E;AAC9E,yEAAyE;AACzE,sBAAsB;AACtB,EAAE;AACF,4EAA4E;AAC5E,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,sEAAsE;AACtE,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,iEAAiE;AACjE,EAAE;AACF,wBAAwB;AACxB,uEAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"process-diagnostics.js","sourceRoot":"","sources":["../src/process-diagnostics.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAe;AACf,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,8EAA8E;AAC9E,yEAAyE;AACzE,sBAAsB;AACtB,EAAE;AACF,4EAA4E;AAC5E,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,sEAAsE;AACtE,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,iEAAiE;AACjE,EAAE;AACF,wBAAwB;AACxB,uEAAuE;AACvE,8EAA8E;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AC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YAC1C,SAAS,GAAG,KAAK,CAAC;YAClB,MAAM;QACR,CAAC;IACH,CAAC;IACD,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,GAAG,EAAE,iBAAiB,CAAC,CAAC;IACjE,IAAI,SAAS,IAAI,KAAK,IAAI,aAAa,EAAE,CAAC;QACxC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IACjE,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;IAChE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AAChE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,2EAA2E;IAC3E,+EAA+E;IAC/E,+EAA+E;IAC/E,4EAA4E;IAC5E,6EAA6E;IAC7E,kEAAkE;IAClE,2EAA2E;IAC3E,4EAA4E;IAC5E,wEAAwE,CAAC"}
|
package/dist/results.d.ts
CHANGED
|
@@ -10,5 +10,13 @@ export interface ErrorResultInput {
|
|
|
10
10
|
* surface richer structured data (e.g. HTTP status + body from the bridge).
|
|
11
11
|
*/
|
|
12
12
|
detail?: unknown;
|
|
13
|
+
/**
|
|
14
|
+
* Optional `_source` stamp on the DEFAULT body (ignored when `detail` is
|
|
15
|
+
* supplied — a custom body stamps its own). "local" for caller-side
|
|
16
|
+
* validation failures, "offline" when an offline-first attempt failed
|
|
17
|
+
* without bridge contact. Keeps the router's derived `_route` honest for
|
|
18
|
+
* error results too, instead of defaulting everything to route:"live".
|
|
19
|
+
*/
|
|
20
|
+
source?: "live" | "offline" | "local";
|
|
13
21
|
}
|
|
14
22
|
export declare function makeErrorResult(input: ErrorResultInput): CallToolResult;
|
package/dist/results.js
CHANGED
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
// is supplied, it replaces the error envelope entirely (callers that build a
|
|
14
14
|
// richer custom body rely on this).
|
|
15
15
|
export function makeErrorResult(input) {
|
|
16
|
-
const body = input.detail ?? {
|
|
16
|
+
const body = input.detail ?? {
|
|
17
|
+
error: { code: input.code, message: input.message },
|
|
18
|
+
...(input.source ? { _source: input.source } : {}),
|
|
19
|
+
};
|
|
17
20
|
return {
|
|
18
21
|
content: [{ type: "text", text: JSON.stringify(body) }],
|
|
19
22
|
isError: true,
|
package/dist/results.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.js","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,gFAAgF;AAChF,0EAA0E;AAC1E,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,oCAAoC;
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,2EAA2E;AAC3E,gFAAgF;AAChF,0EAA0E;AAC1E,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,oCAAoC;AAyBpC,MAAM,UAAU,eAAe,CAAC,KAAuB;IACrD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,IAAI;QAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;QACnD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnD,CAAC;IACF,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/dist/routers.js
CHANGED
|
@@ -49,7 +49,10 @@ export function buildRouterStack(env) {
|
|
|
49
49
|
const pingCache = new PingCache();
|
|
50
50
|
const live = new LiveClient(env.port, pingCache, env.authToken, env.projectPath, undefined, env.envPort);
|
|
51
51
|
const batch = new BatchSpawn({ projectPath: env.projectPath });
|
|
52
|
-
|
|
52
|
+
// projectPath/envPort let the reader's reconnects re-read the instance lock
|
|
53
|
+
// (the bridge rotates its bearer token on every domain reload), mirroring
|
|
54
|
+
// LiveClient's refreshEndpointFromLock self-heal.
|
|
55
|
+
const eventStream = new BridgeEventStream(bridgeBaseUrl(env.port), undefined, env.authToken, env.projectPath, env.envPort);
|
|
53
56
|
const sessionState = new ToolSessionState();
|
|
54
57
|
const router = new ToolRouter(live, batch, env.projectPath, eventStream, sessionState);
|
|
55
58
|
const resourceRouter = new ResourceRouter({
|
package/dist/routers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routers.js","sourceRoot":"","sources":["../src/routers.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yBAAyB;AAEzB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAA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IAC1E,kDAAkD;IAClD,MAAM,WAAW,GAAG,IAAI,iBAAiB,CACvC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EACvB,SAAS,EACT,GAAG,CAAC,SAAS,EACb,GAAG,CAAC,WAAW,EACf,GAAG,CAAC,OAAO,CACZ,CAAC;IACF,MAAM,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IACvF,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC;QACxC,IAAI;QACJ,SAAS;QACT,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,IAAI,EAAE,GAAG,CAAC,IAAI;KACf,CAAC,CAAC;IACH,OAAO;QACL,IAAI;QACJ,KAAK;QACL,MAAM;QACN,SAAS;QACT,cAAc;QACd,WAAW;QACX,YAAY;QACZ,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,SAAS,EAAE,GAAG,CAAC,SAAS;KACzB,CAAC;AACJ,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -17,6 +17,7 @@ import { ALL_TOOLS } from "./tools/index.js";
|
|
|
17
17
|
import { ALL_RESOURCES } from "./resources/index.js";
|
|
18
18
|
import { LiveClient } from "./live-client.js";
|
|
19
19
|
import { BatchSpawn } from "./batch-spawn.js";
|
|
20
|
+
import { installBatchChildSupervision } from "./child-supervision.js";
|
|
20
21
|
import { ToolRouter } from "./tool-router.js";
|
|
21
22
|
import { PingCache } from "./ping-cache.js";
|
|
22
23
|
import { ResourceRouter } from "./resource-router.js";
|
|
@@ -91,11 +92,16 @@ export function createServer(projectPath, port, authToken, envPort) {
|
|
|
91
92
|
const pingCache = new PingCache();
|
|
92
93
|
const liveClient = new LiveClient(port, pingCache, authToken, projectPath, undefined, envPort);
|
|
93
94
|
const batchSpawn = new BatchSpawn({ projectPath });
|
|
95
|
+
// Batch children (headless Unity) hold the project lock; supervise them so
|
|
96
|
+
// a host restart / SIGINT / SIGTERM cannot orphan a run.
|
|
97
|
+
installBatchChildSupervision();
|
|
94
98
|
// M13 T4.4 — one SSE subscription per server process. The MCP server is the
|
|
95
99
|
// only long-lived hop between the bridge and the LLM; a per-process reader
|
|
96
100
|
// amortizes the connection and lets every `unity_senses_pull_events` call
|
|
97
|
-
// share the same buffered queue.
|
|
98
|
-
|
|
101
|
+
// share the same buffered queue. projectPath/envPort feed the reconnect-time
|
|
102
|
+
// instance-lock refresh (the bridge rotates its bearer token on every domain
|
|
103
|
+
// reload), mirroring LiveClient's refreshEndpointFromLock self-heal.
|
|
104
|
+
const eventStream = new BridgeEventStream(bridgeBaseUrl(port), undefined, authToken, projectPath, envPort);
|
|
99
105
|
// Per-session tool-group visibility state. Lives in the MCP server and
|
|
100
106
|
// restores the catalog's default-on groups on every server restart; mutated
|
|
101
107
|
// only by unity_open_mcp_manage_tools and consulted by ListTools.
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC5E,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,0BAA0B;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM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,MAAM,CAAC,iBAAiB,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAChE,SAAS,EAAE,aAAa;KACzB,CAAC,CAAC,CAAC;IAEJ,MAAM,CAAC,iBAAiB,CAAC,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACpE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QAC/B,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register the reachable tool-name set. Called once from `tools/index.ts`
|
|
3
|
+
* after `ALL_TOOLS` is built. Not part of the public agent surface.
|
|
4
|
+
*/
|
|
5
|
+
export declare function registerHintableToolNames(names: readonly string[]): void;
|
|
6
|
+
/**
|
|
7
|
+
* Build the `manage_tools` activation call for a group id. Mirrors the exact
|
|
8
|
+
* invocation an agent must issue, so a hint can be followed verbatim.
|
|
9
|
+
*/
|
|
10
|
+
export declare function activateInstruction(groupId: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* True when `toolName` is reachable in a fresh session without a
|
|
13
|
+
* `manage_tools` activation — i.e. it has no group assignment (always-visible
|
|
14
|
+
* meta-tool) or its group is default-enabled.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isDefaultVisible(toolName: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Render a tool reference for use inside an agent-facing hint or tool
|
|
19
|
+
* description.
|
|
20
|
+
*
|
|
21
|
+
* Default-visible tools render as the bare name. A tool in a group that is NOT
|
|
22
|
+
* enabled by default renders as the name plus the group and the concrete
|
|
23
|
+
* activation call, e.g.
|
|
24
|
+
*
|
|
25
|
+
* unity_open_mcp_recompile_scripts (in the typed-editor group, not enabled
|
|
26
|
+
* by default — activate with manage_tools(action:"activate",
|
|
27
|
+
* group:"typed-editor"))
|
|
28
|
+
*
|
|
29
|
+
* Unknown tool names render bare: this helper never invents an activation call
|
|
30
|
+
* for a tool it cannot resolve. A name that is known to the group catalog but
|
|
31
|
+
* NOT registered (verified against the names registered by tools/index.ts,
|
|
32
|
+
* once available) also renders bare — a hint must not prescribe an activation
|
|
33
|
+
* call for a tool the server cannot actually serve — and logs one maintainer
|
|
34
|
+
* warning so the drift is visible.
|
|
35
|
+
*/
|
|
36
|
+
export declare function toolHintReference(toolName: string): string;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Centralized "how to name a tool inside an agent-facing hint" helper.
|
|
2
|
+
//
|
|
3
|
+
// specs/feedback.md 2026-08-14 (hint regression) — a runtime hint that names a
|
|
4
|
+
// tool the caller cannot see is worse than no hint at all: the agent follows
|
|
5
|
+
// it, the tool is not in its surface (`ToolSearch` answers "no matching
|
|
6
|
+
// deferred tools found"), and it falls back to hand-rolling the behavior the
|
|
7
|
+
// tool exists to replace. This had already been fixed once by appending the
|
|
8
|
+
// `manage_tools` activation call at three hand-maintained call sites; the
|
|
9
|
+
// strings drifted apart again on the next release.
|
|
10
|
+
//
|
|
11
|
+
// The structural fix is this module: ONE helper that looks the tool's group up
|
|
12
|
+
// from the registry (`capabilities/tool-groups.ts`) and appends the activation
|
|
13
|
+
// call automatically when — and only when — that group is not enabled by
|
|
14
|
+
// default. No call site can forget it, and a future group move (or a group
|
|
15
|
+
// flipping to `defaultEnabled`) fixes every hint at once.
|
|
16
|
+
//
|
|
17
|
+
// `tool-hint.test.ts` pins the invariant at the string level: every emitted
|
|
18
|
+
// hint / tool description that names a non-default-group tool must also carry
|
|
19
|
+
// the `manage_tools` activation call.
|
|
20
|
+
import { DEFAULT_ENABLED_GROUPS, groupFor, } from "./capabilities/tool-groups.js";
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// feedback 2026-08-17 — a hint must not name a tool that is not registered.
|
|
23
|
+
// The reported case: the remediation hint pointed at
|
|
24
|
+
// unity_open_mcp_recompile_scripts (in the typed-editor group), the agent
|
|
25
|
+
// activated the group, and the tool was still absent from its surface — the
|
|
26
|
+
// hint sent it down a dead end. `tools/index.ts` registers the full
|
|
27
|
+
// ALL_TOOLS name list here once at module init (a push, so this module never
|
|
28
|
+
// imports the tool graph and no import cycle exists). Until that
|
|
29
|
+
// registration has run — i.e. during module-eval-time calls from tool
|
|
30
|
+
// definition files — the registry is empty and the guard is a no-op; the
|
|
31
|
+
// static companion test in tool-hint.test.ts pins the invariant at source
|
|
32
|
+
// level instead.
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
/** Names of every registered MCP tool. Empty until tools/index.ts registers. */
|
|
35
|
+
const registeredTools = new Set();
|
|
36
|
+
/** Warn-once bookkeeping so an unregistered name logs a single line. */
|
|
37
|
+
const warnedUnregistered = new Set();
|
|
38
|
+
/**
|
|
39
|
+
* Register the reachable tool-name set. Called once from `tools/index.ts`
|
|
40
|
+
* after `ALL_TOOLS` is built. Not part of the public agent surface.
|
|
41
|
+
*/
|
|
42
|
+
export function registerHintableToolNames(names) {
|
|
43
|
+
for (const name of names)
|
|
44
|
+
registeredTools.add(name);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Build the `manage_tools` activation call for a group id. Mirrors the exact
|
|
48
|
+
* invocation an agent must issue, so a hint can be followed verbatim.
|
|
49
|
+
*/
|
|
50
|
+
export function activateInstruction(groupId) {
|
|
51
|
+
return `activate with manage_tools(action:"activate", group:"${groupId}")`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* True when `toolName` is reachable in a fresh session without a
|
|
55
|
+
* `manage_tools` activation — i.e. it has no group assignment (always-visible
|
|
56
|
+
* meta-tool) or its group is default-enabled.
|
|
57
|
+
*/
|
|
58
|
+
export function isDefaultVisible(toolName) {
|
|
59
|
+
const group = groupFor(toolName);
|
|
60
|
+
if (group === null)
|
|
61
|
+
return true;
|
|
62
|
+
return DEFAULT_ENABLED_GROUPS.has(group);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Render a tool reference for use inside an agent-facing hint or tool
|
|
66
|
+
* description.
|
|
67
|
+
*
|
|
68
|
+
* Default-visible tools render as the bare name. A tool in a group that is NOT
|
|
69
|
+
* enabled by default renders as the name plus the group and the concrete
|
|
70
|
+
* activation call, e.g.
|
|
71
|
+
*
|
|
72
|
+
* unity_open_mcp_recompile_scripts (in the typed-editor group, not enabled
|
|
73
|
+
* by default — activate with manage_tools(action:"activate",
|
|
74
|
+
* group:"typed-editor"))
|
|
75
|
+
*
|
|
76
|
+
* Unknown tool names render bare: this helper never invents an activation call
|
|
77
|
+
* for a tool it cannot resolve. A name that is known to the group catalog but
|
|
78
|
+
* NOT registered (verified against the names registered by tools/index.ts,
|
|
79
|
+
* once available) also renders bare — a hint must not prescribe an activation
|
|
80
|
+
* call for a tool the server cannot actually serve — and logs one maintainer
|
|
81
|
+
* warning so the drift is visible.
|
|
82
|
+
*/
|
|
83
|
+
export function toolHintReference(toolName) {
|
|
84
|
+
const group = groupFor(toolName);
|
|
85
|
+
const unregistered = registeredTools.size > 0 && !registeredTools.has(toolName);
|
|
86
|
+
if (unregistered && !warnedUnregistered.has(toolName)) {
|
|
87
|
+
warnedUnregistered.add(toolName);
|
|
88
|
+
console.error(`[unity-open-mcp] tool-hint drift: '${toolName}' is assigned to group ` +
|
|
89
|
+
`${group ?? "(none)"} but is not a registered tool — rendering the hint ` +
|
|
90
|
+
`without its activation call. Check tools/index.ts.`);
|
|
91
|
+
}
|
|
92
|
+
if (group === null || DEFAULT_ENABLED_GROUPS.has(group) || unregistered) {
|
|
93
|
+
return toolName;
|
|
94
|
+
}
|
|
95
|
+
return (`${toolName} (in the ${group} group, not enabled by default — ` +
|
|
96
|
+
`${activateInstruction(group)})`);
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=tool-hint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-hint.js","sourceRoot":"","sources":["../src/tool-hint.ts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C,QAAgB;IAChD,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,MAAM,YAAY,GAChB,eAAe,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7D,IAAI,YAAY,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,CAAC,KAAK,CACX,sCAAsC,QAAQ,yBAAyB;YACrE,GAAG,KAAK,IAAI,QAAQ,qDAAqD;YACzE,oDAAoD,CACvD,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,sBAAsB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,YAAY,EAAE,CAAC;QACxE,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,CACL,GAAG,QAAQ,YAAY,KAAK,mCAAmC;QAC/D,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,CACjC,CAAC;AACJ,CAAC"}
|
package/dist/tool-router.d.ts
CHANGED
|
@@ -26,7 +26,14 @@ export interface HubControlBackend {
|
|
|
26
26
|
import type { ToolSessionState } from "./tool-session-state.js";
|
|
27
27
|
export type SourceTag = "live" | "offline" | "local";
|
|
28
28
|
export interface RouteMeta {
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Where the response came from: "live" (bridge), "batch" (headless spawn),
|
|
31
|
+
* "offline" (disk parser / offline-first attempt, no bridge contact), or
|
|
32
|
+
* "local" (caller-side validation / locally-computed result). The
|
|
33
|
+
* compressible branch derives this from the payload's `_source` tag —
|
|
34
|
+
* including error bodies — so the two tags never disagree about the origin.
|
|
35
|
+
*/
|
|
36
|
+
route: "live" | "batch" | "offline" | "local";
|
|
30
37
|
fallbackReason?: string;
|
|
31
38
|
/**
|
|
32
39
|
* feedback-fable-04-08 §7 — present only when a `live_unavailable` batch
|