Skip to content

Commit e2a5e6b

Browse files
committed
feat(explorer): ship explorer as a workspace agent package
1 parent 345fea5 commit e2a5e6b

7 files changed

Lines changed: 86 additions & 6 deletions

File tree

‎agents/explorer/package.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@corbits/agent-explorer",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"license": "SEE LICENSE IN LICENSE.md",
7+
"exports": {
8+
".": {
9+
"types": "./src/index.ts",
10+
"default": "./src/index.ts"
11+
}
12+
}
13+
}
Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,45 @@
1-
import type { DirectorPackage } from "../types.js";
2-
import { READ_TOOLS } from "../tool-sets.js";
3-
41
/**
52
* Explorer worker (CL-7020 / CL-7015 rename from explore).
63
* Map/read against the brief — scannable findings only; never implement, review, or discover the fleet.
4+
*
5+
* Ships as the @corbits/agent-explorer workspace package: the tool allowlist
6+
* lives here so the package stays importable without the app. Drift against
7+
* the app read surface fails src/agent/directors/explorer/package.test.ts.
78
*/
8-
export const explorerPackage: DirectorPackage = {
9+
export type AgentPackage = {
10+
readonly id: "explorer";
11+
readonly primaryIntent: string;
12+
readonly outOfLane: readonly string[];
13+
readonly description: string;
14+
readonly systemPrompt: string;
15+
/** Unset — explorer never attaches skill bodies at spawn. */
16+
readonly attachedSkills?: readonly string[];
17+
/** Unset — explorer declares no skill scope. */
18+
readonly optionalSkills?: readonly string[];
19+
readonly tools: {
20+
readonly allow: readonly string[];
21+
};
22+
readonly spawn: {
23+
readonly maySpawn: false;
24+
};
25+
readonly modelRole: "explore";
26+
readonly tier: "leaf";
27+
};
28+
29+
const EXPLORER_TOOLS = [
30+
"read_file",
31+
"grep",
32+
"search_files",
33+
"list_dir",
34+
"lsp",
35+
"run_shell",
36+
"web_fetch",
37+
"web_search",
38+
"skill_search",
39+
"use_skill",
40+
] as const;
41+
42+
export const explorerPackage: AgentPackage = {
943
id: "explorer",
1044
primaryIntent: "Map and read the codebase; no product edits",
1145
outOfLane: [
@@ -33,7 +67,7 @@ FINDINGS SHAPE: Findings must be a scannable map — key paths, symbols, call fl
3367
FINISH BIAS: Prefer one thorough pass then report. Expand Findings, change approach, or write the final report — do not keep re-reading the same paths.
3468
3569
OUT OF LANE: product writes, drive-by fixes, shipping features, review severity theater, orchestration, spawning specialists, fleet discovery, becoming Coder/Reviewer/orchestrator as primary.`,
36-
tools: { allow: READ_TOOLS },
70+
tools: { allow: [...EXPLORER_TOOLS] },
3771
spawn: { maySpawn: false },
3872
tier: "leaf",
3973
modelRole: "explore",

‎bun.lock‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"tar": "^7.5.1"
8787
},
8888
"dependencies": {
89+
"@corbits/agent-explorer": "workspace:*",
8990
"@corbits/codex-provider": "0.1.1",
9091
"@corbits/oauth-core": "0.2.0",
9192
"@corbits/openai-responses": "0.2.1",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { explorerPackage } from "@corbits/agent-explorer";
4+
import { READ_TOOLS } from "../tool-sets.js";
5+
import { DIRECTOR_REGISTRY } from "../registry.js";
6+
import type { DirectorPackage } from "../types.js";
7+
8+
describe("explorerPackage", () => {
9+
test("workspace package satisfies the director contract and feeds the registry", () => {
10+
const asDirector: DirectorPackage = explorerPackage;
11+
expect(asDirector.id).toBe("explorer");
12+
expect(DIRECTOR_REGISTRY.explorer).toBe(explorerPackage);
13+
expect([...explorerPackage.tools.allow]).toEqual([...READ_TOOLS]);
14+
});
15+
16+
test("extracted copy stays read-only and non-spawning", () => {
17+
expect(explorerPackage.tools.allow).not.toContain("write_file");
18+
expect(explorerPackage.tools.allow).not.toContain("edit_file");
19+
expect(explorerPackage.tools.allow).not.toContain("delete_file");
20+
expect(explorerPackage.spawn.maySpawn).toBe(false);
21+
expect(explorerPackage.tier).toBe("leaf");
22+
});
23+
});

‎src/agent/directors/registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { explorerPackage } from "@corbits/agent-explorer";
12
import type { AgentProfile, CapabilityFilter } from "../profile-types.js";
23
import { artistPackage } from "./artist/package.js";
34
import { coderPackage } from "./coder/package.js";
45
import { designerPackage } from "./designer/package.js";
56
import { dispatchPackage } from "./dispatch/package.js";
6-
import { explorerPackage } from "./explorer/package.js";
77
import { plannerPackage } from "./planner/package.js";
88
import { proberPackage } from "./prober/package.js";
99
import { qaLeadPackage } from "./qa-lead/package.js";

‎tsconfig.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"composite": false,
66
"baseUrl": ".",
77
"paths": {
8+
"@corbits/agent-explorer": ["./agents/explorer/src/index.ts"],
89
"@corbits/provider-opencode-go": ["./packages/opencode-go/src/index.ts"],
910
"@corbits/first-class-providers": [
1011
"./packages/first-class-providers/src/index.ts"
@@ -17,6 +18,7 @@
1718
"src/**/*.ts",
1819
"testkit/**/*.ts",
1920
"packages/**/*.ts",
21+
"agents/**/*.ts",
2022
"e2e/**/*.ts",
2123
"evals/**/*.ts",
2224
"scripts/**/*.ts"

0 commit comments

Comments
 (0)