pi-nocturne-memory 1.0.13 → 1.0.14

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.
@@ -88,6 +88,11 @@ async function callMCP(method: string, params: Record<string, unknown>): Promise
88
88
  body: JSON.stringify({ jsonrpc: "2.0", id: method + Date.now(), method, params }),
89
89
  });
90
90
 
91
+ if (!resp.ok) {
92
+ const body = await resp.text().catch(() => "<unreadable>");
93
+ return { error: { code: resp.status, message: `HTTP ${resp.status}: ${body.slice(0, 200)}` } };
94
+ }
95
+
91
96
  // Check for new session ID in response
92
97
  const newSid = resp.headers.get("mcp-session-id");
93
98
  if (newSid) {
@@ -129,6 +134,9 @@ async function callMCP(method: string, params: Record<string, unknown>): Promise
129
134
  }
130
135
 
131
136
  function extractText(data: any): string {
137
+ if (data?.error) {
138
+ return `Error: ${data.error.message ?? JSON.stringify(data.error)}`;
139
+ }
132
140
  return data?.result?.content?.[0]?.text ?? "";
133
141
  }
134
142
 
@@ -191,7 +199,8 @@ export default function (pi: ExtensionAPI): void {
191
199
 
192
200
  async execute(_toolCallId, params) {
193
201
  const data = await callMCP("tools/call", { name: "read_memory", arguments: { uri: params.uri } });
194
- return { content: [{ type: "text", text: extractText(data) || "No content" }] };
202
+ const text = extractText(data);
203
+ return { content: [{ type: "text", text: text || "No content" }] };
195
204
  },
196
205
 
197
206
  renderCall(args, theme) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-nocturne-memory",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Nocturne Memory extension for Pi — automated memory management with SessionStart boot protocol",
5
5
  "license": "MIT",
6
6
  "type": "module",