@tangle-network/agent-integrations 0.14.0 → 0.16.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 +42 -0
- package/dist/index.d.ts +793 -323
- package/dist/index.js +1743 -366
- package/dist/index.js.map +1 -1
- package/docs/architecture.md +7 -0
- package/docs/production-completion-checklist.md +63 -0
- package/docs/repo-structure.md +47 -0
- package/examples/calendar-exercise-app.ts +78 -0
- package/package.json +1 -1
package/docs/architecture.md
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
- connection store interface
|
|
17
17
|
- sandbox-safe capability token minting and verification
|
|
18
18
|
- invocation policy enforcement
|
|
19
|
+
- approval persistence contracts and resume helpers
|
|
20
|
+
- audit, idempotency, healthcheck, and webhook-ingestion primitives
|
|
21
|
+
- credential resolver interfaces over product-owned vaults
|
|
22
|
+
- sandbox/CLI bridge payloads for scoped capabilities
|
|
19
23
|
- event normalization
|
|
20
24
|
- redaction helpers
|
|
21
25
|
|
|
@@ -44,3 +48,6 @@ Product apps own:
|
|
|
44
48
|
- Agents can invoke only actions allowed by that capability.
|
|
45
49
|
- Triggers can wake or enqueue sandbox workflows without exposing credentials.
|
|
46
50
|
- Audit logs can show what happened without leaking secrets.
|
|
51
|
+
- Writes can pause for approval, resume by approval id, and replay safely by
|
|
52
|
+
idempotency key.
|
|
53
|
+
- Products can healthcheck connections and ingest webhooks with dedupe.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Production Completion Checklist
|
|
2
|
+
|
|
3
|
+
This is the library-owned done bar for `agent-integrations`. Product repos still
|
|
4
|
+
own UI, DB adapters, vault deployment, enabled-connector policy, and live
|
|
5
|
+
provider credentials.
|
|
6
|
+
|
|
7
|
+
## Complete In This Package
|
|
8
|
+
|
|
9
|
+
- [x] Normalized connector, action, trigger, connection, and capability types.
|
|
10
|
+
- [x] Vendor-neutral `IntegrationHub` facade for provider catalogs, auth,
|
|
11
|
+
connections, scoped capability issue/verify, and action invocation.
|
|
12
|
+
- [x] First-party connector adapter boundary and declarative REST adapter path.
|
|
13
|
+
- [x] Generated setup specs and runbook/admin-UI renderers.
|
|
14
|
+
- [x] Canonical registry that dedupes setup specs, first-party adapters,
|
|
15
|
+
gateway catalogs, and long-tail catalog metadata.
|
|
16
|
+
- [x] Catalog-only safety: long-tail metadata is discoverable but not callable
|
|
17
|
+
unless promoted to an executable support tier.
|
|
18
|
+
- [x] App/agent `IntegrationManifest` resolution against user connections.
|
|
19
|
+
- [x] Persistent grants from user-owned connections to apps, agents, sandboxes,
|
|
20
|
+
and generated software.
|
|
21
|
+
- [x] Sandbox bundles with short-lived capability tokens and tool definitions.
|
|
22
|
+
- [x] Bridge payload/env helpers for sandbox processes and executor-style CLIs.
|
|
23
|
+
- [x] Sandbox invocation host that validates envelopes before hub invocation and
|
|
24
|
+
normalizes success, failure, and approval-required results.
|
|
25
|
+
- [x] Policy engine for allow/deny/approval decisions.
|
|
26
|
+
- [x] Approval store and approval-backed policy resume path.
|
|
27
|
+
- [x] Idempotency guard with replay, same-key drift detection, dry-run mutation
|
|
28
|
+
handling, optional rate-limit hook, and audit records.
|
|
29
|
+
- [x] Audit event store/sink and redaction helpers.
|
|
30
|
+
- [x] Healthcheck primitives for connection status, executable tier, scope
|
|
31
|
+
shape, and optional live provider tests.
|
|
32
|
+
- [x] Credential resolver and secret-store interface for resolving secret refs,
|
|
33
|
+
refreshing expired OAuth credentials, and revoking connections.
|
|
34
|
+
- [x] Workflow runtime for trigger subscription install and normalized event
|
|
35
|
+
dispatch.
|
|
36
|
+
- [x] Webhook ingestion runtime for signature checks, provider-event dedupe, and
|
|
37
|
+
workflow dispatch.
|
|
38
|
+
- [x] Focused tests for hub, registry, runtime grants, workflow triggers,
|
|
39
|
+
sandbox invocation, approval resume, idempotency, credentials,
|
|
40
|
+
healthchecks, bridge payloads, and webhook dedupe.
|
|
41
|
+
|
|
42
|
+
## Product Integration Checklist
|
|
43
|
+
|
|
44
|
+
- [ ] Persist `IntegrationConnection`, `IntegrationGrant`, approval, audit,
|
|
45
|
+
healthcheck, workflow, and event stores in the product database.
|
|
46
|
+
- [ ] Back `IntegrationSecretStore` with the production vault/KMS.
|
|
47
|
+
- [ ] Add OAuth/API-key setup UI from `IntegrationSpec` renderers.
|
|
48
|
+
- [ ] Add connect, approve, revoke, rotate, healthcheck, and audit-log screens.
|
|
49
|
+
- [ ] Feed generated app requirements into `IntegrationManifest`.
|
|
50
|
+
- [ ] Inject `buildIntegrationBridgeEnvironment()` into sandbox launches.
|
|
51
|
+
- [ ] Route sandbox tool calls through `dispatchIntegrationInvocation()`.
|
|
52
|
+
- [ ] Run live OAuth and browser E2E tests for each shipped product.
|
|
53
|
+
|
|
54
|
+
## Executor.sh And Sandbox CLIs
|
|
55
|
+
|
|
56
|
+
Executor-style CLIs are an execution layer, not the integration source of truth.
|
|
57
|
+
They can consume this package cleanly by receiving the bridge env payload inside
|
|
58
|
+
the sandbox and calling back to the product integration hub with capability
|
|
59
|
+
tokens. The CLI never needs OAuth refresh tokens or provider API keys.
|
|
60
|
+
|
|
61
|
+
Use executor-style tooling when it improves sandbox process orchestration,
|
|
62
|
+
command execution, or workflow hosting. Do not make it the credential broker or
|
|
63
|
+
canonical connector registry unless a product explicitly chooses that provider.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Repository Structure
|
|
2
|
+
|
|
3
|
+
This repo intentionally separates catalog breadth from executable runtime code.
|
|
4
|
+
|
|
5
|
+
## Source
|
|
6
|
+
|
|
7
|
+
- `src/index.ts` exports the public package surface.
|
|
8
|
+
- `src/actions.ts` defines canonical launch action ids and schemas for the
|
|
9
|
+
first product-ready connectors.
|
|
10
|
+
- `src/client.ts` is the tiny generated-app/sandbox client over platform
|
|
11
|
+
`/v1/integrations/invoke`.
|
|
12
|
+
- `src/manifest.ts` validates and infers `IntegrationManifest` values.
|
|
13
|
+
- `src/consent.ts` renders user-facing consent/approval copy from manifests.
|
|
14
|
+
- `src/runtime.ts` resolves manifests, creates grants, and builds sandbox
|
|
15
|
+
bundles.
|
|
16
|
+
- `src/bridge.ts` encodes scoped sandbox/CLI bridge payloads.
|
|
17
|
+
- `src/sandbox.ts` validates sandbox invocation envelopes and normalizes
|
|
18
|
+
invocation results.
|
|
19
|
+
- `src/policy.ts`, `src/presets.ts`, `src/approval.ts`, `src/guard.ts`,
|
|
20
|
+
`src/audit.ts`, `src/healthcheck.ts`, `src/credentials.ts`, and
|
|
21
|
+
`src/events.ts` are production control-plane primitives.
|
|
22
|
+
- `src/connectors/` contains first-party adapter contracts and implementations.
|
|
23
|
+
- `src/specs/` is the structured OAuth/setup/runbook source of truth.
|
|
24
|
+
- `src/registry.ts`, `src/gateway-catalog.ts`, `src/coverage-catalog.ts`, and
|
|
25
|
+
`src/activepieces-catalog.ts` compose broad connector catalogs without
|
|
26
|
+
pretending catalog-only entries are executable.
|
|
27
|
+
|
|
28
|
+
## Data
|
|
29
|
+
|
|
30
|
+
- `data/activepieces-catalog.json` is large by design. It is lazy-loaded and
|
|
31
|
+
keeps long-tail discovery out of TypeScript source so `tsc --watch` does not
|
|
32
|
+
re-check a generated 40k-line module. It is catalog metadata, not executable
|
|
33
|
+
support.
|
|
34
|
+
|
|
35
|
+
## Build Artifacts
|
|
36
|
+
|
|
37
|
+
- `dist/` is published because the package ships compiled ESM and `.d.ts`
|
|
38
|
+
files to npm.
|
|
39
|
+
- `node_modules/` is local development state and is not published.
|
|
40
|
+
|
|
41
|
+
## Docs
|
|
42
|
+
|
|
43
|
+
- `docs/production-completion-checklist.md` defines what this package owns and
|
|
44
|
+
what product repos must still implement.
|
|
45
|
+
- `docs/catalog-registry.md` explains support tiers.
|
|
46
|
+
- `docs/provider-decision-matrix.md` explains when to use first-party adapters,
|
|
47
|
+
gateway providers, or catalog-only metadata.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CANONICAL_INTEGRATION_ACTIONS,
|
|
3
|
+
buildIntegrationBridgeEnvironment,
|
|
4
|
+
calendarExercisePlannerManifest,
|
|
5
|
+
createTangleIntegrationsClient,
|
|
6
|
+
renderConsentSummary,
|
|
7
|
+
type IntegrationSandboxBundle,
|
|
8
|
+
} from '../src/index.js'
|
|
9
|
+
|
|
10
|
+
const manifest = calendarExercisePlannerManifest()
|
|
11
|
+
const consent = renderConsentSummary(manifest, { appName: 'Exercise Planner' })
|
|
12
|
+
|
|
13
|
+
console.log(consent.body)
|
|
14
|
+
|
|
15
|
+
// In production this bundle comes from id.tangle.tools after the user grants
|
|
16
|
+
// the generated app access to their Google Calendar connection.
|
|
17
|
+
const bundle: IntegrationSandboxBundle = {
|
|
18
|
+
manifestId: manifest.id,
|
|
19
|
+
subject: { type: 'sandbox', id: 'sandbox_preview_1' },
|
|
20
|
+
connectors: [],
|
|
21
|
+
expiresAt: new Date(Date.now() + 15 * 60_000).toISOString(),
|
|
22
|
+
capabilities: [{
|
|
23
|
+
requirementId: 'calendar-read',
|
|
24
|
+
connectorId: 'google-calendar',
|
|
25
|
+
connectionId: 'conn_google_calendar',
|
|
26
|
+
grantId: 'grant_calendar_read',
|
|
27
|
+
scopes: ['https://www.googleapis.com/auth/calendar.readonly'],
|
|
28
|
+
allowedActions: [CANONICAL_INTEGRATION_ACTIONS.googleCalendarEventsList],
|
|
29
|
+
allowedTriggers: [],
|
|
30
|
+
capability: {
|
|
31
|
+
capability: {
|
|
32
|
+
id: 'cap_calendar_read',
|
|
33
|
+
subject: { type: 'sandbox', id: 'sandbox_preview_1' },
|
|
34
|
+
connectionId: 'conn_google_calendar',
|
|
35
|
+
scopes: ['https://www.googleapis.com/auth/calendar.readonly'],
|
|
36
|
+
allowedActions: [CANONICAL_INTEGRATION_ACTIONS.googleCalendarEventsList],
|
|
37
|
+
issuedAt: new Date().toISOString(),
|
|
38
|
+
expiresAt: new Date(Date.now() + 15 * 60_000).toISOString(),
|
|
39
|
+
},
|
|
40
|
+
token: 'short-lived-capability-token',
|
|
41
|
+
},
|
|
42
|
+
}],
|
|
43
|
+
tools: [{
|
|
44
|
+
name: 'google_calendar_events_list',
|
|
45
|
+
title: 'Google Calendar: List calendar events',
|
|
46
|
+
description: 'Read events from a Google Calendar over a bounded time range.',
|
|
47
|
+
providerId: 'tangle-platform',
|
|
48
|
+
connectorId: 'google-calendar',
|
|
49
|
+
connectorTitle: 'Google Calendar',
|
|
50
|
+
category: 'calendar',
|
|
51
|
+
action: {
|
|
52
|
+
id: CANONICAL_INTEGRATION_ACTIONS.googleCalendarEventsList,
|
|
53
|
+
title: 'List calendar events',
|
|
54
|
+
risk: 'read',
|
|
55
|
+
requiredScopes: ['https://www.googleapis.com/auth/calendar.readonly'],
|
|
56
|
+
dataClass: 'private',
|
|
57
|
+
},
|
|
58
|
+
risk: 'read',
|
|
59
|
+
dataClass: 'private',
|
|
60
|
+
requiredScopes: ['https://www.googleapis.com/auth/calendar.readonly'],
|
|
61
|
+
tags: ['google', 'calendar', 'events', 'list'],
|
|
62
|
+
}],
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const env = buildIntegrationBridgeEnvironment(bundle)
|
|
66
|
+
const client = createTangleIntegrationsClient({
|
|
67
|
+
endpoint: 'https://id.tangle.tools',
|
|
68
|
+
env,
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
await client.invoke({
|
|
72
|
+
tool: CANONICAL_INTEGRATION_ACTIONS.googleCalendarEventsList,
|
|
73
|
+
input: {
|
|
74
|
+
calendarId: 'primary',
|
|
75
|
+
timeMin: new Date().toISOString(),
|
|
76
|
+
timeMax: new Date(Date.now() + 7 * 24 * 60 * 60_000).toISOString(),
|
|
77
|
+
},
|
|
78
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-integrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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": {
|