refactor(connector): rewrite catalog registry as pure pi-mono shape
Strips adapter module, defaultCommand, listModels, configurationDoc, capabilityMatrix, and notes fields from the ConnectorDefinition type. What remains is the declarative pi-mono shape: id, provider, label, description, defaultModel, auth descriptor, onboardingFeatured, notes. The three data files are imported and spread into the CONNECTORS array. findConnectorDefinition + listFeaturedOnboardingConnectors stay in the lookup module unchanged. Docs builders still provide buildOAuthDoc / buildApiKeyDoc / buildCloudDoc for the Settings panel and are consumed by connectors.ts when synthesising per-row configuration docs. ConnectorAuth now uses `type` as the discriminator (legacy `kind` alias removed — credential-resolver and ipc-credentials-handlers already keyed off `type`).
This commit is contained in:
1 parent
77c92d0681
commit
c2c54734a0
3 files changed
+124
-194
No files matched your search
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Per-auth-kind configuration documentation builders for the Settings →
|
||||
* Providers panel. Extracted from `connector-definitions.ts` to keep that
|
||||
* file under the 400-line cap.
|
||||
*/
|
||||
|
||||
import type { PiOAuthProviderId } from "./connector-definitions";
|
||||
|
||||
export function buildOAuthDoc(label: string, oauthId: PiOAuthProviderId): string {
|
||||
return [
|
||||
`# ${label}`,
|
||||
"",
|
||||
"Authenticate via OAuth in your system browser. AgentCompany opens",
|
||||
"the provider's authorization page; the redirect handler runs locally on",
|
||||
"`http://localhost:53692/callback`.",
|
||||
"",
|
||||
`OAuth provider id: \`${oauthId}\`.`,
|
||||
"",
|
||||
"Tokens are encrypted by the OS keychain (or per-profile vault) and",
|
||||
"stored in the `credentials` table. Tokens are refreshed automatically",
|
||||
"before each run (60 second window).",
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
export function buildApiKeyDoc(label: string, envVar: string): string {
|
||||
return [
|
||||
`# ${label}`,
|
||||
"",
|
||||
`API key authentication. Either paste the literal key or use a system`,
|
||||
`environment variable name (default: \`${envVar}\`).`,
|
||||
"",
|
||||
"Keys are encrypted at rest via OS keychain (or per-profile vault).",
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
export function buildCloudDoc(label: string, body: string): string {
|
||||
return [`# ${label}`, "", body].join("\n");
|
||||
}
|
||||
Reference in new issue
Block a user