@objectstack/service-automation 9.4.0 → 9.5.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.
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -163,6 +163,24 @@ interface ConnectorDescriptor {
|
|
|
163
163
|
readonly icon?: string;
|
|
164
164
|
readonly actions: ConnectorActionDescriptor[];
|
|
165
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Default ceiling on the in-memory execution-log ring buffer. Execution logs are
|
|
168
|
+
* process-local and diagnostic only (launch-readiness.md P1-2); the buffer keeps
|
|
169
|
+
* the most recent N entries and evicts the oldest, so memory is bounded
|
|
170
|
+
* regardless of throughput. Operators tune the window via
|
|
171
|
+
* {@link AutomationServicePluginOptions.maxLogSize}. Durable, queryable run
|
|
172
|
+
* history is the DB-backed `sys_automation_run` store (a post-GA HA item), not
|
|
173
|
+
* this buffer.
|
|
174
|
+
*/
|
|
175
|
+
declare const DEFAULT_MAX_EXECUTION_LOG_SIZE = 1000;
|
|
176
|
+
/** Construction options for {@link AutomationEngine}. */
|
|
177
|
+
interface AutomationEngineOptions {
|
|
178
|
+
/**
|
|
179
|
+
* Max in-memory execution-log entries retained (ring buffer; oldest evicted).
|
|
180
|
+
* Defaults to {@link DEFAULT_MAX_EXECUTION_LOG_SIZE}. Must be > 0.
|
|
181
|
+
*/
|
|
182
|
+
maxLogSize?: number;
|
|
183
|
+
}
|
|
166
184
|
/**
|
|
167
185
|
* Execution step log entry. Part of a {@link SuspendedRun}'s persisted state, so
|
|
168
186
|
* it survives serialization to a durable {@link SuspendedRunStore}.
|
|
@@ -284,7 +302,7 @@ declare class AutomationEngine implements IAutomationService {
|
|
|
284
302
|
/** Connectors registered by integration plugins, keyed by connector name (ADR-0018 §Addendum). */
|
|
285
303
|
private connectors;
|
|
286
304
|
private executionLogs;
|
|
287
|
-
private maxLogSize;
|
|
305
|
+
private readonly maxLogSize;
|
|
288
306
|
private logger;
|
|
289
307
|
/**
|
|
290
308
|
* Runs paused at a node, keyed by runId (ADR-0019). In-memory hot cache —
|
|
@@ -303,7 +321,7 @@ declare class AutomationEngine implements IAutomationService {
|
|
|
303
321
|
* duplicate `resume(runId)` can't re-enter and double-run side effects.
|
|
304
322
|
*/
|
|
305
323
|
private resuming;
|
|
306
|
-
constructor(logger: Logger, store?: SuspendedRunStore);
|
|
324
|
+
constructor(logger: Logger, store?: SuspendedRunStore, options?: AutomationEngineOptions);
|
|
307
325
|
/**
|
|
308
326
|
* Attach (or replace) the durable {@link SuspendedRunStore}. Used by the
|
|
309
327
|
* service plugin to upgrade the engine to DB-backed persistence once the
|
|
@@ -4909,6 +4927,13 @@ interface AutomationServicePluginOptions {
|
|
|
4909
4927
|
* survives a process restart and can be resumed after a cold boot.
|
|
4910
4928
|
*/
|
|
4911
4929
|
suspendedRunStore?: 'auto' | 'memory';
|
|
4930
|
+
/**
|
|
4931
|
+
* Max in-memory execution-log entries retained per process (ring buffer;
|
|
4932
|
+
* oldest evicted). The buffer is diagnostic-only and already bounded
|
|
4933
|
+
* (launch-readiness.md P1-2); this just makes the window tunable. Defaults
|
|
4934
|
+
* to {@link DEFAULT_MAX_EXECUTION_LOG_SIZE} (1000).
|
|
4935
|
+
*/
|
|
4936
|
+
maxLogSize?: number;
|
|
4912
4937
|
}
|
|
4913
4938
|
/**
|
|
4914
4939
|
* AutomationServicePlugin — Core engine plugin
|
|
@@ -5055,4 +5080,4 @@ declare function registerConnectorNodes(engine: AutomationEngine, ctx: PluginCon
|
|
|
5055
5080
|
*/
|
|
5056
5081
|
declare function installBuiltinNodes(engine: AutomationEngine, ctx: PluginContext): void;
|
|
5057
5082
|
|
|
5058
|
-
export { AutomationEngine, AutomationServicePlugin, type AutomationServicePluginOptions, type ConnectorActionContext, type ConnectorActionDescriptor, type ConnectorActionHandler, type ConnectorDescriptor, type FlowTrigger, type FlowTriggerBinding, InMemorySuspendedRunStore, type NodeExecutionResult, type NodeExecutor, ObjectStoreSuspendedRunStore, type RegisteredConnector, type StepLogEntry, type SuspendedRun, type SuspendedRunStore, type SuspendedRunStoreEngine, SysAutomationRun, installBuiltinNodes, registerConnectorNodes, registerCrudNodes, registerHttpNodes, registerLogicNodes, registerScreenNodes };
|
|
5083
|
+
export { AutomationEngine, type AutomationEngineOptions, AutomationServicePlugin, type AutomationServicePluginOptions, type ConnectorActionContext, type ConnectorActionDescriptor, type ConnectorActionHandler, type ConnectorDescriptor, DEFAULT_MAX_EXECUTION_LOG_SIZE, type FlowTrigger, type FlowTriggerBinding, InMemorySuspendedRunStore, type NodeExecutionResult, type NodeExecutor, ObjectStoreSuspendedRunStore, type RegisteredConnector, type StepLogEntry, type SuspendedRun, type SuspendedRunStore, type SuspendedRunStoreEngine, SysAutomationRun, installBuiltinNodes, registerConnectorNodes, registerCrudNodes, registerHttpNodes, registerLogicNodes, registerScreenNodes };
|
package/dist/index.d.ts
CHANGED
|
@@ -163,6 +163,24 @@ interface ConnectorDescriptor {
|
|
|
163
163
|
readonly icon?: string;
|
|
164
164
|
readonly actions: ConnectorActionDescriptor[];
|
|
165
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Default ceiling on the in-memory execution-log ring buffer. Execution logs are
|
|
168
|
+
* process-local and diagnostic only (launch-readiness.md P1-2); the buffer keeps
|
|
169
|
+
* the most recent N entries and evicts the oldest, so memory is bounded
|
|
170
|
+
* regardless of throughput. Operators tune the window via
|
|
171
|
+
* {@link AutomationServicePluginOptions.maxLogSize}. Durable, queryable run
|
|
172
|
+
* history is the DB-backed `sys_automation_run` store (a post-GA HA item), not
|
|
173
|
+
* this buffer.
|
|
174
|
+
*/
|
|
175
|
+
declare const DEFAULT_MAX_EXECUTION_LOG_SIZE = 1000;
|
|
176
|
+
/** Construction options for {@link AutomationEngine}. */
|
|
177
|
+
interface AutomationEngineOptions {
|
|
178
|
+
/**
|
|
179
|
+
* Max in-memory execution-log entries retained (ring buffer; oldest evicted).
|
|
180
|
+
* Defaults to {@link DEFAULT_MAX_EXECUTION_LOG_SIZE}. Must be > 0.
|
|
181
|
+
*/
|
|
182
|
+
maxLogSize?: number;
|
|
183
|
+
}
|
|
166
184
|
/**
|
|
167
185
|
* Execution step log entry. Part of a {@link SuspendedRun}'s persisted state, so
|
|
168
186
|
* it survives serialization to a durable {@link SuspendedRunStore}.
|
|
@@ -284,7 +302,7 @@ declare class AutomationEngine implements IAutomationService {
|
|
|
284
302
|
/** Connectors registered by integration plugins, keyed by connector name (ADR-0018 §Addendum). */
|
|
285
303
|
private connectors;
|
|
286
304
|
private executionLogs;
|
|
287
|
-
private maxLogSize;
|
|
305
|
+
private readonly maxLogSize;
|
|
288
306
|
private logger;
|
|
289
307
|
/**
|
|
290
308
|
* Runs paused at a node, keyed by runId (ADR-0019). In-memory hot cache —
|
|
@@ -303,7 +321,7 @@ declare class AutomationEngine implements IAutomationService {
|
|
|
303
321
|
* duplicate `resume(runId)` can't re-enter and double-run side effects.
|
|
304
322
|
*/
|
|
305
323
|
private resuming;
|
|
306
|
-
constructor(logger: Logger, store?: SuspendedRunStore);
|
|
324
|
+
constructor(logger: Logger, store?: SuspendedRunStore, options?: AutomationEngineOptions);
|
|
307
325
|
/**
|
|
308
326
|
* Attach (or replace) the durable {@link SuspendedRunStore}. Used by the
|
|
309
327
|
* service plugin to upgrade the engine to DB-backed persistence once the
|
|
@@ -4909,6 +4927,13 @@ interface AutomationServicePluginOptions {
|
|
|
4909
4927
|
* survives a process restart and can be resumed after a cold boot.
|
|
4910
4928
|
*/
|
|
4911
4929
|
suspendedRunStore?: 'auto' | 'memory';
|
|
4930
|
+
/**
|
|
4931
|
+
* Max in-memory execution-log entries retained per process (ring buffer;
|
|
4932
|
+
* oldest evicted). The buffer is diagnostic-only and already bounded
|
|
4933
|
+
* (launch-readiness.md P1-2); this just makes the window tunable. Defaults
|
|
4934
|
+
* to {@link DEFAULT_MAX_EXECUTION_LOG_SIZE} (1000).
|
|
4935
|
+
*/
|
|
4936
|
+
maxLogSize?: number;
|
|
4912
4937
|
}
|
|
4913
4938
|
/**
|
|
4914
4939
|
* AutomationServicePlugin — Core engine plugin
|
|
@@ -5055,4 +5080,4 @@ declare function registerConnectorNodes(engine: AutomationEngine, ctx: PluginCon
|
|
|
5055
5080
|
*/
|
|
5056
5081
|
declare function installBuiltinNodes(engine: AutomationEngine, ctx: PluginContext): void;
|
|
5057
5082
|
|
|
5058
|
-
export { AutomationEngine, AutomationServicePlugin, type AutomationServicePluginOptions, type ConnectorActionContext, type ConnectorActionDescriptor, type ConnectorActionHandler, type ConnectorDescriptor, type FlowTrigger, type FlowTriggerBinding, InMemorySuspendedRunStore, type NodeExecutionResult, type NodeExecutor, ObjectStoreSuspendedRunStore, type RegisteredConnector, type StepLogEntry, type SuspendedRun, type SuspendedRunStore, type SuspendedRunStoreEngine, SysAutomationRun, installBuiltinNodes, registerConnectorNodes, registerCrudNodes, registerHttpNodes, registerLogicNodes, registerScreenNodes };
|
|
5083
|
+
export { AutomationEngine, type AutomationEngineOptions, AutomationServicePlugin, type AutomationServicePluginOptions, type ConnectorActionContext, type ConnectorActionDescriptor, type ConnectorActionHandler, type ConnectorDescriptor, DEFAULT_MAX_EXECUTION_LOG_SIZE, type FlowTrigger, type FlowTriggerBinding, InMemorySuspendedRunStore, type NodeExecutionResult, type NodeExecutor, ObjectStoreSuspendedRunStore, type RegisteredConnector, type StepLogEntry, type SuspendedRun, type SuspendedRunStore, type SuspendedRunStoreEngine, SysAutomationRun, installBuiltinNodes, registerConnectorNodes, registerCrudNodes, registerHttpNodes, registerLogicNodes, registerScreenNodes };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { FlowSchema, FLOW_STRUCTURAL_NODE_TYPES, validateControlFlow, findRegionEntry, defineActionDescriptor } from "@objectstack/spec/automation";
|
|
3
3
|
import { ConnectorSchema } from "@objectstack/spec/integration";
|
|
4
4
|
import { ExpressionEngine, validateExpression } from "@objectstack/formula";
|
|
5
|
+
var DEFAULT_MAX_EXECUTION_LOG_SIZE = 1e3;
|
|
5
6
|
var FlowSuspendSignal = class {
|
|
6
7
|
constructor(nodeId, correlation, screen) {
|
|
7
8
|
this.nodeId = nodeId;
|
|
@@ -14,7 +15,7 @@ function isSuspendSignal(err) {
|
|
|
14
15
|
return typeof err === "object" && err !== null && err.__flowSuspend === true;
|
|
15
16
|
}
|
|
16
17
|
var _AutomationEngine = class _AutomationEngine {
|
|
17
|
-
constructor(logger, store) {
|
|
18
|
+
constructor(logger, store, options) {
|
|
18
19
|
this.flows = /* @__PURE__ */ new Map();
|
|
19
20
|
this.flowEnabled = /* @__PURE__ */ new Map();
|
|
20
21
|
this.flowVersionHistory = /* @__PURE__ */ new Map();
|
|
@@ -30,7 +31,6 @@ var _AutomationEngine = class _AutomationEngine {
|
|
|
30
31
|
/** Connectors registered by integration plugins, keyed by connector name (ADR-0018 §Addendum). */
|
|
31
32
|
this.connectors = /* @__PURE__ */ new Map();
|
|
32
33
|
this.executionLogs = [];
|
|
33
|
-
this.maxLogSize = 1e3;
|
|
34
34
|
/**
|
|
35
35
|
* Runs paused at a node, keyed by runId (ADR-0019). In-memory hot cache —
|
|
36
36
|
* mirrored to {@link store} when one is configured, so a pause survives a
|
|
@@ -44,6 +44,7 @@ var _AutomationEngine = class _AutomationEngine {
|
|
|
44
44
|
this.resuming = /* @__PURE__ */ new Set();
|
|
45
45
|
this.logger = logger;
|
|
46
46
|
this.store = store;
|
|
47
|
+
this.maxLogSize = options?.maxLogSize ?? DEFAULT_MAX_EXECUTION_LOG_SIZE;
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
50
|
* Attach (or replace) the durable {@link SuspendedRunStore}. Used by the
|
|
@@ -2970,7 +2971,9 @@ var AutomationServicePlugin = class {
|
|
|
2970
2971
|
this.options = options;
|
|
2971
2972
|
}
|
|
2972
2973
|
async init(ctx) {
|
|
2973
|
-
this.engine = new AutomationEngine(ctx.logger
|
|
2974
|
+
this.engine = new AutomationEngine(ctx.logger, void 0, {
|
|
2975
|
+
maxLogSize: this.options.maxLogSize
|
|
2976
|
+
});
|
|
2974
2977
|
ctx.registerService("automation", this.engine);
|
|
2975
2978
|
if ((this.options.suspendedRunStore ?? "auto") !== "memory") {
|
|
2976
2979
|
try {
|
|
@@ -3080,6 +3083,7 @@ var AutomationServicePlugin = class {
|
|
|
3080
3083
|
export {
|
|
3081
3084
|
AutomationEngine,
|
|
3082
3085
|
AutomationServicePlugin,
|
|
3086
|
+
DEFAULT_MAX_EXECUTION_LOG_SIZE,
|
|
3083
3087
|
InMemorySuspendedRunStore,
|
|
3084
3088
|
ObjectStoreSuspendedRunStore,
|
|
3085
3089
|
SysAutomationRun,
|