cliskill 1.1.0 → 1.1.2

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.d.ts CHANGED
@@ -17,8 +17,8 @@ declare const providerSchema: z.ZodObject<{
17
17
  apiKey: z.ZodOptional<z.ZodString>;
18
18
  /** Default model to use */
19
19
  model: z.ZodString;
20
- /** API format: "openai-compatible" | "messages-compatible" | "glm-compatible" | "custom" */
21
- format: z.ZodEnum<["openai-compatible", "messages-compatible", "glm-compatible", "custom"]>;
20
+ /** API format: "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible" | "custom" */
21
+ format: z.ZodEnum<["openai-compatible", "messages-compatible", "glm-compatible", "anthropic-compatible", "custom"]>;
22
22
  /** Custom headers to send with each request */
23
23
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
24
24
  /** Request timeout in milliseconds */
@@ -29,7 +29,7 @@ declare const providerSchema: z.ZodObject<{
29
29
  name: string;
30
30
  baseUrl: string;
31
31
  model: string;
32
- format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible";
32
+ format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible";
33
33
  timeout: number;
34
34
  maxTokens: number;
35
35
  apiKey?: string | undefined;
@@ -38,7 +38,7 @@ declare const providerSchema: z.ZodObject<{
38
38
  name: string;
39
39
  baseUrl: string;
40
40
  model: string;
41
- format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible";
41
+ format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible";
42
42
  apiKey?: string | undefined;
43
43
  headers?: Record<string, string> | undefined;
44
44
  timeout?: number | undefined;
@@ -61,8 +61,8 @@ declare const appConfigSchema: z.ZodObject<{
61
61
  apiKey: z.ZodOptional<z.ZodString>;
62
62
  /** Default model to use */
63
63
  model: z.ZodString;
64
- /** API format: "openai-compatible" | "messages-compatible" | "glm-compatible" | "custom" */
65
- format: z.ZodEnum<["openai-compatible", "messages-compatible", "glm-compatible", "custom"]>;
64
+ /** API format: "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible" | "custom" */
65
+ format: z.ZodEnum<["openai-compatible", "messages-compatible", "glm-compatible", "anthropic-compatible", "custom"]>;
66
66
  /** Custom headers to send with each request */
67
67
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
68
68
  /** Request timeout in milliseconds */
@@ -73,7 +73,7 @@ declare const appConfigSchema: z.ZodObject<{
73
73
  name: string;
74
74
  baseUrl: string;
75
75
  model: string;
76
- format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible";
76
+ format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible";
77
77
  timeout: number;
78
78
  maxTokens: number;
79
79
  apiKey?: string | undefined;
@@ -82,7 +82,7 @@ declare const appConfigSchema: z.ZodObject<{
82
82
  name: string;
83
83
  baseUrl: string;
84
84
  model: string;
85
- format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible";
85
+ format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible";
86
86
  apiKey?: string | undefined;
87
87
  headers?: Record<string, string> | undefined;
88
88
  timeout?: number | undefined;
@@ -274,7 +274,7 @@ declare const appConfigSchema: z.ZodObject<{
274
274
  name: string;
275
275
  baseUrl: string;
276
276
  model: string;
277
- format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible";
277
+ format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible";
278
278
  timeout: number;
279
279
  maxTokens: number;
280
280
  apiKey?: string | undefined;
@@ -347,7 +347,7 @@ declare const appConfigSchema: z.ZodObject<{
347
347
  name: string;
348
348
  baseUrl: string;
349
349
  model: string;
350
- format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible";
350
+ format: "custom" | "openai-compatible" | "messages-compatible" | "glm-compatible" | "anthropic-compatible";
351
351
  apiKey?: string | undefined;
352
352
  headers?: Record<string, string> | undefined;
353
353
  timeout?: number | undefined;
@@ -1535,6 +1535,11 @@ declare class EnhancedMemoryStore {
1535
1535
  };
1536
1536
  prune(): Promise<number>;
1537
1537
  private getAllEntries;
1538
+ /**
1539
+ * Get a formatted summary of all memories for injection into system prompt.
1540
+ * Returns empty string if no memories stored.
1541
+ */
1542
+ getSummary(): string;
1538
1543
  private persist;
1539
1544
  }
1540
1545
 
@@ -2039,23 +2044,31 @@ interface CommandAnalysis {
2039
2044
  declare function parseCommand(input: string): ParsedCommand;
2040
2045
  declare function analyzeCommand(input: string): CommandAnalysis;
2041
2046
 
2042
- interface MCPServerConfig {
2043
- name: string;
2044
- command: string;
2045
- args: string[];
2046
- env?: Record<string, string>;
2047
- transport: 'stdio';
2047
+ /**
2048
+ * MCP (Model Context Protocol) type definitions.
2049
+ * Aligned with MCP specification 2024-11-05 and @modelcontextprotocol/sdk types.
2050
+ */
2051
+ /** Tool annotations as defined by MCP spec — hints for the client about tool behavior. */
2052
+ interface MCPToolAnnotations {
2053
+ readOnlyHint?: boolean;
2054
+ destructiveHint?: boolean;
2055
+ idempotentHint?: boolean;
2056
+ openWorldHint?: boolean;
2057
+ [key: string]: unknown;
2048
2058
  }
2049
2059
  interface MCPTool {
2050
2060
  name: string;
2051
- description: string;
2061
+ description?: string;
2052
2062
  inputSchema: Record<string, unknown>;
2063
+ annotations?: MCPToolAnnotations;
2064
+ _meta?: Record<string, unknown>;
2053
2065
  }
2054
2066
  interface MCPResource {
2055
2067
  uri: string;
2056
2068
  name: string;
2057
2069
  description?: string;
2058
2070
  mimeType?: string;
2071
+ _meta?: Record<string, unknown>;
2059
2072
  }
2060
2073
  interface MCPPrompt {
2061
2074
  name: string;
@@ -2065,6 +2078,14 @@ interface MCPPrompt {
2065
2078
  description?: string;
2066
2079
  required?: boolean;
2067
2080
  }>;
2081
+ _meta?: Record<string, unknown>;
2082
+ }
2083
+ interface MCPServerConfig {
2084
+ name: string;
2085
+ command: string;
2086
+ args: string[];
2087
+ env?: Record<string, string>;
2088
+ transport: 'stdio';
2068
2089
  }
2069
2090
  interface JSONRPCRequest {
2070
2091
  jsonrpc: '2.0';
@@ -2072,49 +2093,107 @@ interface JSONRPCRequest {
2072
2093
  method: string;
2073
2094
  params?: Record<string, unknown>;
2074
2095
  }
2096
+ interface JSONRPCError {
2097
+ code: number;
2098
+ message: string;
2099
+ data?: unknown;
2100
+ }
2075
2101
  interface JSONRPCResponse {
2076
2102
  jsonrpc: '2.0';
2077
- id: number;
2103
+ id: number | null;
2078
2104
  result?: unknown;
2079
- error?: {
2080
- code: number;
2081
- message: string;
2082
- data?: unknown;
2105
+ error?: JSONRPCError;
2106
+ _meta?: Record<string, unknown>;
2107
+ }
2108
+ /** MCP initialize result capabilities */
2109
+ interface MCPServerCapabilities {
2110
+ tools?: Record<string, unknown>;
2111
+ resources?: Record<string, unknown>;
2112
+ prompts?: Record<string, unknown>;
2113
+ logging?: Record<string, unknown>;
2114
+ [key: string]: unknown;
2115
+ }
2116
+ /** MCP initialize result */
2117
+ interface MCPInitializeResult {
2118
+ protocolVersion: string;
2119
+ capabilities: MCPServerCapabilities;
2120
+ serverInfo?: {
2121
+ name: string;
2122
+ version?: string;
2083
2123
  };
2124
+ instructions?: string;
2084
2125
  }
2126
+ /** MCP tool call result content block */
2127
+ interface MCPContentBlock {
2128
+ type: 'text' | 'image' | 'resource';
2129
+ text?: string;
2130
+ data?: string;
2131
+ mimeType?: string;
2132
+ resource?: {
2133
+ uri: string;
2134
+ name?: string;
2135
+ mimeType?: string;
2136
+ text?: string;
2137
+ };
2138
+ _meta?: Record<string, unknown>;
2139
+ }
2140
+ /** MCP tool call result */
2141
+ interface MCPToolCallResult {
2142
+ content: MCPContentBlock[];
2143
+ isError?: boolean;
2144
+ _meta?: Record<string, unknown>;
2145
+ }
2146
+ /** Connection state for an MCP server */
2147
+ type MCPConnectionState = 'disconnected' | 'connecting' | 'connected' | 'failed';
2085
2148
 
2086
2149
  declare class MCPClient {
2087
- private config;
2150
+ private readonly config;
2088
2151
  private process;
2089
2152
  private rl;
2090
- private connected;
2153
+ private connectionState;
2091
2154
  private nextId;
2092
- private pendingRequests;
2093
- private buffer;
2155
+ private readonly pendingRequests;
2156
+ private serverCapabilities;
2157
+ private serverInfo;
2158
+ private serverInstructions;
2159
+ private connectReject;
2094
2160
  constructor(config: MCPServerConfig);
2095
2161
  connect(): Promise<void>;
2096
2162
  disconnect(): Promise<void>;
2097
2163
  listTools(): Promise<MCPTool[]>;
2098
- callTool(name: string, args: Record<string, unknown>): Promise<unknown>;
2164
+ callTool(name: string, args: Record<string, unknown>): Promise<MCPToolCallResult>;
2099
2165
  listResources(): Promise<MCPResource[]>;
2100
2166
  readResource(uri: string): Promise<unknown>;
2101
2167
  listPrompts(): Promise<MCPPrompt[]>;
2102
2168
  isConnected(): boolean;
2169
+ getState(): MCPConnectionState;
2170
+ getServerInfo(): MCPInitializeResult['serverInfo'];
2171
+ getServerInstructions(): string | undefined;
2172
+ getCapabilities(): MCPInitializeResult['capabilities'];
2173
+ getConfig(): MCPServerConfig;
2174
+ private spawnProcess;
2175
+ private performHandshake;
2103
2176
  private sendRequest;
2104
2177
  private sendNotification;
2105
2178
  private handleLine;
2179
+ private handleProcessError;
2180
+ private handleProcessExit;
2181
+ private assertNoError;
2106
2182
  private cleanup;
2107
2183
  }
2108
2184
 
2109
2185
  declare class MCPConnectionManager {
2110
- private clients;
2186
+ private readonly clients;
2111
2187
  addServer(config: MCPServerConfig): Promise<void>;
2112
2188
  removeServer(name: string): Promise<void>;
2113
2189
  getConnectedServers(): string[];
2190
+ getClient(name: string): MCPClient | undefined;
2114
2191
  getAllTools(): Promise<MCPTool[]>;
2115
- callTool(serverName: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
2192
+ callTool(serverName: string, toolName: string, args: Record<string, unknown>): Promise<MCPToolCallResult>;
2116
2193
  getToolsForServer(serverName: string): Promise<MCPTool[]>;
2117
2194
  disconnectAll(): Promise<void>;
2195
+ /** Register graceful shutdown handlers for SIGINT/SIGTERM. */
2196
+ registerShutdownHandlers(): () => void;
2118
2197
  }
2119
2198
 
2120
2199
  declare function executeAgentTask(taskId: string, manager: TaskManager, adapter: ProviderAdapter, tools: ToolRegistry, prompt: string, signal?: AbortSignal): Promise<void>;
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  renderInkApp,
29
29
  runAgentLoop,
30
30
  runCli
31
- } from "./chunk-LHS6LLBW.js";
31
+ } from "./chunk-SDHXIBKZ.js";
32
32
  import {
33
33
  getGlobalSkillsDir,
34
34
  getHistoryPath
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cliskill",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Universal terminal AI assistant with multi-provider LLM support, 15 built-in tools, streaming execution, and agent orchestration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",