@demlik/tea 0.3.0 → 0.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/agent/index.d.ts +5 -5
- package/dist/agent/index.js +10 -10
- package/dist/authed-call/index.d.ts +2 -2
- package/dist/authed-call/index.js +7 -7
- package/dist/await-terminal/index.d.ts +2 -2
- package/dist/await-terminal/index.js +2 -2
- package/dist/batch-window/index.d.ts +3 -3
- package/dist/batch-window/index.js +3 -3
- package/dist/cache/index.d.ts +2 -2
- package/dist/cache/index.js +4 -4
- package/dist/{chunk-S4O26D7B.js → chunk-362SZ6CS.js} +3 -3
- package/dist/{chunk-S4O26D7B.js.map → chunk-362SZ6CS.js.map} +1 -1
- package/dist/{chunk-JFFVBEDI.js → chunk-62QBHM3T.js} +3 -3
- package/dist/{chunk-JFFVBEDI.js.map → chunk-62QBHM3T.js.map} +1 -1
- package/dist/{chunk-TPGASTFF.js → chunk-7A74NSG4.js} +3 -3
- package/dist/{chunk-TPGASTFF.js.map → chunk-7A74NSG4.js.map} +1 -1
- package/dist/{chunk-2KNLKQVN.js → chunk-7UU5P2CX.js} +3 -3
- package/dist/{chunk-2KNLKQVN.js.map → chunk-7UU5P2CX.js.map} +1 -1
- package/dist/{chunk-NPERUUUE.js → chunk-CIDS43FH.js} +3 -3
- package/dist/{chunk-NPERUUUE.js.map → chunk-CIDS43FH.js.map} +1 -1
- package/dist/{chunk-PBDYW2TU.js → chunk-DBOJ2UC6.js} +14 -3
- package/dist/chunk-DBOJ2UC6.js.map +1 -0
- package/dist/{chunk-WGGAMW7Y.js → chunk-KEFMI24G.js} +7 -7
- package/dist/{chunk-WGGAMW7Y.js.map → chunk-KEFMI24G.js.map} +1 -1
- package/dist/{chunk-MVY5DAMF.js → chunk-KWPB6BM6.js} +4 -4
- package/dist/{chunk-MVY5DAMF.js.map → chunk-KWPB6BM6.js.map} +1 -1
- package/dist/{chunk-C6QC273X.js → chunk-LFW66IIV.js} +4 -4
- package/dist/{chunk-C6QC273X.js.map → chunk-LFW66IIV.js.map} +1 -1
- package/dist/{chunk-BP2R7TPP.js → chunk-PBAYOJJO.js} +150 -38
- package/dist/chunk-PBAYOJJO.js.map +1 -0
- package/dist/{chunk-SK5JGUY7.js → chunk-PUTHY7LR.js} +3 -3
- package/dist/{chunk-SK5JGUY7.js.map → chunk-PUTHY7LR.js.map} +1 -1
- package/dist/{chunk-LYLDCIPH.js → chunk-QKUWDC4P.js} +32 -25
- package/dist/chunk-QKUWDC4P.js.map +1 -0
- package/dist/{chunk-VBUCHVCV.js → chunk-T6HDAPMR.js} +3 -3
- package/dist/{chunk-VBUCHVCV.js.map → chunk-T6HDAPMR.js.map} +1 -1
- package/dist/{chunk-IXBKFQH5.js → chunk-W2S4HK7J.js} +6 -6
- package/dist/{chunk-IXBKFQH5.js.map → chunk-W2S4HK7J.js.map} +1 -1
- package/dist/{chunk-CAXMQJJ3.js → chunk-ZILCH3WS.js} +4 -4
- package/dist/{chunk-CAXMQJJ3.js.map → chunk-ZILCH3WS.js.map} +1 -1
- package/dist/{chunk-RMX4EOQK.js → chunk-ZT3MGQB7.js} +3 -3
- package/dist/{chunk-RMX4EOQK.js.map → chunk-ZT3MGQB7.js.map} +1 -1
- package/dist/{core-42kapW0n.d.ts → core-DPYOyOJv.d.ts} +8 -5
- package/dist/deadline/index.d.ts +2 -2
- package/dist/deadline/index.js +3 -3
- package/dist/do/index.d.ts +6 -6
- package/dist/do/index.js +10 -10
- package/dist/{durable-effects-CFRngTNA.d.ts → durable-effects-B0YpoCHg.d.ts} +1 -1
- package/dist/extension/index.d.ts +2 -2
- package/dist/extension/index.js +3 -3
- package/dist/extension/react.js +3 -3
- package/dist/extension/subs/index.d.ts +2 -2
- package/dist/fan-out/index.d.ts +2 -2
- package/dist/idempotent-intake/index.d.ts +2 -2
- package/dist/index.d.ts +18 -4
- package/dist/index.js +2 -2
- package/dist/llm-call/index.d.ts +2 -2
- package/dist/llm-call/index.js +7 -7
- package/dist/{machine-B_BF4jij.d.ts → machine-Q_Bsm7Vu.d.ts} +1 -1
- package/dist/machine-viz/index.d.ts +1 -1
- package/dist/machine-viz/index.js +2 -2
- package/dist/mem/index.d.ts +2 -2
- package/dist/monitored-run/index.d.ts +3 -3
- package/dist/monitored-run/index.js +5 -5
- package/dist/node/index.d.ts +2 -2
- package/dist/paginated-walk/index.d.ts +2 -2
- package/dist/paginated-walk/index.js +7 -7
- package/dist/parity/index.d.ts +2 -2
- package/dist/parity/index.js +3 -3
- package/dist/pbt/arbitraries/index.d.ts +1 -1
- package/dist/pbt/index.d.ts +1 -1
- package/dist/pbt/index.js +3 -3
- package/dist/pbt/runners/index.d.ts +1 -1
- package/dist/pbt/runners/index.js +3 -3
- package/dist/poller/index.d.ts +2 -2
- package/dist/poller/index.js +3 -3
- package/dist/prediction/index.d.ts +1 -1
- package/dist/prediction/index.js +2 -2
- package/dist/pure/index.d.ts +1 -1
- package/dist/pure/index.js +2 -2
- package/dist/react/index.d.ts +9 -3
- package/dist/react/index.js +2 -2
- package/dist/react/index.js.map +1 -1
- package/dist/reconciler/index.d.ts +2 -2
- package/dist/reconciler/index.js +7 -7
- package/dist/recorder/index.d.ts +2 -2
- package/dist/resilient-call/index.d.ts +2 -2
- package/dist/resilient-call/index.js +6 -6
- package/dist/{runtime-types-gsog27b6.d.ts → runtime-types-uBuVvZqa.d.ts} +117 -3
- package/dist/saga/index.d.ts +2 -2
- package/dist/snapshot/index.d.ts +1 -1
- package/dist/snapshot/index.js +3 -3
- package/dist/subs/index.d.ts +16 -9
- package/dist/subs/index.js +3 -3
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +2 -2
- package/dist/throttled-input/index.d.ts +2 -2
- package/dist/throttled-input/index.js +6 -6
- package/dist/token-refresh/index.d.ts +1 -1
- package/dist/token-refresh/index.js +3 -3
- package/dist/trace-replay/index.d.ts +2 -2
- package/dist/trace-replay/index.js +3 -3
- package/dist/{types-KbL3W1mj.d.ts → types-C6mXL9wA.d.ts} +1 -1
- package/dist/with-deadline/index.d.ts +1 -1
- package/dist/with-deadline/index.js +2 -2
- package/dist/with-resilience/index.d.ts +2 -2
- package/dist/with-resilience/index.js +6 -6
- package/dist/with-telemetry/index.d.ts +1 -1
- package/dist/with-telemetry/index.js +2 -2
- package/dist/work-queue/adapter.d.ts +2 -2
- package/dist/work-queue/index.d.ts +2 -2
- package/dist/work-queue/ops.d.ts +2 -2
- package/dist/workflow/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunk-BP2R7TPP.js.map +0 -1
- package/dist/chunk-LYLDCIPH.js.map +0 -1
- package/dist/chunk-PBDYW2TU.js.map +0 -1
package/dist/do/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { status, agentBootMsg, agentEvents } from '../chunk-
|
|
1
|
+
import { status, agentBootMsg, agentEvents } from '../chunk-KEFMI24G.js';
|
|
2
2
|
export { applyEffectEvent, emptyLedger, foldLedger, isOwed, pendingEffectsLedger, survivingEffects } from '../chunk-25LBDCBC.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-ZILCH3WS.js';
|
|
4
|
+
import '../chunk-T6HDAPMR.js';
|
|
5
|
+
import '../chunk-KWPB6BM6.js';
|
|
6
|
+
import '../chunk-W2S4HK7J.js';
|
|
7
7
|
import '../chunk-JELSZN25.js';
|
|
8
8
|
import '../chunk-D736QUGF.js';
|
|
9
9
|
import { createIntake } from '../chunk-ZVJZ72HY.js';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-ZT3MGQB7.js';
|
|
11
11
|
import { defaultRetryPolicy, initRetry, recordFailure, shouldRetry, nextDelayMs } from '../chunk-Q2UM7BXU.js';
|
|
12
12
|
import '../chunk-S2EGRPCM.js';
|
|
13
13
|
import '../chunk-BYQUGDD3.js';
|
|
14
14
|
import '../chunk-K575PT4S.js';
|
|
15
15
|
import '../chunk-UF4MZSLT.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-7UU5P2CX.js';
|
|
17
17
|
import '../chunk-MU6MCIAC.js';
|
|
18
18
|
import '../chunk-FV3Z5MBE.js';
|
|
19
|
-
import '../chunk-
|
|
19
|
+
import '../chunk-QKUWDC4P.js';
|
|
20
20
|
import '../chunk-2YFLOCWX.js';
|
|
21
21
|
import '../chunk-ZJ5AOYBH.js';
|
|
22
22
|
import '../chunk-G5E74IJB.js';
|
|
23
|
-
import { replay, run } from '../chunk-
|
|
24
|
-
import '../chunk-
|
|
23
|
+
import { replay, run } from '../chunk-PBAYOJJO.js';
|
|
24
|
+
import '../chunk-DBOJ2UC6.js';
|
|
25
25
|
|
|
26
26
|
// src/do/durable-timer.ts
|
|
27
27
|
function durableTimer(config) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as Runtime, S as Store } from '../runtime-types-
|
|
2
|
-
import '../core-
|
|
1
|
+
import { R as Runtime, S as Store } from '../runtime-types-uBuVvZqa.js';
|
|
2
|
+
import '../core-DPYOyOJv.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Runtime bridge — expose a `@demlik/tea` runtime running in one chrome context
|
package/dist/extension/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { bridgeClient, bridgeRuntime, bridgeTabClient, passThroughMsg } from '../chunk-
|
|
1
|
+
export { bridgeClient, bridgeRuntime, bridgeTabClient, passThroughMsg } from '../chunk-CIDS43FH.js';
|
|
2
2
|
import '../chunk-G5E74IJB.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-PBAYOJJO.js';
|
|
4
|
+
import '../chunk-DBOJ2UC6.js';
|
|
5
5
|
|
|
6
6
|
// src/extension/index.ts
|
|
7
7
|
var MALFORMED = "chromeStorageStore: stored value is not a string";
|
package/dist/extension/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { bridgeClient, passThroughMsg } from '../chunk-
|
|
1
|
+
import { bridgeClient, passThroughMsg } from '../chunk-CIDS43FH.js';
|
|
2
2
|
import '../chunk-G5E74IJB.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-PBAYOJJO.js';
|
|
4
|
+
import '../chunk-DBOJ2UC6.js';
|
|
5
5
|
import { useRef, useSyncExternalStore, useEffect, useCallback, createContext, useMemo, useContext } from 'react';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Sub } from '../../core-
|
|
2
|
-
import { S as SubscribeHandler } from '../../types-
|
|
1
|
+
import { S as Sub } from '../../core-DPYOyOJv.js';
|
|
2
|
+
import { S as SubscribeHandler } from '../../types-C6mXL9wA.js';
|
|
3
3
|
|
|
4
4
|
type AlarmSubData = {
|
|
5
5
|
alarmName: string;
|
package/dist/fan-out/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as Cmd, P as Port } from '../core-
|
|
1
|
+
import { C as Cmd, P as Port } from '../core-DPYOyOJv.js';
|
|
2
2
|
import { QueueItem } from '../work-queue/index.js';
|
|
3
|
-
import '../runtime-types-
|
|
3
|
+
import '../runtime-types-uBuVvZqa.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @demlik/tea/fan-out — scatter-gather over a bounded-concurrency work list.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IdempotencyStore } from '../idempotency/index.js';
|
|
2
|
-
import { C as Cmd } from '../core-
|
|
2
|
+
import { C as Cmd } from '../core-DPYOyOJv.js';
|
|
3
3
|
import { QueueItem } from '../work-queue/index.js';
|
|
4
|
-
import '../runtime-types-
|
|
4
|
+
import '../runtime-types-uBuVvZqa.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @demlik/tea/idempotent-intake — receive-once intake for webhooks / queue
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BootingRuntime, C as CtxArg, S as Store, O as OnError, a as Supervision } from './runtime-types-
|
|
2
|
-
export { b as Branded,
|
|
3
|
-
import { C as Cmd, S as Sub, M as Machine } from './core-
|
|
4
|
-
export { d as ContextFree, D as DepKeyedSub, e as Dispose, f as Identity, c as Interpret, I as InterpretDetached, n as NoCellError, N as NoCtx, P as Port, b as PortEmitter, R as Reducer, a as SubId, g as Subscribe, h as SyncReturn, T as Transitions, U as UpdateForm, i as applyCell, j as detectUpdateForm, k as foldMsgs, l as formOf, m as msgKeysOf, s as structuralHash, o as subId } from './core-
|
|
1
|
+
import { B as BootingRuntime, C as CtxArg, S as Store, O as OnError, a as Supervision } from './runtime-types-uBuVvZqa.js';
|
|
2
|
+
export { b as Branded, j as DispatchDiscardedError, m as DispatchSettle, D as DisposeTimeoutNotice, I as IdentityDropNotice, P as PortNameCollisionError, Q as QuiescenceTimeoutError, R as Runtime, h as RuntimeDiscardNotice, i as RuntimeDiscardedError, f as RuntimeErrorContext, e as RuntimeErrorPhase, o as RuntimeRef, l as Schema, d as SubIdCollisionError, g as SupervisionStrategy, _ as __resetPortRegistry, c as absurd, q as asReducer, p as defineMachine, k as definePort, n as noop, r as replay, s as schemaMigrate, t as tryInterpret, w as wrapDetached } from './runtime-types-uBuVvZqa.js';
|
|
3
|
+
import { C as Cmd, S as Sub, M as Machine } from './core-DPYOyOJv.js';
|
|
4
|
+
export { d as ContextFree, D as DepKeyedSub, e as Dispose, f as Identity, c as Interpret, I as InterpretDetached, n as NoCellError, N as NoCtx, P as Port, b as PortEmitter, R as Reducer, a as SubId, g as Subscribe, h as SyncReturn, T as Transitions, U as UpdateForm, i as applyCell, j as detectUpdateForm, k as foldMsgs, l as formOf, m as msgKeysOf, s as structuralHash, o as subId } from './core-DPYOyOJv.js';
|
|
5
5
|
|
|
6
6
|
interface HistoryTracker<S, M extends {
|
|
7
7
|
type: string;
|
|
@@ -80,6 +80,20 @@ declare function run<S, M extends {
|
|
|
80
80
|
* `Runtime.result()` and `Runtime.done()`. PURE. Omit → never terminal.
|
|
81
81
|
*/
|
|
82
82
|
terminal?: (state: S) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* How long `stop()` waits for teardown work that returned a Promise (an
|
|
85
|
+
* async `release` in `defineManagedResource`, an async Sub cleanup) before
|
|
86
|
+
* giving up on it. Defaults to 5_000ms.
|
|
87
|
+
*
|
|
88
|
+
* `stop()` awaits those disposals so a host doing
|
|
89
|
+
* `await runtime.stop(); env.evict()` cannot drop the isolate mid-release —
|
|
90
|
+
* the leak the managed-resource battery exists to prevent, relocated to
|
|
91
|
+
* shutdown. The bound is what keeps a release that never settles from
|
|
92
|
+
* hanging the host: on expiry `stop()` reports a `DisposeTimeoutNotice`
|
|
93
|
+
* (warn-only, like every `RuntimeDiscardNotice`) and resolves anyway,
|
|
94
|
+
* because `stop()` resolving is a contract.
|
|
95
|
+
*/
|
|
96
|
+
disposeTimeoutMs?: number;
|
|
83
97
|
/**
|
|
84
98
|
* Iteration cap for `idle()`'s quiescence wait. Defaults to 100_000. Test
|
|
85
99
|
* seam only. Production code must not set it.
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PortNameCollisionError, QuiescenceTimeoutError, SubIdCollisionError, __resetPortRegistry, absurd, asReducer, defineMachine, definePort, historyTracker, noop, replay, run, schemaMigrate, tryInterpret, wrapDetached } from './chunk-
|
|
2
|
-
export { Cmd, NoCellError, applyCell, detectUpdateForm, foldMsgs, formOf, msgKeysOf, structuralHash, subId } from './chunk-
|
|
1
|
+
export { DispatchDiscardedError, DisposeTimeoutNotice, IdentityDropNotice, PortNameCollisionError, QuiescenceTimeoutError, RuntimeDiscardNotice, RuntimeDiscardedError, SubIdCollisionError, __resetPortRegistry, absurd, asReducer, defineMachine, definePort, historyTracker, noop, replay, run, schemaMigrate, tryInterpret, wrapDetached } from './chunk-PBAYOJJO.js';
|
|
2
|
+
export { Cmd, NoCellError, applyCell, detectUpdateForm, foldMsgs, formOf, msgKeysOf, structuralHash, subId } from './chunk-DBOJ2UC6.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/llm-call/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { C as Cmd } from '../core-
|
|
1
|
+
import { C as Cmd } from '../core-DPYOyOJv.js';
|
|
2
2
|
import { SucceedMsg, FailMsg, RunCmd, ResilientState } from '../resilient-call/index.js';
|
|
3
3
|
import { RetryPolicy } from '../retry-backoff/index.js';
|
|
4
4
|
import { DeadlineExceeded, DeadlineSub } from '../deadline/index.js';
|
|
5
5
|
export { deadlineSub, subscribeDeadline } from '../deadline/index.js';
|
|
6
6
|
import '../cache/index.js';
|
|
7
|
-
import '../types-
|
|
7
|
+
import '../types-C6mXL9wA.js';
|
|
8
8
|
import '../circuit-breaker/index.js';
|
|
9
9
|
import '../protocol-B5YmJr0d.js';
|
|
10
10
|
import '../rate-limit/index.js';
|
package/dist/llm-call/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { createLlmCall, liftLlmCall } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { createLlmCall, liftLlmCall } from '../chunk-T6HDAPMR.js';
|
|
2
|
+
import '../chunk-W2S4HK7J.js';
|
|
3
3
|
import '../chunk-JELSZN25.js';
|
|
4
|
-
export { deadlineSub, subscribeDeadline } from '../chunk-
|
|
4
|
+
export { deadlineSub, subscribeDeadline } from '../chunk-ZT3MGQB7.js';
|
|
5
5
|
import '../chunk-Q2UM7BXU.js';
|
|
6
6
|
import '../chunk-S2EGRPCM.js';
|
|
7
7
|
import '../chunk-UF4MZSLT.js';
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-7UU5P2CX.js';
|
|
9
|
+
import '../chunk-QKUWDC4P.js';
|
|
10
10
|
import '../chunk-2YFLOCWX.js';
|
|
11
11
|
import '../chunk-ZJ5AOYBH.js';
|
|
12
12
|
import '../chunk-G5E74IJB.js';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-PBAYOJJO.js';
|
|
14
|
+
import '../chunk-DBOJ2UC6.js';
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Cmd, c as Interpret, M as Machine } from './core-
|
|
1
|
+
import { C as Cmd, c as Interpret, M as Machine } from './core-DPYOyOJv.js';
|
|
2
2
|
import { LlmCall, LlmOk, ModelFactory, Schema, MessageLoader, LlmErr, LlmSucceedMsg, LlmFailMsg, LlmTimerMsg, LlmRunCmd, LlmCallPorts } from './llm-call/index.js';
|
|
3
3
|
import { MonitoredRunState, RunFailure, MonitoredRunCmd } from './monitored-run/index.js';
|
|
4
4
|
import { M as MsgType } from './protocol-B5YmJr0d.js';
|
package/dist/mem/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DeadlineExceeded, DeadlineSub } from '../deadline/index.js';
|
|
2
2
|
export { deadlineSub, subscribeDeadline } from '../deadline/index.js';
|
|
3
|
-
import { c as Interpret, C as Cmd } from '../core-
|
|
3
|
+
import { c as Interpret, C as Cmd } from '../core-DPYOyOJv.js';
|
|
4
4
|
import { SnapshotState, SnapshotWriteCmd, SnapshotStore, SnapshotSavedMsg, SnapshotFailedMsg, SnapshotLoadedMsg, SnapshotLoadFailedMsg, SnapshotLoadCmd } from '../snapshot/index.js';
|
|
5
5
|
import { QueueItem } from '../work-queue/index.js';
|
|
6
|
-
import '../types-
|
|
7
|
-
import '../runtime-types-
|
|
6
|
+
import '../types-C6mXL9wA.js';
|
|
7
|
+
import '../runtime-types-uBuVvZqa.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @demlik/tea/monitored-run — a long-running operation that is BOTH staged and
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { createMonitoredRun, liftRun } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
export { deadlineSub, subscribeDeadline } from '../chunk-
|
|
1
|
+
export { createMonitoredRun, liftRun } from '../chunk-ZILCH3WS.js';
|
|
2
|
+
import '../chunk-KWPB6BM6.js';
|
|
3
|
+
export { deadlineSub, subscribeDeadline } from '../chunk-ZT3MGQB7.js';
|
|
4
4
|
import '../chunk-MU6MCIAC.js';
|
|
5
5
|
import '../chunk-FV3Z5MBE.js';
|
|
6
6
|
import '../chunk-2YFLOCWX.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-PBAYOJJO.js';
|
|
8
|
+
import '../chunk-DBOJ2UC6.js';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'ws';
|
|
2
|
-
import { S as Store } from '../runtime-types-
|
|
3
|
-
import { a as SubId, S as Sub } from '../core-
|
|
2
|
+
import { S as Store } from '../runtime-types-uBuVvZqa.js';
|
|
3
|
+
import { a as SubId, S as Sub } from '../core-DPYOyOJv.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @packageDocumentation
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as Cmd } from '../core-
|
|
1
|
+
import { C as Cmd } from '../core-DPYOyOJv.js';
|
|
2
2
|
import { PaginatorState } from '../paginator/index.js';
|
|
3
3
|
import { CircuitConfig, RateLimitConfig, DeadlineConfig, ResilientState, RunCmd, SucceedMsg, FailMsg, ResilientTimerMsg, ResilientPorts } from '../resilient-call/index.js';
|
|
4
4
|
import { RetryPolicy } from '../retry-backoff/index.js';
|
|
5
5
|
import { DeadlineSub } from '../deadline/index.js';
|
|
6
6
|
export { deadlineSub, subscribeDeadline } from '../deadline/index.js';
|
|
7
7
|
import '../cache/index.js';
|
|
8
|
-
import '../types-
|
|
8
|
+
import '../types-C6mXL9wA.js';
|
|
9
9
|
import '../circuit-breaker/index.js';
|
|
10
10
|
import '../protocol-B5YmJr0d.js';
|
|
11
11
|
import '../rate-limit/index.js';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { PAGE_KEY, createPaginatedWalk, liftWalk } from '../chunk-
|
|
1
|
+
export { PAGE_KEY, createPaginatedWalk, liftWalk } from '../chunk-7A74NSG4.js';
|
|
2
2
|
import '../chunk-SINXE47Y.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-W2S4HK7J.js';
|
|
4
4
|
import '../chunk-JELSZN25.js';
|
|
5
|
-
export { deadlineSub, subscribeDeadline } from '../chunk-
|
|
5
|
+
export { deadlineSub, subscribeDeadline } from '../chunk-ZT3MGQB7.js';
|
|
6
6
|
import '../chunk-Q2UM7BXU.js';
|
|
7
7
|
import '../chunk-S2EGRPCM.js';
|
|
8
8
|
import '../chunk-UF4MZSLT.js';
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import '../chunk-
|
|
9
|
+
import '../chunk-7UU5P2CX.js';
|
|
10
|
+
import '../chunk-QKUWDC4P.js';
|
|
11
11
|
import '../chunk-2YFLOCWX.js';
|
|
12
12
|
import '../chunk-ZJ5AOYBH.js';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-PBAYOJJO.js';
|
|
14
|
+
import '../chunk-DBOJ2UC6.js';
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/parity/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BootingRuntime } from '../runtime-types-
|
|
2
|
-
import { C as Cmd, S as Sub, M as Machine } from '../core-
|
|
1
|
+
import { B as BootingRuntime } from '../runtime-types-uBuVvZqa.js';
|
|
2
|
+
import { C as Cmd, S as Sub, M as Machine } from '../core-DPYOyOJv.js';
|
|
3
3
|
import { Trace, RecorderOptions } from '../recorder/index.js';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/parity/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { recorder } from '../chunk-MUUROGIH.js';
|
|
2
|
-
import { deepEqual } from '../chunk-
|
|
2
|
+
import { deepEqual } from '../chunk-362SZ6CS.js';
|
|
3
3
|
import '../chunk-EWJP3YYP.js';
|
|
4
|
-
import { replay } from '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import { replay } from '../chunk-PBAYOJJO.js';
|
|
5
|
+
import '../chunk-DBOJ2UC6.js';
|
|
6
6
|
|
|
7
7
|
// src/parity/index.ts
|
|
8
8
|
function recordRun(runtime, opts) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as fc from 'fast-check';
|
|
2
|
-
import { C as Cmd, S as Sub, M as Machine } from '../../core-
|
|
2
|
+
import { C as Cmd, S as Sub, M as Machine } from '../../core-DPYOyOJv.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Build a Ctx value whose every property access throws. Use as the `ctx`
|
package/dist/pbt/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { MsgArbitraryTable, arbConstantMsg, arbGuidedSequence, arbMsg, arbMsgSequence, arbRecordMsg, stubCtxThrowingProxy } from './arbitraries/index.js';
|
|
2
2
|
export { Step, foldEvents, propertyInvariant, propertyTerminates, propertyTrace } from './runners/index.js';
|
|
3
|
-
import { C as Cmd, R as Reducer, T as Transitions, U as UpdateForm } from '../core-
|
|
3
|
+
import { C as Cmd, R as Reducer, T as Transitions, U as UpdateForm } from '../core-DPYOyOJv.js';
|
|
4
4
|
import 'fast-check';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/pbt/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { arbConstantMsg, arbGuidedSequence, arbMsg, arbMsgSequence, arbRecordMsg, stubCtxThrowingProxy } from '../chunk-7FYQGDMF.js';
|
|
2
|
-
export { foldEvents, propertyInvariant, propertyTerminates, propertyTrace } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import { msgKeysOf } from '../chunk-
|
|
2
|
+
export { foldEvents, propertyInvariant, propertyTerminates, propertyTrace } from '../chunk-LFW66IIV.js';
|
|
3
|
+
import '../chunk-PBAYOJJO.js';
|
|
4
|
+
import { msgKeysOf } from '../chunk-DBOJ2UC6.js';
|
|
5
5
|
|
|
6
6
|
// src/pbt/util/msg-keys.ts
|
|
7
7
|
function msgTypeKeys(machine) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { foldEvents, propertyInvariant, propertyTerminates, propertyTrace } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { foldEvents, propertyInvariant, propertyTerminates, propertyTrace } from '../../chunk-LFW66IIV.js';
|
|
2
|
+
import '../../chunk-PBAYOJJO.js';
|
|
3
|
+
import '../../chunk-DBOJ2UC6.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/poller/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DeadlineSub } from '../deadline/index.js';
|
|
2
2
|
import { IdempotencyStore } from '../idempotency/index.js';
|
|
3
|
-
import { C as Cmd, S as Sub } from '../core-
|
|
3
|
+
import { C as Cmd, S as Sub } from '../core-DPYOyOJv.js';
|
|
4
4
|
import { AnyRetryPolicy, RetryState } from '../retry-backoff/index.js';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-C6mXL9wA.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @demlik/tea/poller — "poll a source every N ms until a predicate holds, with
|
package/dist/poller/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { deadlineSub } from '../chunk-
|
|
1
|
+
import { deadlineSub } from '../chunk-ZT3MGQB7.js';
|
|
2
2
|
import { asRng, defaultRetryPolicy, initRetry, recordFailure, shouldRetry, nextDelayMs } from '../chunk-Q2UM7BXU.js';
|
|
3
3
|
import { idempotencyMemory } from '../chunk-BYQUGDD3.js';
|
|
4
4
|
import '../chunk-K575PT4S.js';
|
|
5
5
|
import '../chunk-2YFLOCWX.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-PBAYOJJO.js';
|
|
7
|
+
import '../chunk-DBOJ2UC6.js';
|
|
8
8
|
|
|
9
9
|
// src/poller/index.ts
|
|
10
10
|
function pollerSubId(atMs) {
|
package/dist/prediction/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { NO_ACK, ack, initAck, nextSeq, partitionByAck, reconcile, tagSeq } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { NO_ACK, ack, initAck, nextSeq, partitionByAck, reconcile, tagSeq } from '../chunk-62QBHM3T.js';
|
|
2
|
+
import '../chunk-DBOJ2UC6.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/pure/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Ack, AckPartition, NO_ACK, Seq, SeqTagged, ack, initAck, nextSeq, partitionByAck, reconcile, tagSeq } from '../prediction/index.js';
|
|
2
|
-
export { C as Cmd, d as ContextFree, D as DepKeyedSub, e as Dispose, f as Identity, c as Interpret, I as InterpretDetached, M as Machine, n as NoCellError, N as NoCtx, P as Port, b as PortEmitter, R as Reducer, S as Sub, a as SubId, g as Subscribe, h as SyncReturn, T as Transitions, U as UpdateForm, j as detectUpdateForm, k as foldMsgs, l as formOf, s as structuralHash, o as subId } from '../core-
|
|
2
|
+
export { C as Cmd, d as ContextFree, D as DepKeyedSub, e as Dispose, f as Identity, c as Interpret, I as InterpretDetached, M as Machine, n as NoCellError, N as NoCtx, P as Port, b as PortEmitter, R as Reducer, S as Sub, a as SubId, g as Subscribe, h as SyncReturn, T as Transitions, U as UpdateForm, j as detectUpdateForm, k as foldMsgs, l as formOf, s as structuralHash, o as subId } from '../core-DPYOyOJv.js';
|
package/dist/pure/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { NO_ACK, ack, initAck, nextSeq, partitionByAck, reconcile, tagSeq } from '../chunk-
|
|
2
|
-
export { Cmd, NoCellError, detectUpdateForm, foldMsgs, formOf, structuralHash, subId } from '../chunk-
|
|
1
|
+
export { NO_ACK, ack, initAck, nextSeq, partitionByAck, reconcile, tagSeq } from '../chunk-62QBHM3T.js';
|
|
2
|
+
export { Cmd, NoCellError, detectUpdateForm, foldMsgs, formOf, structuralHash, subId } from '../chunk-DBOJ2UC6.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Store, R as Runtime } from '../runtime-types-
|
|
2
|
-
import { C as Cmd, S as Sub, M as Machine } from '../core-
|
|
1
|
+
import { S as Store, R as Runtime } from '../runtime-types-uBuVvZqa.js';
|
|
2
|
+
import { C as Cmd, S as Sub, M as Machine } from '../core-DPYOyOJv.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @packageDocumentation
|
|
@@ -32,6 +32,10 @@ import { C as Cmd, S as Sub, M as Machine } from '../core-42kapW0n.js';
|
|
|
32
32
|
* **Identity matters.** The runtime is memoized on `[machine, opts.ctx,
|
|
33
33
|
* opts.store]`. A new `ctx` reference rebuilds the runtime. Always `useMemo`
|
|
34
34
|
* (or otherwise stabilize) the ctx at the call site. See README.
|
|
35
|
+
*
|
|
36
|
+
* Forgetting to is no longer silent: the replaced runtime's `stop()` reports
|
|
37
|
+
* `RuntimeDiscardedError` under `phase: "discard"` when Cmds were still in
|
|
38
|
+
* flight, which the substrate's default sink warns about (issue #365).
|
|
35
39
|
*/
|
|
36
40
|
interface UseMachineOpts<S, Ctx> {
|
|
37
41
|
ctx: Ctx;
|
|
@@ -47,7 +51,9 @@ interface UseMachineOpts<S, Ctx> {
|
|
|
47
51
|
* runtime.getState)` — tearing-free under React 18 concurrent rendering.
|
|
48
52
|
* - On unmount (or any dep change), `useEffect` cleanup calls
|
|
49
53
|
* `runtime.stop()` — drains the queue, runs every active sub cleanup,
|
|
50
|
-
* flushes state
|
|
54
|
+
* flushes state, and — if Cmds were still in flight — reports
|
|
55
|
+
* `RuntimeDiscardedError` (`phase: "discard"`) rather than dropping them
|
|
56
|
+
* silently.
|
|
51
57
|
*
|
|
52
58
|
* Returns `[state, dispatch]` shaped like `useReducer`.
|
|
53
59
|
*/
|
package/dist/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { run } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { run } from '../chunk-PBAYOJJO.js';
|
|
2
|
+
import '../chunk-DBOJ2UC6.js';
|
|
3
3
|
import { useMemo, useRef, useReducer, useSyncExternalStore, useEffect } from 'react';
|
|
4
4
|
|
|
5
5
|
function useMachine(machine, opts) {
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"sources":["../../src/react/index.ts"],"names":[],"mappings":";;;;AA4EO,SAAS,UAAA,CAOd,SACA,IAAA,EACgC;AAMhC,EAAA,MAAM,MAAM,IAAA,CAAK,GAAA;AACjB,EAAA,MAAM,QAAQ,IAAA,CAAK,KAAA;AAMnB,EAAA,MAAM,OAAA,GAAU,OAAA;AAAA,IACd,MAAM,GAAA,CAAI,OAAA,EAAS,EAAE,GAAA,EAAK,OAAO,CAAA;AAAA,IACjC,CAAC,OAAA,EAAS,GAAA,EAAK,KAAK;AAAA,GACtB;AAeA,EAAA,MAAM,QAAA,GAAW,OAA6B,IAAI,CAAA;AAClD,EAAA,MAAM,GAAG,UAAU,CAAA,GAAI,WAAW,CAAC,IAAA,KAAiB,IAAA,GAAO,CAAA,EAAG,CAAC,CAAA;AAa/D,EAAA,MAAM,gBAAA,GAAmB,OAAA;AAAA,IACvB,MAAM,OAAA,CAAQ,IAAA,CAAK,IAAA,EAAM,GAAG,EAAE,CAAC,CAAA;AAAA,IAC/B,CAAC,SAAS,GAAG;AAAA,GACf;AAMA,EAAA,MAAM,WAAA,GAAc,MAClB,QAAA,CAAS,OAAA,KAAY,OAAO,QAAA,CAAS,OAAA,CAAQ,UAAS,GAAI,gBAAA;AAE5D,EAAA,MAAM,KAAA,GAAQ,oBAAA;AAAA,IACZ,OAAA,CAAQ,SAAA;AAAA,IACR,WAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,IAAA,GAAO,IAAA;AAMX,IAAA,OAAA,CAAQ,KAAA,CAAM,IAAA;AAAA,MACZ,CAAC,CAAA,KAAM;AACL,QAAA,IAAI,IAAA,EAAM;AACR,UAAA,QAAA,CAAS,OAAA,GAAU,CAAA;AACnB,UAAA,UAAA,EAAW;AAAA,QACb;AAAA,MACF,CAAA;AAAA,MACA,MAAM;AAAA,MAAC;AAAA,KACT;AACA,IAAA,OAAO,MAAM;AACX,MAAA,IAAA,GAAO,KAAA;AACP,MAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AAInB,MAAA,OAAA,CAAQ,IAAA,EAAK,CAAE,KAAA,CAAM,MAAM;AAAA,MAAC,CAAC,CAAA;AAAA,IAC/B,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,OAAO,CAAC,KAAA,EAAO,OAAA,CAAQ,QAAQ,CAAA;AACjC;AAeO,SAAS,WACd,OAAA,EACgC;AAChC,EAAA,MAAM,KAAA,GAAQ,oBAAA;AAAA,IACZ,OAAA,CAAQ,SAAA;AAAA,IACR,OAAA,CAAQ,QAAA;AAAA,IACR,OAAA,CAAQ;AAAA,GACV;AACA,EAAA,OAAO,CAAC,KAAA,EAAO,OAAA,CAAQ,QAAQ,CAAA;AACjC","file":"index.js","sourcesContent":["/**\n * @packageDocumentation\n * @demlik/tea/react — React host adapter for `@demlik/tea`.\n *\n * The thinnest possible adapter that makes a tea machine consumable from a\n * React component. Three rules (PRD §\"React adapter\"):\n *\n * 1. The runtime is the source of truth, NOT React state. We subscribe via\n * `useSyncExternalStore(runtime.subscribe, runtime.getState,\n * runtime.getState)`. React renders are driven by runtime state changes;\n * React never owns the state.\n * 2. The runtime is memoized per component-mount, not per render. The deps\n * array is `[machine, opts.ctx, opts.store]` — IDENTITY, not value. See\n * `README.md` for the ctx-identity footgun + fix.\n * 3. Concurrent React is the design target. `useSyncExternalStore` is the\n * React-blessed primitive for tearing-free external state.\n *\n * Client-only in v1 — components that call `useMachine` MUST be `\"use client\"`.\n * Server Components consume data via Relay/RSC as today; tea machines own\n * client-side stateful flows. No RSC streaming, no server-side state\n * hydration. Crossing this boundary is a v2 concern.\n */\n\n\"use client\";\n\nimport {\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useSyncExternalStore,\n} from \"react\";\nimport {\n type BootingRuntime,\n type Cmd,\n type Machine,\n type Runtime,\n run,\n type Store,\n type Sub,\n} from \"../index\";\n\n/**\n * Options passed to `useMachine`. The shape is intentionally minimal — `ctx`\n * is required (every machine has one), `store` is optional (omit it for\n * volatile-state machines).\n *\n * **Identity matters.** The runtime is memoized on `[machine, opts.ctx,\n * opts.store]`. A new `ctx` reference rebuilds the runtime. Always `useMemo`\n * (or otherwise stabilize) the ctx at the call site. See README.\n *\n * Forgetting to is no longer silent: the replaced runtime's `stop()` reports\n * `RuntimeDiscardedError` under `phase: \"discard\"` when Cmds were still in\n * flight, which the substrate's default sink warns about (issue #365).\n */\nexport interface UseMachineOpts<S, Ctx> {\n ctx: Ctx;\n store?: Store<S>;\n}\n\n/**\n * Build and own a `Runtime<S, M>` for the lifetime of the component mount.\n *\n * - Builds via `useMemo(() => run(machine, opts), [machine, opts.ctx,\n * opts.store])` — runtime is recreated when ANY of the three identities\n * change.\n * - Subscribes via `useSyncExternalStore(runtime.subscribe, runtime.getState,\n * runtime.getState)` — tearing-free under React 18 concurrent rendering.\n * - On unmount (or any dep change), `useEffect` cleanup calls\n * `runtime.stop()` — drains the queue, runs every active sub cleanup,\n * flushes state, and — if Cmds were still in flight — reports\n * `RuntimeDiscardedError` (`phase: \"discard\"`) rather than dropping them\n * silently.\n *\n * Returns `[state, dispatch]` shaped like `useReducer`.\n */\nexport function useMachine<\n S,\n M extends { type: string },\n C extends Cmd,\n U extends Sub,\n Ctx,\n>(\n machine: Machine<S, M, C, U, Ctx>,\n opts: UseMachineOpts<S, Ctx>,\n): [S, (msg: M) => Promise<void>] {\n // Deps are literal: machine identity, ctx identity, store identity. NOT\n // `[opts]` (would rebuild every render — callers pass fresh objects).\n // We pass explicit fields to `run()` so the closure captures only the\n // deps in the array — keeps biome's `useExhaustiveDependencies` happy\n // without lying about what the memo actually depends on.\n const ctx = opts.ctx;\n const store = opts.store;\n // `run()` returns a `BootingRuntime<S, M>` SYNCHRONOUSLY (issue #45) — exactly\n // what `useMemo` needs. We never `await` here: awaiting would force an async\n // memo, a null first-commit state, and a resolved-flag dance. Instead we hold\n // the booting handle and capture the booted `Runtime` (the only thing with a\n // total `getState`) once `ready` resolves.\n const booting = useMemo<BootingRuntime<S, M>>(\n () => run(machine, { ctx, store }),\n [machine, ctx, store],\n );\n\n // Captures the booted `Runtime` once `ready` resolves. Until then it is\n // `null` and `getSnapshot` serves `preliminaryState`. Reset whenever the\n // booting handle identity changes (a new machine/ctx/store mount).\n //\n // The boot race the paired `bootedTick` bump exists for: the substrate's\n // boot fanout fires BEFORE `ready` resolves (fireListeners runs inside the\n // boot step; `ready` chains off the boot promise), so at notification time\n // this ref is still null and `getSnapshot` returns the same\n // `preliminaryState` reference — React sees an unchanged snapshot and\n // skips the re-render. Nothing re-notifies after the ref is set, so a\n // store-backed mount would stay stuck on the preliminary state until the\n // next unrelated transition. Bumping a reducer when we capture the booted\n // runtime forces the render that swaps preliminary → real state.\n const readyRef = useRef<Runtime<S, M> | null>(null);\n const [, markBooted] = useReducer((tick: number) => tick + 1, 0);\n\n // Preliminary state computed sync from `machine.init(null, ctx)`. This is\n // the snapshot React sees BEFORE the runtime finishes booting (matters\n // only when `opts.store` is present — without a store, the substrate\n // already sets state synchronously inside `run()`, so the boot fanout that\n // captures `readyRef` lands on the same microtask as the first commit).\n //\n // We deliberately recompute on each render but cache by `[machine,\n // opts.ctx]` — `init` is pure by convention, so cost is negligible. The\n // cached snapshot is also identity-stable across rerenders when the deps\n // don't change, which `useSyncExternalStore` rewards (no spurious\n // re-renders).\n const preliminaryState = useMemo<S>(\n () => machine.init(null, ctx)[0],\n [machine, ctx],\n );\n\n // `getSnapshot` reads the booted runtime if `ready` has resolved (the ref is\n // populated), else falls back to the preliminary state. No try/catch dance\n // anymore — pre-boot there is simply no booted `Runtime` to read from, so\n // the fallback is structural, not exception-driven.\n const getSnapshot = (): S =>\n readyRef.current !== null ? readyRef.current.getState() : preliminaryState;\n\n const state = useSyncExternalStore(\n booting.subscribe,\n getSnapshot,\n getSnapshot,\n );\n\n useEffect(() => {\n let live = true;\n // Capture the booted runtime when `ready` resolves, then force the\n // render that swaps preliminary → real state (see the boot-race note on\n // `readyRef` — the boot fanout fires too early to do it for us). Boot\n // rejections are swallowed: a failed boot surfaces on every `dispatch`,\n // which is where the consumer handles it.\n booting.ready.then(\n (r) => {\n if (live) {\n readyRef.current = r;\n markBooted();\n }\n },\n () => {},\n );\n return () => {\n live = false;\n readyRef.current = null;\n // Fire-and-forget — `stop()` is async but `useEffect` cleanup is sync.\n // The runtime swallows in-flight rejections internally, so this never\n // rejects in practice; we still attach `.catch` for safety.\n booting.stop().catch(() => {});\n };\n }, [booting]);\n\n return [state, booting.dispatch];\n}\n\n/**\n * Lower-level escape hatch: consume an externally-built `Runtime<S, M>`.\n *\n * Use this when the runtime is owned by something OTHER than the component —\n * a parent component, a test harness, a singleton. **The component does NOT\n * call `runtime.stop()` on unmount** — the caller owns the lifecycle.\n *\n * Primary use case in this repo: component tests. Build a runtime with\n * `@demlik/tea/mem` and pre-seed it via `replay`, then mount the component with\n * `useRuntime(testRuntime)` to render in any phase.\n *\n * Returns `[state, dispatch]` — same shape as `useMachine`.\n */\nexport function useRuntime<S, M extends { type: string }>(\n runtime: Runtime<S, M>,\n): [S, (msg: M) => Promise<void>] {\n const state = useSyncExternalStore(\n runtime.subscribe,\n runtime.getState,\n runtime.getState,\n );\n return [state, runtime.dispatch];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CircuitConfig, RateLimitConfig, DeadlineConfig, ResilientPorts, RunCmd, FailMsg, SucceedMsg } from '../resilient-call/index.js';
|
|
2
2
|
import { TtlCache } from '../cache/index.js';
|
|
3
|
-
import { C as Cmd } from '../core-
|
|
3
|
+
import { C as Cmd } from '../core-DPYOyOJv.js';
|
|
4
4
|
import { PaginatedWalkState, FetchPageCmd, PageOkMsg, PageErrMsg, PaginatedWalkTimerMsg } from '../paginated-walk/index.js';
|
|
5
5
|
import { RetryPolicy } from '../retry-backoff/index.js';
|
|
6
6
|
import { DeadlineSub } from '../deadline/index.js';
|
|
@@ -8,7 +8,7 @@ export { deadlineSub, subscribeDeadline } from '../deadline/index.js';
|
|
|
8
8
|
import '../circuit-breaker/index.js';
|
|
9
9
|
import '../protocol-B5YmJr0d.js';
|
|
10
10
|
import '../rate-limit/index.js';
|
|
11
|
-
import '../types-
|
|
11
|
+
import '../types-C6mXL9wA.js';
|
|
12
12
|
import '../paginator/index.js';
|
|
13
13
|
|
|
14
14
|
/**
|
package/dist/reconciler/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { createPaginatedWalk, PAGE_KEY } from '../chunk-
|
|
1
|
+
import { createPaginatedWalk, PAGE_KEY } from '../chunk-7A74NSG4.js';
|
|
2
2
|
import '../chunk-SINXE47Y.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-W2S4HK7J.js';
|
|
4
4
|
import '../chunk-JELSZN25.js';
|
|
5
|
-
export { deadlineSub, subscribeDeadline } from '../chunk-
|
|
5
|
+
export { deadlineSub, subscribeDeadline } from '../chunk-ZT3MGQB7.js';
|
|
6
6
|
import '../chunk-Q2UM7BXU.js';
|
|
7
7
|
import '../chunk-S2EGRPCM.js';
|
|
8
8
|
import '../chunk-UF4MZSLT.js';
|
|
9
|
-
import { initCache, get, set } from '../chunk-
|
|
10
|
-
import '../chunk-
|
|
9
|
+
import { initCache, get, set } from '../chunk-7UU5P2CX.js';
|
|
10
|
+
import '../chunk-QKUWDC4P.js';
|
|
11
11
|
import '../chunk-2YFLOCWX.js';
|
|
12
12
|
import '../chunk-ZJ5AOYBH.js';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-PBAYOJJO.js';
|
|
14
|
+
import '../chunk-DBOJ2UC6.js';
|
|
15
15
|
|
|
16
16
|
// src/reconciler/index.ts
|
|
17
17
|
function createReconciler(config, rng = Math.random) {
|
package/dist/recorder/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BootingRuntime } from '../runtime-types-
|
|
2
|
-
import '../core-
|
|
1
|
+
import { B as BootingRuntime } from '../runtime-types-uBuVvZqa.js';
|
|
2
|
+
import '../core-DPYOyOJv.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A recorded run, sufficient to reproduce it via `../trace-replay`.
|
|
@@ -2,11 +2,11 @@ import { TtlCache } from '../cache/index.js';
|
|
|
2
2
|
import { CircuitState } from '../circuit-breaker/index.js';
|
|
3
3
|
import { DeadlineExceeded, DeadlineSub } from '../deadline/index.js';
|
|
4
4
|
export { deadlineSub, subscribeDeadline } from '../deadline/index.js';
|
|
5
|
-
import { C as Cmd } from '../core-
|
|
5
|
+
import { C as Cmd } from '../core-DPYOyOJv.js';
|
|
6
6
|
import { M as MsgType } from '../protocol-B5YmJr0d.js';
|
|
7
7
|
import { TokenBucket } from '../rate-limit/index.js';
|
|
8
8
|
import { RetryState, AnyRetryPolicy } from '../retry-backoff/index.js';
|
|
9
|
-
import '../types-
|
|
9
|
+
import '../types-C6mXL9wA.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @packageDocumentation
|