heartcode 0.1.45 → 0.1.56
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/CHANGELOG.md +286 -0
- package/README.md +147 -126
- package/SKILL.md +16 -18
- package/bin/heartcode.js +146 -93
- package/package.json +2 -2
- package/prompts/README.md +1 -1
- package/prompts/agent.md +252 -352
- package/prompts/compact.md +24 -45
- package/prompts/guided.md +43 -67
- package/prompts/tests.md +15 -0
- package/src/acp.js +10 -5
- package/src/agent.js +211 -113
- package/src/check.js +411 -0
- package/src/client.js +25 -42
- package/src/config.js +10 -1
- package/src/guided.js +77 -26
- package/src/headless.js +31 -3
- package/src/log.js +1 -1
- package/src/lsp.js +10 -0
- package/src/mcp.js +30 -21
- package/src/prompts.js +1 -0
- package/src/reset.js +1 -1
- package/src/sessions.js +56 -17
- package/src/settings.html +296 -154
- package/src/settings.js +108 -43
- package/src/skills.js +42 -7
- package/src/tabs.js +6 -2
- package/src/tools.js +185 -56
- package/src/ui.js +449 -110
package/README.md
CHANGED
|
@@ -2,90 +2,88 @@
|
|
|
2
2
|
|
|
3
3
|
# HeartCode
|
|
4
4
|
|
|
5
|
-
A coding agent for your terminal
|
|
5
|
+
A coding agent for your terminal. It works with any OpenAI-compatible model: free ones, paid
|
|
6
|
+
ones, local ones, several at once.
|
|
6
7
|
|
|
7
|
-
**Zero dependencies.**
|
|
8
|
-
|
|
9
|
-
what you can read.
|
|
8
|
+
**Zero dependencies.** Only Node.js (22 or newer) and HeartCode's own code. No `node_modules`, no
|
|
9
|
+
install scripts. What you install is what you can read.
|
|
10
10
|
|
|
11
11
|
<!-- image: HeartCode in the terminal, answering a message -->
|
|
12
12
|

|
|
13
13
|
|
|
14
14
|
## Why I made it
|
|
15
15
|
|
|
16
|
-
Not to compete with other coding CLIs. I made it for
|
|
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
|
-
- **Set up in a web page**
|
|
53
|
-
- **
|
|
16
|
+
Not to compete with other coding CLIs. I made it for myself, because none of the ones I tried
|
|
17
|
+
did what I needed.
|
|
18
|
+
|
|
19
|
+
**Safety first.** A coding CLI runs with your files, your keys and your shell. Most pull in
|
|
20
|
+
hundreds of npm packages, and any of them can be hijacked to ship malware in an update. HeartCode
|
|
21
|
+
has none, so there's nothing for anyone to poison.
|
|
22
|
+
|
|
23
|
+
## What it does differently
|
|
24
|
+
|
|
25
|
+
**It keeps working when a model doesn't**
|
|
26
|
+
- Give it a list of models, from any providers (free ones too). When one hits a rate limit, goes
|
|
27
|
+
down or fails, the next one answers and the work goes on. A ↻ in the status bar shows it.
|
|
28
|
+
- When a conversation gets too long for a model, it moves to one of your models with more room
|
|
29
|
+
instead of summarizing things away.
|
|
30
|
+
- When a model goes round in circles, the next one takes over. Only you stop it (Esc).
|
|
31
|
+
|
|
32
|
+
**It works carefully**
|
|
33
|
+
- It asks what you want before it builds, reads the current docs before it uses something, and
|
|
34
|
+
makes a plan before it changes anything.
|
|
35
|
+
- It runs and tests what it changed before it says "done", and another of your models checks the
|
|
36
|
+
result against what you asked.
|
|
37
|
+
- It writes the least code that works and changes only what the task needs.
|
|
38
|
+
|
|
39
|
+
**It learns, per project**
|
|
40
|
+
- Every web page it reads is saved in `.heartcode/research/`.
|
|
41
|
+
- After a task, it saves what's worth knowing as notes (`.heartcode/memory/`) and deletes the junk
|
|
42
|
+
and throwaway files, in the background.
|
|
43
|
+
- A mistake it fixes becomes a lesson it won't repeat.
|
|
44
|
+
|
|
45
|
+
**It gets good work out of small and local models**
|
|
46
|
+
- Models that can't call tools are guided one simple question at a time.
|
|
47
|
+
- What each model can do comes from [models.dev](https://models.dev), so nothing is wasted
|
|
48
|
+
finding out.
|
|
49
|
+
- It sends only what's needed, and never sends `max_tokens`, so no reply is cut short.
|
|
50
|
+
|
|
51
|
+
**And the rest you'd expect**
|
|
52
|
+
- **Set up in a web page** (`/settings`), not by editing config files.
|
|
53
|
+
- **Skills, MCP servers and hooks** in Claude Code's formats; `/import` brings yours over.
|
|
54
|
+
- **Tabs** (`Alt+T`) and git worktrees, for work kept apart.
|
|
55
|
+
- **Servers in the background**: the model starts a dev server and keeps working. `Alt+B` shows
|
|
56
|
+
their logs live.
|
|
57
|
+
- **Telegram messages** when a task finishes, fails or waits for you.
|
|
58
|
+
- **Logs** of exactly what you choose (seven kinds, all off by default), readable on the settings page.
|
|
59
|
+
- **`heart -p`** runs one task without the screen, for other tools and AI agents, like `claude -p`
|
|
54
60
|
(see [SKILL.md](SKILL.md)).
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- **Takes skills, MCP servers and hooks** in Claude Code's formats; `/import` brings yours over.
|
|
59
|
-
- **Tells you when a newer version is out** (a check with npm each time it starts, in the status bar):
|
|
60
|
-
`/update` shows what changed and installs it the way you installed HeartCode. Switch it off in
|
|
61
|
-
`/settings` → General.
|
|
62
|
-
- **An orchestrator that hands work out**: with "Pick" set to "an orchestrator hands it out",
|
|
63
|
-
each message starts on a model you choose for that (a quick, cheap one is enough). It answers
|
|
64
|
-
at once when it can ("hi" needs no other model), and otherwise hands the work to whichever of
|
|
65
|
-
your models it thinks suits it. It knows what each one can do and where it stands in LMArena's
|
|
66
|
-
public rankings. Your models shows each model's Coding, Web apps and Vision scores.
|
|
67
|
-
- **Works with discipline by default**: its rules (from Karpathy's guidelines, Grill Me,
|
|
68
|
-
Superpowers, Ponytail and Caveman) have it ask before building, find a bug's root cause first,
|
|
69
|
-
write the least code that works, change only what the task needs, prove it before saying done,
|
|
70
|
-
then stop, and answer short. A skill with `use: always` adds rules of your own to every message.
|
|
71
|
-
- **Tabs** (`Alt+T`), each with its own conversation, and git worktrees for work kept apart.
|
|
72
|
-
- **Servers and watchers in the background**: the model starts one and goes on working, reads its
|
|
73
|
-
output when it needs to, and stops it. `Alt+B` (or `/background`) shows their logs live above the input,
|
|
74
|
-
a tab each (←/→ or a click switches), while you work; nothing outlives HeartCode.
|
|
75
|
-
- **`/context`**: what fills the context window, part by part (system prompt, tools, messages, tool
|
|
76
|
-
results) and the biggest single pieces.
|
|
77
|
-
|
|
78
|
-
## How I set it up and use it
|
|
61
|
+
- **`heartcode page index.html`** checks a web page in a real browser (errors, blank page, faint
|
|
62
|
+
text, missing icons) and saves desktop and phone screenshots.
|
|
63
|
+
- **`/context`** shows what fills the context window. `/update` installs a newer version.
|
|
79
64
|
|
|
80
|
-
|
|
65
|
+
## What happens when you ask it to make something
|
|
66
|
+
|
|
67
|
+
1. **It asks first.** If your request leaves something open (how it should look, how far to go,
|
|
68
|
+
whether to test it), it asks you, with its own suggestion first. Small fixes it just does.
|
|
69
|
+
2. **It reads up** on whatever it's about to use, instead of trusting its memory.
|
|
70
|
+
3. **It makes a plan**: a todo list you can see. It can't change a file before there's one.
|
|
71
|
+
4. **It does the work**: reading files, running commands, editing.
|
|
72
|
+
5. **It may split the work.** Your #1 model can hand a job to a helper, or run separate parts at
|
|
73
|
+
the same time, each on its own files. Helpers use your models in your order. The model decides.
|
|
74
|
+
6. **It checks before it says it's done**: it must have tested what it changed, finished its todo
|
|
75
|
+
list and made the files it names. Then your next models say yes or no; a no sends it back.
|
|
76
|
+
7. **It tidies up** in the background: saves notes for next time, removes throwaway files.
|
|
81
77
|
|
|
82
|
-
|
|
78
|
+
## How to set it up
|
|
79
|
+
|
|
80
|
+
### 1. Install
|
|
83
81
|
|
|
84
82
|
```sh
|
|
85
83
|
npm install -g heartcode
|
|
86
84
|
```
|
|
87
85
|
|
|
88
|
-
Or from source:
|
|
86
|
+
Or from source (a `git pull` then updates it):
|
|
89
87
|
|
|
90
88
|
```sh
|
|
91
89
|
git clone https://github.com/p32929/HeartCode.git
|
|
@@ -93,11 +91,7 @@ cd HeartCode
|
|
|
93
91
|
npm start
|
|
94
92
|
```
|
|
95
93
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
### 2. Run `heart`
|
|
99
|
-
|
|
100
|
-
In the project you want to work on:
|
|
94
|
+
### 2. Run `heart` in your project
|
|
101
95
|
|
|
102
96
|
```sh
|
|
103
97
|
cd ~/code/my-app
|
|
@@ -106,24 +100,20 @@ heart
|
|
|
106
100
|
|
|
107
101
|
### 3. Open the settings page
|
|
108
102
|
|
|
109
|
-
Type `/settings`. The
|
|
110
|
-
network
|
|
111
|
-
|
|
112
|
-
it has a secret key, and the page answers only to this machine's own addresses. A running
|
|
113
|
-
HeartCode picks up what you change right away.
|
|
103
|
+
Type `/settings`. The page opens in your browser. Its link also works from another device on your
|
|
104
|
+
network (handy when HeartCode runs on a server over SSH). Only that link works: it has a secret
|
|
105
|
+
key. A running HeartCode picks up your changes right away.
|
|
114
106
|
|
|
115
107
|
<!-- image: the settings page -->
|
|
116
108
|

|
|
117
109
|
|
|
118
|
-
|
|
110
|
+
What's in the sidebar:
|
|
119
111
|
|
|
120
|
-
- **Models**: *Your list* (the models HeartCode uses, in order) and *Providers* (where they
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- **Skills**, **MCP servers** and **System prompt**: what HeartCode can do and how it's told.
|
|
126
|
-
- **Advanced**: *Logs* (seven kinds, each on or off, and a viewer) and *Files* (the rest of the settings, as files).
|
|
112
|
+
- **Models**: *Your list* (the models HeartCode uses, in order) and *Providers* (where they come from).
|
|
113
|
+
- **General**: what it may do without asking, colors, thinking effort, voice input, web search,
|
|
114
|
+
and the *Status bar* (drag and drop what it shows). **Notifications**: Telegram.
|
|
115
|
+
- **Skills**, **MCP servers** and **System prompt**: what HeartCode can do and what it's told.
|
|
116
|
+
- **Advanced**: *Logs* and *Files* (the rest of the settings, as files).
|
|
127
117
|
|
|
128
118
|
### 4. Add a provider and pick models
|
|
129
119
|
|
|
@@ -131,64 +121,93 @@ On **Models → Providers**:
|
|
|
131
121
|
|
|
132
122
|

|
|
133
123
|
|
|
134
|
-
1. **Add a provider**: its name, base URL and API key.
|
|
135
|
-
2. **
|
|
124
|
+
1. **Add a provider**: its name, base URL and API key. A preset fills in the URL.
|
|
125
|
+
2. **Pick models**: click a model to add it to your list. I use the free ones.
|
|
136
126
|
|
|
137
127
|
### 5. Put your list in order
|
|
138
128
|
|
|
139
129
|
On **Models → Your list**:
|
|
140
130
|
|
|
141
|
-
1. **Sort
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
- **
|
|
164
|
-
|
|
165
|
-
|
|
131
|
+
1. **Sort.** Click *Abilities*, then *Context*: the most capable models come first, the biggest
|
|
132
|
+
context window first among those. Click **Save order**.
|
|
133
|
+
2. **Drag rows** to fine-tune. #1 is the one HeartCode uses; the rest are its fallbacks, in order.
|
|
134
|
+
3. **Test** (optional): **Test all** sends each model a short message and shows which answer and
|
|
135
|
+
how fast (*Works?*). Sort by it to put the fastest first.
|
|
136
|
+
4. **Filter** (optional): by name, provider, test result, context, abilities or free. **Use only
|
|
137
|
+
these** keeps just the ones you see, in that order.
|
|
138
|
+
|
|
139
|
+
**Update model info** fetches what each model can do and costs (from models.dev) and its places in
|
|
140
|
+
LMArena's public rankings for coding, web apps and vision, as columns to sort by. A model *not
|
|
141
|
+
found* in models.dev: **Retry** looks it up again, or **Set up** tells HeartCode what it can do.
|
|
142
|
+
|
|
143
|
+
### 6. Recommended: let it see what it builds
|
|
144
|
+
|
|
145
|
+
Out of the box, HeartCode reads, writes and runs code. It can't see a page it made or click
|
|
146
|
+
through an app. These three fix that. They're optional, but you'll get much better results with
|
|
147
|
+
them, especially for anything with a screen.
|
|
148
|
+
|
|
149
|
+
**The design skill**: so the pages and apps it makes look right.
|
|
150
|
+
AI-made interfaces often look generic, crowded or broken. This skill gives the model a method
|
|
151
|
+
(understand the job, break the design down, take every size and color from one system, check it)
|
|
152
|
+
plus a theme, a starter page and guides for common components, in shadcn/ui's look.
|
|
153
|
+
- Install: **Skills** → paste `p32929/p32929_design_skill` in *Install a skill* → **Install**.
|
|
154
|
+
Or type `/install_skill p32929/p32929_design_skill` in HeartCode.
|
|
155
|
+
- The model loads it when a task is about how something looks. To have it in every message, set
|
|
156
|
+
*Who uses it* to *Always on*.
|
|
157
|
+
|
|
158
|
+
**Chrome DevTools MCP**: so it can check web pages in a real browser.
|
|
159
|
+
The model opens what it built in Chrome, clicks through it, reads the console errors and takes
|
|
160
|
+
screenshots, instead of guessing whether it works.
|
|
161
|
+
- Install: **MCP servers** → **+ Add a server** → paste `npx -y chrome-devtools-mcp@latest --isolated`
|
|
162
|
+
→ **Add server**. Its name (*chrome-devtools*) comes from the command.
|
|
163
|
+
- `--isolated` gives it a fresh browser profile each time, so it never touches your own Chrome.
|
|
164
|
+
Add `--headless` with the *+ flag* box to hide the window; untick a flag to turn it off.
|
|
165
|
+
- Needs Google Chrome installed.
|
|
166
|
+
|
|
167
|
+
**Computer use MCP**: so it can use apps outside the browser.
|
|
168
|
+
Screenshots, mouse, keyboard and apps on your computer: for testing a desktop app or a game, or
|
|
169
|
+
anything a browser can't reach.
|
|
170
|
+
- Install: **+ Add a server** → paste `npx -y @zavora-ai/computer-use-mcp@latest` → **Add server**.
|
|
171
|
+
Its name is *computer-use*.
|
|
172
|
+
- On macOS, give your terminal app **Accessibility** and **Screen Recording** access (System
|
|
173
|
+
Settings → Privacy & Security), and install the Xcode command line tools
|
|
174
|
+
(`xcode-select --install`).
|
|
175
|
+
- It can click anything on your screen. Switch it off in the list when you don't need it.
|
|
176
|
+
|
|
177
|
+
For screenshots to be useful, one of your models must be able to see images. If #1 can't, it
|
|
178
|
+
hands the looking to the first of your models that can.
|
|
179
|
+
|
|
180
|
+
**Also useful:**
|
|
181
|
+
- **Notifications**: a Telegram message when a task finishes, fails or waits for you. Make a bot with
|
|
182
|
+
[@BotFather](https://t.me/BotFather), paste its token, press Start in the bot; HeartCode finds your chat.
|
|
183
|
+
- **Advanced → Logs**: switch on only the kinds you need and read them there (by run, searched,
|
|
184
|
+
live). Logs older than 3 days are deleted.
|
|
166
185
|
|
|
167
186
|
### 7. Back to HeartCode
|
|
168
187
|
|
|
169
|
-
Go back to the terminal. While the settings page is on, HeartCode shows a dialog and waits.
|
|
170
|
-
|
|
188
|
+
Go back to the terminal. While the settings page is on, HeartCode shows a dialog and waits. Your
|
|
189
|
+
changes are already in.
|
|
171
190
|
|
|
172
191
|
### 8. Press Enter to stop the settings page
|
|
173
192
|
|
|
174
|
-
**Turn off** is selected: press Enter.
|
|
193
|
+
**Turn off** is selected: press Enter.
|
|
175
194
|
|
|
176
195
|
<!-- image: the "settings page is on" dialog -->
|
|
177
196
|

|
|
178
197
|
|
|
179
198
|
### 9. Send "Hi" as a test
|
|
180
199
|
|
|
181
|
-
Type `Hi` and press Enter.
|
|
200
|
+
Type `Hi` and press Enter. A reply means your model works.
|
|
182
201
|
|
|
183
202
|
### 10. Start using it
|
|
184
203
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
commands
|
|
191
|
-
|
|
204
|
+
Ask it to read, change, run and fix things in your project, like any coding agent.
|
|
205
|
+
|
|
206
|
+
- `/` shows every command; `heart --help` lists the rest.
|
|
207
|
+
- `Shift+Tab` changes what it may do without asking.
|
|
208
|
+
- `Esc` stops it, or closes a dialog.
|
|
209
|
+
- While it works, commands that don't change the conversation (`/help`, `/cost`, `/diff`,
|
|
210
|
+
`/settings`…) run at once; the ones that do (`/compact`, `/rewind`…) wait until it's done.
|
|
192
211
|
|
|
193
212
|
## Thanks
|
|
194
213
|
|
|
@@ -198,7 +217,9 @@ models: sending a "no, do this instead" as your own message, counting code's tok
|
|
|
198
217
|
keeping the provider's prompt cache, checking what uses a changed function, saving what the model
|
|
199
218
|
found before compacting), [OpenCode](https://github.com/anomalyco/opencode),
|
|
200
219
|
[Cline](https://github.com/cline/cline), [OpenClaw](https://github.com/openclaw/openclaw) and
|
|
201
|
-
[Pi](https://github.com/earendil-works/pi), for the many use cases like these they showed me.
|
|
220
|
+
[Pi](https://github.com/earendil-works/pi), for the many use cases like these they showed me. Its
|
|
221
|
+
working rules (ask before building, root cause first, the least code that works, prove it, answer
|
|
222
|
+
short) come from Karpathy's guidelines, Grill Me, Superpowers, Ponytail and Caveman.
|
|
202
223
|
|
|
203
224
|
## License
|
|
204
225
|
|
package/SKILL.md
CHANGED
|
@@ -58,7 +58,7 @@ reached has an `error` (in text: a line on stderr) and is skipped; the command s
|
|
|
58
58
|
|
|
59
59
|
| `-m` | What runs |
|
|
60
60
|
|---|---|
|
|
61
|
-
| `auto`, or no `-m` | the user's list: #1, and the next one in order when it fails
|
|
61
|
+
| `auto`, or no `-m` | the user's list: #1, and the next one in order when it fails. Use this unless you need one particular model. |
|
|
62
62
|
| `provider/model` (`-m groq/openai/gpt-oss-120b`), or a model of #1's provider alone | that model alone: never another one, also when it fails (a rate limit or an outage is tried again, up to `--max-retries`) |
|
|
63
63
|
| that, plus `--fallback-model provider/model` (repeatable) | that model, then the fallbacks in order when it fails (as `claude -p --fallback-model`) |
|
|
64
64
|
|
|
@@ -80,14 +80,9 @@ image, one that can't call tools gets the tool calls as text.
|
|
|
80
80
|
|
|
81
81
|
`--provider <name>` and `-u <url>` (a server for this run) also mean one model, alone.
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
at once, streaming, when it can (a greeting, a question), and otherwise hands the work to the
|
|
87
|
-
user's other models through its `agent` tool. It picks which one, knowing what each can do and
|
|
88
|
-
its places in the public LMArena rankings. It has no other tool: the models it picks do the work. If no
|
|
89
|
-
orchestrator answers, the list goes on to the next model. With "in your order" (the default), the list
|
|
90
|
-
is the user's order, as is.
|
|
83
|
+
`heartcode page <file|url>` checks a web page in a headless browser (errors, a blank page, a click
|
|
84
|
+
that breaks it, text too faint to read, content hidden at load, icons that don't draw: exit 0 when it
|
|
85
|
+
passes) and saves screenshots to `.heartcode/page-shots/`.
|
|
91
86
|
|
|
92
87
|
A run picks up settings the user changes meanwhile (`heart settings`, another HeartCode, or
|
|
93
88
|
`~/.heart` by hand) without being restarted, from its next request: the model order, prompts,
|
|
@@ -95,7 +90,7 @@ hooks, skills, MCP servers. `--temp` runs share one throwaway folder, so a chang
|
|
|
95
90
|
other `--temp` runs going on, never the real ones.
|
|
96
91
|
|
|
97
92
|
`heart` is installed by `npm start` in the HeartCode folder. `heartcode` is the same command.
|
|
98
|
-
Needs Node.js
|
|
93
|
+
Needs Node.js 22 or newer. No providers? See "Setting up a model" below.
|
|
99
94
|
|
|
100
95
|
## Run a task
|
|
101
96
|
|
|
@@ -125,7 +120,7 @@ goes to stderr. Logs never go to stdout.
|
|
|
125
120
|
|
|
126
121
|
## Continue the same conversation
|
|
127
122
|
|
|
128
|
-
Every run is saved as a session in
|
|
123
|
+
Every run is saved as a session in the project's `.heartcode/sessions/` (and logged, for the kinds of logs the user
|
|
129
124
|
switched on), as when the user works in HeartCode; `--temp` keeps nothing. Pass the `session_id`
|
|
130
125
|
from the last result:
|
|
131
126
|
|
|
@@ -166,7 +161,7 @@ heart -p -m auto "…" # the user's list, with its fa
|
|
|
166
161
|
heart -p -m groq/openai/gpt-oss-120b "…" # that provider and model alone, for this run
|
|
167
162
|
heart -p -m groq/openai/gpt-oss-120b --fallback-model openrouter/qwen/qwen3-coder "…" # and that one when it fails
|
|
168
163
|
heart -p --provider ollama -m qwen3-coder "…" # the same, written apart
|
|
169
|
-
heart -p --effort high "…" # how hard a thinking model thinks
|
|
164
|
+
heart -p --effort high "…" # how hard a thinking model thinks (low unless set)
|
|
170
165
|
```
|
|
171
166
|
|
|
172
167
|
What a model can do (tool calls, context size, thinking, images) comes from models.dev, at once;
|
|
@@ -174,11 +169,10 @@ nothing is sent to the model to find out. A model models.dev doesn't know works
|
|
|
174
169
|
assumptions, and the user can set it up on the settings page. Models that can't call tools still
|
|
175
170
|
work, in a slower guided mode.
|
|
176
171
|
|
|
177
|
-
The model in use knows the user's other models (what each can do
|
|
178
|
-
session, and with an orchestrator their ranks overall, for code, web apps and vision) and works with them through its `agent` tool: it asks a model that can for what it
|
|
172
|
+
The model in use knows the user's other models (in the user's order, with what each can do) and works with them through its `agent` tool: it asks a model that can for what it
|
|
179
173
|
can't do itself (a model that can't see asks one that can about a screenshot: "which tiles show a
|
|
180
174
|
chair?"), several at once when there are many images or parts, and a helper that fails is handed to
|
|
181
|
-
the next capable model until one does the job. A helper works until its job is done (no step
|
|
175
|
+
the next capable model in the user's order until one does the job. A helper works until its job is done (no step
|
|
182
176
|
limit; `--max-turns` applies to it too). Their tokens are in `usage`, and each model's in
|
|
183
177
|
`modelUsage`.
|
|
184
178
|
|
|
@@ -201,8 +195,7 @@ HEART_API_KEY=… heart -u https://api.groq.com/openai/v1 -m openai/gpt-oss-120b
|
|
|
201
195
|
A model server on this machine (Ollama on :11434, LM Studio on :1234, llama.cpp on :8080) is
|
|
202
196
|
found on its own. The user can also set everything up in a browser: `heart settings` (its link has
|
|
203
197
|
the machine's network address, so it opens from another device too, for HeartCode on a server), where
|
|
204
|
-
**Test
|
|
205
|
-
answers. A run that fails with a wrong key or an unknown model: ask the user to test it there.
|
|
198
|
+
**Test all** under *Your models* sends each model a short message to show it really answers, and how fast. A run that fails with a wrong key or an unknown model: ask the user to test it there.
|
|
206
199
|
|
|
207
200
|
## More context for the task
|
|
208
201
|
|
|
@@ -254,6 +247,11 @@ Stdout: one JSON event per line, `system`/`init` (its `tools` include the MCP se
|
|
|
254
247
|
call's `tool_use` is named as in Claude Code, `mcp__<server>__<tool>`, with the tool's own
|
|
255
248
|
arguments as `input`.
|
|
256
249
|
|
|
250
|
+
With `--include-partial-messages`, each reply also comes as it's written, as Claude Code sends it:
|
|
251
|
+
`stream_event` lines (`message_start`, `content_block_start`, `content_block_delta` with a
|
|
252
|
+
`thinking_delta` or `text_delta`, `content_block_stop`, `message_stop`), before its whole
|
|
253
|
+
`assistant` line. Helpers' replies come whole only (their `assistant` lines, with their parent).
|
|
254
|
+
|
|
257
255
|
A helper's steps (the `agent` tool: another of the user's models, or the same one, doing a job;
|
|
258
256
|
several can run at once) come as `assistant` and `user` lines too, as Claude Code sends a
|
|
259
257
|
subagent's: `parent_tool_use_id` is the id of the `agent` call they belong to (`null` for the main
|
|
@@ -264,7 +262,7 @@ fallback, the one that took over, not the one the run started with (the `init` l
|
|
|
264
262
|
`modelUsage` in the `result` has each model that answered.
|
|
265
263
|
|
|
266
264
|
Not in the stream: HeartCode's own prompts (the system prompt, its nudges), the review's verdict
|
|
267
|
-
and the wrap-up.
|
|
265
|
+
and the wrap-up. Helpers' work is in it: `agent` tool calls, with the helper's lines under them. Their tokens are in `usage` and
|
|
268
266
|
`modelUsage`. Retries and switches to another model go to stderr with `--verbose`.
|
|
269
267
|
|
|
270
268
|
## Don't
|