Files
Jiawen Geng 64693f21cf fix(cursor): show plan usage in Cursor agents' context details (#6353)
Cursor agents never showed plan usage cards under their context details.
ACP sessions had no usageSession(), and the Cursor usage source only ran
global discovery, so per-agent discovery always came back empty.

Cursor ACP sessions now report a usage session (provider "cursor" plus
their launch env). The Cursor usage source resolves the cursor-agent
auth.json for that env. Sessions on CURSOR_API_KEY or CURSOR_AUTH_TOKEN,
the in-memory store, or the macOS Keychain (the default there) report
no login.
2026-10-16 16:56:39 +02:00

16 lines
515 B
TypeScript

import type { PluginServerContext } from "@getpaseo/plugin/server";
import { inputSchema } from "./shared/input.js";
import { fetchUsage, discover, discoverSession } from "./server/usage.js";
export default function contribute(server: PluginServerContext) {
server.registerUsageSource({
id: "cursor",
label: "Cursor",
icon: "icon.svg",
input: inputSchema,
discover: (scope) => (scope.kind === "global" ? discover() : discoverSession(scope)),
fetch: fetchUsage,
});
return () => {};
}