@orbytautomation/engine 0.6.2 → 0.7.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/adapters/AdapterRegistry.d.ts.map +1 -1
- package/dist/adapters/AdapterRegistry.js +2 -1
- package/dist/adapters/AdapterRegistry.js.map +1 -1
- package/dist/adapters/builtins/CLIAdapter.d.ts.map +1 -1
- package/dist/adapters/builtins/CLIAdapter.js +6 -5
- package/dist/adapters/builtins/CLIAdapter.js.map +1 -1
- package/dist/core/EngineConfig.d.ts.map +1 -1
- package/dist/core/EngineConfig.js +6 -2
- package/dist/core/EngineConfig.js.map +1 -1
- package/dist/core/OrbytEngine.d.ts +19 -0
- package/dist/core/OrbytEngine.d.ts.map +1 -1
- package/dist/core/OrbytEngine.js +36 -0
- package/dist/core/OrbytEngine.js.map +1 -1
- package/dist/execution/StepExecutor.d.ts.map +1 -1
- package/dist/execution/StepExecutor.js +11 -9
- package/dist/execution/StepExecutor.js.map +1 -1
- package/dist/execution/WorkflowExecutor.d.ts +6 -0
- package/dist/execution/WorkflowExecutor.d.ts.map +1 -1
- package/dist/execution/WorkflowExecutor.js +27 -5
- package/dist/execution/WorkflowExecutor.js.map +1 -1
- package/dist/storage/ExecutionStore.d.ts +102 -1
- package/dist/storage/ExecutionStore.d.ts.map +1 -1
- package/dist/storage/ExecutionStore.js +188 -1
- package/dist/storage/ExecutionStore.js.map +1 -1
- package/dist/storage/ScheduleStore.d.ts +154 -1
- package/dist/storage/ScheduleStore.d.ts.map +1 -1
- package/dist/storage/ScheduleStore.js +208 -1
- package/dist/storage/ScheduleStore.js.map +1 -1
- package/dist/storage/WorkflowStore.d.ts +82 -1
- package/dist/storage/WorkflowStore.d.ts.map +1 -1
- package/dist/storage/WorkflowStore.js +183 -1
- package/dist/storage/WorkflowStore.js.map +1 -1
- package/dist/storage/index.d.ts +3 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +3 -4
- package/dist/storage/index.js.map +1 -1
- package/dist/types/core-types.d.ts +2 -0
- package/dist/types/core-types.d.ts.map +1 -1
- package/dist/types/core-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,209 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Schedule Store
|
|
3
|
+
*
|
|
4
|
+
* Persists workflow schedule state under .orbyt/schedules/.
|
|
5
|
+
* One JSON file per schedule; enables restart recovery so the scheduler
|
|
6
|
+
* can reload all known schedules without re-registration by callers.
|
|
7
|
+
*
|
|
8
|
+
* Layout:
|
|
9
|
+
* .orbyt/schedules/<scheduleId>.json
|
|
10
|
+
*
|
|
11
|
+
* Primary purposes:
|
|
12
|
+
* - Persist cron/interval schedules so they survive process restarts
|
|
13
|
+
* - Track last-run / next-run timestamps for missed-run recovery
|
|
14
|
+
* - Record consecutive error counts for circuit-breaker logic
|
|
15
|
+
*
|
|
16
|
+
* All methods are non-fatal (errors are swallowed) — the store must never
|
|
17
|
+
* interrupt the scheduler or workflow execution.
|
|
18
|
+
*
|
|
19
|
+
* @module storage
|
|
20
|
+
*/
|
|
21
|
+
import { mkdirSync, writeFileSync, readFileSync, existsSync, readdirSync, rmSync, } from 'node:fs';
|
|
22
|
+
import { join, basename } from 'node:path';
|
|
23
|
+
// ─── ScheduleStore ────────────────────────────────────────────────────────────
|
|
24
|
+
/**
|
|
25
|
+
* File-based schedule state store.
|
|
26
|
+
*
|
|
27
|
+
* An in-memory cache avoids re-reading files on every access.
|
|
28
|
+
* The cache is always the source of truth for in-flight updates;
|
|
29
|
+
* the file acts as the durable record for restarts.
|
|
30
|
+
*/
|
|
31
|
+
export class ScheduleStore {
|
|
32
|
+
dir;
|
|
33
|
+
/** In-memory cache: scheduleId → current state */
|
|
34
|
+
cache = new Map();
|
|
35
|
+
constructor(dir) {
|
|
36
|
+
this.dir = dir;
|
|
37
|
+
}
|
|
38
|
+
// ─── Write API ─────────────────────────────────────────────────────────────
|
|
39
|
+
/**
|
|
40
|
+
* Persist a schedule record.
|
|
41
|
+
* Creates the storage directory on first call.
|
|
42
|
+
* If the schedule already exists it is fully replaced.
|
|
43
|
+
*/
|
|
44
|
+
save(schedule) {
|
|
45
|
+
try {
|
|
46
|
+
mkdirSync(this.dir, { recursive: true });
|
|
47
|
+
const updated = {
|
|
48
|
+
...schedule,
|
|
49
|
+
updatedAt: new Date().toISOString(),
|
|
50
|
+
};
|
|
51
|
+
this.cache.set(schedule.scheduleId, updated);
|
|
52
|
+
this._write(schedule.scheduleId, updated);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Non-fatal
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Record the outcome of a schedule trigger.
|
|
60
|
+
*
|
|
61
|
+
* - Updates `lastRunAt`, `lastStatus`, `nextRunAt`
|
|
62
|
+
* - Increments `executionCount`
|
|
63
|
+
* - On success: resets `errorCount` and clears `lastError`
|
|
64
|
+
* - On failure: increments `errorCount` and stores `lastError`
|
|
65
|
+
*/
|
|
66
|
+
updateLastRun(scheduleId, status, runAt, nextRunAt, error) {
|
|
67
|
+
try {
|
|
68
|
+
const record = this._getOrLoad(scheduleId);
|
|
69
|
+
if (!record)
|
|
70
|
+
return;
|
|
71
|
+
record.lastRunAt = runAt.toISOString();
|
|
72
|
+
record.lastStatus = status;
|
|
73
|
+
record.executionCount = (record.executionCount ?? 0) + 1;
|
|
74
|
+
if (nextRunAt)
|
|
75
|
+
record.nextRunAt = nextRunAt.toISOString();
|
|
76
|
+
if (status === 'completed') {
|
|
77
|
+
record.errorCount = 0;
|
|
78
|
+
delete record.lastError;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
record.errorCount = (record.errorCount ?? 0) + 1;
|
|
82
|
+
if (error)
|
|
83
|
+
record.lastError = error;
|
|
84
|
+
}
|
|
85
|
+
record.updatedAt = new Date().toISOString();
|
|
86
|
+
this.cache.set(scheduleId, record);
|
|
87
|
+
this._write(scheduleId, record);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Non-fatal
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Mark a schedule as active.
|
|
95
|
+
* No-op if the schedule does not exist.
|
|
96
|
+
*/
|
|
97
|
+
enable(scheduleId) {
|
|
98
|
+
this._setStatus(scheduleId, 'active');
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Mark a schedule as paused — it will not fire until re-enabled.
|
|
102
|
+
* No-op if the schedule does not exist.
|
|
103
|
+
*/
|
|
104
|
+
disable(scheduleId) {
|
|
105
|
+
this._setStatus(scheduleId, 'paused');
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Remove a schedule from both the cache and disk.
|
|
109
|
+
* Safe to call if the schedule does not exist.
|
|
110
|
+
*/
|
|
111
|
+
delete(scheduleId) {
|
|
112
|
+
try {
|
|
113
|
+
this.cache.delete(scheduleId);
|
|
114
|
+
const filePath = this._filePath(scheduleId);
|
|
115
|
+
if (existsSync(filePath))
|
|
116
|
+
rmSync(filePath);
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// Non-fatal
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// ─── Read API ──────────────────────────────────────────────────────────────
|
|
123
|
+
/**
|
|
124
|
+
* Read a single schedule by ID.
|
|
125
|
+
* Returns null if not found.
|
|
126
|
+
*/
|
|
127
|
+
load(scheduleId) {
|
|
128
|
+
try {
|
|
129
|
+
const cached = this.cache.get(scheduleId);
|
|
130
|
+
if (cached)
|
|
131
|
+
return { ...cached };
|
|
132
|
+
const filePath = this._filePath(scheduleId);
|
|
133
|
+
if (!existsSync(filePath))
|
|
134
|
+
return null;
|
|
135
|
+
return JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Return all persisted schedules, sorted by `createdAt` ascending.
|
|
143
|
+
*/
|
|
144
|
+
list() {
|
|
145
|
+
try {
|
|
146
|
+
mkdirSync(this.dir, { recursive: true });
|
|
147
|
+
return readdirSync(this.dir)
|
|
148
|
+
.filter(f => f.endsWith('.json'))
|
|
149
|
+
.flatMap(f => {
|
|
150
|
+
try {
|
|
151
|
+
const id = basename(f, '.json');
|
|
152
|
+
const record = this._getOrLoad(id);
|
|
153
|
+
return record ? [record] : [];
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
})
|
|
159
|
+
.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Return only schedules that are currently active.
|
|
167
|
+
*/
|
|
168
|
+
listEnabled() {
|
|
169
|
+
return this.list().filter(s => s.status === 'active');
|
|
170
|
+
}
|
|
171
|
+
// ─── Internal helpers ──────────────────────────────────────────────────────
|
|
172
|
+
_setStatus(scheduleId, status) {
|
|
173
|
+
try {
|
|
174
|
+
const record = this._getOrLoad(scheduleId);
|
|
175
|
+
if (!record)
|
|
176
|
+
return;
|
|
177
|
+
record.status = status;
|
|
178
|
+
record.updatedAt = new Date().toISOString();
|
|
179
|
+
this.cache.set(scheduleId, record);
|
|
180
|
+
this._write(scheduleId, record);
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
// Non-fatal
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
_getOrLoad(scheduleId) {
|
|
187
|
+
const cached = this.cache.get(scheduleId);
|
|
188
|
+
if (cached)
|
|
189
|
+
return cached;
|
|
190
|
+
const filePath = this._filePath(scheduleId);
|
|
191
|
+
if (!existsSync(filePath))
|
|
192
|
+
return null;
|
|
193
|
+
try {
|
|
194
|
+
const record = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
195
|
+
this.cache.set(scheduleId, record);
|
|
196
|
+
return record;
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
_filePath(scheduleId) {
|
|
203
|
+
return join(this.dir, `${scheduleId}.json`);
|
|
204
|
+
}
|
|
205
|
+
_write(scheduleId, record) {
|
|
206
|
+
writeFileSync(this._filePath(scheduleId), JSON.stringify(record, null, 2), 'utf-8');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
2
209
|
//# sourceMappingURL=ScheduleStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleStore.js","sourceRoot":"","sources":["../../src/storage/ScheduleStore.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ScheduleStore.js","sourceRoot":"","sources":["../../src/storage/ScheduleStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,EACX,MAAM,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA6F3C,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,OAAO,aAAa;IACP,GAAG,CAAS;IAC7B,kDAAkD;IACjC,KAAK,GAAG,IAAI,GAAG,EAA6B,CAAC;IAE9D,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,8EAA8E;IAE9E;;;;OAIG;IACH,IAAI,CAAC,QAA2B;QAC9B,IAAI,CAAC;YACH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACzC,MAAM,OAAO,GAAsB;gBACjC,GAAG,QAAQ;gBACX,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CAAC;YACF,IAAI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AI,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,YAAY;QACd,CAAC;IACH,CAAC;IAEO,UAAU,CAAC,UAAkB;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAE1B,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC;QACvC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAsB,CAAC;YAChF,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACnC,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,UAAkB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,UAAU,OAAO,CAAC,CAAC;IAC9C,CAAC;IAEO,MAAM,CAAC,UAAkB,EAAE,MAAyB;QAC1D,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;CACF"}
|
|
@@ -1,2 +1,83 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Store
|
|
3
|
+
*
|
|
4
|
+
* Persists versioned workflow definitions under .orbyt/workflows/.
|
|
5
|
+
* Each workflow gets its own subdirectory; each save creates a new versioned file.
|
|
6
|
+
*
|
|
7
|
+
* Layout:
|
|
8
|
+
* .orbyt/workflows/<workflowName>/v1.json
|
|
9
|
+
* .orbyt/workflows/<workflowName>/v2.json
|
|
10
|
+
* ...
|
|
11
|
+
*
|
|
12
|
+
* Primary purpose: replay a failed run against the exact workflow definition
|
|
13
|
+
* that was used — not against a potentially-modified current version.
|
|
14
|
+
*
|
|
15
|
+
* All methods are non-fatal (errors are swallowed) — the store must never
|
|
16
|
+
* interrupt actual workflow execution.
|
|
17
|
+
*
|
|
18
|
+
* @module storage
|
|
19
|
+
*/
|
|
20
|
+
import type { ParsedWorkflow } from '../types/core-types.js';
|
|
21
|
+
export interface PersistedWorkflow {
|
|
22
|
+
/** Workflow identifier (name or generated) */
|
|
23
|
+
workflowId: string;
|
|
24
|
+
/** Version number (1-based, auto-incremented) */
|
|
25
|
+
version: number;
|
|
26
|
+
/** ISO 8601 timestamp of when this version was saved */
|
|
27
|
+
savedAt: string;
|
|
28
|
+
/** The full parsed workflow definition */
|
|
29
|
+
definition: ParsedWorkflow;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* File-based workflow definition store.
|
|
33
|
+
*
|
|
34
|
+
* Stores multiple versions of each workflow definition so a failed execution
|
|
35
|
+
* can always be replayed against the exact definition that produced it.
|
|
36
|
+
*
|
|
37
|
+
* An in-memory cache for the latest version of each workflow avoids
|
|
38
|
+
* re-reading the file on every `save()` call.
|
|
39
|
+
*/
|
|
40
|
+
export declare class WorkflowStore {
|
|
41
|
+
private readonly dir;
|
|
42
|
+
/** Cache: workflowId → latest saved version number */
|
|
43
|
+
private readonly latestVersionCache;
|
|
44
|
+
constructor(dir: string);
|
|
45
|
+
/**
|
|
46
|
+
* Save a workflow definition.
|
|
47
|
+
* A new version file is created on each call; the version number is
|
|
48
|
+
* determined by inspecting existing files (or the cache).
|
|
49
|
+
*/
|
|
50
|
+
save(workflow: ParsedWorkflow): void;
|
|
51
|
+
/**
|
|
52
|
+
* Load the most recently saved version of a workflow.
|
|
53
|
+
* Returns null if the workflow has never been saved.
|
|
54
|
+
*/
|
|
55
|
+
loadLatest(workflowId: string): PersistedWorkflow | null;
|
|
56
|
+
/**
|
|
57
|
+
* Load a specific version of a workflow.
|
|
58
|
+
* When `version` is omitted the latest version is returned.
|
|
59
|
+
*/
|
|
60
|
+
load(workflowId: string, version?: number): PersistedWorkflow | null;
|
|
61
|
+
/**
|
|
62
|
+
* Return all saved version numbers for a workflow, sorted newest-first.
|
|
63
|
+
*/
|
|
64
|
+
listVersions(workflowId: string): number[];
|
|
65
|
+
/**
|
|
66
|
+
* Return all workflow IDs that have at least one saved version.
|
|
67
|
+
*/
|
|
68
|
+
list(): string[];
|
|
69
|
+
/**
|
|
70
|
+
* Delete a specific version of a workflow, or all versions if `version`
|
|
71
|
+
* is omitted (removes the entire workflow subdirectory).
|
|
72
|
+
*/
|
|
73
|
+
delete(workflowId: string, version?: number): void;
|
|
74
|
+
/** Derive a stable ID from the workflow — prefer `name`, fallback to `metadata.name`. */
|
|
75
|
+
private _resolveId;
|
|
76
|
+
/**
|
|
77
|
+
* Calculate the next version number.
|
|
78
|
+
* Reads the cache first; if not cached, scans the directory.
|
|
79
|
+
*/
|
|
80
|
+
private _nextVersion;
|
|
81
|
+
private _readVersion;
|
|
82
|
+
}
|
|
2
83
|
//# sourceMappingURL=WorkflowStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowStore.d.ts","sourceRoot":"","sources":["../../src/storage/WorkflowStore.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"WorkflowStore.d.ts","sourceRoot":"","sources":["../../src/storage/WorkflowStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,cAAc,CAAC;CAC5B;AAID;;;;;;;;GAQG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,sDAAsD;IACtD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA6B;gBAEpD,GAAG,EAAE,MAAM;IAMvB;;;;OAIG;IACH,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IA2BpC;;;OAGG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IAUxD;;;OAGG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IASpE;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE;IAa1C;;OAEG;IACH,IAAI,IAAI,MAAM,EAAE;IAYhB;;;OAGG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAqBlD,yFAAyF;IACzF,OAAO,CAAC,UAAU;IAMlB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,YAAY;CAKrB"}
|
|
@@ -1,2 +1,184 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Store
|
|
3
|
+
*
|
|
4
|
+
* Persists versioned workflow definitions under .orbyt/workflows/.
|
|
5
|
+
* Each workflow gets its own subdirectory; each save creates a new versioned file.
|
|
6
|
+
*
|
|
7
|
+
* Layout:
|
|
8
|
+
* .orbyt/workflows/<workflowName>/v1.json
|
|
9
|
+
* .orbyt/workflows/<workflowName>/v2.json
|
|
10
|
+
* ...
|
|
11
|
+
*
|
|
12
|
+
* Primary purpose: replay a failed run against the exact workflow definition
|
|
13
|
+
* that was used — not against a potentially-modified current version.
|
|
14
|
+
*
|
|
15
|
+
* All methods are non-fatal (errors are swallowed) — the store must never
|
|
16
|
+
* interrupt actual workflow execution.
|
|
17
|
+
*
|
|
18
|
+
* @module storage
|
|
19
|
+
*/
|
|
20
|
+
import { mkdirSync, writeFileSync, readFileSync, existsSync, readdirSync, rmSync, } from 'node:fs';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
// ─── WorkflowStore ────────────────────────────────────────────────────────────
|
|
23
|
+
/**
|
|
24
|
+
* File-based workflow definition store.
|
|
25
|
+
*
|
|
26
|
+
* Stores multiple versions of each workflow definition so a failed execution
|
|
27
|
+
* can always be replayed against the exact definition that produced it.
|
|
28
|
+
*
|
|
29
|
+
* An in-memory cache for the latest version of each workflow avoids
|
|
30
|
+
* re-reading the file on every `save()` call.
|
|
31
|
+
*/
|
|
32
|
+
export class WorkflowStore {
|
|
33
|
+
dir;
|
|
34
|
+
/** Cache: workflowId → latest saved version number */
|
|
35
|
+
latestVersionCache = new Map();
|
|
36
|
+
constructor(dir) {
|
|
37
|
+
this.dir = dir;
|
|
38
|
+
}
|
|
39
|
+
// ─── Write API ─────────────────────────────────────────────────────────────
|
|
40
|
+
/**
|
|
41
|
+
* Save a workflow definition.
|
|
42
|
+
* A new version file is created on each call; the version number is
|
|
43
|
+
* determined by inspecting existing files (or the cache).
|
|
44
|
+
*/
|
|
45
|
+
save(workflow) {
|
|
46
|
+
try {
|
|
47
|
+
const workflowId = this._resolveId(workflow);
|
|
48
|
+
const workflowDir = join(this.dir, workflowId);
|
|
49
|
+
mkdirSync(workflowDir, { recursive: true });
|
|
50
|
+
const nextVersion = this._nextVersion(workflowId, workflowDir);
|
|
51
|
+
const record = {
|
|
52
|
+
workflowId,
|
|
53
|
+
version: nextVersion,
|
|
54
|
+
savedAt: new Date().toISOString(),
|
|
55
|
+
definition: workflow,
|
|
56
|
+
};
|
|
57
|
+
writeFileSync(join(workflowDir, `v${nextVersion}.json`), JSON.stringify(record, null, 2), 'utf-8');
|
|
58
|
+
this.latestVersionCache.set(workflowId, nextVersion);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Non-fatal
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// ─── Read API ──────────────────────────────────────────────────────────────
|
|
65
|
+
/**
|
|
66
|
+
* Load the most recently saved version of a workflow.
|
|
67
|
+
* Returns null if the workflow has never been saved.
|
|
68
|
+
*/
|
|
69
|
+
loadLatest(workflowId) {
|
|
70
|
+
try {
|
|
71
|
+
const versions = this.listVersions(workflowId);
|
|
72
|
+
if (versions.length === 0)
|
|
73
|
+
return null;
|
|
74
|
+
return this._readVersion(workflowId, versions[0]);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Load a specific version of a workflow.
|
|
82
|
+
* When `version` is omitted the latest version is returned.
|
|
83
|
+
*/
|
|
84
|
+
load(workflowId, version) {
|
|
85
|
+
try {
|
|
86
|
+
if (version === undefined)
|
|
87
|
+
return this.loadLatest(workflowId);
|
|
88
|
+
return this._readVersion(workflowId, version);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Return all saved version numbers for a workflow, sorted newest-first.
|
|
96
|
+
*/
|
|
97
|
+
listVersions(workflowId) {
|
|
98
|
+
try {
|
|
99
|
+
const workflowDir = join(this.dir, workflowId);
|
|
100
|
+
if (!existsSync(workflowDir))
|
|
101
|
+
return [];
|
|
102
|
+
return readdirSync(workflowDir)
|
|
103
|
+
.filter(f => /^v\d+\.json$/.test(f))
|
|
104
|
+
.map(f => parseInt(f.slice(1, -5), 10))
|
|
105
|
+
.sort((a, b) => b - a); // newest first
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Return all workflow IDs that have at least one saved version.
|
|
113
|
+
*/
|
|
114
|
+
list() {
|
|
115
|
+
try {
|
|
116
|
+
mkdirSync(this.dir, { recursive: true });
|
|
117
|
+
return readdirSync(this.dir, { withFileTypes: true })
|
|
118
|
+
.filter(e => e.isDirectory())
|
|
119
|
+
.map(e => e.name)
|
|
120
|
+
.sort();
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Delete a specific version of a workflow, or all versions if `version`
|
|
128
|
+
* is omitted (removes the entire workflow subdirectory).
|
|
129
|
+
*/
|
|
130
|
+
delete(workflowId, version) {
|
|
131
|
+
try {
|
|
132
|
+
if (version !== undefined) {
|
|
133
|
+
const filePath = join(this.dir, workflowId, `v${version}.json`);
|
|
134
|
+
if (existsSync(filePath))
|
|
135
|
+
rmSync(filePath);
|
|
136
|
+
// Invalidate cache if we deleted the latest version
|
|
137
|
+
if (this.latestVersionCache.get(workflowId) === version) {
|
|
138
|
+
this.latestVersionCache.delete(workflowId);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const workflowDir = join(this.dir, workflowId);
|
|
143
|
+
if (existsSync(workflowDir))
|
|
144
|
+
rmSync(workflowDir, { recursive: true });
|
|
145
|
+
this.latestVersionCache.delete(workflowId);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
// Non-fatal
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// ─── Internal helpers ──────────────────────────────────────────────────────
|
|
153
|
+
/** Derive a stable ID from the workflow — prefer `name`, fallback to `metadata.name`. */
|
|
154
|
+
_resolveId(workflow) {
|
|
155
|
+
const raw = workflow.name ?? workflow.metadata?.name ?? 'unnamed';
|
|
156
|
+
// Sanitise for use as a directory name (keep alphanumeric, hyphen, underscore, dot)
|
|
157
|
+
return raw.replace(/[^a-zA-Z0-9._-]/g, '_');
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Calculate the next version number.
|
|
161
|
+
* Reads the cache first; if not cached, scans the directory.
|
|
162
|
+
*/
|
|
163
|
+
_nextVersion(workflowId, workflowDir) {
|
|
164
|
+
const cached = this.latestVersionCache.get(workflowId);
|
|
165
|
+
if (cached !== undefined)
|
|
166
|
+
return cached + 1;
|
|
167
|
+
try {
|
|
168
|
+
const existing = readdirSync(workflowDir)
|
|
169
|
+
.filter(f => /^v\d+\.json$/.test(f))
|
|
170
|
+
.map(f => parseInt(f.slice(1, -5), 10));
|
|
171
|
+
return existing.length === 0 ? 1 : Math.max(...existing) + 1;
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return 1;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
_readVersion(workflowId, version) {
|
|
178
|
+
const filePath = join(this.dir, workflowId, `v${version}.json`);
|
|
179
|
+
if (!existsSync(filePath))
|
|
180
|
+
return null;
|
|
181
|
+
return JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
2
184
|
//# sourceMappingURL=WorkflowStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowStore.js","sourceRoot":"","sources":["../../src/storage/WorkflowStore.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"WorkflowStore.js","sourceRoot":"","sources":["../../src/storage/WorkflowStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,EACX,MAAM,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAgBjC,iFAAiF;AAEjF;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAa;IACP,GAAG,CAAS;IAC7B,sDAAsD;IACrC,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEhE,YAAY,GAAW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9C,CAAC;IAED;;;OAGG;IACK,YAAY,CAAC,UAAkB,EAAE,WAAmB;QAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvD,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,MAAM,GAAG,CAAC,CAAC;QAE5C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC;iBACtC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBACnC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC1C,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC/D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAEO,YAAY,CAAC,UAAkB,EAAE,OAAe;QACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,OAAO,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAsB,CAAC;IAC1E,CAAC;CACF"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
|
package/dist/storage/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// export * from './WorkflowStore.js';
|
|
1
|
+
export * from './ExecutionStore.js';
|
|
2
|
+
export * from './ScheduleStore.js';
|
|
3
|
+
export * from './WorkflowStore.js';
|
|
5
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
|
|
@@ -749,6 +749,8 @@ export interface ParsedStep {
|
|
|
749
749
|
export interface WorkflowResult {
|
|
750
750
|
/** Workflow name */
|
|
751
751
|
workflowName: string;
|
|
752
|
+
/** Unique execution identifier */
|
|
753
|
+
executionId: string;
|
|
752
754
|
/** Overall status */
|
|
753
755
|
status: 'success' | 'failure' | 'partial' | 'timeout';
|
|
754
756
|
/** All step results */
|