Skip to content

[connectors] Connector framework — registry, auth, grants, scopes, tool bridge #86

Description

@serge-ivo

[connectors] Connector framework — registry, auth, grants, scopes, tool bridge

A typed connector abstraction so a new integration is declared once, not built as bespoke routes.

Do

  • Connector { id, label, auth: 'oauth'|'token'|'app', scopes: {read, write}, grantModel: 'user'|'instance-resource', tools: ToolDef[] } in a registry.
  • Auth adapter reuses lib/connector-oauth.ts + user_api_keys (refresh tokens, envelope-encrypted) + github-app.ts for the App model. A connectorClient(env, provider, {userId, instanceId}) mints the access token and enforces scope.
  • Grants reuse instance_connector_grants (0044) generalized beyond folders (resource_type: folder|repo|spreadsheet|…). requireConnectorGrant gates every tool call to granted resources.
  • Connector → tools bridge: a connector's tools auto-register in the tool registry; they're offered to an agent only when (a) declared in capabilities.tools, (b) the subscriber has connected the provider, and (c) a grant exists (for instance-resource connectors).
  • Per-instance enablement UI (console): connect provider → grant resource(s) → the connector's tools light up for that instance.

Acceptance

  • A new connector added by declaring {auth, scopes, grantModel, tools} — no bespoke routes.
  • Tool handlers obtain auth via connectorClient; scope + grant enforced centrally; parameterized + audited.
  • Read-only connectors can't perform writes; ungranted resources rejected (403).

Depends on the tool-registry issue. Part of the connector/tool framework epic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    connectorsConnector + tool framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions