minutes-mcp 0.33.0 → 0.33.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/dist/corpus-lease-worker.js +18 -8
- package/dist/corpus-lease.d.ts +14 -2
- package/dist/corpus-lease.js +93 -8
- package/dist/index.js +10 -4
- package/dist/node-child.js +6 -2
- package/package.json +2 -2
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import { writeSync } from "node:fs";
|
|
1
2
|
import { createInterface } from "node:readline";
|
|
2
|
-
import { markCorpusLeaseWorkerProcess, runCorpusLeaseWorkerRequest, } from "./corpus-lease.js";
|
|
3
|
+
import { corpusDenialReason, validateCorpusDenialReason, markCorpusLeaseWorkerProcess, runCorpusLeaseWorkerRequest, } from "./corpus-lease.js";
|
|
3
4
|
import { retireBoundReadersForProcessShutdown } from "./secure-read.js";
|
|
4
5
|
// Content is sent in 64 KiB raw chunks, so every control line stays far below
|
|
5
6
|
// this fixed ceiling and never scales with the full corpus size.
|
|
6
7
|
const MAX_CONTROL_LINE_BYTES = 512 * 1024;
|
|
7
8
|
markCorpusLeaseWorkerProcess();
|
|
8
|
-
function fail() {
|
|
9
|
+
function fail(reason = "internal") {
|
|
10
|
+
try {
|
|
11
|
+
const message = { type: "denied", reason: validateCorpusDenialReason(reason) };
|
|
12
|
+
writeSync(1, JSON.stringify(message) + "\n");
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
// A broken pipe must not expose an error or prevent termination.
|
|
16
|
+
}
|
|
9
17
|
process.exit(70);
|
|
10
18
|
}
|
|
11
19
|
function send(message) {
|
|
@@ -68,7 +76,7 @@ const bridge = {
|
|
|
68
76
|
};
|
|
69
77
|
},
|
|
70
78
|
};
|
|
71
|
-
let
|
|
79
|
+
let denialReason;
|
|
72
80
|
try {
|
|
73
81
|
const first = await nextResponse();
|
|
74
82
|
if (!first ||
|
|
@@ -82,13 +90,15 @@ try {
|
|
|
82
90
|
}
|
|
83
91
|
await runCorpusLeaseWorkerRequest(first.request, bridge);
|
|
84
92
|
}
|
|
85
|
-
catch {
|
|
86
|
-
|
|
93
|
+
catch (error) {
|
|
94
|
+
denialReason = corpusDenialReason(error);
|
|
87
95
|
}
|
|
88
96
|
try {
|
|
89
97
|
await retireBoundReadersForProcessShutdown();
|
|
90
98
|
}
|
|
91
|
-
catch {
|
|
92
|
-
|
|
99
|
+
catch (error) {
|
|
100
|
+
denialReason ??= corpusDenialReason(error);
|
|
93
101
|
}
|
|
94
|
-
|
|
102
|
+
if (denialReason !== undefined)
|
|
103
|
+
fail(denialReason);
|
|
104
|
+
process.exit(0);
|
package/dist/corpus-lease.d.ts
CHANGED
|
@@ -109,6 +109,17 @@ export type CorpusLeaseHooks = {
|
|
|
109
109
|
*/
|
|
110
110
|
confirmTerminationForTest?: Promise<void>;
|
|
111
111
|
};
|
|
112
|
+
/** Treat worker diagnostics as untrusted: accept only bounded fixed categories. */
|
|
113
|
+
export declare function validateCorpusDenialReason(reason: unknown): string;
|
|
114
|
+
/** Path-free guidance for an absent or invalid configured meetings root. */
|
|
115
|
+
export declare class MeetingsRootError extends Error {
|
|
116
|
+
readonly reason: "root_missing" | "root_not_directory";
|
|
117
|
+
constructor(reason: "root_missing" | "root_not_directory");
|
|
118
|
+
}
|
|
119
|
+
/** Reduce an error immediately; never retain path-bearing filesystem errors. */
|
|
120
|
+
export declare function corpusDenialReason(error: unknown): string;
|
|
121
|
+
/** Metadata preflight only; it never authorizes a read or creates a directory. */
|
|
122
|
+
export declare function assertMeetingsRoot(root: string): Promise<void>;
|
|
112
123
|
/**
|
|
113
124
|
* Test-only: give this process's deferred releases a chance to settle.
|
|
114
125
|
*
|
|
@@ -169,8 +180,9 @@ export declare function runCorpusLeaseWorkerRequest(request: CorpusLeaseWorkerRe
|
|
|
169
180
|
/**
|
|
170
181
|
* Authorize a stable corpus read, presenting one error for one condition.
|
|
171
182
|
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
183
|
+
* A missing or invalid configured root gets path-free setup guidance before
|
|
184
|
+
* authorization. Every authorization refusal still gets the same sentence.
|
|
185
|
+
* Without this, which sentence you saw depended on
|
|
174
186
|
* where the failure landed: `fail()` wraps refusals raised once the worker is
|
|
175
187
|
* running, but a `CorpusLeaseChangedError` thrown before that, such as the
|
|
176
188
|
* deadline guard at the top of the dispatch below, escaped raw.
|
package/dist/corpus-lease.js
CHANGED
|
@@ -87,6 +87,76 @@ class CorpusLeaseChangedError extends Error {
|
|
|
87
87
|
}
|
|
88
88
|
class CorpusLeaseBudgetError extends Error {
|
|
89
89
|
}
|
|
90
|
+
const CORPUS_DENIAL_REASONS = new Set([
|
|
91
|
+
"root_missing", "root_not_directory", "budget_exceeded", "corpus_changed",
|
|
92
|
+
"sentinel_not_private", "internal",
|
|
93
|
+
]);
|
|
94
|
+
const CORPUS_FS_ERROR_CODES = new Set([
|
|
95
|
+
"EACCES", "EPERM", "ENOENT", "ENOTDIR", "EISDIR", "ELOOP", "EIO",
|
|
96
|
+
"EMFILE", "ENFILE", "ENOSPC", "EROFS", "EBUSY", "EINVAL", "ENOSYS",
|
|
97
|
+
"ENOTSUP", "EEXIST", "ENOTEMPTY", "ETIMEDOUT", "ESTALE", "EBADF",
|
|
98
|
+
]);
|
|
99
|
+
/** Treat worker diagnostics as untrusted: accept only bounded fixed categories. */
|
|
100
|
+
export function validateCorpusDenialReason(reason) {
|
|
101
|
+
if (typeof reason !== "string" || reason.length > 64)
|
|
102
|
+
return "internal";
|
|
103
|
+
if (CORPUS_DENIAL_REASONS.has(reason))
|
|
104
|
+
return reason;
|
|
105
|
+
if (reason.startsWith("fs_error:") && CORPUS_FS_ERROR_CODES.has(reason.slice(9))) {
|
|
106
|
+
return reason;
|
|
107
|
+
}
|
|
108
|
+
return "internal";
|
|
109
|
+
}
|
|
110
|
+
/** Path-free guidance for an absent or invalid configured meetings root. */
|
|
111
|
+
export class MeetingsRootError extends Error {
|
|
112
|
+
reason;
|
|
113
|
+
constructor(reason) {
|
|
114
|
+
super("Minutes can't find your meetings folder. " +
|
|
115
|
+
"Check the Meetings Directory setting for the Minutes extension in Claude Desktop " +
|
|
116
|
+
"(default: ~/meetings), or record a meeting first.");
|
|
117
|
+
this.reason = reason;
|
|
118
|
+
this.name = "MeetingsRootError";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
class CorpusLeaseDenialError extends Error {
|
|
122
|
+
reason;
|
|
123
|
+
constructor(reason) {
|
|
124
|
+
super("Access denied: stable meeting corpus authorization failed");
|
|
125
|
+
this.reason = reason;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** Reduce an error immediately; never retain path-bearing filesystem errors. */
|
|
129
|
+
export function corpusDenialReason(error) {
|
|
130
|
+
if (error instanceof MeetingsRootError || error instanceof CorpusLeaseDenialError) {
|
|
131
|
+
return validateCorpusDenialReason(error.reason);
|
|
132
|
+
}
|
|
133
|
+
if (error instanceof CorpusLeaseBudgetError)
|
|
134
|
+
return "budget_exceeded";
|
|
135
|
+
if (error instanceof CorpusLeaseChangedError) {
|
|
136
|
+
return error.message === "meeting corpus sentinel namespace is not private"
|
|
137
|
+
? "sentinel_not_private" : "corpus_changed";
|
|
138
|
+
}
|
|
139
|
+
const code = error?.code;
|
|
140
|
+
return typeof code === "string" ? validateCorpusDenialReason(`fs_error:${code}`) : "internal";
|
|
141
|
+
}
|
|
142
|
+
/** Metadata preflight only; it never authorizes a read or creates a directory. */
|
|
143
|
+
export async function assertMeetingsRoot(root) {
|
|
144
|
+
try {
|
|
145
|
+
if (!(await stat(root)).isDirectory()) {
|
|
146
|
+
throw new MeetingsRootError("root_not_directory");
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
if (error instanceof MeetingsRootError)
|
|
151
|
+
throw error;
|
|
152
|
+
const code = error.code;
|
|
153
|
+
if (code === "ENOENT")
|
|
154
|
+
throw new MeetingsRootError("root_missing");
|
|
155
|
+
if (code === "ENOTDIR")
|
|
156
|
+
throw new MeetingsRootError("root_not_directory");
|
|
157
|
+
throw new CorpusLeaseDenialError(corpusDenialReason(error));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
90
160
|
function reserveCorpusMemory(budgets) {
|
|
91
161
|
// Retained UTF-8 may widen to two-byte JS strings. Path/name metadata has
|
|
92
162
|
// the same widening risk, and each retained file has a fixed conservative
|
|
@@ -1076,10 +1146,12 @@ class WatchedCorpusAttempt {
|
|
|
1076
1146
|
* that uncontrolled writers cannot mutate in the JS check-to-return gap.
|
|
1077
1147
|
*/
|
|
1078
1148
|
async function withStableCorpusLeaseInProcess(root, operation, hooks = {}) {
|
|
1149
|
+
await assertMeetingsRoot(root);
|
|
1079
1150
|
const budgets = resolveCorpusReadBudgets(hooks.budgets);
|
|
1080
1151
|
const { deadline } = authorizationWindow(hooks.timeoutMs);
|
|
1081
1152
|
const fenceTimeoutMs = resolveFenceTimeout(hooks.timeoutMs);
|
|
1082
1153
|
const memoryReservation = reserveCorpusMemory(budgets);
|
|
1154
|
+
let denialReason = "internal";
|
|
1083
1155
|
try {
|
|
1084
1156
|
for (let attempt = 1; attempt <= MAX_AUTHORIZATION_ATTEMPTS; attempt += 1) {
|
|
1085
1157
|
let lease;
|
|
@@ -1167,9 +1239,9 @@ async function withStableCorpusLeaseInProcess(root, operation, hooks = {}) {
|
|
|
1167
1239
|
lease = undefined;
|
|
1168
1240
|
return result;
|
|
1169
1241
|
}
|
|
1170
|
-
catch {
|
|
1171
|
-
|
|
1172
|
-
//
|
|
1242
|
+
catch (error) {
|
|
1243
|
+
denialReason = corpusDenialReason(error);
|
|
1244
|
+
// Retry retaining only a bounded category, never the original error.
|
|
1173
1245
|
}
|
|
1174
1246
|
finally {
|
|
1175
1247
|
// Body failures are retried behind the one path-free public error. A
|
|
@@ -1178,7 +1250,7 @@ async function withStableCorpusLeaseInProcess(root, operation, hooks = {}) {
|
|
|
1178
1250
|
await lease?.close().catch(() => { });
|
|
1179
1251
|
}
|
|
1180
1252
|
}
|
|
1181
|
-
throw new
|
|
1253
|
+
throw new CorpusLeaseDenialError(denialReason);
|
|
1182
1254
|
}
|
|
1183
1255
|
finally {
|
|
1184
1256
|
releaseCorpusMemory(memoryReservation);
|
|
@@ -1408,8 +1480,9 @@ function parentControls(commands, pauses) {
|
|
|
1408
1480
|
/**
|
|
1409
1481
|
* Authorize a stable corpus read, presenting one error for one condition.
|
|
1410
1482
|
*
|
|
1411
|
-
*
|
|
1412
|
-
*
|
|
1483
|
+
* A missing or invalid configured root gets path-free setup guidance before
|
|
1484
|
+
* authorization. Every authorization refusal still gets the same sentence.
|
|
1485
|
+
* Without this, which sentence you saw depended on
|
|
1413
1486
|
* where the failure landed: `fail()` wraps refusals raised once the worker is
|
|
1414
1487
|
* running, but a `CorpusLeaseChangedError` thrown before that, such as the
|
|
1415
1488
|
* deadline guard at the top of the dispatch below, escaped raw.
|
|
@@ -1426,6 +1499,7 @@ function parentControls(commands, pauses) {
|
|
|
1426
1499
|
export async function withStableCorpusLease(root, operation, hooks = {}) {
|
|
1427
1500
|
const authorizationStarted = process.hrtime.bigint();
|
|
1428
1501
|
try {
|
|
1502
|
+
await assertMeetingsRoot(root);
|
|
1429
1503
|
const result = await dispatchStableCorpusLease(root, operation, hooks);
|
|
1430
1504
|
const durationMs = Number((process.hrtime.bigint() - authorizationStarted + 999999n) / 1000000n);
|
|
1431
1505
|
// Match denial diagnostics: content-free, operator-visible, deferred, and
|
|
@@ -1436,6 +1510,10 @@ export async function withStableCorpusLease(root, operation, hooks = {}) {
|
|
|
1436
1510
|
return result;
|
|
1437
1511
|
}
|
|
1438
1512
|
catch (error) {
|
|
1513
|
+
if (error instanceof MeetingsRootError || error instanceof CorpusLeaseDenialError) {
|
|
1514
|
+
const reason = corpusDenialReason(error);
|
|
1515
|
+
setImmediate(() => writeOperatorDiagnostic(`[corpus-lease] denied: ${reason}\n`));
|
|
1516
|
+
}
|
|
1439
1517
|
if (error instanceof CorpusLeaseChangedError) {
|
|
1440
1518
|
throw new Error("Access denied: stable meeting corpus authorization failed");
|
|
1441
1519
|
}
|
|
@@ -1537,7 +1615,7 @@ async function dispatchStableCorpusLease(root, operation, hooks = {}) {
|
|
|
1537
1615
|
};
|
|
1538
1616
|
try {
|
|
1539
1617
|
const result = await new Promise((resolve, reject) => {
|
|
1540
|
-
const fail = (message) => {
|
|
1618
|
+
const fail = (message, reason = "internal") => {
|
|
1541
1619
|
if (settled)
|
|
1542
1620
|
return;
|
|
1543
1621
|
settled = true;
|
|
@@ -1546,7 +1624,9 @@ async function dispatchStableCorpusLease(root, operation, hooks = {}) {
|
|
|
1546
1624
|
const remainingNs = deadline - process.hrtime.bigint();
|
|
1547
1625
|
operationAbort.abort(new CorpusLeaseChangedError(message));
|
|
1548
1626
|
killCorpusWorker(child);
|
|
1549
|
-
reject(
|
|
1627
|
+
reject(reason === "root_missing" || reason === "root_not_directory"
|
|
1628
|
+
? new MeetingsRootError(reason)
|
|
1629
|
+
: new Error("Access denied: stable meeting corpus authorization failed"));
|
|
1550
1630
|
// Diagnostics run last and cannot affect the lease. `settled` is already
|
|
1551
1631
|
// true, so anything thrown here would strand the promise forever: no
|
|
1552
1632
|
// later fail() would get past the guard, and the abort/kill/reject above
|
|
@@ -1628,6 +1708,11 @@ async function dispatchStableCorpusLease(root, operation, hooks = {}) {
|
|
|
1628
1708
|
fail("meeting corpus worker protocol was invalid");
|
|
1629
1709
|
return;
|
|
1630
1710
|
}
|
|
1711
|
+
if (message?.type === "denied") {
|
|
1712
|
+
const reason = validateCorpusDenialReason(message.reason);
|
|
1713
|
+
fail(`worker refusal: ${reason}`, reason);
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1631
1716
|
if (message?.type === "phase") {
|
|
1632
1717
|
const attempt = Number(message.attempt);
|
|
1633
1718
|
const hook = hooks[message.name];
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ import { nodeChildEnvironment, resolveNodeHelperRuntime, NodeHelperRuntimeError
|
|
|
56
56
|
import { hasFeature, probeCapabilitiesSync, } from "./capabilities.js";
|
|
57
57
|
import { downloadReleaseBinaryWithChecksum, extractZipWithPowerShell, installMacSherpaArchiveWithFallback, MACOS_SHERPA_ARCHIVE, } from "./autoInstall.js";
|
|
58
58
|
import { attachCaptureRelay, } from "./captureRelay.js";
|
|
59
|
-
import { withStableCorpusLease, } from "./corpus-lease.js";
|
|
59
|
+
import { assertMeetingsRoot, MeetingsRootError, withStableCorpusLease, } from "./corpus-lease.js";
|
|
60
60
|
import { HTTP_BIND_HOST, DEFAULT_HTTP_PORT, DEFAULT_MAX_SESSIONS, startMinutesHttpServer, } from "./httpTransport.js";
|
|
61
61
|
import { boundReadFingerprint, captureBoundReadExpectation, readTextFileFromBoundParent, } from "./secure-read.js";
|
|
62
62
|
crashTrace("imports-complete");
|
|
@@ -1615,7 +1615,7 @@ const COPILOT_SUPPORTED = hasFeature(CLI_CAPABILITIES, "copilot_realtime");
|
|
|
1615
1615
|
// `./version.ts` (see issue #183). Hosted `.mcpb` bundles will run
|
|
1616
1616
|
// against CLIs with different minor/patch numbers within the same
|
|
1617
1617
|
// major; that is explicitly supported.
|
|
1618
|
-
const MCP_SERVER_VERSION = "0.33.
|
|
1618
|
+
const MCP_SERVER_VERSION = "0.33.2";
|
|
1619
1619
|
export function parseKnowledgeConfig(configContent) {
|
|
1620
1620
|
const knowledgeMatch = configContent.match(/\[knowledge\][\s\S]*?(?=\n\[|$)/);
|
|
1621
1621
|
if (!knowledgeMatch) {
|
|
@@ -4679,6 +4679,7 @@ registerDocsAppTool("get_meeting", {
|
|
|
4679
4679
|
}, async ({ path: filePath, include_restricted }) => {
|
|
4680
4680
|
try {
|
|
4681
4681
|
const meetingsDir = await getEffectiveMeetingsDir();
|
|
4682
|
+
await assertMeetingsRoot(meetingsDir);
|
|
4682
4683
|
const { path: resolved, content: rawContent } = await readTextFileInDirectory(filePath, meetingsDir, [".md"]);
|
|
4683
4684
|
if (!isActiveCorpusMeetingPath(resolved, meetingsDir)) {
|
|
4684
4685
|
throw new Error("Meeting is outside the active corpus.");
|
|
@@ -4762,9 +4763,14 @@ registerDocsAppTool("get_meeting", {
|
|
|
4762
4763
|
_meta: { ui: { resourceUri: UI_RESOURCE_URI }, view: "detail", path: resolved },
|
|
4763
4764
|
};
|
|
4764
4765
|
}
|
|
4765
|
-
catch {
|
|
4766
|
+
catch (error) {
|
|
4766
4767
|
return {
|
|
4767
|
-
content: [{
|
|
4768
|
+
content: [{
|
|
4769
|
+
type: "text",
|
|
4770
|
+
text: error instanceof MeetingsRootError
|
|
4771
|
+
? error.message
|
|
4772
|
+
: "Meeting could not be safely read.",
|
|
4773
|
+
}],
|
|
4768
4774
|
isError: true,
|
|
4769
4775
|
};
|
|
4770
4776
|
}
|
package/dist/node-child.js
CHANGED
|
@@ -29,7 +29,7 @@ export class NodeHelperRuntimeError extends Error {
|
|
|
29
29
|
(override
|
|
30
30
|
? "The Node.js path setting (MINUTES_NODE_PATH) must name an absolute path to a working Node.js executable. "
|
|
31
31
|
: "No working system Node.js runtime was found. ") +
|
|
32
|
-
`Install Node.js ${MINIMUM_HELPER_NODE_MAJOR}+ from nodejs.org or with Homebrew, or set Node.js path in the Minutes extension settings in Claude Desktop to its absolute executable path, then
|
|
32
|
+
`Install Node.js ${MINIMUM_HELPER_NODE_MAJOR}+ from nodejs.org or with Homebrew, or set Node.js path in the Minutes extension settings in Claude Desktop to its absolute executable path, then quit and reopen Claude Desktop.`);
|
|
33
33
|
this.name = "NodeHelperRuntimeError";
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -101,6 +101,9 @@ export function createNodeHelperRuntimeResolver(options = {}) {
|
|
|
101
101
|
"/opt/homebrew/bin", "/usr/local/bin", "/usr/bin",
|
|
102
102
|
paths.join(environment.VOLTA_HOME ?? paths.join(settings.home, ".volta"), "bin"),
|
|
103
103
|
paths.join(settings.home, ".asdf", "shims"),
|
|
104
|
+
// Manual user-space installs (no package or version manager).
|
|
105
|
+
paths.join(settings.home, ".local", "bin"),
|
|
106
|
+
paths.join(settings.home, ".local", "node", "bin"),
|
|
104
107
|
])
|
|
105
108
|
yield paths.join(directory, node);
|
|
106
109
|
for (const [directory, suffix] of [
|
|
@@ -145,7 +148,8 @@ export function createNodeHelperRuntimeResolver(options = {}) {
|
|
|
145
148
|
return settings.execPath;
|
|
146
149
|
const environment = settings.environment();
|
|
147
150
|
const configuredPath = environment.MINUTES_NODE_PATH;
|
|
148
|
-
|
|
151
|
+
// A path pasted into the extension settings can carry stray whitespace.
|
|
152
|
+
const override = configuredPath?.trim() || undefined;
|
|
149
153
|
const key = JSON.stringify([override, environment.PATH, environment.Path]);
|
|
150
154
|
if (resolved?.key === key)
|
|
151
155
|
return resolved.binary;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minutes-mcp",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
4
4
|
"mcpName": "io.github.silverstein/minutes",
|
|
5
5
|
"description": "MCP server for minutes \u2014 conversation memory for AI assistants. Works with Claude Desktop, Mistral Vibe, Cursor, Windsurf, and any MCP client.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/ext-apps": "^2.0.0",
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.32.0",
|
|
50
|
-
"minutes-sdk": "0.33.
|
|
50
|
+
"minutes-sdk": "0.33.2",
|
|
51
51
|
"yaml": "^2.8.3",
|
|
52
52
|
"zod": "^3.25 || ^4.0"
|
|
53
53
|
},
|