@hiai-gg/hiai-opencode 0.1.0 → 0.1.2
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/AGENTS.md +0 -1
- package/ARCHITECTURE.md +0 -1
- package/dist/index.js +3 -3
- package/package.json +1 -6
- package/src/config/defaults.ts +1 -1
- package/dist/ast-grep-napi.linux-x64-gnu-d8zfa2q0.node +0 -0
- package/dist/ast-grep-napi.linux-x64-musl-0wywtr8y.node +0 -0
- package/dist/prompt-snapshots/bob.default.md +0 -514
- package/dist/prompt-snapshots/bob.gemini.md +0 -725
- package/dist/prompt-snapshots/bob.gpt-pro.md +0 -514
- package/dist/prompt-snapshots/coder.gpt-codex.md +0 -299
- package/dist/prompt-snapshots/coder.gpt-pro.md +0 -315
- package/dist/prompt-snapshots/coder.gpt.md +0 -315
- package/dist/prompt-snapshots/critic.md +0 -68
- package/dist/prompt-snapshots/guard.md +0 -599
- package/dist/prompt-snapshots/multimodal.md +0 -39
- package/dist/prompt-snapshots/platform-manager.md +0 -222
- package/dist/prompt-snapshots/quality-guardian.md +0 -32
- package/dist/prompt-snapshots/researcher.md +0 -29
- package/dist/prompt-snapshots/strategist.md +0 -573
- package/dist/prompt-snapshots/sub.md +0 -105
- package/scripts/check_docs.ts +0 -129
- package/scripts/doctor.ts +0 -522
- package/scripts/measure_prompts.ts +0 -193
- package/scripts/test_routing.ts +0 -294
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { createBobAgent } from "../src/agents/bob";
|
|
2
|
-
import { createCoderAgent } from "../src/agents/coder/agent";
|
|
3
|
-
import { createCriticAgent } from "../src/agents/critic/agent";
|
|
4
|
-
import { createGuardAgent } from "../src/agents/guard/agent";
|
|
5
|
-
import { createResearcherAgent } from "../src/agents/researcher";
|
|
6
|
-
import { createBobJuniorAgentWithOverrides } from "../src/agents/sub/agent";
|
|
7
|
-
import { getStrategistPrompt } from "../src/agents/strategist/index";
|
|
8
|
-
import { createQualityGuardianAgent } from "../src/agents/quality-guardian";
|
|
9
|
-
import { createPlatformManagerAgent } from "../src/agents/platform-manager";
|
|
10
|
-
import { createMultimodalLookerAgent } from "../src/agents/ui";
|
|
11
|
-
import { writeFileSync, mkdirSync } from "fs";
|
|
12
|
-
import { join, dirname } from "path";
|
|
13
|
-
import { fileURLToPath } from "url";
|
|
14
|
-
|
|
15
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
-
const ROOT = join(__dirname, "..");
|
|
17
|
-
const OUT_DIR = join(ROOT, "dist", "prompt-snapshots");
|
|
18
|
-
|
|
19
|
-
const emptyAgents: any[] = [];
|
|
20
|
-
const emptyTools: any[] = [];
|
|
21
|
-
const emptySkills: any[] = [];
|
|
22
|
-
const emptyCategories: any[] = [];
|
|
23
|
-
|
|
24
|
-
interface AgentTarget {
|
|
25
|
-
name: string;
|
|
26
|
-
factory: () => { prompt: string; description?: string };
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const HEADER = `<!--
|
|
30
|
-
BASELINE SNAPSHOT — do not edit manually
|
|
31
|
-
~tokens = bytes / 4 (approximate, varies by model)
|
|
32
|
-
-->
|
|
33
|
-
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
function bytesToTokens(bytes: number): number {
|
|
37
|
-
return Math.round(bytes / 4);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function writeSnapshot(filename: string, prompt: string): void {
|
|
41
|
-
const bytes = Buffer.byteLength(prompt, "utf8");
|
|
42
|
-
const tokens = bytesToTokens(bytes);
|
|
43
|
-
const content =
|
|
44
|
-
HEADER +
|
|
45
|
-
prompt +
|
|
46
|
-
`\n\n<!-- ${bytes} bytes · ~${tokens} tokens -->`;
|
|
47
|
-
const filepath = join(OUT_DIR, filename);
|
|
48
|
-
mkdirSync(dirname(filepath), { recursive: true });
|
|
49
|
-
writeFileSync(filepath, content, "utf8");
|
|
50
|
-
const { readFileSync: read } = require("fs");
|
|
51
|
-
const verify = read(filepath, "utf8") as string;
|
|
52
|
-
if (verify !== content) {
|
|
53
|
-
throw new Error(`Snapshot not deterministic: ${filename}`);
|
|
54
|
-
}
|
|
55
|
-
console.log(` ${filename} — ${bytes} B · ~${tokens} tokens`);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const targets: AgentTarget[] = [
|
|
59
|
-
{
|
|
60
|
-
name: "bob.default",
|
|
61
|
-
factory: () =>
|
|
62
|
-
createBobAgent(
|
|
63
|
-
"claude",
|
|
64
|
-
emptyAgents,
|
|
65
|
-
emptyTools,
|
|
66
|
-
emptySkills,
|
|
67
|
-
emptyCategories,
|
|
68
|
-
false,
|
|
69
|
-
),
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "bob.gpt-pro",
|
|
73
|
-
factory: () =>
|
|
74
|
-
createBobAgent(
|
|
75
|
-
"gpt/5.4-pro",
|
|
76
|
-
emptyAgents,
|
|
77
|
-
emptyTools,
|
|
78
|
-
emptySkills,
|
|
79
|
-
emptyCategories,
|
|
80
|
-
false,
|
|
81
|
-
),
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "bob.gemini",
|
|
85
|
-
factory: () =>
|
|
86
|
-
createBobAgent(
|
|
87
|
-
"google/gemini-3.1-pro",
|
|
88
|
-
emptyAgents,
|
|
89
|
-
emptyTools,
|
|
90
|
-
emptySkills,
|
|
91
|
-
emptyCategories,
|
|
92
|
-
false,
|
|
93
|
-
),
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: "coder.gpt",
|
|
97
|
-
factory: () =>
|
|
98
|
-
createCoderAgent(
|
|
99
|
-
"gpt",
|
|
100
|
-
emptyAgents,
|
|
101
|
-
emptyTools,
|
|
102
|
-
emptySkills,
|
|
103
|
-
emptyCategories,
|
|
104
|
-
false,
|
|
105
|
-
),
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "coder.gpt-codex",
|
|
109
|
-
factory: () =>
|
|
110
|
-
createCoderAgent(
|
|
111
|
-
"github-copilot/gpt-5.3-codex",
|
|
112
|
-
emptyAgents,
|
|
113
|
-
emptyTools,
|
|
114
|
-
emptySkills,
|
|
115
|
-
emptyCategories,
|
|
116
|
-
false,
|
|
117
|
-
),
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "coder.gpt-pro",
|
|
121
|
-
factory: () =>
|
|
122
|
-
createCoderAgent(
|
|
123
|
-
"gpt/5.4-pro",
|
|
124
|
-
emptyAgents,
|
|
125
|
-
emptyTools,
|
|
126
|
-
emptySkills,
|
|
127
|
-
emptyCategories,
|
|
128
|
-
false,
|
|
129
|
-
),
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: "critic",
|
|
133
|
-
factory: () => createCriticAgent("claude"),
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: "guard",
|
|
137
|
-
factory: () =>
|
|
138
|
-
createGuardAgent({
|
|
139
|
-
model: "claude",
|
|
140
|
-
availableAgents: emptyAgents,
|
|
141
|
-
availableSkills: emptySkills,
|
|
142
|
-
}),
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: "strategist",
|
|
146
|
-
factory: () => {
|
|
147
|
-
const prompt = getStrategistPrompt("claude");
|
|
148
|
-
return { prompt, description: "Strategist prompt" };
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name: "sub",
|
|
153
|
-
factory: () =>
|
|
154
|
-
createBobJuniorAgentWithOverrides(undefined, "claude", false),
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: "researcher",
|
|
158
|
-
factory: () => createResearcherAgent("claude"),
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: "quality-guardian",
|
|
162
|
-
factory: () => createQualityGuardianAgent("claude"),
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: "platform-manager",
|
|
166
|
-
factory: () => createPlatformManagerAgent("claude"),
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: "multimodal",
|
|
170
|
-
factory: () => createMultimodalLookerAgent("claude"),
|
|
171
|
-
},
|
|
172
|
-
];
|
|
173
|
-
|
|
174
|
-
console.log("\n📏 Building prompt snapshots...\n");
|
|
175
|
-
|
|
176
|
-
let totalBytes = 0;
|
|
177
|
-
for (const target of targets) {
|
|
178
|
-
const { name } = target;
|
|
179
|
-
try {
|
|
180
|
-
const { prompt } = target.factory();
|
|
181
|
-
writeSnapshot(`${name}.md`, prompt);
|
|
182
|
-
totalBytes += Buffer.byteLength(prompt, "utf8");
|
|
183
|
-
} catch (err) {
|
|
184
|
-
console.error(` ERROR [${name}]: ${(err as Error).message}`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const totalTokens = bytesToTokens(totalBytes);
|
|
189
|
-
console.log(
|
|
190
|
-
`\n✅ Done — ${totalBytes} B total · ~${totalTokens} tokens across ${targets.length} snapshots\n`,
|
|
191
|
-
);
|
|
192
|
-
console.log("📁 Snapshots written to: dist/prompt-snapshots/");
|
|
193
|
-
console.log(" Commit these BEFORE modifying any prompt code (T18 baseline rule)\n");
|
package/scripts/test_routing.ts
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* Routing tests for hiai-opencode agent system.
|
|
4
|
-
* Verifies that category routing, agent alias resolution, and visibility rules
|
|
5
|
-
* do not regress.
|
|
6
|
-
*
|
|
7
|
-
* Run: bun run test:routing
|
|
8
|
-
*
|
|
9
|
-
* These tests verify the CURRENT routing contract. If the routing behavior
|
|
10
|
-
* changes intentionally, update these tests to match the new behavior and
|
|
11
|
-
* document the change.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { resolveCanonicalDelegateAgentKey, CODER_AGENT_CONFIG_KEY, SUB_AGENT_CONFIG_KEY } from "../src/tools/delegate-task/sub-agent.ts"
|
|
15
|
-
import { getAgentConfigKey, getAgentDisplayName } from "../src/shared/agent-display-names.ts"
|
|
16
|
-
import { sanitizeSubagentType } from "../src/tools/delegate-task/subagent-discovery.ts"
|
|
17
|
-
|
|
18
|
-
// ── Test helpers ────────────────────────────────────────────────────────────────
|
|
19
|
-
|
|
20
|
-
let pass = 0;
|
|
21
|
-
let fail = 0;
|
|
22
|
-
|
|
23
|
-
function test(name: string, fn: () => boolean): void {
|
|
24
|
-
try {
|
|
25
|
-
if (fn()) {
|
|
26
|
-
pass++;
|
|
27
|
-
console.log(` ${green("✓")} ${name}`);
|
|
28
|
-
} else {
|
|
29
|
-
fail++;
|
|
30
|
-
console.log(` ${red("✗")} ${name}`);
|
|
31
|
-
}
|
|
32
|
-
} catch (e) {
|
|
33
|
-
fail++;
|
|
34
|
-
console.log(` ${red("✗")} ${name} — threw: ${e}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function green(s: string) { return `\x1b[32m${s}\x1b[0m`; }
|
|
39
|
-
function red(s: string) { return `\x1b[31m${s}\x1b[0m`; }
|
|
40
|
-
|
|
41
|
-
// ── Constants ─────────────────────────────────────────────────────────────────
|
|
42
|
-
|
|
43
|
-
test("CODER_AGENT_CONFIG_KEY equals 'coder'", () => {
|
|
44
|
-
return CODER_AGENT_CONFIG_KEY === "coder";
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test("SUB_AGENT_CONFIG_KEY equals 'sub'", () => {
|
|
48
|
-
return SUB_AGENT_CONFIG_KEY === "sub";
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// All categories route to CODER_AGENT_CONFIG_KEY ("coder") in category-resolver.ts
|
|
52
|
-
// This is the foundational routing invariant.
|
|
53
|
-
|
|
54
|
-
test("All categories route to coder (CODER_AGENT_CONFIG_KEY)", () => {
|
|
55
|
-
return CODER_AGENT_CONFIG_KEY === "coder";
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// ── Canonical key resolution: Critic aliases ─────────────────────────────────
|
|
59
|
-
// quality-guardian, code-reviewer, systematic-debugger resolve to "critic"
|
|
60
|
-
|
|
61
|
-
test("quality-guardian resolves to critic", () => {
|
|
62
|
-
return resolveCanonicalDelegateAgentKey("quality-guardian") === "critic";
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test("code-reviewer resolves to critic", () => {
|
|
66
|
-
return resolveCanonicalDelegateAgentKey("code-reviewer") === "critic";
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test("systematic-debugger resolves to critic", () => {
|
|
70
|
-
return resolveCanonicalDelegateAgentKey("systematic-debugger") === "critic";
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// The display name for critic-group aliases is "Critic" (not "Quality Guardian")
|
|
74
|
-
// because they resolve to the critic key, whose display name is "Critic".
|
|
75
|
-
|
|
76
|
-
test("getAgentDisplayName(quality-guardian) returns Critic (resolved to critic key)", () => {
|
|
77
|
-
return getAgentDisplayName("quality-guardian") === "Critic";
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// ── Canonical key resolution: Manager ──────────────────────────────────────
|
|
81
|
-
// "manager" is a public alias for "platform-manager" runtime key
|
|
82
|
-
// Manager -> platform-manager (config key) -> Manager (display name)
|
|
83
|
-
|
|
84
|
-
test("manager resolves to platform-manager", () => {
|
|
85
|
-
return resolveCanonicalDelegateAgentKey("manager") === "platform-manager";
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
test("getAgentDisplayName(manager) returns Manager", () => {
|
|
89
|
-
return getAgentDisplayName("manager") === "Manager";
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
test("getAgentConfigKey(Manager) returns platform-manager", () => {
|
|
93
|
-
return getAgentConfigKey("Manager") === "platform-manager";
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// ── Canonical key resolution: Vision ─────────────────────────────────────────
|
|
97
|
-
// "vision" is a public alias for "multimodal" OR "ui" (internal runtime key varies)
|
|
98
|
-
// Vision (display name) -> ui (config key) -> Vision (display name)
|
|
99
|
-
|
|
100
|
-
test("getAgentConfigKey(Vision) returns ui (display name resolves to config key)", () => {
|
|
101
|
-
return getAgentConfigKey("Vision") === "ui";
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test("getAgentDisplayName(Vision) returns Vision", () => {
|
|
105
|
-
return getAgentDisplayName("Vision") === "Vision";
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// "ui" and "multimodal" are internal runtime keys for Vision family
|
|
109
|
-
// ui resolves to multimodal (via LEGACY_DELEGATE_AGENT_ALIASES)
|
|
110
|
-
|
|
111
|
-
test("ui resolves to multimodal (legacy delegate alias)", () => {
|
|
112
|
-
return resolveCanonicalDelegateAgentKey("ui") === "multimodal";
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
test("getAgentDisplayName(ui) returns Vision", () => {
|
|
116
|
-
return getAgentDisplayName("ui") === "Vision";
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
test("getAgentDisplayName(multimodal) returns Vision", () => {
|
|
120
|
-
return getAgentDisplayName("multimodal") === "Vision";
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// ── Canonical key resolution: Direct specialists ─────────────────────────────
|
|
124
|
-
|
|
125
|
-
test("designer resolves to designer", () => {
|
|
126
|
-
return resolveCanonicalDelegateAgentKey("designer") === "designer";
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
test("brainstormer resolves to brainstormer", () => {
|
|
130
|
-
return resolveCanonicalDelegateAgentKey("brainstormer") === "brainstormer";
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test("researcher resolves to researcher", () => {
|
|
134
|
-
return resolveCanonicalDelegateAgentKey("researcher") === "researcher";
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
test("bob resolves to bob", () => {
|
|
138
|
-
return resolveCanonicalDelegateAgentKey("bob") === "bob";
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
test("strategist resolves to strategist", () => {
|
|
142
|
-
return resolveCanonicalDelegateAgentKey("strategist") === "strategist";
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
test("guard resolves to guard", () => {
|
|
146
|
-
return resolveCanonicalDelegateAgentKey("guard") === "guard";
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
test("critic resolves to critic", () => {
|
|
150
|
-
return resolveCanonicalDelegateAgentKey("critic") === "critic";
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
test("platform-manager resolves to platform-manager", () => {
|
|
154
|
-
return resolveCanonicalDelegateAgentKey("platform-manager") === "platform-manager";
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
test("multimodal resolves to multimodal", () => {
|
|
158
|
-
return resolveCanonicalDelegateAgentKey("multimodal") === "multimodal";
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
// ── Legacy aliases ───────────────────────────────────────────────────────────
|
|
162
|
-
|
|
163
|
-
test("librarian resolves to researcher", () => {
|
|
164
|
-
return resolveCanonicalDelegateAgentKey("librarian") === "researcher";
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
test("explore resolves to researcher", () => {
|
|
168
|
-
return resolveCanonicalDelegateAgentKey("explore") === "researcher";
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
test("mindmodel resolves to platform-manager", () => {
|
|
172
|
-
return resolveCanonicalDelegateAgentKey("mindmodel") === "platform-manager";
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// ── Sub/agent-skills blocking ────────────────────────────────────────────────
|
|
176
|
-
// sub and agent-skills are internal/hidden agents blocked as direct task targets.
|
|
177
|
-
// subagent alias resolves to sub (which is then blocked by SUB_AGENT_CONFIG_KEY check).
|
|
178
|
-
|
|
179
|
-
test("subagent resolves to sub (blocked as direct target)", () => {
|
|
180
|
-
return resolveCanonicalDelegateAgentKey("subagent") === "sub";
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
test("sub resolves to sub (blocked as direct target)", () => {
|
|
184
|
-
return resolveCanonicalDelegateAgentKey("sub") === "sub";
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
test("agent-skills canonical key is 'agent-skills'", () => {
|
|
188
|
-
return resolveCanonicalDelegateAgentKey("agent-skills") === "agent-skills";
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// Hidden agents have display names Sub and Agent Skills
|
|
192
|
-
|
|
193
|
-
test("'sub' display name is 'Sub' (hidden)", () => {
|
|
194
|
-
return getAgentDisplayName("sub") === "Sub";
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
test("'agent-skills' display name is 'Agent Skills' (hidden)", () => {
|
|
198
|
-
return getAgentDisplayName("agent-skills") === "Agent Skills";
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
// ── Display names: primary visible agents ───────────────────────────────────
|
|
202
|
-
|
|
203
|
-
test("getAgentDisplayName(bob) returns Bob", () => {
|
|
204
|
-
return getAgentDisplayName("bob") === "Bob";
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
test("getAgentDisplayName(coder) returns Coder", () => {
|
|
208
|
-
return getAgentDisplayName("coder") === "Coder";
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
test("getAgentDisplayName(strategist) returns Strategist", () => {
|
|
212
|
-
return getAgentDisplayName("strategist") === "Strategist";
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
test("getAgentDisplayName(guard) returns Guard", () => {
|
|
216
|
-
return getAgentDisplayName("guard") === "Guard";
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
test("getAgentDisplayName(critic) returns Critic", () => {
|
|
220
|
-
return getAgentDisplayName("critic") === "Critic";
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
test("getAgentDisplayName(designer) returns Designer", () => {
|
|
224
|
-
return getAgentDisplayName("designer") === "Designer";
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
test("getAgentDisplayName(researcher) returns Researcher", () => {
|
|
228
|
-
return getAgentDisplayName("researcher") === "Researcher";
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
test("getAgentDisplayName(brainstormer) returns Brainstormer", () => {
|
|
232
|
-
return getAgentDisplayName("brainstormer") === "Brainstormer";
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
test("getAgentDisplayName(platform-manager) returns Manager", () => {
|
|
236
|
-
return getAgentDisplayName("platform-manager") === "Manager";
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
// ── Config key: case-insensitivity ─────────────────────────────────────────
|
|
240
|
-
|
|
241
|
-
test("getAgentConfigKey(Bob) returns bob", () => {
|
|
242
|
-
return getAgentConfigKey("Bob") === "bob";
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
test("getAgentConfigKey(BOB) returns bob (case-insensitive)", () => {
|
|
246
|
-
return getAgentConfigKey("BOB") === "bob";
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
// ── sanitizeSubagentType ────────────────────────────────────────────────────
|
|
250
|
-
|
|
251
|
-
test("sanitizeSubagentType trims whitespace", () => {
|
|
252
|
-
return sanitizeSubagentType(" bob ") === "bob";
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
test("sanitizeSubagentType removes surrounding quotes", () => {
|
|
256
|
-
return sanitizeSubagentType('"bob"') === "bob";
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
test("sanitizeSubagentType removes surrounding slashes", () => {
|
|
260
|
-
return sanitizeSubagentType("/bob/") === "bob";
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
// ── Public model contract ───────────────────────────────────────────────────
|
|
264
|
-
// These verify the PUBLIC model: users should see simple canonical names.
|
|
265
|
-
|
|
266
|
-
const PUBLIC_AGENTS: [string, string][] = [
|
|
267
|
-
["bob", "Bob"],
|
|
268
|
-
["coder", "Coder"],
|
|
269
|
-
["strategist", "Strategist"],
|
|
270
|
-
["guard", "Guard"],
|
|
271
|
-
["critic", "Critic"],
|
|
272
|
-
["designer", "Designer"],
|
|
273
|
-
["researcher", "Researcher"],
|
|
274
|
-
["platform-manager", "Manager"],
|
|
275
|
-
["brainstormer", "Brainstormer"],
|
|
276
|
-
["multimodal", "Vision"],
|
|
277
|
-
];
|
|
278
|
-
|
|
279
|
-
for (const [configKey, expectedDisplay] of PUBLIC_AGENTS) {
|
|
280
|
-
test(`public agent ${configKey} → display name '${expectedDisplay}'`, () => {
|
|
281
|
-
return getAgentDisplayName(configKey) === expectedDisplay;
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// ── Summary ───────────────────────────────────────────────────────────────
|
|
286
|
-
|
|
287
|
-
console.log();
|
|
288
|
-
console.log(` Results: ${green(`${pass} pass`)} ${red(`${fail} fail`)}`);
|
|
289
|
-
if (fail > 0) {
|
|
290
|
-
console.log();
|
|
291
|
-
process.exit(1);
|
|
292
|
-
}
|
|
293
|
-
console.log();
|
|
294
|
-
process.exit(0);
|