# veryfront/integrations

## Import

```ts
import {
  createIntegrationClient,
  createIntegrationErrorContext,
  createLocalIntegrationToolSource,
  createOutlookServiceAccountToolSource,
  createSalesforceServiceAccountToolSource,
  getConnector,
} from "veryfront/integrations";
```

## Examples

```ts
import {
  createSalesforceServiceAccountToolSource,
  getConnector,
  getIcon,
  getRemoteIntegrationToolDefinitions,
  getRemoteIntegrationToolDiscovery,
  listConnectors,
} from "veryfront/integrations";

const connectors = listConnectors();
const slack = getConnector("slack");
const slackIcon = getIcon("slack"); // raw SVG string
const discovery = await getRemoteIntegrationToolDiscovery();
const runtimeTools = await getRemoteIntegrationToolDefinitions();
```

## Exports

### Components

| Name                                         | Description                                                                            | Source                                                                                                         |
| -------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `EnvVarSchema`                               | Zod schema for env var.                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationConfigSchema`                    | Zod schema for integration config.                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationEndpointHistoricalSummarySchema` |                                                                                        | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationNameSchema`                      | Zod schema for integration name.                                                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationPromptSchema`                    | Zod schema for integration prompt.                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationToolSchema`                      | Zod schema for integration tool.                                                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `MAX_REMOTE_INTEGRATION_TOOL_NAME_LENGTH`    | Runtime tool names use the same ceiling as the agent invocation contract.              | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/limits.ts)                     |
| `OAuthConfigSchema`                          | Zod schema for oauth config.                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `OAuthFieldSchema`                           | Zod schema for oauth field.                                                            | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `OUTLOOK_SERVICE_ACCOUNT_ENV_VARS`           | Project environment variables required by the local Outlook service-account source.    | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/outlook-service-account.ts)    |
| `SALESFORCE_SERVICE_ACCOUNT_ENV_VARS`        | Project environment variables required by the local Salesforce service-account source. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/salesforce-service-account.ts) |

### Functions

| Name                                       | Description                                                                                                                                                                                                                                                                             | Source                                                                                                         |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `createIntegrationClient`                  | Bind explicit API credentials and an authorized project for catalog, status and tool calls. Requires the API expected-project precondition and effective-project response header contract. This client does not infer consent completion or executable readiness from connected status. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client.ts)                     |
| `createIntegrationErrorContext`            |                                                                                                                                                                                                                                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts)              |
| `createLocalIntegrationToolSource`         | Create an explicitly granted, catalog-backed local integration tool source.                                                                                                                                                                                                             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/local-tool-source.ts)          |
| `createOutlookServiceAccountToolSource`    | Create a local Outlook source that uses Microsoft Entra app-only (client-credentials) access for one configured mailbox.                                                                                                                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/outlook-service-account.ts)    |
| `createSalesforceServiceAccountToolSource` | Create a local Salesforce service-account tool source.                                                                                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/salesforce-service-account.ts) |
| `executeRemoteIntegrationTool`             | Deprecated alias of `runRemoteIntegrationTool`.                                                                                                                                                                                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/remote-tools.ts)               |
| `getConnector`                             | Return connector.                                                                                                                                                                                                                                                                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/index.ts)                      |
| `getConnectorNames`                        | Return connector names.                                                                                                                                                                                                                                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/index.ts)                      |
| `getIcon`                                  | Return icon.                                                                                                                                                                                                                                                                            | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/index.ts)                      |
| `getRemoteIntegrationToolDefinitions`      | Fetch integration tool definitions for the current request context.                                                                                                                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/remote-tools.ts)               |
| `getRemoteIntegrationToolDiscovery`        | Discover integration tools for the current request context.                                                                                                                                                                                                                             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/remote-tools.ts)               |
| `isIntegrationErrorContext`                | Recognizes only an own data discriminator; validation still occurs before serialization.                                                                                                                                                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts)              |
| `isRemoteIntegrationTool`                  | Check if a tool name looks like a remote integration tool. Integration tools use "integration\_\_tool\_id" format (double underscore separator).                                                                                                                                        | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/remote-tools.ts)               |
| `listConnectors`                           | List connectors.                                                                                                                                                                                                                                                                        | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/index.ts)                      |
| `parseIntegrationToolIdentity`             | Parse the canonical API tool name (`integration__tool_id`). Aliases and alternate separators are intentionally not accepted at this policy layer.                                                                                                                                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/source-policy.ts)              |
| `readIntegrationErrorContext`              | Copy only validated safe facts. Accessors, prototypes, extensions and native payloads are excluded.                                                                                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts)              |
| `readIntegrationThrowableContext`          | Read only an own data context from the original throwable; generic boundaries discard it.                                                                                                                                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts)              |
| `runRemoteIntegrationTool`                 | Run a remote integration tool via the API. Called by the agent runtime when a tool isn't found in the local registry. The request, response, and caller-supplied cancellation signal remain bounded for the complete network and response-body lifecycle.                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/remote-tools.ts)               |

### Classes

| Name                  | Description                                                            | Source                                                                                     |
| --------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `IntegrationApiError` | A bounded API failure. Call failures never authorize automatic replay. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client.ts) |

### Types

| Name                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Source                                                                                                         |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `ConnectionDeletion`                        | A deleted connection. `providerRevoked` is false when the provider did not confirm revocation.                                                                                                                                                                                                                                                                                                                                                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `ConnectionRequestOptions`                  | Options for `getConnectionStatus` and `deleteConnection`.                                                                                                                                                                                                                                                                                                                                                                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `ConnectionStatus`                          | Whether an integration is connected for one owner. Not connected is a result, not an error.                                                                                                                                                                                                                                                                                                                                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `ConnectSession`                            | One-time link that starts provider consent. `connectUrl` and `sessionToken` are accessible but excluded from default serialization.                                                                                                                                                                                                                                                                                                                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `CreateConnectSessionOptions`               | Options for `createConnectSession`.                                                                                                                                                                                                                                                                                                                                                                                                                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `EnvVarConfig`                              | Configuration used by env var.                                                                                                                                                                                                                                                                                                                                                                                                                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationCallOptions`                    | Selection metadata for a tool call, separate from native provider arguments. The API must advertise generation-precondition support. Unsupported deployments throw `IntegrationApiError` with kind `unsupported_precondition` and `outcomeUnknown: false` before dispatch. Missing confirmation after a successful call response reports the same kind with `outcomeUnknown: true`. Calls never authorize automatic replay. Omitting the generation retains existing call behavior. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationCallOutcome`                    | The native envelope is retained for both successful execution and tool failure.                                                                                                                                                                                                                                                                                                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationCatalogEntry`                   | Integration catalog summary; additional native metadata is retained.                                                                                                                                                                                                                                                                                                                                                                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationClient`                         | Project-bound primitives. Iterators use a bounded deadline and fail rather than silently truncate.                                                                                                                                                                                                                                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationClientConnection`               | A visible connection row, not an assertion of provider permission or tool readiness.                                                                                                                                                                                                                                                                                                                                                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationClientContext`                  | Explicit caller-owned context. Credentials are never inferred from runtime globals.                                                                                                                                                                                                                                                                                                                                                                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationClientTool`                     | Authored tool schema and native discovery metadata.                                                                                                                                                                                                                                                                                                                                                                                                                                 | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationConfig`                         | Configuration used by integration.                                                                                                                                                                                                                                                                                                                                                                                                                                                  | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationConnectionStatus`               | The legacy OAuth status shape, with the requested scope recorded by the client.                                                                                                                                                                                                                                                                                                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationConnectionWaitOptions`          | Bounded wait for consent completion. Read `status()` before starting consent and pass it as `before`, so the unchanged prior connection is never mistaken for the new one. The baseline must include the same scope, as recorded by `status()`.                                                                                                                                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationConnectionWaitOutcome`          | `connection_observed` requires a connected status whose connection id and generation differ from `before` and match a connected row of the requested scope. It confirms the stored connection, not provider permission or tool readiness.                                                                                                                                                                                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationConnectOptions`                 | Connect options. Scope defaults to personal user ownership, never silently project scope.                                                                                                                                                                                                                                                                                                                                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationConnector`                      | Public API contract for integration connector.                                                                                                                                                                                                                                                                                                                                                                                                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/types.ts)                      |
| `IntegrationConnectOutcome`                 | Catalog setup facts do not establish effective project credentials or tool readiness.                                                                                                                                                                                                                                                                                                                                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationDetails`                        | Connector setup requirements and native catalog details.                                                                                                                                                                                                                                                                                                                                                                                                                            | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationEndpointHistoricalSummary`      | Provider-declared summary contract for old tool outputs kept actionable across turns.                                                                                                                                                                                                                                                                                                                                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationFailureCondition`               | Safe condition metadata supplied by the integration API.                                                                                                                                                                                                                                                                                                                                                                                                                            | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/integration-condition.ts)      |
| `IntegrationHttpProblem`                    | Validated HTTP Problem identity without an assertion about server retryability.                                                                                                                                                                                                                                                                                                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/integration-condition.ts)      |
| `IntegrationJsonObject`                     | Data-only JSON retained without renaming provider fields. Response byte limits follow the endpoint transport budget; authored arguments retain stricter generic limits.                                                                                                                                                                                                                                                                                                             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationName`                           | Public API contract for integration name.                                                                                                                                                                                                                                                                                                                                                                                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationOAuthHandoff`                   | One-time browser handoff. connect\_url is accessible but excluded from default serialization.                                                                                                                                                                                                                                                                                                                                                                                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationPrompt`                         | Public API contract for integration prompt.                                                                                                                                                                                                                                                                                                                                                                                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationSelectedReadiness`              | Metadata-only selected-tool evidence. Provider authorization is never implied.                                                                                                                                                                                                                                                                                                                                                                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/readiness.ts)                  |
| `IntegrationSelectionOptions`               | Select a saved connection and optionally pin its observed generation.                                                                                                                                                                                                                                                                                                                                                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `IntegrationTool`                           | Public API contract for integration tool.                                                                                                                                                                                                                                                                                                                                                                                                                                           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/types.ts)                      |
| `IntegrationToolMeta`                       | Public API contract for integration tool meta.                                                                                                                                                                                                                                                                                                                                                                                                                                      | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `IntegrationToolResult`                     | Native tool envelope, including multimedia, resources and extension metadata.                                                                                                                                                                                                                                                                                                                                                                                                       | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/client-types.ts)               |
| `LocalIntegrationCredentialProvider`        | Resolve one local integration credential by its canonical environment-variable name.                                                                                                                                                                                                                                                                                                                                                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/local-tool-source.ts)          |
| `LocalIntegrationToolSourceOptions`         | Options for a catalog-backed local integration tool source.                                                                                                                                                                                                                                                                                                                                                                                                                         | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/local-tool-source.ts)          |
| `OAuthConfig`                               | Configuration used by oauth.                                                                                                                                                                                                                                                                                                                                                                                                                                                        | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `OAuthField`                                | Public API contract for oauth field.                                                                                                                                                                                                                                                                                                                                                                                                                                                | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/schema.ts)                     |
| `OutlookAttachmentContent`                  | Raw attachment content, ready for `planFileParts` or `fileFromBytes`.                                                                                                                                                                                                                                                                                                                                                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/outlook-service-account.ts)    |
| `OutlookAttachmentContentArgs`              | Arguments for `OutlookServiceAccountToolSource.readAttachment`.                                                                                                                                                                                                                                                                                                                                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/outlook-service-account.ts)    |
| `OutlookServiceAccountToolSource`           | The local Outlook service-account source, plus a raw attachment reader.                                                                                                                                                                                                                                                                                                                                                                                                             | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/outlook-service-account.ts)    |
| `OutlookServiceAccountToolSourceOptions`    | Options for the local Outlook service-account source.                                                                                                                                                                                                                                                                                                                                                                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/outlook-service-account.ts)    |
| `RemoteIntegrationToolDiscoveryResult`      | Result of listing the integration tools available to the current run.                                                                                                                                                                                                                                                                                                                                                                                                               | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/remote-tools.ts)               |
| `SalesforceServiceAccountToolSourceOptions` | Options for the local Salesforce service-account source.                                                                                                                                                                                                                                                                                                                                                                                                                            | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/salesforce-service-account.ts) |

## Deep imports

These import paths group focused functionality under this module. Each is a separate barrel; import only what you need.

### `veryfront/integrations/diagnostics`

Synchronous safe-fact projection for integration operation failures. Readers exclude accessors, native payloads and unrecognized fields. Diagnostic metadata never authorizes automatic replay of an integration operation.

```ts
import {
  createIntegrationErrorContext,
  isIntegrationErrorContext,
  readIntegrationErrorContext,
} from "veryfront/integrations/diagnostics";
```

#### Functions

| Name                              | Description                                                                                         | Source                                                                                            |
| --------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `createIntegrationErrorContext`   |                                                                                                     | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts) |
| `isIntegrationErrorContext`       | Recognizes only an own data discriminator; validation still occurs before serialization.            | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts) |
| `readIntegrationErrorContext`     | Copy only validated safe facts. Accessors, prototypes, extensions and native payloads are excluded. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts) |
| `readIntegrationThrowableContext` | Read only an own data context from the original throwable; generic boundaries discard it.           | [source](https://github.com/veryfront/veryfront-code/blob/main/src/integrations/error-context.ts) |
