@koinzhang/paseo-plugin-activity 0.1.0

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.
Files changed (52) hide show
  1. package/client/activity-heatmap.tsx +138 -0
  2. package/client/global-surface.tsx +689 -0
  3. package/client/panel.tsx +423 -0
  4. package/client/pending-skill.ts +50 -0
  5. package/client/pill-data-cache.test.ts +68 -0
  6. package/client/pill-data-cache.ts +37 -0
  7. package/client/pill.tsx +211 -0
  8. package/client/provider-filter.test.ts +95 -0
  9. package/client/provider-filter.ts +44 -0
  10. package/client/rank-color.test.ts +35 -0
  11. package/client/rank-color.ts +69 -0
  12. package/client/usage-popover.tsx +383 -0
  13. package/client/usage-query.tsx +54 -0
  14. package/client/usage-stats.tsx +18 -0
  15. package/client/use-app-language.ts +14 -0
  16. package/client/web.ts +28 -0
  17. package/index.client.tsx +62 -0
  18. package/index.server.ts +128 -0
  19. package/package.json +31 -0
  20. package/paseo-plugin.json +6 -0
  21. package/server/agents.test.ts +67 -0
  22. package/server/agents.ts +75 -0
  23. package/server/background-sync.test.ts +143 -0
  24. package/server/background-sync.ts +105 -0
  25. package/server/handlers-query.test.ts +91 -0
  26. package/server/handlers.ts +531 -0
  27. package/server/host-types.ts +14 -0
  28. package/server/ingest.test.ts +233 -0
  29. package/server/ingest.ts +277 -0
  30. package/server/mcp-servers.test.ts +70 -0
  31. package/server/mcp-servers.ts +212 -0
  32. package/server/messages.test.ts +150 -0
  33. package/server/migrate-data.test.ts +65 -0
  34. package/server/migrate-data.ts +54 -0
  35. package/server/resolve-model.test.ts +11 -0
  36. package/server/resolve-model.ts +30 -0
  37. package/server/skill-path.test.ts +56 -0
  38. package/server/skill-path.ts +85 -0
  39. package/server/store.test.ts +221 -0
  40. package/server/store.ts +909 -0
  41. package/server/ttl-cache.ts +34 -0
  42. package/shared/activity.test.ts +86 -0
  43. package/shared/activity.ts +185 -0
  44. package/shared/classify.test.ts +306 -0
  45. package/shared/classify.ts +378 -0
  46. package/shared/format.test.ts +48 -0
  47. package/shared/format.ts +45 -0
  48. package/shared/insights.test.ts +122 -0
  49. package/shared/insights.ts +188 -0
  50. package/shared/plugin-id.ts +7 -0
  51. package/shared/usage.test.ts +668 -0
  52. package/shared/usage.ts +726 -0
@@ -0,0 +1,233 @@
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ import type { AgentTimelineItem } from "./host-types.ts";
4
+ import type { PluginHookAgent } from "@getpaseo/plugin/server";
5
+ import { ingestTimeline } from "./ingest.ts";
6
+ import type { ToolCallRow, UsageStore } from "./store.ts";
7
+
8
+ const agent: PluginHookAgent = {
9
+ id: "agent-1",
10
+ workspaceId: "ws-1",
11
+ parentAgentId: null,
12
+ provider: "claude",
13
+ cwd: "/repo",
14
+ title: "test agent",
15
+ };
16
+
17
+ const FIXED_NOW = "2026-09-18T12:00:00.000Z";
18
+ const fixedNow = () => new Date(FIXED_NOW);
19
+
20
+ function fakeStore(): UsageStore & { rows: ToolCallRow[] } {
21
+ const rows: ToolCallRow[] = [];
22
+ const index = new Map<string, number>();
23
+ const agents = new Map<string, import("./store.ts").AgentRow>();
24
+ const sync = new Map<string, { agentId: string; epoch: string; lastSeq: number; updatedAt: string }>();
25
+ return {
26
+ driver: "jsonl",
27
+ upsertUserMessages: () => 0,
28
+ selectUserMessages: () => [],
29
+ rows,
30
+ upsertMany(batch) {
31
+ for (const row of batch) {
32
+ const key = `${row.agentId}\u0000${row.callId}`;
33
+ const at = index.get(key);
34
+ if (at === undefined) {
35
+ index.set(key, rows.length);
36
+ rows.push(row);
37
+ } else {
38
+ rows[at] = row;
39
+ }
40
+ }
41
+ return batch.length;
42
+ },
43
+ count() {
44
+ return rows.length;
45
+ },
46
+ getRow(agentId, callId) {
47
+ return rows.find((row) => row.agentId === agentId && row.callId === callId) ?? null;
48
+ },
49
+ select() {
50
+ return [...rows];
51
+ },
52
+ upsertAgents(batch) {
53
+ for (const row of batch) agents.set(row.agentId, row);
54
+ return batch.length;
55
+ },
56
+ getAgent(agentId) {
57
+ return agents.get(agentId) ?? null;
58
+ },
59
+ selectAgents() {
60
+ return [...agents.values()];
61
+ },
62
+ getSyncState(agentId) {
63
+ return sync.get(agentId) ?? null;
64
+ },
65
+ setSyncState(agentId, epoch, lastSeq) {
66
+ sync.set(agentId, {
67
+ agentId,
68
+ epoch,
69
+ lastSeq,
70
+ updatedAt: new Date().toISOString(),
71
+ });
72
+ },
73
+ deleteCanonicalUserMessages() {
74
+ return 0;
75
+ },
76
+ close() {},
77
+ };
78
+ }
79
+
80
+ test("ingestTimeline maps only tool_call items", () => {
81
+ const timeline: AgentTimelineItem[] = [
82
+ { type: "user_message", text: "hi" },
83
+ {
84
+ type: "tool_call",
85
+ callId: "call-1",
86
+ name: "Skill",
87
+ detail: { type: "plain_text", label: "paseo-plugin" },
88
+ status: "completed",
89
+ error: null,
90
+ },
91
+ {
92
+ type: "tool_call",
93
+ callId: "call-2",
94
+ name: "Bash",
95
+ detail: { type: "shell", command: "git status", exitCode: 0 },
96
+ status: "completed",
97
+ error: null,
98
+ },
99
+ { type: "assistant_message", text: "done" },
100
+ ];
101
+
102
+ const rows = ingestTimeline(timeline, agent, null, {}, fixedNow);
103
+
104
+ assert.equal(rows.length, 2);
105
+ const skillRow = rows[0];
106
+ assert.equal(skillRow?.callId, "call-1");
107
+ assert.equal(skillRow?.category, "skill");
108
+ assert.equal(skillRow?.confidence, "exact");
109
+ assert.equal(skillRow?.skillName, "paseo-plugin");
110
+ assert.equal(skillRow?.agentId, "agent-1");
111
+ assert.equal(skillRow?.workspaceId, "ws-1");
112
+ assert.equal(skillRow?.provider, "claude");
113
+ assert.equal(skillRow?.turnId, null);
114
+ assert.equal(skillRow?.ingestedAt, FIXED_NOW);
115
+ assert.equal(skillRow?.seq, null);
116
+ assert.equal(skillRow?.ts, null);
117
+ const shellRow = rows[1];
118
+ assert.equal(shellRow?.category, "regular");
119
+ assert.equal(shellRow?.detailType, "shell");
120
+ assert.equal(shellRow?.command, "git status");
121
+ });
122
+
123
+ test("ingestTimeline stamps explicit turnId for backfill paths", () => {
124
+ const rows = ingestTimeline(
125
+ [
126
+ {
127
+ type: "tool_call",
128
+ callId: "call-turn",
129
+ name: "Bash",
130
+ detail: { type: "shell", command: "ls" },
131
+ status: "completed",
132
+ error: null,
133
+ },
134
+ ],
135
+ agent,
136
+ "turn-1",
137
+ {},
138
+ fixedNow,
139
+ );
140
+ assert.equal(rows[0]?.turnId, "turn-1");
141
+ });
142
+
143
+ test("ingestTimeline captures failure message", () => {
144
+ const rows = ingestTimeline(
145
+ [
146
+ {
147
+ type: "tool_call",
148
+ callId: "call-err",
149
+ name: "Bash",
150
+ detail: { type: "shell", command: "false" },
151
+ status: "failed",
152
+ error: { message: "exit code 1" },
153
+ },
154
+ ],
155
+ agent,
156
+ null,
157
+ {},
158
+ fixedNow,
159
+ );
160
+
161
+ assert.equal(rows.length, 1);
162
+ assert.equal(rows[0]?.status, "failed");
163
+ assert.equal(rows[0]?.errorMessage, "exit code 1");
164
+ });
165
+
166
+ test("ingestTimeline applies provider-specific mcp rules", () => {
167
+ const rows = ingestTimeline(
168
+ [
169
+ {
170
+ type: "tool_call",
171
+ callId: "call-mcp",
172
+ name: "github.search",
173
+ detail: { type: "unknown", input: {}, output: null },
174
+ status: "completed",
175
+ error: null,
176
+ },
177
+ ],
178
+ { ...agent, provider: "codex" },
179
+ null,
180
+ {},
181
+ fixedNow,
182
+ );
183
+
184
+ assert.equal(rows[0]?.category, "mcp");
185
+ assert.equal(rows[0]?.mcpServer, "github");
186
+ assert.equal(rows[0]?.mcpTool, "search");
187
+ });
188
+
189
+ test("ingestTimeline OpenCode MCP uses mcpServers option", () => {
190
+ const rows = ingestTimeline(
191
+ [
192
+ {
193
+ type: "tool_call",
194
+ callId: "call-mobile",
195
+ name: "mobile-mcp_mobile_list_available_devices",
196
+ detail: { type: "unknown", input: {}, output: null },
197
+ status: "completed",
198
+ error: null,
199
+ },
200
+ ],
201
+ { ...agent, provider: "opencode" },
202
+ null,
203
+ { mcpServers: ["mobile-mcp", "paseo"] },
204
+ fixedNow,
205
+ );
206
+
207
+ assert.equal(rows[0]?.category, "mcp");
208
+ assert.equal(rows[0]?.mcpServer, "mobile-mcp");
209
+ assert.equal(rows[0]?.mcpTool, "mobile_list_available_devices");
210
+ });
211
+
212
+ test("ingestTimeline rows upsert idempotently through the store", () => {
213
+ const store = fakeStore();
214
+ const timeline: AgentTimelineItem[] = [
215
+ {
216
+ type: "tool_call",
217
+ callId: "call-dup",
218
+ name: "Bash",
219
+ detail: { type: "shell", command: "git status" },
220
+ status: "running",
221
+ error: null,
222
+ },
223
+ ];
224
+ store.upsertMany(ingestTimeline(timeline, agent, null, {}, fixedNow));
225
+ store.upsertMany(ingestTimeline(timeline, agent, null, {}, fixedNow));
226
+ assert.equal(store.count(), 1);
227
+ assert.equal(store.getRow("agent-1", "call-dup")?.status, "running");
228
+ });
229
+
230
+ test("ingestTimeline returns empty array for timelines without tool calls", () => {
231
+ const rows = ingestTimeline([{ type: "user_message", text: "hi" }], agent, null, {}, fixedNow);
232
+ assert.deepEqual(rows, []);
233
+ });
@@ -0,0 +1,277 @@
1
+ import { createHash } from "node:crypto";
2
+ import type { AgentTimelineItem } from "./host-types.ts";
3
+ import type { PluginHookAgent } from "@getpaseo/plugin/server";
4
+ import { classifyToolCall, DEFAULT_SKILL_ROOTS, type ToolCallInput } from "../shared/classify.ts";
5
+ import { resolveMcpServers } from "./mcp-servers.ts";
6
+ import type { ToolCallRow, UserMessageRow, UsageStore } from "./store.ts";
7
+ import { createKeyedTtlCache } from "./ttl-cache.ts";
8
+ import { readdirSync, statSync } from "node:fs";
9
+ import { homedir } from "node:os";
10
+ import { join } from "node:path";
11
+
12
+ export type IngestClassifyOptions = {
13
+ homeDir?: string;
14
+ skillRoots?: readonly string[];
15
+ mcpServers?: readonly string[];
16
+ };
17
+
18
+ export type IngestTurnOptions = IngestClassifyOptions & {
19
+ store: UsageStore;
20
+ now?: () => string;
21
+ model?: string | null;
22
+ };
23
+
24
+ const pluginSkillRootsCache = createKeyedTtlCache<string[]>(60_000);
25
+
26
+ // Discover plugin skill dirs under ~/.paseo/plugins (…/checkout/…/skills).
27
+ export function discoverPaseoPluginSkillRoots(homeDir: string): string[] {
28
+ return pluginSkillRootsCache.get(homeDir, () => discoverPaseoPluginSkillRootsUncached(homeDir));
29
+ }
30
+
31
+ function discoverPaseoPluginSkillRootsUncached(homeDir: string): string[] {
32
+ const pluginsRoot = join(homeDir, ".paseo", "plugins");
33
+ const roots: string[] = [];
34
+
35
+ const tryPush = (path: string) => {
36
+ try {
37
+ if (statSync(path).isDirectory()) roots.push(path);
38
+ } catch {
39
+ /* skip */
40
+ }
41
+ };
42
+
43
+ try {
44
+ for (const pluginId of readdirSync(pluginsRoot)) {
45
+ const pluginDir = join(pluginsRoot, pluginId);
46
+ let topEntries: string[];
47
+ try {
48
+ topEntries = readdirSync(pluginDir);
49
+ } catch {
50
+ continue;
51
+ }
52
+ for (const entry of topEntries) {
53
+ const nested = join(pluginDir, entry);
54
+ tryPush(join(nested, "skills"));
55
+ try {
56
+ for (const child of readdirSync(nested)) {
57
+ tryPush(join(nested, child, "skills"));
58
+ try {
59
+ for (const grand of readdirSync(join(nested, child))) {
60
+ tryPush(join(nested, child, grand, "skills"));
61
+ }
62
+ } catch {
63
+ /* skip */
64
+ }
65
+ }
66
+ } catch {
67
+ /* skip */
68
+ }
69
+ }
70
+ }
71
+ } catch {
72
+ /* no plugins dir */
73
+ }
74
+ return roots;
75
+ }
76
+
77
+ export function buildSkillRoots(agent: PluginHookAgent, homeDir: string): string[] {
78
+ const expanded: string[] = [];
79
+ for (const root of DEFAULT_SKILL_ROOTS) {
80
+ if (root.includes("*")) continue;
81
+ if (root.startsWith("~/")) {
82
+ expanded.push(join(homeDir, root.slice(2)));
83
+ } else if (root.startsWith(".")) {
84
+ expanded.push(join(agent.cwd, root));
85
+ } else {
86
+ expanded.push(root);
87
+ }
88
+ }
89
+ return [...expanded, ...discoverPaseoPluginSkillRoots(homeDir)];
90
+ }
91
+
92
+ /** Home / plugin skill roots only (no project-relative paths). */
93
+ export function buildHomeSkillRoots(homeDir: string): string[] {
94
+ const expanded: string[] = [];
95
+ for (const root of DEFAULT_SKILL_ROOTS) {
96
+ if (root.includes("*")) continue;
97
+ if (root.startsWith("~/")) {
98
+ expanded.push(join(homeDir, root.slice(2)));
99
+ }
100
+ }
101
+ return [...expanded, ...discoverPaseoPluginSkillRoots(homeDir)];
102
+ }
103
+
104
+ function toClassifyInput(item: Extract<AgentTimelineItem, { type: "tool_call" }>): ToolCallInput {
105
+ return {
106
+ name: item.name,
107
+ detail: item.detail as ToolCallInput["detail"],
108
+ metadata: item.metadata ?? null,
109
+ };
110
+ }
111
+
112
+ function errorMessage(error: unknown): string | null {
113
+ if (error == null) return null;
114
+ if (typeof error === "string") return error;
115
+ if (typeof error === "object" && error !== null && "message" in error) {
116
+ const msg = (error as { message: unknown }).message;
117
+ if (typeof msg === "string") return msg;
118
+ }
119
+ try {
120
+ return JSON.stringify(error);
121
+ } catch {
122
+ return String(error);
123
+ }
124
+ }
125
+
126
+ export function toolCallToRow(
127
+ item: Extract<AgentTimelineItem, { type: "tool_call" }>,
128
+ agent: PluginHookAgent,
129
+ opts: {
130
+ skillRoots: readonly string[];
131
+ homeDir: string;
132
+ mcpServers?: readonly string[];
133
+ turnId?: string | null;
134
+ seq?: number | null;
135
+ ts?: string | null;
136
+ ingestedAt: string;
137
+ },
138
+ ): ToolCallRow {
139
+ const hit = classifyToolCall(toClassifyInput(item), {
140
+ provider: agent.provider,
141
+ skillRoots: opts.skillRoots,
142
+ homeDir: opts.homeDir,
143
+ mcpServers: opts.mcpServers,
144
+ });
145
+ return {
146
+ agentId: agent.id,
147
+ callId: item.callId,
148
+ workspaceId: agent.workspaceId,
149
+ provider: agent.provider,
150
+ turnId: opts.turnId ?? null,
151
+ name: item.name,
152
+ detailType: hit.detailType,
153
+ category: hit.category,
154
+ confidence: hit.confidence,
155
+ skillName: hit.skillName,
156
+ mcpServer: hit.mcpServer,
157
+ mcpTool: hit.mcpTool,
158
+ command: hit.command,
159
+ filePath: hit.filePath,
160
+ status: item.status,
161
+ errorMessage: errorMessage(item.error),
162
+ seq: opts.seq ?? null,
163
+ ts: opts.ts ?? null,
164
+ ingestedAt: opts.ingestedAt,
165
+ };
166
+ }
167
+
168
+ /**
169
+ * Map a timeline snapshot to tool_call rows (pure; no store I/O).
170
+ *
171
+ * Live turn_ended snapshots are full history — do not stamp event.turnId on every
172
+ * row (would mis-attribute older calls). Pass turnId only for known single-turn
173
+ * or backfill paths.
174
+ */
175
+ export function ingestTimeline(
176
+ timeline: readonly AgentTimelineItem[],
177
+ agent: PluginHookAgent,
178
+ turnId: string | null,
179
+ options: IngestClassifyOptions = {},
180
+ now: () => Date = () => new Date(),
181
+ ): ToolCallRow[] {
182
+ const homeDir = options.homeDir ?? "";
183
+ const skillRoots =
184
+ options.skillRoots ?? (homeDir ? buildSkillRoots(agent, homeDir) : [...DEFAULT_SKILL_ROOTS]);
185
+ const mcpServers =
186
+ options.mcpServers ??
187
+ (homeDir
188
+ ? resolveMcpServers({ homeDir, cwd: agent.cwd, agentId: agent.id })
189
+ : undefined);
190
+ const ingestedAt = now().toISOString();
191
+ const rows: ToolCallRow[] = [];
192
+ for (const item of timeline) {
193
+ if (item.type !== "tool_call") continue;
194
+ rows.push(
195
+ toolCallToRow(item, agent, {
196
+ skillRoots,
197
+ homeDir,
198
+ mcpServers,
199
+ turnId,
200
+ ingestedAt,
201
+ }),
202
+ );
203
+ }
204
+ return rows;
205
+ }
206
+
207
+ /** Scan a turn_ended timeline snapshot and upsert tool_calls. Never throws. */
208
+ export function ingestTurnTimeline(
209
+ agent: PluginHookAgent,
210
+ timeline: readonly AgentTimelineItem[],
211
+ options: IngestTurnOptions,
212
+ ): { upserted: number } {
213
+ try {
214
+ const nowIso = options.now ?? (() => new Date().toISOString());
215
+ const rows = ingestTimeline(
216
+ timeline,
217
+ agent,
218
+ null,
219
+ {
220
+ homeDir: options.homeDir ?? homedir(),
221
+ skillRoots: options.skillRoots,
222
+ mcpServers: options.mcpServers,
223
+ },
224
+ () => new Date(nowIso()),
225
+ );
226
+ options.store.upsertUserMessages(
227
+ ingestUserMessages(timeline, agent, {
228
+ ingestedAt: nowIso(),
229
+ model: options.model ?? null,
230
+ }),
231
+ );
232
+ if (rows.length === 0) return { upserted: 0 };
233
+ return { upserted: options.store.upsertMany(rows) };
234
+ } catch (err) {
235
+ console.error("[activity] ingestTurnTimeline failed:", err);
236
+ return { upserted: 0 };
237
+ }
238
+ }
239
+
240
+ /** No body is persisted. Anonymous live items wait for canonical identity. */
241
+ export function ingestUserMessages(
242
+ timeline: readonly AgentTimelineItem[],
243
+ agent: PluginHookAgent,
244
+ opts: {
245
+ turnId?: string | null;
246
+ seq?: number;
247
+ ts?: string;
248
+ ingestedAt?: string;
249
+ model?: string | null;
250
+ } = {},
251
+ ): UserMessageRow[] {
252
+ const rows: UserMessageRow[] = [];
253
+ const ingestedAt = opts.ingestedAt ?? new Date().toISOString();
254
+ const model =
255
+ typeof opts.model === "string" && opts.model.trim() ? opts.model.trim() : null;
256
+ for (const item of timeline) {
257
+ if (item.type !== "user_message") continue;
258
+ const identity = item as typeof item & { id?: unknown };
259
+ const id = [item.messageId, item.clientMessageId, identity.id]
260
+ .find((value): value is string => typeof value === "string" && !!value.trim());
261
+ if (!id && opts.seq === undefined) continue;
262
+ const messageId = id ?? `canonical:${createHash("sha256")
263
+ .update(JSON.stringify([agent.id, opts.turnId ?? null, opts.seq])).digest("hex")}`;
264
+ rows.push({
265
+ agentId: agent.id,
266
+ messageId,
267
+ workspaceId: agent.workspaceId,
268
+ provider: agent.provider,
269
+ model,
270
+ turnId: opts.turnId ?? null,
271
+ seq: opts.seq ?? null,
272
+ ts: opts.ts ?? null,
273
+ ingestedAt,
274
+ });
275
+ }
276
+ return rows;
277
+ }
@@ -0,0 +1,70 @@
1
+ import assert from "node:assert/strict";
2
+ import { mkdtempSync, mkdirSync, writeFileSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { describe, it } from "node:test";
6
+ import {
7
+ parseJsonc,
8
+ readOpenCodeMcpServerNames,
9
+ resolveMcpServers,
10
+ } from "./mcp-servers.ts";
11
+
12
+ describe("parseJsonc", () => {
13
+ it("strips line and block comments", () => {
14
+ const parsed = parseJsonc(`{
15
+ // user mcp
16
+ "mcp": {
17
+ "mobile-mcp": { "type": "local" /* ok */ }
18
+ },
19
+ }`);
20
+ assert.deepEqual(parsed, {
21
+ mcp: { "mobile-mcp": { type: "local" } },
22
+ });
23
+ });
24
+ });
25
+
26
+ describe("resolveMcpServers", () => {
27
+ it("reads OpenCode mcp keys and always includes paseo when inject on", () => {
28
+ const home = mkdtempSync(join(tmpdir(), "tool-usage-mcp-"));
29
+ mkdirSync(join(home, ".config", "opencode"), { recursive: true });
30
+ mkdirSync(join(home, ".paseo"), { recursive: true });
31
+ writeFileSync(
32
+ join(home, ".paseo", "config.json"),
33
+ JSON.stringify({ daemon: { mcp: { injectIntoAgents: true } } }),
34
+ );
35
+ writeFileSync(
36
+ join(home, ".config", "opencode", "opencode.jsonc"),
37
+ `{
38
+ // comment
39
+ "mcp": {
40
+ "mobile-mcp": { "type": "local", "command": ["npx"] },
41
+ }
42
+ }`,
43
+ );
44
+
45
+ const names = resolveMcpServers({ homeDir: home });
46
+ assert.ok(names.includes("paseo"));
47
+ assert.ok(names.includes("mobile-mcp"));
48
+ });
49
+
50
+ it("reads project opencode.json mcp keys", () => {
51
+ const home = mkdtempSync(join(tmpdir(), "tool-usage-mcp-"));
52
+ const cwd = mkdtempSync(join(tmpdir(), "tool-usage-cwd-"));
53
+ mkdirSync(join(home, ".paseo"), { recursive: true });
54
+ writeFileSync(
55
+ join(home, ".paseo", "config.json"),
56
+ JSON.stringify({ daemon: { mcp: { injectIntoAgents: false } } }),
57
+ );
58
+ writeFileSync(
59
+ join(cwd, "opencode.json"),
60
+ JSON.stringify({ mcp: { github: { type: "local" } } }),
61
+ );
62
+
63
+ const names = readOpenCodeMcpServerNames(home, cwd);
64
+ assert.deepEqual(names, ["github"]);
65
+
66
+ const resolved = resolveMcpServers({ homeDir: home, cwd });
67
+ assert.ok(!resolved.includes("paseo"));
68
+ assert.ok(resolved.includes("github"));
69
+ });
70
+ });