@codemap-ai/shared
Advanced tools
| /** | ||
| * Shared utility functions for slash command outputs | ||
| */ | ||
| /** Format tools as markdown table with descriptions */ | ||
| export declare function formatToolsTable(tools: Array<{ | ||
| name: string; | ||
| description?: string; | ||
| }>): string; | ||
| /** Format tools grouped by server prefix as markdown lists */ | ||
| export declare function formatToolsByServer(tools: Array<{ | ||
| name: string; | ||
| }>): string; | ||
| /** Format MCP server statuses */ | ||
| export declare function formatMcpServers(servers: Array<{ | ||
| name: string; | ||
| connected: boolean; | ||
| connecting?: boolean; | ||
| toolCount: number; | ||
| transport: string; | ||
| error?: string; | ||
| }>): string; | ||
| /** Format model list as markdown bullet list */ | ||
| export declare function formatModelList(models: Array<{ | ||
| id: string; | ||
| name?: string; | ||
| }>): string; | ||
| //# sourceMappingURL=helpers.d.ts.map |
| {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/slash-commands/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uDAAuD;AACvD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAS7F;AAED,8DAA8D;AAC9D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAyB1E;AAED,iCAAiC;AACjC,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,GACD,MAAM,CAuBR;AAED,gDAAgD;AAChD,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAapF"} |
| "use strict"; | ||
| /** | ||
| * Shared utility functions for slash command outputs | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.formatToolsTable = formatToolsTable; | ||
| exports.formatToolsByServer = formatToolsByServer; | ||
| exports.formatMcpServers = formatMcpServers; | ||
| exports.formatModelList = formatModelList; | ||
| /** Format tools as markdown table with descriptions */ | ||
| function formatToolsTable(tools) { | ||
| const lines = ["| Command | Description |", "|---------|-------------|"]; | ||
| for (const tool of tools) { | ||
| const desc = tool.description || "No description available"; | ||
| lines.push(`| \`/${tool.name}\` | ${desc} |`); | ||
| } | ||
| return lines.join("\n"); | ||
| } | ||
| /** Format tools grouped by server prefix as markdown lists */ | ||
| function formatToolsByServer(tools) { | ||
| // Group by server prefix (first part before _) | ||
| const grouped = new Map(); | ||
| for (const tool of tools) { | ||
| const parts = tool.name.split("_"); | ||
| const serverPrefix = parts[0] || "unknown"; | ||
| if (!grouped.has(serverPrefix)) { | ||
| grouped.set(serverPrefix, []); | ||
| } | ||
| grouped.get(serverPrefix).push(tool.name); | ||
| } | ||
| let output = "# Available Tools\n\n"; | ||
| for (const [server, toolNames] of grouped.entries()) { | ||
| output += `### \`${server}\`\n\n`; | ||
| for (const name of toolNames.sort()) { | ||
| output += `- \`${name}\`\n`; | ||
| } | ||
| output += "\n"; | ||
| } | ||
| return output.trim() + "\n"; | ||
| } | ||
| /** Format MCP server statuses */ | ||
| function formatMcpServers(servers) { | ||
| if (servers.length === 0) { | ||
| return "# MCP Servers\n\nNo MCP servers configured."; | ||
| } | ||
| let output = "# MCP Servers\n\n"; | ||
| for (const s of servers) { | ||
| const status = s.connected ? "connected" : s.connecting ? "connecting" : "disconnected"; | ||
| const icon = s.connected ? "✅" : s.connecting ? "⏳" : "❌"; | ||
| output += `#### ${icon} ${s.name} (${s.toolCount} tools)\n\n`; | ||
| output += `- **Status**: ${status}\n`; | ||
| output += `- **Transport**: ${s.transport}\n`; | ||
| if (s.error) { | ||
| output += `- **Error**: ${s.error}\n`; | ||
| } | ||
| output += "\n"; | ||
| } | ||
| return output.trim(); | ||
| } | ||
| /** Format model list as markdown bullet list */ | ||
| function formatModelList(models) { | ||
| if (models.length === 0) { | ||
| return "# Available Models\n\nNo models available."; | ||
| } | ||
| let output = "# Available Models\n\n"; | ||
| for (const model of models) { | ||
| const name = model.name || model.id; | ||
| output += `- \`${model.id}\` - ${name}\n`; | ||
| } | ||
| return output.trim(); | ||
| } |
| /** | ||
| * Slash Commands Module | ||
| * | ||
| * Universal slash commands shared between CLI and Desktop | ||
| */ | ||
| export type { Appender, UniversalCommandContext, UniversalCommand, } from "./types/index.js"; | ||
| export * as helpers from "./helpers.js"; | ||
| export { helpCommand } from "./universal/help.js"; | ||
| export { statusCommand } from "./universal/status.js"; | ||
| export { toolsCommand } from "./universal/tools.js"; | ||
| export { modelsCommand } from "./universal/models.js"; | ||
| export { mcpCommand } from "./universal/mcp.js"; | ||
| import type { UniversalCommand } from "./types/index.js"; | ||
| export declare const universalCommands: readonly UniversalCommand[]; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slash-commands/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,QAAQ,EACR,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,EAAE,SAAS,gBAAgB,EAMxD,CAAC"} |
| "use strict"; | ||
| /** | ||
| * Slash Commands Module | ||
| * | ||
| * Universal slash commands shared between CLI and Desktop | ||
| */ | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
| Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
| }) : function(o, v) { | ||
| o["default"] = v; | ||
| }); | ||
| var __importStar = (this && this.__importStar) || (function () { | ||
| var ownKeys = function(o) { | ||
| ownKeys = Object.getOwnPropertyNames || function (o) { | ||
| var ar = []; | ||
| for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
| return ar; | ||
| }; | ||
| return ownKeys(o); | ||
| }; | ||
| return function (mod) { | ||
| if (mod && mod.__esModule) return mod; | ||
| var result = {}; | ||
| if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
| __setModuleDefault(result, mod); | ||
| return result; | ||
| }; | ||
| })(); | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.universalCommands = exports.mcpCommand = exports.modelsCommand = exports.toolsCommand = exports.statusCommand = exports.helpCommand = exports.helpers = void 0; | ||
| // Helpers | ||
| exports.helpers = __importStar(require("./helpers.js")); | ||
| // Individual Commands | ||
| var help_js_1 = require("./universal/help.js"); | ||
| Object.defineProperty(exports, "helpCommand", { enumerable: true, get: function () { return help_js_1.helpCommand; } }); | ||
| var status_js_1 = require("./universal/status.js"); | ||
| Object.defineProperty(exports, "statusCommand", { enumerable: true, get: function () { return status_js_1.statusCommand; } }); | ||
| var tools_js_1 = require("./universal/tools.js"); | ||
| Object.defineProperty(exports, "toolsCommand", { enumerable: true, get: function () { return tools_js_1.toolsCommand; } }); | ||
| var models_js_1 = require("./universal/models.js"); | ||
| Object.defineProperty(exports, "modelsCommand", { enumerable: true, get: function () { return models_js_1.modelsCommand; } }); | ||
| var mcp_js_1 = require("./universal/mcp.js"); | ||
| Object.defineProperty(exports, "mcpCommand", { enumerable: true, get: function () { return mcp_js_1.mcpCommand; } }); | ||
| // Re-export all as an array for consumers | ||
| const help_js_2 = require("./universal/help.js"); | ||
| const status_js_2 = require("./universal/status.js"); | ||
| const tools_js_2 = require("./universal/tools.js"); | ||
| const models_js_2 = require("./universal/models.js"); | ||
| const mcp_js_2 = require("./universal/mcp.js"); | ||
| exports.universalCommands = [ | ||
| help_js_2.helpCommand, | ||
| status_js_2.statusCommand, | ||
| tools_js_2.toolsCommand, | ||
| models_js_2.modelsCommand, | ||
| mcp_js_2.mcpCommand, | ||
| ]; |
| /** Interface for message append operations - used by slash commands */ | ||
| export interface Appender { | ||
| /** Append a system or user message with markdown content */ | ||
| appendMessage: (msg: { | ||
| role: "system" | "user"; | ||
| content: string; | ||
| }) => void; | ||
| /** Get current messages history */ | ||
| getMessages: () => { | ||
| role: string; | ||
| content: string; | ||
| timestamp?: number; | ||
| }[]; | ||
| /** Set/replace all messages */ | ||
| setMessages: (messages: Array<{ | ||
| role: string; | ||
| content: string; | ||
| timestamp?: number; | ||
| }>) => void; | ||
| } | ||
| /** Shared context available to universal slash commands */ | ||
| export interface UniversalCommandContext extends Appender { | ||
| /** Current active model name */ | ||
| currentModel: string; | ||
| /** Available models list */ | ||
| availableModels?: string[]; | ||
| /** MCP tool client for executing tools */ | ||
| toolClient: { | ||
| callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>; | ||
| listAllowedTools: () => Promise<Array<{ | ||
| name: string; | ||
| }>>; | ||
| getServerStatuses: () => Array<{ | ||
| name: string; | ||
| connected: boolean; | ||
| toolCount: number; | ||
| transport: string; | ||
| }>; | ||
| }; | ||
| /** Get workspace path */ | ||
| workspacePath: string; | ||
| /** Get/set connection status */ | ||
| isConnected: boolean; | ||
| setIsConnected: (connected: boolean) => void; | ||
| } | ||
| /** Universal slash command definition */ | ||
| export interface UniversalCommand { | ||
| /** Command name without / prefix (e.g., "help", "status") */ | ||
| name: string; | ||
| /** User-facing description */ | ||
| description: string; | ||
| /** Execute command - returns markdown output */ | ||
| execute: (args: string, ctx: UniversalCommandContext) => Promise<string>; | ||
| } | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/slash-commands/types/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,MAAM,WAAW,QAAQ;IACvB,4DAA4D;IAC5D,aAAa,EAAE,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAE3E,mCAAmC;IACnC,WAAW,EAAE,MAAM;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE3E,+BAA+B;IAC/B,WAAW,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;CAC/F;AAED,2DAA2D;AAC3D,MAAM,WAAW,uBAAwB,SAAQ,QAAQ;IACvD,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;IAErB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B,0CAA0C;IAC1C,UAAU,EAAE;QACV,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5E,gBAAgB,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC,CAAC;QACzD,iBAAiB,EAAE,MAAM,KAAK,CAAC;YAC7B,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,OAAO,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC,CAAC;KACJ,CAAC;IAEF,yBAAyB;IACzB,aAAa,EAAE,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,yCAAyC;AACzC,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IAEpB,gDAAgD;IAChD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,uBAAuB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1E"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); |
| import type { UniversalCommand } from "../types/index.js"; | ||
| export declare const helpCommand: UniversalCommand; | ||
| //# sourceMappingURL=help.d.ts.map |
| {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/slash-commands/universal/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,WAAW,EAAE,gBA4BzB,CAAC"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.helpCommand = void 0; | ||
| exports.helpCommand = { | ||
| name: "help", | ||
| description: "Show this help", | ||
| execute: async (_args) => { | ||
| const commands = [ | ||
| { name: "help", description: "Show this help" }, | ||
| { name: "status", description: "Show connection status" }, | ||
| { name: "mcp", description: "Show MCP servers" }, | ||
| { name: "login", description: "Log in to CodeMap" }, | ||
| { name: "logout", description: "Log out" }, | ||
| { name: "tools", description: "List available tools" }, | ||
| { name: "models", description: "List available models" }, | ||
| { name: "projects", description: "List cloud projects" }, | ||
| { name: "link", description: "Link a project" }, | ||
| { name: "clear", description: "Clear conversation" }, | ||
| ]; | ||
| let output = "# Available Commands\n\n| Command | Description |\n"; | ||
| output += "|---------|-------------|\n"; | ||
| for (const cmd of commands) { | ||
| output += `| \`${cmd.name}\` | ${cmd.description} |\n`; | ||
| } | ||
| output += "\n@mention Type @ to autocomplete file paths\n"; | ||
| return output; | ||
| }, | ||
| }; |
| import type { UniversalCommand } from "../types/index.js"; | ||
| export declare const mcpCommand: UniversalCommand; | ||
| //# sourceMappingURL=mcp.d.ts.map |
| {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/slash-commands/universal/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,mBAAmB,CAAC;AAGnF,eAAO,MAAM,UAAU,EAAE,gBAkBxB,CAAC"} |
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
| Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
| }) : function(o, v) { | ||
| o["default"] = v; | ||
| }); | ||
| var __importStar = (this && this.__importStar) || (function () { | ||
| var ownKeys = function(o) { | ||
| ownKeys = Object.getOwnPropertyNames || function (o) { | ||
| var ar = []; | ||
| for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
| return ar; | ||
| }; | ||
| return ownKeys(o); | ||
| }; | ||
| return function (mod) { | ||
| if (mod && mod.__esModule) return mod; | ||
| var result = {}; | ||
| if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
| __setModuleDefault(result, mod); | ||
| return result; | ||
| }; | ||
| })(); | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.mcpCommand = void 0; | ||
| const helpers = __importStar(require("../helpers.js")); | ||
| exports.mcpCommand = { | ||
| name: "mcp", | ||
| description: "Show MCP servers", | ||
| execute: async (_args, ctx) => { | ||
| const { toolClient } = ctx; | ||
| try { | ||
| const servers = toolClient.getServerStatuses(); | ||
| if (servers.length === 0) { | ||
| return "# MCP Servers\n\nNo MCP servers configured."; | ||
| } | ||
| return helpers.formatMcpServers(servers); | ||
| } | ||
| catch (error) { | ||
| return `# MCP Servers\n\nError loading MCP servers: ${error.message}`; | ||
| } | ||
| }, | ||
| }; |
| import type { UniversalCommand } from "../types/index.js"; | ||
| export declare const modelsCommand: UniversalCommand; | ||
| //# sourceMappingURL=models.d.ts.map |
| {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/slash-commands/universal/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,mBAAmB,CAAC;AAEnF,eAAO,MAAM,aAAa,EAAE,gBAsB3B,CAAC"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.modelsCommand = void 0; | ||
| exports.modelsCommand = { | ||
| name: "models", | ||
| description: "List available models", | ||
| execute: async (_args, ctx) => { | ||
| const { currentModel, availableModels } = ctx; | ||
| if (!availableModels || availableModels.length === 0) { | ||
| return `# Available Models\n\nNo models available.\n\nCurrently selected: \`${currentModel}\``; | ||
| } | ||
| let output = "# Available Models\n\n"; | ||
| output += `**Currently Selected**: \`${currentModel}\`\n\n`; | ||
| output += "**Other Available**:\n\n"; | ||
| for (const id of availableModels.sort()) { | ||
| const isCurrent = id === currentModel; | ||
| const marker = isCurrent ? "✅ " : ""; | ||
| output += `- ${marker}\`${id}\`\n`; | ||
| } | ||
| return output.trim() + "\n"; | ||
| }, | ||
| }; |
| import type { UniversalCommand } from "../types/index.js"; | ||
| export declare const statusCommand: UniversalCommand; | ||
| //# sourceMappingURL=status.d.ts.map |
| {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/slash-commands/universal/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,mBAAmB,CAAC;AAGnF,eAAO,MAAM,aAAa,EAAE,gBAmB3B,CAAC"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.statusCommand = void 0; | ||
| exports.statusCommand = { | ||
| name: "status", | ||
| description: "Show connection status", | ||
| execute: async (_args, ctx) => { | ||
| const { isConnected, currentModel, availableModels, workspacePath, toolClient } = ctx; | ||
| const servers = toolClient.getServerStatuses(); | ||
| const connectedServers = servers.filter((s) => s.connected).length; | ||
| const totalTools = servers.reduce((sum, s) => sum + s.toolCount, 0); | ||
| let output = "# Connection Status\n\n"; | ||
| output += `- **Connected**: ${isConnected ? "✅" : "❌"}\n`; | ||
| output += `- **Model**: \`${currentModel}\`\n`; | ||
| output += `- **Available Models**: ${availableModels?.length || 0}\n`; | ||
| output += `- **MCP Servers**: ${connectedServers}/${servers.length} (${totalTools} tools)\n`; | ||
| output += `- **Workspace**: \`${workspacePath}\`\n`; | ||
| return output.trim() + "\n"; | ||
| }, | ||
| }; |
| import type { UniversalCommand } from "../types/index.js"; | ||
| export declare const toolsCommand: UniversalCommand; | ||
| //# sourceMappingURL=tools.d.ts.map |
| {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/slash-commands/universal/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA2B,MAAM,mBAAmB,CAAC;AAGnF,eAAO,MAAM,YAAY,EAAE,gBAoB1B,CAAC"} |
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
| Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
| }) : function(o, v) { | ||
| o["default"] = v; | ||
| }); | ||
| var __importStar = (this && this.__importStar) || (function () { | ||
| var ownKeys = function(o) { | ||
| ownKeys = Object.getOwnPropertyNames || function (o) { | ||
| var ar = []; | ||
| for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; | ||
| return ar; | ||
| }; | ||
| return ownKeys(o); | ||
| }; | ||
| return function (mod) { | ||
| if (mod && mod.__esModule) return mod; | ||
| var result = {}; | ||
| if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); | ||
| __setModuleDefault(result, mod); | ||
| return result; | ||
| }; | ||
| })(); | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.toolsCommand = void 0; | ||
| const helpers = __importStar(require("../helpers.js")); | ||
| exports.toolsCommand = { | ||
| name: "tools", | ||
| description: "List available tools", | ||
| execute: async (_args, ctx) => { | ||
| const { toolClient } = ctx; | ||
| try { | ||
| const tools = await toolClient.listAllowedTools(); | ||
| if (tools.length === 0) { | ||
| return "# Available Tools\n\nNo tools available."; | ||
| } | ||
| tools.sort((a, b) => a.name.localeCompare(b.name)); | ||
| return helpers.formatToolsByServer(tools); | ||
| } | ||
| catch (error) { | ||
| return `# Available Tools\n\nError loading tools: ${error.message}`; | ||
| } | ||
| }, | ||
| }; |
+8
-0
@@ -17,2 +17,10 @@ export * from "./auth.js"; | ||
| export * from "./project-mcp.js"; | ||
| export * from "./slash-commands/types/index.js"; | ||
| export * from "./slash-commands/helpers.js"; | ||
| export * from "./slash-commands/index.js"; | ||
| export * from "./slash-commands/universal/help.js"; | ||
| export * from "./slash-commands/universal/status.js"; | ||
| export * from "./slash-commands/universal/tools.js"; | ||
| export * from "./slash-commands/universal/models.js"; | ||
| export * from "./slash-commands/universal/mcp.js"; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC"} |
+9
-0
@@ -33,1 +33,10 @@ "use strict"; | ||
| __exportStar(require("./project-mcp.js"), exports); | ||
| // Slash commands exports | ||
| __exportStar(require("./slash-commands/types/index.js"), exports); | ||
| __exportStar(require("./slash-commands/helpers.js"), exports); | ||
| __exportStar(require("./slash-commands/index.js"), exports); | ||
| __exportStar(require("./slash-commands/universal/help.js"), exports); | ||
| __exportStar(require("./slash-commands/universal/status.js"), exports); | ||
| __exportStar(require("./slash-commands/universal/tools.js"), exports); | ||
| __exportStar(require("./slash-commands/universal/models.js"), exports); | ||
| __exportStar(require("./slash-commands/universal/mcp.js"), exports); |
+1
-1
| { | ||
| "name": "@codemap-ai/shared", | ||
| "version": "2.1.0", | ||
| "version": "3.0.0", | ||
| "main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
109837
25.3%77
45.28%1984
28.5%