cliskill 1.1.8 → 1.2.0

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.
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-6IZLJMAL.js";
5
- import "../chunk-S7IQHES2.js";
4
+ } from "../chunk-RLXS6WEQ.js";
5
+ import "../chunk-CISBSDJM.js";
6
6
  export {
7
7
  runCli
8
8
  };
@@ -1,3 +1,10 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
1
8
  // src/config/paths.ts
2
9
  import { join } from "path";
3
10
  import { homedir } from "os";
@@ -82,6 +89,7 @@ function getConfigSearchPaths() {
82
89
  }
83
90
 
84
91
  export {
92
+ __require,
85
93
  getDataDir,
86
94
  ensureDataDir,
87
95
  getConfigPath,
@@ -100,4 +108,4 @@ export {
100
108
  resolveConfigPath,
101
109
  getConfigSearchPaths
102
110
  };
103
- //# sourceMappingURL=chunk-S7IQHES2.js.map
111
+ //# sourceMappingURL=chunk-CISBSDJM.js.map
@@ -1 +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,YAAY,oB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,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":[]}
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,YAAY,oBAAmC;AAiB/E,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AACxB,IAAM,yBAAyB;AAMxB,SAAS,aAAqB;AACnC,SAAO,KAAK,QAAQ,GAAG,aAAa;AACtC;AAGO,SAAS,gBAAwB;AACtC,QAAM,MAAM,WAAW;AACvB,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,cAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AAAA,EACpC;AACA,SAAO;AACT;AAGO,SAAS,gBAAwB;AACtC,SAAO,KAAK,WAAW,GAAG,eAAe;AAC3C;AAGO,SAAS,sBAA8B;AAC5C,SAAO,KAAK,QAAQ,GAAG,sBAAsB;AAC/C;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