@tangle-network/agent-integrations 0.25.5 → 0.25.7

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.
@@ -4,7 +4,7 @@ import {
4
4
  buildTangleCatalogRuntimePackageManifest,
5
5
  renderTangleCatalogRuntimePnpmAddCommand,
6
6
  startTangleCatalogRuntimeNodeServer
7
- } from "../chunk-ZEDXLDOV.js";
7
+ } from "../chunk-A5I3EYU5.js";
8
8
  import "../chunk-4JQ754PA.js";
9
9
  import "../chunk-376UBTNB.js";
10
10
  import "../chunk-WC63AI4Q.js";
package/dist/catalog.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  parseIntegrationToolName,
6
6
  searchIntegrationTools,
7
7
  toMcpTools
8
- } from "./chunk-ZEDXLDOV.js";
8
+ } from "./chunk-A5I3EYU5.js";
9
9
  import "./chunk-4JQ754PA.js";
10
10
  import "./chunk-376UBTNB.js";
11
11
  import "./chunk-WC63AI4Q.js";
@@ -1362,7 +1362,9 @@ var DefaultIntegrationActionGuard = class {
1362
1362
  }
1363
1363
  try {
1364
1364
  const result = await proceed();
1365
- await this.writeIdempotency(idempotencyKey, requestHash, result);
1365
+ if (result.ok) {
1366
+ await this.writeIdempotency(idempotencyKey, requestHash, result);
1367
+ }
1366
1368
  await this.audit?.record(createIntegrationAuditEvent({
1367
1369
  type: result.ok ? "action.invoked" : "action.failed",
1368
1370
  actor: ctx.connection.owner,
@@ -3023,6 +3025,9 @@ var IntegrationRuntime = class {
3023
3025
  }
3024
3026
  async buildSandboxBundle(input) {
3025
3027
  const grants = await this.resolveBundleGrants(input);
3028
+ if (grants.length === 0) {
3029
+ throw new Error("Cannot build integration bundle; no active integration grants matched the request.");
3030
+ }
3026
3031
  const registry = await this.registry();
3027
3032
  const bindings = [];
3028
3033
  const connectors = [];
@@ -3397,7 +3402,8 @@ var IntegrationHub = class {
3397
3402
  assertScopes(connection, action.requiredScopes);
3398
3403
  assertScopes({ ...connection, grantedScopes: capability.scopes }, action.requiredScopes);
3399
3404
  const fullRequest = { ...request, connectionId: connection.id };
3400
- if (this.policy) {
3405
+ const proceed = async () => {
3406
+ if (!this.policy) return provider.invokeAction(connection, fullRequest);
3401
3407
  const decision = await this.policy.decide({
3402
3408
  connection,
3403
3409
  request: fullRequest,
@@ -3415,8 +3421,8 @@ var IntegrationHub = class {
3415
3421
  metadata: { policyDecision: decision.decision, reason: decision.reason, ...decision.metadata }
3416
3422
  };
3417
3423
  }
3418
- }
3419
- const proceed = () => Promise.resolve(provider.invokeAction(connection, fullRequest));
3424
+ return provider.invokeAction(connection, fullRequest);
3425
+ };
3420
3426
  if (this.guard) {
3421
3427
  return this.guard.invokeAction({ connection, request: fullRequest, action }, proceed);
3422
3428
  }
@@ -4425,4 +4431,4 @@ export {
4425
4431
  signCapability,
4426
4432
  verifyCapabilityToken
4427
4433
  };
4428
- //# sourceMappingURL=chunk-ZEDXLDOV.js.map
4434
+ //# sourceMappingURL=chunk-A5I3EYU5.js.map