Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline (Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/* packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import type { MessageBlock } from "@rakazo/contracts";
|
||
import { describe, expect, it } from "vitest";
|
||
import { isToolActivityBlock } from "./tool-activity.js";
|
||
|
||
describe("tool activity", () => {
|
||
it.each<MessageBlock>([
|
||
{ kind: "steps", steps: [{ label: "Browser", count: 1 }] },
|
||
{ kind: "progress", text: "Using browser", activity: true },
|
||
{ kind: "progress", text: "Using brex: list_expenses", activity: true },
|
||
])("recognizes $kind activity", (block) => {
|
||
expect(isToolActivityBlock(block)).toBe(true);
|
||
});
|
||
|
||
it("keeps assistant narration separate from tool activity", () => {
|
||
expect(isToolActivityBlock({ kind: "progress", text: "I’m checking that now." })).toBe(false);
|
||
expect(isToolActivityBlock({ kind: "progress", text: "Using browser" })).toBe(false);
|
||
expect(
|
||
isToolActivityBlock({
|
||
kind: "progress",
|
||
text: "Let me check",
|
||
pendingToolNames: ["browser"],
|
||
}),
|
||
).toBe(false);
|
||
expect(
|
||
isToolActivityBlock({ kind: "progress", text: "Using the search results, I found it." }),
|
||
).toBe(false);
|
||
expect(
|
||
isToolActivityBlock({
|
||
kind: "progress",
|
||
text: "Using the search results, I found…",
|
||
}),
|
||
).toBe(false);
|
||
expect(
|
||
isToolActivityBlock({
|
||
kind: "progress",
|
||
text: "Using these notes, here is a summary.",
|
||
}),
|
||
).toBe(false);
|
||
expect(isToolActivityBlock({ kind: "text", text: "Done." })).toBe(false);
|
||
});
|
||
});
|