@relayfx/sdk 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import {
4
4
  Service,
5
5
  Service1 as Service2,
6
6
  StateVersionConflict
7
- } from "./index-3w6txjtg.js";
7
+ } from "./index-fh2ftte9.js";
8
8
  import"./index-nb39b5ae.js";
9
9
 
10
10
  // src/http-server.ts
@@ -46,7 +46,7 @@ import {
46
46
  exports_workflow_schema,
47
47
  exports_workspace_schema,
48
48
  followExecutionFrom
49
- } from "./index-3w6txjtg.js";
49
+ } from "./index-fh2ftte9.js";
50
50
  import {
51
51
  __export
52
52
  } from "./index-nb39b5ae.js";
@@ -10887,12 +10887,6 @@ var makeService = (initialTools) => Effect55.gen(function* () {
10887
10887
  yield* input.onRequested;
10888
10888
  }),
10889
10889
  run: Effect55.fn("ToolRuntime.run")(function* (input) {
10890
- let settlementSequence;
10891
- const beginSettlement = Effect55.suspend(() => {
10892
- if (settlementSequence !== undefined)
10893
- return Effect55.succeed(settlementSequence);
10894
- return (input.beforeSettlement ?? Effect55.succeed(input.eventSequence)).pipe(Effect55.tap((sequence) => Effect55.sync(() => settlementSequence = sequence)));
10895
- });
10896
10890
  const stored = yield* Ref12.get(tools);
10897
10891
  const registry = (input.extraTools ?? []).reduce(upsertTool, stored);
10898
10892
  const registeredTool = Chunk.findFirst(registry, sameToolName(input.call.name)).pipe(Option12.getOrUndefined);
@@ -10907,7 +10901,6 @@ var makeService = (initialTools) => Effect55.gen(function* () {
10907
10901
  yield* input.onRequested;
10908
10902
  const existingResult = yield* repository.getResult(input.executionId, input.call.id).pipe(Effect55.mapError(mapRepositoryError2));
10909
10903
  if (existingResult !== undefined) {
10910
- yield* beginSettlement;
10911
10904
  yield* repairResultEvent(eventLog, input, existingResult);
10912
10905
  return existingResult.result;
10913
10906
  }
@@ -10915,17 +10908,11 @@ var makeService = (initialTools) => Effect55.gen(function* () {
10915
10908
  if (registeredTool.definition.needs_approval === true) {
10916
10909
  const bypass = yield* hasPermissionApprovalBypass(waits, input);
10917
10910
  if (!bypass) {
10918
- const sequence = yield* beginSettlement;
10911
+ const decision = yield* resolveApproval(waits, eventLog, input);
10919
10912
  effectiveInput = {
10920
10913
  ...input,
10921
- eventSequence: sequence,
10922
- createdAt: input.createdAt + sequence - input.eventSequence
10923
- };
10924
- const decision = yield* resolveApproval(waits, eventLog, effectiveInput);
10925
- effectiveInput = {
10926
- ...effectiveInput,
10927
- eventSequence: effectiveInput.eventSequence + 1,
10928
- createdAt: effectiveInput.createdAt + 1
10914
+ eventSequence: input.eventSequence + 1,
10915
+ createdAt: input.createdAt + 1
10929
10916
  };
10930
10917
  if (decision._tag === "denied") {
10931
10918
  const deniedRecord = yield* persistReceived(repository, effectiveInput, {
@@ -10944,18 +10931,8 @@ var makeService = (initialTools) => Effect55.gen(function* () {
10944
10931
  callId: input.call.id,
10945
10932
  startedAt: effectiveInput.createdAt
10946
10933
  }).pipe(Effect55.mapError(mapRepositoryError2), Effect55.flatMap(() => finalToolResult(registeredTool, effectiveInput, call.idempotencyKey)), Effect55.catchTag("ToolExecutionFailed", (error5) => Effect55.succeed(placementFailureResult(input, error5.message))));
10947
- const record2 = yield* Effect55.uninterruptibleMask((restore) => restore(executeHandler).pipe(Effect55.flatMap((rawResult) => input.transformResult === undefined || rawResult.error !== undefined ? Effect55.succeed(rawResult) : input.transformResult(rawResult)), Effect55.flatMap((result2) => persistReceived(repository, effectiveInput, result2))));
10948
- const result = record2.result;
10949
- if (effectiveInput === input) {
10950
- const sequence = yield* beginSettlement;
10951
- effectiveInput = {
10952
- ...input,
10953
- eventSequence: sequence,
10954
- createdAt: input.createdAt + sequence - input.eventSequence
10955
- };
10956
- }
10957
- const received = yield* recordReceived(eventLog, effectiveInput, record2);
10958
- yield* recordToolCall(input.call.name, result.error === undefined ? "success" : "failure");
10934
+ const received = yield* Effect55.uninterruptibleMask((restore) => restore(executeHandler).pipe(Effect55.flatMap((rawResult) => input.transformResult === undefined || rawResult.error !== undefined ? Effect55.succeed(rawResult) : input.transformResult(rawResult)), Effect55.flatMap((result) => persistReceived(repository, effectiveInput, result)), Effect55.flatMap((record2) => recordReceived(eventLog, effectiveInput, record2))));
10935
+ yield* recordToolCall(input.call.name, received.error === undefined ? "success" : "failure");
10959
10936
  return received;
10960
10937
  }).pipe(Effect55.tapError((error5) => recordToolCall(input.call.name, error5._tag === "ToolExecutionWaitRequested" ? "wait" : error5._tag === "ToolPermissionDenied" ? "denied" : "failure")));
10961
10938
  })
@@ -15544,10 +15521,10 @@ var contentFromMessage = (message) => {
15544
15521
  return textParts;
15545
15522
  return [exports_content_schema.text(prompt.pipe(Schema81.encodeSync(Prompt5.Prompt), stringifyJson2))];
15546
15523
  };
15547
- var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
15548
- id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
15524
+ var steeringDeliveredEvent = (config, kind, drain2, messages, sequence) => ({
15525
+ id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:delivered`),
15549
15526
  execution_id: config.executionId,
15550
- type: "steering.received",
15527
+ type: "steering.delivered",
15551
15528
  sequence,
15552
15529
  cursor: `${config.executionId}:steering:${kind}:${drain2.drainId}`,
15553
15530
  content: messages.flatMap((message) => message.content),
@@ -15570,7 +15547,7 @@ var drain2 = Effect89.fn("RelaySteering.drain")(function* (config, kind, mode) {
15570
15547
  consumedAt: createdAt,
15571
15548
  createdAt
15572
15549
  });
15573
- yield* appendIdempotentTo(config.eventLog, steeringReceivedEvent(config, kind, result.drain, result.messages, sequence));
15550
+ yield* appendIdempotentTo(config.eventLog, steeringDeliveredEvent(config, kind, result.drain, result.messages, sequence));
15574
15551
  return result.messages.map((message) => ({ prompt: promptForContent(message.content) }));
15575
15552
  });
15576
15553
  var append4 = (config, kind, message) => Clock16.currentTimeMillis.pipe(Effect89.flatMap((createdAt) => config.repository.append({
@@ -15616,15 +15593,6 @@ var boundResult = (config, result) => {
15616
15593
  return exports_tool_output.bound({ _tag: "Success", result: result.output, encodedResult: result.output }, { toolCallId: result.call_id, maxBytes: config.toolOutputMaxBytes }).pipe(Effect90.map((bounded) => ({ ...result, output: jsonValue5(bounded.encodedResult) })));
15617
15594
  };
15618
15595
  var batchKey = (request) => `${request.turn}:${request.toolCallBatch.calls.map((call) => call.id).join(":")}`;
15619
- var gateKey = (turn, toolCallIndex) => `${turn}:${toolCallIndex}`;
15620
- var gateFor = (gates, key4) => {
15621
- const existing = gates.get(key4);
15622
- if (existing !== undefined)
15623
- return existing;
15624
- const created = Deferred3.makeUnsafe();
15625
- gates.set(key4, created);
15626
- return created;
15627
- };
15628
15596
  var callFrom = (call) => ({
15629
15597
  id: exports_ids_schema.ToolCallId.make(call.id),
15630
15598
  name: call.name,
@@ -15640,13 +15608,6 @@ var frameworkFailure = (call, error5) => {
15640
15608
  };
15641
15609
  var make9 = (config) => Effect90.sync(() => {
15642
15610
  const prepared = new Map;
15643
- const settled = new Map;
15644
- const awaitPrevious = (gates, request) => {
15645
- if (request.toolCallIndex === 0 || config.resumedToolCallId === request.call.id)
15646
- return Effect90.void;
15647
- return Deferred3.await(gateFor(gates, gateKey(request.turn, request.toolCallIndex - 1)));
15648
- };
15649
- const completeSettlement = (request) => Deferred3.succeed(gateFor(settled, gateKey(request.turn, request.toolCallIndex)), undefined).pipe(Effect90.asVoid);
15650
15611
  return exports_tool_executor.ToolExecutor.of({
15651
15612
  execute: (request) => {
15652
15613
  const key4 = batchKey(request);
@@ -15674,12 +15635,6 @@ var make9 = (config) => Effect90.sync(() => {
15674
15635
  }).pipe(Effect90.exit, Effect90.flatMap((exit) => Deferred3.done(preparation, exit)), Effect90.andThen(Deferred3.await(preparation)), Effect90.uninterruptible) : Deferred3.await(preparation);
15675
15636
  return Effect90.gen(function* () {
15676
15637
  yield* prepareBatch;
15677
- let settlementSequence;
15678
- const beginSettlement = Effect90.suspend(() => {
15679
- if (settlementSequence !== undefined)
15680
- return Effect90.succeed(settlementSequence);
15681
- return awaitPrevious(settled, request).pipe(Effect90.andThen(config.allocator.current), Effect90.map((sequence) => sequence - 1), Effect90.tap((sequence) => Effect90.sync(() => settlementSequence = sequence)));
15682
- });
15683
15638
  const first = yield* config.allocator.current;
15684
15639
  const call = callFrom(request.call);
15685
15640
  const existingRequest = yield* hasRequestedEvent(config, call.id);
@@ -15691,13 +15646,12 @@ var make9 = (config) => Effect90.sync(() => {
15691
15646
  eventSequence,
15692
15647
  createdAt: config.startedAt + eventSequence - config.eventSequence,
15693
15648
  ...config.extraTools === undefined ? {} : { extraTools: config.extraTools },
15694
- beforeSettlement: beginSettlement,
15695
15649
  transformResult: (result) => boundResult(config, result)
15696
15650
  }).pipe(Effect90.flatMap((result) => nextLoggedSequence2(config.eventLog, config.executionId, existingRequest ? first + 1 : first + 2).pipe(Effect90.flatMap(config.allocator.advanceTo), Effect90.as(result.error === undefined ? { _tag: "Success", result: result.output, encodedResult: result.output } : {
15697
15651
  _tag: "DomainFailure",
15698
15652
  failure: result.error,
15699
15653
  encodedFailure: result.error
15700
- }))), Effect90.catch((error5) => beginSettlement.pipe(Effect90.asVoid, Effect90.andThen(nextLoggedSequence2(config.eventLog, config.executionId, first)), Effect90.flatMap(config.allocator.advanceTo), Effect90.flatMap(() => {
15654
+ }))), Effect90.catch((error5) => nextLoggedSequence2(config.eventLog, config.executionId, first).pipe(Effect90.flatMap(config.allocator.advanceTo), Effect90.flatMap(() => {
15701
15655
  if (error5._tag === "ToolExecutionWaitRequested") {
15702
15656
  return Effect90.succeed({ _tag: "Suspend", token: error5.wait_id });
15703
15657
  }
@@ -15706,7 +15660,7 @@ var make9 = (config) => Effect90.sync(() => {
15706
15660
  return Effect90.succeed({ _tag: "DomainFailure", failure: failure2, encodedFailure: failure2 });
15707
15661
  }
15708
15662
  return Effect90.fail(frameworkFailure(call, error5));
15709
- }))), Effect90.tap((outcome) => outcome._tag === "Suspend" ? Effect90.void : completeSettlement(request)), Effect90.onInterrupt(() => completeSettlement(request)));
15663
+ }))));
15710
15664
  });
15711
15665
  }
15712
15666
  });
@@ -16466,7 +16420,6 @@ var make12 = (layerOptions) => Effect93.gen(function* () {
16466
16420
  startedAt: input.startedAt,
16467
16421
  eventSequence: input.eventSequence,
16468
16422
  ...toolOutputMaxBytes === undefined ? {} : { toolOutputMaxBytes },
16469
- ...resumeToolCall === undefined ? {} : { resumedToolCallId: resumeToolCall.id },
16470
16423
  ...allCoreTools.length === 0 ? {} : { extraTools: allCoreTools }
16471
16424
  });
16472
16425
  const activeBlobStore = toolOutputMaxBytes === undefined || Option24.isNone(blobStore) ? undefined : blobStore.value;
@@ -18898,7 +18851,16 @@ var layerFromRuntime3 = Layer84.effect(Service, Effect109.gen(function* () {
18898
18851
  content: input.content,
18899
18852
  createdAt: input.created_at
18900
18853
  }).pipe(Effect109.mapError(toClientError));
18901
- return { execution_id: record2.executionId, kind: record2.kind, sequence: record2.sequence };
18854
+ return {
18855
+ execution_id: record2.executionId,
18856
+ kind: record2.kind,
18857
+ sequence: record2.sequence,
18858
+ steering_message_id: exports_execution_schema.steeringMessageId({
18859
+ execution_id: record2.executionId,
18860
+ kind: record2.kind,
18861
+ sequence: record2.sequence
18862
+ })
18863
+ };
18902
18864
  }),
18903
18865
  getExecution: getExecutionOperation,
18904
18866
  inspectExecution: inspectExecutionOperation,
@@ -59,6 +59,7 @@ __export2(exports_ids_schema, {
59
59
  ToolAttemptId: () => ToolAttemptId,
60
60
  TenantId: () => TenantId,
61
61
  SystemTenantId: () => SystemTenantId,
62
+ SteeringMessageId: () => SteeringMessageId,
62
63
  SnapshotRef: () => SnapshotRef,
63
64
  SkillDefinitionId: () => SkillDefinitionId,
64
65
  SessionId: () => SessionId,
@@ -110,6 +111,7 @@ var ToolAttemptId = id("Relay.ToolAttemptId");
110
111
  var WaitId = id("Relay.WaitId");
111
112
  var ScheduleId = id("Relay.ScheduleId");
112
113
  var EventId = id("Relay.EventId");
114
+ var SteeringMessageId = id("Relay.SteeringMessageId");
113
115
  var exports_shared_schema = {};
114
116
  __export2(exports_shared_schema, {
115
117
  canonicalValue: () => canonicalValue,
@@ -517,6 +519,7 @@ __export2(exports_child_orchestration_schema, {
517
519
  });
518
520
  var exports_execution_schema = {};
519
521
  __export2(exports_execution_schema, {
522
+ steeringMessageId: () => steeringMessageId,
520
523
  childSessionId: () => childSessionId,
521
524
  SpawnChildRunInput: () => SpawnChildRunInput,
522
525
  ExecutionStatus: () => ExecutionStatus,
@@ -659,6 +662,7 @@ var ChildRunAccepted = Schema7.Struct({
659
662
  execution_id: ExecutionId
660
663
  }).annotate({ identifier: "Relay.ChildRunAccepted" });
661
664
  var childSessionId = (childExecutionId) => SessionId.make(`session:child:${childExecutionId}`);
665
+ var steeringMessageId = (input) => SteeringMessageId.make(`steering:${input.execution_id}:${input.kind}:${input.sequence}`);
662
666
  var ExecutionEventType = Schema7.Literals([
663
667
  "execution.accepted",
664
668
  "execution.started",
@@ -679,7 +683,7 @@ var ExecutionEventType = Schema7.Literals([
679
683
  "tool.approval.resolved",
680
684
  "permission.ask.requested",
681
685
  "permission.ask.resolved",
682
- "steering.received",
686
+ "steering.delivered",
683
687
  "state.updated",
684
688
  "state.deleted",
685
689
  "inbox.enqueued",
@@ -1928,7 +1932,8 @@ var SteerInput = Schema22.Struct({
1928
1932
  var SteerAccepted = Schema22.Struct({
1929
1933
  execution_id: exports_ids_schema.ExecutionId,
1930
1934
  kind: SteeringKind,
1931
- sequence: Schema22.Int.check(Schema22.isGreaterThanOrEqualTo(0))
1935
+ sequence: Schema22.Int.check(Schema22.isGreaterThanOrEqualTo(0)),
1936
+ steering_message_id: exports_ids_schema.SteeringMessageId
1932
1937
  }).annotate({ identifier: "Relay.Operation.SteerAccepted" });
1933
1938
  var WakeInput = Schema22.Struct({
1934
1939
  wait_id: exports_ids_schema.WaitId,
@@ -8,7 +8,7 @@ import {
8
8
  SqlFailure,
9
9
  make,
10
10
  normalizeAcquisitionCause
11
- } from "./index-p2d0xyat.js";
11
+ } from "./index-8asvg7x0.js";
12
12
 
13
13
  // src/migration-errors.ts
14
14
  import { Cause, Effect, Function } from "effect";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  exports_tool_runtime,
15
15
  exports_workflow_definition_host,
16
16
  makeDatabaseIdentity
17
- } from "./index-p2d0xyat.js";
17
+ } from "./index-8asvg7x0.js";
18
18
  import {
19
19
  exports_model_registry
20
20
  } from "./index-x32kbvxv.js";
@@ -46,7 +46,7 @@ import {
46
46
  exports_wait_schema,
47
47
  exports_workflow_schema,
48
48
  followExecutionFrom
49
- } from "./index-3w6txjtg.js";
49
+ } from "./index-fh2ftte9.js";
50
50
  import {
51
51
  __export
52
52
  } from "./index-nb39b5ae.js";
@@ -144,7 +144,7 @@ var runOnce = Effect2.fn("ToolWorker.runOnce")(function* (options) {
144
144
  });
145
145
  var run = Effect2.fn("ToolWorker.run")(function* (options) {
146
146
  const pollInterval = Duration.fromInputUnsafe(options.pollInterval ?? "1 second");
147
- return yield* runOnce(options).pipe(Effect2.flatMap((worked) => worked ? Effect2.void : Effect2.sleep(pollInterval)), Effect2.forever);
147
+ return yield* runOnce(options).pipe(Effect2.catch((error) => Effect2.logWarning("relay tool worker poll failed", { message: error.message }).pipe(Effect2.as(false))), Effect2.flatMap((worked) => worked ? Effect2.void : Effect2.sleep(pollInterval)), Effect2.forever);
148
148
  });
149
149
 
150
150
  // src/language-model-registration.ts
@@ -0,0 +1,3 @@
1
+ UPDATE "relay_execution_events"
2
+ SET "type" = 'steering.delivered', "id" = replace("id", ':received', ':delivered')
3
+ WHERE "type" = 'steering.received';
@@ -0,0 +1,3 @@
1
+ UPDATE relay_execution_events
2
+ SET type = 'steering.delivered', id = replace(id, ':received', ':delivered')
3
+ WHERE type = 'steering.received';
@@ -0,0 +1,3 @@
1
+ UPDATE "relay_execution_events"
2
+ SET "type" = 'steering.delivered', "id" = replace("id", ':received', ':delivered')
3
+ WHERE "type" = 'steering.received';
@@ -0,0 +1,3 @@
1
+ UPDATE relay_execution_events
2
+ SET type = 'steering.delivered', id = replace(id, ':received', ':delivered')
3
+ WHERE type = 'steering.received';
package/dist/mysql.js CHANGED
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  database,
4
4
  normalizeMigrationCause
5
- } from "./index-vthtj624.js";
5
+ } from "./index-h1cf8za4.js";
6
6
  import {
7
7
  MigratorError,
8
8
  RuntimeMigrationError,
9
9
  SqlFailure
10
- } from "./index-p2d0xyat.js";
10
+ } from "./index-8asvg7x0.js";
11
11
  import"./index-x32kbvxv.js";
12
- import"./index-3w6txjtg.js";
12
+ import"./index-fh2ftte9.js";
13
13
  import"./index-nb39b5ae.js";
14
14
 
15
15
  // src/mysql.ts
@@ -83,6 +83,12 @@ RENAME TABLE relay_entity_instances TO relay_resident_instances;
83
83
  ALTER TABLE relay_resident_instances RENAME INDEX idx_relay_entity_instances_kind_status TO idx_relay_resident_instances_kind_status;
84
84
  `;
85
85
 
86
+ // ../../migrations/mysql/0013_steering_delivered.sql
87
+ var _0013_steering_delivered_default = `UPDATE relay_execution_events
88
+ SET type = 'steering.delivered', id = replace(id, ':received', ':delivered')
89
+ WHERE type = 'steering.received';
90
+ `;
91
+
86
92
  // src/mysql-migrations.ts
87
93
  var migrations = [
88
94
  [1, "baseline", _0001_baseline_default],
@@ -96,7 +102,8 @@ var migrations = [
96
102
  [9, "workflow_definitions", _0009_workflow_definitions_default],
97
103
  [10, "workflow_runtime", _0010_workflow_runtime_default],
98
104
  [11, "execution_scoped_tool_calls", _0011_execution_scoped_tool_calls_default],
99
- [12, "rename_entity_to_resident", _0012_rename_entity_to_resident_default]
105
+ [12, "rename_entity_to_resident", _0012_rename_entity_to_resident_default],
106
+ [13, "steering_delivered", _0013_steering_delivered_default]
100
107
  ];
101
108
 
102
109
  // src/mysql.ts
package/dist/postgres.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  database,
4
4
  normalizeMigrationCause
5
- } from "./index-vthtj624.js";
5
+ } from "./index-h1cf8za4.js";
6
6
  import {
7
7
  Dialect,
8
8
  RuntimeMigrationError,
@@ -14,11 +14,11 @@ import {
14
14
  fromDbTimestamp,
15
15
  fromNullableDbTimestamp,
16
16
  timestampParam
17
- } from "./index-p2d0xyat.js";
17
+ } from "./index-8asvg7x0.js";
18
18
  import"./index-x32kbvxv.js";
19
19
  import {
20
20
  exports_ids_schema
21
- } from "./index-3w6txjtg.js";
21
+ } from "./index-fh2ftte9.js";
22
22
  import {
23
23
  __export
24
24
  } from "./index-nb39b5ae.js";
@@ -745,7 +745,7 @@ var relayIdempotencyKeys = pgTable13("relay_idempotency_keys", {
745
745
  uniqueIndex9("uq_relay_idempotency_scope_operation_key").on(table.tenantId, table.scope, table.operation, table.key)
746
746
  ]);
747
747
  // src/postgres.ts
748
- var schemaHead = "20260719120000_rename_entity_to_resident";
748
+ var schemaHead = "20260721120000_steering_delivered";
749
749
  var migrationNames = [
750
750
  "20260701002839_sour_cerebro",
751
751
  "20260701041134_acoustic_hulk",
@@ -773,6 +773,7 @@ var migrationNames = [
773
773
  "20260712190000_workflow_definitions",
774
774
  "20260712200000_workflow_runtime",
775
775
  "20260718140000_execution_scoped_tool_calls",
776
+ "20260719120000_rename_entity_to_resident",
776
777
  schemaHead
777
778
  ];
778
779
  var migrationsFolderUrl = import.meta.url.endsWith("/src/postgres.ts") ? new URL("../../../migrations/pg", import.meta.url) : new URL("./migrations/pg", import.meta.url);
package/dist/sqlite.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  database,
4
4
  normalizeMigrationCause
5
- } from "./index-vthtj624.js";
5
+ } from "./index-h1cf8za4.js";
6
6
  import {
7
7
  DatabaseAlreadyOwned,
8
8
  RuntimeConfigurationError,
@@ -12,9 +12,9 @@ import {
12
12
  make,
13
13
  makeDatabaseIdentity,
14
14
  runtimeLayer
15
- } from "./index-p2d0xyat.js";
15
+ } from "./index-8asvg7x0.js";
16
16
  import"./index-x32kbvxv.js";
17
- import"./index-3w6txjtg.js";
17
+ import"./index-fh2ftte9.js";
18
18
  import"./index-nb39b5ae.js";
19
19
 
20
20
  // src/sqlite-runtime.ts
@@ -668,6 +668,12 @@ DROP INDEX idx_relay_entity_instances_kind_status;
668
668
  CREATE INDEX idx_relay_resident_instances_kind_status ON relay_resident_instances (tenant_id, kind, status);
669
669
  `;
670
670
 
671
+ // ../../migrations/sqlite/0013_steering_delivered.sql
672
+ var _0013_steering_delivered_default = `UPDATE relay_execution_events
673
+ SET type = 'steering.delivered', id = replace(id, ':received', ':delivered')
674
+ WHERE type = 'steering.received';
675
+ `;
676
+
671
677
  // src/sqlite-migrations.ts
672
678
  import { Effect } from "effect";
673
679
  import { SqlClient } from "effect/unstable/sql/SqlClient";
@@ -690,7 +696,8 @@ var migrations = [
690
696
  { id: 9, name: "workflow_definitions", file: "0009_workflow_definitions.sql", source: _0009_workflow_definitions_default },
691
697
  { id: 10, name: "workflow_runtime", file: "0010_workflow_runtime.sql", source: _0010_workflow_runtime_default },
692
698
  { id: 11, name: "execution_scoped_tool_calls", file: "0011_execution_scoped_tool_calls.sql", source: _0011_execution_scoped_tool_calls_default },
693
- { id: 12, name: "rename_entity_to_resident", file: "0012_rename_entity_to_resident.sql", source: _0012_rename_entity_to_resident_default }
699
+ { id: 12, name: "rename_entity_to_resident", file: "0012_rename_entity_to_resident.sql", source: _0012_rename_entity_to_resident_default },
700
+ { id: 13, name: "steering_delivered", file: "0013_steering_delivered.sql", source: _0013_steering_delivered_default }
694
701
  ];
695
702
  var loader = Effect.succeed(migrations.map(({ id, name, source }) => [id, name, Effect.succeed(execute(source))]));
696
703
 
@@ -31,7 +31,7 @@ export declare const followExecution: (input: FollowExecutionInput) => Stream.St
31
31
  readonly child_execution_id: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Relay.ChildExecutionId"> & {
32
32
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
33
33
  }>;
34
- readonly type: import("effect/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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
34
+ readonly type: import("effect/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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
35
35
  readonly sequence: import("effect/Schema").Int;
36
36
  readonly cursor: import("effect/Schema").String;
37
37
  readonly content: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
@@ -151,7 +151,7 @@ export declare const streamSession: (input: StreamSessionInput) => Stream.Stream
151
151
  readonly child_execution_id: import("effect/Schema").optionalKey<import("effect/Schema").brand<import("effect/Schema").String, "Relay.ChildExecutionId"> & {
152
152
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
153
153
  }>;
154
- readonly type: import("effect/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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
154
+ readonly type: import("effect/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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
155
155
  readonly sequence: import("effect/Schema").Int;
156
156
  readonly cursor: import("effect/Schema").String;
157
157
  readonly content: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
@@ -1 +1 @@
1
- export declare const migrations: readonly [readonly [1, "baseline", string], readonly [2, "durable_tool_placement", string], readonly [3, "durable_inbox", string], readonly [4, "execution_state", string], readonly [5, "durable_entities", string], readonly [6, "ephemeral_presence", string], readonly [7, "topic_subscriptions", string], readonly [8, "child_fan_out", string], readonly [9, "workflow_definitions", string], readonly [10, "workflow_runtime", string], readonly [11, "execution_scoped_tool_calls", string], readonly [12, "rename_entity_to_resident", string]];
1
+ export declare const migrations: readonly [readonly [1, "baseline", string], readonly [2, "durable_tool_placement", string], readonly [3, "durable_inbox", string], readonly [4, "execution_state", string], readonly [5, "durable_entities", string], readonly [6, "ephemeral_presence", string], readonly [7, "topic_subscriptions", string], readonly [8, "child_fan_out", string], readonly [9, "workflow_definitions", string], readonly [10, "workflow_runtime", string], readonly [11, "execution_scoped_tool_calls", string], readonly [12, "rename_entity_to_resident", string], readonly [13, "steering_delivered", string]];
@@ -504,6 +504,9 @@ export declare const SteerAccepted: Schema.Struct<{
504
504
  };
505
505
  readonly kind: Schema.Literals<readonly ["steering", "follow_up"]>;
506
506
  readonly sequence: Schema.Int;
507
+ readonly steering_message_id: Schema.brand<Schema.String, "Relay.SteeringMessageId"> & {
508
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SteeringMessageId">;
509
+ };
507
510
  }>;
508
511
  export interface SteerAccepted extends Schema.Schema.Type<typeof SteerAccepted> {
509
512
  }
@@ -647,7 +650,7 @@ export declare const FollowExecutionItem: Schema.Union<readonly [Schema.Struct<{
647
650
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
648
651
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
649
652
  }>;
650
- 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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
653
+ 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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
651
654
  readonly sequence: Schema.Int;
652
655
  readonly cursor: Schema.String;
653
656
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -2404,7 +2407,7 @@ export declare const SessionStreamItem: Schema.Union<readonly [Schema.TaggedStru
2404
2407
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
2405
2408
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
2406
2409
  }>;
2407
- 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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
2410
+ 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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
2408
2411
  readonly sequence: Schema.Int;
2409
2412
  readonly cursor: Schema.String;
2410
2413
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -2715,7 +2718,7 @@ export declare const ReplayExecutionResult: Schema.Struct<{
2715
2718
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
2716
2719
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
2717
2720
  }>;
2718
- 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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
2721
+ 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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
2719
2722
  readonly sequence: Schema.Int;
2720
2723
  readonly cursor: Schema.String;
2721
2724
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -2797,7 +2800,7 @@ export declare const PageExecutionEventsResult: Schema.Struct<{
2797
2800
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
2798
2801
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
2799
2802
  }>;
2800
- 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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
2803
+ 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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
2801
2804
  readonly sequence: Schema.Int;
2802
2805
  readonly cursor: Schema.String;
2803
2806
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -60,5 +60,10 @@ export declare const migrations: readonly [{
60
60
  readonly name: "rename_entity_to_resident";
61
61
  readonly file: "0012_rename_entity_to_resident.sql";
62
62
  readonly source: string;
63
+ }, {
64
+ readonly id: 13;
65
+ readonly name: "steering_delivered";
66
+ readonly file: "0013_steering_delivered.sql";
67
+ readonly source: string;
63
68
  }];
64
- export declare const loader: Effect.Effect<(readonly [1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12, "baseline" | "child_fan_out" | "durable_entities" | "durable_inbox" | "durable_tool_placement" | "ephemeral_presence" | "execution_scoped_tool_calls" | "execution_state" | "rename_entity_to_resident" | "topic_subscriptions" | "workflow_definitions" | "workflow_runtime", Effect.Effect<Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>, never, never>])[], never, never>;
69
+ export declare const loader: Effect.Effect<(readonly [1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13, "baseline" | "child_fan_out" | "durable_entities" | "durable_inbox" | "durable_tool_placement" | "ephemeral_presence" | "execution_scoped_tool_calls" | "execution_state" | "rename_entity_to_resident" | "steering_delivered" | "topic_subscriptions" | "workflow_definitions" | "workflow_runtime", Effect.Effect<Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>, never, never>])[], never, never>;
@@ -16,5 +16,5 @@ export interface Options<E = Error, R = never> {
16
16
  readonly handlers: Readonly<Record<string, Handler<E, R>>>;
17
17
  }
18
18
  export declare const runOnce: <E, R>(options: Options<E, R>) => Effect.Effect<boolean, ClientError, R | ClientService>;
19
- export declare const run: <E, R>(options: Options<E, R>) => Effect.Effect<never, ClientError, R | ClientService>;
19
+ export declare const run: <E, R>(options: Options<E, R>) => Effect.Effect<never, never, R | ClientService>;
20
20
  export type Error = ClientError;
@@ -15,7 +15,6 @@ export interface Config {
15
15
  readonly startedAt: number;
16
16
  readonly eventSequence: Execution.ExecutionEventSequence;
17
17
  readonly toolOutputMaxBytes?: number;
18
- readonly resumedToolCallId?: Ids.ToolCallId;
19
18
  readonly extraTools?: ReadonlyArray<RegisteredTool>;
20
19
  }
21
20
  export declare const make: (config: Config) => Effect.Effect<ToolExecutor.Interface>;
@@ -106,7 +106,6 @@ export interface RunInput {
106
106
  readonly createdAt: number;
107
107
  readonly extraTools?: ReadonlyArray<RegisteredTool>;
108
108
  readonly onRequested?: Effect.Effect<void>;
109
- readonly beforeSettlement?: Effect.Effect<Execution.ExecutionEventSequence>;
110
109
  readonly transformResult?: (result: Tool.Result) => Effect.Effect<Tool.Result, ToolRuntimeError>;
111
110
  }
112
111
  export type RunError = ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError;
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { Definition } from "./agent-schema";
3
- import { ChildExecutionId } from "./ids-schema";
3
+ import { ChildExecutionId, ExecutionId } from "./ids-schema";
4
4
  export declare const ExecutionStatus: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
5
5
  export type ExecutionStatus = typeof ExecutionStatus.Type;
6
6
  export declare const Execution: Schema.Struct<{
@@ -385,7 +385,12 @@ export declare const ChildRunAccepted: Schema.Struct<{
385
385
  export interface ChildRunAccepted extends Schema.Schema.Type<typeof ChildRunAccepted> {
386
386
  }
387
387
  export declare const childSessionId: (childExecutionId: ChildExecutionId) => string & import("effect/Brand").Brand<"Relay.SessionId">;
388
- export declare const ExecutionEventType: 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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
388
+ export declare const steeringMessageId: (input: {
389
+ readonly execution_id: ExecutionId;
390
+ readonly kind: "steering" | "follow_up";
391
+ readonly sequence: number;
392
+ }) => string & import("effect/Brand").Brand<"Relay.SteeringMessageId">;
393
+ export declare const ExecutionEventType: 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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
389
394
  export type ExecutionEventType = typeof ExecutionEventType.Type;
390
395
  export declare const CompactionCommittedEventData: Schema.Struct<{
391
396
  readonly checkpoint_id: Schema.brand<Schema.String, "Relay.SessionEntryId"> & {
@@ -408,7 +413,7 @@ export declare const ExecutionEvent: Schema.Struct<{
408
413
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
409
414
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
410
415
  }>;
411
- 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", "agent.compaction.committed", "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", "resident.created", "resident.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"]>;
416
+ 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", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.delivered", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "resident.created", "resident.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"]>;
412
417
  readonly sequence: Schema.Int;
413
418
  readonly cursor: Schema.String;
414
419
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -104,3 +104,7 @@ export declare const EventId: Schema.brand<Schema.String, "Relay.EventId"> & {
104
104
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
105
105
  };
106
106
  export type EventId = typeof EventId.Type;
107
+ export declare const SteeringMessageId: Schema.brand<Schema.String, "Relay.SteeringMessageId"> & {
108
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SteeringMessageId">;
109
+ };
110
+ export type SteeringMessageId = typeof SteeringMessageId.Type;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@relayfx/sdk",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "Effect-native durable execution SDK for addressable agents and tools",
6
6
  "type": "module",
7
7
  "exports": {