@relayfx/sdk 0.0.49 → 0.1.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 (132) hide show
  1. package/README.md +5 -0
  2. package/dist/ai.js +42 -17218
  3. package/dist/index-q0z11q9m.js +18726 -0
  4. package/dist/index-sms8x6cq.js +137 -0
  5. package/dist/index-vbf5hcw8.js +2156 -0
  6. package/dist/index.js +741 -18835
  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/mysql/0003_durable_inbox.sql +3 -0
  13. package/dist/migrations/mysql/0004_execution_state.sql +3 -0
  14. package/dist/migrations/mysql/0005_durable_entities.sql +13 -0
  15. package/dist/migrations/mysql/0006_ephemeral_presence.sql +12 -0
  16. package/dist/migrations/mysql/0007_topic_subscriptions.sql +1 -0
  17. package/dist/migrations/pg/20260712120000_durable_inbox/migration.sql +9 -0
  18. package/dist/migrations/pg/20260712140000_execution_state/migration.sql +5 -0
  19. package/dist/migrations/pg/20260712150000_durable_entities/migration.sql +15 -0
  20. package/dist/migrations/pg/20260712160000_ephemeral_presence/migration.sql +13 -0
  21. package/dist/migrations/pg/20260712170000_topic_subscriptions/migration.sql +3 -0
  22. package/dist/migrations/sqlite/0003_durable_inbox.sql +9 -0
  23. package/dist/migrations/sqlite/0004_execution_state.sql +3 -0
  24. package/dist/migrations/sqlite/0005_durable_entities.sql +15 -0
  25. package/dist/migrations/sqlite/0006_ephemeral_presence.sql +12 -0
  26. package/dist/migrations/sqlite/0007_topic_subscriptions.sql +3 -0
  27. package/dist/sqlite.js +688 -0
  28. package/dist/types/relay/client.d.ts +197 -17
  29. package/dist/types/relay/command.d.ts +41 -0
  30. package/dist/types/relay/database.d.ts +1 -0
  31. package/dist/types/relay/index.d.ts +3 -2
  32. package/dist/types/relay/operation.d.ts +520 -2
  33. package/dist/types/relay/sqlite-migrations.d.ts +39 -0
  34. package/dist/types/relay/sqlite-runtime.d.ts +5 -0
  35. package/dist/types/relay/sqlite.d.ts +27 -0
  36. package/dist/types/runtime/address/address-book-service.d.ts +4 -4
  37. package/dist/types/runtime/address/address-resolution-service.d.ts +1 -1
  38. package/dist/types/runtime/agent/agent-loop-service.d.ts +2 -2
  39. package/dist/types/runtime/agent/agent-registry-service.d.ts +1 -1
  40. package/dist/types/runtime/agent/relay-compaction.d.ts +1 -1
  41. package/dist/types/runtime/agent/relay-permissions.d.ts +1 -1
  42. package/dist/types/runtime/agent/relay-steering.d.ts +1 -1
  43. package/dist/types/runtime/child/child-run-service.d.ts +1 -1
  44. package/dist/types/runtime/child/parent-notifier-service.d.ts +1 -1
  45. package/dist/types/runtime/cluster/execution-entity.d.ts +1 -1
  46. package/dist/types/runtime/entity/entity-instance-service.d.ts +67 -0
  47. package/dist/types/runtime/entity/entity-registry-service.d.ts +35 -0
  48. package/dist/types/runtime/envelope/envelope-service.d.ts +7 -3
  49. package/dist/types/runtime/execution/event-log-service.d.ts +1 -1
  50. package/dist/types/runtime/execution/execution-service.d.ts +1 -1
  51. package/dist/types/runtime/execution/execution-watch-service.d.ts +32 -0
  52. package/dist/types/runtime/execution/session-stream-service.d.ts +33 -0
  53. package/dist/types/runtime/inbox/inbox-service.d.ts +76 -0
  54. package/dist/types/runtime/inbox/send-message-tool.d.ts +27 -0
  55. package/dist/types/runtime/inbox/wait-for-messages-tool.d.ts +34 -0
  56. package/dist/types/runtime/index.d.ts +13 -0
  57. package/dist/types/runtime/memory/memory-service.d.ts +1 -1
  58. package/dist/types/runtime/presence/presence-service.d.ts +30 -0
  59. package/dist/types/runtime/presence/presence-tool.d.ts +20 -0
  60. package/dist/types/runtime/runner/runner-runtime-service.d.ts +18 -18
  61. package/dist/types/runtime/schedule/scheduler-service.d.ts +1 -1
  62. package/dist/types/runtime/session/session-store-service.d.ts +1 -1
  63. package/dist/types/runtime/skill/skill-registry-service.d.ts +1 -1
  64. package/dist/types/runtime/state/execution-state-service.d.ts +57 -0
  65. package/dist/types/runtime/state/state-tools.d.ts +5 -0
  66. package/dist/types/runtime/tool/tool-runtime-service.d.ts +1 -1
  67. package/dist/types/runtime/topic/publish-to-topic-tool.d.ts +24 -0
  68. package/dist/types/runtime/topic/topic-service.d.ts +50 -0
  69. package/dist/types/runtime/wait/wait-service.d.ts +2 -1
  70. package/dist/types/runtime/wait/wait-signal.d.ts +1 -1
  71. package/dist/types/runtime/workflow/execution-workflow.d.ts +2 -2
  72. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +1 -1
  73. package/dist/types/schema/address-schema.d.ts +6 -6
  74. package/dist/types/schema/entity-schema.d.ts +40 -0
  75. package/dist/types/schema/envelope-schema.d.ts +1 -0
  76. package/dist/types/schema/execution-schema.d.ts +2 -2
  77. package/dist/types/schema/ids-schema.d.ts +8 -0
  78. package/dist/types/schema/inbox-schema.d.ts +81 -0
  79. package/dist/types/schema/index.d.ts +4 -0
  80. package/dist/types/schema/presence-schema.d.ts +28 -0
  81. package/dist/types/schema/state-schema.d.ts +35 -0
  82. package/dist/types/store-sql/address/address-book-repository.d.ts +1 -1
  83. package/dist/types/store-sql/database/database-service.d.ts +4 -18
  84. package/dist/types/store-sql/database/notification-bus.d.ts +2 -0
  85. package/dist/types/store-sql/database/sql-dialect.d.ts +13 -0
  86. package/dist/types/store-sql/entity/entity-repository.d.ts +36 -0
  87. package/dist/types/store-sql/envelope/envelope-repository.d.ts +1 -0
  88. package/dist/types/store-sql/execution/execution-event-repository.d.ts +2 -1
  89. package/dist/types/store-sql/execution/execution-repository.d.ts +12 -2
  90. package/dist/types/store-sql/inbox/inbox-repository.d.ts +56 -0
  91. package/dist/types/store-sql/index.d.ts +6 -0
  92. package/dist/types/store-sql/portable.d.ts +27 -0
  93. package/dist/types/store-sql/presence/presence-repository.d.ts +51 -0
  94. package/dist/types/store-sql/schema/relay-schema.d.ts +1352 -140
  95. package/dist/types/store-sql/state/execution-state-repository.d.ts +80 -0
  96. package/dist/types/store-sql/tenant/tenant-id.d.ts +0 -2
  97. package/dist/types/store-sql/topic/topic-repository.d.ts +44 -0
  98. package/package.json +26 -4
  99. package/dist/migrations/20260701002839_sour_cerebro/snapshot.json +0 -1971
  100. package/dist/migrations/20260701041134_acoustic_hulk/snapshot.json +0 -2372
  101. package/dist/migrations/20260701160543_condemned_stryfe/snapshot.json +0 -2442
  102. package/dist/migrations/20260701220315_heavy_gorgon/snapshot.json +0 -2495
  103. package/dist/migrations/20260701225444_polite_lord_hawal/snapshot.json +0 -2821
  104. package/dist/migrations/20260702030128_flaky_misty_knight/snapshot.json +0 -2821
  105. package/dist/migrations/20260705003847_nervous_banshee/snapshot.json +0 -2954
  106. package/dist/migrations/20260705012626_common_stryfe/snapshot.json +0 -3378
  107. package/dist/migrations/20260705015420_sweet_captain_marvel/snapshot.json +0 -3485
  108. package/dist/migrations/20260705023041_chunky_scalphunter/snapshot.json +0 -3753
  109. package/dist/migrations/20260705030344_short_patriot/snapshot.json +0 -3873
  110. package/dist/migrations/20260705045546_heavy_ben_grimm/snapshot.json +0 -4193
  111. package/dist/migrations/20260706185931_regular_shadow_king/snapshot.json +0 -4844
  112. package/dist/migrations/20260706233300_equal_cyclops/snapshot.json +0 -4883
  113. package/dist/migrations/20260709030349_agent_id_rename/snapshot.json +0 -4883
  114. package/dist/migrations/20260709214238_faithful_black_widow/snapshot.json +0 -5426
  115. package/dist/migrations/20260709220016_fearless_aaron_stack/snapshot.json +0 -5426
  116. package/dist/migrations/pg/20260701002839_sour_cerebro/snapshot.json +0 -1971
  117. package/dist/migrations/pg/20260701041134_acoustic_hulk/snapshot.json +0 -2372
  118. package/dist/migrations/pg/20260701160543_condemned_stryfe/snapshot.json +0 -2442
  119. package/dist/migrations/pg/20260701220315_heavy_gorgon/snapshot.json +0 -2495
  120. package/dist/migrations/pg/20260701225444_polite_lord_hawal/snapshot.json +0 -2821
  121. package/dist/migrations/pg/20260702030128_flaky_misty_knight/snapshot.json +0 -2821
  122. package/dist/migrations/pg/20260705003847_nervous_banshee/snapshot.json +0 -2954
  123. package/dist/migrations/pg/20260705012626_common_stryfe/snapshot.json +0 -3378
  124. package/dist/migrations/pg/20260705015420_sweet_captain_marvel/snapshot.json +0 -3485
  125. package/dist/migrations/pg/20260705023041_chunky_scalphunter/snapshot.json +0 -3753
  126. package/dist/migrations/pg/20260705030344_short_patriot/snapshot.json +0 -3873
  127. package/dist/migrations/pg/20260705045546_heavy_ben_grimm/snapshot.json +0 -4193
  128. package/dist/migrations/pg/20260706185931_regular_shadow_king/snapshot.json +0 -4844
  129. package/dist/migrations/pg/20260706233300_equal_cyclops/snapshot.json +0 -4883
  130. package/dist/migrations/pg/20260709030349_agent_id_rename/snapshot.json +0 -4883
  131. package/dist/migrations/pg/20260709214238_faithful_black_widow/snapshot.json +0 -5426
  132. package/dist/migrations/pg/20260709220016_fearless_aaron_stack/snapshot.json +0 -5426
@@ -0,0 +1,27 @@
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, } 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 EnvelopeService from "../runtime/envelope/envelope-service";
14
+ export * as EventLog from "../runtime/execution/event-log-service";
15
+ export * as ExecutionEntity from "../runtime/cluster/execution-entity";
16
+ export * as ExecutionService from "../runtime/execution/execution-service";
17
+ export * as ExecutionWorkflow from "../runtime/workflow/execution-workflow";
18
+ export * as LanguageModelService from "../runtime/model/language-model-service";
19
+ export * as ModelCallPolicy from "../runtime/model/model-call-policy";
20
+ export * as PromptAssembler from "../runtime/agent/prompt-assembler-service";
21
+ export * as RunnerRuntime from "../runtime/runner/runner-runtime-service";
22
+ export * as SchedulerService from "../runtime/schedule/scheduler-service";
23
+ export * as SchemaRegistry from "../runtime/schema-registry/schema-registry-service";
24
+ export * as SkillRegistry from "../runtime/skill/skill-registry-service";
25
+ export * as ToolRuntime from "../runtime/tool/tool-runtime-service";
26
+ export * as WaitService from "../runtime/wait/wait-service";
27
+ 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 {
@@ -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,4 +1,4 @@
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";
@@ -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 {};
@@ -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";
@@ -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 {};
@@ -0,0 +1,76 @@
1
+ import { Content, Envelope, Execution, Ids, Inbox } from "../../schema/index";
2
+ import { EnvelopeRepository, ExecutionRepository, InboxRepository } from "../../store-sql/portable";
3
+ import { Context, Effect, Layer, Schema } from "effect";
4
+ import { Service as EventLogService } from "../execution/event-log-service";
5
+ import { Service as WaitService } from "../wait/wait-service";
6
+ import type { ExecutionClientFactory } from "../wait/wait-signal";
7
+ declare const InboxDeliveryError_base: Schema.Class<InboxDeliveryError, Schema.TaggedStruct<"InboxDeliveryError", {
8
+ readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
9
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
10
+ };
11
+ readonly message: Schema.String;
12
+ }>, import("effect/Cause").YieldableError>;
13
+ export declare class InboxDeliveryError extends InboxDeliveryError_base {
14
+ }
15
+ declare const InboxReplyTokenInvalid_base: Schema.Class<InboxReplyTokenInvalid, Schema.TaggedStruct<"InboxReplyTokenInvalid", {
16
+ readonly reply_token: Schema.String;
17
+ }>, import("effect/Cause").YieldableError>;
18
+ export declare class InboxReplyTokenInvalid extends InboxReplyTokenInvalid_base {
19
+ }
20
+ declare const InboxServiceError_base: Schema.Class<InboxServiceError, Schema.TaggedStruct<"InboxServiceError", {
21
+ readonly message: Schema.String;
22
+ }>, import("effect/Cause").YieldableError>;
23
+ export declare class InboxServiceError extends InboxServiceError_base {
24
+ }
25
+ export interface DeliverInput {
26
+ readonly executionId: Ids.ExecutionId;
27
+ readonly envelope: Envelope.Envelope;
28
+ readonly acceptance?: EnvelopeRepository.AcceptEnvelopeInput;
29
+ readonly idempotencyKey?: string;
30
+ readonly replyWaitId?: Ids.WaitId;
31
+ readonly eventSequence: Execution.ExecutionEventSequence;
32
+ readonly createdAt: number;
33
+ }
34
+ export interface DeliverResult {
35
+ readonly sequence: Inbox.MessageSequence;
36
+ readonly deduplicated: boolean;
37
+ }
38
+ export interface DrainInput {
39
+ readonly executionId: Ids.ExecutionId;
40
+ readonly drainId: string;
41
+ readonly maxBatch?: number;
42
+ }
43
+ export interface EnsureReplyWaitInput {
44
+ readonly envelope: Envelope.Envelope;
45
+ readonly waitId: Ids.WaitId;
46
+ }
47
+ export interface ReplyInput {
48
+ readonly replyToken: string;
49
+ readonly from: Ids.AddressId;
50
+ readonly content: ReadonlyArray<Content.Part>;
51
+ readonly createdAt: number;
52
+ }
53
+ export interface Interface {
54
+ readonly deliver: (input: DeliverInput) => Effect.Effect<DeliverResult, InboxDeliveryError>;
55
+ readonly ensureReplyWait: (input: EnsureReplyWaitInput) => Effect.Effect<void, InboxDeliveryError>;
56
+ readonly drain: (input: DrainInput) => Effect.Effect<ReadonlyArray<Inbox.Message>, InboxServiceError>;
57
+ readonly undrainedCount: (executionId: Ids.ExecutionId) => Effect.Effect<number, InboxServiceError>;
58
+ readonly reply: (input: ReplyInput) => Effect.Effect<Envelope.EnvelopeAccepted, InboxReplyTokenInvalid | InboxDeliveryError>;
59
+ }
60
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/InboxService", Interface>;
61
+ export declare class Service extends Service_base {
62
+ }
63
+ export interface SignalDependencies {
64
+ readonly makeExecutionClient: ExecutionClientFactory;
65
+ readonly executionRepository: ExecutionRepository.Service["Service"];
66
+ }
67
+ export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | InboxRepository.Service | EventLogService | WaitService>;
68
+ export declare const layerWithSignal: (dependencies: SignalDependencies) => Layer.Layer<Service, never, EnvelopeRepository.Service | InboxRepository.Service | EventLogService | WaitService>;
69
+ export declare const memoryLayer: Layer.Layer<Service, never, EventLogService | WaitService>;
70
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
71
+ export declare const deliver: (input: DeliverInput) => Effect.Effect<DeliverResult, InboxDeliveryError, Service>;
72
+ export declare const ensureReplyWait: (input: EnsureReplyWaitInput) => Effect.Effect<void, InboxDeliveryError, Service>;
73
+ export declare const drain: (input: DrainInput) => Effect.Effect<readonly Inbox.Message[], InboxServiceError, Service>;
74
+ export declare const undrainedCount: (id: Ids.ExecutionId) => Effect.Effect<number, InboxServiceError, Service>;
75
+ export declare const reply: (input: ReplyInput) => Effect.Effect<Envelope.EnvelopeAccepted, InboxDeliveryError | InboxReplyTokenInvalid, Service>;
76
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Ids } from "../../schema/index";
2
+ import { Schema } from "effect";
3
+ import type { Interface as EnvelopeInterface } from "../envelope/envelope-service";
4
+ import type { RegisteredTool } from "../tool/tool-runtime-service";
5
+ import type { Interface as InboxInterface } from "./inbox-service";
6
+ export declare const toolName = "send_message";
7
+ export declare const permissionName = "relay.inbox.send";
8
+ export declare const Input: Schema.Struct<{
9
+ readonly to: Schema.String;
10
+ readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
11
+ readonly type: Schema.Literal<"text">;
12
+ readonly text: Schema.String;
13
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
14
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
15
+ }>>]>;
16
+ readonly reply_token: Schema.optionalKey<Schema.String>;
17
+ }>;
18
+ export declare const Output: Schema.Struct<{
19
+ readonly envelope_id: Schema.String;
20
+ readonly delivered: Schema.Literals<readonly ["inbox", "outbox", "reply"]>;
21
+ }>;
22
+ export interface Config {
23
+ readonly inbox: InboxInterface;
24
+ readonly envelopes: EnvelopeInterface;
25
+ readonly from: Ids.AddressId;
26
+ }
27
+ export declare const registeredTool: (config: Config) => RegisteredTool;
@@ -0,0 +1,34 @@
1
+ import { Schema } from "effect";
2
+ import type { Interface as EventLogInterface } from "../execution/event-log-service";
3
+ import type { Interface as WaitServiceInterface } from "../wait/wait-service";
4
+ import type { RegisteredTool } from "../tool/tool-runtime-service";
5
+ import type { Interface as InboxInterface } from "./inbox-service";
6
+ export declare const toolName = "wait_for_messages";
7
+ export declare const permissionName = "relay.inbox.wait";
8
+ export declare const Input: Schema.Struct<{
9
+ readonly timeout: Schema.optionalKey<Schema.String>;
10
+ }>;
11
+ export interface Input extends Schema.Schema.Type<typeof Input> {
12
+ }
13
+ export declare const Output: Schema.Struct<{
14
+ readonly status: Schema.Literals<readonly ["messages", "timed_out"]>;
15
+ readonly messages: Schema.$Array<Schema.Struct<{
16
+ readonly sequence: Schema.Int;
17
+ readonly from: Schema.String;
18
+ readonly content: Schema.$Array<Schema.Struct<{
19
+ readonly type: Schema.Literal<"text">;
20
+ readonly text: Schema.String;
21
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
22
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
23
+ }>>;
24
+ readonly reply_token: Schema.optionalKey<Schema.String>;
25
+ readonly correlation_key: Schema.optionalKey<Schema.String>;
26
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
27
+ }>>;
28
+ }>;
29
+ export interface Config {
30
+ readonly inbox: InboxInterface;
31
+ readonly waits: WaitServiceInterface;
32
+ readonly eventLog: EventLogInterface;
33
+ }
34
+ export declare const registeredTool: (config: Config) => RegisteredTool;
@@ -8,13 +8,24 @@ export * as ChildRunService from "./child/child-run-service";
8
8
  export * as SpawnChildRunTool from "./child/spawn-child-run-tool";
9
9
  export * as ExecutionEntity from "./cluster/execution-entity";
10
10
  export * as EnvelopeService from "./envelope/envelope-service";
11
+ export * as EntityInstanceService from "./entity/entity-instance-service";
12
+ export * as EntityRegistry from "./entity/entity-registry-service";
13
+ export * as InboxService from "./inbox/inbox-service";
14
+ export * as TopicService from "./topic/topic-service";
15
+ export * as PublishToTopicTool from "./topic/publish-to-topic-tool";
16
+ export * as SendMessageTool from "./inbox/send-message-tool";
17
+ export * as WaitForMessagesTool from "./inbox/wait-for-messages-tool";
11
18
  export * as EventLog from "./execution/event-log-service";
19
+ export * as ExecutionWatch from "./execution/execution-watch-service";
12
20
  export * as ExecutionService from "./execution/execution-service";
21
+ export * as SessionStream from "./execution/session-stream-service";
13
22
  export * as EmbeddingModelService from "./model/embedding-model-service";
14
23
  export * as LanguageModelService from "./model/language-model-service";
15
24
  export * as MemoryService from "./memory/memory-service";
16
25
  export * as ModelCallPolicy from "./model/model-call-policy";
17
26
  export * as ParentNotifier from "./child/parent-notifier-service";
27
+ export * as PresenceService from "./presence/presence-service";
28
+ export * as PresenceTool from "./presence/presence-tool";
18
29
  export * as PromptAssembler from "./agent/prompt-assembler-service";
19
30
  export * as RelayCompaction from "./agent/relay-compaction";
20
31
  export * as RelayPermissions from "./agent/relay-permissions";
@@ -25,6 +36,8 @@ export * as SchedulerService from "./schedule/scheduler-service";
25
36
  export * as SchemaRegistry from "./schema-registry/schema-registry-service";
26
37
  export * as RelaySessionStore from "./session/session-store-service";
27
38
  export * as SkillRegistry from "./skill/skill-registry-service";
39
+ export * as ExecutionState from "./state/execution-state-service";
40
+ export * as StateTools from "./state/state-tools";
28
41
  export * as ToolRuntime from "./tool/tool-runtime-service";
29
42
  export * as ToolTransitionCoordinator from "./tool/tool-transition-coordinator";
30
43
  export * as ToolInputSchemaDigest from "./tool/tool-input-schema-digest";
@@ -1,5 +1,5 @@
1
1
  import { Memory } from "@batonfx/core";
2
- import { MemoryRepository } from "../../store-sql/index";
2
+ import { MemoryRepository } from "../../store-sql/portable";
3
3
  import { Context, Effect, Layer } from "effect";
4
4
  import { Service as EmbeddingModelServiceService } from "../model/embedding-model-service";
5
5
  import type { ModelSelection } from "../model/embedding-model-service";
@@ -0,0 +1,30 @@
1
+ import { Presence, Shared } from "../../schema/index";
2
+ import { PresenceRepository } from "../../store-sql/portable";
3
+ import { Config, Context, Effect, Layer, Schema, Scope, Stream } from "effect";
4
+ declare const PresenceError_base: Schema.Class<PresenceError, Schema.TaggedStruct<"PresenceError", {
5
+ readonly message: Schema.String;
6
+ }>, import("effect/Cause").YieldableError>;
7
+ export declare class PresenceError extends PresenceError_base {
8
+ }
9
+ export interface RegisterInput {
10
+ readonly id: string;
11
+ readonly scope: Presence.Scope;
12
+ readonly metadata?: Shared.Metadata;
13
+ }
14
+ export interface Interface {
15
+ readonly register: (input: RegisterInput) => Effect.Effect<void, never, Scope.Scope>;
16
+ readonly tracked: (scope: Presence.Scope, metadata?: Shared.Metadata) => <A, E, R>(stream: Stream.Stream<A, E, R>) => Stream.Stream<A, E, R>;
17
+ readonly list: (scope: Presence.Scope) => Effect.Effect<Presence.View, PresenceError>;
18
+ readonly watch: (scope: Presence.Scope) => Stream.Stream<Presence.View, PresenceError>;
19
+ }
20
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/Presence", Interface>;
21
+ export declare class Service extends Service_base {
22
+ }
23
+ export declare const PresenceIdentity: Context.Reference<Shared.Metadata>;
24
+ export declare const layerFromRepository: Layer.Layer<Service, Config.ConfigError, PresenceRepository.Service>;
25
+ export declare const memoryLayer: Layer.Layer<Service, Config.ConfigError, never>;
26
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
27
+ export declare const register: (input: RegisterInput) => Effect.Effect<void, never, Scope.Scope | Service>;
28
+ export declare const list: (scope: Presence.Scope) => Effect.Effect<Presence.View, PresenceError, Service>;
29
+ export declare const watch: (scope: Presence.Scope) => Stream.Stream<Presence.View, PresenceError, Service>;
30
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Schema } from "effect";
2
+ import type { Interface as PresenceInterface } from "./presence-service";
3
+ import type { RegisteredTool } from "../tool/tool-runtime-service";
4
+ export declare const toolName = "relay_presence";
5
+ export declare const permissionName = "relay.presence.read";
6
+ export declare const Input: Schema.Struct<{
7
+ readonly scope: Schema.optionalKey<Schema.Struct<{
8
+ readonly kind: Schema.Literals<readonly ["execution", "session"]>;
9
+ readonly id: Schema.String;
10
+ }>>;
11
+ }>;
12
+ export declare const Output: Schema.Struct<{
13
+ readonly watcher_count: Schema.Number;
14
+ readonly entries: Schema.$Array<Schema.Struct<{
15
+ readonly id: Schema.String;
16
+ readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
17
+ readonly connected_at: Schema.Int;
18
+ }>>;
19
+ }>;
20
+ export declare const registeredTool: (presence: PresenceInterface) => RegisteredTool;