mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
refactor: trim diagnostic oauth exports
This commit is contained in:
@@ -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<CacheTraceEvent>) => void;
|
||||
|
||||
@@ -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<ChutesUserInfo | null> {
|
||||
|
||||
Reference in New Issue
Block a user