@defai.digital/ax-cli 3.8.22 → 3.8.23

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.
Files changed (117) hide show
  1. package/README.md +7 -1
  2. package/dist/agent/core/index.d.ts +8 -0
  3. package/dist/agent/core/index.js +9 -0
  4. package/dist/agent/core/index.js.map +1 -0
  5. package/dist/agent/core/types.d.ts +92 -0
  6. package/dist/agent/core/types.js +11 -0
  7. package/dist/agent/core/types.js.map +1 -0
  8. package/dist/agent/execution/index.d.ts +9 -0
  9. package/dist/agent/execution/index.js +9 -0
  10. package/dist/agent/execution/index.js.map +1 -0
  11. package/dist/agent/execution/tool-executor.d.ts +79 -0
  12. package/dist/agent/execution/tool-executor.js +281 -0
  13. package/dist/agent/execution/tool-executor.js.map +1 -0
  14. package/dist/agent/llm-agent.d.ts +22 -98
  15. package/dist/agent/llm-agent.js +169 -712
  16. package/dist/agent/llm-agent.js.map +1 -1
  17. package/dist/agent/planning/index.d.ts +9 -0
  18. package/dist/agent/planning/index.js +9 -0
  19. package/dist/agent/planning/index.js.map +1 -0
  20. package/dist/agent/planning/plan-executor.d.ts +84 -0
  21. package/dist/agent/planning/plan-executor.js +223 -0
  22. package/dist/agent/planning/plan-executor.js.map +1 -0
  23. package/dist/agent/streaming/index.d.ts +9 -0
  24. package/dist/agent/streaming/index.js +9 -0
  25. package/dist/agent/streaming/index.js.map +1 -0
  26. package/dist/agent/streaming/stream-handler.d.ts +62 -0
  27. package/dist/agent/streaming/stream-handler.js +193 -0
  28. package/dist/agent/streaming/stream-handler.js.map +1 -0
  29. package/dist/agent/subagent-orchestrator.d.ts +3 -3
  30. package/dist/agent/subagent-orchestrator.js +1 -0
  31. package/dist/agent/subagent-orchestrator.js.map +1 -1
  32. package/dist/agent/subagent-types.d.ts +10 -22
  33. package/dist/agent/subagent-types.js +19 -0
  34. package/dist/agent/subagent-types.js.map +1 -1
  35. package/dist/index.js +9 -7
  36. package/dist/index.js.map +1 -1
  37. package/dist/llm/client.d.ts +33 -1
  38. package/dist/llm/client.js +15 -11
  39. package/dist/llm/client.js.map +1 -1
  40. package/dist/llm/types.d.ts +7 -1
  41. package/dist/llm/types.js +5 -4
  42. package/dist/llm/types.js.map +1 -1
  43. package/dist/mcp/index.d.ts +31 -0
  44. package/dist/mcp/index.js +36 -0
  45. package/dist/mcp/index.js.map +1 -0
  46. package/dist/planner/types.d.ts +8 -8
  47. package/dist/schemas/index.d.ts +4 -4
  48. package/dist/schemas/tool-schemas.d.ts +12 -12
  49. package/dist/tools/bash.js +1 -1
  50. package/dist/tools/bash.js.map +1 -1
  51. package/dist/tools/text-editor.js +57 -63
  52. package/dist/tools/text-editor.js.map +1 -1
  53. package/dist/ui/hooks/use-enhanced-input.js +66 -81
  54. package/dist/ui/hooks/use-enhanced-input.js.map +1 -1
  55. package/dist/utils/background-task-manager.js +10 -2
  56. package/dist/utils/background-task-manager.js.map +1 -1
  57. package/dist/utils/confirmation-service.js +8 -5
  58. package/dist/utils/confirmation-service.js.map +1 -1
  59. package/dist/utils/index.d.ts +85 -6
  60. package/dist/utils/index.js +103 -15
  61. package/dist/utils/index.js.map +1 -1
  62. package/dist/utils/retry-helper.d.ts +7 -6
  63. package/dist/utils/retry-helper.js +8 -6
  64. package/dist/utils/retry-helper.js.map +1 -1
  65. package/dist/utils/settings-manager.d.ts +6 -0
  66. package/dist/utils/settings-manager.js +51 -64
  67. package/dist/utils/settings-manager.js.map +1 -1
  68. package/node_modules/@ax-cli/schemas/dist/index.d.ts +1 -0
  69. package/node_modules/@ax-cli/schemas/dist/index.d.ts.map +1 -1
  70. package/node_modules/@ax-cli/schemas/dist/index.js.map +1 -1
  71. package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.d.ts +164 -0
  72. package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.d.ts.map +1 -0
  73. package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.js +10 -0
  74. package/node_modules/@ax-cli/schemas/dist/public/agent/chat-types.js.map +1 -0
  75. package/node_modules/@ax-cli/schemas/dist/public/agent/index.d.ts +9 -0
  76. package/node_modules/@ax-cli/schemas/dist/public/agent/index.d.ts.map +1 -0
  77. package/node_modules/@ax-cli/schemas/dist/public/agent/index.js +9 -0
  78. package/node_modules/@ax-cli/schemas/dist/public/agent/index.js.map +1 -0
  79. package/package.json +1 -1
  80. package/packages/schemas/dist/index.d.ts +1 -0
  81. package/packages/schemas/dist/index.d.ts.map +1 -1
  82. package/packages/schemas/dist/index.js.map +1 -1
  83. package/packages/schemas/dist/public/agent/chat-types.d.ts +164 -0
  84. package/packages/schemas/dist/public/agent/chat-types.d.ts.map +1 -0
  85. package/packages/schemas/dist/public/agent/chat-types.js +10 -0
  86. package/packages/schemas/dist/public/agent/chat-types.js.map +1 -0
  87. package/packages/schemas/dist/public/agent/index.d.ts +9 -0
  88. package/packages/schemas/dist/public/agent/index.d.ts.map +1 -0
  89. package/packages/schemas/dist/public/agent/index.js +9 -0
  90. package/packages/schemas/dist/public/agent/index.js.map +1 -0
  91. package/dist/mcp/config-detector-v2.d.ts +0 -83
  92. package/dist/mcp/config-detector-v2.js +0 -328
  93. package/dist/mcp/config-detector-v2.js.map +0 -1
  94. package/dist/mcp/config-migrator-v2.d.ts +0 -89
  95. package/dist/mcp/config-migrator-v2.js +0 -288
  96. package/dist/mcp/config-migrator-v2.js.map +0 -1
  97. package/dist/mcp/config-v2.d.ts +0 -111
  98. package/dist/mcp/config-v2.js +0 -443
  99. package/dist/mcp/config-v2.js.map +0 -1
  100. package/dist/mcp/transports-v2.d.ts +0 -152
  101. package/dist/mcp/transports-v2.js +0 -481
  102. package/dist/mcp/transports-v2.js.map +0 -1
  103. package/dist/utils/error-sanitizer.d.ts +0 -119
  104. package/dist/utils/error-sanitizer.js +0 -253
  105. package/dist/utils/error-sanitizer.js.map +0 -1
  106. package/dist/utils/errors.d.ts +0 -74
  107. package/dist/utils/errors.js +0 -139
  108. package/dist/utils/errors.js.map +0 -1
  109. package/dist/utils/incremental-analyzer.d.ts +0 -134
  110. package/dist/utils/incremental-analyzer.js +0 -377
  111. package/dist/utils/incremental-analyzer.js.map +0 -1
  112. package/dist/utils/settings.d.ts +0 -1
  113. package/dist/utils/settings.js +0 -4
  114. package/dist/utils/settings.js.map +0 -1
  115. package/dist/utils/streaming-analyzer.d.ts +0 -160
  116. package/dist/utils/streaming-analyzer.js +0 -214
  117. 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,OA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9B,IAAI,EAAE,kBAAkB,CAAC;IAEzB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,kDAAkD;IAClD,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAE7B,uBAAuB;IACvB,QAAQ,CAAC,EAAE,cAAc,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,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 {};
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/public/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defai.digital/ax-cli",
3
- "version": "3.8.22",
3
+ "version": "3.8.23",
4
4
  "sdkVersion": "1.2.0",
5
5
  "description": "Enterprise-Class AI Command Line Interface - Primary support for GLM (General Language Model) with multi-provider AI orchestration powered by AutomatosX.",
6
6
  "type": "module",
@@ -11,4 +11,5 @@
11
11
  export { brand, unbrand, isBranded, createBrandFactory, type __brand, type Brand, type ExtractBrand, type ExtractBase, } from './public/core/brand-types.js';
12
12
  export { ApiResponseId, ToolCallId, ToolCallIdSchema, ModelId, ModelIdSchema, TenantId, ApiKeyId, MCPServerId, MCPServerIdSchema, UsageRecordId, PlanId, SessionId, RequestId, type ApiResponseId as ApiResponseIdType, type ToolCallId as ToolCallIdType, type ModelId as ModelIdType, type TenantId as TenantIdType, type ApiKeyId as ApiKeyIdType, type MCPServerId as MCPServerIdType, type UsageRecordId as UsageRecordIdType, type PlanId as PlanIdType, type SessionId as SessionIdType, type RequestId as RequestIdType, } from './public/core/id-types.js';
13
13
  export { MessageRoleEnum, FinishReasonEnum, TransportEnum, EditorCommandEnum, type MessageRole, type FinishReason, type Transport, type EditorCommand, } from './public/core/enums.js';
14
+ export { type LLMToolCallRef, type ToolResultRef, type ChatEntry, type StreamingChunkType, type StreamingChunk, type AccumulatedMessage, type ChatHistory, } from './public/agent/index.js';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,SAAS,EACT,SAAS,EACT,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,UAAU,IAAI,cAAc,EACjC,KAAK,OAAO,IAAI,WAAW,EAC3B,KAAK,QAAQ,IAAI,YAAY,EAC7B,KAAK,QAAQ,IAAI,YAAY,EAC7B,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,MAAM,IAAI,UAAU,EACzB,KAAK,SAAS,IAAI,aAAa,EAC/B,KAAK,SAAS,IAAI,aAAa,GAChC,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,SAAS,EACT,SAAS,EACT,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,UAAU,IAAI,cAAc,EACjC,KAAK,OAAO,IAAI,WAAW,EAC3B,KAAK,QAAQ,IAAI,YAAY,EAC7B,KAAK,QAAQ,IAAI,YAAY,EAC7B,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,MAAM,IAAI,UAAU,EACzB,KAAK,SAAS,IAAI,aAAa,EAC/B,KAAK,SAAS,IAAI,aAAa,GAChC,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,yBAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4BAA4B;AAC5B,OAAO,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,kBAAkB,GAKnB,MAAM,8BAA8B,CAAC;AAEtC,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,SAAS,EACT,SAAS,GAWV,MAAM,2BAA2B,CAAC;AAEnC,oBAAoB;AACpB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GAKlB,MAAM,wBAAwB,CAAC;AAEhC,yDAAyD;AACzD,qCAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4BAA4B;AAC5B,OAAO,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,kBAAkB,GAKnB,MAAM,8BAA8B,CAAC;AAEtC,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,SAAS,EACT,SAAS,GAWV,MAAM,2BAA2B,CAAC;AAEnC,oBAAoB;AACpB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GAKlB,MAAM,wBAAwB,CAAC;AAahC,yDAAyD;AACzD,qCAAqC"}
@@ -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;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,SAAS;IACxB,yBAAyB;IACzB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC;IAEzD,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAEhB,kCAAkC;IAClC,SAAS,EAAE,IAAI,CAAC;IAEhB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAE7B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,wDAAwD;IACxD,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM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ClD,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,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 {};
9
+ //# sourceMappingURL=index.js.map
@@ -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;