@tangle-network/agent-integrations 0.25.6 → 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-S54DPRDU.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-S54DPRDU.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,
@@ -3400,7 +3402,8 @@ var IntegrationHub = class {
3400
3402
  assertScopes(connection, action.requiredScopes);
3401
3403
  assertScopes({ ...connection, grantedScopes: capability.scopes }, action.requiredScopes);
3402
3404
  const fullRequest = { ...request, connectionId: connection.id };
3403
- if (this.policy) {
3405
+ const proceed = async () => {
3406
+ if (!this.policy) return provider.invokeAction(connection, fullRequest);
3404
3407
  const decision = await this.policy.decide({
3405
3408
  connection,
3406
3409
  request: fullRequest,
@@ -3418,8 +3421,8 @@ var IntegrationHub = class {
3418
3421
  metadata: { policyDecision: decision.decision, reason: decision.reason, ...decision.metadata }
3419
3422
  };
3420
3423
  }
3421
- }
3422
- const proceed = () => Promise.resolve(provider.invokeAction(connection, fullRequest));
3424
+ return provider.invokeAction(connection, fullRequest);
3425
+ };
3423
3426
  if (this.guard) {
3424
3427
  return this.guard.invokeAction({ connection, request: fullRequest, action }, proceed);
3425
3428
  }
@@ -4428,4 +4431,4 @@ export {
4428
4431
  signCapability,
4429
4432
  verifyCapabilityToken
4430
4433
  };
4431
- //# sourceMappingURL=chunk-S54DPRDU.js.map
4434
+ //# sourceMappingURL=chunk-A5I3EYU5.js.map