@vietor/easy-agent 0.4.5 → 0.4.7

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 CHANGED
@@ -29,13 +29,37 @@ Create `~/.easy-agent.json` in your home directory:
29
29
  "llm": {
30
30
  "baseUrl": "https://api.deepseek.com/v1",
31
31
  "apiKey": "your-api-key",
32
- "model": "deepseek-v4-flash"
32
+ "model": "deepseek-v4-flash",
33
+ "reasoningEffort": "high"
33
34
  }
34
35
  }
35
36
  ```
36
37
 
37
38
  `llm.baseUrl`, `llm.apiKey`, and `llm.model` are all required. Point `baseUrl` at any OpenAI-compatible endpoint (OpenAI, Azure OpenAI, local servers, etc.) and set `model` to a model that endpoint serves.
38
39
 
40
+ #### `wireApi` (optional)
41
+
42
+ Selects the wire protocol the client speaks. Valid values: `"completions"` | `"anthropic"`. Defaults to `"completions"`.
43
+
44
+ - `"completions"` - OpenAI Chat Completions compatible endpoint (the default). `reasoningEffort` is sent as `reasoning_effort`.
45
+ - `"anthropic"` - Anthropic Messages API via the official SDK. Point `baseUrl` at an Anthropic-compatible endpoint (e.g. `https://api.anthropic.com`) and `model` at a Claude model. `reasoningEffort` enables extended thinking (`"high"` = 16k budget, `"max"` = 32k).
46
+
47
+ ```json
48
+ {
49
+ "llm": {
50
+ "baseUrl": "https://api.anthropic.com",
51
+ "apiKey": "your-api-key",
52
+ "model": "claude-sonnet-5",
53
+ "wireApi": "anthropic",
54
+ "reasoningEffort": "high"
55
+ }
56
+ }
57
+ ```
58
+
59
+ #### `reasoningEffort` (optional)
60
+
61
+ Controls the depth of model reasoning. Valid values: `"high"` | `"max"`. Defaults to `"high"`. When set to `"max"` the model spends more tokens on deeper reasoning before responding — useful for complex logic, math, or multi-step analysis. The current setting is shown in the TUI header (e.g. ` · reasoning max`). Requires a model that supports the `reasoning_effort` parameter.
62
+
39
63
  ### Proxy
40
64
 
41
65
  The agent automatically routes HTTP requests through a proxy when the standard environment variables are set:
package/dist/config.js CHANGED
@@ -7,6 +7,8 @@ const LLMConfig = z.object({
7
7
  baseUrl: z.string(),
8
8
  apiKey: z.string(),
9
9
  model: z.string(),
10
+ reasoningEffort: z.enum(["high", "max"]).default("high"),
11
+ wireApi: z.enum(["completions", "anthropic"]).default("completions"),
10
12
  });
11
13
  const StdioServerConfig = z.object({
12
14
  type: z.literal("stdio").optional(),
package/dist/tui/App.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
- import { Box, render, useApp, useInput, useWindowSize } from "ink";
3
+ import { Box, render, Text, useApp, useInput, useWindowSize } from "ink";
4
4
  import { Markdown } from "./components/Markdown.js";
5
- import { TimelineList } from "./TimelineList.js";
5
+ import { TimelineView } from "./TimelineView.js";
6
6
  import { TodoView } from "./TodoView.js";
7
7
  import { AppHeader } from "./AppHeader.js";
8
8
  import { PromptOrCommandInput } from "./PromptOrCommandInput.js";
@@ -14,10 +14,14 @@ export function App({ session }) {
14
14
  const { exit } = useApp();
15
15
  const { columns } = useWindowSize();
16
16
  const view = useSyncExternalStore(session.subscribe, session.getSnapshot);
17
- const [runState, setRunState] = useState({ running: false, elapsed: 0, promptTokens: 0, completionTokens: 0 });
17
+ const [runState, setRunState] = useState({ running: false, elapsed: 0, thinkingElapsed: 0, replyElapsed: 0, promptTokens: 0, completionTokens: 0 });
18
18
  const [streamingText, setStreamingText] = useState("");
19
19
  const streamingRef = useRef("");
20
20
  const renderTimerRef = useRef(undefined);
21
+ const [reasoningText, setReasoningText] = useState("");
22
+ const reasoningRef = useRef("");
23
+ const reasoningRenderTimerRef = useRef(undefined);
24
+ const [showReasoning, setShowReasoning] = useState(false);
21
25
  const allCmds = useMemo(() => session.commandSchemas, [session]);
22
26
  const pendingQuestion = session.getPendingQuestion();
23
27
  useEffect(() => {
@@ -27,6 +31,14 @@ export function App({ session }) {
27
31
  streamingRef.current += e.text;
28
32
  scheduleStreamingRender();
29
33
  break;
34
+ case "reasoning_delta":
35
+ reasoningRef.current += e.text;
36
+ scheduleReasoningRender();
37
+ break;
38
+ case "reasoning_clear":
39
+ reasoningRef.current = "";
40
+ setReasoningText("");
41
+ break;
30
42
  case "assistant":
31
43
  streamingRef.current = "";
32
44
  setStreamingText("");
@@ -46,12 +58,24 @@ export function App({ session }) {
46
58
  setStreamingText(streamingRef.current);
47
59
  }, STREAM_FRAME_MS);
48
60
  };
61
+ const scheduleReasoningRender = () => {
62
+ if (reasoningRenderTimerRef.current)
63
+ return;
64
+ reasoningRenderTimerRef.current = setTimeout(() => {
65
+ reasoningRenderTimerRef.current = undefined;
66
+ setReasoningText(reasoningRef.current);
67
+ }, STREAM_FRAME_MS);
68
+ };
49
69
  useInput((_input, key) => {
50
70
  if (pendingQuestion) {
51
71
  if (key.ctrl && _input === "c")
52
72
  session.abort();
53
73
  return;
54
74
  }
75
+ if (_input === "t" && runState.running && reasoningText) {
76
+ setShowReasoning((v) => !v);
77
+ return;
78
+ }
55
79
  if (key.escape) {
56
80
  session.abort();
57
81
  }
@@ -68,28 +92,28 @@ export function App({ session }) {
68
92
  exit();
69
93
  }
70
94
  async function handlePrompt(text) {
71
- const [first, ...rest] = text.split(/\s+/);
72
- if (first.startsWith("/") || session.isCommand(first)) {
73
- const name = first.startsWith("/") ? first.slice(1) : first;
74
- await handleCommand(name, rest.join(" "));
75
- }
76
- else {
77
- await session.startPrompt(text);
78
- }
95
+ await session.startPrompt(text);
79
96
  }
80
97
  let runningView = null;
81
98
  if (runState.running) {
82
99
  if (pendingQuestion) {
83
100
  runningView = (_jsx(QuestionView, { question: pendingQuestion, onAnswer: (ans) => session.submitAnswer(pendingQuestion.id, ans) }));
84
101
  }
85
- else if (streamingText) {
86
- runningView = (_jsx(Box, { marginTop: 1, paddingLeft: 1, paddingRight: 1, borderStyle: "single", borderTop: false, borderRight: false, borderBottom: false, borderColor: "gray", children: _jsx(Markdown, { color: "green", children: streamingText }) }));
87
- }
88
102
  else {
89
- runningView = (_jsx(Box, { marginTop: 1, paddingLeft: 1, children: _jsx(Spinner, { label: "thinking", elapsed: runState.elapsed, promptTokens: runState.promptTokens, completionTokens: runState.completionTokens }) }));
103
+ const spinnerLabel = streamingText ? "replying" : "thinking";
104
+ runningView = (_jsxs(_Fragment, { children: [reasoningText ? renderReasoning(reasoningText, showReasoning) : null, streamingText ? (_jsx(Box, { marginTop: 1, paddingLeft: 1, paddingRight: 1, borderStyle: "single", borderTop: false, borderRight: false, borderBottom: false, borderColor: "gray", children: _jsx(Markdown, { children: streamingText }) })) : null, _jsx(Box, { marginTop: 1, paddingLeft: 1, children: _jsx(Spinner, { label: spinnerLabel, thinkingElapsed: runState.thinkingElapsed, replyElapsed: runState.replyElapsed, promptTokens: runState.promptTokens, completionTokens: runState.completionTokens }) })] }));
90
105
  }
91
106
  }
92
- return (_jsxs(Box, { width: columns, flexDirection: "column", children: [_jsx(AppHeader, { cwd: session.cwd }), _jsx(TimelineList, { session: session }), view.todos.length > 0 ? _jsx(TodoView, { todos: view.todos }) : null, runningView, !runState.running ? (_jsxs(_Fragment, { children: [_jsx(StatusBar, { contextTokens: session.contextTokens }), _jsx(PromptOrCommandInput, { commands: allCmds, onCommand: handleCommand, onPrompt: handlePrompt })] })) : null] }));
107
+ return (_jsxs(Box, { width: columns, flexDirection: "column", children: [_jsx(AppHeader, { cwd: session.cwd, model: session.model, reasoningEffort: session.reasoningEffort }), view.timeline.length > 0 ? (_jsx(Box, { flexDirection: "column", paddingLeft: 1, paddingRight: 1, children: view.timeline.map((entry, i) => (_jsx(TimelineView, { entry: entry }, i))) })) : null, runningView, view.todos.length > 0 ? _jsx(TodoView, { todos: view.todos }) : null, !runState.running ? (_jsx(PromptOrCommandInput, { commands: allCmds, onCommand: handleCommand, onPrompt: handlePrompt })) : null, _jsx(StatusBar, { contextTokens: session.contextTokens, contextLimit: session.compactThreshold, running: runState.running, questionPending: !!pendingQuestion, reasoningAvailable: !!reasoningText })] }));
108
+ }
109
+ function renderReasoning(text, expanded) {
110
+ const lines = text.split("\n");
111
+ const firstLine = (lines[0] ?? "").slice(0, 80);
112
+ if (expanded) {
113
+ return (_jsxs(Box, { marginTop: 1, paddingLeft: 1, flexDirection: "column", children: [_jsx(Text, { dimColor: true, children: "\u250A thinking (t to collapse)" }), _jsx(Box, { paddingLeft: 1, children: _jsx(Text, { dimColor: true, children: text }) })] }));
114
+ }
115
+ const extra = lines.length > 1 ? ` …+${lines.length - 1} lines` : "";
116
+ return (_jsx(Box, { marginTop: 1, paddingLeft: 1, children: _jsxs(Text, { dimColor: true, children: ["\u250A ", firstLine, extra, " (t to expand)"] }) }));
93
117
  }
94
118
  export function startApp(session) {
95
119
  process.stdout.write("");
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo } from "react";
3
3
  import { Box, Text, useWindowSize } from "ink";
4
4
  import { getPackageInfo } from "../util/package.js";
5
- export const AppHeader = memo(function AppHeader({ cwd }) {
5
+ export const AppHeader = memo(function AppHeader({ cwd, model, reasoningEffort }) {
6
6
  const { columns } = useWindowSize();
7
7
  const pkginfo = getPackageInfo();
8
- return (_jsxs(Box, { width: columns, paddingX: 1, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Easy Agent" }), _jsxs(Text, { dimColor: true, children: [" v", pkginfo.version] })] }), _jsx(Text, { dimColor: true, children: cwd })] }));
8
+ const reasoning = ` · reasoning ${reasoningEffort}`;
9
+ return (_jsxs(Box, { width: columns, paddingX: 1, flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: "Easy Agent" }), _jsxs(Text, { dimColor: true, children: [" v", pkginfo.version] })] }), _jsx(Text, { dimColor: true, children: `${model}${reasoning}` })] }), _jsx(Text, { dimColor: true, children: cwd })] }));
9
10
  });
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Component } from "react";
3
+ import { Box, Text } from "ink";
4
+ export class ErrorBoundary extends Component {
5
+ state = { error: null };
6
+ static getDerivedStateFromError(error) {
7
+ return { error };
8
+ }
9
+ render() {
10
+ if (this.state.error) {
11
+ return (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [_jsx(Text, { color: "red", bold: true, children: "\u2717 TUI Error" }), _jsx(Text, { dimColor: true, children: this.state.error.message })] }));
12
+ }
13
+ return this.props.children;
14
+ }
15
+ }
@@ -56,10 +56,15 @@ export function PromptOrCommandInput({ commands, onCommand, onPrompt }) {
56
56
  }
57
57
  return;
58
58
  }
59
+ const [first, ...rest] = text.split(/\s+/);
60
+ if (commands.some((c) => c.name === first)) {
61
+ onCommand(first, rest.join(" "));
62
+ return;
63
+ }
59
64
  onPrompt(text);
60
65
  };
61
66
  return (_jsxs(Box, { flexDirection: "column", children: [showMenu && filtered.length > 0 ? (_jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", children: visibleItems.items.map((cmd, i) => {
62
67
  const realIdx = visibleItems.start + i;
63
68
  return (_jsxs(Box, { children: [_jsxs(Text, { color: realIdx === selectedIndex ? "cyan" : undefined, children: [realIdx === selectedIndex ? "▸ " : " ", "/", cmd.name] }), _jsxs(Text, { dimColor: true, children: [" ", cmd.description] })] }, cmd.name));
64
- }) })) : null, _jsxs(Box, { borderStyle: "single", borderLeft: false, borderRight: false, borderColor: "gray", children: [_jsx(Text, { color: "gray", children: "> " }), _jsx(TextInput, { value: input, onChange: setInput, onSubmit: onSubmit })] })] }));
69
+ }) })) : null, _jsxs(Box, { borderStyle: "single", borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", children: [_jsx(Text, { color: "gray", children: "> " }), _jsx(TextInput, { value: input, onChange: setInput, onSubmit: onSubmit })] })] }));
65
70
  }
@@ -39,7 +39,7 @@ export function QuestionView({ question, onAnswer }) {
39
39
  }
40
40
  });
41
41
  if (mode === "input") {
42
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 1, paddingRight: 1, children: [_jsx(Text, { color: "cyan", children: `? ${question.text}` }), _jsxs(Box, { borderStyle: "single", borderLeft: false, borderRight: false, borderColor: "gray", children: [_jsx(Text, { color: "gray", children: "\u276F " }), _jsx(TextInput, { value: text, onChange: setText, onSubmit: () => onAnswer(text) })] })] }));
42
+ return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 1, paddingRight: 1, children: [_jsx(Text, { color: "cyan", children: `? ${question.text}` }), _jsxs(Box, { borderStyle: "single", borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", children: [_jsx(Text, { color: "gray", children: "\u276F " }), _jsx(TextInput, { value: text, onChange: setText, onSubmit: () => onAnswer(text) })] })] }));
43
43
  }
44
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 1, paddingRight: 1, children: [_jsx(Text, { color: "cyan", children: `? ${question.text}` }), _jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", children: items.map((item, i) => (_jsx(Box, { children: _jsxs(Text, { color: i === selected ? "cyan" : undefined, children: [i === selected ? "▸ " : " ", item] }) }, item))) })] }));
44
+ return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 1, paddingRight: 1, children: [_jsx(Text, { color: "cyan", children: `? ${question.text}` }), _jsx(Box, { flexDirection: "column", borderStyle: "single", borderBottom: false, borderColor: "gray", children: items.map((item, i) => (_jsx(Box, { children: _jsxs(Text, { color: i === selected ? "cyan" : undefined, children: [i === selected ? "▸ " : " ", item] }) }, item))) })] }));
45
45
  }
@@ -3,11 +3,11 @@ import { useEffect, useState } from "react";
3
3
  import { Text } from "ink";
4
4
  import { timeDisplay, compactDisplay } from "../util/format.js";
5
5
  const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
6
- export function Spinner({ label, elapsed, promptTokens, completionTokens, }) {
6
+ export function Spinner({ label, thinkingElapsed, replyElapsed, promptTokens, completionTokens, }) {
7
7
  const [frame, setFrame] = useState(0);
8
8
  useEffect(() => {
9
9
  const id = setInterval(() => setFrame((f) => (f + 1) % SPINNER_FRAMES.length), 80);
10
10
  return () => clearInterval(id);
11
11
  }, []);
12
- return (_jsxs(Text, { children: [_jsx(Text, { color: "cyan", children: SPINNER_FRAMES[frame] }), _jsxs(Text, { children: [" ", label] }), _jsxs(Text, { dimColor: true, children: [" \u00B7 ", timeDisplay(elapsed), " \u00B7 \u2191", compactDisplay(promptTokens), " \u00B7 \u2193", compactDisplay(completionTokens)] })] }));
12
+ return (_jsxs(Text, { children: [_jsx(Text, { color: "cyan", children: SPINNER_FRAMES[frame] }), _jsxs(Text, { children: [" ", label] }), _jsxs(Text, { dimColor: true, children: [" \u00B7 think ", timeDisplay(thinkingElapsed), " \u00B7 reply ", timeDisplay(replyElapsed), " \u00B7 \u2191", compactDisplay(promptTokens), " \u00B7 \u2193", compactDisplay(completionTokens)] })] }));
13
13
  }
@@ -1,8 +1,19 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo } from "react";
3
3
  import { Box, Text, useWindowSize } from "ink";
4
4
  import { compactDisplay } from "../util/format.js";
5
- export const StatusBar = memo(function StatusBar({ contextTokens }) {
5
+ export const StatusBar = memo(function StatusBar({ contextTokens, contextLimit, running, questionPending, reasoningAvailable }) {
6
6
  const { columns } = useWindowSize();
7
- return (_jsx(Box, { width: columns, paddingX: 1, flexDirection: "row", children: _jsxs(Text, { dimColor: true, children: ["Context: ", compactDisplay(contextTokens), " tokens \u00B7 ESC to stop \u00B7 / for commands"] }) }));
7
+ const pct = Math.min(100, contextLimit > 0 ? Math.round((contextTokens / contextLimit) * 100) : 0);
8
+ const filled = Math.round((pct / 100) * 10);
9
+ const bar = "█".repeat(filled) + "░".repeat(10 - filled);
10
+ const ctxColor = pct >= 85 ? "red" : pct >= 60 ? "yellow" : "green";
11
+ let hints;
12
+ if (questionPending)
13
+ hints = "↑↓ select · enter confirm · esc skip";
14
+ else if (running)
15
+ hints = reasoningAvailable ? "esc stop · t reasoning" : "esc stop";
16
+ else
17
+ hints = "/ commands";
18
+ return (_jsxs(Box, { width: columns, paddingX: 1, flexDirection: "row", justifyContent: "space-between", borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", children: [_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: `ctx ${compactDisplay(contextTokens)} ` }), _jsx(Text, { color: ctxColor, children: `▕${bar}▏ ${pct}%` })] }), _jsx(Text, { dimColor: true, children: hints })] }));
8
19
  });
@@ -18,7 +18,7 @@ export const TimelineView = memo(function Entry({ entry }) {
18
18
  case "skill":
19
19
  return (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsx(Text, { color: "magenta", children: "\u25C8 " }), _jsx(Text, { dimColor: true, children: "skill " }), _jsx(Text, { color: "magenta", bold: true, children: entry.name })] }) }));
20
20
  case "assistant":
21
- return (_jsx(Box, { marginTop: 1, children: _jsx(Markdown, { color: "green", children: entry.text }) }));
21
+ return (_jsx(Box, { marginTop: 1, children: _jsx(Markdown, { children: entry.text }) }));
22
22
  case "tool":
23
23
  return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { children: [_jsx(Text, { color: "yellow", children: "\u25CF " }), _jsx(Text, { color: "yellow", bold: true, children: entry.name }), entry.summary ? _jsxs(Text, { dimColor: true, children: [" ", entry.summary] }) : null] }), entry.result !== null ? (_jsx(Text, { color: entry.isError ? "red" : "gray", children: ` ${preview(entry.isError ?? false, entry.result)}` })) : null] }));
24
24
  case "retry":
@@ -12,8 +12,7 @@ const COLORS = {
12
12
  completed: "green",
13
13
  };
14
14
  export const TodoView = memo(function TodoView({ todos }) {
15
- if (todos.length === 0)
16
- return null;
17
15
  const done = todos.filter((t) => t.status === "completed").length;
18
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 1, paddingRight: 1, children: [_jsx(Text, { dimColor: true, children: `Tasks [${done}/${todos.length}]` }), todos.map((t, i) => (_jsx(Text, { color: COLORS[t.status], strikethrough: t.status === "completed", children: `${ICONS[t.status]} ${t.content}` }, i)))] }));
16
+ const headerColor = done === todos.length ? "green" : "cyan";
17
+ return (_jsxs(Box, { flexDirection: "column", paddingLeft: 1, paddingRight: 1, children: [_jsx(Box, { borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray" }), _jsx(Text, { color: headerColor, children: `Tasks [${done}/${todos.length}]` }), todos.map((t, i) => (_jsx(Text, { color: COLORS[t.status], strikethrough: t.status === "completed", children: `${ICONS[t.status]} ${t.content}` }, i)))] }));
19
18
  });
@@ -4,14 +4,14 @@ import { Box, Text } from "ink";
4
4
  import { lexer } from "marked";
5
5
  import stringWidth from "string-width";
6
6
  const HEADING_COLOR = ["magentaBright", "cyanBright", "blue", "yellow", "green", "gray"];
7
- export function Markdown({ children, color }) {
7
+ export function Markdown({ children }) {
8
8
  const tokens = useMemo(() => lexer(children, { gfm: true }), [children]);
9
- return _jsx(Box, { flexDirection: "column", children: renderBlocks(tokens, color) });
9
+ return _jsx(Box, { flexDirection: "column", children: renderBlocks(tokens) });
10
10
  }
11
- function renderBlocks(tokens, color) {
12
- return tokens.map((token, i) => (_jsx(Fragment, { children: renderBlock(token, color) }, i)));
11
+ function renderBlocks(tokens) {
12
+ return tokens.map((token, i) => (_jsx(Fragment, { children: renderBlock(token) }, i)));
13
13
  }
14
- function renderBlock(token, color) {
14
+ function renderBlock(token) {
15
15
  switch (token.type) {
16
16
  case "space":
17
17
  return _jsx(Text, { children: " " });
@@ -22,15 +22,15 @@ function renderBlock(token, color) {
22
22
  case "code":
23
23
  return (_jsxs(Box, { borderStyle: "round", borderColor: "gray", paddingX: 1, flexDirection: "column", children: [token.lang ? _jsx(Text, { dimColor: true, children: token.lang }) : null, _jsx(Text, { children: token.text })] }));
24
24
  case "blockquote":
25
- return (_jsx(Box, { borderStyle: "single", borderTop: false, borderBottom: false, borderRight: false, borderColor: "gray", paddingLeft: 1, children: renderBlocks(token.tokens, color) }));
25
+ return (_jsx(Box, { borderStyle: "single", borderTop: false, borderBottom: false, borderRight: false, borderColor: "gray", paddingLeft: 1, children: renderBlocks(token.tokens) }));
26
26
  case "list":
27
- return renderList(token, color);
27
+ return renderList(token);
28
28
  case "table":
29
- return renderTable(token, color);
29
+ return renderTable(token);
30
30
  case "paragraph":
31
- return _jsx(Text, { color: color, children: renderInline(token.tokens) });
31
+ return _jsx(Text, { children: renderInline(token.tokens) });
32
32
  case "text":
33
- return _jsx(Text, { color: color, children: token.tokens ? renderInline(token.tokens) : token.text });
33
+ return _jsx(Text, { children: token.tokens ? renderInline(token.tokens) : token.text });
34
34
  case "html":
35
35
  return _jsx(Text, { dimColor: true, children: token.text });
36
36
  default:
@@ -68,7 +68,7 @@ function renderInline(tokens) {
68
68
  }
69
69
  });
70
70
  }
71
- function renderList(token, color) {
71
+ function renderList(token) {
72
72
  const markers = token.items.map((item, i) => {
73
73
  if (item.task)
74
74
  return item.checked ? "[x]" : "[ ]";
@@ -77,9 +77,9 @@ function renderList(token, color) {
77
77
  return "•";
78
78
  });
79
79
  const markerWidth = Math.max(1, ...markers.map((s) => stringWidth(s)));
80
- return (_jsx(Box, { flexDirection: "column", children: token.items.map((item, i) => (_jsxs(Box, { marginTop: token.loose && i > 0 ? 1 : 0, children: [_jsxs(Text, { color: color, children: [padAlign(markers[i], markerWidth, "right"), " "] }), _jsx(Box, { flexDirection: "column", flexGrow: 1, children: renderBlocks(item.tokens, color) })] }, i))) }));
80
+ return (_jsx(Box, { flexDirection: "column", children: token.items.map((item, i) => (_jsxs(Box, { marginTop: token.loose && i > 0 ? 1 : 0, children: [_jsxs(Text, { children: [padAlign(markers[i], markerWidth, "right"), " "] }), _jsx(Box, { flexDirection: "column", flexGrow: 1, children: renderBlocks(item.tokens) })] }, i))) }));
81
81
  }
82
- function renderTable(token, color) {
82
+ function renderTable(token) {
83
83
  const aligns = token.align;
84
84
  const cols = token.header.length;
85
85
  const overhead = 3 * cols + 1;
@@ -99,7 +99,7 @@ function renderTable(token, color) {
99
99
  return Array.from({ length: height }, (_, r) => (_jsx(Text, { children: [
100
100
  ...row.flatMap((_, c) => [
101
101
  _jsx(Text, { dimColor: true, children: "\u2502" }, `s${c}`),
102
- _jsx(Text, { color: color, bold: bold, children: ` ${padAlign(wrapped[c][r] ?? "", widths[c], aligns[c])} ` }, `c${c}`),
102
+ _jsx(Text, { bold: bold, children: ` ${padAlign(wrapped[c][r] ?? "", widths[c], aligns[c])} ` }, `c${c}`),
103
103
  ]),
104
104
  _jsx(Text, { dimColor: true, children: "\u2502" }, "e"),
105
105
  ] }, r)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vietor/easy-agent",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "react": "^19.2.7",
24
24
  "string-width": "^8.2.1",
25
25
  "zod": "^4.4.3",
26
- "@vietor/easy-agent-core": "0.4.5"
26
+ "@vietor/easy-agent-core": "0.4.7"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^22.0.0",