mirror of
https://github.com/vicky469/aside.git
synced 2026-07-22 17:42:04 +00:00
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import * as assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import { parseAgentDirectives } from "../src/core/text/agentDirectives";
|
|
|
|
test("parseAgentDirectives resolves a single explicit target", () => {
|
|
assert.deepEqual(parseAgentDirectives("Please ask @codex to handle this."), {
|
|
target: "codex",
|
|
hasConflict: false,
|
|
matchedTargets: ["codex"],
|
|
unsupportedTargets: [],
|
|
});
|
|
});
|
|
|
|
test("parseAgentDirectives ignores repeated mentions of the same supported target", () => {
|
|
assert.deepEqual(parseAgentDirectives("@codex please review this for @codex"), {
|
|
target: "codex",
|
|
hasConflict: false,
|
|
matchedTargets: ["codex"],
|
|
unsupportedTargets: [],
|
|
});
|
|
});
|
|
|
|
test("parseAgentDirectives resolves claude as a supported peer target", () => {
|
|
assert.deepEqual(parseAgentDirectives("ping foo@example.com then ask @claude"), {
|
|
target: "claude",
|
|
hasConflict: false,
|
|
matchedTargets: ["claude"],
|
|
unsupportedTargets: [],
|
|
});
|
|
});
|
|
|
|
test("parseAgentDirectives blocks mixed supported agent mentions", () => {
|
|
assert.deepEqual(parseAgentDirectives("ask @codex and @claude"), {
|
|
target: null,
|
|
hasConflict: true,
|
|
matchedTargets: ["codex", "claude"],
|
|
unsupportedTargets: [],
|
|
});
|
|
});
|