heartcode 0.1.102 → 0.1.106
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 +26 -0
- package/README.md +1 -1
- package/bin/heartcode.js +17 -6
- package/package.json +1 -1
- package/src/acp.js +1 -1
- package/src/headless.js +1 -1
- package/src/tools.js +5 -4
- package/src/ui.js +1 -1
- package/src/update.js +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in each version of HeartCode, newest first.
|
|
4
4
|
|
|
5
|
+
## 0.1.106 (2026-11-28)
|
|
6
|
+
|
|
7
|
+
- **Updated while it was open? HeartCode says to restart.** A HeartCode keeps running the code it
|
|
8
|
+
started with, so one left open while `npm install -g heartcode` ran in another window still
|
|
9
|
+
behaved like the old version. Now it notices the newer version on disk within a minute and says
|
|
10
|
+
"restart it to use 0.1.x" (also in the status bar).
|
|
11
|
+
|
|
12
|
+
## 0.1.105 (2026-11-28)
|
|
13
|
+
|
|
14
|
+
- **A newer HeartCode is noticed while HeartCode stays open**: npm is asked at start and then every
|
|
15
|
+
hour, so one left running hears of a version published after it started (said once per version,
|
|
16
|
+
then kept in the status bar). Before, only a restart found it.
|
|
17
|
+
|
|
18
|
+
## 0.1.104 (2026-11-28)
|
|
19
|
+
|
|
20
|
+
- **"Runs everything" now really runs everything: it never asks.** Writing the folder's HeartCode or
|
|
21
|
+
git settings (`.heartcode/hooks.json`, `mcp.json`, `format.json`, `prompts/`, `skills/`, `.git/`)
|
|
22
|
+
no longer stops to ask, and neither does a folder's own HeartCode setup at start (it's used). The
|
|
23
|
+
same holds headless (`-p`) and in editors. The other modes still ask about those files.
|
|
24
|
+
|
|
25
|
+
## 0.1.103 (2026-11-28)
|
|
26
|
+
|
|
27
|
+
- **"Runs everything" no longer stops to ask about a model's own files in `.heartcode/`** (a test
|
|
28
|
+
script it keeps there, say). The question is kept for what can run commands or steer HeartCode:
|
|
29
|
+
`.heartcode/hooks.json`, `mcp.json`, `format.json`, `prompts/`, `skills/`, and git's `.git/`.
|
|
30
|
+
|
|
5
31
|
## 0.1.102 (2026-11-27)
|
|
6
32
|
|
|
7
33
|
- **Import & export your settings** (`/settings` → Advanced → Import & export): tick what goes in the
|
package/README.md
CHANGED
|
@@ -323,6 +323,6 @@ Contributions are very welcome, thank you! Before you start on a pull request, p
|
|
|
323
323
|
|
|
324
324
|
## You might also like
|
|
325
325
|
|
|
326
|
-
<a href="https://openstore.pfay.workers.dev/
|
|
326
|
+
<p><a href="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/0"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/0-dark.svg"><img src="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/0-light.svg" width="50%" align="top" alt="More apps by p32929 on OpenStore (1)"></picture></a><a href="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/1"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/1-dark.svg"><img src="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/1-light.svg" width="50%" align="top" alt="More apps by p32929 on OpenStore (2)"></picture></a><br><a href="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/2"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/2-dark.svg"><img src="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/2-light.svg" width="50%" align="top" alt="More apps by p32929 on OpenStore (3)"></picture></a><a href="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/3"><picture><source media="(prefers-color-scheme: dark)" srcset="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/3-dark.svg"><img src="https://openstore.pfay.workers.dev/more/p32929/heartcode/personal/3-light.svg" width="50%" align="top" alt="More apps by p32929 on OpenStore (4)"></picture></a></p>
|
|
327
327
|
|
|
328
328
|
<p><a href="https://p32929.github.io/share/?repo=HeartCode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://p32929.github.io/readme/footer-share-dark.svg"><img src="https://p32929.github.io/readme/footer-share-light.svg" width="50%" align="top" alt="Share this project with your friends in one click"></picture></a><a href="https://p32929.github.io/support/"><picture><source media="(prefers-color-scheme: dark)" srcset="https://p32929.github.io/readme/footer-support-dark.svg"><img src="https://p32929.github.io/readme/footer-support-light.svg" width="50%" align="top" alt="If you like my work and want to support me, feel free to support"></picture></a><br><a href="https://openstore.pfay.workers.dev/add"><picture><source media="(prefers-color-scheme: dark)" srcset="https://p32929.github.io/readme/footer-join-dark.svg"><img src="https://p32929.github.io/readme/footer-join-light.svg" width="100%" align="top" alt="Put your own apps on OpenStore: free, your listing lives in your own repo"></picture></a></p>
|
package/bin/heartcode.js
CHANGED
|
@@ -9,7 +9,7 @@ import { loadRankings, scoreOf } from '../src/rankings.js'
|
|
|
9
9
|
import { byRecord, useRecords } from '../src/record.js'
|
|
10
10
|
import { Session, transcript, contextReport } from '../src/agent.js'
|
|
11
11
|
import { listJobs, getJob, stopJob, removeJob, runningJobs, tailLines, ago as ranFor } from '../src/background.js'
|
|
12
|
-
import { checkUpdate, installKind, UPDATE_COMMANDS, packageDir, whatsNew } from '../src/update.js'
|
|
12
|
+
import { checkUpdate, installedVersion, newer, installKind, UPDATE_COMMANDS, packageDir, whatsNew } from '../src/update.js'
|
|
13
13
|
import { treeItems, codePlan, move, leaving, leftText, leftFiles } from '../src/tree.js'
|
|
14
14
|
import { UI, c, PERMISSIONS, duration, copyText, overSsh, prettyKey, rank, setTheme, themeCodes, renderDiff, diffLines, DEFAULT_KEYS, loadKeys, width, shortError, wrapWords, ownAsk } from '../src/ui.js'
|
|
15
15
|
import { listFiles, runCommand, clip } from '../src/tools.js'
|
|
@@ -736,7 +736,7 @@ class App {
|
|
|
736
736
|
autocompact: cfg.autoCompact === false ? c.faint('auto-compact off') : null,
|
|
737
737
|
worktree: this.worktree ? c.info(`⎇ ${this.worktree.branch}`) : null,
|
|
738
738
|
background: runningJobs(this.root).length ? c.info(`⚙ ${runningJobs(this.root).length} running`) + c.faint(' Alt+B') : null,
|
|
739
|
-
update: this.update?.newer ? c.green(`⬆ ${this.update.latest}`) + c.faint(' /update') : null,
|
|
739
|
+
update: this.installed ? c.green(`⬆ ${this.installed}`) + c.faint(' restart to use it') : this.update?.newer ? c.green(`⬆ ${this.update.latest}`) + c.faint(' /update') : null,
|
|
740
740
|
permissions: { all: c.green('runs everything'), commands: c.yellow('asks before commands'), ask: c.yellow('asks before changes'), plan: c.info('plan mode') }[ui.permission],
|
|
741
741
|
}
|
|
742
742
|
if (strat) {
|
|
@@ -1971,18 +1971,29 @@ async function repl(app, f = {}) {
|
|
|
1971
1971
|
// models this folder picked earlier (/select_model): said, with the way back to your whole list
|
|
1972
1972
|
if (app.folderModels && cfg.session?.length) ui.notice(`This folder uses ${cfg.session.map((t) => t.model).join(', ')} (picked earlier) · /select_model auto for the whole list again`, 10000) // not a message
|
|
1973
1973
|
app.tabs?.onChange?.() // the conversation it opened with
|
|
1974
|
-
// a newer HeartCode: asked of npm in the background at every start
|
|
1975
|
-
|
|
1974
|
+
// a newer HeartCode: asked of npm in the background at every start and every hour after (one left
|
|
1975
|
+
// open for days still hears of it), said once per version and kept in the status bar
|
|
1976
|
+
const askNpm = () =>
|
|
1976
1977
|
checkUpdate()
|
|
1977
1978
|
.then((u) => {
|
|
1978
|
-
if (!u?.newer) return
|
|
1979
|
+
if (!u?.newer || app.update?.latest === u.latest) return
|
|
1979
1980
|
app.update = u
|
|
1980
1981
|
ui.notice(`HeartCode ${u.latest} is out (this is ${u.current}) · /update`, 10000) // and in the status bar
|
|
1981
1982
|
ui.render?.()
|
|
1982
1983
|
})
|
|
1983
1984
|
.catch(() => {})
|
|
1985
|
+
if (cfg.updateCheck !== false) askNpm(), setInterval(askNpm, 3600_000).unref()
|
|
1986
|
+
// updated while this one runs (npm install -g in another window): it still runs the old code, so say so
|
|
1987
|
+
setInterval(() => {
|
|
1988
|
+
const v = installedVersion()
|
|
1989
|
+
if (!v || !newer(v, VERSION) || app.installed === v) return
|
|
1990
|
+
app.installed = v
|
|
1991
|
+
ui.notice(`HeartCode ${v} is installed, but this one still runs ${VERSION} · restart it to use ${v} (/exit, then heart)`, 30000)
|
|
1992
|
+
ui.render?.()
|
|
1993
|
+
}, 60_000).unref()
|
|
1984
1994
|
// this folder's own setup (a cloned repo's hooks and MCP servers run commands): used once you say so
|
|
1985
|
-
if (!trusted(app.root))
|
|
1995
|
+
if (!trusted(app.root) && ui.permission === 'all') trust(app.root), reloadPrompts() // runs everything: used without asking
|
|
1996
|
+
else if (!trusted(app.root)) {
|
|
1986
1997
|
const files = setupFiles(app.root)
|
|
1987
1998
|
const yes = await ui.pick(`This folder has its own HeartCode setup (${files.join(', ')}). Its hooks and MCP servers run commands on this computer. Use it?`, [
|
|
1988
1999
|
{ label: 'Yes, use it', desc: 'for these files as they are now; asked again if they change', use: true },
|
package/package.json
CHANGED
package/src/acp.js
CHANGED
|
@@ -40,7 +40,7 @@ class AcpUI extends HeadlessUI {
|
|
|
40
40
|
async confirm(question, kind = 'edit') {
|
|
41
41
|
if (kind === 'read' && this.permission === 'plan') return true
|
|
42
42
|
const mode = this.permission === 'plan' ? (this.beforePlan ?? 'ask') : this.permission // plan mode asks as the mode before it did (as the full screen's)
|
|
43
|
-
if (
|
|
43
|
+
if (mode === 'all' || (mode === 'commands' && kind === 'edit')) return true // runs everything: never asks; otherwise setup is always asked
|
|
44
44
|
const toolCallId = runningCall.getStore() ?? this.calls[0] ?? `ask_${Date.now()}` // the call asking
|
|
45
45
|
const r = await this.conn
|
|
46
46
|
.request('session/request_permission', {
|
package/src/headless.js
CHANGED
|
@@ -86,7 +86,7 @@ export class HeadlessUI {
|
|
|
86
86
|
this.said = null
|
|
87
87
|
}
|
|
88
88
|
async confirm(question, kind = 'edit') {
|
|
89
|
-
if (
|
|
89
|
+
if (this.permission === 'all' || (kind !== 'setup' && ((this.permission === 'commands' && kind === 'edit') || (this.permission === 'plan' && kind === 'read')))) return true // runs everything: everything; plan: only reading; setup (HeartCode's or git's settings here): otherwise never without someone to ask
|
|
90
90
|
log('headless', `declined: ${question}`)
|
|
91
91
|
return `Not allowed: HeartCode runs headless with permission mode "${this.permission}", so this can't be approved. Don't retry it; say in your reply what you would have done.`
|
|
92
92
|
}
|
package/src/tools.js
CHANGED
|
@@ -464,10 +464,11 @@ const PLACEHOLDER = /(\.\.\.|…)\s*(rest|existing|remaining|unchanged|other)|re
|
|
|
464
464
|
// model choice. A model never writes them (a small one once wrote its notes over this conversation).
|
|
465
465
|
const OWN_DATA = /^\.heartcode\/(?:sessions|outputs|worktrees)(?:\/|$)|^\.heartcode\/models\.json$/
|
|
466
466
|
|
|
467
|
-
// HeartCode's settings for this folder (hooks
|
|
468
|
-
// git's (its hooks run commands):
|
|
469
|
-
// telling the model to write one would run its commands next time)
|
|
470
|
-
|
|
467
|
+
// HeartCode's settings for this folder (hooks, MCP servers and formatters run commands, prompts and
|
|
468
|
+
// skills steer it) and git's (its hooks run commands): asked about in every mode but runs everything
|
|
469
|
+
// (a file or page telling the model to write one would run its commands next time). The rest of
|
|
470
|
+
// .heartcode (a model's own scripts and notes there) is written like any project file.
|
|
471
|
+
const SETUP_FILES = /^\.git(?:\/|$)|^\.heartcode\/(?:(?:hooks|mcp|format)\.json$|(?:prompts|skills)(?:\/|$))/
|
|
471
472
|
|
|
472
473
|
export async function proposeWrite(s, rel, old, next) {
|
|
473
474
|
if (old === next) return { status: 'unchanged' }
|
package/src/ui.js
CHANGED
|
@@ -2310,7 +2310,7 @@ export class UI {
|
|
|
2310
2310
|
async confirm(question, kind = 'edit') {
|
|
2311
2311
|
if (kind === 'read' && this.permission === 'plan') return true
|
|
2312
2312
|
const mode = this.permission === 'plan' ? (this.beforePlan ?? 'ask') : this.permission
|
|
2313
|
-
if (
|
|
2313
|
+
if (mode === 'all' || (mode === 'commands' && kind === 'edit')) return true // runs everything: never asks, setup files too; otherwise setup is always asked (tools.js SETUP_FILES)
|
|
2314
2314
|
if (this.full) {
|
|
2315
2315
|
this.askAbout = true // the dialog shows what it's about (the diff, the command) above the choices
|
|
2316
2316
|
try {
|
package/src/update.js
CHANGED
|
@@ -31,6 +31,16 @@ export async function checkUpdate() {
|
|
|
31
31
|
return { current: VERSION, latest, newer: Boolean(latest) && newer(latest, VERSION) }
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
// The version installed on disk now: newer than VERSION when HeartCode was updated while this one
|
|
35
|
+
// runs (it keeps the code it started with until it's restarted)
|
|
36
|
+
export function installedVersion() {
|
|
37
|
+
try {
|
|
38
|
+
return JSON.parse(fs.readFileSync(path.join(PKG, 'package.json'), 'utf8')).version
|
|
39
|
+
} catch {
|
|
40
|
+
return null
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
// How HeartCode was installed: 'git' (a checkout, linked), or the package manager that put it there.
|
|
35
45
|
export function installKind() {
|
|
36
46
|
if (fs.existsSync(path.join(PKG, '.git')) || !PKG.split(path.sep).includes('node_modules')) return 'git'
|