@apnex/network-adapter 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hub-error.d.ts +42 -0
- package/dist/hub-error.js +74 -0
- package/dist/hub-error.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel/agent-client.d.ts +192 -0
- package/dist/kernel/agent-client.js +44 -0
- package/dist/kernel/agent-client.js.map +1 -0
- package/dist/kernel/event-router.d.ts +49 -0
- package/dist/kernel/event-router.js +150 -0
- package/dist/kernel/event-router.js.map +1 -0
- package/dist/kernel/handshake.d.ts +161 -0
- package/dist/kernel/handshake.js +257 -0
- package/dist/kernel/handshake.js.map +1 -0
- package/dist/kernel/instance.d.ts +40 -0
- package/dist/kernel/instance.js +79 -0
- package/dist/kernel/instance.js.map +1 -0
- package/dist/kernel/mcp-agent-client.d.ts +139 -0
- package/dist/kernel/mcp-agent-client.js +505 -0
- package/dist/kernel/mcp-agent-client.js.map +1 -0
- package/dist/kernel/poll-backstop.d.ts +108 -0
- package/dist/kernel/poll-backstop.js +243 -0
- package/dist/kernel/poll-backstop.js.map +1 -0
- package/dist/kernel/session-claim.d.ts +67 -0
- package/dist/kernel/session-claim.js +106 -0
- package/dist/kernel/session-claim.js.map +1 -0
- package/dist/kernel/state-sync.d.ts +43 -0
- package/dist/kernel/state-sync.js +85 -0
- package/dist/kernel/state-sync.js.map +1 -0
- package/dist/logger.d.ts +82 -0
- package/dist/logger.js +114 -0
- package/dist/logger.js.map +1 -0
- package/dist/notification-log.d.ts +29 -0
- package/dist/notification-log.js +66 -0
- package/dist/notification-log.js.map +1 -0
- package/dist/prompt-format.d.ts +38 -0
- package/dist/prompt-format.js +220 -0
- package/dist/prompt-format.js.map +1 -0
- package/dist/tool-manager/dispatcher.d.ts +180 -0
- package/dist/tool-manager/dispatcher.js +379 -0
- package/dist/tool-manager/dispatcher.js.map +1 -0
- package/dist/tool-manager/tool-catalog-cache.d.ts +85 -0
- package/dist/tool-manager/tool-catalog-cache.js +137 -0
- package/dist/tool-manager/tool-catalog-cache.js.map +1 -0
- package/dist/wire/mcp-transport.d.ts +120 -0
- package/dist/wire/mcp-transport.js +447 -0
- package/dist/wire/mcp-transport.js.map +1 -0
- package/dist/wire/transport.d.ts +174 -0
- package/dist/wire/transport.js +43 -0
- package/dist/wire/transport.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ITransport — Layer-4 wire surface for the network-adapter package.
|
|
3
|
+
*
|
|
4
|
+
* Phase 1: types only. Zero runtime change. The real implementation
|
|
5
|
+
* (`McpTransport`) lands in Phase 2, extracted out of the current
|
|
6
|
+
* `McpConnectionManager`.
|
|
7
|
+
*
|
|
8
|
+
* ## Responsibility boundary
|
|
9
|
+
*
|
|
10
|
+
* A Transport owns exactly one logical wire to a Hub. It is responsible
|
|
11
|
+
* for:
|
|
12
|
+
*
|
|
13
|
+
* 1. Opening and closing that wire.
|
|
14
|
+
* 2. Shipping untyped request/response pairs over it (`request`).
|
|
15
|
+
* 3. Enumerating what method names the remote peer advertises
|
|
16
|
+
* (`listMethods` — used by the adapter for discovery translation).
|
|
17
|
+
* 4. Surfacing liveness: a coarse 3-value `wireState` and a stream of
|
|
18
|
+
* `WireEvent`s (connected, disconnected, peer-closed, etc.).
|
|
19
|
+
* 5. Wire-level reconnect policy: it transparently reconnects the
|
|
20
|
+
* underlying socket/HTTP/SSE stream on transient failure. It does
|
|
21
|
+
* NOT know about sessions, roles, handshakes, or FSM.
|
|
22
|
+
*
|
|
23
|
+
* It is NOT responsible for:
|
|
24
|
+
*
|
|
25
|
+
* - Session lifecycle (bind/rebind/teardown). That lives on the
|
|
26
|
+
* `IAgentClient` above it.
|
|
27
|
+
* - Authentication and handshake semantics (register_role, enriched handshake).
|
|
28
|
+
* - Event classification, dedup, or state sync.
|
|
29
|
+
* - Retry-on-session-invalid (that policy is above the wire).
|
|
30
|
+
*
|
|
31
|
+
* ## Why untyped `request(method, params)`
|
|
32
|
+
*
|
|
33
|
+
* The adapter and shim above must be transport-agnostic. By keeping the
|
|
34
|
+
* request surface a plain string-keyed call, the same adapter code can
|
|
35
|
+
* run against a future gRPC or QUIC transport without leaking protocol
|
|
36
|
+
* detail. MCP-specific encodings (tool calls, list_tools, etc.) are
|
|
37
|
+
* translated inside `McpTransport`, not exposed here.
|
|
38
|
+
*
|
|
39
|
+
* The trade-off: type safety on the wire is the transport's problem.
|
|
40
|
+
* Callers (the adapter) validate response shapes at the L7 seam.
|
|
41
|
+
*/
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/wire/transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apnex/network-adapter",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Universal MCP Network Adapter — L4/L7 transport for OIS agentic network",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"dev": "tsc --watch",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"test:watch": "vitest"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
20
|
+
"@apnex/cognitive-layer": "*",
|
|
21
|
+
"@apnex/message-router": "*"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/express": "^5.0.6",
|
|
25
|
+
"@types/node": "^22.0.0",
|
|
26
|
+
"express": "^5.2.1",
|
|
27
|
+
"tsx": "^4.21.0",
|
|
28
|
+
"typescript": "^5.7.0",
|
|
29
|
+
"vitest": "^4.1.4",
|
|
30
|
+
"zod": "^4.3.6"
|
|
31
|
+
}
|
|
32
|
+
}
|