cliskill 1.1.3 → 1.1.4

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-V73UZD27.js";
5
+ import "../chunk-S7IQHES2.js";
6
6
  export {
7
7
  runCli
8
8
  };
@@ -100,4 +100,4 @@ export {
100
100
  resolveConfigPath,
101
101
  getConfigSearchPaths
102
102
  };
103
- //# sourceMappingURL=chunk-AJENHWD3.js.map
103
+ //# sourceMappingURL=chunk-S7IQHES2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config/paths.ts"],"sourcesContent":["import { join } from 'node:path'\r\nimport { homedir } from 'node:os'\r\nimport { existsSync, mkdirSync, renameSync, readFileSync, writeFileSync } from 'node:fs'\r\n\r\n/**\r\n * Centralized path management for all cliskill data.\r\n *\r\n * All user data is stored under ~/.cliskill/:\r\n * config.json — main configuration\r\n * sessions/ — conversation session history\r\n * skills/ — global user skills\r\n * history.jsonl — command history\r\n * scheduled_tasks.json — cron/scheduled tasks\r\n * keybindings.json — custom keybindings\r\n * Info.plist — macOS URL scheme registration\r\n * tmp/ — temporary files\r\n * memory/ — global memory store\r\n */\r\n\r\nconst DATA_DIR_NAME = '.cliskill'\r\nconst CONFIG_FILENAME = 'config.json'\r\nconst LEGACY_CONFIG_FILENAME = '.cliskillrc.json'\r\n\r\n/** Known legacy/alternate directory names to migrate from */\r\nconst LEGACY_DIR_NAMES = ['.cliskill11', '.cliskill-dev', '.cliskill_old']\r\n\r\n/** Get the base data directory: ~/.cliskill */\r\nexport function getDataDir(): string {\r\n return join(homedir(), DATA_DIR_NAME)\r\n}\r\n\r\n/** Ensure the data directory exists and return its path */\r\nexport function ensureDataDir(): string {\r\n const dir = getDataDir()\r\n if (!existsSync(dir)) {\r\n mkdirSync(dir, { recursive: true })\r\n }\r\n return dir\r\n}\r\n\r\n/** Path to the main config file: ~/.cliskill/config.json */\r\nexport function getConfigPath(): string {\r\n return join(getDataDir(), CONFIG_FILENAME)\r\n}\r\n\r\n/** Path to the legacy config file: ~/.cliskillrc.json */\r\nexport function getLegacyConfigPath(): string {\r\n return join(homedir(), LEGACY_CONFIG_FILENAME)\r\n}\r\n\r\n/** Path to sessions directory: ~/.cliskill/sessions/ */\r\nexport function getSessionsDir(): string {\r\n return join(getDataDir(), 'sessions')\r\n}\r\n\r\n/** Path to global skills directory: ~/.cliskill/skills/ */\r\nexport function getGlobalSkillsDir(): string {\r\n return join(getDataDir(), 'skills')\r\n}\r\n\r\n/** Path to command history: ~/.cliskill/history.jsonl */\r\nexport function getHistoryPath(): string {\r\n return join(getDataDir(), 'history.jsonl')\r\n}\r\n\r\n/** Path to scheduled tasks: ~/.cliskill/scheduled_tasks.json */\r\nexport function getScheduledTasksPath(): string {\r\n return join(getDataDir(), 'scheduled_tasks.json')\r\n}\r\n\r\n/** Path to custom keybindings: ~/.cliskill/keybindings.json */\r\nexport function getKeybindingsPath(): string {\r\n return join(getDataDir(), 'keybindings.json')\r\n}\r\n\r\n/** Path to macOS URL scheme plist: ~/.cliskill/Info.plist */\r\nexport function getPlistPath(): string {\r\n return join(getDataDir(), 'Info.plist')\r\n}\r\n\r\n/** Path to temp directory: ~/.cliskill/tmp/ */\r\nexport function getTmpDir(): string {\r\n return join(getDataDir(), 'tmp')\r\n}\r\n\r\n/** Path to global memory directory: ~/.cliskill/memory/ */\r\nexport function getGlobalMemoryDir(): string {\r\n return join(getDataDir(), 'memory')\r\n}\r\n\r\n/** Path to history subdirectory: ~/.cliskill/history/ */\r\nexport function getHistoryDir(): string {\r\n return join(getDataDir(), 'history')\r\n}\r\n\r\n/** Path to disk space check file: ~/.cliskill/history.json */\r\nexport function getDiskHistoryPath(): string {\r\n return join(getDataDir(), 'history.json')\r\n}\r\n\r\n/**\r\n * Migrate legacy config (~/.cliskillrc.json) to new location (~/.cliskill/config.json).\r\n * Returns true if migration was performed.\r\n */\r\nexport function migrateLegacyConfig(): boolean {\r\n const legacyPath = getLegacyConfigPath()\r\n const newPath = getConfigPath()\r\n\r\n if (!existsSync(legacyPath)) return false\r\n if (existsSync(newPath)) return false\r\n\r\n try {\r\n // Validate the legacy config is valid JSON before migrating\r\n const content = readFileSync(legacyPath, 'utf-8')\r\n JSON.parse(content)\r\n\r\n ensureDataDir()\r\n renameSync(legacyPath, newPath)\r\n return true\r\n } catch {\r\n return false\r\n }\r\n}\r\n\r\n/**\r\n * Get config path, checking both new and legacy locations.\r\n * Returns the path that exists, preferring the new location.\r\n */\r\nexport function resolveConfigPath(): string {\r\n const newPath = getConfigPath()\r\n if (existsSync(newPath)) return newPath\r\n\r\n const legacyPath = getLegacyConfigPath()\r\n if (existsSync(legacyPath)) return legacyPath\r\n\r\n return newPath\r\n}\r\n\r\n/**\r\n * Get all config search paths in priority order.\r\n * Used by doctor and loader to find config files.\r\n */\r\nexport function getConfigSearchPaths(): string[] {\r\n return [\r\n getConfigPath(),\r\n getLegacyConfigPath(),\r\n join(process.cwd(), '.cliskillrc.json'),\r\n ]\r\n}\r\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,YAAY,WAAW,YA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,UAAM,UAAU,aAAa,YAAY,OAAO;AAChD,SAAK,MAAM,OAAO;AAElB,kBAAc;AACd,eAAW,YAAY,OAAO;AAC9B,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAMO,SAAS,oBAA4B;AAC1C,QAAM,UAAU,cAAc;AAC9B,MAAI,WAAW,OAAO,EAAG,QAAO;AAEhC,QAAM,aAAa,oBAAoB;AACvC,MAAI,WAAW,UAAU,EAAG,QAAO;AAEnC,SAAO;AACT;AAMO,SAAS,uBAAiC;AAC/C,SAAO;AAAA,IACL,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,KAAK,QAAQ,IAAI,GAAG,kBAAkB;AAAA,EACxC;AACF;","names":[]}
@@ -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
@@ -10873,7 +10887,7 @@ var DeepLinkHandler = class {
10873
10887
  </dict>
10874
10888
  </plist>`;
10875
10889
  const { writeFile: writeFile5 } = await import("fs/promises");
10876
- const { getPlistPath } = await import("./paths-OODUHG6V.js");
10890
+ const { getPlistPath } = await import("./paths-FVFXSRUD.js");
10877
10891
  const plistPath = getPlistPath();
10878
10892
  await writeFile5(plistPath, plistContent, "utf-8");
10879
10893
  try {
@@ -10888,7 +10902,7 @@ var DeepLinkHandler = class {
10888
10902
  }
10889
10903
  async unregisterMacOS() {
10890
10904
  const { unlink: unlink4 } = await import("fs/promises");
10891
- const { getPlistPath } = await import("./paths-OODUHG6V.js");
10905
+ const { getPlistPath } = await import("./paths-FVFXSRUD.js");
10892
10906
  const plistPath = getPlistPath();
10893
10907
  try {
10894
10908
  await unlink4(plistPath);
@@ -10898,7 +10912,7 @@ var DeepLinkHandler = class {
10898
10912
  async checkMacOS() {
10899
10913
  try {
10900
10914
  const { stat: stat5 } = await import("fs/promises");
10901
- const { getPlistPath } = await import("./paths-OODUHG6V.js");
10915
+ const { getPlistPath } = await import("./paths-FVFXSRUD.js");
10902
10916
  const plistPath = getPlistPath();
10903
10917
  await stat5(plistPath);
10904
10918
  return true;
@@ -12180,4 +12194,4 @@ export {
12180
12194
  MCPConnectionManager,
12181
12195
  runCli
12182
12196
  };
12183
- //# sourceMappingURL=chunk-SDHXIBKZ.js.map
12197
+ //# sourceMappingURL=chunk-V73UZD27.js.map