@tangle-network/agent-integrations 0.53.0 → 0.53.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.
Files changed (46) hide show
  1. package/dist/catalog.d.ts +2 -2
  2. package/dist/catalog.js +8 -8
  3. package/dist/{chunk-S2BUASSV.js → chunk-5NLIZJOI.js} +2 -2
  4. package/dist/{chunk-OOGP4SCY.js → chunk-5QWQFX2Q.js} +52 -34
  5. package/dist/{chunk-OOGP4SCY.js.map → chunk-5QWQFX2Q.js.map} +1 -1
  6. package/dist/{chunk-QVCO4ZYJ.js → chunk-6OQNMPQE.js} +2 -2
  7. package/dist/{chunk-VLVSP7SP.js → chunk-6ZHVV537.js} +2 -2
  8. package/dist/{chunk-NOCFPRQM.js → chunk-NLFG3UWL.js} +2 -2
  9. package/dist/{chunk-UWF33ESC.js → chunk-PDV6QQTH.js} +3 -1
  10. package/dist/chunk-PDV6QQTH.js.map +1 -0
  11. package/dist/{chunk-LA76XB7M.js → chunk-PNHETWE4.js} +2 -2
  12. package/dist/{chunk-CUTII6IW.js → chunk-SQU63PYS.js} +3 -3
  13. package/dist/connect/index.d.ts +2 -2
  14. package/dist/connect/index.js +2 -2
  15. package/dist/connectors/adapters/index.d.ts +2 -2
  16. package/dist/connectors/adapters/index.js +2 -2
  17. package/dist/connectors/index.d.ts +3 -3
  18. package/dist/connectors/index.js +3 -3
  19. package/dist/{consumer-CTMB1xcc.d.ts → consumer-DJLQcY8t.d.ts} +1 -1
  20. package/dist/consumer.d.ts +3 -3
  21. package/dist/consumer.js +2 -2
  22. package/dist/{core-types-BZLzY8Oa.d.ts → core-types-CdAHF1wy.d.ts} +1 -1
  23. package/dist/coverage-catalog.d.ts +2 -2
  24. package/dist/{importers-6Beu0SQ9.d.ts → importers-Ch76O-1f.d.ts} +1 -1
  25. package/dist/index.d.ts +8 -8
  26. package/dist/index.js +8 -8
  27. package/dist/mcp.d.ts +3 -3
  28. package/dist/mcp.js +8 -8
  29. package/dist/middleware/index.d.ts +2 -2
  30. package/dist/middleware/index.js +2 -2
  31. package/dist/registry.d.ts +2 -2
  32. package/dist/registry.js +8 -8
  33. package/dist/runtime.d.ts +2 -2
  34. package/dist/runtime.js +8 -8
  35. package/dist/specs.d.ts +2 -2
  36. package/dist/specs.js +4 -4
  37. package/dist/{tangle-id-_uZ3ywCF.d.ts → tangle-id-DkT2T54x.d.ts} +1 -1
  38. package/dist/{types-rBPdMcpb.d.ts → types-DkIrJgM-.d.ts} +8 -2
  39. package/package.json +1 -1
  40. package/dist/chunk-UWF33ESC.js.map +0 -1
  41. /package/dist/{chunk-S2BUASSV.js.map → chunk-5NLIZJOI.js.map} +0 -0
  42. /package/dist/{chunk-QVCO4ZYJ.js.map → chunk-6OQNMPQE.js.map} +0 -0
  43. /package/dist/{chunk-VLVSP7SP.js.map → chunk-6ZHVV537.js.map} +0 -0
  44. /package/dist/{chunk-NOCFPRQM.js.map → chunk-NLFG3UWL.js.map} +0 -0
  45. /package/dist/{chunk-LA76XB7M.js.map → chunk-PNHETWE4.js.map} +0 -0
  46. /package/dist/{chunk-CUTII6IW.js.map → chunk-SQU63PYS.js.map} +0 -0
package/dist/catalog.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IntegrationSupportTier, IntegrationRegistry, IntegrationRegistrySummary } from './registry.js';
2
- import { d as IntegrationConnectorCategory, e as IntegrationConnectorAction, f as IntegrationActionRisk, g as IntegrationDataClass, b as IntegrationConnector } from './core-types-BZLzY8Oa.js';
3
- import './types-rBPdMcpb.js';
2
+ import { d as IntegrationConnectorCategory, e as IntegrationConnectorAction, f as IntegrationActionRisk, g as IntegrationDataClass, b as IntegrationConnector } from './core-types-CdAHF1wy.js';
3
+ import './types-DkIrJgM-.js';
4
4
 
5
5
  interface IntegrationToolDefinition {
6
6
  name: string;
package/dist/catalog.js CHANGED
@@ -7,18 +7,18 @@ import {
7
7
  parseIntegrationToolName,
8
8
  searchIntegrationTools,
9
9
  toMcpTools
10
- } from "./chunk-CUTII6IW.js";
11
- import "./chunk-S2BUASSV.js";
12
- import "./chunk-LA76XB7M.js";
10
+ } from "./chunk-SQU63PYS.js";
11
+ import "./chunk-5NLIZJOI.js";
12
+ import "./chunk-PNHETWE4.js";
13
13
  import "./chunk-H4XYLS7T.js";
14
- import "./chunk-VLVSP7SP.js";
15
- import "./chunk-QVCO4ZYJ.js";
14
+ import "./chunk-6ZHVV537.js";
15
+ import "./chunk-6OQNMPQE.js";
16
16
  import "./chunk-LBPYXEHO.js";
17
17
  import "./chunk-P4FFI752.js";
18
- import "./chunk-NOCFPRQM.js";
19
- import "./chunk-OOGP4SCY.js";
18
+ import "./chunk-NLFG3UWL.js";
19
+ import "./chunk-5QWQFX2Q.js";
20
20
  import "./chunk-XC54EOUQ.js";
21
- import "./chunk-UWF33ESC.js";
21
+ import "./chunk-PDV6QQTH.js";
22
22
  import "./chunk-PZ5AY32C.js";
23
23
  export {
24
24
  buildIntegrationCatalogView,
@@ -2,7 +2,7 @@ import {
2
2
  DEFAULT_TANGLE_PLATFORM_URL,
3
3
  TangleIdentityUnreachableError,
4
4
  createTangleIdentityClient
5
- } from "./chunk-UWF33ESC.js";
5
+ } from "./chunk-PDV6QQTH.js";
6
6
 
7
7
  // src/connect/index.ts
8
8
  function startConnectFlow(opts, input) {
@@ -103,4 +103,4 @@ export {
103
103
  revokeConnectFlow,
104
104
  InMemoryConnectStateStore
105
105
  };
106
- //# sourceMappingURL=chunk-S2BUASSV.js.map
106
+ //# sourceMappingURL=chunk-5NLIZJOI.js.map
@@ -14,7 +14,7 @@ import {
14
14
  TangleIdentityUnreachableError,
15
15
  createTangleIdentityClient,
16
16
  tangleIdentity
17
- } from "./chunk-UWF33ESC.js";
17
+ } from "./chunk-PDV6QQTH.js";
18
18
  import {
19
19
  __export
20
20
  } from "./chunk-PZ5AY32C.js";
@@ -1004,6 +1004,19 @@ function declarativeRestConnector(spec) {
1004
1004
  async executeRead(inv) {
1005
1005
  const op = readOperation(spec, inv.capabilityName, "read");
1006
1006
  const response = await executeRestRequest(spec, op.request, inv, requiredArgsOf(op.parameters));
1007
+ if (response.outcome === "rate-limited") {
1008
+ const retryAfterMs = response.retryAfterMs ?? DEFAULT_RETRY_AFTER_MS;
1009
+ throw new ProviderRateLimited(
1010
+ `${spec.displayName} ${inv.capabilityName} rate limit (429); retry after ${retryAfterMs}ms`,
1011
+ inv.source.id,
1012
+ { status: 429, body: response.data, retryAfterMs }
1013
+ );
1014
+ }
1015
+ if (response.outcome === "conflict") {
1016
+ throw new Error(
1017
+ `${spec.kind} ${op.request.method} ${op.request.path} HTTP ${response.status ?? 409}: ${(response.message ?? "").slice(0, 300)}`
1018
+ );
1019
+ }
1007
1020
  return {
1008
1021
  data: response.data,
1009
1022
  etag: response.etag,
@@ -1013,31 +1026,7 @@ function declarativeRestConnector(spec) {
1013
1026
  async executeMutation(inv) {
1014
1027
  const op = readOperation(spec, inv.capabilityName, "mutation");
1015
1028
  const response = await executeRestRequest(spec, op.request, inv, requiredArgsOf(op.parameters));
1016
- if (response.outcome === "conflict") {
1017
- return {
1018
- status: "conflict",
1019
- alternatives: [],
1020
- // The upstream's parsed body — the contract calls this "the current
1021
- // authoritative state", so it must be what the provider returned,
1022
- // not the transport's own wrapper.
1023
- currentState: response.data,
1024
- message: response.message || `${spec.displayName} rejected the write on a state conflict`
1025
- };
1026
- }
1027
- if (response.outcome === "rate-limited") {
1028
- return {
1029
- status: "rate-limited",
1030
- retryAfterMs: response.retryAfterMs ?? DEFAULT_RETRY_AFTER_MS,
1031
- message: response.message || `${spec.displayName} throttled the write`
1032
- };
1033
- }
1034
- return {
1035
- status: "committed",
1036
- data: response.data,
1037
- etagAfter: response.etag,
1038
- committedAt: Date.now(),
1039
- idempotentReplay: false
1040
- };
1029
+ return mutationResultFromTransport(spec.displayName, response);
1041
1030
  },
1042
1031
  async test(source) {
1043
1032
  if (!spec.test) return { ok: true };
@@ -1048,6 +1037,12 @@ function declarativeRestConnector(spec) {
1048
1037
  args: {},
1049
1038
  idempotencyKey: "test"
1050
1039
  });
1040
+ if (response.outcome) {
1041
+ return {
1042
+ ok: false,
1043
+ reason: response.message || `${spec.displayName} test request was ${response.outcome}`
1044
+ };
1045
+ }
1051
1046
  validateTestResponse(spec, spec.test, response.data);
1052
1047
  return { ok: true };
1053
1048
  } catch (error) {
@@ -1104,6 +1099,33 @@ function requiredArgsOf(parameters) {
1104
1099
  const required = parameters.required;
1105
1100
  return Array.isArray(required) ? required.filter((entry) => typeof entry === "string") : void 0;
1106
1101
  }
1102
+ function mutationResultFromTransport(displayName, response) {
1103
+ if (response.outcome === "conflict") {
1104
+ return {
1105
+ status: "conflict",
1106
+ alternatives: [],
1107
+ // The upstream's parsed body — the contract calls this "the current
1108
+ // authoritative state", so it must be what the provider returned,
1109
+ // not the transport's own wrapper.
1110
+ currentState: response.data,
1111
+ message: response.message || `${displayName} rejected the write on a state conflict`
1112
+ };
1113
+ }
1114
+ if (response.outcome === "rate-limited") {
1115
+ return {
1116
+ status: "rate-limited",
1117
+ retryAfterMs: response.retryAfterMs ?? DEFAULT_RETRY_AFTER_MS,
1118
+ message: response.message || `${displayName} throttled the write`
1119
+ };
1120
+ }
1121
+ return {
1122
+ status: "committed",
1123
+ data: response.data,
1124
+ etagAfter: response.etag,
1125
+ committedAt: Date.now(),
1126
+ idempotentReplay: false
1127
+ };
1128
+ }
1107
1129
  async function executeRestRequest(spec, request, inv, requiredArgs) {
1108
1130
  const placement = spec.credentialPlacement ?? { kind: "bearer" };
1109
1131
  const aws = placement.kind === "aws-sigv4" ? parseAwsCredentialBundle(inv.source.credentials) : void 0;
@@ -1158,6 +1180,7 @@ async function executeRestRequest(spec, request, inv, requiredArgs) {
1158
1180
  return {
1159
1181
  data: parseBodyText(text2),
1160
1182
  outcome: "conflict",
1183
+ status: res.status,
1161
1184
  message: text2,
1162
1185
  etag: res.headers.get("etag") ?? void 0
1163
1186
  };
@@ -1167,6 +1190,7 @@ async function executeRestRequest(spec, request, inv, requiredArgs) {
1167
1190
  return {
1168
1191
  data: parseBodyText(text2),
1169
1192
  outcome: "rate-limited",
1193
+ status: res.status,
1170
1194
  message: text2,
1171
1195
  retryAfterMs: retryAfterMsFromHeader(res.headers.get("retry-after"))
1172
1196
  };
@@ -7403,13 +7427,7 @@ async function databasesUpdate(inv) {
7403
7427
  { method: "PATCH", path: "/databases/{databaseId}", body },
7404
7428
  inv
7405
7429
  );
7406
- return {
7407
- status: "committed",
7408
- data: response.data,
7409
- etagAfter: response.etag,
7410
- committedAt: Date.now(),
7411
- idempotentReplay: false
7412
- };
7430
+ return mutationResultFromTransport(NOTION_SPEC.displayName, response);
7413
7431
  }
7414
7432
  function withNotionOverrides(base) {
7415
7433
  return {
@@ -127745,4 +127763,4 @@ export {
127745
127763
  demandbaseConnector,
127746
127764
  adapters_exports
127747
127765
  };
127748
- //# sourceMappingURL=chunk-OOGP4SCY.js.map
127766
+ //# sourceMappingURL=chunk-5QWQFX2Q.js.map