@phren/agent 0.1.8 → 0.1.9
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/commands/info.js +1 -0
- package/dist/commands/model.js +5 -4
- package/dist/commands/session.js +24 -2
- package/dist/commands.js +36 -1
- package/dist/config.js +27 -11
- package/dist/cost.js +11 -74
- package/dist/index.js +92 -35
- package/dist/mcp-client.js +4 -2
- package/dist/memory/context.js +56 -24
- package/dist/memory/session.js +21 -88
- package/dist/models.js +390 -0
- package/dist/multi/agent-types.js +170 -0
- package/dist/multi/child-entry.js +248 -78
- package/dist/multi/coordinator.js +69 -1
- package/dist/multi/diff-renderer.js +193 -17
- package/dist/multi/markdown.js +49 -23
- package/dist/multi/model-picker.js +12 -21
- package/dist/multi/multi-events.js +17 -0
- package/dist/multi/multi-render.js +1 -0
- package/dist/multi/provider-manager.js +23 -13
- package/dist/multi/spawner.js +84 -7
- package/dist/multi/syntax-highlight.js +64 -48
- package/dist/multi/worktree.js +43 -0
- package/dist/package-metadata.js +11 -0
- package/dist/permissions/checker.js +21 -1
- package/dist/providers/codex-auth.js +48 -34
- package/dist/providers/codex.js +110 -40
- package/dist/providers/ollama.js +5 -4
- package/dist/providers/openrouter.js +12 -5
- package/dist/providers/resolve.js +50 -32
- package/dist/providers/types.js +0 -1
- package/dist/repl.js +19 -34
- package/dist/tools/grep.js +111 -23
- package/dist/tools/mcp-resources.js +32 -0
- package/dist/tools/registry.js +13 -2
- package/dist/tools/shell.js +101 -3
- package/dist/tools/skill.js +44 -0
- package/dist/tools/spawn-agent.js +158 -0
- package/dist/tui/ansi.js +15 -11
- package/dist/tui/components/App.js +179 -8
- package/dist/tui/components/Banner.js +7 -4
- package/dist/tui/components/InputArea.js +54 -12
- package/dist/tui/components/PhrenInput.js +329 -0
- package/dist/tui/components/StatusBar.js +3 -1
- package/dist/tui/components/SteerQueue.js +4 -2
- package/dist/tui/components/ThinkingIndicator.js +7 -5
- package/dist/tui/components/ToolCall.js +12 -8
- package/dist/tui/components/ToolSpinner.js +13 -0
- package/dist/tui/hooks/useKeyboardShortcuts.js +65 -24
- package/dist/tui/hooks/useSearch.js +47 -0
- package/dist/tui/hooks/useSlashCommands.js +16 -19
- package/dist/tui/ink-entry.js +373 -14
- package/dist/tui/mouse.js +71 -0
- package/dist/tui/terminal-control.js +62 -0
- package/dist/tui/themes.js +398 -0
- package/dist/tui/tool-render.js +12 -1
- package/dist/tui.js +2 -1
- package/package.json +1 -3
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme system — semantic color keys for every TUI element.
|
|
3
|
+
*
|
|
4
|
+
* Ink components use Ink color strings (e.g., "magenta", "#7C3AED").
|
|
5
|
+
* Raw ANSI renderers (markdown, syntax, diff) use ANSI escape sequences.
|
|
6
|
+
*/
|
|
7
|
+
const ESC = "\x1b[";
|
|
8
|
+
const RESET = `${ESC}0m`;
|
|
9
|
+
// ── Theme presets ───────────────────────────────────────────────────────────
|
|
10
|
+
export const DARK_THEME = {
|
|
11
|
+
name: "dark",
|
|
12
|
+
user: { label: "\u276f", color: "white", bold: true },
|
|
13
|
+
agent: { label: "\u25c6", color: "magenta" },
|
|
14
|
+
system: { color: "gray" },
|
|
15
|
+
tool: {
|
|
16
|
+
success: "green",
|
|
17
|
+
error: "red",
|
|
18
|
+
name: "cyan",
|
|
19
|
+
preview: "gray",
|
|
20
|
+
duration: "gray",
|
|
21
|
+
output: "gray",
|
|
22
|
+
border: "gray",
|
|
23
|
+
},
|
|
24
|
+
thinking: {
|
|
25
|
+
primary: [155, 140, 250],
|
|
26
|
+
secondary: [40, 211, 242],
|
|
27
|
+
verb: "magenta",
|
|
28
|
+
elapsed: "gray",
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
separator: "gray",
|
|
32
|
+
prompt: "cyan",
|
|
33
|
+
bashPrompt: "yellow",
|
|
34
|
+
placeholder: "gray",
|
|
35
|
+
},
|
|
36
|
+
statusBar: {
|
|
37
|
+
background: "gray",
|
|
38
|
+
text: "white",
|
|
39
|
+
accent: "cyan",
|
|
40
|
+
separator: "gray",
|
|
41
|
+
},
|
|
42
|
+
permission: {
|
|
43
|
+
suggest: "cyan",
|
|
44
|
+
auto: "green",
|
|
45
|
+
plan: "magenta",
|
|
46
|
+
fullAuto: "yellow",
|
|
47
|
+
},
|
|
48
|
+
markdown: {
|
|
49
|
+
heading: `${ESC}1m${ESC}36m`, // bold cyan
|
|
50
|
+
bold: `${ESC}1m`, // bold
|
|
51
|
+
italic: `${ESC}3m`, // italic
|
|
52
|
+
code: `${ESC}36m${ESC}7m`, // cyan inverse
|
|
53
|
+
codeBlockBorder: `${ESC}2m`, // dim
|
|
54
|
+
codeBlockLabel: `${ESC}2m${ESC}33m`, // dim yellow
|
|
55
|
+
bullet: `${ESC}33m`, // yellow
|
|
56
|
+
link: `${ESC}4m${ESC}36m`, // underline cyan
|
|
57
|
+
reset: RESET,
|
|
58
|
+
},
|
|
59
|
+
syntax: {
|
|
60
|
+
keyword: `${ESC}35m`, // magenta
|
|
61
|
+
string: `${ESC}32m`, // green
|
|
62
|
+
number: `${ESC}33m`, // yellow
|
|
63
|
+
comment: `${ESC}90m`, // gray
|
|
64
|
+
type: `${ESC}36m`, // cyan
|
|
65
|
+
variable: `${ESC}33m`, // yellow
|
|
66
|
+
operator: `${ESC}36m`, // cyan
|
|
67
|
+
reset: RESET,
|
|
68
|
+
},
|
|
69
|
+
diff: {
|
|
70
|
+
added: `${ESC}32m`, // green
|
|
71
|
+
removed: `${ESC}31m`, // red
|
|
72
|
+
context: `${ESC}2m`, // dim
|
|
73
|
+
lineNumber: `${ESC}90m`, // gray
|
|
74
|
+
header: `${ESC}36m`, // cyan
|
|
75
|
+
separator: `${ESC}2m`, // dim
|
|
76
|
+
reset: RESET,
|
|
77
|
+
},
|
|
78
|
+
agentTab: {
|
|
79
|
+
active: "magentaBright",
|
|
80
|
+
inactive: "gray",
|
|
81
|
+
running: "cyan",
|
|
82
|
+
idle: "gray",
|
|
83
|
+
done: "green",
|
|
84
|
+
error: "red",
|
|
85
|
+
},
|
|
86
|
+
text: "white",
|
|
87
|
+
dim: "gray",
|
|
88
|
+
accent: "cyan",
|
|
89
|
+
warning: "yellow",
|
|
90
|
+
error: "red",
|
|
91
|
+
success: "green",
|
|
92
|
+
info: "blue",
|
|
93
|
+
banner: {
|
|
94
|
+
logo: "magenta",
|
|
95
|
+
version: "gray",
|
|
96
|
+
cwd: "cyan",
|
|
97
|
+
},
|
|
98
|
+
steer: { color: "yellow", icon: "↳" },
|
|
99
|
+
search: { prompt: "cyan", match: "yellow", noMatch: "red" },
|
|
100
|
+
separator: "gray",
|
|
101
|
+
};
|
|
102
|
+
export const LIGHT_THEME = {
|
|
103
|
+
name: "light",
|
|
104
|
+
user: { label: "\u276f", color: "black", bold: true },
|
|
105
|
+
agent: { label: "\u25c6", color: "#7C3AED" },
|
|
106
|
+
system: { color: "gray" },
|
|
107
|
+
tool: {
|
|
108
|
+
success: "#16a34a",
|
|
109
|
+
error: "#dc2626",
|
|
110
|
+
name: "#0891b2",
|
|
111
|
+
preview: "gray",
|
|
112
|
+
duration: "gray",
|
|
113
|
+
output: "gray",
|
|
114
|
+
border: "gray",
|
|
115
|
+
},
|
|
116
|
+
thinking: {
|
|
117
|
+
primary: [120, 58, 237],
|
|
118
|
+
secondary: [6, 182, 212],
|
|
119
|
+
verb: "#7C3AED",
|
|
120
|
+
elapsed: "gray",
|
|
121
|
+
},
|
|
122
|
+
input: {
|
|
123
|
+
separator: "gray",
|
|
124
|
+
prompt: "#0891b2",
|
|
125
|
+
bashPrompt: "#ca8a04",
|
|
126
|
+
placeholder: "gray",
|
|
127
|
+
},
|
|
128
|
+
statusBar: {
|
|
129
|
+
background: "gray",
|
|
130
|
+
text: "black",
|
|
131
|
+
accent: "#0891b2",
|
|
132
|
+
separator: "gray",
|
|
133
|
+
},
|
|
134
|
+
permission: {
|
|
135
|
+
suggest: "#0891b2",
|
|
136
|
+
auto: "#16a34a",
|
|
137
|
+
plan: "#7C3AED",
|
|
138
|
+
fullAuto: "#ca8a04",
|
|
139
|
+
},
|
|
140
|
+
markdown: {
|
|
141
|
+
heading: `${ESC}1m${ESC}34m`, // bold blue
|
|
142
|
+
bold: `${ESC}1m`,
|
|
143
|
+
italic: `${ESC}3m`,
|
|
144
|
+
code: `${ESC}34m${ESC}7m`, // blue inverse
|
|
145
|
+
codeBlockBorder: `${ESC}2m`,
|
|
146
|
+
codeBlockLabel: `${ESC}2m${ESC}34m`,
|
|
147
|
+
bullet: `${ESC}34m`, // blue
|
|
148
|
+
link: `${ESC}4m${ESC}34m`, // underline blue
|
|
149
|
+
reset: RESET,
|
|
150
|
+
},
|
|
151
|
+
syntax: {
|
|
152
|
+
keyword: `${ESC}34m`, // blue
|
|
153
|
+
string: `${ESC}32m`, // green
|
|
154
|
+
number: `${ESC}35m`, // magenta
|
|
155
|
+
comment: `${ESC}90m`, // gray
|
|
156
|
+
type: `${ESC}34m`, // blue
|
|
157
|
+
variable: `${ESC}33m`, // yellow
|
|
158
|
+
operator: `${ESC}36m`, // cyan
|
|
159
|
+
reset: RESET,
|
|
160
|
+
},
|
|
161
|
+
diff: {
|
|
162
|
+
added: `${ESC}32m`,
|
|
163
|
+
removed: `${ESC}31m`,
|
|
164
|
+
context: `${ESC}2m`,
|
|
165
|
+
lineNumber: `${ESC}90m`,
|
|
166
|
+
header: `${ESC}34m`,
|
|
167
|
+
separator: `${ESC}2m`,
|
|
168
|
+
reset: RESET,
|
|
169
|
+
},
|
|
170
|
+
agentTab: {
|
|
171
|
+
active: "#7C3AED",
|
|
172
|
+
inactive: "gray",
|
|
173
|
+
running: "#0891b2",
|
|
174
|
+
idle: "gray",
|
|
175
|
+
done: "#16a34a",
|
|
176
|
+
error: "#dc2626",
|
|
177
|
+
},
|
|
178
|
+
text: "black",
|
|
179
|
+
dim: "gray",
|
|
180
|
+
accent: "#0891b2",
|
|
181
|
+
warning: "#ca8a04",
|
|
182
|
+
error: "#dc2626",
|
|
183
|
+
success: "#16a34a",
|
|
184
|
+
info: "#2563eb",
|
|
185
|
+
banner: {
|
|
186
|
+
logo: "#7C3AED",
|
|
187
|
+
version: "gray",
|
|
188
|
+
cwd: "#0891b2",
|
|
189
|
+
},
|
|
190
|
+
steer: { color: "#ca8a04", icon: "↳" },
|
|
191
|
+
search: { prompt: "#0891b2", match: "#ca8a04", noMatch: "#dc2626" },
|
|
192
|
+
separator: "gray",
|
|
193
|
+
};
|
|
194
|
+
export const SOLARIZED_THEME = {
|
|
195
|
+
name: "solarized",
|
|
196
|
+
user: { label: "\u276f", color: "#839496", bold: true },
|
|
197
|
+
agent: { label: "\u25c6", color: "#b58900" },
|
|
198
|
+
system: { color: "#586e75" },
|
|
199
|
+
tool: {
|
|
200
|
+
success: "#859900",
|
|
201
|
+
error: "#dc322f",
|
|
202
|
+
name: "#268bd2",
|
|
203
|
+
preview: "#586e75",
|
|
204
|
+
duration: "#586e75",
|
|
205
|
+
output: "#586e75",
|
|
206
|
+
border: "#586e75",
|
|
207
|
+
},
|
|
208
|
+
thinking: {
|
|
209
|
+
primary: [181, 137, 0],
|
|
210
|
+
secondary: [38, 139, 210],
|
|
211
|
+
verb: "#b58900",
|
|
212
|
+
elapsed: "#586e75",
|
|
213
|
+
},
|
|
214
|
+
input: {
|
|
215
|
+
separator: "#586e75",
|
|
216
|
+
prompt: "#268bd2",
|
|
217
|
+
bashPrompt: "#b58900",
|
|
218
|
+
placeholder: "#586e75",
|
|
219
|
+
},
|
|
220
|
+
statusBar: {
|
|
221
|
+
background: "#073642",
|
|
222
|
+
text: "#839496",
|
|
223
|
+
accent: "#268bd2",
|
|
224
|
+
separator: "#586e75",
|
|
225
|
+
},
|
|
226
|
+
permission: {
|
|
227
|
+
suggest: "#2aa198",
|
|
228
|
+
auto: "#859900",
|
|
229
|
+
plan: "#6c71c4",
|
|
230
|
+
fullAuto: "#b58900",
|
|
231
|
+
},
|
|
232
|
+
markdown: {
|
|
233
|
+
heading: `${ESC}1m${ESC}33m`,
|
|
234
|
+
bold: `${ESC}1m`,
|
|
235
|
+
italic: `${ESC}3m`,
|
|
236
|
+
code: `${ESC}36m${ESC}7m`,
|
|
237
|
+
codeBlockBorder: `${ESC}2m`,
|
|
238
|
+
codeBlockLabel: `${ESC}2m${ESC}33m`,
|
|
239
|
+
bullet: `${ESC}33m`,
|
|
240
|
+
link: `${ESC}4m${ESC}36m`,
|
|
241
|
+
reset: RESET,
|
|
242
|
+
},
|
|
243
|
+
syntax: {
|
|
244
|
+
keyword: `${ESC}32m`, // solarized green
|
|
245
|
+
string: `${ESC}36m`, // cyan
|
|
246
|
+
number: `${ESC}35m`, // magenta
|
|
247
|
+
comment: `${ESC}90m`, // base01
|
|
248
|
+
type: `${ESC}33m`, // yellow
|
|
249
|
+
variable: `${ESC}34m`, // blue
|
|
250
|
+
operator: `${ESC}32m`, // green
|
|
251
|
+
reset: RESET,
|
|
252
|
+
},
|
|
253
|
+
diff: {
|
|
254
|
+
added: `${ESC}32m`,
|
|
255
|
+
removed: `${ESC}31m`,
|
|
256
|
+
context: `${ESC}2m`,
|
|
257
|
+
lineNumber: `${ESC}90m`,
|
|
258
|
+
header: `${ESC}33m`,
|
|
259
|
+
separator: `${ESC}2m`,
|
|
260
|
+
reset: RESET,
|
|
261
|
+
},
|
|
262
|
+
agentTab: {
|
|
263
|
+
active: "#b58900",
|
|
264
|
+
inactive: "#586e75",
|
|
265
|
+
running: "#268bd2",
|
|
266
|
+
idle: "#586e75",
|
|
267
|
+
done: "#859900",
|
|
268
|
+
error: "#dc322f",
|
|
269
|
+
},
|
|
270
|
+
text: "#839496",
|
|
271
|
+
dim: "#586e75",
|
|
272
|
+
accent: "#268bd2",
|
|
273
|
+
warning: "#b58900",
|
|
274
|
+
error: "#dc322f",
|
|
275
|
+
success: "#859900",
|
|
276
|
+
info: "#268bd2",
|
|
277
|
+
banner: {
|
|
278
|
+
logo: "#b58900",
|
|
279
|
+
version: "#586e75",
|
|
280
|
+
cwd: "#268bd2",
|
|
281
|
+
},
|
|
282
|
+
steer: { color: "#b58900", icon: "↳" },
|
|
283
|
+
search: { prompt: "#268bd2", match: "#b58900", noMatch: "#dc322f" },
|
|
284
|
+
separator: "#586e75",
|
|
285
|
+
};
|
|
286
|
+
export const MONO_THEME = {
|
|
287
|
+
name: "mono",
|
|
288
|
+
user: { label: "\u276f", color: "white", bold: true },
|
|
289
|
+
agent: { label: "\u25c6", color: "white" },
|
|
290
|
+
system: { color: "gray" },
|
|
291
|
+
tool: {
|
|
292
|
+
success: "white",
|
|
293
|
+
error: "white",
|
|
294
|
+
name: "white",
|
|
295
|
+
preview: "gray",
|
|
296
|
+
duration: "gray",
|
|
297
|
+
output: "gray",
|
|
298
|
+
border: "gray",
|
|
299
|
+
},
|
|
300
|
+
thinking: {
|
|
301
|
+
primary: [200, 200, 200],
|
|
302
|
+
secondary: [120, 120, 120],
|
|
303
|
+
verb: "white",
|
|
304
|
+
elapsed: "gray",
|
|
305
|
+
},
|
|
306
|
+
input: {
|
|
307
|
+
separator: "gray",
|
|
308
|
+
prompt: "white",
|
|
309
|
+
bashPrompt: "white",
|
|
310
|
+
placeholder: "gray",
|
|
311
|
+
},
|
|
312
|
+
statusBar: {
|
|
313
|
+
background: "gray",
|
|
314
|
+
text: "white",
|
|
315
|
+
accent: "white",
|
|
316
|
+
separator: "gray",
|
|
317
|
+
},
|
|
318
|
+
permission: {
|
|
319
|
+
suggest: "white",
|
|
320
|
+
auto: "white",
|
|
321
|
+
plan: "white",
|
|
322
|
+
fullAuto: "white",
|
|
323
|
+
},
|
|
324
|
+
markdown: {
|
|
325
|
+
heading: `${ESC}1m`,
|
|
326
|
+
bold: `${ESC}1m`,
|
|
327
|
+
italic: `${ESC}3m`,
|
|
328
|
+
code: `${ESC}7m`,
|
|
329
|
+
codeBlockBorder: `${ESC}2m`,
|
|
330
|
+
codeBlockLabel: `${ESC}2m`,
|
|
331
|
+
bullet: `${ESC}1m`,
|
|
332
|
+
link: `${ESC}4m`,
|
|
333
|
+
reset: RESET,
|
|
334
|
+
},
|
|
335
|
+
syntax: {
|
|
336
|
+
keyword: `${ESC}1m`, // bold
|
|
337
|
+
string: `${ESC}2m`, // dim
|
|
338
|
+
number: `${ESC}0m`, // normal
|
|
339
|
+
comment: `${ESC}2m`, // dim
|
|
340
|
+
type: `${ESC}1m`, // bold
|
|
341
|
+
variable: `${ESC}0m`, // normal
|
|
342
|
+
operator: `${ESC}0m`, // normal
|
|
343
|
+
reset: RESET,
|
|
344
|
+
},
|
|
345
|
+
diff: {
|
|
346
|
+
added: `${ESC}1m`, // bold
|
|
347
|
+
removed: `${ESC}9m`, // strikethrough
|
|
348
|
+
context: `${ESC}2m`, // dim
|
|
349
|
+
lineNumber: `${ESC}2m`, // dim
|
|
350
|
+
header: `${ESC}1m`, // bold
|
|
351
|
+
separator: `${ESC}2m`, // dim
|
|
352
|
+
reset: RESET,
|
|
353
|
+
},
|
|
354
|
+
agentTab: {
|
|
355
|
+
active: "white",
|
|
356
|
+
inactive: "gray",
|
|
357
|
+
running: "white",
|
|
358
|
+
idle: "gray",
|
|
359
|
+
done: "white",
|
|
360
|
+
error: "white",
|
|
361
|
+
},
|
|
362
|
+
text: "white",
|
|
363
|
+
dim: "gray",
|
|
364
|
+
accent: "white",
|
|
365
|
+
warning: "white",
|
|
366
|
+
error: "white",
|
|
367
|
+
success: "white",
|
|
368
|
+
info: "white",
|
|
369
|
+
banner: {
|
|
370
|
+
logo: "white",
|
|
371
|
+
version: "gray",
|
|
372
|
+
cwd: "white",
|
|
373
|
+
},
|
|
374
|
+
steer: { color: "white", icon: "↳" },
|
|
375
|
+
search: { prompt: "white", match: "white", noMatch: "gray" },
|
|
376
|
+
separator: "gray",
|
|
377
|
+
};
|
|
378
|
+
// ── Theme registry ──────────────────────────────────────────────────────────
|
|
379
|
+
const THEMES = {
|
|
380
|
+
dark: DARK_THEME,
|
|
381
|
+
light: LIGHT_THEME,
|
|
382
|
+
solarized: SOLARIZED_THEME,
|
|
383
|
+
mono: MONO_THEME,
|
|
384
|
+
};
|
|
385
|
+
export const THEME_NAMES = Object.keys(THEMES);
|
|
386
|
+
export function getTheme(name) {
|
|
387
|
+
if (name && THEMES[name])
|
|
388
|
+
return THEMES[name];
|
|
389
|
+
// Auto-detect: check COLORFGBG env for light/dark terminal background
|
|
390
|
+
const bg = process.env.COLORFGBG;
|
|
391
|
+
if (bg) {
|
|
392
|
+
const parts = bg.split(";");
|
|
393
|
+
const bgColor = parseInt(parts[parts.length - 1] ?? "0", 10);
|
|
394
|
+
if (bgColor > 8)
|
|
395
|
+
return LIGHT_THEME;
|
|
396
|
+
}
|
|
397
|
+
return DARK_THEME;
|
|
398
|
+
}
|
package/dist/tui/tool-render.js
CHANGED
|
@@ -12,6 +12,16 @@ export function formatDuration(ms) {
|
|
|
12
12
|
const secs = Math.round((ms % 60_000) / 1000);
|
|
13
13
|
return `${mins}m ${secs}s`;
|
|
14
14
|
}
|
|
15
|
+
const FILE_TOOLS = new Set(["read_file", "write_file", "edit_file"]);
|
|
16
|
+
/** Wrap a file path in an OSC 8 hyperlink for terminals that support it. */
|
|
17
|
+
export function fileLink(filePath) {
|
|
18
|
+
const abs = filePath.startsWith("/") ? filePath : `${process.cwd()}/${filePath}`;
|
|
19
|
+
return `\x1b]8;;file://${abs}\x07${filePath}\x1b]8;;\x07`;
|
|
20
|
+
}
|
|
21
|
+
/** Returns true if the tool's preview string is a file path that should be linked. */
|
|
22
|
+
export function isFileToolPreview(name) {
|
|
23
|
+
return FILE_TOOLS.has(name);
|
|
24
|
+
}
|
|
15
25
|
export function formatToolInput(name, input) {
|
|
16
26
|
switch (name) {
|
|
17
27
|
case "read_file":
|
|
@@ -28,9 +38,10 @@ export function formatToolInput(name, input) {
|
|
|
28
38
|
}
|
|
29
39
|
export function renderToolCall(name, input, output, isError, durationMs) {
|
|
30
40
|
const preview = formatToolInput(name, input);
|
|
41
|
+
const linkedPreview = isFileToolPreview(name) && preview ? fileLink(preview) : preview;
|
|
31
42
|
const dur = formatDuration(durationMs);
|
|
32
43
|
const icon = isError ? s.red("✗") : s.green("→");
|
|
33
|
-
const header = ` ${icon} ${s.bold(name)} ${s.gray(
|
|
44
|
+
const header = ` ${icon} ${s.bold(name)} ${s.gray(linkedPreview)} ${s.dim(dur)}`;
|
|
34
45
|
// Compact: show first 3 lines only, with overflow count
|
|
35
46
|
const allLines = output.split("\n").filter(Boolean);
|
|
36
47
|
if (allLines.length === 0)
|
package/dist/tui.js
CHANGED
|
@@ -440,6 +440,7 @@ export async function startTui(config, spawner) {
|
|
|
440
440
|
undoStack: [],
|
|
441
441
|
providerName: config.provider.name,
|
|
442
442
|
currentModel: config.provider.model,
|
|
443
|
+
currentReasoning: config.provider.reasoningEffort ?? null,
|
|
443
444
|
provider: config.provider,
|
|
444
445
|
systemPrompt: config.systemPrompt,
|
|
445
446
|
spawner,
|
|
@@ -451,7 +452,7 @@ export async function startTui(config, spawner) {
|
|
|
451
452
|
// Live model switch — re-resolve provider with new model
|
|
452
453
|
try {
|
|
453
454
|
const { resolveProvider } = await import("./providers/resolve.js");
|
|
454
|
-
const newProvider = resolveProvider(config.provider.name, result.model);
|
|
455
|
+
const newProvider = resolveProvider(config.provider.name, result.model, undefined, result.reasoning ?? undefined);
|
|
455
456
|
config.provider = newProvider;
|
|
456
457
|
// Rebuild system prompt with new model info
|
|
457
458
|
const { buildSystemPrompt } = await import("./system-prompt.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phren/agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Coding agent with persistent memory — powered by phren",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"ink": "^6.8.0",
|
|
17
|
-
"ink-spinner": "^5.0.0",
|
|
18
|
-
"ink-text-input": "^6.0.0",
|
|
19
17
|
"react": "^19.2.4",
|
|
20
18
|
"@phren/cli": "0.1.8"
|
|
21
19
|
},
|