@tangle-network/agent-integrations 0.7.0 → 0.8.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 +151 -161
- package/dist/index.d.ts +184 -1
- package/dist/index.js +591 -0
- package/dist/index.js.map +1 -1
- package/docs/integration-coverage-checklist.md +2 -1
- package/docs/provider-decision-matrix.md +1 -3
- package/examples/basic-hub.ts +47 -0
- package/examples/declarative-rest.ts +27 -0
- package/examples/first-party-adapter.ts +32 -0
- package/package.json +2 -1
- package/docs/execution-layer-launch-plan.md +0 -222
|
@@ -77,7 +77,7 @@ The exhaustive checklist is generated from `integrationCoverageChecklistMarkdown
|
|
|
77
77
|
- HR/legal/signature: Workday, BambooHR, Greenhouse, Lever, Gusto, Rippling, DocuSign, Ironclad, Clio.
|
|
78
78
|
- AI/vector/workflow: OpenAI, Anthropic, Gemini, Hugging Face, Pinecone, Weaviate, Qdrant, Zapier, Make, Nango, Pipedream, Activepieces.
|
|
79
79
|
|
|
80
|
-
##
|
|
80
|
+
## Remaining Work
|
|
81
81
|
|
|
82
82
|
- [ ] Wire Builder to show Tier 0 missing connections from the coverage catalog.
|
|
83
83
|
- [ ] Add Gmail first-party adapter.
|
|
@@ -85,5 +85,6 @@ The exhaustive checklist is generated from `integrationCoverageChecklistMarkdown
|
|
|
85
85
|
- [x] Add Salesforce or Zendesk first-party adapter.
|
|
86
86
|
- [x] Add reusable declarative REST adapter factory.
|
|
87
87
|
- [x] Add Airtable, GitLab, and Asana via declarative REST.
|
|
88
|
+
- [x] Add generated integration setup specs, renderers, validation, and healthcheck plans.
|
|
88
89
|
- [ ] Add live smoke-test harness that skips only when explicit credentials are absent.
|
|
89
90
|
- [ ] Add gateway sync job for Nango/Pipedream/Activepieces metadata.
|
|
@@ -159,6 +159,4 @@ This avoids two bad extremes:
|
|
|
159
159
|
|
|
160
160
|
- locking the product into a vendor abstraction that becomes expensive and
|
|
161
161
|
limiting;
|
|
162
|
-
-
|
|
163
|
-
matter.
|
|
164
|
-
|
|
162
|
+
- cloning hundreds of integrations before knowing which ones matter.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InMemoryConnectionStore,
|
|
3
|
+
IntegrationHub,
|
|
4
|
+
buildIntegrationToolCatalog,
|
|
5
|
+
createMockIntegrationProvider,
|
|
6
|
+
searchIntegrationTools,
|
|
7
|
+
} from '@tangle-network/agent-integrations'
|
|
8
|
+
|
|
9
|
+
const provider = createMockIntegrationProvider()
|
|
10
|
+
const store = new InMemoryConnectionStore()
|
|
11
|
+
const hub = new IntegrationHub({
|
|
12
|
+
providers: [provider],
|
|
13
|
+
store,
|
|
14
|
+
capabilitySecret: 'replace-with-secret-manager-value',
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const tools = searchIntegrationTools(
|
|
18
|
+
buildIntegrationToolCatalog(await hub.listConnectors()),
|
|
19
|
+
'email search',
|
|
20
|
+
{ maxRisk: 'read' },
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const connection = await hub.upsertConnection({
|
|
24
|
+
id: 'conn_1',
|
|
25
|
+
owner: { type: 'user', id: 'user_1' },
|
|
26
|
+
providerId: 'mock',
|
|
27
|
+
connectorId: 'gmail',
|
|
28
|
+
status: 'active',
|
|
29
|
+
grantedScopes: ['email.read'],
|
|
30
|
+
createdAt: new Date().toISOString(),
|
|
31
|
+
updatedAt: new Date().toISOString(),
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const capability = await hub.issueCapability({
|
|
35
|
+
subject: { type: 'sandbox', id: 'sandbox_1' },
|
|
36
|
+
connectionId: connection.id,
|
|
37
|
+
scopes: ['email.read'],
|
|
38
|
+
allowedActions: [tools[0]!.tool.action.id],
|
|
39
|
+
ttlMs: 60_000,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const result = await hub.invokeWithCapability(capability.token, {
|
|
43
|
+
action: tools[0]!.tool.action.id,
|
|
44
|
+
input: { q: 'is:unread' },
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
console.log(result)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { declarativeRestConnector } from '@tangle-network/agent-integrations'
|
|
2
|
+
|
|
3
|
+
export const statusApiConnector = declarativeRestConnector({
|
|
4
|
+
kind: 'status-api',
|
|
5
|
+
displayName: 'Status API',
|
|
6
|
+
description: 'Read service health from an internal status endpoint.',
|
|
7
|
+
auth: { kind: 'api-key', hint: 'Status API token.' },
|
|
8
|
+
category: 'other',
|
|
9
|
+
defaultConsistencyModel: 'authoritative',
|
|
10
|
+
baseUrl: 'https://status.example.com/api',
|
|
11
|
+
capabilities: [
|
|
12
|
+
{
|
|
13
|
+
name: 'services.get',
|
|
14
|
+
class: 'read',
|
|
15
|
+
description: 'Read one service status.',
|
|
16
|
+
parameters: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: { serviceId: { type: 'string' } },
|
|
19
|
+
required: ['serviceId'],
|
|
20
|
+
},
|
|
21
|
+
request: {
|
|
22
|
+
method: 'GET',
|
|
23
|
+
path: '/services/{serviceId}',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createConnectorAdapterProvider,
|
|
3
|
+
githubConnector,
|
|
4
|
+
type IntegrationConnection,
|
|
5
|
+
type ResolvedDataSource,
|
|
6
|
+
} from '@tangle-network/agent-integrations'
|
|
7
|
+
|
|
8
|
+
const provider = createConnectorAdapterProvider({
|
|
9
|
+
adapters: [githubConnector],
|
|
10
|
+
resolveDataSource,
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const connectors = await provider.listConnectors()
|
|
14
|
+
console.log(connectors.map((connector) => connector.id))
|
|
15
|
+
|
|
16
|
+
async function resolveDataSource(connection: IntegrationConnection): Promise<ResolvedDataSource> {
|
|
17
|
+
return {
|
|
18
|
+
id: `source_${connection.id}`,
|
|
19
|
+
projectId: 'project_1',
|
|
20
|
+
publishedAgentId: null,
|
|
21
|
+
kind: connection.connectorId,
|
|
22
|
+
label: connection.connectorId,
|
|
23
|
+
consistencyModel: 'authoritative',
|
|
24
|
+
scopes: connection.grantedScopes,
|
|
25
|
+
metadata: {},
|
|
26
|
+
credentials: {
|
|
27
|
+
kind: 'api-key',
|
|
28
|
+
apiKey: process.env.GITHUB_TOKEN ?? '',
|
|
29
|
+
},
|
|
30
|
+
status: 'active',
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-integrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Vendor-neutral integration contracts and runtime helpers for sandbox and agent apps.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-integrations#readme",
|
|
6
6
|
"repository": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
25
|
"docs",
|
|
26
|
+
"examples",
|
|
26
27
|
"README.md"
|
|
27
28
|
],
|
|
28
29
|
"publishConfig": {
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
# Agent Integrations Execution Layer Launch Plan
|
|
2
|
-
|
|
3
|
-
## Goal
|
|
4
|
-
|
|
5
|
-
Make `agent-integrations` the shared execution layer for Tangle products, generated sandbox apps, and agents that need external systems.
|
|
6
|
-
|
|
7
|
-
The package should own the stable product contract for:
|
|
8
|
-
|
|
9
|
-
- connector catalog and tool discovery
|
|
10
|
-
- user/team-owned connections
|
|
11
|
-
- OAuth/API-key/HMAC connection flows
|
|
12
|
-
- short-lived sandbox-safe capabilities
|
|
13
|
-
- policy checks and approval gates
|
|
14
|
-
- action execution
|
|
15
|
-
- trigger/webhook normalization
|
|
16
|
-
- MCP/tool export surfaces
|
|
17
|
-
- first-party and vendor-backed provider adapters
|
|
18
|
-
|
|
19
|
-
The product value is direct: a user can ask Agent Builder to create an app that uses Gmail, Slack, Calendar, HubSpot, Stripe, Notion, or a webhook; the app can request the right connections; the sandbox receives only scoped capabilities; and every read, write, trigger, and approval is auditable.
|
|
20
|
-
|
|
21
|
-
## Current Status
|
|
22
|
-
|
|
23
|
-
Shipped:
|
|
24
|
-
|
|
25
|
-
- vendor-neutral `IntegrationHub`
|
|
26
|
-
- connection store contract
|
|
27
|
-
- short-lived signed capabilities
|
|
28
|
-
- action invocation with scope/action checks
|
|
29
|
-
- `IntegrationActionGuard` hook for idempotency, audit, rate limits, and approvals
|
|
30
|
-
- generic HTTP provider adapter for hosted gateways
|
|
31
|
-
- OAuth helper
|
|
32
|
-
- webhook signature helpers
|
|
33
|
-
- first-party adapter contracts
|
|
34
|
-
- first-party adapters for Google Calendar, Google Sheets, Microsoft Calendar, HubSpot, Slack, Notion, Twilio SMS, Stripe, generic webhooks, Slack events, and Stripe webhooks
|
|
35
|
-
- adapter manifest contract tests
|
|
36
|
-
|
|
37
|
-
Missing for full launch:
|
|
38
|
-
|
|
39
|
-
- typed, searchable tool catalog that agents can query by intent
|
|
40
|
-
- canonical policy engine with approval decisions, not only a hook
|
|
41
|
-
- approval request/result types and helpers
|
|
42
|
-
- MCP/tool-call export helpers
|
|
43
|
-
- runtime invocation envelope for sandboxes, with central validation for
|
|
44
|
-
tool/action consistency, idempotency keys, metadata shape, known-tool checks,
|
|
45
|
-
and input-size limits
|
|
46
|
-
- connection requirement planning for generated apps
|
|
47
|
-
- provider import pipeline for OpenAPI/GraphQL/MCP catalogs
|
|
48
|
-
- first-party provider registry that wraps `ConnectorAdapter[]` into `IntegrationProvider`
|
|
49
|
-
- live provider smoke tests for top connectors
|
|
50
|
-
- security hardening gates for secret redaction, scope minimization, replay, and writes
|
|
51
|
-
|
|
52
|
-
## Architecture Target
|
|
53
|
-
|
|
54
|
-
```txt
|
|
55
|
-
Generated app / agent / sandbox
|
|
56
|
-
-> Integration tool catalog search
|
|
57
|
-
-> connection requirements
|
|
58
|
-
-> user connects provider account
|
|
59
|
-
-> capability issued for sandbox/session
|
|
60
|
-
-> policy engine decides allow / approve / deny
|
|
61
|
-
-> action executor calls first-party or vendor-backed provider
|
|
62
|
-
-> audit event emitted
|
|
63
|
-
-> trigger receiver wakes sandbox workflows
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
`agent-integrations` owns contracts and reusable enforcement. Product repos own UI, tenant policy, persistence, and provider credentials.
|
|
67
|
-
|
|
68
|
-
## Tactical PR Sequence
|
|
69
|
-
|
|
70
|
-
### PR 1: Execution Plan
|
|
71
|
-
|
|
72
|
-
- Add this tracking doc.
|
|
73
|
-
|
|
74
|
-
Exit criteria:
|
|
75
|
-
|
|
76
|
-
- The repo has a durable, concrete launch map.
|
|
77
|
-
|
|
78
|
-
### PR 2: Catalog Search and Tool Export
|
|
79
|
-
|
|
80
|
-
- [x] Add `IntegrationToolDefinition`.
|
|
81
|
-
- [x] Add `buildIntegrationToolCatalog(connectors)`.
|
|
82
|
-
- [x] Add `searchIntegrationTools(catalog, query, filters)`.
|
|
83
|
-
- [x] Add `integrationToolName(providerId, connectorId, actionId)`.
|
|
84
|
-
- [x] Add `parseIntegrationToolName(name)`.
|
|
85
|
-
- [x] Add MCP-compatible tool export shape.
|
|
86
|
-
|
|
87
|
-
Exit criteria:
|
|
88
|
-
|
|
89
|
-
- Agents can discover tools by intent instead of stuffing every schema into context.
|
|
90
|
-
- Tool names round-trip deterministically to provider/connector/action.
|
|
91
|
-
|
|
92
|
-
### PR 3: Policy Engine and Approvals
|
|
93
|
-
|
|
94
|
-
- [x] Add `IntegrationPolicyRule`.
|
|
95
|
-
- [x] Add `IntegrationPolicyEngine`.
|
|
96
|
-
- [x] Add decision states: `allow`, `require_approval`, `deny`.
|
|
97
|
-
- [x] Add approval artifact types: `IntegrationApprovalRequest`, `IntegrationApprovalResolution`.
|
|
98
|
-
- [x] Add default policy: reads allowed, writes require approval by default, destructive denied unless explicitly allowed.
|
|
99
|
-
|
|
100
|
-
Exit criteria:
|
|
101
|
-
|
|
102
|
-
- Product apps can enforce a consistent approval boundary before any external write.
|
|
103
|
-
- Policy decisions include reasons and audit-safe metadata.
|
|
104
|
-
|
|
105
|
-
### PR 4: Sandbox Invocation Envelope
|
|
106
|
-
|
|
107
|
-
- [x] Add `IntegrationInvocationEnvelope`.
|
|
108
|
-
- [x] Add helper to build a sandbox-safe invocation request from a capability and tool call.
|
|
109
|
-
- [x] Add redaction helpers for logs/events.
|
|
110
|
-
- [x] Add action result normalization for conflict/rate-limit/approval states.
|
|
111
|
-
|
|
112
|
-
Exit criteria:
|
|
113
|
-
|
|
114
|
-
- Sandboxes can invoke integrations without ever receiving reusable provider credentials.
|
|
115
|
-
|
|
116
|
-
### PR 5: First-Party Provider Registry
|
|
117
|
-
|
|
118
|
-
- [x] Add `createConnectorAdapterProvider`.
|
|
119
|
-
- [x] Convert `ConnectorAdapter` manifests into `IntegrationConnector` catalog entries.
|
|
120
|
-
- [x] Route read/mutation calls to adapter methods.
|
|
121
|
-
- [x] Enforce capability class alignment and idempotency key defaults.
|
|
122
|
-
|
|
123
|
-
Exit criteria:
|
|
124
|
-
|
|
125
|
-
- The shipped first-party adapters become directly usable through `IntegrationHub`.
|
|
126
|
-
|
|
127
|
-
### PR 6: Catalog Importers
|
|
128
|
-
|
|
129
|
-
- [x] Add source importer contracts for OpenAPI, GraphQL, and MCP catalogs.
|
|
130
|
-
- [x] Add manifest normalization helpers.
|
|
131
|
-
- Add license-safe notes for importing MIT/open catalogs and deriving patterns from restricted-license systems.
|
|
132
|
-
|
|
133
|
-
Exit criteria:
|
|
134
|
-
|
|
135
|
-
- We can mine open-source catalogs and API specs without making product code vendor-shaped.
|
|
136
|
-
|
|
137
|
-
### PR 7: Launch Smoke Tests
|
|
138
|
-
|
|
139
|
-
- Add live-test harness contracts with environment-gated tests.
|
|
140
|
-
- Cover OAuth start/complete where practical.
|
|
141
|
-
- Cover reads, writes, approval-required writes, webhook verification, replay rejection, and scope denial.
|
|
142
|
-
|
|
143
|
-
Exit criteria:
|
|
144
|
-
|
|
145
|
-
- Top connectors have real non-mocked verification paths before public launch.
|
|
146
|
-
|
|
147
|
-
## First Provider Priorities
|
|
148
|
-
|
|
149
|
-
Tier 1 first-party:
|
|
150
|
-
|
|
151
|
-
- Gmail
|
|
152
|
-
- Google Calendar
|
|
153
|
-
- Slack
|
|
154
|
-
- GitHub
|
|
155
|
-
- Notion
|
|
156
|
-
- Stripe
|
|
157
|
-
- HubSpot
|
|
158
|
-
- Airtable
|
|
159
|
-
- Microsoft Calendar / Outlook
|
|
160
|
-
- Linear
|
|
161
|
-
|
|
162
|
-
Tier 2 first-party or vendor-backed:
|
|
163
|
-
|
|
164
|
-
- Google Sheets
|
|
165
|
-
- Google Drive
|
|
166
|
-
- Salesforce
|
|
167
|
-
- Zendesk
|
|
168
|
-
- Intercom
|
|
169
|
-
- Jira
|
|
170
|
-
- Asana
|
|
171
|
-
- Trello
|
|
172
|
-
- Resend
|
|
173
|
-
- Twilio
|
|
174
|
-
- Supabase
|
|
175
|
-
- Postgres
|
|
176
|
-
|
|
177
|
-
Long tail:
|
|
178
|
-
|
|
179
|
-
- Import from OpenAPI/GraphQL/MCP catalogs.
|
|
180
|
-
- Use vendor-backed providers only as coverage accelerators.
|
|
181
|
-
- Promote high-volume or high-trust integrations to first-party.
|
|
182
|
-
|
|
183
|
-
## OSS Mining Policy
|
|
184
|
-
|
|
185
|
-
Use permissively licensed projects aggressively, especially MIT and Apache-2.0.
|
|
186
|
-
|
|
187
|
-
Allowed:
|
|
188
|
-
|
|
189
|
-
- copy, fork, or port license-compatible code with attribution
|
|
190
|
-
- import connector definitions and catalog structure
|
|
191
|
-
- reuse MCP bridge and policy patterns where license permits
|
|
192
|
-
- derive architecture lessons from any public repo
|
|
193
|
-
|
|
194
|
-
Not allowed without explicit legal/product decision:
|
|
195
|
-
|
|
196
|
-
- copying restricted-license source into this package
|
|
197
|
-
- inheriting a vendor's auth, storage, tenancy, or billing model as our product contract
|
|
198
|
-
- exposing provider secrets to generated apps or sandboxes
|
|
199
|
-
|
|
200
|
-
Executor-style systems are priority inspiration for catalog, policy, MCP, and local/dev ergonomics. Nango-style systems are useful for OAuth, sync, and provider quirks, but restricted-license source should be treated as reference material rather than vendored code.
|
|
201
|
-
|
|
202
|
-
## Launch Gate Checklist
|
|
203
|
-
|
|
204
|
-
- [x] Tool catalog search works over first-party tools.
|
|
205
|
-
- [x] MCP-compatible tool export is stable.
|
|
206
|
-
- [x] Default policy engine gates writes and destructive actions.
|
|
207
|
-
- [x] Approval artifacts are typed and audit-safe.
|
|
208
|
-
- [x] Sandbox invocation envelope never contains provider credentials.
|
|
209
|
-
- [x] First-party adapters are callable through `IntegrationHub`.
|
|
210
|
-
- [x] Webhook receivers verify signatures and reject replay where provider supports timestamps.
|
|
211
|
-
- [x] Redaction helper covers connections, capabilities, approvals, and invocation logs.
|
|
212
|
-
- [ ] Agent Builder can declare required connectors from generated app specs.
|
|
213
|
-
- [ ] Agent Builder can ask users to connect missing accounts.
|
|
214
|
-
- [ ] Agent Builder can pass scoped capabilities to generated sandbox apps.
|
|
215
|
-
- [ ] Generated sandbox apps can call integrations through the runtime envelope.
|
|
216
|
-
- [ ] Human approval flow exists for writes.
|
|
217
|
-
- [ ] Top provider live smoke tests are documented and environment-gated.
|
|
218
|
-
- [ ] Package README explains the concrete product UX, not only abstractions.
|
|
219
|
-
|
|
220
|
-
## Definition Of Done
|
|
221
|
-
|
|
222
|
-
The package is launch-ready when Agent Builder can generate an app that needs at least Gmail, Slack, Calendar, or Stripe; the user can connect the account; the app runs in a sandbox with a scoped capability; reads execute without extra user friction; writes pause for approval; triggers can wake workflows; and every step is observable without leaking secrets.
|