@kkelly-offical/kkcode 0.1.3 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -172
- package/package.json +46 -46
- package/src/agent/agent.mjs +220 -170
- package/src/agent/prompt/bug-hunter.txt +90 -0
- package/src/agent/prompt/frontend-designer.txt +58 -0
- package/src/agent/prompt/longagent-blueprint-agent.txt +83 -0
- package/src/agent/prompt/longagent-coding-agent.txt +37 -0
- package/src/agent/prompt/longagent-debugging-agent.txt +46 -0
- package/src/agent/prompt/longagent-preview-agent.txt +63 -0
- package/src/config/defaults.mjs +260 -195
- package/src/config/schema.mjs +71 -6
- package/src/core/constants.mjs +91 -46
- package/src/index.mjs +1 -1
- package/src/knowledge/frontend-aesthetics.txt +39 -0
- package/src/knowledge/loader.mjs +2 -1
- package/src/knowledge/tailwind.txt +12 -3
- package/src/mcp/client-http.mjs +141 -157
- package/src/mcp/client-sse.mjs +288 -286
- package/src/mcp/client-stdio.mjs +533 -451
- package/src/mcp/constants.mjs +2 -0
- package/src/mcp/registry.mjs +479 -394
- package/src/mcp/stdio-framing.mjs +133 -127
- package/src/mcp/tool-result.mjs +24 -0
- package/src/observability/index.mjs +42 -0
- package/src/observability/metrics.mjs +137 -0
- package/src/observability/tracer.mjs +137 -0
- package/src/orchestration/background-manager.mjs +372 -358
- package/src/orchestration/background-worker.mjs +305 -245
- package/src/orchestration/longagent-manager.mjs +171 -116
- package/src/orchestration/stage-scheduler.mjs +728 -489
- package/src/permission/exec-policy.mjs +9 -11
- package/src/provider/anthropic.mjs +1 -0
- package/src/provider/openai.mjs +340 -339
- package/src/provider/retry-policy.mjs +68 -68
- package/src/provider/router.mjs +241 -228
- package/src/provider/sse.mjs +104 -91
- package/src/repl.mjs +59 -7
- package/src/session/checkpoint.mjs +66 -3
- package/src/session/compaction.mjs +298 -276
- package/src/session/engine.mjs +232 -225
- package/src/session/longagent-4stage.mjs +460 -0
- package/src/session/longagent-hybrid.mjs +1097 -0
- package/src/session/longagent-plan.mjs +365 -329
- package/src/session/longagent-project-memory.mjs +53 -0
- package/src/session/longagent-scaffold.mjs +291 -100
- package/src/session/longagent-task-bus.mjs +54 -0
- package/src/session/longagent-utils.mjs +472 -0
- package/src/session/longagent.mjs +900 -1462
- package/src/session/loop.mjs +65 -40
- package/src/session/project-context.mjs +30 -0
- package/src/session/prompt/agent.txt +25 -0
- package/src/session/prompt/plan.txt +31 -9
- package/src/session/rollback.mjs +196 -0
- package/src/session/store.mjs +519 -503
- package/src/session/system-prompt.mjs +273 -260
- package/src/session/task-validator.mjs +4 -3
- package/src/skill/builtin/design.mjs +76 -0
- package/src/skill/builtin/frontend.mjs +8 -0
- package/src/skill/registry.mjs +390 -336
- package/src/storage/ghost-commit-store.mjs +18 -8
- package/src/tool/executor.mjs +11 -0
- package/src/tool/git-auto.mjs +0 -19
- package/src/tool/question-prompt.mjs +93 -86
- package/src/tool/registry.mjs +71 -37
- package/src/ui/activity-renderer.mjs +664 -410
- package/src/util/git.mjs +23 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
=== LONGAGENT STAGE 4/4: DEBUGGING AGENT ===
|
|
2
|
+
|
|
3
|
+
You are the Debugging Agent in the four-stage LongAgent architecture.
|
|
4
|
+
|
|
5
|
+
# YOUR ROLE
|
|
6
|
+
Verify the implementation, find bugs, and ensure all requirements are met.
|
|
7
|
+
|
|
8
|
+
# STAGE 4: DEBUG MODE - FULL PERMISSIONS
|
|
9
|
+
|
|
10
|
+
# DEBUGGING OBJECTIVES
|
|
11
|
+
|
|
12
|
+
## 1. Syntax & Basic Checks
|
|
13
|
+
- Verify all files parse without syntax errors
|
|
14
|
+
- Check for missing imports/exports
|
|
15
|
+
- Run basic syntax validation commands
|
|
16
|
+
|
|
17
|
+
## 2. Completeness Check
|
|
18
|
+
- Compare implementation against Stage 2 blueprint
|
|
19
|
+
- Verify all planned files exist and all functions implemented
|
|
20
|
+
|
|
21
|
+
## 3. Test & Validate
|
|
22
|
+
- Run existing test suite (if any)
|
|
23
|
+
- Test edge cases identified in blueprint
|
|
24
|
+
- Validate error handling works
|
|
25
|
+
|
|
26
|
+
## 4. Bug Detection & Fixing
|
|
27
|
+
- Identify and fix any bugs
|
|
28
|
+
- If major issues found, output: [RETURN TO STAGE 3: CODING]
|
|
29
|
+
|
|
30
|
+
## 5. Final Verification
|
|
31
|
+
- Run full build/test process
|
|
32
|
+
- Confirm all acceptance criteria met
|
|
33
|
+
|
|
34
|
+
# WORKFLOW
|
|
35
|
+
1. Check syntax first - quick wins
|
|
36
|
+
2. Verify completeness against blueprint
|
|
37
|
+
3. Run tests
|
|
38
|
+
4. Fix any issues found
|
|
39
|
+
5. If major issues, go back to Stage 3
|
|
40
|
+
6. Do final full verification
|
|
41
|
+
|
|
42
|
+
End your response with:
|
|
43
|
+
```
|
|
44
|
+
[STAGE 4/4: DEBUGGING - COMPLETE]
|
|
45
|
+
[TASK_COMPLETE]
|
|
46
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
=== LONGAGENT STAGE 1/4: PREVIEWING AGENT ===
|
|
2
|
+
|
|
3
|
+
You are the Previewing Agent in the four-stage LongAgent architecture.
|
|
4
|
+
|
|
5
|
+
# YOUR ROLE
|
|
6
|
+
You are responsible for understanding the task, exploring the codebase, and extracting critical information.
|
|
7
|
+
|
|
8
|
+
# STAGE 1: PREVIEW MODE - READ-ONLY
|
|
9
|
+
IMPORTANT: You are in READ-ONLY mode. NO EDITING ALLOWED.
|
|
10
|
+
|
|
11
|
+
CRITICAL CONSTRAINTS:
|
|
12
|
+
- NO file editing (edit, write, multiedit, patch)
|
|
13
|
+
- NO commands that modify filesystem or system state
|
|
14
|
+
- NO git operations (commit, push, etc.)
|
|
15
|
+
- ONLY use: read, glob, grep, list, bash (read-only)
|
|
16
|
+
- This is ZERO-EXCEPTION rule
|
|
17
|
+
|
|
18
|
+
# EXPLORATION OBJECTIVES
|
|
19
|
+
|
|
20
|
+
## 1. Understand User Request
|
|
21
|
+
- Extract core requirements from user input
|
|
22
|
+
- Identify key constraints, goals, and expected outcomes
|
|
23
|
+
- Note any specific files, functions, or patterns mentioned
|
|
24
|
+
|
|
25
|
+
## 2. Explore Project Structure
|
|
26
|
+
- Use `glob` to map the entire codebase
|
|
27
|
+
- Understand directory organization and file naming conventions
|
|
28
|
+
- Identify project type (e.g., Node.js, Python, React, etc.)
|
|
29
|
+
- Locate configuration files (package.json, tsconfig.json, etc.)
|
|
30
|
+
|
|
31
|
+
## 3. Analyze Existing Code
|
|
32
|
+
- Search for relevant existing code using `grep`
|
|
33
|
+
- Read critical files to understand current implementation
|
|
34
|
+
- Identify patterns, utilities, and functions that can be reused
|
|
35
|
+
- Look for tests to understand expected behavior
|
|
36
|
+
- Trace dependencies and import relationships
|
|
37
|
+
|
|
38
|
+
## 4. Extract Key Information
|
|
39
|
+
- Project structure summary
|
|
40
|
+
- Relevant file paths
|
|
41
|
+
- Existing patterns and utilities
|
|
42
|
+
- Potential challenges or constraints
|
|
43
|
+
- Dependencies and their versions
|
|
44
|
+
|
|
45
|
+
# OUTPUT FORMAT
|
|
46
|
+
|
|
47
|
+
Present findings structurally:
|
|
48
|
+
- Project Overview (type, stack, config)
|
|
49
|
+
- Critical Files Identified (to modify/create/reference)
|
|
50
|
+
- Reusable Assets (existing functions, patterns, dependencies)
|
|
51
|
+
- Constraints & Considerations
|
|
52
|
+
|
|
53
|
+
# WORKFLOW
|
|
54
|
+
1. Explore thoroughly - don't rush
|
|
55
|
+
2. Use parallel tool calls for efficiency
|
|
56
|
+
3. Focus on understanding, not solving
|
|
57
|
+
4. Document everything clearly
|
|
58
|
+
5. NO EDITING - STAY IN READ-ONLY MODE
|
|
59
|
+
|
|
60
|
+
End your response with:
|
|
61
|
+
```
|
|
62
|
+
[STAGE 1/4: PREVIEW - COMPLETE]
|
|
63
|
+
```
|
package/src/config/defaults.mjs
CHANGED
|
@@ -1,195 +1,260 @@
|
|
|
1
|
-
export const DEFAULT_CONFIG = {
|
|
2
|
-
language: "en",
|
|
3
|
-
provider: {
|
|
4
|
-
default: "openai",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
1
|
+
export const DEFAULT_CONFIG = {
|
|
2
|
+
language: "en",
|
|
3
|
+
provider: {
|
|
4
|
+
default: "openai",
|
|
5
|
+
strict_mode: false,
|
|
6
|
+
openai: {
|
|
7
|
+
base_url: "https://api.openai.com/v1",
|
|
8
|
+
api_key_env: "OPENAI_API_KEY",
|
|
9
|
+
default_model: "gpt-5.3-codex",
|
|
10
|
+
models: ["gpt-5.3-codex", "gpt-5.2"],
|
|
11
|
+
timeout_ms: 120000,
|
|
12
|
+
stream_idle_timeout_ms: 120000,
|
|
13
|
+
max_tokens: 32768,
|
|
14
|
+
context_limit: null,
|
|
15
|
+
retry_attempts: 3,
|
|
16
|
+
retry_base_delay_ms: 800,
|
|
17
|
+
stream: true,
|
|
18
|
+
thinking: null
|
|
19
|
+
},
|
|
20
|
+
anthropic: {
|
|
21
|
+
base_url: "https://api.anthropic.com/v1",
|
|
22
|
+
api_key_env: "ANTHROPIC_API_KEY",
|
|
23
|
+
default_model: "claude-opus-4-6",
|
|
24
|
+
models: ["claude-sonnet-4-5", "claude-sonnet-4-6", "claude-haiku-4-5-20251001", "claude-opus-4-6"],
|
|
25
|
+
timeout_ms: 120000,
|
|
26
|
+
stream_idle_timeout_ms: 120000,
|
|
27
|
+
max_tokens: 32768,
|
|
28
|
+
context_limit: null,
|
|
29
|
+
retry_attempts: 3,
|
|
30
|
+
retry_base_delay_ms: 800,
|
|
31
|
+
stream: true,
|
|
32
|
+
thinking: null
|
|
33
|
+
},
|
|
34
|
+
ollama: {
|
|
35
|
+
base_url: "http://localhost:11434",
|
|
36
|
+
api_key_env: "",
|
|
37
|
+
default_model: "llama3.1",
|
|
38
|
+
timeout_ms: 300000,
|
|
39
|
+
stream_idle_timeout_ms: 300000,
|
|
40
|
+
max_tokens: 32768,
|
|
41
|
+
context_limit: null,
|
|
42
|
+
retry_attempts: 1,
|
|
43
|
+
retry_base_delay_ms: 1000,
|
|
44
|
+
stream: true,
|
|
45
|
+
thinking: null
|
|
46
|
+
},
|
|
47
|
+
model_context: {}
|
|
48
|
+
},
|
|
49
|
+
agent: {
|
|
50
|
+
default_mode: "agent",
|
|
51
|
+
max_steps: 8,
|
|
52
|
+
longagent: {
|
|
53
|
+
max_iterations: 0,
|
|
54
|
+
no_progress_warning: 3,
|
|
55
|
+
no_progress_limit: 5,
|
|
56
|
+
max_stage_recoveries: 3,
|
|
57
|
+
heartbeat_timeout_ms: 120000,
|
|
58
|
+
checkpoint_interval: 5,
|
|
59
|
+
lock_timeout_ms: 5000,
|
|
60
|
+
parallel: {
|
|
61
|
+
enabled: true,
|
|
62
|
+
max_concurrency: 3,
|
|
63
|
+
stage_pass_rule: "all_success",
|
|
64
|
+
task_timeout_ms: 600000,
|
|
65
|
+
task_max_retries: 2,
|
|
66
|
+
poll_interval_ms: 300
|
|
67
|
+
},
|
|
68
|
+
planner: {
|
|
69
|
+
intake_questions: {
|
|
70
|
+
enabled: true,
|
|
71
|
+
max_rounds: 6
|
|
72
|
+
},
|
|
73
|
+
ask_user_after_plan_frozen: false
|
|
74
|
+
},
|
|
75
|
+
four_stage: {
|
|
76
|
+
enabled: false,
|
|
77
|
+
preview_max_iterations: 10,
|
|
78
|
+
blueprint_max_iterations: 10,
|
|
79
|
+
coding_max_iterations: 50,
|
|
80
|
+
debugging_max_iterations: 20,
|
|
81
|
+
separate_models: {
|
|
82
|
+
enabled: false,
|
|
83
|
+
preview_model: null,
|
|
84
|
+
blueprint_model: null,
|
|
85
|
+
coding_model: null,
|
|
86
|
+
debugging_model: null
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
hybrid: {
|
|
90
|
+
enabled: true,
|
|
91
|
+
intake: true,
|
|
92
|
+
completion_validation: true,
|
|
93
|
+
debugging_max_iterations: 20,
|
|
94
|
+
max_coding_rollbacks: 2,
|
|
95
|
+
parallel_preview: true,
|
|
96
|
+
blueprint_review: false,
|
|
97
|
+
blueprint_validation: true,
|
|
98
|
+
tdd_mode: false,
|
|
99
|
+
cross_review: true,
|
|
100
|
+
incremental_gates: true,
|
|
101
|
+
context_pressure_limit: 8000,
|
|
102
|
+
budget_awareness: true,
|
|
103
|
+
checkpoint_resume: true,
|
|
104
|
+
project_memory: true,
|
|
105
|
+
task_bus: true,
|
|
106
|
+
coding_phase_timeout_ms: 1800000,
|
|
107
|
+
debugging_phase_timeout_ms: 600000,
|
|
108
|
+
checkpoint_max_keep: 10,
|
|
109
|
+
checkpoint_cleanup: true,
|
|
110
|
+
degradation: {
|
|
111
|
+
enabled: true,
|
|
112
|
+
fallback_model: null,
|
|
113
|
+
skip_non_critical: true
|
|
114
|
+
},
|
|
115
|
+
separate_models: {
|
|
116
|
+
enabled: false,
|
|
117
|
+
preview_model: null,
|
|
118
|
+
blueprint_model: null,
|
|
119
|
+
debugging_model: null
|
|
120
|
+
},
|
|
121
|
+
adaptive_models: {
|
|
122
|
+
enabled: false,
|
|
123
|
+
low: null,
|
|
124
|
+
medium: null,
|
|
125
|
+
high: null
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
resume_incomplete_files: true,
|
|
129
|
+
scaffold: {
|
|
130
|
+
enabled: true
|
|
131
|
+
},
|
|
132
|
+
git: {
|
|
133
|
+
enabled: "ask",
|
|
134
|
+
auto_branch: true,
|
|
135
|
+
auto_commit_stages: true,
|
|
136
|
+
auto_merge: true,
|
|
137
|
+
branch_prefix: "kkcode"
|
|
138
|
+
},
|
|
139
|
+
usability_gates: {
|
|
140
|
+
prompt_user: "first_run",
|
|
141
|
+
build: { enabled: true },
|
|
142
|
+
test: { enabled: true },
|
|
143
|
+
review: { enabled: true },
|
|
144
|
+
health: { enabled: true },
|
|
145
|
+
budget: { enabled: true }
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
subagents: {},
|
|
149
|
+
routing: {
|
|
150
|
+
categories: {}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
mcp: {
|
|
154
|
+
servers: {},
|
|
155
|
+
auto_discover: true,
|
|
156
|
+
timeout_ms: 30000,
|
|
157
|
+
max_reconnect_attempts: 5,
|
|
158
|
+
circuit_reset_ms: 60000,
|
|
159
|
+
health_check_interval_ms: 0,
|
|
160
|
+
max_buffer_bytes: 16777216,
|
|
161
|
+
shutdown_timeout_ms: 5000,
|
|
162
|
+
max_sse_buffer_bytes: 4194304
|
|
163
|
+
},
|
|
164
|
+
skills: {
|
|
165
|
+
enabled: true,
|
|
166
|
+
dirs: [".kkcode/skills"],
|
|
167
|
+
allowed_commands: []
|
|
168
|
+
},
|
|
169
|
+
permission: {
|
|
170
|
+
default_policy: "ask",
|
|
171
|
+
non_tty_default: "deny",
|
|
172
|
+
rules: []
|
|
173
|
+
},
|
|
174
|
+
storage: {
|
|
175
|
+
session_shard_enabled: true,
|
|
176
|
+
flush_interval_ms: 1000,
|
|
177
|
+
event_rotate_mb: 32,
|
|
178
|
+
event_retain_days: 14
|
|
179
|
+
},
|
|
180
|
+
background: {
|
|
181
|
+
mode: "worker_process",
|
|
182
|
+
worker_timeout_ms: 900000,
|
|
183
|
+
max_parallel: 2,
|
|
184
|
+
max_log_lines: 300
|
|
185
|
+
},
|
|
186
|
+
runtime: {
|
|
187
|
+
tool_registry_cache_ttl_ms: 30000,
|
|
188
|
+
mcp_refresh_ttl_ms: 60000
|
|
189
|
+
},
|
|
190
|
+
tool: {
|
|
191
|
+
sources: {
|
|
192
|
+
builtin: true,
|
|
193
|
+
local: true,
|
|
194
|
+
mcp: true,
|
|
195
|
+
plugin: true
|
|
196
|
+
},
|
|
197
|
+
bash_timeout_ms: 120000,
|
|
198
|
+
write_lock: {
|
|
199
|
+
mode: "file_lock",
|
|
200
|
+
wait_timeout_ms: 120000
|
|
201
|
+
},
|
|
202
|
+
local_dirs: [".kkcode/tools", ".kkcode/tool"],
|
|
203
|
+
plugin_dirs: [".kkcode/plugins", ".kkcode/plugin"]
|
|
204
|
+
},
|
|
205
|
+
session: {
|
|
206
|
+
max_history: 30,
|
|
207
|
+
recovery: true,
|
|
208
|
+
compaction_threshold_ratio: 0.7,
|
|
209
|
+
compaction_threshold_messages: 50,
|
|
210
|
+
context_cache_points: true
|
|
211
|
+
},
|
|
212
|
+
review: {
|
|
213
|
+
sort: "risk_first",
|
|
214
|
+
default_lines: 80,
|
|
215
|
+
max_expand_lines: 1200,
|
|
216
|
+
risk_weights: {
|
|
217
|
+
sensitive_path: 4,
|
|
218
|
+
large_change: 3,
|
|
219
|
+
medium_change: 2,
|
|
220
|
+
small_change: 1,
|
|
221
|
+
executable_script: 2,
|
|
222
|
+
command_pattern: 3
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
usage: {
|
|
226
|
+
pricing_file: null,
|
|
227
|
+
aggregation: ["turn", "session", "global"],
|
|
228
|
+
budget: {
|
|
229
|
+
session_usd: null,
|
|
230
|
+
global_usd: null,
|
|
231
|
+
warn_at_percent: 80,
|
|
232
|
+
strategy: "warn"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
ui: {
|
|
236
|
+
theme_file: null,
|
|
237
|
+
mode_colors: {
|
|
238
|
+
ask: "#8da3b9",
|
|
239
|
+
plan: "#00b7c2",
|
|
240
|
+
agent: "#2ac26f",
|
|
241
|
+
longagent: "#ff7a33"
|
|
242
|
+
},
|
|
243
|
+
layout: "compact",
|
|
244
|
+
markdown_render: true,
|
|
245
|
+
status: {
|
|
246
|
+
show_cost: true,
|
|
247
|
+
show_token_meter: true
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export const VALID_PROVIDER_TYPES = ["openai", "anthropic", "ollama", "openai-compatible"]
|
|
253
|
+
|
|
254
|
+
import { listProviders } from "../provider/router.mjs"
|
|
255
|
+
export function getValidProviderTypes() {
|
|
256
|
+
return listProviders()
|
|
257
|
+
}
|
|
258
|
+
export const VALID_MODES = ["ask", "plan", "agent", "longagent"]
|
|
259
|
+
export const VALID_REVIEW_SORT = ["risk_first", "time_order", "file_order"]
|
|
260
|
+
export const VALID_LANGUAGES = ["en", "zh"]
|