aegiscode 3.1.10 → 3.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.
Files changed (209) hide show
  1. package/bin/aegis-cli-linux-x64 +0 -0
  2. package/bin/cli.js +68 -0
  3. package/package.json +11 -48
  4. package/scripts/download-binary.mjs +155 -0
  5. package/dist/main.js +0 -2171
  6. package/gui/run-gui.cjs +0 -13
  7. package/src/agent/Agent.ts +0 -903
  8. package/src/agent/SimpleAgent.ts +0 -48
  9. package/src/agent/index.ts +0 -54
  10. package/src/agent/orchestrator/AppBuilder.ts +0 -443
  11. package/src/agent/orchestrator/CouncilAgent.ts +0 -310
  12. package/src/agent/orchestrator/DiscussionRoom.ts +0 -462
  13. package/src/agent/orchestrator/OrchestratorAgent.ts +0 -637
  14. package/src/agent/orchestrator/index.ts +0 -38
  15. package/src/agent/orchestrator/utils.ts +0 -397
  16. package/src/agent/pricing.ts +0 -115
  17. package/src/agent/router.ts +0 -74
  18. package/src/agent/routerStats.ts +0 -121
  19. package/src/agent/types.ts +0 -318
  20. package/src/auth/login.ts +0 -383
  21. package/src/cli/config.ts +0 -189
  22. package/src/cli/index.ts +0 -17
  23. package/src/cli/middleware.ts +0 -119
  24. package/src/cli/types.ts +0 -75
  25. package/src/config/ConfigManager.ts +0 -587
  26. package/src/config/index.ts +0 -7
  27. package/src/config/types.ts +0 -584
  28. package/src/context/CompactionService.ts +0 -300
  29. package/src/context/ContextManager.ts +0 -450
  30. package/src/context/FileAnalyzer.ts +0 -267
  31. package/src/context/TokenCounter.ts +0 -265
  32. package/src/context/index.ts +0 -27
  33. package/src/context/storage/CacheStore.ts +0 -176
  34. package/src/context/storage/JSONLStore.ts +0 -201
  35. package/src/context/storage/MemoryStore.ts +0 -205
  36. package/src/context/storage/PersistentStore.ts +0 -327
  37. package/src/context/storage/index.ts +0 -9
  38. package/src/context/storage/pathUtils.ts +0 -114
  39. package/src/context/test.ts +0 -309
  40. package/src/context/types.ts +0 -268
  41. package/src/hooks/HookExecutor.ts +0 -434
  42. package/src/hooks/HookManager.ts +0 -596
  43. package/src/hooks/HookService.ts +0 -269
  44. package/src/hooks/Matcher.ts +0 -157
  45. package/src/hooks/index.ts +0 -63
  46. package/src/hooks/types.ts +0 -424
  47. package/src/main.tsx +0 -596
  48. package/src/mcp/HealthMonitor.ts +0 -150
  49. package/src/mcp/McpClient.ts +0 -491
  50. package/src/mcp/McpRegistry.ts +0 -321
  51. package/src/mcp/createMcpTool.ts +0 -251
  52. package/src/mcp/index.ts +0 -15
  53. package/src/mcp/server.ts +0 -334
  54. package/src/mcp/test-server.ts +0 -88
  55. package/src/mcp/test.ts +0 -372
  56. package/src/mcp/types.ts +0 -247
  57. package/src/memory/AgentMemoryBus.ts +0 -432
  58. package/src/memory/CloudSync.ts +0 -99
  59. package/src/memory/DriveSync.ts +0 -106
  60. package/src/memory/SharedMemory.ts +0 -951
  61. package/src/memory/index.ts +0 -14
  62. package/src/memory/machineFingerprint.ts +0 -40
  63. package/src/orchestrator/SubAgentMetadata.ts +0 -136
  64. package/src/prompts/builder.ts +0 -213
  65. package/src/prompts/default.ts +0 -144
  66. package/src/prompts/index.ts +0 -16
  67. package/src/prompts/plan.ts +0 -64
  68. package/src/prompts/test.ts +0 -78
  69. package/src/services/AnthropicChatService.ts +0 -341
  70. package/src/services/ChatService.ts +0 -347
  71. package/src/services/ClaudeCliChatService.ts +0 -256
  72. package/src/services/CloudSync.ts +0 -168
  73. package/src/services/CostLedger.ts +0 -211
  74. package/src/services/Heartbeat.ts +0 -135
  75. package/src/services/LearningCollector.ts +0 -291
  76. package/src/services/OllamaInstaller.ts +0 -342
  77. package/src/services/VersionChecker.ts +0 -445
  78. package/src/services/index.ts +0 -57
  79. package/src/services/streaming/OpenAIEventAdapter.ts +0 -126
  80. package/src/services/streaming/RenderingProfile.ts +0 -90
  81. package/src/services/streaming/StreamEventParser.ts +0 -181
  82. package/src/services/streaming/ThrottledRenderer.ts +0 -139
  83. package/src/services/streaming/TranscriptBuffer.ts +0 -574
  84. package/src/services/streaming/eventStatusMap.ts +0 -52
  85. package/src/services/streaming/index.ts +0 -46
  86. package/src/services/streaming/renderFormatting.ts +0 -79
  87. package/src/services/streaming/types.ts +0 -234
  88. package/src/skills/SkillLoader.ts +0 -126
  89. package/src/skills/SkillRegistry.ts +0 -366
  90. package/src/skills/index.ts +0 -48
  91. package/src/skills/types.ts +0 -146
  92. package/src/slash-commands/billing.ts +0 -70
  93. package/src/slash-commands/build.ts +0 -413
  94. package/src/slash-commands/builtinCommands.ts +0 -2733
  95. package/src/slash-commands/clone.ts +0 -242
  96. package/src/slash-commands/council.ts +0 -125
  97. package/src/slash-commands/custom/CustomCommandExecutor.ts +0 -143
  98. package/src/slash-commands/custom/CustomCommandLoader.ts +0 -251
  99. package/src/slash-commands/custom/CustomCommandRegistry.ts +0 -144
  100. package/src/slash-commands/custom/index.ts +0 -7
  101. package/src/slash-commands/debate.ts +0 -254
  102. package/src/slash-commands/gmail.ts +0 -105
  103. package/src/slash-commands/index.ts +0 -388
  104. package/src/slash-commands/mcpCommand.ts +0 -205
  105. package/src/slash-commands/types.ts +0 -201
  106. package/src/store/index.ts +0 -76
  107. package/src/store/selectors.ts +0 -246
  108. package/src/store/slices/appSlice.ts +0 -205
  109. package/src/store/slices/commandSlice.ts +0 -115
  110. package/src/store/slices/configSlice.ts +0 -46
  111. package/src/store/slices/focusSlice.ts +0 -64
  112. package/src/store/slices/index.ts +0 -9
  113. package/src/store/slices/sessionSlice.ts +0 -424
  114. package/src/store/streaming-buffer.ts +0 -425
  115. package/src/store/test.ts +0 -296
  116. package/src/store/types.ts +0 -274
  117. package/src/store/vanilla.ts +0 -186
  118. package/src/tools/builtin/bash.ts +0 -236
  119. package/src/tools/builtin/council.ts +0 -105
  120. package/src/tools/builtin/edit.ts +0 -213
  121. package/src/tools/builtin/glob.ts +0 -136
  122. package/src/tools/builtin/grep.ts +0 -263
  123. package/src/tools/builtin/index.ts +0 -61
  124. package/src/tools/builtin/memory.ts +0 -66
  125. package/src/tools/builtin/read.ts +0 -168
  126. package/src/tools/builtin/skill.ts +0 -97
  127. package/src/tools/builtin/snapshot.ts +0 -40
  128. package/src/tools/builtin/task.ts +0 -106
  129. package/src/tools/builtin/write.ts +0 -134
  130. package/src/tools/createTool.ts +0 -221
  131. package/src/tools/execution/ExecutionPipeline.ts +0 -263
  132. package/src/tools/execution/index.ts +0 -40
  133. package/src/tools/execution/stages/CacheStage.ts +0 -131
  134. package/src/tools/execution/stages/ConfirmationStage.ts +0 -203
  135. package/src/tools/execution/stages/DiscoveryStage.ts +0 -46
  136. package/src/tools/execution/stages/ExecutionStage.ts +0 -48
  137. package/src/tools/execution/stages/FormattingStage.ts +0 -44
  138. package/src/tools/execution/stages/HookStage.ts +0 -72
  139. package/src/tools/execution/stages/PermissionStage.ts +0 -287
  140. package/src/tools/execution/stages/PostHookStage.ts +0 -71
  141. package/src/tools/execution/stages/index.ts +0 -12
  142. package/src/tools/execution/test.ts +0 -266
  143. package/src/tools/execution/types.ts +0 -273
  144. package/src/tools/index.ts +0 -81
  145. package/src/tools/registry.ts +0 -304
  146. package/src/tools/schemas.ts +0 -109
  147. package/src/tools/test.ts +0 -220
  148. package/src/tools/types.ts +0 -175
  149. package/src/tools/validation/PermissionChecker.ts +0 -242
  150. package/src/tools/validation/SensitiveFileDetector.ts +0 -210
  151. package/src/tools/validation/index.ts +0 -11
  152. package/src/ui/App.tsx +0 -166
  153. package/src/ui/components/AegisInterface.tsx +0 -484
  154. package/src/ui/components/common/ChatSearch.tsx +0 -150
  155. package/src/ui/components/common/ErrorBoundary.tsx +0 -82
  156. package/src/ui/components/common/ExitMessage.tsx +0 -120
  157. package/src/ui/components/common/LoadingIndicator.tsx +0 -49
  158. package/src/ui/components/common/index.ts +0 -6
  159. package/src/ui/components/dialog/ConfirmationPrompt.tsx +0 -208
  160. package/src/ui/components/dialog/InteractiveSelector.tsx +0 -149
  161. package/src/ui/components/dialog/SetupWizard.tsx +0 -297
  162. package/src/ui/components/dialog/UpdatePrompt.tsx +0 -155
  163. package/src/ui/components/dialog/index.ts +0 -8
  164. package/src/ui/components/index.ts +0 -28
  165. package/src/ui/components/input/CommandSuggestions.tsx +0 -139
  166. package/src/ui/components/input/CustomTextInput.tsx +0 -220
  167. package/src/ui/components/input/InputArea.tsx +0 -361
  168. package/src/ui/components/input/PromptSuggestions.tsx +0 -66
  169. package/src/ui/components/input/index.ts +0 -6
  170. package/src/ui/components/layout/ChatStatusBar.tsx +0 -90
  171. package/src/ui/components/layout/ContextBar.tsx +0 -79
  172. package/src/ui/components/layout/MessageArea.tsx +0 -96
  173. package/src/ui/components/layout/MessageList.tsx +0 -647
  174. package/src/ui/components/layout/MessageSeparator.tsx +0 -26
  175. package/src/ui/components/layout/WelcomeMessage.tsx +0 -93
  176. package/src/ui/components/layout/index.ts +0 -7
  177. package/src/ui/components/markdown/CodeHighlighter.tsx +0 -292
  178. package/src/ui/components/markdown/MessageRenderer.tsx +0 -1211
  179. package/src/ui/components/markdown/index.ts +0 -8
  180. package/src/ui/components/markdown/parser.ts +0 -336
  181. package/src/ui/components/markdown/types.ts +0 -66
  182. package/src/ui/focus/FocusManager.ts +0 -137
  183. package/src/ui/focus/index.ts +0 -13
  184. package/src/ui/focus/types.ts +0 -54
  185. package/src/ui/focus/useFocus.ts +0 -75
  186. package/src/ui/hooks/index.ts +0 -11
  187. package/src/ui/hooks/useAgent.ts +0 -284
  188. package/src/ui/hooks/useCommandHistory.ts +0 -87
  189. package/src/ui/hooks/useCommandProcessor.ts +0 -443
  190. package/src/ui/hooks/useConfirmation.ts +0 -99
  191. package/src/ui/hooks/useCtrlCHandler.ts +0 -100
  192. package/src/ui/hooks/useInputBuffer.ts +0 -122
  193. package/src/ui/hooks/useTerminalSize.ts +0 -68
  194. package/src/ui/hooks/useTerminalWidth.ts +0 -5
  195. package/src/ui/hooks/useWindowedList.ts +0 -118
  196. package/src/ui/render-debugger.ts +0 -621
  197. package/src/ui/test.ts +0 -189
  198. package/src/ui/themes/ThemeManager.ts +0 -332
  199. package/src/ui/themes/aegisTheme.ts +0 -87
  200. package/src/ui/themes/darkTheme.ts +0 -87
  201. package/src/ui/themes/defaultTheme.ts +0 -85
  202. package/src/ui/themes/index.ts +0 -10
  203. package/src/ui/themes/lightTheme.ts +0 -89
  204. package/src/ui/themes/popularThemes.ts +0 -187
  205. package/src/ui/themes/types.ts +0 -130
  206. package/src/utils/clipboard.ts +0 -48
  207. package/src/utils/debug.ts +0 -43
  208. package/src/utils/environment.ts +0 -68
  209. package/src/utils/index.ts +0 -10
@@ -1,181 +0,0 @@
1
- /**
2
- * StreamEventParser — replicates Claude Code's event_parser.py
3
- *
4
- * Parses raw Anthropic Messages API streaming events (content_block_start/delta/stop)
5
- * into typed internal events that the TranscriptBuffer consumes.
6
- *
7
- * This is the entry point for all streaming content. Every chunk from the API
8
- * stream passes through here before being applied to the transcript.
9
- */
10
-
11
- import type {
12
- AnthropicStreamEvent,
13
- ParsedEvent,
14
- ContentBlockStartEvent,
15
- ContentBlockDeltaEvent,
16
- MessageStartEvent,
17
- } from './types.js';
18
-
19
- /**
20
- * Parse a raw Anthropic stream event into one or more internal events.
21
- *
22
- * Returns an array of ParsedEvents (most events produce 1, content_block_start
23
- * may produce 2 if there's initial text). Empty array if not recognized.
24
- */
25
- export function parseStreamEvent(event: AnthropicStreamEvent): ParsedEvent[] {
26
- const results: ParsedEvent[] = [];
27
-
28
- switch (event.type) {
29
- case 'content_block_start':
30
- return parseContentBlockStart(event);
31
-
32
- case 'content_block_delta':
33
- return parseContentBlockDelta(event);
34
-
35
- case 'content_block_stop':
36
- return [{ type: 'block_stop', index: event.index }];
37
-
38
- case 'message_start':
39
- // message_start contains initial content blocks in non-streaming form.
40
- // If the API sends content inline, parse them as full blocks.
41
- return parseMessageContent(event);
42
-
43
- case 'message_delta':
44
- // message_delta signals completion metadata — map to complete event.
45
- return [{ type: 'complete', status: event.delta.stop_reason }];
46
-
47
- case 'message_stop':
48
- // Signal final completion. If no content was streamed, this ensures
49
- // the transcript shows something.
50
- return [{ type: 'complete', status: 'message_stop' }];
51
-
52
- case 'ping':
53
- return [];
54
-
55
- case 'error':
56
- return [{
57
- type: 'error',
58
- message: event.error?.message || 'Unknown API error',
59
- }];
60
-
61
- default:
62
- return [];
63
- }
64
- }
65
-
66
- /**
67
- * Parse content_block_start — produces the start event for the block type,
68
- * plus potentially initial text/thinking content.
69
- */
70
- function parseContentBlockStart(event: ContentBlockStartEvent): ParsedEvent[] {
71
- const block = event.content_block;
72
- const results: ParsedEvent[] = [];
73
-
74
- switch (block.type) {
75
- case 'thinking':
76
- results.push({ type: 'thinking_start', index: event.index });
77
- if (block.thinking) {
78
- results.push({ type: 'thinking_delta', index: event.index, text: block.thinking });
79
- }
80
- break;
81
-
82
- case 'text':
83
- results.push({ type: 'text_start', index: event.index });
84
- if (block.text) {
85
- results.push({ type: 'text_delta', index: event.index, text: block.text });
86
- }
87
- break;
88
-
89
- case 'tool_use':
90
- results.push({
91
- type: 'tool_use_start',
92
- index: event.index,
93
- id: block.id,
94
- name: block.name,
95
- input: block.input,
96
- });
97
- break;
98
- }
99
-
100
- return results;
101
- }
102
-
103
- /**
104
- * Parse content_block_delta — produces delta events for the block type.
105
- */
106
- function parseContentBlockDelta(event: ContentBlockDeltaEvent): ParsedEvent[] {
107
- const delta = event.delta;
108
-
109
- switch (delta.type) {
110
- case 'text_delta':
111
- return [{
112
- type: 'text_delta',
113
- index: event.index,
114
- text: delta.text,
115
- }];
116
-
117
- case 'thinking_delta':
118
- return [{
119
- type: 'thinking_delta',
120
- index: event.index,
121
- text: delta.thinking,
122
- }];
123
-
124
- case 'input_json_delta':
125
- return [{
126
- type: 'tool_use_delta',
127
- index: event.index,
128
- partial_json: delta.partial_json,
129
- }];
130
-
131
- default:
132
- return [];
133
- }
134
- }
135
-
136
- /**
137
- * Parse message content from message_start event — handles non-streaming
138
- * content blocks that arrive inline.
139
- */
140
- function parseMessageContent(event: MessageStartEvent): ParsedEvent[] {
141
- const content = event.message?.content;
142
- if (!Array.isArray(content) || content.length === 0) return [];
143
-
144
- const results: ParsedEvent[] = [];
145
-
146
- for (const block of content) {
147
- if (typeof block !== 'object' || block === null) continue;
148
-
149
- const b = block as Record<string, unknown>;
150
-
151
- switch (b.type) {
152
- case 'text':
153
- results.push({ type: 'text_chunk' as const, text: String(b.text || '') });
154
- break;
155
-
156
- case 'thinking':
157
- results.push({ type: 'thinking_chunk' as const, text: String(b.thinking || '') });
158
- break;
159
-
160
- case 'tool_use':
161
- results.push({
162
- type: 'tool_use' as const,
163
- id: String(b.id || '').trim(),
164
- name: String(b.name || ''),
165
- input: b.input,
166
- });
167
- break;
168
-
169
- case 'tool_result':
170
- results.push({
171
- type: 'tool_result' as const,
172
- tool_use_id: String(b.tool_use_id || '').trim(),
173
- content: b.content,
174
- is_error: Boolean(b.is_error),
175
- });
176
- break;
177
- }
178
- }
179
-
180
- return results;
181
- }
@@ -1,139 +0,0 @@
1
- /**
2
- * ThrottledRenderer — rate-limited transcript rendering with status lines.
3
- *
4
- * Replicates free-claude-code's ThrottledTranscriptEditor (messaging/ui_updates.py)
5
- * plus the UI update loop from node_event_pipeline.py process_parsed_cli_event().
6
- *
7
- * Key behaviors:
8
- * 1. Throttles to 1 update per second (configurable)
9
- * 2. Deduplicates — skips if rendered text hasn't changed
10
- * 3. Handles status line attachment
11
- * 4. Integrates with RenderingProfile for platform-specific formatting
12
- */
13
-
14
- import { TranscriptBuffer } from './TranscriptBuffer.js';
15
- import type { RenderContext } from './types.js';
16
- import type { RenderingProfile } from './types.js';
17
-
18
- /** Callback type for delivering rendered output */
19
- export type RenderOutputCallback = (text: string) => void | Promise<void>;
20
-
21
- export interface ThrottledRendererOptions {
22
- /** Throttle interval in ms (default 1000) */
23
- throttleMs?: number;
24
- /** Debug logging */
25
- debug?: boolean;
26
- }
27
-
28
- /**
29
- * ThrottledRenderer — drives transcript rendering with rate limiting.
30
- *
31
- * Usage:
32
- * const renderer = new ThrottledRenderer(transcript, profile, outputCallback);
33
- * await renderer.update('🔄 Processing...'); // throttled
34
- * await renderer.update('✅ Complete', true); // forced (no throttle)
35
- */
36
- export class ThrottledRenderer {
37
- private _transcript: TranscriptBuffer;
38
- private _renderCtx: RenderContext;
39
- private _outputCallback: RenderOutputCallback;
40
- private _throttleMs: number;
41
- private _debug: boolean;
42
-
43
- private _lastUpdate = 0;
44
- private _lastDisplayedText: string | null = null;
45
- private _lastStatus: string | null = null;
46
- private _pendingTimer: ReturnType<typeof setTimeout> | null = null;
47
-
48
- constructor(
49
- transcript: TranscriptBuffer,
50
- profile: RenderingProfile,
51
- outputCallback: RenderOutputCallback,
52
- options: ThrottledRendererOptions = {},
53
- ) {
54
- this._transcript = transcript;
55
- this._renderCtx = profile.renderCtx;
56
- this._outputCallback = outputCallback;
57
- this._throttleMs = options.throttleMs ?? 1000;
58
- this._debug = options.debug ?? false;
59
- }
60
-
61
- get lastStatus(): string | null {
62
- return this._lastStatus;
63
- }
64
-
65
- /**
66
- * Update the rendered output.
67
- * @param status Optional status line to append below transcript
68
- * @param force If true, skip throttling and render immediately
69
- */
70
- async update(status?: string | null, force = false): Promise<void> {
71
- const now = Date.now();
72
-
73
- if (status !== undefined && status !== null) {
74
- this._lastStatus = status;
75
- }
76
-
77
- if (!force && now - this._lastUpdate < this._throttleMs) {
78
- // Schedule a pending update in case no more events arrive
79
- if (!this._pendingTimer) {
80
- this._pendingTimer = setTimeout(() => {
81
- this._pendingTimer = null;
82
- this._doUpdate().catch(() => {});
83
- }, this._throttleMs);
84
- }
85
- return;
86
- }
87
-
88
- // Clear any pending timer
89
- if (this._pendingTimer) {
90
- clearTimeout(this._pendingTimer);
91
- this._pendingTimer = null;
92
- }
93
-
94
- await this._doUpdate();
95
- }
96
-
97
- private async _doUpdate(): Promise<void> {
98
- this._lastUpdate = Date.now();
99
-
100
- let display: string;
101
- try {
102
- display = this._transcript.render(this._renderCtx, this._lastStatus ?? undefined);
103
- } catch (err) {
104
- if (this._debug) {
105
- console.error('[ThrottledRenderer] render failed:', err);
106
- }
107
- return;
108
- }
109
-
110
- if (!display && !this._lastDisplayedText) {
111
- return;
112
- }
113
-
114
- if (display === this._lastDisplayedText) {
115
- return; // dedup
116
- }
117
-
118
- this._lastDisplayedText = display;
119
-
120
- try {
121
- await this._outputCallback(display);
122
- } catch (err) {
123
- if (this._debug) {
124
- console.error('[ThrottledRenderer] output callback failed:', err);
125
- }
126
- }
127
- }
128
-
129
- /** Reset internal state (for new turns) */
130
- reset(): void {
131
- this._lastUpdate = 0;
132
- this._lastDisplayedText = null;
133
- this._lastStatus = null;
134
- if (this._pendingTimer) {
135
- clearTimeout(this._pendingTimer);
136
- this._pendingTimer = null;
137
- }
138
- }
139
- }