@essentialai/cogent-bridge 3.1.10 → 3.2.2
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/CHANGELOG.md +60 -0
- package/dist/backend/file-backend.d.ts +2 -2
- package/dist/backend/file-backend.d.ts.map +1 -1
- package/dist/backend/file-backend.js +6 -4
- package/dist/backend/file-backend.js.map +1 -1
- package/dist/backend/http-backend.d.ts +14 -3
- package/dist/backend/http-backend.d.ts.map +1 -1
- package/dist/backend/http-backend.js +59 -5
- package/dist/backend/http-backend.js.map +1 -1
- package/dist/backend/relay-version-cache.d.ts +17 -0
- package/dist/backend/relay-version-cache.d.ts.map +1 -0
- package/dist/backend/relay-version-cache.js +65 -0
- package/dist/backend/relay-version-cache.js.map +1 -0
- package/dist/backend/storage-backend.d.ts +32 -4
- package/dist/backend/storage-backend.d.ts.map +1 -1
- package/dist/services/auto-relay.d.ts +36 -1
- package/dist/services/auto-relay.d.ts.map +1 -1
- package/dist/services/auto-relay.js +65 -2
- package/dist/services/auto-relay.js.map +1 -1
- package/dist/services/health-check.d.ts +8 -1
- package/dist/services/health-check.d.ts.map +1 -1
- package/dist/services/health-check.js +1 -1
- package/dist/services/health-check.js.map +1 -1
- package/dist/services/peer-registry.d.ts +2 -2
- package/dist/services/peer-registry.d.ts.map +1 -1
- package/dist/services/peer-registry.js +38 -4
- package/dist/services/peer-registry.js.map +1 -1
- package/dist/startup.d.ts.map +1 -1
- package/dist/startup.js +7 -4
- package/dist/startup.js.map +1 -1
- package/dist/tools/get-history.d.ts.map +1 -1
- package/dist/tools/get-history.js +26 -2
- package/dist/tools/get-history.js.map +1 -1
- package/dist/tools/health-check.d.ts.map +1 -1
- package/dist/tools/health-check.js +44 -5
- package/dist/tools/health-check.js.map +1 -1
- package/dist/tools/list-peers.d.ts.map +1 -1
- package/dist/tools/list-peers.js +5 -0
- package/dist/tools/list-peers.js.map +1 -1
- package/dist/tools/register-peer.d.ts.map +1 -1
- package/dist/tools/register-peer.js +12 -3
- package/dist/tools/register-peer.js.map +1 -1
- package/dist/tools/send-message.d.ts.map +1 -1
- package/dist/tools/send-message.js +28 -12
- package/dist/tools/send-message.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.2.2] - 2026-05-19
|
|
4
|
+
|
|
5
|
+
Surfaced by ~4-day clone-detector channel observer watch (tick 89 mass re-register event at 2026-05-18T00:30:26Z). Two client-side polish fixes plus a long-deferred marketplace + plugin version sync. No emergency — bridge transport is otherwise operationally fine.
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **FIX-LABEL-PRESERVE: preserve operator-supplied label + mode on auto-reconnect.** `AutoRelayService` now captures `label` and `mode` at `setLocalPeer()` time and surfaces both via `getLocalPeer()`. `triggerReRegistration()` in `src/startup.ts` passes the captured `label` (not `peerId`) and `mode` (not implicit `"agent"`) to `backend.registerPeer()` on auto-reconnect. Pre-3.2.2, the re-register call substituted `peerId` for `label` (silently normalizing `"Cogent_Master"` -> `"cogent-master"` after a WS-cycle mass-reregister) and dropped `mode` (silently flipping observer peers back to agent mode). See `src/services/auto-relay.ts`, `src/tools/register-peer.ts`, `src/startup.ts`.
|
|
9
|
+
- **FIX-WSHEALTH-RECONNECTING: new transient "reconnecting" state on health-check.** `transport.wsHealth` now has a fourth value, `"reconnecting"`, returned when `wsConnected=false` BUT the last frame was received within `COGENT_WS_STALE_MS` (default 90s). Pre-3.2.2 reported `"disconnected"` during the 1-4s window each ~5-20min keepalive cycle takes — alarming on a healthy idle channel. Only sustained socket-down beyond the threshold (or null last-frame) is now reported as `"disconnected"`. See `src/tools/health-check.ts`.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **`AutoRelayService.setLocalPeer()` signature** gained a 5th optional `label?: string` parameter (defaults to `peerId` for back-compat). `getLocalPeer()` return type widened to include `label: string` and `mode: "observer" | "agent"` so re-registration can replay the original registration payload exactly.
|
|
13
|
+
|
|
14
|
+
### Marketplace + manifests
|
|
15
|
+
- **`server.json` bumped 3.1.11 -> 3.2.2.** Top-level `version` + `packages[].version`. Was 4 minor-releases behind the npm package after Phase 17 / Phase 18 light shipped without a marketplace sync — operators installing via the MCP registry could not consume `metadataOnly` history or `dedupInferredEchoes` because the registry advertised pre-feature versions.
|
|
16
|
+
- **`plugin/.claude-plugin/plugin.json` bumped 3.1.8 -> 3.2.2.** Same story for the Claude Code plugin marketplace at `eaisdevelopment/cogent` — was 6 minor-releases behind. Plugin sync will land in the marketplace repo as part of this release deploy.
|
|
17
|
+
|
|
18
|
+
### Internal
|
|
19
|
+
- 5 new tests under `src/services/auto-relay.test.ts` covering label preservation, peerId-fallback for pre-3.2.2 callers, observer-mode preservation, and `stop()` clearing `localLabel`.
|
|
20
|
+
- 2 new tests under `src/tools/health-check.test.ts` covering the new `"reconnecting"` state (recent frame, socket down) and the boundary case where an old frame plus socket-down still resolves to `"disconnected"`.
|
|
21
|
+
- Existing `src/startup.test.ts triggerReRegistration` test updated to assert the new 6-arg `registerPeer` call (peerId, sessionId, cwd, label, clientVersion, mode); added one new test for observer-mode preservation through the re-register path.
|
|
22
|
+
|
|
23
|
+
Observability backstory: `temp/watch/cogent-watch-state.json` ticks 70-94 (4-day continuous watch as cogent-master; mass-reregister event at tick 89 surfaced both the label-strip regression and the wsHealth UX issue).
|
|
24
|
+
|
|
25
|
+
## [3.2.1] - 2026-05-17
|
|
26
|
+
|
|
27
|
+
Surfaced by 51-tick clone-detector channel watch (20 confirmed sender-side 180s timeouts, 9 confirmed untagged-echo phantoms across the session's 899-message history). Neither is a relay drop — both are receipt-side UX bugs that misled the LLM reading the bridge output.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- **FIX-TIMEOUT-UX: cloud-mode send-message timeout result shape.** Both timeout paths (`DELIVERY_NO_ACK` after 15s ack-wait, `RESPONSE_TIMEOUT` after `COGENT_TIMEOUT_MS` response-wait) now return `{success: false, timedOut: true, error: "DELIVERY_NO_ACK" | "RESPONSE_TIMEOUT", message: <stub-text>, response: null, durationMs}` instead of the prior `{success: true, response: <stub-text>}`. The LLM no longer mistakes the bridge's "Delivered to X but no synchronous response within 180s" stub for the recipient's actual reply. The history record's `response` field is also written as `null` on timeout (was the stub text), so later inspection cleanly distinguishes "no reply received" from "real reply received." See `src/tools/send-message.ts`.
|
|
31
|
+
- **FIX-INFERRED-ECHO: server-side dedup of untagged auto-relay echoes (Phase 18 light).** New optional GET param on `/api/sessions/:id/messages` — `dedupInferredEchoes` (default `false`). When `true`, suppresses M[i] when `M[i].message === M[i-1].response`, `M[i].fromPeerId === M[i-1].toPeerId`, `M[i].toPeerId === M[i-1].fromPeerId`, AND `Δt < 120s`. Catches the ~13% of echo records that bypass the `isRelayEcho` tag (peer-driven `cogent_send_message` re-broadcasts after autoRelay's execClaude returns). Opt-in to avoid surprise behavior change. Plumbed through `cogent_get_history` (new `dedupInferredEchoes: boolean` param) → `StorageBackend.getHistory(..., dedupInferredEchoes?)` → `HttpBackend` (sends `?dedupInferredEchoes=true` to server). `FileBackend` ignores the flag (local mode doesn't synthesize untagged echoes). See `server/src/routes/messages.ts`, `src/tools/get-history.ts`, `src/backend/*.ts`.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- **`StorageBackend.updateMessageResponse(messageId, response, durationMs)`** signature: `response: string` → `response: string | null`. Server PATCH route mirrors with `z.string().nullable()`. Lets cloud clients explicitly mark timed-out sends with `null` response (was previously a misleading stub string).
|
|
35
|
+
|
|
36
|
+
### Internal
|
|
37
|
+
- 2 new tests under `src/tools/send-message.test.ts` `describe("cloud-mode timeout result shape (v3.2.1)")` — assert `success:false`, `timedOut:true`, `error: "DELIVERY_NO_ACK" | "RESPONSE_TIMEOUT"`, `response: null`, and that explanatory text lives in `message` not `response`. Spies on `isCloudMode` + `autoRelay.waitForDeliveryAck` / `waitForResponse` to drive the cloud path without booting `HttpBackend`.
|
|
38
|
+
- 5 new tests under `server/src/__tests__/routes/messages.test.ts` `describe("dedupInferredEchoes (FIX-INFERRED-ECHO, 3.2.1)")` — happy-path suppression, default-off backward compat, content-mismatch no-op, direction-mismatch no-op, string `"true"` preprocess coercion.
|
|
39
|
+
|
|
40
|
+
Observability backstory: `.planning/notes/` (`temp/watch/cogent-watch-state.json` raw evidence).
|
|
41
|
+
|
|
42
|
+
## [3.2.0] - 2026-05-12
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
- **Observer-mode peer registration (OBS-01).** `cogent_register_peer` accepts optional `mode: "observer" | "agent"` (default `"agent"`). Observer peers register normally and remain visible/targetable but skip the auto-relay subprocess. See `src/tools/register-peer.ts`, `src/services/auto-relay.ts`.
|
|
46
|
+
- **Observer mode surfaced via list-peers (OBS-02).** `cogent_list_peers` passes through the `mode` field via the existing `PeerInfo` spread. Operators can identify observer peers in the topology before sending. See `src/tools/list-peers.ts`, `src/types.ts`.
|
|
47
|
+
- **Auto-relay observer short-circuit (OBS-03).** `AutoRelayService.handleIncoming` short-circuits AFTER delivery-ack and waiter resolution, BEFORE `_processMessage` — observers ack frames and resolve their own outbound waiters, but never spawn `execClaude`. Extracted as `_shouldSkipAutoRelay()` for Phase 20 presence/DND reuse. See `src/services/auto-relay.ts`.
|
|
48
|
+
- **Metadata-only history schema (HIST-01).** `cogent_get_history` accepts optional `metadataOnly: boolean` (default `false`). Plumbs through `StorageBackend.getHistory(..., metadataOnly?)` to both `FileBackend` (client-side projection) and `HttpBackend` (server-side projection via `?metadataOnly=true` query param). See `src/tools/get-history.ts`, `src/backend/*.ts`.
|
|
49
|
+
- **Metadata-only 7-key projection (HIST-02).** When `metadataOnly: true`, each record is exactly `{id, fromPeerId, toPeerId, timestamp, durationMs, isRelayEcho, success}` — `message` and `response` keys are physically absent (object-literal projection, not delete-on-clone). Measured 94.4% payload reduction for a 30-record window (5.6% ratio vs ≤10% target). See `src/services/peer-registry.ts`, `server/src/routes/messages.ts`.
|
|
50
|
+
- **`transport.relayVersion` on health-check (VER-02).** Cloud mode populates `transport.relayVersion` from a lazy `GET /api/health` fetch behind a 60s module-scoped TTL cache (`src/backend/relay-version-cache.ts`). Relay upgrades become client-visible within 60s without a client restart. Returns `null` on fetch failure (rest of payload intact); key omitted entirely in local mode. See `src/tools/health-check.ts`, `src/backend/http-backend.ts`.
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
- **Hard rename: `serverVersion` → `mcpServerVersion` (VER-01).** Top-level field on `cogent_health_check` renamed without a backward-compat alias. This is the local cogent-bridge npm package version (NOT the upstream relay; the relay's version is now in `transport.relayVersion`). **Breaking by omission:** mixed-version 3.1.x clients reading the old name will see `undefined` — intentional per the coordinated 3.2.0 bump. See `src/services/health-check.ts`, `src/backend/http-backend.ts`, `src/tools/health-check.ts`.
|
|
54
|
+
|
|
55
|
+
### Internal
|
|
56
|
+
- New module `src/backend/relay-version-cache.ts` with injectable `nowFn` clock seam and `__resetCacheForTest()` helper for deterministic TTL tests. Module-scoped `TTL_MS = 60_000` constant.
|
|
57
|
+
- 10 new tests under `src/services/auto-relay.test.ts` `describe("observer mode (OBS-03)")` and 6 new tests under `src/tools/health-check.test.ts` `describe("version field hygiene (VER-01 / VER-02)")`.
|
|
58
|
+
- 4 new tests under `src/tools/get-history.test.ts` `describe("metadataOnly (HIST-02)")` including a backend-layer size-ratio assertion (`≤0.10`).
|
|
59
|
+
- 5 new tests under `src/backend/relay-version-cache.test.ts` covering cold fetch, warm fetch, TTL expiry, fetch-error no-cache, and malformed-payload no-cache.
|
|
60
|
+
|
|
61
|
+
Planning: `.planning/phases/17-observer-mode-and-history-hygiene/`
|
|
62
|
+
|
|
3
63
|
## [3.1.5] - 2026-05-05
|
|
4
64
|
|
|
5
65
|
### Fixed
|
|
@@ -8,13 +8,13 @@ import { StorageBackend } from "./storage-backend.js";
|
|
|
8
8
|
* cc-cli.ts, and health-check.ts. No added logic, logging, or transformation.
|
|
9
9
|
*/
|
|
10
10
|
export declare class FileBackend implements StorageBackend {
|
|
11
|
-
registerPeer(peerId: string, sessionId: string, cwd: string, label: string, clientVersion?: string): Promise<PeerInfo>;
|
|
11
|
+
registerPeer(peerId: string, sessionId: string, cwd: string, label: string, clientVersion?: string, mode?: "observer" | "agent"): Promise<PeerInfo>;
|
|
12
12
|
deregisterPeer(peerId: string): Promise<boolean>;
|
|
13
13
|
getPeer(peerId: string): Promise<PeerInfo | undefined>;
|
|
14
14
|
listPeers(): Promise<PeerInfo[]>;
|
|
15
15
|
updateLastSeen(peerId: string): Promise<void>;
|
|
16
16
|
recordMessage(record: Omit<MessageRecord, "id" | "timestamp">): Promise<MessageRecord>;
|
|
17
|
-
getHistory(peerId?: string, limit?: number): Promise<MessageRecord[]>;
|
|
17
|
+
getHistory(peerId?: string, limit?: number, includeRelayEchoes?: boolean, metadataOnly?: boolean, _dedupInferredEchoes?: boolean): Promise<MessageRecord[]>;
|
|
18
18
|
validateSession(sessionId: string, cwd: string): Promise<boolean>;
|
|
19
19
|
execClaude(sessionId: string, message: string, cwd: string, timeoutMs?: number): Promise<CliExecResult>;
|
|
20
20
|
checkHealth(): Promise<HealthCheckResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-backend.d.ts","sourceRoot":"","sources":["../../src/backend/file-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD;;;;;GAKG;AACH,qBAAa,WAAY,YAAW,cAAc;IAGhD,YAAY,CACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,aAA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S,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC;IAMzB,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAG1C"}
|
|
@@ -9,8 +9,8 @@ import * as health from "../services/health-check.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export class FileBackend {
|
|
11
11
|
// --- Peer management ---
|
|
12
|
-
registerPeer(peerId, sessionId, cwd, label, clientVersion) {
|
|
13
|
-
return registry.registerPeer(peerId, sessionId, cwd, label, clientVersion);
|
|
12
|
+
registerPeer(peerId, sessionId, cwd, label, clientVersion, mode) {
|
|
13
|
+
return registry.registerPeer(peerId, sessionId, cwd, label, clientVersion, mode);
|
|
14
14
|
}
|
|
15
15
|
deregisterPeer(peerId) {
|
|
16
16
|
return registry.deregisterPeer(peerId);
|
|
@@ -28,8 +28,10 @@ export class FileBackend {
|
|
|
28
28
|
recordMessage(record) {
|
|
29
29
|
return registry.recordMessage(record);
|
|
30
30
|
}
|
|
31
|
-
getHistory(peerId, limit) {
|
|
32
|
-
|
|
31
|
+
getHistory(peerId, limit, includeRelayEchoes, metadataOnly, _dedupInferredEchoes) {
|
|
32
|
+
// Local FileBackend doesn't synthesize untagged echoes (no autoRelay
|
|
33
|
+
// re-broadcast pattern), so dedupInferredEchoes is a no-op here.
|
|
34
|
+
return registry.getHistory(peerId, limit, includeRelayEchoes, metadataOnly);
|
|
33
35
|
}
|
|
34
36
|
// --- Message relay ---
|
|
35
37
|
validateSession(sessionId, cwd) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-backend.js","sourceRoot":"","sources":["../../src/backend/file-backend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEt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,CAAC,CAAC;IAC9E,CAAC;IAED,wBAAwB;IAExB,eAAe,CAAC,SAAiB,EAAE,GAAW;QAC5C,OAAO,GAAG,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED,UAAU,CACR,SAAiB,EACjB,OAAe,EACf,GAAW,EACX,SAAkB;QAElB,OAAO,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED,iBAAiB;IAEjB,WAAW;QACT,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -26,7 +26,7 @@ export declare class HttpBackend implements StorageBackend {
|
|
|
26
26
|
* The sessionId parameter from StorageBackend is the local CC sessionId;
|
|
27
27
|
* in cloud mode we ignore it and use this.sessionId (the cloud session).
|
|
28
28
|
*/
|
|
29
|
-
registerPeer(peerId: string, _sessionId: string, cwd: string, label: string, clientVersion?: string): Promise<PeerInfo>;
|
|
29
|
+
registerPeer(peerId: string, _sessionId: string, cwd: string, label: string, clientVersion?: string, mode?: "observer" | "agent"): Promise<PeerInfo>;
|
|
30
30
|
/**
|
|
31
31
|
* Deregister a peer from the cloud session.
|
|
32
32
|
* DELETE /api/sessions/:sessionId/peers/:peerId
|
|
@@ -65,7 +65,7 @@ export declare class HttpBackend implements StorageBackend {
|
|
|
65
65
|
*
|
|
66
66
|
* Supports optional peerId filter and limit (default 300).
|
|
67
67
|
*/
|
|
68
|
-
getHistory(peerId?: string, limit?: number): Promise<MessageRecord[]>;
|
|
68
|
+
getHistory(peerId?: string, limit?: number, includeRelayEchoes?: boolean, metadataOnly?: boolean, dedupInferredEchoes?: boolean): Promise<MessageRecord[]>;
|
|
69
69
|
/**
|
|
70
70
|
* Update an existing message record's response field on the server.
|
|
71
71
|
* PATCH /api/sessions/:sessionId/messages/:messageId
|
|
@@ -73,7 +73,7 @@ export declare class HttpBackend implements StorageBackend {
|
|
|
73
73
|
* Called by send-message after receiving the async cloud response,
|
|
74
74
|
* so that get-history shows the actual response (not null).
|
|
75
75
|
*/
|
|
76
|
-
updateMessageResponse(messageId: string, response: string, durationMs: number): Promise<void>;
|
|
76
|
+
updateMessageResponse(messageId: string, response: string | null, durationMs: number): Promise<void>;
|
|
77
77
|
/**
|
|
78
78
|
* Validate a session.
|
|
79
79
|
* In cloud mode, the server validates session authenticity on every
|
|
@@ -97,5 +97,16 @@ export declare class HttpBackend implements StorageBackend {
|
|
|
97
97
|
* format with cloud-mode-specific diagnostics.
|
|
98
98
|
*/
|
|
99
99
|
checkHealth(): Promise<HealthCheckResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Lazy lookup of the upstream relay's `version` field via GET /api/health,
|
|
102
|
+
* memoized for 60s. Returns null on fetch failure or malformed payload.
|
|
103
|
+
* Never throws — the caller (health-check tool) treats null as "unknown"
|
|
104
|
+
* and keeps the rest of the response intact.
|
|
105
|
+
*
|
|
106
|
+
* Delegates to the module-scoped cache in `relay-version-cache.ts` so the
|
|
107
|
+
* TTL is shared across all callers and tests can reset state via
|
|
108
|
+
* `__resetCacheForTest()`. VER-02 (3.2).
|
|
109
|
+
*/
|
|
110
|
+
getRelayVersion(): Promise<string | null>;
|
|
100
111
|
}
|
|
101
112
|
//# sourceMappingURL=http-backend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-backend.d.ts","sourceRoot":"","sources":["../../src/backend/http-backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"http-backend.d.ts","sourceR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,EAAE,MAAM,EACd,kBAAkB,CAAC,EAAE,OAAO,EAC5B,YAAY,CAAC,EAAE,OAAO,EACtB,mBAAmB,CAAC,EAAE,OAAO,GAC5B,OAAO,CAAC,aAAa,EAAE,CAAC;IAmC3B;;;;;;OAMG;IACG,qBAAqB,CACzB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;OAIG;IACG,eAAe,CACnB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC;IAInB;;;;;;;OAOG;IACG,UAAU,CACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,CAAC;IAQzB;;;;;;OAMG;IACG,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAyC/C;;;;;;;;;OASG;IACG,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAGhD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SERVER_VERSION } from "../constants.js";
|
|
2
|
+
import { getRelayVersion } from "./relay-version-cache.js";
|
|
2
3
|
/**
|
|
3
4
|
* API path patterns matching @essentialai/cogent PATHS constants.
|
|
4
5
|
* Defined locally because cogent is not a dependency of the main package.
|
|
@@ -38,7 +39,7 @@ export class HttpBackend {
|
|
|
38
39
|
* The sessionId parameter from StorageBackend is the local CC sessionId;
|
|
39
40
|
* in cloud mode we ignore it and use this.sessionId (the cloud session).
|
|
40
41
|
*/
|
|
41
|
-
async registerPeer(peerId, _sessionId, cwd, label, clientVersion) {
|
|
42
|
+
async registerPeer(peerId, _sessionId, cwd, label, clientVersion, mode) {
|
|
42
43
|
const path = PATHS.peers.replace(":sessionId", this.sessionId);
|
|
43
44
|
// Build body conditionally: omit clientVersion entirely for older clients
|
|
44
45
|
// / undefined inputs so the wire payload stays clean (no JSON null) and
|
|
@@ -54,6 +55,14 @@ export class HttpBackend {
|
|
|
54
55
|
if (clientVersion !== undefined) {
|
|
55
56
|
body.clientVersion = clientVersion;
|
|
56
57
|
}
|
|
58
|
+
// Same omit-when-undefined pattern for the 3.2.0 mode field (Phase 17
|
|
59
|
+
// OBS-01). Older servers that don't know the field will ignore it (it
|
|
60
|
+
// arrives via the .strict() body schema, so a pre-3.2.0 server WOULD
|
|
61
|
+
// reject the request — guarded by the optional field on the server
|
|
62
|
+
// mirror being shipped in lockstep with the client).
|
|
63
|
+
if (mode !== undefined) {
|
|
64
|
+
body.mode = mode;
|
|
65
|
+
}
|
|
57
66
|
return this.http.post(path, body);
|
|
58
67
|
}
|
|
59
68
|
/**
|
|
@@ -111,11 +120,19 @@ export class HttpBackend {
|
|
|
111
120
|
*/
|
|
112
121
|
async recordMessage(record) {
|
|
113
122
|
const path = PATHS.messages.replace(":sessionId", this.sessionId);
|
|
114
|
-
|
|
123
|
+
// Build body conditionally: only forward isRelayEcho when explicitly true,
|
|
124
|
+
// so the wire payload stays minimal and older servers (pre-3.1.6) that
|
|
125
|
+
// don't know the field simply ignore an absent flag. Setting an
|
|
126
|
+
// explicit `false` is unnecessary -- the server treats absent as false.
|
|
127
|
+
const body = {
|
|
115
128
|
fromPeerId: record.fromPeerId,
|
|
116
129
|
toPeerId: record.toPeerId,
|
|
117
130
|
message: record.message,
|
|
118
|
-
}
|
|
131
|
+
};
|
|
132
|
+
if (record.isRelayEcho === true) {
|
|
133
|
+
body.isRelayEcho = true;
|
|
134
|
+
}
|
|
135
|
+
const resp = await this.http.post(path, body);
|
|
119
136
|
return {
|
|
120
137
|
...record,
|
|
121
138
|
id: resp.id,
|
|
@@ -128,13 +145,33 @@ export class HttpBackend {
|
|
|
128
145
|
*
|
|
129
146
|
* Supports optional peerId filter and limit (default 300).
|
|
130
147
|
*/
|
|
131
|
-
async getHistory(peerId, limit) {
|
|
148
|
+
async getHistory(peerId, limit, includeRelayEchoes, metadataOnly, dedupInferredEchoes) {
|
|
132
149
|
const path = PATHS.messages.replace(":sessionId", this.sessionId);
|
|
133
150
|
const query = {};
|
|
134
151
|
if (peerId) {
|
|
135
152
|
query.peerId = peerId;
|
|
136
153
|
}
|
|
137
154
|
query.limit = String(limit ?? 300);
|
|
155
|
+
// Only attach when truthy: server defaults to filtering, and omitting
|
|
156
|
+
// the param keeps the wire payload minimal + leaves older servers
|
|
157
|
+
// (pre-3.1.6) untouched -- they ignore unknown query keys (.strict()
|
|
158
|
+
// is on the JSON body, not the query schema on those builds).
|
|
159
|
+
if (includeRelayEchoes) {
|
|
160
|
+
query.includeRelayEchoes = "true";
|
|
161
|
+
}
|
|
162
|
+
// HIST-02 (3.2): server projects the 7-key shape when this is set.
|
|
163
|
+
// Same omit-when-falsy pattern — pre-3.2 servers ignore the unknown
|
|
164
|
+
// key and return full records, so client-side parsers must not assume
|
|
165
|
+
// the projection is enforced.
|
|
166
|
+
if (metadataOnly) {
|
|
167
|
+
query.metadataOnly = "true";
|
|
168
|
+
}
|
|
169
|
+
// FIX-INFERRED-ECHO (3.2.1): server filters untagged auto-relay echoes
|
|
170
|
+
// via content-and-direction heuristic when this is set. Older servers
|
|
171
|
+
// (pre-3.2.1) ignore the unknown key.
|
|
172
|
+
if (dedupInferredEchoes) {
|
|
173
|
+
query.dedupInferredEchoes = "true";
|
|
174
|
+
}
|
|
138
175
|
const result = await this.http.get(path, query);
|
|
139
176
|
return result.messages;
|
|
140
177
|
}
|
|
@@ -185,7 +222,11 @@ export class HttpBackend {
|
|
|
185
222
|
const resp = await this.http.get(PATHS.health);
|
|
186
223
|
return {
|
|
187
224
|
healthy: resp.status === "ok",
|
|
188
|
-
|
|
225
|
+
// VER-01 (3.2): the SERVER_VERSION constant still identifies the local
|
|
226
|
+
// cogent-bridge npm package — this property name makes its role
|
|
227
|
+
// unambiguous now that transport.relayVersion carries the upstream
|
|
228
|
+
// relay's version. Hard rename, no backward-compat alias.
|
|
229
|
+
mcpServerVersion: SERVER_VERSION,
|
|
189
230
|
statePath: "cloud:" + this.sessionId,
|
|
190
231
|
claudePath: "N/A (cloud mode)",
|
|
191
232
|
checks: {
|
|
@@ -210,5 +251,18 @@ export class HttpBackend {
|
|
|
210
251
|
serverUptime: resp.uptime,
|
|
211
252
|
};
|
|
212
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Lazy lookup of the upstream relay's `version` field via GET /api/health,
|
|
256
|
+
* memoized for 60s. Returns null on fetch failure or malformed payload.
|
|
257
|
+
* Never throws — the caller (health-check tool) treats null as "unknown"
|
|
258
|
+
* and keeps the rest of the response intact.
|
|
259
|
+
*
|
|
260
|
+
* Delegates to the module-scoped cache in `relay-version-cache.ts` so the
|
|
261
|
+
* TTL is shared across all callers and tests can reset state via
|
|
262
|
+
* `__resetCacheForTest()`. VER-02 (3.2).
|
|
263
|
+
*/
|
|
264
|
+
async getRelayVersion() {
|
|
265
|
+
return getRelayVersion(this.http);
|
|
266
|
+
}
|
|
213
267
|
}
|
|
214
268
|
//# sourceMappingURL=http-backend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-backend.js","sourceRoot":"","sources":["../../src/backend/http-backend.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"http-backend.js","sourceRoot":"","sources":["../../src/backend/http-backend.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;GAGG;AACH,MAAM,KAAK,GAAG;IACZ,KAAK,EAAE,gCAAgC;IACvC,IAAI,EAAE,wCAAwC;IAC9C,QAAQ,EAAE,mCAAmC;IAC7C,OAAO,EAAE,8CAA8C;IACvD,SAAS,EAAE,oCAAoC;IAC/C,MAAM,EAAE,aAAa;CAC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;gBACD,SAAS,EAAE;oBACT,EAAE,EAAE,IAAI;oBACR,OAAO,EAAE,6BAA6B;iBACvC;aACF;YACD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,IAAI,EAAE,OAAO;YACb,YAAY,EAAE,IAAI,CAAC,MAAM;YACzB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,YAAY,EAAE,IAAI,CAAC,MAAM;SAC1B,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HttpClient } from "../cloud/http-client.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get the relay's version, using a 60s TTL cache. Returns null on fetch
|
|
4
|
+
* failure or malformed response. Does not throw.
|
|
5
|
+
*
|
|
6
|
+
* @param http Authenticated HttpClient (typically `HttpBackend.http`).
|
|
7
|
+
* @param nowFn Override for `Date.now()` (test seam). Defaults to `Date.now`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getRelayVersion(http: HttpClient, nowFn?: () => number): Promise<string | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Test-only helper to clear the module-scoped cache. Call from beforeEach
|
|
12
|
+
* in test suites that exercise the cache.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function __resetCacheForTest(): void;
|
|
17
|
+
//# sourceMappingURL=relay-version-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-version-cache.d.ts","sourceRoot":"","sources":["../../src/backend/relay-version-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAmC1D;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,UAAU,EAChB,KAAK,GAAE,MAAM,MAAiB,GAC7B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyBxB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { logger } from "../logger.js";
|
|
2
|
+
/**
|
|
3
|
+
* Module-scoped cache for the relay's `version` field (from GET /api/health).
|
|
4
|
+
*
|
|
5
|
+
* Rationale (VER-02, plan 17-03):
|
|
6
|
+
* - Operators need to see "is my relay current?" at a glance via cogent_health_check.
|
|
7
|
+
* - A hot-path HTTP call on every health_check is too expensive.
|
|
8
|
+
* - A 60s TTL bounds staleness: relay upgrades become visible to the client
|
|
9
|
+
* within 60s without a client restart, but the fetch is amortized across
|
|
10
|
+
* N calls within the window.
|
|
11
|
+
*
|
|
12
|
+
* Failure semantics:
|
|
13
|
+
* - On HTTP error: return null, DO NOT cache. Next call retries.
|
|
14
|
+
* - On malformed payload (no `version` string): return null, DO NOT cache.
|
|
15
|
+
* - Caller (health-check tool) treats null as "unknown" — does NOT propagate
|
|
16
|
+
* the fetch failure upward; the rest of the health_check response is intact.
|
|
17
|
+
*
|
|
18
|
+
* Test seam:
|
|
19
|
+
* - `nowFn` parameter (default `Date.now`) lets tests advance the clock
|
|
20
|
+
* deterministically without coupling to vitest fake-timer state shared
|
|
21
|
+
* across other suites.
|
|
22
|
+
* - `__resetCacheForTest()` clears module state between tests.
|
|
23
|
+
*/
|
|
24
|
+
const TTL_MS = 60_000;
|
|
25
|
+
let cached = null;
|
|
26
|
+
/**
|
|
27
|
+
* Get the relay's version, using a 60s TTL cache. Returns null on fetch
|
|
28
|
+
* failure or malformed response. Does not throw.
|
|
29
|
+
*
|
|
30
|
+
* @param http Authenticated HttpClient (typically `HttpBackend.http`).
|
|
31
|
+
* @param nowFn Override for `Date.now()` (test seam). Defaults to `Date.now`.
|
|
32
|
+
*/
|
|
33
|
+
export async function getRelayVersion(http, nowFn = Date.now) {
|
|
34
|
+
const now = nowFn();
|
|
35
|
+
if (cached !== null && now - cached.fetchedAt < TTL_MS) {
|
|
36
|
+
return cached.version;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const resp = await http.get("/api/health");
|
|
40
|
+
const version = resp?.version;
|
|
41
|
+
if (typeof version !== "string" || version.length === 0) {
|
|
42
|
+
// Malformed response shape — treat as fetch failure. Do not cache.
|
|
43
|
+
logger.debug(`relay-version-cache: /api/health response missing string 'version' field`);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
cached = { version, fetchedAt: now };
|
|
47
|
+
return version;
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
51
|
+
logger.debug(`relay-version-cache: /api/health fetch failed: ${msg}`);
|
|
52
|
+
// Do NOT update `cached` — next call retries.
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Test-only helper to clear the module-scoped cache. Call from beforeEach
|
|
58
|
+
* in test suites that exercise the cache.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export function __resetCacheForTest() {
|
|
63
|
+
cached = null;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=relay-version-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-version-cache.js","sourceRoot":"","sources":["../../src/backend/relay-version-cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,GAAG,MAAM,CAAC;AAOtB,IAAI,MAAM,GAAsB,IAAI,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAgB,EAChB,QAAsB,IAAI,CAAC,GAAG;IAE9B,MAAM,GAAG,GAAG,KAAK,EAAE,CAAC;IAEpB,IAAI,MAAM,KAAK,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,EAAE,CAAC;QACvD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAwB,aAAa,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,IAAI,EAAE,OAAO,CAAC;QAC9B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxD,mEAAmE;YACnE,MAAM,CAAC,KAAK,CACV,0EAA0E,CAC3E,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;QACrC,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,kDAAkD,GAAG,EAAE,CAAC,CAAC;QACtE,8CAA8C;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -10,17 +10,45 @@ import { HealthCheckResult } from "../services/health-check.js";
|
|
|
10
10
|
export interface StorageBackend {
|
|
11
11
|
registerPeer(peerId: string, sessionId: string, cwd: string, label: string,
|
|
12
12
|
/** cogent-bridge client version sent by the registering process (3.1.6+). */
|
|
13
|
-
clientVersion?: string
|
|
13
|
+
clientVersion?: string,
|
|
14
|
+
/** Observer peers receive frames but never auto-respond, added in 3.2 (Phase 17 OBS-01). */
|
|
15
|
+
mode?: "observer" | "agent"): Promise<PeerInfo>;
|
|
14
16
|
deregisterPeer(peerId: string): Promise<boolean>;
|
|
15
17
|
getPeer(peerId: string): Promise<PeerInfo | undefined>;
|
|
16
18
|
listPeers(): Promise<PeerInfo[]>;
|
|
17
19
|
updateLastSeen(peerId: string): Promise<void>;
|
|
18
20
|
recordMessage(record: Omit<MessageRecord, "id" | "timestamp">): Promise<MessageRecord>;
|
|
19
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Retrieve message history.
|
|
23
|
+
*
|
|
24
|
+
* @param includeRelayEchoes When true, includes auto-relay echo records
|
|
25
|
+
* (FE->BE response mirrors). Defaults to false in implementations -- the
|
|
26
|
+
* common case is a "clean" history with one record per directed exchange.
|
|
27
|
+
* Added in 3.1.11 (260511-o3p).
|
|
28
|
+
* @param metadataOnly When true, records are returned with body fields
|
|
29
|
+
* (message, response) omitted — only id, fromPeerId, toPeerId, timestamp,
|
|
30
|
+
* durationMs, isRelayEcho, success kept. Added in 3.2 (HIST-02).
|
|
31
|
+
* @param dedupInferredEchoes When true, suppress untagged auto-relay echoes
|
|
32
|
+
* via content-and-direction heuristic. Cloud-backend-only; FileBackend
|
|
33
|
+
* ignores the flag. Added in 3.2.1 (FIX-INFERRED-ECHO).
|
|
34
|
+
*/
|
|
35
|
+
getHistory(peerId?: string, limit?: number, includeRelayEchoes?: boolean, metadataOnly?: boolean, dedupInferredEchoes?: boolean): Promise<MessageRecord[]>;
|
|
20
36
|
validateSession(sessionId: string, cwd: string): Promise<boolean>;
|
|
21
37
|
execClaude(sessionId: string, message: string, cwd: string, timeoutMs?: number): Promise<CliExecResult>;
|
|
22
|
-
/**
|
|
23
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Update an existing message record's response field. Optional -- only
|
|
40
|
+
* HttpBackend implements this. Pass `null` to mark a timed-out send so
|
|
41
|
+
* the record's response is not mistaken for the recipient's actual reply
|
|
42
|
+
* (v3.2.1, FIX-TIMEOUT-UX).
|
|
43
|
+
*/
|
|
44
|
+
updateMessageResponse?(messageId: string, response: string | null, durationMs: number): Promise<void>;
|
|
24
45
|
checkHealth(): Promise<HealthCheckResult>;
|
|
46
|
+
/**
|
|
47
|
+
* Lazy lookup of the upstream relay's `version` field, memoized for 60s
|
|
48
|
+
* by the implementing backend. Returns null in local mode or on fetch
|
|
49
|
+
* failure. Optional — only HttpBackend implements this; FileBackend omits.
|
|
50
|
+
* Added in 3.2 (VER-02). Consumers must use optional chaining.
|
|
51
|
+
*/
|
|
52
|
+
getRelayVersion?(): Promise<string | null>;
|
|
25
53
|
}
|
|
26
54
|
//# sourceMappingURL=storage-backend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-backend.d.ts","sourceRoot":"","sources":["../../src/backend/storage-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAE7B,YAAY,CACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM;IACb,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"storage-backend.d.ts","sourceRoot":"","sources":["../../src/backend/storage-backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAE7B,YAAY,CACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM;IACb,6EAA6E;IAC7E,aAAa,CAAC,EAA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,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC5C"}
|
|
@@ -3,6 +3,27 @@ export declare class AutoRelayService {
|
|
|
3
3
|
private localPeerId;
|
|
4
4
|
private localSessionId;
|
|
5
5
|
private localCwd;
|
|
6
|
+
/**
|
|
7
|
+
* Peer participation mode (3.2.0, Phase 17 OBS-03).
|
|
8
|
+
* - "agent" (default): full auto-relay — inbound directed messages run
|
|
9
|
+
* through delivery-ack + queueing + execClaude.
|
|
10
|
+
* - "observer": short-circuit before delivery-ack and processing; the peer
|
|
11
|
+
* is a passive watcher. Set by `setLocalPeer()` from the register-peer
|
|
12
|
+
* tool when the operator passes `mode: "observer"`.
|
|
13
|
+
*
|
|
14
|
+
* Phase 20 will OR additional conditions (presence/DND/AFK) into the
|
|
15
|
+
* short-circuit check via the `_shouldSkipAutoRelay()` helper.
|
|
16
|
+
*/
|
|
17
|
+
private localMode;
|
|
18
|
+
/**
|
|
19
|
+
* Human-readable label captured at register-peer time. Preserved here so
|
|
20
|
+
* triggerReRegistration() (startup.ts) can pass the original label on
|
|
21
|
+
* auto-reconnect after a server eviction or WS cycle, instead of falling
|
|
22
|
+
* back to the peerId. Closes the v3.2.1 label-normalization regression
|
|
23
|
+
* where 'Cogent_Master' silently became 'cogent-master' after the first
|
|
24
|
+
* mass-reregister event.
|
|
25
|
+
*/
|
|
26
|
+
private localLabel;
|
|
6
27
|
private processing;
|
|
7
28
|
private queue;
|
|
8
29
|
private expectingResponseFrom;
|
|
@@ -13,7 +34,18 @@ export declare class AutoRelayService {
|
|
|
13
34
|
* Set the local peer info. Called from register-peer tool after
|
|
14
35
|
* successful registration so we know which session to inject into.
|
|
15
36
|
*/
|
|
16
|
-
setLocalPeer(peerId: string, sessionId: string, cwd: string): void;
|
|
37
|
+
setLocalPeer(peerId: string, sessionId: string, cwd: string, mode?: "observer" | "agent", label?: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Internal predicate: should auto-relay short-circuit BEFORE delivery-ack,
|
|
40
|
+
* BEFORE waiter resolution, and BEFORE _processMessage spawns execClaude?
|
|
41
|
+
*
|
|
42
|
+
* Extracted as a method so Phase 20 (presence/DND/AFK) can OR additional
|
|
43
|
+
* conditions in here without rewriting handleIncoming. The short-circuit
|
|
44
|
+
* site is upstream of delivery-ack on purpose: observers are passive — the
|
|
45
|
+
* sender should not believe the message was "delivered to an agent that
|
|
46
|
+
* will act on it". (STATE.md blocker for Phase 20 reusability.)
|
|
47
|
+
*/
|
|
48
|
+
private _shouldSkipAutoRelay;
|
|
17
49
|
/**
|
|
18
50
|
* Get the local peer info for re-registration after eviction.
|
|
19
51
|
* Returns null if no peer has been registered yet.
|
|
@@ -22,6 +54,8 @@ export declare class AutoRelayService {
|
|
|
22
54
|
peerId: string;
|
|
23
55
|
sessionId: string;
|
|
24
56
|
cwd: string;
|
|
57
|
+
label: string;
|
|
58
|
+
mode: "observer" | "agent";
|
|
25
59
|
} | null;
|
|
26
60
|
/**
|
|
27
61
|
* Re-detect the current CC session from disk. If the session has rotated
|
|
@@ -127,6 +161,7 @@ export declare class AutoRelayService {
|
|
|
127
161
|
getDiagnostics(): {
|
|
128
162
|
registered: boolean;
|
|
129
163
|
localPeerId: string | null;
|
|
164
|
+
mode: "observer" | "agent";
|
|
130
165
|
processing: boolean;
|
|
131
166
|
queueLength: number;
|
|
132
167
|
expectingResponseFrom: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-relay.d.ts","sourceRoot":"","sources":["../../src/services/auto-relay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAqD5C,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,qBAAqB,CAA0B;IA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