aegiscode 3.1.10 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aegis.js +165 -0
- package/package.json +18 -86
- package/LICENSE +0 -21
- package/README.md +0 -394
- package/dist/main.js +0 -2171
- package/gui/run-gui.cjs +0 -13
- package/src/agent/Agent.ts +0 -903
- package/src/agent/SimpleAgent.ts +0 -48
- package/src/agent/index.ts +0 -54
- package/src/agent/orchestrator/AppBuilder.ts +0 -443
- package/src/agent/orchestrator/CouncilAgent.ts +0 -310
- package/src/agent/orchestrator/DiscussionRoom.ts +0 -462
- package/src/agent/orchestrator/OrchestratorAgent.ts +0 -637
- package/src/agent/orchestrator/index.ts +0 -38
- package/src/agent/orchestrator/utils.ts +0 -397
- package/src/agent/pricing.ts +0 -115
- package/src/agent/router.ts +0 -74
- package/src/agent/routerStats.ts +0 -121
- package/src/agent/types.ts +0 -318
- package/src/auth/login.ts +0 -383
- package/src/cli/config.ts +0 -189
- package/src/cli/index.ts +0 -17
- package/src/cli/middleware.ts +0 -119
- package/src/cli/types.ts +0 -75
- package/src/config/ConfigManager.ts +0 -587
- package/src/config/index.ts +0 -7
- package/src/config/types.ts +0 -584
- package/src/context/CompactionService.ts +0 -300
- package/src/context/ContextManager.ts +0 -450
- package/src/context/FileAnalyzer.ts +0 -267
- package/src/context/TokenCounter.ts +0 -265
- package/src/context/index.ts +0 -27
- package/src/context/storage/CacheStore.ts +0 -176
- package/src/context/storage/JSONLStore.ts +0 -201
- package/src/context/storage/MemoryStore.ts +0 -205
- package/src/context/storage/PersistentStore.ts +0 -327
- package/src/context/storage/index.ts +0 -9
- package/src/context/storage/pathUtils.ts +0 -114
- package/src/context/test.ts +0 -309
- package/src/context/types.ts +0 -268
- package/src/hooks/HookExecutor.ts +0 -434
- package/src/hooks/HookManager.ts +0 -596
- package/src/hooks/HookService.ts +0 -269
- package/src/hooks/Matcher.ts +0 -157
- package/src/hooks/index.ts +0 -63
- package/src/hooks/types.ts +0 -424
- package/src/main.tsx +0 -596
- package/src/mcp/HealthMonitor.ts +0 -150
- package/src/mcp/McpClient.ts +0 -491
- package/src/mcp/McpRegistry.ts +0 -321
- package/src/mcp/createMcpTool.ts +0 -251
- package/src/mcp/index.ts +0 -15
- package/src/mcp/server.ts +0 -334
- package/src/mcp/test-server.ts +0 -88
- package/src/mcp/test.ts +0 -372
- package/src/mcp/types.ts +0 -247
- package/src/memory/AgentMemoryBus.ts +0 -432
- package/src/memory/CloudSync.ts +0 -99
- package/src/memory/DriveSync.ts +0 -106
- package/src/memory/SharedMemory.ts +0 -951
- package/src/memory/index.ts +0 -14
- package/src/memory/machineFingerprint.ts +0 -40
- package/src/orchestrator/SubAgentMetadata.ts +0 -136
- package/src/prompts/builder.ts +0 -213
- package/src/prompts/default.ts +0 -144
- package/src/prompts/index.ts +0 -16
- package/src/prompts/plan.ts +0 -64
- package/src/prompts/test.ts +0 -78
- package/src/services/AnthropicChatService.ts +0 -341
- package/src/services/ChatService.ts +0 -347
- package/src/services/ClaudeCliChatService.ts +0 -256
- package/src/services/CloudSync.ts +0 -168
- package/src/services/CostLedger.ts +0 -211
- package/src/services/Heartbeat.ts +0 -135
- package/src/services/LearningCollector.ts +0 -291
- package/src/services/OllamaInstaller.ts +0 -342
- package/src/services/VersionChecker.ts +0 -445
- package/src/services/index.ts +0 -57
- package/src/services/streaming/OpenAIEventAdapter.ts +0 -126
- package/src/services/streaming/RenderingProfile.ts +0 -90
- package/src/services/streaming/StreamEventParser.ts +0 -181
- package/src/services/streaming/ThrottledRenderer.ts +0 -139
- package/src/services/streaming/TranscriptBuffer.ts +0 -574
- package/src/services/streaming/eventStatusMap.ts +0 -52
- package/src/services/streaming/index.ts +0 -46
- package/src/services/streaming/renderFormatting.ts +0 -79
- package/src/services/streaming/types.ts +0 -234
- package/src/skills/SkillLoader.ts +0 -126
- package/src/skills/SkillRegistry.ts +0 -366
- package/src/skills/index.ts +0 -48
- package/src/skills/types.ts +0 -146
- package/src/slash-commands/billing.ts +0 -70
- package/src/slash-commands/build.ts +0 -413
- package/src/slash-commands/builtinCommands.ts +0 -2733
- package/src/slash-commands/clone.ts +0 -242
- package/src/slash-commands/council.ts +0 -125
- package/src/slash-commands/custom/CustomCommandExecutor.ts +0 -143
- package/src/slash-commands/custom/CustomCommandLoader.ts +0 -251
- package/src/slash-commands/custom/CustomCommandRegistry.ts +0 -144
- package/src/slash-commands/custom/index.ts +0 -7
- package/src/slash-commands/debate.ts +0 -254
- package/src/slash-commands/gmail.ts +0 -105
- package/src/slash-commands/index.ts +0 -388
- package/src/slash-commands/mcpCommand.ts +0 -205
- package/src/slash-commands/types.ts +0 -201
- package/src/store/index.ts +0 -76
- package/src/store/selectors.ts +0 -246
- package/src/store/slices/appSlice.ts +0 -205
- package/src/store/slices/commandSlice.ts +0 -115
- package/src/store/slices/configSlice.ts +0 -46
- package/src/store/slices/focusSlice.ts +0 -64
- package/src/store/slices/index.ts +0 -9
- package/src/store/slices/sessionSlice.ts +0 -424
- package/src/store/streaming-buffer.ts +0 -425
- package/src/store/test.ts +0 -296
- package/src/store/types.ts +0 -274
- package/src/store/vanilla.ts +0 -186
- package/src/tools/builtin/bash.ts +0 -236
- package/src/tools/builtin/council.ts +0 -105
- package/src/tools/builtin/edit.ts +0 -213
- package/src/tools/builtin/glob.ts +0 -136
- package/src/tools/builtin/grep.ts +0 -263
- package/src/tools/builtin/index.ts +0 -61
- package/src/tools/builtin/memory.ts +0 -66
- package/src/tools/builtin/read.ts +0 -168
- package/src/tools/builtin/skill.ts +0 -97
- package/src/tools/builtin/snapshot.ts +0 -40
- package/src/tools/builtin/task.ts +0 -106
- package/src/tools/builtin/write.ts +0 -134
- package/src/tools/createTool.ts +0 -221
- package/src/tools/execution/ExecutionPipeline.ts +0 -263
- package/src/tools/execution/index.ts +0 -40
- package/src/tools/execution/stages/CacheStage.ts +0 -131
- package/src/tools/execution/stages/ConfirmationStage.ts +0 -203
- package/src/tools/execution/stages/DiscoveryStage.ts +0 -46
- package/src/tools/execution/stages/ExecutionStage.ts +0 -48
- package/src/tools/execution/stages/FormattingStage.ts +0 -44
- package/src/tools/execution/stages/HookStage.ts +0 -72
- package/src/tools/execution/stages/PermissionStage.ts +0 -287
- package/src/tools/execution/stages/PostHookStage.ts +0 -71
- package/src/tools/execution/stages/index.ts +0 -12
- package/src/tools/execution/test.ts +0 -266
- package/src/tools/execution/types.ts +0 -273
- package/src/tools/index.ts +0 -81
- package/src/tools/registry.ts +0 -304
- package/src/tools/schemas.ts +0 -109
- package/src/tools/test.ts +0 -220
- package/src/tools/types.ts +0 -175
- package/src/tools/validation/PermissionChecker.ts +0 -242
- package/src/tools/validation/SensitiveFileDetector.ts +0 -210
- package/src/tools/validation/index.ts +0 -11
- package/src/ui/App.tsx +0 -166
- package/src/ui/components/AegisInterface.tsx +0 -484
- package/src/ui/components/common/ChatSearch.tsx +0 -150
- package/src/ui/components/common/ErrorBoundary.tsx +0 -82
- package/src/ui/components/common/ExitMessage.tsx +0 -120
- package/src/ui/components/common/LoadingIndicator.tsx +0 -49
- package/src/ui/components/common/index.ts +0 -6
- package/src/ui/components/dialog/ConfirmationPrompt.tsx +0 -208
- package/src/ui/components/dialog/InteractiveSelector.tsx +0 -149
- package/src/ui/components/dialog/SetupWizard.tsx +0 -297
- package/src/ui/components/dialog/UpdatePrompt.tsx +0 -155
- package/src/ui/components/dialog/index.ts +0 -8
- package/src/ui/components/index.ts +0 -28
- package/src/ui/components/input/CommandSuggestions.tsx +0 -139
- package/src/ui/components/input/CustomTextInput.tsx +0 -220
- package/src/ui/components/input/InputArea.tsx +0 -361
- package/src/ui/components/input/PromptSuggestions.tsx +0 -66
- package/src/ui/components/input/index.ts +0 -6
- package/src/ui/components/layout/ChatStatusBar.tsx +0 -90
- package/src/ui/components/layout/ContextBar.tsx +0 -79
- package/src/ui/components/layout/MessageArea.tsx +0 -96
- package/src/ui/components/layout/MessageList.tsx +0 -647
- package/src/ui/components/layout/MessageSeparator.tsx +0 -26
- package/src/ui/components/layout/WelcomeMessage.tsx +0 -93
- package/src/ui/components/layout/index.ts +0 -7
- package/src/ui/components/markdown/CodeHighlighter.tsx +0 -292
- package/src/ui/components/markdown/MessageRenderer.tsx +0 -1211
- package/src/ui/components/markdown/index.ts +0 -8
- package/src/ui/components/markdown/parser.ts +0 -336
- package/src/ui/components/markdown/types.ts +0 -66
- package/src/ui/focus/FocusManager.ts +0 -137
- package/src/ui/focus/index.ts +0 -13
- package/src/ui/focus/types.ts +0 -54
- package/src/ui/focus/useFocus.ts +0 -75
- package/src/ui/hooks/index.ts +0 -11
- package/src/ui/hooks/useAgent.ts +0 -284
- package/src/ui/hooks/useCommandHistory.ts +0 -87
- package/src/ui/hooks/useCommandProcessor.ts +0 -443
- package/src/ui/hooks/useConfirmation.ts +0 -99
- package/src/ui/hooks/useCtrlCHandler.ts +0 -100
- package/src/ui/hooks/useInputBuffer.ts +0 -122
- package/src/ui/hooks/useTerminalSize.ts +0 -68
- package/src/ui/hooks/useTerminalWidth.ts +0 -5
- package/src/ui/hooks/useWindowedList.ts +0 -118
- package/src/ui/render-debugger.ts +0 -621
- package/src/ui/test.ts +0 -189
- package/src/ui/themes/ThemeManager.ts +0 -332
- package/src/ui/themes/aegisTheme.ts +0 -87
- package/src/ui/themes/darkTheme.ts +0 -87
- package/src/ui/themes/defaultTheme.ts +0 -85
- package/src/ui/themes/index.ts +0 -10
- package/src/ui/themes/lightTheme.ts +0 -89
- package/src/ui/themes/popularThemes.ts +0 -187
- package/src/ui/themes/types.ts +0 -130
- package/src/utils/clipboard.ts +0 -48
- package/src/utils/debug.ts +0 -43
- package/src/utils/environment.ts +0 -68
- package/src/utils/index.ts +0 -10
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { Theme, BaseColors, Spacing } from './types.js';
|
|
2
|
-
|
|
3
|
-
const aegisColors: BaseColors = {
|
|
4
|
-
primary: '#00e5c0', // ÆGIS teal
|
|
5
|
-
secondary: '#7c6fd4', // purple
|
|
6
|
-
accent: '#00e5c0',
|
|
7
|
-
success: '#22c55e',
|
|
8
|
-
warning: '#f59e0b',
|
|
9
|
-
error: '#ef4444',
|
|
10
|
-
info: '#00e5c0',
|
|
11
|
-
text: {
|
|
12
|
-
primary: '#e8e6f4',
|
|
13
|
-
secondary: '#8882a4',
|
|
14
|
-
muted: '#44405a',
|
|
15
|
-
light: '#e8e6f4',
|
|
16
|
-
},
|
|
17
|
-
background: {
|
|
18
|
-
primary: '#04040c',
|
|
19
|
-
secondary: '#181828',
|
|
20
|
-
dark: '#0c0c16',
|
|
21
|
-
},
|
|
22
|
-
border: {
|
|
23
|
-
light: '#1a1a2a',
|
|
24
|
-
dark: '#1a1a2a',
|
|
25
|
-
},
|
|
26
|
-
syntax: {
|
|
27
|
-
keyword: '#00e5c0',
|
|
28
|
-
string: '#7c6fd4',
|
|
29
|
-
number: '#f59e0b',
|
|
30
|
-
comment: '#44405a',
|
|
31
|
-
function: '#f472b6',
|
|
32
|
-
variable: '#e8e6f4',
|
|
33
|
-
operator: '#89DDFF',
|
|
34
|
-
type: '#FFCB6B',
|
|
35
|
-
tag: '#F07178',
|
|
36
|
-
attr: '#C3E88D',
|
|
37
|
-
default: '#A6ACCD',
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const spacing: Spacing = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4 };
|
|
42
|
-
|
|
43
|
-
const tokens = {
|
|
44
|
-
elevation: {
|
|
45
|
-
flat: 'rgba(0,0,0,0)',
|
|
46
|
-
raised: 'rgba(0, 229, 192, 0.08)',
|
|
47
|
-
overlay: 'rgba(0, 0, 0, 0.4)',
|
|
48
|
-
sticky: 'rgba(0, 229, 192, 0.12)',
|
|
49
|
-
},
|
|
50
|
-
radius: {
|
|
51
|
-
sm: 0,
|
|
52
|
-
md: 1,
|
|
53
|
-
lg: 2,
|
|
54
|
-
full: 0,
|
|
55
|
-
},
|
|
56
|
-
animation: {
|
|
57
|
-
fast: 80,
|
|
58
|
-
normal: 150,
|
|
59
|
-
slow: 300,
|
|
60
|
-
easing: 'ease-out',
|
|
61
|
-
},
|
|
62
|
-
semantic: {
|
|
63
|
-
interactive: {
|
|
64
|
-
idle: aegisColors.primary,
|
|
65
|
-
hover: '#33ffd9',
|
|
66
|
-
active: '#00bfa0',
|
|
67
|
-
disabled: '#44405a',
|
|
68
|
-
},
|
|
69
|
-
focus: {
|
|
70
|
-
ring: '#00e5c0',
|
|
71
|
-
glow: 'rgba(0, 229, 192, 0.3)',
|
|
72
|
-
},
|
|
73
|
-
code: {
|
|
74
|
-
background: '#08080f',
|
|
75
|
-
border: '#1a1a2a',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const defaultTheme: Theme = {
|
|
81
|
-
name: 'default',
|
|
82
|
-
colors: aegisColors,
|
|
83
|
-
spacing,
|
|
84
|
-
tokens,
|
|
85
|
-
};
|
package/src/ui/themes/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export * from './types.js';
|
|
6
|
-
export { defaultTheme } from './defaultTheme.js';
|
|
7
|
-
export { darkTheme } from './darkTheme.js';
|
|
8
|
-
export { lightTheme } from './lightTheme.js';
|
|
9
|
-
export { ThemeManager, themeManager } from './ThemeManager.js';
|
|
10
|
-
export { aegisTheme } from './aegisTheme.js';
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { Theme } from './types.js';
|
|
7
|
-
import { defaultTheme } from './defaultTheme.js';
|
|
8
|
-
|
|
9
|
-
const lightTokens = {
|
|
10
|
-
elevation: {
|
|
11
|
-
flat: 'rgba(0,0,0,0)',
|
|
12
|
-
raised: 'rgba(37, 99, 235, 0.06)',
|
|
13
|
-
overlay: 'rgba(0, 0, 0, 0.15)',
|
|
14
|
-
sticky: 'rgba(37, 99, 235, 0.1)',
|
|
15
|
-
},
|
|
16
|
-
radius: {
|
|
17
|
-
sm: 0,
|
|
18
|
-
md: 1,
|
|
19
|
-
lg: 2,
|
|
20
|
-
full: 0,
|
|
21
|
-
},
|
|
22
|
-
animation: {
|
|
23
|
-
fast: 80,
|
|
24
|
-
normal: 150,
|
|
25
|
-
slow: 300,
|
|
26
|
-
easing: 'ease-out',
|
|
27
|
-
},
|
|
28
|
-
semantic: {
|
|
29
|
-
interactive: {
|
|
30
|
-
idle: '#2563eb',
|
|
31
|
-
hover: '#1d4ed8',
|
|
32
|
-
active: '#1e40af',
|
|
33
|
-
disabled: '#9ca3af',
|
|
34
|
-
},
|
|
35
|
-
focus: {
|
|
36
|
-
ring: '#2563eb',
|
|
37
|
-
glow: 'rgba(37, 99, 235, 0.25)',
|
|
38
|
-
},
|
|
39
|
-
code: {
|
|
40
|
-
background: '#f9fafb',
|
|
41
|
-
border: '#d1d5db',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const lightTheme: Theme = {
|
|
47
|
-
...defaultTheme,
|
|
48
|
-
name: 'light',
|
|
49
|
-
tokens: lightTokens,
|
|
50
|
-
colors: {
|
|
51
|
-
...defaultTheme.colors,
|
|
52
|
-
// 使用更深的颜色确保对比
|
|
53
|
-
primary: '#2563eb', // blue-600
|
|
54
|
-
secondary: '#4f46e5', // indigo-600
|
|
55
|
-
accent: '#7c3aed', // violet-600
|
|
56
|
-
success: '#16a34a', // green-600
|
|
57
|
-
warning: '#d97706', // amber-600
|
|
58
|
-
error: '#dc2626', // red-600
|
|
59
|
-
info: '#0891b2', // cyan-600
|
|
60
|
-
text: {
|
|
61
|
-
primary: '#111827', // gray-900 - 最深的文
|
|
62
|
-
secondary: '#374151', // gray-700
|
|
63
|
-
muted: '#6b7280', // gray-500
|
|
64
|
-
light: '#f9fafb', // gray-50
|
|
65
|
-
},
|
|
66
|
-
background: {
|
|
67
|
-
primary: '#ffffff',
|
|
68
|
-
secondary: '#e5e7eb', // gray-200
|
|
69
|
-
dark: '#111827', // gray-900
|
|
70
|
-
},
|
|
71
|
-
border: {
|
|
72
|
-
light: '#d1d5db', // gray-300
|
|
73
|
-
dark: '#6b7280', // gray-500
|
|
74
|
-
},
|
|
75
|
-
syntax: {
|
|
76
|
-
comment: '#6b7280', // gray-500
|
|
77
|
-
string: '#047857', // emerald-700
|
|
78
|
-
number: '#be185d', // pink-700
|
|
79
|
-
keyword: '#6d28d9', // violet-700
|
|
80
|
-
function: '#1d4ed8', // blue-700
|
|
81
|
-
variable: '#111827', // gray-900
|
|
82
|
-
operator: '#b45309', // amber-700
|
|
83
|
-
type: '#0e7490', // cyan-700
|
|
84
|
-
tag: '#b91c1c', // red-700
|
|
85
|
-
attr: '#a16207', // yellow-700
|
|
86
|
-
default: '#111827', // gray-900
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
};
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Popular themes: Dracula, Nord, Tokyo Night, Catppuccin
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { Theme, BaseColors, Spacing } from './types.js';
|
|
6
|
-
|
|
7
|
-
const defaultSpacing: Spacing = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4 };
|
|
8
|
-
|
|
9
|
-
// ─── Dracula ───────────────────────────────────────────────
|
|
10
|
-
const draculaColors: BaseColors = {
|
|
11
|
-
primary: '#bd93f9', // purple
|
|
12
|
-
secondary: '#ff79c6', // pink
|
|
13
|
-
accent: '#50fa7b', // green
|
|
14
|
-
success: '#50fa7b',
|
|
15
|
-
warning: '#f1fa8c',
|
|
16
|
-
error: '#ff5555',
|
|
17
|
-
info: '#8be9fd',
|
|
18
|
-
text: {
|
|
19
|
-
primary: '#f8f8f2',
|
|
20
|
-
secondary: '#e9e9f0',
|
|
21
|
-
muted: '#6272a4',
|
|
22
|
-
light: '#f8f8f2',
|
|
23
|
-
},
|
|
24
|
-
background: {
|
|
25
|
-
primary: '#282a36',
|
|
26
|
-
secondary: '#44475a',
|
|
27
|
-
dark: '#21222c',
|
|
28
|
-
},
|
|
29
|
-
border: {
|
|
30
|
-
light: '#44475a',
|
|
31
|
-
dark: '#21222c',
|
|
32
|
-
},
|
|
33
|
-
syntax: {
|
|
34
|
-
keyword: '#ff79c6',
|
|
35
|
-
string: '#f1fa8c',
|
|
36
|
-
number: '#bd93f9',
|
|
37
|
-
comment: '#6272a4',
|
|
38
|
-
function: '#50fa7b',
|
|
39
|
-
variable: '#f8f8f2',
|
|
40
|
-
operator: '#ff79c6',
|
|
41
|
-
type: '#8be9fd',
|
|
42
|
-
tag: '#ff5555',
|
|
43
|
-
attr: '#50fa7b',
|
|
44
|
-
default: '#f8f8f2',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const draculaTheme: Theme = {
|
|
49
|
-
name: 'dracula',
|
|
50
|
-
colors: draculaColors,
|
|
51
|
-
spacing: defaultSpacing,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// ─── Nord ──────────────────────────────────────────────────
|
|
55
|
-
const nordColors: BaseColors = {
|
|
56
|
-
primary: '#88c0d0', // frost
|
|
57
|
-
secondary: '#81a1c1', // frost
|
|
58
|
-
accent: '#a3be8c', // green
|
|
59
|
-
success: '#a3be8c',
|
|
60
|
-
warning: '#ebcb8b',
|
|
61
|
-
error: '#bf616a',
|
|
62
|
-
info: '#88c0d0',
|
|
63
|
-
text: {
|
|
64
|
-
primary: '#eceff4',
|
|
65
|
-
secondary: '#e5e9f0',
|
|
66
|
-
muted: '#616e88',
|
|
67
|
-
light: '#eceff4',
|
|
68
|
-
},
|
|
69
|
-
background: {
|
|
70
|
-
primary: '#2e3440',
|
|
71
|
-
secondary: '#3b4252',
|
|
72
|
-
dark: '#242933',
|
|
73
|
-
},
|
|
74
|
-
border: {
|
|
75
|
-
light: '#4c566a',
|
|
76
|
-
dark: '#2e3440',
|
|
77
|
-
},
|
|
78
|
-
syntax: {
|
|
79
|
-
keyword: '#81a1c1',
|
|
80
|
-
string: '#a3be8c',
|
|
81
|
-
number: '#b48ead',
|
|
82
|
-
comment: '#616e88',
|
|
83
|
-
function: '#88c0d0',
|
|
84
|
-
variable: '#d8dee9',
|
|
85
|
-
operator: '#81a1c1',
|
|
86
|
-
type: '#8fbcbb',
|
|
87
|
-
tag: '#bf616a',
|
|
88
|
-
attr: '#a3be8c',
|
|
89
|
-
default: '#eceff4',
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const nordTheme: Theme = {
|
|
94
|
-
name: 'nord',
|
|
95
|
-
colors: nordColors,
|
|
96
|
-
spacing: defaultSpacing,
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// ─── Tokyo Night ───────────────────────────────────────────
|
|
100
|
-
const tokyoNightColors: BaseColors = {
|
|
101
|
-
primary: '#7aa2f7', // blue
|
|
102
|
-
secondary: '#bb9af7', // purple
|
|
103
|
-
accent: '#7dcfff', // cyan
|
|
104
|
-
success: '#9ece6a',
|
|
105
|
-
warning: '#e0af68',
|
|
106
|
-
error: '#f7768e',
|
|
107
|
-
info: '#7dcfff',
|
|
108
|
-
text: {
|
|
109
|
-
primary: '#c0caf5',
|
|
110
|
-
secondary: '#a9b1d6',
|
|
111
|
-
muted: '#565f89',
|
|
112
|
-
light: '#c0caf5',
|
|
113
|
-
},
|
|
114
|
-
background: {
|
|
115
|
-
primary: '#1a1b26',
|
|
116
|
-
secondary: '#24283b',
|
|
117
|
-
dark: '#0f0f17',
|
|
118
|
-
},
|
|
119
|
-
border: {
|
|
120
|
-
light: '#3b4261',
|
|
121
|
-
dark: '#1a1b26',
|
|
122
|
-
},
|
|
123
|
-
syntax: {
|
|
124
|
-
keyword: '#bb9af7',
|
|
125
|
-
string: '#9ece6a',
|
|
126
|
-
number: '#ff9e64',
|
|
127
|
-
comment: '#565f89',
|
|
128
|
-
function: '#7aa2f7',
|
|
129
|
-
variable: '#c0caf5',
|
|
130
|
-
operator: '#89DDFF',
|
|
131
|
-
type: '#ff9e64',
|
|
132
|
-
tag: '#f7768e',
|
|
133
|
-
attr: '#9ece6a',
|
|
134
|
-
default: '#c0caf5',
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export const tokyoNightTheme: Theme = {
|
|
139
|
-
name: 'tokyo-night',
|
|
140
|
-
colors: tokyoNightColors,
|
|
141
|
-
spacing: defaultSpacing,
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
// ─── Catppuccin Mocha ──────────────────────────────────────
|
|
145
|
-
const catppuccinColors: BaseColors = {
|
|
146
|
-
primary: '#89b4fa', // blue
|
|
147
|
-
secondary: '#cba6f7', // mauve
|
|
148
|
-
accent: '#a6e3a1', // green
|
|
149
|
-
success: '#a6e3a1',
|
|
150
|
-
warning: '#f9e2af',
|
|
151
|
-
error: '#f38ba8',
|
|
152
|
-
info: '#89dceb',
|
|
153
|
-
text: {
|
|
154
|
-
primary: '#cdd6f4',
|
|
155
|
-
secondary: '#bac2de',
|
|
156
|
-
muted: '#6c7086',
|
|
157
|
-
light: '#cdd6f4',
|
|
158
|
-
},
|
|
159
|
-
background: {
|
|
160
|
-
primary: '#1e1e2e',
|
|
161
|
-
secondary: '#313244',
|
|
162
|
-
dark: '#181825',
|
|
163
|
-
},
|
|
164
|
-
border: {
|
|
165
|
-
light: '#45475a',
|
|
166
|
-
dark: '#1e1e2e',
|
|
167
|
-
},
|
|
168
|
-
syntax: {
|
|
169
|
-
keyword: '#cba6f7',
|
|
170
|
-
string: '#a6e3a1',
|
|
171
|
-
number: '#fab387',
|
|
172
|
-
comment: '#6c7086',
|
|
173
|
-
function: '#89b4fa',
|
|
174
|
-
variable: '#cdd6f4',
|
|
175
|
-
operator: '#89dceb',
|
|
176
|
-
type: '#f9e2af',
|
|
177
|
-
tag: '#f38ba8',
|
|
178
|
-
attr: '#a6e3a1',
|
|
179
|
-
default: '#cdd6f4',
|
|
180
|
-
},
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
export const catppuccinTheme: Theme = {
|
|
184
|
-
name: 'catppuccin',
|
|
185
|
-
colors: catppuccinColors,
|
|
186
|
-
spacing: defaultSpacing,
|
|
187
|
-
};
|
package/src/ui/themes/types.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Theme type definitions
|
|
3
|
-
*
|
|
4
|
-
* Extended with design tokens for consistent spacing, elevation, and semantic colors.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export type ColorMode = 'dark' | 'light' | 'unknown';
|
|
8
|
-
|
|
9
|
-
export interface SyntaxColors {
|
|
10
|
-
comment: string;
|
|
11
|
-
string: string;
|
|
12
|
-
number: string;
|
|
13
|
-
keyword: string;
|
|
14
|
-
function: string;
|
|
15
|
-
variable: string;
|
|
16
|
-
operator: string;
|
|
17
|
-
type: string;
|
|
18
|
-
tag: string;
|
|
19
|
-
attr: string;
|
|
20
|
-
default: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface BaseColors {
|
|
24
|
-
primary: string;
|
|
25
|
-
secondary: string;
|
|
26
|
-
accent: string;
|
|
27
|
-
success: string;
|
|
28
|
-
warning: string;
|
|
29
|
-
error: string;
|
|
30
|
-
info: string;
|
|
31
|
-
text: {
|
|
32
|
-
primary: string;
|
|
33
|
-
secondary: string;
|
|
34
|
-
muted: string;
|
|
35
|
-
light: string;
|
|
36
|
-
};
|
|
37
|
-
background: {
|
|
38
|
-
primary: string;
|
|
39
|
-
secondary: string;
|
|
40
|
-
dark: string;
|
|
41
|
-
};
|
|
42
|
-
border: {
|
|
43
|
-
light: string;
|
|
44
|
-
dark: string;
|
|
45
|
-
};
|
|
46
|
-
syntax: SyntaxColors;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface Spacing {
|
|
50
|
-
xs: number;
|
|
51
|
-
sm: number;
|
|
52
|
-
md: number;
|
|
53
|
-
lg: number;
|
|
54
|
-
xl: number;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// ========== Design Tokens (new) ==========
|
|
58
|
-
|
|
59
|
-
/** Elevation / shadow depth for panels, modals, overlays */
|
|
60
|
-
export interface ElevationTokens {
|
|
61
|
-
flat: string; // No elevation (background surface)
|
|
62
|
-
raised: string; // Cards, panels
|
|
63
|
-
overlay: string; // Modals, dialogs
|
|
64
|
-
sticky: string; // Status bars, headers that should stand out
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Border radius tokens */
|
|
68
|
-
export interface RadiusTokens {
|
|
69
|
-
sm: number;
|
|
70
|
-
md: number;
|
|
71
|
-
lg: number;
|
|
72
|
-
full: number;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Animation / transition tokens */
|
|
76
|
-
export interface AnimationTokens {
|
|
77
|
-
fast: number; // ms — hover, micro-interactions
|
|
78
|
-
normal: number; // ms — standard transitions
|
|
79
|
-
slow: number; // ms — page/appear transitions
|
|
80
|
-
easing: string; // CSS easing function name or cubic-bezier
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Semantic color roles */
|
|
84
|
-
export interface SemanticTokens {
|
|
85
|
-
/** Interactive element states */
|
|
86
|
-
interactive: {
|
|
87
|
-
idle: string;
|
|
88
|
-
hover: string;
|
|
89
|
-
active: string;
|
|
90
|
-
disabled: string;
|
|
91
|
-
};
|
|
92
|
-
/** Focus ring */
|
|
93
|
-
focus: {
|
|
94
|
-
ring: string;
|
|
95
|
-
glow: string;
|
|
96
|
-
};
|
|
97
|
-
/** Code block styling */
|
|
98
|
-
code: {
|
|
99
|
-
background: string;
|
|
100
|
-
border: string;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface DesignTokens {
|
|
105
|
-
elevation: ElevationTokens;
|
|
106
|
-
radius: RadiusTokens;
|
|
107
|
-
animation: AnimationTokens;
|
|
108
|
-
semantic: SemanticTokens;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface Theme {
|
|
112
|
-
name: string;
|
|
113
|
-
colors: BaseColors;
|
|
114
|
-
spacing: Spacing;
|
|
115
|
-
/** Optional design tokens for fine-grained UI control */
|
|
116
|
-
tokens?: DesignTokens;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface RoleStyle {
|
|
120
|
-
color: string;
|
|
121
|
-
prefix: string;
|
|
122
|
-
bold?: boolean;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export interface ThemePreset {
|
|
126
|
-
id: string;
|
|
127
|
-
name: string;
|
|
128
|
-
description?: string;
|
|
129
|
-
theme: Theme;
|
|
130
|
-
}
|
package/src/utils/clipboard.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Clipboard helper with an OSC 52 fallback.
|
|
3
|
-
*
|
|
4
|
-
* Native tools (pbcopy/xclip/xsel/clip) require a desktop clipboard and,
|
|
5
|
-
* on Linux, an X11/Wayland display — neither is available over plain SSH
|
|
6
|
-
* or on minimal/headless installs. OSC 52 asks the terminal emulator
|
|
7
|
-
* itself to set the clipboard and works in that case too (most modern
|
|
8
|
-
* terminals support it, including over SSH and inside tmux/screen).
|
|
9
|
-
*/
|
|
10
|
-
export async function copyToClipboard(text: string): Promise<void> {
|
|
11
|
-
const { execSync } = await import('child_process');
|
|
12
|
-
const platform = process.platform;
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
if (platform === 'darwin') {
|
|
16
|
-
execSync('pbcopy', { input: text });
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (platform === 'win32') {
|
|
20
|
-
execSync('clip', { input: text });
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (platform === 'linux') {
|
|
24
|
-
try {
|
|
25
|
-
execSync('xclip -selection clipboard', { input: text });
|
|
26
|
-
return;
|
|
27
|
-
} catch {
|
|
28
|
-
execSync('xsel --clipboard --input', { input: text });
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
} catch {
|
|
33
|
-
// Fall through to the OSC 52 escape sequence below.
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
writeOsc52(text);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function writeOsc52(text: string): void {
|
|
40
|
-
const base64 = Buffer.from(text, 'utf8').toString('base64');
|
|
41
|
-
// Wrap in tmux passthrough so it reaches the outer terminal when running
|
|
42
|
-
// inside tmux, where OSC 52 would otherwise be swallowed by tmux itself.
|
|
43
|
-
const sequence = `\x1b]52;c;${base64}\x07`;
|
|
44
|
-
const payload = process.env.TMUX
|
|
45
|
-
? `\x1bPtmux;\x1b${sequence}\x1b\\`
|
|
46
|
-
: sequence;
|
|
47
|
-
process.stdout.write(payload);
|
|
48
|
-
}
|
package/src/utils/debug.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debug 日志工具
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/** 设置全局 debug 状态(由 main.tsx parseDebugEarly 调用) */
|
|
8
|
-
export function setGlobalDebug(enabled: boolean): void {
|
|
9
|
-
(globalThis as any).__AEGIS_DEBUG__ = enabled;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** 获取全局 debug 状态 */
|
|
13
|
-
export function isDebugEnabled(): boolean {
|
|
14
|
-
return (globalThis as any).__AEGIS_DEBUG__ === true;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export function createDebugLogger(prefix: string) {
|
|
21
|
-
return {
|
|
22
|
-
log: (...args: unknown[]) => {
|
|
23
|
-
if (isDebugEnabled()) {
|
|
24
|
-
console.log(`[${prefix}]`, ...args);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
warn: (...args: unknown[]) => {
|
|
28
|
-
if (isDebugEnabled()) {
|
|
29
|
-
console.warn(`[${prefix}]`, ...args);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
error: (...args: unknown[]) => {
|
|
33
|
-
// 错误始终输
|
|
34
|
-
console.error(`[${prefix}]`, ...args);
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 预定义
|
|
40
|
-
export const agentDebug = createDebugLogger('Agent');
|
|
41
|
-
export const mcpDebug = createDebugLogger('MCP');
|
|
42
|
-
export const mcpClientDebug = (name: string) => createDebugLogger(`McpClient:${name}`);
|
|
43
|
-
export const mcpRegistryDebug = createDebugLogger('McpRegistry');
|
package/src/utils/environment.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import os from 'os';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export interface EnvironmentInfo {
|
|
13
|
-
workingDirectory: string;
|
|
14
|
-
homeDirectory: string;
|
|
15
|
-
platform: string;
|
|
16
|
-
nodeVersion: string;
|
|
17
|
-
currentDate: string;
|
|
18
|
-
shell: string;
|
|
19
|
-
username: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
export function getEnvironmentInfo(): EnvironmentInfo {
|
|
26
|
-
return {
|
|
27
|
-
workingDirectory: process.cwd(),
|
|
28
|
-
homeDirectory: os.homedir(),
|
|
29
|
-
platform: `${os.platform()} ${os.release()}`,
|
|
30
|
-
nodeVersion: process.version,
|
|
31
|
-
currentDate: new Date().toLocaleDateString('zh-CN', {
|
|
32
|
-
year: 'numeric',
|
|
33
|
-
month: 'long',
|
|
34
|
-
day: 'numeric',
|
|
35
|
-
weekday: 'long',
|
|
36
|
-
}),
|
|
37
|
-
shell: process.env.SHELL || 'unknown',
|
|
38
|
-
username: (() => { try { return os.userInfo().username; } catch { return process.env.USER || 'user'; } })(),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
|
-
export function getEnvironmentContext(): string {
|
|
48
|
-
const env = getEnvironmentInfo();
|
|
49
|
-
|
|
50
|
-
return `# Environment Context
|
|
51
|
-
|
|
52
|
-
## Working Directory
|
|
53
|
-
**Current**: \`${env.workingDirectory}\`
|
|
54
|
-
**Home**: \`${env.homeDirectory}\`
|
|
55
|
-
|
|
56
|
-
## System Information
|
|
57
|
-
- **Platform**: ${env.platform}
|
|
58
|
-
- **Node.js**: ${env.nodeVersion}
|
|
59
|
-
- **Shell**: ${env.shell}
|
|
60
|
-
- **Date**: ${env.currentDate}
|
|
61
|
-
|
|
62
|
-
## File Path Guidelines
|
|
63
|
-
When using file tools, provide **absolute paths**:
|
|
64
|
-
- ✅ Correct: \`${env.workingDirectory}/package.json\`
|
|
65
|
-
- ❌ Incorrect: \`package.json\` (relative path)
|
|
66
|
-
|
|
67
|
-
The working directory is the root for all relative references.`;
|
|
68
|
-
}
|