Repository navigation
feat: add connectors and local connection vault for providers and MCP - #188
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds v1 of Connectors & Connections across the schema, plugin contract, harness, host RPC server, CLI, and desktop app. Static Connector definitions from
https://catalog.codework.sh/v1/connectors.json(with a bundled offline fallback) are instantiated into workspace-scoped Connections whose credentials live only on the host in a dedicated0600SQLite vault (<home>/connections.db), never incodework.db, settings files, or Relay.Schemas & Plugin Contract (
packages/schema,packages/plugin)@codeworksh/schema/connectorwith bare UUIDv7ConnectionID,ConnectorSpec(kinds: ["provider" | "mcp" | "integration"]),ConnectionSummary,ConnectionConfig, OAuth/device-code wire types,hostMatches, tagged errors, and the bundled 6-entry v1 catalog (com.anthropic,com.openai,com.openai.codex,com.github.copilot,ai.openrouter,app.linear).@codeworksh/plugin/connector(Brokercontract) and extended HTTP MCP server auth in@codeworksh/pluginwith{ connection }.connectors.catalog,connections.*,connections.oauth.*) to@codeworksh/schema/host.Host Vault, Catalog Cache, OAuth & CLI (
packages/codework)<home>/connections.db(0600, WAL,connection/credential/metatables) with one-time non-destructive import of legacy<home>/aikit/auth.jsonlogins.If-None-MatchETag disk caching at<home>/cache/connectors.jsonwith offline fallback.openai-codexandgithub-copilothandlers (reusing@codeworksh/aikit/oauth/*without changingpackages/aikit), with single-flight refresh locking andallowedHostsvalidation.oauthdefaulting topersonal,apikeydefaulting toshared, and read-only machine-global hostenvprojection) with stored-over-env precedence (explicit -> default -> env -> single-match).codework connect discover|categories|create|login|list|status|disconnect|remove(both in-process and--server), preserving barecodework connectfor machine workspace linking and keeping legacycodework auth/codework mcp loginworking.Harness Wiring (
packages/harness)Connector.BrokerintoLLM.openWith,ModelCatalog.Credentials,Mcp.layer, andStateso providers resolve credentials through the broker and enabledmcpConnections auto-register into sessions (with explicitmcp.jsonentries taking precedence).Desktop App (
apps/contract,apps/server,apps/web)connectors.catalog,connections.*, streamingconnections.oauth.runwith client-side loopback callback listener,connections.oauth.finish,deviceStart,devicePoll), all supportingmachineIdrouting for local and paired hosts.<MachinePicker>).Docs (
docs/internals)00_glossary.md,03_models.md,08_plugins.md, and09_server.mdto document Connectors, Connections,connections.db, auto-registered MCP connections, and the client-loopback / host-exchange OAuth split.Testing
vp run verify(vp check, builds, package typechecks,knipfiles/deps/exports): passed (0 issues).@codeworksh/contract,@codeworksh/server,@codeworksh/web): passed.packages/codework/test/connector.test.ts(4/4 passed, with artifacts inpackages/codework/test/__artifacts__/connector.*.json).packages/codework/test/server.test.ts(42/42 passed).packages/harness/test/mcp.oauth.test.ts&packages/harness/test/model.catalog.test.ts(3/3 passed)..scratch/home), local Relay, dev RPC server, and Electron (CodeWork Local):https://catalog.codework.sh/v1/connectors.jsonfetch (200) and ETag cache creation.com.openai/defaultinconnections.dbwith noOPENAI_API_KEYin the server env) with a realopenai/gpt-4o-miniturn via--serverand live streaming into Electron.envprojection (com.openai/env) with a realopenai/gpt-4o-miniturn on an empty temp home.app.linear/default, personal) through the Electron UI and a real session querying the 5 latest Linear issues with zero manualmcp.jsonsetup.openai-codexandgithub-copilotaccounts (covered against local mock OAuth servers inconnector.test.ts).Built with Gemini (Antigravity).