mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 15:18:58 +00:00
refactor: trim pi helper exports
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user