Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"@modelcontextprotocol/server": "^2.0.0",
"@opencode-ai/sdk": "^1.17.13",
"@pierre/diffs": "^1.3.6",
"@tanstack/react-query": "^5.102.8",
"@tanstack/react-router": "^1.170.33",
"better-result": "^2.10.0",
"better-sqlite3": "^12.10.0",
"cross-spawn": "^7.0.6",
Expand Down
108 changes: 108 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/review-checkpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function reviewRefs(
};
}

async function createWorkingTreeSnapshot(gitRoot: string, parent: string): Promise<string> {
export async function createWorkingTreeSnapshot(gitRoot: string, parent: string): Promise<string> {
const tempDir = await mkdtemp(join(tmpdir(), "devspace-review-index-"));
const indexPath = join(tempDir, "index");
const env = checkpointEnv(indexPath);
Expand All @@ -305,7 +305,7 @@ async function readReviewCommit(gitRoot: string, reviewRef: string): Promise<Rev
};
}

async function readReviewBetween(
export async function readReviewBetween(
gitRoot: string,
before: string,
after: string,
Expand Down
34 changes: 34 additions & 0 deletions src/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { WorkspaceRegistry } from "./workspaces.js";
import { writeTestDevspaceConfig } from "./test-support/config.test.js";
import { groupWorkspaceToolCalls } from "./workspace-activity.js";
import { WorkspaceActivityJournal } from "./workspace-activity-journal.js";
import { WorkspaceActivityService } from "./workspace-activity-service.js";
import { WorkspaceActivityStore } from "./workspace-activity-store.js";

const execFileAsync = promisify(execFile);
Expand Down Expand Up @@ -291,6 +292,34 @@ test("workspace activity groups a real tool sequence under its review ref", asyn
);
});

test("workspace inspector tools are app-only and do not journal their own reads", async (t) => {
const context = await fixture(t, { git: true, captureActivity: true, uiEnabled: true });
assert.ok(context.activity);
const workspaceId = structuredContent(
await callOpen(context.client, context.project, "inspector-tools"),
).workspace_id;
assert.ok(typeof workspaceId === "string");

await context.client.callTool({
name: "read",
arguments: { workspace_id: workspaceId, path: "README.md" },
});
const before = context.activity.listCalls({ workspaceId, limit: 20 }).length;
const activity = structuredContent(await context.client.callTool({
name: "get_workspace_activity",
arguments: { workspace_id: workspaceId },
}));
assert.ok(Array.isArray(activity.groups));
assert.equal(context.activity.listCalls({ workspaceId, limit: 20 }).length, before);

const tools = await context.client.listTools();
const inspectorTool = tools.tools.find((tool) => tool.name === "get_workspace_activity");
assert.deepEqual(
(inspectorTool?._meta as { ui?: { visibility?: string[] } } | undefined)?.ui?.visibility,
["app"],
);
});

test("open_workspace keeps lifecycle flags out of model output and preserves complete card metadata", async (t) => {
const providerNote = "available";
const context = await fixture(t, {
Expand Down Expand Up @@ -775,6 +804,9 @@ async function fixture(
const activityJournal = options.captureActivity
? new WorkspaceActivityJournal(stateDir)
: undefined;
const activityService = options.captureActivity
? new WorkspaceActivityService(stateDir)
: undefined;
const activity = options.captureActivity
? new WorkspaceActivityStore(stateDir)
: undefined;
Expand All @@ -788,6 +820,7 @@ async function fixture(
[],
undefined,
activityJournal,
activityService,
);
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
const client = new Client({ name: "devspace-test-client", version: "1.0.0" });
Expand All @@ -803,6 +836,7 @@ async function fixture(
await client.close();
await server.close();
activity?.close();
activityService?.close();
activityJournal?.close();
store.close();
};
Expand Down
Loading
Loading