@tangle-network/agent-integrations 0.6.0 → 0.7.1
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 +146 -144
- package/dist/index.d.ts +56 -1
- package/dist/index.js +547 -0
- package/dist/index.js.map +1 -1
- package/docs/integration-coverage-checklist.md +9 -6
- 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
|
@@ -15,7 +15,8 @@ Goal: cover the integrations that make agents useful for 99% of practical produc
|
|
|
15
15
|
- [x] One normalized connector contract for apps, sandboxes, and agents.
|
|
16
16
|
- [x] Central sandbox invocation envelope validation.
|
|
17
17
|
- [x] Coverage catalog for 100+ high-value integrations.
|
|
18
|
-
- [
|
|
18
|
+
- [x] Builder API consumes the coverage catalog for app planning.
|
|
19
|
+
- [x] Declarative REST adapter factory for fast first-party promotion of REST-shaped APIs.
|
|
19
20
|
- [ ] Generated sandbox apps can request missing connections from the catalog.
|
|
20
21
|
- [ ] Live smoke credentials exist for Tier 0 connectors.
|
|
21
22
|
- [ ] Tier 0 connector failures are classified by auth, scope, rate-limit, provider outage, validation, approval, and conflict.
|
|
@@ -39,11 +40,11 @@ Goal: cover the integrations that make agents useful for 99% of practical produc
|
|
|
39
40
|
- [ ] Google Docs
|
|
40
41
|
- [ ] Microsoft Teams
|
|
41
42
|
- [ ] OneDrive
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
43
|
+
- [x] Airtable
|
|
44
|
+
- [x] Salesforce
|
|
44
45
|
- [ ] Linear
|
|
45
46
|
- [ ] Jira
|
|
46
|
-
- [
|
|
47
|
+
- [x] GitHub
|
|
47
48
|
- [ ] Zendesk
|
|
48
49
|
- [ ] Intercom
|
|
49
50
|
- [ ] QuickBooks
|
|
@@ -80,7 +81,9 @@ The exhaustive checklist is generated from `integrationCoverageChecklistMarkdown
|
|
|
80
81
|
|
|
81
82
|
- [ ] Wire Builder to show Tier 0 missing connections from the coverage catalog.
|
|
82
83
|
- [ ] Add Gmail first-party adapter.
|
|
83
|
-
- [
|
|
84
|
-
- [
|
|
84
|
+
- [x] Add GitHub first-party adapter.
|
|
85
|
+
- [x] Add Salesforce or Zendesk first-party adapter.
|
|
86
|
+
- [x] Add reusable declarative REST adapter factory.
|
|
87
|
+
- [x] Add Airtable, GitLab, and Asana via declarative REST.
|
|
85
88
|
- [ ] Add live smoke-test harness that skips only when explicit credentials are absent.
|
|
86
89
|
- [ ] Add gateway sync job for Nango/Pipedream/Activepieces metadata.
|
|
@@ -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.7.1",
|
|
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": {
|