evOo-local/packages/core/src/tool-activity.test.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
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.
2026-09-20 17:15:16 +02:00

42 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
});
});