Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-docs-integrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@agentskit/integrations": patch
---

Document the public API.
103 changes: 0 additions & 103 deletions docs/stability/jsdoc-coverage-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,95 +547,10 @@
".::ToolCallStatus",
".::ToolDefinition",
".::ToolExecutionContext",
".::useChat",
".::UseStreamOptions",
".::UseStreamReturn"
],
"@agentskit/integrations": [
".::acuityIntegration",
".::airtableIntegration",
".::ApiKeyAuthSpec",
".::apolloIntegration",
".::asanaIntegration",
".::assemblyaiIntegration",
".::attioIntegration",
".::AuthSpec",
".::azureOpenaiIntegration",
".::baserowIntegration",
".::bigcommerceIntegration",
".::boxIntegration",
".::calComIntegration",
".::calendlyIntegration",
".::coingeckoIntegration",
".::confluenceIntegration",
".::createRegistry",
".::deepgramIntegration",
".::discordIntegration",
".::dropboxIntegration",
".::elevenlabsIntegration",
".::EmailAttachment",
".::EmailConfig",
".::emailIntegration",
".::EmailMessage",
".::EmailSendMessage",
".::EmailSendResult",
".::EmailTransport",
".::figmaIntegration",
".::firecrawlIntegration",
".::getIntegration",
".::githubActionsIntegration",
".::githubIntegration",
".::gmailIntegration",
".::googleCalendarIntegration",
".::googleDriveIntegration",
".::HttpJsonRequest",
".::HttpToolOptions",
".::hubspotIntegration",
".::ImapClient",
".::ImapFetchOptions",
".::Integration",
".::IntegrationAction",
".::integrationsByCategory",
".::IntegrationTrigger",
".::intercomIntegration",
".::jiraIntegration",
".::linearIntegration",
".::linearTriageIntegration",
".::listIntegrations",
".::mailchimpIntegration",
".::mapsIntegration",
".::NoAuthSpec",
".::notionIntegration",
".::OAuth2AuthSpec",
".::openaiImagesIntegration",
".::pagerdutyIntegration",
".::pipedriveIntegration",
".::readerIntegration",
".::registerIntegration",
".::RetryableHttpMethod",
".::RetryPolicy",
".::salesforceIntegration",
".::sendgridIntegration",
".::sentryIntegration",
".::shopifyIntegration",
".::SideEffect",
".::slackIntegration",
".::stripeIntegration",
".::TeamsAdaptiveCard",
".::TeamsAdaptiveCardAction",
".::TeamsBotClient",
".::TeamsBotMessage",
".::TeamsBotSendResult",
".::teamsIntegration",
".::TeamsMessageCard",
".::telegramIntegration",
".::twilioIntegration",
".::VerifyResult",
".::weatherIntegration",
".::WebhookInput",
".::WebhookSecretAuthSpec",
".::whatsappIntegration",
".::whisperIntegration",
"./testing::validateAction",
"./testing::validateTrigger"
],
Expand Down Expand Up @@ -1098,7 +1013,6 @@
"@agentskit/svelte": [
".::ChatContainer",
".::CodeBlock",
".::createChatStore",
".::InputBar",
".::Markdown",
".::Message",
Expand Down Expand Up @@ -1156,16 +1070,6 @@
"./integrations::cloudflareR2SignedUrl",
"./integrations::documentParsers",
"./integrations::DocumentParsersConfig",
"./integrations::EmailAttachment",
"./integrations::EmailConfig",
"./integrations::EmailMessage",
"./integrations::EmailSendMessage",
"./integrations::EmailSendResult",
"./integrations::EmailTransport",
"./integrations::HttpJsonRequest",
"./integrations::HttpToolOptions",
"./integrations::ImapClient",
"./integrations::ImapFetchOptions",
"./integrations::parseDocx",
"./integrations::parsePdf",
"./integrations::parseXlsx",
Expand All @@ -1181,18 +1085,11 @@
"./integrations::postgresQuery",
"./integrations::PostgresRolesConfig",
"./integrations::R2ClientLike",
"./integrations::RetryPolicy",
"./integrations::s3",
"./integrations::S3Config",
"./integrations::s3GetObject",
"./integrations::s3ListObjects",
"./integrations::s3PutObject",
"./integrations::TeamsAdaptiveCard",
"./integrations::TeamsAdaptiveCardAction",
"./integrations::TeamsBotClient",
"./integrations::TeamsBotMessage",
"./integrations::TeamsBotSendResult",
"./integrations::TeamsMessageCard",
"./mcp-devtools::devtoolsTools",
"./mcp-devtools::EvalResult",
"./mcp-devtools::EvalSummary",
Expand Down
11 changes: 11 additions & 0 deletions packages/integrations/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { IntegrationHttp } from './http'
// Side effects — lets a host enforce an autonomy/approval gate per action.
// ---------------------------------------------------------------------------

/** Declared blast radius of an integration action. */
export type SideEffect = 'none' | 'read' | 'write' | 'destructive' | 'external'

// ---------------------------------------------------------------------------
Expand All @@ -27,10 +28,12 @@ export interface OAuth2ProviderSpec {
extraAuthParams?: Record<string, string>
}

/** OAuth2 authorization configuration for a service integration. */
export interface OAuth2AuthSpec extends OAuth2ProviderSpec {
kind: 'oauth2'
}

/** Header-based API key authentication configuration. */
export interface ApiKeyAuthSpec {
kind: 'apiKey'
/** Header the credential is sent in (e.g. `authorization`). */
Expand All @@ -41,16 +44,19 @@ export interface ApiKeyAuthSpec {
envHint?: string
}

/** Authentication configuration for verifying inbound webhook signatures. */
export interface WebhookSecretAuthSpec {
kind: 'webhookSecret'
/** Signature scheme used to verify inbound webhooks. */
scheme: 'hmac-sha256' | 'ed25519' | 'custom'
}

/** Authentication marker for integrations that require no credentials. */
export interface NoAuthSpec {
kind: 'none'
}

/** Supported declarative authentication configurations for integrations. */
export type AuthSpec =
| OAuth2AuthSpec
| ApiKeyAuthSpec
Expand Down Expand Up @@ -86,6 +92,7 @@ export interface IntegrationActionContext {
config: unknown
}

/** An executable provider operation that can be projected into a tool. */
export interface IntegrationAction {
/** Stable, namespaced id, e.g. `slack_post_message`. */
name: string
Expand All @@ -107,6 +114,7 @@ export interface IntegrationAction {
// canonical normalized event a host trigger layer can consume.
// ---------------------------------------------------------------------------

/** Request data supplied to a trigger's webhook verifier. */
export interface WebhookInput {
/** Verification secret (signing secret / shared token). */
secret: string
Expand All @@ -118,6 +126,7 @@ export interface WebhookInput {
requestUrl?: string
}

/** Result returned by an integration webhook signature verifier. */
export type VerifyResult = { ok: true } | { ok: false; reason: string }

/** External thread reference — basis for session stitching across turns. */
Expand All @@ -136,6 +145,7 @@ export interface NormalizedEvent {
raw?: unknown
}

/** Webhook trigger that verifies and normalizes provider events. */
export interface IntegrationTrigger {
/** Stable id, e.g. `slack.message`. */
name: string
Expand Down Expand Up @@ -174,6 +184,7 @@ export interface ConfigField {
placeholder?: string
}

/** Complete service descriptor shared by integration projections. */
export interface Integration {
/** Service slug, e.g. `slack`. */
name: string
Expand Down
4 changes: 4 additions & 0 deletions packages/integrations/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { composeTimeoutSignal } from './http-timeout'
export { readResponseBytes, readResponseText } from './http-body'
export { composeTimeoutSignal } from './http-timeout'

/** Configuration for an authenticated, origin-confined integration HTTP client. */
export interface HttpToolOptions {
baseUrl?: string
/** Header bag merged into every request (auth, user-agent, etc.). */
Expand All @@ -32,6 +33,7 @@ export interface HttpToolOptions {
retry?: RetryPolicy
}

/** Retry limits and delays for retryable integration HTTP requests. */
export interface RetryPolicy {
/** Total attempts, including the first request. Defaults to 1; valid range is 1–100. */
maxAttempts?: number
Expand All @@ -43,10 +45,12 @@ export interface RetryPolicy {
methods?: RetryableHttpMethod[]
}

/** HTTP methods for which the integration client can retry requests. */
export type RetryableHttpMethod = NonNullable<HttpJsonRequest['method']>

const MAX_TIMEOUT_MS = 2_147_483_647

/** Request options accepted by `httpJson` and a bound integration client. */
export interface HttpJsonRequest {
/** HTTP method. Defaults to GET. */
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
Expand Down
25 changes: 25 additions & 0 deletions packages/integrations/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ export interface IntegrationRegistry {
byCategory(category: string): Integration[]
}

/** Creates an isolated in-memory registry seeded with optional descriptors.
* @param initial Integrations to register when the registry is created.
* @returns A registry with register, lookup, list, and category methods.
* @throws {ConfigError} When two initial integrations have the same name.
* @example
* ```ts
* const registry = createRegistry([slackIntegration])
* const slack = registry.get('slack')
* ```
*/
export function createRegistry(initial: Integration[] = []): IntegrationRegistry {
const map = new Map<string, Integration>()

Expand Down Expand Up @@ -48,18 +58,33 @@ export function createRegistry(initial: Integration[] = []): IntegrationRegistry
*/
const defaultRegistry = createRegistry()

/** Adds an integration to the default catalog.
* @param integration Descriptor to register.
* @throws {ConfigError} When an integration with the same name is registered.
*/
export function registerIntegration(integration: Integration): void {
defaultRegistry.register(integration)
}

/** Looks up an integration by its service slug in the default catalog.
* @param name Integration slug.
* @returns The matching descriptor, or `undefined` when not registered.
*/
export function getIntegration(name: string): Integration | undefined {
return defaultRegistry.get(name)
}

/** Returns all descriptors registered in the default catalog.
* @returns A new array of integration descriptors.
*/
export function listIntegrations(): Integration[] {
return defaultRegistry.list()
}

/** Returns default-catalog integrations that include the requested category.
* @param category Category slug to match.
* @returns Matching integration descriptors.
*/
export function integrationsByCategory(category: string): Integration[] {
return defaultRegistry.byCategory(category)
}
1 change: 1 addition & 0 deletions packages/integrations/src/services/acuity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CONFIG_FIELDS } from '../../config-fields'
import { registerIntegration } from '../../registry'
import { acuityActions } from './actions'

/** Descriptor for the Acuity Scheduling service integration. */
export const acuityIntegration = defineIntegration({
name: 'acuity',
displayName: 'Acuity Scheduling',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/airtable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { airtableActions } from './actions'

/** Descriptor for the Airtable service integration. */
export const airtableIntegration = defineIntegration({
name: 'airtable',
displayName: 'Airtable',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/apollo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { apolloActions } from './actions'

/** Descriptor for the Apollo.io service integration. */
export const apolloIntegration = defineIntegration({
name: 'apollo',
displayName: 'Apollo.io',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/asana/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { asanaActions } from './actions'

/** Descriptor for the Asana service integration. */
export const asanaIntegration = defineIntegration({
name: 'asana',
displayName: 'Asana',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/assemblyai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { assemblyaiActions } from './actions'

/** Descriptor for the AssemblyAI service integration. */
export const assemblyaiIntegration = defineIntegration({
name: 'assemblyai',
displayName: 'AssemblyAI',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/attio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { attioActions } from './actions'

/** Descriptor for the Attio service integration. */
export const attioIntegration = defineIntegration({
name: 'attio',
displayName: 'Attio',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/azure-openai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { azureOpenaiActions } from './actions'

/** Descriptor for the Azure OpenAI service integration. */
export const azureOpenaiIntegration = defineIntegration({
name: 'azure-openai',
displayName: 'Azure OpenAI',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/baserow/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { baserowActions } from './actions'

/** Descriptor for the Baserow service integration. */
export const baserowIntegration = defineIntegration({
name: 'baserow',
displayName: 'Baserow',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/bigcommerce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { bigcommerceActions } from './actions'

/** Descriptor for the BigCommerce service integration. */
export const bigcommerceIntegration = defineIntegration({
name: 'bigcommerce',
displayName: 'BigCommerce',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineIntegration } from '../../contract'
import { registerIntegration } from '../../registry'
import { boxActions } from './actions'

/** Descriptor for the Box service integration. */
export const boxIntegration = defineIntegration({
name: 'box',
displayName: 'Box',
Expand Down
1 change: 1 addition & 0 deletions packages/integrations/src/services/cal-com/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CONFIG_FIELDS } from '../../config-fields'
import { registerIntegration } from '../../registry'
import { calComActions } from './actions'

/** Descriptor for the Cal.com service integration. */
export const calComIntegration = defineIntegration({
name: 'cal-com',
displayName: 'Cal.com',
Expand Down
Loading
Loading