effect-durable-agent-cloudflare 0.1.0-alpha.20 → 0.1.0-alpha.21

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.js","names":[],"sources":["../src/providers/providers.ts"],"sourcesContent":["import { AnthropicClient, AnthropicLanguageModel } from \"@effect/ai-anthropic\";\nimport { OpenAiClient, OpenAiLanguageModel } from \"@effect/ai-openai\";\nimport {\n CompactionError,\n CompactionExecutor,\n CompactionOutput,\n promptPrefixSummaryCompactionExecutor,\n type CompactionExecutorInput,\n type CompactionExecutorShape,\n} from \"effect-durable-agent/services/compaction\";\nimport { generateTextOfferingTools } from \"effect-durable-agent/services/model-call\";\nimport { ModelResolver } from \"effect-durable-agent/services/model-resolver\";\nimport { nativeCompactionSummaryMessage } from \"effect-durable-agent/services/prompt-projector\";\nimport type { ModelSelectionPayload, UsagePayload } from \"effect-durable-agent/types/events\";\nimport { CompactionExecutorId } from \"effect-durable-agent/domain/context-projection\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport type * as Schema from \"effect/Schema\";\n\nimport {\n makeEDAAnthropicClientLayer,\n prepareEDAAnthropicPrompt,\n type EDAAnthropicClientOptions,\n type EDAAnthropicModelConfig,\n} from \"./anthropic\";\nimport { makeEDAOpenAiClientLayer, type EDAOpenAiModelConfig } from \"./openai\";\nimport {\n ANTHROPIC_COMPACTION_BETA,\n EDAProviderRequestOverride,\n prepareNativeCompaction,\n withBeta,\n type EDAProviderRequest,\n} from \"./transport\";\n\n/** Model request settings the host derives from a durable selection. */\nexport type EDAResolvedModel =\n | {\n readonly provider: \"openai\";\n readonly modelId: string;\n readonly config: EDAOpenAiModelConfig;\n }\n | {\n readonly provider: \"anthropic\";\n readonly modelId: string;\n readonly config: EDAAnthropicModelConfig;\n };\n\n/** Clients for every provider a host serves; a session runs on the one its selection names. */\nexport interface EDAMultiProviderModelResolverOptions {\n readonly openai?: {\n readonly aiGateway?: AiGateway | undefined;\n readonly apiKey?: string | undefined;\n readonly apiUrl?: string | undefined;\n };\n readonly anthropic?: EDAAnthropicClientOptions;\n /** Host policy: validate the recorded selection and choose request settings. Throw to reject. */\n readonly resolve: (selection: ModelSelectionPayload | undefined) => EDAResolvedModel;\n}\n\n/**\n * Resolves each durable selection to the provider it names, sharing one client per provider for\n * the runtime lifetime, and prepares prompts in that provider's cache and compaction shape.\n */\nexport const makeEDAMultiProviderModelResolverLayer = (\n options: EDAMultiProviderModelResolverOptions,\n): Layer.Layer<ModelResolver> => {\n const openAiClient =\n options.openai === undefined ? undefined : makeEDAOpenAiClientLayer(options.openai);\n const anthropicClient =\n options.anthropic === undefined ? undefined : makeEDAAnthropicClientLayer(options.anthropic);\n return Layer.effect(\n ModelResolver,\n Effect.gen(function* () {\n const openAi =\n openAiClient === undefined\n ? undefined\n : yield* OpenAiClient.OpenAiClient.pipe(Effect.provide(openAiClient));\n const anthropic =\n anthropicClient === undefined\n ? undefined\n : yield* AnthropicClient.AnthropicClient.pipe(Effect.provide(anthropicClient));\n return {\n resolve: Effect.fn(\"MultiProviderModelResolver.resolve\")(function* (selection) {\n const resolved = options.resolve(selection);\n if (resolved.provider === \"anthropic\") {\n if (anthropic === undefined) {\n return yield* Effect.die(new Error(\"No Anthropic client is configured.\"));\n }\n return yield* AnthropicLanguageModel.make({\n model: resolved.modelId,\n config: resolved.config,\n }).pipe(Effect.provideService(AnthropicClient.AnthropicClient, anthropic));\n }\n if (openAi === undefined) {\n return yield* Effect.die(new Error(\"No OpenAI client is configured.\"));\n }\n return yield* OpenAiLanguageModel.make({\n model: resolved.modelId,\n config: resolved.config,\n }).pipe(Effect.provideService(OpenAiClient.OpenAiClient, openAi));\n }),\n preparePrompt: (selection, prompt) =>\n selection?.provider === \"anthropic\"\n ? prepareEDAAnthropicPrompt(prompt)\n : selection?.provider === \"openai\"\n ? prepareNativeCompaction(\"openai\", prompt)\n : prompt,\n };\n }),\n );\n};\n\n/** Options for provider-native compaction. */\nexport interface EDANativeCompactionOptions {\n /**\n * Custom summarization prompt for Anthropic (`compaction.instructions`, up to 16,384 characters).\n * OpenAI compaction takes no prompt.\n */\n readonly anthropicInstructions?: string | undefined;\n /** Output budget for the Anthropic summary call, thinking included. Defaults to 16,000. */\n readonly anthropicMaxTokens?: number | undefined;\n}\n\n/**\n * Compacts with the session provider's own endpoint: OpenAI `/responses/compact`, Anthropic\n * on-demand compaction (`compact-2026-09-04`). Each call carries the exact earlier request prompt,\n * so it reads the conversation from the provider cache, and the returned native items replace the\n * summarized history on later requests. Other providers fall back to a prompt-prefix summary.\n */\nexport const makeEDANativeCompactionExecutorLayer = (\n options: EDANativeCompactionOptions = {},\n): Layer.Layer<CompactionExecutor> =>\n Layer.effect(\n CompactionExecutor,\n Effect.gen(function* () {\n const fallback = yield* CompactionExecutor.pipe(\n Effect.provide(promptPrefixSummaryCompactionExecutor()),\n );\n return {\n id: CompactionExecutorId.make(\"provider-native\"),\n execute: (input) => {\n switch (input.state.modelSelection?.provider) {\n case \"anthropic\":\n return anthropicCompaction(input, options);\n case \"openai\":\n return openAiCompaction(input);\n default:\n return fallback.execute(input);\n }\n },\n } satisfies CompactionExecutorShape;\n }),\n );\n\ninterface CapturedResponse {\n readonly status: number;\n readonly body: unknown;\n}\n\n/** Run the adapter's request with an override and return the raw provider response. */\nconst callWithOverride = (\n input: CompactionExecutorInput,\n rewrite: (request: EDAProviderRequest) => EDAProviderRequest,\n) =>\n Effect.gen(function* () {\n let captured: CapturedResponse | undefined;\n const exit = yield* generateTextOfferingTools(input.model, input.prompt, input.toolkit).pipe(\n Effect.provideService(EDAProviderRequestOverride, {\n rewrite,\n onResponse: (status, body) => {\n captured = { status, body };\n },\n }),\n Effect.exit,\n );\n if (captured === undefined) {\n return yield* new CompactionError({\n message: `compaction request failed before a provider response: ${\n Exit.isFailure(exit) ? String(exit.cause) : \"no response\"\n }`,\n });\n }\n if (captured.status < 200 || captured.status >= 300) {\n return yield* new CompactionError({\n message: `compaction request failed with ${captured.status}: ${providerErrorMessage(captured.body)}`,\n });\n }\n return captured.body;\n });\n\nconst anthropicCompaction = (input: CompactionExecutorInput, options: EDANativeCompactionOptions) =>\n Effect.gen(function* () {\n const body = yield* callWithOverride(input, (request) => ({\n ...request,\n headers: {\n ...withBeta(request.headers, ANTHROPIC_COMPACTION_BETA),\n accept: \"text/event-stream\",\n },\n body: isRecord(request.body)\n ? {\n ...request.body,\n max_tokens: options.anthropicMaxTokens ?? 16_000,\n // Streaming keeps the connection active (pings) while the summary is written.\n stream: true,\n compaction: {\n type: \"summarize\",\n ...(options.anthropicInstructions === undefined\n ? {}\n : { instructions: options.anthropicInstructions }),\n },\n }\n : request.body,\n })).pipe(Effect.map(anthropicMessageFromStream));\n const usage = anthropicCompactionUsage(body);\n const block = isRecord(body) && Array.isArray(body.content) ? body.content[0] : undefined;\n if (\n !isRecord(body) ||\n body.stop_reason !== \"compaction\" ||\n !isRecord(block) ||\n block.type !== \"compaction\" ||\n typeof block.content !== \"string\" ||\n block.content.trim().length === 0\n ) {\n return yield* new CompactionError({\n message: `anthropic compaction returned no summary (stop_reason ${\n isRecord(body) ? String(body.stop_reason) : \"unknown\"\n })`,\n ...(usage === undefined ? {} : { usage }),\n });\n }\n const text = block.content.trim();\n return CompactionOutput.make({\n text,\n promptMessage: nativeCompactionSummaryMessage(`Conversation summary:\\n\\n${text}`, {\n provider: \"anthropic\",\n modelId: input.state.modelSelection?.modelId ?? \"unknown\",\n items: [jsonValue(block)],\n }),\n executorId: CompactionExecutorId.make(\"anthropic-native\"),\n ...(usage === undefined ? {} : { usage }),\n });\n });\n\nconst openAiCompaction = (input: CompactionExecutorInput) =>\n Effect.gen(function* () {\n const body = yield* callWithOverride(input, (request) => ({\n ...request,\n url: new URL(\n request.url.pathname.replace(/\\/responses$/u, \"/responses/compact\"),\n request.url,\n ),\n body: isRecord(request.body)\n ? Object.fromEntries(\n Object.entries(request.body).filter(([key]) =>\n [\"model\", \"input\", \"instructions\", \"tools\"].includes(key),\n ),\n )\n : request.body,\n }));\n const usage = openAiUsage(isRecord(body) ? body.usage : undefined);\n const output = isRecord(body) && Array.isArray(body.output) ? body.output : [];\n // The host sends its own instructions; keep only conversation items from the compacted window.\n const items = output.filter(\n (item) => !(isRecord(item) && (item.role === \"developer\" || item.role === \"system\")),\n );\n if (!items.some((item) => isRecord(item) && item.type === \"compaction\")) {\n return yield* new CompactionError({\n message: \"openai compaction returned no compaction item\",\n ...(usage === undefined ? {} : { usage }),\n });\n }\n const retainedUserMessages = items.filter(\n (item) => isRecord(item) && item.role === \"user\",\n ).length;\n const text = `Earlier conversation compacted by OpenAI into an encrypted summary (${retainedUserMessages} user messages retained verbatim).`;\n return CompactionOutput.make({\n text,\n promptMessage: nativeCompactionSummaryMessage(text, {\n provider: \"openai\",\n modelId: input.state.modelSelection?.modelId ?? \"unknown\",\n items: items.map(jsonValue),\n }),\n executorId: CompactionExecutorId.make(\"openai-native\"),\n ...(usage === undefined ? {} : { usage }),\n });\n });\n\n/**\n * Rebuild a Messages API response from its SSE stream. A compaction block arrives whole in its\n * `content_block_start`; usage (with `iterations`) arrives on `message_delta`.\n */\nconst anthropicMessageFromStream = (body: unknown): unknown => {\n if (typeof body !== \"string\") return body;\n let message: Record<string, unknown> = {};\n const content: Array<unknown> = [];\n for (const line of body.split(\"\\n\")) {\n if (!line.startsWith(\"data: \")) continue;\n const event: unknown = JSON.parse(line.slice(\"data: \".length));\n if (!isRecord(event)) continue;\n if (event.type === \"message_start\" && isRecord(event.message)) {\n message = { ...event.message };\n } else if (event.type === \"content_block_start\" && typeof event.index === \"number\") {\n content[event.index] = event.content_block;\n } else if (event.type === \"message_delta\") {\n const delta = isRecord(event.delta) ? event.delta : {};\n const usage = isRecord(message.usage) ? message.usage : {};\n message = {\n ...message,\n ...delta,\n usage: { ...usage, ...(isRecord(event.usage) ? event.usage : {}) },\n };\n } else if (event.type === \"error\") {\n return { error: event.error };\n }\n }\n return { ...message, content: content.filter((block) => block !== undefined) };\n};\n\n/** Anthropic reports compaction cost only in `usage.iterations`; top-level fields are zero. */\nconst anthropicCompactionUsage = (body: unknown): UsagePayload | undefined => {\n const usage = isRecord(body) ? body.usage : undefined;\n const iterations = isRecord(usage) && Array.isArray(usage.iterations) ? usage.iterations : [];\n if (iterations.length === 0) return undefined;\n let uncached = 0;\n let cacheRead = 0;\n let cacheWrite = 0;\n let output = 0;\n for (const iteration of iterations) {\n if (!isRecord(iteration)) continue;\n uncached += count(iteration.input_tokens);\n cacheRead += count(iteration.cache_read_input_tokens);\n cacheWrite += count(iteration.cache_creation_input_tokens);\n output += count(iteration.output_tokens);\n }\n return {\n inputTokens: uncached + cacheRead + cacheWrite,\n cachedInputTokens: cacheRead,\n cacheWriteInputTokens: cacheWrite,\n outputTokens: output,\n };\n};\n\nconst openAiUsage = (usage: unknown): UsagePayload | undefined => {\n if (!isRecord(usage)) return undefined;\n const details = isRecord(usage.input_tokens_details) ? usage.input_tokens_details : {};\n return {\n inputTokens: count(usage.input_tokens),\n cachedInputTokens: count(details.cached_tokens),\n cacheWriteInputTokens: count(details.cache_write_tokens),\n outputTokens: count(usage.output_tokens),\n };\n};\n\nconst count = (value: unknown): number =>\n typeof value === \"number\" && Number.isSafeInteger(value) && value >= 0 ? value : 0;\n\nconst providerErrorMessage = (body: unknown): string => {\n if (isRecord(body) && isRecord(body.error) && typeof body.error.message === \"string\") {\n return body.error.message;\n }\n return typeof body === \"string\" ? body.slice(0, 500) : JSON.stringify(body).slice(0, 500);\n};\n\nconst jsonValue = (value: unknown): Schema.Json => {\n const parsed: Schema.Json = JSON.parse(JSON.stringify(value) ?? \"null\");\n return parsed;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport { prepareEDAAnthropicPrompt } from \"./anthropic\";\nexport type { EDAAnthropicModelConfig } from \"./anthropic\";\nexport type { EDAOpenAiModel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,MAAM,oBAAoB,IAAI,MAAM,uBAAuB,CAAC;CACrF,OAAO;EACL,aAAa,MAAM,MAAM,YAAY;EACrC,mBAAmB,MAAM,QAAQ,aAAa;EAC9C,uBAAuB,MAAM,QAAQ,kBAAkB;EACvD,cAAc,MAAM,MAAM,aAAa;CACzC;AACF;AAEA,MAAM,SAAS,UACb,OAAO,UAAU,YAAY,OAAO,cAAc,KAAK,KAAK,SAAS,IAAI,QAAQ;AAEnF,MAAM,wBAAwB,SAA0B;CACtD,IAAI,SAAS,IAAI,KAAK,SAAS,KAAK,KAAK,KAAK,OAAO,KAAK,MAAM,YAAY,UAC1E,OAAO,KAAK,MAAM;CAEpB,OAAO,OAAO,SAAS,WAAW,KAAK,MAAM,GAAG,GAAG,IAAI,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,GAAG,GAAG;AAC1F;AAEA,MAAM,aAAa,UAAgC;CAEjD,OAD4B,KAAK,MAAM,KAAK,UAAU,KAAK,KAAK,MACpD;AACd;AAEA,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK"}
@@ -1,3 +1,5 @@
1
+ import "effect-durable-agent/services/prompt-projector";
2
+ import * as Layer from "effect/Layer";
1
3
  import * as Effect from "effect/Effect";
2
4
  import * as Schema from "effect/Schema";
3
5
  import { ContextRebasedPayload, DurableEventEnvelope, SummaryCreatedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, contextRebasedEventType, decodeDurableEventSync, effectDurableAgentNamespace, steeringMessageQueuedEventType, summaryCreatedEventType, systemMessageCommittedEventType, userMessageCommittedEventType } from "effect-durable-agent/types/events";
@@ -6,7 +8,6 @@ import { EDATraceMetadata, makeRootEDATraceMetadata } from "effect-durable-agent
6
8
  import { EDASessionStore, EDASessionStoreError } from "effect-durable-agent/services/session-store";
7
9
  import { EDARuntime } from "effect-durable-agent/services/runtime";
8
10
  import { annotateEdaSpan, committedBatchAttributes, compactSpanAttributes, toEdaExternalSpan } from "effect-durable-agent/services/tracing";
9
- import * as Layer from "effect/Layer";
10
11
  import * as ManagedRuntime from "effect/ManagedRuntime";
11
12
  import { SinkCheckpointStore } from "effect-durable-agent/services/sink-checkpoint-store";
12
13
  import * as Cause from "effect/Cause";
@@ -16,7 +17,6 @@ import { CompactionSummaryArtifact } from "effect-durable-agent/domain/context-p
16
17
  import { RunSchedulingWakeup } from "effect-durable-agent/services/run-scheduling-wakeup";
17
18
  import "effect-durable-agent/services/compaction";
18
19
  import { EDAKeepAlive } from "effect-durable-agent/services/keep-alive";
19
- import "effect-durable-agent/services/prompt-projector";
20
20
  import { EDAReducerRegistry } from "effect-durable-agent/services/reducer-registry";
21
21
  import { makeEDARuntimeLayer } from "effect-durable-agent/services/runtime-layer";
22
22
  import { SessionEventObserver } from "effect-durable-agent/services/session-event-observer";
@@ -1462,4 +1462,4 @@ const hostSpanOptions = (trace, attributes) => ({
1462
1462
  //#endregion
1463
1463
  export { EDAWebSocketProjectionId as n, makeEDADurableObjectRuntimeLayer as r, EDASessionController as t };
1464
1464
 
1465
- //# sourceMappingURL=session-controller-zTTLb7tt.js.map
1465
+ //# sourceMappingURL=session-controller-BGfz1DdS.js.map