@powerhousedao/reactor-workflow 6.2.3-dev.85 → 6.2.3-dev.86

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as containsRedactedMarker, A as AttachmentCache, B as SecretCreatorMismatchError, C as blockLabel, Ct as isIndeterminateError, D as describeBuiltinPiece, E as builtinPiece, F as shapeConnection, G as secretRefFromId, H as SecretNotFoundError, I as resolveStepInput, J as PieceWorkerPool, K as stepBlock, L as expressionsIn, N as declaredConnectionIds, O as CORE_PIECE_NAME, P as declaredReactorConnectionIds, Q as PieceWorkerTimeoutError, R as unavailableValue, S as storeHandlers, St as setPieceRegistryUrl, T as blockPorts, U as SecretOwnerMismatchError, V as SecretDeletedError, W as parseSecretRef, X as PieceWorkerDisposedError, Y as PieceWorker, Z as PieceWorkerError, _ as effectiveRetryPolicy, _t as unsupportedTrigger, a as PieceRegistry, at as isPrivateAddress, b as isHostBound, bt as npmRegistryBaseUrl, c as packagePieces, ct as FileTooLargeError, d as runWorkflow, dt as pieceModuleRef, et as redact, f as canonicalJson, ft as sourcedResolver, g as checkDynamicProperties, gt as unsupportedAuth, h as DynamicPropertiesError, ht as authMethodFor, i as tracedSteps, it as DEFAULT_EGRESS_POLICY, j as BoundConnectionResolver, k as CORE_PIECE_VERSION, lt as maxFileBytes, m as stepConfigHash, mt as UnsupportedPieceFeatureError, n as WorkflowTelemetry, nt as rememberSecrets, o as installedPiece, ot as parseAddress, p as hashOf, q as triggerBlock, r as tracedMethods, rt as secretsFor, s as installedPieces, st as extractDedupeKey, t as TELEMETRY_SCOPE, tt as redactMessage, u as errorNameOf, ut as bundleResolver, v as ActivepiecesBlockExecutor, w as unpinnedNote, x as resolvedBlock, xt as pieceRegistrySource, y as CompositeBlockExecutor } from "./telemetry-B5OOpfCS.js";
1
+ import { $ as containsRedactedMarker, A as AttachmentCache, B as SecretCreatorMismatchError, C as blockLabel, Ct as isIndeterminateError, D as describeBuiltinPiece, E as builtinPiece, F as shapeConnection, G as secretRefFromId, H as SecretNotFoundError, I as resolveStepInput, J as PieceWorkerPool, K as stepBlock, L as expressionsIn, N as declaredConnectionIds, O as CORE_PIECE_NAME, P as declaredReactorConnectionIds, Q as PieceWorkerTimeoutError, R as unavailableValue, S as storeHandlers, St as setPieceRegistryUrl, T as blockPorts, U as SecretOwnerMismatchError, V as SecretDeletedError, W as parseSecretRef, X as PieceWorkerDisposedError, Y as PieceWorker, Z as PieceWorkerError, _ as effectiveRetryPolicy, _t as unsupportedTrigger, a as PieceRegistry, at as isPrivateAddress, b as isHostBound, bt as npmRegistryBaseUrl, c as packagePieces, ct as FileTooLargeError, d as runWorkflow, dt as pieceModuleRef, et as redact, f as canonicalJson, ft as sourcedResolver, g as checkDynamicProperties, gt as unsupportedAuth, h as DynamicPropertiesError, ht as authMethodFor, i as tracedSteps, it as DEFAULT_EGRESS_POLICY, j as BoundConnectionResolver, k as CORE_PIECE_VERSION, lt as maxFileBytes, m as stepConfigHash, mt as UnsupportedPieceFeatureError, n as WorkflowTelemetry, nt as rememberSecrets, o as installedPiece, ot as parseAddress, p as hashOf, q as triggerBlock, r as tracedMethods, rt as secretsFor, s as installedPieces, st as extractDedupeKey, t as TELEMETRY_SCOPE, tt as redactMessage, u as errorNameOf, ut as bundleResolver, v as ActivepiecesBlockExecutor, w as unpinnedNote, x as resolvedBlock, xt as pieceRegistrySource, y as CompositeBlockExecutor } from "./telemetry-GZA1FLlY.js";
2
2
  import { DENIED_ACTION_INDEXES, ReactorAccessDeniedError, ReactorAccessDeniedError as ReactorAccessDeniedError$1, ReactorJobFailedError, ReactorJobPendingError as ReactorJobPendingError$1, WebhookHandshakeStrategy, assertActionsApplied } from "@powerhousedao/pieces-framework";
3
3
  import { mkdirSync, openAsBlob, readFileSync, writeFileSync } from "node:fs";
4
4
  import { open, readFile, readdir, rm, stat } from "node:fs/promises";
@@ -12,6 +12,7 @@ import net from "node:net";
12
12
  import { AsyncLocalStorage } from "node:async_hooks";
13
13
  import { hostname } from "node:os";
14
14
  import { blockKey, compareVersions, isExactVersion, rankClosestVersions } from "@powerhousedao/pieces-framework/block-type";
15
+ import { BaseReadModel, JobStatus, PropagationMode, WriteHandleFactory, createEmptyDocument, defaultReadModelIndexingConfig, deleteDocumentAction, isPurgeMarker, jobIdsOf, placeholderJob, registerTelemetryGauge, remoteStagePort } from "@powerhousedao/reactor";
15
16
  import { actions, isReactorConnectorId, parseReactorConnectionConfig } from "@powerhousedao/workflow/document-models/connection";
16
17
  import http, { validateHeaderName, validateHeaderValue } from "node:http";
17
18
  import https from "node:https";
@@ -19,7 +20,6 @@ import { actions as actions$1, reducer, utils } from "@powerhousedao/workflow/do
19
20
  import { Kind, parse } from "graphql";
20
21
  import { ReactorHostServer } from "@powerhousedao/reactor/rpc";
21
22
  import { SpanStatusCode, context } from "@opentelemetry/api";
22
- import { BaseReadModel, JobStatus, PropagationMode, WriteHandleFactory, createEmptyDocument, defaultReadModelIndexingConfig, deleteDocumentAction, isPurgeMarker, jobIdsOf, placeholderJob, remoteStagePort } from "@powerhousedao/reactor";
23
23
  import { isFolderNode } from "@powerhousedao/shared/document-drive";
24
24
  import { DOCUMENT_SCOPE_ACTION_TYPES, initializeAuth, normalizeDocumentModelVersion, withSignaturePolicy } from "@powerhousedao/shared/document-model";
25
25
  import { performance as performance$1 } from "node:perf_hooks";
@@ -439,6 +439,12 @@ function tokenSetFrom(response, context, previous) {
439
439
  }
440
440
  };
441
441
  }
442
+ function relayEgress(egress) {
443
+ return {
444
+ ...egress,
445
+ allowPrivateAddresses: true
446
+ };
447
+ }
442
448
  async function exchangeCode(attempt, code, clientSecret, egress, fromRegistry = false) {
443
449
  const method = authorizationMethod(attempt.authorization_method);
444
450
  const auth = clientAuth$1(method, attempt.client_id, clientSecret);
@@ -448,7 +454,7 @@ async function exchangeCode(attempt, code, clientSecret, egress, fromRegistry =
448
454
  redirect_uri: attempt.redirect_uri,
449
455
  ...attempt.code_verifier ? { code_verifier: attempt.code_verifier } : {},
450
456
  ...auth.form
451
- }, auth.headers, egress), {
457
+ }, auth.headers, clientSecret === null ? relayEgress(egress) : egress), {
452
458
  token_url: attempt.token_url,
453
459
  authorization_method: method,
454
460
  redirect_url: attempt.redirect_uri,
@@ -523,7 +529,7 @@ var StoreTokenRefresher = class {
523
529
  grant_type: "refresh_token",
524
530
  refresh_token: tokens.refresh_token,
525
531
  ...auth.form
526
- }, auth.headers, this.egress);
532
+ }, auth.headers, tokens.relayed ? relayEgress(this.egress) : this.egress);
527
533
  } catch (error) {
528
534
  const detail = error instanceof Error ? error.message : String(error);
529
535
  if (!tokenExpired(tokens, Math.round(Date.now() / 1e3))) {
@@ -13480,7 +13486,12 @@ var WorkflowRuntimeService = class {
13480
13486
  pool.dispose();
13481
13487
  return this.pieceWorkers = pool;
13482
13488
  }
13483
- this.unobservePool = this.telemetry.observeWorkerPool(() => pool.stats());
13489
+ const unobservePool = this.telemetry.observeWorkerPool(() => pool.stats());
13490
+ const unregisterGauge = registerTelemetryGauge("workflow.pool", () => pool.memoryStats());
13491
+ this.unobservePool = () => {
13492
+ unobservePool();
13493
+ unregisterGauge();
13494
+ };
13484
13495
  return this.pieceWorkers = pool;
13485
13496
  }
13486
13497
  dispatcher() {