@bli-cockpit/memory-mcp 0.1.0 → 0.1.1

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/server.d.ts CHANGED
@@ -33,12 +33,17 @@
33
33
  */
34
34
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
35
35
  import { z } from "zod";
36
+ import { type FetchImpl } from "./door.js";
36
37
  import type { MemorySession } from "./session.js";
37
38
  export declare const PACKAGE_NAME = "@bli-cockpit/memory-mcp";
38
- export declare const PACKAGE_VERSION = "0.1.0";
39
- /** The server id an MCP client registers. Named in every install block. */
40
- export declare const SERVER_NAME = "bli-memory";
41
- export type FetchImpl = typeof fetch;
39
+ export declare const PACKAGE_VERSION = "0.1.1";
40
+ /**
41
+ * The server id an MCP client registers. Defined in `print-config.ts` and
42
+ * re-exported here: `index.ts` needs the name on the hook and print-config
43
+ * paths, and importing it from this module would drag the MCP SDK into both.
44
+ */
45
+ export { SERVER_NAME } from "./print-config.js";
46
+ export type { FetchImpl } from "./door.js";
42
47
  export interface ServerDeps {
43
48
  session: MemorySession;
44
49
  fetchImpl: FetchImpl;
package/dist/server.js CHANGED
@@ -34,10 +34,16 @@
34
34
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
35
35
  import { z } from "zod";
36
36
  import { resolveContainerTag } from "./container-tag.js";
37
+ import { postMemoryDoor } from "./door.js";
38
+ import { SERVER_NAME } from "./print-config.js";
37
39
  export const PACKAGE_NAME = "@bli-cockpit/memory-mcp";
38
- export const PACKAGE_VERSION = "0.1.0";
39
- /** The server id an MCP client registers. Named in every install block. */
40
- export const SERVER_NAME = "bli-memory";
40
+ export const PACKAGE_VERSION = "0.1.1";
41
+ /**
42
+ * The server id an MCP client registers. Defined in `print-config.ts` and
43
+ * re-exported here: `index.ts` needs the name on the hook and print-config
44
+ * paths, and importing it from this module would drag the MCP SDK into both.
45
+ */
46
+ export { SERVER_NAME } from "./print-config.js";
41
47
  const READ_ONLY_ANNOTATIONS = {
42
48
  readOnlyHint: true,
43
49
  destructiveHint: false,
@@ -103,43 +109,18 @@ export const forgetMemoryInput = {
103
109
  .optional()
104
110
  .describe("A short label for why, e.g. asked_by_person. Never prose."),
105
111
  };
112
+ /**
113
+ * The four tools' one call site. The transport, the auth header and the
114
+ * transport-vs-refusal distinction live in `door.ts`, shared with the hooks —
115
+ * see that file's header for why.
116
+ */
106
117
  async function callDoor(deps, path, body) {
107
- const url = `${deps.session.dashboardUrl}${path}`;
108
- let response;
109
- try {
110
- response = await deps.fetchImpl(url, {
111
- method: "POST",
112
- headers: {
113
- // The device token. Never logged, never echoed into a message.
114
- authorization: `Bearer ${deps.session.deviceToken}`,
115
- "content-type": "application/json",
116
- accept: "application/json",
117
- },
118
- body: JSON.stringify(body),
119
- });
120
- }
121
- catch (error) {
122
- return {
123
- ok: false,
124
- status: 0,
125
- body: {},
126
- transportError: error instanceof Error ? error.message.split("\n")[0] : String(error),
127
- };
128
- }
129
- let parsed = {};
130
- try {
131
- const text = await response.text();
132
- parsed = text ? JSON.parse(text) : {};
133
- }
134
- catch {
135
- return {
136
- ok: false,
137
- status: response.status,
138
- body: {},
139
- transportError: `Tower answered ${response.status} with a body this server could not read as JSON.`,
140
- };
141
- }
142
- return { ok: response.ok, status: response.status, body: parsed, transportError: null };
118
+ return postMemoryDoor({
119
+ session: deps.session,
120
+ fetchImpl: deps.fetchImpl,
121
+ path,
122
+ body,
123
+ });
143
124
  }
144
125
  function textResult(text, structured) {
145
126
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/memory-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "description": "BLI Memory — an MCP server for the memory layer BLI owns (save, search, update, forget).",
6
6
  "type": "module",
@@ -18,13 +18,17 @@
18
18
  "node": ">=20"
19
19
  },
20
20
  "scripts": {
21
+ "prebuild": "node ../../scripts/build-workspace-dep.mjs @bli-cockpit/telemetry-core",
21
22
  "build": "tsc",
22
- "prepack": "rm -rf dist && tsc",
23
+ "prepack": "node ../../scripts/build-workspace-dep.mjs @bli-cockpit/telemetry-core && rm -rf dist && tsc",
24
+ "pretypecheck": "node ../../scripts/build-workspace-dep.mjs @bli-cockpit/telemetry-core",
23
25
  "typecheck": "tsc --noEmit",
26
+ "pretest": "node ../../scripts/build-workspace-dep.mjs @bli-cockpit/telemetry-core",
24
27
  "test": "vitest run",
25
28
  "start": "node dist/index.js"
26
29
  },
27
30
  "dependencies": {
31
+ "@bli-cockpit/telemetry-core": "0.1.26",
28
32
  "@modelcontextprotocol/sdk": "^1.29.0",
29
33
  "zod": "^4.3.6"
30
34
  },