@relayfx/test 0.3.1 → 0.3.2

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 (89) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +29 -20481
  3. package/dist/types/test/index.d.ts +0 -2
  4. package/dist/types/test/test-runtime.d.ts +6 -7
  5. package/dist/types/test/test-tools.d.ts +2 -2
  6. package/dist/types/test/wait-test-kit.d.ts +1 -1
  7. package/package.json +7 -6
  8. package/dist/types/runtime/address/address-book-service.d.ts +0 -74
  9. package/dist/types/runtime/address/address-resolution-service.d.ts +0 -172
  10. package/dist/types/runtime/agent/agent-loop-service.d.ts +0 -92
  11. package/dist/types/runtime/agent/agent-registry-service.d.ts +0 -31
  12. package/dist/types/runtime/agent/prompt-assembler-service.d.ts +0 -64
  13. package/dist/types/runtime/agent/relay-approvals.d.ts +0 -2
  14. package/dist/types/runtime/agent/relay-compaction.d.ts +0 -24
  15. package/dist/types/runtime/agent/relay-instructions.d.ts +0 -7
  16. package/dist/types/runtime/agent/relay-permissions.d.ts +0 -25
  17. package/dist/types/runtime/agent/relay-steering.d.ts +0 -17
  18. package/dist/types/runtime/agent/relay-tool-executor.d.ts +0 -22
  19. package/dist/types/runtime/agent/relay-tool-output.d.ts +0 -10
  20. package/dist/types/runtime/agent/sequence-allocator.d.ts +0 -8
  21. package/dist/types/runtime/child/child-fan-out-admission-service.d.ts +0 -30
  22. package/dist/types/runtime/child/child-fan-out-runtime.d.ts +0 -40
  23. package/dist/types/runtime/child/child-fan-out-transition-service.d.ts +0 -25
  24. package/dist/types/runtime/child/child-run-service.d.ts +0 -96
  25. package/dist/types/runtime/child/parent-notifier-service.d.ts +0 -42
  26. package/dist/types/runtime/child/spawn-child-run-tool.d.ts +0 -225
  27. package/dist/types/runtime/cluster/execution-entity.d.ts +0 -39
  28. package/dist/types/runtime/content/artifact-store-service.d.ts +0 -26
  29. package/dist/types/runtime/content/blob-store-service.d.ts +0 -54
  30. package/dist/types/runtime/entity/entity-instance-service.d.ts +0 -76
  31. package/dist/types/runtime/entity/entity-registry-service.d.ts +0 -35
  32. package/dist/types/runtime/envelope/envelope-service.d.ts +0 -56
  33. package/dist/types/runtime/execution/active-execution-registry.d.ts +0 -12
  34. package/dist/types/runtime/execution/event-log-service.d.ts +0 -93
  35. package/dist/types/runtime/execution/execution-service.d.ts +0 -66
  36. package/dist/types/runtime/execution/execution-watch-service.d.ts +0 -32
  37. package/dist/types/runtime/execution/session-stream-service.d.ts +0 -33
  38. package/dist/types/runtime/inbox/inbox-service.d.ts +0 -76
  39. package/dist/types/runtime/inbox/send-message-tool.d.ts +0 -27
  40. package/dist/types/runtime/inbox/wait-for-messages-tool.d.ts +0 -34
  41. package/dist/types/runtime/index.d.ts +0 -56
  42. package/dist/types/runtime/memory/memory-service.d.ts +0 -22
  43. package/dist/types/runtime/model/embedding-model-service.d.ts +0 -81
  44. package/dist/types/runtime/model/language-model-service.d.ts +0 -48
  45. package/dist/types/runtime/model/model-call-policy.d.ts +0 -14
  46. package/dist/types/runtime/observability/runtime-metrics.d.ts +0 -28
  47. package/dist/types/runtime/presence/presence-service.d.ts +0 -30
  48. package/dist/types/runtime/presence/presence-tool.d.ts +0 -20
  49. package/dist/types/runtime/runner/runner-runtime-service.d.ts +0 -149
  50. package/dist/types/runtime/schedule/scheduler-service.d.ts +0 -34
  51. package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +0 -27
  52. package/dist/types/runtime/session/session-store-service.d.ts +0 -23
  53. package/dist/types/runtime/skill/skill-registry-service.d.ts +0 -44
  54. package/dist/types/runtime/state/execution-state-service.d.ts +0 -60
  55. package/dist/types/runtime/state/state-tools.d.ts +0 -5
  56. package/dist/types/runtime/tool/tool-input-schema-digest.d.ts +0 -6
  57. package/dist/types/runtime/tool/tool-runtime-service.d.ts +0 -162
  58. package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +0 -13
  59. package/dist/types/runtime/topic/publish-to-topic-tool.d.ts +0 -24
  60. package/dist/types/runtime/topic/topic-service.d.ts +0 -50
  61. package/dist/types/runtime/wait/wait-service.d.ts +0 -81
  62. package/dist/types/runtime/wait/wait-signal.d.ts +0 -25
  63. package/dist/types/runtime/workflow/activity-version-registry.d.ts +0 -93
  64. package/dist/types/runtime/workflow/definition-runtime.d.ts +0 -95
  65. package/dist/types/runtime/workflow/execution-workflow.d.ts +0 -534
  66. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +0 -64
  67. package/dist/types/runtime/workspace/workspace-provider-service.d.ts +0 -112
  68. package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +0 -21
  69. package/dist/types/schema/address-schema.d.ts +0 -77
  70. package/dist/types/schema/agent-schema.d.ts +0 -901
  71. package/dist/types/schema/child-orchestration-schema.d.ts +0 -429
  72. package/dist/types/schema/content-schema.d.ts +0 -118
  73. package/dist/types/schema/entity-schema.d.ts +0 -40
  74. package/dist/types/schema/envelope-schema.d.ts +0 -180
  75. package/dist/types/schema/execution-schema.d.ts +0 -453
  76. package/dist/types/schema/ids-schema.d.ts +0 -106
  77. package/dist/types/schema/inbox-schema.d.ts +0 -81
  78. package/dist/types/schema/index.d.ts +0 -19
  79. package/dist/types/schema/presence-schema.d.ts +0 -28
  80. package/dist/types/schema/schedule-schema.d.ts +0 -79
  81. package/dist/types/schema/shared-schema.d.ts +0 -13
  82. package/dist/types/schema/skill-schema.d.ts +0 -260
  83. package/dist/types/schema/state-schema.d.ts +0 -35
  84. package/dist/types/schema/tool-schema.d.ts +0 -84
  85. package/dist/types/schema/wait-schema.d.ts +0 -98
  86. package/dist/types/schema/workflow-schema.d.ts +0 -2062
  87. package/dist/types/schema/workspace-schema.d.ts +0 -78
  88. package/dist/types/test/captured-model.d.ts +0 -19
  89. package/dist/types/test/scripted-model.d.ts +0 -49
@@ -1,5 +1,3 @@
1
- export * as ScriptedModel from "./scripted-model";
2
- export * as CapturedModel from "./captured-model";
3
1
  export * as TestTools from "./test-tools";
4
2
  export * as TestRuntime from "./test-runtime";
5
3
  export * as WaitTestKit from "./wait-test-kit";
@@ -1,9 +1,8 @@
1
- import { RunnerRuntime, ToolRuntime } from "../runtime/index";
1
+ import type { TestModel } from "@batonfx/test";
2
+ import { Runtime, ToolRuntime } from "@relayfx/sdk";
2
3
  import { Layer } from "effect";
3
- import { LanguageModel } from "effect/unstable/ai";
4
- import type { ScriptedTurn } from "./scripted-model";
5
- export declare const layer: typeof RunnerRuntime.testLayer;
4
+ export declare const layer: Layer.Layer<Runtime.EmbeddedOutput, Runtime.AcquisitionError, never>;
6
5
  export declare const layerWith: (options: {
7
- readonly model?: Layer.Layer<LanguageModel.LanguageModel> | ReadonlyArray<ScriptedTurn>;
8
- readonly tools?: ReadonlyArray<ToolRuntime.RegisteredTool>;
9
- }) => typeof RunnerRuntime.testLayer;
6
+ readonly model?: TestModel.Fixture;
7
+ readonly tools?: NonNullable<Parameters<typeof ToolRuntime.layer>[0]>;
8
+ }) => Layer.Layer<Runtime.EmbeddedOutput, Runtime.AcquisitionError, never>;
@@ -1,5 +1,5 @@
1
- import { ToolRuntime } from "../runtime/index";
2
- import type { Ids, Shared, Tool } from "../schema/index";
1
+ import { ToolRuntime } from "@relayfx/sdk";
2
+ import type { Ids, Shared, Tool } from "@relayfx/sdk";
3
3
  import { Effect } from "effect";
4
4
  export interface CapturedTool {
5
5
  readonly registered: ToolRuntime.RegisteredTool;
@@ -1,4 +1,4 @@
1
- import type { Ids } from "../schema/index";
1
+ import type { Ids } from "@relayfx/sdk";
2
2
  import { Client, Operation } from "@relayfx/sdk";
3
3
  import { Effect } from "effect";
4
4
  export declare const runThroughWait: <E, R>(options: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@relayfx/test",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "description": "Experimental deterministic test kit for Relay applications",
6
6
  "type": "module",
7
7
  "exports": {
@@ -30,16 +30,17 @@
30
30
  "url": "https://github.com/In-Time-Tec/relayfx/issues"
31
31
  },
32
32
  "scripts": {
33
- "build": "rm -rf dist && bun build ./src/index.ts --outdir dist --target bun --format esm --external effect --external 'effect/*' --external '@effect/*' --external '@relayfx/sdk' --external '@relayfx/sdk/*' && bun ../relay/scripts/build-types.ts && bun scripts/build-types.ts",
33
+ "build": "rm -rf dist && bun build ./src/index.ts --outdir dist --target bun --format esm --external effect --external 'effect/*' --external '@effect/*' --external '@relayfx/sdk' --external '@relayfx/sdk/*' && bun scripts/build-types.ts",
34
34
  "lint": "bun --cwd ../.. oxlint packages/test/src packages/test/scripts packages/test/test",
35
- "test": "bun --cwd ../.. vitest run packages/test/test --passWithNoTests",
35
+ "test": "bun --cwd ../.. --bun vitest run packages/test/test --passWithNoTests",
36
36
  "typecheck": "bun tsc --noEmit"
37
37
  },
38
38
  "dependencies": {
39
- "@relayfx/sdk": "0.3.1",
40
- "effect": "4.0.0-beta.93"
39
+ "@batonfx/test": "0.6.0",
40
+ "@relayfx/sdk": "0.3.2",
41
+ "effect": "4.0.0-beta.98"
41
42
  },
42
43
  "peerDependencies": {
43
- "@effect/vitest": "4.0.0-beta.93"
44
+ "@effect/vitest": "4.0.0-beta.98"
44
45
  }
45
46
  }
@@ -1,74 +0,0 @@
1
- import { Address, Ids } from "../../schema/index";
2
- import { AddressBookRepository } from "@relayfx/store-sql/portable";
3
- import { Context, Effect, Layer, Schema } from "effect";
4
- export declare const RouteKind: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
5
- export type RouteKind = typeof RouteKind.Type;
6
- export declare const Route: Schema.Struct<{
7
- readonly kind: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
8
- readonly route_key: Schema.String;
9
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
10
- }>;
11
- export interface Route extends Address.Route {
12
- }
13
- export declare const RouteRecord: Schema.Struct<{
14
- readonly id: Schema.brand<Schema.String, "Relay.AddressBookEntryId"> & {
15
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressBookEntryId">;
16
- };
17
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
18
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
19
- };
20
- readonly route: Schema.Struct<{
21
- readonly kind: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
22
- readonly route_key: Schema.String;
23
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
24
- }>;
25
- readonly created_at: Schema.Int;
26
- readonly updated_at: Schema.Int;
27
- }>;
28
- export interface RouteRecord extends Address.RouteRecord {
29
- }
30
- declare const AddressNotFound_base: Schema.Class<AddressNotFound, Schema.TaggedStruct<"AddressNotFound", {
31
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
32
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
33
- };
34
- }>, import("effect/Cause").YieldableError>;
35
- export declare class AddressNotFound extends AddressNotFound_base {
36
- }
37
- declare const AddressUnavailable_base: Schema.Class<AddressUnavailable, Schema.TaggedStruct<"AddressUnavailable", {
38
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
39
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
40
- };
41
- readonly route_key: Schema.String;
42
- }>, import("effect/Cause").YieldableError>;
43
- export declare class AddressUnavailable extends AddressUnavailable_base {
44
- }
45
- declare const AddressDeferred_base: Schema.Class<AddressDeferred, Schema.TaggedStruct<"AddressDeferred", {
46
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
47
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
48
- };
49
- readonly route_key: Schema.String;
50
- }>, import("effect/Cause").YieldableError>;
51
- export declare class AddressDeferred extends AddressDeferred_base {
52
- }
53
- declare const AddressBookServiceError_base: Schema.Class<AddressBookServiceError, Schema.TaggedStruct<"AddressBookServiceError", {
54
- readonly message: Schema.String;
55
- }>, import("effect/Cause").YieldableError>;
56
- export declare class AddressBookServiceError extends AddressBookServiceError_base {
57
- }
58
- export interface Interface {
59
- readonly resolve: (addressId: Ids.AddressId) => Effect.Effect<Route, AddressNotFound | AddressUnavailable | AddressDeferred | AddressBookServiceError>;
60
- readonly register: (addressId: Ids.AddressId, route: Route) => Effect.Effect<Address.RouteRegistered, AddressBookServiceError>;
61
- readonly get: (addressId: Ids.AddressId) => Effect.Effect<RouteRecord | undefined, AddressBookServiceError>;
62
- readonly list: Effect.Effect<Address.RouteList, AddressBookServiceError>;
63
- }
64
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/address/address-book-service/Service", Interface>;
65
- export declare class Service extends Service_base {
66
- }
67
- export declare const layerFromRepository: Layer.Layer<Service, never, AddressBookRepository.Service>;
68
- export declare const memoryLayer: (entries?: Iterable<readonly [Ids.AddressId, Route]>) => Layer.Layer<Service, never, never>;
69
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
70
- export declare const resolve: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<Route, AddressBookServiceError | AddressDeferred | AddressNotFound | AddressUnavailable, Service>;
71
- export declare const register: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">, route: Route) => Effect.Effect<Address.RouteRegistered, AddressBookServiceError, Service>;
72
- export declare const get: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<RouteRecord | undefined, AddressBookServiceError, Service>;
73
- export declare const list: () => Effect.Effect<Address.RouteList, AddressBookServiceError, Service>;
74
- export {};
@@ -1,172 +0,0 @@
1
- import { Agent, Ids } from "../../schema/index";
2
- import { Context, Effect, Layer, Schema } from "effect";
3
- import { Service as AddressBookService } from "./address-book-service";
4
- import { Service as AgentRegistryService } from "../agent/agent-registry-service";
5
- declare const AddressRouteNotFound_base: Schema.Class<AddressRouteNotFound, Schema.TaggedStruct<"AddressRouteNotFound", {
6
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
7
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
8
- };
9
- }>, import("effect/Cause").YieldableError>;
10
- export declare class AddressRouteNotFound extends AddressRouteNotFound_base {
11
- }
12
- declare const AddressRouteKindMismatch_base: Schema.Class<AddressRouteKindMismatch, Schema.TaggedStruct<"AddressRouteKindMismatch", {
13
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
14
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
15
- };
16
- readonly expected: Schema.Literal<"local-agent">;
17
- readonly actual: Schema.Literals<readonly ["local-agent", "local-execution", "remote-relay", "local-adapter", "unavailable", "deferred-retry"]>;
18
- readonly route_key: Schema.String;
19
- }>, import("effect/Cause").YieldableError>;
20
- export declare class AddressRouteKindMismatch extends AddressRouteKindMismatch_base {
21
- }
22
- declare const AddressAgentDefinitionNotFound_base: Schema.Class<AddressAgentDefinitionNotFound, Schema.TaggedStruct<"AddressAgentDefinitionNotFound", {
23
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
24
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
25
- };
26
- readonly agent_id: Schema.brand<Schema.String, "Relay.AgentId"> & {
27
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
28
- };
29
- }>, import("effect/Cause").YieldableError>;
30
- export declare class AddressAgentDefinitionNotFound extends AddressAgentDefinitionNotFound_base {
31
- }
32
- declare const AddressResolutionError_base: Schema.Class<AddressResolutionError, Schema.TaggedStruct<"AddressResolutionError", {
33
- readonly message: Schema.String;
34
- }>, import("effect/Cause").YieldableError>;
35
- export declare class AddressResolutionError extends AddressResolutionError_base {
36
- }
37
- export declare const LocalAgentRoute: Schema.Struct<{
38
- readonly kind: Schema.Literal<"local-agent">;
39
- readonly route_key: Schema.String;
40
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
41
- }>;
42
- export interface LocalAgentRoute extends Schema.Schema.Type<typeof LocalAgentRoute> {
43
- }
44
- export declare const LocalAgentTarget: Schema.Struct<{
45
- readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
46
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
47
- };
48
- readonly route: Schema.Struct<{
49
- readonly kind: Schema.Literal<"local-agent">;
50
- readonly route_key: Schema.String;
51
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
52
- }>;
53
- readonly agent_id: Schema.brand<Schema.String, "Relay.AgentId"> & {
54
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
55
- };
56
- readonly agent_revision: Schema.Int;
57
- readonly agent_snapshot: Schema.Codec<Agent.Definition, {
58
- readonly name: string;
59
- readonly instructions?: string;
60
- readonly model: {
61
- readonly provider: string;
62
- readonly model: string;
63
- readonly registration_key?: string;
64
- readonly request_options?: {
65
- readonly [x: string]: Schema.Json;
66
- };
67
- readonly metadata?: {
68
- readonly [x: string]: Schema.Json;
69
- };
70
- };
71
- readonly tool_names: readonly string[];
72
- readonly permissions: readonly {
73
- readonly name: string;
74
- readonly value: Schema.Json;
75
- readonly metadata?: {
76
- readonly [x: string]: Schema.Json;
77
- };
78
- }[];
79
- readonly skill_definition_ids?: readonly string[];
80
- readonly permission_rules?: {
81
- readonly rules: readonly {
82
- readonly pattern: string;
83
- readonly level: "allow" | "ask" | "deny";
84
- readonly reason?: string;
85
- }[];
86
- readonly fallback?: "allow" | "ask" | "deny";
87
- };
88
- readonly turn_policy?: Agent.TurnPolicySnapshot;
89
- readonly compaction_policy?: {
90
- readonly context_window: number;
91
- readonly reserve_tokens: number;
92
- readonly keep_recent_tokens: number;
93
- readonly summary_model?: {
94
- readonly provider: string;
95
- readonly model: string;
96
- readonly registration_key?: string;
97
- readonly request_options?: {
98
- readonly [x: string]: Schema.Json;
99
- };
100
- readonly metadata?: {
101
- readonly [x: string]: Schema.Json;
102
- };
103
- };
104
- };
105
- readonly max_tool_turns?: number;
106
- readonly max_wait_turns?: number;
107
- readonly token_budget?: number;
108
- readonly child_run_presets?: {
109
- readonly [x: string]: {
110
- readonly instructions?: string;
111
- readonly model?: {
112
- readonly provider: string;
113
- readonly model: string;
114
- readonly registration_key?: string;
115
- readonly request_options?: {
116
- readonly [x: string]: Schema.Json;
117
- };
118
- readonly metadata?: {
119
- readonly [x: string]: Schema.Json;
120
- };
121
- };
122
- readonly compaction_policy?: {
123
- readonly context_window: number;
124
- readonly reserve_tokens: number;
125
- readonly keep_recent_tokens: number;
126
- readonly summary_model?: {
127
- readonly provider: string;
128
- readonly model: string;
129
- readonly registration_key?: string;
130
- readonly request_options?: {
131
- readonly [x: string]: Schema.Json;
132
- };
133
- readonly metadata?: {
134
- readonly [x: string]: Schema.Json;
135
- };
136
- };
137
- };
138
- readonly tool_names?: readonly string[];
139
- readonly permissions?: readonly string[];
140
- readonly workspace_policy?: {
141
- readonly mode: "fork" | "share";
142
- readonly fallback?: "fail" | "fresh";
143
- };
144
- readonly output_schema_ref?: string;
145
- readonly metadata?: {
146
- readonly [x: string]: Schema.Json;
147
- };
148
- };
149
- };
150
- readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
151
- readonly name: Schema.String;
152
- readonly preset_name: Schema.String;
153
- }, "Encoded">[];
154
- readonly output_schema_ref?: string;
155
- readonly metadata?: {
156
- readonly [x: string]: Schema.Json;
157
- };
158
- }, never, never>;
159
- readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
160
- }>;
161
- export interface LocalAgentTarget extends Schema.Schema.Type<typeof LocalAgentTarget> {
162
- }
163
- export interface Interface {
164
- readonly resolveLocalAgent: (addressId: Ids.AddressId) => Effect.Effect<LocalAgentTarget, AddressRouteNotFound | AddressRouteKindMismatch | AddressAgentDefinitionNotFound | AddressResolutionError>;
165
- }
166
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/address/address-resolution-service/Service", Interface>;
167
- export declare class Service extends Service_base {
168
- }
169
- export declare const layer: Layer.Layer<Service, never, AddressBookService | AgentRegistryService>;
170
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
171
- export declare const resolveLocalAgent: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<LocalAgentTarget, AddressAgentDefinitionNotFound | AddressResolutionError | AddressRouteKindMismatch | AddressRouteNotFound, Service>;
172
- export {};
@@ -1,92 +0,0 @@
1
- import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
2
- import { AgentChatRepository } from "@relayfx/store-sql/portable";
3
- import { Cause, Context, Effect, Layer, Schema } from "effect";
4
- import { Tool as AiTool } from "effect/unstable/ai";
5
- import type { DispatchInput } from "../child/spawn-child-run-tool";
6
- import { Service as EventLogService } from "../execution/event-log-service";
7
- import { Service as LanguageModelServiceService } from "../model/language-model-service";
8
- import { Service as ModelCallPolicyService } from "../model/model-call-policy";
9
- import { Service as SchemaRegistryService } from "../schema-registry/schema-registry-service";
10
- import { Service as ToolRuntimeService } from "../tool/tool-runtime-service";
11
- import type { ToolRuntimeError } from "../tool/tool-runtime-service";
12
- import { Service as PromptAssemblerService } from "./prompt-assembler-service";
13
- declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
14
- readonly message: Schema.String;
15
- readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
16
- }>, Cause.YieldableError>;
17
- export declare class AgentLoopError extends AgentLoopError_base {
18
- }
19
- declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested, Schema.TaggedStruct<"AgentLoopWaitRequested", {
20
- readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
21
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
22
- };
23
- readonly tool_call: Schema.Struct<{
24
- readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
25
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
26
- };
27
- readonly name: Schema.String;
28
- readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
29
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
30
- }>;
31
- readonly next_event_sequence: Schema.Int;
32
- }>, Cause.YieldableError>;
33
- export declare class AgentLoopWaitRequested extends AgentLoopWaitRequested_base {
34
- }
35
- declare const AgentLoopBudgetExceeded_base: Schema.Class<AgentLoopBudgetExceeded, Schema.TaggedStruct<"AgentLoopBudgetExceeded", {
36
- readonly tokens_used: Schema.Int;
37
- readonly token_budget: Schema.Int;
38
- readonly next_event_sequence: Schema.Int;
39
- }>, Cause.YieldableError>;
40
- export declare class AgentLoopBudgetExceeded extends AgentLoopBudgetExceeded_base {
41
- }
42
- export interface RunInput {
43
- readonly executionId: Ids.ExecutionId;
44
- readonly sessionId?: Ids.SessionId;
45
- readonly agent: Agent.Definition;
46
- readonly agentId?: Ids.AgentId;
47
- readonly agentRevision?: Agent.DefinitionRevision;
48
- readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
49
- readonly input: ReadonlyArray<Content.Part>;
50
- readonly resumeToolCall?: Tool.Call;
51
- readonly memorySubjectId?: Ids.MemorySubjectId;
52
- readonly eventSequence: Execution.ExecutionEventSequence;
53
- readonly startedAt: number;
54
- readonly completedAt: number;
55
- readonly steeringEnabled?: boolean;
56
- readonly toolOutputMaxBytes?: number | null;
57
- readonly sessionEntryScope?: string;
58
- readonly dispatchChildRun?: (input: DispatchInput) => Effect.Effect<void, ToolRuntimeError>;
59
- }
60
- export interface RunResult {
61
- readonly metadata: Shared.Metadata;
62
- readonly nextEventSequence: Execution.ExecutionEventSequence;
63
- }
64
- export interface Interface {
65
- readonly run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded>;
66
- }
67
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/agent/agent-loop-service/Service", Interface>;
68
- export declare class Service extends Service_base {
69
- }
70
- /**
71
- * Prompt for the terminal structured turn. The transcript already holds the full
72
- * conversation history (system message, user input, and every tool result), so
73
- * this single instruction is enough to elicit the typed final output.
74
- *
75
- * @experimental
76
- */
77
- export declare const STRUCTURED_TURN_PROMPT = "Return the final structured output for the task above.";
78
- export declare const toolFromDefinition: (definition: Tool.Definition) => AiTool.Dynamic<string, {
79
- readonly parameters: Schema.Codec<unknown, unknown, never, never>;
80
- readonly success: Schema.Unknown;
81
- readonly failure: Schema.Never;
82
- readonly failureMode: "error";
83
- }, never>;
84
- /** Map a Baton run failure (or an upstream model error) to the public error types. */
85
- export declare const mapBoundaryError: {
86
- (current: Execution.ExecutionEventSequence): (error: unknown) => AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
87
- (error: unknown, current: Execution.ExecutionEventSequence): AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
88
- };
89
- export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLogService | ToolRuntimeService | LanguageModelServiceService | ModelCallPolicyService | SchemaRegistryService | PromptAssemblerService>;
90
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
91
- export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopBudgetExceeded | AgentLoopError | AgentLoopWaitRequested, Service>;
92
- export {};
@@ -1,31 +0,0 @@
1
- import { Agent, Ids } from "../../schema/index";
2
- import { AgentDefinitionRepository } from "@relayfx/store-sql/portable";
3
- import { Context, Effect, Layer, Schema } from "effect";
4
- declare const AgentDefinitionInvalid_base: Schema.Class<AgentDefinitionInvalid, Schema.TaggedStruct<"AgentDefinitionInvalid", {
5
- readonly message: Schema.String;
6
- }>, import("effect/Cause").YieldableError>;
7
- export declare class AgentDefinitionInvalid extends AgentDefinitionInvalid_base {
8
- }
9
- declare const AgentRegistryError_base: Schema.Class<AgentRegistryError, Schema.TaggedStruct<"AgentRegistryError", {
10
- readonly message: Schema.String;
11
- }>, import("effect/Cause").YieldableError>;
12
- export declare class AgentRegistryError extends AgentRegistryError_base {
13
- }
14
- export interface Interface {
15
- readonly register: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, AgentDefinitionInvalid | AgentRegistryError>;
16
- readonly get: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRecord | undefined, AgentRegistryError>;
17
- readonly getRevision: (input: AgentDefinitionRepository.GetAgentDefinitionRevisionInput) => Effect.Effect<Agent.DefinitionRevisionRecord | undefined, AgentRegistryError>;
18
- readonly list: Effect.Effect<Agent.DefinitionList, AgentRegistryError>;
19
- readonly listRevisions: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRevisionList, AgentRegistryError>;
20
- }
21
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/agent/agent-registry-service/Service", Interface>;
22
- export declare class Service extends Service_base {
23
- }
24
- export declare const layer: Layer.Layer<Service, never, AgentDefinitionRepository.Service>;
25
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
26
- export declare const register: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, AgentDefinitionInvalid | AgentRegistryError, Service>;
27
- export declare const get: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRecord | undefined, AgentRegistryError, Service>;
28
- export declare const getRevision: (input: AgentDefinitionRepository.GetAgentDefinitionRevisionInput) => Effect.Effect<Agent.DefinitionRevisionRecord | undefined, AgentRegistryError, Service>;
29
- export declare const list: () => Effect.Effect<Agent.DefinitionList, AgentRegistryError, Service>;
30
- export declare const listRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRevisionList, AgentRegistryError, Service>;
31
- export {};
@@ -1,64 +0,0 @@
1
- import { Agent, Content, Shared, Tool } from "../../schema/index";
2
- import { Context, Effect, Layer, Schema } from "effect";
3
- import { Prompt } from "effect/unstable/ai";
4
- import { Service as ArtifactStoreService } from "../content/artifact-store-service";
5
- import { Service as BlobStoreService } from "../content/blob-store-service";
6
- declare const PromptAssemblerError_base: Schema.Class<PromptAssemblerError, Schema.TaggedStruct<"PromptAssemblerError", {
7
- readonly message: Schema.String;
8
- }>, import("effect/Cause").YieldableError>;
9
- export declare class PromptAssemblerError extends PromptAssemblerError_base {
10
- }
11
- export interface AssembleInput {
12
- readonly agent: Agent.Definition;
13
- readonly tools: ReadonlyArray<Tool.Definition>;
14
- readonly input: ReadonlyArray<Content.Part>;
15
- readonly tokenBudget?: number;
16
- readonly metadata?: Shared.Metadata;
17
- }
18
- export interface Assembled {
19
- readonly system: string;
20
- readonly prompt: Prompt.Prompt;
21
- }
22
- export interface Interface {
23
- readonly assemble: (input: AssembleInput) => Effect.Effect<Assembled, PromptAssemblerError>;
24
- }
25
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/agent/prompt-assembler-service/Service", Interface>;
26
- export declare class Service extends Service_base {
27
- }
28
- export type PureContentPart = Content.TextPart | Content.StructuredPart | Content.ToolCallPart | Content.ToolResultPart;
29
- export declare const contentToPromptPart: (part: PureContentPart) => Prompt.UserMessagePart;
30
- /**
31
- * Default assembler that resolves reference content parts through the
32
- * {@link BlobStore} and {@link ArtifactStore} it reads from context. Requires
33
- * both stores to be provided (`runner-runtime-service.ts` wires passthrough
34
- * stores by default; see `docs/spec/29-blob-and-artifact-stores.md`).
35
- *
36
- * @experimental
37
- */
38
- export declare const defaultLayerWithStores: Layer.Layer<Service, never, BlobStoreService | ArtifactStoreService>;
39
- /**
40
- * Default assembler: reproduces the agent loop's historical prompt construction,
41
- * minus the model-selection dump (see `docs/spec/28-prompt-assembly.md`).
42
- * Bakes in passthrough stores so it stays self-contained and behavior is
43
- * preserved bit-for-bit (see `docs/spec/29-blob-and-artifact-stores.md`).
44
- *
45
- * @experimental
46
- */
47
- export declare const defaultLayer: Layer.Layer<Service>;
48
- /**
49
- * Wraps a custom assembler implementation as a layer.
50
- *
51
- * @experimental
52
- */
53
- export declare const layer: (implementation: Interface) => Layer.Layer<Service>;
54
- /**
55
- * Alias of {@link layer} for test wiring.
56
- *
57
- * @experimental
58
- */
59
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service>;
60
- /**
61
- * @experimental
62
- */
63
- export declare const assemble: (input: AssembleInput) => Effect.Effect<Assembled, PromptAssemblerError, Service>;
64
- export {};
@@ -1,2 +0,0 @@
1
- import { Approvals } from "@batonfx/core";
2
- export declare const layer: import("effect/Layer").Layer<Approvals.Approvals, never, never>;
@@ -1,24 +0,0 @@
1
- import { Compaction, ModelRegistry } from "@batonfx/core";
2
- import { Ids } from "../../schema/index";
3
- import { CompactionRepository } from "@relayfx/store-sql/portable";
4
- import { Effect, Layer } from "effect";
5
- export interface Options {
6
- readonly contextWindow?: number;
7
- readonly reserveTokens?: number;
8
- readonly keepRecentTokens?: number;
9
- readonly summaryModel?: Effect.Effect<Layer.Layer<ModelRegistry.ModelEnvironment>, Compaction.CompactionError>;
10
- }
11
- export interface Config {
12
- readonly executionId: Ids.ExecutionId;
13
- readonly repository: CompactionRepository.Interface;
14
- readonly options?: Options;
15
- readonly strategy?: Compaction.Strategy;
16
- }
17
- export declare const checkpointId: (input: {
18
- readonly executionId: Ids.ExecutionId;
19
- readonly turn: number;
20
- readonly firstKeptEntryId: Ids.SessionEntryId | string;
21
- }) => string;
22
- export declare const strategy: (config: Config) => Compaction.Strategy;
23
- export declare const make: (config: Config) => Compaction.Interface;
24
- export declare const layer: (config: Config) => Layer.Layer<Compaction.Compaction>;
@@ -1,7 +0,0 @@
1
- import { Instructions } from "@batonfx/core";
2
- export interface ContextEpoch {
3
- readonly baseline: string;
4
- readonly dynamicSourceIds: ReadonlyArray<string>;
5
- }
6
- export declare const layerFromEpoch: (epoch: ContextEpoch) => import("effect/Layer").Layer<Instructions.Instructions, never, never>;
7
- export declare const layer: (system: string) => import("effect/Layer").Layer<Instructions.Instructions, never, never>;
@@ -1,25 +0,0 @@
1
- import { Permissions } from "@batonfx/core";
2
- import { Agent, Execution, Ids } from "../../schema/index";
3
- import { PermissionRuleRepository } from "@relayfx/store-sql/portable";
4
- import { Effect, Layer } from "effect";
5
- import type { Interface as EventLogInterface } from "../execution/event-log-service";
6
- import type { Interface as WaitServiceInterface } from "../wait/wait-service";
7
- export interface SequenceAllocator {
8
- readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
9
- readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
10
- readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
11
- }
12
- export interface Config {
13
- readonly ruleset: Agent.PermissionRuleset;
14
- readonly repository: PermissionRuleRepository.Interface;
15
- readonly waits: WaitServiceInterface;
16
- readonly eventLog: EventLogInterface;
17
- readonly allocator: SequenceAllocator;
18
- readonly executionId: Ids.ExecutionId;
19
- readonly agentName: string;
20
- readonly scope: string;
21
- readonly startedAt: number;
22
- readonly eventSequence: Execution.ExecutionEventSequence;
23
- }
24
- export declare const waitIdForToolCall: (toolCallId: string) => string & import("effect/Brand").Brand<"Relay.WaitId">;
25
- export declare const layer: (config: Config) => Layer.Layer<Permissions.Permissions | Permissions.RuleStore, never, never>;
@@ -1,17 +0,0 @@
1
- import { Steering } from "@batonfx/core";
2
- import { Execution, Ids } from "../../schema/index";
3
- import { SteeringRepository } from "@relayfx/store-sql/portable";
4
- import { Effect, Layer } from "effect";
5
- import type { Interface } from "../execution/event-log-service";
6
- export interface SequenceAllocator {
7
- readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
8
- }
9
- export interface Config {
10
- readonly repository: SteeringRepository.Interface;
11
- readonly eventLog: Interface;
12
- readonly allocator: SequenceAllocator;
13
- readonly executionId: Ids.ExecutionId;
14
- readonly startedAt: number;
15
- readonly eventSequence: Execution.ExecutionEventSequence;
16
- }
17
- export declare const layer: (config: Config) => Layer.Layer<Steering.Steering>;
@@ -1,22 +0,0 @@
1
- import { ToolExecutor } from "@batonfx/core";
2
- import { Execution, Ids, Tool } from "../../schema/index";
3
- import { Effect, Layer } from "effect";
4
- import type { Interface as ToolRuntimeInterface, RegisteredTool } from "../tool/tool-runtime-service";
5
- import type { Interface as EventLogInterface } from "../execution/event-log-service";
6
- export interface Config {
7
- readonly toolRuntime: ToolRuntimeInterface;
8
- readonly eventLog: EventLogInterface;
9
- readonly allocator: {
10
- readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
11
- readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
12
- };
13
- readonly executionId: Ids.ExecutionId;
14
- readonly permissions: ReadonlyArray<Tool.Permission>;
15
- readonly startedAt: number;
16
- readonly eventSequence: Execution.ExecutionEventSequence;
17
- readonly toolOutputMaxBytes?: number;
18
- readonly resumedToolCallId?: Ids.ToolCallId;
19
- readonly extraTools?: ReadonlyArray<RegisteredTool>;
20
- }
21
- export declare const make: (config: Config) => ToolExecutor.Interface;
22
- export declare const layer: (config: Config) => Layer.Layer<ToolExecutor.ToolExecutor>;
@@ -1,10 +0,0 @@
1
- import { ToolOutput } from "@batonfx/core";
2
- import { Effect, Layer, Option } from "effect";
3
- import type { Interface as BlobStoreInterface, Service as BlobStoreService } from "../content/blob-store-service";
4
- export declare const store: {
5
- (blobStore: BlobStoreInterface, toolCallId: string, content: unknown): Effect.Effect<Option.Option<string>, ToolOutput.ToolOutputError>;
6
- (toolCallId: string, content: unknown): (blobStore: BlobStoreInterface) => Effect.Effect<Option.Option<string>, ToolOutput.ToolOutputError>;
7
- };
8
- export declare const make: (blobStore: BlobStoreInterface) => ToolOutput.StoreInterface;
9
- export declare const layerFromBlobStore: (blobStore: BlobStoreInterface) => Layer.Layer<ToolOutput.ToolOutputStore>;
10
- export declare const layer: Layer.Layer<ToolOutput.ToolOutputStore, never, BlobStoreService>;
@@ -1,8 +0,0 @@
1
- import { Execution } from "../../schema/index";
2
- import { Effect } from "effect";
3
- export interface SequenceAllocator {
4
- readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
5
- readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
6
- readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
7
- }
8
- export declare const make: (first: Execution.ExecutionEventSequence) => Effect.Effect<SequenceAllocator>;