@phren/agent 0.1.5 → 0.1.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/dist/tui/ink-entry.js +0 -12
- package/package.json +2 -2
package/dist/tui/ink-entry.js
CHANGED
|
@@ -99,7 +99,6 @@ export async function startInkTui(config, spawner) {
|
|
|
99
99
|
},
|
|
100
100
|
});
|
|
101
101
|
function handleSubmit(input) {
|
|
102
|
-
console.error(`[BRIDGE] handleSubmit: ${JSON.stringify(input.slice(0, 40))} running=${running}`);
|
|
103
102
|
const line = input.trim();
|
|
104
103
|
if (!line)
|
|
105
104
|
return;
|
|
@@ -173,34 +172,28 @@ export async function startInkTui(config, spawner) {
|
|
|
173
172
|
// TurnHooks bridge — updates mutable state, calls update()
|
|
174
173
|
const tuiHooks = {
|
|
175
174
|
onTextDelta: (text) => {
|
|
176
|
-
console.error(`[BRIDGE] onTextDelta: ${JSON.stringify(text.slice(0, 40))}`);
|
|
177
175
|
thinking = false;
|
|
178
176
|
streamingText += text;
|
|
179
177
|
update();
|
|
180
178
|
},
|
|
181
179
|
onTextDone: () => {
|
|
182
|
-
console.error("[BRIDGE] onTextDone");
|
|
183
180
|
// streaming complete — finalized in runAgentTurn
|
|
184
181
|
},
|
|
185
182
|
onTextBlock: (text) => {
|
|
186
|
-
console.error(`[BRIDGE] onTextBlock: ${JSON.stringify(text.slice(0, 40))}`);
|
|
187
183
|
thinking = false;
|
|
188
184
|
streamingText += text;
|
|
189
185
|
update();
|
|
190
186
|
},
|
|
191
187
|
onToolStart: (_name, _input, _count) => {
|
|
192
|
-
console.error(`[BRIDGE] onToolStart: ${_name} (${_count} tools)`);
|
|
193
188
|
thinking = false;
|
|
194
189
|
update();
|
|
195
190
|
},
|
|
196
191
|
onToolEnd: (name, input, output, isError, dur) => {
|
|
197
|
-
console.error(`[BRIDGE] onToolEnd: ${name} isError=${isError} dur=${dur}ms`);
|
|
198
192
|
const diffData = (name === "edit_file" || name === "write_file") ? decodeDiffPayload(output) : null;
|
|
199
193
|
const cleanOutput = diffData ? output.slice(0, output.indexOf(DIFF_MARKER)) : output;
|
|
200
194
|
currentToolCalls.push({ name, input, output: cleanOutput, isError, durationMs: dur });
|
|
201
195
|
update();
|
|
202
196
|
},
|
|
203
|
-
onStatus: (msg) => { console.error(`[BRIDGE] onStatus: ${msg.slice(0, 60)}`); update(); },
|
|
204
197
|
getSteeringInput: () => {
|
|
205
198
|
const result = (() => {
|
|
206
199
|
if (steerQueueBuf.length > 0 && inputMode === "steering") {
|
|
@@ -213,13 +206,10 @@ export async function startInkTui(config, spawner) {
|
|
|
213
206
|
}
|
|
214
207
|
return null;
|
|
215
208
|
})();
|
|
216
|
-
if (result)
|
|
217
|
-
console.error(`[BRIDGE] getSteeringInput: ${JSON.stringify(result.slice(0, 40))}`);
|
|
218
209
|
return result;
|
|
219
210
|
},
|
|
220
211
|
};
|
|
221
212
|
async function runAgentTurn(userInput) {
|
|
222
|
-
console.error(`[BRIDGE] runAgentTurn START: ${JSON.stringify(userInput.slice(0, 40))}`);
|
|
223
213
|
running = true;
|
|
224
214
|
thinking = true;
|
|
225
215
|
thinkStartTime = Date.now();
|
|
@@ -232,12 +222,10 @@ export async function startInkTui(config, spawner) {
|
|
|
232
222
|
}
|
|
233
223
|
catch (err) {
|
|
234
224
|
const msg = err instanceof Error ? err.message : String(err);
|
|
235
|
-
console.error(`[BRIDGE] runAgentTurn ERROR: ${msg}`);
|
|
236
225
|
streamingText += `\nError: ${msg}`;
|
|
237
226
|
}
|
|
238
227
|
// Compute elapsed time
|
|
239
228
|
const elapsed = ((Date.now() - thinkStartTime) / 1000).toFixed(1);
|
|
240
|
-
console.error(`[BRIDGE] runAgentTurn END: elapsed=${elapsed}s streamingText=${streamingText.length}chars toolCalls=${currentToolCalls.length}`);
|
|
241
229
|
// Finalize: move streaming content + tool calls to completed messages
|
|
242
230
|
thinking = false;
|
|
243
231
|
if (streamingText || currentToolCalls.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phren/agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Coding agent with persistent memory — powered by phren",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"ink-spinner": "^5.0.0",
|
|
18
18
|
"ink-text-input": "^6.0.0",
|
|
19
19
|
"react": "^19.2.4",
|
|
20
|
-
"@phren/cli": "0.1.
|
|
20
|
+
"@phren/cli": "0.1.7"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20.0.0"
|