(connectors: SerializableConnectorConfig[])
| 258 | * per-connector schema file for full config details. |
| 259 | */ |
| 260 | export function serializeConnectorOverview(connectors: SerializableConnectorConfig[]): string { |
| 261 | const rows = connectors.map((c) => { |
| 262 | const provider = c.auth.provider ?? c.auth.mode |
| 263 | const scopes = c.auth.requiredScopes?.length ? c.auth.requiredScopes.join(', ') : '(none)' |
| 264 | return `| ${c.id} | ${c.name} | ${provider} | ${scopes} |` |
| 265 | }) |
| 266 | |
| 267 | return [ |
| 268 | '# Available KB Connectors', |
| 269 | '', |
| 270 | 'Use `read("knowledgebases/connectors/{type}.json")` to get the full config schema before calling `add_connector`.', |
| 271 | '', |
| 272 | '| Type | Name | OAuth Provider | Required Scopes |', |
| 273 | '|------|------|---------------|-----------------|', |
| 274 | ...rows, |
| 275 | '', |
| 276 | 'To add a connector, the user must have an OAuth credential for that provider.', |
| 277 | 'Check `environment/credentials.json` for available credential IDs.', |
| 278 | ].join('\n') |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * Serialize workspace file metadata for VFS files/{path}/{name}/meta.json. |
no test coverage detected