min-agent 2.0.0 → 3.2.2609221209
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 +38 -2
- package/dist/cli.js +465 -475
- package/dist/web/assets/index-0DW9pnJc.js +113 -0
- package/dist/web/assets/index-Bb02wiVA.css +10 -0
- package/dist/web/favicon.svg +4 -0
- package/dist/web/index.html +22 -0
- package/package.json +6 -4
- package/skills/self-config/SKILL.md +15 -15
- package/skills/self-config/reference.md +11 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
|
+
Theme: GitHub Dark
|
|
3
|
+
Description: Dark theme as seen on github.com
|
|
4
|
+
Author: github.com
|
|
5
|
+
Maintainer: @Hirse
|
|
6
|
+
Updated: 2021-05-15
|
|
7
|
+
|
|
8
|
+
Outdated base version: https://github.com/primer/github-syntax-dark
|
|
9
|
+
Current colors taken from GitHub's CSS
|
|
10
|
+
*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root{--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;--bg: #f7f7f8;--surface: #ffffff;--surface-2: #f1f1f3;--surface-3: #e9e9ec;--border: #e3e3e7;--border-strong: #cfcfd6;--text: #1a1a1e;--text-2: #55555f;--text-3: #9a9aa4;--accent: #3b66e0;--accent-weak: rgba(59, 102, 224, .09);--accent-text: #2b52c4;--danger: #c73e3e;--danger-weak: rgba(199, 62, 62, .08);--ok: #2f8a4c;--warn: #b07a1f;--warn-weak: rgba(176, 122, 31, .09);--code-bg: #f4f4f6;--mark-bg: rgba(59, 102, 224, .14);--ring: rgba(59, 102, 224, .35);--shadow-pop: 0 8px 32px rgba(20, 20, 26, .1), 0 1px 3px rgba(20, 20, 26, .07);--radius: 8px;--radius-lg: 12px;--sidebar-w: 264px}:root[data-theme=dark]{--bg: #101013;--surface: #17171b;--surface-2: #1e1e23;--surface-3: #26262c;--border: #27272e;--border-strong: #3a3a44;--text: #e8e8ec;--text-2: #a2a2ad;--text-3: #6a6a76;--accent: #7396f0;--accent-weak: rgba(115, 150, 240, .12);--accent-text: #9cb4f5;--danger: #e06c6c;--danger-weak: rgba(224, 108, 108, .1);--ok: #5fb877;--warn: #d0a04a;--warn-weak: rgba(208, 160, 74, .12);--code-bg: #1c1c21;--mark-bg: rgba(115, 150, 240, .22);--ring: rgba(115, 150, 240, .4);--shadow-pop: 0 8px 32px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .4)}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;font-family:var(--font-sans);font-size:14px;line-height:1.6;color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button{font:inherit;color:inherit;background:none;border:none;padding:0;cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}input,textarea,select{font:inherit;color:inherit}::selection{background:var(--mark-bg)}:focus-visible{outline:2px solid var(--ring);outline-offset:1px;border-radius:4px}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border-strong);border:3px solid transparent;background-clip:content-box;border-radius:8px}::-webkit-scrollbar-track{background:transparent}.app{display:grid;grid-template-columns:var(--sidebar-w) 1fr;height:100%;overflow:hidden}.sidebar{display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--border);min-height:0}.sidebar-head{display:flex;align-items:center;gap:10px;padding:14px 14px 12px}.brand{display:flex;align-items:center;gap:9px;font-weight:650;font-size:14.5px;letter-spacing:.1px}.brand svg{color:var(--accent);flex:none}.brand .ver{font-family:var(--font-mono);font-size:10.5px;font-weight:400;color:var(--text-3);border:1px solid var(--border);border-radius:99px;padding:0 6px;line-height:16px;margin-top:1px}.sidebar-new{margin:2px 12px 10px;display:flex;align-items:center;justify-content:center;gap:7px;padding:8px 12px;border:1px solid var(--border-strong);border-radius:var(--radius);font-size:13px;font-weight:550;color:var(--text);background:var(--surface);transition:background .12s ease,border-color .12s ease}.sidebar-new:hover{background:var(--surface-2);border-color:var(--text-3)}.session-list{flex:1;overflow-y:auto;min-height:0;padding:2px 8px 12px}.session-group{font-size:11px;font-weight:600;letter-spacing:.4px;text-transform:uppercase;color:var(--text-3);padding:14px 8px 5px}.session-item{position:relative;display:flex;align-items:center;gap:4px;padding:2px 4px 2px 2px;border-radius:7px;border:1px solid transparent;color:var(--text-2);transition:background .1s ease,color .1s ease}.session-item:hover{background:var(--surface-2);color:var(--text)}.session-item.active{background:var(--accent-weak);border-color:color-mix(in srgb,var(--accent) 26%,transparent);color:var(--text)}.session-main{display:flex;align-items:center;gap:8px;flex:1;min-width:0;text-align:left;padding:6px 6px 6px 8px;border-radius:6px;color:inherit}.session-item .title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.session-item .meta-count{font-family:var(--font-mono);font-size:10.5px;color:var(--text-3);flex:none}.session-actions{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:flex;align-items:center;gap:1px;padding-left:22px;visibility:hidden}.session-item:hover .session-actions,.session-item.active .session-actions{visibility:visible}.session-item:hover .session-actions{background:linear-gradient(to right,transparent,var(--surface-2) 45%)}.session-item.active .session-actions{background:linear-gradient(to right,transparent,var(--accent-weak) 45%)}.session-input{width:100%;border:1px solid var(--accent);border-radius:6px;background:var(--surface);padding:4px 7px;font-size:13px}.session-empty{color:var(--text-3);font-size:12.5px;padding:18px 10px;text-align:center}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;color:var(--text-3);flex:none;transition:background .1s ease,color .1s ease}.icon-btn:hover{background:var(--surface-3);color:var(--text)}.icon-btn.danger:hover{background:var(--danger-weak);color:var(--danger)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;border-radius:var(--radius);border:1px solid var(--border-strong);background:var(--surface);font-size:13px;font-weight:550;transition:background .12s ease,border-color .12s ease}.btn:hover:not(:disabled){background:var(--surface-2)}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover:not(:disabled){background:var(--accent-text);border-color:var(--accent-text)}.btn.danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 35%,var(--border-strong))}.btn.danger:hover:not(:disabled){background:var(--danger-weak)}.btn.small{padding:3px 10px;font-size:12px;border-radius:7px}.field-label{display:block;font-size:12px;font-weight:600;color:var(--text-2);margin:0 0 6px}.field-label .select-wrap{margin-top:6px}.select-wrap{position:relative;display:block}.select-wrap select{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius);padding:7px 30px 7px 11px;font-size:13px;cursor:pointer;transition:border-color .12s ease}.select-wrap select:hover{border-color:var(--text-3)}.select-wrap:after{content:"";position:absolute;right:12px;top:50%;width:7px;height:7px;border-right:1.5px solid var(--text-3);border-bottom:1.5px solid var(--text-3);transform:translateY(-70%) rotate(45deg);pointer-events:none}.seg{display:flex;border:1px solid var(--border-strong);border-radius:var(--radius);overflow:hidden}.seg button{flex:1;padding:6px 4px;font-size:12.5px;color:var(--text-2);border-right:1px solid var(--border);transition:background .1s ease,color .1s ease}.seg button:last-child{border-right:none}.seg button:hover{background:var(--surface-2)}.seg button.on{background:var(--accent-weak);color:var(--accent-text);font-weight:600}.main{display:flex;flex-direction:column;min-width:0;min-height:0}.topbar{display:flex;align-items:center;gap:8px;padding:9px 18px;border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--surface) 62%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);min-height:50px}.topbar .spacer{flex:1}.chip{display:inline-flex;align-items:center;gap:6px;max-width:220px;height:27px;padding:0 10px;border:1px solid var(--border);border-radius:99px;background:var(--surface);font-size:12px;color:var(--text-2);cursor:pointer;transition:border-color .12s ease,color .12s ease;white-space:nowrap}.chip:hover{border-color:var(--text-3);color:var(--text)}.chip .k{color:var(--text-3);font-size:11px}.chip .v{overflow:hidden;text-overflow:ellipsis;font-weight:550}.chip .dot{width:6px;height:6px;border-radius:50%;background:var(--text-3);flex:none}.chip .dot.ok{background:var(--ok)}.chip .dot.warn{background:var(--warn)}.chip-wrap{position:relative;display:inline-flex}.chip.open{border-color:var(--text-3);color:var(--text)}.chip-menu{position:absolute;top:calc(100% + 6px);right:0;z-index:80;min-width:170px;max-height:320px;overflow-y:auto;display:flex;flex-direction:column;gap:2px;padding:4px;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow-pop)}.chip-menu button{display:flex;align-items:center;gap:4px;padding:6px 9px;border-radius:7px;font-size:12px;color:var(--text-2);text-align:left;white-space:nowrap}.chip-menu button:hover{background:var(--surface-2);color:var(--text)}.chip-menu button.on{color:var(--accent-text);font-weight:550}.chip-menu .ck{width:14px;flex:none;font-size:11px}.topbar .icon-btn{width:30px;height:30px}.messages{flex:1;overflow-y:auto;min-height:0;scroll-behavior:smooth}.messages-inner{max-width:780px;margin:0 auto;padding:26px 22px 12px;display:flex;flex-direction:column;gap:20px}.msg-user{align-self:flex-end;max-width:82%;border:1px solid var(--border);background:var(--surface);border-radius:14px 14px 4px;padding:9px 14px;white-space:pre-wrap;word-break:break-word}.msg-user .imgs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:6px}.msg-user .imgs img{max-width:180px;max-height:140px;border-radius:8px;border:1px solid var(--border);object-fit:cover}.msg-assistant{align-self:stretch}.msg-info{align-self:stretch;display:flex;gap:9px;align-items:baseline;font-size:12.5px;color:var(--text-3);border-left:2px solid var(--border-strong);padding:2px 0 2px 12px}.msg-info.error{color:var(--danger);border-left-color:var(--danger)}.msg-info.notice{color:var(--warn);border-left-color:var(--warn)}.md{font-size:14.5px;word-break:break-word}.md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}.md p{margin:.55em 0}.md h1,.md h2,.md h3,.md h4{margin:1.2em 0 .45em;font-weight:650;line-height:1.35}.md h1{font-size:1.32em}.md h2{font-size:1.18em}.md h3{font-size:1.06em}.md ul,.md ol{margin:.5em 0;padding-left:1.5em}.md li{margin:.22em 0}.md li::marker{color:var(--text-3)}.md blockquote{margin:.7em 0;padding:.1em 0 .1em 14px;border-left:2px solid var(--border-strong);color:var(--text-2)}.md hr{border:none;border-top:1px solid var(--border);margin:1.2em 0}.md a{color:var(--accent-text);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--accent) 40%,transparent)}.md a:hover{border-bottom-color:var(--accent)}.md code{font-family:var(--font-mono);font-size:.86em;background:var(--code-bg);border:1px solid var(--border);border-radius:5px;padding:.1em .36em}.md pre{margin:0;padding:12px 14px;overflow-x:auto;background:var(--code-bg);font-size:12.8px;line-height:1.55}.md pre code{background:none;border:none;padding:0;font-size:inherit}.codeblock{margin:.7em 0;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--code-bg)}.codeblock-head{display:flex;align-items:center;justify-content:space-between;padding:4px 6px 4px 12px;border-bottom:1px solid var(--border);background:var(--surface)}.codeblock-lang{font-family:var(--font-mono);font-size:10.5px;letter-spacing:.5px;text-transform:uppercase;color:var(--text-3)}.codeblock .icon-btn{width:24px;height:22px}.thinking{border:1px dashed var(--border-strong);border-radius:var(--radius);background:color-mix(in srgb,var(--surface-2) 55%,transparent)}.thinking>summary{display:flex;align-items:center;gap:7px;padding:6px 11px;font-size:12px;font-weight:550;color:var(--text-3);cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.thinking>summary::-webkit-details-marker{display:none}.thinking>summary .chev{transition:transform .15s ease}.thinking[open]>summary .chev{transform:rotate(90deg)}.thinking .thinking-body{padding:2px 14px 10px;font-size:13px;color:var(--text-2);white-space:pre-wrap;word-break:break-word;max-height:320px;overflow-y:auto}.thinking.live>summary .label:after{content:"";display:inline-block;width:6px;height:12px;margin-left:6px;background:var(--accent);opacity:.7;animation:blink 1s steps(2) infinite;vertical-align:-1px}@keyframes blink{50%{opacity:0}}.tool{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);overflow:hidden}.tool>summary{display:flex;align-items:center;gap:8px;padding:7px 11px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-family:var(--font-mono);font-size:12px;color:var(--text-2)}.tool>summary::-webkit-details-marker{display:none}.tool>summary:hover{background:var(--surface-2)}.tool>summary .chev{transition:transform .15s ease;color:var(--text-3)}.tool[open]>summary .chev{transform:rotate(90deg)}.tool>summary .tname{color:var(--text);font-weight:600}.tool>summary .tstate{margin-left:auto;display:inline-flex;align-items:center;gap:5px;font-size:10.5px;color:var(--text-3)}.tool>summary .tstate .dot{width:6px;height:6px;border-radius:50%}.tool>summary .tstate.running .dot{background:var(--accent);animation:pulse 1.1s ease-in-out infinite}.tool>summary .tstate.done .dot{background:var(--ok)}.tool>summary .tstate.failed .dot{background:var(--danger)}@keyframes pulse{50%{opacity:.25}}.tool-body{border-top:1px solid var(--border);display:grid}.tool-sec{padding:9px 13px}.tool-sec+.tool-sec{border-top:1px dashed var(--border)}.tool-sec .sec-k{font-family:var(--font-mono);font-size:10px;letter-spacing:.6px;text-transform:uppercase;color:var(--text-3);margin-bottom:4px}.tool-sec pre{margin:0;font-family:var(--font-mono);font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--text-2);max-height:300px;overflow-y:auto}.turn-stats{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;font-family:var(--font-mono);font-size:11px;color:var(--text-3);padding-top:2px}.turn-stats .warn{color:var(--warn)}.task-panel{align-self:stretch;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:10px 13px}.task-panel .task-goal{font-size:12.5px;color:var(--text-2);margin-bottom:8px;display:flex;gap:8px;align-items:baseline}.task-panel .task-goal b{color:var(--text-3);font-size:11px;font-weight:600;letter-spacing:.4px;text-transform:uppercase;flex:none}.task-panel ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.task-panel li{display:flex;gap:8px;font-size:13px;align-items:baseline}.task-panel li .tick{font-family:var(--font-mono);font-size:11px;flex:none;width:14px;text-align:center}.task-panel li.completed{color:var(--text-3);text-decoration:line-through}.task-panel li.in_progress .tick{color:var(--accent)}.approval{align-self:stretch;border:1px solid color-mix(in srgb,var(--warn) 45%,var(--border));border-radius:var(--radius);background:var(--warn-weak);padding:12px 14px}.approval .a-label{display:flex;align-items:center;gap:7px;font-size:11.5px;font-weight:650;letter-spacing:.4px;text-transform:uppercase;color:var(--warn);margin-bottom:7px}.approval .a-msg{font-family:var(--font-mono);font-size:12.5px;white-space:pre-wrap;word-break:break-word;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:7px;padding:9px 11px;max-height:260px;overflow-y:auto;margin-bottom:11px}.approval .a-actions{display:flex;gap:8px;flex-wrap:wrap}.approval .a-options{display:flex;flex-direction:column;gap:6px;margin-bottom:11px}.approval .a-opt{display:flex;align-items:center;gap:9px;text-align:left;border:1px solid var(--border-strong);border-radius:7px;background:var(--surface);padding:7px 11px;font-size:13px;transition:border-color .12s ease,background .12s ease}.approval .a-opt:hover,.approval .a-opt.sel{border-color:var(--accent);background:var(--accent-weak)}.approval .a-opt .idx{font-family:var(--font-mono);font-size:10.5px;color:var(--text-3);border:1px solid var(--border);border-radius:4px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;flex:none}.approval input[type=text]{width:100%;border:1px solid var(--border-strong);border-radius:7px;background:var(--surface);padding:7px 11px;font-size:13px;margin-bottom:11px}.composer{border-top:1px solid var(--border);background:color-mix(in srgb,var(--surface) 62%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);padding:14px 22px 12px}.composer-inner{max-width:780px;margin:0 auto}.attach-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.attach{position:relative;border:1px solid var(--border);border-radius:8px;overflow:hidden;background:var(--surface)}.attach img{display:block;width:64px;height:64px;object-fit:cover}.attach .icon-btn{position:absolute;top:2px;right:2px;width:20px;height:20px;background:color-mix(in srgb,var(--surface) 80%,transparent);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.input-box{border:1px solid var(--border-strong);border-radius:var(--radius-lg);background:var(--surface);transition:border-color .15s ease,box-shadow .15s ease}.input-box:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--ring) 28%,transparent)}.input-box textarea{display:block;width:100%;border:none;background:none;resize:none;outline:none;padding:12px 14px 6px;min-height:24px;max-height:220px;line-height:1.55}.input-box textarea::placeholder{color:var(--text-3)}.input-foot{display:flex;align-items:center;gap:4px;padding:4px 8px 8px 10px}.input-foot .hint{font-size:11px;color:var(--text-3);font-family:var(--font-mono)}.input-foot .spacer{flex:1}.send-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:32px;height:32px;border-radius:9px;background:var(--accent);color:#fff;transition:background .12s ease,transform .1s ease}.send-btn:hover:not(:disabled){background:var(--accent-text)}.send-btn:active:not(:disabled){transform:scale(.96)}.send-btn.stop{background:var(--surface-3);color:var(--danger)}.send-btn.stop:hover{background:var(--danger-weak)}@keyframes fade{0%{opacity:0}}.desc{font-size:11.5px;color:var(--text-3);margin-top:5px}.mono{font-family:var(--font-mono);font-size:11px}.clamp1,.clamp2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical}.clamp1{-webkit-line-clamp:1;text-overflow:ellipsis;white-space:nowrap}.clamp2{-webkit-line-clamp:2}.link{color:var(--accent-text);font:inherit}.link:hover{text-decoration:underline}.kv{display:flex;justify-content:space-between;gap:12px;font-size:12.5px;padding:4px 0}.kv .k{color:var(--text-3);flex:none}.kv .v{text-align:right;word-break:break-all;font-family:var(--font-mono);font-size:11.5px}.setting-row{margin-bottom:14px}.settings-page{position:fixed;top:0;right:0;bottom:0;left:0;z-index:42;background:var(--bg);display:grid;grid-template-columns:218px 1fr;animation:fade .15s ease}.settings-nav{display:flex;flex-direction:column;gap:2px;padding:16px 10px;background:var(--surface);border-right:1px solid var(--border);overflow-y:auto}.settings-brand{display:flex;align-items:center;gap:8px;font-weight:650;font-size:14px;padding:2px 10px 12px}.settings-brand svg{color:var(--accent)}.settings-nav-item{display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:7px;font-size:13px;color:var(--text-2);text-align:left;transition:background .1s ease,color .1s ease}.settings-nav-item:hover{background:var(--surface-2);color:var(--text)}.settings-nav-item.on{background:var(--accent-weak);color:var(--accent-text);font-weight:550}.settings-nav-foot{margin-top:auto;padding:10px 8px 2px;border-top:1px solid var(--border)}.settings-main{display:flex;flex-direction:column;min-width:0;min-height:0}.settings-head{display:flex;align-items:center;justify-content:space-between;padding:13px 22px;border-bottom:1px solid var(--border);background:var(--surface)}.settings-head h2{margin:0;font-size:15px;font-weight:650}.settings-body{flex:1;overflow-y:auto;padding:20px 22px 40px;max-width:880px;width:100%;margin:0 auto}.panel-sec{margin-bottom:26px}.panel-sec-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;padding-bottom:7px;border-bottom:1px solid var(--border)}.panel-sec-head h3{margin:0;font-size:12px;font-weight:650;letter-spacing:.5px;text-transform:uppercase;color:var(--text-3)}.head-actions{display:flex;align-items:center;gap:8px}.notice{border:1px solid var(--border);border-radius:var(--radius);padding:8px 12px;font-size:12.5px;margin-bottom:10px}.notice.warn{border-color:color-mix(in srgb,var(--warn) 40%,var(--border));background:var(--warn-weak);color:var(--warn)}.row-list{display:flex;flex-direction:column;gap:6px}.row-item{display:flex;align-items:center;gap:10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:9px 12px}.row-main{flex:1;min-width:0}.row-title{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:550;flex-wrap:wrap}.row-sub{font-size:11.5px;color:var(--text-3);margin-top:2px;display:flex;gap:6px;flex-wrap:wrap}.row-sub.err{color:var(--danger)}.row-actions{display:flex;align-items:center;gap:5px;flex:none;flex-wrap:wrap;justify-content:flex-end}.badge{font-size:10px;font-weight:600;letter-spacing:.3px;border:1px solid var(--border-strong);border-radius:99px;padding:0 7px;line-height:16px;color:var(--text-3);flex:none}.badge.ok{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 45%,var(--border))}.badge.warn{color:var(--warn);border-color:color-mix(in srgb,var(--warn) 45%,var(--border))}.badge.off{color:var(--text-3);border-color:var(--border)}.badge.accent{color:var(--accent-text);border-color:color-mix(in srgb,var(--accent) 45%,var(--border))}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border-strong);border-radius:7px;padding:6px 14px;font-size:13px;font-weight:500;background:var(--surface);transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface-2);border-color:var(--text-3)}.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn-primary:hover:not(:disabled){background:var(--accent-text);border-color:var(--accent-text)}.btn-danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 40%,var(--border-strong))}.btn-danger:hover:not(:disabled){background:var(--danger-weak);border-color:var(--danger)}.btn-sm{padding:3px 10px;font-size:12px;border-radius:6px}.form-grid{display:flex;flex-direction:column;gap:12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:14px;margin-top:10px}.field{display:flex;flex-direction:column;gap:5px}.field input,.field textarea,.search-line input,.model-default input{border:1px solid var(--border-strong);border-radius:7px;background:var(--surface);padding:7px 10px;font-size:13px;outline:none}.field textarea,.code-editor{resize:vertical;font-size:12.5px;line-height:1.55}.field input:focus,.field textarea:focus,.search-line input:focus,.model-default input:focus,.code-editor:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--ring) 28%,transparent)}.form-actions{display:flex;gap:8px;align-items:center}.form-error{color:var(--danger);font-size:12px}.check-line{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--text-2)}.scope-pick{display:inline-flex;border:1px solid var(--border-strong);border-radius:7px;overflow:hidden}.scope-pick button{padding:2px 10px;font-size:11.5px;color:var(--text-3)}.scope-pick button.on{background:var(--accent-weak);color:var(--accent-text);font-weight:600}.scope-line{display:flex;align-items:center;gap:9px;font-size:12.5px;color:var(--text-2);margin-bottom:8px}.model-default{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.model-default .grow,.grow{flex:1;min-width:140px}.search-line{display:flex;gap:8px;align-items:center;margin-bottom:10px}.search-line input{flex:1}.mem-group{margin-top:12px}.mem-group-title{font-size:11.5px;font-weight:600;color:var(--text-3);margin-bottom:6px}.code-view{border:1px solid var(--border);border-radius:var(--radius);background:var(--code-bg);padding:12px;font-family:var(--font-mono);font-size:11.5px;line-height:1.6;overflow:auto;max-height:380px;white-space:pre-wrap;margin-top:10px}.code-editor{display:block;width:100%;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--code-bg);padding:10px 12px;font-family:var(--font-mono);outline:none}.empty-note{color:var(--text-3);font-size:12.5px;padding:8px 2px}@media(max-width:900px){.settings-page{grid-template-columns:1fr;grid-template-rows:auto 1fr}.settings-nav{flex-direction:row;flex-wrap:wrap;align-items:center;border-right:none;border-bottom:1px solid var(--border);padding:8px 10px}.settings-brand{padding:0 8px 0 4px}.settings-nav-foot{display:none}.settings-body{padding:14px 12px 32px}}.toasts{position:fixed;bottom:18px;left:50%;transform:translate(-50%);z-index:60;display:flex;flex-direction:column;gap:8px;align-items:center}.toast{background:var(--surface);border:1px solid var(--border-strong);border-radius:9px;box-shadow:var(--shadow-pop);padding:8px 15px;font-size:13px;max-width:70vw;animation:toast-in .18s ease}.toast.error{border-color:color-mix(in srgb,var(--danger) 45%,var(--border));color:var(--danger)}@keyframes toast-in{0%{opacity:0;transform:translateY(8px)}}.empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:var(--text-3);padding:30px;text-align:center}.empty .logo{color:var(--border-strong)}.empty h2{margin:0;font-size:17px;font-weight:650;color:var(--text-2)}.empty p{margin:0;font-size:13px;max-width:380px}.empty .samples{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:4px}.empty .sample{border:1px solid var(--border);border-radius:99px;padding:5px 14px;font-size:12.5px;color:var(--text-2);transition:all .12s ease}.empty .sample:hover{border-color:var(--accent);color:var(--accent-text);background:var(--accent-weak)}.caret{display:inline-block;width:7px;height:14px;margin-left:2px;background:var(--accent);vertical-align:-2px;animation:blink 1s steps(2) infinite;border-radius:1.5px}.sidebar-toggle,.scrim{display:none}@media(max-width:900px){.app{grid-template-columns:1fr}.sidebar{position:fixed;inset:0 auto 0 0;width:min(300px,84vw);z-index:50;transform:translate(-100%);transition:transform .2s ease;box-shadow:var(--shadow-pop)}.sidebar.open{transform:translate(0)}.scrim{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:#0a0a0e52;z-index:45;animation:fade .15s ease}.sidebar-toggle{display:inline-flex}.messages-inner{padding:18px 14px 10px}.composer{padding:10px 12px}.topbar{padding:8px 12px}.chip .v{max-width:90px}}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
|
|
2
|
+
<rect x="3" y="3" width="26" height="26" rx="7" stroke="currentColor" stroke-width="2.4"/>
|
|
3
|
+
<path d="M10 20v-8l6 5 6-5v8" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
|
+
<meta name="color-scheme" content="light dark" />
|
|
7
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
|
+
<title>min-agent</title>
|
|
9
|
+
<script>
|
|
10
|
+
;(() => {
|
|
11
|
+
const saved = localStorage.getItem("ma-theme")
|
|
12
|
+
const theme = saved === "light" || saved === "dark" ? saved : (matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
|
|
13
|
+
document.documentElement.dataset.theme = theme
|
|
14
|
+
})()
|
|
15
|
+
</script>
|
|
16
|
+
<script type="module" crossorigin src="/assets/index-0DW9pnJc.js"></script>
|
|
17
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bb02wiVA.css">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<div id="root"></div>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "min-agent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "3.2.2609221209",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Minimal AI coding agent with tool use, MCP, and skills support",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
8
|
-
"min-agent": "bin/min-agent.js"
|
|
8
|
+
"min-agent": "bin/min-agent.js",
|
|
9
|
+
"min": "bin/min-agent.js"
|
|
9
10
|
},
|
|
10
11
|
"engines": {
|
|
11
12
|
"node": ">=20.0.0"
|
|
@@ -32,10 +33,11 @@
|
|
|
32
33
|
"dev": "bun run src/cli.ts",
|
|
33
34
|
"build": "bun run scripts/bundle.ts",
|
|
34
35
|
"typecheck": "tsc --noEmit",
|
|
35
|
-
"test": "bun test",
|
|
36
|
+
"test": "MIN_AGENT_NO_INTERACTIVE=1 NODE_ENV=test bun test",
|
|
36
37
|
"lint": "biome check src tests scripts",
|
|
37
38
|
"format": "biome format --write src tests scripts",
|
|
38
|
-
"prepack": "npm run typecheck && npm run build"
|
|
39
|
+
"prepack": "npm run typecheck && npm run build",
|
|
40
|
+
"prepublishOnly": "bun run --cwd ../min-agent-web build && bun run scripts/bump-version.ts"
|
|
39
41
|
},
|
|
40
42
|
"keywords": [
|
|
41
43
|
"ai",
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
name: self-config
|
|
3
3
|
description: >
|
|
4
4
|
Configures min-agent itself: providers, MCP servers, skills, rules, memory,
|
|
5
|
-
permission, sandbox, thinking intensity, plugins, and files under ~/.min-agent
|
|
5
|
+
permission, sandbox, thinking intensity, plugins, and files under ~/.min-agent/.
|
|
6
6
|
Use when the user asks to install, enable, disable, or change min-agent settings.
|
|
7
7
|
always-load: true
|
|
8
|
-
version: 1.
|
|
8
|
+
version: 1.1.0
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Configure min-agent
|
|
@@ -17,25 +17,25 @@ This skill is already loaded. Follow it whenever the user asks to change min-age
|
|
|
17
17
|
| Scope | Directory | When to use |
|
|
18
18
|
|-------|-----------|-------------|
|
|
19
19
|
| Global | `~/.min-agent/` (`MIN_AGENT_CONFIG_DIR` replaces this) | All projects; API keys live only here |
|
|
20
|
-
| Project |
|
|
20
|
+
| Project | `~/.min-agent/sessions/<project-key>/` | This repo only |
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Project config never touches the project directory. Each project gets a folder under the global `sessions/` dir named `<basename>-<hash>` (hash of the absolute cwd path); a `project.json` marker inside records the path it belongs to. Writes auto-create the folder — no `min-agent init` required. Never put `apiKey`, `token`, `serperApiKey`, or other secrets in project files.
|
|
23
23
|
|
|
24
|
-
Config files are **strict JSON** (no comments). Read the file before editing. Prefer the `edit` tool for existing files; `write` only when creating a new file. Keep unrelated keys. Create parent directories when needed
|
|
24
|
+
Config files are **strict JSON** (no comments). Read the file before editing. Prefer the `edit` tool for existing files; `write` only when creating a new file. Keep unrelated keys. Create parent directories when needed.
|
|
25
25
|
|
|
26
26
|
## What goes where
|
|
27
27
|
|
|
28
28
|
| Goal | File | Notes |
|
|
29
29
|
|------|------|--------|
|
|
30
30
|
| Providers, keys, search backends, pricing, extra instruction paths, global skill disables | `~/.min-agent/config.json` | Keys only here |
|
|
31
|
-
| Project skill toggles; overlay `activeProvider` / `defaultModel` / `sampling` / `permission` / `thinking` / `memory` / `sandbox` / `compaction` / `agent` |
|
|
32
|
-
| MCP servers | `~/.min-agent/mcp.json` or
|
|
31
|
+
| Project skill toggles; overlay `activeProvider` / `defaultModel` / `sampling` / `permission` / `thinking` / `memory` / `sandbox` / `compaction` / `agent` | `~/.min-agent/sessions/<project-key>/config.json` | Overlay is field-by-field; `sampling`/`sandbox`/`compaction`/`agent` merge keys |
|
|
32
|
+
| MCP servers | `~/.min-agent/mcp.json` or `sessions/<project-key>/mcp.json` | Merge by server **name**; project replaces the same name |
|
|
33
33
|
| Memories | `memory.json` in the same dirs | Prefer `memory_save` / `memory_search` tools over editing the file |
|
|
34
34
|
| Global rules | `~/.min-agent/rules.md` and/or `~/.min-agent/AGENTS.md` | Both always loaded when present |
|
|
35
|
-
| Project rules | `AGENTS.md`, `RULES.md`, or `CLAUDE.md` in cwd (or
|
|
35
|
+
| Project rules | `AGENTS.md`, `RULES.md`, or `CLAUDE.md` in cwd (or `sessions/<project-key>/AGENTS.md`) | The config-dir AGENTS.md wins; otherwise first match walking up from cwd |
|
|
36
36
|
| Extra instruction files | `instructions` array in global `config.json` | Paths or URLs |
|
|
37
|
-
| Custom tools |
|
|
38
|
-
| Project skills |
|
|
37
|
+
| Custom tools | `sessions/<project-key>/tools/*.ts` or `~/.min-agent/tools/*.ts` | See reference.md |
|
|
38
|
+
| Project skills | `sessions/<project-key>/skills/<name>/SKILL.md` | Or `min-agent skills new <name>` |
|
|
39
39
|
| Global skills | `~/.min-agent/skills/<name>/SKILL.md` (also `~/.agents/skills/`) | `min-agent skills new <name> --global` (or `min-agent --global skills new <name>`) writes under `~/.min-agent/skills/` |
|
|
40
40
|
|
|
41
41
|
## MCP
|
|
@@ -44,7 +44,7 @@ Write `{ "mcpServers": { "<name>": { ... } } }`.
|
|
|
44
44
|
|
|
45
45
|
- Local: `"command": ["npx", "-y", "@scope/server", "..."]` plus optional `environment`, `enabled`, `connectTimeout`, `callTimeout`.
|
|
46
46
|
- Remote: `"url": "https://..."`. Optional `token`, `headers`, `remoteTransport` (`auto` default, or `streamable-http` / `sse`), `oauth` (`{}` to login in a browser, or `false` to disable).
|
|
47
|
-
- `enabled: false` disables without deleting. Project
|
|
47
|
+
- `enabled: false` disables without deleting. Project `mcp.json` wins on the same name.
|
|
48
48
|
|
|
49
49
|
CLI (user shell, not a substitute for writing the file in this session): `min-agent mcp add|update|rename|list|info|enable|disable|remove|check`. Put `--project` on the mcp subcommand or on the root (`min-agent --project mcp …`) for repo scope. Prefer `mcp add --name <name> …` (positional name still works). `update --rename <new> <old>` or `mcp rename <old> <new>` renames. `add` refuses to overwrite unless `--force` (or root `-y`). `update` only changes the fields you pass (`--token ""` removes the token, `--env`/`--headers` merge, a new command switches the server to stdio and clears remote fields).
|
|
50
50
|
|
|
@@ -56,12 +56,12 @@ MCP *tools* from connected servers are inlined when there are 8 or fewer. More t
|
|
|
56
56
|
|
|
57
57
|
## Skills
|
|
58
58
|
|
|
59
|
-
User-skill roots, later overriding earlier: `~/.agents/skills/` → `~/.min-agent/skills/` →
|
|
59
|
+
User-skill roots, later overriding earlier: `~/.agents/skills/` → `~/.min-agent/skills/` → project `sessions/<project-key>/skills/` → `.agents/skills/` → `.opencode/skills/` → `.claude/skills/` (the last four are relative to cwd). Symlinks are followed. `MIN_AGENT_SKILLS_DIRS` (path-delimiter separated) replaces that user list. Built-in skills shipped with min-agent still load and **win on name**; they are not overridden by user copies. `MIN_AGENT_NO_BUILTIN_SKILLS=1` skips built-ins.
|
|
60
60
|
|
|
61
61
|
Enable/disable:
|
|
62
62
|
|
|
63
63
|
- Global disable: `disabledSkills` in `~/.min-agent/config.json`
|
|
64
|
-
- Project disable: `disabledSkills` in
|
|
64
|
+
- Project disable: `disabledSkills` in the project `sessions/<project-key>/config.json` (wins)
|
|
65
65
|
- Re-enable a globally disabled skill in this repo: add the name to project `enabledSkills`
|
|
66
66
|
|
|
67
67
|
Toggles take effect on the next turn. CLI: `min-agent skills enable|disable <name...> [--project|--global]` (flag on the skills subcommand or on the root). Interactive: `/skills enable|disable <name...> [--project]`. `skills enable <orphan>` clears that name from **all** config lists (global `disabledSkills` and project `disabledSkills`/`enabledSkills`) — no need to guess scope. `skills list` shows orphan entries with their lists. A **new** `SKILL.md` is invisible until skills are rediscovered (`/skills` in the interactive session, `POST /v1/skills/reload` on serve, or restart). `skills new` warns if the name collides with a built-in or another discovered skill.
|
|
@@ -81,7 +81,7 @@ Instructions...
|
|
|
81
81
|
## Rules, memory, permission, sandbox, thinking
|
|
82
82
|
|
|
83
83
|
- Rules: edit the files in the table above. `/reload` reloads rules only, not MCP.
|
|
84
|
-
- Memory: **off** by default. Config `memory` is `on` | `off` (`true`/`enable` → on, `false`/`disable` → off). Project overlays global; writing `memory` globally also removes a project `memory` overlay. When off, memories are not injected and `memory_save` / `memory_search` / `memory_delete` are not registered (takes effect next turn after you change the file). CLI `min-agent memory on|off` / `--memory` follow the same write-vs-this-run rule as permission. `/memory on|off` writes **global** by default (and clears a project overlay); `/memory --project` writes only the project file. `/memory` lists the switch plus stored entries; `/memory <text>` still writes `memory.json` even when off. Default save scope is project
|
|
84
|
+
- Memory: **off** by default. Config `memory` is `on` | `off` (`true`/`enable` → on, `false`/`disable` → off). Project overlays global; writing `memory` globally also removes a project `memory` overlay. When off, memories are not injected and `memory_save` / `memory_search` / `memory_delete` are not registered (takes effect next turn after you change the file). CLI `min-agent memory on|off` / `--memory` follow the same write-vs-this-run rule as permission. `/memory on|off` writes **global** by default (and clears a project overlay); `/memory --project` writes only the project file. `/memory` lists the switch plus stored entries; `/memory <text>` still writes `memory.json` even when off. Default save scope is project (stored under `sessions/<project-key>/memory.json`). Shape: `{ "content": string, "tags": string[], "created": ISO string }` array. When on, memories are injected each turn as background reference, not as work to resume. Do not store secrets or API keys. HTTP: `GET/POST /v1/memory/mode`, chat body `memory`, and `GET /v1/memory` include `memory` / `source` / `label`.
|
|
85
85
|
- Permission: `accept-edits` (default) | `ask` | `allow-all` in config `permission`. CLI `min-agent permission …` / `--permission` without a message writes config and exits; with a message it is this session only. `--yes` is this session only and does not write config. `min-agent exec` (one-shot) uses a permissive default when neither `--permission` nor `--yes` is given: file edits and ordinary commands run without asking, and only genuinely destructive commands (any deleting command such as plain `rm file`, `rm -r/-f`, `truncate -s 0`, `drop`/`truncate table`/`delete from`, `mkfs`/`dd`/raw-device writes, `shred`/`wipefs`, `git reset --hard`/`git clean -f`, `docker rm`/`prune`, `find … -delete`/`-exec rm`) still prompt. An explicit `--permission` (or `--yes`) overrides this and behaves exactly as in interactive sessions (`allow-all` runs even destructive commands silently). In `ask` / `accept-edits`, "dangerous commands" that still prompt do NOT include ordinary `git push`, `git stash`/`git stash pop`, `git rebase`, or `chmod` — only their harmful forms count: force pushes (`git push --force`/`-f`/`--force-with-lease`), `git stash drop`/`git stash clear`, any `rm` with target files, in-place edits (`sed -i`, `perl -i`, `awk -i inplace`), plus `git reset --hard`, `git clean -f`, `git checkout .`, `sudo`, disk/db operations. Shell quoting is respected: dangerous-looking words inside quotes (e.g. `grep "delete from users" src/`) do not prompt; in `accept-edits` a redirect into the project (`cmd > out.log`) mirrors the edit tools and stays silent, while absolute/system/device targets (`> /etc/hosts`) still ask — in `ask` mode any file-writing redirect prompts. Confirmation prompts are coalesced: when several actions in one step need approval, a single overlay lists them all and one decision applies to the whole batch instead of stacking separate prompts. The overlay offers 允许 / 总是允许 / 拒绝 (hotkeys y / a / n): choosing 总是允许 remembers that action for the current process so identical repeats (same normalized shell command, same custom/MCP tool) never prompt again until exit; MCP tools without a read-only hint confirm on each distinct tool exactly once this way, `allow-all` / `--yes` remain fully silent.
|
|
86
86
|
- Thinking intensity: `off` | `low` | `medium` | `high` | `max` in config `thinking`. Omit the field to use **high**, then clamp to levels the current model actually exposes (from the model catalog). If the live gateway rejects that level, the same request retries remaining levels (high → medium → max → low → off) without surfacing the error, and the working level is remembered per model. `/think` opens an interactive picker of those English levels and writes **global** config; that also clears a project `thinking` overlay so a leftover project `off` cannot hide the new value after restart. `/think --project` writes only the project file. Typed `/think off|low|medium|high|max` still works when the model supports that value. `min-agent think …` / `--think` follow the same write-vs-this-run rule as permission. `xhigh` / `extra-high` / `none` are accepted as aliases (`xhigh` → `max`, `none` → `off`). Each request maps that intensity onto the current model and gateway (MiniMax uses `adaptive`/`disabled`; official OpenAI omits `thinking` and maps `max` to `xhigh`; an `ollama` provider uses native chat with `think` plus the configured window). Some models (Gemini, and any gateway that answers “reasoning is mandatory”) cannot turn thinking off: the request is sent with reasoning still on, `off` is dropped from `/think` for that model, and the mapping is cached. Learned wire mappings are cached in `~/.min-agent/thinking-wire-cache.json` and learned default intensities in `~/.min-agent/thinking-default-cache.json`, both for 7 days. Per-model context window and supported effort values are loaded from the model catalog (`https://models.lonae.com`, override with `MIN_AGENT_MODELS_API_URL`) and cached in `~/.min-agent/model-catalog-cache.json` for 7 days after a successful lookup. When the provider host is unknown, effort levels are the majority across offerings that actually list efforts (toggle-only rows do not vote), so a single gateway cannot invent `medium`. An `ollama` provider skips that catalog and uses native `POST /api/show` instead (whether the model advertises thinking, plus the loaded window: Modelfile `num_ctx` if set, otherwise the architecture length capped at 32768). Chat completions are sent to native `POST /api/chat` so `options.num_ctx` and `think` actually apply — the OpenAI-compatible `/v1` endpoint ignores both. `/ctx` opens a picker of `2k` / `4k` / `8k` / `12k` / `16k` / `32k` / `64k` / `128k` / `256k` / `auto` and writes the active provider's `contextWindow` (global only; providers are not in project config). Typed `/ctx 8k` and CLI `min-agent ctx 8k` do the same; `auto` clears the override. The menu item is hidden unless the active provider is ollama. Non-Ollama models without a detected window use 128k; if a request overflows and reports `n_ctx`, that value is remembered for 24 hours (it does not override an explicit `contextWindow`). Results are cached in `~/.min-agent/ollama-model-cache.json` for 7 days.
|
|
87
87
|
- Sandbox default is **off**. `mode`: `off` | `workspace` | `strict`. Optional `network`, `extraWriteRoots`, `extraReadRoots`. Isolation is independent of permission. `--sandbox` / `--network` without a message write config and exit. On Windows there is no seatbelt/bwrap: `strict` rejects bash; `workspace` still path-checks file tools; bash prefers Git Bash when installed, otherwise `cmd.exe`.
|
|
@@ -94,6 +94,6 @@ Only in global `config.json`: `providers[]` with `name`, `type` (`openai-compati
|
|
|
94
94
|
|
|
95
95
|
CLI: `min-agent provider` (no args) prints the active provider and the available list; `min-agent provider <name>` switches the active provider (writes global `activeProvider`, clears the project overlay). Add/edit/remove go through `min-agent setup` (interactive wizard or flags): `--type openai-compatible|openai|ollama`, `--url`, `--api-key`, `--name`, `--default-model`, `--switch <name>`, `--remove <name>`. `--yes` skips overwrite/delete confirmation during setup; it does not change permission. Keys only in the global file.
|
|
96
96
|
|
|
97
|
-
HTTP: `GET /v1/provider` returns `{ active, providers[] }`; `POST /v1/provider` with `{ "provider": "<name>" }` switches (writes global, clears project overlay; no `scope`, since providers are global-only). Missing/empty name → `400 invalid_provider`; unknown name → `404 provider_not_found`.
|
|
97
|
+
HTTP: `GET /v1/provider` returns `{ active, providers[] }`; `POST /v1/provider` with `{ "provider": "<name>" }` switches (writes global, clears project overlay; no `scope`, since providers are global-only). Missing/empty name → `400 invalid_provider`; unknown name → `404 provider_not_found`. Full CRUD on a running serve (e.g. from the web settings page): `GET /v1/providers` (details, masks API keys, reports `locked`), `POST /v1/providers` (add + activate), `PATCH /v1/providers/:name` (partial update / rename), `DELETE /v1/providers/:name`; default model via `POST /v1/models/default` `{ model, scope? }`. All of these return `403 provider_locked` while the builtin OpenRouter preset is active.
|
|
98
98
|
|
|
99
99
|
After changing keys or MCP connections, tell the user if a restart is required. Do not print full secrets back in chat.
|
|
@@ -78,7 +78,9 @@ Read this when you need exact keys. Files are strict JSON.
|
|
|
78
78
|
- Interactive `/provider` (and typed `/provider <name>`) writes global `activeProvider` and clears a project `activeProvider` overlay. It does not add, edit, or remove providers.
|
|
79
79
|
- If `providers` is missing or empty, runtime uses a built-in OpenRouter provider (`name`: `openrouter`, `defaultModel`: `openrouter/free`) without writing it to disk. The preset is locked: while it is the active provider, `min-agent setup` refuses to add/edit/switch/remove providers, the model list is fixed to `openrouter/free` (no network fetch), and selecting any other model (interactive picker, `/model`, `--model`, HTTP chat `model`) is rejected. `MIN_AGENT_NO_BUILTIN_PROVIDER=1` disables the fallback; with the preset disabled or any user provider stored, the lock does not apply and setup works normally.
|
|
80
80
|
|
|
81
|
-
## Project
|
|
81
|
+
## Project `sessions/<project-key>/config.json`
|
|
82
|
+
|
|
83
|
+
Project files live under the global config dir, never inside the repo: `~/.min-agent/sessions/<project-key>/` where `<project-key>` is `<cwd-basename>-<12-hex sha256 of the absolute cwd>`. A `project.json` marker (`{ "path": ... }`) records the mapped directory. Writes auto-create the folder.
|
|
82
84
|
|
|
83
85
|
Allowed keys (no `providers`, no API keys, no search secrets):
|
|
84
86
|
|
|
@@ -124,7 +126,7 @@ Disable lists are string arrays. A project `enabledSkills` name unblocks a globa
|
|
|
124
126
|
|
|
125
127
|
## Plugins
|
|
126
128
|
|
|
127
|
-
|
|
129
|
+
`sessions/<project-key>/tools/*.ts` (or `~/.min-agent/tools/*.ts`). Each exported object:
|
|
128
130
|
|
|
129
131
|
```typescript
|
|
130
132
|
export const myTool = {
|
|
@@ -159,4 +161,10 @@ Array of `{ "content": string, "tags": string[], "created": string }`. Prefer me
|
|
|
159
161
|
|
|
160
162
|
## HTTP (only if the user is running `min-agent serve`)
|
|
161
163
|
|
|
162
|
-
Skills: `GET /v1/skills`, `GET /v1/skills/:name`, `POST /v1/skills/reload`, `POST /v1/skills/:name/enable|disable` with `{ "scope": "project"|"global" }` (
|
|
164
|
+
Skills: `GET /v1/skills`, `GET /v1/skills/:name`, `POST /v1/skills/reload`, `POST /v1/skills` (create; body `{ name, description?, content?, scope? }`, `409 skill_exists` on duplicate), `POST /v1/skills/:name/enable|disable` with `{ "scope": "project"|"global" }` (project writes auto-create the project folder under `sessions/`). `stale_disabled` entries are `{ "name", "in": ["global_disabled"|"project_disabled"|"project_enabled"] }`; enabling an orphan name clears it from every list (`cleared_stale` in the response). MCP enable/disable similarly. Thinking: `GET/POST /v1/thinking` (optional `?model=` picks the model the `choices` levels are resolved for; levels come from the model catalog and fall back to all five when the model is not listed). Permission: `GET/POST /v1/permission` with optional `scope`. Memory switch: `GET/POST /v1/memory/mode` with optional `scope`. Ollama context level: `GET/POST /v1/context` with `{ "level": "8k" }` or `"auto"`.
|
|
165
|
+
|
|
166
|
+
Providers: `GET /v1/providers` returns `{ active, locked, default_model, project_default_model, providers[] }` (each entry masks `apiKey` as `apiKey_masked`; `locked: true` means the builtin OpenRouter preset is active and every write below returns `403 provider_locked`). `POST /v1/providers` adds `{ name, type?, baseURL, apiKey, defaultModel?, contextWindow?, overwrite? }` and activates it (`409 provider_exists` without `overwrite`). `PATCH /v1/providers/:name` partially updates (rename via `name`; empty `apiKey` keeps the old key). `DELETE /v1/providers/:name` removes it. Default model: `POST /v1/models/default` with `{ model, scope? }` (project scope writes the project `defaultModel` overlay; `DELETE /v1/models/default` clears that overlay). Provider switch stays `POST /v1/provider` with `{ provider }`.
|
|
167
|
+
|
|
168
|
+
Rules: `GET /v1/rules/files` lists editable rule files with content (`global-rules` = `~/.min-agent/rules.md`, `global-agents` = `~/.min-agent/AGENTS.md`, `project-agents` = project `AGENTS.md`). `PUT /v1/rules/files/:target` with `{ content }` writes and hot-reloads instructions on the running server; `DELETE` removes the file.
|
|
169
|
+
|
|
170
|
+
Full list is `docs/API.md` in the min-agent package; do not treat that file as this skill's replacement.
|