@koda-sl/baker-bridge 0.159.0-dev.aefecbe62 → 0.159.0-dev.c31d1bca3
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/hono/bridge-job.d.ts +4 -0
- package/dist/hono/bridge-job.d.ts.map +1 -1
- package/dist/hono/bridge-job.js +61 -18
- package/dist/hono/bridge-job.js.map +1 -1
- package/dist/hono/bridge-job.test.js +43 -1
- package/dist/hono/bridge-job.test.js.map +1 -1
- package/dist/review/digest.test.js +63 -0
- package/dist/review/digest.test.js.map +1 -1
- package/dist/review/reply-language.d.ts.map +1 -1
- package/dist/review/reply-language.js +102 -10
- package/dist/review/reply-language.js.map +1 -1
- package/package.json +2 -1
|
@@ -70,6 +70,7 @@ function recordingRelay() {
|
|
|
70
70
|
const reviewDigests = [];
|
|
71
71
|
const retractedEvents = [];
|
|
72
72
|
const toolOutcomeBatches = [];
|
|
73
|
+
const previewedTools = [];
|
|
73
74
|
const contextUsageUpdates = [];
|
|
74
75
|
return {
|
|
75
76
|
assistantEvents,
|
|
@@ -80,9 +81,12 @@ function recordingRelay() {
|
|
|
80
81
|
reviewDigests,
|
|
81
82
|
retractedEvents,
|
|
82
83
|
toolOutcomeBatches,
|
|
84
|
+
previewedTools,
|
|
83
85
|
startPreview: () => undefined,
|
|
84
86
|
previewText: () => undefined,
|
|
85
|
-
previewTools: () =>
|
|
87
|
+
previewTools: (_target, tools) => {
|
|
88
|
+
previewedTools.push(tools);
|
|
89
|
+
},
|
|
86
90
|
tagInputRequest: () => Promise.resolve(true),
|
|
87
91
|
tagInputResolved: () => Promise.resolve(),
|
|
88
92
|
flowInputRequest: () => Promise.resolve(true),
|
|
@@ -485,6 +489,44 @@ describe("BridgeJobExecutor", () => {
|
|
|
485
489
|
},
|
|
486
490
|
]);
|
|
487
491
|
});
|
|
492
|
+
it("previews a step with the input it streamed, not the empty one it opened with", async () => {
|
|
493
|
+
const relay = recordingRelay();
|
|
494
|
+
const executor = createExecutor({
|
|
495
|
+
relay,
|
|
496
|
+
queryResults: [
|
|
497
|
+
scriptedMessages({ type: "stream_event", event: { type: "message_start" } }, {
|
|
498
|
+
type: "stream_event",
|
|
499
|
+
event: {
|
|
500
|
+
type: "content_block_start",
|
|
501
|
+
index: 0,
|
|
502
|
+
content_block: { type: "tool_use", id: "tool_1", name: "Bash", input: {} },
|
|
503
|
+
},
|
|
504
|
+
}, {
|
|
505
|
+
type: "stream_event",
|
|
506
|
+
event: {
|
|
507
|
+
type: "content_block_delta",
|
|
508
|
+
index: 0,
|
|
509
|
+
delta: { type: "input_json_delta", partial_json: '{"command":"ls","descr' },
|
|
510
|
+
},
|
|
511
|
+
}, {
|
|
512
|
+
type: "stream_event",
|
|
513
|
+
event: {
|
|
514
|
+
type: "content_block_delta",
|
|
515
|
+
index: 0,
|
|
516
|
+
delta: { type: "input_json_delta", partial_json: 'iption":"Checking your pages"}' },
|
|
517
|
+
},
|
|
518
|
+
}, { type: "stream_event", event: { type: "content_block_stop", index: 0 } }, resultMessage(0.01, "session_next")),
|
|
519
|
+
],
|
|
520
|
+
});
|
|
521
|
+
await executor.execute({ threadId: "thread_1", turnId: "turn_1", prompt: "Look", history: history([]) }, activeControls());
|
|
522
|
+
expect(relay.previewedTools.at(-1)).toEqual([
|
|
523
|
+
expect.objectContaining({
|
|
524
|
+
toolUseId: "tool_1",
|
|
525
|
+
toolName: "Bash",
|
|
526
|
+
input: { command: "ls", description: "Checking your pages" },
|
|
527
|
+
}),
|
|
528
|
+
]);
|
|
529
|
+
});
|
|
488
530
|
it("ends the turn with a legible error and clears the session once the control channel is closed", async () => {
|
|
489
531
|
const clearCalls = [];
|
|
490
532
|
const executor = createExecutor({
|