@microvac/adapter-pi-local 0.0.0-stage → 0.1.0-rc.14
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/LICENSE +22 -0
- package/dist/cli/format-event.d.ts +2 -0
- package/dist/cli/format-event.d.ts.map +1 -0
- package/dist/cli/format-event.js +99 -0
- package/dist/cli/format-event.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/server/execute.d.ts +3 -0
- package/dist/server/execute.d.ts.map +1 -0
- package/dist/server/execute.js +784 -0
- package/dist/server/execute.js.map +1 -0
- package/dist/server/execute.remote.test.d.ts +2 -0
- package/dist/server/execute.remote.test.d.ts.map +1 -0
- package/dist/server/execute.remote.test.js +814 -0
- package/dist/server/execute.remote.test.js.map +1 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +56 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/models.d.ts +20 -0
- package/dist/server/models.d.ts.map +1 -0
- package/dist/server/models.js +162 -0
- package/dist/server/models.js.map +1 -0
- package/dist/server/models.test.d.ts +2 -0
- package/dist/server/models.test.d.ts.map +1 -0
- package/dist/server/models.test.js +48 -0
- package/dist/server/models.test.js.map +1 -0
- package/dist/server/openrouter-extension.d.ts +7 -0
- package/dist/server/openrouter-extension.d.ts.map +1 -0
- package/dist/server/openrouter-extension.js +66 -0
- package/dist/server/openrouter-extension.js.map +1 -0
- package/dist/server/openrouter-extension.test.d.ts +2 -0
- package/dist/server/openrouter-extension.test.d.ts.map +1 -0
- package/dist/server/openrouter-extension.test.js +74 -0
- package/dist/server/openrouter-extension.test.js.map +1 -0
- package/dist/server/parse.d.ts +43 -0
- package/dist/server/parse.d.ts.map +1 -0
- package/dist/server/parse.js +220 -0
- package/dist/server/parse.js.map +1 -0
- package/dist/server/parse.test.d.ts +2 -0
- package/dist/server/parse.test.d.ts.map +1 -0
- package/dist/server/parse.test.js +272 -0
- package/dist/server/parse.test.js.map +1 -0
- package/dist/server/runtime-config.d.ts +12 -0
- package/dist/server/runtime-config.d.ts.map +1 -0
- package/dist/server/runtime-config.js +142 -0
- package/dist/server/runtime-config.js.map +1 -0
- package/dist/server/runtime-config.test.d.ts +2 -0
- package/dist/server/runtime-config.test.d.ts.map +1 -0
- package/dist/server/runtime-config.test.js +216 -0
- package/dist/server/runtime-config.test.js.map +1 -0
- package/dist/server/skills.d.ts +7 -0
- package/dist/server/skills.d.ts.map +1 -0
- package/dist/server/skills.js +69 -0
- package/dist/server/skills.js.map +1 -0
- package/dist/server/stdout-compaction.d.ts +27 -0
- package/dist/server/stdout-compaction.d.ts.map +1 -0
- package/dist/server/stdout-compaction.js +107 -0
- package/dist/server/stdout-compaction.js.map +1 -0
- package/dist/server/stdout-compaction.test.d.ts +2 -0
- package/dist/server/stdout-compaction.test.d.ts.map +1 -0
- package/dist/server/stdout-compaction.test.js +333 -0
- package/dist/server/stdout-compaction.test.js.map +1 -0
- package/dist/server/test.d.ts +3 -0
- package/dist/server/test.d.ts.map +1 -0
- package/dist/server/test.js +311 -0
- package/dist/server/test.js.map +1 -0
- package/dist/ui/build-config.d.ts +3 -0
- package/dist/ui/build-config.d.ts.map +1 -0
- package/dist/ui/build-config.js +39 -0
- package/dist/ui/build-config.js.map +1 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/parse-stdout.d.ts +4 -0
- package/dist/ui/parse-stdout.d.ts.map +1 -0
- package/dist/ui/parse-stdout.js +276 -0
- package/dist/ui/parse-stdout.js.map +1 -0
- package/package.json +51 -4
- package/README.md +0 -3
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { parsePiJsonl } from "./parse.js";
|
|
3
|
+
import { createPiStdoutCompactor, resolvePiStdoutLogMode, } from "./stdout-compaction.js";
|
|
4
|
+
import { parsePiStdoutLine, resetParserState } from "../ui/parse-stdout.js";
|
|
5
|
+
function messageUpdate(delta, cumulativeText) {
|
|
6
|
+
return JSON.stringify({
|
|
7
|
+
type: "message_update",
|
|
8
|
+
message: {
|
|
9
|
+
role: "assistant",
|
|
10
|
+
content: [
|
|
11
|
+
{ type: "thinking", thinking: "x".repeat(5000) },
|
|
12
|
+
{ type: "text", text: cumulativeText },
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
assistantMessageEvent: {
|
|
16
|
+
type: "text_delta",
|
|
17
|
+
contentIndex: 1,
|
|
18
|
+
delta,
|
|
19
|
+
partial: {
|
|
20
|
+
role: "assistant",
|
|
21
|
+
content: [{ type: "text", text: cumulativeText }],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function toolExecutionUpdate(toolCallId, partial) {
|
|
27
|
+
return JSON.stringify({
|
|
28
|
+
type: "tool_execution_update",
|
|
29
|
+
toolCallId,
|
|
30
|
+
toolName: "bash",
|
|
31
|
+
args: { command: "ls" },
|
|
32
|
+
partialResult: {
|
|
33
|
+
content: [{ type: "text", text: partial }],
|
|
34
|
+
details: { truncation: null, fullOutputPath: null },
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function assistantUpdate(message, assistantMessageEvent) {
|
|
39
|
+
return JSON.stringify({
|
|
40
|
+
type: "message_update",
|
|
41
|
+
message,
|
|
42
|
+
assistantMessageEvent: { ...assistantMessageEvent, partial: message },
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Protocol-faithful Pi 0.74 multi-turn sequence derived from pi-agent-core's
|
|
47
|
+
* event order and published AgentEvent/AssistantMessageEvent shapes.
|
|
48
|
+
*/
|
|
49
|
+
function buildTranscript() {
|
|
50
|
+
const usage1 = {
|
|
51
|
+
input: 100,
|
|
52
|
+
output: 20,
|
|
53
|
+
cacheRead: 10,
|
|
54
|
+
cacheWrite: 0,
|
|
55
|
+
totalTokens: 130,
|
|
56
|
+
cost: { input: 0.001, output: 0.0004, cacheRead: 0.0001, cacheWrite: 0, total: 0.0015 },
|
|
57
|
+
};
|
|
58
|
+
const usage2 = {
|
|
59
|
+
input: 120,
|
|
60
|
+
output: 40,
|
|
61
|
+
cacheRead: 12,
|
|
62
|
+
cacheWrite: 0,
|
|
63
|
+
totalTokens: 172,
|
|
64
|
+
cost: { input: 0.0012, output: 0.0008, cacheRead: 0.00012, cacheWrite: 0, total: 0.00212 },
|
|
65
|
+
};
|
|
66
|
+
const userMessage = { role: "user", content: "List files, then summarize.", timestamp: 1 };
|
|
67
|
+
const firstAssistant = {
|
|
68
|
+
role: "assistant",
|
|
69
|
+
content: [
|
|
70
|
+
{ type: "thinking", thinking: "I should inspect the workspace." },
|
|
71
|
+
{ type: "toolCall", id: "tc-1", name: "bash", arguments: { command: "ls" } },
|
|
72
|
+
],
|
|
73
|
+
api: "openai-responses",
|
|
74
|
+
provider: "openai",
|
|
75
|
+
model: "gpt-5",
|
|
76
|
+
usage: usage1,
|
|
77
|
+
stopReason: "toolUse",
|
|
78
|
+
timestamp: 2,
|
|
79
|
+
};
|
|
80
|
+
const toolResult = {
|
|
81
|
+
role: "toolResult",
|
|
82
|
+
toolCallId: "tc-1",
|
|
83
|
+
toolName: "bash",
|
|
84
|
+
content: [{ type: "text", text: "file1\nfile2" }],
|
|
85
|
+
details: { truncation: null, fullOutputPath: null },
|
|
86
|
+
isError: false,
|
|
87
|
+
timestamp: 3,
|
|
88
|
+
};
|
|
89
|
+
const finalAssistant = {
|
|
90
|
+
role: "assistant",
|
|
91
|
+
content: [
|
|
92
|
+
{ type: "thinking", thinking: "The directory contains two files." },
|
|
93
|
+
{ type: "text", text: "Hello world!" },
|
|
94
|
+
],
|
|
95
|
+
api: "openai-responses",
|
|
96
|
+
provider: "openai",
|
|
97
|
+
model: "gpt-5",
|
|
98
|
+
responseId: "resp-final",
|
|
99
|
+
usage: usage2,
|
|
100
|
+
stopReason: "stop",
|
|
101
|
+
timestamp: 4,
|
|
102
|
+
};
|
|
103
|
+
const thinkingStart = { ...firstAssistant, content: [{ type: "thinking", thinking: "" }] };
|
|
104
|
+
const thinkingPartial = { ...firstAssistant, content: [{ type: "thinking", thinking: "I should inspect" }] };
|
|
105
|
+
const thinkingComplete = {
|
|
106
|
+
...firstAssistant,
|
|
107
|
+
content: [{ type: "thinking", thinking: "I should inspect the workspace." }],
|
|
108
|
+
};
|
|
109
|
+
const toolCallStart = {
|
|
110
|
+
...firstAssistant,
|
|
111
|
+
content: [
|
|
112
|
+
{ type: "thinking", thinking: "I should inspect the workspace." },
|
|
113
|
+
{ type: "toolCall", id: "tc-1", name: "bash", arguments: {} },
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
const toolCallPartial = {
|
|
117
|
+
...firstAssistant,
|
|
118
|
+
content: [
|
|
119
|
+
{ type: "thinking", thinking: "I should inspect the workspace." },
|
|
120
|
+
{ type: "toolCall", id: "tc-1", name: "bash", arguments: { command: "l" } },
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
const finalThinkingStart = {
|
|
124
|
+
...finalAssistant,
|
|
125
|
+
content: [{ type: "thinking", thinking: "" }],
|
|
126
|
+
};
|
|
127
|
+
const finalThinkingPartial = {
|
|
128
|
+
...finalAssistant,
|
|
129
|
+
content: [{ type: "thinking", thinking: "The directory contains" }],
|
|
130
|
+
};
|
|
131
|
+
const finalThinkingComplete = {
|
|
132
|
+
...finalAssistant,
|
|
133
|
+
content: [{ type: "thinking", thinking: "The directory contains two files." }],
|
|
134
|
+
};
|
|
135
|
+
const finalTextStart = {
|
|
136
|
+
...finalAssistant,
|
|
137
|
+
content: [
|
|
138
|
+
{ type: "thinking", thinking: "The directory contains two files." },
|
|
139
|
+
{ type: "text", text: "" },
|
|
140
|
+
],
|
|
141
|
+
};
|
|
142
|
+
const finalTextPartial = {
|
|
143
|
+
...finalAssistant,
|
|
144
|
+
content: [
|
|
145
|
+
{ type: "thinking", thinking: "The directory contains two files." },
|
|
146
|
+
{ type: "text", text: "Hello" },
|
|
147
|
+
],
|
|
148
|
+
};
|
|
149
|
+
return [
|
|
150
|
+
JSON.stringify({ type: "session", id: "s-1", cwd: "/tmp/work" }),
|
|
151
|
+
JSON.stringify({ type: "agent_start" }),
|
|
152
|
+
JSON.stringify({ type: "turn_start" }),
|
|
153
|
+
JSON.stringify({ type: "message_start", message: { ...firstAssistant, content: [] } }),
|
|
154
|
+
assistantUpdate(thinkingStart, { type: "thinking_start", contentIndex: 0 }),
|
|
155
|
+
assistantUpdate(thinkingPartial, { type: "thinking_delta", contentIndex: 0, delta: "I should inspect" }),
|
|
156
|
+
assistantUpdate(thinkingComplete, {
|
|
157
|
+
type: "thinking_end",
|
|
158
|
+
contentIndex: 0,
|
|
159
|
+
content: "I should inspect the workspace.",
|
|
160
|
+
}),
|
|
161
|
+
assistantUpdate(toolCallStart, { type: "toolcall_start", contentIndex: 1 }),
|
|
162
|
+
assistantUpdate(toolCallPartial, { type: "toolcall_delta", contentIndex: 1, delta: '"ls"' }),
|
|
163
|
+
assistantUpdate(firstAssistant, {
|
|
164
|
+
type: "toolcall_end",
|
|
165
|
+
contentIndex: 1,
|
|
166
|
+
toolCall: firstAssistant.content[1],
|
|
167
|
+
}),
|
|
168
|
+
JSON.stringify({ type: "message_end", message: firstAssistant }),
|
|
169
|
+
JSON.stringify({
|
|
170
|
+
type: "tool_execution_start",
|
|
171
|
+
toolCallId: "tc-1",
|
|
172
|
+
toolName: "bash",
|
|
173
|
+
args: { command: "ls" },
|
|
174
|
+
}),
|
|
175
|
+
toolExecutionUpdate("tc-1", "file"),
|
|
176
|
+
toolExecutionUpdate("tc-1", "file1\nfile2"),
|
|
177
|
+
JSON.stringify({
|
|
178
|
+
type: "tool_execution_end",
|
|
179
|
+
toolCallId: "tc-1",
|
|
180
|
+
toolName: "bash",
|
|
181
|
+
result: { content: toolResult.content, details: toolResult.details },
|
|
182
|
+
isError: false,
|
|
183
|
+
}),
|
|
184
|
+
JSON.stringify({ type: "message_start", message: toolResult }),
|
|
185
|
+
JSON.stringify({ type: "message_end", message: toolResult }),
|
|
186
|
+
JSON.stringify({ type: "turn_end", message: firstAssistant, toolResults: [toolResult] }),
|
|
187
|
+
JSON.stringify({ type: "turn_start" }),
|
|
188
|
+
JSON.stringify({ type: "message_start", message: { ...finalAssistant, content: [] } }),
|
|
189
|
+
assistantUpdate(finalThinkingStart, { type: "thinking_start", contentIndex: 0 }),
|
|
190
|
+
assistantUpdate(finalThinkingPartial, {
|
|
191
|
+
type: "thinking_delta",
|
|
192
|
+
contentIndex: 0,
|
|
193
|
+
delta: "The directory contains",
|
|
194
|
+
}),
|
|
195
|
+
assistantUpdate(finalThinkingComplete, {
|
|
196
|
+
type: "thinking_end",
|
|
197
|
+
contentIndex: 0,
|
|
198
|
+
content: "The directory contains two files.",
|
|
199
|
+
}),
|
|
200
|
+
assistantUpdate(finalTextStart, { type: "text_start", contentIndex: 1 }),
|
|
201
|
+
assistantUpdate(finalTextPartial, { type: "text_delta", contentIndex: 1, delta: "Hello" }),
|
|
202
|
+
assistantUpdate(finalAssistant, { type: "text_delta", contentIndex: 1, delta: " world!" }),
|
|
203
|
+
assistantUpdate(finalAssistant, { type: "text_end", contentIndex: 1, content: "Hello world!" }),
|
|
204
|
+
JSON.stringify({ type: "message_end", message: finalAssistant }),
|
|
205
|
+
JSON.stringify({ type: "turn_end", message: finalAssistant, toolResults: [] }),
|
|
206
|
+
JSON.stringify({
|
|
207
|
+
type: "agent_end",
|
|
208
|
+
messages: [userMessage, firstAssistant, toolResult, finalAssistant],
|
|
209
|
+
}),
|
|
210
|
+
JSON.stringify({ type: "agent_settled" }),
|
|
211
|
+
];
|
|
212
|
+
}
|
|
213
|
+
function filterTranscript(lines, mode) {
|
|
214
|
+
const compact = createPiStdoutCompactor(mode);
|
|
215
|
+
return lines.map((l) => compact(l)).filter((l) => l !== null);
|
|
216
|
+
}
|
|
217
|
+
describe("resolvePiStdoutLogMode", () => {
|
|
218
|
+
it("defaults missing values to compact but fails invalid values safely to raw", () => {
|
|
219
|
+
expect(resolvePiStdoutLogMode({})).toBe("compact");
|
|
220
|
+
expect(resolvePiStdoutLogMode({ stdoutLogMode: undefined })).toBe("compact");
|
|
221
|
+
expect(resolvePiStdoutLogMode({ stdoutLogMode: "bogus" })).toBe("raw");
|
|
222
|
+
expect(resolvePiStdoutLogMode({ stdoutLogMode: 42 })).toBe("raw");
|
|
223
|
+
});
|
|
224
|
+
it("accepts explicit modes case-insensitively", () => {
|
|
225
|
+
expect(resolvePiStdoutLogMode({ stdoutLogMode: "raw" })).toBe("raw");
|
|
226
|
+
expect(resolvePiStdoutLogMode({ stdoutLogMode: " Compact " })).toBe("compact");
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
describe("raw mode", () => {
|
|
230
|
+
it("passes all input through unchanged", () => {
|
|
231
|
+
const lines = [
|
|
232
|
+
...buildTranscript(),
|
|
233
|
+
"not json at all",
|
|
234
|
+
"{broken",
|
|
235
|
+
"42",
|
|
236
|
+
"[1,2,3]",
|
|
237
|
+
'"just a string"',
|
|
238
|
+
"line with \u2028 separator",
|
|
239
|
+
];
|
|
240
|
+
expect(filterTranscript(lines, "raw")).toEqual(lines);
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
describe("compact mode", () => {
|
|
244
|
+
it("strips cumulative message and partial from message_update, keeps delta", () => {
|
|
245
|
+
const out = filterTranscript([messageUpdate("Hello", "Hello")], "compact");
|
|
246
|
+
expect(out).toHaveLength(1);
|
|
247
|
+
const event = JSON.parse(out[0]);
|
|
248
|
+
expect(event.type).toBe("message_update");
|
|
249
|
+
expect(event.message).toBeUndefined();
|
|
250
|
+
expect(event.assistantMessageEvent.type).toBe("text_delta");
|
|
251
|
+
expect(event.assistantMessageEvent.delta).toBe("Hello");
|
|
252
|
+
expect(event.assistantMessageEvent.contentIndex).toBe(1);
|
|
253
|
+
expect(event.assistantMessageEvent.partial).toBeUndefined();
|
|
254
|
+
});
|
|
255
|
+
it("preserves terminal and unknown events byte-for-byte (including CRLF)", () => {
|
|
256
|
+
const terminal = buildTranscript().filter((l) => {
|
|
257
|
+
const t = JSON.parse(l).type;
|
|
258
|
+
return !["message_update", "tool_execution_update"].includes(t);
|
|
259
|
+
});
|
|
260
|
+
const unknown = JSON.stringify({ type: "brand_new_pi_event", payload: { big: "z".repeat(1000) } });
|
|
261
|
+
// Add CRLF to a terminal line and verify it survives byte-for-byte.
|
|
262
|
+
const crlfLine = terminal[0] + "\r";
|
|
263
|
+
const out = filterTranscript([...terminal, unknown, crlfLine], "compact");
|
|
264
|
+
expect(out).toEqual([...terminal, unknown, crlfLine]);
|
|
265
|
+
});
|
|
266
|
+
it("passes malformed lines through unchanged", () => {
|
|
267
|
+
const weird = ["not json", "{broken", "42", "[1,2]"];
|
|
268
|
+
expect(filterTranscript(weird, "compact")).toEqual(weird);
|
|
269
|
+
});
|
|
270
|
+
it("shrinks a cumulative transcript to ~linear size", () => {
|
|
271
|
+
const n = 50;
|
|
272
|
+
const lines = [];
|
|
273
|
+
let text = "";
|
|
274
|
+
for (let i = 0; i < n; i++) {
|
|
275
|
+
text += `chunk-${i} `;
|
|
276
|
+
lines.push(messageUpdate(`chunk-${i} `, text));
|
|
277
|
+
}
|
|
278
|
+
const rawBytes = lines.join("\n").length;
|
|
279
|
+
const compactBytes = filterTranscript(lines, "compact").join("\n").length;
|
|
280
|
+
expect(compactBytes).toBeLessThan(rawBytes / 10);
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
describe("tool_execution_update liveness", () => {
|
|
284
|
+
it("compact emits schema-distinct Paperclip progress at 0/5000ms boundaries", () => {
|
|
285
|
+
let now = 0;
|
|
286
|
+
const compact = createPiStdoutCompactor("compact", { now: () => now });
|
|
287
|
+
const line = toolExecutionUpdate("tc-1", "a".repeat(50_000));
|
|
288
|
+
const first = compact(line);
|
|
289
|
+
now = 4_999;
|
|
290
|
+
const beforeBoundary = compact(line);
|
|
291
|
+
now = 5_000;
|
|
292
|
+
const atBoundary = compact(line);
|
|
293
|
+
expect(first).not.toBeNull();
|
|
294
|
+
expect(beforeBoundary).toBeNull();
|
|
295
|
+
expect(atBoundary).not.toBeNull();
|
|
296
|
+
expect(JSON.parse(first)).toEqual({
|
|
297
|
+
type: "paperclip_progress",
|
|
298
|
+
sourceEventType: "tool_execution_update",
|
|
299
|
+
toolCallId: "tc-1",
|
|
300
|
+
});
|
|
301
|
+
expect(JSON.parse(atBoundary)).toEqual(JSON.parse(first));
|
|
302
|
+
});
|
|
303
|
+
it("raw mode passes partialResult through unchanged", () => {
|
|
304
|
+
const line = toolExecutionUpdate("tc-4", "c".repeat(100));
|
|
305
|
+
expect(filterTranscript([line], "raw")).toEqual([line]);
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
describe("replay through Paperclip parsers", () => {
|
|
309
|
+
const raw = buildTranscript();
|
|
310
|
+
it("compact preserves full parsePiJsonl output (finalMessage, usage, toolCalls, errors, messages)", () => {
|
|
311
|
+
const filtered = filterTranscript(raw, "compact");
|
|
312
|
+
const fromRaw = parsePiJsonl(raw.join("\n"));
|
|
313
|
+
const fromFiltered = parsePiJsonl(filtered.join("\n"));
|
|
314
|
+
expect(fromFiltered).toEqual(fromRaw);
|
|
315
|
+
expect(fromFiltered.finalMessage).toBe("Hello world!");
|
|
316
|
+
});
|
|
317
|
+
it("compact produces identical full UI transcript entries", () => {
|
|
318
|
+
const render = (lines) => {
|
|
319
|
+
resetParserState();
|
|
320
|
+
return lines.flatMap((line) => parsePiStdoutLine(line, "2026-07-24T00:00:00Z"));
|
|
321
|
+
};
|
|
322
|
+
expect(render(filterTranscript(raw, "compact"))).toEqual(render(raw));
|
|
323
|
+
});
|
|
324
|
+
it("Paperclip progress events stay out of the UI transcript", () => {
|
|
325
|
+
const event = {
|
|
326
|
+
type: "paperclip_progress",
|
|
327
|
+
sourceEventType: "tool_execution_update",
|
|
328
|
+
toolCallId: "tc-1",
|
|
329
|
+
};
|
|
330
|
+
expect(parsePiStdoutLine(JSON.stringify(event), "2026-07-24T00:00:00Z")).toEqual([]);
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
//# sourceMappingURL=stdout-compaction.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdout-compaction.test.js","sourceRoot":"","sources":["../../src/server/stdout-compaction.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,SAAS,aAAa,CAAC,KAAa,EAAE,cAAsB;IAC1D,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBAChD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE;aACvC;SACF;QACD,qBAAqB,EAAE;YACrB,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,CAAC;YACf,KAAK;YACL,OAAO,EAAE;gBACP,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;aAClD;SACF;KACF,CAA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@@
|
|
|
1
|
+
import { asString, parseObject, ensurePathInEnv, sanitizeInheritedPaperclipEnv, } from "@paperclipai/adapter-utils/server-utils";
|
|
2
|
+
import { asStringArray, } from "@paperclipai/adapter-utils/server-utils";
|
|
3
|
+
import { ensureAdapterExecutionTargetCommandResolvable, maybeRunSandboxInstallCommand, ensureAdapterExecutionTargetDirectory, isAdapterExecutionTargetUnavailableError, runAdapterExecutionTargetProcess, describeAdapterExecutionTarget, resolveAdapterExecutionTargetCwd, } from "@paperclipai/adapter-utils/execution-target";
|
|
4
|
+
import { discoverPiModelsCached } from "./models.js";
|
|
5
|
+
import { parsePiJsonl } from "./parse.js";
|
|
6
|
+
import { SANDBOX_INSTALL_COMMAND } from "../index.js";
|
|
7
|
+
function summarizeStatus(checks) {
|
|
8
|
+
if (checks.some((check) => check.level === "error"))
|
|
9
|
+
return "fail";
|
|
10
|
+
if (checks.some((check) => check.level === "warn"))
|
|
11
|
+
return "warn";
|
|
12
|
+
return "pass";
|
|
13
|
+
}
|
|
14
|
+
function firstNonEmptyLine(text) {
|
|
15
|
+
return (text
|
|
16
|
+
.split(/\r?\n/)
|
|
17
|
+
.map((line) => line.trim())
|
|
18
|
+
.find(Boolean) ?? "");
|
|
19
|
+
}
|
|
20
|
+
function summarizeProbeDetail(stdout, stderr, parsedError) {
|
|
21
|
+
const raw = parsedError?.trim() || firstNonEmptyLine(stderr) || firstNonEmptyLine(stdout);
|
|
22
|
+
if (!raw)
|
|
23
|
+
return null;
|
|
24
|
+
const clean = raw.replace(/\s+/g, " ").trim();
|
|
25
|
+
const max = 240;
|
|
26
|
+
return clean.length > max ? `${clean.slice(0, max - 1)}...` : clean;
|
|
27
|
+
}
|
|
28
|
+
function normalizeEnv(input) {
|
|
29
|
+
if (typeof input !== "object" || input === null || Array.isArray(input))
|
|
30
|
+
return {};
|
|
31
|
+
const env = {};
|
|
32
|
+
for (const [key, value] of Object.entries(input)) {
|
|
33
|
+
if (typeof value === "string")
|
|
34
|
+
env[key] = value;
|
|
35
|
+
}
|
|
36
|
+
return env;
|
|
37
|
+
}
|
|
38
|
+
const PI_AUTH_REQUIRED_RE = /(?:auth(?:entication)?\s+required|api\s*key|invalid\s*api\s*key|not\s+logged\s+in|free\s+usage\s+exceeded)/i;
|
|
39
|
+
const PI_STALE_PACKAGE_RE = /pi-driver|npm:\s*pi-driver/i;
|
|
40
|
+
function buildPiModelDiscoveryFailureCheck(message) {
|
|
41
|
+
if (PI_STALE_PACKAGE_RE.test(message)) {
|
|
42
|
+
return {
|
|
43
|
+
code: "pi_package_install_failed",
|
|
44
|
+
level: "warn",
|
|
45
|
+
message: "Pi startup failed while installing configured package `npm:pi-driver`.",
|
|
46
|
+
detail: message,
|
|
47
|
+
hint: "Remove `npm:pi-driver` from ~/.pi/agent/settings.json or set adapter env HOME to a clean Pi profile, then retry `pi --list-models`.",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
code: "pi_models_discovery_failed",
|
|
52
|
+
level: "warn",
|
|
53
|
+
message,
|
|
54
|
+
hint: "Run `pi --list-models` manually to verify provider auth and config.",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export async function testEnvironment(ctx) {
|
|
58
|
+
const checks = [];
|
|
59
|
+
const config = parseObject(ctx.config);
|
|
60
|
+
const command = asString(config.command, "pi");
|
|
61
|
+
const target = ctx.executionTarget ?? null;
|
|
62
|
+
const targetIsRemote = target?.kind === "remote";
|
|
63
|
+
const cwd = resolveAdapterExecutionTargetCwd(target, asString(config.cwd, ""), process.cwd());
|
|
64
|
+
const targetLabel = targetIsRemote
|
|
65
|
+
? ctx.environmentName ?? describeAdapterExecutionTarget(target)
|
|
66
|
+
: null;
|
|
67
|
+
const runId = `pi-envtest-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
68
|
+
if (targetLabel) {
|
|
69
|
+
checks.push({
|
|
70
|
+
code: "pi_environment_target",
|
|
71
|
+
level: "info",
|
|
72
|
+
message: `Probing inside environment: ${targetLabel}`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
await ensureAdapterExecutionTargetDirectory(runId, target, cwd, {
|
|
77
|
+
cwd,
|
|
78
|
+
env: {},
|
|
79
|
+
createIfMissing: false,
|
|
80
|
+
});
|
|
81
|
+
checks.push({
|
|
82
|
+
code: "pi_cwd_valid",
|
|
83
|
+
level: "info",
|
|
84
|
+
message: `Working directory is valid: ${cwd}`,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
checks.push({
|
|
89
|
+
code: "pi_cwd_invalid",
|
|
90
|
+
...(isAdapterExecutionTargetUnavailableError(err) ? { retryable: true } : {}),
|
|
91
|
+
level: "error",
|
|
92
|
+
message: err instanceof Error ? err.message : "Invalid working directory",
|
|
93
|
+
detail: cwd,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const envConfig = parseObject(config.env);
|
|
97
|
+
const env = {};
|
|
98
|
+
for (const [key, value] of Object.entries(envConfig)) {
|
|
99
|
+
if (typeof value === "string")
|
|
100
|
+
env[key] = value;
|
|
101
|
+
}
|
|
102
|
+
const runtimeEnv = normalizeEnv(ensurePathInEnv({ ...sanitizeInheritedPaperclipEnv(process.env), ...env }));
|
|
103
|
+
const cwdInvalid = checks.some((check) => check.code === "pi_cwd_invalid");
|
|
104
|
+
if (cwdInvalid) {
|
|
105
|
+
checks.push({
|
|
106
|
+
code: "pi_command_skipped",
|
|
107
|
+
level: "warn",
|
|
108
|
+
message: "Skipped command check because working directory validation failed.",
|
|
109
|
+
detail: command,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const installCheck = await maybeRunSandboxInstallCommand({
|
|
114
|
+
runId,
|
|
115
|
+
target,
|
|
116
|
+
adapterKey: "pi",
|
|
117
|
+
installCommand: SANDBOX_INSTALL_COMMAND,
|
|
118
|
+
detectCommand: command,
|
|
119
|
+
env,
|
|
120
|
+
});
|
|
121
|
+
if (installCheck)
|
|
122
|
+
checks.push(installCheck);
|
|
123
|
+
try {
|
|
124
|
+
await ensureAdapterExecutionTargetCommandResolvable(command, target, cwd, runtimeEnv);
|
|
125
|
+
checks.push({
|
|
126
|
+
code: "pi_command_resolvable",
|
|
127
|
+
level: "info",
|
|
128
|
+
message: `Command is executable: ${command}`,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
checks.push({
|
|
133
|
+
code: "pi_command_unresolvable",
|
|
134
|
+
...(isAdapterExecutionTargetUnavailableError(err) ? { retryable: true } : {}),
|
|
135
|
+
level: "error",
|
|
136
|
+
message: err instanceof Error ? err.message : "Command is not executable",
|
|
137
|
+
detail: command,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const canRunProbe = checks.every((check) => check.code !== "pi_cwd_invalid" && check.code !== "pi_command_unresolvable");
|
|
142
|
+
// Pi model discovery shells out to `pi --list-models` locally; when probing a
|
|
143
|
+
// remote target we skip discovery and let the remote hello probe surface
|
|
144
|
+
// model/auth issues directly.
|
|
145
|
+
if (!targetIsRemote && canRunProbe) {
|
|
146
|
+
try {
|
|
147
|
+
const discovered = await discoverPiModelsCached({ command, cwd, env: runtimeEnv });
|
|
148
|
+
if (discovered.length > 0) {
|
|
149
|
+
checks.push({
|
|
150
|
+
code: "pi_models_discovered",
|
|
151
|
+
level: "info",
|
|
152
|
+
message: `Discovered ${discovered.length} model(s) from Pi.`,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
checks.push({
|
|
157
|
+
code: "pi_models_empty",
|
|
158
|
+
level: "warn",
|
|
159
|
+
message: "Pi returned no models.",
|
|
160
|
+
hint: "Run `pi --list-models` and verify provider authentication.",
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
checks.push(buildPiModelDiscoveryFailureCheck(err instanceof Error ? err.message : "Pi model discovery failed."));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const configuredModel = asString(config.model, "").trim();
|
|
169
|
+
if (!configuredModel) {
|
|
170
|
+
checks.push({
|
|
171
|
+
code: "pi_model_required",
|
|
172
|
+
level: "error",
|
|
173
|
+
message: "Pi requires a configured model in provider/model format.",
|
|
174
|
+
hint: "Set adapterConfig.model using an ID from `pi --list-models`.",
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
else if (targetIsRemote) {
|
|
178
|
+
checks.push({
|
|
179
|
+
code: "pi_model_validation_skipped_remote",
|
|
180
|
+
level: "info",
|
|
181
|
+
message: `Skipped local model validation; will be validated by the hello probe inside ${targetLabel}.`,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
else if (canRunProbe) {
|
|
185
|
+
// Verify model is in the list
|
|
186
|
+
try {
|
|
187
|
+
const discovered = await discoverPiModelsCached({ command, cwd, env: runtimeEnv });
|
|
188
|
+
const modelExists = discovered.some((m) => m.id === configuredModel);
|
|
189
|
+
if (modelExists) {
|
|
190
|
+
checks.push({
|
|
191
|
+
code: "pi_model_configured",
|
|
192
|
+
level: "info",
|
|
193
|
+
message: `Configured model: ${configuredModel}`,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
checks.push({
|
|
198
|
+
code: "pi_model_not_found",
|
|
199
|
+
level: "warn",
|
|
200
|
+
message: `Configured model "${configuredModel}" not found in available models.`,
|
|
201
|
+
hint: "Run `pi --list-models` and choose a currently available provider/model ID.",
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
// If we can't verify, just note it
|
|
207
|
+
checks.push({
|
|
208
|
+
code: "pi_model_configured",
|
|
209
|
+
level: "info",
|
|
210
|
+
message: `Configured model: ${configuredModel}`,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (canRunProbe && configuredModel) {
|
|
215
|
+
// Parse model for probe
|
|
216
|
+
const provider = configuredModel.includes("/")
|
|
217
|
+
? configuredModel.slice(0, configuredModel.indexOf("/"))
|
|
218
|
+
: "";
|
|
219
|
+
const modelId = configuredModel.includes("/")
|
|
220
|
+
? configuredModel.slice(configuredModel.indexOf("/") + 1)
|
|
221
|
+
: configuredModel;
|
|
222
|
+
const thinking = asString(config.thinking, "").trim();
|
|
223
|
+
const extraArgs = (() => {
|
|
224
|
+
const fromExtraArgs = asStringArray(config.extraArgs);
|
|
225
|
+
if (fromExtraArgs.length > 0)
|
|
226
|
+
return fromExtraArgs;
|
|
227
|
+
return asStringArray(config.args);
|
|
228
|
+
})();
|
|
229
|
+
const args = ["-p", "Respond with hello.", "--mode", "json"];
|
|
230
|
+
if (provider)
|
|
231
|
+
args.push("--provider", provider);
|
|
232
|
+
if (modelId)
|
|
233
|
+
args.push("--model", modelId);
|
|
234
|
+
if (thinking)
|
|
235
|
+
args.push("--thinking", thinking);
|
|
236
|
+
args.push("--tools", "read");
|
|
237
|
+
if (extraArgs.length > 0)
|
|
238
|
+
args.push(...extraArgs);
|
|
239
|
+
try {
|
|
240
|
+
const probe = await runAdapterExecutionTargetProcess(runId, target, command, args, {
|
|
241
|
+
cwd,
|
|
242
|
+
env: runtimeEnv,
|
|
243
|
+
timeoutSec: 60,
|
|
244
|
+
graceSec: 5,
|
|
245
|
+
onLog: async () => { },
|
|
246
|
+
});
|
|
247
|
+
const parsed = parsePiJsonl(probe.stdout);
|
|
248
|
+
const detail = summarizeProbeDetail(probe.stdout, probe.stderr, parsed.errors[0] ?? null);
|
|
249
|
+
const authEvidence = `${parsed.errors.join("\n")}\n${probe.stdout}\n${probe.stderr}`.trim();
|
|
250
|
+
if (probe.timedOut) {
|
|
251
|
+
checks.push({
|
|
252
|
+
code: "pi_hello_probe_timed_out",
|
|
253
|
+
level: "warn",
|
|
254
|
+
message: "Pi hello probe timed out.",
|
|
255
|
+
hint: "Retry the probe. If this persists, run Pi manually in this working directory.",
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
else if ((probe.exitCode ?? 1) === 0 && parsed.errors.length === 0) {
|
|
259
|
+
const summary = (parsed.finalMessage || parsed.messages.join(" ")).trim();
|
|
260
|
+
const hasHello = /\bhello\b/i.test(summary);
|
|
261
|
+
checks.push({
|
|
262
|
+
code: hasHello ? "pi_hello_probe_passed" : "pi_hello_probe_unexpected_output",
|
|
263
|
+
level: hasHello ? "info" : "warn",
|
|
264
|
+
message: hasHello
|
|
265
|
+
? "Pi hello probe succeeded."
|
|
266
|
+
: "Pi probe ran but did not return `hello` as expected.",
|
|
267
|
+
...(summary ? { detail: summary.replace(/\s+/g, " ").trim().slice(0, 240) } : {}),
|
|
268
|
+
...(hasHello
|
|
269
|
+
? {}
|
|
270
|
+
: {
|
|
271
|
+
hint: "Run `pi --mode json` manually and prompt `Respond with hello` to inspect output.",
|
|
272
|
+
}),
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
else if (PI_AUTH_REQUIRED_RE.test(authEvidence)) {
|
|
276
|
+
checks.push({
|
|
277
|
+
code: "pi_hello_probe_auth_required",
|
|
278
|
+
level: "warn",
|
|
279
|
+
message: "Pi is installed, but provider authentication is not ready.",
|
|
280
|
+
...(detail ? { detail } : {}),
|
|
281
|
+
hint: "Set provider API key environment variable (e.g., ANTHROPIC_API_KEY, XAI_API_KEY) and retry.",
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
checks.push({
|
|
286
|
+
code: "pi_hello_probe_failed",
|
|
287
|
+
level: "error",
|
|
288
|
+
message: "Pi hello probe failed.",
|
|
289
|
+
...(detail ? { detail } : {}),
|
|
290
|
+
hint: "Run `pi --mode json` manually in this working directory to debug.",
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
catch (err) {
|
|
295
|
+
checks.push({
|
|
296
|
+
code: "pi_hello_probe_failed",
|
|
297
|
+
level: "error",
|
|
298
|
+
message: "Pi hello probe failed.",
|
|
299
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
300
|
+
hint: "Run `pi --mode json` manually in this working directory to debug.",
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
adapterType: ctx.adapterType,
|
|
306
|
+
status: summarizeStatus(checks),
|
|
307
|
+
checks,
|
|
308
|
+
testedAt: new Date().toISOString(),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=test.js.map
|