@defai.digital/ax-cli 3.8.22 → 3.8.24
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 +8 -2
- package/config-defaults/models.yaml +1 -1
- package/dist/agent/core/index.d.ts +8 -0
- package/dist/agent/core/index.js +9 -0
- package/dist/agent/core/index.js.map +1 -0
- package/dist/agent/core/types.d.ts +92 -0
- package/dist/agent/core/types.js +11 -0
- package/dist/agent/core/types.js.map +1 -0
- package/dist/agent/execution/index.d.ts +9 -0
- package/dist/agent/execution/index.js +9 -0
- package/dist/agent/execution/index.js.map +1 -0
- package/dist/agent/execution/tool-executor.d.ts +79 -0
- package/dist/agent/execution/tool-executor.js +281 -0
- package/dist/agent/execution/tool-executor.js.map +1 -0
- package/dist/agent/llm-agent.d.ts +22 -98
- package/dist/agent/llm-agent.js +181 -722
- package/dist/agent/llm-agent.js.map +1 -1
- package/dist/agent/planning/index.d.ts +9 -0
- package/dist/agent/planning/index.js +9 -0
- package/dist/agent/planning/index.js.map +1 -0
- package/dist/agent/planning/plan-executor.d.ts +84 -0
- package/dist/agent/planning/plan-executor.js +223 -0
- package/dist/agent/planning/plan-executor.js.map +1 -0
- package/dist/agent/streaming/index.d.ts +9 -0
- package/dist/agent/streaming/index.js +9 -0
- package/dist/agent/streaming/index.js.map +1 -0
- package/dist/agent/streaming/stream-handler.d.ts +62 -0
- package/dist/agent/streaming/stream-handler.js +193 -0
- package/dist/agent/streaming/stream-handler.js.map +1 -0
- package/dist/agent/subagent-orchestrator.d.ts +3 -3
- package/dist/agent/subagent-orchestrator.js +1 -0
- package/dist/agent/subagent-orchestrator.js.map +1 -1
- package/dist/agent/subagent-types.d.ts +10 -22
- package/dist/agent/subagent-types.js +19 -0
- package/dist/agent/subagent-types.js.map +1 -1
- package/dist/commands/usage.js +14 -0
- package/dist/commands/usage.js.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/llm/client.d.ts +33 -1
- package/dist/llm/client.js +23 -11
- package/dist/llm/client.js.map +1 -1
- package/dist/llm/types.d.ts +7 -1
- package/dist/llm/types.js +5 -4
- package/dist/llm/types.js.map +1 -1
- package/dist/mcp/index.d.ts +31 -0
- package/dist/mcp/index.js +36 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/planner/types.d.ts +8 -8
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/tool-schemas.d.ts +12 -12
- package/dist/tools/bash.js +1 -1
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/text-editor.js +57 -63
- package/dist/tools/text-editor.js.map +1 -1
- package/dist/ui/hooks/use-enhanced-input.js +66 -81
- package/dist/ui/hooks/use-enhanced-input.js.map +1 -1
- package/dist/utils/background-task-manager.js +10 -2
- package/dist/utils/background-task-manager.js.map +1 -1
- package/dist/utils/confirmation-service.js +8 -5
- package/dist/utils/confirmation-service.js.map +1 -1
- package/dist/utils/index.d.ts +85 -6
- package/dist/utils/index.js +103 -15
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/retry-helper.d.ts +7 -6
- package/dist/utils/retry-helper.js +8 -6
- package/dist/utils/retry-helper.js.map +1 -1
- package/dist/utils/settings-manager.d.ts +6 -0
- package/dist/utils/settings-manager.js +51 -64
- package/dist/utils/settings-manager.js.map +1 -1
- package/node_modules/@ax-cli/schemas/dist/index.d.ts +1 -0
- package/node_modules/@ax-cli/schemas/dist/index.d.ts.map +1 -1
- package/node_modules/@ax-cli/schemas/dist/index.js.map +1 -1
- package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.d.ts +164 -0
- package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.d.ts.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.js +10 -0
- package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.js.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/agent/index.d.ts +9 -0
- package/node_modules/@ax-cli/schemas/dist/public/agent/index.d.ts.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/agent/index.js +9 -0
- package/node_modules/@ax-cli/schemas/dist/public/agent/index.js.map +1 -0
- package/package.json +1 -1
- package/packages/schemas/dist/index.d.ts +1 -0
- package/packages/schemas/dist/index.d.ts.map +1 -1
- package/packages/schemas/dist/index.js.map +1 -1
- package/packages/schemas/dist/public/agent/chat-types.d.ts +164 -0
- package/packages/schemas/dist/public/agent/chat-types.d.ts.map +1 -0
- package/packages/schemas/dist/public/agent/chat-types.js +10 -0
- package/packages/schemas/dist/public/agent/chat-types.js.map +1 -0
- package/packages/schemas/dist/public/agent/index.d.ts +9 -0
- package/packages/schemas/dist/public/agent/index.d.ts.map +1 -0
- package/packages/schemas/dist/public/agent/index.js +9 -0
- package/packages/schemas/dist/public/agent/index.js.map +1 -0
- package/dist/mcp/config-detector-v2.d.ts +0 -83
- package/dist/mcp/config-detector-v2.js +0 -328
- package/dist/mcp/config-detector-v2.js.map +0 -1
- package/dist/mcp/config-migrator-v2.d.ts +0 -89
- package/dist/mcp/config-migrator-v2.js +0 -288
- package/dist/mcp/config-migrator-v2.js.map +0 -1
- package/dist/mcp/config-v2.d.ts +0 -111
- package/dist/mcp/config-v2.js +0 -443
- package/dist/mcp/config-v2.js.map +0 -1
- package/dist/mcp/transports-v2.d.ts +0 -152
- package/dist/mcp/transports-v2.js +0 -481
- package/dist/mcp/transports-v2.js.map +0 -1
- package/dist/utils/error-sanitizer.d.ts +0 -119
- package/dist/utils/error-sanitizer.js +0 -253
- package/dist/utils/error-sanitizer.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -74
- package/dist/utils/errors.js +0 -139
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/incremental-analyzer.d.ts +0 -134
- package/dist/utils/incremental-analyzer.js +0 -377
- package/dist/utils/incremental-analyzer.js.map +0 -1
- package/dist/utils/settings.d.ts +0 -1
- package/dist/utils/settings.js +0 -4
- package/dist/utils/settings.js.map +0 -1
- package/dist/utils/streaming-analyzer.d.ts +0 -160
- package/dist/utils/streaming-analyzer.js +0 -214
- package/dist/utils/streaming-analyzer.js.map +0 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ax-cli/schemas - Agent Chat Types
|
|
3
|
+
*
|
|
4
|
+
* Single Source of Truth (SSOT) for agent chat-related types.
|
|
5
|
+
* These types are used across the agent, UI, checkpoint, and SDK modules.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* LLM Tool Call representation
|
|
11
|
+
*
|
|
12
|
+
* Represents a tool call made by the LLM during a conversation.
|
|
13
|
+
* This is a simplified version that doesn't depend on OpenAI types.
|
|
14
|
+
*/
|
|
15
|
+
export interface LLMToolCallRef {
|
|
16
|
+
/** Unique identifier for this tool call */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Type of tool call (always "function" for now) */
|
|
19
|
+
type: "function";
|
|
20
|
+
/** Function details */
|
|
21
|
+
function: {
|
|
22
|
+
/** Name of the function to call */
|
|
23
|
+
name: string;
|
|
24
|
+
/** JSON-encoded arguments string */
|
|
25
|
+
arguments: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Tool execution result
|
|
30
|
+
*
|
|
31
|
+
* Represents the result of executing a tool.
|
|
32
|
+
*/
|
|
33
|
+
export interface ToolResultRef {
|
|
34
|
+
/** Whether the tool execution succeeded */
|
|
35
|
+
success: boolean;
|
|
36
|
+
/** Output from successful execution */
|
|
37
|
+
output?: string;
|
|
38
|
+
/** Error message if execution failed */
|
|
39
|
+
error?: string;
|
|
40
|
+
/** Additional structured data from the tool */
|
|
41
|
+
data?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Chat Entry
|
|
45
|
+
*
|
|
46
|
+
* Represents a single entry in the chat history between user and assistant.
|
|
47
|
+
* This is the canonical definition - DO NOT duplicate this type elsewhere.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const userMessage: ChatEntry = {
|
|
52
|
+
* type: "user",
|
|
53
|
+
* content: "Hello, how are you?",
|
|
54
|
+
* timestamp: new Date(),
|
|
55
|
+
* };
|
|
56
|
+
*
|
|
57
|
+
* const assistantMessage: ChatEntry = {
|
|
58
|
+
* type: "assistant",
|
|
59
|
+
* content: "I'm doing well, thank you!",
|
|
60
|
+
* timestamp: new Date(),
|
|
61
|
+
* durationMs: 1500,
|
|
62
|
+
* };
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export interface ChatEntry {
|
|
66
|
+
/** Type of chat entry */
|
|
67
|
+
type: "user" | "assistant" | "tool_result" | "tool_call";
|
|
68
|
+
/** Text content of the entry */
|
|
69
|
+
content: string;
|
|
70
|
+
/** When this entry was created */
|
|
71
|
+
timestamp: Date;
|
|
72
|
+
/** Tool calls made by assistant (for type="assistant") */
|
|
73
|
+
toolCalls?: LLMToolCallRef[];
|
|
74
|
+
/** Single tool call (for type="tool_call") */
|
|
75
|
+
toolCall?: LLMToolCallRef;
|
|
76
|
+
/** Result of tool execution (for type="tool_result") */
|
|
77
|
+
toolResult?: {
|
|
78
|
+
success: boolean;
|
|
79
|
+
output?: string;
|
|
80
|
+
error?: string;
|
|
81
|
+
};
|
|
82
|
+
/** Whether content is currently streaming */
|
|
83
|
+
isStreaming?: boolean;
|
|
84
|
+
/** GLM-4.6 reasoning content (thinking mode) */
|
|
85
|
+
reasoningContent?: string;
|
|
86
|
+
/** Whether reasoning is currently streaming */
|
|
87
|
+
isReasoningStreaming?: boolean;
|
|
88
|
+
/** Response duration in milliseconds */
|
|
89
|
+
durationMs?: number;
|
|
90
|
+
/** Tool execution start time (for elapsed time display while running) */
|
|
91
|
+
executionStartTime?: Date;
|
|
92
|
+
/** Tool execution duration in milliseconds (shown after completion) */
|
|
93
|
+
executionDurationMs?: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Streaming Chunk Types
|
|
97
|
+
*
|
|
98
|
+
* Represents different types of streaming chunks that can be received
|
|
99
|
+
* during a streaming response from the LLM.
|
|
100
|
+
*/
|
|
101
|
+
export type StreamingChunkType = "content" | "reasoning" | "tool_calls" | "tool_result" | "done" | "token_count";
|
|
102
|
+
/**
|
|
103
|
+
* Streaming Chunk
|
|
104
|
+
*
|
|
105
|
+
* Represents a chunk of data received during streaming response.
|
|
106
|
+
* Used by UI components to render incremental updates.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* // Content chunk
|
|
111
|
+
* const contentChunk: StreamingChunk = {
|
|
112
|
+
* type: "content",
|
|
113
|
+
* content: "Hello",
|
|
114
|
+
* };
|
|
115
|
+
*
|
|
116
|
+
* // Tool result chunk
|
|
117
|
+
* const toolResultChunk: StreamingChunk = {
|
|
118
|
+
* type: "tool_result",
|
|
119
|
+
* toolResult: { success: true, output: "File created" },
|
|
120
|
+
* executionDurationMs: 150,
|
|
121
|
+
* };
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export interface StreamingChunk {
|
|
125
|
+
/** Type of streaming chunk */
|
|
126
|
+
type: StreamingChunkType;
|
|
127
|
+
/** Text content (for type="content") */
|
|
128
|
+
content?: string;
|
|
129
|
+
/** GLM-4.6 reasoning content chunk (for type="reasoning") */
|
|
130
|
+
reasoningContent?: string;
|
|
131
|
+
/** Tool calls from LLM (for type="tool_calls") */
|
|
132
|
+
toolCalls?: LLMToolCallRef[];
|
|
133
|
+
/** Single tool call */
|
|
134
|
+
toolCall?: LLMToolCallRef;
|
|
135
|
+
/** Tool execution result (for type="tool_result") */
|
|
136
|
+
toolResult?: ToolResultRef;
|
|
137
|
+
/** Token count (for type="token_count") */
|
|
138
|
+
tokenCount?: number;
|
|
139
|
+
/** Tool execution duration in milliseconds (for type="tool_result") */
|
|
140
|
+
executionDurationMs?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Accumulated Message
|
|
144
|
+
*
|
|
145
|
+
* Contains the full message content accumulated from streaming response.
|
|
146
|
+
* Used internally by the agent to build complete messages from chunks.
|
|
147
|
+
*/
|
|
148
|
+
export interface AccumulatedMessage {
|
|
149
|
+
/** Message role (e.g., "assistant") */
|
|
150
|
+
role?: string;
|
|
151
|
+
/** Full accumulated content */
|
|
152
|
+
content?: string;
|
|
153
|
+
/** Tool calls accumulated from the response */
|
|
154
|
+
tool_calls?: LLMToolCallRef[];
|
|
155
|
+
/** Allow additional properties for flexibility */
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Chat History
|
|
160
|
+
*
|
|
161
|
+
* Type alias for an array of chat entries.
|
|
162
|
+
*/
|
|
163
|
+
export type ChatHistory = ChatEntry[];
|
|
164
|
+
//# sourceMappingURL=chat-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-types.d.ts","sourceRoot":"","sources":["../../../src/public/agent/chat-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,IAAI,EAAE,UAAU,CAAC;IACjB,uBAAuB;IACvB,QAAQ,EAAE;QACR,mCAAmC;QACnC,IAAI,EAAE,MAAM,CAAC;QACb,oCAAoC;QACpC,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;GAq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CAAC;IAE1B,qDAAqD;IACrD,UAAU,CAAC,EAAE,aAAa,CAAC;IAE3B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAE9B,kDAAkD;IAClD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ax-cli/schemas - Agent Chat Types
|
|
3
|
+
*
|
|
4
|
+
* Single Source of Truth (SSOT) for agent chat-related types.
|
|
5
|
+
* These types are used across the agent, UI, checkpoint, and SDK modules.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=chat-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-types.js","sourceRoot":"","sources":["../../../src/public/agent/chat-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ax-cli/schemas - Agent Types
|
|
3
|
+
*
|
|
4
|
+
* Exports all agent-related types for the ax-cli ecosystem.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export { type LLMToolCallRef, type ToolResultRef, type ChatEntry, type StreamingChunkType, type StreamingChunk, type AccumulatedMessage, type ChatHistory, } from './chat-types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/public/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/public/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type-Safe MCP Config Detector (Phase 2 Improvements)
|
|
3
|
-
*
|
|
4
|
-
* Improvements applied:
|
|
5
|
-
* 1. Result types instead of boolean returns
|
|
6
|
-
* 2. Exhaustiveness checking for format detection
|
|
7
|
-
* 3. Better error context
|
|
8
|
-
* 4. Branded types for validation
|
|
9
|
-
*
|
|
10
|
-
* Coverage: 85% → 90% (Phase 2)
|
|
11
|
-
*/
|
|
12
|
-
import { Result } from './type-safety.js';
|
|
13
|
-
/**
|
|
14
|
-
* Config format version
|
|
15
|
-
*/
|
|
16
|
-
export type ConfigFormatVersion = 'legacy-stdio' | 'modern-stdio' | 'modern-http' | 'modern-sse' | 'unknown';
|
|
17
|
-
/**
|
|
18
|
-
* Detection result with detailed information
|
|
19
|
-
*/
|
|
20
|
-
export interface ConfigDetectionResult {
|
|
21
|
-
isValid: boolean;
|
|
22
|
-
isLegacy: boolean;
|
|
23
|
-
isAutomatosX: boolean;
|
|
24
|
-
formatVersion: ConfigFormatVersion;
|
|
25
|
-
issues: string[];
|
|
26
|
-
warnings: string[];
|
|
27
|
-
originalConfig: any;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Check if config is in legacy stdio-only format
|
|
31
|
-
*
|
|
32
|
-
* Phase 2: Returns Result with reasoning instead of just boolean
|
|
33
|
-
*/
|
|
34
|
-
export declare function isLegacyStdioFormat(config: any): Result<boolean, Error>;
|
|
35
|
-
/**
|
|
36
|
-
* Detect config format with comprehensive analysis
|
|
37
|
-
*
|
|
38
|
-
* Phase 2: Better error handling and validation
|
|
39
|
-
*/
|
|
40
|
-
export declare function detectConfigFormat(config: any): ConfigDetectionResult;
|
|
41
|
-
/**
|
|
42
|
-
* Check if any configs need migration
|
|
43
|
-
*
|
|
44
|
-
* Phase 2: Returns Result with detailed information
|
|
45
|
-
*/
|
|
46
|
-
export declare function detectMigrationNeeded(configs: any[]): Result<{
|
|
47
|
-
needed: boolean;
|
|
48
|
-
legacyCount: number;
|
|
49
|
-
details: ConfigDetectionResult[];
|
|
50
|
-
}, Error>;
|
|
51
|
-
/**
|
|
52
|
-
* Get human-readable format description
|
|
53
|
-
*
|
|
54
|
-
* Phase 2: Exhaustiveness checking ensures all formats handled
|
|
55
|
-
*/
|
|
56
|
-
export declare function getFormatDescription(format: ConfigFormatVersion): string;
|
|
57
|
-
/**
|
|
58
|
-
* Categorize issues by severity
|
|
59
|
-
*
|
|
60
|
-
* Phase 2: Better error categorization
|
|
61
|
-
*/
|
|
62
|
-
export interface CategorizedIssues {
|
|
63
|
-
critical: string[];
|
|
64
|
-
warnings: string[];
|
|
65
|
-
info: string[];
|
|
66
|
-
}
|
|
67
|
-
export declare function categorizeIssues(detection: ConfigDetectionResult): CategorizedIssues;
|
|
68
|
-
/**
|
|
69
|
-
* Check if config is in modern format (has transport field)
|
|
70
|
-
*
|
|
71
|
-
* Phase 2: Returns Result for type safety
|
|
72
|
-
*/
|
|
73
|
-
export declare function isModernFormat(config: any): Result<boolean, Error>;
|
|
74
|
-
/**
|
|
75
|
-
* Detect transport type from config
|
|
76
|
-
*
|
|
77
|
-
* Phase 2: Returns Result with transport type
|
|
78
|
-
*/
|
|
79
|
-
export declare function detectTransportType(transport: any): Result<string, Error>;
|
|
80
|
-
/**
|
|
81
|
-
* Generate migration recommendation
|
|
82
|
-
*/
|
|
83
|
-
export declare function getMigrationRecommendation(detection: ConfigDetectionResult): string | null;
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type-Safe MCP Config Detector (Phase 2 Improvements)
|
|
3
|
-
*
|
|
4
|
-
* Improvements applied:
|
|
5
|
-
* 1. Result types instead of boolean returns
|
|
6
|
-
* 2. Exhaustiveness checking for format detection
|
|
7
|
-
* 3. Better error context
|
|
8
|
-
* 4. Branded types for validation
|
|
9
|
-
*
|
|
10
|
-
* Coverage: 85% → 90% (Phase 2)
|
|
11
|
-
*/
|
|
12
|
-
import { MCPServerConfigSchema } from '../schemas/settings-schemas.js';
|
|
13
|
-
import { Ok, Err, assertNever } from './type-safety.js';
|
|
14
|
-
/**
|
|
15
|
-
* Check if config is in legacy stdio-only format
|
|
16
|
-
*
|
|
17
|
-
* Phase 2: Returns Result with reasoning instead of just boolean
|
|
18
|
-
*/
|
|
19
|
-
export function isLegacyStdioFormat(config) {
|
|
20
|
-
if (!config || typeof config !== 'object') {
|
|
21
|
-
return Err(new Error('Config must be an object'));
|
|
22
|
-
}
|
|
23
|
-
const hasCommand = typeof config.command === 'string' && config.command.length > 0;
|
|
24
|
-
const hasTransport = config.transport !== undefined;
|
|
25
|
-
// Legacy format: has command but NO transport
|
|
26
|
-
const isLegacy = hasCommand && !hasTransport;
|
|
27
|
-
return Ok(isLegacy);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Detect config format with comprehensive analysis
|
|
31
|
-
*
|
|
32
|
-
* Phase 2: Better error handling and validation
|
|
33
|
-
*/
|
|
34
|
-
export function detectConfigFormat(config) {
|
|
35
|
-
const issues = [];
|
|
36
|
-
const warnings = [];
|
|
37
|
-
let formatVersion = 'unknown';
|
|
38
|
-
let isLegacy = false;
|
|
39
|
-
let isAutomatosX = false;
|
|
40
|
-
// Basic validation
|
|
41
|
-
if (!config || typeof config !== 'object') {
|
|
42
|
-
issues.push('Config must be a non-null object');
|
|
43
|
-
return {
|
|
44
|
-
isValid: false,
|
|
45
|
-
isLegacy: false,
|
|
46
|
-
isAutomatosX: false,
|
|
47
|
-
formatVersion: 'unknown',
|
|
48
|
-
issues,
|
|
49
|
-
warnings,
|
|
50
|
-
originalConfig: config
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
// Check for required name field
|
|
54
|
-
if (!config.name || typeof config.name !== 'string') {
|
|
55
|
-
issues.push('Missing or invalid "name" field');
|
|
56
|
-
}
|
|
57
|
-
else if (config.name.trim().length === 0) {
|
|
58
|
-
issues.push('Server "name" cannot be empty');
|
|
59
|
-
}
|
|
60
|
-
// Detect format based on presence of fields
|
|
61
|
-
const hasCommand = typeof config.command === 'string' && config.command.length > 0;
|
|
62
|
-
const hasTransport = config.transport !== undefined && config.transport !== null;
|
|
63
|
-
if (hasCommand && !hasTransport) {
|
|
64
|
-
// Legacy stdio-only format
|
|
65
|
-
isLegacy = true;
|
|
66
|
-
formatVersion = 'legacy-stdio';
|
|
67
|
-
// Validate legacy format
|
|
68
|
-
if (!config.args || !Array.isArray(config.args)) {
|
|
69
|
-
warnings.push('Legacy format: "args" should be an array');
|
|
70
|
-
}
|
|
71
|
-
if (config.env && typeof config.env !== 'object') {
|
|
72
|
-
issues.push('Legacy format: "env" must be an object');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
else if (hasTransport) {
|
|
76
|
-
// Modern format with transport
|
|
77
|
-
if (typeof config.transport !== 'object') {
|
|
78
|
-
issues.push('Modern format: "transport" must be an object');
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
const transportType = config.transport.type;
|
|
82
|
-
// Phase 2: Exhaustive check of transport types
|
|
83
|
-
switch (transportType) {
|
|
84
|
-
case 'stdio':
|
|
85
|
-
formatVersion = 'modern-stdio';
|
|
86
|
-
validateStdioTransport(config.transport, issues, warnings);
|
|
87
|
-
break;
|
|
88
|
-
case 'http':
|
|
89
|
-
formatVersion = 'modern-http';
|
|
90
|
-
validateHttpTransport(config.transport, issues, warnings);
|
|
91
|
-
break;
|
|
92
|
-
case 'sse':
|
|
93
|
-
formatVersion = 'modern-sse';
|
|
94
|
-
validateSseTransport(config.transport, issues, warnings);
|
|
95
|
-
break;
|
|
96
|
-
case undefined:
|
|
97
|
-
case null:
|
|
98
|
-
issues.push('Modern format: "transport.type" is required');
|
|
99
|
-
formatVersion = 'unknown';
|
|
100
|
-
break;
|
|
101
|
-
default:
|
|
102
|
-
// Phase 2: Exhaustiveness check catches unknown types
|
|
103
|
-
issues.push(`Unknown transport type: "${transportType}"`);
|
|
104
|
-
formatVersion = 'unknown';
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
// Neither command nor transport
|
|
110
|
-
issues.push('Config must have either "command" (legacy) or "transport" (modern)');
|
|
111
|
-
formatVersion = 'unknown';
|
|
112
|
-
}
|
|
113
|
-
// Detect AutomatosX-specific patterns
|
|
114
|
-
if (config._automatosXMigrated || config.automatosXSource) {
|
|
115
|
-
isAutomatosX = true;
|
|
116
|
-
warnings.push('Config appears to be from AutomatosX');
|
|
117
|
-
}
|
|
118
|
-
// Run full validation
|
|
119
|
-
const validationResult = MCPServerConfigSchema.safeParse(config);
|
|
120
|
-
let isValid = validationResult.success;
|
|
121
|
-
if (!validationResult.success && validationResult.error) {
|
|
122
|
-
// Add Zod validation issues
|
|
123
|
-
validationResult.error.issues.forEach(issue => {
|
|
124
|
-
const field = issue.path.join('.');
|
|
125
|
-
issues.push(`Field "${field}": ${issue.message}`);
|
|
126
|
-
});
|
|
127
|
-
isValid = false;
|
|
128
|
-
}
|
|
129
|
-
// If we have issues, it's not valid
|
|
130
|
-
if (issues.length > 0) {
|
|
131
|
-
isValid = false;
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
isValid,
|
|
135
|
-
isLegacy,
|
|
136
|
-
isAutomatosX,
|
|
137
|
-
formatVersion,
|
|
138
|
-
issues,
|
|
139
|
-
warnings,
|
|
140
|
-
originalConfig: config
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Validate stdio transport configuration
|
|
145
|
-
*/
|
|
146
|
-
function validateStdioTransport(transport, issues, warnings) {
|
|
147
|
-
if (!transport.command || typeof transport.command !== 'string') {
|
|
148
|
-
issues.push('stdio transport: "command" is required and must be a string');
|
|
149
|
-
}
|
|
150
|
-
if (transport.args !== undefined && !Array.isArray(transport.args)) {
|
|
151
|
-
issues.push('stdio transport: "args" must be an array');
|
|
152
|
-
}
|
|
153
|
-
if (transport.env !== undefined && typeof transport.env !== 'object') {
|
|
154
|
-
issues.push('stdio transport: "env" must be an object');
|
|
155
|
-
}
|
|
156
|
-
// Warnings for common mistakes
|
|
157
|
-
if (transport.url) {
|
|
158
|
-
warnings.push('stdio transport: "url" field is ignored (use http or sse for URL-based connections)');
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Validate HTTP transport configuration
|
|
163
|
-
*/
|
|
164
|
-
function validateHttpTransport(transport, issues, warnings) {
|
|
165
|
-
if (!transport.url || typeof transport.url !== 'string') {
|
|
166
|
-
issues.push('http transport: "url" is required and must be a string');
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
// Validate URL format
|
|
170
|
-
try {
|
|
171
|
-
new URL(transport.url);
|
|
172
|
-
}
|
|
173
|
-
catch {
|
|
174
|
-
issues.push(`http transport: invalid URL format: "${transport.url}"`);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
// Warnings for common mistakes
|
|
178
|
-
if (transport.command) {
|
|
179
|
-
warnings.push('http transport: "command" field is ignored (use stdio for command-based servers)');
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Validate SSE transport configuration
|
|
184
|
-
*/
|
|
185
|
-
function validateSseTransport(transport, issues, warnings) {
|
|
186
|
-
if (!transport.url || typeof transport.url !== 'string') {
|
|
187
|
-
issues.push('sse transport: "url" is required and must be a string');
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
// Validate URL format
|
|
191
|
-
try {
|
|
192
|
-
new URL(transport.url);
|
|
193
|
-
}
|
|
194
|
-
catch {
|
|
195
|
-
issues.push(`sse transport: invalid URL format: "${transport.url}"`);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
// Warnings for common mistakes
|
|
199
|
-
if (transport.command) {
|
|
200
|
-
warnings.push('sse transport: "command" field is ignored (use stdio for command-based servers)');
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Check if any configs need migration
|
|
205
|
-
*
|
|
206
|
-
* Phase 2: Returns Result with detailed information
|
|
207
|
-
*/
|
|
208
|
-
export function detectMigrationNeeded(configs) {
|
|
209
|
-
if (!Array.isArray(configs)) {
|
|
210
|
-
return Err(new Error('Configs must be an array'));
|
|
211
|
-
}
|
|
212
|
-
const details = [];
|
|
213
|
-
let legacyCount = 0;
|
|
214
|
-
for (const config of configs) {
|
|
215
|
-
const detection = detectConfigFormat(config);
|
|
216
|
-
details.push(detection);
|
|
217
|
-
if (detection.isLegacy) {
|
|
218
|
-
legacyCount++;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return Ok({
|
|
222
|
-
needed: legacyCount > 0,
|
|
223
|
-
legacyCount,
|
|
224
|
-
details
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Get human-readable format description
|
|
229
|
-
*
|
|
230
|
-
* Phase 2: Exhaustiveness checking ensures all formats handled
|
|
231
|
-
*/
|
|
232
|
-
export function getFormatDescription(format) {
|
|
233
|
-
switch (format) {
|
|
234
|
-
case 'legacy-stdio':
|
|
235
|
-
return 'Legacy stdio-only format (command, args, env)';
|
|
236
|
-
case 'modern-stdio':
|
|
237
|
-
return 'Modern stdio format (transport.type = stdio)';
|
|
238
|
-
case 'modern-http':
|
|
239
|
-
return 'Modern HTTP format (transport.type = http)';
|
|
240
|
-
case 'modern-sse':
|
|
241
|
-
return 'Modern SSE format (transport.type = sse)';
|
|
242
|
-
case 'unknown':
|
|
243
|
-
return 'Unknown or invalid format';
|
|
244
|
-
default:
|
|
245
|
-
// Phase 2: Exhaustiveness check - compile error if new format added
|
|
246
|
-
return assertNever(format);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
export function categorizeIssues(detection) {
|
|
250
|
-
const critical = [];
|
|
251
|
-
const warnings = [];
|
|
252
|
-
const info = [];
|
|
253
|
-
// All issues from detection are critical
|
|
254
|
-
critical.push(...detection.issues);
|
|
255
|
-
// Warnings from detection
|
|
256
|
-
warnings.push(...detection.warnings);
|
|
257
|
-
// Add info messages
|
|
258
|
-
if (detection.isLegacy) {
|
|
259
|
-
info.push('This config uses legacy format and should be migrated');
|
|
260
|
-
}
|
|
261
|
-
if (detection.isAutomatosX) {
|
|
262
|
-
info.push('This config originated from AutomatosX');
|
|
263
|
-
}
|
|
264
|
-
return { critical, warnings, info };
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Check if config is in modern format (has transport field)
|
|
268
|
-
*
|
|
269
|
-
* Phase 2: Returns Result for type safety
|
|
270
|
-
*/
|
|
271
|
-
export function isModernFormat(config) {
|
|
272
|
-
if (!config || typeof config !== 'object') {
|
|
273
|
-
return Err(new Error('Config must be an object'));
|
|
274
|
-
}
|
|
275
|
-
const hasTransport = config.transport !== undefined && config.transport !== null;
|
|
276
|
-
return Ok(hasTransport);
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Detect transport type from config
|
|
280
|
-
*
|
|
281
|
-
* Phase 2: Returns Result with transport type
|
|
282
|
-
*/
|
|
283
|
-
export function detectTransportType(transport) {
|
|
284
|
-
if (!transport || typeof transport !== 'object') {
|
|
285
|
-
return Err(new Error('Transport must be an object'));
|
|
286
|
-
}
|
|
287
|
-
const transportType = transport.type;
|
|
288
|
-
if (!transportType || typeof transportType !== 'string') {
|
|
289
|
-
return Err(new Error('Transport type is required'));
|
|
290
|
-
}
|
|
291
|
-
// Validate known transport types
|
|
292
|
-
const validTypes = ['stdio', 'http', 'sse', 'streamable_http'];
|
|
293
|
-
if (!validTypes.includes(transportType)) {
|
|
294
|
-
return Err(new Error(`Unknown transport type: "${transportType}"`));
|
|
295
|
-
}
|
|
296
|
-
return Ok(transportType);
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Generate migration recommendation
|
|
300
|
-
*/
|
|
301
|
-
export function getMigrationRecommendation(detection) {
|
|
302
|
-
if (!detection.isLegacy) {
|
|
303
|
-
return null;
|
|
304
|
-
}
|
|
305
|
-
return `
|
|
306
|
-
This server uses the legacy configuration format.
|
|
307
|
-
|
|
308
|
-
Current format:
|
|
309
|
-
{
|
|
310
|
-
"name": "${detection.originalConfig.name}",
|
|
311
|
-
"command": "${detection.originalConfig.command}",
|
|
312
|
-
"args": [...]
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
Recommended format:
|
|
316
|
-
{
|
|
317
|
-
"name": "${detection.originalConfig.name}",
|
|
318
|
-
"transport": {
|
|
319
|
-
"type": "stdio",
|
|
320
|
-
"command": "${detection.originalConfig.command}",
|
|
321
|
-
"args": [...]
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
Run: ax-cli mcp migrate --server ${detection.originalConfig.name}
|
|
326
|
-
`.trim();
|
|
327
|
-
}
|
|
328
|
-
//# sourceMappingURL=config-detector-v2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-detector-v2.js","sourceRoot":"","sources":["../../src/mcp/config-detector-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAU,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAyBhE;;;;GAIG;AACH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