@axlsdk/axl 0.26.0 → 0.27.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/README.md +17 -4
- package/dist/index.cjs +1336 -238
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +508 -55
- package/dist/index.d.ts +508 -55
- package/dist/index.js +1336 -238
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -755,7 +755,9 @@ const store = await RedisStore.create({
|
|
|
755
755
|
|
|
756
756
|
The prefix is concatenated as-given — no normalization. Include a trailing colon if you want one. Empty string is rejected.
|
|
757
757
|
|
|
758
|
-
**TTLs are strongly recommended in production** — without them every `save*` accumulates forever and Redis eventually OOMs. Sliding window: `memory`, `session`, `sessionMeta` (every write refreshes; reads do NOT). Fixed
|
|
758
|
+
**TTLs are strongly recommended in production** — without them every `save*` accumulates forever and Redis eventually OOMs. Sliding window: `memory`, `session`, `sessionMeta` (every write refreshes; reads do NOT). Fixed from the first write: `checkpoint`, `streamingEvents`, `evalHistory` (re-saves and corrections keep an eval row's expiry). Restarted on every save: `executionState`, `executionHistory`. `streamingEvents` is opt-in only (does NOT fall back to `defaultTtl`). See [api-reference.md](../../docs/api-reference.md#redisstore-options) for the full table.
|
|
759
|
+
|
|
760
|
+
`MemoryStore` and `SQLiteStore` take the same `ttls.executionHistory` / `ttls.evalHistory`; `MemoryStore` keeps the newest 1 000 runs by default (`maxExecutions`). See the [execution history retention guide](../../docs/migration/execution-history-retention.md).
|
|
759
761
|
|
|
760
762
|
#### Crash survival: `state.persist: 'streaming'`
|
|
761
763
|
|
|
@@ -771,8 +773,7 @@ const runtime = new AxlRuntime({
|
|
|
771
773
|
},
|
|
772
774
|
});
|
|
773
775
|
|
|
774
|
-
// Boot sequence:
|
|
775
|
-
await runtime.getExecutions();
|
|
776
|
+
// Boot sequence: recover THEN accept new work
|
|
776
777
|
const recovered = await runtime.recoverIncompleteStreams();
|
|
777
778
|
console.log(`Recovered ${recovered.length} crashed executions`);
|
|
778
779
|
app.listen(3000);
|
|
@@ -803,7 +804,19 @@ runtime.on('decision_cleanup_failed', (e) => {
|
|
|
803
804
|
|
|
804
805
|
If the execution is still running, the workflow is aborted (and a paused `ctx.awaitHuman()` correctly wakes with `AbortError` — fixed in 0.17.7). The resurrection guard ensures the workflow's eventual `workflow_end` doesn't re-create the row. Deletion waits for any in-process approval resolution or cancellation compensation before the store sweep. Custom stores must make `resolveDecision` idempotent and implement the complete execution-scoped sweep in `deleteExecution`.
|
|
805
806
|
|
|
806
|
-
`ExecutionInfo.metadata` round-trips from `ExecuteOptions.metadata` (`userId`, `tenantId`, etc.)
|
|
807
|
+
`ExecutionInfo.metadata` round-trips from `ExecuteOptions.metadata` (`userId`, `tenantId`, etc.). Filter on it as you read history; for large histories, read a page at a time:
|
|
808
|
+
|
|
809
|
+
```typescript
|
|
810
|
+
let cursor: ExecutionCursor | undefined;
|
|
811
|
+
do {
|
|
812
|
+
const page = await runtime.getExecutions({ limit: 500, cursor });
|
|
813
|
+
for (const e of page) if (e.metadata?.tenantId === tenantId) handle(e);
|
|
814
|
+
const last = page.at(-1);
|
|
815
|
+
cursor = last && { startedAt: last.startedAt, executionId: last.executionId };
|
|
816
|
+
} while (cursor);
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
Internal session control-plane keys (`sessionHistory`, `sessionId`) are stripped before persistence; they remain available via `ctx.metadata` for dynamic selectors.
|
|
807
820
|
|
|
808
821
|
### Session Options
|
|
809
822
|
|