@relayfx/sdk 0.0.39 → 0.0.41
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/dist/ai.js +15416 -0
- package/dist/index.js +1591 -1181
- package/dist/migrations/20260709030349_agent_id_rename/migration.sql +8 -0
- package/dist/migrations/20260709030349_agent_id_rename/snapshot.json +4883 -0
- package/dist/migrations/mysql/0001_baseline.sql +8 -8
- package/dist/migrations/pg/20260709030349_agent_id_rename/migration.sql +8 -0
- package/dist/migrations/pg/20260709030349_agent_id_rename/snapshot.json +4883 -0
- package/dist/migrations/sqlite/0001_baseline.sql +8 -8
- package/dist/types/ai/embedding-model/embedding-model-registration.d.ts +2 -4
- package/dist/types/ai/index.d.ts +1 -0
- package/dist/types/relay/adapter-outbox.d.ts +11 -11
- package/dist/types/relay/ai.d.ts +2 -0
- package/dist/types/relay/client.d.ts +67 -162
- package/dist/types/relay/database.d.ts +11 -10
- package/dist/types/relay/operation.d.ts +7 -7
- package/dist/types/runtime/address/address-resolution-service.d.ts +7 -7
- package/dist/types/runtime/agent/agent-loop-service.d.ts +15 -15
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +6 -44
- package/dist/types/runtime/agent/relay-approvals.d.ts +0 -19
- package/dist/types/runtime/agent/relay-instructions.d.ts +0 -15
- package/dist/types/runtime/agent/relay-permissions.d.ts +4 -4
- package/dist/types/runtime/agent/relay-steering.d.ts +2 -2
- package/dist/types/runtime/agent/relay-tool-executor.d.ts +5 -21
- package/dist/types/runtime/agent/relay-tool-output.d.ts +5 -5
- package/dist/types/runtime/agent/sequence-allocator.d.ts +0 -19
- package/dist/types/runtime/child/child-run-service.d.ts +2 -2
- package/dist/types/runtime/child/parent-notifier-service.d.ts +4 -4
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +14 -14
- package/dist/types/runtime/cluster/execution-entity.d.ts +25 -25
- package/dist/types/runtime/content/artifact-store-service.d.ts +0 -47
- package/dist/types/runtime/content/blob-store-service.d.ts +0 -33
- package/dist/types/runtime/envelope/envelope-service.d.ts +4 -4
- package/dist/types/runtime/execution/event-log-service.d.ts +0 -5
- package/dist/types/runtime/execution/execution-service.d.ts +9 -8
- package/dist/types/runtime/memory/memory-service.d.ts +5 -4
- package/dist/types/runtime/model/embedding-model-service.d.ts +3 -3
- package/dist/types/runtime/model/language-model-service.d.ts +0 -30
- package/dist/types/runtime/model/model-call-policy.d.ts +0 -58
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +63 -74
- package/dist/types/runtime/schedule/scheduler-service.d.ts +5 -5
- package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +0 -40
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +20 -14
- package/dist/types/runtime/wait/wait-service.d.ts +2 -2
- package/dist/types/runtime/wait/wait-signal.d.ts +3 -3
- package/dist/types/runtime/workflow/execution-workflow.d.ts +15 -20
- package/dist/types/runtime/workspace/workspace-planner-service.d.ts +16 -15
- package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +4 -4
- package/dist/types/schema/agent-schema.d.ts +0 -8
- package/dist/types/schema/execution-schema.d.ts +4 -4
- package/dist/types/store-sql/address/address-book-repository.d.ts +2 -2
- package/dist/types/store-sql/agent/agent-definition-repository.d.ts +3 -3
- package/dist/types/store-sql/chat/agent-chat-repository.d.ts +2 -2
- package/dist/types/store-sql/child/child-execution-repository.d.ts +2 -2
- package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +2 -2
- package/dist/types/store-sql/compaction/compaction-repository.d.ts +2 -2
- package/dist/types/store-sql/database/database-service.d.ts +11 -12
- package/dist/types/store-sql/database/notification-bus.d.ts +3 -3
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +2 -2
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +4 -4
- package/dist/types/store-sql/execution/execution-repository.d.ts +12 -12
- package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +3 -3
- package/dist/types/store-sql/memory/memory-repository.d.ts +5 -5
- package/dist/types/store-sql/permission/permission-rule-repository.d.ts +2 -2
- package/dist/types/store-sql/schedule/schedule-repository.d.ts +2 -2
- package/dist/types/store-sql/schema/relay-schema.d.ts +21 -21
- package/dist/types/store-sql/session/context-epoch-repository.d.ts +2 -2
- package/dist/types/store-sql/session/session-repository.d.ts +6 -6
- package/dist/types/store-sql/skill/skill-definition-repository.d.ts +2 -2
- package/dist/types/store-sql/steering/steering-repository.d.ts +2 -2
- package/dist/types/store-sql/tenant/tenant-id.d.ts +3 -1
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +2 -2
- package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +2 -2
- package/package.json +8 -15
|
@@ -26,18 +26,18 @@ CREATE TABLE "relay_agent_definitions" (
|
|
|
26
26
|
--> statement-breakpoint
|
|
27
27
|
CREATE INDEX "idx_relay_agent_definitions_name" ON "relay_agent_definitions" ("tenant_id", "name");
|
|
28
28
|
--> statement-breakpoint
|
|
29
|
-
CREATE TABLE "
|
|
29
|
+
CREATE TABLE "relay_agent_revisions" (
|
|
30
30
|
"tenant_id" TEXT NOT NULL DEFAULT 'system',
|
|
31
|
-
"
|
|
31
|
+
"agent_id" TEXT NOT NULL,
|
|
32
32
|
"revision" INTEGER NOT NULL,
|
|
33
33
|
"name" TEXT NOT NULL,
|
|
34
34
|
"definition_json" TEXT NOT NULL,
|
|
35
35
|
"tool_input_schema_digests_json" TEXT NOT NULL DEFAULT '{}',
|
|
36
36
|
"created_at" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsec') * 1000 AS INTEGER)),
|
|
37
|
-
CONSTRAINT "
|
|
37
|
+
CONSTRAINT "pk_relay_agent_revisions" PRIMARY KEY ("tenant_id", "agent_id", "revision")
|
|
38
38
|
);
|
|
39
39
|
--> statement-breakpoint
|
|
40
|
-
CREATE INDEX "
|
|
40
|
+
CREATE INDEX "idx_relay_agent_revisions_definition" ON "relay_agent_revisions" ("tenant_id", "agent_id", "revision");
|
|
41
41
|
--> statement-breakpoint
|
|
42
42
|
CREATE TABLE "relay_skill_definitions" (
|
|
43
43
|
"tenant_id" TEXT NOT NULL DEFAULT 'system',
|
|
@@ -194,10 +194,10 @@ CREATE TABLE "relay_executions" (
|
|
|
194
194
|
"root_address_id" TEXT NOT NULL,
|
|
195
195
|
"session_id" TEXT,
|
|
196
196
|
"status" TEXT NOT NULL,
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
197
|
+
"agent_id" TEXT,
|
|
198
|
+
"agent_revision" INTEGER,
|
|
199
|
+
"agent_snapshot_json" TEXT,
|
|
200
|
+
"agent_tool_input_schema_digests_json" TEXT NOT NULL DEFAULT '{}',
|
|
201
201
|
"metadata_json" TEXT NOT NULL DEFAULT '{}',
|
|
202
202
|
"created_at" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsec') * 1000 AS INTEGER)),
|
|
203
203
|
"updated_at" INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsec') * 1000 AS INTEGER)),
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import * as OpenAiCompatibleClient from "@effect/ai-openai-compat/OpenAiClient";
|
|
4
|
-
import * as OpenAiCompatibleEmbeddingModel from "@effect/ai-openai-compat/OpenAiEmbeddingModel";
|
|
1
|
+
import { OpenAiClient, OpenAiEmbeddingModel } from "@effect/ai-openai";
|
|
2
|
+
import { OpenAiClient as OpenAiCompatibleClient, OpenAiEmbeddingModel as OpenAiCompatibleEmbeddingModel } from "@effect/ai-openai-compat";
|
|
5
3
|
import { EmbeddingModelService } from "../../runtime/index";
|
|
6
4
|
export interface OpenAiEmbeddingInput {
|
|
7
5
|
readonly model: OpenAiEmbeddingModel.Model | (string & {});
|
package/dist/types/ai/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * as EmbeddingModelRegistration from "./embedding-model/embedding-model-registration";
|
|
2
2
|
export * as LanguageModelRegistration from "./language-model/language-model-registration";
|
|
3
|
+
export { Agent, AgentEvent, AgentTool, AiError, Approvals, Chat, Compaction, EmbeddingModel, Guardrail, Handoff, IdGenerator, Instructions, LanguageModel, Memory, Model, ModelMiddleware, ModelRegistry, ModelResilience, Permissions, Prompt, Response, ResponseIdTracker, Session, SkillSource, Steering, Telemetry, Tokenizer, Tool, ToolContext, ToolExecutor, Toolkit, ToolOutput, TurnPolicy, } from "@batonfx/core";
|
|
3
4
|
export declare const aiPackage = "./index";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { ClientError, Service as ClientService } from "./client";
|
|
3
|
+
import { AckEnvelopeReadyInput, ClaimEnvelopeReadyInput, EnvelopeReadyAcked, EnvelopeReadyLease, EnvelopeReadyReleased, ReleaseEnvelopeReadyInput, SubmitInboundEnvelopeAccepted, SubmitInboundEnvelopeInput } from "./operation";
|
|
4
4
|
export interface Interface {
|
|
5
|
-
readonly claim: (input:
|
|
6
|
-
readonly ack: (input:
|
|
7
|
-
readonly release: (input:
|
|
8
|
-
readonly submitInbound: (input:
|
|
5
|
+
readonly claim: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError>;
|
|
6
|
+
readonly ack: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError>;
|
|
7
|
+
readonly release: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError>;
|
|
8
|
+
readonly submitInbound: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError>;
|
|
9
9
|
}
|
|
10
10
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/AdapterOutbox", Interface>;
|
|
11
11
|
export declare class Service extends Service_base {
|
|
12
12
|
}
|
|
13
|
-
export declare const layer: Layer.Layer<Service, never,
|
|
13
|
+
export declare const layer: Layer.Layer<Service, never, ClientService>;
|
|
14
14
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
15
|
-
export declare const claim: (input:
|
|
16
|
-
export declare const ack: (input:
|
|
17
|
-
export declare const release: (input:
|
|
18
|
-
export declare const submitInbound: (input:
|
|
15
|
+
export declare const claim: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError, Service>;
|
|
16
|
+
export declare const ack: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError, Service>;
|
|
17
|
+
export declare const release: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError, Service>;
|
|
18
|
+
export declare const submitInbound: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError, Service>;
|
|
19
19
|
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Agent, AgentEvent, AgentTool, AiError, Approvals, Chat, Compaction, EmbeddingModel, Guardrail, Handoff, IdGenerator, Instructions, LanguageModel, Memory, Model, ModelMiddleware, ModelRegistry, ModelResilience, Permissions, Prompt, Response, ResponseIdTracker, Session, SkillSource, Steering, Telemetry, Tokenizer, Tool, ToolContext, ToolExecutor, Toolkit, ToolOutput, TurnPolicy, } from "../ai/index";
|
|
2
|
+
export declare const relayAiPackage = "@relayfx/sdk/ai";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AddressBook, AgentRegistry, EventLog, ExecutionService, SkillRegistry, WaitService } from "../runtime/index";
|
|
2
|
-
import {
|
|
2
|
+
import type { Agent as BatonAgent } from "@batonfx/core";
|
|
3
|
+
import { Address, Agent, Content, Envelope, Execution, Ids, Shared, Skill, Tool } from "../schema/index";
|
|
3
4
|
import { ClusterRegistryRepository, EnvelopeRepository, ExecutionRepository, ScheduleRepository, SessionRepository, SteeringRepository } from "../store-sql/index";
|
|
4
5
|
import { Context, Effect, Layer, Schema, Stream } from "effect";
|
|
5
6
|
import { Sharding, ShardingConfig } from "effect/unstable/cluster";
|
|
6
|
-
import
|
|
7
|
+
import type { AckEnvelopeReadyInput, CancelExecutionAccepted, CancelExecutionInput, CancelScheduleInput, CancelScheduleResult, ClaimEnvelopeReadyInput, CreateScheduleInput, CreateScheduleResult, EnvelopeReadyAcked, EnvelopeReadyLease, EnvelopeReadyReleased, GetSessionInput, GetSessionResult, ListExecutionsInput, ListExecutionsResult, ListPendingApprovalsInput, ListRunnersResult, ListSchedulesInput, ListSchedulesResult, ListSessionsInput, ListSessionsResult, ListWaitsInput, PendingToolApprovalList, ReleaseEnvelopeReadyInput, ReplayExecutionInput, ReplayExecutionResult, ResolvePermissionInput, ResolveToolApprovalInput, RouteExecutionResult, StartExecutionInput, StartExecutionResult, SteerAccepted, SteerInput, StreamExecutionInput, SubmitInboundEnvelopeAccepted, SubmitInboundEnvelopeInput, WaitView, WakeAccepted, WakeInput } from "./operation";
|
|
7
8
|
declare const ClientError_base: Schema.Class<ClientError, Schema.TaggedStruct<"ClientError", {
|
|
8
9
|
readonly message: Schema.String;
|
|
9
10
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -24,7 +25,7 @@ export interface StartExecutionByAddressInput {
|
|
|
24
25
|
export interface StartExecutionByAgentDefinitionInput {
|
|
25
26
|
readonly root_address_id: Ids.AddressId;
|
|
26
27
|
readonly session_id?: Ids.SessionId;
|
|
27
|
-
readonly
|
|
28
|
+
readonly agent_id: Ids.AgentId;
|
|
28
29
|
readonly input?: ReadonlyArray<Content.Part>;
|
|
29
30
|
readonly idempotency_key: Shared.NonEmptyString;
|
|
30
31
|
readonly execution_id?: Ids.ExecutionId;
|
|
@@ -34,38 +35,26 @@ export interface StartExecutionByAgentDefinitionInput {
|
|
|
34
35
|
readonly wait_id?: Ids.WaitId;
|
|
35
36
|
readonly metadata?: Shared.Metadata;
|
|
36
37
|
}
|
|
37
|
-
export interface
|
|
38
|
+
export interface RegisterDefinedAgentInput extends Agent.DefineInput {
|
|
38
39
|
readonly address?: Ids.AddressId;
|
|
39
40
|
}
|
|
40
|
-
export interface
|
|
41
|
-
readonly id?: Ids.AgentId;
|
|
42
|
-
readonly address?: Ids.AddressId;
|
|
43
|
-
readonly name?: Shared.NonEmptyString;
|
|
44
|
-
readonly permissions?: Agent.DefineInput["permissions"];
|
|
45
|
-
}
|
|
46
|
-
export interface RegisteredAgent {
|
|
41
|
+
export interface RegisterBatonAgentInput {
|
|
47
42
|
readonly id: Ids.AgentId;
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
readonly
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
57
|
-
readonly
|
|
58
|
-
readonly
|
|
59
|
-
readonly
|
|
60
|
-
readonly started_at?: Shared.TimestampMillis;
|
|
61
|
-
readonly completed_at?: Shared.TimestampMillis;
|
|
62
|
-
readonly wait_id?: Ids.WaitId;
|
|
43
|
+
readonly address?: Ids.AddressId;
|
|
44
|
+
readonly agent: BatonAgent.Agent<any>;
|
|
45
|
+
readonly model: Agent.ModelSelection;
|
|
46
|
+
readonly permissions?: ReadonlyArray<Tool.Permission>;
|
|
47
|
+
readonly skill_definition_ids?: ReadonlyArray<Ids.SkillDefinitionId>;
|
|
48
|
+
readonly permission_rules?: Agent.PermissionRuleset;
|
|
49
|
+
readonly max_tool_turns?: number;
|
|
50
|
+
readonly max_wait_turns?: number;
|
|
51
|
+
readonly token_budget?: number;
|
|
52
|
+
readonly child_run_presets?: Readonly<Record<string, Agent.ChildRunPreset>>;
|
|
53
|
+
readonly handoff_targets?: ReadonlyArray<Agent.HandoffTarget>;
|
|
54
|
+
readonly output_schema_ref?: string;
|
|
63
55
|
readonly metadata?: Shared.Metadata;
|
|
64
56
|
}
|
|
65
|
-
export
|
|
66
|
-
readonly after_cursor?: Shared.NonEmptyString;
|
|
67
|
-
readonly limit?: number;
|
|
68
|
-
}
|
|
57
|
+
export type RegisterAgentInput = RegisterDefinedAgentInput | RegisterBatonAgentInput;
|
|
69
58
|
export interface Interface {
|
|
70
59
|
readonly registerAgent: (input: RegisterAgentInput) => Effect.Effect<Agent.DefinitionRegistered, ClientError>;
|
|
71
60
|
readonly registerAgentDefinition: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, ClientError>;
|
|
@@ -78,33 +67,33 @@ export interface Interface {
|
|
|
78
67
|
readonly registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered, ClientError>;
|
|
79
68
|
readonly getAddressBookRoute: (id: Ids.AddressId) => Effect.Effect<Address.RouteRecord | undefined, ClientError>;
|
|
80
69
|
readonly listAddressBookRoutes: () => Effect.Effect<Address.RouteList, ClientError>;
|
|
81
|
-
readonly startExecution: (input:
|
|
82
|
-
readonly startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<
|
|
83
|
-
readonly startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<
|
|
84
|
-
readonly cancelExecution: (input:
|
|
85
|
-
readonly steer: (input:
|
|
70
|
+
readonly startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult, ClientError>;
|
|
71
|
+
readonly startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult, ClientError>;
|
|
72
|
+
readonly startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult, ClientError>;
|
|
73
|
+
readonly cancelExecution: (input: CancelExecutionInput) => Effect.Effect<CancelExecutionAccepted, ClientError>;
|
|
74
|
+
readonly steer: (input: SteerInput) => Effect.Effect<SteerAccepted, ClientError>;
|
|
86
75
|
readonly getExecution: (id: Ids.ExecutionId) => Effect.Effect<Execution.Execution | undefined, ClientError>;
|
|
87
|
-
readonly listExecutions: (input:
|
|
88
|
-
readonly listSessions: (input:
|
|
89
|
-
readonly getSession: (input:
|
|
90
|
-
readonly listWaits: (input:
|
|
91
|
-
readonly replayExecution: (input:
|
|
92
|
-
readonly listRunners: () => Effect.Effect<
|
|
93
|
-
readonly routeExecution: (executionId: Ids.ExecutionId) => Effect.Effect<
|
|
76
|
+
readonly listExecutions: (input: ListExecutionsInput) => Effect.Effect<ListExecutionsResult, ClientError>;
|
|
77
|
+
readonly listSessions: (input: ListSessionsInput) => Effect.Effect<ListSessionsResult, ClientError>;
|
|
78
|
+
readonly getSession: (input: GetSessionInput) => Effect.Effect<GetSessionResult, ClientError>;
|
|
79
|
+
readonly listWaits: (input: ListWaitsInput) => Effect.Effect<ReadonlyArray<WaitView>, ClientError>;
|
|
80
|
+
readonly replayExecution: (input: ReplayExecutionInput) => Effect.Effect<ReplayExecutionResult, ClientError>;
|
|
81
|
+
readonly listRunners: () => Effect.Effect<ListRunnersResult, ClientError>;
|
|
82
|
+
readonly routeExecution: (executionId: Ids.ExecutionId) => Effect.Effect<RouteExecutionResult, ClientError>;
|
|
94
83
|
readonly send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError>;
|
|
95
|
-
readonly streamExecution: (input:
|
|
96
|
-
readonly wake: (input:
|
|
97
|
-
readonly listPendingApprovals: (input:
|
|
98
|
-
readonly resolveToolApproval: (input:
|
|
99
|
-
readonly resolvePermission: (input:
|
|
100
|
-
readonly submitInboundEnvelope: (input:
|
|
84
|
+
readonly streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError>;
|
|
85
|
+
readonly wake: (input: WakeInput) => Effect.Effect<WakeAccepted, ClientError>;
|
|
86
|
+
readonly listPendingApprovals: (input: ListPendingApprovalsInput) => Effect.Effect<PendingToolApprovalList, ClientError>;
|
|
87
|
+
readonly resolveToolApproval: (input: ResolveToolApprovalInput) => Effect.Effect<WakeAccepted, ClientError>;
|
|
88
|
+
readonly resolvePermission: (input: ResolvePermissionInput) => Effect.Effect<WakeAccepted, ClientError>;
|
|
89
|
+
readonly submitInboundEnvelope: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError>;
|
|
101
90
|
readonly spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ClientError>;
|
|
102
|
-
readonly claimEnvelopeReady: (input:
|
|
103
|
-
readonly ackEnvelopeReady: (input:
|
|
104
|
-
readonly releaseEnvelopeReady: (input:
|
|
105
|
-
readonly createSchedule: (input:
|
|
106
|
-
readonly cancelSchedule: (input:
|
|
107
|
-
readonly listSchedules: (input:
|
|
91
|
+
readonly claimEnvelopeReady: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError>;
|
|
92
|
+
readonly ackEnvelopeReady: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError>;
|
|
93
|
+
readonly releaseEnvelopeReady: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError>;
|
|
94
|
+
readonly createSchedule: (input: CreateScheduleInput) => Effect.Effect<CreateScheduleResult, ClientError>;
|
|
95
|
+
readonly cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError>;
|
|
96
|
+
readonly listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError>;
|
|
108
97
|
}
|
|
109
98
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/Client", Interface>;
|
|
110
99
|
export declare class Service extends Service_base {
|
|
@@ -113,88 +102,6 @@ export declare const layerFromRuntime: Layer.Layer<Service, never, AgentRegistry
|
|
|
113
102
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
114
103
|
export declare const registerAgentDefinition: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, ClientError, Service>;
|
|
115
104
|
export declare const registerAgent: (input: RegisterAgentInput) => Effect.Effect<Agent.DefinitionRegistered, ClientError, Service>;
|
|
116
|
-
export declare const agent: (slug: string, input: AgentOptions) => Effect.Effect<{
|
|
117
|
-
id: string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
118
|
-
address_id: string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
119
|
-
record: {
|
|
120
|
-
readonly id: string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
121
|
-
readonly created_at: number;
|
|
122
|
-
readonly updated_at: number;
|
|
123
|
-
readonly current_revision: number;
|
|
124
|
-
readonly definition: {
|
|
125
|
-
readonly name: string;
|
|
126
|
-
readonly permissions: readonly {
|
|
127
|
-
readonly name: string;
|
|
128
|
-
readonly value: Schema.Json;
|
|
129
|
-
readonly metadata?: {
|
|
130
|
-
readonly [x: string]: Schema.Json;
|
|
131
|
-
};
|
|
132
|
-
}[];
|
|
133
|
-
readonly model: {
|
|
134
|
-
readonly provider: string;
|
|
135
|
-
readonly model: string;
|
|
136
|
-
readonly metadata?: {
|
|
137
|
-
readonly [x: string]: Schema.Json;
|
|
138
|
-
};
|
|
139
|
-
readonly registration_key?: string;
|
|
140
|
-
readonly request_options?: {
|
|
141
|
-
readonly [x: string]: Schema.Json;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
readonly tool_names: readonly string[];
|
|
145
|
-
readonly metadata?: {
|
|
146
|
-
readonly [x: string]: Schema.Json;
|
|
147
|
-
};
|
|
148
|
-
readonly instructions?: string;
|
|
149
|
-
readonly output_schema_ref?: string;
|
|
150
|
-
readonly skill_definition_ids?: readonly (string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">)[];
|
|
151
|
-
readonly permission_rules?: {
|
|
152
|
-
readonly rules: readonly {
|
|
153
|
-
readonly pattern: string;
|
|
154
|
-
readonly level: "allow" | "deny" | "ask";
|
|
155
|
-
readonly reason?: string;
|
|
156
|
-
}[];
|
|
157
|
-
readonly fallback?: "allow" | "deny" | "ask";
|
|
158
|
-
};
|
|
159
|
-
readonly max_tool_turns?: number;
|
|
160
|
-
readonly max_wait_turns?: number;
|
|
161
|
-
readonly token_budget?: number;
|
|
162
|
-
readonly child_run_presets?: {
|
|
163
|
-
readonly [x: string]: {
|
|
164
|
-
readonly metadata?: {
|
|
165
|
-
readonly [x: string]: Schema.Json;
|
|
166
|
-
};
|
|
167
|
-
readonly permissions?: readonly string[];
|
|
168
|
-
readonly model?: {
|
|
169
|
-
readonly provider: string;
|
|
170
|
-
readonly model: string;
|
|
171
|
-
readonly metadata?: {
|
|
172
|
-
readonly [x: string]: Schema.Json;
|
|
173
|
-
};
|
|
174
|
-
readonly registration_key?: string;
|
|
175
|
-
readonly request_options?: {
|
|
176
|
-
readonly [x: string]: Schema.Json;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
readonly instructions?: string;
|
|
180
|
-
readonly tool_names?: readonly string[];
|
|
181
|
-
readonly workspace_policy?: {
|
|
182
|
-
readonly mode: "share" | "fork";
|
|
183
|
-
readonly fallback?: "fail" | "fresh";
|
|
184
|
-
};
|
|
185
|
-
readonly output_schema_ref?: string;
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
|
|
189
|
-
readonly name: Schema.String;
|
|
190
|
-
readonly preset_name: Schema.String;
|
|
191
|
-
}, "Type">[];
|
|
192
|
-
};
|
|
193
|
-
readonly tool_input_schema_digests?: {
|
|
194
|
-
readonly [x: string]: string;
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
}, ClientError, Service>;
|
|
198
105
|
export declare const getAgentDefinition: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRecord | undefined, ClientError, Service>;
|
|
199
106
|
export declare const listAgentDefinitions: () => Effect.Effect<Agent.DefinitionList, ClientError, Service>;
|
|
200
107
|
export declare const listAgentDefinitionRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRevisionList, ClientError, Service>;
|
|
@@ -204,33 +111,31 @@ export declare const listSkillDefinitionRevisions: (id: string & import("effect/
|
|
|
204
111
|
export declare const registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered, ClientError, Service>;
|
|
205
112
|
export declare const getAddressBookRoute: (id: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<Address.RouteRecord | undefined, ClientError, Service>;
|
|
206
113
|
export declare const listAddressBookRoutes: () => Effect.Effect<Address.RouteList, ClientError, Service>;
|
|
207
|
-
export declare const startExecution: (input:
|
|
208
|
-
export declare const startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<
|
|
209
|
-
export declare const startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<
|
|
210
|
-
export declare const
|
|
211
|
-
export declare const
|
|
212
|
-
export declare const cancelExecution: (input: Operation.CancelExecutionInput) => Effect.Effect<Operation.CancelExecutionAccepted, ClientError, Service>;
|
|
213
|
-
export declare const steer: (input: Operation.SteerInput) => Effect.Effect<Operation.SteerAccepted, ClientError, Service>;
|
|
114
|
+
export declare const startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult, ClientError, Service>;
|
|
115
|
+
export declare const startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult, ClientError, Service>;
|
|
116
|
+
export declare const startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult, ClientError, Service>;
|
|
117
|
+
export declare const cancelExecution: (input: CancelExecutionInput) => Effect.Effect<CancelExecutionAccepted, ClientError, Service>;
|
|
118
|
+
export declare const steer: (input: SteerInput) => Effect.Effect<SteerAccepted, ClientError, Service>;
|
|
214
119
|
export declare const getExecution: (id: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<Execution.Execution | undefined, ClientError, Service>;
|
|
215
|
-
export declare const listExecutions: (input:
|
|
216
|
-
export declare const listSessions: (input:
|
|
217
|
-
export declare const getSession: (input:
|
|
218
|
-
export declare const listWaits: (input:
|
|
219
|
-
export declare const replayExecution: (input:
|
|
220
|
-
export declare const listRunners: () => Effect.Effect<
|
|
221
|
-
export declare const routeExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<
|
|
120
|
+
export declare const listExecutions: (input: ListExecutionsInput) => Effect.Effect<ListExecutionsResult, ClientError, Service>;
|
|
121
|
+
export declare const listSessions: (input: ListSessionsInput) => Effect.Effect<ListSessionsResult, ClientError, Service>;
|
|
122
|
+
export declare const getSession: (input: GetSessionInput) => Effect.Effect<GetSessionResult, ClientError, Service>;
|
|
123
|
+
export declare const listWaits: (input: ListWaitsInput) => Effect.Effect<readonly WaitView[], ClientError, Service>;
|
|
124
|
+
export declare const replayExecution: (input: ReplayExecutionInput) => Effect.Effect<ReplayExecutionResult, ClientError, Service>;
|
|
125
|
+
export declare const listRunners: () => Effect.Effect<ListRunnersResult, ClientError, Service>;
|
|
126
|
+
export declare const routeExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<RouteExecutionResult, ClientError, Service>;
|
|
222
127
|
export declare const send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError, Service>;
|
|
223
|
-
export declare const streamExecution: (input:
|
|
224
|
-
export declare const wake: (input:
|
|
225
|
-
export declare const listPendingApprovals: (input:
|
|
226
|
-
export declare const resolveToolApproval: (input:
|
|
227
|
-
export declare const resolvePermission: (input:
|
|
228
|
-
export declare const submitInboundEnvelope: (input:
|
|
128
|
+
export declare const streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError, Service>;
|
|
129
|
+
export declare const wake: (input: WakeInput) => Effect.Effect<WakeAccepted, ClientError, Service>;
|
|
130
|
+
export declare const listPendingApprovals: (input: ListPendingApprovalsInput) => Effect.Effect<PendingToolApprovalList, ClientError, Service>;
|
|
131
|
+
export declare const resolveToolApproval: (input: ResolveToolApprovalInput) => Effect.Effect<WakeAccepted, ClientError, Service>;
|
|
132
|
+
export declare const resolvePermission: (input: ResolvePermissionInput) => Effect.Effect<WakeAccepted, ClientError, Service>;
|
|
133
|
+
export declare const submitInboundEnvelope: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError, Service>;
|
|
229
134
|
export declare const spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ClientError, Service>;
|
|
230
|
-
export declare const claimEnvelopeReady: (input:
|
|
231
|
-
export declare const ackEnvelopeReady: (input:
|
|
232
|
-
export declare const releaseEnvelopeReady: (input:
|
|
233
|
-
export declare const createSchedule: (input:
|
|
234
|
-
export declare const cancelSchedule: (input:
|
|
235
|
-
export declare const listSchedules: (input:
|
|
135
|
+
export declare const claimEnvelopeReady: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError, Service>;
|
|
136
|
+
export declare const ackEnvelopeReady: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError, Service>;
|
|
137
|
+
export declare const releaseEnvelopeReady: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError, Service>;
|
|
138
|
+
export declare const createSchedule: (input: CreateScheduleInput) => Effect.Effect<CreateScheduleResult, ClientError, Service>;
|
|
139
|
+
export declare const cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError, Service>;
|
|
140
|
+
export declare const listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError, Service>;
|
|
236
141
|
export {};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
1
|
+
import { Database } from "../store-sql/index";
|
|
2
|
+
import type { Context, Effect } from "effect";
|
|
3
|
+
export type Drizzle = Context.Service.Shape<typeof Database.Service>;
|
|
4
|
+
export type PgTimestamp = Parameters<typeof Database.fromPgDate>[0];
|
|
5
|
+
export type DatabaseError = Effect.Error<ReturnType<typeof Database.check>>;
|
|
6
|
+
export type Dialect = typeof Database.Dialect.Type;
|
|
7
|
+
export declare const Service: typeof Database.Service;
|
|
8
|
+
export declare const layerFromPgClient: import("effect/Layer").Layer<Database.Service, never, import("@effect/sql-pg/PgClient").PgClient>;
|
|
9
|
+
export declare const testLayer: (db: Database.Drizzle) => import("effect/Layer").Layer<Database.Service, never, never>;
|
|
10
|
+
export declare const check: () => Effect.Effect<void, import("drizzle-orm/effect-core").EffectDrizzleQueryError, Database.Service>;
|
|
10
11
|
export declare const pgTypeParsers: {
|
|
11
12
|
getTypeParser: (typeId: number, format?: "text" | "binary") => any;
|
|
12
13
|
};
|
|
13
14
|
export declare const Dialect: import("effect/Schema").Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
14
|
-
export declare const dialect:
|
|
15
|
+
export declare const dialect: Effect.Effect<"pg" | "mysql" | "sqlite", never, import("effect/unstable/sql/SqlClient").SqlClient>;
|
|
@@ -61,11 +61,11 @@ export declare const StartExecutionInput: Schema.Struct<{
|
|
|
61
61
|
readonly event_sequence: Schema.Int;
|
|
62
62
|
readonly started_at: Schema.Int;
|
|
63
63
|
readonly completed_at: Schema.Int;
|
|
64
|
-
readonly
|
|
64
|
+
readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
65
65
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
66
66
|
}>;
|
|
67
|
-
readonly
|
|
68
|
-
readonly
|
|
67
|
+
readonly agent_revision: Schema.optionalKey<Schema.Int>;
|
|
68
|
+
readonly agent_snapshot: Schema.optionalKey<Schema.Struct<{
|
|
69
69
|
readonly name: Schema.String;
|
|
70
70
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
71
71
|
readonly model: Schema.Struct<{
|
|
@@ -120,7 +120,7 @@ export declare const StartExecutionInput: Schema.Struct<{
|
|
|
120
120
|
readonly output_schema_ref: Schema.optionalKey<Schema.String>;
|
|
121
121
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
122
122
|
}>>;
|
|
123
|
-
readonly
|
|
123
|
+
readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
124
124
|
readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
125
125
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
126
126
|
}>;
|
|
@@ -942,7 +942,7 @@ export declare const ConversationSummary: Schema.Struct<{
|
|
|
942
942
|
}>;
|
|
943
943
|
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
944
944
|
readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
|
|
945
|
-
readonly
|
|
945
|
+
readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
946
946
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
947
947
|
}>;
|
|
948
948
|
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
@@ -964,7 +964,7 @@ export declare const ListExecutionsResult: Schema.Struct<{
|
|
|
964
964
|
}>;
|
|
965
965
|
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
966
966
|
readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
|
|
967
|
-
readonly
|
|
967
|
+
readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
968
968
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
969
969
|
}>;
|
|
970
970
|
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
@@ -1046,7 +1046,7 @@ export declare const GetSessionResult: Schema.Struct<{
|
|
|
1046
1046
|
}>;
|
|
1047
1047
|
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
1048
1048
|
readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
|
|
1049
|
-
readonly
|
|
1049
|
+
readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
1050
1050
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
1051
1051
|
}>;
|
|
1052
1052
|
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ids } from "../../schema/index";
|
|
2
2
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { Service as AddressBookService } from "./address-book-service";
|
|
4
|
+
import { Service as AgentRegistryService } from "../agent/agent-registry-service";
|
|
5
5
|
declare const AddressRouteNotFound_base: Schema.Class<AddressRouteNotFound, Schema.TaggedStruct<"AddressRouteNotFound", {
|
|
6
6
|
readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
7
7
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
@@ -23,7 +23,7 @@ declare const AddressAgentDefinitionNotFound_base: Schema.Class<AddressAgentDefi
|
|
|
23
23
|
readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
24
24
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
25
25
|
};
|
|
26
|
-
readonly
|
|
26
|
+
readonly agent_id: Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
27
27
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
28
28
|
};
|
|
29
29
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -50,11 +50,11 @@ export declare const LocalAgentTarget: Schema.Struct<{
|
|
|
50
50
|
readonly route_key: Schema.String;
|
|
51
51
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
52
52
|
}>;
|
|
53
|
-
readonly
|
|
53
|
+
readonly agent_id: Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
54
54
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
55
55
|
};
|
|
56
|
-
readonly
|
|
57
|
-
readonly
|
|
56
|
+
readonly agent_revision: Schema.Int;
|
|
57
|
+
readonly agent_snapshot: Schema.Struct<{
|
|
58
58
|
readonly name: Schema.String;
|
|
59
59
|
readonly instructions: Schema.optionalKey<Schema.String>;
|
|
60
60
|
readonly model: Schema.Struct<{
|
|
@@ -119,7 +119,7 @@ export interface Interface {
|
|
|
119
119
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/AddressResolution", Interface>;
|
|
120
120
|
export declare class Service extends Service_base {
|
|
121
121
|
}
|
|
122
|
-
export declare const layer: Layer.Layer<Service, never,
|
|
122
|
+
export declare const layer: Layer.Layer<Service, never, AddressBookService | AgentRegistryService>;
|
|
123
123
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
124
124
|
export declare const resolveLocalAgent: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<LocalAgentTarget, AddressRouteNotFound | AddressRouteKindMismatch | AddressAgentDefinitionNotFound | AddressResolutionError, Service>;
|
|
125
125
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
|
|
2
2
|
import { AgentChatRepository } from "../../store-sql/index";
|
|
3
3
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
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
13
|
declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
|
|
14
14
|
readonly message: Schema.String;
|
|
15
15
|
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
@@ -44,8 +44,8 @@ export interface RunInput {
|
|
|
44
44
|
readonly sessionId?: Ids.SessionId;
|
|
45
45
|
readonly agent: Agent.Definition;
|
|
46
46
|
readonly agentId?: Ids.AgentId;
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
47
|
+
readonly agentRevision?: Agent.DefinitionRevision;
|
|
48
|
+
readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
|
|
49
49
|
readonly input: ReadonlyArray<Content.Part>;
|
|
50
50
|
readonly resumeToolCall?: Tool.Call;
|
|
51
51
|
readonly memorySubjectId?: Ids.MemorySubjectId;
|
|
@@ -54,9 +54,9 @@ export interface RunInput {
|
|
|
54
54
|
readonly completedAt: number;
|
|
55
55
|
readonly steeringEnabled?: boolean;
|
|
56
56
|
readonly toolOutputMaxBytes?: number | null;
|
|
57
|
-
readonly compaction?:
|
|
57
|
+
readonly compaction?: Options | null;
|
|
58
58
|
readonly sessionEntryScope?: string;
|
|
59
|
-
readonly dispatchChildRun?: (input:
|
|
59
|
+
readonly dispatchChildRun?: (input: DispatchInput) => Effect.Effect<void, unknown, any>;
|
|
60
60
|
}
|
|
61
61
|
export interface RunResult {
|
|
62
62
|
readonly metadata: Shared.Metadata;
|
|
@@ -76,10 +76,10 @@ export declare class Service extends Service_base {
|
|
|
76
76
|
* @experimental
|
|
77
77
|
*/
|
|
78
78
|
export declare const STRUCTURED_TURN_PROMPT = "Return the final structured output for the task above.";
|
|
79
|
-
export declare const toolFromDefinition: (definition: Tool.Definition) =>
|
|
79
|
+
export declare const toolFromDefinition: (definition: Tool.Definition) => AiTool.Any;
|
|
80
80
|
/** Map a Baton run failure (or an upstream model error) to the public error types. */
|
|
81
81
|
export declare const mapBoundaryError: (error: unknown, current: Execution.ExecutionEventSequence) => AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
|
|
82
|
-
export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service |
|
|
82
|
+
export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLogService | ToolRuntimeService | LanguageModelServiceService | ModelCallPolicyService | SchemaRegistryService | PromptAssemblerService>;
|
|
83
83
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
84
84
|
export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded, Service>;
|
|
85
85
|
export {};
|