@objectstack/service-automation 9.3.0 → 9.5.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/dist/index.cjs CHANGED
@@ -22,6 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  AutomationEngine: () => AutomationEngine,
24
24
  AutomationServicePlugin: () => AutomationServicePlugin,
25
+ DEFAULT_MAX_EXECUTION_LOG_SIZE: () => DEFAULT_MAX_EXECUTION_LOG_SIZE,
25
26
  InMemorySuspendedRunStore: () => InMemorySuspendedRunStore,
26
27
  ObjectStoreSuspendedRunStore: () => ObjectStoreSuspendedRunStore,
27
28
  SysAutomationRun: () => SysAutomationRun,
@@ -38,6 +39,7 @@ module.exports = __toCommonJS(index_exports);
38
39
  var import_automation = require("@objectstack/spec/automation");
39
40
  var import_integration = require("@objectstack/spec/integration");
40
41
  var import_formula = require("@objectstack/formula");
42
+ var DEFAULT_MAX_EXECUTION_LOG_SIZE = 1e3;
41
43
  var FlowSuspendSignal = class {
42
44
  constructor(nodeId, correlation, screen) {
43
45
  this.nodeId = nodeId;
@@ -50,7 +52,7 @@ function isSuspendSignal(err) {
50
52
  return typeof err === "object" && err !== null && err.__flowSuspend === true;
51
53
  }
52
54
  var _AutomationEngine = class _AutomationEngine {
53
- constructor(logger, store) {
55
+ constructor(logger, store, options) {
54
56
  this.flows = /* @__PURE__ */ new Map();
55
57
  this.flowEnabled = /* @__PURE__ */ new Map();
56
58
  this.flowVersionHistory = /* @__PURE__ */ new Map();
@@ -66,7 +68,6 @@ var _AutomationEngine = class _AutomationEngine {
66
68
  /** Connectors registered by integration plugins, keyed by connector name (ADR-0018 §Addendum). */
67
69
  this.connectors = /* @__PURE__ */ new Map();
68
70
  this.executionLogs = [];
69
- this.maxLogSize = 1e3;
70
71
  /**
71
72
  * Runs paused at a node, keyed by runId (ADR-0019). In-memory hot cache —
72
73
  * mirrored to {@link store} when one is configured, so a pause survives a
@@ -80,6 +81,7 @@ var _AutomationEngine = class _AutomationEngine {
80
81
  this.resuming = /* @__PURE__ */ new Set();
81
82
  this.logger = logger;
82
83
  this.store = store;
84
+ this.maxLogSize = options?.maxLogSize ?? DEFAULT_MAX_EXECUTION_LOG_SIZE;
83
85
  }
84
86
  /**
85
87
  * Attach (or replace) the durable {@link SuspendedRunStore}. Used by the
@@ -3006,7 +3008,9 @@ var AutomationServicePlugin = class {
3006
3008
  this.options = options;
3007
3009
  }
3008
3010
  async init(ctx) {
3009
- this.engine = new AutomationEngine(ctx.logger);
3011
+ this.engine = new AutomationEngine(ctx.logger, void 0, {
3012
+ maxLogSize: this.options.maxLogSize
3013
+ });
3010
3014
  ctx.registerService("automation", this.engine);
3011
3015
  if ((this.options.suspendedRunStore ?? "auto") !== "memory") {
3012
3016
  try {
@@ -3117,6 +3121,7 @@ var AutomationServicePlugin = class {
3117
3121
  0 && (module.exports = {
3118
3122
  AutomationEngine,
3119
3123
  AutomationServicePlugin,
3124
+ DEFAULT_MAX_EXECUTION_LOG_SIZE,
3120
3125
  InMemorySuspendedRunStore,
3121
3126
  ObjectStoreSuspendedRunStore,
3122
3127
  SysAutomationRun,