@relayfx/test 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 (81) hide show
  1. package/README.md +5 -0
  2. package/dist/index.js +18190 -0
  3. package/dist/types/runtime/address/address-book-service.d.ts +74 -0
  4. package/dist/types/runtime/address/address-resolution-service.d.ts +140 -0
  5. package/dist/types/runtime/agent/agent-loop-service.d.ts +85 -0
  6. package/dist/types/runtime/agent/agent-registry-service.d.ts +31 -0
  7. package/dist/types/runtime/agent/prompt-assembler-service.d.ts +64 -0
  8. package/dist/types/runtime/agent/relay-approvals.d.ts +2 -0
  9. package/dist/types/runtime/agent/relay-compaction.d.ts +23 -0
  10. package/dist/types/runtime/agent/relay-instructions.d.ts +7 -0
  11. package/dist/types/runtime/agent/relay-permissions.d.ts +25 -0
  12. package/dist/types/runtime/agent/relay-steering.d.ts +17 -0
  13. package/dist/types/runtime/agent/relay-tool-executor.d.ts +22 -0
  14. package/dist/types/runtime/agent/relay-tool-output.d.ts +7 -0
  15. package/dist/types/runtime/agent/sequence-allocator.d.ts +8 -0
  16. package/dist/types/runtime/child/child-run-service.d.ts +90 -0
  17. package/dist/types/runtime/child/parent-notifier-service.d.ts +40 -0
  18. package/dist/types/runtime/child/spawn-child-run-tool.d.ts +211 -0
  19. package/dist/types/runtime/cluster/execution-entity.d.ts +37 -0
  20. package/dist/types/runtime/content/artifact-store-service.d.ts +26 -0
  21. package/dist/types/runtime/content/blob-store-service.d.ts +54 -0
  22. package/dist/types/runtime/entity/entity-instance-service.d.ts +67 -0
  23. package/dist/types/runtime/entity/entity-registry-service.d.ts +35 -0
  24. package/dist/types/runtime/envelope/envelope-service.d.ts +56 -0
  25. package/dist/types/runtime/execution/event-log-service.d.ts +68 -0
  26. package/dist/types/runtime/execution/execution-service.d.ts +65 -0
  27. package/dist/types/runtime/execution/execution-watch-service.d.ts +32 -0
  28. package/dist/types/runtime/execution/session-stream-service.d.ts +33 -0
  29. package/dist/types/runtime/inbox/inbox-service.d.ts +76 -0
  30. package/dist/types/runtime/inbox/send-message-tool.d.ts +27 -0
  31. package/dist/types/runtime/inbox/wait-for-messages-tool.d.ts +34 -0
  32. package/dist/types/runtime/index.d.ts +51 -0
  33. package/dist/types/runtime/memory/memory-service.d.ts +22 -0
  34. package/dist/types/runtime/model/embedding-model-service.d.ts +68 -0
  35. package/dist/types/runtime/model/language-model-service.d.ts +34 -0
  36. package/dist/types/runtime/model/model-call-policy.d.ts +14 -0
  37. package/dist/types/runtime/observability/runtime-metrics.d.ts +19 -0
  38. package/dist/types/runtime/presence/presence-service.d.ts +30 -0
  39. package/dist/types/runtime/presence/presence-tool.d.ts +20 -0
  40. package/dist/types/runtime/runner/runner-runtime-service.d.ts +149 -0
  41. package/dist/types/runtime/schedule/scheduler-service.d.ts +34 -0
  42. package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +27 -0
  43. package/dist/types/runtime/session/session-store-service.d.ts +14 -0
  44. package/dist/types/runtime/skill/skill-registry-service.d.ts +44 -0
  45. package/dist/types/runtime/state/execution-state-service.d.ts +57 -0
  46. package/dist/types/runtime/state/state-tools.d.ts +5 -0
  47. package/dist/types/runtime/tool/tool-input-schema-digest.d.ts +6 -0
  48. package/dist/types/runtime/tool/tool-runtime-service.d.ts +139 -0
  49. package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +13 -0
  50. package/dist/types/runtime/topic/publish-to-topic-tool.d.ts +24 -0
  51. package/dist/types/runtime/topic/topic-service.d.ts +50 -0
  52. package/dist/types/runtime/wait/wait-service.d.ts +81 -0
  53. package/dist/types/runtime/wait/wait-signal.d.ts +16 -0
  54. package/dist/types/runtime/workflow/activity-version-registry.d.ts +89 -0
  55. package/dist/types/runtime/workflow/execution-workflow.d.ts +475 -0
  56. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +64 -0
  57. package/dist/types/runtime/workspace/workspace-provider-service.d.ts +108 -0
  58. package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +21 -0
  59. package/dist/types/schema/address-schema.d.ts +77 -0
  60. package/dist/types/schema/agent-schema.d.ts +658 -0
  61. package/dist/types/schema/content-schema.d.ts +118 -0
  62. package/dist/types/schema/entity-schema.d.ts +40 -0
  63. package/dist/types/schema/envelope-schema.d.ts +180 -0
  64. package/dist/types/schema/execution-schema.d.ts +347 -0
  65. package/dist/types/schema/ids-schema.d.ts +94 -0
  66. package/dist/types/schema/inbox-schema.d.ts +81 -0
  67. package/dist/types/schema/index.d.ts +16 -0
  68. package/dist/types/schema/presence-schema.d.ts +28 -0
  69. package/dist/types/schema/schedule-schema.d.ts +79 -0
  70. package/dist/types/schema/shared-schema.d.ts +13 -0
  71. package/dist/types/schema/skill-schema.d.ts +260 -0
  72. package/dist/types/schema/state-schema.d.ts +35 -0
  73. package/dist/types/schema/tool-schema.d.ts +84 -0
  74. package/dist/types/schema/workspace-schema.d.ts +78 -0
  75. package/dist/types/test/captured-model.d.ts +13 -0
  76. package/dist/types/test/index.d.ts +6 -0
  77. package/dist/types/test/scripted-model.d.ts +39 -0
  78. package/dist/types/test/test-runtime.d.ts +9 -0
  79. package/dist/types/test/test-tools.d.ts +18 -0
  80. package/dist/types/test/wait-test-kit.d.ts +9 -0
  81. package/package.json +45 -0
@@ -0,0 +1,65 @@
1
+ import { Agent, Envelope, Execution, Ids, Shared } from "../../schema/index";
2
+ import { ExecutionRepository } from "@relayfx/store-sql/portable";
3
+ import { Context, Effect, Layer, Schema, Stream } from "effect";
4
+ import { ShardingConfig } from "effect/unstable/cluster";
5
+ import { Service as ChildRunServiceService } from "../child/child-run-service";
6
+ import { Service as EventLogService } from "./event-log-service";
7
+ import type { ReplayInput } from "./event-log-service";
8
+ declare const ExecutionServiceError_base: Schema.Class<ExecutionServiceError, Schema.TaggedStruct<"ExecutionServiceError", {
9
+ readonly message: Schema.String;
10
+ readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
11
+ }>, import("effect/Cause").YieldableError>;
12
+ export declare class ExecutionServiceError extends ExecutionServiceError_base {
13
+ }
14
+ export interface AcceptInput {
15
+ readonly executionId: Ids.ExecutionId;
16
+ readonly rootAddressId: Ids.AddressId;
17
+ readonly sessionId?: Ids.SessionId;
18
+ readonly eventSequence: Execution.ExecutionEventSequence;
19
+ readonly createdAt: number;
20
+ readonly agentId?: Ids.AgentId;
21
+ readonly agentRevision?: Agent.DefinitionRevision;
22
+ readonly agentSnapshot?: Agent.Definition;
23
+ readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
24
+ readonly metadata?: Shared.Metadata;
25
+ }
26
+ export interface RunInput {
27
+ readonly executionId: Ids.ExecutionId;
28
+ readonly eventSequence: Execution.ExecutionEventSequence;
29
+ readonly startedAt: number;
30
+ readonly completedAt: number;
31
+ readonly program: Effect.Effect<RunProgramResult, ExecutionServiceError>;
32
+ }
33
+ export interface RunProgramResult {
34
+ readonly _tag?: "completed" | "waiting";
35
+ readonly waitId?: Ids.WaitId;
36
+ readonly metadata?: Shared.Metadata;
37
+ readonly nextEventSequence?: Execution.ExecutionEventSequence;
38
+ }
39
+ export interface CancelInput {
40
+ readonly executionId: Ids.ExecutionId;
41
+ readonly eventSequence: Execution.ExecutionEventSequence;
42
+ readonly cancelledAt: number;
43
+ readonly reason?: string;
44
+ }
45
+ export interface Interface {
46
+ readonly accept: (input: AcceptInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
47
+ readonly run: (input: RunInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
48
+ readonly cancel: (input: CancelInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
49
+ readonly send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ExecutionServiceError>;
50
+ readonly spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ExecutionServiceError>;
51
+ readonly stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, ExecutionServiceError>;
52
+ }
53
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ExecutionService", Interface>;
54
+ export declare class Service extends Service_base {
55
+ }
56
+ export declare const layer: Layer.Layer<Service, never, ExecutionRepository.Service | EventLogService | ChildRunServiceService | ShardingConfig.ShardingConfig>;
57
+ export declare const memoryLayer: Layer.Layer<Service, never, never>;
58
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
59
+ export declare const accept: (input: AcceptInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
60
+ export declare const run: (input: RunInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
61
+ export declare const cancel: (input: CancelInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
62
+ export declare const send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ExecutionServiceError, Service>;
63
+ export declare const spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ExecutionServiceError, Service>;
64
+ export declare const stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, ExecutionServiceError, Service>;
65
+ export {};
@@ -0,0 +1,32 @@
1
+ import { Execution, Ids } from "../../schema/index";
2
+ import { ExecutionRepository } from "@relayfx/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 "@relayfx/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 "@relayfx/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;
@@ -0,0 +1,51 @@
1
+ export * as AddressBook from "./address/address-book-service";
2
+ export * as AddressResolution from "./address/address-resolution-service";
3
+ export * as AgentLoop from "./agent/agent-loop-service";
4
+ export * as AgentRegistry from "./agent/agent-registry-service";
5
+ export * as ArtifactStore from "./content/artifact-store-service";
6
+ export * as BlobStore from "./content/blob-store-service";
7
+ export * as ChildRunService from "./child/child-run-service";
8
+ export * as SpawnChildRunTool from "./child/spawn-child-run-tool";
9
+ export * as ExecutionEntity from "./cluster/execution-entity";
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";
18
+ export * as EventLog from "./execution/event-log-service";
19
+ export * as ExecutionWatch from "./execution/execution-watch-service";
20
+ export * as ExecutionService from "./execution/execution-service";
21
+ export * as SessionStream from "./execution/session-stream-service";
22
+ export * as EmbeddingModelService from "./model/embedding-model-service";
23
+ export * as LanguageModelService from "./model/language-model-service";
24
+ export * as MemoryService from "./memory/memory-service";
25
+ export * as ModelCallPolicy from "./model/model-call-policy";
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";
29
+ export * as PromptAssembler from "./agent/prompt-assembler-service";
30
+ export * as RelayCompaction from "./agent/relay-compaction";
31
+ export * as RelayPermissions from "./agent/relay-permissions";
32
+ export * as RelaySteering from "./agent/relay-steering";
33
+ export * as RelayToolOutput from "./agent/relay-tool-output";
34
+ export * as RunnerRuntime from "./runner/runner-runtime-service";
35
+ export * as SchedulerService from "./schedule/scheduler-service";
36
+ export * as SchemaRegistry from "./schema-registry/schema-registry-service";
37
+ export * as RelaySessionStore from "./session/session-store-service";
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";
41
+ export * as ToolRuntime from "./tool/tool-runtime-service";
42
+ export * as ToolTransitionCoordinator from "./tool/tool-transition-coordinator";
43
+ export * as ToolInputSchemaDigest from "./tool/tool-input-schema-digest";
44
+ export * as WaitService from "./wait/wait-service";
45
+ export * as WaitSignal from "./wait/wait-signal";
46
+ export * as WorkspacePlanner from "./workspace/workspace-planner-service";
47
+ export * as WorkspaceProvider from "./workspace/workspace-provider-service";
48
+ export * as WorkspaceRuntime from "./workspace/workspace-runtime-service";
49
+ export * as ExecutionWorkflow from "./workflow/execution-workflow";
50
+ export * as ActivityVersionRegistry from "./workflow/activity-version-registry";
51
+ export declare const runtimePackage = "./index";
@@ -0,0 +1,22 @@
1
+ import { Memory } from "@batonfx/core";
2
+ import { MemoryRepository } from "@relayfx/store-sql/portable";
3
+ import { Context, Effect, Layer } from "effect";
4
+ import { Service as EmbeddingModelServiceService } from "../model/embedding-model-service";
5
+ import type { ModelSelection } from "../model/embedding-model-service";
6
+ export interface Options {
7
+ readonly topK?: number | undefined;
8
+ readonly minScore?: number | undefined;
9
+ readonly embeddingSelection?: ModelSelection | undefined;
10
+ }
11
+ export interface Interface extends Memory.Interface {
12
+ }
13
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/MemoryService", Interface>;
14
+ export declare class Service extends Service_base {
15
+ }
16
+ export declare const layer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service | EmbeddingModelServiceService>;
17
+ export declare const memoryLayer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service | EmbeddingModelServiceService>;
18
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service | Memory.Memory>;
19
+ export declare const recall: (input: Memory.RecallInput) => Effect.Effect<readonly Memory.Item[], Memory.MemoryError, Service>;
20
+ export declare const remember: (input: Memory.RememberInput) => Effect.Effect<void, Memory.MemoryError, Service>;
21
+ export declare const forget: (input: Memory.ForgetInput) => Effect.Effect<void, Memory.MemoryError, Service>;
22
+ export {};
@@ -0,0 +1,68 @@
1
+ import { Agent, Shared } from "../../schema/index";
2
+ import { Context, Effect, Layer, Schema } from "effect";
3
+ import { EmbeddingModel, Model } from "effect/unstable/ai";
4
+ declare const EmbeddingModelNotRegistered_base: Schema.Class<EmbeddingModelNotRegistered, Schema.TaggedStruct<"EmbeddingModelNotRegistered", {
5
+ readonly provider: Schema.String;
6
+ readonly model: Schema.String;
7
+ readonly registration_key: Schema.optionalKey<Schema.String>;
8
+ }>, import("effect/Cause").YieldableError>;
9
+ export declare class EmbeddingModelNotRegistered extends EmbeddingModelNotRegistered_base {
10
+ }
11
+ export interface ModelSelection {
12
+ readonly provider: string;
13
+ readonly model: string;
14
+ readonly registrationKey?: string | undefined;
15
+ }
16
+ export type ModelEnvironment = EmbeddingModel.EmbeddingModel | EmbeddingModel.Dimensions | Model.ProviderName | Model.ModelName;
17
+ export interface Registration {
18
+ readonly provider: string;
19
+ readonly model: string;
20
+ readonly registrationKey?: string | undefined;
21
+ readonly layer: Layer.Layer<ModelEnvironment>;
22
+ readonly metadata?: Shared.Metadata | undefined;
23
+ }
24
+ export interface RegisterInput {
25
+ readonly provider: string;
26
+ readonly model: string;
27
+ readonly registrationKey?: string | undefined;
28
+ readonly layer: Layer.Layer<ModelEnvironment>;
29
+ readonly metadata?: Shared.Metadata | undefined;
30
+ }
31
+ export interface LayerOptions {
32
+ readonly defaultSelection?: ModelSelection | undefined;
33
+ }
34
+ export interface DeterministicOptions {
35
+ readonly provider?: string | undefined;
36
+ readonly model?: string | undefined;
37
+ readonly dimensions?: number | undefined;
38
+ }
39
+ export interface Interface {
40
+ readonly register: (input: RegisterInput) => Effect.Effect<void>;
41
+ readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
42
+ readonly provide: <A, E, R>(selection: ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EmbeddingModelNotRegistered, Exclude<R, ModelEnvironment>>;
43
+ readonly provideDefault: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EmbeddingModelNotRegistered, Exclude<R, ModelEnvironment>>;
44
+ readonly provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | EmbeddingModelNotRegistered, Exclude<R, ModelEnvironment>>;
45
+ }
46
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EmbeddingModelService", Interface>;
47
+ export declare class Service extends Service_base {
48
+ }
49
+ export declare const registrationFromLayer: <Provides extends ModelEnvironment, R>(input: {
50
+ readonly provider: string;
51
+ readonly model: string;
52
+ readonly registrationKey?: string | undefined;
53
+ readonly layer: Layer.Layer<Provides, never, R>;
54
+ readonly metadata?: Shared.Metadata | undefined;
55
+ }) => Effect.Effect<Registration, never, R>;
56
+ export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>, options?: LayerOptions) => Layer.Layer<Service, never, never>;
57
+ export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>, options?: LayerOptions) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
58
+ export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>, options?: LayerOptions) => Layer.Layer<Service, never, never>;
59
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
60
+ export declare const deterministicLayer: (options?: DeterministicOptions) => Layer.Layer<EmbeddingModel.EmbeddingModel | EmbeddingModel.Dimensions, never, never>;
61
+ export declare const deterministicRegistration: (options?: DeterministicOptions) => Effect.Effect<Registration, never, never>;
62
+ export declare const deterministicTestLayer: (options?: DeterministicOptions) => Layer.Layer<Service, never, never>;
63
+ export declare const register: (input: RegisterInput) => Effect.Effect<void, never, Service>;
64
+ export declare const registrations: () => Effect.Effect<readonly Registration[], never, Service>;
65
+ export declare const provide: <A, E, R>(selection: ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, EmbeddingModelNotRegistered | E, Service | Exclude<R, ModelEnvironment>>;
66
+ export declare const provideDefault: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, EmbeddingModelNotRegistered | E, Service | Exclude<R, ModelEnvironment>>;
67
+ export declare const provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, EmbeddingModelNotRegistered | E, Service | Exclude<R, ModelEnvironment>>;
68
+ export {};
@@ -0,0 +1,34 @@
1
+ import { ModelRegistry } from "@batonfx/core";
2
+ import { Agent } from "../../schema/index";
3
+ import { Context, Effect, Layer } from "effect";
4
+ export declare const LanguageModelNotRegistered: typeof ModelRegistry.LanguageModelNotRegistered;
5
+ export type LanguageModelNotRegistered = ModelRegistry.LanguageModelNotRegistered;
6
+ export type Registration = ModelRegistry.Registration;
7
+ export type GovernanceOptions = ModelRegistry.GovernanceOptions;
8
+ export type RegisterInput = ModelRegistry.RegisterInput;
9
+ export type ModelEnvironment = ModelRegistry.ModelEnvironment;
10
+ export interface Interface {
11
+ readonly register: (input: RegisterInput) => Effect.Effect<void>;
12
+ readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
13
+ readonly provide: <A, E, R>(selection: Agent.ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | LanguageModelNotRegistered, Exclude<R, ModelEnvironment>>;
14
+ readonly provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | LanguageModelNotRegistered, Exclude<R, ModelEnvironment>>;
15
+ }
16
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/LanguageModelService", Interface>;
17
+ export declare class Service extends Service_base {
18
+ }
19
+ export declare const registrationFromLayer: <R>(input: {
20
+ readonly provider: string;
21
+ readonly model: string;
22
+ readonly registrationKey?: string;
23
+ readonly layer: Layer.Layer<import("effect/unstable/ai/LanguageModel").LanguageModel, never, R>;
24
+ readonly metadata?: ModelRegistry.Metadata;
25
+ }) => Effect.Effect<ModelRegistry.Registration, never, R>;
26
+ export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>, options?: GovernanceOptions) => Layer.Layer<Service, never, never>;
27
+ export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>, options?: GovernanceOptions) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
28
+ export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>, options?: GovernanceOptions) => Layer.Layer<Service, never, never>;
29
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
30
+ export declare const register: (input: ModelRegistry.RegisterInput) => Effect.Effect<void, never, Service>;
31
+ export declare const registrations: () => Effect.Effect<readonly ModelRegistry.Registration[], never, Service>;
32
+ export declare const provide: <A, E, R>(selection: Agent.ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, ModelRegistry.LanguageModelNotRegistered | E, Service | Exclude<R, ModelRegistry.ModelEnvironment>>;
33
+ export declare const provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, ModelRegistry.LanguageModelNotRegistered | E, Service | Exclude<R, ModelRegistry.ModelEnvironment>>;
34
+ export {};
@@ -0,0 +1,14 @@
1
+ import { ModelResilience } from "@batonfx/core";
2
+ import { Context, Layer, Schedule } from "effect";
3
+ export type Classification = ModelResilience.Classification;
4
+ export type Interface = ModelResilience.Interface;
5
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ModelCallPolicy", ModelResilience.Interface>;
6
+ export declare class Service extends Service_base {
7
+ }
8
+ export declare const defaultClassify: (error: unknown) => Classification;
9
+ export declare const defaultSchedule: Schedule.Schedule<unknown>;
10
+ export declare const make: (input?: Partial<Interface>) => Interface;
11
+ export declare const layer: (input?: Partial<Interface>) => Layer.Layer<Service, never, never>;
12
+ export declare const noRetryLayer: Layer.Layer<Service, never, never>;
13
+ export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
14
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Effect } from "effect";
2
+ export declare const recordExecutionAccepted: Effect.Effect<void, never, never>;
3
+ export declare const recordExecutionFinished: (status: string) => Effect.Effect<void, never, never>;
4
+ export declare const recordEnvelopeSent: (routeKind: string) => Effect.Effect<void, never, never>;
5
+ export declare const recordWaitTransitioned: (state: string) => Effect.Effect<void, never, never>;
6
+ export declare const recordChildRunSpawned: (kind: string) => Effect.Effect<void, never, never>;
7
+ export declare const recordAddressResolved: (routeKind: string) => Effect.Effect<void, never, never>;
8
+ export declare const recordEventAppended: (eventType: string) => Effect.Effect<void, never, never>;
9
+ export declare const recordEventReplayed: (source: string, count: number) => Effect.Effect<void, never, never>;
10
+ export declare const recordRunnerReadinessChecked: (database: string) => Effect.Effect<void, never, never>;
11
+ export declare const recordModelUsage: (input: {
12
+ readonly provider: string;
13
+ readonly model: string;
14
+ readonly finishReason: string;
15
+ readonly inputTokens: number;
16
+ readonly outputTokens: number;
17
+ }) => Effect.Effect<void, never, never>;
18
+ export declare const recordToolCall: (tool: string, outcome: "success" | "failure" | "denied" | "wait") => Effect.Effect<void, never, never>;
19
+ export declare const recordExecutionDuration: (status: string, durationMillis: number) => Effect.Effect<void, never, never>;
@@ -0,0 +1,30 @@
1
+ import { Presence, Shared } from "../../schema/index";
2
+ import { PresenceRepository } from "@relayfx/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;