cliskill 1.1.3 → 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/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ## Что это
18
18
 
19
- cliskill — CLI-инструмент для работы с LLM прямо из терминала. Подключает любого провайдера через стандартный `/chat/completions` API, даёт 15 встроенных инструментов, мульти-агентную координацию и MCP-интеграцию. Без подписок, без vendor lock-in.
19
+ cliskill — CLI-инструмент для работы с LLM прямо из терминала. Подключает любого провайдера через стандартный `/chat/completions` API, даёт 22 встроенных инструментов, мульти-агентную координацию и MCP-интеграцию. Без подписок, без vendor lock-in.
20
20
 
21
21
  ## Быстрый старт
22
22
 
@@ -224,6 +224,10 @@ ANTHROPIC_BASE_URL="https://api.anthropic.com"
224
224
 
225
225
  ### Настройка
226
226
 
227
+ Поддерживаются два формата конфигурации — **массив** (нативный) и **объект** (Claude/Cursor совместимый):
228
+
229
+ **Формат массива:**
230
+
227
231
  ```json
228
232
  {
229
233
  "mcpServers": [
@@ -232,23 +236,36 @@ ANTHROPIC_BASE_URL="https://api.anthropic.com"
232
236
  "command": "npx",
233
237
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"],
234
238
  "transport": "stdio"
239
+ }
240
+ ]
241
+ }
242
+ ```
243
+
244
+ **Формат объекта (Claude/Cursor совместимый):**
245
+
246
+ ```json
247
+ {
248
+ "mcpServers": {
249
+ "filesystem": {
250
+ "command": "npx",
251
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]
235
252
  },
236
- {
237
- "name": "github",
253
+ "github": {
238
254
  "command": "npx",
239
255
  "args": ["-y", "@modelcontextprotocol/server-github"],
240
- "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" },
241
- "transport": "stdio"
256
+ "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_token" }
242
257
  }
243
- ]
258
+ }
244
259
  }
245
260
  ```
246
261
 
262
+ В объектном формате ключ становится `name`, а `transport` по умолчанию `stdio`.
263
+
247
264
  ### Поля
248
265
 
249
266
  | Поле | Тип | Обязательное | Описание |
250
267
  |------|-----|:---:|----------|
251
- | `name` | string | да | Уникальное имя |
268
+ | `name` | string | да* | Уникальное имя (авто из ключа объекта) |
252
269
  | `command` | string | да | Команда запуска |
253
270
  | `args` | string[] | нет | Аргументы |
254
271
  | `env` | object | нет | Переменные окружения |
@@ -359,6 +376,10 @@ npm run typecheck # Проверка типов
359
376
 
360
377
  ## Changelog
361
378
 
379
+ ### v1.1.4
380
+
381
+ - MCP config compatibility — поддержка объектного формата `mcpServers` (Claude/Cursor совместимый), автоматическая конвертация в массив через `z.preprocess`
382
+
362
383
  ### v1.1.2
363
384
 
364
385
  - Anthropic Claude integration — Messages API с streaming, tool use, кастомный Base URL
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-SDHXIBKZ.js";
5
- import "../chunk-AJENHWD3.js";
4
+ } from "../chunk-GEH466DM.js";
5
+ import "../chunk-S7IQHES2.js";
6
6
  export {
7
7
  runCli
8
8
  };
@@ -8,7 +8,7 @@ import {
8
8
  getSessionsDir,
9
9
  migrateLegacyConfig,
10
10
  resolveConfigPath
11
- } from "./chunk-AJENHWD3.js";
11
+ } from "./chunk-S7IQHES2.js";
12
12
 
13
13
  // src/bootstrap/cli.ts
14
14
  import { Command } from "commander";
@@ -149,8 +149,22 @@ var appConfigSchema = z.object({
149
149
  maxMemorySize: z.number().default(50),
150
150
  idleThreshold: z.number().default(3e5)
151
151
  }).default({}),
152
- /** MCP servers — external tool providers via Model Context Protocol */
153
- mcpServers: z.array(mcpServerSchema).default([])
152
+ /** MCP servers — external tool providers via Model Context Protocol.
153
+ * Accepts both array format (our native) and object/map format (Claude/Cursor compat).
154
+ * Object format: { "server-name": { command, args, env, transport } }
155
+ * Array format: [{ name, command, args, env, transport }]
156
+ */
157
+ mcpServers: z.preprocess(
158
+ (val) => {
159
+ if (val && typeof val === "object" && !Array.isArray(val)) {
160
+ return Object.entries(val).map(
161
+ ([name, cfg]) => ({ name, ...cfg })
162
+ );
163
+ }
164
+ return val;
165
+ },
166
+ z.array(mcpServerSchema).default([])
167
+ )
154
168
  });
155
169
 
156
170
  // src/config/constants.ts
@@ -8310,6 +8324,27 @@ You have been invoked in the following environment:
8310
8324
  - Hostname: ${hostname()}
8311
8325
  - Shell: ${isWin ? "cmd.exe (use Windows-compatible commands)" : "bash/zsh"}`;
8312
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
+ }
8313
8348
  function buildSystemPrompt() {
8314
8349
  return [
8315
8350
  getIntroSection(),
@@ -8935,6 +8970,22 @@ async function connectMcpServers(config, toolRegistry) {
8935
8970
  mcpManager.registerShutdownHandlers();
8936
8971
  return mcpManager;
8937
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
+ }
8938
8989
  async function runTuiRepl(config) {
8939
8990
  const adapterRegistry = new AdapterRegistry();
8940
8991
  for (const provider of config.providers) {
@@ -8948,6 +8999,9 @@ async function runTuiRepl(config) {
8948
8999
  const modelRouter = buildModelRouter(adapterRegistry, config);
8949
9000
  const toolRegistry = createDefaultToolRegistry(modelRouter);
8950
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;
8951
9005
  ensureDataDir();
8952
9006
  const sessionSaver = new SessionSaver();
8953
9007
  await sessionSaver.init();
@@ -8966,7 +9020,7 @@ async function runTuiRepl(config) {
8966
9020
  adapter,
8967
9021
  toolRegistry,
8968
9022
  config,
8969
- systemPrompt: config.systemPrompt ?? buildSystemPrompt(),
9023
+ systemPrompt,
8970
9024
  cwd: process.cwd(),
8971
9025
  abortSignal: activeAbortController.signal,
8972
9026
  onPermissionRequest: async () => true,
@@ -9045,7 +9099,10 @@ async function runBasicRepl(config) {
9045
9099
  `);
9046
9100
  }
9047
9101
  const toolRegistry = createDefaultToolRegistry(modelRouter);
9048
- 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;
9049
9106
  const abortController = new AbortController();
9050
9107
  ensureDataDir();
9051
9108
  const sessionSaver = new SessionSaver();
@@ -9126,7 +9183,7 @@ async function runBasicRepl(config) {
9126
9183
  adapter,
9127
9184
  toolRegistry,
9128
9185
  config,
9129
- systemPrompt: config.systemPrompt ?? buildSystemPrompt(),
9186
+ systemPrompt,
9130
9187
  cwd: process.cwd(),
9131
9188
  abortSignal: abortController.signal,
9132
9189
  onPermissionRequest: async (operation, details) => {
@@ -10873,7 +10930,7 @@ var DeepLinkHandler = class {
10873
10930
  </dict>
10874
10931
  </plist>`;
10875
10932
  const { writeFile: writeFile5 } = await import("fs/promises");
10876
- const { getPlistPath } = await import("./paths-OODUHG6V.js");
10933
+ const { getPlistPath } = await import("./paths-FVFXSRUD.js");
10877
10934
  const plistPath = getPlistPath();
10878
10935
  await writeFile5(plistPath, plistContent, "utf-8");
10879
10936
  try {
@@ -10888,7 +10945,7 @@ var DeepLinkHandler = class {
10888
10945
  }
10889
10946
  async unregisterMacOS() {
10890
10947
  const { unlink: unlink4 } = await import("fs/promises");
10891
- const { getPlistPath } = await import("./paths-OODUHG6V.js");
10948
+ const { getPlistPath } = await import("./paths-FVFXSRUD.js");
10892
10949
  const plistPath = getPlistPath();
10893
10950
  try {
10894
10951
  await unlink4(plistPath);
@@ -10898,7 +10955,7 @@ var DeepLinkHandler = class {
10898
10955
  async checkMacOS() {
10899
10956
  try {
10900
10957
  const { stat: stat5 } = await import("fs/promises");
10901
- const { getPlistPath } = await import("./paths-OODUHG6V.js");
10958
+ const { getPlistPath } = await import("./paths-FVFXSRUD.js");
10902
10959
  const plistPath = getPlistPath();
10903
10960
  await stat5(plistPath);
10904
10961
  return true;
@@ -12180,4 +12237,4 @@ export {
12180
12237
  MCPConnectionManager,
12181
12238
  runCli
12182
12239
  };
12183
- //# sourceMappingURL=chunk-SDHXIBKZ.js.map
12240
+ //# sourceMappingURL=chunk-GEH466DM.js.map