refactor: trim pi helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 21:39:43 +01:00
parent 1e4f511f0a
commit 06fe78e4c4
4 changed files with 6 additions and 8 deletions

View File

@@ -2,8 +2,8 @@ import { normalizeOptionalString } from "../shared/string-coerce.js";
import type { AuthProfileCredential, AuthProfileStore } from "./auth-profiles.js";
import { normalizeProviderId } from "./provider-id.js";
export type PiApiKeyCredential = { type: "api_key"; key: string };
export type PiOAuthCredential = {
type PiApiKeyCredential = { type: "api_key"; key: string };
type PiOAuthCredential = {
type: "oauth";
access: string;
refresh: string;
@@ -13,7 +13,7 @@ export type PiOAuthCredential = {
export type PiCredential = PiApiKeyCredential | PiOAuthCredential;
export type PiCredentialMap = Record<string, PiCredential>;
export function convertAuthProfileCredentialToPi(cred: AuthProfileCredential): PiCredential | null {
function convertAuthProfileCredentialToPi(cred: AuthProfileCredential): PiCredential | null {
if (cred.type === "api_key") {
const key = normalizeOptionalString(cred.key) ?? "";
if (!key) {

View File

@@ -30,7 +30,7 @@ export function sanitizeServerName(raw: string, usedNames: Set<string>): string
return candidate;
}
export function sanitizeToolName(raw: string): string {
function sanitizeToolName(raw: string): string {
return sanitizeToolFragment(raw, "tool");
}

View File

@@ -325,7 +325,7 @@ export function filterToolResultMediaUrls(
* returns base64 image data but no file path; those need a different delivery
* path like saving to a temp file).
*/
export type ToolResultMediaArtifact = {
type ToolResultMediaArtifact = {
mediaUrls: string[];
audioAsVoice?: boolean;
trustedLocalMedia?: boolean;

View File

@@ -123,9 +123,7 @@ export function applyPiCompactionSettingsFromConfig(params: {
}
/** Decide whether Pi's internal auto-compaction should be disabled for this run. */
export function shouldDisablePiAutoCompaction(params: {
contextEngineInfo?: ContextEngineInfo;
}): boolean {
function shouldDisablePiAutoCompaction(params: { contextEngineInfo?: ContextEngineInfo }): boolean {
return params.contextEngineInfo?.ownsCompaction === true;
}