@relayfx/sdk 0.2.10 → 0.2.12

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  __export,
4
4
  exports_model_registry
5
- } from "./index-fhqr1n44.js";
5
+ } from "./index-33d4k6kk.js";
6
6
 
7
7
  // ../ai/src/language-model/language-model-registration.ts
8
8
  var exports_language_model_registration = {};
@@ -24,7 +24,7 @@ __export(exports_language_model_registration, {
24
24
  anthropic: () => anthropic
25
25
  });
26
26
 
27
- // ../../node_modules/.bun/@batonfx+providers@0.4.2/node_modules/@batonfx/providers/dist/anthropic.js
27
+ // ../../node_modules/.bun/@batonfx+providers@0.4.3/node_modules/@batonfx/providers/dist/anthropic.js
28
28
  import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
29
29
  import { Config, Layer, Redacted } from "effect";
30
30
  import { FetchHttpClient } from "effect/unstable/http";
@@ -40,13 +40,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
40
40
  });
41
41
  var anthropicClientLayerConfig = AnthropicClient.layerConfig;
42
42
  var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer.provide(FetchHttpClient.layer));
43
- // ../../node_modules/.bun/@batonfx+providers@0.4.2/node_modules/@batonfx/providers/dist/deterministic.js
43
+ // ../../node_modules/.bun/@batonfx+providers@0.4.3/node_modules/@batonfx/providers/dist/deterministic.js
44
44
  import { OpenAiClient as OpenAiClient2 } from "@effect/ai-openai";
45
45
  import { Effect, Layer as Layer3, Option, Stream } from "effect";
46
46
  import { LanguageModel, Response } from "effect/unstable/ai";
47
47
  import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
48
48
 
49
- // ../../node_modules/.bun/@batonfx+providers@0.4.2/node_modules/@batonfx/providers/dist/openai.js
49
+ // ../../node_modules/.bun/@batonfx+providers@0.4.3/node_modules/@batonfx/providers/dist/openai.js
50
50
  import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai";
51
51
  import { Config as Config2, Layer as Layer2, Redacted as Redacted2 } from "effect";
52
52
  import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
@@ -63,7 +63,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
63
63
  var openAiClientLayerConfig = OpenAiClient.layerConfig;
64
64
  var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer2.provide(OpenAiClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer2.provide(FetchHttpClient2.layer));
65
65
 
66
- // ../../node_modules/.bun/@batonfx+providers@0.4.2/node_modules/@batonfx/providers/dist/deterministic.js
66
+ // ../../node_modules/.bun/@batonfx+providers@0.4.3/node_modules/@batonfx/providers/dist/deterministic.js
67
67
  var deterministicModelLayer = Layer3.effect(LanguageModel.LanguageModel, LanguageModel.make({
68
68
  generateText: () => Effect.succeed([{ type: "text", text: "deterministic response" }]),
69
69
  streamText: () => Stream.make(Response.makePart("text-delta", { id: "text", delta: "deterministic response" }))
@@ -87,7 +87,7 @@ var withOpenAiOrDeterministic = (options) => Layer3.unwrap(Effect.gen(function*
87
87
  ...Option.isSome(openAiRegistration) ? [openAiRegistration.value] : []
88
88
  ]);
89
89
  }));
90
- // ../../node_modules/.bun/@batonfx+providers@0.4.2/node_modules/@batonfx/providers/dist/openai-compat.js
90
+ // ../../node_modules/.bun/@batonfx+providers@0.4.3/node_modules/@batonfx/providers/dist/openai-compat.js
91
91
  import { OpenAiClient as OpenAiClient3, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
92
92
  import { Config as Config3, Layer as Layer4, Redacted as Redacted3 } from "effect";
93
93
  import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
@@ -108,7 +108,7 @@ var clientLayerConfig = (options) => OpenAiClient3.layerConfig({
108
108
  ...options.baseUrl === undefined ? {} : { apiUrl: Config3.succeed(options.baseUrl) }
109
109
  });
110
110
  var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer4.provide(clientLayerConfig(options)), Layer4.provide(FetchHttpClient4.layer));
111
- // ../../node_modules/.bun/@batonfx+providers@0.4.2/node_modules/@batonfx/providers/dist/openrouter.js
111
+ // ../../node_modules/.bun/@batonfx+providers@0.4.3/node_modules/@batonfx/providers/dist/openrouter.js
112
112
  import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
113
113
  import { Config as Config4, Layer as Layer5, Redacted as Redacted4 } from "effect";
114
114
  import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  exports_language_model_registration
4
- } from "./index-tpwr0wmj.js";
4
+ } from "./index-aph699jp.js";
5
5
  import {
6
6
  Service,
7
7
  exports_client,
8
8
  exports_command,
9
9
  exports_operation
10
- } from "./index-r8975x1z.js";
10
+ } from "./index-236a3f4t.js";
11
11
  import {
12
12
  Dialect,
13
13
  __export,
@@ -59,7 +59,7 @@ import {
59
59
  fromDbTimestamp,
60
60
  fromNullableDbTimestamp,
61
61
  timestampParam
62
- } from "./index-fhqr1n44.js";
62
+ } from "./index-33d4k6kk.js";
63
63
 
64
64
  // src/adapter-outbox.ts
65
65
  var exports_adapter_outbox = {};
package/dist/sqlite.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  exports_client,
4
4
  exports_operation
5
- } from "./index-r8975x1z.js";
5
+ } from "./index-236a3f4t.js";
6
6
  import {
7
7
  __export,
8
8
  exports_activity_version_registry,
@@ -46,7 +46,7 @@ import {
46
46
  exports_wait_service,
47
47
  exports_workflow_definition_repository,
48
48
  exports_workflow_schema
49
- } from "./index-fhqr1n44.js";
49
+ } from "./index-33d4k6kk.js";
50
50
  // src/sqlite-runtime.ts
51
51
  var exports_sqlite_runtime = {};
52
52
  __export(exports_sqlite_runtime, {
@@ -64,6 +64,7 @@ export interface StartExecutionByAgentDefinitionInput {
64
64
  readonly root_address_id: Ids.AddressId;
65
65
  readonly session_id?: Ids.SessionId;
66
66
  readonly agent_id: Ids.AgentId;
67
+ readonly agent_revision: Agent.DefinitionRevision;
67
68
  readonly input?: ReadonlyArray<Content.Part>;
68
69
  readonly idempotency_key: Shared.NonEmptyString;
69
70
  readonly execution_id?: Ids.ExecutionId;
@@ -84,6 +85,7 @@ export interface RegisterBatonAgentInput {
84
85
  readonly permissions?: ReadonlyArray<Tool.Permission>;
85
86
  readonly skill_definition_ids?: ReadonlyArray<Ids.SkillDefinitionId>;
86
87
  readonly permission_rules?: Agent.PermissionRuleset;
88
+ readonly compaction_policy?: Agent.CompactionPolicy;
87
89
  readonly max_tool_turns?: number;
88
90
  readonly max_wait_turns?: number;
89
91
  readonly token_budget?: number;
@@ -231,7 +233,7 @@ export declare const followExecution: (input: FollowExecutionInput) => Stream.St
231
233
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
232
234
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
233
235
  }>;
234
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
236
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
235
237
  readonly sequence: Schema.Int;
236
238
  readonly cursor: Schema.String;
237
239
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -351,7 +353,7 @@ export declare const streamSession: (input: StreamSessionInput) => Stream.Stream
351
353
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
352
354
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
353
355
  }>;
354
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
356
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
355
357
  readonly sequence: Schema.Int;
356
358
  readonly cursor: Schema.String;
357
359
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -91,6 +91,11 @@ export declare const StartExecutionInput: Schema.Struct<{
91
91
  readonly [x: string]: Schema.Json;
92
92
  };
93
93
  readonly instructions?: string;
94
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
95
+ readonly context_window: Schema.Number;
96
+ readonly reserve_tokens: Schema.Number;
97
+ readonly keep_recent_tokens: Schema.Number;
98
+ }, "Encoded">;
94
99
  readonly output_schema_ref?: string;
95
100
  readonly skill_definition_ids?: readonly string[];
96
101
  readonly permission_rules?: {
@@ -123,6 +128,11 @@ export declare const StartExecutionInput: Schema.Struct<{
123
128
  };
124
129
  };
125
130
  readonly instructions?: string;
131
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
132
+ readonly context_window: Schema.Number;
133
+ readonly reserve_tokens: Schema.Number;
134
+ readonly keep_recent_tokens: Schema.Number;
135
+ }, "Encoded">;
126
136
  readonly tool_names?: readonly string[];
127
137
  readonly workspace_policy?: {
128
138
  readonly mode: "share" | "fork";
@@ -612,7 +622,7 @@ export declare const FollowExecutionItem: Schema.Union<readonly [Schema.Struct<{
612
622
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
613
623
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
614
624
  }>;
615
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
625
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
616
626
  readonly sequence: Schema.Int;
617
627
  readonly cursor: Schema.String;
618
628
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -1074,6 +1084,11 @@ export declare const SpawnChildRunInput: Schema.Struct<{
1074
1084
  readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1075
1085
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1076
1086
  }>>;
1087
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1088
+ readonly context_window: Schema.Number;
1089
+ readonly reserve_tokens: Schema.Number;
1090
+ readonly keep_recent_tokens: Schema.Number;
1091
+ }>>;
1077
1092
  readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
1078
1093
  readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
1079
1094
  readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
@@ -1158,6 +1173,11 @@ export declare const CreateChildFanOutInput: Schema.Struct<{
1158
1173
  readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1159
1174
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1160
1175
  }>>;
1176
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1177
+ readonly context_window: Schema.Number;
1178
+ readonly reserve_tokens: Schema.Number;
1179
+ readonly keep_recent_tokens: Schema.Number;
1180
+ }>>;
1161
1181
  readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
1162
1182
  readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
1163
1183
  readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
@@ -1322,6 +1342,11 @@ export declare const CancelChildFanOutResult: Schema.Struct<{
1322
1342
  readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1323
1343
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1324
1344
  }>>;
1345
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1346
+ readonly context_window: Schema.Number;
1347
+ readonly reserve_tokens: Schema.Number;
1348
+ readonly keep_recent_tokens: Schema.Number;
1349
+ }>>;
1325
1350
  readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
1326
1351
  readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
1327
1352
  readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
@@ -1485,6 +1510,11 @@ export declare const InspectChildFanOutResult: Schema.Struct<{
1485
1510
  readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1486
1511
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1487
1512
  }>>;
1513
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1514
+ readonly context_window: Schema.Number;
1515
+ readonly reserve_tokens: Schema.Number;
1516
+ readonly keep_recent_tokens: Schema.Number;
1517
+ }>>;
1488
1518
  readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
1489
1519
  readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
1490
1520
  readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
@@ -2312,7 +2342,7 @@ export declare const SessionStreamItem: Schema.Union<readonly [Schema.TaggedStru
2312
2342
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
2313
2343
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
2314
2344
  }>;
2315
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
2345
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
2316
2346
  readonly sequence: Schema.Int;
2317
2347
  readonly cursor: Schema.String;
2318
2348
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -2623,7 +2653,7 @@ export declare const ReplayExecutionResult: Schema.Struct<{
2623
2653
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
2624
2654
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
2625
2655
  }>;
2626
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
2656
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
2627
2657
  readonly sequence: Schema.Int;
2628
2658
  readonly cursor: Schema.String;
2629
2659
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -79,6 +79,11 @@ export declare const LocalAgentTarget: Schema.Struct<{
79
79
  readonly [x: string]: Schema.Json;
80
80
  };
81
81
  readonly instructions?: string;
82
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
83
+ readonly context_window: Schema.Number;
84
+ readonly reserve_tokens: Schema.Number;
85
+ readonly keep_recent_tokens: Schema.Number;
86
+ }, "Encoded">;
82
87
  readonly output_schema_ref?: string;
83
88
  readonly skill_definition_ids?: readonly string[];
84
89
  readonly permission_rules?: {
@@ -111,6 +116,11 @@ export declare const LocalAgentTarget: Schema.Struct<{
111
116
  };
112
117
  };
113
118
  readonly instructions?: string;
119
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
120
+ readonly context_window: Schema.Number;
121
+ readonly reserve_tokens: Schema.Number;
122
+ readonly keep_recent_tokens: Schema.Number;
123
+ }, "Encoded">;
114
124
  readonly tool_names?: readonly string[];
115
125
  readonly workspace_policy?: {
116
126
  readonly mode: "share" | "fork";
@@ -1,6 +1,6 @@
1
1
  import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
2
2
  import { AgentChatRepository } from "../../store-sql/portable";
3
- import { Context, Effect, Layer, Schema } from "effect";
3
+ import { Cause, Context, Effect, Layer, Schema } from "effect";
4
4
  import { Tool as AiTool } from "effect/unstable/ai";
5
5
  import type { DispatchInput } from "../child/spawn-child-run-tool";
6
6
  import { Service as EventLogService } from "../execution/event-log-service";
@@ -9,11 +9,10 @@ import { Service as ModelCallPolicyService } from "../model/model-call-policy";
9
9
  import { Service as SchemaRegistryService } from "../schema-registry/schema-registry-service";
10
10
  import { Service as ToolRuntimeService } from "../tool/tool-runtime-service";
11
11
  import { Service as PromptAssemblerService } from "./prompt-assembler-service";
12
- import type { Options } from "./relay-compaction";
13
12
  declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
14
13
  readonly message: Schema.String;
15
14
  readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
16
- }>, import("effect/Cause").YieldableError>;
15
+ }>, Cause.YieldableError>;
17
16
  export declare class AgentLoopError extends AgentLoopError_base {
18
17
  }
19
18
  declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested, Schema.TaggedStruct<"AgentLoopWaitRequested", {
@@ -29,14 +28,14 @@ declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested,
29
28
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
30
29
  }>;
31
30
  readonly next_event_sequence: Schema.Int;
32
- }>, import("effect/Cause").YieldableError>;
31
+ }>, Cause.YieldableError>;
33
32
  export declare class AgentLoopWaitRequested extends AgentLoopWaitRequested_base {
34
33
  }
35
34
  declare const AgentLoopBudgetExceeded_base: Schema.Class<AgentLoopBudgetExceeded, Schema.TaggedStruct<"AgentLoopBudgetExceeded", {
36
35
  readonly tokens_used: Schema.Int;
37
36
  readonly token_budget: Schema.Int;
38
37
  readonly next_event_sequence: Schema.Int;
39
- }>, import("effect/Cause").YieldableError>;
38
+ }>, Cause.YieldableError>;
40
39
  export declare class AgentLoopBudgetExceeded extends AgentLoopBudgetExceeded_base {
41
40
  }
42
41
  export interface RunInput {
@@ -54,7 +53,6 @@ export interface RunInput {
54
53
  readonly completedAt: number;
55
54
  readonly steeringEnabled?: boolean;
56
55
  readonly toolOutputMaxBytes?: number | null;
57
- readonly compaction?: Options | null;
58
56
  readonly sessionEntryScope?: string;
59
57
  readonly dispatchChildRun?: (input: DispatchInput) => Effect.Effect<void, unknown, any>;
60
58
  }
@@ -29,6 +29,7 @@ export declare class ChildRunModelMissing extends ChildRunModelMissing_base {
29
29
  export interface AgentContext {
30
30
  readonly instructions?: string;
31
31
  readonly model?: Agent.ModelSelection;
32
+ readonly compactionPolicy?: Agent.CompactionPolicy;
32
33
  readonly toolNames: ReadonlyArray<string>;
33
34
  readonly permissions: ReadonlyArray<string>;
34
35
  readonly outputSchemaRef?: string;
@@ -37,6 +38,7 @@ export interface AgentContext {
37
38
  export interface ChildRunOverride {
38
39
  readonly instructions?: string;
39
40
  readonly model?: Agent.ModelSelection;
41
+ readonly compactionPolicy?: Agent.CompactionPolicy;
40
42
  readonly toolNames?: ReadonlyArray<string>;
41
43
  readonly permissions?: ReadonlyArray<string>;
42
44
  readonly workspacePolicy?: Agent.ChildRunWorkspacePolicy;
@@ -74,6 +76,7 @@ export declare class Service extends Service_base {
74
76
  export interface ResolvedChildContext {
75
77
  readonly instructions?: string;
76
78
  readonly model?: Agent.ModelSelection;
79
+ readonly compactionPolicy?: Agent.CompactionPolicy;
77
80
  readonly toolNames: ReadonlyArray<string>;
78
81
  readonly permissions: ReadonlyArray<string>;
79
82
  readonly workspacePolicy?: Agent.ChildRunWorkspacePolicy;
@@ -16,6 +16,11 @@ export declare const Input: Schema.Struct<{
16
16
  readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
17
17
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
18
18
  }>>;
19
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
20
+ readonly context_window: Schema.Number;
21
+ readonly reserve_tokens: Schema.Number;
22
+ readonly keep_recent_tokens: Schema.Number;
23
+ }>>;
19
24
  readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
20
25
  readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
21
26
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
@@ -103,6 +103,11 @@ export declare const StartInput: Schema.Struct<{
103
103
  readonly [x: string]: Schema.Json;
104
104
  };
105
105
  readonly instructions?: string;
106
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
107
+ readonly context_window: Schema.Number;
108
+ readonly reserve_tokens: Schema.Number;
109
+ readonly keep_recent_tokens: Schema.Number;
110
+ }, "Encoded">;
106
111
  readonly output_schema_ref?: string;
107
112
  readonly skill_definition_ids?: readonly string[];
108
113
  readonly permission_rules?: {
@@ -135,6 +140,11 @@ export declare const StartInput: Schema.Struct<{
135
140
  };
136
141
  };
137
142
  readonly instructions?: string;
143
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
144
+ readonly context_window: Schema.Number;
145
+ readonly reserve_tokens: Schema.Number;
146
+ readonly keep_recent_tokens: Schema.Number;
147
+ }, "Encoded">;
138
148
  readonly tool_names?: readonly string[];
139
149
  readonly workspace_policy?: {
140
150
  readonly mode: "share" | "fork";
@@ -361,6 +371,11 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
361
371
  readonly [x: string]: Schema.Json;
362
372
  };
363
373
  readonly instructions?: string;
374
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
375
+ readonly context_window: Schema.Number;
376
+ readonly reserve_tokens: Schema.Number;
377
+ readonly keep_recent_tokens: Schema.Number;
378
+ }, "Encoded">;
364
379
  readonly output_schema_ref?: string;
365
380
  readonly skill_definition_ids?: readonly string[];
366
381
  readonly permission_rules?: {
@@ -393,6 +408,11 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
393
408
  };
394
409
  };
395
410
  readonly instructions?: string;
411
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
412
+ readonly context_window: Schema.Number;
413
+ readonly reserve_tokens: Schema.Number;
414
+ readonly keep_recent_tokens: Schema.Number;
415
+ }, "Encoded">;
396
416
  readonly tool_names?: readonly string[];
397
417
  readonly workspace_policy?: {
398
418
  readonly mode: "share" | "fork";
@@ -13,6 +13,13 @@ export declare const ModelSelection: Schema.Struct<{
13
13
  }>;
14
14
  export interface ModelSelection extends Schema.Schema.Type<typeof ModelSelection> {
15
15
  }
16
+ export declare const CompactionPolicy: Schema.Struct<{
17
+ readonly context_window: Schema.Number;
18
+ readonly reserve_tokens: Schema.Number;
19
+ readonly keep_recent_tokens: Schema.Number;
20
+ }>;
21
+ export interface CompactionPolicy extends Schema.Schema.Type<typeof CompactionPolicy> {
22
+ }
16
23
  export declare const ChildRunWorkspacePolicy: Schema.Struct<{
17
24
  readonly mode: Schema.Literals<readonly ["share", "fork"]>;
18
25
  readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
@@ -28,6 +35,11 @@ export declare const ChildRunPreset: Schema.Struct<{
28
35
  readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
29
36
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
30
37
  }>>;
38
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
39
+ readonly context_window: Schema.Number;
40
+ readonly reserve_tokens: Schema.Number;
41
+ readonly keep_recent_tokens: Schema.Number;
42
+ }>>;
31
43
  readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
32
44
  readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
33
45
  readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
@@ -114,6 +126,11 @@ declare const DefinitionSchema: Schema.Struct<{
114
126
  readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
115
127
  }>>;
116
128
  readonly turn_policy: Schema.optionalKey<Schema.Codec<TurnPolicySnapshot, TurnPolicySnapshot, never, never>>;
129
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
130
+ readonly context_window: Schema.Number;
131
+ readonly reserve_tokens: Schema.Number;
132
+ readonly keep_recent_tokens: Schema.Number;
133
+ }>>;
117
134
  readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
118
135
  readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
119
136
  readonly token_budget: Schema.optionalKey<Schema.Int>;
@@ -126,6 +143,11 @@ declare const DefinitionSchema: Schema.Struct<{
126
143
  readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
127
144
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
128
145
  }>>;
146
+ readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
147
+ readonly context_window: Schema.Number;
148
+ readonly reserve_tokens: Schema.Number;
149
+ readonly keep_recent_tokens: Schema.Number;
150
+ }>>;
129
151
  readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
130
152
  readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
131
153
  readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
@@ -160,6 +182,7 @@ export interface DefineInput {
160
182
  readonly skill_definition_ids?: ReadonlyArray<SkillDefinitionId>;
161
183
  readonly permission_rules?: PermissionRuleset;
162
184
  readonly turn_policy?: TurnPolicySnapshot;
185
+ readonly compaction_policy?: CompactionPolicy;
163
186
  readonly max_tool_turns?: number;
164
187
  readonly max_wait_turns?: number;
165
188
  readonly token_budget?: number;
@@ -199,6 +222,11 @@ export declare const DefinitionRecord: Schema.Struct<{
199
222
  readonly [x: string]: Schema.Json;
200
223
  };
201
224
  readonly instructions?: string;
225
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
226
+ readonly context_window: Schema.Number;
227
+ readonly reserve_tokens: Schema.Number;
228
+ readonly keep_recent_tokens: Schema.Number;
229
+ }, "Encoded">;
202
230
  readonly output_schema_ref?: string;
203
231
  readonly skill_definition_ids?: readonly string[];
204
232
  readonly permission_rules?: {
@@ -231,6 +259,11 @@ export declare const DefinitionRecord: Schema.Struct<{
231
259
  };
232
260
  };
233
261
  readonly instructions?: string;
262
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
263
+ readonly context_window: Schema.Number;
264
+ readonly reserve_tokens: Schema.Number;
265
+ readonly keep_recent_tokens: Schema.Number;
266
+ }, "Encoded">;
234
267
  readonly tool_names?: readonly string[];
235
268
  readonly workspace_policy?: {
236
269
  readonly mode: "share" | "fork";
@@ -280,6 +313,11 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
280
313
  readonly [x: string]: Schema.Json;
281
314
  };
282
315
  readonly instructions?: string;
316
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
317
+ readonly context_window: Schema.Number;
318
+ readonly reserve_tokens: Schema.Number;
319
+ readonly keep_recent_tokens: Schema.Number;
320
+ }, "Encoded">;
283
321
  readonly output_schema_ref?: string;
284
322
  readonly skill_definition_ids?: readonly string[];
285
323
  readonly permission_rules?: {
@@ -312,6 +350,11 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
312
350
  };
313
351
  };
314
352
  readonly instructions?: string;
353
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
354
+ readonly context_window: Schema.Number;
355
+ readonly reserve_tokens: Schema.Number;
356
+ readonly keep_recent_tokens: Schema.Number;
357
+ }, "Encoded">;
315
358
  readonly tool_names?: readonly string[];
316
359
  readonly workspace_policy?: {
317
360
  readonly mode: "share" | "fork";
@@ -359,6 +402,11 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
359
402
  readonly [x: string]: Schema.Json;
360
403
  };
361
404
  readonly instructions?: string;
405
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
406
+ readonly context_window: Schema.Number;
407
+ readonly reserve_tokens: Schema.Number;
408
+ readonly keep_recent_tokens: Schema.Number;
409
+ }, "Encoded">;
362
410
  readonly output_schema_ref?: string;
363
411
  readonly skill_definition_ids?: readonly string[];
364
412
  readonly permission_rules?: {
@@ -391,6 +439,11 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
391
439
  };
392
440
  };
393
441
  readonly instructions?: string;
442
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
443
+ readonly context_window: Schema.Number;
444
+ readonly reserve_tokens: Schema.Number;
445
+ readonly keep_recent_tokens: Schema.Number;
446
+ }, "Encoded">;
394
447
  readonly tool_names?: readonly string[];
395
448
  readonly workspace_policy?: {
396
449
  readonly mode: "share" | "fork";
@@ -438,6 +491,11 @@ export declare const DefinitionRegistered: Schema.Struct<{
438
491
  readonly [x: string]: Schema.Json;
439
492
  };
440
493
  readonly instructions?: string;
494
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
495
+ readonly context_window: Schema.Number;
496
+ readonly reserve_tokens: Schema.Number;
497
+ readonly keep_recent_tokens: Schema.Number;
498
+ }, "Encoded">;
441
499
  readonly output_schema_ref?: string;
442
500
  readonly skill_definition_ids?: readonly string[];
443
501
  readonly permission_rules?: {
@@ -470,6 +528,11 @@ export declare const DefinitionRegistered: Schema.Struct<{
470
528
  };
471
529
  };
472
530
  readonly instructions?: string;
531
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
532
+ readonly context_window: Schema.Number;
533
+ readonly reserve_tokens: Schema.Number;
534
+ readonly keep_recent_tokens: Schema.Number;
535
+ }, "Encoded">;
473
536
  readonly tool_names?: readonly string[];
474
537
  readonly workspace_policy?: {
475
538
  readonly mode: "share" | "fork";
@@ -521,6 +584,11 @@ export declare const DefinitionList: Schema.Struct<{
521
584
  readonly [x: string]: Schema.Json;
522
585
  };
523
586
  readonly instructions?: string;
587
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
588
+ readonly context_window: Schema.Number;
589
+ readonly reserve_tokens: Schema.Number;
590
+ readonly keep_recent_tokens: Schema.Number;
591
+ }, "Encoded">;
524
592
  readonly output_schema_ref?: string;
525
593
  readonly skill_definition_ids?: readonly string[];
526
594
  readonly permission_rules?: {
@@ -553,6 +621,11 @@ export declare const DefinitionList: Schema.Struct<{
553
621
  };
554
622
  };
555
623
  readonly instructions?: string;
624
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
625
+ readonly context_window: Schema.Number;
626
+ readonly reserve_tokens: Schema.Number;
627
+ readonly keep_recent_tokens: Schema.Number;
628
+ }, "Encoded">;
556
629
  readonly tool_names?: readonly string[];
557
630
  readonly workspace_policy?: {
558
631
  readonly mode: "share" | "fork";
@@ -604,6 +677,11 @@ export declare const DefinitionRevisionList: Schema.Struct<{
604
677
  readonly [x: string]: Schema.Json;
605
678
  };
606
679
  readonly instructions?: string;
680
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
681
+ readonly context_window: Schema.Number;
682
+ readonly reserve_tokens: Schema.Number;
683
+ readonly keep_recent_tokens: Schema.Number;
684
+ }, "Encoded">;
607
685
  readonly output_schema_ref?: string;
608
686
  readonly skill_definition_ids?: readonly string[];
609
687
  readonly permission_rules?: {
@@ -636,6 +714,11 @@ export declare const DefinitionRevisionList: Schema.Struct<{
636
714
  };
637
715
  };
638
716
  readonly instructions?: string;
717
+ readonly compaction_policy?: Schema.Struct.ReadonlySide<{
718
+ readonly context_window: Schema.Number;
719
+ readonly reserve_tokens: Schema.Number;
720
+ readonly keep_recent_tokens: Schema.Number;
721
+ }, "Encoded">;
639
722
  readonly tool_names?: readonly string[];
640
723
  readonly workspace_policy?: {
641
724
  readonly mode: "share" | "fork";