@nanhara/hara 0.0.2 → 0.33.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +431 -0
  2. package/CLA.md +1 -1
  3. package/README.md +199 -10
  4. package/dist/activity.js +30 -0
  5. package/dist/agent/loop.js +184 -0
  6. package/dist/config.js +114 -0
  7. package/dist/context/agents-md.js +64 -0
  8. package/dist/context/mentions.js +90 -0
  9. package/dist/diff.js +103 -0
  10. package/dist/fs-walk.js +103 -0
  11. package/dist/fuzzy.js +62 -0
  12. package/dist/images.js +146 -0
  13. package/dist/index.js +1362 -0
  14. package/dist/mcp/client.js +54 -0
  15. package/dist/md.js +52 -0
  16. package/dist/memory/guard.js +51 -0
  17. package/dist/memory/store.js +93 -0
  18. package/dist/org/planner.js +155 -0
  19. package/dist/org/roles.js +140 -0
  20. package/dist/org/router.js +39 -0
  21. package/dist/plugins/plugins.js +124 -0
  22. package/dist/providers/anthropic.js +83 -0
  23. package/dist/providers/openai.js +125 -0
  24. package/dist/providers/qwen-oauth.js +139 -0
  25. package/dist/providers/types.js +2 -0
  26. package/dist/recall.js +76 -0
  27. package/dist/sandbox.js +78 -0
  28. package/dist/search/embed.js +42 -0
  29. package/dist/search/hybrid.js +38 -0
  30. package/dist/search/semindex.js +141 -0
  31. package/dist/session/store.js +95 -0
  32. package/dist/skills/skills.js +141 -0
  33. package/dist/statusbar.js +69 -0
  34. package/dist/tools/agent.js +26 -0
  35. package/dist/tools/apply-core.js +63 -0
  36. package/dist/tools/builtin.js +106 -0
  37. package/dist/tools/codebase.js +102 -0
  38. package/dist/tools/computer.js +236 -0
  39. package/dist/tools/edit.js +62 -0
  40. package/dist/tools/memory.js +147 -0
  41. package/dist/tools/patch.js +123 -0
  42. package/dist/tools/registry.js +18 -0
  43. package/dist/tools/search.js +176 -0
  44. package/dist/tools/skill.js +30 -0
  45. package/dist/tools/web.js +73 -0
  46. package/dist/tui/App.js +165 -0
  47. package/dist/tui/InputBox.js +208 -0
  48. package/dist/tui/run.js +10 -0
  49. package/dist/tui/theme.js +11 -0
  50. package/dist/ui.js +17 -0
  51. package/dist/undo.js +40 -0
  52. package/dist/vision.js +81 -0
  53. package/package.json +32 -8
  54. package/LICENSE-MIT +0 -21
  55. package/bin/hara.mjs +0 -25
  56. /package/{LICENSE-APACHE → LICENSE} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,431 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@nanhara/hara`.
4
+
5
+ > Versioning (pre-1.0, SemVer-style): the **minor** (middle) number bumps for a **new feature**; the
6
+ > **patch** (last) number bumps for **optimizations/fixes of existing features**.
7
+
8
+ ## 0.33.0 — unreleased (semantic recall + memory)
9
+
10
+ - **`recall` and `memory_search` go hybrid too.** The semantic layer added in 0.32 now also powers your
11
+ code-asset library and durable memory — `hara index --assets` embeds `~/.hara/code-assets`, global skills,
12
+ and `~/.hara/memory` into `assets` + `memory` indexes. `hara recall`, `/recall`, and the `memory_search` tool
13
+ then blend meaning-based hits with lexical (semantic leads, lexical fills, deduped by path).
14
+ - **`hara index [--repo|--assets|--all]`** — `--repo` (default) for `codebase_search`, `--assets` for recall +
15
+ memory, `--all` for everything. Each index is still a self-`.gitignore`d derived artifact; `hara doctor` lists
16
+ which of `repo / assets / memory` are built.
17
+ - **Lexical stays the default everywhere** — with no index/embedder, recall and memory behave exactly as before.
18
+ Capture/dedup (`skill_create`) stays purely lexical by design (saving shouldn't depend on an embedding model).
19
+ - Verified end-to-end with local `bge-m3`: "retrying a request that failed" → a backoff snippet; "how do I ship
20
+ a release" → the deploy note — both matched by meaning, not keywords.
21
+ - **License simplified to Apache-2.0** (from `MIT OR Apache-2.0`). Apache-2.0 adds an explicit patent grant +
22
+ trademark protection — the right fit for a company-backed tool with a commercial future, and matches the peer
23
+ norm (Codex, Goose). `LICENSE-MIT` removed; `LICENSE-APACHE` → `LICENSE`.
24
+
25
+ ## 0.32.0 — unreleased (semantic search for `codebase_search`)
26
+
27
+ - **Opt-in semantic index — `hara index`.** `codebase_search` (the "this repo is a knowledge base" tool) can
28
+ now blend **meaning-based** results with its lexical ranking. Build the index once with `hara index`; queries
29
+ then find the right file even when they share no keywords with the code (e.g. "read an image pasted from the
30
+ clipboard" → `src/images.ts`).
31
+ - **Zero new dependency, lexical stays the default.** The store is a built-in JSON cosine index (fine for repo /
32
+ code-asset scale); when no index or embedding provider is configured, `codebase_search` is exactly as before.
33
+ No native vector DB is required (zvec remains the documented scale-up path).
34
+ - **Bring your own embeddings**: `hara config set embedProvider ollama` (local & offline — e.g. `bge-m3`,
35
+ `nomic-embed-text`), `qwen` (DashScope `text-embedding-v3`), or any OpenAI-compatible `/embeddings` endpoint
36
+ (`embedModel` / `embedBaseURL` / `embedApiKey`). Embeddings never run unless you opt in.
37
+ - The index is a **derived, rebuildable artifact** — written under `.hara/index/` with a self-`.gitignore` so it
38
+ can never be committed (it may embed file contents). `hara doctor` shows the search/semantic/index state.
39
+
40
+ ## 0.31.0 — unreleased (native screen control)
41
+
42
+ - **`computer` tool — operate desktop software, not just the browser.** Screenshot → read → click / move /
43
+ type / press keys at coordinates. Native shell-out per OS (no heavy deps): macOS `screencapture` + `cliclick`,
44
+ Windows PowerShell (.NET / user32, built-in), Linux `scrot` + `xdotool`.
45
+ - **Strict, opt-in safety**: `computerUse: off|read|click|full` (default **off**) gates capability tiers;
46
+ `computerApps` is a frontmost-window **allowlist** checked before any click/type (the key guard against
47
+ wrong-window actions); a **dangerous-key blocklist** (cmd+q, ctrl+alt+del…); and a **once-per-session grant**
48
+ (the `computer` tool kind always confirms once, even in full-auto).
49
+ - Screenshots are **read via the vision sidecar** (a screenshot is described to text) so a text-only main
50
+ model can still act on what's on screen. `hara doctor` shows the tier, per-OS backend availability, and the
51
+ app allowlist.
52
+
53
+ ## 0.30.1 — unreleased
54
+
55
+ - Capture honors `assetCapture`: in **ask** (default) the end-of-session distill now **prompts before saving**
56
+ each skill/memory — the "remind me to confirm" flow — instead of writing silently; **auto** stays silent;
57
+ **off** disables proactive capture. `hara doctor` shows the capture mode.
58
+
59
+ ## 0.30.0 — unreleased (codebase search — the repo as a knowledge base)
60
+
61
+ - **`codebase_search`** — the current project is now a searchable knowledge base. Relevance-ranked **lexical**
62
+ search over the repo's code/text (respects `.gitignore` via `listProjectFiles`), returning the top files +
63
+ their densest snippet (`file:line`). Distinct from `grep` (exact pattern): the agent finds *related* code
64
+ from a natural-language query ("where's auth handled?") while working. Zero new deps; it's the interface a
65
+ semantic (zvec) index slots into later.
66
+
67
+ ## 0.29.0 — unreleased (asset capture & curation — phase 1)
68
+
69
+ - **Unified asset search** (the fix that enables the rest): `recall` / `searchAssets` now cover **skills +
70
+ code-assets** as one corpus — they were disconnected, so agent-saved skills were invisible to recall (and
71
+ dedup was impossible).
72
+ - **`skill_create` is now curated capture:**
73
+ - **`scope`** — `project` (this repo's `.hara/skills`) or `personal` (`~/.hara/skills`, default). Sharing to
74
+ company / public stays a separate, human-confirmed step.
75
+ - **Sanitize on save** — secrets are **redacted** to typed placeholders (`<REDACTED:sk-key>`…) rather than
76
+ blocking the whole save; local identifiers are generalized (`<project>` / `~` / `<email>`); injection
77
+ phrases are still hard-blocked.
78
+ - **Dedup signal** — searches the unified corpus before saving and flags a near-duplicate so you update
79
+ instead of piling up.
80
+ - **`assetCapture: off | ask | auto`** gates proactive end-of-session capture (the distill turn).
81
+ - `guard.ts` gains `redactSecrets()` / `scrubLocal()` — redact on the way in; `scanMemory` still blocks on load.
82
+
83
+ ## 0.28.0 — unreleased (plugins)
84
+
85
+ - **Plugins** — a distribution unit bundling skills + roles + MCP servers; it owns nothing at runtime, the
86
+ existing loaders pick its contents up. Manifest is **Claude-Code-compatible** (`.claude-plugin/plugin.json`,
87
+ `.hara-plugin/plugin.json`, or bare `plugin.json`) so hara can consume community plugins.
88
+ - `hara plugin add file:<path> | github:<owner/repo> | git:<url>` installs into `~/.hara/plugins/<name>`;
89
+ `hara plugin` lists; `hara plugin enable/disable/remove`. Enabled plugins' skills/roles/MCP auto-contribute
90
+ (lowest precedence — project & global override). `hara doctor` shows them.
91
+ - **Claude-Code subagent interop**: `.claude/agents/*.md` load as roles (`tools:` → allowTools).
92
+
93
+ ## 0.27.0 — unreleased (skills)
94
+
95
+ - **Skills** — agentskills.io-standard reusable capabilities at `~/.hara/skills/<name>/SKILL.md` (+ project
96
+ `.hara/skills`). The system prompt lists each skill (id + description); the agent calls the new **`skill`**
97
+ tool to load a skill's full instructions on demand — progressive disclosure (the body returns as a tool
98
+ result, keeping the prompt cache stable). `context: fork` runs the skill as a sub-agent; `allowed-tools` /
99
+ `when_to_use` / `paths` / `user-invocable` frontmatter supported (Claude-Code-compatible).
100
+ - **`skill_create`** replaces `playbook_save` — the agent saves a reusable how-to as a real SKILL.md (lexical
101
+ guard scans it). Playbooks are now just the agent-authored corner of the one skills system.
102
+ - **`hara skills` / `hara skills init`**, plus `/skills` (list) and `/skill <id>` (load into your next
103
+ message). `hara doctor` lists your skills. Reuses the existing recall lexical engine — no new deps.
104
+
105
+ ## 0.26.0 — unreleased (inline image tokens + session UUID & auto-name)
106
+
107
+ - **Pasted images are inline `[Image #N]` tokens** (Claude Code / codex style) — highlighted in the input
108
+ where you paste, carried inline in the message; **backspace over a token removes it + its attachment**
109
+ (and renumbers the rest). Replaces the chip experiment (a desktop-GUI pattern) with the terminal-native
110
+ one both reference tools use.
111
+ - **Sessions now have a full UUID** (was an 8-char stub) + an **auto-summarized name** from the first
112
+ message that's **language-aware (keeps CJK)** — a Chinese first line names the session meaningfully
113
+ instead of a random word; it never shows "new session" (falls back to the short id).
114
+ - Startup header shows `session <uuid>`; the top border shows the name (or short id); `/sessions` + `/name`
115
+ show the short id / full UUID; **`--resume` accepts a short-id prefix**, not just the full UUID.
116
+
117
+ ## 0.25.0 — unreleased (vision UX polish + ground-truth capability map)
118
+
119
+ - **Header shows image routing at startup** — the banner now states whether the main model reads images
120
+ directly, routes them through a describer (`👁 glm-5 is text-only → images read by qwen3.7-plus`), or will
121
+ ask on first paste.
122
+ - **Cleaner paste** — a pasted/dragged image is a 🖼 **chip** below the prompt (no more `[Image #N]` token in
123
+ your text); the input stays clean, you can submit an image with no text, and **backspace on empty input
124
+ removes the last attachment** (cc-haha style).
125
+ - **Capability map corrected to the Alibaba Coding Plan** (ground truth): `qwen3.5/3.6/3.7-plus` + `kimi-k2.5`
126
+ → vision; `qwen3-max`, `qwen3-coder-*`, `glm-5`, `glm-4.7`, `MiniMax-M2.5` → text-only. So `glm-5` no longer
127
+ hits the "unknown" prompt — it routes straight to the describer.
128
+ - **Hardening** (expert review): `/vision` is now one implementation shared by both REPLs; setting a
129
+ non-vision describer warns; `/model` resets the describer cache + reminder; Esc during describe reads as
130
+ "cancelled" not "failed".
131
+
132
+ ## 0.24.1 — unreleased
133
+
134
+ - Capability map: recognize the Alibaba coding-plan **Qwen3 flagships** (`qwen3.x-plus` / `qwen3-max`) as
135
+ **vision-capable** — verified `qwen3.7-plus` accepts image input and describes/OCRs accurately. (As a
136
+ `visionModel` describer it already worked; this corrects its classification when used as the *main* model.)
137
+
138
+ ## 0.24.0 — unreleased (auto-detect vision capability)
139
+
140
+ - **Automatic** image routing — hara classifies the main model and decides each turn:
141
+ - vision-capable (Claude, gpt-4o, qwen-vl, glm-4v…) → image sent **inline**, describer suspended;
142
+ - text-only (DeepSeek, qwen-coder, glm-4-flash…) → image **auto-described** by `visionModel` into text,
143
+ or — if none set — a **reminder** to add one (`/vision <model>`);
144
+ - **unknown** model → hara **asks once** ("Can <model> see images? Yes / No / Skip") and remembers the
145
+ answer per-model.
146
+ - Built-in, extensible **capability map** (`classifyVision`) for the major families — Claude / GPT / Qwen /
147
+ GLM / DeepSeek / Gemini / Mistral / Llama / Kimi / Grok / Pixtral·Llava·InternVL.
148
+ - **`/vision <model>`** sets the describer in-place; **`/vision main yes|no|auto`** overrides/clears the
149
+ current model's detected capability (stored per-model in `modelVision`). `hara doctor` shows it.
150
+
151
+ ## 0.23.0 — unreleased (vision sidecar for text-only models)
152
+
153
+ - **Use pasted images with text-only models** (DeepSeek, coding models, …) via a configurable vision
154
+ **sidecar**: `hara config set visionModel <model>` (e.g. a `qwen-vl-*` on the same Alibaba plan) — hara
155
+ OCRs/describes each pasted image into text with that model, then your main model continues. Reuses the
156
+ main provider's endpoint + key; override with `visionBaseURL` / `visionApiKey` if vision lives elsewhere.
157
+ Unset = images go inline (needs a vision main model).
158
+ - The describe prompt is coding-tuned: verbatim transcription of text/code in fenced blocks, plus UI /
159
+ diagram / error description. `hara doctor` shows the vision status.
160
+
161
+ ## 0.22.0 — unreleased (image paste / vision)
162
+
163
+ - **Paste images into the prompt** (ink TUI) — **Ctrl+V** pastes an image from the OS clipboard (a
164
+ screenshot, or an image copied from a browser); **dragging an image file** into the terminal (or
165
+ pasting its path) attaches it too. Each shows as an `[Image #N]` token in the input with a 🖼 chip
166
+ below the box. Zero new deps — shells out to `osascript`/`sips` (macOS), `wl-paste`/`xclip` (Linux),
167
+ or PowerShell (Windows), the same posture as the sandbox.
168
+ - **Vision on every provider** — attachments are sent as image blocks: base64 `image` blocks for
169
+ Anthropic (Claude), `image_url` data-URLs for OpenAI-compatible endpoints (Qwen-VL / GLM-4V /
170
+ OpenAI). Use a vision-capable model. Oversized images are auto-downsized (macOS `sips`, ≤1568 px)
171
+ and capped at ~5 MB.
172
+ - Only image **paths** ride in the conversation/session JSON (sessions stay small); bytes are read +
173
+ base64-encoded at request time. `@image.png` mentions no longer inline binary — they hint to paste.
174
+ - 85 offline tests (clipboard capture, path detection, provider image blocks, TUI paste).
175
+
176
+ ## 0.21.2 — unreleased (memory everywhere)
177
+
178
+ - Memory now injects into **every execution mode** — `hara -p` one-shot, `hara org`, `hara plan` atoms,
179
+ and sub-agents — not only the interactive REPL (M1 had wired just the interactive turns).
180
+ - `hara doctor` / `/doctor` shows memory status + the `evolve` level.
181
+
182
+ ## 0.21.1 — unreleased (TUI command parity)
183
+
184
+ - Wire the missing slash commands into the default ink TUI: **`/compact`** (with the proactive pre-compact
185
+ flush + working-set distill), **`/sessions`**, **`/usage`**, **`/doctor`**, **`/roles`**, **`/approval [mode]`**.
186
+ (`runDoctor` now returns a string so both the classic REPL and the TUI can render it.) `/org` and `/plan`
187
+ remain `hara org`/`hara plan` subcommands.
188
+
189
+ ## 0.21.0 — unreleased (self-evolution · M2)
190
+
191
+ - **`playbook_save`** — the agent grows its own reusable playbooks (`~/.hara/code-assets/playbooks/<slug>.md`,
192
+ frontmatter + body), found later by `recall` / `memory_search`.
193
+ - **AGENTS.md self-refinement** — the agent may propose AGENTS.md edits via `edit_file`, reviewed through the
194
+ normal diff/approval gate (no new write path).
195
+ - **Guard** (`src/memory/guard.ts`) — a lexical scan on agent-written memory + playbooks blocks prompt-injection
196
+ phrases, secret-shaped tokens (`sk-…`/`AKIA…`/PEM/`ghp_…`), and `file://` URLs before they hit disk.
197
+ - **Session-end distill** — with `evolve: proactive` (default), `/exit` runs one reflection turn that persists
198
+ durable learnings via `memory_write` / `playbook_save`. Set `evolve: light` (no distill) or `off` to disable.
199
+ - 76 offline tests.
200
+
201
+ ## 0.20.0 — unreleased (memory + self-evolution · M1)
202
+
203
+ - **Long-term memory** — a lexical, file-backed store (no embeddings): global `~/.hara/memory/` + project
204
+ `<root>/.hara/memory/` (`MEMORY.md` / `USER.md` / daily logs). Tools: `memory_search`, `memory_get`,
205
+ `memory_write`, `memory_forget`. The agent recalls before answering about prior decisions and is nudged to
206
+ **proactively save** durable facts (conventions, your preferences, tricky solutions).
207
+ - **Injection** — a capped MEMORY/USER digest is added to the system prompt (frozen snapshot at session
208
+ start), reusing the `recall` lexical engine over the memory roots.
209
+ - **Short-term working memory** — `SessionMeta.workingSet` survives `/compact` (which used to wipe it) and
210
+ resume; `/compact` distills its summary into it.
211
+ - **Global roles** — `~/.hara/roles/*.md` (reusable personas) alongside project `.hara/roles/`; project wins
212
+ on name clash — the same global/project scoping as memory + config.
213
+ - 74 offline tests; zero new runtime deps. (M2 = playbooks + AGENTS.md self-refine + a guard + session-end distill.)
214
+
215
+ ## 0.19.0 — unreleased (plan mode + theme)
216
+
217
+ - **Plan mode** — a 4th `shift+tab` mode. hara goes **read-only** (`read_file`/`grep`/`glob`/`ls`/`web_fetch`),
218
+ investigates, and proposes a step-by-step plan; then a **selectable "proceed?"** prompt — *Yes, auto-apply
219
+ edits · Yes, approve each edit · No, keep planning* — flips the approval mode and executes the plan.
220
+ Matches codex (`Default`+`Plan`) / Claude Code.
221
+ - **Selectable prompts** — the tool-approval confirm and the plan-proceed share one `↑↓` / Enter / shortcut
222
+ select component; the input box stays visible underneath.
223
+ - **Theme switch** — `hara config set theme dark|light` (or `HARA_THEME`). Banner/accent is the brand
224
+ vermilion **#FF6B5C** on dark, **#C0392B** on light. Truecolor; chalk degrades on 256/16-color terminals.
225
+
226
+ ## 0.18.0 — unreleased (ink TUI)
227
+
228
+ - **New terminal UI — a real TUI (ink 6 + React 19).** The interactive REPL is now a **bordered input
229
+ box pinned at the bottom**: the session name sits in the top-right corner, and the approval modes +
230
+ token usage + concurrent-agent count live in the bottom border, with the conversation scrolling above.
231
+ Streaming assistant text, dim reasoning, tool calls, and colored diffs render as live blocks; a spinner
232
+ shows while a turn runs (**Esc** interrupts); tool-approval prompts appear inline (y/N); **shift+tab**
233
+ cycles the approval mode. Same approach Claude Code itself uses (ink). `HARA_TUI=0` falls back to the
234
+ classic readline REPL.
235
+ - The agent loop + tools now emit through a `UiSink` so output is rendered by ink (not raw stdout),
236
+ keeping the TUI uncorrupted; the plain path is unchanged when no sink is present (`-p`, pipes, sub-agents).
237
+ - TUI slash commands: `/help` `/tools` `/model` `/undo` `/recall` `/reset` `/exit` (others → `HARA_TUI=0`).
238
+
239
+ ## 0.17.1 — unreleased (status bar actually renders)
240
+
241
+ - **Fix: the status bar now shows.** The pinned-footer (v0.6) used a terminal scroll region that
242
+ doesn't compose with Node's `readline`, so it silently never rendered. It's now a status **header
243
+ printed above each prompt** — session · the three approval modes · tokens + ctx% · concurrent ops —
244
+ visible in any terminal. (True bottom-pinning needs a full TUI; deferred.) `HARA_FOOTER=0` hides it.
245
+
246
+ ## 0.17.0 — unreleased (doctor + command completion)
247
+
248
+ - **`hara doctor` / `/doctor`** — a setup health check: Node version, provider + model, whether auth
249
+ is configured (with a fix hint), config path, code-assets, roles, MCP servers. Diagnoses the common
250
+ "not authenticated / wrong model" pitfalls at a glance.
251
+ - **`/command` Tab-completion** — typing `/` (or `/mo`) + Tab completes slash-command names in the REPL.
252
+
253
+ ## 0.16.1 — unreleased (terminal UX polish)
254
+
255
+ - **`@<dir>` loads a directory** — mentioning a directory now attaches a listing of its files (the
256
+ agent can then read specific ones); previously `@dir` did nothing.
257
+ - **`@src/` Tab drills in** — completing a path that ends in `/` lists that folder's immediate
258
+ children (directories first), like a file picker.
259
+ - **Tool calls show their argument** — `↳ read_file src/x.ts`, `↳ bash npm test`, `↳ grep TODO`
260
+ instead of a bare tool name.
261
+ - **"working Ns" spinner** while a turn is in flight (cleared the moment output/reasoning streams).
262
+
263
+ ## 0.16.0 — unreleased (parallel sub-agents)
264
+
265
+ - **`agent` tool** — delegate an independent sub-task to a fresh sub-agent; spawn several in one turn
266
+ to run them **in parallel** (the footer's `⛁ N agents` count is now real). Sub-agents are read-only
267
+ by default (analysis/search/review/web), so they're safe to parallelize; pass a `role` id to use
268
+ that role's persona + tools. The agent loop gained a `quiet` mode so parallel sub-agents don't
269
+ interleave output — only their results return to the parent. Sub-agents can't recurse (no nested
270
+ fan-out).
271
+
272
+ ## 0.15.0 — unreleased (code-asset recall)
273
+
274
+ - **`hara recall "<query>"` / `/recall`** — a personal, git-versionable library of snippets/playbooks
275
+ at `~/.hara/code-assets` (override with `HARA_ASSETS`). Lexical search ranks `*.md` assets by
276
+ query-word matches; in the REPL `/recall` pulls the top matches into your **next message's context**.
277
+ `hara recall --init` scaffolds the directory with an example. Phase-C v0 — lexical-first (embeddings
278
+ deferred until proven necessary).
279
+
280
+ ## 0.14.1 — unreleased (planner: objective verify gate)
281
+
282
+ - **`hara plan` verify can run a command** — an atom may carry a `check` shell command; the verify
283
+ gate passes only if it exits 0 (objective), falling back to the LLM self-check when no `check` is
284
+ given. Makes plans trustworthy — e.g. `npm test`, `tsc --noEmit`, `test -f path`.
285
+
286
+ ## 0.14.0 — unreleased (web_fetch)
287
+
288
+ - **`web_fetch`** — fetch an `http(s)` URL and return its text (HTML reduced to readable text), for
289
+ pulling docs / references / pages into context. Read-only, follows redirects, 30s timeout,
290
+ size-capped. Not sandboxed (network egress is in-process, not via `bash`).
291
+
292
+ ## 0.13.0 — unreleased (context management)
293
+
294
+ - **`/compact`** — summarize the conversation so far into a brief and replace the history with it, to
295
+ free up context in long sessions (preserves goal, decisions, files changed, next steps).
296
+ - **Context budget warning** — after a turn, if the context reaches ≥80% of the model's window, hara
297
+ warns and suggests `/compact` / `/reset`. (The status bar already shows live `ctx %`.)
298
+
299
+ ## 0.12.0 — unreleased (rendered output + visible reasoning)
300
+
301
+ - **Markdown rendering** — assistant output renders in the terminal: headers, **bold**, `inline
302
+ code`, and bullets are styled; code fences pass through verbatim (copy-paste accurate). Line-buffered
303
+ streaming (`src/md.ts`); interactive terminal only — pipes/`-p` stay raw, disable with `HARA_MD=0`.
304
+ - **Reasoning/thinking display** — when a model streams reasoning (GLM-5 / DeepSeek `reasoning_content`,
305
+ or Anthropic thinking), hara shows it dimmed before the answer. Interactive terminal only.
306
+
307
+ ## 0.11.0 — unreleased (undo + live shell output)
308
+
309
+ - **`/undo`** — revert the last file change(s) made this session. Every edit tool
310
+ (`write_file`/`edit_file`/`apply_patch`) records the prior file state; `/undo` restores it (and
311
+ deletes files that were freshly created). In-session, up to 50 steps. (`src/undo.ts`)
312
+ - **Live bash output** — the `bash` tool now streams stdout/stderr **as the command runs**
313
+ (interactive terminal only) instead of waiting for completion. `runShell` rewritten on `spawn` with
314
+ an `onData` hook; the full output is still captured for the model.
315
+
316
+ ## 0.10.0 — unreleased (multi-file patches + interrupt)
317
+
318
+ - **`apply_patch`** — change several files in one **atomic** step (all-or-nothing). `changes` is an
319
+ array of `{path, type:'update'|'create'|'delete', edits?|content?}`; everything is validated and
320
+ computed in memory first, and **nothing is written if any change fails**. Shows a diff per file.
321
+ Prefer it over multiple `edit_file` calls for multi-file work. (Shared edit core extracted to
322
+ `src/tools/apply-core.ts`, reused by `edit_file`.)
323
+ - **Esc interrupts a running turn** — press Esc while the agent is working to abort the in-flight
324
+ request and return to the prompt (the session is kept). Plumbed via `AbortSignal` through both
325
+ providers; an interrupt renders as a dim `(interrupted)`, not an error.
326
+
327
+ ## 0.9.0 — unreleased (daily-driver polish: streaming + diffs)
328
+
329
+ - **Streaming for OpenAI-compatible providers** — Qwen/GLM/OpenAI now stream tokens live (the whole
330
+ response used to appear at once). Tool calls are accumulated from the stream by index, and usage is
331
+ read from the final chunk (`stream_options.include_usage`). Anthropic already streamed.
332
+ - **Diff display on edits** — after `edit_file`/`write_file`, hara prints a colored unified diff
333
+ (`◇ path +N -M` with `+`/`-` lines) so you see exactly what changed. Zero-dependency line diff
334
+ (`src/diff.ts`); shown in an interactive terminal only (pipes/scripts stay clean).
335
+ - **Sturdier retries** — both SDK clients now retry transient errors (429/5xx/network) up to 4×.
336
+
337
+ ## 0.8.0 — unreleased (atomization planner — the org plans, not just routes)
338
+
339
+ - **`hara plan "<task>"` / `/plan`** — decompose a task into atoms, sequence them as a DAG, then
340
+ execute each step (optionally routed to a role) behind a **verify gate**. This is the execution
341
+ methodology made real: frame → atomize → sequence → execute → verify.
342
+ - **Planner** (`src/org/planner.ts`): `decompose` (LLM → atoms + deps), `topoOrder` (Kahn ordering +
343
+ cycle detection), per-atom `verify` (checks the step's done-criteria), and an SSOT plan state at
344
+ `.hara/org/plan.json` — inspectable, and execution stops on the first failed verification.
345
+ - Atoms may carry a `role`, so the planner routes steps to the org's role-agents
346
+ (implementer/reviewer/docs) with their persona, tool subset, and model.
347
+
348
+ ## 0.7.0 — unreleased (fuzzy matching + did-you-mean)
349
+
350
+ - **Fuzzy `@file` completion** — `@path` now ranks by a built-in subsequence fuzzy matcher (zero new
351
+ deps): `@idx` finds `src/index.ts`, `@sc` finds `src/`. Handles insertions/skips (not transpositions).
352
+ - **Path did-you-mean** — when `read_file`/`edit_file` get a path that doesn't exist, the error now
353
+ suggests the nearest real project files ("Did you mean: src/index.ts?") instead of just failing.
354
+ - **Slash-command did-you-mean** — a mistyped command suggests the closest one ("`/modl` → Did you
355
+ mean /model?").
356
+ - New `src/fuzzy.ts` (`fuzzyScore`/`fuzzyRank`/`nearest`) + `nearestPaths` in `fs-walk.ts`.
357
+
358
+ ## 0.6.0 — unreleased (CLI UX + search tools)
359
+
360
+ - **Status bar** — a persistent footer pinned below the REPL transcript (terminal scroll region):
361
+ session name · the three approval modes with the current one highlighted · live token usage + ctx% ·
362
+ a concurrent-operation count (`⛁ N`). TTY-only; degrades to the plain after-turn status line when
363
+ piped. Disable with `HARA_FOOTER=0`.
364
+ - **Approval mode switching** — bare `/approval` now cycles suggest → auto-edit → full-auto (still
365
+ `/approval <mode>` to set); **shift+tab** cycles it from anywhere (TTY).
366
+ - **Search tools** — `grep` (regex across files, `path:line: text`), `glob` (`**`/`*`/`?` path
367
+ patterns), `ls` (one directory). All read-only, so they never prompt and run in parallel.
368
+ - **Parallel safe-tool execution** — read-only tool calls in a turn now run concurrently (edit/exec
369
+ still run alone, in order); the footer's `⛁` count reflects live concurrency.
370
+ - **`edit_file` hardened** — accepts multiple `edits` applied in order, and falls back to
371
+ quote-insensitive matching (straight ↔ curly) when an exact match isn't found.
372
+ - **`@file` completion fixed** — now walks subdirectories (git-tracked + untracked, or a filesystem
373
+ walk outside git), drills into directories (`@src/…`), and works in non-git projects. Previously it
374
+ only consulted `git ls-files` and silently returned nothing otherwise.
375
+
376
+ ## 0.5.0 — unreleased (Phase 2: governed role-agent org — the differentiator)
377
+
378
+ - **Roles** — markdown role-agents in `.hara/roles/*.md` (frontmatter: `name`, `description`, `owns[]`,
379
+ `rejects[]`, `model?`, `allowTools[]`/`denyTools[]`; body = persona). `hara roles` lists, `hara roles init` scaffolds.
380
+ - **Dispatcher** — `hara org "<task>"` routes a task to the role that **owns** it (keyword match → LLM
381
+ fallback), or `--role <id>` to force one; runs that role's agent with its persona, tool subset, and model.
382
+ `/org` and `/roles` in the REPL.
383
+ - hara now runs like an engineering org, not a single agent — a read-only `reviewer` vs an editing
384
+ `implementer`, each owning its slice of the work.
385
+
386
+ ## 0.4.0 — unreleased (Tier-3)
387
+
388
+ - **Sessions & resume** — conversations saved under `~/.hara/sessions`; `-c`/`--continue` resumes the latest
389
+ in the cwd, `--resume <id>` a specific one, `hara sessions` / `/sessions` list them.
390
+ - **MCP client** — connect stdio MCP servers via an `mcpServers` map in config (global or project);
391
+ their tools register as `mcp__<server>__<tool>` and become available to the agent.
392
+ - **OS sandboxing** — `--sandbox` / `config set sandbox` (`off` | `workspace-write` | `read-only`): the
393
+ `bash` tool runs under macOS Seatbelt — workspace-write confines writes to the project (+ temp),
394
+ read-only blocks writes. Non-macOS runs unsandboxed (the approval gate still applies).
395
+
396
+ ## 0.3.0 — unreleased (Tier-2 coding-CLI polish)
397
+
398
+ - **Approval modes** — `suggest` (confirm edits & shell), `auto-edit` (auto file edits, confirm shell),
399
+ `full-auto` (no prompts). Set via `--approval`, `hara config set approval`, or `/approval`; `-y` = full-auto.
400
+ - **Slash-command registry** — `/help` `/init` `/tools` `/model` `/approval` `/usage` `/reset` `/exit`,
401
+ data-driven (auto-listed in `/help`).
402
+ - **Config profiles & project config** — named `profiles` in `~/.hara/config.json` (`--profile` /
403
+ `HARA_PROFILE`), plus a project-level `.hara/config.json` that overrides the global config.
404
+ - **Status line** — model + cumulative token usage (`↑in ↓out`) after each turn and in `-p` output;
405
+ `/usage` shows it on demand.
406
+
407
+ ## 0.2.0 — unreleased (coding-CLI features, borrowed from Codex)
408
+
409
+ - **Project context (`AGENTS.md`)** — auto-loaded each run (walks up to the project root, concatenates,
410
+ 32 KiB cap). On first run in a project with no `AGENTS.md`, hara offers to analyze the repo and write
411
+ one; `hara init` / `/init` (re)generate it. Uses the cross-tool `AGENTS.md` standard.
412
+ - **`@file` mentions** — `@path` in the REPL or `-p` attaches that file's contents to your message;
413
+ Tab-completes `@paths` from `git ls-files`.
414
+ - **`edit_file` tool** — surgical exact-string edits to existing files (unique-match guard / `replace_all`),
415
+ instead of overwriting whole files with `write_file`. Behind the same confirm gate.
416
+
417
+ ## 0.1.0 — unreleased (first functional release)
418
+
419
+ - Streaming **agentic loop** with a manual tool-use cycle.
420
+ - Built-in tools: `read_file`, `write_file`, `bash`, with a **human-in-the-loop confirmation gate**
421
+ on the dangerous ones (`write_file`, `bash`) unless `-y` is passed.
422
+ - Interactive **REPL** (`/help`, `/tools`, `/model`, `/reset`, `/exit`), one-shot `-p` mode, `-y`/`-m` flags.
423
+ - **Multi-provider**: Anthropic (Claude — streaming + adaptive thinking) and any OpenAI-compatible
424
+ endpoint (Qwen/DashScope, GLM, Kimi, OpenAI) via a provider-neutral conversation core.
425
+ - **`hara config`** (`provider` / `apiKey` / `model` / `baseURL`) → `~/.hara/config.json`; env vars override.
426
+ - Offline **test suite** for the built-in tools.
427
+ - Dual-licensed **MIT OR Apache-2.0**; CLA in place.
428
+
429
+ ## 0.0.2
430
+
431
+ - Placeholder package reserving `@nanhara/hara` on npm (dual MIT/Apache + CLA, functional stub).
package/CLA.md CHANGED
@@ -26,7 +26,7 @@ agree that:
26
26
 
27
27
  3. **Right to relicense.** You agree the Maintainer may license Your
28
28
  contributions to third parties under the Project's then-current open-source
29
- license(s) (**MIT OR Apache-2.0**) **and** under separate terms, including
29
+ license (**Apache-2.0**) **and** under separate terms, including
30
30
  commercial/proprietary licenses. This lets the Project sustain itself via an
31
31
  open-core model without re-contacting every contributor.
32
32