cliskill 1.1.1 → 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;
@@ -2044,23 +2044,31 @@ interface CommandAnalysis {
2044
2044
  declare function parseCommand(input: string): ParsedCommand;
2045
2045
  declare function analyzeCommand(input: string): CommandAnalysis;
2046
2046
 
2047
- interface MCPServerConfig {
2048
- name: string;
2049
- command: string;
2050
- args: string[];
2051
- env?: Record<string, string>;
2052
- 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;
2053
2058
  }
2054
2059
  interface MCPTool {
2055
2060
  name: string;
2056
- description: string;
2061
+ description?: string;
2057
2062
  inputSchema: Record<string, unknown>;
2063
+ annotations?: MCPToolAnnotations;
2064
+ _meta?: Record<string, unknown>;
2058
2065
  }
2059
2066
  interface MCPResource {
2060
2067
  uri: string;
2061
2068
  name: string;
2062
2069
  description?: string;
2063
2070
  mimeType?: string;
2071
+ _meta?: Record<string, unknown>;
2064
2072
  }
2065
2073
  interface MCPPrompt {
2066
2074
  name: string;
@@ -2070,6 +2078,14 @@ interface MCPPrompt {
2070
2078
  description?: string;
2071
2079
  required?: boolean;
2072
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';
2073
2089
  }
2074
2090
  interface JSONRPCRequest {
2075
2091
  jsonrpc: '2.0';
@@ -2077,49 +2093,107 @@ interface JSONRPCRequest {
2077
2093
  method: string;
2078
2094
  params?: Record<string, unknown>;
2079
2095
  }
2096
+ interface JSONRPCError {
2097
+ code: number;
2098
+ message: string;
2099
+ data?: unknown;
2100
+ }
2080
2101
  interface JSONRPCResponse {
2081
2102
  jsonrpc: '2.0';
2082
- id: number;
2103
+ id: number | null;
2083
2104
  result?: unknown;
2084
- error?: {
2085
- code: number;
2086
- message: string;
2087
- 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;
2088
2123
  };
2124
+ instructions?: string;
2089
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';
2090
2148
 
2091
2149
  declare class MCPClient {
2092
- private config;
2150
+ private readonly config;
2093
2151
  private process;
2094
2152
  private rl;
2095
- private connected;
2153
+ private connectionState;
2096
2154
  private nextId;
2097
- private pendingRequests;
2098
- private buffer;
2155
+ private readonly pendingRequests;
2156
+ private serverCapabilities;
2157
+ private serverInfo;
2158
+ private serverInstructions;
2159
+ private connectReject;
2099
2160
  constructor(config: MCPServerConfig);
2100
2161
  connect(): Promise<void>;
2101
2162
  disconnect(): Promise<void>;
2102
2163
  listTools(): Promise<MCPTool[]>;
2103
- callTool(name: string, args: Record<string, unknown>): Promise<unknown>;
2164
+ callTool(name: string, args: Record<string, unknown>): Promise<MCPToolCallResult>;
2104
2165
  listResources(): Promise<MCPResource[]>;
2105
2166
  readResource(uri: string): Promise<unknown>;
2106
2167
  listPrompts(): Promise<MCPPrompt[]>;
2107
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;
2108
2176
  private sendRequest;
2109
2177
  private sendNotification;
2110
2178
  private handleLine;
2179
+ private handleProcessError;
2180
+ private handleProcessExit;
2181
+ private assertNoError;
2111
2182
  private cleanup;
2112
2183
  }
2113
2184
 
2114
2185
  declare class MCPConnectionManager {
2115
- private clients;
2186
+ private readonly clients;
2116
2187
  addServer(config: MCPServerConfig): Promise<void>;
2117
2188
  removeServer(name: string): Promise<void>;
2118
2189
  getConnectedServers(): string[];
2190
+ getClient(name: string): MCPClient | undefined;
2119
2191
  getAllTools(): Promise<MCPTool[]>;
2120
- callTool(serverName: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
2192
+ callTool(serverName: string, toolName: string, args: Record<string, unknown>): Promise<MCPToolCallResult>;
2121
2193
  getToolsForServer(serverName: string): Promise<MCPTool[]>;
2122
2194
  disconnectAll(): Promise<void>;
2195
+ /** Register graceful shutdown handlers for SIGINT/SIGTERM. */
2196
+ registerShutdownHandlers(): () => void;
2123
2197
  }
2124
2198
 
2125
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-PRO7DR3G.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.1",
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",