@tangle-network/agent-integrations 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/dist/index.d.ts +554 -54
- package/dist/index.js +1271 -190
- package/dist/index.js.map +1 -1
- package/docs/architecture.md +7 -0
- package/docs/production-completion-checklist.md +63 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,13 @@ agent-facing tool contract.
|
|
|
40
40
|
pretending every catalog item is executable.
|
|
41
41
|
- A canonical registry that deduplicates overlapping catalogs, keeps support
|
|
42
42
|
tiers explicit, and reports auth/category conflicts.
|
|
43
|
+
- App/agent manifests, grants, and sandbox bundles so Builder, generated apps,
|
|
44
|
+
vertical agents, Blueprint Agent, and executor-backed runtimes can reuse the
|
|
45
|
+
same user-owned connections safely.
|
|
46
|
+
- Workflow trigger installation and normalized event dispatch for non-agent UI
|
|
47
|
+
automation, sync jobs, webhooks, and product workflows.
|
|
48
|
+
- Approval persistence, audit events, healthchecks, credential resolution,
|
|
49
|
+
webhook ingestion, idempotency guards, and sandbox/CLI bridge payloads.
|
|
43
50
|
- A generated `IntegrationSpec` registry used for setup docs, admin UI steps,
|
|
44
51
|
normalized permissions, healthcheck plans, and tool descriptions.
|
|
45
52
|
|
|
@@ -77,6 +84,16 @@ pnpm add @tangle-network/agent-integrations
|
|
|
77
84
|
| `IntegrationConnection` | User/team/agent-owned grant with scopes and secret references. |
|
|
78
85
|
| `IntegrationHub` | Facade for provider catalogs, connection storage, capabilities, and invocation. |
|
|
79
86
|
| `IntegrationCapability` | Short-lived authorization for a specific subject, connection, scope set, and action set. |
|
|
87
|
+
| `IntegrationManifest` | Generated app or agent requirements: connectors, actions, scopes, and reasons. |
|
|
88
|
+
| `IntegrationGrant` | Persistent grant from a user-owned connection to an app, agent, or sandbox consumer. |
|
|
89
|
+
| `createIntegrationRuntime` | Facade for manifest resolution, grant creation, and sandbox capability bundles. |
|
|
90
|
+
| `createIntegrationWorkflowRuntime` | Installs trigger workflows and dispatches normalized provider events. |
|
|
91
|
+
| `createApprovalBackedPolicyEngine` | Persists approval requests and allows approved invocations to resume. |
|
|
92
|
+
| `createDefaultIntegrationActionGuard` | Adds idempotency replay, dry-run mutation handling, rate-limit hooks, and audit events. |
|
|
93
|
+
| `createConnectionCredentialResolver` | Resolves secret refs into in-memory connector credentials and refreshes expired OAuth credentials. |
|
|
94
|
+
| `runIntegrationHealthchecks` | Checks connection status, registry executability, scope shape, and optional live provider tests. |
|
|
95
|
+
| `receiveIntegrationWebhook` | Verifies inbound webhooks, dedupes provider events, and dispatches normalized trigger events. |
|
|
96
|
+
| `buildIntegrationBridgeEnvironment` | Encodes scoped sandbox capabilities for sandbox processes or executor-style CLIs. |
|
|
80
97
|
| `buildIntegrationToolCatalog` | Converts connector actions into agent/tool definitions. |
|
|
81
98
|
| `searchIntegrationTools` | Intent search over normalized integration tools. |
|
|
82
99
|
| `buildDefaultIntegrationRegistry` | Composes setup specs and vendored catalog metadata into one deduplicated connector registry. |
|
|
@@ -109,6 +126,47 @@ catalogOnly < setupReady < gatewayExecutable < firstPartyExecutable < sandboxExe
|
|
|
109
126
|
|
|
110
127
|
See [Catalog Registry](./docs/catalog-registry.md).
|
|
111
128
|
|
|
129
|
+
## App And Agent Grants
|
|
130
|
+
|
|
131
|
+
Use `IntegrationManifest` for any app or agent that needs integrations:
|
|
132
|
+
Agent Builder-generated apps, tax/legal/GTM/creative agents, Blueprint Agent
|
|
133
|
+
sandboxes, and executor-backed workflows all use the same shape.
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
const runtime = createIntegrationRuntime({ hub, grants })
|
|
137
|
+
|
|
138
|
+
const resolution = await runtime.resolveManifest(manifest, user)
|
|
139
|
+
const grants = await runtime.createGrants({
|
|
140
|
+
manifest,
|
|
141
|
+
owner: user,
|
|
142
|
+
grantee: { type: 'app', id: manifest.id },
|
|
143
|
+
})
|
|
144
|
+
const bundle = await runtime.buildSandboxBundle({
|
|
145
|
+
manifestId: manifest.id,
|
|
146
|
+
subject: { type: 'sandbox', id: sandboxId },
|
|
147
|
+
ttlMs: 15 * 60_000,
|
|
148
|
+
})
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Generated apps and sandboxes receive scoped capability tokens and tool
|
|
152
|
+
definitions. They never receive OAuth refresh tokens, API keys, or raw secrets.
|
|
153
|
+
For sandbox processes, pass the bundle through `buildIntegrationBridgeEnvironment()`;
|
|
154
|
+
the payload contains short-lived capability tokens and tool names only.
|
|
155
|
+
|
|
156
|
+
The same manifest/grant model works for non-agent workflows:
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
await workflows.install({
|
|
160
|
+
workflow,
|
|
161
|
+
owner: user,
|
|
162
|
+
grantee: { type: 'app', id: 'github-pr-sync' },
|
|
163
|
+
})
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
That installs provider trigger subscriptions against the user's connection and
|
|
167
|
+
lets the product dispatch normalized events to UI workflows, sync jobs, or
|
|
168
|
+
agent runs.
|
|
169
|
+
|
|
112
170
|
## Provider Strategy
|
|
113
171
|
|
|
114
172
|
The package deliberately avoids vendor lock-in.
|
|
@@ -166,9 +224,14 @@ without obscuring the package contract.
|
|
|
166
224
|
- Capability tokens expire.
|
|
167
225
|
- Capability tokens do not contain provider credentials.
|
|
168
226
|
- Connection records carry secret references, not raw secrets.
|
|
227
|
+
- Secret stores are consumer-pluggable; the package only resolves secret refs at
|
|
228
|
+
call time and keeps raw credentials in memory.
|
|
169
229
|
- Write and destructive actions can require approval.
|
|
230
|
+
- Approval records are bound to the subject, connection, connector, and action.
|
|
231
|
+
- Default guards provide idempotency replay and same-key drift detection.
|
|
170
232
|
- Invocation envelopes validate action/tool consistency, idempotency keys,
|
|
171
233
|
metadata shape, known tools, and input size.
|
|
234
|
+
- Webhook ingestion supports signature verification and provider-event dedupe.
|
|
172
235
|
- Action invocation checks ownership, connection status, scopes, allowed actions,
|
|
173
236
|
and expiration.
|
|
174
237
|
- `IntegrationActionGuard` can enforce idempotency, approval, audit logging,
|