min-agent 0.2.1 → 0.3.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.
- package/README.md +146 -18
- package/dist/agent.js +293 -408
- package/dist/assistant-stream.js +11 -7
- package/dist/cli.js +397 -139
- package/dist/clipboard.js +59 -23
- package/dist/code-mode.js +3 -3
- package/dist/compaction.js +182 -81
- package/dist/config.js +186 -35
- package/dist/confirm.js +55 -6
- package/dist/context-window.js +67 -54
- package/dist/doom-loop.js +19 -12
- package/dist/http.js +119 -0
- package/dist/instructions.js +51 -33
- package/dist/logger.js +66 -0
- package/dist/markdown.js +3 -44
- package/dist/mcp.js +547 -100
- package/dist/memory.js +48 -6
- package/dist/output.js +36 -27
- package/dist/paste-handler.js +3 -3
- package/dist/plugins.js +33 -6
- package/dist/pricing.js +119 -0
- package/dist/provider.js +17 -15
- package/dist/serve.js +658 -369
- package/dist/sessions.js +151 -13
- package/dist/skills.js +466 -76
- package/dist/synthetic.js +7 -0
- package/dist/title-gen.js +2 -1
- package/dist/tool-display.js +173 -0
- package/dist/tool-output.js +54 -45
- package/dist/tools/apply_patch.js +191 -0
- package/dist/tools/backend.js +61 -0
- package/dist/tools/bash.js +147 -70
- package/dist/tools/code_search.js +6 -5
- package/dist/tools/edit.js +23 -7
- package/dist/tools/explore.js +80 -12
- package/dist/tools/glob.js +3 -3
- package/dist/tools/grep.js +146 -14
- package/dist/tools/index.js +7 -7
- package/dist/tools/question.js +4 -22
- package/dist/tools/read.js +71 -11
- package/dist/tools/task.js +33 -20
- package/dist/tools/todo.js +83 -73
- package/dist/tools/web_fetch.js +150 -46
- package/dist/tools/web_search.js +706 -28
- package/dist/tools/write.js +13 -7
- package/dist/tui/App.js +40 -6
- package/dist/tui/ConfirmBar.js +24 -3
- package/dist/tui/InputBar.js +390 -45
- package/dist/tui/MessageList.js +533 -20
- package/dist/tui/ModelPicker.js +108 -0
- package/dist/tui/QuestionBar.js +104 -0
- package/dist/tui/StatusBar.js +19 -11
- package/dist/tui/agent-runner.js +103 -0
- package/dist/tui/caret-pos.js +134 -0
- package/dist/tui/caret.js +69 -0
- package/dist/tui/diff-view.js +61 -0
- package/dist/tui/drag-state.js +44 -0
- package/dist/tui/index.js +153 -24
- package/dist/tui/input-history.js +44 -0
- package/dist/tui/layout.js +17 -0
- package/dist/tui/mouse.js +46 -0
- package/dist/tui/selection.js +134 -0
- package/dist/tui/slash-commands.js +90 -0
- package/dist/tui/slash-handler.js +370 -0
- package/dist/tui/text-width.js +91 -0
- package/dist/tui/theme.js +12 -0
- package/dist/tui/undo-stack.js +14 -0
- package/dist/tui/use-sgr-mouse.js +27 -0
- package/dist/tui-chat.js +111 -331
- package/dist/updater.js +57 -0
- package/docs/API.md +160 -14
- package/docs/superpowers/plans/2026-08-16-batch1-tui-improvements.md +1510 -0
- package/docs/superpowers/plans/2026-08-16-batch2-cli-tools-api.md +2105 -0
- package/docs/superpowers/plans/2026-08-16-batch3-config-engineering.md +1595 -0
- package/docs/superpowers/plans/2026-08-16-input-caret.md +782 -0
- package/docs/superpowers/specs/2026-08-16-batch1-tui-improvements-design.md +183 -0
- package/docs/superpowers/specs/2026-08-16-batch2-cli-tools-api-design.md +220 -0
- package/docs/superpowers/specs/2026-08-16-batch3-config-engineering-design.md +196 -0
- package/docs/superpowers/specs/2026-08-16-input-caret-design.md +63 -0
- package/docs/superpowers/specs/2026-08-17-mouse-selection-design.md +116 -0
- package/package.json +7 -8
package/dist/assistant-stream.js
CHANGED
|
@@ -11,6 +11,12 @@ const THINKING_BLOCKS = [
|
|
|
11
11
|
];
|
|
12
12
|
/** Max tail to keep when looking for a partial opening tag. */
|
|
13
13
|
const PARTIAL_TAG_HOLD = 72;
|
|
14
|
+
/**
|
|
15
|
+
* If an opening tag never gets closed (truncated / misbehaving model), the
|
|
16
|
+
* buffer would grow without bound. Beyond this size, treat the remainder as
|
|
17
|
+
* thinking text and move on.
|
|
18
|
+
*/
|
|
19
|
+
const UNCLOSED_THINK_MAX = 16 * 1024;
|
|
14
20
|
function lower(s) {
|
|
15
21
|
return s.toLowerCase();
|
|
16
22
|
}
|
|
@@ -71,10 +77,6 @@ export class ThinkingBodySplitter {
|
|
|
71
77
|
this.buf = this.buf.slice(open.index);
|
|
72
78
|
}
|
|
73
79
|
const low = lower(this.buf);
|
|
74
|
-
if (!low.startsWith(open.tag.open)) {
|
|
75
|
-
this.buf = this.buf.slice(1);
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
80
|
const afterOpen = open.tag.open.length;
|
|
79
81
|
const closeRel = low.indexOf(open.tag.close, afterOpen);
|
|
80
82
|
if (closeRel < 0) {
|
|
@@ -82,6 +84,11 @@ export class ThinkingBodySplitter {
|
|
|
82
84
|
thinking += this.buf.slice(afterOpen);
|
|
83
85
|
this.buf = "";
|
|
84
86
|
}
|
|
87
|
+
else if (this.buf.length - afterOpen > UNCLOSED_THINK_MAX) {
|
|
88
|
+
thinking += this.buf.slice(afterOpen);
|
|
89
|
+
this.buf = "";
|
|
90
|
+
hadThinking = true;
|
|
91
|
+
}
|
|
85
92
|
break;
|
|
86
93
|
}
|
|
87
94
|
const inner = this.buf.slice(afterOpen, closeRel);
|
|
@@ -90,9 +97,6 @@ export class ThinkingBodySplitter {
|
|
|
90
97
|
this.buf = this.buf.slice(closeRel + open.tag.close.length);
|
|
91
98
|
}
|
|
92
99
|
// Strip leading newlines from display that follow a thinking block
|
|
93
|
-
if (hadThinking && display.length === 0 && this.buf.startsWith("\n")) {
|
|
94
|
-
// Will be handled on next feed
|
|
95
|
-
}
|
|
96
100
|
if (hadThinking) {
|
|
97
101
|
display = display.replace(/^\n+/, "");
|
|
98
102
|
}
|