Sign In

@agentskit/integrations

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentskit/integrations - npm Package Compare versions

Comparing version
0.6.4
to
0.7.0
+219
dist/contract-J8wVHb2z.d.cts
import { JSONSchema7 } from 'json-schema';
import { MaybePromise } from '@agentskit/core';
interface HttpToolOptions {
baseUrl?: string;
/** Header bag merged into every request (auth, user-agent, etc.). */
headers?: Record<string, string>;
/** Per-request timeout in ms. Default 20_000. */
timeoutMs?: number;
/** Caller cancellation signal; composed with the internal timeout. */
signal?: AbortSignal;
/** Swap in a fake for tests. */
fetch?: typeof globalThis.fetch;
/** Optional retry policy. Retries are limited to idempotent methods. */
retry?: RetryPolicy;
}
interface RetryPolicy {
/** Total attempts, including the first request. Defaults to one. */
maxAttempts?: number;
/** Delay before the first retry when Retry-After is absent. */
baseDelayMs?: number;
/** Upper bound for exponential backoff and Retry-After. */
maxDelayMs?: number;
}
interface HttpJsonRequest {
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
path: string;
query?: Record<string, string | number | undefined>;
body?: unknown;
headers?: Record<string, string>;
}
declare function composeTimeoutSignal(timeoutMs: number, outer?: AbortSignal): {
signal: AbortSignal;
cleanup: () => void;
};
/**
* Shared HTTP helper used by the service integrations. Handles query string
* encoding, JSON body + response parsing, timeouts, and turns non-2xx into
* throwable errors with the server payload attached.
*
* Auth lives entirely in `options.headers` — an action never sees the raw
* credential; the auth layer binds it before the action runs.
*/
declare function httpJson<TResult = unknown>(options: HttpToolOptions, request: HttpJsonRequest): Promise<TResult>;
/**
* An auth-bound HTTP client handed to every `IntegrationAction.execute`. The
* `baseUrl`, auth headers, and timeout are already applied — the action only
* supplies the per-request path/method/body.
*/
type IntegrationHttp = <TResult = unknown>(request: HttpJsonRequest) => Promise<TResult>;
/** Bind `httpJson` to a fixed set of options, producing an `IntegrationHttp`. */
declare function bindHttp(options: HttpToolOptions): IntegrationHttp;
type SideEffect = 'none' | 'read' | 'write' | 'destructive' | 'external';
/**
* Declarative OAuth2 provider spec — authorize/token endpoints, default scopes,
* PKCE flag, and any non-standard authorize params. The portable data an OAuth
* flow needs; the host owns the flow runner, token vault, and client secrets.
*/
interface OAuth2ProviderSpec {
authorizationUrl: string;
tokenUrl: string;
defaultScopes: string[];
usePkce: boolean;
/** Non-standard authorize params (e.g. Dropbox `token_access_type=offline`). */
extraAuthParams?: Record<string, string>;
}
interface OAuth2AuthSpec extends OAuth2ProviderSpec {
kind: 'oauth2';
}
interface ApiKeyAuthSpec {
kind: 'apiKey';
/** Header the credential is sent in (e.g. `authorization`). */
header: string;
/** Optional prefix, e.g. `Bearer ` or `token `. */
prefix?: string;
/** Hint for where the key is conventionally read from (docs/UX only). */
envHint?: string;
}
interface WebhookSecretAuthSpec {
kind: 'webhookSecret';
/** Signature scheme used to verify inbound webhooks. */
scheme: 'hmac-sha256' | 'ed25519' | 'custom';
}
interface NoAuthSpec {
kind: 'none';
}
type AuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | WebhookSecretAuthSpec | NoAuthSpec;
/**
* Execution context handed to every action. `http` covers the common
* REST-with-token case; `fetch` + `config` let complex services do their own
* transport (form-encoded bodies, Basic auth, injected SMTP/bot adapters).
*/
interface IntegrationActionContext {
/** Auth-bound JSON HTTP client (base URL + auth headers applied). */
http: IntegrationHttp;
/** Raw fetch for provider / non-JSON transports (not model-controlled URLs). */
fetch: typeof globalThis.fetch;
/**
* Host-injected, policy-enforcing transport for model-controlled URLs
* (SSRF egress gate). Distinct from `fetch`, which remains the provider path.
*/
fetchUntrusted?: typeof globalThis.fetch;
/** Caller cancellation propagated to non-JSON provider transports. */
signal?: AbortSignal;
/** Service-specific config: extra credentials, injected adapters, options. */
config: unknown;
}
interface IntegrationAction {
/** Stable, namespaced id, e.g. `slack_post_message`. */
name: string;
description: string;
/** JSON Schema (canonical) for the action arguments. */
schema: JSONSchema7;
sideEffect?: SideEffect;
requiresConfirmation?: boolean;
/**
* SendCapability id this action fulfils when projected as an outbound
* connector sender (e.g. `chat.postMessage`). Absent = not a sender.
*/
sendCapability?: string;
execute: (args: Record<string, unknown>, ctx: IntegrationActionContext) => MaybePromise<unknown>;
}
interface WebhookInput {
/** Verification secret (signing secret / shared token). */
secret: string;
/** Raw, unparsed request body — required for signature verification. */
rawBody: string;
headers: Record<string, string>;
/** Override for replay-window checks; defaults to now. */
nowSeconds?: number;
requestUrl?: string;
}
type VerifyResult = {
ok: true;
} | {
ok: false;
reason: string;
};
/** External thread reference — basis for session stitching across turns. */
interface ExternalThreadRef {
kind: string;
id: string;
parentId?: string;
}
/** Provider payload normalized to a uniform shape before canonicalization. */
interface NormalizedEvent {
/** Provider event type, e.g. `message`, `issues.opened`. */
kind: string;
payload: unknown;
/** Untouched provider envelope, kept for replay/debug. */
raw?: unknown;
}
interface IntegrationTrigger {
/** Stable id, e.g. `slack.message`. */
name: string;
/** Canonical source slug — matches the OS IncomingEvent `source`. */
source: string;
/** Verify inbound signature. Omit only for unauthenticated sources. */
verify?: (input: WebhookInput) => VerifyResult;
/** Normalize a raw provider payload into a uniform event. */
normalize: (raw: unknown) => NormalizedEvent;
/** Extract a thread reference for session stitching, when available. */
externalThreadRef?: (raw: unknown) => ExternalThreadRef | undefined;
}
/**
* A single user-supplied configuration field for a service that authenticates
* with structured config rather than a single API key (e.g. Twilio's
* accountSid + authToken + fromNumber, Jira's baseUrl). Declarative so a host UI
* can render a connect form, and a host can validate before storing. Maps onto
* the `config` object passed to each action's `IntegrationActionContext`.
*/
interface ConfigField {
/** Key on the `config` object the actions read (e.g. `accountSid`). */
key: string;
/** Human label for the form field. */
label: string;
/** Render as a masked secret input + store in the vault. */
secret?: boolean;
/** The connector cannot operate without it. Defaults to required. */
required?: boolean;
/** Placeholder / example shown in the form. */
placeholder?: string;
}
interface Integration {
/** Service slug — matches the OS ConnectionKind, e.g. `slack`. */
name: string;
displayName: string;
categories: string[];
/** Shared transport facts applied to every action (base URL + default headers). */
http?: {
baseUrl: string;
headers?: Record<string, string>;
};
auth: AuthSpec;
/** OAuth2 flow spec, when the service supports an OAuth authorization-code
* flow (independent of the primary `auth`). The portable provider registry. */
oauth?: OAuth2ProviderSpec;
/** Structured-config fields a host UI captures to connect the service, when it
* authenticates with more than a single API key (Twilio, Jira, Stripe, …). */
configFields?: ConfigField[];
actions: IntegrationAction[];
triggers?: IntegrationTrigger[];
/** Pointers letting projections pick the canonical send/notify action. */
capabilities?: {
/** Action name used as the canonical outbound sender. */
send?: string;
/** Action name used as the canonical notification channel. */
notify?: string;
};
}
/** Define an integration descriptor (identity; anchors the type). */
declare function defineIntegration(integration: Integration): Integration;
/** Define a single action (identity; anchors the type). */
declare function defineAction(action: IntegrationAction): IntegrationAction;
/** Define a single trigger (identity; anchors the type). */
declare function defineTrigger(trigger: IntegrationTrigger): IntegrationTrigger;
export { type ApiKeyAuthSpec as A, type ConfigField as C, type ExternalThreadRef as E, type HttpToolOptions as H, type Integration as I, type NoAuthSpec as N, type OAuth2AuthSpec as O, type RetryPolicy as R, type SideEffect as S, type VerifyResult as V, type WebhookInput as W, type IntegrationAction as a, type IntegrationActionContext as b, type IntegrationTrigger as c, type AuthSpec as d, type HttpJsonRequest as e, type IntegrationHttp as f, type NormalizedEvent as g, type OAuth2ProviderSpec as h, type WebhookSecretAuthSpec as i, bindHttp as j, composeTimeoutSignal as k, defineAction as l, defineIntegration as m, defineTrigger as n, httpJson as o };
import { JSONSchema7 } from 'json-schema';
import { MaybePromise } from '@agentskit/core';
interface HttpToolOptions {
baseUrl?: string;
/** Header bag merged into every request (auth, user-agent, etc.). */
headers?: Record<string, string>;
/** Per-request timeout in ms. Default 20_000. */
timeoutMs?: number;
/** Caller cancellation signal; composed with the internal timeout. */
signal?: AbortSignal;
/** Swap in a fake for tests. */
fetch?: typeof globalThis.fetch;
/** Optional retry policy. Retries are limited to idempotent methods. */
retry?: RetryPolicy;
}
interface RetryPolicy {
/** Total attempts, including the first request. Defaults to one. */
maxAttempts?: number;
/** Delay before the first retry when Retry-After is absent. */
baseDelayMs?: number;
/** Upper bound for exponential backoff and Retry-After. */
maxDelayMs?: number;
}
interface HttpJsonRequest {
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
path: string;
query?: Record<string, string | number | undefined>;
body?: unknown;
headers?: Record<string, string>;
}
declare function composeTimeoutSignal(timeoutMs: number, outer?: AbortSignal): {
signal: AbortSignal;
cleanup: () => void;
};
/**
* Shared HTTP helper used by the service integrations. Handles query string
* encoding, JSON body + response parsing, timeouts, and turns non-2xx into
* throwable errors with the server payload attached.
*
* Auth lives entirely in `options.headers` — an action never sees the raw
* credential; the auth layer binds it before the action runs.
*/
declare function httpJson<TResult = unknown>(options: HttpToolOptions, request: HttpJsonRequest): Promise<TResult>;
/**
* An auth-bound HTTP client handed to every `IntegrationAction.execute`. The
* `baseUrl`, auth headers, and timeout are already applied — the action only
* supplies the per-request path/method/body.
*/
type IntegrationHttp = <TResult = unknown>(request: HttpJsonRequest) => Promise<TResult>;
/** Bind `httpJson` to a fixed set of options, producing an `IntegrationHttp`. */
declare function bindHttp(options: HttpToolOptions): IntegrationHttp;
type SideEffect = 'none' | 'read' | 'write' | 'destructive' | 'external';
/**
* Declarative OAuth2 provider spec — authorize/token endpoints, default scopes,
* PKCE flag, and any non-standard authorize params. The portable data an OAuth
* flow needs; the host owns the flow runner, token vault, and client secrets.
*/
interface OAuth2ProviderSpec {
authorizationUrl: string;
tokenUrl: string;
defaultScopes: string[];
usePkce: boolean;
/** Non-standard authorize params (e.g. Dropbox `token_access_type=offline`). */
extraAuthParams?: Record<string, string>;
}
interface OAuth2AuthSpec extends OAuth2ProviderSpec {
kind: 'oauth2';
}
interface ApiKeyAuthSpec {
kind: 'apiKey';
/** Header the credential is sent in (e.g. `authorization`). */
header: string;
/** Optional prefix, e.g. `Bearer ` or `token `. */
prefix?: string;
/** Hint for where the key is conventionally read from (docs/UX only). */
envHint?: string;
}
interface WebhookSecretAuthSpec {
kind: 'webhookSecret';
/** Signature scheme used to verify inbound webhooks. */
scheme: 'hmac-sha256' | 'ed25519' | 'custom';
}
interface NoAuthSpec {
kind: 'none';
}
type AuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | WebhookSecretAuthSpec | NoAuthSpec;
/**
* Execution context handed to every action. `http` covers the common
* REST-with-token case; `fetch` + `config` let complex services do their own
* transport (form-encoded bodies, Basic auth, injected SMTP/bot adapters).
*/
interface IntegrationActionContext {
/** Auth-bound JSON HTTP client (base URL + auth headers applied). */
http: IntegrationHttp;
/** Raw fetch for provider / non-JSON transports (not model-controlled URLs). */
fetch: typeof globalThis.fetch;
/**
* Host-injected, policy-enforcing transport for model-controlled URLs
* (SSRF egress gate). Distinct from `fetch`, which remains the provider path.
*/
fetchUntrusted?: typeof globalThis.fetch;
/** Caller cancellation propagated to non-JSON provider transports. */
signal?: AbortSignal;
/** Service-specific config: extra credentials, injected adapters, options. */
config: unknown;
}
interface IntegrationAction {
/** Stable, namespaced id, e.g. `slack_post_message`. */
name: string;
description: string;
/** JSON Schema (canonical) for the action arguments. */
schema: JSONSchema7;
sideEffect?: SideEffect;
requiresConfirmation?: boolean;
/**
* SendCapability id this action fulfils when projected as an outbound
* connector sender (e.g. `chat.postMessage`). Absent = not a sender.
*/
sendCapability?: string;
execute: (args: Record<string, unknown>, ctx: IntegrationActionContext) => MaybePromise<unknown>;
}
interface WebhookInput {
/** Verification secret (signing secret / shared token). */
secret: string;
/** Raw, unparsed request body — required for signature verification. */
rawBody: string;
headers: Record<string, string>;
/** Override for replay-window checks; defaults to now. */
nowSeconds?: number;
requestUrl?: string;
}
type VerifyResult = {
ok: true;
} | {
ok: false;
reason: string;
};
/** External thread reference — basis for session stitching across turns. */
interface ExternalThreadRef {
kind: string;
id: string;
parentId?: string;
}
/** Provider payload normalized to a uniform shape before canonicalization. */
interface NormalizedEvent {
/** Provider event type, e.g. `message`, `issues.opened`. */
kind: string;
payload: unknown;
/** Untouched provider envelope, kept for replay/debug. */
raw?: unknown;
}
interface IntegrationTrigger {
/** Stable id, e.g. `slack.message`. */
name: string;
/** Canonical source slug — matches the OS IncomingEvent `source`. */
source: string;
/** Verify inbound signature. Omit only for unauthenticated sources. */
verify?: (input: WebhookInput) => VerifyResult;
/** Normalize a raw provider payload into a uniform event. */
normalize: (raw: unknown) => NormalizedEvent;
/** Extract a thread reference for session stitching, when available. */
externalThreadRef?: (raw: unknown) => ExternalThreadRef | undefined;
}
/**
* A single user-supplied configuration field for a service that authenticates
* with structured config rather than a single API key (e.g. Twilio's
* accountSid + authToken + fromNumber, Jira's baseUrl). Declarative so a host UI
* can render a connect form, and a host can validate before storing. Maps onto
* the `config` object passed to each action's `IntegrationActionContext`.
*/
interface ConfigField {
/** Key on the `config` object the actions read (e.g. `accountSid`). */
key: string;
/** Human label for the form field. */
label: string;
/** Render as a masked secret input + store in the vault. */
secret?: boolean;
/** The connector cannot operate without it. Defaults to required. */
required?: boolean;
/** Placeholder / example shown in the form. */
placeholder?: string;
}
interface Integration {
/** Service slug — matches the OS ConnectionKind, e.g. `slack`. */
name: string;
displayName: string;
categories: string[];
/** Shared transport facts applied to every action (base URL + default headers). */
http?: {
baseUrl: string;
headers?: Record<string, string>;
};
auth: AuthSpec;
/** OAuth2 flow spec, when the service supports an OAuth authorization-code
* flow (independent of the primary `auth`). The portable provider registry. */
oauth?: OAuth2ProviderSpec;
/** Structured-config fields a host UI captures to connect the service, when it
* authenticates with more than a single API key (Twilio, Jira, Stripe, …). */
configFields?: ConfigField[];
actions: IntegrationAction[];
triggers?: IntegrationTrigger[];
/** Pointers letting projections pick the canonical send/notify action. */
capabilities?: {
/** Action name used as the canonical outbound sender. */
send?: string;
/** Action name used as the canonical notification channel. */
notify?: string;
};
}
/** Define an integration descriptor (identity; anchors the type). */
declare function defineIntegration(integration: Integration): Integration;
/** Define a single action (identity; anchors the type). */
declare function defineAction(action: IntegrationAction): IntegrationAction;
/** Define a single trigger (identity; anchors the type). */
declare function defineTrigger(trigger: IntegrationTrigger): IntegrationTrigger;
export { type ApiKeyAuthSpec as A, type ConfigField as C, type ExternalThreadRef as E, type HttpToolOptions as H, type Integration as I, type NoAuthSpec as N, type OAuth2AuthSpec as O, type RetryPolicy as R, type SideEffect as S, type VerifyResult as V, type WebhookInput as W, type IntegrationAction as a, type IntegrationActionContext as b, type IntegrationTrigger as c, type AuthSpec as d, type HttpJsonRequest as e, type IntegrationHttp as f, type NormalizedEvent as g, type OAuth2ProviderSpec as h, type WebhookSecretAuthSpec as i, bindHttp as j, composeTimeoutSignal as k, defineAction as l, defineIntegration as m, defineTrigger as n, httpJson as o };
+10
-3

@@ -1,3 +0,3 @@

import { I as Integration, a as IntegrationAction, b as IntegrationActionContext, H as HttpToolOptions, c as IntegrationTrigger } from './contract-CROT0KQa.cjs';
export { A as ApiKeyAuthSpec, d as AuthSpec, C as ConfigField, E as ExternalThreadRef, e as HttpJsonRequest, f as IntegrationHttp, N as NoAuthSpec, g as NormalizedEvent, O as OAuth2AuthSpec, h as OAuth2ProviderSpec, S as SideEffect, V as VerifyResult, W as WebhookInput, i as WebhookSecretAuthSpec, j as bindHttp, k as defineAction, l as defineIntegration, m as defineTrigger, n as httpJson } from './contract-CROT0KQa.cjs';
import { I as Integration, R as RetryPolicy, a as IntegrationAction, b as IntegrationActionContext, H as HttpToolOptions, c as IntegrationTrigger } from './contract-J8wVHb2z.cjs';
export { A as ApiKeyAuthSpec, d as AuthSpec, C as ConfigField, E as ExternalThreadRef, e as HttpJsonRequest, f as IntegrationHttp, N as NoAuthSpec, g as NormalizedEvent, O as OAuth2AuthSpec, h as OAuth2ProviderSpec, S as SideEffect, V as VerifyResult, W as WebhookInput, i as WebhookSecretAuthSpec, j as bindHttp, k as composeTimeoutSignal, l as defineAction, m as defineIntegration, n as defineTrigger, o as httpJson } from './contract-J8wVHb2z.cjs';
import { ToolDefinition } from '@agentskit/core';

@@ -62,2 +62,7 @@ import 'json-schema';

}];
readonly whatsapp: [{
readonly key: "phoneNumberId";
readonly label: "Phone number ID";
readonly required: true;
}];
readonly elevenlabs: [{

@@ -193,2 +198,3 @@ readonly key: "apiKey";

timeoutMs?: number;
retry?: RetryPolicy;
signal?: AbortSignal;

@@ -354,2 +360,3 @@ fetch?: typeof globalThis.fetch;

replyToId?: string;
signal?: AbortSignal;
}

@@ -470,2 +477,2 @@ interface TeamsBotSendResult {

export { CONFIG_FIELDS, type EmailAttachment, type EmailConfig, type EmailMessage, type EmailSendMessage, type EmailSendResult, type EmailTransport, HttpToolOptions, type ImapClient, type ImapFetchOptions, Integration, IntegrationAction, IntegrationActionContext, type IntegrationRegistry, IntegrationTrigger, type ProjectionConfig, type TeamsAdaptiveCard, type TeamsAdaptiveCardAction, type TeamsBotClient, type TeamsBotMessage, type TeamsBotSendResult, type TeamsMessageCard, type TeamsRuntimeConfig, actionToToolDefinition, acuityIntegration, adaptiveCard, airtableIntegration, apolloIntegration, asanaIntegration, assemblyaiIntegration, attioIntegration, azureOpenaiIntegration, baserowIntegration, bigcommerceIntegration, boxIntegration, calComIntegration, calendlyIntegration, coingeckoIntegration, confluenceIntegration, createRegistry, credentialEnvVar, deepgramIntegration, discordIntegration, dropboxIntegration, elevenlabsIntegration, emailIntegration, figmaIntegration, firecrawlIntegration, getIntegration, githubActionsIntegration, githubIntegration, gmailIntegration, googleCalendarIntegration, googleDriveIntegration, httpOptionsFor, hubspotIntegration, integrationTools, integrationToolsFromEnv, integrationsByCategory, intercomIntegration, jiraIntegration, linearIntegration, linearTriageIntegration, listIntegrations, mailchimpIntegration, mapsIntegration, messageCard, notionIntegration, openaiImagesIntegration, pagerdutyIntegration, pipedriveIntegration, readerIntegration, registerIntegration, salesforceIntegration, sendgridIntegration, sentryIntegration, shopifyIntegration, slackIntegration, stripeIntegration, stripeWebhook, teamsIntegration, telegramIntegration, toToolDefinitions, twilioIntegration, verifyStripeSignature, weatherIntegration, whatsappIntegration, whisperIntegration };
export { CONFIG_FIELDS, type EmailAttachment, type EmailConfig, type EmailMessage, type EmailSendMessage, type EmailSendResult, type EmailTransport, HttpToolOptions, type ImapClient, type ImapFetchOptions, Integration, IntegrationAction, IntegrationActionContext, type IntegrationRegistry, IntegrationTrigger, type ProjectionConfig, RetryPolicy, type TeamsAdaptiveCard, type TeamsAdaptiveCardAction, type TeamsBotClient, type TeamsBotMessage, type TeamsBotSendResult, type TeamsMessageCard, type TeamsRuntimeConfig, actionToToolDefinition, acuityIntegration, adaptiveCard, airtableIntegration, apolloIntegration, asanaIntegration, assemblyaiIntegration, attioIntegration, azureOpenaiIntegration, baserowIntegration, bigcommerceIntegration, boxIntegration, calComIntegration, calendlyIntegration, coingeckoIntegration, confluenceIntegration, createRegistry, credentialEnvVar, deepgramIntegration, discordIntegration, dropboxIntegration, elevenlabsIntegration, emailIntegration, figmaIntegration, firecrawlIntegration, getIntegration, githubActionsIntegration, githubIntegration, gmailIntegration, googleCalendarIntegration, googleDriveIntegration, httpOptionsFor, hubspotIntegration, integrationTools, integrationToolsFromEnv, integrationsByCategory, intercomIntegration, jiraIntegration, linearIntegration, linearTriageIntegration, listIntegrations, mailchimpIntegration, mapsIntegration, messageCard, notionIntegration, openaiImagesIntegration, pagerdutyIntegration, pipedriveIntegration, readerIntegration, registerIntegration, salesforceIntegration, sendgridIntegration, sentryIntegration, shopifyIntegration, slackIntegration, stripeIntegration, stripeWebhook, teamsIntegration, telegramIntegration, toToolDefinitions, twilioIntegration, verifyStripeSignature, weatherIntegration, whatsappIntegration, whisperIntegration };

@@ -1,3 +0,3 @@

import { I as Integration, a as IntegrationAction, b as IntegrationActionContext, H as HttpToolOptions, c as IntegrationTrigger } from './contract-CROT0KQa.js';
export { A as ApiKeyAuthSpec, d as AuthSpec, C as ConfigField, E as ExternalThreadRef, e as HttpJsonRequest, f as IntegrationHttp, N as NoAuthSpec, g as NormalizedEvent, O as OAuth2AuthSpec, h as OAuth2ProviderSpec, S as SideEffect, V as VerifyResult, W as WebhookInput, i as WebhookSecretAuthSpec, j as bindHttp, k as defineAction, l as defineIntegration, m as defineTrigger, n as httpJson } from './contract-CROT0KQa.js';
import { I as Integration, R as RetryPolicy, a as IntegrationAction, b as IntegrationActionContext, H as HttpToolOptions, c as IntegrationTrigger } from './contract-J8wVHb2z.js';
export { A as ApiKeyAuthSpec, d as AuthSpec, C as ConfigField, E as ExternalThreadRef, e as HttpJsonRequest, f as IntegrationHttp, N as NoAuthSpec, g as NormalizedEvent, O as OAuth2AuthSpec, h as OAuth2ProviderSpec, S as SideEffect, V as VerifyResult, W as WebhookInput, i as WebhookSecretAuthSpec, j as bindHttp, k as composeTimeoutSignal, l as defineAction, m as defineIntegration, n as defineTrigger, o as httpJson } from './contract-J8wVHb2z.js';
import { ToolDefinition } from '@agentskit/core';

@@ -62,2 +62,7 @@ import 'json-schema';

}];
readonly whatsapp: [{
readonly key: "phoneNumberId";
readonly label: "Phone number ID";
readonly required: true;
}];
readonly elevenlabs: [{

@@ -193,2 +198,3 @@ readonly key: "apiKey";

timeoutMs?: number;
retry?: RetryPolicy;
signal?: AbortSignal;

@@ -354,2 +360,3 @@ fetch?: typeof globalThis.fetch;

replyToId?: string;
signal?: AbortSignal;
}

@@ -470,2 +477,2 @@ interface TeamsBotSendResult {

export { CONFIG_FIELDS, type EmailAttachment, type EmailConfig, type EmailMessage, type EmailSendMessage, type EmailSendResult, type EmailTransport, HttpToolOptions, type ImapClient, type ImapFetchOptions, Integration, IntegrationAction, IntegrationActionContext, type IntegrationRegistry, IntegrationTrigger, type ProjectionConfig, type TeamsAdaptiveCard, type TeamsAdaptiveCardAction, type TeamsBotClient, type TeamsBotMessage, type TeamsBotSendResult, type TeamsMessageCard, type TeamsRuntimeConfig, actionToToolDefinition, acuityIntegration, adaptiveCard, airtableIntegration, apolloIntegration, asanaIntegration, assemblyaiIntegration, attioIntegration, azureOpenaiIntegration, baserowIntegration, bigcommerceIntegration, boxIntegration, calComIntegration, calendlyIntegration, coingeckoIntegration, confluenceIntegration, createRegistry, credentialEnvVar, deepgramIntegration, discordIntegration, dropboxIntegration, elevenlabsIntegration, emailIntegration, figmaIntegration, firecrawlIntegration, getIntegration, githubActionsIntegration, githubIntegration, gmailIntegration, googleCalendarIntegration, googleDriveIntegration, httpOptionsFor, hubspotIntegration, integrationTools, integrationToolsFromEnv, integrationsByCategory, intercomIntegration, jiraIntegration, linearIntegration, linearTriageIntegration, listIntegrations, mailchimpIntegration, mapsIntegration, messageCard, notionIntegration, openaiImagesIntegration, pagerdutyIntegration, pipedriveIntegration, readerIntegration, registerIntegration, salesforceIntegration, sendgridIntegration, sentryIntegration, shopifyIntegration, slackIntegration, stripeIntegration, stripeWebhook, teamsIntegration, telegramIntegration, toToolDefinitions, twilioIntegration, verifyStripeSignature, weatherIntegration, whatsappIntegration, whisperIntegration };
export { CONFIG_FIELDS, type EmailAttachment, type EmailConfig, type EmailMessage, type EmailSendMessage, type EmailSendResult, type EmailTransport, HttpToolOptions, type ImapClient, type ImapFetchOptions, Integration, IntegrationAction, IntegrationActionContext, type IntegrationRegistry, IntegrationTrigger, type ProjectionConfig, RetryPolicy, type TeamsAdaptiveCard, type TeamsAdaptiveCardAction, type TeamsBotClient, type TeamsBotMessage, type TeamsBotSendResult, type TeamsMessageCard, type TeamsRuntimeConfig, actionToToolDefinition, acuityIntegration, adaptiveCard, airtableIntegration, apolloIntegration, asanaIntegration, assemblyaiIntegration, attioIntegration, azureOpenaiIntegration, baserowIntegration, bigcommerceIntegration, boxIntegration, calComIntegration, calendlyIntegration, coingeckoIntegration, confluenceIntegration, createRegistry, credentialEnvVar, deepgramIntegration, discordIntegration, dropboxIntegration, elevenlabsIntegration, emailIntegration, figmaIntegration, firecrawlIntegration, getIntegration, githubActionsIntegration, githubIntegration, gmailIntegration, googleCalendarIntegration, googleDriveIntegration, httpOptionsFor, hubspotIntegration, integrationTools, integrationToolsFromEnv, integrationsByCategory, intercomIntegration, jiraIntegration, linearIntegration, linearTriageIntegration, listIntegrations, mailchimpIntegration, mapsIntegration, messageCard, notionIntegration, openaiImagesIntegration, pagerdutyIntegration, pipedriveIntegration, readerIntegration, registerIntegration, salesforceIntegration, sendgridIntegration, sentryIntegration, shopifyIntegration, slackIntegration, stripeIntegration, stripeWebhook, teamsIntegration, telegramIntegration, toToolDefinitions, twilioIntegration, verifyStripeSignature, weatherIntegration, whatsappIntegration, whisperIntegration };

@@ -1,2 +0,2 @@

import { I as Integration, a as IntegrationAction, c as IntegrationTrigger } from './contract-CROT0KQa.cjs';
import { I as Integration, a as IntegrationAction, c as IntegrationTrigger } from './contract-J8wVHb2z.cjs';
import 'json-schema';

@@ -3,0 +3,0 @@ import '@agentskit/core';

@@ -1,2 +0,2 @@

import { I as Integration, a as IntegrationAction, c as IntegrationTrigger } from './contract-CROT0KQa.js';
import { I as Integration, a as IntegrationAction, c as IntegrationTrigger } from './contract-J8wVHb2z.js';
import 'json-schema';

@@ -3,0 +3,0 @@ import '@agentskit/core';

{
"name": "@agentskit/integrations",
"version": "0.6.4",
"version": "0.7.0",
"description": "Unified, plug-and-play service integrations for AgentsKit agents — one descriptor per service projected into tools, connectors, triggers, and auth.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -67,7 +67,7 @@ # @agentskit/integrations

```ts
import { defineIntegration, defineAction, httpJson } from '@agentskit/integrations'
import { defineIntegration, defineAction } from '@agentskit/integrations'
export const myService = defineIntegration({
name: 'my-service',
baseUrl: 'https://api.example.com',
http: { baseUrl: 'https://api.example.com' },
actions: [

@@ -77,3 +77,3 @@ defineAction({

schema: { type: 'object', properties: { to: { type: 'string' } }, required: ['to'] },
execute: (args, ctx) => httpJson(ctx, 'POST', '/send', args),
execute: (args, { http }) => http({ method: 'POST', path: '/send', body: args }),
}),

@@ -90,2 +90,3 @@ ],

- **`HttpToolOptions.signal` / `ProjectionConfig.signal`** — caller cancellation composed with the per-request timeout.
- **`HttpToolOptions.retry`** — opt-in retries for idempotent methods only, honoring `Retry-After` with bounded backoff.
- **Origin-confined auth-bound HTTP** — when `baseUrl` is set, `httpJson` rejects cross-origin paths and disables automatic redirects so bound credentials cannot leave that origin.

@@ -92,0 +93,0 @@ - **Derived confirmation** — projection forces `requiresConfirmation` for actions with `sideEffect` of `write`, `external`, or `destructive` (descriptors cannot opt out).

import { JSONSchema7 } from 'json-schema';
import { MaybePromise } from '@agentskit/core';
interface HttpToolOptions {
baseUrl?: string;
/** Header bag merged into every request (auth, user-agent, etc.). */
headers?: Record<string, string>;
/** Per-request timeout in ms. Default 20_000. */
timeoutMs?: number;
/** Caller cancellation signal; composed with the internal timeout. */
signal?: AbortSignal;
/** Swap in a fake for tests. */
fetch?: typeof globalThis.fetch;
}
interface HttpJsonRequest {
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
path: string;
query?: Record<string, string | number | undefined>;
body?: unknown;
headers?: Record<string, string>;
}
/**
* Shared HTTP helper used by the service integrations. Handles query string
* encoding, JSON body + response parsing, timeouts, and turns non-2xx into
* throwable errors with the server payload attached.
*
* Auth lives entirely in `options.headers` — an action never sees the raw
* credential; the auth layer binds it before the action runs.
*/
declare function httpJson<TResult = unknown>(options: HttpToolOptions, request: HttpJsonRequest): Promise<TResult>;
/**
* An auth-bound HTTP client handed to every `IntegrationAction.execute`. The
* `baseUrl`, auth headers, and timeout are already applied — the action only
* supplies the per-request path/method/body.
*/
type IntegrationHttp = <TResult = unknown>(request: HttpJsonRequest) => Promise<TResult>;
/** Bind `httpJson` to a fixed set of options, producing an `IntegrationHttp`. */
declare function bindHttp(options: HttpToolOptions): IntegrationHttp;
type SideEffect = 'none' | 'read' | 'write' | 'destructive' | 'external';
/**
* Declarative OAuth2 provider spec — authorize/token endpoints, default scopes,
* PKCE flag, and any non-standard authorize params. The portable data an OAuth
* flow needs; the host owns the flow runner, token vault, and client secrets.
*/
interface OAuth2ProviderSpec {
authorizationUrl: string;
tokenUrl: string;
defaultScopes: string[];
usePkce: boolean;
/** Non-standard authorize params (e.g. Dropbox `token_access_type=offline`). */
extraAuthParams?: Record<string, string>;
}
interface OAuth2AuthSpec extends OAuth2ProviderSpec {
kind: 'oauth2';
}
interface ApiKeyAuthSpec {
kind: 'apiKey';
/** Header the credential is sent in (e.g. `authorization`). */
header: string;
/** Optional prefix, e.g. `Bearer ` or `token `. */
prefix?: string;
/** Hint for where the key is conventionally read from (docs/UX only). */
envHint?: string;
}
interface WebhookSecretAuthSpec {
kind: 'webhookSecret';
/** Signature scheme used to verify inbound webhooks. */
scheme: 'hmac-sha256' | 'ed25519' | 'custom';
}
interface NoAuthSpec {
kind: 'none';
}
type AuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | WebhookSecretAuthSpec | NoAuthSpec;
/**
* Execution context handed to every action. `http` covers the common
* REST-with-token case; `fetch` + `config` let complex services do their own
* transport (form-encoded bodies, Basic auth, injected SMTP/bot adapters).
*/
interface IntegrationActionContext {
/** Auth-bound JSON HTTP client (base URL + auth headers applied). */
http: IntegrationHttp;
/** Raw fetch for provider / non-JSON transports (not model-controlled URLs). */
fetch: typeof globalThis.fetch;
/**
* Host-injected, policy-enforcing transport for model-controlled URLs
* (SSRF egress gate). Distinct from `fetch`, which remains the provider path.
*/
fetchUntrusted?: typeof globalThis.fetch;
/** Service-specific config: extra credentials, injected adapters, options. */
config: unknown;
}
interface IntegrationAction {
/** Stable, namespaced id, e.g. `slack_post_message`. */
name: string;
description: string;
/** JSON Schema (canonical) for the action arguments. */
schema: JSONSchema7;
sideEffect?: SideEffect;
requiresConfirmation?: boolean;
/**
* SendCapability id this action fulfils when projected as an outbound
* connector sender (e.g. `chat.postMessage`). Absent = not a sender.
*/
sendCapability?: string;
execute: (args: Record<string, unknown>, ctx: IntegrationActionContext) => MaybePromise<unknown>;
}
interface WebhookInput {
/** Verification secret (signing secret / shared token). */
secret: string;
/** Raw, unparsed request body — required for signature verification. */
rawBody: string;
headers: Record<string, string>;
/** Override for replay-window checks; defaults to now. */
nowSeconds?: number;
requestUrl?: string;
}
type VerifyResult = {
ok: true;
} | {
ok: false;
reason: string;
};
/** External thread reference — basis for session stitching across turns. */
interface ExternalThreadRef {
kind: string;
id: string;
parentId?: string;
}
/** Provider payload normalized to a uniform shape before canonicalization. */
interface NormalizedEvent {
/** Provider event type, e.g. `message`, `issues.opened`. */
kind: string;
payload: unknown;
/** Untouched provider envelope, kept for replay/debug. */
raw?: unknown;
}
interface IntegrationTrigger {
/** Stable id, e.g. `slack.message`. */
name: string;
/** Canonical source slug — matches the OS IncomingEvent `source`. */
source: string;
/** Verify inbound signature. Omit only for unauthenticated sources. */
verify?: (input: WebhookInput) => VerifyResult;
/** Normalize a raw provider payload into a uniform event. */
normalize: (raw: unknown) => NormalizedEvent;
/** Extract a thread reference for session stitching, when available. */
externalThreadRef?: (raw: unknown) => ExternalThreadRef | undefined;
}
/**
* A single user-supplied configuration field for a service that authenticates
* with structured config rather than a single API key (e.g. Twilio's
* accountSid + authToken + fromNumber, Jira's baseUrl). Declarative so a host UI
* can render a connect form, and a host can validate before storing. Maps onto
* the `config` object passed to each action's `IntegrationActionContext`.
*/
interface ConfigField {
/** Key on the `config` object the actions read (e.g. `accountSid`). */
key: string;
/** Human label for the form field. */
label: string;
/** Render as a masked secret input + store in the vault. */
secret?: boolean;
/** The connector cannot operate without it. Defaults to required. */
required?: boolean;
/** Placeholder / example shown in the form. */
placeholder?: string;
}
interface Integration {
/** Service slug — matches the OS ConnectionKind, e.g. `slack`. */
name: string;
displayName: string;
categories: string[];
/** Shared transport facts applied to every action (base URL + default headers). */
http?: {
baseUrl: string;
headers?: Record<string, string>;
};
auth: AuthSpec;
/** OAuth2 flow spec, when the service supports an OAuth authorization-code
* flow (independent of the primary `auth`). The portable provider registry. */
oauth?: OAuth2ProviderSpec;
/** Structured-config fields a host UI captures to connect the service, when it
* authenticates with more than a single API key (Twilio, Jira, Stripe, …). */
configFields?: ConfigField[];
actions: IntegrationAction[];
triggers?: IntegrationTrigger[];
/** Pointers letting projections pick the canonical send/notify action. */
capabilities?: {
/** Action name used as the canonical outbound sender. */
send?: string;
/** Action name used as the canonical notification channel. */
notify?: string;
};
}
/** Define an integration descriptor (identity; anchors the type). */
declare function defineIntegration(integration: Integration): Integration;
/** Define a single action (identity; anchors the type). */
declare function defineAction(action: IntegrationAction): IntegrationAction;
/** Define a single trigger (identity; anchors the type). */
declare function defineTrigger(trigger: IntegrationTrigger): IntegrationTrigger;
export { type ApiKeyAuthSpec as A, type ConfigField as C, type ExternalThreadRef as E, type HttpToolOptions as H, type Integration as I, type NoAuthSpec as N, type OAuth2AuthSpec as O, type SideEffect as S, type VerifyResult as V, type WebhookInput as W, type IntegrationAction as a, type IntegrationActionContext as b, type IntegrationTrigger as c, type AuthSpec as d, type HttpJsonRequest as e, type IntegrationHttp as f, type NormalizedEvent as g, type OAuth2ProviderSpec as h, type WebhookSecretAuthSpec as i, bindHttp as j, defineAction as k, defineIntegration as l, defineTrigger as m, httpJson as n };
import { JSONSchema7 } from 'json-schema';
import { MaybePromise } from '@agentskit/core';
interface HttpToolOptions {
baseUrl?: string;
/** Header bag merged into every request (auth, user-agent, etc.). */
headers?: Record<string, string>;
/** Per-request timeout in ms. Default 20_000. */
timeoutMs?: number;
/** Caller cancellation signal; composed with the internal timeout. */
signal?: AbortSignal;
/** Swap in a fake for tests. */
fetch?: typeof globalThis.fetch;
}
interface HttpJsonRequest {
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
path: string;
query?: Record<string, string | number | undefined>;
body?: unknown;
headers?: Record<string, string>;
}
/**
* Shared HTTP helper used by the service integrations. Handles query string
* encoding, JSON body + response parsing, timeouts, and turns non-2xx into
* throwable errors with the server payload attached.
*
* Auth lives entirely in `options.headers` — an action never sees the raw
* credential; the auth layer binds it before the action runs.
*/
declare function httpJson<TResult = unknown>(options: HttpToolOptions, request: HttpJsonRequest): Promise<TResult>;
/**
* An auth-bound HTTP client handed to every `IntegrationAction.execute`. The
* `baseUrl`, auth headers, and timeout are already applied — the action only
* supplies the per-request path/method/body.
*/
type IntegrationHttp = <TResult = unknown>(request: HttpJsonRequest) => Promise<TResult>;
/** Bind `httpJson` to a fixed set of options, producing an `IntegrationHttp`. */
declare function bindHttp(options: HttpToolOptions): IntegrationHttp;
type SideEffect = 'none' | 'read' | 'write' | 'destructive' | 'external';
/**
* Declarative OAuth2 provider spec — authorize/token endpoints, default scopes,
* PKCE flag, and any non-standard authorize params. The portable data an OAuth
* flow needs; the host owns the flow runner, token vault, and client secrets.
*/
interface OAuth2ProviderSpec {
authorizationUrl: string;
tokenUrl: string;
defaultScopes: string[];
usePkce: boolean;
/** Non-standard authorize params (e.g. Dropbox `token_access_type=offline`). */
extraAuthParams?: Record<string, string>;
}
interface OAuth2AuthSpec extends OAuth2ProviderSpec {
kind: 'oauth2';
}
interface ApiKeyAuthSpec {
kind: 'apiKey';
/** Header the credential is sent in (e.g. `authorization`). */
header: string;
/** Optional prefix, e.g. `Bearer ` or `token `. */
prefix?: string;
/** Hint for where the key is conventionally read from (docs/UX only). */
envHint?: string;
}
interface WebhookSecretAuthSpec {
kind: 'webhookSecret';
/** Signature scheme used to verify inbound webhooks. */
scheme: 'hmac-sha256' | 'ed25519' | 'custom';
}
interface NoAuthSpec {
kind: 'none';
}
type AuthSpec = OAuth2AuthSpec | ApiKeyAuthSpec | WebhookSecretAuthSpec | NoAuthSpec;
/**
* Execution context handed to every action. `http` covers the common
* REST-with-token case; `fetch` + `config` let complex services do their own
* transport (form-encoded bodies, Basic auth, injected SMTP/bot adapters).
*/
interface IntegrationActionContext {
/** Auth-bound JSON HTTP client (base URL + auth headers applied). */
http: IntegrationHttp;
/** Raw fetch for provider / non-JSON transports (not model-controlled URLs). */
fetch: typeof globalThis.fetch;
/**
* Host-injected, policy-enforcing transport for model-controlled URLs
* (SSRF egress gate). Distinct from `fetch`, which remains the provider path.
*/
fetchUntrusted?: typeof globalThis.fetch;
/** Service-specific config: extra credentials, injected adapters, options. */
config: unknown;
}
interface IntegrationAction {
/** Stable, namespaced id, e.g. `slack_post_message`. */
name: string;
description: string;
/** JSON Schema (canonical) for the action arguments. */
schema: JSONSchema7;
sideEffect?: SideEffect;
requiresConfirmation?: boolean;
/**
* SendCapability id this action fulfils when projected as an outbound
* connector sender (e.g. `chat.postMessage`). Absent = not a sender.
*/
sendCapability?: string;
execute: (args: Record<string, unknown>, ctx: IntegrationActionContext) => MaybePromise<unknown>;
}
interface WebhookInput {
/** Verification secret (signing secret / shared token). */
secret: string;
/** Raw, unparsed request body — required for signature verification. */
rawBody: string;
headers: Record<string, string>;
/** Override for replay-window checks; defaults to now. */
nowSeconds?: number;
requestUrl?: string;
}
type VerifyResult = {
ok: true;
} | {
ok: false;
reason: string;
};
/** External thread reference — basis for session stitching across turns. */
interface ExternalThreadRef {
kind: string;
id: string;
parentId?: string;
}
/** Provider payload normalized to a uniform shape before canonicalization. */
interface NormalizedEvent {
/** Provider event type, e.g. `message`, `issues.opened`. */
kind: string;
payload: unknown;
/** Untouched provider envelope, kept for replay/debug. */
raw?: unknown;
}
interface IntegrationTrigger {
/** Stable id, e.g. `slack.message`. */
name: string;
/** Canonical source slug — matches the OS IncomingEvent `source`. */
source: string;
/** Verify inbound signature. Omit only for unauthenticated sources. */
verify?: (input: WebhookInput) => VerifyResult;
/** Normalize a raw provider payload into a uniform event. */
normalize: (raw: unknown) => NormalizedEvent;
/** Extract a thread reference for session stitching, when available. */
externalThreadRef?: (raw: unknown) => ExternalThreadRef | undefined;
}
/**
* A single user-supplied configuration field for a service that authenticates
* with structured config rather than a single API key (e.g. Twilio's
* accountSid + authToken + fromNumber, Jira's baseUrl). Declarative so a host UI
* can render a connect form, and a host can validate before storing. Maps onto
* the `config` object passed to each action's `IntegrationActionContext`.
*/
interface ConfigField {
/** Key on the `config` object the actions read (e.g. `accountSid`). */
key: string;
/** Human label for the form field. */
label: string;
/** Render as a masked secret input + store in the vault. */
secret?: boolean;
/** The connector cannot operate without it. Defaults to required. */
required?: boolean;
/** Placeholder / example shown in the form. */
placeholder?: string;
}
interface Integration {
/** Service slug — matches the OS ConnectionKind, e.g. `slack`. */
name: string;
displayName: string;
categories: string[];
/** Shared transport facts applied to every action (base URL + default headers). */
http?: {
baseUrl: string;
headers?: Record<string, string>;
};
auth: AuthSpec;
/** OAuth2 flow spec, when the service supports an OAuth authorization-code
* flow (independent of the primary `auth`). The portable provider registry. */
oauth?: OAuth2ProviderSpec;
/** Structured-config fields a host UI captures to connect the service, when it
* authenticates with more than a single API key (Twilio, Jira, Stripe, …). */
configFields?: ConfigField[];
actions: IntegrationAction[];
triggers?: IntegrationTrigger[];
/** Pointers letting projections pick the canonical send/notify action. */
capabilities?: {
/** Action name used as the canonical outbound sender. */
send?: string;
/** Action name used as the canonical notification channel. */
notify?: string;
};
}
/** Define an integration descriptor (identity; anchors the type). */
declare function defineIntegration(integration: Integration): Integration;
/** Define a single action (identity; anchors the type). */
declare function defineAction(action: IntegrationAction): IntegrationAction;
/** Define a single trigger (identity; anchors the type). */
declare function defineTrigger(trigger: IntegrationTrigger): IntegrationTrigger;
export { type ApiKeyAuthSpec as A, type ConfigField as C, type ExternalThreadRef as E, type HttpToolOptions as H, type Integration as I, type NoAuthSpec as N, type OAuth2AuthSpec as O, type SideEffect as S, type VerifyResult as V, type WebhookInput as W, type IntegrationAction as a, type IntegrationActionContext as b, type IntegrationTrigger as c, type AuthSpec as d, type HttpJsonRequest as e, type IntegrationHttp as f, type NormalizedEvent as g, type OAuth2ProviderSpec as h, type WebhookSecretAuthSpec as i, bindHttp as j, defineAction as k, defineIntegration as l, defineTrigger as m, httpJson as n };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display