@adhdev/mesh-shared 1.0.60-rc.73 → 1.0.60-rc.74
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/brain-routing.d.ts +4 -6
- package/dist/git-diff.d.ts +21 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +84 -269
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +78 -250
- package/dist/index.mjs.map +1 -1
- package/dist/json.d.ts +4 -0
- package/dist/mesh-tool-names.d.ts +11 -7
- package/dist/mesh-vocabulary.d.ts +1 -2
- package/dist/outbound-message.d.ts +1 -2
- package/dist/protocol/daemon-server.d.ts +8 -31
- package/dist/session-launch.d.ts +0 -8
- package/dist/slot-proposal.d.ts +1 -27
- package/dist/turn-ipc-mission.d.ts +0 -7
- package/dist/turn-ipc-queue.d.ts +10 -35
- package/dist/turn-ipc-stats.d.ts +72 -0
- package/dist/turn-ipc.d.ts +4 -4
- package/package.json +1 -1
- package/src/brain-routing.ts +6 -8
- package/src/git-diff.ts +48 -0
- package/src/index.ts +1 -1
- package/src/json.ts +10 -0
- package/src/mesh-tool-names.ts +20 -25
- package/src/mesh-vocabulary.ts +1 -2
- package/src/outbound-message.ts +1 -2
- package/src/protocol/daemon-server.ts +3 -34
- package/src/session-launch.ts +2 -4
- package/src/slot-proposal.ts +1 -47
- package/src/turn-ipc-mission.ts +7 -21
- package/src/turn-ipc-queue.ts +40 -102
- package/src/turn-ipc-stats.ts +193 -0
- package/src/turn-ipc.ts +5 -11
- package/dist/magi.d.ts +0 -281
- package/dist/turn-ipc-graph.d.ts +0 -195
- package/src/magi.ts +0 -310
- package/src/turn-ipc-graph.ts +0 -477
package/dist/index.js
CHANGED
|
@@ -47,10 +47,8 @@ __export(index_exports, {
|
|
|
47
47
|
DISPATCH_FAILURE_REASONS: () => DISPATCH_FAILURE_REASONS,
|
|
48
48
|
EVIDENCE_ENVELOPE_FIELD_SPECS: () => EVIDENCE_ENVELOPE_FIELD_SPECS,
|
|
49
49
|
EVIDENCE_SOURCE_IDS: () => EVIDENCE_SOURCE_IDS,
|
|
50
|
-
GRAPH_AUDIT_EVENTS: () => GRAPH_AUDIT_EVENTS,
|
|
51
50
|
HOLD_REASONS: () => HOLD_REASONS,
|
|
52
51
|
LIVENESS_RESULTS: () => LIVENESS_RESULTS,
|
|
53
|
-
MAGI_RAW_ANSWER_CAP: () => MAGI_RAW_ANSWER_CAP,
|
|
54
52
|
MAX_MESH_RECORD_STRING: () => MAX_MESH_RECORD_STRING,
|
|
55
53
|
MAX_OWNED_PATHS: () => MAX_OWNED_PATHS,
|
|
56
54
|
MESH_CHUNK_KIND: () => MESH_CHUNK_KIND,
|
|
@@ -61,7 +59,6 @@ __export(index_exports, {
|
|
|
61
59
|
MESH_MAX_CHUNKS: () => MESH_MAX_CHUNKS,
|
|
62
60
|
MESH_MAX_INLINE_FRAME_BYTES: () => MESH_MAX_INLINE_FRAME_BYTES,
|
|
63
61
|
MESH_MAX_REASSEMBLED_BYTES: () => MESH_MAX_REASSEMBLED_BYTES,
|
|
64
|
-
MESH_MISSION_SOURCES: () => MESH_MISSION_SOURCES,
|
|
65
62
|
MESH_MISSION_STATUSES: () => MESH_MISSION_STATUSES,
|
|
66
63
|
MESH_P2P_SIGNAL_TYPES: () => MESH_P2P_SIGNAL_TYPES,
|
|
67
64
|
MESH_RECORD_PAYLOAD_KEYS: () => MESH_RECORD_PAYLOAD_KEYS,
|
|
@@ -95,6 +92,7 @@ __export(index_exports, {
|
|
|
95
92
|
RECENT_SESSION_BUCKETS: () => RECENT_SESSION_BUCKETS,
|
|
96
93
|
RECLAIMING_SEND_REFUSALS: () => RECLAIMING_SEND_REFUSALS,
|
|
97
94
|
RELEASE_CHANNELS: () => RELEASE_CHANNELS,
|
|
95
|
+
REMOVED_MESH_TOOLS: () => REMOVED_MESH_TOOLS,
|
|
98
96
|
RETIRED_MESH_TOOLS: () => RETIRED_MESH_TOOLS,
|
|
99
97
|
SEND_POLICY_MODES: () => SEND_POLICY_MODES,
|
|
100
98
|
SEND_REFUSAL_REASONS: () => SEND_REFUSAL_REASONS,
|
|
@@ -138,7 +136,6 @@ __export(index_exports, {
|
|
|
138
136
|
WORKER_TOOLS: () => WORKER_TOOLS,
|
|
139
137
|
appendWorkerProtocolFooter: () => appendWorkerProtocolFooter,
|
|
140
138
|
argsCarryStatusProbeMarker: () => argsCarryStatusProbeMarker,
|
|
141
|
-
buildMagiPanelProposal: () => buildMagiPanelProposal,
|
|
142
139
|
buildSlotProposal: () => buildSlotProposal,
|
|
143
140
|
canonicalDaemonId: () => canonicalDaemonId,
|
|
144
141
|
classifySessionStatus: () => classifySessionStatus,
|
|
@@ -154,18 +151,6 @@ __export(index_exports, {
|
|
|
154
151
|
decodeDashboardToUserSession: () => decodeDashboardToUserSession,
|
|
155
152
|
decodeDirectDispatchRecordRequest: () => decodeDirectDispatchRecordRequest,
|
|
156
153
|
decodeDirectDispatchRecordResponse: () => decodeDirectDispatchRecordResponse,
|
|
157
|
-
decodeGraphAuditRecordRequest: () => decodeGraphAuditRecordRequest,
|
|
158
|
-
decodeGraphAuditRecordResponse: () => decodeGraphAuditRecordResponse,
|
|
159
|
-
decodeGraphGateAbandonRequest: () => decodeGraphGateAbandonRequest,
|
|
160
|
-
decodeGraphGateAbandonResponse: () => decodeGraphGateAbandonResponse,
|
|
161
|
-
decodeGraphGateClaimRequest: () => decodeGraphGateClaimRequest,
|
|
162
|
-
decodeGraphGateClaimResponse: () => decodeGraphGateClaimResponse,
|
|
163
|
-
decodeGraphGateReleaseRequest: () => decodeGraphGateReleaseRequest,
|
|
164
|
-
decodeGraphGateReleaseResponse: () => decodeGraphGateReleaseResponse,
|
|
165
|
-
decodeGraphNodePatchRequest: () => decodeGraphNodePatchRequest,
|
|
166
|
-
decodeGraphNodePatchResponse: () => decodeGraphNodePatchResponse,
|
|
167
|
-
decodeGraphViewQueryRequest: () => decodeGraphViewQueryRequest,
|
|
168
|
-
decodeGraphViewQueryResponse: () => decodeGraphViewQueryResponse,
|
|
169
154
|
decodeLedgerQueryRequest: () => decodeLedgerQueryRequest,
|
|
170
155
|
decodeLedgerQueryResponse: () => decodeLedgerQueryResponse,
|
|
171
156
|
decodeMeshIndexQueryRequest: () => decodeMeshIndexQueryRequest,
|
|
@@ -190,8 +175,8 @@ __export(index_exports, {
|
|
|
190
175
|
decodePruneStaleDirectResponse: () => decodePruneStaleDirectResponse,
|
|
191
176
|
decodeQueueCancelRequest: () => decodeQueueCancelRequest,
|
|
192
177
|
decodeQueueCancelResponse: () => decodeQueueCancelResponse,
|
|
193
|
-
|
|
194
|
-
|
|
178
|
+
decodeQueueEnqueueBatchRequest: () => decodeQueueEnqueueBatchRequest,
|
|
179
|
+
decodeQueueEnqueueBatchResponse: () => decodeQueueEnqueueBatchResponse,
|
|
195
180
|
decodeQueueEnqueueRequest: () => decodeQueueEnqueueRequest,
|
|
196
181
|
decodeQueueEnqueueResponse: () => decodeQueueEnqueueResponse,
|
|
197
182
|
decodeQueueQueryRequest: () => decodeQueueQueryRequest,
|
|
@@ -248,7 +233,6 @@ __export(index_exports, {
|
|
|
248
233
|
isDowngrade: () => isDowngrade,
|
|
249
234
|
isEvidenceIdentifier: () => isEvidenceIdentifier,
|
|
250
235
|
isFiniteNumber: () => isFiniteNumber,
|
|
251
|
-
isGraphViewQueryRequest: () => isGraphViewQueryRequest,
|
|
252
236
|
isIdleSessionState: () => isIdleSessionState,
|
|
253
237
|
isInputEnvelopeWire: () => isInputEnvelopeWire,
|
|
254
238
|
isMeshDeliveryMode: () => isMeshDeliveryMode,
|
|
@@ -327,14 +311,17 @@ __export(index_exports, {
|
|
|
327
311
|
parseSessionLaunchRecord: () => parseSessionLaunchRecord,
|
|
328
312
|
pathsOverlap: () => pathsOverlap,
|
|
329
313
|
pickBestTransitGitStatus: () => pickBestTransitGitStatus,
|
|
314
|
+
projectFileDiffRow: () => projectFileDiffRow,
|
|
330
315
|
projectTurnEvidenceEntry: () => projectTurnEvidenceEntry,
|
|
331
316
|
readBoolean: () => readBoolean,
|
|
332
317
|
readEnvelopeFields: () => readEnvelopeFields,
|
|
333
318
|
readGitSubmodules: () => readGitSubmodules,
|
|
334
319
|
readNumber: () => readNumber,
|
|
320
|
+
readOptionalRecord: () => readOptionalRecord,
|
|
335
321
|
readRecord: () => readRecord,
|
|
336
322
|
readString: () => readString,
|
|
337
323
|
readStringArray: () => readStringArray,
|
|
324
|
+
readText: () => readText,
|
|
338
325
|
renderCoordinatorWorkerSection: () => renderCoordinatorWorkerSection,
|
|
339
326
|
renderMissionBriefBlock: () => renderMissionBriefBlock,
|
|
340
327
|
renderWorkerProtocolFooter: () => renderWorkerProtocolFooter,
|
|
@@ -359,6 +346,9 @@ module.exports = __toCommonJS(index_exports);
|
|
|
359
346
|
function readRecord(value) {
|
|
360
347
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
361
348
|
}
|
|
349
|
+
function readOptionalRecord(value) {
|
|
350
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
351
|
+
}
|
|
362
352
|
function readString(...values) {
|
|
363
353
|
for (const value of values) {
|
|
364
354
|
if (typeof value !== "string") continue;
|
|
@@ -367,6 +357,9 @@ function readString(...values) {
|
|
|
367
357
|
}
|
|
368
358
|
return void 0;
|
|
369
359
|
}
|
|
360
|
+
function readText(...values) {
|
|
361
|
+
return readString(...values) ?? "";
|
|
362
|
+
}
|
|
370
363
|
function readNumber(...values) {
|
|
371
364
|
for (const value of values) {
|
|
372
365
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -734,8 +727,29 @@ function summarizeGitShape(status) {
|
|
|
734
727
|
};
|
|
735
728
|
}
|
|
736
729
|
|
|
737
|
-
// src/
|
|
738
|
-
|
|
730
|
+
// src/git-diff.ts
|
|
731
|
+
function truncateDiffText(text, maxLines) {
|
|
732
|
+
const lines = text.split("\n");
|
|
733
|
+
const truncated = lines.length > maxLines;
|
|
734
|
+
return {
|
|
735
|
+
diff: truncated ? lines.slice(0, maxLines).join("\n") + "\n... (truncated)" : text,
|
|
736
|
+
truncated
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
function projectFileDiffRow(file, rawResult, maxLines) {
|
|
740
|
+
const raw = readRecord(rawResult);
|
|
741
|
+
const d = readRecord(raw.diff ?? rawResult);
|
|
742
|
+
const text = typeof d.diff === "string" ? d.diff : "";
|
|
743
|
+
const { diff, truncated } = truncateDiffText(text, maxLines);
|
|
744
|
+
return {
|
|
745
|
+
path: file.path,
|
|
746
|
+
old_path: file.oldPath ?? null,
|
|
747
|
+
status: file.status ?? "M",
|
|
748
|
+
diff,
|
|
749
|
+
truncated,
|
|
750
|
+
binary: typeof d.binary === "boolean" ? d.binary : false
|
|
751
|
+
};
|
|
752
|
+
}
|
|
739
753
|
|
|
740
754
|
// src/brain-routing.ts
|
|
741
755
|
var MESH_TASK_DIFFICULTIES = ["easy", "medium", "difficult", "freeform"];
|
|
@@ -976,23 +990,6 @@ function buildSlotProposal(detected, currentSlots = []) {
|
|
|
976
990
|
destructive: droppedSlots.length > 0
|
|
977
991
|
};
|
|
978
992
|
}
|
|
979
|
-
function buildMagiPanelProposal(detected, opts = {}) {
|
|
980
|
-
const providers = dedupeDetected(detected ?? []);
|
|
981
|
-
const tableOrder = Object.keys(CLI_SLOT_RECIPES);
|
|
982
|
-
const rank = (type) => {
|
|
983
|
-
const i = tableOrder.indexOf(type);
|
|
984
|
-
return i === -1 ? Number.MAX_SAFE_INTEGER : i;
|
|
985
|
-
};
|
|
986
|
-
const ordered = [...providers].sort((a, b) => rank(a.type) - rank(b.type));
|
|
987
|
-
const limit = Number.isFinite(opts.maxSlots) && opts.maxSlots > 0 ? Math.floor(opts.maxSlots) : ordered.length;
|
|
988
|
-
return ordered.slice(0, limit).map((p) => ({
|
|
989
|
-
...opts.nodeId ? { nodeId: opts.nodeId } : {},
|
|
990
|
-
provider: p.type
|
|
991
|
-
// A model is intentionally NOT pinned: the panel's job is cross-provider
|
|
992
|
-
// independence, and pinning models here would silently couple the panel
|
|
993
|
-
// to this table's cost assumptions rather than to review quality.
|
|
994
|
-
}));
|
|
995
|
-
}
|
|
996
993
|
|
|
997
994
|
// src/interpolation.ts
|
|
998
995
|
function interpolateString(template, ctx) {
|
|
@@ -1007,14 +1004,10 @@ var CANONICAL_MESH_TOOL_NAMES = [
|
|
|
1007
1004
|
"mesh_status",
|
|
1008
1005
|
"mesh_route_preview",
|
|
1009
1006
|
"mesh_list_nodes",
|
|
1010
|
-
//
|
|
1007
|
+
// Batch before task, mirroring ALL_MESH_TOOLS.
|
|
1011
1008
|
"mesh_enqueue_batch",
|
|
1012
1009
|
"mesh_enqueue_task",
|
|
1013
1010
|
"mesh_view_queue",
|
|
1014
|
-
// GRAPH-ORCHESTRATION Phase E — the coordinator gate + graph view surface.
|
|
1015
|
-
"mesh_graph_view",
|
|
1016
|
-
"mesh_graph_gate",
|
|
1017
|
-
"mesh_graph_node_patch",
|
|
1018
1011
|
"mesh_queue_cancel",
|
|
1019
1012
|
"mesh_queue_requeue",
|
|
1020
1013
|
"mesh_send_task",
|
|
@@ -1049,29 +1042,14 @@ var CANONICAL_MESH_TOOL_NAMES = [
|
|
|
1049
1042
|
"mesh_mission_upsert",
|
|
1050
1043
|
"mesh_mission_list",
|
|
1051
1044
|
"mesh_review_inbox",
|
|
1052
|
-
"mesh_magi_review",
|
|
1053
|
-
"mesh_magi_collect",
|
|
1054
|
-
"mesh_magi_kind_panel",
|
|
1055
1045
|
"mesh_node_slots",
|
|
1056
1046
|
"mesh_coordinator_prompt_append"
|
|
1057
1047
|
];
|
|
1058
1048
|
var CANONICAL_MESH_TOOL_COUNT = CANONICAL_MESH_TOOL_NAMES.length;
|
|
1059
1049
|
var RETIRED_MESH_TOOLS = {
|
|
1060
|
-
mesh_graph_gate_claim: {
|
|
1061
|
-
tool: "mesh_graph_gate",
|
|
1062
|
-
args: { action: "claim" },
|
|
1063
|
-
note: 'The extend-only form (claim with extend_seconds) is now action: "extend" with the same extend_seconds.'
|
|
1064
|
-
},
|
|
1065
|
-
mesh_graph_gate_release: { tool: "mesh_graph_gate", args: { action: "release" } },
|
|
1066
|
-
mesh_graph_gate_abandon: { tool: "mesh_graph_gate", args: { action: "abandon" } },
|
|
1067
|
-
// Never a published tool (it is the daemon command behind the extend verb),
|
|
1068
|
-
// but an older gate-expiry notice told coordinators to call it by this name.
|
|
1069
|
-
mesh_graph_gate_extend: { tool: "mesh_graph_gate", args: { action: "extend" } },
|
|
1070
1050
|
mesh_node_slots_set: { tool: "mesh_node_slots", args: { action: "set" } },
|
|
1071
1051
|
mesh_node_slots_list: { tool: "mesh_node_slots", args: { action: "list" } },
|
|
1072
1052
|
mesh_node_slots_propose: { tool: "mesh_node_slots", args: { action: "propose" } },
|
|
1073
|
-
mesh_magi_kind_panel_set: { tool: "mesh_magi_kind_panel", args: { action: "set" } },
|
|
1074
|
-
mesh_magi_kind_panel_list: { tool: "mesh_magi_kind_panel", args: { action: "list" } },
|
|
1075
1053
|
mesh_coordinator_prompt_append_get: { tool: "mesh_coordinator_prompt_append", args: { action: "get" } },
|
|
1076
1054
|
mesh_coordinator_prompt_append_set: { tool: "mesh_coordinator_prompt_append", args: { action: "set" } },
|
|
1077
1055
|
mesh_record_note: { tool: "mesh_note", args: { action: "record" } },
|
|
@@ -1083,7 +1061,17 @@ var RETIRED_MESH_TOOLS = {
|
|
|
1083
1061
|
mesh_plan_onboarding: { tool: "mesh_create", args: { mode: "plan" } },
|
|
1084
1062
|
mesh_prune_stale_direct: { tool: "mesh_cleanup_sessions", args: { mode: "prune_stale_direct" } }
|
|
1085
1063
|
};
|
|
1064
|
+
var REMOVED_MESH_TOOLS = {
|
|
1065
|
+
mesh_magi_review: "For a multi-perspective review, send the same question to 2-3 workers on different providers with mesh_send_task, wait for their report_completion, then synthesize the answers yourself.",
|
|
1066
|
+
mesh_magi_collect: "Worker answers arrive as report_completion events; synthesize them yourself.",
|
|
1067
|
+
mesh_magi_kind_panel: "There are no review panels any more; pick the workers per review with mesh_send_task.",
|
|
1068
|
+
mesh_magi_kind_panel_set: "There are no review panels any more; pick the workers per review with mesh_send_task.",
|
|
1069
|
+
mesh_magi_kind_panel_list: "There are no review panels any more; pick the workers per review with mesh_send_task."
|
|
1070
|
+
};
|
|
1086
1071
|
function retiredMeshToolError(name) {
|
|
1072
|
+
if (Object.prototype.hasOwnProperty.call(REMOVED_MESH_TOOLS, name)) {
|
|
1073
|
+
return `Tool "${name}" was removed. ${REMOVED_MESH_TOOLS[name]}`;
|
|
1074
|
+
}
|
|
1087
1075
|
const entry = Object.prototype.hasOwnProperty.call(RETIRED_MESH_TOOLS, name) ? RETIRED_MESH_TOOLS[name] : void 0;
|
|
1088
1076
|
if (!entry) return null;
|
|
1089
1077
|
const discriminator = Object.entries(entry.args).map(([k, v]) => `${k}: "${v}"`).join(", ");
|
|
@@ -1380,7 +1368,6 @@ var DAEMON_TO_SERVER_TYPES = [
|
|
|
1380
1368
|
"command_result",
|
|
1381
1369
|
"error",
|
|
1382
1370
|
"agent_event",
|
|
1383
|
-
"beacon_vectors",
|
|
1384
1371
|
"daemon_mesh_command",
|
|
1385
1372
|
"p2p_offer",
|
|
1386
1373
|
"p2p_ice"
|
|
@@ -1413,7 +1400,6 @@ var SERVER_TO_DAEMON_CONTROL_TYPES = [
|
|
|
1413
1400
|
"command",
|
|
1414
1401
|
"agent_command",
|
|
1415
1402
|
"resolve_action",
|
|
1416
|
-
"beacon_vectors_result",
|
|
1417
1403
|
"daemon_mesh_result",
|
|
1418
1404
|
"p2p_ready",
|
|
1419
1405
|
"p2p_offer",
|
|
@@ -1438,18 +1424,9 @@ function decodeServerToDaemon(raw) {
|
|
|
1438
1424
|
...readEnvelopeFields(raw),
|
|
1439
1425
|
...isNonEmptyString(raw.source) ? { source: raw.source } : {}
|
|
1440
1426
|
};
|
|
1441
|
-
if (raw.type === "
|
|
1427
|
+
if (raw.type === "daemon_mesh_result") {
|
|
1442
1428
|
if (!isNonEmptyString(raw.requestId)) return null;
|
|
1443
1429
|
const base = { requestId: raw.requestId, success: raw.success === true };
|
|
1444
|
-
if (raw.type === "beacon_vectors_result") {
|
|
1445
|
-
return {
|
|
1446
|
-
type: "beacon_vectors_result",
|
|
1447
|
-
...base,
|
|
1448
|
-
...Array.isArray(raw.reports) ? { reports: raw.reports } : {},
|
|
1449
|
-
...typeof raw.truncated === "number" ? { truncated: raw.truncated } : {},
|
|
1450
|
-
...typeof raw.error === "string" ? { error: raw.error } : {}
|
|
1451
|
-
};
|
|
1452
|
-
}
|
|
1453
1430
|
return {
|
|
1454
1431
|
type: "daemon_mesh_result",
|
|
1455
1432
|
...base,
|
|
@@ -2426,9 +2403,6 @@ function sanitizeModelIdentifier(value) {
|
|
|
2426
2403
|
const trimmed = value.trim();
|
|
2427
2404
|
return MODEL_IDENTIFIER_PATTERN.test(trimmed) ? trimmed : void 0;
|
|
2428
2405
|
}
|
|
2429
|
-
function readString2(value) {
|
|
2430
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
2431
|
-
}
|
|
2432
2406
|
function readFiniteNumber(value) {
|
|
2433
2407
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
2434
2408
|
}
|
|
@@ -2440,17 +2414,17 @@ function parseModelSelection(raw) {
|
|
|
2440
2414
|
for (const entry of record.history) {
|
|
2441
2415
|
if (!entry || typeof entry !== "object") continue;
|
|
2442
2416
|
const e = entry;
|
|
2443
|
-
const value =
|
|
2417
|
+
const value = readString(e.value);
|
|
2444
2418
|
const at = readFiniteNumber(e.at);
|
|
2445
2419
|
const via = e.via === "launch" || e.via === "change_model" || e.via === "observed" ? e.via : void 0;
|
|
2446
2420
|
if (value && at !== void 0 && via) history.push({ at, value, via });
|
|
2447
2421
|
}
|
|
2448
2422
|
}
|
|
2449
|
-
const requested =
|
|
2450
|
-
const launchValue =
|
|
2451
|
-
const resolvedDefault =
|
|
2452
|
-
const current =
|
|
2453
|
-
const observed =
|
|
2423
|
+
const requested = readString(record.requested);
|
|
2424
|
+
const launchValue = readString(record.launchValue);
|
|
2425
|
+
const resolvedDefault = readString(record.resolvedDefault);
|
|
2426
|
+
const current = readString(record.current);
|
|
2427
|
+
const observed = readString(record.observed);
|
|
2454
2428
|
const observedAt = readFiniteNumber(record.observedAt);
|
|
2455
2429
|
return {
|
|
2456
2430
|
source: isModelAxisSource(record.source) ? record.source : "unspecified",
|
|
@@ -2466,15 +2440,15 @@ function parseModelSelection(raw) {
|
|
|
2466
2440
|
function parseSessionLaunchRecord(raw) {
|
|
2467
2441
|
if (!raw || typeof raw !== "object") return void 0;
|
|
2468
2442
|
const record = raw;
|
|
2469
|
-
const sessionId =
|
|
2470
|
-
const providerType =
|
|
2443
|
+
const sessionId = readString(record.sessionId);
|
|
2444
|
+
const providerType = readString(record.providerType);
|
|
2471
2445
|
const launchedAt = readFiniteNumber(record.launchedAt);
|
|
2472
2446
|
const model = parseModelSelection(record.model);
|
|
2473
2447
|
const thinkingLevel = parseModelSelection(record.thinkingLevel);
|
|
2474
2448
|
if (!sessionId || !providerType || launchedAt === void 0 || !model || !thinkingLevel) return void 0;
|
|
2475
|
-
const providerVersion =
|
|
2476
|
-
const workspace =
|
|
2477
|
-
const autoApproveModeId =
|
|
2449
|
+
const providerVersion = readString(record.providerVersion);
|
|
2450
|
+
const workspace = readString(record.workspace);
|
|
2451
|
+
const autoApproveModeId = readString(record.autoApproveModeId);
|
|
2478
2452
|
return {
|
|
2479
2453
|
sessionId,
|
|
2480
2454
|
providerType,
|
|
@@ -2762,8 +2736,6 @@ function decodeMeshIndexQueryResponse(value) {
|
|
|
2762
2736
|
// src/turn-ipc-mission.ts
|
|
2763
2737
|
var MESH_MISSION_STATUSES = ["active", "paused", "completed", "abandoned"];
|
|
2764
2738
|
var isMeshMissionStatusValue = makeGuard3(MESH_MISSION_STATUSES);
|
|
2765
|
-
var MESH_MISSION_SOURCES = ["magi", "coordinator"];
|
|
2766
|
-
var isMeshMissionSourceValue = makeGuard3(MESH_MISSION_SOURCES);
|
|
2767
2739
|
function isMissionBriefWire(value) {
|
|
2768
2740
|
if (!isRecord(value) || !hasOnlyKeys2(value, ["goal", "constraints", "doneCriteria", "handoffNotes", "ownedPaths"])) return false;
|
|
2769
2741
|
if (typeof value.goal !== "string" || value.goal.trim().length === 0) return false;
|
|
@@ -2773,23 +2745,21 @@ function isMissionBriefWire(value) {
|
|
|
2773
2745
|
return true;
|
|
2774
2746
|
}
|
|
2775
2747
|
function isMeshMissionRecordWire(value) {
|
|
2776
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["id", "meshId", "title", "goal", "status", "
|
|
2748
|
+
if (!isRecord(value) || !hasOnlyKeys2(value, ["id", "meshId", "title", "goal", "status", "brief"])) return false;
|
|
2777
2749
|
if (!isEvidenceIdentifier(value.id) || !isEvidenceIdentifier(value.meshId)) return false;
|
|
2778
2750
|
if (typeof value.title !== "string" || typeof value.goal !== "string") return false;
|
|
2779
2751
|
if (!isMeshMissionStatusValue(value.status)) return false;
|
|
2780
|
-
if (value.source !== void 0 && !isMeshMissionSourceValue(value.source)) return false;
|
|
2781
2752
|
if (value.brief !== void 0 && !isMissionBriefWire(value.brief)) return false;
|
|
2782
2753
|
return true;
|
|
2783
2754
|
}
|
|
2784
2755
|
function isMissionUpsertRequest(value) {
|
|
2785
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "id", "title", "goal", "status", "
|
|
2756
|
+
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "id", "title", "goal", "status", "brief"])) return false;
|
|
2786
2757
|
if (value.v !== TURN_IPC_PROTOCOL_VERSION) return false;
|
|
2787
2758
|
if (!isEvidenceIdentifier(value.meshId)) return false;
|
|
2788
2759
|
if (value.id !== void 0 && !isEvidenceIdentifier(value.id)) return false;
|
|
2789
2760
|
if (typeof value.title !== "string" || value.title.trim().length === 0) return false;
|
|
2790
2761
|
if (value.goal !== void 0 && typeof value.goal !== "string") return false;
|
|
2791
2762
|
if (value.status !== void 0 && !isMeshMissionStatusValue(value.status)) return false;
|
|
2792
|
-
if (value.source !== void 0 && !isMeshMissionSourceValue(value.source)) return false;
|
|
2793
2763
|
if (value.brief !== void 0 && value.brief !== null && !isMissionBriefWire(value.brief)) return false;
|
|
2794
2764
|
return true;
|
|
2795
2765
|
}
|
|
@@ -2823,7 +2793,7 @@ function decodeMissionQueryResponse(value) {
|
|
|
2823
2793
|
return isMissionQueryResponse(value) ? value : null;
|
|
2824
2794
|
}
|
|
2825
2795
|
function isMissionListQueryRequest(value) {
|
|
2826
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "statuses", "verbose", "
|
|
2796
|
+
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "statuses", "verbose", "withStats", "limit", "historyIdLimit", "meshStatusView"])) return false;
|
|
2827
2797
|
if (value.meshStatusView !== void 0 && value.meshStatusView !== "compact" && value.meshStatusView !== "verbose") return false;
|
|
2828
2798
|
if (value.v !== TURN_IPC_PROTOCOL_VERSION) return false;
|
|
2829
2799
|
if (!isEvidenceIdentifier(value.meshId)) return false;
|
|
@@ -2832,7 +2802,6 @@ function isMissionListQueryRequest(value) {
|
|
|
2832
2802
|
if (!value.statuses.every(isMeshMissionStatusValue)) return false;
|
|
2833
2803
|
}
|
|
2834
2804
|
if (value.verbose !== void 0 && typeof value.verbose !== "boolean") return false;
|
|
2835
|
-
if (value.includeMagi !== void 0 && typeof value.includeMagi !== "boolean") return false;
|
|
2836
2805
|
if (value.withStats !== void 0 && typeof value.withStats !== "boolean") return false;
|
|
2837
2806
|
if (value.limit !== void 0 && !isNonNegativeInt(value.limit)) return false;
|
|
2838
2807
|
if (value.historyIdLimit !== void 0 && !isNonNegativeInt(value.historyIdLimit)) return false;
|
|
@@ -2865,13 +2834,12 @@ function isMissionListSummaryWire(value) {
|
|
|
2865
2834
|
const hasGoal = "goal" in value;
|
|
2866
2835
|
const hasPreview = "goalPreview" in value && "goalTruncated" in value;
|
|
2867
2836
|
if (hasGoal === hasPreview) return false;
|
|
2868
|
-
const baseKeys = ["id", "meshId", "title", "status", "
|
|
2837
|
+
const baseKeys = ["id", "meshId", "title", "status", "tasks", "stats", "brief", "createdAt", "updatedAt", "closeCandidateEmittedAt"];
|
|
2869
2838
|
const allowed = hasGoal ? [...baseKeys, "goal"] : [...baseKeys, "goalPreview", "goalTruncated"];
|
|
2870
2839
|
if (!hasOnlyKeys2(value, allowed)) return false;
|
|
2871
2840
|
if (!isEvidenceIdentifier(value.id) || !isEvidenceIdentifier(value.meshId)) return false;
|
|
2872
2841
|
if (typeof value.title !== "string") return false;
|
|
2873
2842
|
if (!isMeshMissionStatusValue(value.status)) return false;
|
|
2874
|
-
if (value.source !== void 0 && !isMeshMissionSourceValue(value.source)) return false;
|
|
2875
2843
|
if (!isMeshMissionTaskAggregateWire(value.tasks)) return false;
|
|
2876
2844
|
if (value.stats !== void 0 && !isMeshMissionStatsWire(value.stats)) return false;
|
|
2877
2845
|
if (value.brief !== void 0 && !isMissionBriefWire(value.brief)) return false;
|
|
@@ -3024,7 +2992,7 @@ function decodeQueueQueryRequest(value) {
|
|
|
3024
2992
|
return isQueueQueryRequest(value) ? value : null;
|
|
3025
2993
|
}
|
|
3026
2994
|
function isQueueDependencyHeadWire(value) {
|
|
3027
|
-
return isRecord(value) && hasOnlyKeys2(value, ["id", "status", "
|
|
2995
|
+
return isRecord(value) && hasOnlyKeys2(value, ["id", "status", "cancelReason"]) && typeof value.id === "string" && typeof value.status === "string" && (value.cancelReason === void 0 || typeof value.cancelReason === "string");
|
|
3028
2996
|
}
|
|
3029
2997
|
function isQueueQueryResponse(value) {
|
|
3030
2998
|
if (!isRecord(value) || !hasOnlyKeys2(value, ["entries", "counts", "oldHistoricalCount", "dependencyHeads"])) return false;
|
|
@@ -3038,7 +3006,7 @@ function decodeQueueQueryResponse(value) {
|
|
|
3038
3006
|
return isQueueQueryResponse(value) ? value : null;
|
|
3039
3007
|
}
|
|
3040
3008
|
function isQueueEnqueueRequest(value) {
|
|
3041
|
-
return isRecord(value) && hasOnlyKeys2(value, ["v", "meshId", "message", "options"
|
|
3009
|
+
return isRecord(value) && hasOnlyKeys2(value, ["v", "meshId", "message", "options"]) && value.v === TURN_IPC_PROTOCOL_VERSION && isEvidenceIdentifier(value.meshId) && typeof value.message === "string" && isOptionalRecord(value.options);
|
|
3042
3010
|
}
|
|
3043
3011
|
function decodeQueueEnqueueRequest(value) {
|
|
3044
3012
|
return isQueueEnqueueRequest(value) ? value : null;
|
|
@@ -3049,28 +3017,24 @@ function isQueueEnqueueResponse(value) {
|
|
|
3049
3017
|
function decodeQueueEnqueueResponse(value) {
|
|
3050
3018
|
return isQueueEnqueueResponse(value) ? value : null;
|
|
3051
3019
|
}
|
|
3052
|
-
function
|
|
3053
|
-
|
|
3054
|
-
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId)) return false;
|
|
3055
|
-
if (value.mode === "compat") return isRecordArray(value.specs) && value.plan === void 0 && isOptionalRecord(value.audit);
|
|
3056
|
-
if (value.mode === "graph") return isRecord(value.plan) && value.specs === void 0 && isOptionalRecord(value.audit);
|
|
3057
|
-
return false;
|
|
3020
|
+
function isQueueEnqueueBatchRequest(value) {
|
|
3021
|
+
return isRecord(value) && hasOnlyKeys2(value, ["v", "meshId", "specs"]) && value.v === TURN_IPC_PROTOCOL_VERSION && isEvidenceIdentifier(value.meshId) && isRecordArray(value.specs);
|
|
3058
3022
|
}
|
|
3059
|
-
function
|
|
3060
|
-
return
|
|
3023
|
+
function decodeQueueEnqueueBatchRequest(value) {
|
|
3024
|
+
return isQueueEnqueueBatchRequest(value) ? value : null;
|
|
3061
3025
|
}
|
|
3062
|
-
function
|
|
3026
|
+
function isQueueEnqueueBatchResponse(value) {
|
|
3063
3027
|
if (!isRecord(value)) return false;
|
|
3064
3028
|
if (value.ok === true) {
|
|
3065
|
-
return hasOnlyKeys2(value, ["ok", "tasks"
|
|
3029
|
+
return hasOnlyKeys2(value, ["ok", "tasks"]) && Array.isArray(value.tasks) && value.tasks.every(isQueueEntryWire);
|
|
3066
3030
|
}
|
|
3067
3031
|
if (value.ok === false) {
|
|
3068
3032
|
return hasOnlyKeys2(value, ["ok", "refusalCode", "message", "extra"]) && typeof value.message === "string" && isOptionalString(value.refusalCode) && isOptionalRecord(value.extra);
|
|
3069
3033
|
}
|
|
3070
3034
|
return false;
|
|
3071
3035
|
}
|
|
3072
|
-
function
|
|
3073
|
-
return
|
|
3036
|
+
function decodeQueueEnqueueBatchResponse(value) {
|
|
3037
|
+
return isQueueEnqueueBatchResponse(value) ? value : null;
|
|
3074
3038
|
}
|
|
3075
3039
|
function isQueueCancelRequest(value) {
|
|
3076
3040
|
return isRecord(value) && hasOnlyKeys2(value, ["v", "meshId", "taskId", "reason"]) && value.v === TURN_IPC_PROTOCOL_VERSION && isEvidenceIdentifier(value.meshId) && isEvidenceIdentifier(value.taskId) && isOptionalString(value.reason);
|
|
@@ -3097,31 +3061,17 @@ function decodeQueueRequeueResponse(value) {
|
|
|
3097
3061
|
return isQueueRequeueResponse(value) ? value : null;
|
|
3098
3062
|
}
|
|
3099
3063
|
function isDirectDispatchRecordRequest(value) {
|
|
3100
|
-
return isRecord(value) && hasOnlyKeys2(value, ["v", "meshId", "taskId", "message", "task"
|
|
3064
|
+
return isRecord(value) && hasOnlyKeys2(value, ["v", "meshId", "taskId", "message", "task"]) && value.v === TURN_IPC_PROTOCOL_VERSION && isEvidenceIdentifier(value.meshId) && isEvidenceIdentifier(value.taskId) && typeof value.message === "string" && isOptionalRecord(value.task);
|
|
3101
3065
|
}
|
|
3102
3066
|
function decodeDirectDispatchRecordRequest(value) {
|
|
3103
3067
|
return isDirectDispatchRecordRequest(value) ? value : null;
|
|
3104
3068
|
}
|
|
3105
3069
|
function isDirectDispatchRecordResponse(value) {
|
|
3106
|
-
return isRecord(value) && hasOnlyKeys2(value, ["taskRecorded"
|
|
3070
|
+
return isRecord(value) && hasOnlyKeys2(value, ["taskRecorded"]) && typeof value.taskRecorded === "boolean";
|
|
3107
3071
|
}
|
|
3108
3072
|
function decodeDirectDispatchRecordResponse(value) {
|
|
3109
3073
|
return isDirectDispatchRecordResponse(value) ? value : null;
|
|
3110
3074
|
}
|
|
3111
|
-
var GRAPH_AUDIT_EVENTS = ["gate_claimed", "gate_released", "gate_abandoned", "node_patched"];
|
|
3112
|
-
var isGraphAuditEvent = makeGuard3(GRAPH_AUDIT_EVENTS);
|
|
3113
|
-
function isGraphAuditRecordRequest(value) {
|
|
3114
|
-
return isRecord(value) && hasOnlyKeys2(value, ["v", "meshId", "event", "fields"]) && value.v === TURN_IPC_PROTOCOL_VERSION && isEvidenceIdentifier(value.meshId) && isGraphAuditEvent(value.event) && isRecord(value.fields);
|
|
3115
|
-
}
|
|
3116
|
-
function decodeGraphAuditRecordRequest(value) {
|
|
3117
|
-
return isGraphAuditRecordRequest(value) ? value : null;
|
|
3118
|
-
}
|
|
3119
|
-
function isGraphAuditRecordResponse(value) {
|
|
3120
|
-
return isRecord(value) && hasOnlyKeys2(value, ["recorded"]) && typeof value.recorded === "boolean";
|
|
3121
|
-
}
|
|
3122
|
-
function decodeGraphAuditRecordResponse(value) {
|
|
3123
|
-
return isGraphAuditRecordResponse(value) ? value : null;
|
|
3124
|
-
}
|
|
3125
3075
|
function isActiveWorkQueryRequest(value) {
|
|
3126
3076
|
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "nodes", "queue", "recordTail", "includeTerminalDirect", "compute", "includeInputs", "includeSummary", "includeSchedulingRuntime", "mesh"])) return false;
|
|
3127
3077
|
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId)) return false;
|
|
@@ -3170,123 +3120,7 @@ function decodeRecoveryContextQueryResponse(value) {
|
|
|
3170
3120
|
return isRecoveryContextQueryResponse(value) ? value : null;
|
|
3171
3121
|
}
|
|
3172
3122
|
|
|
3173
|
-
// src/turn-ipc-
|
|
3174
|
-
function isGraphGateClaimRequest(value) {
|
|
3175
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "gateId", "coordinatorSessionId", "leaseSeconds", "extendDeadlineSeconds", "probeConvergenceEvidence"])) return false;
|
|
3176
|
-
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId) || !isEvidenceIdentifier(value.gateId) || !isEvidenceIdentifier(value.coordinatorSessionId)) return false;
|
|
3177
|
-
if (value.leaseSeconds !== void 0 && !isFiniteNumber3(value.leaseSeconds)) return false;
|
|
3178
|
-
if (value.extendDeadlineSeconds !== void 0 && !isFiniteNumber3(value.extendDeadlineSeconds)) return false;
|
|
3179
|
-
return isOptionalBoolean(value.probeConvergenceEvidence);
|
|
3180
|
-
}
|
|
3181
|
-
function decodeGraphGateClaimRequest(value) {
|
|
3182
|
-
return isGraphGateClaimRequest(value) ? value : null;
|
|
3183
|
-
}
|
|
3184
|
-
function isGraphGateClaimResponse(value) {
|
|
3185
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["claimed", "reason", "gate", "leaseGeneration", "fencingToken", "leaseExpiresAt", "deadlineAt", "ambiguousExternalOutcome", "previousLeaseOwnerSessionId", "convergenceEvidence"])) return false;
|
|
3186
|
-
if (typeof value.claimed !== "boolean") return false;
|
|
3187
|
-
return isOptionalRecord(value.gate) && isOptionalRecord(value.convergenceEvidence) && isOptionalBoolean(value.ambiguousExternalOutcome);
|
|
3188
|
-
}
|
|
3189
|
-
function decodeGraphGateClaimResponse(value) {
|
|
3190
|
-
return isGraphGateClaimResponse(value) ? value : null;
|
|
3191
|
-
}
|
|
3192
|
-
function isGraphGateReleaseRequest(value) {
|
|
3193
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "gateId", "fencingToken", "leaseGeneration", "idempotencyKey", "outcome", "result", "evidence", "patches"])) return false;
|
|
3194
|
-
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId) || !isEvidenceIdentifier(value.gateId)) return false;
|
|
3195
|
-
if (typeof value.fencingToken !== "string" || !value.fencingToken) return false;
|
|
3196
|
-
if (!isFiniteNumber3(value.leaseGeneration)) return false;
|
|
3197
|
-
if (typeof value.idempotencyKey !== "string" || !value.idempotencyKey) return false;
|
|
3198
|
-
if (typeof value.outcome !== "string" || !value.outcome) return false;
|
|
3199
|
-
if (value.patches !== void 0) {
|
|
3200
|
-
if (!Array.isArray(value.patches)) return false;
|
|
3201
|
-
for (const p of value.patches) {
|
|
3202
|
-
if (!isRecord(p) || typeof p.node !== "string" || !p.node || !isRecord(p.baseSpecPatch)) return false;
|
|
3203
|
-
}
|
|
3204
|
-
}
|
|
3205
|
-
return true;
|
|
3206
|
-
}
|
|
3207
|
-
function decodeGraphGateReleaseRequest(value) {
|
|
3208
|
-
return isGraphGateReleaseRequest(value) ? value : null;
|
|
3209
|
-
}
|
|
3210
|
-
function isGraphGateReleaseResponse(value) {
|
|
3211
|
-
if (!isRecord(value)) return false;
|
|
3212
|
-
if (value.released === true) {
|
|
3213
|
-
if (!hasOnlyKeys2(value, ["released", "duplicate", "gate", "materializedNodeIds", "downstreamNodeCount", "graphCompleted"])) return false;
|
|
3214
|
-
if (typeof value.duplicate !== "boolean") return false;
|
|
3215
|
-
if (!Array.isArray(value.materializedNodeIds) || !value.materializedNodeIds.every((n) => typeof n === "string")) return false;
|
|
3216
|
-
if (value.downstreamNodeCount !== void 0 && !isNonNegativeInt(value.downstreamNodeCount)) return false;
|
|
3217
|
-
return isOptionalRecord(value.gate) && isOptionalBoolean(value.graphCompleted);
|
|
3218
|
-
}
|
|
3219
|
-
if (value.released === false) {
|
|
3220
|
-
return hasOnlyKeys2(value, ["released", "refusalCode", "message"]) && typeof value.message === "string" && isOptionalString(value.refusalCode);
|
|
3221
|
-
}
|
|
3222
|
-
return false;
|
|
3223
|
-
}
|
|
3224
|
-
function decodeGraphGateReleaseResponse(value) {
|
|
3225
|
-
return isGraphGateReleaseResponse(value) ? value : null;
|
|
3226
|
-
}
|
|
3227
|
-
function isGraphGateAbandonRequest(value) {
|
|
3228
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "gateId", "reason", "coordinatorSessionId", "force"])) return false;
|
|
3229
|
-
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId) || !isEvidenceIdentifier(value.gateId)) return false;
|
|
3230
|
-
if (typeof value.reason !== "string" || !value.reason) return false;
|
|
3231
|
-
if (value.coordinatorSessionId !== void 0 && !isEvidenceIdentifier(value.coordinatorSessionId)) return false;
|
|
3232
|
-
return isOptionalBoolean(value.force);
|
|
3233
|
-
}
|
|
3234
|
-
function decodeGraphGateAbandonRequest(value) {
|
|
3235
|
-
return isGraphGateAbandonRequest(value) ? value : null;
|
|
3236
|
-
}
|
|
3237
|
-
function isGraphGateAbandonResponse(value) {
|
|
3238
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["abandoned", "reason", "gate", "cancelledNodeIds", "cancelledTaskIds", "graphStatus"])) return false;
|
|
3239
|
-
if (typeof value.abandoned !== "boolean") return false;
|
|
3240
|
-
if (!Array.isArray(value.cancelledNodeIds) || !value.cancelledNodeIds.every((n) => typeof n === "string")) return false;
|
|
3241
|
-
if (!Array.isArray(value.cancelledTaskIds) || !value.cancelledTaskIds.every((n) => typeof n === "string")) return false;
|
|
3242
|
-
return isOptionalRecord(value.gate);
|
|
3243
|
-
}
|
|
3244
|
-
function decodeGraphGateAbandonResponse(value) {
|
|
3245
|
-
return isGraphGateAbandonResponse(value) ? value : null;
|
|
3246
|
-
}
|
|
3247
|
-
function isGraphNodePatchRequest(value) {
|
|
3248
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "node", "graphId", "baseSpecPatch"])) return false;
|
|
3249
|
-
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId)) return false;
|
|
3250
|
-
if (typeof value.node !== "string" || !value.node) return false;
|
|
3251
|
-
if (value.graphId !== void 0 && !isEvidenceIdentifier(value.graphId)) return false;
|
|
3252
|
-
return isRecord(value.baseSpecPatch) && Object.keys(value.baseSpecPatch).length > 0;
|
|
3253
|
-
}
|
|
3254
|
-
function decodeGraphNodePatchRequest(value) {
|
|
3255
|
-
return isGraphNodePatchRequest(value) ? value : null;
|
|
3256
|
-
}
|
|
3257
|
-
function isGraphNodePatchResponse(value) {
|
|
3258
|
-
if (!isRecord(value)) return false;
|
|
3259
|
-
if (value.patched === true) {
|
|
3260
|
-
if (!hasOnlyKeys2(value, ["patched", "graphId", "nodeId", "ref", "queueTaskId", "materializationVersion", "state", "outcomeKind", "skippedReason", "blockedReason"])) return false;
|
|
3261
|
-
if (!isEvidenceIdentifier(value.graphId) || !isEvidenceIdentifier(value.nodeId)) return false;
|
|
3262
|
-
if (!isNonNegativeInt(value.materializationVersion)) return false;
|
|
3263
|
-
return typeof value.state === "string" && typeof value.outcomeKind === "string";
|
|
3264
|
-
}
|
|
3265
|
-
if (value.patched === false) {
|
|
3266
|
-
return hasOnlyKeys2(value, ["patched", "refusalCode", "message"]) && typeof value.message === "string" && isOptionalString(value.refusalCode);
|
|
3267
|
-
}
|
|
3268
|
-
return false;
|
|
3269
|
-
}
|
|
3270
|
-
function decodeGraphNodePatchResponse(value) {
|
|
3271
|
-
return isGraphNodePatchResponse(value) ? value : null;
|
|
3272
|
-
}
|
|
3273
|
-
function isGraphViewQueryRequest(value) {
|
|
3274
|
-
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "graphId", "batchId", "activeOnly", "limit", "probeGateEvidence"])) return false;
|
|
3275
|
-
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId)) return false;
|
|
3276
|
-
if (value.graphId !== void 0 && !isEvidenceIdentifier(value.graphId)) return false;
|
|
3277
|
-
if (value.batchId !== void 0 && !isEvidenceIdentifier(value.batchId)) return false;
|
|
3278
|
-
if (value.limit !== void 0 && !isNonNegativeInt(value.limit)) return false;
|
|
3279
|
-
return isOptionalBoolean(value.activeOnly) && isOptionalBoolean(value.probeGateEvidence);
|
|
3280
|
-
}
|
|
3281
|
-
function decodeGraphViewQueryRequest(value) {
|
|
3282
|
-
return isGraphViewQueryRequest(value) ? value : null;
|
|
3283
|
-
}
|
|
3284
|
-
function isGraphViewQueryResponse(value) {
|
|
3285
|
-
return isRecord(value) && hasOnlyKeys2(value, ["graphs"]) && isRecordArray(value.graphs);
|
|
3286
|
-
}
|
|
3287
|
-
function decodeGraphViewQueryResponse(value) {
|
|
3288
|
-
return isGraphViewQueryResponse(value) ? value : null;
|
|
3289
|
-
}
|
|
3123
|
+
// src/turn-ipc-stats.ts
|
|
3290
3124
|
function isTaskStatsQueryRequest(value) {
|
|
3291
3125
|
if (!isRecord(value) || !hasOnlyKeys2(value, ["v", "meshId", "taskIds", "missionId", "tail", "rollup", "missionIds"])) return false;
|
|
3292
3126
|
if (value.v !== TURN_IPC_PROTOCOL_VERSION || !isEvidenceIdentifier(value.meshId)) return false;
|
|
@@ -3380,21 +3214,15 @@ var TURN_IPC_COMMANDS = [
|
|
|
3380
3214
|
"record_local",
|
|
3381
3215
|
"queue_query",
|
|
3382
3216
|
"queue_enqueue",
|
|
3383
|
-
"
|
|
3217
|
+
"queue_enqueue_batch",
|
|
3384
3218
|
"queue_cancel",
|
|
3385
3219
|
"queue_requeue",
|
|
3386
3220
|
"direct_dispatch_record",
|
|
3387
|
-
"graph_audit_record",
|
|
3388
3221
|
"active_work_query",
|
|
3389
3222
|
"recovery_context_query",
|
|
3390
3223
|
// C-W9c additions (2026-09-24 19:00 stamp — the last mcp-server in-process
|
|
3391
|
-
// daemon-core paths:
|
|
3392
|
-
//
|
|
3393
|
-
"graph_gate_claim",
|
|
3394
|
-
"graph_gate_release",
|
|
3395
|
-
"graph_gate_abandon",
|
|
3396
|
-
"graph_node_patch",
|
|
3397
|
-
"graph_view_query",
|
|
3224
|
+
// daemon-core paths: mission reads, task/mission stats, orphaned-pin
|
|
3225
|
+
// helpers, one prune audit):
|
|
3398
3226
|
"task_stats_query",
|
|
3399
3227
|
"prune_stale_direct",
|
|
3400
3228
|
"orphaned_pin_notify"
|
|
@@ -3844,10 +3672,8 @@ function stableMeshNodeRow(row) {
|
|
|
3844
3672
|
DISPATCH_FAILURE_REASONS,
|
|
3845
3673
|
EVIDENCE_ENVELOPE_FIELD_SPECS,
|
|
3846
3674
|
EVIDENCE_SOURCE_IDS,
|
|
3847
|
-
GRAPH_AUDIT_EVENTS,
|
|
3848
3675
|
HOLD_REASONS,
|
|
3849
3676
|
LIVENESS_RESULTS,
|
|
3850
|
-
MAGI_RAW_ANSWER_CAP,
|
|
3851
3677
|
MAX_MESH_RECORD_STRING,
|
|
3852
3678
|
MAX_OWNED_PATHS,
|
|
3853
3679
|
MESH_CHUNK_KIND,
|
|
@@ -3858,7 +3684,6 @@ function stableMeshNodeRow(row) {
|
|
|
3858
3684
|
MESH_MAX_CHUNKS,
|
|
3859
3685
|
MESH_MAX_INLINE_FRAME_BYTES,
|
|
3860
3686
|
MESH_MAX_REASSEMBLED_BYTES,
|
|
3861
|
-
MESH_MISSION_SOURCES,
|
|
3862
3687
|
MESH_MISSION_STATUSES,
|
|
3863
3688
|
MESH_P2P_SIGNAL_TYPES,
|
|
3864
3689
|
MESH_RECORD_PAYLOAD_KEYS,
|
|
@@ -3892,6 +3717,7 @@ function stableMeshNodeRow(row) {
|
|
|
3892
3717
|
RECENT_SESSION_BUCKETS,
|
|
3893
3718
|
RECLAIMING_SEND_REFUSALS,
|
|
3894
3719
|
RELEASE_CHANNELS,
|
|
3720
|
+
REMOVED_MESH_TOOLS,
|
|
3895
3721
|
RETIRED_MESH_TOOLS,
|
|
3896
3722
|
SEND_POLICY_MODES,
|
|
3897
3723
|
SEND_REFUSAL_REASONS,
|
|
@@ -3935,7 +3761,6 @@ function stableMeshNodeRow(row) {
|
|
|
3935
3761
|
WORKER_TOOLS,
|
|
3936
3762
|
appendWorkerProtocolFooter,
|
|
3937
3763
|
argsCarryStatusProbeMarker,
|
|
3938
|
-
buildMagiPanelProposal,
|
|
3939
3764
|
buildSlotProposal,
|
|
3940
3765
|
canonicalDaemonId,
|
|
3941
3766
|
classifySessionStatus,
|
|
@@ -3951,18 +3776,6 @@ function stableMeshNodeRow(row) {
|
|
|
3951
3776
|
decodeDashboardToUserSession,
|
|
3952
3777
|
decodeDirectDispatchRecordRequest,
|
|
3953
3778
|
decodeDirectDispatchRecordResponse,
|
|
3954
|
-
decodeGraphAuditRecordRequest,
|
|
3955
|
-
decodeGraphAuditRecordResponse,
|
|
3956
|
-
decodeGraphGateAbandonRequest,
|
|
3957
|
-
decodeGraphGateAbandonResponse,
|
|
3958
|
-
decodeGraphGateClaimRequest,
|
|
3959
|
-
decodeGraphGateClaimResponse,
|
|
3960
|
-
decodeGraphGateReleaseRequest,
|
|
3961
|
-
decodeGraphGateReleaseResponse,
|
|
3962
|
-
decodeGraphNodePatchRequest,
|
|
3963
|
-
decodeGraphNodePatchResponse,
|
|
3964
|
-
decodeGraphViewQueryRequest,
|
|
3965
|
-
decodeGraphViewQueryResponse,
|
|
3966
3779
|
decodeLedgerQueryRequest,
|
|
3967
3780
|
decodeLedgerQueryResponse,
|
|
3968
3781
|
decodeMeshIndexQueryRequest,
|
|
@@ -3987,8 +3800,8 @@ function stableMeshNodeRow(row) {
|
|
|
3987
3800
|
decodePruneStaleDirectResponse,
|
|
3988
3801
|
decodeQueueCancelRequest,
|
|
3989
3802
|
decodeQueueCancelResponse,
|
|
3990
|
-
|
|
3991
|
-
|
|
3803
|
+
decodeQueueEnqueueBatchRequest,
|
|
3804
|
+
decodeQueueEnqueueBatchResponse,
|
|
3992
3805
|
decodeQueueEnqueueRequest,
|
|
3993
3806
|
decodeQueueEnqueueResponse,
|
|
3994
3807
|
decodeQueueQueryRequest,
|
|
@@ -4045,7 +3858,6 @@ function stableMeshNodeRow(row) {
|
|
|
4045
3858
|
isDowngrade,
|
|
4046
3859
|
isEvidenceIdentifier,
|
|
4047
3860
|
isFiniteNumber,
|
|
4048
|
-
isGraphViewQueryRequest,
|
|
4049
3861
|
isIdleSessionState,
|
|
4050
3862
|
isInputEnvelopeWire,
|
|
4051
3863
|
isMeshDeliveryMode,
|
|
@@ -4124,14 +3936,17 @@ function stableMeshNodeRow(row) {
|
|
|
4124
3936
|
parseSessionLaunchRecord,
|
|
4125
3937
|
pathsOverlap,
|
|
4126
3938
|
pickBestTransitGitStatus,
|
|
3939
|
+
projectFileDiffRow,
|
|
4127
3940
|
projectTurnEvidenceEntry,
|
|
4128
3941
|
readBoolean,
|
|
4129
3942
|
readEnvelopeFields,
|
|
4130
3943
|
readGitSubmodules,
|
|
4131
3944
|
readNumber,
|
|
3945
|
+
readOptionalRecord,
|
|
4132
3946
|
readRecord,
|
|
4133
3947
|
readString,
|
|
4134
3948
|
readStringArray,
|
|
3949
|
+
readText,
|
|
4135
3950
|
renderCoordinatorWorkerSection,
|
|
4136
3951
|
renderMissionBriefBlock,
|
|
4137
3952
|
renderWorkerProtocolFooter,
|