refactor(connectors): remove adapter module references from services

Drops every `definition.module.*` call and legacy id hardcode (claude_local,
codex_local, gemini_local, claude_compat_*) from the connector services.
Health checks now evaluate stored credentials against the declarative auth
descriptor, model policy reads provider models via pi-ai, matching keys off
provider ids, and hire-hook logs activity without invoking an adapter hook.
Introduces a local normalizeCommandValue helper to replace the deleted
@agentcompany/adapter-utils/server-utils import.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-17 02:20:56 -04:00
1 parent 60178ceafa
commit 06a3ba603e
14 files changed
+267 -377

No files matched your search

+17 -12
View File
@@ -51,23 +51,28 @@ export interface SkillAssignment {
}
/**
* Per-adapter token budgets for skill content injection.
* Default token budget used when a connector does not declare an override.
*/
const DEFAULT_TOKEN_BUDGET = 30000;
/**
* Per-connector token budgets for skill content injection.
* Values represent the maximum token count of skill content that can be
* included in a single prompt for each adapter type.
* included in a single prompt for a given connector.
*/
export const TOKEN_BUDGETS: Readonly<Record<string, number>> = {
claude_local: 50000,
codex_local: 30000,
gemini_local: 50000,
claude_compatible: 50000,
// High-context Anthropic-style connectors run with a larger injection budget.
"claude-pro": 50000,
"anthropic": 50000,
"amazon-bedrock": 50000,
"gemini-cli": 50000,
"google": 50000,
"google-vertex": 50000,
};
/**
* Resolves the token budget for a given adapter type.
* Handles claude_compat_2..10 variants by mapping them to claude_compatible.
* Resolves the token budget for a given connector id.
*/
export function resolveTokenBudget(adapterType: string): number {
if (TOKEN_BUDGETS[adapterType] !== undefined) return TOKEN_BUDGETS[adapterType];
if (adapterType.startsWith("claude_compat")) return TOKEN_BUDGETS.claude_compatible;
return 30000;
export function resolveTokenBudget(connectorId: string): number {
return TOKEN_BUDGETS[connectorId] ?? DEFAULT_TOKEN_BUDGET;
}