Skip to content

feat(integrations): add typed manifest-driven integrations system - #163

Closed
gabrielvfonseca wants to merge 1 commit into
mainfrom
feat/integrations-system
Closed

gabrielvfonseca wants to merge 1 commit into
mainfrom
feat/integrations-system

Conversation

@gabrielvfonseca

@gabrielvfonseca gabrielvfonseca commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Builds a pluggable, fully typed, config-driven integrations system for the Frontal Code Server (API, CLI, typed SDK clients), driven by IntegrationManifest files — no hardcoded provider code beyond the MCP transport layer.

Changes

  • crates/code-integrations/src/manifest.rs — IntegrationManifest types (the single source of truth, re-exported from crate root) + validation (id/version/display_name/transport/capabilities with JSON Schema input/output validation, events, context_fields, AuthSpec) + ManifestRegistry (BTreeMap-backed, deterministic order, remove() for override semantics). 15 tests.
  • crates/code-integrations/src/providers.rs — 4 built-in provider manifests:
    • github: create_pr, create_issue_comment, create_check_run
    • linear: create_issue_comment
    • posthog: capture_event, capture_events_batch (both idempotent)
    • sentry: create_issue, create_issue_comment
    • builtin_providers() + BUILTIN_PROVIDER_IDS re-exported from crate root. 7 tests.
  • crates/code-server/src/integrations.rs — /v1/integrations control-plane routes (list, get, capabilities, events + 501 invoke stub). IntegrationsState seeded with built-ins on startup; FRONTAL_CODE_INTEGRATIONS_CONFIG JSON array layered on top, with same-id manifests overriding built-ins.
  • cli/src/integrations.rs — integrations list|show|capabilities|validate (+ --json); seeds built-ins, then settings file (mcp.integrations), then env var; same-id overrides.
  • Rust SDK (sdks/rust/src/integrations.rs) + TypeScript SDK (sdks/typescript/src/integrations.ts) — IntegrationClient (list/get/capabilities/events/invoke).
  • Backward compat — deprecated call_* wrappers in mcp/integration.rs kept functional as an adapter layer for one release; tracker_reporting.rs unaffected.
  • Docs — new docs/INTEGRATIONS.md; updated docs/MCP.md and docs/API_REFERENCES.md with the new /v1/integrations* endpoints.

Tested

  • cargo test -p code-integrations --lib — 84 passed
  • cargo test -p code-server --lib — 142 passed
  • cargo test -p cli --bin code — 203 passed
  • cargo test -p frontal-code-sdk --lib — 11 passed
  • cargo clippy -p code-integrations -p code-server -p cli -p frontal-code-sdk --all-targets -- -D warnings — clean
  • npm run build && npm test in sdks/typescript — 43 passed

Summary by CodeRabbit

  • New Features
    • Added an integrations CLI for listing providers, viewing details and capabilities, and validating manifests in text or JSON.
    • Added built-in GitHub, Linear, PostHog, and Sentry integrations, with support for project configuration and provider overrides.
    • Added API endpoints to browse integrations, capabilities, and events. Capability invocation is not yet available.
    • Added Rust and TypeScript clients for the integrations API.
  • Documentation
    • Added integration setup and API reference documentation, including CLI usage and configuration options.

- Add IntegrationManifest types + validation in crates/code-integrations
  (manifest.rs): id/version/display_name/transport/capabilities with
  JSON Schema input/output validation, events, context_fields, AuthSpec
- Add 4 built-in provider manifests (github, linear, posthog, sentry) in
  providers.rs with BUILTIN_PROVIDER_IDS
- Add /v1/integrations routes in code-server (list/get/capabilities/events
  + 501 invoke stub); built-ins seeded on startup, config manifest with
  same id overrides a built-in (FRONTAL_CODE_INTEGRATIONS_CONFIG)
- Add CLI 'integrations list|show|capabilities|validate' commands with
  --json support
- Add IntegrationClient to Rust SDK and TypeScript SDK (list/get/
  capabilities/events/invoke)
- Keep deprecated call_* wrappers in mcp/integration.rs functional as
  adapter layer (tracker_reporting.rs unaffected)
- Docs: new docs/INTEGRATIONS.md; updated MCP.md and API_REFERENCES.md

Tested:
- cargo test -p code-integrations --lib (84 passed)
- cargo test -p code-server --lib (142 passed)
- cargo test -p cli --bin code (203 passed)
- cargo test -p frontal-code-sdk --lib (11 passed)
- cargo clippy --all-targets -- -D warnings (clean)
- npm run build && npm test in sdks/typescript (43 passed)
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

This PR adds a manifest-based integration system across the shared crate, server API, CLI, and Rust and TypeScript SDKs. It defines four built-in providers, supports configuration overrides, exposes integration metadata and capability routes, and documents that capability invocation currently returns HTTP 501.

Changes: Integration system

Layer / File(s) Summary
Manifest contracts and registry
crates/code-integrations/src/manifest.rs, crates/code-integrations/src/mcp/tools.rs, crates/code-integrations/src/lib.rs, docs/INTEGRATIONS.md, docs/MCP.md
Adds serializable manifest types, validation, registry operations, and public exports. The documentation describes the manifest schema and the retained MCP adapter.
Built-in provider manifests
crates/code-integrations/src/providers.rs, docs/INTEGRATIONS.md
Adds GitHub, Linear, PostHog, and Sentry manifests and documents their capabilities and legacy adapter details.
Server integration API
crates/code-server/src/integrations.rs, crates/code-server/src/lib.rs, docs/API_REFERENCES.md
Loads configured manifests over built-ins and adds protected routes for integration data. Known capability invocations return HTTP 501.
CLI configuration and commands
cli/src/integrations.rs, cli/src/main.rs, docs/INTEGRATIONS.md
Adds registry loading from built-ins, project settings, and environment configuration. Adds list, show, capabilities, and validate commands with text and JSON output.
Rust and TypeScript SDK clients
sdks/rust/Cargo.toml, sdks/rust/src/integrations.rs, sdks/rust/src/lib.rs, sdks/typescript/src/integrations.ts, sdks/typescript/src/index.ts, sdks/typescript/tests/integrations.test.ts, docs/INTEGRATIONS.md
Adds typed clients for integration lists, manifests, capabilities, events, and invocation. The clients normalize base URLs and report transport, server-response, and parse errors.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant IntegrationClient
  participant ControlPlaneAuth
  participant IntegrationsRouter
  participant ManifestRegistry
  IntegrationClient->>ControlPlaneAuth: GET /v1/integrations
  ControlPlaneAuth->>IntegrationsRouter: Forward authenticated request
  IntegrationsRouter->>ManifestRegistry: Read registered integrations
  ManifestRegistry-->>IntegrationsRouter: Return integration manifests
  IntegrationsRouter-->>IntegrationClient: Return integration summaries
Loading

Suggested reviewers: frontal-labs

Merge Risk: Moderate · up to 09b48

The new integrations feature has several wire-format and loader bugs. The Rust SDK cannot fetch built-in manifests, and both SDKs' invoke calls are wrong. An invalid override can silently remove a built-in integration. The CLI validate command reports success for invalid manifests. The Rust formatting CI check also fails. Fix these before merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

private readonly baseUrl: string;

constructor(baseUrl: string) {
this.baseUrl = baseUrl.replace(/\/+$/, "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants