Full-codebase ts-prune + manual audit sweep. Every change below is a pure
deletion (or a 2-line re-wire where a dead function was supposed to be
alive). No scope additions.
Dead wrappers / phantom features
- shouldAutoApproveApproval: zero-value wrapper over shouldAutoApprove.
Four call sites now import shouldAutoApprove from execution-policy
directly.
- evaluateRotation(session, connectorId, thresholdsOverride): the
connectorId arg was never read (underscored), and thresholdsOverride
was only exercised by the test suite — no production caller. Signature
collapses to evaluateRotation(session). DEFAULT_THRESHOLDS /
RotationThresholds exports and their tests go with it.
- installLogRedactor: defensive console wrapper that was never wired
from worker-entry. buildRedactor handles the known threat (env-value
leaks); the pattern-based redactTokens stays for tests and future
composition.
Dead files
- resume-interrupted-tasks.ts: helper function never imported.
- service-graph-orchestration-deps.ts: three factory closures
superseded by the inline closures in create-orchestration-service.
Dead exports
- listConnectorsByAuthKind (shared/connector-catalog)
- getLocalePromptInstruction + whole localization.ts file
- ImportantDocType
- main-side ConnectorAuthKind (duplicated the shared one; not referenced)
- CheckpointEngineService, RunHousekeepingService types
- WorkspaceResolution type
- cmdOrCtrlSymbol
- AgentEventPush, CredentialPayload type aliases
- parseApprovalPayloadJson, parseEnvValue, ProviderCard
- getSOP — buildSOPSection reads the SOPS map directly; the individual
getter had no callers. Deduped to a flat array.
- renderWakeReason in wake-reasons/en.ts: byte-for-byte duplicate of the
one in wake-reasons/index.ts.
Forgotten wiring (not cleanup, but adjacent)
- registerAgentStandupRoute: the GET /api/agents/me/standup endpoint is
advertised in every system prompt and wake-reason doc, but the route
handler was never registered in api-server/index.ts. Agents have been
hitting 404 since Pi Mono. Registered.
Dead DB column
- v44 migration drops runs.context_snapshot_json. Column was added by
v16-v25, never written or read, and v43's deliberate preservation
was an interim measure. Same idempotent table-rebuild pattern as
v41/v43.
Test tree
- Phantom-feature threshold override tests removed (3). The rest of
the rotation suite re-expressed against the real maxRuns=20 floor.
495/495 unit tests pass. typecheck + build clean.
289 lines
9.6 KiB
TypeScript
289 lines
9.6 KiB
TypeScript
/**
|
|
* Renderer-visible pi-mono connector catalog.
|
|
*
|
|
* Mirrors the authoritative definitions in `src/main/connector-definitions*.ts`
|
|
* so the renderer can drive UI from the same 26-entry list without importing
|
|
* Node/main-process modules. Keep this file in strict lockstep with the main
|
|
* catalog when new connectors are added.
|
|
*/
|
|
|
|
import type { ConnectorId } from "./types/enums";
|
|
|
|
export type PiOAuthProviderId =
|
|
| "anthropic"
|
|
| "openai-codex"
|
|
| "github-copilot"
|
|
| "google-gemini-cli"
|
|
| "google-antigravity";
|
|
|
|
export type ConnectorAuthKind = "oauth" | "api_key" | "aws" | "azure" | "gcp_adc";
|
|
|
|
export interface ConnectorAuthOAuth { type: "oauth"; oauthId: PiOAuthProviderId }
|
|
export interface ConnectorAuthApiKey { type: "api_key"; envKey: string }
|
|
export interface ConnectorAuthAws { type: "aws" }
|
|
export interface ConnectorAuthAzure { type: "azure" }
|
|
export interface ConnectorAuthGcpAdc { type: "gcp_adc" }
|
|
|
|
export type ConnectorAuth =
|
|
| ConnectorAuthOAuth
|
|
| ConnectorAuthApiKey
|
|
| ConnectorAuthAws
|
|
| ConnectorAuthAzure
|
|
| ConnectorAuthGcpAdc;
|
|
|
|
export interface ConnectorCatalogEntry {
|
|
id: ConnectorId;
|
|
provider: string;
|
|
label: string;
|
|
description: string;
|
|
defaultModel: string;
|
|
auth: ConnectorAuth;
|
|
onboardingFeatured?: boolean;
|
|
notes?: string;
|
|
}
|
|
|
|
const OAUTH_ENTRIES: ConnectorCatalogEntry[] = [
|
|
{
|
|
id: "claude-pro",
|
|
provider: "anthropic",
|
|
label: "Claude Pro/Max",
|
|
description: "Anthropic Claude via Claude Pro / Max subscription OAuth.",
|
|
defaultModel: "claude-sonnet-4-5",
|
|
auth: { type: "oauth", oauthId: "anthropic" },
|
|
onboardingFeatured: true,
|
|
notes: "Requires an active Claude Pro or Max subscription. Tokens refresh automatically.",
|
|
},
|
|
{
|
|
id: "openai-codex",
|
|
provider: "openai-codex",
|
|
label: "ChatGPT Plus/Pro (Codex)",
|
|
description: "OpenAI Codex via a ChatGPT Plus or Pro subscription.",
|
|
defaultModel: "gpt-5.3-codex",
|
|
auth: { type: "oauth", oauthId: "openai-codex" },
|
|
onboardingFeatured: true,
|
|
notes: "Personal use only; requires ChatGPT Plus or Pro.",
|
|
},
|
|
{
|
|
id: "github-copilot",
|
|
provider: "github-copilot",
|
|
label: "GitHub Copilot",
|
|
description: "Models exposed through a GitHub Copilot subscription.",
|
|
defaultModel: "claude-opus-4.5",
|
|
auth: { type: "oauth", oauthId: "github-copilot" },
|
|
notes: "Supports github.com and GitHub Enterprise Server.",
|
|
},
|
|
{
|
|
id: "gemini-cli",
|
|
provider: "google-gemini-cli",
|
|
label: "Google Gemini CLI",
|
|
description: "Google Gemini models via Cloud Code Assist OAuth. Free tier works with any Google account.",
|
|
defaultModel: "gemini-2.5-pro",
|
|
auth: { type: "oauth", oauthId: "google-gemini-cli" },
|
|
notes: "For paid Cloud Code Assist, set GOOGLE_CLOUD_PROJECT.",
|
|
},
|
|
{
|
|
id: "antigravity",
|
|
provider: "google-antigravity",
|
|
label: "Google Antigravity",
|
|
description: "Google Antigravity sandbox with Gemini 3, Claude, and GPT-OSS models.",
|
|
defaultModel: "claude-sonnet-4-5",
|
|
auth: { type: "oauth", oauthId: "google-antigravity" },
|
|
notes: "Free with any Google account.",
|
|
},
|
|
];
|
|
|
|
const API_KEY_ENTRIES: ConnectorCatalogEntry[] = [
|
|
{
|
|
id: "anthropic",
|
|
provider: "anthropic",
|
|
label: "Anthropic API",
|
|
description: "Direct Anthropic Messages API for production workloads.",
|
|
defaultModel: "claude-sonnet-4-5",
|
|
auth: { type: "api_key", envKey: "ANTHROPIC_API_KEY" },
|
|
onboardingFeatured: true,
|
|
},
|
|
{
|
|
id: "openai",
|
|
provider: "openai",
|
|
label: "OpenAI API",
|
|
description: "OpenAI Responses + Chat Completions endpoints. GPT-5 family and Codex deployments.",
|
|
defaultModel: "gpt-5.4",
|
|
auth: { type: "api_key", envKey: "OPENAI_API_KEY" },
|
|
onboardingFeatured: true,
|
|
},
|
|
{
|
|
id: "google",
|
|
provider: "google",
|
|
label: "Google Gemini API",
|
|
description: "Google Gemini Generative Language API using the standard GEMINI_API_KEY variable.",
|
|
defaultModel: "gemini-2.5-pro",
|
|
auth: { type: "api_key", envKey: "GEMINI_API_KEY" },
|
|
},
|
|
{
|
|
id: "mistral",
|
|
provider: "mistral",
|
|
label: "Mistral",
|
|
description: "Mistral La Plateforme — Codestral, Devstral, Mistral Medium/Large families.",
|
|
defaultModel: "mistral-medium-latest",
|
|
auth: { type: "api_key", envKey: "MISTRAL_API_KEY" },
|
|
},
|
|
{
|
|
id: "groq",
|
|
provider: "groq",
|
|
label: "Groq",
|
|
description: "Groq LPU cloud. High-throughput inference for Llama 3, Qwen, DeepSeek, Groq Compound.",
|
|
defaultModel: "groq/compound",
|
|
auth: { type: "api_key", envKey: "GROQ_API_KEY" },
|
|
},
|
|
{
|
|
id: "cerebras",
|
|
provider: "cerebras",
|
|
label: "Cerebras",
|
|
description: "Cerebras Inference cloud — wafer-scale hardware for Qwen, Llama, GPT-OSS.",
|
|
defaultModel: "qwen-3-235b-a22b-instruct-2507",
|
|
auth: { type: "api_key", envKey: "CEREBRAS_API_KEY" },
|
|
},
|
|
{
|
|
id: "xai",
|
|
provider: "xai",
|
|
label: "xAI",
|
|
description: "xAI Grok API including Grok 4 Fast and Grok Code Fast.",
|
|
defaultModel: "grok-4-fast",
|
|
auth: { type: "api_key", envKey: "XAI_API_KEY" },
|
|
},
|
|
{
|
|
id: "openrouter",
|
|
provider: "openrouter",
|
|
label: "OpenRouter",
|
|
description: "OpenRouter aggregator — Anthropic, OpenAI, Google, open-weights through one key.",
|
|
defaultModel: "anthropic/claude-sonnet-4.5",
|
|
auth: { type: "api_key", envKey: "OPENROUTER_API_KEY" },
|
|
},
|
|
{
|
|
id: "vercel-ai-gateway",
|
|
provider: "vercel-ai-gateway",
|
|
label: "Vercel AI Gateway",
|
|
description: "Vercel multi-provider proxy using provider/model slugs on one billing profile.",
|
|
defaultModel: "anthropic/claude-sonnet-4.5",
|
|
auth: { type: "api_key", envKey: "AI_GATEWAY_API_KEY" },
|
|
},
|
|
{
|
|
id: "zai",
|
|
provider: "zai",
|
|
label: "Z.AI",
|
|
description: "Z.AI GLM-4.5/4.6 family — coding-tuned Chinese models with tool use.",
|
|
defaultModel: "glm-4.6",
|
|
auth: { type: "api_key", envKey: "ZAI_API_KEY" },
|
|
},
|
|
{
|
|
id: "opencode",
|
|
provider: "opencode",
|
|
label: "OpenCode Zen",
|
|
description: "OpenCode Zen managed endpoint. Shares OPENCODE_API_KEY with OpenCode Go.",
|
|
defaultModel: "claude-sonnet-4.5",
|
|
auth: { type: "api_key", envKey: "OPENCODE_API_KEY" },
|
|
},
|
|
{
|
|
id: "opencode-go",
|
|
provider: "opencode-go",
|
|
label: "OpenCode Go",
|
|
description: "OpenCode Go managed endpoint. Shares OPENCODE_API_KEY with OpenCode Zen.",
|
|
defaultModel: "kimi-k2.5",
|
|
auth: { type: "api_key", envKey: "OPENCODE_API_KEY" },
|
|
},
|
|
{
|
|
id: "huggingface",
|
|
provider: "huggingface",
|
|
label: "Hugging Face",
|
|
description: "Hugging Face Inference Endpoints — Kimi K2, GLM, DeepSeek, MiniMax, open-weights.",
|
|
defaultModel: "moonshotai/Kimi-K2.5",
|
|
auth: { type: "api_key", envKey: "HF_TOKEN" },
|
|
},
|
|
{
|
|
id: "kimi-coding",
|
|
provider: "kimi-coding",
|
|
label: "Kimi For Coding",
|
|
description: "Moonshot AI Kimi For Coding endpoint — tuned for agentic coding workloads.",
|
|
defaultModel: "kimi-for-coding",
|
|
auth: { type: "api_key", envKey: "KIMI_API_KEY" },
|
|
},
|
|
{
|
|
id: "minimax",
|
|
provider: "minimax",
|
|
label: "MiniMax",
|
|
description: "MiniMax international endpoint for M2 coding models.",
|
|
defaultModel: "MiniMax-M2.7",
|
|
auth: { type: "api_key", envKey: "MINIMAX_API_KEY" },
|
|
},
|
|
{
|
|
id: "minimax-cn",
|
|
provider: "minimax-cn",
|
|
label: "MiniMax (China)",
|
|
description: "MiniMax mainland China endpoint. Separate key from the international tier.",
|
|
defaultModel: "MiniMax-M2.7",
|
|
auth: { type: "api_key", envKey: "MINIMAX_CN_API_KEY" },
|
|
},
|
|
{
|
|
id: "fireworks",
|
|
provider: "fireworks",
|
|
label: "Fireworks AI",
|
|
description: "Fireworks inference cloud — Kimi K2.5 Turbo and more.",
|
|
defaultModel: "accounts/fireworks/models/kimi-k2.5-turbo",
|
|
auth: { type: "api_key", envKey: "FIREWORKS_API_KEY" },
|
|
},
|
|
{
|
|
id: "fireworks-firepass",
|
|
provider: "fireworks-firepass",
|
|
label: "Fireworks Fire Pass",
|
|
description: "Fireworks Fire Pass — subscription bundle. Same FIREWORKS_API_KEY.",
|
|
defaultModel: "accounts/fireworks/models/kimi-k2.5-turbo",
|
|
auth: { type: "api_key", envKey: "FIREWORKS_API_KEY" },
|
|
notes: "Covers Kimi K2.5 Turbo only; other Fireworks models still bill per-token.",
|
|
},
|
|
];
|
|
|
|
const CLOUD_ENTRIES: ConnectorCatalogEntry[] = [
|
|
{
|
|
id: "amazon-bedrock",
|
|
provider: "amazon-bedrock",
|
|
label: "AWS Bedrock",
|
|
description: "Anthropic, Amazon Nova, and Llama models served through AWS Bedrock.",
|
|
defaultModel: "us.anthropic.claude-sonnet-4-20250514-v1:0",
|
|
auth: { type: "aws" },
|
|
onboardingFeatured: true,
|
|
notes: "Honours standard AWS credential discovery. Region defaults to us-east-1.",
|
|
},
|
|
{
|
|
id: "azure-openai",
|
|
provider: "azure-openai-responses",
|
|
label: "Azure OpenAI",
|
|
description: "Azure-hosted OpenAI deployments via the Responses API.",
|
|
defaultModel: "gpt-5.4",
|
|
auth: { type: "azure" },
|
|
notes: "Provide AZURE_OPENAI_API_KEY plus AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME.",
|
|
},
|
|
{
|
|
id: "google-vertex",
|
|
provider: "google-vertex",
|
|
label: "Google Vertex AI",
|
|
description: "Gemini, Claude, and third-party models on Google Vertex AI using ADC.",
|
|
defaultModel: "gemini-2.5-pro",
|
|
auth: { type: "gcp_adc" },
|
|
notes: "Set GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION.",
|
|
},
|
|
];
|
|
|
|
export const CONNECTOR_CATALOG: ConnectorCatalogEntry[] = [
|
|
...OAUTH_ENTRIES,
|
|
...API_KEY_ENTRIES,
|
|
...CLOUD_ENTRIES,
|
|
];
|
|
|
|
export function findConnectorCatalogEntry(id: string): ConnectorCatalogEntry | undefined {
|
|
return CONNECTOR_CATALOG.find((entry) => entry.id === id);
|
|
}
|
|
|
|
export function listFeaturedOnboardingConnectors(): ConnectorCatalogEntry[] {
|
|
return CONNECTOR_CATALOG.filter((entry) => entry.onboardingFeatured === true);
|
|
}
|