knit-mcp 0.7.0 → 0.7.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/{cache-WGZ2C7BZ.js → cache-BVFD5F5Y.js} +3 -3
- package/dist/chunk-WMESQUZU.js +25 -0
- package/dist/cli.js +13 -5
- package/dist/{install-agents-AXT6DMYM.js → install-agents-HXVYULKK.js} +3 -3
- package/dist/notifier-4L27HKHI.js +10 -0
- package/dist/{tools-KRPOUYNT.js → tools-NZUUKPYI.js} +7 -2
- package/package.json +1 -1
- package/dist/{chunk-QMH2DT6K.js → chunk-X6TGTET3.js} +7 -7
- package/dist/{refresh-MSN5YNPS.js → refresh-JJUSH2J5.js} +3 -3
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
detectProjectRoot,
|
|
3
3
|
getBrain,
|
|
4
4
|
refreshBrain
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-SLN5ABF5.js";
|
|
7
|
-
import "./chunk-M3YZOJNW.js";
|
|
5
|
+
} from "./chunk-X6TGTET3.js";
|
|
8
6
|
import "./chunk-3XR77YJM.js";
|
|
7
|
+
import "./chunk-SLN5ABF5.js";
|
|
9
8
|
import "./chunk-7PPC6IG6.js";
|
|
9
|
+
import "./chunk-M3YZOJNW.js";
|
|
10
10
|
import "./chunk-BAUQEFYY.js";
|
|
11
11
|
import "./chunk-HBMF62U4.js";
|
|
12
12
|
export {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/mcp/notifier.ts
|
|
2
|
+
var notifierImpl = null;
|
|
3
|
+
function registerToolsListChangedNotifier(fn) {
|
|
4
|
+
notifierImpl = fn;
|
|
5
|
+
}
|
|
6
|
+
function notifyToolsListChanged() {
|
|
7
|
+
if (!notifierImpl) return;
|
|
8
|
+
try {
|
|
9
|
+
const result = notifierImpl();
|
|
10
|
+
if (result && typeof result.then === "function") {
|
|
11
|
+
result.catch(() => {
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
} catch {
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function __resetNotifierForTests() {
|
|
18
|
+
notifierImpl = null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
registerToolsListChangedNotifier,
|
|
23
|
+
notifyToolsListChanged,
|
|
24
|
+
__resetNotifierForTests
|
|
25
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -26,8 +26,8 @@ async function runCLI() {
|
|
|
26
26
|
const chalk = (await import("chalk")).default;
|
|
27
27
|
const { setupCommand } = await import("./setup-5TUUWLIJ.js");
|
|
28
28
|
const { statusCommand } = await import("./status-XN6VHO66.js");
|
|
29
|
-
const { refreshCommand } = await import("./refresh-
|
|
30
|
-
const { installAgentsCommand } = await import("./install-agents-
|
|
29
|
+
const { refreshCommand } = await import("./refresh-JJUSH2J5.js");
|
|
30
|
+
const { installAgentsCommand } = await import("./install-agents-HXVYULKK.js");
|
|
31
31
|
const { exportCommand } = await import("./export-IKPBLZOO.js");
|
|
32
32
|
const ENGRAM_GRADIENT = gradient(["#7c3aed", "#2563eb", "#06b6d4"]);
|
|
33
33
|
const banner = `
|
|
@@ -94,14 +94,22 @@ async function runMCP() {
|
|
|
94
94
|
const { Server } = await import("@modelcontextprotocol/sdk/server/index.js");
|
|
95
95
|
const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");
|
|
96
96
|
const { ListToolsRequestSchema, CallToolRequestSchema } = await import("@modelcontextprotocol/sdk/types.js");
|
|
97
|
-
const { getBrain, detectProjectRoot, refreshBrain } = await import("./cache-
|
|
98
|
-
const { getActiveToolDefinitionsForBrain, handleToolCall } = await import("./tools-
|
|
97
|
+
const { getBrain, detectProjectRoot, refreshBrain } = await import("./cache-BVFD5F5Y.js");
|
|
98
|
+
const { getActiveToolDefinitionsForBrain, handleToolCall } = await import("./tools-NZUUKPYI.js");
|
|
99
99
|
const { KNIT_INSTRUCTIONS } = await import("./instructions-33TUHLTK.js");
|
|
100
|
+
const { registerToolsListChangedNotifier } = await import("./notifier-4L27HKHI.js");
|
|
100
101
|
const ROOT_PATH = detectProjectRoot();
|
|
101
102
|
const server = new Server(
|
|
102
103
|
{ name: "knit-brain", version: VERSION },
|
|
103
|
-
{
|
|
104
|
+
{
|
|
105
|
+
capabilities: { tools: { listChanged: true } },
|
|
106
|
+
instructions: KNIT_INSTRUCTIONS
|
|
107
|
+
}
|
|
104
108
|
);
|
|
109
|
+
registerToolsListChangedNotifier(() => {
|
|
110
|
+
void server.sendToolListChanged().catch(() => {
|
|
111
|
+
});
|
|
112
|
+
});
|
|
105
113
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
106
114
|
tools: getActiveToolDefinitionsForBrain(getBrain(ROOT_PATH))
|
|
107
115
|
}));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getBrain
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-SLN5ABF5.js";
|
|
5
|
-
import "./chunk-M3YZOJNW.js";
|
|
3
|
+
} from "./chunk-X6TGTET3.js";
|
|
6
4
|
import {
|
|
7
5
|
installAgentsForProject
|
|
8
6
|
} from "./chunk-3XR77YJM.js";
|
|
7
|
+
import "./chunk-SLN5ABF5.js";
|
|
9
8
|
import "./chunk-7PPC6IG6.js";
|
|
9
|
+
import "./chunk-M3YZOJNW.js";
|
|
10
10
|
import "./chunk-BAUQEFYY.js";
|
|
11
11
|
import "./chunk-HBMF62U4.js";
|
|
12
12
|
|
|
@@ -36,6 +36,9 @@ import {
|
|
|
36
36
|
teamsPath,
|
|
37
37
|
worktreesRegistryPath
|
|
38
38
|
} from "./chunk-HBMF62U4.js";
|
|
39
|
+
import {
|
|
40
|
+
notifyToolsListChanged
|
|
41
|
+
} from "./chunk-WMESQUZU.js";
|
|
39
42
|
|
|
40
43
|
// src/mcp/handlers.ts
|
|
41
44
|
import { writeFileSync as writeFileSync4, readFileSync as readFileSync4, readdirSync, existsSync as existsSync4, renameSync as renameSync2, unlinkSync } from "fs";
|
|
@@ -1233,12 +1236,13 @@ function handleEnableFeature(params, brain) {
|
|
|
1233
1236
|
enabled.add(feature);
|
|
1234
1237
|
if (!wasAlreadyOn) {
|
|
1235
1238
|
saveEnabledFeatures(brain.rootPath, enabled);
|
|
1239
|
+
notifyToolsListChanged();
|
|
1236
1240
|
}
|
|
1237
1241
|
return JSON.stringify({
|
|
1238
1242
|
status: wasAlreadyOn ? "already-enabled" : "enabled",
|
|
1239
1243
|
feature,
|
|
1240
1244
|
enabled_features: [...enabled].sort(),
|
|
1241
|
-
instruction: "
|
|
1245
|
+
instruction: wasAlreadyOn ? "Already enabled. Call knit_list_features to see the active tool list." : "Tools list updated for this session. The newly-enabled tools should be available immediately \u2014 call knit_list_features to confirm."
|
|
1242
1246
|
});
|
|
1243
1247
|
}
|
|
1244
1248
|
function handleDisableFeature(params, brain) {
|
|
@@ -1253,12 +1257,13 @@ function handleDisableFeature(params, brain) {
|
|
|
1253
1257
|
const wasOn = enabled.delete(feature);
|
|
1254
1258
|
if (wasOn) {
|
|
1255
1259
|
saveEnabledFeatures(brain.rootPath, enabled);
|
|
1260
|
+
notifyToolsListChanged();
|
|
1256
1261
|
}
|
|
1257
1262
|
return JSON.stringify({
|
|
1258
1263
|
status: wasOn ? "disabled" : "already-disabled",
|
|
1259
1264
|
feature,
|
|
1260
1265
|
enabled_features: [...enabled].sort(),
|
|
1261
|
-
instruction: "
|
|
1266
|
+
instruction: wasOn ? "Tools list updated for this session. Opt-in-only tools for this feature are no longer visible." : "Already disabled. Auto-exposed tools (e.g. teams when \u22653 domains) stay visible regardless of this flag."
|
|
1262
1267
|
});
|
|
1263
1268
|
}
|
|
1264
1269
|
function detectsInquiryIntent(description) {
|
package/package.json
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
installAgentsForProject,
|
|
3
|
+
pruneSessionsByAge
|
|
4
|
+
} from "./chunk-3XR77YJM.js";
|
|
1
5
|
import {
|
|
2
6
|
KNIT_MARKER_START,
|
|
3
7
|
buildKnowledge,
|
|
@@ -5,16 +9,12 @@ import {
|
|
|
5
9
|
generateClaudeMd,
|
|
6
10
|
spliceKnitBlock
|
|
7
11
|
} from "./chunk-SLN5ABF5.js";
|
|
8
|
-
import {
|
|
9
|
-
readLearnings
|
|
10
|
-
} from "./chunk-M3YZOJNW.js";
|
|
11
|
-
import {
|
|
12
|
-
installAgentsForProject,
|
|
13
|
-
pruneSessionsByAge
|
|
14
|
-
} from "./chunk-3XR77YJM.js";
|
|
15
12
|
import {
|
|
16
13
|
scanProject
|
|
17
14
|
} from "./chunk-7PPC6IG6.js";
|
|
15
|
+
import {
|
|
16
|
+
readLearnings
|
|
17
|
+
} from "./chunk-M3YZOJNW.js";
|
|
18
18
|
import {
|
|
19
19
|
importFromMarkdown,
|
|
20
20
|
loadKnowledgeBase,
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
buildKnowledge,
|
|
3
3
|
generateClaudeMd
|
|
4
4
|
} from "./chunk-SLN5ABF5.js";
|
|
5
|
-
import {
|
|
6
|
-
findFalsePositives
|
|
7
|
-
} from "./chunk-M3YZOJNW.js";
|
|
8
5
|
import {
|
|
9
6
|
scanProject
|
|
10
7
|
} from "./chunk-7PPC6IG6.js";
|
|
8
|
+
import {
|
|
9
|
+
findFalsePositives
|
|
10
|
+
} from "./chunk-M3YZOJNW.js";
|
|
11
11
|
import {
|
|
12
12
|
knowledgePath,
|
|
13
13
|
learningsDir,
|