@relayfx/sdk 0.0.50 → 0.2.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.
Files changed (155) hide show
  1. package/README.md +5 -0
  2. package/dist/ai.js +42 -17222
  3. package/dist/index-2xztzkfr.js +20596 -0
  4. package/dist/index-bcbbm5wt.js +137 -0
  5. package/dist/index-qgt9z94q.js +2443 -0
  6. package/dist/index.js +830 -18839
  7. package/dist/migrations/20260712120000_durable_inbox/migration.sql +9 -0
  8. package/dist/migrations/20260712140000_execution_state/migration.sql +5 -0
  9. package/dist/migrations/20260712150000_durable_entities/migration.sql +15 -0
  10. package/dist/migrations/20260712160000_ephemeral_presence/migration.sql +13 -0
  11. package/dist/migrations/20260712170000_topic_subscriptions/migration.sql +3 -0
  12. package/dist/migrations/20260712180000_child_fan_out/migration.sql +27 -0
  13. package/dist/migrations/20260712190000_workflow_definitions/migration.sql +3 -0
  14. package/dist/migrations/20260712200000_workflow_runtime/migration.sql +2 -0
  15. package/dist/migrations/mysql/0003_durable_inbox.sql +3 -0
  16. package/dist/migrations/mysql/0004_execution_state.sql +3 -0
  17. package/dist/migrations/mysql/0005_durable_entities.sql +13 -0
  18. package/dist/migrations/mysql/0006_ephemeral_presence.sql +12 -0
  19. package/dist/migrations/mysql/0007_topic_subscriptions.sql +1 -0
  20. package/dist/migrations/mysql/0008_child_fan_out.sql +26 -0
  21. package/dist/migrations/mysql/0009_workflow_definitions.sql +3 -0
  22. package/dist/migrations/mysql/0010_workflow_runtime.sql +3 -0
  23. package/dist/migrations/pg/20260712120000_durable_inbox/migration.sql +9 -0
  24. package/dist/migrations/pg/20260712140000_execution_state/migration.sql +5 -0
  25. package/dist/migrations/pg/20260712150000_durable_entities/migration.sql +15 -0
  26. package/dist/migrations/pg/20260712160000_ephemeral_presence/migration.sql +13 -0
  27. package/dist/migrations/pg/20260712170000_topic_subscriptions/migration.sql +3 -0
  28. package/dist/migrations/pg/20260712180000_child_fan_out/migration.sql +27 -0
  29. package/dist/migrations/pg/20260712190000_workflow_definitions/migration.sql +3 -0
  30. package/dist/migrations/pg/20260712200000_workflow_runtime/migration.sql +2 -0
  31. package/dist/migrations/sqlite/0003_durable_inbox.sql +9 -0
  32. package/dist/migrations/sqlite/0004_execution_state.sql +3 -0
  33. package/dist/migrations/sqlite/0005_durable_entities.sql +15 -0
  34. package/dist/migrations/sqlite/0006_ephemeral_presence.sql +12 -0
  35. package/dist/migrations/sqlite/0007_topic_subscriptions.sql +3 -0
  36. package/dist/migrations/sqlite/0008_child_fan_out.sql +27 -0
  37. package/dist/migrations/sqlite/0009_workflow_definitions.sql +3 -0
  38. package/dist/migrations/sqlite/0010_workflow_runtime.sql +3 -0
  39. package/dist/sqlite.js +737 -0
  40. package/dist/types/relay/adapter-outbox.d.ts +3 -3
  41. package/dist/types/relay/client.d.ts +335 -25
  42. package/dist/types/relay/command.d.ts +41 -0
  43. package/dist/types/relay/database.d.ts +1 -0
  44. package/dist/types/relay/index.d.ts +3 -2
  45. package/dist/types/relay/operation.d.ts +1082 -7
  46. package/dist/types/relay/sqlite-migrations.d.ts +54 -0
  47. package/dist/types/relay/sqlite-runtime.d.ts +10 -0
  48. package/dist/types/relay/sqlite.d.ts +29 -0
  49. package/dist/types/runtime/address/address-book-service.d.ts +4 -4
  50. package/dist/types/runtime/address/address-resolution-service.d.ts +1 -1
  51. package/dist/types/runtime/agent/agent-loop-service.d.ts +2 -2
  52. package/dist/types/runtime/agent/agent-registry-service.d.ts +1 -1
  53. package/dist/types/runtime/agent/relay-compaction.d.ts +1 -1
  54. package/dist/types/runtime/agent/relay-permissions.d.ts +1 -1
  55. package/dist/types/runtime/agent/relay-steering.d.ts +1 -1
  56. package/dist/types/runtime/child/child-fan-out-admission-service.d.ts +30 -0
  57. package/dist/types/runtime/child/child-fan-out-runtime.d.ts +34 -0
  58. package/dist/types/runtime/child/child-fan-out-transition-service.d.ts +25 -0
  59. package/dist/types/runtime/child/child-run-service.d.ts +1 -1
  60. package/dist/types/runtime/child/parent-notifier-service.d.ts +1 -1
  61. package/dist/types/runtime/cluster/execution-entity.d.ts +5 -3
  62. package/dist/types/runtime/entity/entity-instance-service.d.ts +67 -0
  63. package/dist/types/runtime/entity/entity-registry-service.d.ts +35 -0
  64. package/dist/types/runtime/envelope/envelope-service.d.ts +7 -3
  65. package/dist/types/runtime/execution/active-execution-registry.d.ts +12 -0
  66. package/dist/types/runtime/execution/event-log-service.d.ts +1 -1
  67. package/dist/types/runtime/execution/execution-service.d.ts +2 -1
  68. package/dist/types/runtime/execution/execution-watch-service.d.ts +32 -0
  69. package/dist/types/runtime/execution/session-stream-service.d.ts +33 -0
  70. package/dist/types/runtime/inbox/inbox-service.d.ts +76 -0
  71. package/dist/types/runtime/inbox/send-message-tool.d.ts +27 -0
  72. package/dist/types/runtime/inbox/wait-for-messages-tool.d.ts +34 -0
  73. package/dist/types/runtime/index.d.ts +18 -0
  74. package/dist/types/runtime/memory/memory-service.d.ts +1 -1
  75. package/dist/types/runtime/presence/presence-service.d.ts +30 -0
  76. package/dist/types/runtime/presence/presence-tool.d.ts +20 -0
  77. package/dist/types/runtime/runner/runner-runtime-service.d.ts +18 -18
  78. package/dist/types/runtime/schedule/scheduler-service.d.ts +1 -1
  79. package/dist/types/runtime/session/session-store-service.d.ts +1 -1
  80. package/dist/types/runtime/skill/skill-registry-service.d.ts +1 -1
  81. package/dist/types/runtime/state/execution-state-service.d.ts +57 -0
  82. package/dist/types/runtime/state/state-tools.d.ts +5 -0
  83. package/dist/types/runtime/tool/tool-runtime-service.d.ts +1 -1
  84. package/dist/types/runtime/topic/publish-to-topic-tool.d.ts +24 -0
  85. package/dist/types/runtime/topic/topic-service.d.ts +50 -0
  86. package/dist/types/runtime/wait/wait-service.d.ts +2 -1
  87. package/dist/types/runtime/wait/wait-signal.d.ts +1 -1
  88. package/dist/types/runtime/workflow/definition-runtime.d.ts +78 -0
  89. package/dist/types/runtime/workflow/execution-workflow.d.ts +7 -7
  90. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +1 -1
  91. package/dist/types/schema/address-schema.d.ts +6 -6
  92. package/dist/types/schema/child-orchestration-schema.d.ts +393 -0
  93. package/dist/types/schema/entity-schema.d.ts +40 -0
  94. package/dist/types/schema/envelope-schema.d.ts +1 -0
  95. package/dist/types/schema/execution-schema.d.ts +2 -2
  96. package/dist/types/schema/ids-schema.d.ts +20 -0
  97. package/dist/types/schema/inbox-schema.d.ts +81 -0
  98. package/dist/types/schema/index.d.ts +7 -0
  99. package/dist/types/schema/presence-schema.d.ts +28 -0
  100. package/dist/types/schema/state-schema.d.ts +35 -0
  101. package/dist/types/schema/wait-schema.d.ts +98 -0
  102. package/dist/types/schema/workflow-schema.d.ts +2062 -0
  103. package/dist/types/store-sql/address/address-book-repository.d.ts +1 -1
  104. package/dist/types/store-sql/child/child-fan-out-repository.d.ts +53 -0
  105. package/dist/types/store-sql/database/database-service.d.ts +4 -18
  106. package/dist/types/store-sql/database/notification-bus.d.ts +2 -0
  107. package/dist/types/store-sql/database/sql-dialect.d.ts +13 -0
  108. package/dist/types/store-sql/entity/entity-repository.d.ts +36 -0
  109. package/dist/types/store-sql/envelope/envelope-repository.d.ts +1 -0
  110. package/dist/types/store-sql/execution/execution-event-repository.d.ts +2 -1
  111. package/dist/types/store-sql/execution/execution-repository.d.ts +12 -2
  112. package/dist/types/store-sql/inbox/inbox-repository.d.ts +56 -0
  113. package/dist/types/store-sql/index.d.ts +8 -0
  114. package/dist/types/store-sql/portable.d.ts +29 -0
  115. package/dist/types/store-sql/presence/presence-repository.d.ts +51 -0
  116. package/dist/types/store-sql/schema/relay-schema.d.ts +3064 -587
  117. package/dist/types/store-sql/state/execution-state-repository.d.ts +80 -0
  118. package/dist/types/store-sql/tenant/tenant-id.d.ts +0 -2
  119. package/dist/types/store-sql/topic/topic-repository.d.ts +44 -0
  120. package/dist/types/store-sql/workflow/workflow-definition-repository.d.ts +29 -0
  121. package/package.json +26 -4
  122. package/dist/migrations/20260701002839_sour_cerebro/snapshot.json +0 -1971
  123. package/dist/migrations/20260701041134_acoustic_hulk/snapshot.json +0 -2372
  124. package/dist/migrations/20260701160543_condemned_stryfe/snapshot.json +0 -2442
  125. package/dist/migrations/20260701220315_heavy_gorgon/snapshot.json +0 -2495
  126. package/dist/migrations/20260701225444_polite_lord_hawal/snapshot.json +0 -2821
  127. package/dist/migrations/20260702030128_flaky_misty_knight/snapshot.json +0 -2821
  128. package/dist/migrations/20260705003847_nervous_banshee/snapshot.json +0 -2954
  129. package/dist/migrations/20260705012626_common_stryfe/snapshot.json +0 -3378
  130. package/dist/migrations/20260705015420_sweet_captain_marvel/snapshot.json +0 -3485
  131. package/dist/migrations/20260705023041_chunky_scalphunter/snapshot.json +0 -3753
  132. package/dist/migrations/20260705030344_short_patriot/snapshot.json +0 -3873
  133. package/dist/migrations/20260705045546_heavy_ben_grimm/snapshot.json +0 -4193
  134. package/dist/migrations/20260706185931_regular_shadow_king/snapshot.json +0 -4844
  135. package/dist/migrations/20260706233300_equal_cyclops/snapshot.json +0 -4883
  136. package/dist/migrations/20260709030349_agent_id_rename/snapshot.json +0 -4883
  137. package/dist/migrations/20260709214238_faithful_black_widow/snapshot.json +0 -5426
  138. package/dist/migrations/20260709220016_fearless_aaron_stack/snapshot.json +0 -5426
  139. package/dist/migrations/pg/20260701002839_sour_cerebro/snapshot.json +0 -1971
  140. package/dist/migrations/pg/20260701041134_acoustic_hulk/snapshot.json +0 -2372
  141. package/dist/migrations/pg/20260701160543_condemned_stryfe/snapshot.json +0 -2442
  142. package/dist/migrations/pg/20260701220315_heavy_gorgon/snapshot.json +0 -2495
  143. package/dist/migrations/pg/20260701225444_polite_lord_hawal/snapshot.json +0 -2821
  144. package/dist/migrations/pg/20260702030128_flaky_misty_knight/snapshot.json +0 -2821
  145. package/dist/migrations/pg/20260705003847_nervous_banshee/snapshot.json +0 -2954
  146. package/dist/migrations/pg/20260705012626_common_stryfe/snapshot.json +0 -3378
  147. package/dist/migrations/pg/20260705015420_sweet_captain_marvel/snapshot.json +0 -3485
  148. package/dist/migrations/pg/20260705023041_chunky_scalphunter/snapshot.json +0 -3753
  149. package/dist/migrations/pg/20260705030344_short_patriot/snapshot.json +0 -3873
  150. package/dist/migrations/pg/20260705045546_heavy_ben_grimm/snapshot.json +0 -4193
  151. package/dist/migrations/pg/20260706185931_regular_shadow_king/snapshot.json +0 -4844
  152. package/dist/migrations/pg/20260706233300_equal_cyclops/snapshot.json +0 -4883
  153. package/dist/migrations/pg/20260709030349_agent_id_rename/snapshot.json +0 -4883
  154. package/dist/migrations/pg/20260709214238_faithful_black_widow/snapshot.json +0 -5426
  155. package/dist/migrations/pg/20260709220016_fearless_aaron_stack/snapshot.json +0 -5426
@@ -0,0 +1,54 @@
1
+ import { Effect } from "effect";
2
+ import { SqlClient } from "effect/unstable/sql/SqlClient";
3
+ export declare const migrations: readonly [{
4
+ readonly id: 1;
5
+ readonly name: "baseline";
6
+ readonly file: "0001_baseline.sql";
7
+ readonly source: string;
8
+ }, {
9
+ readonly id: 2;
10
+ readonly name: "durable_tool_placement";
11
+ readonly file: "0002_durable_tool_placement.sql";
12
+ readonly source: string;
13
+ }, {
14
+ readonly id: 3;
15
+ readonly name: "durable_inbox";
16
+ readonly file: "0003_durable_inbox.sql";
17
+ readonly source: string;
18
+ }, {
19
+ readonly id: 4;
20
+ readonly name: "execution_state";
21
+ readonly file: "0004_execution_state.sql";
22
+ readonly source: string;
23
+ }, {
24
+ readonly id: 5;
25
+ readonly name: "durable_entities";
26
+ readonly file: "0005_durable_entities.sql";
27
+ readonly source: string;
28
+ }, {
29
+ readonly id: 6;
30
+ readonly name: "ephemeral_presence";
31
+ readonly file: "0006_ephemeral_presence.sql";
32
+ readonly source: string;
33
+ }, {
34
+ readonly id: 7;
35
+ readonly name: "topic_subscriptions";
36
+ readonly file: "0007_topic_subscriptions.sql";
37
+ readonly source: string;
38
+ }, {
39
+ readonly id: 8;
40
+ readonly name: "child_fan_out";
41
+ readonly file: "0008_child_fan_out.sql";
42
+ readonly source: string;
43
+ }, {
44
+ readonly id: 9;
45
+ readonly name: "workflow_definitions";
46
+ readonly file: "0009_workflow_definitions.sql";
47
+ readonly source: string;
48
+ }, {
49
+ readonly id: 10;
50
+ readonly name: "workflow_runtime";
51
+ readonly file: "0010_workflow_runtime.sql";
52
+ readonly source: string;
53
+ }];
54
+ export declare const loader: Effect.Effect<(readonly [1 | 2 | 6 | 3 | 4 | 7 | 8 | 5 | 9 | 10, "baseline" | "durable_tool_placement" | "durable_inbox" | "execution_state" | "durable_entities" | "ephemeral_presence" | "topic_subscriptions" | "child_fan_out" | "workflow_definitions" | "workflow_runtime", Effect.Effect<Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>, never, never>])[], never, never>;
@@ -0,0 +1,10 @@
1
+ import { type SqliteClientConfig } from "@effect/sql-sqlite-bun/SqliteClient";
2
+ import { ChildFanOutRuntime, WorkflowDefinitionRuntime } from "../runtime/index";
3
+ import { WorkflowDefinitionRepository } from "../store-sql/portable";
4
+ import { Layer } from "effect";
5
+ import { SqlClient } from "effect/unstable/sql/SqlClient";
6
+ export declare const clientLayer: (options: SqliteClientConfig) => Layer.Layer<SqlClient | import("@effect/sql-sqlite-bun/SqliteClient").SqliteClient, never, never>;
7
+ export declare const migrationsLayer: Layer.Layer<never, import("effect/unstable/sql/SqlError").SqlError | import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError, SqlClient>;
8
+ export declare const layer: (options: SqliteClientConfig) => Layer.Layer<SqlClient, import("effect/unstable/sql/SqlError").SqlError | import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError, never>;
9
+ export declare const workflowLayer: <E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, E, R>) => Layer.Layer<SqlClient | WorkflowDefinitionRepository.Service | WorkflowDefinitionRuntime.HandlerService | WorkflowDefinitionRuntime.Service, unknown, Exclude<R, SqlClient | WorkflowDefinitionRepository.Service>>;
10
+ export declare const childFanOutLayer: <E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<ChildFanOutRuntime.HandlerService, E, R>) => Layer.Layer<ChildFanOutRuntime.Service, unknown, R>;
@@ -0,0 +1,29 @@
1
+ export * as Client from "./client";
2
+ export * as Operation from "./operation";
3
+ export * as SQLite from "./sqlite-runtime";
4
+ export { Address, Agent, Content, Entity, Envelope, Execution, Ids, Schedule, Shared, Skill, Tool, Workflow, } from "../schema/index";
5
+ export * as AddressBook from "../runtime/address/address-book-service";
6
+ export * as AddressResolution from "../runtime/address/address-resolution-service";
7
+ export * as AgentLoop from "../runtime/agent/agent-loop-service";
8
+ export * as AgentRegistry from "../runtime/agent/agent-registry-service";
9
+ export * as ActivityVersionRegistry from "../runtime/workflow/activity-version-registry";
10
+ export * as ArtifactStore from "../runtime/content/artifact-store-service";
11
+ export * as BlobStore from "../runtime/content/blob-store-service";
12
+ export * as ChildRunService from "../runtime/child/child-run-service";
13
+ export * as ChildFanOutRuntime from "../runtime/child/child-fan-out-runtime";
14
+ export * as EnvelopeService from "../runtime/envelope/envelope-service";
15
+ export * as EventLog from "../runtime/execution/event-log-service";
16
+ export * as ExecutionEntity from "../runtime/cluster/execution-entity";
17
+ export * as ExecutionService from "../runtime/execution/execution-service";
18
+ export * as ExecutionWorkflow from "../runtime/workflow/execution-workflow";
19
+ export * as LanguageModelService from "../runtime/model/language-model-service";
20
+ export * as ModelCallPolicy from "../runtime/model/model-call-policy";
21
+ export * as PromptAssembler from "../runtime/agent/prompt-assembler-service";
22
+ export * as RunnerRuntime from "../runtime/runner/runner-runtime-service";
23
+ export * as SchedulerService from "../runtime/schedule/scheduler-service";
24
+ export * as SchemaRegistry from "../runtime/schema-registry/schema-registry-service";
25
+ export * as SkillRegistry from "../runtime/skill/skill-registry-service";
26
+ export * as ToolRuntime from "../runtime/tool/tool-runtime-service";
27
+ export * as WaitService from "../runtime/wait/wait-service";
28
+ export * as WorkflowDefinitionRuntime from "../runtime/workflow/definition-runtime";
29
+ export declare const relaySqlitePackage = "@relayfx/sdk/sqlite";
@@ -1,10 +1,10 @@
1
1
  import { Address, Ids } from "../../schema/index";
2
- import { AddressBookRepository } from "../../store-sql/index";
2
+ import { AddressBookRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
- export declare const RouteKind: Schema.Literals<readonly ["local-agent", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
4
+ export declare const RouteKind: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
5
5
  export type RouteKind = typeof RouteKind.Type;
6
6
  export declare const Route: Schema.Struct<{
7
- readonly kind: Schema.Literals<readonly ["local-agent", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
7
+ readonly kind: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
8
8
  readonly route_key: Schema.String;
9
9
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
10
10
  }>;
@@ -18,7 +18,7 @@ export declare const RouteRecord: Schema.Struct<{
18
18
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
19
19
  };
20
20
  readonly route: Schema.Struct<{
21
- readonly kind: Schema.Literals<readonly ["local-agent", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
21
+ readonly kind: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
22
22
  readonly route_key: Schema.String;
23
23
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
24
24
  }>;
@@ -14,7 +14,7 @@ declare const AddressRouteKindMismatch_base: Schema.Class<AddressRouteKindMismat
14
14
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
15
15
  };
16
16
  readonly expected: Schema.Literal<"local-agent">;
17
- readonly actual: Schema.Literals<readonly ["local-agent", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
17
+ readonly actual: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
18
18
  readonly route_key: Schema.String;
19
19
  }>, import("effect/Cause").YieldableError>;
20
20
  export declare class AddressRouteKindMismatch extends AddressRouteKindMismatch_base {
@@ -1,5 +1,5 @@
1
1
  import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
2
- import { AgentChatRepository } from "../../store-sql/index";
2
+ import { AgentChatRepository } from "../../store-sql/portable";
3
3
  import { 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";
@@ -81,5 +81,5 @@ export declare const toolFromDefinition: (definition: Tool.Definition) => AiTool
81
81
  export declare const mapBoundaryError: (error: unknown, current: Execution.ExecutionEventSequence) => AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
82
82
  export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLogService | ToolRuntimeService | LanguageModelServiceService | ModelCallPolicyService | SchemaRegistryService | PromptAssemblerService>;
83
83
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
84
- export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded, Service>;
84
+ export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopBudgetExceeded | AgentLoopWaitRequested, Service>;
85
85
  export {};
@@ -1,5 +1,5 @@
1
1
  import { Agent, Ids } from "../../schema/index";
2
- import { AgentDefinitionRepository } from "../../store-sql/index";
2
+ import { AgentDefinitionRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
4
  declare const AgentDefinitionInvalid_base: Schema.Class<AgentDefinitionInvalid, Schema.TaggedStruct<"AgentDefinitionInvalid", {
5
5
  readonly message: Schema.String;
@@ -1,6 +1,6 @@
1
1
  import { Compaction } from "@batonfx/core";
2
2
  import { Ids } from "../../schema/index";
3
- import { CompactionRepository } from "../../store-sql/index";
3
+ import { CompactionRepository } from "../../store-sql/portable";
4
4
  import { Layer } from "effect";
5
5
  export interface Options {
6
6
  readonly contextWindow?: number;
@@ -1,6 +1,6 @@
1
1
  import { Permissions } from "@batonfx/core";
2
2
  import { Agent, Execution, Ids } from "../../schema/index";
3
- import { PermissionRuleRepository } from "../../store-sql/index";
3
+ import { PermissionRuleRepository } from "../../store-sql/portable";
4
4
  import { Effect, Layer } from "effect";
5
5
  import type { Interface as EventLogInterface } from "../execution/event-log-service";
6
6
  import type { Interface as WaitServiceInterface } from "../wait/wait-service";
@@ -1,6 +1,6 @@
1
1
  import { Steering } from "@batonfx/core";
2
2
  import { Execution, Ids } from "../../schema/index";
3
- import { SteeringRepository } from "../../store-sql/index";
3
+ import { SteeringRepository } from "../../store-sql/portable";
4
4
  import { Effect, Layer } from "effect";
5
5
  import type { Interface } from "../execution/event-log-service";
6
6
  export interface SequenceAllocator {
@@ -0,0 +1,30 @@
1
+ import { ChildOrchestration, Execution, Ids } from "../../schema/index";
2
+ import { ChildFanOutRepository } from "../../store-sql/portable";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
+ import { Service as ChildRunService, type AgentContext } from "./child-run-service";
5
+ declare const ChildFanOutAdmissionError_base: Schema.Class<ChildFanOutAdmissionError, Schema.TaggedStruct<"ChildFanOutAdmissionError", {
6
+ readonly message: Schema.String;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ export declare class ChildFanOutAdmissionError extends ChildFanOutAdmissionError_base {
9
+ }
10
+ export interface AdmitInput {
11
+ readonly fanOutId: Ids.ChildFanOutId;
12
+ readonly parent: AgentContext;
13
+ readonly eventSequence: Execution.ExecutionEventSequence;
14
+ readonly admittedAt: number;
15
+ }
16
+ export interface Interface {
17
+ readonly admit: (input: AdmitInput) => Effect.Effect<ReadonlyArray<Execution.ChildRunAccepted>, ChildFanOutAdmissionError>;
18
+ readonly recover: (input: AdmitInput) => Effect.Effect<ReadonlyArray<Execution.ChildRunAccepted>, ChildFanOutAdmissionError>;
19
+ readonly recoverAll: (inputFor: (fanOut: ChildOrchestration.FanOutState) => AdmitInput) => Effect.Effect<ReadonlyArray<Execution.ChildRunAccepted>, ChildFanOutAdmissionError>;
20
+ }
21
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ChildFanOutAdmissionService", Interface>;
22
+ export declare class Service extends Service_base {
23
+ }
24
+ export declare const layer: Layer.Layer<Service, never, ChildFanOutRepository.Service | ChildRunService>;
25
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
26
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
27
+ export declare const admit: (input: AdmitInput) => Effect.Effect<readonly Execution.ChildRunAccepted[], ChildFanOutAdmissionError, Service>;
28
+ export declare const recover: (input: AdmitInput) => Effect.Effect<readonly Execution.ChildRunAccepted[], ChildFanOutAdmissionError, Service>;
29
+ export declare const recoverAll: (inputFor: (fanOut: ChildOrchestration.FanOutState) => AdmitInput) => Effect.Effect<readonly Execution.ChildRunAccepted[], ChildFanOutAdmissionError, Service>;
30
+ export {};
@@ -0,0 +1,34 @@
1
+ import { ChildOrchestration, Content, Ids } from "../../schema/index";
2
+ import { ChildFanOutRepository } from "../../store-sql/portable";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
+ import { Service as TransitionService } from "./child-fan-out-transition-service";
5
+ export interface ChildResult {
6
+ readonly status: "completed" | "failed" | "cancelled";
7
+ readonly output: ReadonlyArray<Content.Part>;
8
+ readonly error?: string;
9
+ readonly completedAt?: number;
10
+ }
11
+ export interface Handlers {
12
+ readonly execute: (child: ChildOrchestration.FanOutChild, fanOut: ChildOrchestration.FanOutState, idempotencyKey: string) => Effect.Effect<ChildResult, unknown>;
13
+ readonly cancel: (childExecutionId: Ids.ChildExecutionId, reason: string) => Effect.Effect<void, unknown>;
14
+ }
15
+ declare const HandlerService_base: Context.ServiceClass<HandlerService, "@relayfx/runtime/ChildFanOutRuntimeHandlers", Handlers>;
16
+ export declare class HandlerService extends HandlerService_base {
17
+ }
18
+ declare const ChildFanOutRuntimeError_base: Schema.Class<ChildFanOutRuntimeError, Schema.TaggedStruct<"ChildFanOutRuntimeError", {
19
+ readonly message: Schema.String;
20
+ }>, import("effect/Cause").YieldableError>;
21
+ export declare class ChildFanOutRuntimeError extends ChildFanOutRuntimeError_base {
22
+ }
23
+ export interface Interface {
24
+ readonly create: (definition: ChildOrchestration.FanOutDefinition) => Effect.Effect<ChildOrchestration.FanOutState, ChildFanOutRuntimeError>;
25
+ readonly recover: () => Effect.Effect<ReadonlyArray<Ids.ChildFanOutId>, ChildFanOutRuntimeError>;
26
+ readonly cancel: (fanOutId: Ids.ChildFanOutId, cancelledAt: number, reason: string) => Effect.Effect<ChildOrchestration.FanOutState | undefined, ChildFanOutRuntimeError>;
27
+ readonly inspect: (fanOutId: Ids.ChildFanOutId) => Effect.Effect<ChildOrchestration.FanOutState | undefined, ChildFanOutRuntimeError>;
28
+ }
29
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ChildFanOutRuntime", Interface>;
30
+ export declare class Service extends Service_base {
31
+ }
32
+ export declare const layer: Layer.Layer<Service, ChildFanOutRuntimeError, ChildFanOutRepository.Service | TransitionService | HandlerService>;
33
+ export declare const testHandlersLayer: (handlers: Handlers) => Layer.Layer<HandlerService, never, never>;
34
+ export {};
@@ -0,0 +1,25 @@
1
+ import { Content, Ids } from "../../schema/index";
2
+ import { ChildFanOutRepository } from "../../store-sql/portable";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
+ import { Service as EventLogService } from "../execution/event-log-service";
5
+ declare const ChildFanOutTransitionError_base: Schema.Class<ChildFanOutTransitionError, Schema.TaggedStruct<"ChildFanOutTransitionError", {
6
+ readonly message: Schema.String;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ export declare class ChildFanOutTransitionError extends ChildFanOutTransitionError_base {
9
+ }
10
+ export interface TerminalInput {
11
+ readonly childExecutionId: Ids.ChildExecutionId;
12
+ readonly status: "completed" | "failed" | "cancelled";
13
+ readonly output: ReadonlyArray<Content.Part>;
14
+ readonly error?: string;
15
+ readonly completedAt: number;
16
+ }
17
+ export interface Interface {
18
+ readonly terminal: (input: TerminalInput) => Effect.Effect<ChildFanOutRepository.RecordTerminalResult | undefined, ChildFanOutTransitionError>;
19
+ }
20
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ChildFanOutTransitionService", Interface>;
21
+ export declare class Service extends Service_base {
22
+ }
23
+ export declare const layer: Layer.Layer<Service, never, ChildFanOutRepository.Service | EventLogService>;
24
+ export declare const terminal: (input: TerminalInput) => Effect.Effect<ChildFanOutRepository.RecordTerminalResult | undefined, ChildFanOutTransitionError, Service>;
25
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { Agent, Execution, Ids, Shared } from "../../schema/index";
2
- import { ChildExecutionRepository } from "../../store-sql/index";
2
+ import { ChildExecutionRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
4
  import { Service as EventLogService } from "../execution/event-log-service";
5
5
  declare const StaticChildRunPresetNotFound_base: Schema.Class<StaticChildRunPresetNotFound, Schema.TaggedStruct<"StaticChildRunPresetNotFound", {
@@ -1,5 +1,5 @@
1
1
  import { Content, Ids } from "../../schema/index";
2
- import { ChildExecutionRepository } from "../../store-sql/index";
2
+ import { ChildExecutionRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer, Ref, Schema } from "effect";
4
4
  import { Service as EventLogService } from "../execution/event-log-service";
5
5
  import { Service as WaitServiceService } from "../wait/wait-service";
@@ -1,13 +1,15 @@
1
- import type { ChildExecutionRepository, EnvelopeRepository, ExecutionRepository, ToolCallRepository } from "../../store-sql/index";
1
+ import type { ChildExecutionRepository, EnvelopeRepository, ExecutionRepository, ToolCallRepository } from "../../store-sql/portable";
2
2
  import { Entity } from "effect/unstable/cluster";
3
3
  import { Rpc } from "effect/unstable/rpc";
4
4
  import type { WorkflowEngine } from "effect/unstable/workflow";
5
5
  import { Schema } from "effect";
6
6
  import type { Effect } from "effect";
7
7
  import { ExecutionWorkflowFailed, StartInput, StartResult } from "../workflow/execution-workflow";
8
+ import type { Service as ActiveExecutionRegistryService } from "../execution/active-execution-registry";
8
9
  import type { Service as EventLogService } from "../execution/event-log-service";
9
- import type { Service as WaitServiceService } from "../wait/wait-service";
10
+ import type { Service as ExecutionServiceService } from "../execution/execution-service";
10
11
  import type { Service as ToolTransitionCoordinatorService } from "../tool/tool-transition-coordinator";
12
+ import type { Service as WaitServiceService } from "../wait/wait-service";
11
13
  export declare const Start: Rpc.Rpc<"start", typeof StartInput, typeof StartResult, typeof ExecutionWorkflowFailed>;
12
14
  export declare const SignalWait: Rpc.Rpc<"signalWait", Schema.Struct<{
13
15
  readonly workflow_execution_id: Schema.String;
@@ -32,6 +34,6 @@ export declare const Cancel: Rpc.Rpc<"cancel", Schema.Struct<{
32
34
  }>, typeof ExecutionWorkflowFailed, never, never>;
33
35
  type ExecutionRpc = typeof Start | typeof Dispatch | typeof SignalWait | typeof Cancel;
34
36
  export declare const entity: Entity.Entity<"Relay/Execution", ExecutionRpc>;
35
- export declare const layer: import("effect/Layer").Layer<never, never, ChildExecutionRepository.Service | EnvelopeRepository.Service | ExecutionRepository.Service | ToolCallRepository.Service | EventLogService | WaitServiceService | ToolTransitionCoordinatorService | WorkflowEngine.WorkflowEngine | import("effect/unstable/cluster/Sharding").Sharding>;
37
+ export declare const layer: import("effect/Layer").Layer<never, never, ChildExecutionRepository.Service | EnvelopeRepository.Service | ExecutionRepository.Service | ToolCallRepository.Service | EventLogService | WaitServiceService | ExecutionServiceService | ActiveExecutionRegistryService | ToolTransitionCoordinatorService | WorkflowEngine.WorkflowEngine | import("effect/unstable/cluster/Sharding").Sharding>;
36
38
  export declare const client: Effect.Effect<(entityId: string) => import("effect/unstable/rpc/RpcClient").RpcClient.From<ExecutionRpc, import("effect/unstable/cluster/ClusterError").MailboxFull | import("effect/unstable/cluster/ClusterError").AlreadyProcessingMessage | import("effect/unstable/cluster/ClusterError").PersistenceError>, never, import("effect/unstable/cluster/Sharding").Sharding>;
37
39
  export {};
@@ -0,0 +1,67 @@
1
+ import { Content, Entity, Ids, Shared } from "../../schema/index";
2
+ import { EntityRepository } from "../../store-sql/portable";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
+ import { Service as AddressBookService } from "../address/address-book-service";
5
+ import { Service as AgentRegistryService } from "../agent/agent-registry-service";
6
+ import { Service as EventLogService } from "../execution/event-log-service";
7
+ import { EntityKindInvalid, EntityKindNotFound, Service as EntityRegistryService } from "./entity-registry-service";
8
+ declare const EntityDestroyed_base: Schema.Class<EntityDestroyed, Schema.TaggedStruct<"EntityDestroyed", {
9
+ readonly kind: Schema.brand<Schema.String, "Relay.EntityKindName"> & {
10
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EntityKindName">;
11
+ };
12
+ readonly key: Schema.brand<Schema.String, "Relay.EntityKey"> & {
13
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EntityKey">;
14
+ };
15
+ }>, import("effect/Cause").YieldableError>;
16
+ export declare class EntityDestroyed extends EntityDestroyed_base {
17
+ }
18
+ declare const EntityNotFound_base: Schema.Class<EntityNotFound, Schema.TaggedStruct<"EntityNotFound", {
19
+ readonly kind: Schema.brand<Schema.String, "Relay.EntityKindName"> & {
20
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EntityKindName">;
21
+ };
22
+ readonly key: Schema.brand<Schema.String, "Relay.EntityKey"> & {
23
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EntityKey">;
24
+ };
25
+ }>, import("effect/Cause").YieldableError>;
26
+ export declare class EntityNotFound extends EntityNotFound_base {
27
+ }
28
+ declare const EntityServiceError_base: Schema.Class<EntityServiceError, Schema.TaggedStruct<"EntityServiceError", {
29
+ readonly message: Schema.String;
30
+ }>, import("effect/Cause").YieldableError>;
31
+ export declare class EntityServiceError extends EntityServiceError_base {
32
+ }
33
+ export interface GetOrCreateInput {
34
+ readonly kind: Ids.EntityKindName;
35
+ readonly key: Ids.EntityKey;
36
+ readonly input?: ReadonlyArray<Content.Part>;
37
+ readonly metadata?: Shared.Metadata;
38
+ readonly createdAt: number;
39
+ }
40
+ export interface Interface {
41
+ readonly getOrCreate: (input: GetOrCreateInput) => Effect.Effect<Entity.Instance, EntityKindNotFound | EntityKindInvalid | EntityServiceError>;
42
+ readonly get: (input: {
43
+ readonly kind: Ids.EntityKindName;
44
+ readonly key: Ids.EntityKey;
45
+ }) => Effect.Effect<Entity.Instance | undefined, EntityServiceError>;
46
+ readonly destroy: (input: {
47
+ readonly kind: Ids.EntityKindName;
48
+ readonly key: Ids.EntityKey;
49
+ readonly reason?: string;
50
+ readonly destroyedAt: number;
51
+ }) => Effect.Effect<Entity.Instance, EntityNotFound | EntityDestroyed | EntityServiceError>;
52
+ readonly list: (input: {
53
+ readonly kind?: Ids.EntityKindName;
54
+ readonly afterKind?: Ids.EntityKindName;
55
+ readonly afterKey?: string;
56
+ readonly limit?: number;
57
+ }) => Effect.Effect<ReadonlyArray<Entity.Instance>, EntityServiceError>;
58
+ }
59
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EntityInstanceService", Interface>;
60
+ export declare class Service extends Service_base {
61
+ }
62
+ export declare const entityExecutionId: (tenant: Ids.TenantId, kind: Ids.EntityKindName, key: Ids.EntityKey, generation: number) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
63
+ export declare const entityAddressId: (tenant: Ids.TenantId, kind: Ids.EntityKindName, key: Ids.EntityKey) => string & import("effect/Brand").Brand<"Relay.AddressId">;
64
+ export declare const entitySessionId: (tenant: Ids.TenantId, kind: Ids.EntityKindName, key: Ids.EntityKey) => string & import("effect/Brand").Brand<"Relay.SessionId">;
65
+ export declare const layer: Layer.Layer<Service, never, EntityRepository.Service | AddressBookService | EventLogService | AgentRegistryService | import("effect/unstable/cluster/Sharding").Sharding | EntityRegistryService>;
66
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
67
+ export {};
@@ -0,0 +1,35 @@
1
+ import { Entity, Ids } from "../../schema/index";
2
+ import { EntityRepository } from "../../store-sql/portable";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
+ import { Service as AgentRegistryService } from "../agent/agent-registry-service";
5
+ declare const EntityKindNotFound_base: Schema.Class<EntityKindNotFound, Schema.TaggedStruct<"EntityKindNotFound", {
6
+ readonly kind: Schema.brand<Schema.String, "Relay.EntityKindName"> & {
7
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EntityKindName">;
8
+ };
9
+ }>, import("effect/Cause").YieldableError>;
10
+ export declare class EntityKindNotFound extends EntityKindNotFound_base {
11
+ }
12
+ declare const EntityKindInvalid_base: Schema.Class<EntityKindInvalid, Schema.TaggedStruct<"EntityKindInvalid", {
13
+ readonly kind: Schema.brand<Schema.String, "Relay.EntityKindName"> & {
14
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EntityKindName">;
15
+ };
16
+ readonly message: Schema.String;
17
+ }>, import("effect/Cause").YieldableError>;
18
+ export declare class EntityKindInvalid extends EntityKindInvalid_base {
19
+ }
20
+ declare const EntityRegistryError_base: Schema.Class<EntityRegistryError, Schema.TaggedStruct<"EntityRegistryError", {
21
+ readonly message: Schema.String;
22
+ }>, import("effect/Cause").YieldableError>;
23
+ export declare class EntityRegistryError extends EntityRegistryError_base {
24
+ }
25
+ export interface Interface {
26
+ readonly registerKind: (input: Entity.KindDefinition) => Effect.Effect<Entity.KindDefinition, EntityKindInvalid | EntityRegistryError>;
27
+ readonly getKind: (kind: Ids.EntityKindName) => Effect.Effect<Entity.KindDefinition | undefined, EntityRegistryError>;
28
+ readonly listKinds: () => Effect.Effect<ReadonlyArray<Entity.KindDefinition>, EntityRegistryError>;
29
+ }
30
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EntityRegistry", Interface>;
31
+ export declare class Service extends Service_base {
32
+ }
33
+ export declare const layer: Layer.Layer<Service, never, EntityRepository.Service | AgentRegistryService>;
34
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
35
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { Envelope, Execution, Ids } from "../../schema/index";
2
- import { EnvelopeRepository } from "../../store-sql/index";
2
+ import { EnvelopeRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
4
  import { Route, Service as AddressBookService } from "../address/address-book-service";
5
5
  import { Service as EventLogService } from "../execution/event-log-service";
@@ -40,7 +40,9 @@ export interface SendInput {
40
40
  readonly waitId?: Ids.WaitId;
41
41
  }
42
42
  export interface Interface {
43
- readonly send: (input: SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, EnvelopeAddressNotFound | EnvelopeRouteUnavailable | EnvelopeRouteDeferred | EnvelopeServiceError>;
43
+ readonly send: (input: SendInput) => Effect.Effect<Envelope.EnvelopeAccepted & {
44
+ readonly route_kind?: Route["kind"];
45
+ }, EnvelopeAddressNotFound | EnvelopeRouteUnavailable | EnvelopeRouteDeferred | EnvelopeServiceError>;
44
46
  }
45
47
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EnvelopeService", Interface>;
46
48
  export declare class Service extends Service_base {
@@ -48,5 +50,7 @@ export declare class Service extends Service_base {
48
50
  export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | AddressBookService | EventLogService>;
49
51
  export declare const memoryLayer: (routes?: Iterable<readonly [Ids.AddressId, Route]>) => Layer.Layer<Service, never, never>;
50
52
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
51
- export declare const send: (input: SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, EnvelopeAddressNotFound | EnvelopeRouteUnavailable | EnvelopeRouteDeferred | EnvelopeServiceError, Service>;
53
+ export declare const send: (input: SendInput) => Effect.Effect<Envelope.EnvelopeAccepted & {
54
+ readonly route_kind?: Route["kind"];
55
+ }, EnvelopeAddressNotFound | EnvelopeRouteUnavailable | EnvelopeRouteDeferred | EnvelopeServiceError, Service>;
52
56
  export {};
@@ -0,0 +1,12 @@
1
+ import { Ids } from "../../schema/index";
2
+ import { Context, Effect, Layer } from "effect";
3
+ export interface Interface {
4
+ readonly run: <A, E, R>(executionId: Ids.ExecutionId, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
5
+ readonly interrupt: (executionId: Ids.ExecutionId) => Effect.Effect<boolean>;
6
+ }
7
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ActiveExecutionRegistry", Interface>;
8
+ export declare class Service extends Service_base {
9
+ }
10
+ export declare const layer: Layer.Layer<Service, never, never>;
11
+ export declare const testLayer: Layer.Layer<Service, never, never>;
12
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { Execution, Ids } from "../../schema/index";
2
- import { ExecutionEventRepository } from "../../store-sql/index";
2
+ import { ExecutionEventRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer, Option, Schema, Stream } from "effect";
4
4
  declare const EventLogCursorNotFound_base: Schema.Class<EventLogCursorNotFound, Schema.TaggedStruct<"EventLogCursorNotFound", {
5
5
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
@@ -1,5 +1,5 @@
1
1
  import { Agent, Envelope, Execution, Ids, Shared } from "../../schema/index";
2
- import { ExecutionRepository } from "../../store-sql/index";
2
+ import { ExecutionRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer, Schema, Stream } from "effect";
4
4
  import { ShardingConfig } from "effect/unstable/cluster";
5
5
  import { Service as ChildRunServiceService } from "../child/child-run-service";
@@ -41,6 +41,7 @@ export interface CancelInput {
41
41
  readonly eventSequence: Execution.ExecutionEventSequence;
42
42
  readonly cancelledAt: number;
43
43
  readonly reason?: string;
44
+ readonly metadata?: Shared.Metadata;
44
45
  }
45
46
  export interface Interface {
46
47
  readonly accept: (input: AcceptInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
@@ -0,0 +1,32 @@
1
+ import { Execution, Ids } from "../../schema/index";
2
+ import { ExecutionRepository } from "../../store-sql/portable";
3
+ import { Context, Layer, Schema, Stream } from "effect";
4
+ declare const ExecutionWatchError_base: Schema.Class<ExecutionWatchError, Schema.TaggedStruct<"ExecutionWatchError", {
5
+ readonly message: Schema.String;
6
+ }>, import("effect/Cause").YieldableError>;
7
+ export declare class ExecutionWatchError extends ExecutionWatchError_base {
8
+ }
9
+ export interface WatchInput {
10
+ readonly rootAddressId?: Ids.AddressId;
11
+ readonly sessionId?: Ids.SessionId;
12
+ readonly status?: Execution.ExecutionStatus;
13
+ readonly limit?: number;
14
+ }
15
+ export type ExecutionListChange = {
16
+ readonly _tag: "snapshot";
17
+ readonly records: ReadonlyArray<ExecutionRepository.ExecutionRecord>;
18
+ readonly nextCursor?: ExecutionRepository.ExecutionCursor;
19
+ } | {
20
+ readonly _tag: "upsert";
21
+ readonly record: ExecutionRepository.ExecutionRecord;
22
+ };
23
+ export interface Interface {
24
+ readonly watch: (input: WatchInput) => Stream.Stream<ExecutionListChange, ExecutionWatchError>;
25
+ }
26
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ExecutionWatch", Interface>;
27
+ export declare class Service extends Service_base {
28
+ }
29
+ export declare const layerFromServices: Layer.Layer<Service, never, ExecutionRepository.Service>;
30
+ export declare const memoryLayer: Layer.Layer<Service, never, ExecutionRepository.Service>;
31
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
32
+ export {};
@@ -0,0 +1,33 @@
1
+ import { Execution, Ids } from "../../schema/index";
2
+ import { ExecutionRepository } from "../../store-sql/portable";
3
+ import { Context, Layer, Schema, Stream } from "effect";
4
+ import { EventLogCursorNotFound, Service as EventLogService } from "./event-log-service";
5
+ declare const SessionStreamError_base: Schema.Class<SessionStreamError, Schema.TaggedStruct<"SessionStreamError", {
6
+ readonly message: Schema.String;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ export declare class SessionStreamError extends SessionStreamError_base {
9
+ }
10
+ export interface StreamInput {
11
+ readonly sessionId: Ids.SessionId;
12
+ readonly resume?: ReadonlyArray<{
13
+ readonly executionId: Ids.ExecutionId;
14
+ readonly afterCursor?: string;
15
+ }>;
16
+ }
17
+ export type SessionStreamItem = {
18
+ readonly _tag: "execution_joined";
19
+ readonly record: ExecutionRepository.ExecutionRecord;
20
+ } | {
21
+ readonly _tag: "execution_event";
22
+ readonly event: Execution.ExecutionEvent;
23
+ };
24
+ export interface Interface {
25
+ readonly stream: (input: StreamInput) => Stream.Stream<SessionStreamItem, EventLogCursorNotFound | SessionStreamError>;
26
+ }
27
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/SessionStream", Interface>;
28
+ export declare class Service extends Service_base {
29
+ }
30
+ export declare const layerFromServices: Layer.Layer<Service, never, ExecutionRepository.Service | EventLogService>;
31
+ export declare const memoryLayer: Layer.Layer<Service, never, ExecutionRepository.Service | EventLogService>;
32
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
33
+ export {};