effect-durable-agent 0.1.0-alpha.1 → 0.1.0-alpha.3
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 +16 -1
- package/README.md +110 -108
- package/SECURITY.md +3 -4
- package/dist/{compaction-YayFKo_1.d.ts → compaction-1LSZR944.d.ts} +2 -2
- package/dist/{durable-object-runtime-pWv0ohlz.d.ts → durable-object-runtime-CiMKxGs6.d.ts} +7 -7
- package/dist/{durable-object-runtime-B7jwBY2R.js → durable-object-runtime-wKiqaAt2.js} +3 -3
- package/dist/durable-object-runtime-wKiqaAt2.js.map +1 -0
- package/dist/host/durable-object-runtime.d.ts +1 -1
- package/dist/host/durable-object-runtime.js +1 -1
- package/dist/host/durable-object.d.ts +3 -3
- package/dist/host/durable-object.js +1 -1
- package/dist/host/websocket-wire.d.ts +2 -2
- package/dist/host/websocket-wire.js +37 -20
- package/dist/host/websocket-wire.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{prompt-projector-9_02lk5-.d.ts → prompt-projector-DimXJPOJ.d.ts} +12 -13
- package/dist/{runtime-C56FQxiL.d.ts → runtime-DcdPOEuE.d.ts} +2 -2
- package/dist/services/compaction.d.ts +1 -1
- 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/runtime.d.ts +1 -1
- package/dist/services/runtime.js +1 -1
- package/dist/services/session-query.d.ts +1 -1
- package/dist/services/session-query.js +1 -1
- package/dist/services/sink-registry.d.ts +1 -1
- package/dist/{session-query-DOc1KanA.js → session-query-Cbf-e0rG.js} +26 -70
- package/dist/session-query-Cbf-e0rG.js.map +1 -0
- package/dist/{session-query-DlRo5Ufc.d.ts → session-query-hxfujxUH.d.ts} +9 -9
- package/dist/{sink-registry-CIU0LD3m.d.ts → sink-registry-BziFpxoE.d.ts} +2 -2
- package/dist/testkit/layers.d.ts +5 -5
- package/dist/testkit/layers.js +1 -1
- package/dist/websocket-wire-D3tLrhe2.d.ts +2172 -0
- package/docs/assets/architecture.svg +170 -60
- package/docs/assets/event-sequence.svg +68 -78
- package/docs/assets/hero.svg +33 -0
- package/docs/releasing.md +78 -39
- package/docs/spec.md +4 -1
- package/docs/websocket-protocol.md +31 -5
- package/package.json +1 -1
- package/dist/durable-object-runtime-B7jwBY2R.js.map +0 -1
- package/dist/session-query-DOc1KanA.js.map +0 -1
- package/dist/websocket-wire-DvOu_6BJ.d.ts +0 -16773
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as defaultCompactionRetainTailTokens, a as CompactionExecutorShape, c as CompactionPolicy, d as CompactionRunner, f as CompactionRunnerInput, g as defaultCompactionMinSummarizableTokens, h as defaultCompactionCharsPerToken, i as CompactionExecutorInput, l as CompactionPolicyInput, m as LanguageModelSummaryCompactionExecutorOptions, n as CompactionError, o as CompactionOutput, p as CompactionRunnerShape, r as CompactionExecutor, s as CompactionPlan, t as ApproximateTokenThresholdCompactionPolicyOptions, u as CompactionPolicyShape, v as defaultCompactionThresholdTokens } from "../compaction-
|
|
1
|
+
import { _ as defaultCompactionRetainTailTokens, a as CompactionExecutorShape, c as CompactionPolicy, d as CompactionRunner, f as CompactionRunnerInput, g as defaultCompactionMinSummarizableTokens, h as defaultCompactionCharsPerToken, i as CompactionExecutorInput, l as CompactionPolicyInput, m as LanguageModelSummaryCompactionExecutorOptions, n as CompactionError, o as CompactionOutput, p as CompactionRunnerShape, r as CompactionExecutor, s as CompactionPlan, t as ApproximateTokenThresholdCompactionPolicyOptions, u as CompactionPolicyShape, v as defaultCompactionThresholdTokens } from "../compaction-1LSZR944.js";
|
|
2
2
|
export { ApproximateTokenThresholdCompactionPolicyOptions, CompactionError, CompactionExecutor, CompactionExecutorInput, CompactionExecutorShape, CompactionOutput, CompactionPlan, CompactionPolicy, CompactionPolicyInput, CompactionPolicyShape, CompactionRunner, CompactionRunnerInput, CompactionRunnerShape, LanguageModelSummaryCompactionExecutorOptions, defaultCompactionCharsPerToken, defaultCompactionMinSummarizableTokens, defaultCompactionRetainTailTokens, defaultCompactionThresholdTokens };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as buildEDAPrompt, i as
|
|
2
|
-
export { EDAPromptProjectionInput, EDAPromptProjector, EDAPromptProjectorShape,
|
|
1
|
+
import { a as buildEDAPrompt, i as EDAPromptProjectorShape, n as EDAPromptProjectionInput, r as EDAPromptProjector, t as EDAProjectedPromptContext } from "../prompt-projector-DimXJPOJ.js";
|
|
2
|
+
export { EDAProjectedPromptContext, EDAPromptProjectionInput, EDAPromptProjector, EDAPromptProjectorShape, buildEDAPrompt };
|
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { contextProjectionPrompt } from "../domain/message-transcript.js";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Prompt from "effect/unstable/ai/Prompt";
|
|
5
6
|
//#region src/services/prompt-projector.ts
|
|
6
|
-
/** Build a provider prompt
|
|
7
|
+
/** Build a provider prompt entirely from the current durable state projection. */
|
|
7
8
|
const buildEDAPrompt = (projector, input) => Effect.gen(function* () {
|
|
8
9
|
const state = yield* projector.projectState(input);
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
const context = yield* projector.projectContext(input);
|
|
11
|
+
const transcript = contextProjectionPrompt(state, input.context);
|
|
12
|
+
const instructionBoundary = firstNonSystemMessageIndex(transcript.content);
|
|
13
|
+
return Prompt.fromMessages([
|
|
14
|
+
...transcript.content.slice(0, instructionBoundary),
|
|
15
|
+
...context.instructions,
|
|
16
|
+
...transcript.content.slice(instructionBoundary),
|
|
17
|
+
...context.messages
|
|
18
|
+
]);
|
|
11
19
|
});
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
return durable?._tag === "User" && durable.requestedDisposition === void 0;
|
|
20
|
+
const firstNonSystemMessageIndex = (messages) => {
|
|
21
|
+
const index = messages.findIndex((message) => message.role !== "system");
|
|
22
|
+
return index === -1 ? messages.length : index;
|
|
16
23
|
};
|
|
17
24
|
/** Service that lets apps derive LLM context independently from UI projections. */
|
|
18
25
|
var EDAPromptProjector = class EDAPromptProjector extends Context.Service()("@effect-durable-agent/EDAPromptProjector") {
|
|
19
26
|
static Default = Layer.succeed(EDAPromptProjector, {
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
projectContext: () => Effect.succeed({
|
|
28
|
+
instructions: [],
|
|
29
|
+
messages: []
|
|
30
|
+
}),
|
|
31
|
+
projectState: (input) => Effect.succeed(input.state)
|
|
22
32
|
});
|
|
23
33
|
};
|
|
24
34
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-projector.js","names":[],"sources":["../../src/services/prompt-projector.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport
|
|
1
|
+
{"version":3,"file":"prompt-projector.js","names":[],"sources":["../../src/services/prompt-projector.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Prompt from \"effect/unstable/ai/Prompt\";\n\nimport { contextProjectionPrompt } from \"../domain/message-transcript\";\nimport type { ContextProjection } from \"../domain/context-projection\";\nimport type { ReducedState } from \"../domain/reduced-state\";\nimport type { SessionId } from \"../types/core\";\nimport type { EDAReducerStateSnapshot } from \"./reducer-registry\";\n\n/** Input for app-extensible state-to-LLM prompt projection. */\nexport interface EDAPromptProjectionInput {\n readonly sessionId: SessionId;\n readonly state: ReducedState;\n readonly reducerStates: EDAReducerStateSnapshot;\n readonly context?: ContextProjection;\n}\n\n/** App-derived instructions and data inserted around the durable transcript. */\nexport interface EDAProjectedPromptContext {\n /** Instruction messages placed after durable system context and before transcript history. */\n readonly instructions: ReadonlyArray<Prompt.SystemMessage>;\n /** Data messages placed after transcript history and before scheduler-selected user messages. */\n readonly messages: ReadonlyArray<Prompt.UserMessage>;\n}\n\n/** Host-extensible projection from durable state into provider prompt context. */\nexport interface EDAPromptProjectorShape {\n readonly projectContext: (\n input: EDAPromptProjectionInput,\n ) => Effect.Effect<EDAProjectedPromptContext>;\n readonly projectState: (input: EDAPromptProjectionInput) => Effect.Effect<ReducedState>;\n}\n\n/** Build a provider prompt entirely from the current durable state projection. */\nexport const buildEDAPrompt = (\n projector: EDAPromptProjectorShape,\n input: EDAPromptProjectionInput,\n): Effect.Effect<Prompt.Prompt> =>\n Effect.gen(function* () {\n const state = yield* projector.projectState(input);\n const context = yield* projector.projectContext(input);\n const transcript = contextProjectionPrompt(state, input.context);\n const instructionBoundary = firstNonSystemMessageIndex(transcript.content);\n return Prompt.fromMessages([\n ...transcript.content.slice(0, instructionBoundary),\n ...context.instructions,\n ...transcript.content.slice(instructionBoundary),\n ...context.messages,\n ]);\n });\n\nconst firstNonSystemMessageIndex = (messages: ReadonlyArray<Prompt.Message>): number => {\n const index = messages.findIndex((message) => message.role !== \"system\");\n return index === -1 ? messages.length : index;\n};\n\n/** Service that lets apps derive LLM context independently from UI projections. */\nexport class EDAPromptProjector extends Context.Service<\n EDAPromptProjector,\n EDAPromptProjectorShape\n>()(\"@effect-durable-agent/EDAPromptProjector\") {\n static readonly Default = Layer.succeed(EDAPromptProjector, {\n projectContext: () => Effect.succeed({ instructions: [], messages: [] }),\n projectState: (input) => Effect.succeed(input.state),\n } satisfies EDAPromptProjectorShape);\n}\n"],"mappings":";;;;;;;AAoCA,MAAa,kBACX,WACA,UAEA,OAAO,IAAI,aAAa;CACtB,MAAM,QAAQ,OAAO,UAAU,aAAa,KAAK;CACjD,MAAM,UAAU,OAAO,UAAU,eAAe,KAAK;CACrD,MAAM,aAAa,wBAAwB,OAAO,MAAM,OAAO;CAC/D,MAAM,sBAAsB,2BAA2B,WAAW,OAAO;CACzE,OAAO,OAAO,aAAa;EACzB,GAAG,WAAW,QAAQ,MAAM,GAAG,mBAAmB;EAClD,GAAG,QAAQ;EACX,GAAG,WAAW,QAAQ,MAAM,mBAAmB;EAC/C,GAAG,QAAQ;CACb,CAAC;AACH,CAAC;AAEH,MAAM,8BAA8B,aAAoD;CACtF,MAAM,QAAQ,SAAS,WAAW,YAAY,QAAQ,SAAS,QAAQ;CACvE,OAAO,UAAU,KAAK,SAAS,SAAS;AAC1C;;AAGA,IAAa,qBAAb,MAAa,2BAA2B,QAAQ,QAG9C,EAAE,0CAA0C,EAAE;CAC9C,OAAgB,UAAU,MAAM,QAAQ,oBAAoB;EAC1D,sBAAsB,OAAO,QAAQ;GAAE,cAAc,CAAC;GAAG,UAAU,CAAC;EAAE,CAAC;EACvE,eAAe,UAAU,OAAO,QAAQ,MAAM,KAAK;CACrD,CAAmC;AACrC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as EDARuntimeError, i as EDARuntimeConfig, n as EDACommandTerminalEvent, o as EDARuntimeShape, r as EDARuntime, s as EDARuntimeSubmit, t as CommittedCommandTerminalEvent } from "../runtime-
|
|
1
|
+
import { a as EDARuntimeError, i as EDARuntimeConfig, n as EDACommandTerminalEvent, o as EDARuntimeShape, r as EDARuntime, s as EDARuntimeSubmit, t as CommittedCommandTerminalEvent } from "../runtime-DcdPOEuE.js";
|
|
2
2
|
export { CommittedCommandTerminalEvent, EDACommandTerminalEvent, EDARuntime, EDARuntimeConfig, EDARuntimeError, EDARuntimeShape, EDARuntimeSubmit };
|
package/dist/services/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SequenceNumber, durablePosition } from "../types/core.js";
|
|
2
2
|
import { gn as commandFailedEventType, hn as commandCompletedEventType, lr as ModelSelectionPayload, mn as commandCancelledEventType, mr as SystemPromptText, ur as NonNegativeInt } from "../durable-C3Rz7kg3.js";
|
|
3
|
-
import { n as SessionState, t as EDASessionQuery } from "../session-query-
|
|
3
|
+
import { n as SessionState, t as EDASessionQuery } from "../session-query-Cbf-e0rG.js";
|
|
4
4
|
import { t as CommittedDurableEvent } from "../session-store-pYxQW9qh.js";
|
|
5
5
|
import { annotateEdaSpan, committedBatchAttributes } from "./tracing.js";
|
|
6
6
|
import * as Context from "effect/Context";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as EDASessionQueryShape, r as EDASessionSnapshot, t as EDASessionQuery } from "../session-query-
|
|
1
|
+
import { n as EDASessionQueryShape, r as EDASessionSnapshot, t as EDASessionQuery } from "../session-query-hxfujxUH.js";
|
|
2
2
|
export { EDASessionQuery, EDASessionQueryShape, EDASessionSnapshot };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as EDASessionQuery } from "../session-query-
|
|
1
|
+
import { t as EDASessionQuery } from "../session-query-Cbf-e0rG.js";
|
|
2
2
|
export { EDASessionQuery };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as EDASinkContext, c as EDASinkRegistryShape, i as EDASinkCheckpoint, l as EDASinkRunnerStartInput, n as EDAEphemeralSinkDefinition, o as EDASinkDurableBatch, r as EDASink, s as EDASinkRegistry, t as EDADurableSinkDefinition } from "../sink-registry-
|
|
1
|
+
import { a as EDASinkContext, c as EDASinkRegistryShape, i as EDASinkCheckpoint, l as EDASinkRunnerStartInput, n as EDAEphemeralSinkDefinition, o as EDASinkDurableBatch, r as EDASink, s as EDASinkRegistry, t as EDADurableSinkDefinition } from "../sink-registry-BziFpxoE.js";
|
|
2
2
|
export { EDADurableSinkDefinition, EDAEphemeralSinkDefinition, EDASink, EDASinkCheckpoint, EDASinkContext, EDASinkDurableBatch, EDASinkRegistry, EDASinkRegistryShape, EDASinkRunnerStartInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandId, InferenceId, MessageId, Position, RunId, SequenceNumber, SubSequenceNumber, TurnId } from "./types/core.js";
|
|
2
|
-
import { CancelPendingMessageCommand, PromotePendingMessageCommand, ResumePendingMessagesCommand, StopTurnCommand, SubmitMessageCommand
|
|
2
|
+
import { CancelPendingMessageCommand, PromotePendingMessageCommand, ResumePendingMessagesCommand, StopTurnCommand, SubmitMessageCommand } from "./types/commands.js";
|
|
3
3
|
import { makeEDARunTrace } from "./types/tracing.js";
|
|
4
4
|
import { Dn as inferenceFailedEventType, En as inferenceCompletedEventType, Gn as toolCallRejectedEventType, Jn as turnFailedEventType, Un as toolCallCreatedEventType, _r as UsagePayload, cr as FailurePayload, dr as PositionedEvent, fr as ProviderPartId, hr as ToolName, lr as ModelSelectionPayload, mr as SystemPromptText, pn as commandAdmittedEventType, ur as NonNegativeInt } from "./durable-C3Rz7kg3.js";
|
|
5
5
|
import { a as encodeReducedStateCheckpoint, h as assertNeverError, i as decodeReducedStateCheckpoint, l as initialReducedState, m as assertNever, n as activeTurnIdentityForCommand, o as foldReducedState, p as reducedStateCheckpointEventSeqs, r as classifyRecoverableWork, s as frameworkReducedStateReducerName } from "./reduced-state-C4nVVzz9.js";
|
|
@@ -1937,23 +1937,28 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
1937
1937
|
});
|
|
1938
1938
|
const closeRunTraceOnFailure = (trace, effect) => effect.pipe(Effect.onExit((exit) => Exit.isFailure(exit) ? Scope.close(trace.runScope, exit) : Effect.void));
|
|
1939
1939
|
const startTurn = Effect.fn(function* (input) {
|
|
1940
|
-
const inputMessageIds = input.promptInput.selectedUserMessages.map((message) => message.messageId);
|
|
1941
|
-
const prompt = yield* buildEDAPrompt(promptProjector, input.promptInput);
|
|
1942
1940
|
const turnId = yield* ids.makeTurnId();
|
|
1943
|
-
const
|
|
1941
|
+
const started = yield* appendDurable(yield* events.turnStarted({
|
|
1942
|
+
runId: input.runId,
|
|
1943
|
+
turnId,
|
|
1944
|
+
...input.inputMessageIds.length === 0 ? {} : { inputMessageIds: input.inputMessageIds }
|
|
1945
|
+
}));
|
|
1946
|
+
const promptState = yield* currentData();
|
|
1947
|
+
const prompt = yield* buildEDAPrompt(promptProjector, {
|
|
1948
|
+
sessionId: sessionContext.sessionId,
|
|
1949
|
+
state: promptState.reduced,
|
|
1950
|
+
reducerStates: promptState.reducerStates,
|
|
1951
|
+
context: yield* contextProjectionFor(promptState.reduced)
|
|
1952
|
+
});
|
|
1953
|
+
const current = promptState.reduced;
|
|
1944
1954
|
const remainingToolCalls = remainingToolCallsForRun(current, input.runId, input.maxToolCallsPerRun ?? defaultMaxToolCallsPerRun);
|
|
1945
1955
|
const remainingToolRejectionCorrections = remainingToolRejectionCorrectionsForRun(current, input.runId, NonNegativeInt.make(maxToolRejectionCorrections));
|
|
1946
1956
|
yield* annotateEdaSpan({
|
|
1947
1957
|
"eda.command.id": input.commandId,
|
|
1948
1958
|
"eda.run.id": input.runId,
|
|
1949
1959
|
"eda.turn.id": turnId,
|
|
1950
|
-
"eda.message.input_count": inputMessageIds.length
|
|
1960
|
+
"eda.message.input_count": input.inputMessageIds.length
|
|
1951
1961
|
});
|
|
1952
|
-
const started = yield* appendDurable(yield* events.turnStarted({
|
|
1953
|
-
runId: input.runId,
|
|
1954
|
-
turnId,
|
|
1955
|
-
...inputMessageIds.length === 0 ? {} : { inputMessageIds }
|
|
1956
|
-
}));
|
|
1957
1962
|
const turnScope = yield* Scope.fork(input.runScope, "sequential");
|
|
1958
1963
|
const fiber = yield* keepAlive.withActiveWork(`turn:${turnId}`, turnRunner.runTurn({
|
|
1959
1964
|
runId: input.runId,
|
|
@@ -2014,30 +2019,17 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
2014
2019
|
modelSelection: input.modelSelection,
|
|
2015
2020
|
trace: activeRunTrace.runTrace
|
|
2016
2021
|
});
|
|
2017
|
-
const startedEvents = yield* appendDurableBatch([
|
|
2018
|
-
commandStarted,
|
|
2019
|
-
...userMessage === void 0 ? [] : [userMessage],
|
|
2020
|
-
runStarted
|
|
2021
|
-
]);
|
|
2022
|
-
const selectedUserContent = submittedMessage === void 0 ? submit.content : Schema.decodeUnknownSync(UserMessageContent)(submittedMessage.content);
|
|
2023
|
-
const promptState = yield* currentData();
|
|
2024
2022
|
return yield* startTurn({
|
|
2025
2023
|
commandId,
|
|
2026
|
-
commandStarted:
|
|
2024
|
+
commandStarted: (yield* appendDurableBatch([
|
|
2025
|
+
commandStarted,
|
|
2026
|
+
...userMessage === void 0 ? [] : [userMessage],
|
|
2027
|
+
runStarted
|
|
2028
|
+
]))[0],
|
|
2029
|
+
inputMessageIds: [messageId],
|
|
2027
2030
|
runId,
|
|
2028
2031
|
modelSelection: input.modelSelection,
|
|
2029
2032
|
...input.maxToolCallsPerRun === void 0 ? {} : { maxToolCallsPerRun: input.maxToolCallsPerRun },
|
|
2030
|
-
promptInput: {
|
|
2031
|
-
sessionId: sessionContext.sessionId,
|
|
2032
|
-
state: promptState.reduced,
|
|
2033
|
-
reducerStates: promptState.reducerStates,
|
|
2034
|
-
context: yield* contextProjectionFor(promptState.reduced),
|
|
2035
|
-
selectedUserMessages: [{
|
|
2036
|
-
commandId,
|
|
2037
|
-
content: selectedUserContent,
|
|
2038
|
-
messageId
|
|
2039
|
-
}]
|
|
2040
|
-
},
|
|
2041
2033
|
runScope: activeRunTrace.runScope,
|
|
2042
2034
|
runSpan: activeRunTrace.runSpan
|
|
2043
2035
|
});
|
|
@@ -2069,20 +2061,10 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
2069
2061
|
return yield* startTurn({
|
|
2070
2062
|
commandId: command.commandId,
|
|
2071
2063
|
commandStarted: started[0],
|
|
2064
|
+
inputMessageIds: pending.map((message) => message.messageId),
|
|
2072
2065
|
runId,
|
|
2073
2066
|
modelSelection: input.modelSelection,
|
|
2074
2067
|
...input.maxToolCallsPerRun === void 0 ? {} : { maxToolCallsPerRun: input.maxToolCallsPerRun },
|
|
2075
|
-
promptInput: {
|
|
2076
|
-
sessionId: sessionContext.sessionId,
|
|
2077
|
-
state: current.reduced,
|
|
2078
|
-
reducerStates: current.reducerStates,
|
|
2079
|
-
context: yield* contextProjectionFor(current.reduced),
|
|
2080
|
-
selectedUserMessages: pending.map((message) => ({
|
|
2081
|
-
commandId: message.commandId,
|
|
2082
|
-
content: message.content,
|
|
2083
|
-
messageId: message.messageId
|
|
2084
|
-
}))
|
|
2085
|
-
},
|
|
2086
2068
|
runScope: activeRunTrace.runScope,
|
|
2087
2069
|
runSpan: activeRunTrace.runSpan
|
|
2088
2070
|
});
|
|
@@ -2302,20 +2284,10 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
2302
2284
|
yield* startTurn({
|
|
2303
2285
|
commandId: continuation.command.commandId,
|
|
2304
2286
|
commandStarted,
|
|
2287
|
+
inputMessageIds: pendingInputs.map((message) => message.messageId),
|
|
2305
2288
|
runId: continuation.runId,
|
|
2306
2289
|
modelSelection: input.modelSelection,
|
|
2307
2290
|
...input.maxToolCallsPerRun === void 0 ? {} : { maxToolCallsPerRun: input.maxToolCallsPerRun },
|
|
2308
|
-
promptInput: {
|
|
2309
|
-
sessionId: sessionContext.sessionId,
|
|
2310
|
-
state: promptState.reduced,
|
|
2311
|
-
reducerStates: promptState.reducerStates,
|
|
2312
|
-
context: yield* contextProjectionFor(promptState.reduced),
|
|
2313
|
-
selectedUserMessages: pendingInputs.map((message) => ({
|
|
2314
|
-
commandId: message.commandId,
|
|
2315
|
-
content: message.content,
|
|
2316
|
-
messageId: message.messageId
|
|
2317
|
-
}))
|
|
2318
|
-
},
|
|
2319
2291
|
runScope: continuation.runScope,
|
|
2320
2292
|
runSpan: continuation.runSpan
|
|
2321
2293
|
});
|
|
@@ -2556,36 +2528,20 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
2556
2528
|
case "ContinueWithSteering": return yield* startTurn({
|
|
2557
2529
|
commandId: active.commandId,
|
|
2558
2530
|
commandStarted: active.commandStarted,
|
|
2531
|
+
inputMessageIds: continuation.steerings.map((steering) => steering.messageId),
|
|
2559
2532
|
runId: active.runId,
|
|
2560
2533
|
modelSelection: active.modelSelection,
|
|
2561
2534
|
...active.maxToolCallsPerRun === void 0 ? {} : { maxToolCallsPerRun: active.maxToolCallsPerRun },
|
|
2562
|
-
promptInput: {
|
|
2563
|
-
sessionId: sessionContext.sessionId,
|
|
2564
|
-
state: current,
|
|
2565
|
-
reducerStates: (yield* currentData()).reducerStates,
|
|
2566
|
-
context: yield* contextProjectionFor(current),
|
|
2567
|
-
selectedUserMessages: continuation.steerings.map((steering) => ({
|
|
2568
|
-
commandId: steering.commandId,
|
|
2569
|
-
content: steering.content,
|
|
2570
|
-
messageId: steering.messageId
|
|
2571
|
-
}))
|
|
2572
|
-
},
|
|
2573
2535
|
runScope: active.runScope,
|
|
2574
2536
|
runSpan: active.runSpan
|
|
2575
2537
|
});
|
|
2576
2538
|
case "ContinueWithToolFeedback": return yield* startTurn({
|
|
2577
2539
|
commandId: active.commandId,
|
|
2578
2540
|
commandStarted: active.commandStarted,
|
|
2541
|
+
inputMessageIds: [],
|
|
2579
2542
|
runId: active.runId,
|
|
2580
2543
|
modelSelection: active.modelSelection,
|
|
2581
2544
|
...active.maxToolCallsPerRun === void 0 ? {} : { maxToolCallsPerRun: active.maxToolCallsPerRun },
|
|
2582
|
-
promptInput: {
|
|
2583
|
-
sessionId: sessionContext.sessionId,
|
|
2584
|
-
state: current,
|
|
2585
|
-
reducerStates: (yield* currentData()).reducerStates,
|
|
2586
|
-
context: yield* contextProjectionFor(current),
|
|
2587
|
-
selectedUserMessages: []
|
|
2588
|
-
},
|
|
2589
2545
|
runScope: active.runScope,
|
|
2590
2546
|
runSpan: active.runSpan
|
|
2591
2547
|
});
|
|
@@ -2927,4 +2883,4 @@ const uniquePositionedEvents = (events) => {
|
|
|
2927
2883
|
//#endregion
|
|
2928
2884
|
export { ToolExecutor as a, InferenceRunner as i, SessionState as n, TurnRunner as r, EDASessionQuery as t };
|
|
2929
2885
|
|
|
2930
|
-
//# sourceMappingURL=session-query-
|
|
2886
|
+
//# sourceMappingURL=session-query-Cbf-e0rG.js.map
|