From 5f3a17e2fd8ec6e3538545c2a78a2d7907d2e484 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 21:00:47 +0100 Subject: [PATCH] refactor: trim diagnostic oauth exports --- src/agents/cache-trace.ts | 6 +++--- src/agents/chutes-oauth.ts | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/agents/cache-trace.ts b/src/agents/cache-trace.ts index e0ea2f2233c..43f7bd4a177 100644 --- a/src/agents/cache-trace.ts +++ b/src/agents/cache-trace.ts @@ -10,7 +10,7 @@ import { sanitizeDiagnosticPayload } from "./payload-redaction.js"; import { getQueuedFileWriter, type QueuedFileWriter } from "./queued-file-writer.js"; import { buildAgentTraceBase } from "./trace-base.js"; -export type CacheTraceStage = +type CacheTraceStage = | "cache:result" | "cache:state" | "session:loaded" @@ -22,7 +22,7 @@ export type CacheTraceStage = | "stream:context" | "session:after"; -export type CacheTraceEvent = { +type CacheTraceEvent = { ts: string; seq: number; stage: CacheTraceStage; @@ -47,7 +47,7 @@ export type CacheTraceEvent = { error?: string; }; -export type CacheTrace = { +type CacheTrace = { enabled: true; filePath: string; recordStage: (stage: CacheTraceStage, payload?: Partial) => void; diff --git a/src/agents/chutes-oauth.ts b/src/agents/chutes-oauth.ts index 74dd5bdf17e..5c3d6f8ef77 100644 --- a/src/agents/chutes-oauth.ts +++ b/src/agents/chutes-oauth.ts @@ -2,16 +2,16 @@ import { createHash, randomBytes } from "node:crypto"; import type { OAuthCredentials } from "@mariozechner/pi-ai"; import { normalizeOptionalString } from "../shared/string-coerce.js"; -export const CHUTES_OAUTH_ISSUER = "https://api.chutes.ai"; +const CHUTES_OAUTH_ISSUER = "https://api.chutes.ai"; export const CHUTES_AUTHORIZE_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/authorize`; export const CHUTES_TOKEN_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/token`; export const CHUTES_USERINFO_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/userinfo`; const DEFAULT_EXPIRES_BUFFER_MS = 5 * 60 * 1000; -export type ChutesPkce = { verifier: string; challenge: string }; +type ChutesPkce = { verifier: string; challenge: string }; -export type ChutesUserInfo = { +type ChutesUserInfo = { sub?: string; username?: string; created_at?: string; @@ -24,7 +24,7 @@ export type ChutesOAuthAppConfig = { scopes: string[]; }; -export type ChutesStoredOAuth = OAuthCredentials & { +type ChutesStoredOAuth = OAuthCredentials & { clientId?: string; }; @@ -86,7 +86,7 @@ function coerceExpiresAt(expiresInSeconds: number, now: number): number { return Math.max(value, now + 30_000); } -export async function fetchChutesUserInfo(params: { +async function fetchChutesUserInfo(params: { accessToken: string; fetchFn?: typeof fetch; }): Promise {