min-agent 0.5.1 → 0.6.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 +18 -18
- package/dist/cli.js +538 -12
- package/docs/API.md +6 -6
- package/package.json +6 -6
- package/skills/self-config/SKILL.md +4 -2
- package/skills/self-config/reference.md +4 -1
- package/dist/agent.js +0 -1388
- package/dist/assistant-stream.js +0 -131
- package/dist/cli/commands/chat.js +0 -13
- package/dist/cli/commands/ctx.js +0 -7
- package/dist/cli/commands/exec.js +0 -35
- package/dist/cli/commands/history.js +0 -58
- package/dist/cli/commands/index.js +0 -249
- package/dist/cli/commands/init.js +0 -18
- package/dist/cli/commands/mcp.js +0 -173
- package/dist/cli/commands/memory.js +0 -87
- package/dist/cli/commands/models.js +0 -21
- package/dist/cli/commands/permission.js +0 -12
- package/dist/cli/commands/rules.js +0 -33
- package/dist/cli/commands/sandbox.js +0 -13
- package/dist/cli/commands/serve.js +0 -9
- package/dist/cli/commands/setup.js +0 -56
- package/dist/cli/commands/shared.js +0 -25
- package/dist/cli/commands/skills.js +0 -119
- package/dist/cli/commands/think.js +0 -12
- package/dist/cli/commands/update.js +0 -7
- package/dist/cli/commands/write-config.js +0 -52
- package/dist/cli/errors.js +0 -36
- package/dist/cli/exec-prompt.js +0 -26
- package/dist/cli/option-helpers.js +0 -65
- package/dist/cli/program.js +0 -223
- package/dist/cli/setup/detect.js +0 -17
- package/dist/cli/setup/flags.js +0 -12
- package/dist/cli/setup/flow.js +0 -108
- package/dist/cli/setup/provider-form.js +0 -102
- package/dist/cli/setup/ui.js +0 -534
- package/dist/clipboard.js +0 -142
- package/dist/code-mode.js +0 -184
- package/dist/compaction.js +0 -644
- package/dist/config.js +0 -363
- package/dist/confirm.js +0 -172
- package/dist/context-window.js +0 -256
- package/dist/ctx-cli.js +0 -30
- package/dist/ctx.js +0 -80
- package/dist/doom-loop.js +0 -278
- package/dist/fetch-timeout.js +0 -152
- package/dist/http-approvals.js +0 -60
- package/dist/http.js +0 -119
- package/dist/instructions.js +0 -196
- package/dist/logger.js +0 -95
- package/dist/markdown.js +0 -259
- package/dist/mcp.js +0 -1036
- package/dist/memory-cli.js +0 -33
- package/dist/memory.js +0 -295
- package/dist/model-catalog.js +0 -285
- package/dist/ollama-model.js +0 -234
- package/dist/ollama-openai-bridge.js +0 -383
- package/dist/output.js +0 -76
- package/dist/paste-handler.js +0 -41
- package/dist/permission-cli.js +0 -40
- package/dist/plugins.js +0 -131
- package/dist/pricing.js +0 -119
- package/dist/provider.js +0 -63
- package/dist/question-format.js +0 -60
- package/dist/reasoning-stream.js +0 -158
- package/dist/sandbox-cli.js +0 -79
- package/dist/sandbox.js +0 -403
- package/dist/save-throttle.js +0 -45
- package/dist/scope.js +0 -23
- package/dist/serve/common.js +0 -425
- package/dist/serve/routes-chat.js +0 -367
- package/dist/serve/routes-mcp.js +0 -212
- package/dist/serve/routes-memory.js +0 -95
- package/dist/serve/routes-meta.js +0 -268
- package/dist/serve/routes-sessions.js +0 -61
- package/dist/serve/routes-skills.js +0 -70
- package/dist/serve.js +0 -138
- package/dist/sessions.js +0 -265
- package/dist/skills.js +0 -599
- package/dist/structured-output.js +0 -29
- package/dist/synthetic.js +0 -7
- package/dist/think-cli.js +0 -36
- package/dist/thinking-wire.js +0 -239
- package/dist/thinking.js +0 -166
- package/dist/title-gen.js +0 -55
- package/dist/token-display.js +0 -39
- package/dist/tool-display.js +0 -178
- package/dist/tool-output.js +0 -126
- package/dist/tools/apply_patch.js +0 -265
- package/dist/tools/atomic-file.js +0 -35
- package/dist/tools/backend.js +0 -61
- package/dist/tools/bash.js +0 -231
- package/dist/tools/code_search.js +0 -98
- package/dist/tools/edit.js +0 -68
- package/dist/tools/explore.js +0 -232
- package/dist/tools/glob.js +0 -40
- package/dist/tools/grep.js +0 -174
- package/dist/tools/index.js +0 -34
- package/dist/tools/question.js +0 -54
- package/dist/tools/read.js +0 -109
- package/dist/tools/search-searxng.js +0 -223
- package/dist/tools/search-serper.js +0 -189
- package/dist/tools/task.js +0 -165
- package/dist/tools/todo.js +0 -213
- package/dist/tools/web_fetch.js +0 -195
- package/dist/tools/web_search.js +0 -228
- package/dist/tools/write.js +0 -55
- package/dist/tui/App.js +0 -138
- package/dist/tui/ConfirmBar.js +0 -66
- package/dist/tui/CtxPicker.js +0 -68
- package/dist/tui/InputBar.js +0 -618
- package/dist/tui/MessageList.js +0 -718
- package/dist/tui/ModelPicker.js +0 -113
- package/dist/tui/QuestionBar.js +0 -136
- package/dist/tui/SessionPicker.js +0 -79
- package/dist/tui/Spinner.js +0 -6
- package/dist/tui/StatusBar.js +0 -22
- package/dist/tui/ThinkPicker.js +0 -75
- package/dist/tui/agent-runner.js +0 -223
- package/dist/tui/bracketed-paste.js +0 -37
- package/dist/tui/caret-pos.js +0 -179
- package/dist/tui/caret.js +0 -69
- package/dist/tui/click-count.js +0 -13
- package/dist/tui/diff-view.js +0 -61
- package/dist/tui/drag-state.js +0 -49
- package/dist/tui/hydrate.js +0 -129
- package/dist/tui/index.js +0 -264
- package/dist/tui/input-history.js +0 -125
- package/dist/tui/layout.js +0 -105
- package/dist/tui/mouse.js +0 -46
- package/dist/tui/overlay-input.js +0 -12
- package/dist/tui/paste-draft.js +0 -173
- package/dist/tui/prompt-queue.js +0 -24
- package/dist/tui/selection.js +0 -232
- package/dist/tui/session-switch.js +0 -28
- package/dist/tui/slash-commands.js +0 -129
- package/dist/tui/slash-handler.js +0 -615
- package/dist/tui/text-width.js +0 -113
- package/dist/tui/theme.js +0 -12
- package/dist/tui/token-info.js +0 -7
- package/dist/tui/tool-children.js +0 -19
- package/dist/tui/types.js +0 -1
- package/dist/tui/undo-stack.js +0 -14
- package/dist/tui/use-sgr-mouse.js +0 -29
- package/dist/tui-chat.js +0 -478
- package/dist/updater.js +0 -116
- package/dist/xml-search.js +0 -194
- package/docs/superpowers/plans/2026-08-16-batch1-tui-improvements.md +0 -1510
- package/docs/superpowers/plans/2026-08-16-batch2-cli-tools-api.md +0 -2105
- package/docs/superpowers/plans/2026-08-16-batch3-config-engineering.md +0 -1595
- package/docs/superpowers/plans/2026-08-16-input-caret.md +0 -782
- package/docs/superpowers/plans/2026-08-20-tui-completeness.md +0 -873
- package/docs/superpowers/plans/2026-08-20-unified-tui-default.md +0 -631
- package/docs/superpowers/plans/2026-08-23-cli-setup.md +0 -501
- package/docs/superpowers/plans/2026-08-23-input-paste-attachments.md +0 -475
- package/docs/superpowers/plans/2026-08-23-thinking-wire-profile.md +0 -450
- package/docs/superpowers/specs/2026-08-16-batch1-tui-improvements-design.md +0 -183
- package/docs/superpowers/specs/2026-08-16-batch2-cli-tools-api-design.md +0 -220
- package/docs/superpowers/specs/2026-08-16-batch3-config-engineering-design.md +0 -196
- package/docs/superpowers/specs/2026-08-16-input-caret-design.md +0 -63
- package/docs/superpowers/specs/2026-08-17-mouse-selection-design.md +0 -116
- package/docs/superpowers/specs/2026-08-20-config-http-alignment-design.md +0 -47
- package/docs/superpowers/specs/2026-08-20-mcp-plugins-alignment-design.md +0 -37
- package/docs/superpowers/specs/2026-08-20-sandbox-permissions-design.md +0 -68
- package/docs/superpowers/specs/2026-08-20-tui-completeness-design.md +0 -273
- package/docs/superpowers/specs/2026-08-20-unified-tui-default-design.md +0 -165
- package/docs/superpowers/specs/2026-08-23-cli-setup-design.md +0 -282
- package/docs/superpowers/specs/2026-08-23-input-paste-attachments-design.md +0 -174
- package/docs/superpowers/specs/2026-08-23-thinking-wire-profile-design.md +0 -140
package/dist/tui/ConfirmBar.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useState } from "react";
|
|
3
|
-
import { Box, Text, useInput } from "ink";
|
|
4
|
-
import { wrapByWidth } from "./text-width.js";
|
|
5
|
-
import { CONFIRM_CHROME_ROWS, footerMaxRows, innerTextWidth, sliceLineWindow } from "./layout.js";
|
|
6
|
-
import { theme } from "./theme.js";
|
|
7
|
-
export function confirmMessageLines(message, columns) {
|
|
8
|
-
const textWidth = innerTextWidth(columns);
|
|
9
|
-
return String(message ?? "")
|
|
10
|
-
.split("\n")
|
|
11
|
-
.flatMap((line) => wrapByWidth(line, textWidth));
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Terminal rows the confirm bar occupies, mirroring the JSX layout below.
|
|
15
|
-
* Capped so a huge permission payload cannot push [y]/[N] off the screen.
|
|
16
|
-
*/
|
|
17
|
-
export function confirmBarRows(message, columns, frameRowCount = 0) {
|
|
18
|
-
const natural = confirmMessageLines(message, columns).length + CONFIRM_CHROME_ROWS;
|
|
19
|
-
return Math.min(natural, footerMaxRows(frameRowCount, CONFIRM_CHROME_ROWS));
|
|
20
|
-
}
|
|
21
|
-
export function ConfirmBar({ message, onConfirm, columns, maxRows }) {
|
|
22
|
-
const lines = useMemo(() => confirmMessageLines(message, columns), [message, columns]);
|
|
23
|
-
const bodyMax = Math.max(0, maxRows - CONFIRM_CHROME_ROWS);
|
|
24
|
-
const [top, setTop] = useState(0);
|
|
25
|
-
const window = useMemo(() => sliceLineWindow(lines, bodyMax, top), [lines, bodyMax, top]);
|
|
26
|
-
const scrollable = window.above > 0 || window.below > 0;
|
|
27
|
-
useInput((input, key) => {
|
|
28
|
-
if (key.escape) {
|
|
29
|
-
onConfirm(false);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const hasEnter = key.return || /[\r\n]/.test(input);
|
|
33
|
-
const stripped = input
|
|
34
|
-
.replace(/[\r\n]+/g, "")
|
|
35
|
-
.trim()
|
|
36
|
-
.toLowerCase();
|
|
37
|
-
if (stripped === "y") {
|
|
38
|
-
onConfirm(true);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (stripped === "n" || (stripped === "" && hasEnter)) {
|
|
42
|
-
onConfirm(false);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (!scrollable)
|
|
46
|
-
return;
|
|
47
|
-
const view = Math.max(1, window.lines.length);
|
|
48
|
-
if (key.upArrow) {
|
|
49
|
-
setTop((t) => sliceLineWindow(lines, bodyMax, t - 1).start);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (key.downArrow) {
|
|
53
|
-
setTop((t) => sliceLineWindow(lines, bodyMax, t + 1).start);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (key.pageUp) {
|
|
57
|
-
setTop((t) => sliceLineWindow(lines, bodyMax, t - view).start);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (key.pageDown) {
|
|
61
|
-
setTop((t) => sliceLineWindow(lines, bodyMax, t + view).start);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, width: "100%", borderStyle: "round", borderColor: theme.confirmBorder, paddingX: 1, children: [_jsx(Box, { flexShrink: 0, children: _jsx(Text, { bold: true, color: theme.confirmBorder, wrap: "truncate-end", children: "\u26A0 \u8BF7\u6C42\u6267\u884C\u6743\u9650" }) }), bodyMax > 0 && (_jsxs(Box, { flexDirection: "column", height: bodyMax, overflow: "hidden", flexShrink: 0, width: "100%", children: [window.above > 0 && (_jsx(Box, { paddingLeft: 1, flexShrink: 0, children: _jsxs(Text, { color: theme.muted, dimColor: true, children: ["\u2026 \u4EE5\u4E0A ", window.above, " \u884C"] }) })), window.lines.map((line, i) => (_jsx(Box, { paddingLeft: 1, flexShrink: 0, children: _jsx(Text, { wrap: "truncate-end", children: line }) }, i))), window.below > 0 && (_jsx(Box, { paddingLeft: 1, flexShrink: 0, children: _jsxs(Text, { color: theme.muted, dimColor: true, children: ["\u2193 \u8FD8\u6709 ", window.below, " \u884C"] }) }))] })), _jsxs(Box, { marginTop: 1, flexShrink: 0, height: 1, overflow: "hidden", width: "100%", children: [_jsxs(Text, { bold: true, color: theme.confirmBorder, children: ["? \u662F\u5426\u5141\u8BB8\u6267\u884C\uFF1F", " "] }), _jsx(Text, { color: theme.success, children: "[y]" }), _jsx(Text, { color: theme.muted, children: " / " }), _jsx(Text, { color: theme.error, children: "[N]" })] })] }));
|
|
66
|
-
}
|
package/dist/tui/CtxPicker.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { Box, Text, useInput } from "ink";
|
|
4
|
-
import { getActiveProvider, loadConfig } from "../config.js";
|
|
5
|
-
import { CTX_CHOICES, ctxChoiceLabel, matchCtxLevel } from "../ctx.js";
|
|
6
|
-
import { formatTokenCount } from "../token-display.js";
|
|
7
|
-
import { shouldAcceptOverlayConfirm } from "./overlay-input.js";
|
|
8
|
-
import { theme } from "./theme.js";
|
|
9
|
-
export function ctxPickerRows() {
|
|
10
|
-
return 2 + 1 + 1 + CTX_CHOICES.length + 1;
|
|
11
|
-
}
|
|
12
|
-
function configuredTokens() {
|
|
13
|
-
const n = getActiveProvider(loadConfig())?.contextWindow;
|
|
14
|
-
if (typeof n === "number" && Number.isFinite(n) && n > 0)
|
|
15
|
-
return Math.floor(n);
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
function currentLabel() {
|
|
19
|
-
const tokens = configuredTokens();
|
|
20
|
-
if (tokens == null)
|
|
21
|
-
return ctxChoiceLabel("auto");
|
|
22
|
-
return matchCtxLevel(tokens) ?? formatTokenCount(tokens);
|
|
23
|
-
}
|
|
24
|
-
function markedChoice() {
|
|
25
|
-
const tokens = configuredTokens();
|
|
26
|
-
if (tokens == null)
|
|
27
|
-
return "auto";
|
|
28
|
-
return matchCtxLevel(tokens);
|
|
29
|
-
}
|
|
30
|
-
export function CtxPicker({ onSelect, onCancel }) {
|
|
31
|
-
const marked = markedChoice();
|
|
32
|
-
const [index, setIndex] = useState(() => {
|
|
33
|
-
const i = marked ? CTX_CHOICES.indexOf(marked) : -1;
|
|
34
|
-
return i >= 0 ? i : CTX_CHOICES.length - 1;
|
|
35
|
-
});
|
|
36
|
-
const armed = useRef(false);
|
|
37
|
-
const indexRef = useRef(index);
|
|
38
|
-
indexRef.current = index;
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
const timer = setTimeout(() => {
|
|
41
|
-
armed.current = true;
|
|
42
|
-
}, 0);
|
|
43
|
-
return () => clearTimeout(timer);
|
|
44
|
-
}, []);
|
|
45
|
-
useInput((input, key) => {
|
|
46
|
-
if (key.escape) {
|
|
47
|
-
onCancel();
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (key.downArrow) {
|
|
51
|
-
setIndex((i) => (i + 1) % CTX_CHOICES.length);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (key.upArrow) {
|
|
55
|
-
setIndex((i) => (i - 1 + CTX_CHOICES.length) % CTX_CHOICES.length);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (shouldAcceptOverlayConfirm(armed.current, key, input)) {
|
|
59
|
-
const picked = CTX_CHOICES[indexRef.current];
|
|
60
|
-
if (picked)
|
|
61
|
-
onSelect(picked);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, width: "100%", borderStyle: "round", borderColor: theme.pickerBorder, paddingX: 1, children: [_jsx(Box, { children: _jsx(Text, { bold: true, color: theme.pickerBorder, children: "\u9009\u62E9\u4E0A\u4E0B\u6587\u7A97\u53E3" }) }), _jsx(Box, { children: _jsxs(Text, { color: theme.muted, children: ["\u5F53\u524D: ", currentLabel()] }) }), CTX_CHOICES.map((choice, i) => {
|
|
65
|
-
const active = i === index;
|
|
66
|
-
return (_jsxs(Box, { children: [_jsx(Text, { color: active ? theme.accent : theme.muted, children: active ? "❯ " : " " }), _jsx(Text, { bold: active, color: active ? theme.accent : undefined, children: ctxChoiceLabel(choice) }), choice === marked && _jsx(Text, { color: theme.success, children: " \u2190 \u5F53\u524D" })] }, choice));
|
|
67
|
-
}), _jsx(Box, { children: _jsx(Text, { color: theme.muted, dimColor: true, wrap: "truncate-end", children: "\u2191\u2193 \u9009\u62E9 \u00B7 Enter \u786E\u8BA4 \u00B7 Esc \u53D6\u6D88" }) })] }));
|
|
68
|
-
}
|