effect-durable-agent 0.1.0-alpha.1 → 0.1.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -136
- package/dist/{command-queues-CQ9cwRP7.d.ts → command-queues-B45Xa1Dl.d.ts} +109 -21
- package/dist/{commands-Ce1ec6kH.d.ts → commands-p8venTWs.d.ts} +10 -2
- package/dist/compaction-0k8zCJgB.js +473 -0
- package/dist/compaction-0k8zCJgB.js.map +1 -0
- package/dist/{compaction-YayFKo_1.d.ts → compaction-DoTyQf6k.d.ts} +28 -7
- package/dist/context-projection-CCoN8m9W.d.ts +140 -0
- package/dist/{core-Hv3cFydL.d.ts → core-C-6xHzRx.d.ts} +6 -3
- package/dist/domain/command-queues.d.ts +1 -1
- package/dist/domain/command-queues.js +1 -1
- package/dist/domain/command-queues.js.map +1 -1
- package/dist/domain/context-projection.d.ts +2 -0
- package/dist/domain/context-projection.js +32 -0
- package/dist/domain/context-projection.js.map +1 -0
- package/dist/domain/message-transcript.d.ts +1 -1
- package/dist/domain/model-usage.d.ts +2 -0
- package/dist/domain/model-usage.js +59 -0
- package/dist/domain/model-usage.js.map +1 -0
- package/dist/domain/reduced-state-schema.d.ts +14 -18
- package/dist/domain/reduced-state-schema.js +7 -11
- package/dist/domain/reduced-state-schema.js.map +1 -1
- package/dist/domain/reduced-state.d.ts +3 -2
- package/dist/domain/reduced-state.js +3 -2
- package/dist/domain/run-scheduling.d.ts +2 -0
- package/dist/domain/run-scheduling.js +127 -0
- package/dist/domain/run-scheduling.js.map +1 -0
- package/dist/{durable-C3Rz7kg3.js → durable-BPHVFVvV.js} +74 -83
- package/dist/durable-BPHVFVvV.js.map +1 -0
- package/dist/{durable-DlScwmCy.d.ts → durable-DeLCAvbw.d.ts} +1256 -104
- package/dist/envelope-DkZyMIgp.d.ts +191 -0
- package/dist/envelope-DxQzo5rN.js +82 -0
- package/dist/envelope-DxQzo5rN.js.map +1 -0
- package/dist/{keep-alive-DYDsH6qN.d.ts → event-factory-EL4szNWm.d.ts} +10 -30
- package/dist/{keep-alive-p8dIcSVy.js → event-factory-QuC_UvyP.js} +8 -10
- package/dist/event-factory-QuC_UvyP.js.map +1 -0
- package/dist/{events-Bb9-Cu-7.d.ts → events-LZFNoESe.d.ts} +2 -188
- package/dist/{id-generator-C2Q15uZM.d.ts → id-generator--x6itQZ2.d.ts} +3 -2
- package/dist/index.d.ts +7 -6
- package/dist/index.js +5 -4
- package/dist/keep-alive-Chl5SJxy.d.ts +29 -0
- package/dist/{message-transcript-BCHdHAe2.d.ts → message-transcript-Dr6Rk-re.d.ts} +4 -4
- package/dist/model-resolver-BPPJAsuh.d.ts +18 -0
- package/dist/model-usage-CdBEkTwU.d.ts +55 -0
- package/dist/{prompt-projector-9_02lk5-.d.ts → prompt-projector-BpRH-Ec-.d.ts} +15 -16
- package/dist/{reduced-state-C4nVVzz9.js → reduced-state-Bz68V2H8.js} +65 -32
- package/dist/reduced-state-Bz68V2H8.js.map +1 -0
- package/dist/{reducer-registry-C0svUa63.d.ts → reducer-registry-DjP1qqbs.d.ts} +16 -6
- package/dist/run-scheduler-DvHWwWBJ.d.ts +43 -0
- package/dist/run-scheduling-wakeup-CGgJ7RNe.d.ts +25 -0
- package/dist/{runtime-C56FQxiL.d.ts → runtime-BFsU92E7.d.ts} +15 -6
- package/dist/services/compaction.d.ts +1 -1
- package/dist/services/compaction.js +1 -425
- package/dist/services/id-generator.d.ts +1 -1
- package/dist/services/id-generator.js +2 -1
- package/dist/services/id-generator.js.map +1 -1
- package/dist/services/keep-alive.d.ts +2 -0
- package/dist/services/keep-alive.js +13 -0
- package/dist/services/keep-alive.js.map +1 -0
- package/dist/services/model-resolver.d.ts +2 -0
- package/dist/services/model-resolver.js +17 -0
- package/dist/services/model-resolver.js.map +1 -0
- package/dist/services/prompt-projector.d.ts +2 -2
- package/dist/services/prompt-projector.js +20 -10
- package/dist/services/prompt-projector.js.map +1 -1
- package/dist/services/reducer-registry.d.ts +2 -2
- package/dist/services/reducer-registry.js +7 -3
- package/dist/services/reducer-registry.js.map +1 -1
- package/dist/services/run-scheduler.d.ts +3 -0
- package/dist/services/run-scheduler.js +25 -0
- package/dist/services/run-scheduler.js.map +1 -0
- package/dist/services/run-scheduling-wakeup.d.ts +2 -0
- package/dist/services/run-scheduling-wakeup.js +13 -0
- package/dist/services/run-scheduling-wakeup.js.map +1 -0
- package/dist/services/runtime-layer.d.ts +67 -0
- package/dist/services/runtime-layer.js +47 -0
- package/dist/services/runtime-layer.js.map +1 -0
- package/dist/services/runtime.d.ts +1 -1
- package/dist/services/runtime.js +21 -14
- package/dist/services/runtime.js.map +1 -1
- package/dist/services/session-event-observer.d.ts +2 -0
- package/dist/services/session-event-observer.js +13 -0
- package/dist/services/session-event-observer.js.map +1 -0
- package/dist/services/session-query.d.ts +2 -2
- package/dist/services/session-query.js +140 -1
- package/dist/services/session-query.js.map +1 -0
- package/dist/services/session-state.d.ts +2 -0
- package/dist/services/session-state.js +2 -0
- package/dist/services/session-store.d.ts +2 -2
- package/dist/services/session-store.js +182 -2
- package/dist/services/session-store.js.map +1 -0
- package/dist/services/sink-checkpoint-store.d.ts +2 -0
- package/dist/services/sink-checkpoint-store.js +49 -0
- package/dist/services/sink-checkpoint-store.js.map +1 -0
- package/dist/services/sink-registry.d.ts +1 -1
- package/dist/services/sink-registry.js +1 -1
- package/dist/services/span-names.d.ts +1 -1
- package/dist/services/span-names.js +3 -0
- package/dist/services/span-names.js.map +1 -1
- package/dist/services/tool-registry.d.ts +1 -1
- package/dist/services/tracing.d.ts +1 -1
- package/dist/services/tracing.js +23 -2
- package/dist/services/tracing.js.map +1 -1
- package/dist/session-event-observer-DaFMKKNc.d.ts +24 -0
- package/dist/session-query-Bo_wroPS.d.ts +47 -0
- package/dist/{session-query-DlRo5Ufc.d.ts → session-state-5uD0FqQ8.d.ts} +143 -45
- package/dist/{session-query-DOc1KanA.js → session-state-CN7DcLal.js} +353 -186
- package/dist/session-state-CN7DcLal.js.map +1 -0
- package/dist/{session-store-D2Ore1QC.d.ts → session-store-BIr-xfJ7.d.ts} +7 -96
- package/dist/sink-checkpoint-store-Cr9_GmOw.d.ts +40 -0
- package/dist/{sink-registry-CFC6xjsN.js → sink-registry-6CNeeRTt.js} +41 -82
- package/dist/sink-registry-6CNeeRTt.js.map +1 -0
- package/dist/{sink-registry-CIU0LD3m.d.ts → sink-registry-Bz4bBJaC.d.ts} +24 -49
- package/dist/testkit/layers.d.ts +24 -14
- package/dist/testkit/layers.js +18 -11
- package/dist/testkit/layers.js.map +1 -1
- package/dist/{tool-registry-CcnkAAQK.d.ts → tool-registry-Dhs2KmYK.d.ts} +4 -4
- package/dist/types/commands.d.ts +2 -2
- package/dist/types/commands.js +7 -2
- package/dist/types/commands.js.map +1 -1
- package/dist/types/core.d.ts +2 -2
- package/dist/types/core.js +4 -2
- package/dist/types/core.js.map +1 -1
- package/dist/types/events/durable.d.ts +2 -2
- package/dist/types/events/durable.js +2 -2
- package/dist/types/events.d.ts +4 -3
- package/dist/types/events.js +3 -2
- package/dist/types/events.js.map +1 -1
- package/dist/websocket.d.ts +2776 -0
- package/dist/websocket.js +498 -0
- package/dist/websocket.js.map +1 -0
- package/package.json +68 -43
- package/testing/offline-trace/README.md +2 -1
- package/CHANGELOG.md +0 -10
- package/CONTRIBUTING.md +0 -26
- package/SECURITY.md +0 -8
- package/dist/durable-C3Rz7kg3.js.map +0 -1
- package/dist/durable-object-runtime-B7jwBY2R.js +0 -1494
- package/dist/durable-object-runtime-B7jwBY2R.js.map +0 -1
- package/dist/durable-object-runtime-pWv0ohlz.d.ts +0 -257
- package/dist/durable-object-storage-Czy7IPrh.d.ts +0 -41
- package/dist/host/durable-object-runtime.d.ts +0 -2
- package/dist/host/durable-object-runtime.js +0 -2
- package/dist/host/durable-object-storage.d.ts +0 -2
- package/dist/host/durable-object-storage.js +0 -0
- package/dist/host/durable-object.d.ts +0 -83
- package/dist/host/durable-object.js +0 -191
- package/dist/host/durable-object.js.map +0 -1
- package/dist/host/websocket-wire.d.ts +0 -2
- package/dist/host/websocket-wire.js +0 -88
- package/dist/host/websocket-wire.js.map +0 -1
- package/dist/keep-alive-p8dIcSVy.js.map +0 -1
- package/dist/reduced-state-C4nVVzz9.js.map +0 -1
- package/dist/services/compaction.js.map +0 -1
- package/dist/session-query-DOc1KanA.js.map +0 -1
- package/dist/session-store-pYxQW9qh.js +0 -214
- package/dist/session-store-pYxQW9qh.js.map +0 -1
- package/dist/sink-registry-CFC6xjsN.js.map +0 -1
- package/dist/websocket-wire-DvOu_6BJ.d.ts +0 -16773
- package/docs/assets/architecture.svg +0 -106
- package/docs/assets/event-sequence.svg +0 -143
- package/docs/assets/gcp-trace.png +0 -0
- package/docs/message-steering.md +0 -831
- package/docs/releasing.md +0 -57
- package/docs/spec.md +0 -774
- package/docs/subagents.md +0 -725
- package/docs/testing.md +0 -64
- package/docs/ui-projection.md +0 -742
- package/docs/websocket-protocol.md +0 -613
- package/examples/001-no-tools/README.md +0 -65
- package/examples/001-no-tools/worker.ts +0 -79
- package/examples/002-slack-bridge/README.md +0 -134
- package/examples/002-slack-bridge/events.ts +0 -115
- package/examples/002-slack-bridge/reducer.ts +0 -216
- package/examples/002-slack-bridge/scenario.test.ts +0 -223
- package/examples/002-slack-bridge/sinks.ts +0 -109
- package/examples/002-slack-bridge/worker.ts +0 -140
- package/examples/003-sandbox-lifecycle/README.md +0 -78
- package/examples/003-sandbox-lifecycle/events.ts +0 -203
- package/examples/003-sandbox-lifecycle/reducer.ts +0 -305
- package/examples/003-sandbox-lifecycle/scenario.test.ts +0 -202
- package/examples/_shared/event-id.ts +0 -12
- package/examples/_shared/http.ts +0 -27
- package/examples/_shared/openai.ts +0 -33
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as EDASessionStore, o as EDASessionStoreError, t as CommittedDurableEvent } from "./session-store-
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { Q as RunGrantResult, S as ReducedState } from "./command-queues-B45Xa1Dl.js";
|
|
2
|
+
import { d as PositionedEvent, l as ModelSelectionPayload, n as EphemeralEventEnvelope, t as DurableEventEnvelope, u as NonNegativeInt } from "./envelope-DkZyMIgp.js";
|
|
3
|
+
import { i as GrantRunCommand, r as EDACommand } from "./commands-p8venTWs.js";
|
|
4
|
+
import { zt as ToolCallCreatedEvent } from "./durable-DeLCAvbw.js";
|
|
5
|
+
import { a as EDASessionStore, o as EDASessionStoreError, t as CommittedDurableEvent } from "./session-store-BIr-xfJ7.js";
|
|
6
|
+
import { t as ModelResolver } from "./model-resolver-BPPJAsuh.js";
|
|
7
|
+
import { t as IdGenerator } from "./id-generator--x6itQZ2.js";
|
|
8
|
+
import { r as SessionContext, t as EventFactory } from "./event-factory-EL4szNWm.js";
|
|
9
|
+
import { t as EDAKeepAlive } from "./keep-alive-Chl5SJxy.js";
|
|
10
|
+
import { d as CompactionRunner } from "./compaction-DoTyQf6k.js";
|
|
11
|
+
import { s as EDASinkRegistry, u as LiveEventBus } from "./sink-registry-Bz4bBJaC.js";
|
|
12
|
+
import { a as EDAReducerStateSnapshot, r as EDAReducerRegistry } from "./reducer-registry-DjP1qqbs.js";
|
|
13
|
+
import { r as EDAPromptProjector } from "./prompt-projector-BpRH-Ec-.js";
|
|
14
|
+
import { t as RunScheduler } from "./run-scheduler-DvHWwWBJ.js";
|
|
15
|
+
import { t as RunSchedulingWakeup } from "./run-scheduling-wakeup-CGgJ7RNe.js";
|
|
16
|
+
import { r as EDAToolRegistry } from "./tool-registry-Dhs2KmYK.js";
|
|
15
17
|
import * as Context from "effect/Context";
|
|
16
18
|
import * as Effect from "effect/Effect";
|
|
17
19
|
import * as Layer from "effect/Layer";
|
|
18
20
|
import * as Schema from "effect/Schema";
|
|
19
|
-
import * as Stream from "effect/Stream";
|
|
20
21
|
import * as Prompt from "effect/unstable/ai/Prompt";
|
|
21
22
|
import * as Cause from "effect/Cause";
|
|
22
|
-
import * as Scope from "effect/Scope";
|
|
23
|
-
import * as LanguageModel from "effect/unstable/ai/LanguageModel";
|
|
24
23
|
import * as Response from "effect/unstable/ai/Response";
|
|
25
24
|
|
|
26
25
|
//#region src/services/session-event-sink.d.ts
|
|
@@ -146,7 +145,7 @@ interface ToolExecutorShape {
|
|
|
146
145
|
declare const ToolExecutor_base: Context.ServiceClass<ToolExecutor, "@effect-durable-agent/ToolExecutor", ToolExecutorShape>;
|
|
147
146
|
/** Executes sealed framework-owned tool calls and commits tool lifecycle boundaries. */
|
|
148
147
|
declare class ToolExecutor extends ToolExecutor_base {
|
|
149
|
-
static readonly Live: Layer.Layer<ToolExecutor, never, IdGenerator | EventFactory | SessionContext
|
|
148
|
+
static readonly Live: Layer.Layer<ToolExecutor, never, EDAToolRegistry | IdGenerator | EventFactory | SessionContext>;
|
|
150
149
|
}
|
|
151
150
|
//#endregion
|
|
152
151
|
//#region src/services/inference-runner.d.ts
|
|
@@ -294,7 +293,7 @@ interface InferenceRunnerShape {
|
|
|
294
293
|
declare const InferenceRunner_base: Context.ServiceClass<InferenceRunner, "@effect-durable-agent/InferenceRunner", InferenceRunnerShape>;
|
|
295
294
|
/** Owns provider inference streams and routes them into durable/live inference emissions. */
|
|
296
295
|
declare class InferenceRunner extends InferenceRunner_base {
|
|
297
|
-
static readonly Live: Layer.Layer<InferenceRunner, never,
|
|
296
|
+
static readonly Live: Layer.Layer<InferenceRunner, never, ModelResolver | EDAToolRegistry | IdGenerator | EventFactory>;
|
|
298
297
|
}
|
|
299
298
|
//#endregion
|
|
300
299
|
//#region src/services/turn-runner.d.ts
|
|
@@ -567,6 +566,120 @@ declare const SessionRunInput: Schema.Struct<{
|
|
|
567
566
|
readonly systemPrompt: Schema.optionalKey<Schema.NonEmptyString>;
|
|
568
567
|
}>;
|
|
569
568
|
type SessionRunInput = typeof SessionRunInput.Type;
|
|
569
|
+
/** Command outcome when the command's run completed and the command was completed. */
|
|
570
|
+
declare const SessionCommandCompleted: Schema.TaggedStruct<"SessionCommandCompleted", {
|
|
571
|
+
readonly committed: Schema.Struct<{
|
|
572
|
+
readonly position: Schema.Struct<{
|
|
573
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
574
|
+
readonly subSeq: Schema.brand<Schema.Literal<0>, "SubSequenceNumber">;
|
|
575
|
+
}>;
|
|
576
|
+
readonly event: Schema.Struct<{
|
|
577
|
+
readonly durability: Schema.Literal<"durable">;
|
|
578
|
+
readonly namespace: Schema.NonEmptyString;
|
|
579
|
+
readonly type: Schema.NonEmptyString;
|
|
580
|
+
readonly schemaVersion: Schema.Int;
|
|
581
|
+
readonly eventId: Schema.brand<Schema.String, "EventId">;
|
|
582
|
+
readonly sessionId: Schema.brand<Schema.String, "SessionId">;
|
|
583
|
+
readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
|
|
584
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
585
|
+
readonly trace: Schema.withConstructorDefault<Schema.Struct<{
|
|
586
|
+
readonly span: Schema.Struct<{
|
|
587
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
588
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
589
|
+
readonly sampled: Schema.Boolean;
|
|
590
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
591
|
+
}>;
|
|
592
|
+
readonly links: Schema.$Array<Schema.Struct<{
|
|
593
|
+
readonly context: Schema.Struct<{
|
|
594
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
595
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
596
|
+
readonly sampled: Schema.Boolean;
|
|
597
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
598
|
+
}>;
|
|
599
|
+
readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
600
|
+
}>>;
|
|
601
|
+
}>>;
|
|
602
|
+
readonly payload: Schema.Unknown;
|
|
603
|
+
}>;
|
|
604
|
+
}>;
|
|
605
|
+
}>;
|
|
606
|
+
type SessionCommandCompleted = typeof SessionCommandCompleted.Type;
|
|
607
|
+
/** Command outcome when the command's run failed and the command was failed. */
|
|
608
|
+
declare const SessionCommandFailed: Schema.TaggedStruct<"SessionCommandFailed", {
|
|
609
|
+
readonly committed: Schema.Struct<{
|
|
610
|
+
readonly position: Schema.Struct<{
|
|
611
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
612
|
+
readonly subSeq: Schema.brand<Schema.Literal<0>, "SubSequenceNumber">;
|
|
613
|
+
}>;
|
|
614
|
+
readonly event: Schema.Struct<{
|
|
615
|
+
readonly durability: Schema.Literal<"durable">;
|
|
616
|
+
readonly namespace: Schema.NonEmptyString;
|
|
617
|
+
readonly type: Schema.NonEmptyString;
|
|
618
|
+
readonly schemaVersion: Schema.Int;
|
|
619
|
+
readonly eventId: Schema.brand<Schema.String, "EventId">;
|
|
620
|
+
readonly sessionId: Schema.brand<Schema.String, "SessionId">;
|
|
621
|
+
readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
|
|
622
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
623
|
+
readonly trace: Schema.withConstructorDefault<Schema.Struct<{
|
|
624
|
+
readonly span: Schema.Struct<{
|
|
625
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
626
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
627
|
+
readonly sampled: Schema.Boolean;
|
|
628
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
629
|
+
}>;
|
|
630
|
+
readonly links: Schema.$Array<Schema.Struct<{
|
|
631
|
+
readonly context: Schema.Struct<{
|
|
632
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
633
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
634
|
+
readonly sampled: Schema.Boolean;
|
|
635
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
636
|
+
}>;
|
|
637
|
+
readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
638
|
+
}>>;
|
|
639
|
+
}>>;
|
|
640
|
+
readonly payload: Schema.Unknown;
|
|
641
|
+
}>;
|
|
642
|
+
}>;
|
|
643
|
+
}>;
|
|
644
|
+
type SessionCommandFailed = typeof SessionCommandFailed.Type;
|
|
645
|
+
/** Command outcome when command work was cancelled by stop, interrupt, or recovery. */
|
|
646
|
+
declare const SessionCommandCancelled: Schema.TaggedStruct<"SessionCommandCancelled", {
|
|
647
|
+
readonly committed: Schema.Struct<{
|
|
648
|
+
readonly position: Schema.Struct<{
|
|
649
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
650
|
+
readonly subSeq: Schema.brand<Schema.Literal<0>, "SubSequenceNumber">;
|
|
651
|
+
}>;
|
|
652
|
+
readonly event: Schema.Struct<{
|
|
653
|
+
readonly durability: Schema.Literal<"durable">;
|
|
654
|
+
readonly namespace: Schema.NonEmptyString;
|
|
655
|
+
readonly type: Schema.NonEmptyString;
|
|
656
|
+
readonly schemaVersion: Schema.Int;
|
|
657
|
+
readonly eventId: Schema.brand<Schema.String, "EventId">;
|
|
658
|
+
readonly sessionId: Schema.brand<Schema.String, "SessionId">;
|
|
659
|
+
readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
|
|
660
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
661
|
+
readonly trace: Schema.withConstructorDefault<Schema.Struct<{
|
|
662
|
+
readonly span: Schema.Struct<{
|
|
663
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
664
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
665
|
+
readonly sampled: Schema.Boolean;
|
|
666
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
667
|
+
}>;
|
|
668
|
+
readonly links: Schema.$Array<Schema.Struct<{
|
|
669
|
+
readonly context: Schema.Struct<{
|
|
670
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
671
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
672
|
+
readonly sampled: Schema.Boolean;
|
|
673
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
674
|
+
}>;
|
|
675
|
+
readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
676
|
+
}>>;
|
|
677
|
+
}>>;
|
|
678
|
+
readonly payload: Schema.Unknown;
|
|
679
|
+
}>;
|
|
680
|
+
}>;
|
|
681
|
+
}>;
|
|
682
|
+
type SessionCommandCancelled = typeof SessionCommandCancelled.Type;
|
|
570
683
|
/** Terminal command-processing variants returned from one control action. */
|
|
571
684
|
declare const SessionCommandOutcome: Schema.Union<readonly [Schema.TaggedStruct<"SessionCommandCompleted", {
|
|
572
685
|
readonly committed: Schema.Struct<{
|
|
@@ -680,9 +793,12 @@ interface SessionCommandResult {
|
|
|
680
793
|
readonly started: CommittedDurableEvent;
|
|
681
794
|
readonly outcome: SessionCommandOutcome;
|
|
682
795
|
}
|
|
796
|
+
/** Why a control drain stopped without starting more command work. */
|
|
797
|
+
declare const SessionNoRunnableReason: Schema.Literals<readonly ["active-command", "no-pending-command", "awaiting-run-authorization"]>;
|
|
798
|
+
type SessionNoRunnableReason = typeof SessionNoRunnableReason.Type;
|
|
683
799
|
/** Session control result when no admitted command is runnable. */
|
|
684
800
|
declare const SessionNoRunnableCommand: Schema.TaggedStruct<"SessionNoRunnableCommand", {
|
|
685
|
-
readonly reason: Schema.Literals<readonly ["active-command", "no-pending-command"]>;
|
|
801
|
+
readonly reason: Schema.Literals<readonly ["active-command", "no-pending-command", "awaiting-run-authorization"]>;
|
|
686
802
|
readonly active: Schema.optionalKey<Schema.TaggedStruct<"DispatchActiveCommand", {
|
|
687
803
|
readonly commandId: Schema.brand<Schema.String, "CommandId">;
|
|
688
804
|
readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
@@ -716,6 +832,10 @@ type SessionCommandAdmissionError = EDASessionStoreError | SessionCommandAdmissi
|
|
|
716
832
|
type EDASubmittable = EDACommand | DurableEventEnvelope;
|
|
717
833
|
/** Internal live-process authority for commands, durable writes, and scheduling. */
|
|
718
834
|
interface SessionStateShape extends SessionEventSink {
|
|
835
|
+
/** Trusted permission entrypoint, serialized with control actions and revalidated before commit. */
|
|
836
|
+
readonly grantRun: (command: GrantRunCommand, input: SessionRunInput) => Effect.Effect<RunGrantResult, SessionStateError>;
|
|
837
|
+
/** Host alarm callback for strict, at-least-once delivery of the current persisted request. */
|
|
838
|
+
readonly retryRunSchedulingDelivery: () => Effect.Effect<void, EDASessionStoreError>;
|
|
719
839
|
/** Commit session-initial context, such as app-owned system prompt, before command work starts. */
|
|
720
840
|
readonly initialize: (input: SessionRunInput) => Effect.Effect<void, SessionCommandAdmissionError>;
|
|
721
841
|
/** Submit commands and/or app durable events as one ordered durable batch. */
|
|
@@ -740,30 +860,8 @@ interface SessionStateShape extends SessionEventSink {
|
|
|
740
860
|
declare const SessionState_base: Context.ServiceClass<SessionState, "@effect-durable-agent/SessionState", SessionStateShape>;
|
|
741
861
|
/** Internal authoritative live state and root control loop for one session. */
|
|
742
862
|
declare class SessionState extends SessionState_base {
|
|
743
|
-
static readonly Live: Layer.Layer<SessionState, EDASessionStoreError,
|
|
744
|
-
}
|
|
745
|
-
//#endregion
|
|
746
|
-
//#region src/services/session-query.d.ts
|
|
747
|
-
/** Authoritative live snapshot for one EDA session plus its derived durable transcript. */
|
|
748
|
-
interface EDASessionSnapshot {
|
|
749
|
-
readonly state: ReducedState;
|
|
750
|
-
readonly reducerStates: EDAReducerStateSnapshot;
|
|
751
|
-
readonly messages: ReadonlyArray<DurableTranscriptMessage>;
|
|
752
|
-
}
|
|
753
|
-
/** Read-only query facade over authoritative live state and reconnect-safe event streams. */
|
|
754
|
-
interface EDASessionQueryShape {
|
|
755
|
-
/** Read the authoritative live state and derive its durable transcript. */
|
|
756
|
-
readonly snapshot: () => Effect.Effect<EDASessionSnapshot, EDASessionStoreError>;
|
|
757
|
-
/** Read durable user/assistant messages in committed sequence order from the live snapshot. */
|
|
758
|
-
readonly messages: () => Effect.Effect<ReadonlyArray<DurableTranscriptMessage>, EDASessionStoreError>;
|
|
759
|
-
/** Backfill durable events after `afterSeq`, then follow live durable/ephemeral events. */
|
|
760
|
-
readonly eventsAfter: (afterSeq: SequenceNumber) => Effect.Effect<Stream.Stream<PositionedEvent, EDASessionStoreError>, EDASessionStoreError, Scope.Scope>;
|
|
761
|
-
}
|
|
762
|
-
declare const EDASessionQuery_base: Context.ServiceClass<EDASessionQuery, "@effect-durable-agent/EDASessionQuery", EDASessionQueryShape>;
|
|
763
|
-
/** Read-only session query facade backed by authoritative SessionState plus durable backfill. */
|
|
764
|
-
declare class EDASessionQuery extends EDASessionQuery_base {
|
|
765
|
-
static readonly Live: Layer.Layer<EDASessionQuery, never, SessionState | LiveEventBus | EDASessionStore>;
|
|
863
|
+
static readonly Live: Layer.Layer<SessionState, EDASessionStoreError, RunSchedulingWakeup | RunScheduler | EDAKeepAlive | EDAPromptProjector | EDAReducerRegistry | EDASessionStore | LiveEventBus | IdGenerator | EventFactory | TurnRunner | CompactionRunner | SessionContext | EDASinkRegistry>;
|
|
766
864
|
}
|
|
767
865
|
//#endregion
|
|
768
|
-
export {
|
|
769
|
-
//# sourceMappingURL=session-
|
|
866
|
+
export { ToolExecutor as S, SessionStateShape as _, SessionCommandCompleted as a, InferenceRunner as b, SessionCommandResult as c, SessionForkedCommand as d, SessionNoRunnableCommand as f, SessionStateError as g, SessionState as h, SessionCommandCancelled as i, SessionDrainProcessed as l, SessionRunInput as m, SessionCommandAdmissionConflict as n, SessionCommandFailed as o, SessionNoRunnableReason as p, SessionCommandAdmissionError as r, SessionCommandOutcome as s, EDASubmittable as t, SessionDrainResult as u, SessionStateSnapshotData as v, InferenceRunnerStreamPart as x, TurnRunner as y };
|
|
867
|
+
//# sourceMappingURL=session-state-5uD0FqQ8.d.ts.map
|