mini-coder 0.5.11 → 0.5.13
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/BENCHMARK.md +107 -0
- package/PROGRESS.md +4 -0
- package/README.md +66 -21
- package/assets/mc-claude-smart.png +0 -0
- package/assets/mc-gpt-smart.png +0 -0
- package/benchmark-baseline.sh +15 -0
- package/benchmark-loop.sh +19 -0
- package/bun.lock +265 -90
- package/package.json +8 -7
- package/skills-lock.json +15 -0
- package/src/agent.ts +20 -0
- package/src/cli.ts +2 -1
- package/src/headless.ts +152 -38
- package/src/index.ts +107 -143
- package/src/input.ts +13 -1
- package/src/mcp.ts +609 -0
- package/src/prompt.ts +10 -12
- package/src/session-message.ts +393 -0
- package/src/session.ts +102 -396
- package/src/settings.ts +218 -22
- package/src/shared.ts +39 -0
- package/src/skills.ts +12 -3
- package/src/submit.ts +20 -25
- package/src/text.ts +71 -0
- package/src/theme.ts +186 -3
- package/src/tool-common.ts +93 -0
- package/src/tool-grep.ts +606 -0
- package/src/tool-read.ts +313 -0
- package/src/tool-shell.ts +1001 -0
- package/src/tools.ts +190 -995
- package/src/ui/agent.ts +206 -110
- package/src/ui/commands.test.ts +489 -17
- package/src/ui/commands.ts +231 -55
- package/src/ui/conversation.test.ts +585 -0
- package/src/ui/conversation.ts +878 -455
- package/src/ui/help.ts +27 -11
- package/src/ui/input.test.ts +1 -43
- package/src/ui/runtime.ts +69 -0
- package/src/ui.ts +422 -185
- package/src/plugins.ts +0 -183
package/BENCHMARK.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# CORE GOAL
|
|
2
|
+
|
|
3
|
+
**Terminal-Bench is a signal, not the product. The target is a better coding agent, not a higher benchmark score from benchmark-shaped patches.**
|
|
4
|
+
|
|
5
|
+
- Do not add fixes to fix an issue with specific terminal bench evals, focus on improving the agent's behaviour.
|
|
6
|
+
- Benchmarks run headless mode in one shot. Make sure you use `tmux` often to check that the TUI and multiturn UX is still
|
|
7
|
+
good.
|
|
8
|
+
|
|
9
|
+
# Benchmark workflow
|
|
10
|
+
|
|
11
|
+
Use this as the default tuning loop for `mini-coder` on Terminal-Bench.
|
|
12
|
+
|
|
13
|
+
The goal is not to rerun the whole benchmark after every change. The goal is to get fast enough feedback that small changes can be judged quickly, then promote only the promising ones to bigger runs.
|
|
14
|
+
|
|
15
|
+
## Principles
|
|
16
|
+
|
|
17
|
+
- Keep changes small.
|
|
18
|
+
- Change one thing at a time.
|
|
19
|
+
- Compare against a fresh baseline, not an old leaderboard run.
|
|
20
|
+
- Use fast suites for iteration, broad suites for promotion.
|
|
21
|
+
- Keep structured `mc --json` logs in trial artifacts so behavior can be analyzed.
|
|
22
|
+
- Optimize for general coding-agent behavior first.
|
|
23
|
+
- Use benchmark failures to extract general behavior gaps, not to encode benchmark lore into the agent.
|
|
24
|
+
- Prefer generic improvements over task-named patches, reminders, or stop-time nudges.
|
|
25
|
+
|
|
26
|
+
## Suites
|
|
27
|
+
|
|
28
|
+
There is a full 89 test baseline run with 2 attemps in the teminal-bench folder. Use the evals in it
|
|
29
|
+
to determine your fast evals to start your optimization process and iterations.
|
|
30
|
+
|
|
31
|
+
Settings:
|
|
32
|
+
|
|
33
|
+
- `2` attempts
|
|
34
|
+
- `2` concurrent
|
|
35
|
+
- `0` retries
|
|
36
|
+
|
|
37
|
+
## Experiment quality bar
|
|
38
|
+
|
|
39
|
+
Before changing code, write the hypothesis in two layers:
|
|
40
|
+
|
|
41
|
+
1. the benchmark symptom
|
|
42
|
+
2. the general coding-agent behavior gap behind it
|
|
43
|
+
|
|
44
|
+
Only run an experiment if you can answer all of these:
|
|
45
|
+
|
|
46
|
+
- what general behavior is being improved?
|
|
47
|
+
- why should that help outside Terminal-Bench?
|
|
48
|
+
- what would make this change obviously overfit?
|
|
49
|
+
|
|
50
|
+
Reject or redesign experiments that:
|
|
51
|
+
|
|
52
|
+
- depend on benchmark-specific task names, file names, package names, or tool names in product logic
|
|
53
|
+
- inject reminders or guards keyed to one benchmark noun unless that rule maps cleanly to a real product behavior
|
|
54
|
+
- only make sense because a particular verifier is known
|
|
55
|
+
- cannot be explained without citing a single task transcript
|
|
56
|
+
|
|
57
|
+
Hard rule:
|
|
58
|
+
|
|
59
|
+
- no task-specific nouns in agent logic unless they map to a real product feature
|
|
60
|
+
|
|
61
|
+
## Iteration loop
|
|
62
|
+
|
|
63
|
+
For each change:
|
|
64
|
+
|
|
65
|
+
1. inspect the last fast / focused failures
|
|
66
|
+
2. translate them into **one** general behavior gap
|
|
67
|
+
3. reject benchmark-shaped ideas; if you cannot phrase the change without task-specific nouns, keep diagnosing
|
|
68
|
+
4. if the change depends on a dynamic trigger, confirm that the trigger actually appears in the target failures
|
|
69
|
+
5. form **one** narrow hypothesis
|
|
70
|
+
6. make **one** small change
|
|
71
|
+
7. run:
|
|
72
|
+
- fast suite
|
|
73
|
+
8. compare to baseline or your reference run
|
|
74
|
+
9. decide:
|
|
75
|
+
- keep
|
|
76
|
+
- revert
|
|
77
|
+
- refine
|
|
78
|
+
|
|
79
|
+
## Behavior analysis requirements
|
|
80
|
+
|
|
81
|
+
Behavior analysis depends on structured agent logs.
|
|
82
|
+
|
|
83
|
+
Keep wrappers on:
|
|
84
|
+
|
|
85
|
+
- `mc --json -p ...`
|
|
86
|
+
|
|
87
|
+
Per trial, keep:
|
|
88
|
+
|
|
89
|
+
- result JSON
|
|
90
|
+
- verifier output
|
|
91
|
+
- exception type
|
|
92
|
+
- agent stderr
|
|
93
|
+
- structured `agent/mini-coder.ndjson`
|
|
94
|
+
- timestamps
|
|
95
|
+
|
|
96
|
+
## Minimal experiment log format
|
|
97
|
+
|
|
98
|
+
You are running in a loop, make sure to keep your progress tracked so you
|
|
99
|
+
can continue between loop iterations, this is to avoid context pressure.:w
|
|
100
|
+
Keep this in `PROGRESS.md`, a final summary for each completed change:
|
|
101
|
+
|
|
102
|
+
- benchmark symptom
|
|
103
|
+
- general behavior gap
|
|
104
|
+
- why this should help outside Terminal-Bench
|
|
105
|
+
- hypothesis
|
|
106
|
+
- verification method
|
|
107
|
+
- keep / revert / refine (Make the decision very visible in the file).
|
package/PROGRESS.md
ADDED
package/README.md
CHANGED
|
@@ -39,15 +39,16 @@ $ mc
|
|
|
39
39
|
|
|
40
40
|
## Tools
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Six built-in tools, plus a conditional read-only image tool and any configured MCP tools:
|
|
43
43
|
|
|
44
44
|
- **`shell`** — runs commands in the user's shell. Returns stdout, stderr, and exit code. Large output is truncated to protect model context.
|
|
45
|
+
- **`read`** — reads UTF-8 text files from disk, optionally by line window.
|
|
46
|
+
- **`grep`** — searches file contents with ripgrep-style options and returns structured matches.
|
|
45
47
|
- **`edit`** — exact-text replacement in a single file. Fails deterministically if the target is missing or ambiguous. Creates new files when old text is empty.
|
|
46
48
|
- **`todoWrite`** — creates or updates the session todo list incrementally and returns the full current snapshot.
|
|
47
49
|
- **`todoRead`** — returns the full current session todo list snapshot.
|
|
48
50
|
- **`readImage`** — reads PNG, JPEG, GIF, and WebP files as model input. Only registered when the active model supports images.
|
|
49
|
-
|
|
50
|
-
Plugins can add more tools, but the core stays intentionally small.
|
|
51
|
+
- **Configured MCP tools** — tools discovered from `settings.json` Streamable HTTP MCP servers. Imported tool names are prefixed with the server name, for example `docs__search`.
|
|
51
52
|
|
|
52
53
|
## Features
|
|
53
54
|
|
|
@@ -56,25 +57,27 @@ Plugins can add more tools, but the core stays intentionally small.
|
|
|
56
57
|
- **Session persistence** — SQLite-backed sessions with undo, fork, resume, and cumulative usage stats. Sessions are scoped to the working directory.
|
|
57
58
|
- **Reasoning and verbosity controls** — toggle thinking visibility and verbose tool rendering on demand. Preferences persist across launches.
|
|
58
59
|
- **[AGENTS.md](https://agents.md) support** — project-specific instructions discovered root-to-leaf, with `~/.agents/` for global instructions.
|
|
59
|
-
- **[Agent Skills](https://agentskills.io)** — skill catalogs exposed in the prompt. `/skill:name` injects a skill body into the next user message.
|
|
60
|
-
- **
|
|
60
|
+
- **[Agent Skills](https://agentskills.io)** — skill catalogs exposed in the prompt. `/skill:name` injects a skill body into the next user message, and `/skill` opens a picker that fills in the selected skill reference without submitting.
|
|
61
|
+
- **Settings-driven MCP tools** — connect Streamable HTTP MCP servers from `~/.config/mini-coder/settings.json` and expose their tools directly in the core runtime.
|
|
61
62
|
|
|
62
63
|
## Commands
|
|
63
64
|
|
|
64
|
-
| Command
|
|
65
|
-
|
|
|
66
|
-
| `/model`
|
|
67
|
-
| `/session`
|
|
68
|
-
| `/new`
|
|
69
|
-
| `/fork`
|
|
70
|
-
| `/undo`
|
|
71
|
-
| `/reasoning`
|
|
72
|
-
| `/verbose`
|
|
73
|
-
| `/
|
|
74
|
-
| `/
|
|
75
|
-
| `/
|
|
76
|
-
| `/
|
|
77
|
-
| `/
|
|
65
|
+
| Command | Description |
|
|
66
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
67
|
+
| `/model` | Switch models and save the choice as the global default. |
|
|
68
|
+
| `/session` | Open the session picker for the current working directory. |
|
|
69
|
+
| `/new` | Start a fresh session and reset the running token and cost totals. |
|
|
70
|
+
| `/fork` | Fork the current chat into a new session, keep the original, and add a UI-only `Forked session.` note. |
|
|
71
|
+
| `/undo` | Remove the last conversational turn without touching filesystem changes. |
|
|
72
|
+
| `/reasoning` | Show or hide model thinking. The setting is saved and restored on launch. |
|
|
73
|
+
| `/verbose` | Toggle compact vs full rendering for verbose-aware tool previews/results, including shell, read, grep, edit previews/errors, and MCP tool blocks. |
|
|
74
|
+
| `/mcp` | Open the MCP server picker and toggle configured servers on or off for future turns. |
|
|
75
|
+
| `/todo` | Show the current session todo list in the conversation log as a UI-only checklist block. |
|
|
76
|
+
| `/login` | Sign in with a supported OAuth provider. |
|
|
77
|
+
| `/logout` | Remove saved OAuth credentials for a logged-in provider. |
|
|
78
|
+
| `/effort` | Choose low, medium, high, or xhigh reasoning effort. |
|
|
79
|
+
| `/help` | Show commands, current toggles, loaded AGENTS.md files, skills, and MCP servers with on/off state. |
|
|
80
|
+
| `/skill:name` | Insert a discovered skill into the next message. Submit `/skill` or pick `/skill:name` from slash-command autocomplete to choose a skill without auto-submitting. |
|
|
78
81
|
|
|
79
82
|
## Key bindings
|
|
80
83
|
|
|
@@ -83,7 +86,7 @@ Plugins can add more tools, but the core stays intentionally small.
|
|
|
83
86
|
| `Enter` | Submit message |
|
|
84
87
|
| `Shift+Enter` | Insert newline |
|
|
85
88
|
| `Escape` | Dismiss the overlay without changing the draft; otherwise interrupt the running turn; otherwise do nothing |
|
|
86
|
-
| `Tab` | Autocomplete a path, or open the command picker when the draft starts with `/`
|
|
89
|
+
| `Tab` | Autocomplete a path, or open the command picker when the draft starts with `/` without clearing the draft |
|
|
87
90
|
| `Ctrl+R` | Search global raw input history |
|
|
88
91
|
| `Ctrl+C` | Graceful exit |
|
|
89
92
|
| `Ctrl+D` | Graceful exit when the input is empty |
|
|
@@ -103,9 +106,40 @@ $ printf '%s\n' 'fix the failing tests' | mc
|
|
|
103
106
|
- Starts when `-p/--prompt` is provided or when stdin or stdout is not a TTY.
|
|
104
107
|
- If stdout is redirected but stdin is still interactive, pass `-p`; headless mode will not fall back to an interactive prompt.
|
|
105
108
|
- Uses the same parser as the TUI for plain text, `/skill:name`, and standalone image paths.
|
|
109
|
+
- Without `--json`, keeps stdout script-friendly by writing only the final assistant text there, while lightweight assistant commentary snippets from tool-use turns go to stderr.
|
|
106
110
|
- With `--json`, writes NDJSON events for completed assistant/tool-result messages plus `done` / `error` / `aborted` outcomes; queued `user_message` events may also appear. Streaming deltas are omitted.
|
|
107
111
|
- Headless runs still persist like normal sessions and show up in `/session` history for that working directory.
|
|
108
|
-
- Interactive slash commands such as `/model`, `/session`, and `/help` are not available in headless mode.
|
|
112
|
+
- Interactive slash commands such as `/skill` without a name, `/model`, `/session`, `/mcp`, and `/help` are not available in headless mode.
|
|
113
|
+
|
|
114
|
+
## Settings
|
|
115
|
+
|
|
116
|
+
Global defaults live in `~/.config/mini-coder/settings.json`.
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"customProviders": [
|
|
121
|
+
{
|
|
122
|
+
"name": "lm-studio",
|
|
123
|
+
"baseUrl": "http://127.0.0.1:1234/v1"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"mcp": {
|
|
127
|
+
"servers": [
|
|
128
|
+
{
|
|
129
|
+
"name": "docs",
|
|
130
|
+
"url": "http://127.0.0.1:8787/mcp",
|
|
131
|
+
"enabled": true
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
- `mcp.servers` currently supports Streamable HTTP MCP endpoints.
|
|
139
|
+
- Each server `name` becomes the imported tool prefix, so a remote `search` tool appears as `docs__search`.
|
|
140
|
+
- MCP servers with `enabled: true` connect at startup; disabled ones stay disconnected until you turn them back on.
|
|
141
|
+
- Invalid MCP URLs are skipped immediately, and enabled servers that are unreachable are skipped with a warning.
|
|
142
|
+
- `/mcp` can enable or disable configured MCP servers during the current app run, and that on/off state is persisted.
|
|
109
143
|
|
|
110
144
|
## Docs
|
|
111
145
|
|
|
@@ -123,6 +157,17 @@ bun run format
|
|
|
123
157
|
bun run typecheck
|
|
124
158
|
```
|
|
125
159
|
|
|
160
|
+
## Also makes LLMs smarter
|
|
161
|
+
|
|
162
|
+
LLMs famously tell you to walk 50 meters to the car wash — forgetting the car needs to be there too. Not on our watch.
|
|
163
|
+
|
|
164
|
+
<table align="center">
|
|
165
|
+
<tr>
|
|
166
|
+
<td><img src="assets/mc-claude-smart.png" alt="Claude correctly answering the car wash question" width="400" /></td>
|
|
167
|
+
<td><img src="assets/mc-gpt-smart.png" alt="GPT correctly answering the car wash question" width="400" /></td>
|
|
168
|
+
</tr>
|
|
169
|
+
</table>
|
|
170
|
+
|
|
126
171
|
## License
|
|
127
172
|
|
|
128
173
|
MIT
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
|
|
5
|
+
|
|
6
|
+
PYTHONPATH="$PWD/terminal-bench" harbor run -y \
|
|
7
|
+
--job-name benchmark-baseline-full-$(date +%F__%H-%M-%S) \
|
|
8
|
+
--jobs-dir "$PWD/terminal-bench/jobs" \
|
|
9
|
+
--agent-import-path mini_coder_agent:MiniCoderAgent \
|
|
10
|
+
--ak version=0.5.12 \
|
|
11
|
+
--model openai-codex/gpt-5.4 \
|
|
12
|
+
--dataset terminal-bench@2.0 \
|
|
13
|
+
--n-attempts 2 \
|
|
14
|
+
--n-concurrent 2 \
|
|
15
|
+
--max-retries 0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
stop() {
|
|
5
|
+
echo "stopping loop"
|
|
6
|
+
exit 0
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
trap stop INT TERM
|
|
10
|
+
|
|
11
|
+
while :; do
|
|
12
|
+
echo ""
|
|
13
|
+
echo "> Running step"
|
|
14
|
+
echo ""
|
|
15
|
+
mc -p "See BENCHMARK.md and PROGRESS.md first. Do the next step in the process. Once the step is complete update PROGRESS.md"
|
|
16
|
+
|
|
17
|
+
sleep 60
|
|
18
|
+
done
|
|
19
|
+
|