mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-19 05:12:16 +03:00
* feat(dashboard): agents WS channel + agent.task.updated event * feat(a2a): publish agent.task.updated on cloud-agent and a2a task writes * feat(dashboard): mirror conductor fleet transitions into agents channel * feat(dashboard): orchestration snapshot rides the agents WS channel (2.1) --------- Co-authored-by: Markus Hartung <diegosouzapw@users.noreply.github.com>
21 lines
756 B
TypeScript
21 lines
756 B
TypeScript
import { describe, it } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import { CHANNEL_EVENTS, getChannelForEvent } from "../../src/lib/events/types.ts";
|
|
import { emit, on } from "../../src/lib/events/eventBus.ts";
|
|
|
|
describe("agents WS channel (B1)", () => {
|
|
it("agents channel maps agent.task.updated", () => {
|
|
assert.deepEqual(CHANNEL_EVENTS.agents, ["agent.task.updated"]);
|
|
assert.equal(getChannelForEvent("agent.task.updated"), "agents");
|
|
});
|
|
|
|
it("emit/on round-trip", () => {
|
|
const seen: unknown[] = [];
|
|
const off = on("agent.task.updated", (p) => seen.push(p));
|
|
emit("agent.task.updated", { source: "a2a", taskId: "t1", state: "working", timestamp: 1 });
|
|
off();
|
|
assert.equal(seen.length, 1);
|
|
});
|
|
});
|