@neurynae/toolcairn-mcp 0.9.0 → 0.9.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/index.js CHANGED
@@ -1512,7 +1512,7 @@ ${args.prompt}
1512
1512
  """${projectToolsContext}
1513
1513
 
1514
1514
  Your response (one category name only):`;
1515
- const needs_tool_search_prompt = `Based on this classification, determine if ToolPilot tool search should be invoked.
1515
+ const needs_tool_search_prompt = `Based on this classification, determine if ToolCairn tool search should be invoked.
1516
1516
  Respond with 1 if the classification is one of: tool_discovery, stack_building, tool_comparison
1517
1517
  Respond with 0 if the classification is: tool_configuration, debugging, general_coding
1518
1518
  Respond with ONLY 0 or 1.`;
@@ -1528,7 +1528,7 @@ Respond with ONLY 0 or 1.`;
1528
1528
  "general_coding"
1529
1529
  ],
1530
1530
  tool_required_if: TOOL_REQUIRED_CLASSIFICATIONS,
1531
- instructions: "Step 1: Send classification_prompt to the LLM and get a classification. Step 2: If classification is in tool_required_if, call refine_requirement with the classification. Otherwise, proceed without ToolPilot search."
1531
+ instructions: "Step 1: Send classification_prompt to the LLM and get a classification. Step 2: If classification is in tool_required_if, call refine_requirement with the classification. Otherwise, proceed without ToolCairn search."
1532
1532
  });
1533
1533
  } catch (e) {
1534
1534
  logger2.error({ err: e }, "classify_prompt failed");
@@ -1542,29 +1542,29 @@ var import_errors5 = __toESM(require_dist2(), 1);
1542
1542
 
1543
1543
  // ../../packages/tools-local/dist/templates/agent-instructions.js
1544
1544
  init_esm_shims();
1545
- var TOOLPILOT_MCP_ENTRY = {
1546
- toolpilot: {
1545
+ var TOOLCAIRN_MCP_ENTRY = {
1546
+ toolcairn: {
1547
1547
  command: "npx",
1548
- args: ["-y", "@toolcairn/mcp@latest"]
1548
+ args: ["-y", "@neurynae/toolcairn-mcp"]
1549
1549
  }
1550
1550
  };
1551
1551
  var CORE_RULES = `
1552
- ## ToolPilot \u2014 Tool Intelligence MCP
1552
+ ## ToolCairn \u2014 Tool Intelligence MCP
1553
1553
 
1554
- ToolPilot is your tool intelligence co-pilot. It has a graph database of 500+ indexed tools with health signals, compatibility data, and known issue tracking. Always use it before recommending any tool, library, or framework.
1554
+ ToolCairn is your tool intelligence co-pilot. It has a graph database of 500+ indexed tools with health signals, compatibility data, and known issue tracking. Always use it before recommending any tool, library, or framework.
1555
1555
 
1556
1556
  ### Workflow for Tool Selection
1557
1557
 
1558
1558
  1. **Before recommending any tool**: Always call \`search_tools\` first. Never recommend from training data alone.
1559
1559
  2. **When user describes a use case**: Call \`classify_prompt\` first, then \`refine_requirement\` if tool selection is needed.
1560
- 3. **When starting a new project**: Call \`toolpilot_init\` to set up .toolpilot/config.json.
1561
- 4. **When resuming work on a project**: Read .toolpilot/config.json via \`read_project_config\` to see confirmed tools.
1560
+ 3. **When starting a new project**: Call \`toolcairn_init\` to set up .toolcairn/config.json.
1561
+ 4. **When resuming work on a project**: Read .toolcairn/config.json via \`read_project_config\` to see confirmed tools.
1562
1562
  5. **When a tool is selected**: Call \`update_project_config\` to persist the choice.
1563
1563
  6. **When encountering an error with a tool**: Call \`check_issue\` before debugging \u2014 it may be a known issue with an open GitHub ticket.
1564
1564
  7. **When user asks to compare tools**: Call \`compare_tools\` for a structured comparison with health data.
1565
1565
  8. **When user chooses a non-indexed/proprietary tool**: Add it to config with source: "non_oss" via \`update_project_config\`.
1566
1566
 
1567
- ### Available ToolPilot MCP Tools
1567
+ ### Available ToolCairn MCP Tools
1568
1568
 
1569
1569
  | Tool | When to use |
1570
1570
  |------|------------|
@@ -1577,17 +1577,17 @@ ToolPilot is your tool intelligence co-pilot. It has a graph database of 500+ in
1577
1577
  | \`check_compatibility\` | Check if two tools work well together |
1578
1578
  | \`compare_tools\` | Compare two tools with health and graph data |
1579
1579
  | \`report_outcome\` | Report whether a recommended tool worked (improves future results) |
1580
- | \`toolpilot_init\` | Set up ToolPilot for a new project |
1581
- | \`init_project_config\` | Initialize .toolpilot/config.json |
1582
- | \`read_project_config\` | Parse .toolpilot/config.json to get confirmed tools |
1583
- | \`update_project_config\` | Add/remove/update tools in .toolpilot/config.json |
1584
- | \`suggest_graph_update\` | Suggest a new tool or relationship for the ToolPilot graph |
1580
+ | \`toolcairn_init\` | Set up ToolCairn for a new project |
1581
+ | \`init_project_config\` | Initialize .toolcairn/config.json |
1582
+ | \`read_project_config\` | Parse .toolcairn/config.json to get confirmed tools |
1583
+ | \`update_project_config\` | Add/remove/update tools in .toolcairn/config.json |
1584
+ | \`suggest_graph_update\` | Suggest a new tool or relationship for the ToolCairn graph |
1585
1585
 
1586
1586
  ### Rules
1587
1587
 
1588
- - NEVER recommend a tool without first checking ToolPilot unless the tool is already in .toolpilot/config.json
1589
- - Always check .toolpilot/config.json at the start of a session if it exists
1590
- - Prefer open-source tools from ToolPilot index; flag proprietary alternatives clearly
1588
+ - NEVER recommend a tool without first checking ToolCairn unless the tool is already in .toolcairn/config.json
1589
+ - Always check .toolcairn/config.json at the start of a session if it exists
1590
+ - Prefer open-source tools from ToolCairn index; flag proprietary alternatives clearly
1591
1591
  - After selecting a tool, always call \`update_project_config\` to persist it
1592
1592
  - After using a tool successfully/unsuccessfully, call \`report_outcome\`
1593
1593
  `;
@@ -1663,20 +1663,20 @@ function getInstructionsForAgent(agent) {
1663
1663
  function getMcpConfigEntry(serverPath) {
1664
1664
  if (serverPath) {
1665
1665
  return {
1666
- toolpilot: {
1666
+ toolcairn: {
1667
1667
  command: "node",
1668
1668
  args: [serverPath]
1669
1669
  }
1670
1670
  };
1671
1671
  }
1672
- return TOOLPILOT_MCP_ENTRY;
1672
+ return TOOLCAIRN_MCP_ENTRY;
1673
1673
  }
1674
1674
  function getOpenCodeMcpEntry(serverPath) {
1675
1675
  const resolvedPath = serverPath;
1676
1676
  return {
1677
- toolpilot: {
1677
+ toolcairn: {
1678
1678
  type: "local",
1679
- command: resolvedPath ? ["node", resolvedPath] : ["npx", "-y", "@toolcairn/mcp@latest"],
1679
+ command: resolvedPath ? ["node", resolvedPath] : ["npx", "-y", "@neurynae/toolcairn-mcp"],
1680
1680
  enabled: true
1681
1681
  }
1682
1682
  };
@@ -1690,7 +1690,7 @@ function generateTrackerHtml2(eventsPath) {
1690
1690
  <head>
1691
1691
  <meta charset="UTF-8" />
1692
1692
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1693
- <title>ToolPilot Tracker</title>
1693
+ <title>ToolCairn Tracker</title>
1694
1694
  <style>
1695
1695
  :root {
1696
1696
  --bg: #0a0a0f;
@@ -1787,7 +1787,7 @@ function generateTrackerHtml2(eventsPath) {
1787
1787
  <circle cx="10" cy="10" r="9" stroke="#7c5cfc" stroke-width="1.5"/>
1788
1788
  <path d="M6 10h8M10 6v8" stroke="#7c5cfc" stroke-width="1.5" stroke-linecap="round"/>
1789
1789
  </svg>
1790
- <h1><span>Tool</span>Pilot Tracker</h1>
1790
+ <h1><span>Tool</span>Cairn Tracker</h1>
1791
1791
  <div id="statusText" style="font-size:12px; color:var(--muted);">Loading...</div>
1792
1792
  <div id="statusDot" class="status-dot paused"></div>
1793
1793
  </header>
@@ -1816,7 +1816,7 @@ function generateTrackerHtml2(eventsPath) {
1816
1816
  <div class="empty" id="emptyState">
1817
1817
  <svg width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="18" stroke="currentColor" stroke-width="1.5" fill="none"/><path d="M13 20h14M20 13v14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
1818
1818
  <p>Waiting for MCP tool calls...</p>
1819
- <code>Set TOOLPILOT_EVENTS_PATH in your MCP server env</code>
1819
+ <code>Set TOOLCAIRN_EVENTS_PATH in your MCP server env</code>
1820
1820
  </div>
1821
1821
  </div>
1822
1822
  <div class="sidebar">
@@ -2078,7 +2078,7 @@ function renderAll() {
2078
2078
  // \u2500\u2500\u2500 Boot \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
2079
2079
  if (!EVENTS_PATH || EVENTS_PATH === 'null') {
2080
2080
  document.getElementById('statusText').textContent = 'No events path configured';
2081
- document.getElementById('emptyState').querySelector('p').textContent = 'TOOLPILOT_EVENTS_PATH not set in MCP server environment';
2081
+ document.getElementById('emptyState').querySelector('p').textContent = 'TOOLCAIRN_EVENTS_PATH not set in MCP server environment';
2082
2082
  } else {
2083
2083
  startPolling();
2084
2084
  }
@@ -2088,19 +2088,19 @@ if (!EVENTS_PATH || EVENTS_PATH === 'null') {
2088
2088
  }
2089
2089
 
2090
2090
  // ../../packages/tools-local/dist/handlers/toolcairn-init.js
2091
- var logger3 = (0, import_errors5.createMcpLogger)({ name: "@toolcairn/tools:toolpilot-init" });
2091
+ var logger3 = (0, import_errors5.createMcpLogger)({ name: "@toolcairn/tools:toolcairn-init" });
2092
2092
  async function handleToolcairnInit(args) {
2093
2093
  try {
2094
- logger3.info({ agent: args.agent, project_root: args.project_root }, "toolpilot_init called");
2094
+ logger3.info({ agent: args.agent, project_root: args.project_root }, "toolcairn_init called");
2095
2095
  const instructions = getInstructionsForAgent(args.agent);
2096
2096
  const isOpenCode = args.agent === "opencode";
2097
2097
  const mcpConfigEntry = isOpenCode ? getOpenCodeMcpEntry(args.server_path) : getMcpConfigEntry(args.server_path);
2098
2098
  const mcpConfigFile = isOpenCode ? "opencode.json" : ".mcp.json";
2099
2099
  const hasMcpJson = args.detected_files?.some((f) => f === mcpConfigFile || f.endsWith(`/${mcpConfigFile}`));
2100
2100
  const hasInstructionFile = args.detected_files?.some((f) => f.endsWith(instructions.file_path));
2101
- const hasToolpilotConfig = args.detected_files?.some((f) => f.includes(".toolpilot/config.json"));
2102
- const hasTrackerHtml = args.detected_files?.some((f) => f.includes(".toolpilot/tracker.html"));
2103
- const eventsPath = `${args.project_root}/.toolpilot/events.jsonl`;
2101
+ const hasToolcairnConfig = args.detected_files?.some((f) => f.includes(".toolcairn/config.json"));
2102
+ const hasTrackerHtml = args.detected_files?.some((f) => f.includes(".toolcairn/tracker.html"));
2103
+ const eventsPath = `${args.project_root}/.toolcairn/events.jsonl`;
2104
2104
  const setupSteps = [];
2105
2105
  let step = 1;
2106
2106
  setupSteps.push({
@@ -2111,7 +2111,7 @@ async function handleToolcairnInit(args) {
2111
2111
  note: hasInstructionFile ? `Append the content to your existing ${instructions.file_path}` : `Create ${instructions.file_path} with the content`
2112
2112
  });
2113
2113
  const mcpContent = isOpenCode ? JSON.stringify({ mcp: mcpConfigEntry }, null, 2) : JSON.stringify({ mcpServers: mcpConfigEntry }, null, 2);
2114
- const mcpMergeNote = isOpenCode ? `Merge the toolpilot entry into your existing ${mcpConfigFile} under "mcp"` : `Merge the toolpilot entry into your existing ${mcpConfigFile} under "mcpServers"`;
2114
+ const mcpMergeNote = isOpenCode ? `Merge the toolcairn entry into your existing ${mcpConfigFile} under "mcp"` : `Merge the toolcairn entry into your existing ${mcpConfigFile} under "mcpServers"`;
2115
2115
  const mcpCreateNote = isOpenCode ? `Create ${mcpConfigFile} with this content (OpenCode MCP config format)` : `Create ${mcpConfigFile} with this content`;
2116
2116
  setupSteps.push({
2117
2117
  step: step++,
@@ -2120,29 +2120,29 @@ async function handleToolcairnInit(args) {
2120
2120
  content: mcpContent,
2121
2121
  note: hasMcpJson ? mcpMergeNote : mcpCreateNote
2122
2122
  });
2123
- if (!hasToolpilotConfig) {
2123
+ if (!hasToolcairnConfig) {
2124
2124
  setupSteps.push({
2125
2125
  step: step++,
2126
2126
  action: "create",
2127
- file: ".toolpilot/config.json",
2128
- note: "Call init_project_config to generate the config content, then write to .toolpilot/config.json"
2127
+ file: ".toolcairn/config.json",
2128
+ note: "Call init_project_config to generate the config content, then write to .toolcairn/config.json"
2129
2129
  });
2130
2130
  }
2131
2131
  if (!hasTrackerHtml) {
2132
2132
  setupSteps.push({
2133
2133
  step: step++,
2134
2134
  action: "create",
2135
- file: ".toolpilot/tracker.html",
2135
+ file: ".toolcairn/tracker.html",
2136
2136
  content: generateTrackerHtml2(eventsPath),
2137
- note: `Open .toolpilot/tracker.html in your browser to monitor MCP tool calls in real time. Set TOOLPILOT_EVENTS_PATH=${eventsPath} in your MCP server environment to enable event logging.`
2137
+ note: `Open .toolcairn/tracker.html in your browser to monitor MCP tool calls in real time. Set TOOLCAIRN_EVENTS_PATH=${eventsPath} in your MCP server environment to enable event logging.`
2138
2138
  });
2139
2139
  }
2140
2140
  setupSteps.push({
2141
2141
  step: step++,
2142
2142
  action: "append",
2143
2143
  file: ".gitignore",
2144
- content: "\n# ToolPilot\n.toolpilot/events.jsonl\n",
2145
- note: "Add .toolpilot/events.jsonl to .gitignore (the tracker event log)"
2144
+ content: "\n# ToolCairn\n.toolcairn/events.jsonl\n",
2145
+ note: "Add .toolcairn/events.jsonl to .gitignore (the tracker event log)"
2146
2146
  });
2147
2147
  const agentFileLabel = {
2148
2148
  claude: "CLAUDE.md",
@@ -2160,16 +2160,16 @@ async function handleToolcairnInit(args) {
2160
2160
  mcp_config_entry: mcpConfigEntry,
2161
2161
  events_path: eventsPath,
2162
2162
  summary: [
2163
- `ToolPilot setup for ${args.agent} agent in ${args.project_root}`,
2163
+ `ToolCairn setup for ${args.agent} agent in ${args.project_root}`,
2164
2164
  `Instructions will be added to: ${instructions.file_path}`,
2165
- `MCP server entry: toolpilot \u2192 ${mcpConfigFile}`,
2166
- hasToolpilotConfig ? ".toolpilot/config.json already exists \u2014 skipping init" : "Run init_project_config next to generate .toolpilot/config.json",
2167
- hasTrackerHtml ? ".toolpilot/tracker.html already exists \u2014 skipping" : "Tracker dashboard: open .toolpilot/tracker.html in browser"
2165
+ `MCP server entry: toolcairn \u2192 ${mcpConfigFile}`,
2166
+ hasToolcairnConfig ? ".toolcairn/config.json already exists \u2014 skipping init" : "Run init_project_config next to generate .toolcairn/config.json",
2167
+ hasTrackerHtml ? ".toolcairn/tracker.html already exists \u2014 skipping" : "Tracker dashboard: open .toolcairn/tracker.html in browser"
2168
2168
  ].join("\n"),
2169
- next_steps: hasToolpilotConfig ? "Setup complete. Open .toolpilot/tracker.html to monitor tool calls." : "After completing setup steps, call init_project_config to initialize .toolpilot/config.json."
2169
+ next_steps: hasToolcairnConfig ? "Setup complete. Open .toolcairn/tracker.html to monitor tool calls." : "After completing setup steps, call init_project_config to initialize .toolcairn/config.json."
2170
2170
  });
2171
2171
  } catch (e) {
2172
- logger3.error({ err: e }, "toolpilot_init failed");
2172
+ logger3.error({ err: e }, "toolcairn_init failed");
2173
2173
  return errResult("init_error", e instanceof Error ? e.message : String(e));
2174
2174
  }
2175
2175
  }
@@ -2187,7 +2187,7 @@ async function handleInitProjectConfig(args) {
2187
2187
  source: t.source,
2188
2188
  version: t.version,
2189
2189
  chosen_at: now,
2190
- chosen_reason: "Auto-detected from project files during toolpilot_init",
2190
+ chosen_reason: "Auto-detected from project files during toolcairn_init",
2191
2191
  alternatives_considered: []
2192
2192
  }));
2193
2193
  const config5 = {
@@ -2213,8 +2213,8 @@ async function handleInitProjectConfig(args) {
2213
2213
  const config_json = JSON.stringify(config5, null, 2);
2214
2214
  return okResult({
2215
2215
  config_json,
2216
- file_path: ".toolpilot/config.json",
2217
- instructions: "Create the directory .toolpilot/ in your project root (if it does not exist), then write this config_json content to .toolpilot/config.json. Also add .toolpilot/ to .gitignore if not already present.",
2216
+ file_path: ".toolcairn/config.json",
2217
+ instructions: "Create the directory .toolcairn/ in your project root (if it does not exist), then write this config_json content to .toolcairn/config.json. Also add .toolcairn/ to .gitignore if not already present.",
2218
2218
  confirmed_count: confirmedTools.length,
2219
2219
  next_step: confirmedTools.length > 0 ? "Config initialized with auto-detected tools. Use search_tools to find any additional tools you need." : "Config initialized. Use classify_prompt \u2192 refine_requirement \u2192 search_tools to discover tools for your project."
2220
2220
  });
@@ -2260,13 +2260,13 @@ async function handleReadProjectConfig(args) {
2260
2260
  };
2261
2261
  });
2262
2262
  const non_oss_tools = config5.tools.confirmed.filter((t) => t.source === "non_oss").map((t) => t.name);
2263
- const toolpilot_indexed_tools = config5.tools.confirmed.filter((t) => t.source === "toolpilot").map((t) => t.name);
2263
+ const toolcairn_indexed_tools = config5.tools.confirmed.filter((t) => t.source === "toolcairn" || t.source === "toolpilot").map((t) => t.name);
2264
2264
  return okResult({
2265
2265
  project: config5.project,
2266
2266
  confirmed_tools: confirmedToolNames,
2267
2267
  pending_tools: pendingToolNames,
2268
2268
  non_oss_tools,
2269
- toolpilot_indexed_tools,
2269
+ toolcairn_indexed_tools,
2270
2270
  stale_tools: staleTools,
2271
2271
  total_confirmed: confirmedToolNames.length,
2272
2272
  total_pending: pendingToolNames.length,
@@ -2306,11 +2306,11 @@ async function handleUpdateProjectConfig(args) {
2306
2306
  if (!config5.tools.confirmed.some((t) => t.name === args.tool_name)) {
2307
2307
  const newTool = {
2308
2308
  name: args.tool_name,
2309
- source: data.source ?? "toolpilot",
2309
+ source: data.source ?? "toolcairn",
2310
2310
  github_url: data.github_url,
2311
2311
  version: data.version,
2312
2312
  chosen_at: now,
2313
- chosen_reason: data.chosen_reason ?? "Selected via ToolPilot",
2313
+ chosen_reason: data.chosen_reason ?? "Selected via ToolCairn",
2314
2314
  alternatives_considered: data.alternatives_considered ?? [],
2315
2315
  query_id: data.query_id,
2316
2316
  notes: data.notes
@@ -2321,7 +2321,7 @@ async function handleUpdateProjectConfig(args) {
2321
2321
  action: "add_tool",
2322
2322
  tool: args.tool_name,
2323
2323
  timestamp: now,
2324
- reason: data.chosen_reason ?? "Added via ToolPilot recommendation"
2324
+ reason: data.chosen_reason ?? "Added via ToolCairn recommendation"
2325
2325
  });
2326
2326
  break;
2327
2327
  }
@@ -2381,12 +2381,12 @@ async function handleUpdateProjectConfig(args) {
2381
2381
  const updated_config_json = JSON.stringify(config5, null, 2);
2382
2382
  return okResult({
2383
2383
  updated_config_json,
2384
- file_path: ".toolpilot/config.json",
2384
+ file_path: ".toolcairn/config.json",
2385
2385
  action_applied: args.action,
2386
2386
  tool_name: args.tool_name,
2387
2387
  confirmed_count: config5.tools.confirmed.length,
2388
2388
  pending_count: config5.tools.pending_evaluation.length,
2389
- instructions: "Write updated_config_json to .toolpilot/config.json to persist this change."
2389
+ instructions: "Write updated_config_json to .toolcairn/config.json to persist this change."
2390
2390
  });
2391
2391
  } catch (e) {
2392
2392
  logger6.error({ err: e }, "update_project_config failed");
@@ -2642,7 +2642,7 @@ async function addToolsToServer(server) {
2642
2642
  server.registerTool(
2643
2643
  "get_stack",
2644
2644
  {
2645
- description: 'Build a complementary tool stack for a project use case. For best results, call refine_requirement first with classification "stack_building", evaluate its decomposition_prompt to get sub-needs, then pass each {sub_need_type, keyword_sentence} object as a sub_needs entry. This lets get_stack keyword-match per layer (e.g. "web-framework", "database", "auth") instead of one broad search. Falls back to balanced search when sub_needs is omitted.',
2645
+ description: 'Build a complementary tool stack for a project use case. For best results, call refine_requirement first with classification "stack_building", evaluate its decomposition_prompt to get sub-needs, then pass each {sub_need_type, keyword_sentence} object as a sub_needs entry. This lets get_stack keyword-match per layer (e.g. "web-framework", "database", "auth") instead of one broad search. Falls back to balanced search when sub_needs is omitted. Each tool in the returned stack also carries a `version` object with the recommended version that is cross-compatible with the rest of the stack (downgraded from latest if needed to satisfy peer constraints), plus a top-level `compatibility_matrix` + `stack_compatibility` summarising cross-tool version fit.',
2646
2646
  inputSchema: getStackSchema
2647
2647
  },
2648
2648
  wrap("get_stack", async (args) => remote.getStack(args))