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>
22 lines
612 B
TypeScript
22 lines
612 B
TypeScript
import { z } from "zod";
|
|
|
|
export const routeSchema = z.discriminatedUnion("store", [
|
|
z.object({ store: z.enum(["codex", "opencode", "pi"]), path: z.string().min(1) }).strict(),
|
|
z
|
|
.object({
|
|
store: z.literal("opencode-db"),
|
|
path: z.string().min(1),
|
|
credentialId: z.string().min(1),
|
|
})
|
|
.strict(),
|
|
z
|
|
.object({
|
|
store: z.literal("omp"),
|
|
path: z.string().min(1),
|
|
credentialId: z.number().int().positive(),
|
|
})
|
|
.strict(),
|
|
]);
|
|
export const inputSchema = z.object({ route: routeSchema }).strict();
|
|
export type CodexUsageInput = z.infer<typeof inputSchema>;
|