agent-from-zero 0.32.1 → 0.32.3
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/dist/ink/app.js +4 -1
- package/dist/ink/sink.js +14 -1
- package/dist/prompt.js +1 -0
- package/package.json +1 -1
package/dist/ink/app.js
CHANGED
|
@@ -36,7 +36,10 @@ const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧",
|
|
|
36
36
|
// <Static> (formatted as markdown) the moment it finishes.
|
|
37
37
|
function liveTail(s) {
|
|
38
38
|
const rows = process.stdout.rows || 24;
|
|
39
|
-
|
|
39
|
+
// Keep the preview SMALL (≤10 lines) even on a tall terminal: Ink repaints this
|
|
40
|
+
// whole region on every (throttled) update, and a smaller block repaints with
|
|
41
|
+
// far less flicker. The full reply still lands in <Static> on commit.
|
|
42
|
+
const maxLines = Math.max(3, Math.min(10, rows - 14)); // reserve rows for the input box + status bar + agent bar + margins
|
|
40
43
|
const cols = process.stdout.columns || 80;
|
|
41
44
|
const maxChars = maxLines * cols; // rough bound so one very long line can't blow past either
|
|
42
45
|
let t = s.length > maxChars ? s.slice(-maxChars) : s;
|
package/dist/ink/sink.js
CHANGED
|
@@ -29,15 +29,28 @@ export function makeInkSink(api) {
|
|
|
29
29
|
// The streamed answer accumulates in the dynamic region as raw text (live,
|
|
30
30
|
// "it's typing"), then commits as ONE markdown-rendered item when it ends —
|
|
31
31
|
// partial markdown mid-stream renders badly, so we format only once it's whole.
|
|
32
|
+
//
|
|
33
|
+
// THROTTLED on purpose: a fast stream delivers tokens dozens of times a
|
|
34
|
+
// second, and Ink erases+redraws the whole live region on every state change
|
|
35
|
+
// — repainting a multi-line block that often is what makes a long answer
|
|
36
|
+
// "shake" violently. So we coalesce a burst of tokens into ONE setLive every
|
|
37
|
+
// ~90ms (≈11 fps, smooth but cheap). The final, complete answer still commits
|
|
38
|
+
// to <Static> on end(), so nothing is lost or under-rendered.
|
|
32
39
|
answer() {
|
|
33
40
|
let buf = "";
|
|
41
|
+
let timer = null;
|
|
34
42
|
api.setLive("");
|
|
35
43
|
return {
|
|
36
44
|
push: (tok) => {
|
|
37
45
|
buf += tok;
|
|
38
|
-
|
|
46
|
+
if (!timer)
|
|
47
|
+
timer = setTimeout(() => { timer = null; api.setLive(buf); }, 90); // leading-edge throttle: schedule one repaint, ignore the burst until it fires
|
|
39
48
|
},
|
|
40
49
|
end: () => {
|
|
50
|
+
if (timer) {
|
|
51
|
+
clearTimeout(timer);
|
|
52
|
+
timer = null;
|
|
53
|
+
} // drop the pending repaint — we're committing now
|
|
41
54
|
api.setLive(null); // clear the live preview first, then commit (no flicker/duplicate)
|
|
42
55
|
if (buf.trim())
|
|
43
56
|
api.pushItem({ kind: "answer", text: buf });
|
package/dist/prompt.js
CHANGED
|
@@ -18,6 +18,7 @@ export const SYSTEM_PROMPT = `You are mini-agent, a coding agent that works in t
|
|
|
18
18
|
|
|
19
19
|
Behavior rules:
|
|
20
20
|
- Use the dedicated tools for file work: read_file, edit_file, write_file, search. Use run_bash only for things that truly need execution.
|
|
21
|
+
- You support SKILLS — reusable, named procedures saved as Markdown under .mini-agent/skills/ in the project (or ~/.config/mini-agent/skills/ globally). When a request matches one of the skills listed in the \`skill\` tool, call \`skill\` with its name to load the steps, then carry them out. If there is no \`skill\` tool in this session, none are loaded in this project yet — the capability still exists: the user adds one at .mini-agent/skills/<name>/SKILL.md, runs any with "/skill <name>", and lists them with "/skills". So when asked whether you support skills, the answer is yes — describe this mechanism (and which skills, if any, are currently loaded); never claim your toolset is fixed.
|
|
21
22
|
- Report results accurately. If a test fails, say it failed. Don't claim success when you're not sure. Don't be overly self-doubting either — distinguish "verified working" from "I think it works".
|
|
22
23
|
- Never add comments to code you did not change. Never reformat code you did not change.
|
|
23
24
|
- Keep final answers under 150 words unless the task genuinely requires more.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-from-zero",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.3",
|
|
4
4
|
"description": "Build a Claude Code-style CLI agent from scratch, with AI as your pair programmer — companion code for a 10-day tutorial (DeepSeek by default, any OpenAI-compatible model)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|