@tangle-network/agent-integrations 0.33.2 → 0.35.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 +3 -0
- package/dist/catalog.js +2 -2
- package/dist/{chunk-DT3H3NIW.js → chunk-6W72E2KN.js} +79 -6
- package/dist/chunk-6W72E2KN.js.map +1 -0
- package/dist/{chunk-C4CGT5JE.js → chunk-ZVGYRP2O.js} +2 -2
- package/dist/connectors/adapters/index.d.ts +29 -1
- package/dist/connectors/adapters/index.js +3 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +3 -1
- package/dist/delegated-tools/index.d.ts +195 -0
- package/dist/delegated-tools/index.js +207 -0
- package/dist/delegated-tools/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/registry.js +2 -2
- package/dist/runtime.js +2 -2
- package/package.json +6 -1
- package/dist/chunk-DT3H3NIW.js.map +0 -1
- /package/dist/{chunk-C4CGT5JE.js.map → chunk-ZVGYRP2O.js.map} +0 -0
package/README.md
CHANGED
|
@@ -165,6 +165,9 @@ OAuth credentials.
|
|
|
165
165
|
| `runIntegrationHealthchecks` | Checks connection status, registry executability, scope shape, and optional live provider tests. |
|
|
166
166
|
| `receiveIntegrationWebhook` | Verifies inbound webhooks, dedupes provider events, and dispatches normalized trigger events. |
|
|
167
167
|
| `buildIntegrationBridgeEnvironment` | Encodes scoped sandbox capabilities for sandbox processes or executor-style CLIs. |
|
|
168
|
+
| `mintDelegatedToolToken` / `verifyDelegatedToolToken` | Signed-claims bearer (workspace + tool allow-list + TTL) for an external agent that calls back into the product's tools mid-session. |
|
|
169
|
+
| `issueDelegatedToolLease` | Standardized lease (token + allow-list + expiry + callback URL) the product hands to its external agent. |
|
|
170
|
+
| `handleDelegatedToolCall` / `handleDelegatedToolRequest` | Transport-agnostic JSON-RPC 2.0 callback handler with fail-closed gates (token fresh, tool allow-listed, integration connected) via product-supplied seams. |
|
|
168
171
|
| `createTangleIntegrationsClient` | Tiny generated-app/sandbox client for platform `/v1/integrations/invoke`. |
|
|
169
172
|
| `inferIntegrationManifestFromTools` / `validateIntegrationManifest` | Deterministic manifest helpers for Builder and platform APIs. |
|
|
170
173
|
| `renderConsentSummary` / `renderApprovalCopy` | User-facing consent and approval copy from manifests/actions. |
|
package/dist/catalog.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
parseIntegrationToolName,
|
|
8
8
|
searchIntegrationTools,
|
|
9
9
|
toMcpTools
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZVGYRP2O.js";
|
|
11
11
|
import "./chunk-D57YS6XC.js";
|
|
12
12
|
import "./chunk-CR35IEKW.js";
|
|
13
13
|
import "./chunk-H4XYLS7T.js";
|
|
@@ -15,7 +15,7 @@ import "./chunk-O553GSCX.js";
|
|
|
15
15
|
import "./chunk-53NQJZAT.js";
|
|
16
16
|
import "./chunk-7P2LN4VT.js";
|
|
17
17
|
import "./chunk-376UBTNB.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-6W72E2KN.js";
|
|
19
19
|
import "./chunk-2TW2QKGZ.js";
|
|
20
20
|
import "./chunk-ZDK7Y4QG.js";
|
|
21
21
|
import "./chunk-PZ5AY32C.js";
|
|
@@ -468,6 +468,7 @@ __export(adapters_exports, {
|
|
|
468
468
|
twilioConnector: () => twilioConnector,
|
|
469
469
|
twilioSmsConnector: () => twilioSmsConnector,
|
|
470
470
|
twinLabsConnector: () => twinLabsConnector,
|
|
471
|
+
twitter: () => twitter,
|
|
471
472
|
twitterConnector: () => twitterConnector,
|
|
472
473
|
typeformConnector: () => typeformConnector,
|
|
473
474
|
typefullyConnector: () => typefullyConnector,
|
|
@@ -111089,7 +111090,10 @@ var twinLabsConnector = declarativeRestConnector({
|
|
|
111089
111090
|
});
|
|
111090
111091
|
|
|
111091
111092
|
// src/connectors/adapters/twitter.ts
|
|
111092
|
-
var
|
|
111093
|
+
var AUTH_URL19 = "https://twitter.com/i/oauth2/authorize";
|
|
111094
|
+
var TOKEN_URL19 = "https://api.twitter.com/2/oauth2/token";
|
|
111095
|
+
var SCOPES14 = ["tweet.read", "tweet.write", "users.read", "like.write", "offline.access"];
|
|
111096
|
+
var TWITTER_SPEC = {
|
|
111093
111097
|
kind: "twitter",
|
|
111094
111098
|
displayName: "Twitter",
|
|
111095
111099
|
description: "Post tweets and reply to tweets on Twitter.",
|
|
@@ -111099,9 +111103,9 @@ var twitterConnector = declarativeRestConnector({
|
|
|
111099
111103
|
options: [
|
|
111100
111104
|
{
|
|
111101
111105
|
kind: "oauth2",
|
|
111102
|
-
authorizationUrl:
|
|
111103
|
-
tokenUrl:
|
|
111104
|
-
scopes:
|
|
111106
|
+
authorizationUrl: AUTH_URL19,
|
|
111107
|
+
tokenUrl: TOKEN_URL19,
|
|
111108
|
+
scopes: SCOPES14,
|
|
111105
111109
|
clientIdEnv: "TWITTER_OAUTH_CLIENT_ID",
|
|
111106
111110
|
clientSecretEnv: "TWITTER_OAUTH_CLIENT_SECRET"
|
|
111107
111111
|
},
|
|
@@ -111214,7 +111218,75 @@ var twitterConnector = declarativeRestConnector({
|
|
|
111214
111218
|
externalEffect: true
|
|
111215
111219
|
}
|
|
111216
111220
|
]
|
|
111217
|
-
}
|
|
111221
|
+
};
|
|
111222
|
+
var twitterConnector = declarativeRestConnector(TWITTER_SPEC);
|
|
111223
|
+
function twitter(opts) {
|
|
111224
|
+
const { clientId, clientSecret } = opts;
|
|
111225
|
+
return {
|
|
111226
|
+
...declarativeRestConnector(TWITTER_SPEC),
|
|
111227
|
+
async exchangeOAuth(input) {
|
|
111228
|
+
if (!clientId || !clientSecret) {
|
|
111229
|
+
throw new Error("Twitter OAuth client not configured (TWITTER_OAUTH_CLIENT_ID / _SECRET)");
|
|
111230
|
+
}
|
|
111231
|
+
const tokens = await twitterTokenRequest(clientId, clientSecret, {
|
|
111232
|
+
grant_type: "authorization_code",
|
|
111233
|
+
code: input.code,
|
|
111234
|
+
redirect_uri: input.redirectUri,
|
|
111235
|
+
code_verifier: input.codeVerifier,
|
|
111236
|
+
client_id: clientId
|
|
111237
|
+
});
|
|
111238
|
+
return {
|
|
111239
|
+
credentials: {
|
|
111240
|
+
kind: "oauth2",
|
|
111241
|
+
accessToken: tokens.accessToken,
|
|
111242
|
+
refreshToken: tokens.refreshToken,
|
|
111243
|
+
expiresAt: tokens.expiresIn ? Date.now() + tokens.expiresIn * 1e3 : void 0
|
|
111244
|
+
},
|
|
111245
|
+
scopes: tokens.scope?.split(/\s+/) ?? SCOPES14,
|
|
111246
|
+
metadata: {}
|
|
111247
|
+
};
|
|
111248
|
+
},
|
|
111249
|
+
async refreshToken(creds) {
|
|
111250
|
+
if (creds.kind !== "oauth2" || !creds.refreshToken) {
|
|
111251
|
+
throw new Error("twitter.refreshToken: missing refresh token (was offline.access granted?)");
|
|
111252
|
+
}
|
|
111253
|
+
const refreshed = await twitterTokenRequest(clientId, clientSecret, {
|
|
111254
|
+
grant_type: "refresh_token",
|
|
111255
|
+
refresh_token: creds.refreshToken,
|
|
111256
|
+
client_id: clientId
|
|
111257
|
+
});
|
|
111258
|
+
return {
|
|
111259
|
+
kind: "oauth2",
|
|
111260
|
+
accessToken: refreshed.accessToken,
|
|
111261
|
+
refreshToken: refreshed.refreshToken ?? creds.refreshToken,
|
|
111262
|
+
expiresAt: refreshed.expiresIn ? Date.now() + refreshed.expiresIn * 1e3 : void 0
|
|
111263
|
+
};
|
|
111264
|
+
}
|
|
111265
|
+
};
|
|
111266
|
+
}
|
|
111267
|
+
async function twitterTokenRequest(clientId, clientSecret, params) {
|
|
111268
|
+
const res = await fetch(TOKEN_URL19, {
|
|
111269
|
+
method: "POST",
|
|
111270
|
+
headers: {
|
|
111271
|
+
authorization: `Basic ${Buffer.from(`${clientId}:${clientSecret}`).toString("base64")}`,
|
|
111272
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
111273
|
+
accept: "application/json"
|
|
111274
|
+
},
|
|
111275
|
+
body: new URLSearchParams(params),
|
|
111276
|
+
signal: AbortSignal.timeout(15e3)
|
|
111277
|
+
});
|
|
111278
|
+
if (!res.ok) {
|
|
111279
|
+
const text = await res.text().catch(() => "");
|
|
111280
|
+
throw new Error(`twitter ${params.grant_type} token request failed: ${res.status} ${res.statusText} \u2014 ${text.slice(0, 200)}`);
|
|
111281
|
+
}
|
|
111282
|
+
const json = await res.json();
|
|
111283
|
+
return {
|
|
111284
|
+
accessToken: json.access_token,
|
|
111285
|
+
refreshToken: json.refresh_token,
|
|
111286
|
+
expiresIn: json.expires_in,
|
|
111287
|
+
scope: json.scope
|
|
111288
|
+
};
|
|
111289
|
+
}
|
|
111218
111290
|
|
|
111219
111291
|
// src/connectors/adapters/twilio.ts
|
|
111220
111292
|
var twilioConnector = declarativeRestConnector({
|
|
@@ -118636,6 +118708,7 @@ export {
|
|
|
118636
118708
|
typefullyConnector,
|
|
118637
118709
|
twinLabsConnector,
|
|
118638
118710
|
twitterConnector,
|
|
118711
|
+
twitter,
|
|
118639
118712
|
twilioConnector,
|
|
118640
118713
|
upgradechatConnector,
|
|
118641
118714
|
vapiConnector,
|
|
@@ -118672,4 +118745,4 @@ export {
|
|
|
118672
118745
|
pipedreamConnector,
|
|
118673
118746
|
adapters_exports
|
|
118674
118747
|
};
|
|
118675
|
-
//# sourceMappingURL=chunk-
|
|
118748
|
+
//# sourceMappingURL=chunk-6W72E2KN.js.map
|