@apnex/network-adapter 0.1.2 → 0.1.5
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/build-info.json +6 -0
- package/dist/file-logger.d.ts +42 -0
- package/dist/file-logger.js +122 -0
- package/dist/file-logger.js.map +1 -0
- package/dist/index.d.ts +37 -13
- package/dist/index.js +42 -15
- package/dist/index.js.map +1 -1
- package/dist/kernel/adapter-config.d.ts +47 -0
- package/dist/kernel/adapter-config.js +90 -0
- package/dist/kernel/adapter-config.js.map +1 -0
- package/dist/kernel/agent-client.d.ts +25 -20
- package/dist/kernel/build-identity.d.ts +24 -0
- package/dist/kernel/build-identity.js +45 -0
- package/dist/kernel/build-identity.js.map +1 -0
- package/dist/kernel/event-router.d.ts +22 -1
- package/dist/kernel/event-router.js +45 -7
- package/dist/kernel/event-router.js.map +1 -1
- package/dist/kernel/handshake.d.ts +40 -4
- package/dist/kernel/handshake.js +46 -7
- package/dist/kernel/handshake.js.map +1 -1
- package/dist/kernel/harness-manifest.d.ts +51 -0
- package/dist/kernel/harness-manifest.js +96 -0
- package/dist/kernel/harness-manifest.js.map +1 -0
- package/dist/kernel/liveness-signal.d.ts +35 -0
- package/dist/kernel/liveness-signal.js +61 -0
- package/dist/kernel/liveness-signal.js.map +1 -0
- package/dist/kernel/liveness-watchdog.d.ts +78 -0
- package/dist/kernel/liveness-watchdog.js +115 -0
- package/dist/kernel/liveness-watchdog.js.map +1 -0
- package/dist/kernel/mcp-agent-client.d.ts +2 -2
- package/dist/kernel/mcp-agent-client.js +49 -3
- package/dist/kernel/mcp-agent-client.js.map +1 -1
- package/dist/kernel/poll-backstop.d.ts +93 -4
- package/dist/kernel/poll-backstop.js +193 -25
- package/dist/kernel/poll-backstop.js.map +1 -1
- package/dist/kernel/state-sync.d.ts +2 -13
- package/dist/kernel/state-sync.js.map +1 -1
- package/dist/notification-log.d.ts +8 -0
- package/dist/notification-log.js +10 -0
- package/dist/notification-log.js.map +1 -1
- package/dist/observability.d.ts +24 -0
- package/dist/observability.js +52 -0
- package/dist/observability.js.map +1 -0
- package/dist/prompt-format.js +82 -9
- package/dist/prompt-format.js.map +1 -1
- package/dist/tool-manager/catalog/health-revision.d.ts +43 -0
- package/dist/tool-manager/catalog/health-revision.js +61 -0
- package/dist/tool-manager/catalog/health-revision.js.map +1 -0
- package/dist/tool-manager/{tool-catalog-cache.d.ts → catalog/tool-catalog-cache.d.ts} +39 -19
- package/dist/tool-manager/{tool-catalog-cache.js → catalog/tool-catalog-cache.js} +53 -26
- package/dist/tool-manager/catalog/tool-catalog-cache.js.map +1 -0
- package/dist/tool-manager/catalog/tool-surface-reconciler.d.ts +93 -0
- package/dist/tool-manager/catalog/tool-surface-reconciler.js +101 -0
- package/dist/tool-manager/catalog/tool-surface-reconciler.js.map +1 -0
- package/dist/tool-manager/contracts.d.ts +91 -0
- package/dist/tool-manager/contracts.js +20 -0
- package/dist/tool-manager/contracts.js.map +1 -0
- package/dist/tool-manager/dispatch/dispatch.d.ts +77 -0
- package/dist/tool-manager/dispatch/dispatch.js +170 -0
- package/dist/tool-manager/dispatch/dispatch.js.map +1 -0
- package/dist/tool-manager/dispatch/tool-call-policy.d.ts +32 -0
- package/dist/tool-manager/dispatch/tool-call-policy.js +56 -0
- package/dist/tool-manager/dispatch/tool-call-policy.js.map +1 -0
- package/dist/tool-manager/{dispatcher.d.ts → orchestrator/dispatcher.d.ts} +110 -31
- package/dist/tool-manager/orchestrator/dispatcher.js +559 -0
- package/dist/tool-manager/orchestrator/dispatcher.js.map +1 -0
- package/dist/tool-manager/work-protocol/claimable-digest-tracker.d.ts +60 -0
- package/dist/tool-manager/work-protocol/claimable-digest-tracker.js +66 -0
- package/dist/tool-manager/work-protocol/claimable-digest-tracker.js.map +1 -0
- package/dist/tool-manager/work-protocol/work-lease-tracker.d.ts +59 -0
- package/dist/tool-manager/work-protocol/work-lease-tracker.js +134 -0
- package/dist/tool-manager/work-protocol/work-lease-tracker.js.map +1 -0
- package/dist/wire/mcp-transport.d.ts +1 -1
- package/dist/wire/mcp-transport.js +31 -7
- package/dist/wire/mcp-transport.js.map +1 -1
- package/dist/wire/slot-gate.d.ts +40 -0
- package/dist/wire/slot-gate.js +61 -0
- package/dist/wire/slot-gate.js.map +1 -0
- package/dist/wire/transport.d.ts +18 -0
- package/package.json +6 -3
- package/dist/kernel/instance.d.ts +0 -40
- package/dist/kernel/instance.js +0 -79
- package/dist/kernel/instance.js.map +0 -1
- package/dist/tool-manager/dispatcher.js +0 -379
- package/dist/tool-manager/dispatcher.js.map +0 -1
- package/dist/tool-manager/tool-catalog-cache.js.map +0 -1
package/dist/kernel/instance.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* globalInstanceId bootstrap.
|
|
3
|
-
*
|
|
4
|
-
* Identity is decoupled from authentication: the Hub token grants *access*
|
|
5
|
-
* and *role*; the globalInstanceId grants *identity*. This lets tokens be
|
|
6
|
-
* rotated without orphaning Agent entities.
|
|
7
|
-
*
|
|
8
|
-
* Storage: ~/.ois/instance.json (owner-private, 0600). NOT workspace-local —
|
|
9
|
-
* workspace scoping fails on multi-terminal, clone, and accidental git commit.
|
|
10
|
-
*
|
|
11
|
-
* First call generates a new UUID v4. Subsequent calls read it. If the file
|
|
12
|
-
* is deleted or corrupted, a new UUID is generated → new fingerprint → Hub
|
|
13
|
-
* creates a new Agent. The old Agent remains append-only with its queue
|
|
14
|
-
* intact; use `migrate_agent_queue` to recover pending work.
|
|
15
|
-
*/
|
|
16
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync } from "node:fs";
|
|
17
|
-
import { join } from "node:path";
|
|
18
|
-
import { homedir } from "node:os";
|
|
19
|
-
import { randomUUID } from "node:crypto";
|
|
20
|
-
const DEFAULT_INSTANCE_DIR = join(homedir(), ".ois");
|
|
21
|
-
const DEFAULT_INSTANCE_FILE = join(DEFAULT_INSTANCE_DIR, "instance.json");
|
|
22
|
-
/**
|
|
23
|
-
* Load an existing globalInstanceId from disk or create a new one.
|
|
24
|
-
* Returns the UUID (or the env-provided string override). Idempotent
|
|
25
|
-
* across calls within a process.
|
|
26
|
-
*
|
|
27
|
-
* Precedence: `OIS_INSTANCE_ID` env var wins outright — used when the
|
|
28
|
-
* operator wants a stable, human-meaningful identity (e.g. "greg" or
|
|
29
|
-
* "kate") and is responsible for uniqueness themselves. Absent that,
|
|
30
|
-
* falls back to the file-persisted UUID (original behaviour). The env
|
|
31
|
-
* path does NOT touch the file, so the two schemes coexist cleanly:
|
|
32
|
-
* toggling the env var off restores the file-derived UUID untouched.
|
|
33
|
-
*
|
|
34
|
-
* This is a pragmatic escape hatch that unblocks multi-agent
|
|
35
|
-
* co-location on a single user account (two Claude instances on one
|
|
36
|
-
* laptop). A richer design — separate agentName metadata plus an
|
|
37
|
-
* agentId derived from multiple inputs — is queued for the Entity
|
|
38
|
-
* Registry SSOT mission.
|
|
39
|
-
*/
|
|
40
|
-
export function loadOrCreateGlobalInstanceId(opts = {}) {
|
|
41
|
-
const log = opts.log ?? (() => { });
|
|
42
|
-
const envOverride = process.env.OIS_INSTANCE_ID?.trim();
|
|
43
|
-
if (envOverride) {
|
|
44
|
-
log(`[instance] Using OIS_INSTANCE_ID from env: ${envOverride}`);
|
|
45
|
-
return envOverride;
|
|
46
|
-
}
|
|
47
|
-
const file = opts.instanceFile ?? DEFAULT_INSTANCE_FILE;
|
|
48
|
-
const dir = file.substring(0, file.lastIndexOf("/")) || DEFAULT_INSTANCE_DIR;
|
|
49
|
-
if (!existsSync(dir)) {
|
|
50
|
-
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
51
|
-
}
|
|
52
|
-
if (existsSync(file)) {
|
|
53
|
-
try {
|
|
54
|
-
const raw = JSON.parse(readFileSync(file, "utf-8"));
|
|
55
|
-
if (raw.globalInstanceId && typeof raw.globalInstanceId === "string") {
|
|
56
|
-
return raw.globalInstanceId;
|
|
57
|
-
}
|
|
58
|
-
log(`[instance] ${file} missing globalInstanceId — regenerating`);
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
log(`[instance] Failed to parse ${file}: ${err} — regenerating`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
const globalInstanceId = randomUUID();
|
|
65
|
-
const body = {
|
|
66
|
-
globalInstanceId,
|
|
67
|
-
createdAt: new Date().toISOString(),
|
|
68
|
-
};
|
|
69
|
-
writeFileSync(file, JSON.stringify(body, null, 2), { mode: 0o600 });
|
|
70
|
-
try {
|
|
71
|
-
chmodSync(file, 0o600);
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
/* best effort — filesystem may not support chmod */
|
|
75
|
-
}
|
|
76
|
-
log(`[instance] Generated new globalInstanceId → ${file}`);
|
|
77
|
-
return globalInstanceId;
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=instance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/kernel/instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;AACrD,MAAM,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;AAc1E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAA4B,EAAE;IAE9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAgB,CAAC,CAAC,CAA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AAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACpE,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,oDAAoD;IACtD,CAAC;IACD,GAAG,CAAC,+CAA+C,IAAI,EAAE,CAAC,CAAC;IAC3D,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dispatcher.ts — tool-manager handler factory (Layer 1c).
|
|
3
|
-
*
|
|
4
|
-
* Host-independent shared abstraction that owns the MCP server's
|
|
5
|
-
* Initialize / ListTools / CallTool handlers and the supporting
|
|
6
|
-
* pending-action-queueItemId tracking + tool-catalog cache fallback +
|
|
7
|
-
* clientInfo capture + error-envelope normalization.
|
|
8
|
-
*
|
|
9
|
-
* Mounted by per-host shims (Layer 3) which add host-specific transport
|
|
10
|
-
* plumbing (stdio / Bun-HTTP / future) and host-specific render-surface
|
|
11
|
-
* via the `notificationHooks` callback bag (Universal Adapter
|
|
12
|
-
* notification contract).
|
|
13
|
-
*
|
|
14
|
-
* This module is the "tool-manager" per Design v1.2 §4 naming discipline
|
|
15
|
-
* (Director-ratified rename from "MCP-boundary dispatcher" 2026-04-26)
|
|
16
|
-
* — distinct from the "Message-router" which is sovereign-package #6
|
|
17
|
-
* (`@apnex/message-router`) landing in M-Push-Foundation W4. Always
|
|
18
|
-
* qualify ("tool-manager" or "Message-router") in new code; avoid bare
|
|
19
|
-
* "dispatcher".
|
|
20
|
-
*/
|
|
21
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
22
|
-
import { ListToolsRequestSchema, CallToolRequestSchema, InitializeRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
23
|
-
import { MessageRouter, SeenIdCache } from "@apnex/message-router";
|
|
24
|
-
import { PollBackstop } from "../kernel/poll-backstop.js";
|
|
25
|
-
/** Compose the pendingActionMap key. Pure helper; exported for tests. */
|
|
26
|
-
/**
|
|
27
|
-
* Mission-62 W3: tools that should NOT trigger signal_working_*
|
|
28
|
-
* wrapping. The signal_* tools themselves would recurse infinitely;
|
|
29
|
-
* register_role + claim_session + drain_pending_actions are lifecycle
|
|
30
|
-
* tools, not semantic tool-call-work.
|
|
31
|
-
*/
|
|
32
|
-
export const TOOL_CALL_SIGNAL_SKIP = new Set([
|
|
33
|
-
"signal_working_started",
|
|
34
|
-
"signal_working_completed",
|
|
35
|
-
"signal_quota_blocked",
|
|
36
|
-
"signal_quota_recovered",
|
|
37
|
-
"register_role",
|
|
38
|
-
"claim_session",
|
|
39
|
-
"drain_pending_actions",
|
|
40
|
-
]);
|
|
41
|
-
export function pendingKey(dispatchType, entityRef) {
|
|
42
|
-
return `${dispatchType}:${entityRef}`;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Inject `sourceQueueItemId` into a settling tool call's arguments
|
|
46
|
-
* when a pendingActionMap entry is registered for the call's target.
|
|
47
|
-
* Currently only `create_thread_reply` settles a thread_message
|
|
48
|
-
* dispatch; extend this set as new auto-injection rules are ratified.
|
|
49
|
-
*
|
|
50
|
-
* Side effect: deletes the consumed map entry. Explicit
|
|
51
|
-
* sourceQueueItemId in the args wins over the map (no rewrite).
|
|
52
|
-
*/
|
|
53
|
-
export function injectQueueItemId(name, args, pendingActionMap) {
|
|
54
|
-
if (name !== "create_thread_reply")
|
|
55
|
-
return args;
|
|
56
|
-
const threadId = args.threadId;
|
|
57
|
-
if (typeof threadId !== "string")
|
|
58
|
-
return args;
|
|
59
|
-
if ("sourceQueueItemId" in args)
|
|
60
|
-
return args;
|
|
61
|
-
const queueItemId = pendingActionMap.get(pendingKey("thread_message", threadId));
|
|
62
|
-
if (!queueItemId)
|
|
63
|
-
return args;
|
|
64
|
-
pendingActionMap.delete(pendingKey("thread_message", threadId));
|
|
65
|
-
return { ...args, sourceQueueItemId: queueItemId };
|
|
66
|
-
}
|
|
67
|
-
export function createSharedDispatcher(opts) {
|
|
68
|
-
const log = opts.log ?? (() => { });
|
|
69
|
-
const serverName = opts.serverName ?? "proxy";
|
|
70
|
-
const serverCapabilities = opts.serverCapabilities ?? { tools: {}, logging: {} };
|
|
71
|
-
const pendingActionMap = new Map();
|
|
72
|
-
let capturedClientInfo = {
|
|
73
|
-
name: "unknown",
|
|
74
|
-
version: "0.0.0",
|
|
75
|
-
};
|
|
76
|
-
const getClientInfo = () => capturedClientInfo;
|
|
77
|
-
function isUsableAgent(agent) {
|
|
78
|
-
return !!agent && agent.isConnected !== false;
|
|
79
|
-
}
|
|
80
|
-
// ADR-017 Phase 1.1: SSE thread_message events carry queueItemId
|
|
81
|
-
// inline. Capture into pendingActionMap so the next settling
|
|
82
|
-
// create_thread_reply can auto-inject sourceQueueItemId — even if
|
|
83
|
-
// no drain ever populated the map. Eliminates the SSE-vs-drain race
|
|
84
|
-
// that caused false-positive escalations on early thread tests.
|
|
85
|
-
const captureQueueItemFromEvent = (event) => {
|
|
86
|
-
if (event.event !== "thread_message")
|
|
87
|
-
return;
|
|
88
|
-
const data = event.data;
|
|
89
|
-
const qid = data.queueItemId;
|
|
90
|
-
const threadId = data.threadId;
|
|
91
|
-
if (typeof qid === "string" && typeof threadId === "string") {
|
|
92
|
-
pendingActionMap.set(pendingKey("thread_message", threadId), qid);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
// Mission-56 W2.2: Layer-2 routing. Every classified event goes
|
|
96
|
-
// through `@apnex/message-router` so Message-ID dedup (push+poll
|
|
97
|
-
// race) + kind→hook mapping live in one place. The host's
|
|
98
|
-
// `notificationHooks` bag is the router's hook surface — no
|
|
99
|
-
// shape adapter needed (the router's NotificationHooks interface
|
|
100
|
-
// mirrors DispatcherNotificationHooks exactly).
|
|
101
|
-
//
|
|
102
|
-
// The seen-id cache is shared across the construction-time router
|
|
103
|
-
// and any per-call routers minted by `makePendingActionItemHandler`,
|
|
104
|
-
// so a Message ID seen on the SSE inline path will dedup a later
|
|
105
|
-
// drain-path replay (and vice-versa).
|
|
106
|
-
const seenIdCache = new SeenIdCache();
|
|
107
|
-
const router = new MessageRouter({
|
|
108
|
-
hooks: opts.notificationHooks ?? {},
|
|
109
|
-
seenIdCache,
|
|
110
|
-
});
|
|
111
|
-
// Mission-56 W3.3: post-render claim. Extracts the Message ID from
|
|
112
|
-
// `message_arrived` events (W1a SSE shape: event.data.message.id)
|
|
113
|
-
// and fires `claim_message(id)` against the Hub via the agent. Per
|
|
114
|
-
// architect-issued W3 directive: claim happens AFTER the host hook
|
|
115
|
-
// renders (the ordering matches "shim calls after successful render
|
|
116
|
-
// to host" from Design v1.2 commitment #6). Errors are swallowed +
|
|
117
|
-
// logged — claim failure is non-fatal (the SSE path still rendered;
|
|
118
|
-
// the next poll-tick will pick up any unclaimed Message in the
|
|
119
|
-
// status === "new" set if needed).
|
|
120
|
-
//
|
|
121
|
-
// Multi-agent same-role: the Hub-side CAS enforces winner-takes-all
|
|
122
|
-
// (mission-56 W3.2). The wonClaim signal is informational; even if
|
|
123
|
-
// we lost, the host has already rendered (claim is post-render), so
|
|
124
|
-
// the loser still sees the Message — but only the winner's claim
|
|
125
|
-
// flips status to `received`, gating subsequent ack to a single
|
|
126
|
-
// canonical actor.
|
|
127
|
-
function fireClaimMessage(event) {
|
|
128
|
-
if (event.event !== "message_arrived")
|
|
129
|
-
return;
|
|
130
|
-
const data = event.data;
|
|
131
|
-
const message = data?.message;
|
|
132
|
-
const messageId = message?.id;
|
|
133
|
-
if (typeof messageId !== "string")
|
|
134
|
-
return;
|
|
135
|
-
const agent = opts.getAgent();
|
|
136
|
-
if (!agent || agent.state !== "streaming")
|
|
137
|
-
return;
|
|
138
|
-
void agent
|
|
139
|
-
.call("claim_message", { id: messageId })
|
|
140
|
-
.catch((err) => {
|
|
141
|
-
log(`[claim_message] non-fatal failure for ${messageId}: ${err?.message ?? String(err)}`);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
const callbacks = {
|
|
145
|
-
onActionableEvent: (event) => {
|
|
146
|
-
captureQueueItemFromEvent(event);
|
|
147
|
-
router.route({ kind: "notification.actionable", event });
|
|
148
|
-
// Mission-56 W3.3: post-render claim (replaces W2.2 stub-claim TODO).
|
|
149
|
-
fireClaimMessage(event);
|
|
150
|
-
},
|
|
151
|
-
onInformationalEvent: (event) => {
|
|
152
|
-
router.route({ kind: "notification.informational", event });
|
|
153
|
-
},
|
|
154
|
-
onStateChange: (state, previous, reason) => {
|
|
155
|
-
log(`Connection: ${previous} → ${state}${reason ? ` (${reason})` : ""}`);
|
|
156
|
-
router.route({ kind: "state.change", state, previous, reason });
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
// Mission-56 W3.3: PollBackstop construction (opt-in via opts.pollBackstop).
|
|
160
|
-
// The backstop fires `list_messages({status:"new", since:<lastSeen>})`
|
|
161
|
-
// periodically and routes each delta Message through the same
|
|
162
|
-
// MessageRouter as the SSE inline path so seen-id LRU dedup catches
|
|
163
|
-
// push+poll race overlap. Polled Messages also fire claim_message
|
|
164
|
-
// (the router invocation goes through onActionableEvent which
|
|
165
|
-
// already includes fireClaimMessage).
|
|
166
|
-
const pollBackstop = opts.pollBackstop
|
|
167
|
-
? new PollBackstop({
|
|
168
|
-
...opts.pollBackstop,
|
|
169
|
-
log: opts.pollBackstop.log ?? log,
|
|
170
|
-
onPolledMessage: (event) => {
|
|
171
|
-
router.route({ kind: "notification.actionable", event });
|
|
172
|
-
fireClaimMessage(event);
|
|
173
|
-
},
|
|
174
|
-
})
|
|
175
|
-
: undefined;
|
|
176
|
-
// Mission-56 W3.3: explicit-ack-on-action helper. Host shims wire
|
|
177
|
-
// this to fire when the LLM consumer has acted on (or actively
|
|
178
|
-
// deferred) a Message — per Option (i) ratified at thread-325 round-2,
|
|
179
|
-
// ack is tied to consumer-action, not auto-on-render.
|
|
180
|
-
async function ackMessage(messageId) {
|
|
181
|
-
const agent = opts.getAgent();
|
|
182
|
-
if (!agent || agent.state !== "streaming")
|
|
183
|
-
return;
|
|
184
|
-
try {
|
|
185
|
-
await agent.call("ack_message", { id: messageId });
|
|
186
|
-
}
|
|
187
|
-
catch (err) {
|
|
188
|
-
log(`[ack_message] non-fatal failure for ${messageId}: ${err?.message ?? String(err)}`);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
const makePendingActionItemHandler = (hooks) => {
|
|
192
|
-
// Per-call hooks override the construction-time bag for the
|
|
193
|
-
// drain path (preserves the original makePendingActionItemHandler
|
|
194
|
-
// contract — claude-plugin shim uses this to bind a custom log
|
|
195
|
-
// sink). Share the seen-id cache so drain-path replays dedup
|
|
196
|
-
// against SSE-path inline deliveries.
|
|
197
|
-
const drainRouter = new MessageRouter({
|
|
198
|
-
hooks: hooks ?? {},
|
|
199
|
-
seenIdCache,
|
|
200
|
-
});
|
|
201
|
-
return (item) => {
|
|
202
|
-
pendingActionMap.set(pendingKey(item.dispatchType, item.entityRef), item.id);
|
|
203
|
-
drainRouter.route({ kind: "pending-action.dispatch", item });
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
function createMcpServer() {
|
|
207
|
-
const server = new Server({ name: serverName, version: opts.proxyVersion }, { capabilities: serverCapabilities });
|
|
208
|
-
// Initialize handler is intentionally NOT gated — host MCP clients
|
|
209
|
-
// (e.g. Claude Code) have a tight initialize timeout that's faster
|
|
210
|
-
// than a full Hub handshake. The Initialize handler captures
|
|
211
|
-
// clientInfo for downstream handshake passthrough.
|
|
212
|
-
server.setRequestHandler(InitializeRequestSchema, async (request) => {
|
|
213
|
-
try {
|
|
214
|
-
const ci = request.params
|
|
215
|
-
.clientInfo;
|
|
216
|
-
if (ci &&
|
|
217
|
-
typeof ci.name === "string" &&
|
|
218
|
-
typeof ci.version === "string") {
|
|
219
|
-
capturedClientInfo = { name: ci.name, version: ci.version };
|
|
220
|
-
log(`[Handshake] Captured clientInfo: ${ci.name}@${ci.version}`);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
catch (err) {
|
|
224
|
-
log(`[Handshake] clientInfo capture failed (non-fatal): ${err}`);
|
|
225
|
-
}
|
|
226
|
-
return {
|
|
227
|
-
protocolVersion: request.params.protocolVersion,
|
|
228
|
-
capabilities: serverCapabilities,
|
|
229
|
-
serverInfo: { name: serverName, version: opts.proxyVersion },
|
|
230
|
-
};
|
|
231
|
-
});
|
|
232
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
233
|
-
// Probe-safe cache fallback. When identity hasn't yet resolved
|
|
234
|
-
// (e.g. `claude mcp list` spawned the adapter and will exit
|
|
235
|
-
// before the handshake completes), serve the persisted catalog
|
|
236
|
-
// if available + valid against the current Hub version. Probe
|
|
237
|
-
// returns in <50ms with zero Hub round-trips.
|
|
238
|
-
if (opts.getCachedCatalog &&
|
|
239
|
-
opts.getIsIdentityReady &&
|
|
240
|
-
!opts.getIsIdentityReady()) {
|
|
241
|
-
const cached = opts.getCachedCatalog();
|
|
242
|
-
if (cached) {
|
|
243
|
-
const currentVersion = opts.getCurrentHubVersion?.() ?? null;
|
|
244
|
-
const valid = (opts.isCacheValid ?? (() => false))(cached, currentVersion);
|
|
245
|
-
if (valid) {
|
|
246
|
-
log("[ListTools] served from cache");
|
|
247
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
248
|
-
return { tools: cached.catalog };
|
|
249
|
-
}
|
|
250
|
-
log(`[ListTools] cache stale (cached.hubVersion=${cached.hubVersion}, current=${currentVersion ?? "unknown"}) — bootstrapping`);
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
log("[ListTools] no cache (bootstrapping cache from Hub)");
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (opts.listToolsGate)
|
|
257
|
-
await opts.listToolsGate;
|
|
258
|
-
const agent = opts.getAgent();
|
|
259
|
-
if (!isUsableAgent(agent))
|
|
260
|
-
return { tools: [] };
|
|
261
|
-
// Route through agent.listTools() so any configured cognitive
|
|
262
|
-
// pipeline's onListTools middleware (ToolDescriptionEnricher,
|
|
263
|
-
// ResponseSummarizer, etc.) observes and modifies the surface.
|
|
264
|
-
const tools = await agent.listTools();
|
|
265
|
-
// Best-effort cache write-back. Failures log + continue; the
|
|
266
|
-
// primary response is already on its way to the host.
|
|
267
|
-
if (opts.persistCatalog) {
|
|
268
|
-
try {
|
|
269
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
270
|
-
opts.persistCatalog(tools);
|
|
271
|
-
}
|
|
272
|
-
catch (err) {
|
|
273
|
-
log(`[ListTools] persistCatalog hook threw (non-fatal): ${err.message ?? err}`);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
277
|
-
return { tools: tools };
|
|
278
|
-
});
|
|
279
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
280
|
-
const callStartedAt = Date.now();
|
|
281
|
-
const requestedTool = request.params.name;
|
|
282
|
-
log(`[CallTool] ${requestedTool} entered`);
|
|
283
|
-
try {
|
|
284
|
-
if (opts.callToolGate) {
|
|
285
|
-
log(`[CallTool] ${requestedTool} awaiting callToolGate`);
|
|
286
|
-
await opts.callToolGate;
|
|
287
|
-
log(`[CallTool] ${requestedTool} gate passed (+${Date.now() - callStartedAt}ms)`);
|
|
288
|
-
}
|
|
289
|
-
const agent = opts.getAgent();
|
|
290
|
-
if (!isUsableAgent(agent)) {
|
|
291
|
-
log(`[CallTool] ${requestedTool} aborted — Hub not connected`);
|
|
292
|
-
return {
|
|
293
|
-
content: [
|
|
294
|
-
{
|
|
295
|
-
type: "text",
|
|
296
|
-
text: JSON.stringify({
|
|
297
|
-
error: "Hub not connected",
|
|
298
|
-
message: "The Hub adapter is not currently connected.",
|
|
299
|
-
}),
|
|
300
|
-
},
|
|
301
|
-
],
|
|
302
|
-
isError: true,
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
const { name } = request.params;
|
|
306
|
-
const incomingArgs = (request.params.arguments ?? {});
|
|
307
|
-
const outgoingArgs = injectQueueItemId(name, incomingArgs, pendingActionMap);
|
|
308
|
-
// ── Mission-62 W3 — activity FSM signal wrapping ─────────────
|
|
309
|
-
//
|
|
310
|
-
// Wrap each LLM-driven tool call with signal_working_started +
|
|
311
|
-
// signal_working_completed RPCs (fire-and-forget; eventual-
|
|
312
|
-
// consistency on Hub-side activity FSM). Per Design v1.0 §5.2:
|
|
313
|
-
// implicit-only inference infeasible (LLM-to-MCP-tool-call
|
|
314
|
-
// path doesn't enqueue items per ADR-017 §M1-M2); explicit
|
|
315
|
-
// signaling required for routing peers to see this agent's
|
|
316
|
-
// working state.
|
|
317
|
-
//
|
|
318
|
-
// Skip-list prevents infinite recursion (signal_* calls would
|
|
319
|
-
// wrap themselves) + handshake/lifecycle tools that are not
|
|
320
|
-
// semantically tool-call-work (register_role, claim_session,
|
|
321
|
-
// drain_pending_actions).
|
|
322
|
-
const wrapWithSignal = !TOOL_CALL_SIGNAL_SKIP.has(name);
|
|
323
|
-
if (wrapWithSignal) {
|
|
324
|
-
// Fire-and-forget: don't await; Hub-side eventual-consistency
|
|
325
|
-
// is acceptable for v1.0 routing-cache use case.
|
|
326
|
-
agent.call("signal_working_started", { toolName: name }).catch((err) => {
|
|
327
|
-
log(`[mission-62] signal_working_started fire-and-forget failed (non-fatal): ${err?.message ?? err}`);
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
let result;
|
|
331
|
-
const agentCallStart = Date.now();
|
|
332
|
-
log(`[CallTool] ${name} dispatching to agent.call (wrapWithSignal=${wrapWithSignal})`);
|
|
333
|
-
try {
|
|
334
|
-
result = await agent.call(name, outgoingArgs);
|
|
335
|
-
log(`[CallTool] ${name} agent.call returned in ${Date.now() - agentCallStart}ms`);
|
|
336
|
-
}
|
|
337
|
-
finally {
|
|
338
|
-
if (wrapWithSignal) {
|
|
339
|
-
agent.call("signal_working_completed", {}).catch((err) => {
|
|
340
|
-
log(`[mission-62] signal_working_completed fire-and-forget failed (non-fatal): ${err?.message ?? err}`);
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
log(`[CallTool] ${name} completed in ${Date.now() - callStartedAt}ms total`);
|
|
345
|
-
return {
|
|
346
|
-
content: [
|
|
347
|
-
{
|
|
348
|
-
type: "text",
|
|
349
|
-
text: typeof result === "string"
|
|
350
|
-
? result
|
|
351
|
-
: JSON.stringify(result, null, 2),
|
|
352
|
-
},
|
|
353
|
-
],
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
catch (err) {
|
|
357
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
358
|
-
log(`[CallTool] ${requestedTool} threw after ${Date.now() - callStartedAt}ms: ${message}`);
|
|
359
|
-
return {
|
|
360
|
-
content: [
|
|
361
|
-
{ type: "text", text: JSON.stringify({ error: message }) },
|
|
362
|
-
],
|
|
363
|
-
isError: true,
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
return server;
|
|
368
|
-
}
|
|
369
|
-
return {
|
|
370
|
-
pendingActionMap,
|
|
371
|
-
createMcpServer,
|
|
372
|
-
callbacks,
|
|
373
|
-
getClientInfo,
|
|
374
|
-
makePendingActionItemHandler,
|
|
375
|
-
pollBackstop,
|
|
376
|
-
ackMessage,
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
//# sourceMappingURL=dispatcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/tool-manager/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAQnE,OAAO,EA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