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,119 +0,0 @@
1
- /**
2
- * CLI 中间件
3
- *
4
- *
5
- * - 验证参数
6
- * - 加载配置
7
- * - 设置全局状态
8
- */
9
-
10
- import type { CliArguments } from './types.js';
11
- import { configManager } from '../config/index.js';
12
-
13
- /**
14
- *
15
- *
16
- *
17
- * 1. 处理 --yolo 快捷方式
18
- * 2. 检测工具列表冲突
19
- */
20
- export const validatePermissions = (argv: CliArguments): void => {
21
- // 1. 处理 --yolo 快捷方
22
- if (argv.yolo) {
23
- if (argv.permissionMode && argv.permissionMode !== 'yolo') {
24
- throw new Error(
25
- 'Cannot use both --yolo and --permission-mode with different values'
26
- );
27
- }
28
- argv.permissionMode = 'yolo';
29
- console.error('\x1b[33m⚠ YOLO MODE — Claude will execute ALL commands without confirmation. Use with caution.\x1b[0m');
30
- }
31
-
32
- // 2. 验证工具列表冲
33
- if (Array.isArray(argv.allowedTools) && Array.isArray(argv.disallowedTools)) {
34
- const allowedSet = new Set(argv.allowedTools);
35
- const intersection = argv.disallowedTools.filter(tool => allowedSet.has(tool));
36
-
37
- if (intersection.length > 0) {
38
- throw new Error(
39
- `Tools cannot be both allowed and disallowed: ${intersection.join(', ')}`
40
- );
41
- }
42
- }
43
- };
44
-
45
- /**
46
- *
47
- *
48
- *
49
- * 1. 初始化 ConfigManager
50
- * 2. 应用 CLI 参数
51
- * 3. 验证会话选项
52
- */
53
- export const loadConfiguration = async (argv: CliArguments): Promise<void> => {
54
- // 跳过 --init 命令的配置加
55
- if (argv.init) {
56
- return;
57
- }
58
-
59
- try {
60
- // 1. 初始化 ConfigManager(加载配置文件 + 环境变
61
- await configManager.initialize();
62
-
63
- // 2. 应用 CLI 参数(最高优先
64
- configManager.applyCliArgs({
65
- apiKey: argv.apiKey,
66
- baseURL: argv.baseUrl,
67
- model: argv.model,
68
- });
69
-
70
- if (argv.debug) {
71
- console.log('[CLI] Configuration loaded successfully');
72
- const paths = configManager.getLoadedConfigPaths();
73
- if (paths.length > 0) {
74
- console.log('[CLI] Loaded config files:', paths);
75
- }
76
- }
77
- } catch (error) {
78
- console.error('❌ Failed to initialize configuration');
79
- console.error(
80
- 'Error:',
81
- error instanceof Error ? error.message : 'Unknown error'
82
- );
83
- console.error('');
84
- console.error('Please check:');
85
- console.error(' 1. Config file format (~/.aegis/config.json)');
86
- console.error(' 2. Run "aegis --init" to create default config');
87
- console.error(' 3. Config file permissions');
88
- process.exit(1);
89
- }
90
-
91
- // 3. 验证会话选
92
- if (argv.continue && argv.resume) {
93
- throw new Error('Cannot use both --continue and --resume flags');
94
- }
95
- };
96
-
97
- /**
98
- *
99
- *
100
- *
101
- * 1. 验证输出格式组合
102
- */
103
- export const validateOutput = (argv: CliArguments): void => {
104
- // 验证输出格式只能与 --print 一起使
105
- if (argv.outputFormat && argv.outputFormat !== 'text' && !argv.print) {
106
- throw new Error('--output-format can only be used with --print flag');
107
- }
108
- };
109
-
110
- /**
111
- *
112
- *
113
- */
114
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
- export const middlewareChain: any[] = [
116
- validatePermissions,
117
- loadConfiguration,
118
- validateOutput,
119
- ];
package/src/cli/types.ts DELETED
@@ -1,75 +0,0 @@
1
- /**
2
- * CLI 类型定义
3
- */
4
-
5
- import type { Arguments } from 'yargs';
6
-
7
- /**
8
- *
9
- */
10
- export type PermissionMode = 'default' | 'autoEdit' | 'yolo';
11
-
12
- /**
13
- * UI 主题
14
- */
15
- export type ThemeName = 'default' | 'dark' | 'ocean' | 'forest' | 'sunset';
16
-
17
- /**
18
- * CLI 参数接口
19
- */
20
- export interface CliArguments extends Arguments {
21
- // 调试选
22
- debug?: boolean;
23
-
24
- // AI 选
25
- apiKey?: string;
26
- baseUrl?: string;
27
- model?: string;
28
- maxTurns?: number;
29
- router?: boolean;
30
-
31
- // 安全选
32
- permissionMode?: PermissionMode;
33
- yolo?: boolean;
34
- allowedTools?: string[];
35
- disallowedTools?: string[];
36
-
37
- // 会话选
38
- continue?: boolean;
39
- resume?: string | boolean;
40
-
41
- // 输出选
42
- print?: boolean;
43
- outputFormat?: 'text' | 'json';
44
-
45
- // UI 选
46
- theme?: ThemeName;
47
- plain?: boolean;
48
-
49
- // 命令相
50
- init?: boolean;
51
-
52
- // 位置参数(初始消
53
- message?: string;
54
- }
55
-
56
- /**
57
- *
58
- *
59
- */
60
- export type MiddlewareFunction<T = CliArguments> = (
61
- argv: T
62
- ) => void | Promise<void>;
63
-
64
- /**
65
- * App Props - 传递给 UI 组件的属性
66
- */
67
- export interface AppProps {
68
- apiKey: string;
69
- baseURL?: string;
70
- model?: string;
71
- initialMessage?: string;
72
- debug?: boolean;
73
- permissionMode?: PermissionMode;
74
- resumeSessionId?: string;
75
- }