mirror of
https://github.com/getpaseo/paseo.git
synced 2026-12-01 12:46:55 +00:00
* fix(usage): support OpenCode v2 usageSession, session scopes, and Codex opencode.db logins - Implement usageSession() on OpenCodeV2Session with provider "opencode", authoritative model tracking (info.model falling back to config.model), effective provider + launch harness environment, and a stable sessionKey. - Read active and migrated OpenAI OAuth logins from OpenCode v2's opencode.db in codex-usage-source (honoring absolute/relative OPENCODE_DB, active=1 or migrated active IS NULL, falling back to v1 auth.json, and normalizing provider to "opencode"). - Add OpenCode session-scope discovery to built-in usage sources OpenCode serves (opencode-go, minimax, zai, kimi, grok, copilot, openrouter-host). Co-authored-by: Jiayang Wu <651475459@qq.com> * fix(usage): keep Copilot/Kimi default visibility hints and deduplicate session discovery helpers --------- Co-authored-by: Jiayang Wu <651475459@qq.com>
17 lines
554 B
TypeScript
17 lines
554 B
TypeScript
import type { PluginServerContext } from "@getpaseo/plugin/server";
|
|
import { inputSchema } from "./shared/input.js";
|
|
import { discover, discoverSession, fetchUsage } from "./server/usage.js";
|
|
|
|
export default function contribute(server: PluginServerContext) {
|
|
server.registerUsageSource({
|
|
id: "opencode-go",
|
|
label: "OpenCode Go",
|
|
icon: "icon.svg",
|
|
providers: ["opencode"],
|
|
input: inputSchema,
|
|
discover: (scope) => (scope.kind === "global" ? discover() : discoverSession(scope)),
|
|
fetch: fetchUsage,
|
|
});
|
|
return () => {};
|
|
}
|