refactor: trim diagnostic oauth exports · openclaw/openclaw@5f3a17e
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ import { sanitizeDiagnosticPayload } from "./payload-redaction.js";
|
10 | 10 | import { getQueuedFileWriter, type QueuedFileWriter } from "./queued-file-writer.js"; |
11 | 11 | import { buildAgentTraceBase } from "./trace-base.js"; |
12 | 12 | |
13 | | -export type CacheTraceStage = |
| 13 | +type CacheTraceStage = |
14 | 14 | | "cache:result" |
15 | 15 | | "cache:state" |
16 | 16 | | "session:loaded" |
@@ -22,7 +22,7 @@ export type CacheTraceStage =
|
22 | 22 | | "stream:context" |
23 | 23 | | "session:after"; |
24 | 24 | |
25 | | -export type CacheTraceEvent = { |
| 25 | +type CacheTraceEvent = { |
26 | 26 | ts: string; |
27 | 27 | seq: number; |
28 | 28 | stage: CacheTraceStage; |
@@ -47,7 +47,7 @@ export type CacheTraceEvent = {
|
47 | 47 | error?: string; |
48 | 48 | }; |
49 | 49 | |
50 | | -export type CacheTrace = { |
| 50 | +type CacheTrace = { |
51 | 51 | enabled: true; |
52 | 52 | filePath: string; |
53 | 53 | recordStage: (stage: CacheTraceStage, payload?: Partial<CacheTraceEvent>) => void; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,16 +2,16 @@ import { createHash, randomBytes } from "node:crypto";
|
2 | 2 | import type { OAuthCredentials } from "@mariozechner/pi-ai"; |
3 | 3 | import { normalizeOptionalString } from "../shared/string-coerce.js"; |
4 | 4 | |
5 | | -export const CHUTES_OAUTH_ISSUER = "https://api.chutes.ai"; |
| 5 | +const CHUTES_OAUTH_ISSUER = "https://api.chutes.ai"; |
6 | 6 | export const CHUTES_AUTHORIZE_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/authorize`; |
7 | 7 | export const CHUTES_TOKEN_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/token`; |
8 | 8 | export const CHUTES_USERINFO_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/userinfo`; |
9 | 9 | |
10 | 10 | const DEFAULT_EXPIRES_BUFFER_MS = 5 * 60 * 1000; |
11 | 11 | |
12 | | -export type ChutesPkce = { verifier: string; challenge: string }; |
| 12 | +type ChutesPkce = { verifier: string; challenge: string }; |
13 | 13 | |
14 | | -export type ChutesUserInfo = { |
| 14 | +type ChutesUserInfo = { |
15 | 15 | sub?: string; |
16 | 16 | username?: string; |
17 | 17 | created_at?: string; |
@@ -24,7 +24,7 @@ export type ChutesOAuthAppConfig = {
|
24 | 24 | scopes: string[]; |
25 | 25 | }; |
26 | 26 | |
27 | | -export type ChutesStoredOAuth = OAuthCredentials & { |
| 27 | +type ChutesStoredOAuth = OAuthCredentials & { |
28 | 28 | clientId?: string; |
29 | 29 | }; |
30 | 30 | |
@@ -86,7 +86,7 @@ function coerceExpiresAt(expiresInSeconds: number, now: number): number {
|
86 | 86 | return Math.max(value, now + 30_000); |
87 | 87 | } |
88 | 88 | |
89 | | -export async function fetchChutesUserInfo(params: { |
| 89 | +async function fetchChutesUserInfo(params: { |
90 | 90 | accessToken: string; |
91 | 91 | fetchFn?: typeof fetch; |
92 | 92 | }): Promise<ChutesUserInfo | null> { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。