@tangle-network/agent-integrations 0.1.0 → 0.1.2

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.
@@ -0,0 +1,164 @@
1
+ # Provider Decision Matrix
2
+
3
+ Status date: 2026-05-04
4
+
5
+ `agent-integrations` should keep product code independent from Nango,
6
+ Pipedream, Zapier, Activepieces, Composio, executor-style services, and our own
7
+ first-party connectors. The strategic goal is not to outsource integrations
8
+ forever. The goal is to get broad connector coverage quickly while preserving a
9
+ clean path to bring important connectors in-house.
10
+
11
+ ## Default Strategy
12
+
13
+ Use a three-tier connector strategy:
14
+
15
+ | Tier | Connector type | Default implementation | Why |
16
+ | --- | --- | --- | --- |
17
+ | Tier 1 | Strategic, high-volume, high-trust connectors | First-party provider adapter | Lowest unit cost, best UX, strictest security, strongest product moat. |
18
+ | Tier 2 | Common but non-core connectors | Hosted gateway behind `createHttpIntegrationProvider` | Fast coverage without leaking vendor APIs into apps or sandboxes. |
19
+ | Tier 3 | Long-tail and experimental connectors | Gateway or generated adapter | Cheap validation before committing engineering ownership. |
20
+
21
+ The invariant: every connector, no matter who backs it, must expose the same
22
+ `IntegrationConnector`, `IntegrationConnection`, action, trigger, and capability
23
+ contracts.
24
+
25
+ ## Decision Matrix
26
+
27
+ Score each connector from 1 to 5. Higher total means stronger first-party
28
+ priority.
29
+
30
+ | Criterion | 1 | 3 | 5 |
31
+ | --- | --- | --- | --- |
32
+ | User demand | Rarely requested | Common in one vertical | Needed across many products/agents |
33
+ | Workflow criticality | Nice-to-have read path | Useful but recoverable | Blocks core product value |
34
+ | Data sensitivity | Public/low-risk | Private business data | Regulated, financial, legal, health, secrets |
35
+ | Write risk | Read-only | Reversible writes | Money movement, external comms, destructive writes |
36
+ | Volume/cost | Low call volume | Moderate calls | High volume where vendor margins matter |
37
+ | API stability | Messy/private/unstable | Usable but quirky | Stable official API + webhook model |
38
+ | Auth complexity | Simple API key | OAuth with refresh | Multi-tenant OAuth, domain-wide delegation, scoped installs |
39
+ | Product differentiation | Commodity | Some UX benefit | Better in-house UX is a moat |
40
+ | Vendor coverage quality | Vendor handles it well | Vendor has gaps | Vendor coverage is weak or too generic |
41
+ | Compliance/control need | Low | Moderate | Requires internal audit, retention, approval, residency controls |
42
+
43
+ Decision:
44
+
45
+ - `38+`: build or migrate first-party.
46
+ - `26-37`: start behind a gateway, schedule migration once usage proves out.
47
+ - `15-25`: keep gateway-backed unless a product launch depends on it.
48
+ - `<15`: do not build first-party yet; use long-tail gateway or defer.
49
+
50
+ ## Practical Launch Order
51
+
52
+ Build first-party adapters first for connectors that are both broadly useful
53
+ and expensive/risky to delegate:
54
+
55
+ 1. Gmail / Google Workspace mail
56
+ 2. Google Calendar
57
+ 3. Google Drive / Docs
58
+ 4. Slack
59
+ 5. Microsoft 365 mail/calendar/files
60
+ 6. HubSpot
61
+ 7. Salesforce
62
+ 8. Notion
63
+ 9. GitHub
64
+ 10. Webhooks / generic HTTP actions
65
+
66
+ Use gateway-backed coverage for the next large tranche:
67
+
68
+ - marketing and ad platforms
69
+ - analytics tools
70
+ - project-management tools
71
+ - form tools
72
+ - storage services
73
+ - social networks
74
+ - long-tail CRM/support/helpdesk systems
75
+ - vendor-specific workflow triggers
76
+
77
+ This gives Agent Builder useful breadth immediately without forcing us to own
78
+ hundreds of OAuth apps, refresh-token edge cases, webhook subscription models,
79
+ rate-limit policies, and provider-specific APIs on day one.
80
+
81
+ ## When To Roll Our Own
82
+
83
+ Move a connector first-party when one of these is true:
84
+
85
+ - It appears in multiple product launch paths.
86
+ - It is needed by generated sandbox apps, not just back-office automation.
87
+ - Users expect a polished native UX for connection, approval, and failure
88
+ recovery.
89
+ - The action volume makes gateway pricing materially worse than internal
90
+ maintenance.
91
+ - The connector touches high-trust data or irreversible writes.
92
+ - We need better replay, idempotency, audit, or conflict handling than a vendor
93
+ exposes.
94
+ - The vendor abstraction hides too much provider-specific capability.
95
+ - We need to publish open-source agent apps that still reliably route through
96
+ our platform keys, sandboxes, and audit controls.
97
+
98
+ ## When To Use A Gateway
99
+
100
+ Use a gateway when speed and breadth matter more than deep ownership:
101
+
102
+ - The connector is long-tail or unproven.
103
+ - The integration is read-only or low write-risk.
104
+ - The provider API is annoying but not strategic.
105
+ - The product team needs a demo or beta connector this week.
106
+ - The connector is mainly a trigger source, not a rich bidirectional app API.
107
+ - The connector is expected to churn while the product shape is still moving.
108
+
109
+ Gateways are acceptable only behind `IntegrationProvider`. Product code must
110
+ not import vendor SDKs or depend on vendor-specific connection records.
111
+
112
+ ## First-Party Adapter Requirements
113
+
114
+ A first-party connector is not just a thin API wrapper. It must ship with:
115
+
116
+ - normalized connector manifest
117
+ - OAuth/API-key start and complete flows
118
+ - encrypted token/secret reference handling
119
+ - refresh-token and expiry handling
120
+ - action schemas and output schemas
121
+ - trigger subscription and normalization if supported
122
+ - provider rate-limit and retry policy
123
+ - typed errors that agents can recover from
124
+ - `IntegrationActionGuard` compatibility for idempotency, audit, approval, and
125
+ conflict handling
126
+ - tests that cover auth, scope denial, capability denial, provider errors, and
127
+ write approval paths
128
+
129
+ ## Guard Policy
130
+
131
+ Every production hub should install an `IntegrationActionGuard`.
132
+
133
+ The guard is where products enforce cross-provider discipline:
134
+
135
+ - idempotency key replay
136
+ - same-key-different-args rejection
137
+ - human approval before risky writes
138
+ - per-tenant and per-connection rate limits
139
+ - audit logging
140
+ - conflict detection
141
+ - dry-run handling
142
+ - structured alternatives when an action cannot safely run
143
+
144
+ Providers should execute actions. Guards should decide whether an action may
145
+ run, whether it has already run, and how to record it.
146
+
147
+ ## The Cheap Path
148
+
149
+ The cheapest credible path is:
150
+
151
+ 1. Keep `agent-integrations` as the stable SDK contract.
152
+ 2. Use a hosted gateway for broad catalog coverage while demand is uncertain.
153
+ 3. Route every sandbox/app action through short-lived capabilities and a guard.
154
+ 4. Instrument connector usage, error rate, action volume, and approval friction.
155
+ 5. Promote the highest-scoring connectors to first-party adapters.
156
+ 6. Keep long-tail connectors gateway-backed until usage justifies ownership.
157
+
158
+ This avoids two bad extremes:
159
+
160
+ - locking the product into a vendor abstraction that becomes expensive and
161
+ limiting;
162
+ - spending months cloning hundreds of integrations before knowing which ones
163
+ matter.
164
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-integrations",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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": {
@@ -28,6 +28,14 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
+ "scripts": {
32
+ "build": "tsup",
33
+ "dev": "tsup --watch",
34
+ "prepare": "tsup",
35
+ "test": "vitest run",
36
+ "test:watch": "vitest",
37
+ "typecheck": "tsc --noEmit"
38
+ },
31
39
  "devDependencies": {
32
40
  "@types/node": "^25.6.0",
33
41
  "tsup": "^8.0.0",
@@ -38,11 +46,5 @@
38
46
  "node": ">=20"
39
47
  },
40
48
  "license": "MIT",
41
- "scripts": {
42
- "build": "tsup",
43
- "dev": "tsup --watch",
44
- "test": "vitest run",
45
- "test:watch": "vitest",
46
- "typecheck": "tsc --noEmit"
47
- }
48
- }
49
+ "packageManager": "pnpm@10.28.0"
50
+ }