@tangle-network/agent-integrations 0.15.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.
@@ -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.15.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": {