refactor: trim pi helper exports · openclaw/openclaw@06fe78e
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,8 +2,8 @@ import { normalizeOptionalString } from "../shared/string-coerce.js";
|
2 | 2 | import type { AuthProfileCredential, AuthProfileStore } from "./auth-profiles.js"; |
3 | 3 | import { normalizeProviderId } from "./provider-id.js"; |
4 | 4 | |
5 | | -export type PiApiKeyCredential = { type: "api_key"; key: string }; |
6 | | -export type PiOAuthCredential = { |
| 5 | +type PiApiKeyCredential = { type: "api_key"; key: string }; |
| 6 | +type PiOAuthCredential = { |
7 | 7 | type: "oauth"; |
8 | 8 | access: string; |
9 | 9 | refresh: string; |
@@ -13,7 +13,7 @@ export type PiOAuthCredential = {
|
13 | 13 | export type PiCredential = PiApiKeyCredential | PiOAuthCredential; |
14 | 14 | export type PiCredentialMap = Record<string, PiCredential>; |
15 | 15 | |
16 | | -export function convertAuthProfileCredentialToPi(cred: AuthProfileCredential): PiCredential | null { |
| 16 | +function convertAuthProfileCredentialToPi(cred: AuthProfileCredential): PiCredential | null { |
17 | 17 | if (cred.type === "api_key") { |
18 | 18 | const key = normalizeOptionalString(cred.key) ?? ""; |
19 | 19 | if (!key) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,7 +30,7 @@ export function sanitizeServerName(raw: string, usedNames: Set<string>): string
|
30 | 30 | return candidate; |
31 | 31 | } |
32 | 32 | |
33 | | -export function sanitizeToolName(raw: string): string { |
| 33 | +function sanitizeToolName(raw: string): string { |
34 | 34 | return sanitizeToolFragment(raw, "tool"); |
35 | 35 | } |
36 | 36 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -325,7 +325,7 @@ export function filterToolResultMediaUrls(
|
325 | 325 | * returns base64 image data but no file path; those need a different delivery |
326 | 326 | * path like saving to a temp file). |
327 | 327 | */ |
328 | | -export type ToolResultMediaArtifact = { |
| 328 | +type ToolResultMediaArtifact = { |
329 | 329 | mediaUrls: string[]; |
330 | 330 | audioAsVoice?: boolean; |
331 | 331 | trustedLocalMedia?: boolean; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -123,9 +123,7 @@ export function applyPiCompactionSettingsFromConfig(params: {
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** Decide whether Pi's internal auto-compaction should be disabled for this run. */ |
126 | | -export function shouldDisablePiAutoCompaction(params: { |
127 | | -contextEngineInfo?: ContextEngineInfo; |
128 | | -}): boolean { |
| 126 | +function shouldDisablePiAutoCompaction(params: { contextEngineInfo?: ContextEngineInfo }): boolean { |
129 | 127 | return params.contextEngineInfo?.ownsCompaction === true; |
130 | 128 | } |
131 | 129 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。