cliskill 1.1.4 → 1.1.5
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/bootstrap/cli.js
CHANGED
|
@@ -8324,6 +8324,27 @@ You have been invoked in the following environment:
|
|
|
8324
8324
|
- Hostname: ${hostname()}
|
|
8325
8325
|
- Shell: ${isWin ? "cmd.exe (use Windows-compatible commands)" : "bash/zsh"}`;
|
|
8326
8326
|
}
|
|
8327
|
+
function buildMcpToolsSection(servers) {
|
|
8328
|
+
if (servers.length === 0) return "";
|
|
8329
|
+
const lines = [
|
|
8330
|
+
"# MCP (Model Context Protocol) Tools",
|
|
8331
|
+
"",
|
|
8332
|
+
"You have access to tools from connected MCP (Model Context Protocol) servers.",
|
|
8333
|
+
"These are external tools provided by MCP services that extend your capabilities beyond the built-in tools.",
|
|
8334
|
+
"Use them like any other tool when they are relevant to the task.",
|
|
8335
|
+
"",
|
|
8336
|
+
"When the user asks about MCP services, MCP tools, or what external tools are available, refer to the list below.",
|
|
8337
|
+
""
|
|
8338
|
+
];
|
|
8339
|
+
for (const server of servers) {
|
|
8340
|
+
lines.push(`## MCP Server: ${server.name}`);
|
|
8341
|
+
for (const tool of server.tools) {
|
|
8342
|
+
lines.push(`- **${tool.name}**: ${tool.description}`);
|
|
8343
|
+
}
|
|
8344
|
+
lines.push("");
|
|
8345
|
+
}
|
|
8346
|
+
return lines.join("\n");
|
|
8347
|
+
}
|
|
8327
8348
|
function buildSystemPrompt() {
|
|
8328
8349
|
return [
|
|
8329
8350
|
getIntroSection(),
|
|
@@ -8949,6 +8970,22 @@ async function connectMcpServers(config, toolRegistry) {
|
|
|
8949
8970
|
mcpManager.registerShutdownHandlers();
|
|
8950
8971
|
return mcpManager;
|
|
8951
8972
|
}
|
|
8973
|
+
async function buildMcpSystemSection(mcpManager) {
|
|
8974
|
+
if (!mcpManager) return "";
|
|
8975
|
+
const servers = [];
|
|
8976
|
+
for (const serverName of mcpManager.getConnectedServers()) {
|
|
8977
|
+
const tools = await mcpManager.getToolsForServer(serverName);
|
|
8978
|
+
if (tools.length === 0) continue;
|
|
8979
|
+
servers.push({
|
|
8980
|
+
name: serverName,
|
|
8981
|
+
tools: tools.map((t) => ({
|
|
8982
|
+
name: `mcp_${serverName}_${t.name}`,
|
|
8983
|
+
description: t.description ?? `MCP tool: ${t.name}`
|
|
8984
|
+
}))
|
|
8985
|
+
});
|
|
8986
|
+
}
|
|
8987
|
+
return buildMcpToolsSection(servers);
|
|
8988
|
+
}
|
|
8952
8989
|
async function runTuiRepl(config) {
|
|
8953
8990
|
const adapterRegistry = new AdapterRegistry();
|
|
8954
8991
|
for (const provider of config.providers) {
|
|
@@ -8962,6 +8999,9 @@ async function runTuiRepl(config) {
|
|
|
8962
8999
|
const modelRouter = buildModelRouter(adapterRegistry, config);
|
|
8963
9000
|
const toolRegistry = createDefaultToolRegistry(modelRouter);
|
|
8964
9001
|
const mcpManager = await connectMcpServers(config, toolRegistry);
|
|
9002
|
+
const mcpSection = await buildMcpSystemSection(mcpManager);
|
|
9003
|
+
const baseSystemPrompt = config.systemPrompt ?? buildSystemPrompt();
|
|
9004
|
+
const systemPrompt = mcpSection ? baseSystemPrompt + "\n\n" + mcpSection : baseSystemPrompt;
|
|
8965
9005
|
ensureDataDir();
|
|
8966
9006
|
const sessionSaver = new SessionSaver();
|
|
8967
9007
|
await sessionSaver.init();
|
|
@@ -8980,7 +9020,7 @@ async function runTuiRepl(config) {
|
|
|
8980
9020
|
adapter,
|
|
8981
9021
|
toolRegistry,
|
|
8982
9022
|
config,
|
|
8983
|
-
systemPrompt
|
|
9023
|
+
systemPrompt,
|
|
8984
9024
|
cwd: process.cwd(),
|
|
8985
9025
|
abortSignal: activeAbortController.signal,
|
|
8986
9026
|
onPermissionRequest: async () => true,
|
|
@@ -9059,7 +9099,10 @@ async function runBasicRepl(config) {
|
|
|
9059
9099
|
`);
|
|
9060
9100
|
}
|
|
9061
9101
|
const toolRegistry = createDefaultToolRegistry(modelRouter);
|
|
9062
|
-
await connectMcpServers(config, toolRegistry);
|
|
9102
|
+
const mcpManager = await connectMcpServers(config, toolRegistry);
|
|
9103
|
+
const mcpSection = await buildMcpSystemSection(mcpManager);
|
|
9104
|
+
const baseSystemPrompt = config.systemPrompt ?? buildSystemPrompt();
|
|
9105
|
+
const systemPrompt = mcpSection ? baseSystemPrompt + "\n\n" + mcpSection : baseSystemPrompt;
|
|
9063
9106
|
const abortController = new AbortController();
|
|
9064
9107
|
ensureDataDir();
|
|
9065
9108
|
const sessionSaver = new SessionSaver();
|
|
@@ -9140,7 +9183,7 @@ async function runBasicRepl(config) {
|
|
|
9140
9183
|
adapter,
|
|
9141
9184
|
toolRegistry,
|
|
9142
9185
|
config,
|
|
9143
|
-
systemPrompt
|
|
9186
|
+
systemPrompt,
|
|
9144
9187
|
cwd: process.cwd(),
|
|
9145
9188
|
abortSignal: abortController.signal,
|
|
9146
9189
|
onPermissionRequest: async (operation, details) => {
|
|
@@ -12194,4 +12237,4 @@ export {
|
|
|
12194
12237
|
MCPConnectionManager,
|
|
12195
12238
|
runCli
|
|
12196
12239
|
};
|
|
12197
|
-
//# sourceMappingURL=chunk-
|
|
12240
|
+
//# sourceMappingURL=chunk-GEH466DM.js.map
|