@axplusb/kepler 2.0.7 → 2.3.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.
- package/KEPLER-README.md +157 -142
- package/README.md +37 -65
- package/package.json +2 -2
- package/src/config/cli-args.mjs +14 -0
- package/src/config/hook-runner.mjs +100 -0
- package/src/config/memory-loader.mjs +32 -0
- package/src/config/settings-loader.mjs +45 -0
- package/src/core/agent-loop.mjs +8 -2
- package/src/core/approval-log.mjs +104 -0
- package/src/core/approval.mjs +164 -24
- package/src/core/cache-control.mjs +92 -0
- package/src/core/context-envelope.mjs +54 -0
- package/src/core/headless.mjs +99 -10
- package/src/core/jsonl-writer.mjs +50 -0
- package/src/core/local-agent.mjs +121 -14
- package/src/core/local-store.mjs +486 -5
- package/src/core/policy-resolver.mjs +156 -0
- package/src/core/project-context-loader.mjs +139 -0
- package/src/core/rate-limit-display.mjs +97 -0
- package/src/core/resume-mode.mjs +154 -0
- package/src/core/risk-tier.mjs +88 -2
- package/src/core/safety.mjs +3 -0
- package/src/core/session-manager.mjs +53 -10
- package/src/core/stream-client.mjs +69 -10
- package/src/core/system-prompt.mjs +6 -1
- package/src/core/tasks.mjs +196 -0
- package/src/core/tool-executor.mjs +72 -6
- package/src/core/trust.mjs +158 -0
- package/src/core/work-scope.mjs +217 -0
- package/src/onboarding/preflight.mjs +27 -11
- package/src/permissions/command-classifier.mjs +78 -0
- package/src/terminal/init.mjs +145 -0
- package/src/terminal/main.mjs +9 -0
- package/src/terminal/repl.mjs +1822 -140
- package/src/tools/bash.mjs +57 -9
- package/src/tools/project-overview.mjs +83 -10
- package/src/ui/approval.mjs +154 -35
- package/src/ui/commands.mjs +5 -4
- package/src/ui/formatter.mjs +39 -5
- package/src/ui/mission-report.mjs +55 -22
- package/src/ui/slash-commands.mjs +57 -5
- package/src/ui/tool-card.mjs +51 -1
package/KEPLER-README.md
CHANGED
|
@@ -1,222 +1,237 @@
|
|
|
1
1
|
# @axplusb/kepler
|
|
2
2
|
|
|
3
|
-
AI coding agent
|
|
3
|
+
Kepler is an AI coding agent for terminal-first software work. It can inspect a
|
|
4
|
+
repo, plan changes, run tools, ask for human approval, resume prior sessions, and
|
|
5
|
+
keep local project context in `.kepler/`.
|
|
4
6
|
|
|
5
7
|
## Install
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
npm install -g @axplusb/kepler
|
|
10
|
+
npm install -g @axplusb/kepler@latest
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Run without global install:
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
|
|
15
|
-
kepler # Start interactive REPL
|
|
16
|
-
kepler "fix the auth bug" # Run a single instruction
|
|
16
|
+
npx @axplusb/kepler@latest
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Update an existing global install:
|
|
20
20
|
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
kepler
|
|
24
|
-
kepler login Sign in via browser
|
|
25
|
-
kepler dashboard Open Kepler Pulse analytics dashboard
|
|
26
|
-
kepler sessions List recent local sessions
|
|
27
|
-
kepler stats Aggregate session stats (tokens, cost, tools)
|
|
28
|
-
kepler history Recent prompt history
|
|
29
|
-
kepler skills list List discovered project and global skills
|
|
30
|
-
kepler skills view NAME View a skill procedure or bundled resource
|
|
31
|
-
kepler skills install SRC Install skills from a directory or Git repository
|
|
32
|
-
kepler skills update NAME Update a locked installed skill
|
|
33
|
-
kepler skills remove NAME Remove an installed skill
|
|
34
|
-
kepler version Show version
|
|
21
|
+
```bash
|
|
22
|
+
npm update -g @axplusb/kepler
|
|
23
|
+
kepler version
|
|
35
24
|
```
|
|
36
25
|
|
|
37
|
-
|
|
26
|
+
Requires Node.js 18 or newer.
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
directories. Skill metadata is included in the cached agent context; full
|
|
41
|
-
instructions and references are loaded only when the agent calls
|
|
42
|
-
`skill_view`.
|
|
43
|
-
|
|
44
|
-
Discovery precedence:
|
|
28
|
+
## Quick Start
|
|
45
29
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
```bash
|
|
31
|
+
kepler login
|
|
32
|
+
kepler
|
|
33
|
+
kepler "fix the failing auth test"
|
|
34
|
+
```
|
|
50
35
|
|
|
51
|
-
|
|
36
|
+
Common startup commands:
|
|
52
37
|
|
|
53
38
|
```bash
|
|
54
|
-
kepler
|
|
55
|
-
kepler
|
|
56
|
-
kepler
|
|
57
|
-
kepler
|
|
39
|
+
kepler Start interactive REPL
|
|
40
|
+
kepler "instruction" Run a single instruction and exit
|
|
41
|
+
kepler login Sign in through the browser
|
|
42
|
+
kepler dashboard Open Kepler Pulse analytics dashboard
|
|
43
|
+
kepler sessions List recent local sessions
|
|
44
|
+
kepler stats Aggregate local session stats
|
|
45
|
+
kepler history Show recent prompt history
|
|
46
|
+
kepler version Show installed version
|
|
58
47
|
```
|
|
59
48
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
## What's New In 2.2.0
|
|
50
|
+
|
|
51
|
+
- Resume sessions with summary-only, summary plus last 10 turns, or summary plus
|
|
52
|
+
last 20 turns.
|
|
53
|
+
- Resume summaries are checkpointed in the selected session transcript, so future
|
|
54
|
+
resumes summarize only new uncovered history.
|
|
55
|
+
- Approval prompts now use one consistent layout across shell, sensitive reads,
|
|
56
|
+
destructive actions, and backend/framework HITL approvals.
|
|
57
|
+
- Reject/stop is a single action. Use re-plan with note when you want to steer
|
|
58
|
+
the agent.
|
|
59
|
+
- Approval logs redact secrets before writing to `.kepler/approvals.log`.
|
|
60
|
+
- Long shell commands wrap instead of being truncated.
|
|
61
|
+
- Long-running shell commands return an observed output tail instead of hanging
|
|
62
|
+
silently.
|
|
64
63
|
|
|
65
64
|
## REPL Commands
|
|
66
65
|
|
|
67
|
-
```
|
|
68
|
-
/help Show
|
|
69
|
-
/
|
|
70
|
-
/
|
|
66
|
+
```text
|
|
67
|
+
/help Show commands and command groups
|
|
68
|
+
/status Session status and loaded project context
|
|
69
|
+
/plan Show project plan and task files
|
|
70
|
+
/tasks List or add project tasks
|
|
71
|
+
/stats Session metrics
|
|
71
72
|
/history Conversation history
|
|
72
|
-
/
|
|
73
|
+
/history approvals Recent approval decisions
|
|
74
|
+
/resume Resume a previous local session
|
|
75
|
+
/clear Clear in-memory conversation history
|
|
73
76
|
/explore <query> Spawn read-only codebase explorer
|
|
74
77
|
/review <query> Spawn code review agent
|
|
75
78
|
/architect <query> Spawn architecture planning agent
|
|
76
79
|
/safety Show safety guardrail status
|
|
77
80
|
/revoke Revoke auto-approvals
|
|
81
|
+
/settings Show effective settings and policy sources
|
|
78
82
|
/exit Exit the REPL
|
|
79
83
|
```
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
Keyboard:
|
|
82
86
|
|
|
83
|
-
```
|
|
84
|
-
Esc
|
|
87
|
+
```text
|
|
88
|
+
Esc Stop current execution or close a prompt
|
|
85
89
|
Space Pause / resume execution
|
|
86
90
|
Ctrl+C Exit
|
|
87
91
|
```
|
|
88
92
|
|
|
89
|
-
##
|
|
93
|
+
## Resume Behavior
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
`/resume` reads local JSONL transcripts from `~/.kepler/projects/**`. The
|
|
96
|
+
selected session is the source of truth.
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
- **Model**: Choose your preferred model (40+ supported)
|
|
95
|
-
- **Gateway**: Select provider (OpenRouter, Anthropic, OpenAI, Bedrock, Google AI, etc.)
|
|
96
|
-
- **Config directory**: `~/.kepler/`
|
|
98
|
+
For large sessions, Kepler shows mode choices:
|
|
97
99
|
|
|
98
|
-
|
|
100
|
+
```text
|
|
101
|
+
full transcript
|
|
102
|
+
summary only
|
|
103
|
+
summary + last 10 turns
|
|
104
|
+
summary + last 20 turns
|
|
105
|
+
```
|
|
99
106
|
|
|
100
|
-
|
|
107
|
+
The session picker still shows the raw full transcript estimate, for example
|
|
108
|
+
`593k ctx`. If a summary checkpoint exists, it also shows a status such as
|
|
109
|
+
`summarized 82%`. That means earlier reconstructed messages are already covered
|
|
110
|
+
by a stored `resume_summary` marker. Summary and tail modes reuse that marker and
|
|
111
|
+
only summarize uncovered messages when needed.
|
|
101
112
|
|
|
102
|
-
|
|
103
|
-
|----------|--------|
|
|
104
|
-
| DeepSeek | V4 Flash, V4 Pro, R1 |
|
|
105
|
-
| Anthropic | Claude Opus 4.6, Sonnet 4.6, Haiku 4.5 |
|
|
106
|
-
| Google | Gemini 2.5 Pro, Flash |
|
|
107
|
-
| OpenAI | GPT-4.1, O3, Codex |
|
|
108
|
-
| Meta | Llama 4 Maverick, Scout |
|
|
109
|
-
| Mistral | Devstral, Codestral |
|
|
110
|
-
| xAI | Grok 3 |
|
|
111
|
-
| Qwen | Qwen3 Coder |
|
|
112
|
-
| + | AWS Bedrock, Azure OpenAI, Databricks, Moonshot, Custom |
|
|
113
|
+
The agent receives:
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
1. resume metadata
|
|
116
|
+
2. the original user request
|
|
117
|
+
3. the checkpointed or freshly generated summary
|
|
118
|
+
4. the retained recent tail for summary-plus-tail modes
|
|
115
119
|
|
|
116
|
-
##
|
|
120
|
+
## Approvals And HITL
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
| DeepSeek V4 Flash | 39.7% (119/300) | $0.046/instance |
|
|
122
|
-
| DeepSeek V4 Flash (baseline) | 30.7% (92/300) | $0.03/instance |
|
|
123
|
-
| DeepSeek V4 Pro | 50% (14/28 sample) | $0.48/instance |
|
|
122
|
+
Kepler auto-approves low-risk reads and safe shell inspection commands. It asks
|
|
123
|
+
for confirmation for sensitive reads, mutating shell commands, destructive
|
|
124
|
+
actions, network actions, and framework-level HITL requests.
|
|
124
125
|
|
|
125
|
-
|
|
126
|
+
Prompt actions:
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
```text
|
|
129
|
+
Enter / y approve once
|
|
130
|
+
t always allow this tool type, when available
|
|
131
|
+
s trust this pattern for the session, when policy allows it
|
|
132
|
+
a trust this pattern for the project, when policy allows it
|
|
133
|
+
r re-plan with a note for the agent
|
|
134
|
+
n / Esc stop without running
|
|
135
|
+
? show why approval is required
|
|
136
|
+
```
|
|
128
137
|
|
|
129
|
-
|
|
138
|
+
Sensitive reads include files such as `.env`, `*.pem`, and `secrets/**`.
|
|
130
139
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```
|
|
140
|
+
Approval decisions are logged locally in `.kepler/approvals.log`. Secret-like
|
|
141
|
+
values in commands, nested args, query strings, authorization headers, and
|
|
142
|
+
rejection notes are redacted before the log is written.
|
|
135
143
|
|
|
136
|
-
|
|
144
|
+
## Project Context
|
|
137
145
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
python3 benchmark/swe-bench/harness.py \
|
|
152
|
-
--dataset lite \
|
|
153
|
-
--model deepseek/deepseek-v4-flash \
|
|
154
|
-
--parallel 3 \
|
|
155
|
-
--skip-done \
|
|
156
|
-
--timeout 600
|
|
146
|
+
Kepler uses a project-local `.kepler/` folder for hand-editable context:
|
|
147
|
+
|
|
148
|
+
```text
|
|
149
|
+
.kepler/
|
|
150
|
+
KEPLER.md Project operating brief
|
|
151
|
+
settings.json Project settings and policy
|
|
152
|
+
hooks.json Tool/user hook configuration
|
|
153
|
+
hitl.md Approval guidance
|
|
154
|
+
tasks/
|
|
155
|
+
backlog.md
|
|
156
|
+
active.md
|
|
157
|
+
blocked.md
|
|
158
|
+
done.md
|
|
157
159
|
```
|
|
158
160
|
|
|
159
|
-
|
|
161
|
+
Use `/plan` and `/tasks` in the REPL to inspect and update task files.
|
|
162
|
+
|
|
163
|
+
## Skills
|
|
160
164
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
| `--skip-done` | Skip instances already in the output file |
|
|
167
|
-
| `--timeout <s>` | Per-instance timeout in seconds (default: 600) |
|
|
168
|
-
| `--limit <n>` | Only run first N instances |
|
|
169
|
-
| `--instance <id>` | Run a single instance by ID |
|
|
170
|
-
| `--gen-only` | Generate patches only (skip test evaluation) |
|
|
171
|
-
| `--output <path>` | Custom output file path |
|
|
165
|
+
Kepler supports portable `SKILL.md` bundles and Claude-compatible skill
|
|
166
|
+
directories. Skill metadata is included in cached context; full instructions and
|
|
167
|
+
references are loaded only when needed.
|
|
168
|
+
|
|
169
|
+
Discovery precedence:
|
|
172
170
|
|
|
173
|
-
|
|
171
|
+
1. `<project>/.kepler/skills`
|
|
172
|
+
2. `<project>/.claude/skills`
|
|
173
|
+
3. `~/.kepler/skills`
|
|
174
|
+
4. `~/.claude/skills`
|
|
174
175
|
|
|
175
|
-
|
|
176
|
+
Install skills:
|
|
176
177
|
|
|
177
178
|
```bash
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
kepler skills install ./my-skill
|
|
180
|
+
kepler skills install github:owner/skills-repository
|
|
181
|
+
kepler skills install https://github.com/owner/skills.git
|
|
182
|
+
kepler skills install ./team-skills --project
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Configuration
|
|
180
186
|
|
|
181
|
-
|
|
182
|
-
tmux capture-pane -t bench -p | tail -20
|
|
187
|
+
Settings are managed in the web dashboard and synced to the CLI:
|
|
183
188
|
|
|
184
|
-
|
|
185
|
-
|
|
189
|
+
https://codekepler.ai/dashboard/settings
|
|
190
|
+
|
|
191
|
+
Common local paths:
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
~/.kepler/ Global CLI state
|
|
195
|
+
~/.kepler/projects/** Local JSONL transcripts
|
|
196
|
+
~/.kepler/history.jsonl Prompt history
|
|
197
|
+
<project>/.kepler/ Project context and policy
|
|
198
|
+
<project>/.kepler/approvals.log Project approval audit log
|
|
186
199
|
```
|
|
187
200
|
|
|
188
|
-
|
|
201
|
+
Provider API keys can be configured in the dashboard or through environment
|
|
202
|
+
variables such as `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, and
|
|
203
|
+
`OPENROUTER_API_KEY`.
|
|
189
204
|
|
|
190
|
-
|
|
191
|
-
evaluate Kepler in Terminal-Bench without touching the production CLI.
|
|
205
|
+
## Troubleshooting
|
|
192
206
|
|
|
193
|
-
|
|
207
|
+
Check installed package:
|
|
194
208
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
209
|
+
```bash
|
|
210
|
+
npm list -g @axplusb/kepler --depth=0
|
|
211
|
+
kepler version
|
|
212
|
+
```
|
|
199
213
|
|
|
200
|
-
|
|
214
|
+
Use a clean one-off run:
|
|
201
215
|
|
|
202
216
|
```bash
|
|
203
|
-
|
|
204
|
-
benchmark/terminal-bench/run-kepler-backend.sh
|
|
205
|
-
benchmark/terminal-bench/run-kepler-benchmark.sh --task-id hello-world
|
|
217
|
+
npx @axplusb/kepler@latest --version
|
|
206
218
|
```
|
|
207
219
|
|
|
208
|
-
|
|
220
|
+
If npm cache permissions are broken, use a temporary cache:
|
|
209
221
|
|
|
210
|
-
|
|
211
|
-
|
|
222
|
+
```bash
|
|
223
|
+
env NPM_CONFIG_CACHE=/private/tmp/kepler-npm-cache npm pack --dry-run
|
|
224
|
+
```
|
|
212
225
|
|
|
213
|
-
|
|
214
|
-
|
|
226
|
+
If a resume session shows a large context number, check whether the row also
|
|
227
|
+
shows `summarized`. The large number is the full transcript estimate; summary and
|
|
228
|
+
tail modes usually send much less.
|
|
215
229
|
|
|
216
230
|
## Links
|
|
217
231
|
|
|
218
|
-
- Website:
|
|
219
|
-
- Company:
|
|
232
|
+
- Website: https://codekepler.ai
|
|
233
|
+
- Company: https://axplusb.tech
|
|
234
|
+
- Repository: https://github.com/raviakasapu/codekepler-npm
|
|
220
235
|
|
|
221
236
|
## License
|
|
222
237
|
|
package/README.md
CHANGED
|
@@ -1,96 +1,68 @@
|
|
|
1
1
|
# @axplusb/kepler
|
|
2
2
|
|
|
3
|
-
AI coding agent
|
|
3
|
+
Kepler is an AI coding agent for terminal-first software work. It can inspect a
|
|
4
|
+
repo, plan changes, run tools, ask for human approval, resume prior sessions, and
|
|
5
|
+
keep local project context in `.kepler/`.
|
|
6
|
+
|
|
7
|
+
The npm package uses [KEPLER-README.md](./KEPLER-README.md) as the published
|
|
8
|
+
README. Keep that file as the canonical npm-facing documentation.
|
|
4
9
|
|
|
5
10
|
## Install
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
|
-
npm install -g @axplusb/kepler
|
|
13
|
+
npm install -g @axplusb/kepler@latest
|
|
9
14
|
```
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
Run without global install:
|
|
12
17
|
|
|
13
18
|
```bash
|
|
14
|
-
|
|
15
|
-
kepler # Start interactive REPL
|
|
16
|
-
kepler "fix the auth bug" # Run a single instruction
|
|
19
|
+
npx @axplusb/kepler@latest
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
##
|
|
22
|
+
## Quick Start
|
|
20
23
|
|
|
24
|
+
```bash
|
|
25
|
+
kepler login
|
|
26
|
+
kepler
|
|
27
|
+
kepler "fix the failing auth test"
|
|
21
28
|
```
|
|
29
|
+
|
|
30
|
+
## Common Commands
|
|
31
|
+
|
|
32
|
+
```text
|
|
22
33
|
kepler Start interactive REPL
|
|
23
34
|
kepler "instruction" Run a single instruction and exit
|
|
24
|
-
kepler login Sign in
|
|
35
|
+
kepler login Sign in through the browser
|
|
25
36
|
kepler dashboard Open Kepler Pulse analytics dashboard
|
|
26
37
|
kepler sessions List recent local sessions
|
|
27
|
-
kepler stats Aggregate session stats
|
|
28
|
-
kepler history
|
|
29
|
-
kepler version Show version
|
|
38
|
+
kepler stats Aggregate local session stats
|
|
39
|
+
kepler history Show recent prompt history
|
|
40
|
+
kepler version Show installed version
|
|
30
41
|
```
|
|
31
42
|
|
|
32
|
-
##
|
|
43
|
+
## 2.2.0 Highlights
|
|
33
44
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/explore <query> Spawn read-only codebase explorer
|
|
41
|
-
/review <query> Spawn code review agent
|
|
42
|
-
/architect <query> Spawn architecture planning agent
|
|
43
|
-
/safety Show safety guardrail status
|
|
44
|
-
/revoke Revoke auto-approvals
|
|
45
|
-
/exit Exit the REPL
|
|
46
|
-
```
|
|
45
|
+
- Checkpointed `/resume` summaries with summary-only and summary-plus-tail modes.
|
|
46
|
+
- One approval prompt model for shell, sensitive reads, destructive actions, and
|
|
47
|
+
backend/framework HITL.
|
|
48
|
+
- Redacted local approval logs.
|
|
49
|
+
- Wrapped full shell command display.
|
|
50
|
+
- Long-running shell command tail capture.
|
|
47
51
|
|
|
48
|
-
##
|
|
52
|
+
## Development
|
|
49
53
|
|
|
54
|
+
```bash
|
|
55
|
+
npm test
|
|
56
|
+
env NPM_CONFIG_CACHE=/private/tmp/kepler-npm-cache npm pack --dry-run
|
|
50
57
|
```
|
|
51
|
-
Esc Cancel current execution
|
|
52
|
-
Space Pause / resume execution
|
|
53
|
-
Ctrl+C Exit
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Configuration
|
|
57
|
-
|
|
58
|
-
Settings are managed via the web dashboard at [codekepler.ai/dashboard/settings](https://codekepler.ai/dashboard/settings) and synced to the CLI automatically.
|
|
59
|
-
|
|
60
|
-
- **API Key**: Add your OpenRouter/Anthropic/OpenAI key in Settings
|
|
61
|
-
- **Model**: Choose your preferred model (40+ supported)
|
|
62
|
-
- **Gateway**: Select provider (OpenRouter, Anthropic, OpenAI, Bedrock, Google AI, etc.)
|
|
63
|
-
- **Config directory**: `~/.kepler/`
|
|
64
|
-
|
|
65
|
-
## Models
|
|
66
|
-
|
|
67
|
-
Works with 13 providers and 40+ models:
|
|
68
|
-
|
|
69
|
-
| Provider | Models |
|
|
70
|
-
|----------|--------|
|
|
71
|
-
| DeepSeek | V4 Flash, V4 Pro, R1 |
|
|
72
|
-
| Anthropic | Claude Opus 4.6, Sonnet 4.6, Haiku 4.5 |
|
|
73
|
-
| Google | Gemini 2.5 Pro, Flash |
|
|
74
|
-
| OpenAI | GPT-4.1, O3, Codex |
|
|
75
|
-
| Meta | Llama 4 Maverick, Scout |
|
|
76
|
-
| Mistral | Devstral, Codestral |
|
|
77
|
-
| xAI | Grok 3 |
|
|
78
|
-
| Qwen | Qwen3 Coder |
|
|
79
|
-
| + | AWS Bedrock, Azure OpenAI, Databricks, Moonshot, Custom |
|
|
80
|
-
|
|
81
|
-
Platform default included free. Bring your own API key for unlimited.
|
|
82
|
-
|
|
83
|
-
## SWE-bench
|
|
84
58
|
|
|
85
|
-
|
|
86
|
-
|-------|-------|------|
|
|
87
|
-
| DeepSeek V4 Flash | 30.7% (92/300) | $0.03/fix |
|
|
88
|
-
| DeepSeek V4 Pro | 50% (14/28 sample) | $0.48/fix |
|
|
59
|
+
See [RELEASE.md](./RELEASE.md) for the merge, PR, and npm publish checklist.
|
|
89
60
|
|
|
90
61
|
## Links
|
|
91
62
|
|
|
92
|
-
- Website:
|
|
93
|
-
- Company:
|
|
63
|
+
- Website: https://codekepler.ai
|
|
64
|
+
- Company: https://axplusb.tech
|
|
65
|
+
- Repository: https://github.com/raviakasapu/codekepler-npm
|
|
94
66
|
|
|
95
67
|
## License
|
|
96
68
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axplusb/kepler",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Kepler — AI coding agent with operating brief, preflight planning, and sub-agents. SWE-bench Lite evaluated.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"readme": "KEPLER-README.md",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"start": "node src/terminal/main.mjs",
|
|
17
|
-
"test": "node test/test-sse-client.mjs && node test/test-tool-executor.mjs && node test/test-project-artifacts.mjs && node test/test-skills.mjs && node test/test-callback.mjs && node test/test-formatter.mjs && node test/test-terminal-rendering.mjs && node test/test-slash-commands.mjs && node test/test-approval.mjs && node test/test-session-manager.mjs && node test/test-safety.mjs && node test/test-jsonl-writer.mjs && node test/test-analytics.mjs && node test/test-stagnation.mjs"
|
|
17
|
+
"test": "KEPLER_HOME=/tmp/kepler-test-home node test/test-sse-client.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-tool-executor.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-project-artifacts.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-work-scope.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-skills.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-callback.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-rate-limit-display.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-preflight.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-formatter.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-terminal-rendering.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-slash-commands.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-approval.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-approval-log.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-kepler-contract.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-session-manager.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-safety.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-jsonl-writer.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-analytics.mjs && KEPLER_HOME=/tmp/kepler-test-home node test/test-stagnation.mjs"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=18.0.0"
|
package/src/config/cli-args.mjs
CHANGED
|
@@ -103,6 +103,19 @@ export function parseArgs(args) {
|
|
|
103
103
|
result.freeswim = true; // headless implies skip permissions
|
|
104
104
|
break;
|
|
105
105
|
|
|
106
|
+
case '--cache-report':
|
|
107
|
+
// PRD-071 §1.5 — write a machine-readable cache summary to
|
|
108
|
+
// <path> at end of run. Consumed by benchmark/cache-check.sh.
|
|
109
|
+
result.cacheReport = args[++i];
|
|
110
|
+
break;
|
|
111
|
+
|
|
112
|
+
case '--local':
|
|
113
|
+
// Force LocalAgent path (bypass backend). Meant for benchmarks
|
|
114
|
+
// that need to exercise the CLI's own LLM code — cache_control
|
|
115
|
+
// wiring, prompt-cache stats, etc.
|
|
116
|
+
result.local = true;
|
|
117
|
+
break;
|
|
118
|
+
|
|
106
119
|
case '--freeswim-open-waters':
|
|
107
120
|
case '--freeswim':
|
|
108
121
|
case '--yes':
|
|
@@ -161,6 +174,7 @@ Options:
|
|
|
161
174
|
--resume, -r [sessionId] Resume last session (or specific session)
|
|
162
175
|
--continue Alias for --resume
|
|
163
176
|
--headless Non-interactive mode: auto-approve, JSONL output
|
|
177
|
+
--cache-report <file> Write prompt-cache summary JSON to <file> (headless only)
|
|
164
178
|
--freeswim-open-waters Skip all approval prompts (no boundaries)
|
|
165
179
|
--freeswim Alias for --freeswim-open-waters
|
|
166
180
|
--yes Alias for --freeswim-open-waters
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { loadKeplerSettings } from './settings-loader.mjs';
|
|
4
|
+
|
|
5
|
+
function asArray(value) {
|
|
6
|
+
if (!value) return [];
|
|
7
|
+
return Array.isArray(value) ? value : [value];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function matchesHook(hook, toolName) {
|
|
11
|
+
const matcher = hook.matcher || hook.toolName || hook.tool;
|
|
12
|
+
if (!matcher) return true;
|
|
13
|
+
try {
|
|
14
|
+
return new RegExp(matcher).test(toolName);
|
|
15
|
+
} catch {
|
|
16
|
+
return matcher === toolName;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function runCommand(command, { cwd, env, timeoutMs, input }) {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
const child = execFile('/bin/sh', ['-lc', command], {
|
|
23
|
+
cwd,
|
|
24
|
+
env,
|
|
25
|
+
timeout: timeoutMs,
|
|
26
|
+
windowsHide: true,
|
|
27
|
+
}, (error, stdout, stderr) => {
|
|
28
|
+
let parsed = null;
|
|
29
|
+
try { parsed = stdout.trim() ? JSON.parse(stdout.trim()) : null; }
|
|
30
|
+
catch { parsed = stdout.trim() ? { output: stdout.trim() } : null; }
|
|
31
|
+
resolve({
|
|
32
|
+
ok: !error,
|
|
33
|
+
code: error?.code ?? 0,
|
|
34
|
+
signal: error?.signal || null,
|
|
35
|
+
stdout,
|
|
36
|
+
stderr,
|
|
37
|
+
parsed,
|
|
38
|
+
error,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
if (input) child.stdin?.end(JSON.stringify(input));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class HookRunner {
|
|
46
|
+
constructor({ cwd = process.cwd(), settings = null, sessionId = null } = {}) {
|
|
47
|
+
this.cwd = cwd;
|
|
48
|
+
this.sessionId = sessionId;
|
|
49
|
+
this.settings = settings || loadKeplerSettings({ cwd }).settings;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
reload() {
|
|
53
|
+
this.settings = loadKeplerSettings({ cwd: this.cwd }).settings;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
hooksFor(event) {
|
|
57
|
+
return asArray(this.settings?.hooks?.[event]);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async run(event, payload = {}) {
|
|
61
|
+
const results = [];
|
|
62
|
+
for (const hook of this.hooksFor(event)) {
|
|
63
|
+
const toolName = payload.toolName || payload.tool || '';
|
|
64
|
+
if ((event === 'PreToolUse' || event === 'PostToolUse') && !matchesHook(hook, toolName)) continue;
|
|
65
|
+
const timeoutSeconds = hook.timeout ?? this.settings?.hooks?.timeout ?? 5;
|
|
66
|
+
const input = {
|
|
67
|
+
event,
|
|
68
|
+
tool_name: toolName,
|
|
69
|
+
tool_input: payload.input || payload.args || {},
|
|
70
|
+
tool_result: payload.result || null,
|
|
71
|
+
project_dir: this.cwd,
|
|
72
|
+
session_id: this.sessionId || '',
|
|
73
|
+
};
|
|
74
|
+
const env = {
|
|
75
|
+
...process.env,
|
|
76
|
+
...(this.settings?.env || {}),
|
|
77
|
+
KEPLER_TOOL_NAME: toolName,
|
|
78
|
+
KEPLER_TOOL_INPUT_FILE_PATH: input.tool_input.file_path || input.tool_input.path || '',
|
|
79
|
+
KEPLER_PROJECT_DIR: this.cwd,
|
|
80
|
+
KEPLER_SESSION_ID: this.sessionId || '',
|
|
81
|
+
KEPLER_TURN_ID: payload.turnId || '',
|
|
82
|
+
};
|
|
83
|
+
const result = await runCommand(hook.command, {
|
|
84
|
+
cwd: path.resolve(this.cwd),
|
|
85
|
+
env,
|
|
86
|
+
timeoutMs: timeoutSeconds * 1000,
|
|
87
|
+
input,
|
|
88
|
+
});
|
|
89
|
+
results.push({ hook, ...result });
|
|
90
|
+
if (result.code === 2 || result.parsed?.block === true || result.parsed?.decision === 'deny') {
|
|
91
|
+
return {
|
|
92
|
+
blocked: true,
|
|
93
|
+
message: result.parsed?.message || result.stderr?.trim() || `Blocked by hook: ${hook.command}`,
|
|
94
|
+
results,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return { blocked: false, results };
|
|
99
|
+
}
|
|
100
|
+
}
|