mindweave 3.2.5 → 3.2.7

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 (42) hide show
  1. package/README.md +113 -113
  2. package/dist/cli/App.js +22 -10
  3. package/dist/cli/App.js.map +1 -1
  4. package/dist/cli/blockHeights.js +99 -3
  5. package/dist/cli/blockHeights.js.map +1 -1
  6. package/dist/cli/clipboard.js +67 -26
  7. package/dist/cli/clipboard.js.map +1 -1
  8. package/dist/cli/components/PromptInput.js +16 -0
  9. package/dist/cli/components/PromptInput.js.map +1 -1
  10. package/dist/cli/components/ToolLine.js +67 -5
  11. package/dist/cli/components/ToolLine.js.map +1 -1
  12. package/dist/cli/components/WorkGroup.js +2 -1
  13. package/dist/cli/components/WorkGroup.js.map +1 -1
  14. package/dist/cli/diffRows.js +112 -0
  15. package/dist/cli/diffRows.js.map +1 -0
  16. package/dist/cli/expandHits.js +4 -0
  17. package/dist/cli/expandHits.js.map +1 -1
  18. package/dist/cli/shellNotes.js +5 -0
  19. package/dist/cli/shellNotes.js.map +1 -1
  20. package/dist/cli/theme.js +16 -0
  21. package/dist/cli/theme.js.map +1 -1
  22. package/dist/cli/transcript.js +67 -12
  23. package/dist/cli/transcript.js.map +1 -1
  24. package/dist/tools/cdp.js +24 -0
  25. package/dist/tools/cdp.js.map +1 -1
  26. package/dist/tools/detail.js +114 -0
  27. package/dist/tools/detail.js.map +1 -1
  28. package/dist/tools/edit.js +12 -5
  29. package/dist/tools/edit.js.map +1 -1
  30. package/dist/tools/guard.js +5 -1
  31. package/dist/tools/guard.js.map +1 -1
  32. package/dist/tools/killTree.js +30 -8
  33. package/dist/tools/killTree.js.map +1 -1
  34. package/dist/tools/lineDiff.js +152 -0
  35. package/dist/tools/lineDiff.js.map +1 -0
  36. package/dist/tools/replaceSymbol.js +3 -3
  37. package/dist/tools/replaceSymbol.js.map +1 -1
  38. package/dist/tools/uiPage.js +294 -293
  39. package/dist/tools/uiPage.js.map +1 -1
  40. package/dist/tools/writeFile.js +20 -13
  41. package/dist/tools/writeFile.js.map +1 -1
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -1,113 +1,113 @@
1
- <h1 align="center">Mindweave</h1>
2
-
3
- <p align="center">
4
- A coding agent for your terminal.<br>
5
- You bring your own key. It runs on your machine. Nothing goes anywhere else.
6
- </p>
7
-
8
- <p align="center">
9
- <a href="LICENSE">Apache 2.0</a> &nbsp;•&nbsp;
10
- <a href="https://mindweavedev.netlify.app/">Website</a> &nbsp;•&nbsp;
11
- <a href="https://github.com/mindweave-cli/mwcode">Desktop app</a> &nbsp;•&nbsp;
12
- <a href="https://x.com/mindweavecli">X</a>
13
- </p>
14
-
15
- ---
16
-
17
- Mindweave works inside your repository: it reads, searches, edits, runs commands and
18
- checks its own work. There is no backend and no account. Your code and your key only
19
- ever go to the model provider you picked.
20
-
21
- Prompts are kept thin on purpose, so the context goes on your code rather than on
22
- scaffolding.
23
-
24
- Prefer a window to a terminal? [mwcode](https://github.com/mindweave-cli/mwcode) is the
25
- desktop app, built on the same engine, for Windows, macOS and Linux.
26
-
27
- ## Install
28
-
29
- Needs **Node.js 24+**. The npm package is tested on **Windows** and **Linux**. It has not
30
- been run on a real Mac yet, so on macOS the desktop app is the safe choice
31
- ([details](KNOWN-ISSUES.md)).
32
-
33
- ```bash
34
- npm install -g mindweave
35
- cd your-project
36
- mindweave # or mw
37
- ```
38
-
39
- It asks for an API key on first launch and keeps it in `~/.mindweave/.env`.
40
-
41
- From source:
42
-
43
- ```bash
44
- git clone https://github.com/mindweave-cli/mindweave
45
- cd mindweave
46
- npm install
47
- npm run build
48
- npm link
49
- ```
50
-
51
- ## What it does
52
-
53
- - **16 providers, 63 models** — DeepSeek, Anthropic, OpenAI, Gemini, xAI, Mistral, Groq, Cerebras,
54
- Qwen, Kimi, GLM, Meta, MiniMax, Tencent, OpenRouter, and local models through Ollama
55
- with no key at all. [PROVIDERS.md](src/drivers/PROVIDERS.md)
56
- - **Real tools** — file reads and edits, search, a shell with background jobs,
57
- sub-agents, web search, and a tool that tests your app by using it.
58
- - **Code intelligence** — tree-sitter and language servers index the repo in the
59
- background, at no token cost, and every edit comes back with that file's errors.
60
- - **Goals that run on their own** — `/marathon` takes a goal and keeps going until it is
61
- verified done, blocked, or out of budget.
62
- - **Memory** — project notes in MINDWEAVE.md, compaction that keeps what matters, and
63
- earlier sessions it can look back at.
64
- - **Safety nets** — `/undo`, `/rewind`, approval modes, per-project rules for paths
65
- and commands it must not touch, and a project's own servers and hooks never run unasked.
66
- - **MCP servers** — connect external tools with `/mcp`. [docs/MCP.md](docs/MCP.md)
67
-
68
- `/help` lists every command. `shift+tab` switches modes. Type while it works and your
69
- message queues.
70
-
71
- ## Your own rules and hooks
72
-
73
- Both live in your state folder (`~/.mindweave`, or `projects/<name>` inside it for one
74
- project), never in the repository, so a project you clone cannot add them.
75
-
76
- **`command-rules.md`** sets what Sentinel asks about, one line per rule, matched on the start
77
- of the command:
78
-
79
- ```
80
- allow npm test
81
- prompt git push
82
- forbid rm -rf :: use the trash folder
83
- ```
84
-
85
- `forbid` refuses the command in every mode and tells the agent your reason. `prompt` always
86
- asks. `allow` stops the question for that command, but never for one that writes a file or
87
- that Mindweave cannot read with certainty.
88
-
89
- **`hooks.json`** runs your own commands at set moments. Each gets one JSON object on its
90
- input, and exit code 2 stops the action and tells the agent why:
91
-
92
- ```json
93
- { "hooks": {
94
- "PreToolUse": [ { "matcher": "run_command|edit", "command": "node check.js" } ],
95
- "Stop": [ { "command": "npm test --silent" } ]
96
- } }
97
- ```
98
-
99
- The moments are `PreToolUse`, `PostToolUse`, `UserPromptSubmit`, `Stop` and `SessionStart`.
100
- A hook is stopped after 60 seconds unless it sets `timeoutMs`.
101
-
102
- ## More
103
-
104
- [CHANGELOG](CHANGELOG.md) · [Known issues](KNOWN-ISSUES.md) ·
105
- [Philosophy](PHILOSOPHY.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)
106
-
107
- Contributions are welcome, model drivers especially. Bug reports are the most useful
108
- thing you can send ([what to include](CONTRIBUTING.md#reporting-a-bug)). Questions:
109
- zallinimann@gmail.com
110
-
111
- ## License
112
-
113
- [Apache License 2.0](LICENSE)
1
+ <h1 align="center">Mindweave</h1>
2
+
3
+ <p align="center">
4
+ A coding agent for your terminal.<br>
5
+ You bring your own key. It runs on your machine. Nothing goes anywhere else.
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="LICENSE">Apache 2.0</a> &nbsp;•&nbsp;
10
+ <a href="https://mindweavedev.netlify.app/">Website</a> &nbsp;•&nbsp;
11
+ <a href="https://github.com/mindweave-cli/mwcode">Desktop app</a> &nbsp;•&nbsp;
12
+ <a href="https://x.com/mindweavecli">X</a>
13
+ </p>
14
+
15
+ ---
16
+
17
+ Mindweave works inside your repository: it reads, searches, edits, runs commands and
18
+ checks its own work. There is no backend and no account. Your code and your key only
19
+ ever go to the model provider you picked.
20
+
21
+ Prompts are kept thin on purpose, so the context goes on your code rather than on
22
+ scaffolding.
23
+
24
+ Prefer a window to a terminal? [mwcode](https://github.com/mindweave-cli/mwcode) is the
25
+ desktop app, built on the same engine, for Windows, macOS and Linux.
26
+
27
+ ## Install
28
+
29
+ Needs **Node.js 24+**. Every change is tested on **Windows**, **macOS** (Apple silicon) and
30
+ **Linux**. Driving a native desktop app and taking window screenshots are Windows-only for
31
+ now, and the rest of the limits are in [KNOWN-ISSUES.md](KNOWN-ISSUES.md).
32
+
33
+ ```bash
34
+ npm install -g mindweave
35
+ cd your-project
36
+ mindweave # or mw
37
+ ```
38
+
39
+ It asks for an API key on first launch and keeps it in `~/.mindweave/.env`.
40
+
41
+ From source:
42
+
43
+ ```bash
44
+ git clone https://github.com/mindweave-cli/mindweave
45
+ cd mindweave
46
+ npm install
47
+ npm run build
48
+ npm link
49
+ ```
50
+
51
+ ## What it does
52
+
53
+ - **16 providers, 63 models** — DeepSeek, Anthropic, OpenAI, Gemini, xAI, Mistral, Groq, Cerebras,
54
+ Qwen, Kimi, GLM, Meta, MiniMax, Tencent, OpenRouter, and local models through Ollama
55
+ with no key at all. [PROVIDERS.md](src/drivers/PROVIDERS.md)
56
+ - **Real tools** — file reads and edits, search, a shell with background jobs,
57
+ sub-agents, web search, and a tool that tests your app by using it.
58
+ - **Code intelligence** — tree-sitter and language servers index the repo in the
59
+ background, at no token cost, and every edit comes back with that file's errors.
60
+ - **Goals that run on their own** — `/marathon` takes a goal and keeps going until it is
61
+ verified done, blocked, or out of budget.
62
+ - **Memory** — project notes in MINDWEAVE.md, compaction that keeps what matters, and
63
+ earlier sessions it can look back at.
64
+ - **Safety nets** — `/undo`, `/rewind`, approval modes, per-project rules for paths
65
+ and commands it must not touch, and a project's own servers and hooks never run unasked.
66
+ - **MCP servers** — connect external tools with `/mcp`. [docs/MCP.md](docs/MCP.md)
67
+
68
+ `/help` lists every command. `shift+tab` switches modes. Type while it works and your
69
+ message queues.
70
+
71
+ ## Your own rules and hooks
72
+
73
+ Both live in your state folder (`~/.mindweave`, or `projects/<name>` inside it for one
74
+ project), never in the repository, so a project you clone cannot add them.
75
+
76
+ **`command-rules.md`** sets what Sentinel asks about, one line per rule, matched on the start
77
+ of the command:
78
+
79
+ ```
80
+ allow npm test
81
+ prompt git push
82
+ forbid rm -rf :: use the trash folder
83
+ ```
84
+
85
+ `forbid` refuses the command in every mode and tells the agent your reason. `prompt` always
86
+ asks. `allow` stops the question for that command, but never for one that writes a file or
87
+ that Mindweave cannot read with certainty.
88
+
89
+ **`hooks.json`** runs your own commands at set moments. Each gets one JSON object on its
90
+ input, and exit code 2 stops the action and tells the agent why:
91
+
92
+ ```json
93
+ { "hooks": {
94
+ "PreToolUse": [ { "matcher": "run_command|edit", "command": "node check.js" } ],
95
+ "Stop": [ { "command": "npm test --silent" } ]
96
+ } }
97
+ ```
98
+
99
+ The moments are `PreToolUse`, `PostToolUse`, `UserPromptSubmit`, `Stop` and `SessionStart`.
100
+ A hook is stopped after 60 seconds unless it sets `timeoutMs`.
101
+
102
+ ## More
103
+
104
+ [CHANGELOG](CHANGELOG.md) · [Known issues](KNOWN-ISSUES.md) ·
105
+ [Philosophy](PHILOSOPHY.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)
106
+
107
+ Contributions are welcome, model drivers especially. Bug reports are the most useful
108
+ thing you can send ([what to include](CONTRIBUTING.md#reporting-a-bug)). Questions:
109
+ zallinimann@gmail.com
110
+
111
+ ## License
112
+
113
+ [Apache License 2.0](LICENSE)
package/dist/cli/App.js CHANGED
@@ -76,7 +76,7 @@ import { isTight } from "./blockSpacing.js";
76
76
  import { parseScreenArg, screenChoices, screenNotice, startupMode } from "./screenMode.js";
77
77
  import { applyScreenMode } from "./screenShell.js";
78
78
  import { saveScreenMode } from "./screenStore.js";
79
- import { needsMeasure, pruneHeights } from "./blockHeights.js";
79
+ import { FULL_TAIL_BLOCKS, needsMeasure, pruneHeights, seedHeights } from "./blockHeights.js";
80
80
  import { expandableAt, hitBlock, hitItem } from "./expandHits.js";
81
81
  import { shellNote } from "./shellNotes.js";
82
82
  import { readFileSync, statSync } from "node:fs";
@@ -3761,15 +3761,27 @@ export function App({ resumeSessionId, initialScreen }) {
3761
3761
  // bottom — so in practice this prefix is everything but the last block or two.
3762
3762
  let known = 0;
3763
3763
  const knownHeights = [];
3764
- while (known < rendered.length) {
3765
- const block = rendered[known];
3766
- const entry = blockHeights.current.get(block.id);
3767
- // The identity check IS the invalidation: a block that changed is a new object, so
3768
- // its recorded height belongs to the version before the change.
3769
- if (entry === undefined || entry.block !== block)
3770
- break;
3771
- knownHeights.push(entry.height);
3772
- known++;
3764
+ const extendKnown = () => {
3765
+ while (known < rendered.length) {
3766
+ const block = rendered[known];
3767
+ const entry = blockHeights.current.get(block.id);
3768
+ // The identity check IS the invalidation: a block that changed is a new object, so
3769
+ // its recorded height belongs to the version before the change.
3770
+ if (entry === undefined || entry.block !== block)
3771
+ break;
3772
+ knownHeights.push(entry.height);
3773
+ known++;
3774
+ }
3775
+ };
3776
+ extendKnown();
3777
+ // A long conversation reopened has no heights at all, and laying every block out in full just to
3778
+ // learn them cost about a millisecond each: 28 seconds for a very long session, with nothing on the
3779
+ // screen until it was done. Only the newest few hundred are laid out now (they are the ones in view);
3780
+ // the older ones take an ESTIMATE that is marked as one, exactly as after a resize, and each is
3781
+ // measured for real the first time it comes near the window. See seedHeights.
3782
+ if (rendered.length - known > FULL_TAIL_BLOCKS) {
3783
+ seedHeights(blockHeights.current, rendered, known, width);
3784
+ extendKnown();
3773
3785
  }
3774
3786
  const win = virtualWindow(knownHeights, -chatOffset, chatRows);
3775
3787
  if (perfEnabled()) {