min-agent 0.3.0 → 0.4.1

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 (120) hide show
  1. package/README.md +154 -216
  2. package/dist/agent.js +1119 -256
  3. package/dist/cli/commands/chat.js +10 -0
  4. package/dist/cli/commands/exec.js +32 -0
  5. package/dist/cli/commands/history.js +58 -0
  6. package/dist/cli/commands/index.js +224 -0
  7. package/dist/cli/commands/init.js +18 -0
  8. package/dist/cli/commands/mcp.js +173 -0
  9. package/dist/cli/commands/memory.js +69 -0
  10. package/dist/cli/commands/models.js +21 -0
  11. package/dist/cli/commands/permission.js +12 -0
  12. package/dist/cli/commands/rules.js +33 -0
  13. package/dist/cli/commands/sandbox.js +13 -0
  14. package/dist/cli/commands/serve.js +9 -0
  15. package/dist/cli/commands/setup.js +4 -0
  16. package/dist/cli/commands/shared.js +16 -0
  17. package/dist/cli/commands/skills.js +119 -0
  18. package/dist/cli/commands/update.js +7 -0
  19. package/dist/cli/commands/write-config.js +30 -0
  20. package/dist/cli/errors.js +36 -0
  21. package/dist/cli/exec-prompt.js +26 -0
  22. package/dist/cli/option-helpers.js +53 -0
  23. package/dist/cli/program.js +180 -0
  24. package/dist/cli.js +5 -888
  25. package/dist/code-mode.js +32 -14
  26. package/dist/compaction.js +347 -160
  27. package/dist/config.js +119 -10
  28. package/dist/confirm.js +56 -9
  29. package/dist/context-window.js +107 -39
  30. package/dist/doom-loop.js +264 -29
  31. package/dist/fetch-timeout.js +152 -0
  32. package/dist/http-approvals.js +60 -0
  33. package/dist/instructions.js +21 -0
  34. package/dist/logger.js +33 -4
  35. package/dist/markdown.js +37 -11
  36. package/dist/mcp.js +328 -30
  37. package/dist/memory.js +97 -56
  38. package/dist/output.js +7 -5
  39. package/dist/permission-cli.js +43 -0
  40. package/dist/plugins.js +46 -8
  41. package/dist/pricing.js +4 -4
  42. package/dist/provider.js +23 -6
  43. package/dist/question-format.js +60 -0
  44. package/dist/sandbox-cli.js +82 -0
  45. package/dist/sandbox.js +403 -0
  46. package/dist/save-throttle.js +45 -0
  47. package/dist/serve/common.js +404 -0
  48. package/dist/serve/routes-chat.js +347 -0
  49. package/dist/serve/routes-mcp.js +212 -0
  50. package/dist/serve/routes-memory.js +66 -0
  51. package/dist/serve/routes-meta.js +205 -0
  52. package/dist/serve/routes-sessions.js +61 -0
  53. package/dist/serve/routes-skills.js +70 -0
  54. package/dist/serve.js +33 -883
  55. package/dist/sessions.js +53 -9
  56. package/dist/skills.js +82 -18
  57. package/dist/title-gen.js +8 -2
  58. package/dist/token-display.js +36 -0
  59. package/dist/tool-display.js +5 -0
  60. package/dist/tool-output.js +1 -3
  61. package/dist/tools/apply_patch.js +85 -11
  62. package/dist/tools/atomic-file.js +35 -0
  63. package/dist/tools/backend.js +2 -2
  64. package/dist/tools/bash.js +57 -19
  65. package/dist/tools/code_search.js +7 -1
  66. package/dist/tools/edit.js +11 -10
  67. package/dist/tools/explore.js +74 -14
  68. package/dist/tools/glob.js +4 -0
  69. package/dist/tools/grep.js +17 -10
  70. package/dist/tools/index.js +6 -21
  71. package/dist/tools/question.js +28 -9
  72. package/dist/tools/read.js +6 -4
  73. package/dist/tools/search-searxng.js +223 -0
  74. package/dist/tools/search-serper.js +189 -0
  75. package/dist/tools/task.js +84 -30
  76. package/dist/tools/todo.js +120 -19
  77. package/dist/tools/web_fetch.js +11 -3
  78. package/dist/tools/web_search.js +66 -556
  79. package/dist/tools/write.js +23 -6
  80. package/dist/tui/App.js +63 -14
  81. package/dist/tui/ConfirmBar.js +45 -13
  82. package/dist/tui/InputBar.js +150 -35
  83. package/dist/tui/MessageList.js +266 -125
  84. package/dist/tui/ModelPicker.js +8 -3
  85. package/dist/tui/QuestionBar.js +51 -19
  86. package/dist/tui/SessionPicker.js +79 -0
  87. package/dist/tui/StatusBar.js +8 -14
  88. package/dist/tui/agent-runner.js +142 -22
  89. package/dist/tui/caret-pos.js +48 -5
  90. package/dist/tui/caret.js +1 -1
  91. package/dist/tui/click-count.js +13 -0
  92. package/dist/tui/drag-state.js +8 -3
  93. package/dist/tui/hydrate.js +129 -0
  94. package/dist/tui/index.js +42 -13
  95. package/dist/tui/input-history.js +92 -11
  96. package/dist/tui/layout.js +75 -4
  97. package/dist/tui/prompt-queue.js +24 -0
  98. package/dist/tui/selection.js +113 -21
  99. package/dist/tui/session-switch.js +28 -0
  100. package/dist/tui/slash-commands.js +22 -6
  101. package/dist/tui/slash-handler.js +233 -58
  102. package/dist/tui/text-width.js +38 -16
  103. package/dist/tui/token-info.js +7 -0
  104. package/dist/tui/tool-children.js +19 -0
  105. package/dist/tui/undo-stack.js +1 -1
  106. package/dist/tui/use-sgr-mouse.js +3 -1
  107. package/dist/tui-chat.js +276 -40
  108. package/dist/updater.js +88 -29
  109. package/dist/xml-search.js +194 -0
  110. package/docs/API.md +257 -25
  111. package/docs/superpowers/plans/2026-08-20-tui-completeness.md +873 -0
  112. package/docs/superpowers/plans/2026-08-20-unified-tui-default.md +631 -0
  113. package/docs/superpowers/specs/2026-08-20-config-http-alignment-design.md +47 -0
  114. package/docs/superpowers/specs/2026-08-20-mcp-plugins-alignment-design.md +37 -0
  115. package/docs/superpowers/specs/2026-08-20-sandbox-permissions-design.md +68 -0
  116. package/docs/superpowers/specs/2026-08-20-tui-completeness-design.md +273 -0
  117. package/docs/superpowers/specs/2026-08-20-unified-tui-default-design.md +165 -0
  118. package/package.json +6 -1
  119. package/skills/self-config/SKILL.md +90 -0
  120. package/skills/self-config/reference.md +149 -0
package/dist/code-mode.js CHANGED
@@ -48,35 +48,47 @@ export function scanProject() {
48
48
  try {
49
49
  const pkg = JSON.parse(readFileSync(path.join(cwd, "package.json"), "utf-8"));
50
50
  const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
51
- if (allDeps["next"])
51
+ if (allDeps.next)
52
52
  framework = "Next.js";
53
- else if (allDeps["nuxt"])
53
+ else if (allDeps.nuxt)
54
54
  framework = "Nuxt";
55
55
  else if (allDeps["@angular/core"])
56
56
  framework = "Angular";
57
- else if (allDeps["vue"])
57
+ else if (allDeps.vue)
58
58
  framework = "Vue";
59
- else if (allDeps["react"])
59
+ else if (allDeps.react)
60
60
  framework = "React";
61
- else if (allDeps["svelte"])
61
+ else if (allDeps.svelte)
62
62
  framework = "Svelte";
63
- else if (allDeps["express"])
63
+ else if (allDeps.express)
64
64
  framework = "Express";
65
- else if (allDeps["fastify"])
65
+ else if (allDeps.fastify)
66
66
  framework = "Fastify";
67
- else if (allDeps["hono"])
67
+ else if (allDeps.hono)
68
68
  framework = "Hono";
69
- else if (allDeps["effect"])
69
+ else if (allDeps.effect)
70
70
  framework = "Effect";
71
71
  }
72
72
  catch { }
73
73
  }
74
74
  // Find entry files
75
75
  const entryPatterns = [
76
- "src/index.ts", "src/index.js", "src/main.ts", "src/main.js",
77
- "src/app.ts", "src/app.js", "index.ts", "index.js",
78
- "main.ts", "main.js", "app.ts", "app.js",
79
- "src/lib.rs", "main.go", "main.py", "app.py",
76
+ "src/index.ts",
77
+ "src/index.js",
78
+ "src/main.ts",
79
+ "src/main.js",
80
+ "src/app.ts",
81
+ "src/app.js",
82
+ "index.ts",
83
+ "index.js",
84
+ "main.ts",
85
+ "main.js",
86
+ "app.ts",
87
+ "app.js",
88
+ "src/lib.rs",
89
+ "main.go",
90
+ "main.py",
91
+ "app.py",
80
92
  ];
81
93
  for (const p of entryPatterns) {
82
94
  if (existsSync(path.join(cwd, p)))
@@ -134,9 +146,15 @@ export function buildCodeSystemPrompt(project, instructions) {
134
146
  "- Prefer editing existing files over creating new ones.",
135
147
  "- After making changes, run lint/typecheck/build if available.",
136
148
  "- NEVER commit unless explicitly asked.",
149
+ "- When the user asks to configure, install, or manage MCP servers, skills, rules, memory, permission, sandbox, providers, plugins, or other min-agent settings, follow the built-in `self-config` skill (already loaded). If its instructions are missing, load it with the skill tool before making changes.",
137
150
  "",
138
151
  "# Workflow",
139
- "- Use search tools (grep, glob) to understand the codebase before making changes.",
152
+ "- For greetings, thanks, or general chat with no concrete task, reply directly do not call any tools. The Project Structure below already covers the basics; do not re-explore the codebase just to answer a greeting.",
153
+ "- Use search tools (grep, glob) to understand the codebase before making changes, only once the user gives a concrete task.",
154
+ "- Use the search_web tool for live web search. Never emit XML tags such as <web_search>.",
155
+ "- After a few targeted web searches and fetching the best sources, stop researching and produce the requested output.",
156
+ "- Do not keep searching for completeness, extra models, or slightly better numbers. Mark uncertain dates or scores as estimates and move on.",
157
+ "- If the user asked for a file or other artifact, write it as soon as the required fields can be filled. Then stop.",
140
158
  "- Use the edit tool for precise changes instead of rewriting entire files.",
141
159
  "- When fixing bugs: read the relevant code, understand the issue, fix it, verify.",
142
160
  "- When adding features: explore existing patterns first, then implement consistently.",