@t4h.framework/core 0.9.1 → 0.10.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/.ai/skills/framework-core/SKILL.md +6 -4
- package/.ai/skills/framework-workflow-creation/SKILL.md +32 -7
- package/.ai/skills/framework-workflow-testing/SKILL.md +9 -1
- package/CHANGELOG.md +18 -0
- package/README.md +8 -0
- package/dist/core.d.ts +1 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +1 -0
- package/dist/core.js.map +1 -1
- package/dist/exceptions/TimerNotAllowedException.d.ts +5 -0
- package/dist/exceptions/TimerNotAllowedException.d.ts.map +1 -0
- package/dist/exceptions/TimerNotAllowedException.js +9 -0
- package/dist/exceptions/TimerNotAllowedException.js.map +1 -0
- package/dist/models/AsyncActivityAwaitable.d.ts +1 -1
- package/dist/models/AsyncActivityAwaitable.d.ts.map +1 -1
- package/dist/models/AsyncActivityAwaitable.js +2 -0
- package/dist/models/AsyncActivityAwaitable.js.map +1 -1
- package/dist/models/History.d.ts +17 -2
- package/dist/models/History.d.ts.map +1 -1
- package/dist/models/History.js +26 -8
- package/dist/models/History.js.map +1 -1
- package/dist/models/Logger.d.ts.map +1 -1
- package/dist/models/Logger.js +2 -1
- package/dist/models/Logger.js.map +1 -1
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +6 -35
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestWorkflowEnvironment.d.ts.map +1 -1
- package/dist/testing/TestWorkflowEnvironment.js +6 -4
- package/dist/testing/TestWorkflowEnvironment.js.map +1 -1
- package/dist/testing/tools/resolve-activity.d.ts.map +1 -1
- package/dist/testing/tools/resolve-activity.js +4 -1
- package/dist/testing/tools/resolve-activity.js.map +1 -1
- package/dist/testing/tools/resolve-async-activity.d.ts +3 -2
- package/dist/testing/tools/resolve-async-activity.d.ts.map +1 -1
- package/dist/testing/tools/resolve-async-activity.js +17 -36
- package/dist/testing/tools/resolve-async-activity.js.map +1 -1
- package/dist/testing/tools/run-workflow-ticks.d.ts.map +1 -1
- package/dist/testing/tools/run-workflow-ticks.js +6 -0
- package/dist/testing/tools/run-workflow-ticks.js.map +1 -1
- package/dist/testing/tools/run-workflow.d.ts +4 -0
- package/dist/testing/tools/run-workflow.d.ts.map +1 -1
- package/dist/testing/tools/run-workflow.js +17 -7
- package/dist/testing/tools/run-workflow.js.map +1 -1
- package/dist/tools/Deterministic.d.ts +7 -0
- package/dist/tools/Deterministic.d.ts.map +1 -0
- package/dist/tools/Deterministic.js +107 -0
- package/dist/tools/Deterministic.js.map +1 -0
- package/dist/tools/Internals.d.ts +2 -0
- package/dist/tools/Internals.d.ts.map +1 -1
- package/dist/tools/Internals.js +5 -1
- package/dist/tools/Internals.js.map +1 -1
- package/dist/tools/clock.d.ts +3 -0
- package/dist/tools/clock.d.ts.map +1 -0
- package/dist/tools/clock.js +11 -0
- package/dist/tools/clock.js.map +1 -0
- package/dist/tools/random.d.ts +3 -0
- package/dist/tools/random.d.ts.map +1 -0
- package/dist/tools/random.js +29 -0
- package/dist/tools/random.js.map +1 -0
- package/package.json +1 -1
- package/LICENSE +0 -21
|
@@ -36,7 +36,8 @@ Node `>=22`. Schemas use TypeBox (`typebox`). See [README.md](../../../README.md
|
|
|
36
36
|
|
|
37
37
|
- **Workflow** — an orchestration entrypoint: a plain async function wrapped in `new Workflow(...)`. It coordinates steps; it does not implement the steps.
|
|
38
38
|
- **App** — registers workflows so the runtime can discover and run them.
|
|
39
|
-
- **Replay & determinism** — the runtime
|
|
39
|
+
- **Replay & determinism** — the runtime re-runs a workflow from its recorded history on every tick, so the body must reach the same state every time. Branch on inputs, on the results of the steps you call, and on the values the framework makes deterministic (see below); never on other ambient state (`process.env`, module-level mutable variables).
|
|
40
|
+
- **Time & randomness** — inside a workflow, `Date.now()`, `new Date()`, `Math.random()` and `crypto.randomUUID()` are deterministic and safe to use. The clock follows the history: it starts when the run was created and only moves forward as steps are recorded (a step's request time, or the moment an awaited step settled), so it stands still between two steps. Randomness is seeded by the run id. `setTimeout`/`setInterval` throw `TimerNotAllowedException` — use `sleep` to wait.
|
|
40
41
|
- **env** — configuration values supplied by the runtime; the single source for URLs, tokens, and tenants.
|
|
41
42
|
- **Composition** — external work is performed by calling primitives from the other framework packages inside the workflow body.
|
|
42
43
|
|
|
@@ -167,7 +168,7 @@ const output = await env.execute(workflow, input, {
|
|
|
167
168
|
|
|
168
169
|
| Option | Default | Purpose |
|
|
169
170
|
|--------|---------|---------|
|
|
170
|
-
| `now` | `0` |
|
|
171
|
+
| `now` | `0` | Virtual host time at run start. It becomes the run's start time and stamps every recorded step; `Date.now()` inside the workflow reads those stamps |
|
|
171
172
|
| `resolveActivityTimeouts` | `true` | Auto-advances the clock through time-based steps (e.g. `sleep`) and resolves them |
|
|
172
173
|
|
|
173
174
|
`execute()` options:
|
|
@@ -201,7 +202,8 @@ Do **not** import `@t4h.framework/core/testing` in production app code.
|
|
|
201
202
|
- Reading `process.env` directly, or reading the raw `env` proxy when the project should declare an `EnvDesign` in `constants/environments.ts`.
|
|
202
203
|
- Inlining URLs/secrets/tenants in workflow code instead of pulling them from the shared `EnvDesign`.
|
|
203
204
|
- Accessing an `EnvDesign` key at module top level (throws — no env storage outside a run); read keys inside the workflow body/functions.
|
|
204
|
-
-
|
|
205
|
+
- `setTimeout` / `setInterval` inside a workflow body — throws `TimerNotAllowedException`; wait with `sleep`.
|
|
206
|
+
- Branching on ambient state (`process.env`, module-level mutable variables) or measuring elapsed time between steps — the workflow clock stands still between steps, so such measurements are always `0`.
|
|
205
207
|
- Non-`Serializable` workflow input, output, or step values.
|
|
206
208
|
- Duplicate `workflow.id` within an `App`.
|
|
207
209
|
- Importing `@t4h.framework/core/testing` from production code.
|
|
@@ -211,7 +213,7 @@ Do **not** import `@t4h.framework/core/testing` in production app code.
|
|
|
211
213
|
|
|
212
214
|
## Exports
|
|
213
215
|
|
|
214
|
-
**Main (`@t4h.framework/core`):** `Workflow`, `App`, `startWorkflow`, `WorkflowRef`, `env`, `EnvDesign`, `Authorization`, `Binary`, `Serializable`.
|
|
216
|
+
**Main (`@t4h.framework/core`):** `Workflow`, `App`, `startWorkflow`, `WorkflowRef`, `env`, `EnvDesign`, `Authorization`, `Binary`, `Serializable`, `TimerNotAllowedException`.
|
|
215
217
|
|
|
216
218
|
**Testing (`@t4h.framework/core/testing`):** `TestWorkflowEnvironment`, `TestClock`, `createTestEnv`, `createTestEnvEntries`, `NonDeterministicWorkflowError`.
|
|
217
219
|
|
|
@@ -7,7 +7,10 @@ description: >-
|
|
|
7
7
|
read configuration from a shared EnvDesign in constants/environments.ts.
|
|
8
8
|
Register it in an App. Use whenever the user asks to create a new workflow,
|
|
9
9
|
wire it into an App, or refactor workflow code to remove hardcoded
|
|
10
|
-
URLs/secrets/client values and move configuration to an EnvDesign.
|
|
10
|
+
URLs/secrets/client values and move configuration to an EnvDesign. A workflow
|
|
11
|
+
never implements infrastructure types itself — file content becomes a Binary
|
|
12
|
+
through `write` from @t4h.framework/fs (see framework-fs-write), never
|
|
13
|
+
through a custom Binary subclass.
|
|
11
14
|
---
|
|
12
15
|
|
|
13
16
|
# Create workflows with `@t4h.framework/core`
|
|
@@ -32,10 +35,11 @@ Create workflows that:
|
|
|
32
35
|
| External HTTP call | `http.get/post/put/...` | `@t4h.framework/http` (see **framework-http**) |
|
|
33
36
|
| Delay / wait | `sleep('30 seconds')` | `@t4h.framework/sleep` (see **framework-sleep**) |
|
|
34
37
|
| Nested workflow | `startWorkflow(child, input)` | `@t4h.framework/core` |
|
|
38
|
+
| Content into a file (`Binary`) | `write(content, { contentType })` | `@t4h.framework/fs` (see **framework-fs-write**) |
|
|
35
39
|
| Configuration | `environments.MY_KEY` from a shared `EnvDesign` | `@t4h.framework/core` |
|
|
36
40
|
| Branching / mapping | plain TypeScript | — |
|
|
37
41
|
|
|
38
|
-
Keep the body **deterministic** so it replays safely: branch on inputs and step results, never on `Date.now()`, `Math.random()
|
|
42
|
+
Keep the body **deterministic** so it replays safely: branch on inputs and step results, never on ambient state (`process.env`, module-level mutable variables). `Date.now()`, `new Date()`, `Math.random()` and `crypto.randomUUID()` are made deterministic by the framework and are safe to use — the clock follows the recorded history and stands still between steps, randomness is seeded by the run. `setTimeout`/`setInterval` throw `TimerNotAllowedException`; use `sleep` when you need time to pass.
|
|
39
43
|
|
|
40
44
|
## Expected project shape
|
|
41
45
|
|
|
@@ -102,14 +106,28 @@ One `environments` object is the single source of configuration for the whole pr
|
|
|
102
106
|
3. Define workflow metadata with a stable `id`.
|
|
103
107
|
4. Add a `schema` when input validation is needed.
|
|
104
108
|
5. Import all configuration from the shared `EnvDesign` in `constants/environments.ts` — never raw `env` or `process.env`.
|
|
105
|
-
6. Keep the body deterministic so replay produces the same result.
|
|
109
|
+
6. Keep the body deterministic so replay produces the same result. `Date.now()` / `Math.random()` are safe; timers are not — use `sleep`.
|
|
110
|
+
7. Obtain a `Binary` from the framework — an HTTP response body, `sftp.get`, `write`, `join` — never by implementing one.
|
|
106
111
|
|
|
107
112
|
## Hard constraints
|
|
108
113
|
|
|
109
114
|
- Do not hardcode URLs, client IDs, client secrets, API keys, tenants, or tokens.
|
|
110
115
|
- Do not initialize third-party clients with inline credentials inside workflow files.
|
|
111
116
|
- Do not read `process.env` or the raw `env` proxy directly — declare configuration in the shared `EnvDesign` (`constants/environments.ts`).
|
|
112
|
-
- Do not call `fetch`/`axios` or other non-framework I/O directly — that breaks replay safety
|
|
117
|
+
- Do not call `fetch`/`axios` or other non-framework I/O directly — that breaks replay safety, and their internal timers throw `TimerNotAllowedException`.
|
|
118
|
+
- Do not call `setTimeout` / `setInterval` inside a workflow — it throws `TimerNotAllowedException`. Wait with `sleep` from `@t4h.framework/sleep`.
|
|
119
|
+
- Do not measure elapsed time between steps with `Date.now()` — the workflow clock only moves when a step is recorded, so the difference is always `0`.
|
|
120
|
+
- **Do not declare a class that extends `Binary`** (`BufferBinary`, `StringBinary`, `stringToBinary` helpers, …). To hand content to a primitive that takes a `Binary` — `sftp.put`, `sftp.append`, an HTTP body — build it with `write` from `@t4h.framework/fs`:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import { write } from '@t4h.framework/fs'
|
|
124
|
+
|
|
125
|
+
const file = await write(JSON.stringify(data), { contentType: 'application/json' })
|
|
126
|
+
|
|
127
|
+
await sftp.put('/out/data.json', file)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
A value handed to a primitive becomes the input of a durable activity and is serialized to storage before the activity runs; a `Binary` holding bytes in memory has nothing to serialize into, and the activity may run in another process after a replay. Such a class can pass locally — the dev server keeps values in memory — and break once deployed. See the **framework-fs-write** skill.
|
|
113
131
|
|
|
114
132
|
Required keys declared in the `EnvDesign` fail fast automatically: accessing an unset required key throws `Environment variable X is not set`. Use `isOptional`/`defaultValue` when a key may be absent.
|
|
115
133
|
|
|
@@ -135,7 +153,7 @@ Required keys declared in the `EnvDesign` fail fast automatically: accessing an
|
|
|
135
153
|
|
|
136
154
|
### Step 4: make it test-friendly
|
|
137
155
|
|
|
138
|
-
- Keep outputs deterministic.
|
|
156
|
+
- Keep outputs deterministic (`Date.now()` and `Math.random()` are fine; they replay identically).
|
|
139
157
|
- Avoid hidden global state.
|
|
140
158
|
- Drive external effects through package primitives so tests can supply their providers (see **framework-core** testing and each package's skill).
|
|
141
159
|
|
|
@@ -192,8 +210,13 @@ import { Workflow, startWorkflow } from '@t4h.framework/core'
|
|
|
192
210
|
import { childWorkflow } from './child-workflow.js'
|
|
193
211
|
|
|
194
212
|
export const parentWorkflow = new Workflow({ id: 'parent-workflow' }, async input => {
|
|
195
|
-
const
|
|
196
|
-
|
|
213
|
+
const started = await startWorkflow(childWorkflow, input)
|
|
214
|
+
|
|
215
|
+
// `startWorkflow` resolves as soon as the child is started; `wait()` is what
|
|
216
|
+
// suspends the parent until the child is terminal.
|
|
217
|
+
const ref = await started.wait()
|
|
218
|
+
|
|
219
|
+
return ref.output // ref: WorkflowRef — { status, output }
|
|
197
220
|
})
|
|
198
221
|
```
|
|
199
222
|
|
|
@@ -205,6 +228,8 @@ export const parentWorkflow = new Workflow({ id: 'parent-workflow' }, async inpu
|
|
|
205
228
|
- Creating SDK/API clients with literal credentials inside the workflow function.
|
|
206
229
|
- Calling `fetch`/`axios` or other raw I/O instead of the framework's `http` primitive.
|
|
207
230
|
- Building custom low-level infrastructure inside a consuming app to make a workflow work — use the framework packages that already provide it.
|
|
231
|
+
- Declaring a `Binary` subclass to pass generated content to `sftp.put` or any other file primitive — use `write` from `@t4h.framework/fs` (**framework-fs-write**).
|
|
232
|
+
- Reading `.output` straight off the value `startWorkflow` returns — it resolves to an awaitable; call `wait()` to get the `WorkflowRef`.
|
|
208
233
|
- Large workflow functions doing plumbing instead of orchestration.
|
|
209
234
|
- Registering workflows in scattered places instead of the centralized `App` declaration.
|
|
210
235
|
|
|
@@ -66,7 +66,7 @@ env.clock.set(now) // set pinned clock to a Date | number
|
|
|
66
66
|
|
|
67
67
|
| Option | Default | Purpose |
|
|
68
68
|
|--------|---------|---------|
|
|
69
|
-
| `now` | `0` |
|
|
69
|
+
| `now` | `0` | Virtual host time at start. It becomes the run's start time and stamps every recorded step; `Date.now()` inside the workflow reads those stamps |
|
|
70
70
|
| `resolveActivityTimeouts` | `true` | Auto-advances clock to each activity's `timeoutAt` and resolves it via `onTimeout` |
|
|
71
71
|
|
|
72
72
|
`execute()` options:
|
|
@@ -80,6 +80,14 @@ env.clock.set(now) // set pinned clock to a Date | number
|
|
|
80
80
|
After `execute()` returns, the clock is advanced to wherever the run left it.
|
|
81
81
|
Subsequent `env.clock.advance()` calls build on that value between tests.
|
|
82
82
|
|
|
83
|
+
Inside the workflow, `Date.now()` is the history clock, not the virtual clock
|
|
84
|
+
directly: it equals `now` until the first step is recorded, then moves to each
|
|
85
|
+
step's stamp (request time, or settle time for an awaited async step). It never
|
|
86
|
+
moves backwards and stands still between steps. `Math.random()` and
|
|
87
|
+
`crypto.randomUUID()` are seeded by the run and replay identically, so asserting
|
|
88
|
+
on them is safe. A workflow that calls `setTimeout` / `setInterval` rejects with
|
|
89
|
+
`TimerNotAllowedException`.
|
|
90
|
+
|
|
83
91
|
Async activities are resolved in tests through `mockAsyncActivity` (which returns
|
|
84
92
|
a final outcome directly). Workflow tests never drive an activity's internal
|
|
85
93
|
`advance` method — you only assert the workflow's observable output and effects.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @t4h.framework/core
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#155](https://github.com/tech4humans-brasil/framework/pull/155) [`8098041`](https://github.com/tech4humans-brasil/framework/commit/80980419d59a987378b7c94372ee2f7b7dcc00f5) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Deterministic workflow replay: time, randomness and timers.
|
|
8
|
+
- `Date.now()`, `new Date()`, `Math.random()` and `crypto.randomUUID()` are
|
|
9
|
+
deterministic inside workflow code. The clock follows the history
|
|
10
|
+
(`createdAt` of the run, then `createdAt`/`settledAt` of each item) and
|
|
11
|
+
randomness derives from the run id, so nothing new is stored.
|
|
12
|
+
- `setTimeout`/`setInterval` inside a workflow throw
|
|
13
|
+
`TimerNotAllowedException`. Use an activity (`@t4h.framework/sleep`) to wait.
|
|
14
|
+
- New export: `TimerNotAllowedException`.
|
|
15
|
+
- **Breaking for hosts:** `Internals.runWorkflow` now requires `id` and
|
|
16
|
+
`createdAt`, `HistoryItem` requires `createdAt`, and async items accept
|
|
17
|
+
`settledAt`.
|
|
18
|
+
- Testing: `runWorkflow` accepts and returns `seed`/`createdAt`; `TestClock`
|
|
19
|
+
feeds the host clock instead of patching `Date` itself.
|
|
20
|
+
|
|
3
21
|
## 0.9.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -302,6 +302,8 @@ The runtime is responsible for executing workflows and activities by providing t
|
|
|
302
302
|
import { Internals } from '@t4h.framework/core'
|
|
303
303
|
|
|
304
304
|
Internals.runWorkflow(myWorkflow, {
|
|
305
|
+
id: run.id, // seeds Math.random / randomUUID inside the workflow
|
|
306
|
+
createdAt: run.createdAt.getTime(), // where the workflow clock starts
|
|
305
307
|
input: { userId: '123', amount: 100 },
|
|
306
308
|
env: { API_URL: 'https://api.example.com' },
|
|
307
309
|
claims: [
|
|
@@ -344,6 +346,8 @@ Env.run → Claim.run → fn(activity)
|
|
|
344
346
|
|
|
345
347
|
**History** handles reconciliation: when an activity has been executed before, the previous result is returned directly (deterministic replay). When there is no history, the activity runs and the result is stored.
|
|
346
348
|
|
|
349
|
+
**History** also owns the workflow clock. Each `HistoryItem` carries `createdAt` (when the activity was requested) and async items `settledAt` (when they settled); `Date.now()` inside the workflow reads the last of those the replay walked past, starting from the run's `createdAt`. `History.run` also patches `Date`, `Math.random` and `randomUUID` for workflow code and forbids `setTimeout` / `setInterval` there (`TimerNotAllowedException`). Hosts must stamp those fields when building the history.
|
|
350
|
+
|
|
347
351
|
---
|
|
348
352
|
|
|
349
353
|
## Testing
|
|
@@ -478,6 +482,10 @@ await TestClock.run({ now: 0 }, async () => {
|
|
|
478
482
|
})
|
|
479
483
|
```
|
|
480
484
|
|
|
485
|
+
`TestClock` acts as the host clock: activities are stamped with it and the
|
|
486
|
+
workflow reads those stamps back through `Date.now()`, exactly as in
|
|
487
|
+
production.
|
|
488
|
+
|
|
481
489
|
### Activity-level tests
|
|
482
490
|
|
|
483
491
|
The real `advance` logic is intentionally **not** exercised by `execute()`.
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './activities/StartWorkflowActivity.js';
|
|
2
2
|
export * from './exceptions/ActivityException.js';
|
|
3
3
|
export * from './exceptions/ClaimException.js';
|
|
4
|
+
export * from './exceptions/TimerNotAllowedException.js';
|
|
4
5
|
export * from './models/Activity.js';
|
|
5
6
|
export * from './models/Authorization.js';
|
|
6
7
|
export * from './models/App.js';
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AAErD,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AAErD,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0CAA0C,CAAA;AAExD,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AACzC,cAAc,wCAAwC,CAAA;AACtD,cAAc,oCAAoC,CAAA;AAClD,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AAEvC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA"}
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './activities/StartWorkflowActivity.js';
|
|
2
2
|
export * from './exceptions/ActivityException.js';
|
|
3
3
|
export * from './exceptions/ClaimException.js';
|
|
4
|
+
export * from './exceptions/TimerNotAllowedException.js';
|
|
4
5
|
export * from './models/Activity.js';
|
|
5
6
|
export * from './models/Authorization.js';
|
|
6
7
|
export * from './models/App.js';
|
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AAErD,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AAErD,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0CAA0C,CAAA;AAExD,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AACzC,cAAc,wCAAwC,CAAA;AACtD,cAAc,oCAAoC,CAAA;AAClD,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,mCAAmC,CAAA;AACjD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yBAAyB,CAAA;AAEvC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimerNotAllowedException.d.ts","sourceRoot":"","sources":["../../src/exceptions/TimerNotAllowedException.ts"],"names":[],"mappings":"AAAA,qBAAa,wBAAyB,SAAQ,KAAK;aACd,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM;CAKjD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class TimerNotAllowedException extends Error {
|
|
2
|
+
timer;
|
|
3
|
+
constructor(timer) {
|
|
4
|
+
super(`${timer}() cannot be used inside a workflow.`);
|
|
5
|
+
this.timer = timer;
|
|
6
|
+
this.name = 'TimerNotAllowedException';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=TimerNotAllowedException.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimerNotAllowedException.js","sourceRoot":"","sources":["../../src/exceptions/TimerNotAllowedException.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACd;IAAnC,YAAmC,KAAa;QAC9C,KAAK,CAAC,GAAG,KAAK,sCAAsC,CAAC,CAAA;QADpB,UAAK,GAAL,KAAK,CAAQ;QAG9C,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAA;IACxC,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Activity } from './Activity.js';
|
|
2
2
|
import type { AnyAsyncActivity } from './AsyncActivity.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type IHistoryItemAsync } from './History.js';
|
|
4
4
|
export declare class AsyncActivityAwaitable<T extends AnyAsyncActivity> {
|
|
5
5
|
private readonly activity;
|
|
6
6
|
private readonly item;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncActivityAwaitable.d.ts","sourceRoot":"","sources":["../../src/models/AsyncActivityAwaitable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AsyncActivityAwaitable.d.ts","sourceRoot":"","sources":["../../src/models/AsyncActivityAwaitable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAG9D,qBAAa,sBAAsB,CAAC,CAAC,SAAS,gBAAgB;IAE1D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFJ,QAAQ,EAAE,CAAC,EACX,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,SAAS,GAAG,EAAE;IAG1B,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAQjD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {} from './Activity.js';
|
|
2
|
+
import { History } from './History.js';
|
|
2
3
|
import { PushWaitAsyncActivity } from './PushWaitAsyncActivity.js';
|
|
3
4
|
export class AsyncActivityAwaitable {
|
|
4
5
|
activity;
|
|
@@ -12,6 +13,7 @@ export class AsyncActivityAwaitable {
|
|
|
12
13
|
async wait() {
|
|
13
14
|
if (this.item.status === 'pending')
|
|
14
15
|
throw new PushWaitAsyncActivity(this.activity, this.item.timeoutAt);
|
|
16
|
+
History.advanceClock(this.item.settledAt);
|
|
15
17
|
return this.activity.toOutput(this.item.output, ...this.args);
|
|
16
18
|
}
|
|
17
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncActivityAwaitable.js","sourceRoot":"","sources":["../../src/models/AsyncActivityAwaitable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"AsyncActivityAwaitable.js","sourceRoot":"","sources":["../../src/models/AsyncActivityAwaitable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,eAAe,CAAA;AAE7C,OAAO,EAAE,OAAO,EAA0B,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAElE,MAAM,OAAO,sBAAsB;IAEd;IACA;IACA;IAHnB,YACmB,QAAW,EACX,IAAuB,EACvB,IAAoB;QAFpB,aAAQ,GAAR,QAAQ,CAAG;QACX,SAAI,GAAJ,IAAI,CAAmB;QACvB,SAAI,GAAJ,IAAI,CAAgB;IACpC,CAAC;IAEG,KAAK,CAAC,IAAI;QACf,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS;YAChC,MAAM,IAAI,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAErE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAEzC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/D,CAAC;CACF"}
|
package/dist/models/History.d.ts
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
import { type Activity } from './Activity.js';
|
|
2
2
|
import { type AnyAsyncActivity } from './AsyncActivity.js';
|
|
3
|
-
import { AsyncActivityAwaitable } from './AsyncActivityAwaitable.js';
|
|
3
|
+
import type { AsyncActivityAwaitable } from './AsyncActivityAwaitable.js';
|
|
4
4
|
export type HistoryItemType = 'sync' | 'async';
|
|
5
5
|
interface IHistoryItem<T extends HistoryItemType> {
|
|
6
6
|
id: string;
|
|
7
7
|
type: T;
|
|
8
8
|
output: any;
|
|
9
|
+
createdAt: number;
|
|
9
10
|
}
|
|
10
11
|
export interface IHistoryItemSync extends IHistoryItem<'sync'> {
|
|
11
12
|
}
|
|
12
13
|
export interface IHistoryItemAsync extends IHistoryItem<'async'> {
|
|
13
14
|
status: 'pending' | 'fulfilled' | 'rejected';
|
|
14
15
|
timeoutAt?: Date | null;
|
|
16
|
+
settledAt?: number;
|
|
15
17
|
}
|
|
16
18
|
export type HistoryItem = IHistoryItemSync | IHistoryItemAsync;
|
|
19
|
+
export interface HistoryRunOptions {
|
|
20
|
+
history: readonly HistoryItem[];
|
|
21
|
+
seed: string;
|
|
22
|
+
createdAt: number;
|
|
23
|
+
}
|
|
24
|
+
export interface HistoryStore {
|
|
25
|
+
readonly items: HistoryItem[];
|
|
26
|
+
readonly seed: string;
|
|
27
|
+
clock: number;
|
|
28
|
+
randomCalls: number;
|
|
29
|
+
}
|
|
17
30
|
export declare namespace History {
|
|
18
31
|
type ReconcilerOutput<T extends Activity> = T extends AnyAsyncActivity ? AsyncActivityAwaitable<T> : Activity.Output<T>;
|
|
19
32
|
function bind<T extends Activity>(Activity: new () => T): (...args: Activity.Args<T>) => Promise<ReconcilerOutput<T>>;
|
|
20
33
|
function reconciler<T extends Activity>(Activity: new () => T, ...args: Activity.Args<T>): Promise<ReconcilerOutput<T>>;
|
|
21
34
|
function isReplaying(): boolean;
|
|
22
|
-
function
|
|
35
|
+
function peek(): HistoryStore | undefined;
|
|
36
|
+
function advanceClock(at: number | undefined): void;
|
|
37
|
+
function run<T>(options: HistoryRunOptions, fn: () => T): T;
|
|
23
38
|
}
|
|
24
39
|
export {};
|
|
25
40
|
//# sourceMappingURL=History.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"History.d.ts","sourceRoot":"","sources":["../../src/models/History.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"History.d.ts","sourceRoot":"","sources":["../../src/models/History.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe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,EAAE,UAAU,CAAC,IACpD,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,kCAClC;IAED,SAAsB,UAAU,CAAC,CAAC,SAAS,QAAQ,EACjD,QAAQ,EAAE,UAAU,CAAC,EACrB,GAAG,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CA8B9B;IAED,SAAgB,WAAW,IAAI,OAAO,CAMrC;IAED,SAAgB,IAAI,IAAI,YAAY,GAAG,SAAS,CAE/C;IAED,SAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,QAMlD;IAED,SAAgB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAYjE;CACF"}
|
package/dist/models/History.js
CHANGED
|
@@ -2,8 +2,8 @@ import { AsyncLocalStorage } from 'node:async_hooks';
|
|
|
2
2
|
import { uuidv7 } from 'uuidv7';
|
|
3
3
|
import {} from './Activity.js';
|
|
4
4
|
import { AsyncActivity } from './AsyncActivity.js';
|
|
5
|
-
import { AsyncActivityAwaitable } from './AsyncActivityAwaitable.js';
|
|
6
5
|
import { PushActivity } from './PushActivity.js';
|
|
6
|
+
import { Deterministic } from '../tools/Deterministic.js';
|
|
7
7
|
export var History;
|
|
8
8
|
(function (History) {
|
|
9
9
|
const storage = new AsyncLocalStorage();
|
|
@@ -12,17 +12,18 @@ export var History;
|
|
|
12
12
|
}
|
|
13
13
|
History.bind = bind;
|
|
14
14
|
async function reconciler(Activity, ...args) {
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
15
|
+
const store = storage.getStore();
|
|
16
|
+
if (!store)
|
|
17
17
|
throw new Error('No activities in storage');
|
|
18
|
-
const value =
|
|
18
|
+
const value = store.items.shift();
|
|
19
19
|
const activity = new Activity();
|
|
20
20
|
if (!value) {
|
|
21
21
|
activity.id = uuidv7();
|
|
22
|
-
const input = await activity.toInput(...args);
|
|
22
|
+
const input = await storage.exit(() => activity.toInput(...args));
|
|
23
23
|
throw new PushActivity(activity, input);
|
|
24
24
|
}
|
|
25
25
|
activity.id = value.id;
|
|
26
|
+
advanceClock(value.createdAt);
|
|
26
27
|
if (activity instanceof AsyncActivity) {
|
|
27
28
|
if (value.type !== 'async')
|
|
28
29
|
throw new Error('Invalid history item type');
|
|
@@ -36,11 +37,28 @@ export var History;
|
|
|
36
37
|
const store = storage.getStore();
|
|
37
38
|
if (!store)
|
|
38
39
|
return false;
|
|
39
|
-
return store.length > 0;
|
|
40
|
+
return store.items.length > 0;
|
|
40
41
|
}
|
|
41
42
|
History.isReplaying = isReplaying;
|
|
42
|
-
function
|
|
43
|
-
return storage.
|
|
43
|
+
function peek() {
|
|
44
|
+
return storage.getStore();
|
|
45
|
+
}
|
|
46
|
+
History.peek = peek;
|
|
47
|
+
function advanceClock(at) {
|
|
48
|
+
const store = storage.getStore();
|
|
49
|
+
if (!store || at === undefined)
|
|
50
|
+
return;
|
|
51
|
+
store.clock = Math.max(store.clock, at);
|
|
52
|
+
}
|
|
53
|
+
History.advanceClock = advanceClock;
|
|
54
|
+
function run(options, fn) {
|
|
55
|
+
Deterministic.install();
|
|
56
|
+
return storage.run({
|
|
57
|
+
items: options.history.slice(),
|
|
58
|
+
seed: options.seed,
|
|
59
|
+
clock: options.createdAt,
|
|
60
|
+
randomCalls: 0,
|
|
61
|
+
}, fn);
|
|
44
62
|
}
|
|
45
63
|
History.run = run;
|
|
46
64
|
})(History || (History = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"History.js","sourceRoot":"","sources":["../../src/models/History.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAiB,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,aAA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OAAO,CAAC,GAAG,CAChB;YACE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE;YAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,SAAS;YACxB,WAAW,EAAE,CAAC;SACf,EACD,EAAE,CACH,CAAA;IACH,CAAC;IAZe,WAAG,MAYlB,CAAA;AACH,CAAC,EA/EgB,OAAO,KAAP,OAAO,QA+EvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/models/Logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../src/models/Logger.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAElE,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,QAAQ,CAAA;IACf,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;CACX;AAMD,yBAAiB,MAAM,CAAC;IAetB,SAAgB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,KAI9C;CAuBF"}
|
package/dist/models/Logger.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
2
|
import { History } from './History.js';
|
|
3
|
+
import { Deterministic } from '../tools/Deterministic.js';
|
|
3
4
|
export var Logger;
|
|
4
5
|
(function (Logger) {
|
|
5
6
|
const storage = new AsyncLocalStorage();
|
|
@@ -31,7 +32,7 @@ export var Logger;
|
|
|
31
32
|
return original[level](...args);
|
|
32
33
|
if (History.isReplaying())
|
|
33
34
|
return;
|
|
34
|
-
context.logs.push({ level, args, at:
|
|
35
|
+
context.logs.push({ level, args, at: Deterministic.hostNow() });
|
|
35
36
|
original[level](...args);
|
|
36
37
|
}
|
|
37
38
|
})(Logger || (Logger = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/models/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/models/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAczD,MAAM,KAAW,MAAM,CA0CtB;AA1CD,WAAiB,MAAM;IACrB,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAiB,CAAA;IAEtD,MAAM,MAAM,GAAwB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAE7E,MAAM,QAAQ,GAAmD;QAC/D,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9B,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QAChC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QAChC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;KACnC,CAAA;IAED,IAAI,aAAa,GAAG,KAAK,CAAA;IAEzB,SAAgB,GAAG,CAAI,IAAW,EAAE,EAAW;QAC7C,gBAAgB,EAAE,CAAA;QAElB,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAA;IAClC,CAAC;IAJe,UAAG,MAIlB,CAAA;IAED,SAAS,gBAAgB;QACvB,IAAI,aAAa;YAAE,OAAM;QAEzB,aAAa,GAAG,IAAI,CAAA;QAEpB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC9D,CAAC;IACH,CAAC;IAED,SAAS,MAAM,CAAC,KAAe,EAAE,IAAe;QAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAA;QAElC,IAAI,CAAC,OAAO;YAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;QAE7C,IAAI,OAAO,CAAC,WAAW,EAAE;YAAE,OAAM;QAEjC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAE/D,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC1B,CAAC;AACH,CAAC,EA1CgB,MAAM,KAAN,MAAM,QA0CtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestClock.d.ts","sourceRoot":"","sources":["../../src/testing/TestClock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TestClock.d.ts","sourceRoot":"","sources":["../../src/testing/TestClock.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CACpB;AAID,qBAAa,SAAS;WACN,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;WAYpD,QAAQ,IAAI,OAAO;WAInB,GAAG,IAAI,MAAM;WAIb,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;WAWzB,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI;WAW7B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAGtC"}
|
|
@@ -1,49 +1,20 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { Deterministic } from '../tools/Deterministic.js';
|
|
2
3
|
const storage = new AsyncLocalStorage();
|
|
3
|
-
const OriginalDate = globalThis.Date;
|
|
4
|
-
function createPatchedDateConstructor() {
|
|
5
|
-
return class extends OriginalDate {
|
|
6
|
-
constructor(...args) {
|
|
7
|
-
if (args.length === 0) {
|
|
8
|
-
super(TestClock.now());
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
super(...args);
|
|
12
|
-
}
|
|
13
|
-
static now() {
|
|
14
|
-
return TestClock.now();
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
4
|
export class TestClock {
|
|
19
5
|
static run(options, fn) {
|
|
6
|
+
Deterministic.install();
|
|
7
|
+
Deterministic.useHostClock(() => storage.getStore()?.now);
|
|
20
8
|
const now = options.now instanceof Date
|
|
21
9
|
? options.now.getTime()
|
|
22
|
-
: (options.now ??
|
|
23
|
-
return storage.run({ now },
|
|
24
|
-
const PatchedDate = createPatchedDateConstructor();
|
|
25
|
-
globalThis.Date = PatchedDate;
|
|
26
|
-
const finish = () => {
|
|
27
|
-
globalThis.Date = OriginalDate;
|
|
28
|
-
};
|
|
29
|
-
try {
|
|
30
|
-
const result = fn();
|
|
31
|
-
if (result instanceof Promise)
|
|
32
|
-
return result.finally(finish);
|
|
33
|
-
finish();
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
finish();
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
10
|
+
: (options.now ?? Deterministic.realNow());
|
|
11
|
+
return storage.run({ now }, fn);
|
|
41
12
|
}
|
|
42
13
|
static isActive() {
|
|
43
14
|
return storage.getStore() !== undefined;
|
|
44
15
|
}
|
|
45
16
|
static now() {
|
|
46
|
-
return storage.getStore()?.now ??
|
|
17
|
+
return storage.getStore()?.now ?? Deterministic.realNow();
|
|
47
18
|
}
|
|
48
19
|
static advance(ms) {
|
|
49
20
|
const state = storage.getStore();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestClock.js","sourceRoot":"","sources":["../../src/testing/TestClock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"TestClock.js","sourceRoot":"","sources":["../../src/testing/TestClock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAUzD,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAkB,CAAA;AAEvD,MAAM,OAAO,SAAS;IACb,MAAM,CAAC,GAAG,CAAI,OAA4B,EAAE,EAAW;QAC5D,aAAa,CAAC,OAAO,EAAE,CAAA;QACvB,aAAa,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAA;QAEzD,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,YAAY,IAAI;YACzB,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE;YACvB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC,CAAA;QAE9C,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAA;IACjC,CAAC;IAEM,MAAM,CAAC,QAAQ;QACpB,OAAO,OAAO,CAAC,QAAQ,EAAE,KAAK,SAAS,CAAA;IACzC,CAAC;IAEM,MAAM,CAAC,GAAG;QACf,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,CAAA;IAC3D,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,EAAU;QAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAA;QAEhC,IAAI,CAAC,KAAK;YACR,MAAM,IAAI,KAAK,CACb,kGAAkG,CACnG,CAAA;QAEH,KAAK,CAAC,GAAG,IAAI,EAAE,CAAA;IACjB,CAAC;IAEM,MAAM,CAAC,GAAG,CAAC,GAAkB;QAClC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAA;QAEhC,IAAI,CAAC,KAAK;YACR,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAA;QAEH,KAAK,CAAC,GAAG,GAAG,GAAG,YAAY,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;IACvD,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,EAAU;QAC5B,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACvB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestWorkflowEnvironment.d.ts","sourceRoot":"","sources":["../../src/testing/TestWorkflowEnvironment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TestWorkflowEnvironment.d.ts","sourceRoot":"","sources":["../../src/testing/TestWorkflowEnvironment.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,MAAM,WAAW,8BAA8B;IAC7C,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACnB,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAClC;AAED,MAAM,WAAW,qCAAqC;IACpD,MAAM,CAAC,EAAE,SAAS,aAAa,CAAC,GAAG,CAAC,EAAE,CAAA;IACtC,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACtC;AAED,qBAAa,uBAAuB;IAClC,OAAO,CAAC,uBAAuB,CAAgB;IAE/C,OAAO,CAAC,GAAG,CAAY;IAEvB,OAAO;WASO,MAAM,CAClB,OAAO,GAAE,8BAAmC,GAC3C,uBAAuB;IAI1B,SAAgB,KAAK;;sBAGL,MAAM;mBAMT,IAAI,GAAG,MAAM;MAKzB;IAEY,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAC/C,QAAQ,EAAE,CAAC,EACX,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,OAAO,GAAE,qCAA0C;YAgCvC,qBAAqB;CA0BpC"}
|
|
@@ -2,7 +2,7 @@ import { isDeepStrictEqual } from 'node:util';
|
|
|
2
2
|
import { NonDeterministicWorkflowError } from './exceptions/NonDeterministicWorkflowError.js';
|
|
3
3
|
import { TestClock } from './TestClock.js';
|
|
4
4
|
import { clone } from './tools/clone.js';
|
|
5
|
-
import { runWorkflow } from './tools/run-workflow.js';
|
|
5
|
+
import { runWorkflow, } from './tools/run-workflow.js';
|
|
6
6
|
import { Internals } from '../tools/Internals.js';
|
|
7
7
|
export class TestWorkflowEnvironment {
|
|
8
8
|
resolveActivityTimeouts = true;
|
|
@@ -44,19 +44,21 @@ export class TestWorkflowEnvironment {
|
|
|
44
44
|
const result = await runWorkflow(workflow, input, runWorkflowOptions);
|
|
45
45
|
if (result.clockNow !== undefined)
|
|
46
46
|
this.now = result.clockNow;
|
|
47
|
-
await this.assertWorkflowReplays(workflow, input, result
|
|
47
|
+
await this.assertWorkflowReplays(workflow, input, result, runWorkflowOptions);
|
|
48
48
|
return result.output;
|
|
49
49
|
}
|
|
50
|
-
async assertWorkflowReplays(workflow, input,
|
|
50
|
+
async assertWorkflowReplays(workflow, input, result, context) {
|
|
51
51
|
const history = await clone(context.history);
|
|
52
52
|
const replay = await TestClock.run({ now: this.now }, () => Internals.runWorkflow(workflow, {
|
|
53
|
+
id: result.seed,
|
|
54
|
+
createdAt: result.createdAt,
|
|
53
55
|
input,
|
|
54
56
|
claims: context.claims,
|
|
55
57
|
env: context.env,
|
|
56
58
|
history,
|
|
57
59
|
logs: [],
|
|
58
60
|
}));
|
|
59
|
-
if (isDeepStrictEqual(output, replay))
|
|
61
|
+
if (isDeepStrictEqual(result.output, replay))
|
|
60
62
|
return;
|
|
61
63
|
throw new NonDeterministicWorkflowError('Replay from recorded history produced a different workflow output.');
|
|
62
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestWorkflowEnvironment.js","sourceRoot":"","sources":["../../src/testing/TestWorkflowEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAA;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"TestWorkflowEnvironment.js","sourceRoot":"","sources":["../../src/testing/TestWorkflowEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAA;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAk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T,CAAC,CACH,CAAA;QAED,IAAI,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;YAAE,OAAM;QAEpD,MAAM,IAAI,6BAA6B,CACrC,oEAAoE,CACrE,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-activity.d.ts","sourceRoot":"","sources":["../../../src/testing/tools/resolve-activity.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,EAElB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"resolve-activity.d.ts","sourceRoot":"","sources":["../../../src/testing/tools/resolve-activity.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,EAElB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,UAAU,sBAAsB;IAC9B,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,KAAK,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9B;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC,EAC5B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,EACjD,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,WAAW,CAAC,CAwCtB"}
|