@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.
- package/README.md +5 -0
- package/dist/index.js +18190 -0
- package/dist/types/runtime/address/address-book-service.d.ts +74 -0
- package/dist/types/runtime/address/address-resolution-service.d.ts +140 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +85 -0
- package/dist/types/runtime/agent/agent-registry-service.d.ts +31 -0
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +64 -0
- package/dist/types/runtime/agent/relay-approvals.d.ts +2 -0
- package/dist/types/runtime/agent/relay-compaction.d.ts +23 -0
- package/dist/types/runtime/agent/relay-instructions.d.ts +7 -0
- package/dist/types/runtime/agent/relay-permissions.d.ts +25 -0
- package/dist/types/runtime/agent/relay-steering.d.ts +17 -0
- package/dist/types/runtime/agent/relay-tool-executor.d.ts +22 -0
- package/dist/types/runtime/agent/relay-tool-output.d.ts +7 -0
- package/dist/types/runtime/agent/sequence-allocator.d.ts +8 -0
- package/dist/types/runtime/child/child-run-service.d.ts +90 -0
- package/dist/types/runtime/child/parent-notifier-service.d.ts +40 -0
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +211 -0
- package/dist/types/runtime/cluster/execution-entity.d.ts +37 -0
- package/dist/types/runtime/content/artifact-store-service.d.ts +26 -0
- package/dist/types/runtime/content/blob-store-service.d.ts +54 -0
- package/dist/types/runtime/entity/entity-instance-service.d.ts +67 -0
- package/dist/types/runtime/entity/entity-registry-service.d.ts +35 -0
- package/dist/types/runtime/envelope/envelope-service.d.ts +56 -0
- package/dist/types/runtime/execution/event-log-service.d.ts +68 -0
- package/dist/types/runtime/execution/execution-service.d.ts +65 -0
- package/dist/types/runtime/execution/execution-watch-service.d.ts +32 -0
- package/dist/types/runtime/execution/session-stream-service.d.ts +33 -0
- package/dist/types/runtime/inbox/inbox-service.d.ts +76 -0
- package/dist/types/runtime/inbox/send-message-tool.d.ts +27 -0
- package/dist/types/runtime/inbox/wait-for-messages-tool.d.ts +34 -0
- package/dist/types/runtime/index.d.ts +51 -0
- package/dist/types/runtime/memory/memory-service.d.ts +22 -0
- package/dist/types/runtime/model/embedding-model-service.d.ts +68 -0
- package/dist/types/runtime/model/language-model-service.d.ts +34 -0
- package/dist/types/runtime/model/model-call-policy.d.ts +14 -0
- package/dist/types/runtime/observability/runtime-metrics.d.ts +19 -0
- package/dist/types/runtime/presence/presence-service.d.ts +30 -0
- package/dist/types/runtime/presence/presence-tool.d.ts +20 -0
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +149 -0
- package/dist/types/runtime/schedule/scheduler-service.d.ts +34 -0
- package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +27 -0
- package/dist/types/runtime/session/session-store-service.d.ts +14 -0
- package/dist/types/runtime/skill/skill-registry-service.d.ts +44 -0
- package/dist/types/runtime/state/execution-state-service.d.ts +57 -0
- package/dist/types/runtime/state/state-tools.d.ts +5 -0
- package/dist/types/runtime/tool/tool-input-schema-digest.d.ts +6 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +139 -0
- package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +13 -0
- package/dist/types/runtime/topic/publish-to-topic-tool.d.ts +24 -0
- package/dist/types/runtime/topic/topic-service.d.ts +50 -0
- package/dist/types/runtime/wait/wait-service.d.ts +81 -0
- package/dist/types/runtime/wait/wait-signal.d.ts +16 -0
- package/dist/types/runtime/workflow/activity-version-registry.d.ts +89 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +475 -0
- package/dist/types/runtime/workspace/workspace-planner-service.d.ts +64 -0
- package/dist/types/runtime/workspace/workspace-provider-service.d.ts +108 -0
- package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +21 -0
- package/dist/types/schema/address-schema.d.ts +77 -0
- package/dist/types/schema/agent-schema.d.ts +658 -0
- package/dist/types/schema/content-schema.d.ts +118 -0
- package/dist/types/schema/entity-schema.d.ts +40 -0
- package/dist/types/schema/envelope-schema.d.ts +180 -0
- package/dist/types/schema/execution-schema.d.ts +347 -0
- package/dist/types/schema/ids-schema.d.ts +94 -0
- package/dist/types/schema/inbox-schema.d.ts +81 -0
- package/dist/types/schema/index.d.ts +16 -0
- package/dist/types/schema/presence-schema.d.ts +28 -0
- package/dist/types/schema/schedule-schema.d.ts +79 -0
- package/dist/types/schema/shared-schema.d.ts +13 -0
- package/dist/types/schema/skill-schema.d.ts +260 -0
- package/dist/types/schema/state-schema.d.ts +35 -0
- package/dist/types/schema/tool-schema.d.ts +84 -0
- package/dist/types/schema/workspace-schema.d.ts +78 -0
- package/dist/types/test/captured-model.d.ts +13 -0
- package/dist/types/test/index.d.ts +6 -0
- package/dist/types/test/scripted-model.d.ts +39 -0
- package/dist/types/test/test-runtime.d.ts +9 -0
- package/dist/types/test/test-tools.d.ts +18 -0
- package/dist/types/test/wait-test-kit.d.ts +9 -0
- package/package.json +45 -0
|
@@ -0,0 +1,74 @@
|
|
|
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/AddressBook", 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, AddressNotFound | AddressUnavailable | AddressDeferred | AddressBookServiceError, 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 {};
|
|
@@ -0,0 +1,140 @@
|
|
|
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 permissions: readonly {
|
|
60
|
+
readonly name: string;
|
|
61
|
+
readonly value: Schema.Json;
|
|
62
|
+
readonly metadata?: {
|
|
63
|
+
readonly [x: string]: Schema.Json;
|
|
64
|
+
};
|
|
65
|
+
}[];
|
|
66
|
+
readonly model: {
|
|
67
|
+
readonly provider: string;
|
|
68
|
+
readonly model: string;
|
|
69
|
+
readonly metadata?: {
|
|
70
|
+
readonly [x: string]: Schema.Json;
|
|
71
|
+
};
|
|
72
|
+
readonly registration_key?: string;
|
|
73
|
+
readonly request_options?: {
|
|
74
|
+
readonly [x: string]: Schema.Json;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly tool_names: readonly string[];
|
|
78
|
+
readonly metadata?: {
|
|
79
|
+
readonly [x: string]: Schema.Json;
|
|
80
|
+
};
|
|
81
|
+
readonly instructions?: string;
|
|
82
|
+
readonly output_schema_ref?: string;
|
|
83
|
+
readonly skill_definition_ids?: readonly string[];
|
|
84
|
+
readonly permission_rules?: {
|
|
85
|
+
readonly rules: readonly {
|
|
86
|
+
readonly pattern: string;
|
|
87
|
+
readonly level: "allow" | "deny" | "ask";
|
|
88
|
+
readonly reason?: string;
|
|
89
|
+
}[];
|
|
90
|
+
readonly fallback?: "allow" | "deny" | "ask";
|
|
91
|
+
};
|
|
92
|
+
readonly turn_policy?: Agent.TurnPolicySnapshot;
|
|
93
|
+
readonly max_tool_turns?: number;
|
|
94
|
+
readonly max_wait_turns?: number;
|
|
95
|
+
readonly token_budget?: number;
|
|
96
|
+
readonly child_run_presets?: {
|
|
97
|
+
readonly [x: string]: {
|
|
98
|
+
readonly metadata?: {
|
|
99
|
+
readonly [x: string]: Schema.Json;
|
|
100
|
+
};
|
|
101
|
+
readonly permissions?: readonly string[];
|
|
102
|
+
readonly model?: {
|
|
103
|
+
readonly provider: string;
|
|
104
|
+
readonly model: string;
|
|
105
|
+
readonly metadata?: {
|
|
106
|
+
readonly [x: string]: Schema.Json;
|
|
107
|
+
};
|
|
108
|
+
readonly registration_key?: string;
|
|
109
|
+
readonly request_options?: {
|
|
110
|
+
readonly [x: string]: Schema.Json;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly instructions?: string;
|
|
114
|
+
readonly tool_names?: readonly string[];
|
|
115
|
+
readonly workspace_policy?: {
|
|
116
|
+
readonly mode: "share" | "fork";
|
|
117
|
+
readonly fallback?: "fail" | "fresh";
|
|
118
|
+
};
|
|
119
|
+
readonly output_schema_ref?: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
|
|
123
|
+
readonly name: Schema.String;
|
|
124
|
+
readonly preset_name: Schema.String;
|
|
125
|
+
}, "Encoded">[];
|
|
126
|
+
}, never, never>;
|
|
127
|
+
readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
128
|
+
}>;
|
|
129
|
+
export interface LocalAgentTarget extends Schema.Schema.Type<typeof LocalAgentTarget> {
|
|
130
|
+
}
|
|
131
|
+
export interface Interface {
|
|
132
|
+
readonly resolveLocalAgent: (addressId: Ids.AddressId) => Effect.Effect<LocalAgentTarget, AddressRouteNotFound | AddressRouteKindMismatch | AddressAgentDefinitionNotFound | AddressResolutionError>;
|
|
133
|
+
}
|
|
134
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/AddressResolution", Interface>;
|
|
135
|
+
export declare class Service extends Service_base {
|
|
136
|
+
}
|
|
137
|
+
export declare const layer: Layer.Layer<Service, never, AddressBookService | AgentRegistryService>;
|
|
138
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
139
|
+
export declare const resolveLocalAgent: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<LocalAgentTarget, AddressRouteNotFound | AddressRouteKindMismatch | AddressAgentDefinitionNotFound | AddressResolutionError, Service>;
|
|
140
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
|
|
2
|
+
import { AgentChatRepository } from "@relayfx/store-sql/portable";
|
|
3
|
+
import { 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 { Service as PromptAssemblerService } from "./prompt-assembler-service";
|
|
12
|
+
import type { Options } from "./relay-compaction";
|
|
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
|
+
}>, import("effect/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
|
+
}>, import("effect/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
|
+
}>, import("effect/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 compaction?: Options | null;
|
|
58
|
+
readonly sessionEntryScope?: string;
|
|
59
|
+
readonly dispatchChildRun?: (input: DispatchInput) => Effect.Effect<void, unknown, any>;
|
|
60
|
+
}
|
|
61
|
+
export interface RunResult {
|
|
62
|
+
readonly metadata: Shared.Metadata;
|
|
63
|
+
readonly nextEventSequence: Execution.ExecutionEventSequence;
|
|
64
|
+
}
|
|
65
|
+
export interface Interface {
|
|
66
|
+
readonly run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded>;
|
|
67
|
+
}
|
|
68
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/AgentLoop", Interface>;
|
|
69
|
+
export declare class Service extends Service_base {
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Prompt for the terminal structured turn. The transcript already holds the full
|
|
73
|
+
* conversation history (system message, user input, and every tool result), so
|
|
74
|
+
* this single instruction is enough to elicit the typed final output.
|
|
75
|
+
*
|
|
76
|
+
* @experimental
|
|
77
|
+
*/
|
|
78
|
+
export declare const STRUCTURED_TURN_PROMPT = "Return the final structured output for the task above.";
|
|
79
|
+
export declare const toolFromDefinition: (definition: Tool.Definition) => AiTool.Any;
|
|
80
|
+
/** Map a Baton run failure (or an upstream model error) to the public error types. */
|
|
81
|
+
export declare const mapBoundaryError: (error: unknown, current: Execution.ExecutionEventSequence) => AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
|
|
82
|
+
export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLogService | ToolRuntimeService | LanguageModelServiceService | ModelCallPolicyService | SchemaRegistryService | PromptAssemblerService>;
|
|
83
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
84
|
+
export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopBudgetExceeded | AgentLoopWaitRequested, Service>;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
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/AgentRegistry", 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 {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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/PromptAssembler", 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 {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Compaction } from "@batonfx/core";
|
|
2
|
+
import { Ids } from "../../schema/index";
|
|
3
|
+
import { CompactionRepository } from "@relayfx/store-sql/portable";
|
|
4
|
+
import { Layer } from "effect";
|
|
5
|
+
export interface Options {
|
|
6
|
+
readonly contextWindow?: number;
|
|
7
|
+
readonly reserveTokens?: number;
|
|
8
|
+
readonly keepRecentTokens?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface Config {
|
|
11
|
+
readonly executionId: Ids.ExecutionId;
|
|
12
|
+
readonly repository: CompactionRepository.Interface;
|
|
13
|
+
readonly options?: Options;
|
|
14
|
+
readonly strategy?: Compaction.Strategy;
|
|
15
|
+
}
|
|
16
|
+
export declare const checkpointId: (input: {
|
|
17
|
+
readonly executionId: Ids.ExecutionId;
|
|
18
|
+
readonly turn: number;
|
|
19
|
+
readonly firstKeptEntryId: Ids.SessionEntryId | string;
|
|
20
|
+
}) => string;
|
|
21
|
+
export declare const strategy: (config: Config) => Compaction.Strategy;
|
|
22
|
+
export declare const make: (config: Config) => Compaction.Interface;
|
|
23
|
+
export declare const layer: (config: Config) => Layer.Layer<Compaction.Compaction>;
|
|
@@ -0,0 +1,7 @@
|
|
|
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>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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>;
|
|
@@ -0,0 +1,22 @@
|
|
|
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>;
|
|
@@ -0,0 +1,7 @@
|
|
|
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: (blobStore: BlobStoreInterface, toolCallId: string, content: unknown) => Effect.Effect<Option.Option<string>, ToolOutput.ToolOutputError>;
|
|
5
|
+
export declare const make: (blobStore: BlobStoreInterface) => ToolOutput.StoreInterface;
|
|
6
|
+
export declare const layerFromBlobStore: (blobStore: BlobStoreInterface) => Layer.Layer<ToolOutput.ToolOutputStore>;
|
|
7
|
+
export declare const layer: Layer.Layer<ToolOutput.ToolOutputStore, never, BlobStoreService>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Agent, Execution, Ids, Shared } from "../../schema/index";
|
|
2
|
+
import { ChildExecutionRepository } from "@relayfx/store-sql/portable";
|
|
3
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
+
import { Service as EventLogService } from "../execution/event-log-service";
|
|
5
|
+
declare const StaticChildRunPresetNotFound_base: Schema.Class<StaticChildRunPresetNotFound, Schema.TaggedStruct<"StaticChildRunPresetNotFound", {
|
|
6
|
+
readonly preset_name: Schema.String;
|
|
7
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
|
+
export declare class StaticChildRunPresetNotFound extends StaticChildRunPresetNotFound_base {
|
|
9
|
+
}
|
|
10
|
+
declare const ChildRunScopeBroadened_base: Schema.Class<ChildRunScopeBroadened, Schema.TaggedStruct<"ChildRunScopeBroadened", {
|
|
11
|
+
readonly field: Schema.Literals<readonly ["tool_names", "permissions"]>;
|
|
12
|
+
readonly value: Schema.String;
|
|
13
|
+
}>, import("effect/Cause").YieldableError>;
|
|
14
|
+
export declare class ChildRunScopeBroadened extends ChildRunScopeBroadened_base {
|
|
15
|
+
}
|
|
16
|
+
declare const ChildRunServiceError_base: Schema.Class<ChildRunServiceError, Schema.TaggedStruct<"ChildRunServiceError", {
|
|
17
|
+
readonly message: Schema.String;
|
|
18
|
+
}>, import("effect/Cause").YieldableError>;
|
|
19
|
+
export declare class ChildRunServiceError extends ChildRunServiceError_base {
|
|
20
|
+
}
|
|
21
|
+
declare const ChildRunWorkspaceUnavailable_base: Schema.Class<ChildRunWorkspaceUnavailable, Schema.TaggedStruct<"ChildRunWorkspaceUnavailable", {
|
|
22
|
+
readonly reason: Schema.String;
|
|
23
|
+
}>, import("effect/Cause").YieldableError>;
|
|
24
|
+
export declare class ChildRunWorkspaceUnavailable extends ChildRunWorkspaceUnavailable_base {
|
|
25
|
+
}
|
|
26
|
+
declare const ChildRunModelMissing_base: Schema.Class<ChildRunModelMissing, Schema.TaggedStruct<"ChildRunModelMissing", {}>, import("effect/Cause").YieldableError>;
|
|
27
|
+
export declare class ChildRunModelMissing extends ChildRunModelMissing_base {
|
|
28
|
+
}
|
|
29
|
+
export interface AgentContext {
|
|
30
|
+
readonly instructions?: string;
|
|
31
|
+
readonly model?: Agent.ModelSelection;
|
|
32
|
+
readonly toolNames: ReadonlyArray<string>;
|
|
33
|
+
readonly permissions: ReadonlyArray<string>;
|
|
34
|
+
readonly outputSchemaRef?: string;
|
|
35
|
+
readonly metadata?: Shared.Metadata;
|
|
36
|
+
}
|
|
37
|
+
export interface ChildRunOverride {
|
|
38
|
+
readonly instructions?: string;
|
|
39
|
+
readonly model?: Agent.ModelSelection;
|
|
40
|
+
readonly toolNames?: ReadonlyArray<string>;
|
|
41
|
+
readonly permissions?: ReadonlyArray<string>;
|
|
42
|
+
readonly workspacePolicy?: Agent.ChildRunWorkspacePolicy;
|
|
43
|
+
readonly outputSchemaRef?: string;
|
|
44
|
+
readonly metadata?: Shared.Metadata;
|
|
45
|
+
}
|
|
46
|
+
export interface ChildRunPreset extends ChildRunOverride {
|
|
47
|
+
}
|
|
48
|
+
export interface SpawnStaticInput {
|
|
49
|
+
readonly childExecutionId: Ids.ChildExecutionId;
|
|
50
|
+
readonly executionId: Ids.ExecutionId;
|
|
51
|
+
readonly addressId: Ids.AddressId;
|
|
52
|
+
readonly parent: AgentContext;
|
|
53
|
+
readonly presets: ReadonlyMap<string, ChildRunPreset>;
|
|
54
|
+
readonly presetName: string;
|
|
55
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
56
|
+
readonly createdAt: number;
|
|
57
|
+
}
|
|
58
|
+
export interface SpawnDynamicInput {
|
|
59
|
+
readonly childExecutionId: Ids.ChildExecutionId;
|
|
60
|
+
readonly executionId: Ids.ExecutionId;
|
|
61
|
+
readonly addressId: Ids.AddressId;
|
|
62
|
+
readonly parent: AgentContext;
|
|
63
|
+
readonly override?: ChildRunOverride;
|
|
64
|
+
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
65
|
+
readonly createdAt: number;
|
|
66
|
+
}
|
|
67
|
+
export interface Interface {
|
|
68
|
+
readonly spawnStatic: (input: SpawnStaticInput) => Effect.Effect<Execution.ChildRunAccepted, StaticChildRunPresetNotFound | ChildRunScopeBroadened | ChildRunWorkspaceUnavailable | ChildRunServiceError>;
|
|
69
|
+
readonly spawnDynamic: (input: SpawnDynamicInput) => Effect.Effect<Execution.ChildRunAccepted, ChildRunScopeBroadened | ChildRunWorkspaceUnavailable | ChildRunServiceError>;
|
|
70
|
+
}
|
|
71
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ChildRunService", Interface>;
|
|
72
|
+
export declare class Service extends Service_base {
|
|
73
|
+
}
|
|
74
|
+
export interface ResolvedChildContext {
|
|
75
|
+
readonly instructions?: string;
|
|
76
|
+
readonly model?: Agent.ModelSelection;
|
|
77
|
+
readonly toolNames: ReadonlyArray<string>;
|
|
78
|
+
readonly permissions: ReadonlyArray<string>;
|
|
79
|
+
readonly workspacePolicy?: Agent.ChildRunWorkspacePolicy;
|
|
80
|
+
readonly outputSchemaRef?: string;
|
|
81
|
+
readonly metadata: Shared.Metadata;
|
|
82
|
+
}
|
|
83
|
+
export declare const layer: Layer.Layer<Service, never, ChildExecutionRepository.Service | EventLogService>;
|
|
84
|
+
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
85
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
86
|
+
export declare const resolveForDispatch: (input: Execution.SpawnChildRunInput) => Effect.Effect<ResolvedChildContext, StaticChildRunPresetNotFound | ChildRunScopeBroadened, never>;
|
|
87
|
+
export declare const childDefinition: (parentDefinition: Agent.Definition, context: ResolvedChildContext) => Effect.Effect<Agent.Definition, ChildRunModelMissing>;
|
|
88
|
+
export declare const spawnStatic: (input: SpawnStaticInput) => Effect.Effect<Execution.ChildRunAccepted, StaticChildRunPresetNotFound | ChildRunScopeBroadened | ChildRunServiceError | ChildRunWorkspaceUnavailable, Service>;
|
|
89
|
+
export declare const spawnDynamic: (input: SpawnDynamicInput) => Effect.Effect<Execution.ChildRunAccepted, ChildRunScopeBroadened | ChildRunServiceError | ChildRunWorkspaceUnavailable, Service>;
|
|
90
|
+
export {};
|