@bli-cockpit/mcp 0.1.71 → 0.1.73

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.
@@ -2,6 +2,12 @@
2
2
  * One call to `/api/docs/**` or `/api/msg/**` with this machine's device
3
3
  * token (BLI-3706). Deadline-bounded; a transport failure and a door refusal
4
4
  * are kept apart, same rule as `packages/cockpit-memory-mcp/src/door.ts`.
5
+ *
6
+ * BLI-10746: a successful write here invalidates the CLI's own read cache
7
+ * for the same surface (`@bli-cockpit/telemetry-core`'s `./node-read-cache`)
8
+ * — "any write through the CLI or MCP invalidates the affected cache" holds
9
+ * because both talk to the identical on-disk cache directory on the same
10
+ * machine, and neither depends on the other package to say so.
5
11
  */
6
12
  import type { AgentDoorSession } from "./agent-door-session.js";
7
13
  export type FetchImpl = typeof fetch;
@@ -2,7 +2,16 @@
2
2
  * One call to `/api/docs/**` or `/api/msg/**` with this machine's device
3
3
  * token (BLI-3706). Deadline-bounded; a transport failure and a door refusal
4
4
  * are kept apart, same rule as `packages/cockpit-memory-mcp/src/door.ts`.
5
+ *
6
+ * BLI-10746: a successful write here invalidates the CLI's own read cache
7
+ * for the same surface (`@bli-cockpit/telemetry-core`'s `./node-read-cache`)
8
+ * — "any write through the CLI or MCP invalidates the affected cache" holds
9
+ * because both talk to the identical on-disk cache directory on the same
10
+ * machine, and neither depends on the other package to say so.
5
11
  */
12
+ import os from "node:os";
13
+ import { getUserLocalCockpitPaths } from "@bli-cockpit/telemetry-core";
14
+ import { invalidateReadCacheSurface, readCacheSurfaceForPath, } from "@bli-cockpit/telemetry-core/node-read-cache";
6
15
  /**
7
16
  * How long a door gets before this server gives up on it (BLI-10432).
8
17
  *
@@ -67,5 +76,12 @@ export async function callAgentDoor(session, fetchImpl, method, path, body, time
67
76
  transportError: `Tower answered ${response.status} with a body this server could not read as JSON.`,
68
77
  };
69
78
  }
79
+ if (method !== "GET" && response.ok) {
80
+ const surface = readCacheSurfaceForPath(path);
81
+ if (surface) {
82
+ const stateDir = getUserLocalCockpitPaths(os.homedir()).state_dir;
83
+ invalidateReadCacheSurface(stateDir, session.deviceToken, surface);
84
+ }
85
+ }
70
86
  return { ok: response.ok, status: response.status, body: parsed, transportError: null };
71
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/mcp",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "private": false,
5
5
  "description": "bli-tower: an MCP server over BLI Cockpit's agent doors: JARVIS (jarvis_*), documents (docs_*), channels (msg_*), issues (work_*), the daily page (brief_*), meeting notes (notes_*), the ops board (ops_status/slack_*), settings/team/model, Scout and the workbook, plus the legacy event-stream tools (emit_event, get_ticket_timeline, get_active_tickets).",
6
6
  "type": "module",
@@ -30,7 +30,7 @@
30
30
  "readme": "npm run build && node scripts/write-readme-census.mjs"
31
31
  },
32
32
  "dependencies": {
33
- "@bli-cockpit/telemetry-core": "0.1.49",
33
+ "@bli-cockpit/telemetry-core": "0.1.51",
34
34
  "@modelcontextprotocol/sdk": "^1.29.0",
35
35
  "zod": "^4.3.6"
36
36
  },