@swirls/looms 0.0.2 → 0.1.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/CHANGELOG.md +9 -2
- package/dist/actor/cell.d.ts +9 -4
- package/dist/actor/cell.js +7 -11
- package/dist/actor/host.d.ts +7 -3
- package/dist/actor/host.js +55 -32
- package/dist/actor/index.d.ts +1 -1
- package/dist/actor/index.js +1 -1
- package/dist/actor/routing.d.ts +12 -1
- package/dist/actor/routing.js +57 -51
- package/dist/agent/agent-session.d.ts +5 -0
- package/dist/agent/agent-session.js +270 -0
- package/dist/agent/definitions-store.d.ts +2 -3
- package/dist/agent/definitions-store.js +2 -4
- package/dist/agent/definitions.d.ts +46 -20
- package/dist/agent/definitions.js +36 -8
- package/dist/agent/effects.d.ts +359 -2
- package/dist/agent/effects.js +60 -34
- package/dist/agent/events.d.ts +175 -19
- package/dist/agent/events.js +45 -10
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.js +1 -0
- package/dist/agent/llm.d.ts +11 -2
- package/dist/agent/llm.js +13 -3
- package/dist/agent/module.d.ts +812 -78
- package/dist/agent/module.js +16 -4
- package/dist/agent/scope.d.ts +174 -18
- package/dist/agent/signals.d.ts +24 -1
- package/dist/agent/signals.js +77 -0
- package/dist/agent/threads.d.ts +3 -33
- package/dist/agent/threads.js +20 -25
- package/dist/agent/tool-schema.js +0 -1
- package/dist/agent/types.d.ts +49 -4
- package/dist/agent/types.js +5 -5
- package/dist/ai-vercel/index.d.ts +1 -0
- package/dist/ai-vercel/index.js +1 -0
- package/dist/ai-vercel/messages.js +22 -7
- package/dist/ai-vercel/vercel-evaluator.d.ts +23 -0
- package/dist/ai-vercel/vercel-evaluator.js +68 -0
- package/dist/ai-vercel/vercel-llm.js +64 -44
- package/dist/approval/effects.d.ts +89 -0
- package/dist/approval/module.d.ts +179 -29
- package/dist/approval/projections.d.ts +0 -14
- package/dist/approval/projections.js +20 -3
- package/dist/approval/signals.d.ts +2 -0
- package/dist/approval/signals.js +18 -2
- package/dist/cli/cli.js +2 -0
- package/dist/cli/commands.js +12 -16
- package/dist/client/client.d.ts +1195 -18
- package/dist/client/client.js +118 -120
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/sse.d.ts +13 -0
- package/dist/client/sse.js +38 -44
- package/dist/cloudflare/alarm-scheduler.d.ts +12 -2
- package/dist/cloudflare/alarm-scheduler.js +34 -7
- package/dist/cloudflare/durable-object.d.ts +10 -2
- package/dist/cloudflare/durable-object.js +59 -28
- package/dist/cloudflare/event-store.d.ts +7 -2
- package/dist/cloudflare/event-store.js +8 -7
- package/dist/cloudflare/index.d.ts +2 -2
- package/dist/cloudflare/index.js +2 -2
- package/dist/cloudflare/router.js +13 -14
- package/dist/core/catalog.d.ts +3 -3
- package/dist/core/catalog.js +2 -5
- package/dist/core/coalesce.js +5 -3
- package/dist/core/compose.d.ts +2 -1
- package/dist/core/compose.js +18 -2
- package/dist/core/definition-store.d.ts +11 -0
- package/dist/core/definition-store.js +6 -0
- package/dist/core/effects.d.ts +127 -15
- package/dist/core/effects.js +89 -17
- package/dist/core/envelope.d.ts +27 -7
- package/dist/core/envelope.js +20 -6
- package/dist/core/event-codec.d.ts +4 -2
- package/dist/core/event-codec.js +10 -5
- package/dist/core/event-index.js +1 -3
- package/dist/core/fold.d.ts +3 -0
- package/dist/core/fold.js +171 -24
- package/dist/core/ids.d.ts +5 -0
- package/dist/core/ids.js +35 -2
- package/dist/core/index.d.ts +5 -1
- package/dist/core/index.js +5 -1
- package/dist/core/kind.d.ts +22 -0
- package/dist/core/kind.js +17 -0
- package/dist/core/limits.d.ts +34 -0
- package/dist/core/limits.js +46 -0
- package/dist/core/match.d.ts +1 -0
- package/dist/core/match.js +10 -1
- package/dist/core/module-scope.d.ts +22 -20
- package/dist/core/module-scope.js +38 -28
- package/dist/core/module.d.ts +16 -5
- package/dist/core/module.js +4 -0
- package/dist/core/projection.d.ts +13 -13
- package/dist/core/projection.js +9 -5
- package/dist/core/protocol.d.ts +68 -11
- package/dist/core/protocol.js +82 -11
- package/dist/core/replay.d.ts +312 -3
- package/dist/core/replay.js +11 -1
- package/dist/core/schema.d.ts +8 -19
- package/dist/core/schema.js +25 -80
- package/dist/core/serialize.js +2 -4
- package/dist/core/snapshot-store.d.ts +2 -1
- package/dist/core/snapshot-store.js +8 -2
- package/dist/core/snapshots.d.ts +5 -1
- package/dist/core/snapshots.js +10 -15
- package/dist/core/sqlite-store.js +56 -11
- package/dist/core/state.d.ts +142 -4
- package/dist/core/state.js +78 -0
- package/dist/core/store.d.ts +38 -3
- package/dist/core/store.js +77 -22
- package/dist/core/thread.d.ts +10 -9
- package/dist/core/types.d.ts +5 -8
- package/dist/core/types.js +28 -24
- package/dist/core/validate-event.js +14 -4
- package/dist/core/worker-callback.d.ts +17 -0
- package/dist/core/worker-callback.js +1 -0
- package/dist/debugger/components/event-stream.js +9 -10
- package/dist/debugger/events/protocol-summarize.js +26 -0
- package/dist/debugger/lib/event-meta.js +1 -2
- package/dist/evaluator/definitions-store.d.ts +11 -0
- package/dist/evaluator/definitions-store.js +8 -0
- package/dist/evaluator/definitions.d.ts +18 -0
- package/dist/evaluator/definitions.js +4 -0
- package/dist/evaluator/effects.d.ts +226 -0
- package/dist/evaluator/effects.js +132 -0
- package/dist/evaluator/evaluator.d.ts +24 -0
- package/dist/evaluator/evaluator.js +67 -0
- package/dist/evaluator/events.d.ts +59 -0
- package/dist/evaluator/events.js +21 -0
- package/dist/evaluator/index.d.ts +11 -0
- package/dist/evaluator/index.js +11 -0
- package/dist/evaluator/module.d.ts +606 -0
- package/dist/evaluator/module.js +25 -0
- package/dist/evaluator/projections.d.ts +50 -0
- package/dist/evaluator/projections.js +20 -0
- package/dist/evaluator/scope.d.ts +59 -0
- package/dist/evaluator/scope.js +7 -0
- package/dist/evaluator/signals.d.ts +3 -0
- package/dist/evaluator/signals.js +17 -0
- package/dist/evaluator/threads.d.ts +62 -0
- package/dist/evaluator/threads.js +117 -0
- package/dist/evaluator/types.d.ts +125 -0
- package/dist/evaluator/types.js +51 -0
- package/dist/projectors/delivery.d.ts +83 -0
- package/dist/projectors/delivery.js +182 -0
- package/dist/projectors/index-model.d.ts +1 -1
- package/dist/projectors/index-model.js +4 -6
- package/dist/projectors/index.d.ts +2 -0
- package/dist/projectors/index.js +2 -0
- package/dist/projectors/memory.d.ts +1 -1
- package/dist/projectors/memory.js +10 -8
- package/dist/projectors/postgres.js +44 -58
- package/dist/projectors/projector.d.ts +17 -0
- package/dist/projectors/projector.js +26 -1
- package/dist/projectors/sqlite-delivery.d.ts +4 -0
- package/dist/projectors/sqlite-delivery.js +147 -0
- package/dist/projectors/sqlite.js +23 -23
- package/dist/projectors/with-projectors.d.ts +7 -2
- package/dist/projectors/with-projectors.js +27 -28
- package/dist/react/notify.js +11 -8
- package/dist/react/react.d.ts +2 -3
- package/dist/react/react.js +14 -30
- package/dist/react/sse.d.ts +1 -1
- package/dist/react/sse.js +1 -1
- package/dist/react/store.d.ts +2 -2
- package/dist/react/store.js +109 -119
- package/dist/runtime/cancellation.d.ts +16 -0
- package/dist/runtime/cancellation.js +129 -0
- package/dist/runtime/deadline-transition-planner.d.ts +31 -0
- package/dist/runtime/deadline-transition-planner.js +139 -0
- package/dist/runtime/dispatch-effect.d.ts +3 -2
- package/dist/runtime/dispatch-effect.js +7 -13
- package/dist/runtime/errors.d.ts +51 -0
- package/dist/runtime/errors.js +39 -0
- package/dist/runtime/{runtime-helpers.d.ts → helpers.d.ts} +24 -4
- package/dist/runtime/{runtime-helpers.js → helpers.js} +56 -19
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/ingress.d.ts +15 -0
- package/dist/runtime/ingress.js +42 -0
- package/dist/runtime/local-effect-executor.d.ts +21 -0
- package/dist/runtime/local-effect-executor.js +137 -0
- package/dist/runtime/looms.d.ts +22 -4
- package/dist/runtime/looms.js +54 -36
- package/dist/runtime/observer.d.ts +45 -0
- package/dist/runtime/observer.js +11 -0
- package/dist/runtime/repository.d.ts +55 -0
- package/dist/runtime/repository.js +278 -0
- package/dist/runtime/retry-policy.d.ts +16 -0
- package/dist/runtime/retry-policy.js +29 -0
- package/dist/runtime/run-execution-context.d.ts +30 -0
- package/dist/runtime/run-execution-context.js +56 -0
- package/dist/runtime/run-start.d.ts +4 -0
- package/dist/runtime/run-start.js +44 -0
- package/dist/runtime/runtime.d.ts +6 -87
- package/dist/runtime/runtime.js +233 -470
- package/dist/runtime/server/auth.d.ts +40 -0
- package/dist/runtime/server/auth.js +40 -0
- package/dist/runtime/server/fetch-handler.d.ts +14 -0
- package/dist/runtime/server/fetch-handler.js +51 -0
- package/dist/runtime/server/http.d.ts +37 -0
- package/dist/runtime/server/http.js +62 -0
- package/dist/runtime/server/route-table.d.ts +55 -0
- package/dist/runtime/server/route-table.js +74 -0
- package/dist/runtime/server/routes/effects.d.ts +3 -0
- package/dist/runtime/server/routes/effects.js +59 -0
- package/dist/runtime/server/routes/operations.d.ts +3 -0
- package/dist/runtime/server/routes/operations.js +14 -0
- package/dist/runtime/server/routes/runs.d.ts +3 -0
- package/dist/runtime/server/routes/runs.js +192 -0
- package/dist/runtime/server.d.ts +2 -8
- package/dist/runtime/server.js +4 -211
- package/dist/runtime/sse.d.ts +2 -1
- package/dist/runtime/sse.js +24 -17
- package/dist/runtime/types.d.ts +115 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/wake-engine.d.ts +20 -0
- package/dist/runtime/wake-engine.js +311 -0
- package/dist/runtime/wake-scheduler.d.ts +3 -4
- package/dist/runtime/wake-scheduler.js +25 -31
- package/dist/runtime/worker-callbacks.d.ts +16 -0
- package/dist/runtime/worker-callbacks.js +167 -0
- package/dist/runtime/worker-effect-dispatch.d.ts +36 -0
- package/dist/runtime/worker-effect-dispatch.js +126 -0
- package/dist/s2/config.d.ts +1 -1
- package/dist/s2/config.js +1 -1
- package/dist/s2/lite.js +70 -82
- package/dist/s2/pagination.d.ts +15 -0
- package/dist/s2/pagination.js +36 -0
- package/dist/s2/projector.js +6 -5
- package/dist/s2/snapshot-store.js +148 -163
- package/dist/s2/store.d.ts +3 -21
- package/dist/s2/store.js +71 -165
- package/dist/testing/index.d.ts +15 -0
- package/dist/testing/index.js +53 -16
- package/dist/workflow/definitions-store.d.ts +2 -3
- package/dist/workflow/definitions-store.js +2 -2
- package/dist/workflow/definitions.d.ts +78 -22
- package/dist/workflow/definitions.js +80 -14
- package/dist/workflow/effects.d.ts +453 -107
- package/dist/workflow/effects.js +214 -115
- package/dist/workflow/events.d.ts +149 -5
- package/dist/workflow/events.js +27 -5
- package/dist/workflow/graph.d.ts +56 -0
- package/dist/workflow/graph.js +207 -0
- package/dist/workflow/index.d.ts +1 -0
- package/dist/workflow/index.js +1 -0
- package/dist/workflow/module.d.ts +1047 -266
- package/dist/workflow/projections.d.ts +14 -12
- package/dist/workflow/projections.js +30 -8
- package/dist/workflow/scope.d.ts +146 -4
- package/dist/workflow/threads.d.ts +383 -155
- package/dist/workflow/threads.js +308 -110
- package/package.json +7 -2
- package/dist/runtime/events-api.d.ts +0 -4
- package/dist/runtime/events-api.js +0 -84
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { RuntimeExecutionError } from './errors.js';
|
|
2
|
+
function createRunExecutionContext() {
|
|
3
|
+
return {
|
|
4
|
+
activeEffects: new Map(),
|
|
5
|
+
waking: false,
|
|
6
|
+
wakeAgain: false,
|
|
7
|
+
wakeCompletion: null,
|
|
8
|
+
resolveWakeCompletion: null,
|
|
9
|
+
ingress: null,
|
|
10
|
+
liveStore: undefined,
|
|
11
|
+
liveCount: 0,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function isIdle(context) {
|
|
15
|
+
return (!context.waking &&
|
|
16
|
+
!context.wakeAgain &&
|
|
17
|
+
context.wakeCompletion === null &&
|
|
18
|
+
context.resolveWakeCompletion === null &&
|
|
19
|
+
context.ingress === null &&
|
|
20
|
+
context.liveStore === undefined &&
|
|
21
|
+
context.liveCount === 0 &&
|
|
22
|
+
context.activeEffects.size === 0);
|
|
23
|
+
}
|
|
24
|
+
export class RunExecutionContexts {
|
|
25
|
+
runs = new Map();
|
|
26
|
+
get(runId) {
|
|
27
|
+
const current = this.runs.get(runId);
|
|
28
|
+
if (current) {
|
|
29
|
+
return current;
|
|
30
|
+
}
|
|
31
|
+
const created = createRunExecutionContext();
|
|
32
|
+
this.runs.set(runId, created);
|
|
33
|
+
return created;
|
|
34
|
+
}
|
|
35
|
+
peek(runId) {
|
|
36
|
+
return this.runs.get(runId);
|
|
37
|
+
}
|
|
38
|
+
/** Abort in-process effects owned by the given threads. */
|
|
39
|
+
abort(runId, threadIds, message) {
|
|
40
|
+
const activeEffects = this.runs.get(runId)?.activeEffects;
|
|
41
|
+
if (!activeEffects || threadIds.size === 0) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
for (const active of activeEffects.values()) {
|
|
45
|
+
if (threadIds.has(active.threadId)) {
|
|
46
|
+
active.controller.abort(new RuntimeExecutionError(message));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
releaseIfIdle(runId) {
|
|
51
|
+
const context = this.runs.get(runId);
|
|
52
|
+
if (context && isIdle(context)) {
|
|
53
|
+
this.runs.delete(runId);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import type { RunState } from '@swirls/looms/core';
|
|
3
|
+
import { RuntimeExecutionError, StartRunConflictError, type RunStartIdentity } from './errors';
|
|
4
|
+
export declare function assertSameDurableStart(runId: string, state: RunState, requested: RunStartIdentity): Effect.Effect<string, RuntimeExecutionError | StartRunConflictError>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Effect, Predicate } from 'effect';
|
|
2
|
+
import { RuntimeExecutionError, StartRunConflictError } from './errors.js';
|
|
3
|
+
function canonicalJson(value) {
|
|
4
|
+
if (Array.isArray(value)) {
|
|
5
|
+
return `[${value.map(canonicalJson).join(',')}]`;
|
|
6
|
+
}
|
|
7
|
+
if (Predicate.isObject(value)) {
|
|
8
|
+
const keys = Object.keys(value);
|
|
9
|
+
// oxlint-disable-next-line unicorn/no-array-sort
|
|
10
|
+
keys.sort();
|
|
11
|
+
return `{${keys
|
|
12
|
+
.map((key) => `${JSON.stringify(key)}:${canonicalJson(value[key] ?? null)}`)
|
|
13
|
+
.join(',')}}`;
|
|
14
|
+
}
|
|
15
|
+
return JSON.stringify(value);
|
|
16
|
+
}
|
|
17
|
+
export function assertSameDurableStart(runId, state, requested) {
|
|
18
|
+
const existing = state.startIdentity;
|
|
19
|
+
if (!existing) {
|
|
20
|
+
return Effect.fail(new RuntimeExecutionError(`Run "${runId}" has durable state but no start identity; its legacy snapshot cannot safely validate a retry`));
|
|
21
|
+
}
|
|
22
|
+
const mismatches = [];
|
|
23
|
+
if (existing.kind !== requested.kind) {
|
|
24
|
+
mismatches.push('kind');
|
|
25
|
+
}
|
|
26
|
+
if (existing.definitionName !== requested.definitionName) {
|
|
27
|
+
mismatches.push('definitionName');
|
|
28
|
+
}
|
|
29
|
+
if (existing.definitionVersion !== requested.definitionVersion) {
|
|
30
|
+
mismatches.push('definitionVersion');
|
|
31
|
+
}
|
|
32
|
+
if (canonicalJson(existing.input) !== canonicalJson(requested.input)) {
|
|
33
|
+
mismatches.push('input');
|
|
34
|
+
}
|
|
35
|
+
if (existing.requestedThreadId !== requested.requestedThreadId) {
|
|
36
|
+
mismatches.push('requestedThreadId');
|
|
37
|
+
}
|
|
38
|
+
if (existing.idempotencyKey !== requested.idempotencyKey) {
|
|
39
|
+
mismatches.push('idempotencyKey');
|
|
40
|
+
}
|
|
41
|
+
return mismatches.length > 0
|
|
42
|
+
? Effect.fail(new StartRunConflictError(runId, requested, existing, mismatches))
|
|
43
|
+
: Effect.succeed(existing.rootThreadId);
|
|
44
|
+
}
|
|
@@ -1,91 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { EventStoreError, EventStoreFencedError, EventStoreTruncationError } from '@swirls/looms/core';
|
|
3
|
-
import { EventStoreTag, EventStoreTrimmedError, type AnyRuntimeModule, type ComposedRegistry, type EventEnvelope, type EventInput, type EventStore, type JsonValue, type ProjectionDefinition, type ReplayStep, type RunState, type SnapshotStore } from '@swirls/looms/core';
|
|
4
|
-
import { type WakeScheduler } from './wake-scheduler';
|
|
1
|
+
import { type AnyRuntimeModule } from '@swirls/looms/core';
|
|
5
2
|
export type { RegisteredDefinition } from '@swirls/looms/core';
|
|
6
3
|
export type { WakeScheduler } from './wake-scheduler';
|
|
7
4
|
export { createTimeoutScheduler } from './wake-scheduler';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
readonly effectId: string;
|
|
14
|
-
readonly threadId: string;
|
|
15
|
-
readonly message: string;
|
|
16
|
-
}> {
|
|
17
|
-
constructor(runId: string, effectId: string, threadId: string);
|
|
18
|
-
}
|
|
19
|
-
declare const MaxWakeIterationsError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
20
|
-
readonly _tag: "MaxWakeIterationsError";
|
|
21
|
-
} & Readonly<A>;
|
|
22
|
-
export declare class MaxWakeIterationsError extends MaxWakeIterationsError_base<{
|
|
23
|
-
readonly runId: string;
|
|
24
|
-
readonly maxIterations: number;
|
|
25
|
-
readonly message: string;
|
|
26
|
-
}> {
|
|
27
|
-
constructor(runId: string, maxIterations: number);
|
|
28
|
-
}
|
|
29
|
-
export type WakeError = DuplicateEffectDispatchError | MaxWakeIterationsError | EventStoreTruncationError | EventStoreTrimmedError | EventStoreFencedError | EventStoreError | Error;
|
|
30
|
-
export interface CreateRuntimeOptions<TModules extends readonly AnyRuntimeModule[] = readonly AnyRuntimeModule[]> {
|
|
31
|
-
readonly modules: TModules;
|
|
32
|
-
readonly store?: EventStore;
|
|
33
|
-
/**
|
|
34
|
-
* Durable events between mid-wake snapshots. Default 200; `0` disables.
|
|
35
|
-
* A snapshot is always taken when a wake parks, so this only bounds replay
|
|
36
|
-
* after a crash inside one long wake.
|
|
37
|
-
*/
|
|
38
|
-
readonly snapshotEvery?: number;
|
|
39
|
-
readonly maxWakeIterations?: number;
|
|
40
|
-
/** Defaults to the EventStore's attached store or an in-memory SnapshotStore. */
|
|
41
|
-
readonly snapshotStore?: SnapshotStore;
|
|
42
|
-
/** Trim the event log behind the oldest kept snapshot. Also sets how many snapshots to keep. */
|
|
43
|
-
readonly trimAfterSnapshot?: {
|
|
44
|
-
keepSnapshots: number;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Cursors to keep in process between calls. Default `0`: every call starts
|
|
48
|
-
* from the store (snapshot + delta). A cached cursor is validated against
|
|
49
|
-
* `store.tail` before use.
|
|
50
|
-
*/
|
|
51
|
-
readonly runCacheSize?: number;
|
|
52
|
-
/**
|
|
53
|
-
* Pluggable wake scheduler for timer waits.
|
|
54
|
-
* Defaults to an in-process setTimeout scheduler.
|
|
55
|
-
*/
|
|
56
|
-
readonly scheduler?: WakeScheduler;
|
|
57
|
-
}
|
|
58
|
-
export interface StartRunArgs {
|
|
59
|
-
kind: string;
|
|
60
|
-
definitionName: string;
|
|
61
|
-
input?: JsonValue;
|
|
62
|
-
runId?: string;
|
|
63
|
-
threadId?: string;
|
|
64
|
-
idempotencyKey?: string;
|
|
65
|
-
}
|
|
66
|
-
export interface StartResult {
|
|
67
|
-
runId: string;
|
|
68
|
-
threadId: string;
|
|
69
|
-
state: RunState;
|
|
70
|
-
}
|
|
71
|
-
export interface LoomsRuntime<TModules extends readonly AnyRuntimeModule[] = readonly AnyRuntimeModule[]> {
|
|
72
|
-
readonly modules: TModules;
|
|
73
|
-
readonly registry: ComposedRegistry;
|
|
74
|
-
startRun(args: StartRunArgs): Effect.Effect<StartResult, Error | EventStoreError, EventStoreTag>;
|
|
75
|
-
signal(runId: string, events: ReadonlyArray<EventInput>, options?: {
|
|
76
|
-
idempotencyKey?: string;
|
|
77
|
-
}): Effect.Effect<RunState, Error | EventStoreError, EventStoreTag>;
|
|
78
|
-
wake(runId: string): Effect.Effect<RunState, WakeError, EventStoreTag>;
|
|
79
|
-
getRun(runId: string): Effect.Effect<RunState, EventStoreTruncationError | EventStoreTrimmedError | EventStoreError, EventStoreTag>;
|
|
80
|
-
getEvents(runId: string, options?: {
|
|
81
|
-
fromSeq?: number;
|
|
82
|
-
limit?: number;
|
|
83
|
-
}): Effect.Effect<EventEnvelope[], EventStoreError, EventStoreTag>;
|
|
84
|
-
project<S>(runId: string, definition: ProjectionDefinition<S>): Effect.Effect<S, EventStoreError, EventStoreTag>;
|
|
85
|
-
replayTo(runId: string, seq: number): Effect.Effect<ReplayStep | null, EventStoreError, EventStoreTag>;
|
|
86
|
-
cancel(runId: string, threadId?: string): Effect.Effect<RunState, Error | EventStoreError, EventStoreTag>;
|
|
87
|
-
listRuns(): Effect.Effect<string[], EventStoreError, EventStoreTag>;
|
|
88
|
-
rescanTimers(): Effect.Effect<number, EventStoreTruncationError | EventStoreTrimmedError | EventStoreError, EventStoreTag>;
|
|
89
|
-
dispose(): void;
|
|
90
|
-
}
|
|
5
|
+
export { DuplicateEffectDispatchError, MaxWakeIterationsError, StartRunConflictError, } from './errors';
|
|
6
|
+
export { RunOverloadedError } from './ingress';
|
|
7
|
+
export type { CreateRuntimeOptions, EffectWorker, EffectWorkerTask, LoomsRuntime, RunOperationalStatus, StartResult, StartRunArgs, WakeError, } from './types';
|
|
8
|
+
export type { WorkerCallback, WorkerCallbackInput } from '@swirls/looms/core';
|
|
9
|
+
import type { CreateRuntimeOptions, LoomsRuntime } from './types';
|
|
91
10
|
export declare function createRuntime<const TModules extends readonly AnyRuntimeModule[]>(options: CreateRuntimeOptions<TModules>): LoomsRuntime<TModules>;
|