@relayfx/sdk 0.3.6 → 0.4.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/dist/ai.js +1 -1
- package/dist/http-server.js +1 -1
- package/dist/{index-mtvz1bjn.js → index-3w6txjtg.js} +63 -426
- package/dist/{index-2vsf6dks.js → index-cs3be24t.js} +1 -1
- package/dist/{index-e02krw55.js → index-p43mg4kt.js} +5882 -5127
- package/dist/{index-8fpd6kvj.js → index-x32kbvxv.js} +1004 -970
- package/dist/index.js +487 -22
- package/dist/migrations/20260719120000_rename_entity_to_resident/migration.sql +9 -0
- package/dist/migrations/mysql/0012_rename_entity_to_resident.sql +5 -0
- package/dist/migrations/pg/20260719120000_rename_entity_to_resident/migration.sql +9 -0
- package/dist/migrations/sqlite/0012_rename_entity_to_resident.sql +7 -0
- package/dist/mysql.js +18 -5
- package/dist/postgres.js +569 -550
- package/dist/sqlite.js +16 -5
- package/dist/types/relay/client-baton-agent.d.ts +30 -0
- package/dist/types/relay/client-child-runs.d.ts +35 -0
- package/dist/types/relay/client-error-mapping.d.ts +5 -0
- package/dist/types/relay/client-event-sequence.d.ts +3 -0
- package/dist/types/relay/client-execution-payloads.d.ts +12 -0
- package/dist/types/relay/client-public-agents.d.ts +15 -0
- package/dist/types/relay/client-public-child-runs.d.ts +9 -0
- package/dist/types/relay/client-public-envelope-ready.d.ts +6 -0
- package/dist/types/relay/client-public-executions.d.ts +247 -0
- package/dist/types/relay/client-public-messaging.d.ts +18 -0
- package/dist/types/relay/client-public-residents.d.ts +14 -0
- package/dist/types/relay/client-public-schedules.d.ts +6 -0
- package/dist/types/relay/client-public-tools.d.ts +12 -0
- package/dist/types/relay/client-public-workflows.d.ts +10 -0
- package/dist/types/relay/client-public.d.ts +133 -313
- package/dist/types/relay/client-runtime-wake.d.ts +10 -0
- package/dist/types/relay/client-tool-outcome.d.ts +16 -0
- package/dist/types/relay/client-view-mappers.d.ts +16 -0
- package/dist/types/relay/client-wait-signal.d.ts +5 -0
- package/dist/types/relay/client.d.ts +118 -1
- package/dist/types/relay/command.d.ts +6 -6
- package/dist/types/relay/http-server.d.ts +55 -37
- package/dist/types/relay/index.d.ts +3 -4
- package/dist/types/relay/internal-client.d.ts +5 -5
- package/dist/types/relay/mysql-migrations.d.ts +1 -1
- package/dist/types/relay/operation.d.ts +44 -41
- package/dist/types/relay/sqlite-migrations.d.ts +6 -1
- package/dist/types/runtime/address/address-resolution-service.d.ts +3 -0
- package/dist/types/runtime/agent/agent-loop-events.d.ts +24 -0
- package/dist/types/runtime/agent/relay-tool-executor.d.ts +2 -2
- package/dist/types/runtime/agent/sequence-allocator.d.ts +1 -0
- package/dist/types/runtime/execution/event-log-memory.d.ts +7 -0
- package/dist/types/runtime/execution/event-log-repository.d.ts +8 -0
- package/dist/types/runtime/execution/event-log-service.d.ts +3 -1
- package/dist/types/runtime/index.d.ts +2 -2
- package/dist/types/runtime/resident/resident-instance-service.d.ts +76 -0
- package/dist/types/runtime/resident/resident-registry-service.d.ts +35 -0
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +14 -14
- package/dist/types/runtime/tool/tool-runtime-contract.d.ts +4 -1
- package/dist/types/runtime/workflow/execution-workflow-state.d.ts +43 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +6 -0
- package/dist/types/schema/agent-schema.d.ts +24 -0
- package/dist/types/schema/execution-schema.d.ts +5 -2
- package/dist/types/schema/ids-schema.d.ts +6 -6
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/{entity-schema.d.ts → resident-schema.d.ts} +6 -6
- package/dist/types/store-sql/envelope/envelope-ready-records.d.ts +51 -0
- package/dist/types/store-sql/envelope/envelope-records.d.ts +43 -0
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +1 -2
- package/dist/types/store-sql/envelope/wait-records.d.ts +64 -0
- package/dist/types/store-sql/execution/execution-event-repository-memory.d.ts +8 -0
- package/dist/types/store-sql/execution/execution-event-repository-sql.d.ts +13 -0
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +13 -5
- package/dist/types/store-sql/index.d.ts +1 -1
- package/dist/types/store-sql/portable.d.ts +1 -1
- package/dist/types/store-sql/resident/resident-repository.d.ts +36 -0
- package/dist/types/store-sql/schema/address-book-schema.d.ts +131 -0
- package/dist/types/store-sql/schema/agent-schema.d.ts +954 -0
- package/dist/types/store-sql/schema/communication-schema.d.ts +743 -0
- package/dist/types/store-sql/schema/envelope-schema.d.ts +701 -0
- package/dist/types/store-sql/schema/execution-schema.d.ts +1119 -0
- package/dist/types/store-sql/schema/idempotency-schema.d.ts +161 -0
- package/dist/types/store-sql/schema/presence-schema.d.ts +116 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +13 -6684
- package/dist/types/store-sql/schema/resident-schema.d.ts +294 -0
- package/dist/types/store-sql/schema/schedule-schema.d.ts +282 -0
- package/dist/types/store-sql/schema/schema-columns.d.ts +1 -0
- package/dist/types/store-sql/schema/session-schema.d.ts +228 -0
- package/dist/types/store-sql/schema/tool-schema.d.ts +627 -0
- package/dist/types/store-sql/schema/workflow-schema.d.ts +996 -0
- package/dist/types/store-sql/schema/workspace-schema.d.ts +338 -0
- package/dist/types/store-sql/session/session-entry-records.d.ts +52 -0
- package/dist/types/store-sql/session/session-records.d.ts +51 -0
- package/dist/types/store-sql/session/session-repository.d.ts +2 -3
- package/dist/types/store-sql/tool/tool-attempt-records.d.ts +52 -0
- package/dist/types/store-sql/tool/tool-call-records.d.ts +121 -0
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +1 -2
- package/dist/types/store-sql/tool/tool-work-operations.d.ts +11 -0
- package/package.json +3 -3
- package/dist/types/runtime/entity/entity-instance-service.d.ts +0 -76
- package/dist/types/runtime/entity/entity-registry-service.d.ts +0 -35
- package/dist/types/store-sql/entity/entity-repository.d.ts +0 -36
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { StateVersionConflict } from "./state-version-conflict";
|
|
2
2
|
export { StateVersionConflict } from "./state-version-conflict";
|
|
3
3
|
import type { Agent as BatonAgent } from "@batonfx/core";
|
|
4
|
-
import { Address, Agent, ChildOrchestration, Content,
|
|
4
|
+
import { Address, Agent, ChildOrchestration, Content, Resident, Envelope, Execution, Ids, Inbox, Presence, Shared, Skill, State, Tool, Workflow } from "../schema/index";
|
|
5
5
|
import { Context, Effect, Schema, Stream } from "effect";
|
|
6
6
|
import type { Tool as BatonTool } from "effect/unstable/ai";
|
|
7
|
-
import type { AckEnvelopeReadyInput, CancelExecutionAccepted, CancelExecutionInput, CancelScheduleInput, CancelScheduleResult, ClaimEnvelopeReadyInput, CreateScheduleInput, CreateScheduleResult, EnvelopeReadyAcked, EnvelopeReadyLease, EnvelopeReadyReleased, ExecutionInspection, ExecutionListChange, GetSessionInput, GetSessionResult,
|
|
7
|
+
import type { AckEnvelopeReadyInput, CancelExecutionAccepted, CancelExecutionInput, CancelScheduleInput, CancelScheduleResult, ClaimEnvelopeReadyInput, CreateScheduleInput, CreateScheduleResult, EnvelopeReadyAcked, EnvelopeReadyLease, EnvelopeReadyReleased, ExecutionInspection, ExecutionListChange, GetSessionInput, GetSessionResult, GetResidentStateInput, PutResidentStateInput, DeleteResidentStateInput, ListResidentStateInput, SpawnResidentInput, GetResidentInput, DestroyResidentInput, ListResidentsInput, ListExecutionsInput, ListExecutionsResult, ListInboxMessagesInput, ListTopicSubscriptionsInput, PublishTopicInput, SubscribeTopicInput, TopicPublishAccepted, TopicSubscription, UnsubscribeTopicInput, ListPendingApprovalsInput, SessionStreamItem, StreamSessionInput, WatchExecutionsInput, ListRunnersResult, ListSchedulesInput, ListSchedulesResult, ListSessionsInput, ListSessionsResult, ListWaitsInput, PendingToolApprovalList, PendingToolCallList, ListPendingToolCallsInput, FulfillToolCallInput, ClaimToolWorkInput, CompleteToolWorkInput, ReleaseToolWorkInput, ListToolAttemptsInput, ToolAttemptList, ToolOutcomeAccepted, ToolWorkLease, ToolWorkReleased, ReleaseEnvelopeReadyInput, PageExecutionEventsInput, PageExecutionEventsResult, ReplayExecutionInput, ReplayExecutionResult, ResolvePermissionInput, ResolveToolApprovalInput, RouteExecutionResult, StartExecutionInput, StartExecutionResult, SpawnChildRunInput, CancelChildFanOutInput, CancelChildFanOutResult, CreateChildFanOutInput, InspectChildFanOutInput, InspectChildFanOutResult, SteerAccepted, SteerInput, StreamExecutionInput, SubmitInboundEnvelopeAccepted, SubmitInboundEnvelopeInput, WaitView, WakeAccepted, WakeInput } from "./operation";
|
|
8
8
|
import { EventLogCursorNotFound } from "./operation";
|
|
9
9
|
export { EventLogCursorNotFound } from "./operation";
|
|
10
10
|
import { AwaitWaitInput, WaitOutcome } from "./operation";
|
|
11
11
|
import { FollowExecutionInput, FollowExecutionItem } from "./operation";
|
|
12
|
-
import { CommandReplyInvalid, CommandTimedOut,
|
|
12
|
+
import { CommandReplyInvalid, CommandTimedOut, ResidentNotFound } from "./command";
|
|
13
13
|
import type { Command } from "./command";
|
|
14
14
|
import { type RuntimeCapabilityUnavailable } from "./runtime-capability-policy";
|
|
15
15
|
declare const ClientError_base: Schema.Class<ClientError, Schema.TaggedStruct<"ClientError", {
|
|
@@ -24,11 +24,11 @@ declare const ExecutionNotFound_base: Schema.Class<ExecutionNotFound, Schema.Tag
|
|
|
24
24
|
}>, import("effect/Cause").YieldableError>;
|
|
25
25
|
export declare class ExecutionNotFound extends ExecutionNotFound_base {
|
|
26
26
|
}
|
|
27
|
-
declare const
|
|
27
|
+
declare const ResidentNamespaceReserved_base: Schema.Class<ResidentNamespaceReserved, Schema.TaggedStruct<"ResidentNamespaceReserved", {
|
|
28
28
|
readonly id: Schema.String;
|
|
29
29
|
readonly message: Schema.String;
|
|
30
30
|
}>, import("effect/Cause").YieldableError>;
|
|
31
|
-
export declare class
|
|
31
|
+
export declare class ResidentNamespaceReserved extends ResidentNamespaceReserved_base {
|
|
32
32
|
}
|
|
33
33
|
declare const WaitKindMismatch_base: Schema.Class<WaitKindMismatch, Schema.TaggedStruct<"WaitKindMismatch", {
|
|
34
34
|
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
@@ -40,9 +40,9 @@ declare const WaitKindMismatch_base: Schema.Class<WaitKindMismatch, Schema.Tagge
|
|
|
40
40
|
}>, import("effect/Cause").YieldableError>;
|
|
41
41
|
export declare class WaitKindMismatch extends WaitKindMismatch_base {
|
|
42
42
|
}
|
|
43
|
-
export interface
|
|
44
|
-
readonly kind: Ids.
|
|
45
|
-
readonly key: Ids.
|
|
43
|
+
export interface AskResidentInput<Name extends string, I extends Schema.Top, O extends Schema.Top> {
|
|
44
|
+
readonly kind: Ids.ResidentKindName;
|
|
45
|
+
readonly key: Ids.ResidentKey;
|
|
46
46
|
readonly command: Command<Name, I, O>;
|
|
47
47
|
readonly input: I["Type"];
|
|
48
48
|
readonly from: Ids.AddressId;
|
|
@@ -100,12 +100,12 @@ export interface RegisterAgent {
|
|
|
100
100
|
<Tools extends Record<string, BatonTool.Any>, Requirements>(input: RegisterBatonAgentInput<Tools, Requirements>): Effect.Effect<Agent.DefinitionRegistered, ClientError>;
|
|
101
101
|
(input: RegisterDefinedAgentInput): Effect.Effect<Agent.DefinitionRegistered, ClientError>;
|
|
102
102
|
}
|
|
103
|
-
export interface
|
|
104
|
-
readonly
|
|
105
|
-
readonly
|
|
106
|
-
readonly
|
|
107
|
-
readonly
|
|
108
|
-
readonly
|
|
103
|
+
export interface FlatInterface {
|
|
104
|
+
readonly registerResidentKind: (input: Resident.KindDefinition) => Effect.Effect<Resident.KindDefinition, ClientError>;
|
|
105
|
+
readonly spawnResident: (input: SpawnResidentInput) => Effect.Effect<Resident.Instance, ClientError>;
|
|
106
|
+
readonly getResident: (input: GetResidentInput) => Effect.Effect<Resident.Instance | undefined, ClientError>;
|
|
107
|
+
readonly destroyResident: (input: DestroyResidentInput) => Effect.Effect<Resident.Instance, ClientError>;
|
|
108
|
+
readonly listResidents: (input: ListResidentsInput) => Effect.Effect<ReadonlyArray<Resident.Instance>, ClientError>;
|
|
109
109
|
readonly registerWorkflowDefinition: (input: Workflow.RegisterDefinitionPayload) => Effect.Effect<Workflow.DefinitionRegistered, ClientError>;
|
|
110
110
|
readonly getWorkflowDefinitionRevision: (id: Ids.WorkflowDefinitionId, revision?: Workflow.DefinitionRevision) => Effect.Effect<Workflow.DefinitionRevisionRecord | undefined, ClientError>;
|
|
111
111
|
readonly listWorkflowDefinitionRevisions: (id: Ids.WorkflowDefinitionId) => Effect.Effect<Workflow.DefinitionRevisionList, ClientError>;
|
|
@@ -121,12 +121,12 @@ export interface Interface {
|
|
|
121
121
|
readonly getSkillDefinition: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRecord | undefined, ClientError>;
|
|
122
122
|
readonly listSkillDefinitions: (_?: void) => Effect.Effect<Skill.DefinitionList, ClientError>;
|
|
123
123
|
readonly listSkillDefinitionRevisions: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRevisionList, ClientError>;
|
|
124
|
-
readonly registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered,
|
|
124
|
+
readonly registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered, ResidentNamespaceReserved | ClientError>;
|
|
125
125
|
readonly getAddressBookRoute: (id: Ids.AddressId) => Effect.Effect<Address.RouteRecord | undefined, ClientError>;
|
|
126
126
|
readonly listAddressBookRoutes: (_?: void) => Effect.Effect<Address.RouteList, ClientError>;
|
|
127
|
-
readonly startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult,
|
|
128
|
-
readonly startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult,
|
|
129
|
-
readonly startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult,
|
|
127
|
+
readonly startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult, ResidentNamespaceReserved | ClientError>;
|
|
128
|
+
readonly startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult, ResidentNamespaceReserved | ClientError>;
|
|
129
|
+
readonly startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult, ResidentNamespaceReserved | ClientError>;
|
|
130
130
|
readonly cancelExecution: (input: CancelExecutionInput) => Effect.Effect<CancelExecutionAccepted, ClientError>;
|
|
131
131
|
readonly steer: (input: SteerInput) => Effect.Effect<SteerAccepted, ClientError>;
|
|
132
132
|
readonly getExecution: (id: Ids.ExecutionId) => Effect.Effect<Execution.Execution | undefined, ClientError>;
|
|
@@ -145,16 +145,16 @@ export interface Interface {
|
|
|
145
145
|
readonly listRunners: (_?: void) => Effect.Effect<ListRunnersResult, ClientError>;
|
|
146
146
|
readonly routeExecution: (executionId: Ids.ExecutionId) => Effect.Effect<RouteExecutionResult, ClientError>;
|
|
147
147
|
readonly send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError>;
|
|
148
|
-
readonly
|
|
148
|
+
readonly askResident: <Name extends string, I extends Schema.Top, O extends Schema.Top>(input: AskResidentInput<Name, I, O>) => Effect.Effect<O["Type"], CommandTimedOut | CommandReplyInvalid | ResidentNotFound | ClientError, I["EncodingServices"] | O["DecodingServices"]>;
|
|
149
149
|
readonly awaitWait: (input: AwaitWaitInput) => Effect.Effect<WaitOutcome, ClientError>;
|
|
150
150
|
readonly streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, EventLogCursorNotFound | ClientError>;
|
|
151
151
|
readonly followExecution: (input: FollowExecutionInput) => Stream.Stream<FollowExecutionItem, EventLogCursorNotFound | ClientError>;
|
|
152
152
|
readonly streamSession: (input: StreamSessionInput) => Stream.Stream<SessionStreamItem, EventLogCursorNotFound | ClientError>;
|
|
153
153
|
readonly watchExecutions: (input: WatchExecutionsInput) => Stream.Stream<ExecutionListChange, ClientError>;
|
|
154
|
-
readonly
|
|
155
|
-
readonly
|
|
156
|
-
readonly
|
|
157
|
-
readonly
|
|
154
|
+
readonly getResidentState: (input: GetResidentStateInput) => Effect.Effect<State.StateRecordView | undefined, ClientError>;
|
|
155
|
+
readonly putResidentState: (input: PutResidentStateInput) => Effect.Effect<State.StateRecordView, StateVersionConflict | ClientError>;
|
|
156
|
+
readonly deleteResidentState: (input: DeleteResidentStateInput) => Effect.Effect<State.StateRecordView | undefined, StateVersionConflict | ClientError>;
|
|
157
|
+
readonly listResidentState: (input: ListResidentStateInput) => Effect.Effect<ReadonlyArray<State.StateRecordView>, ClientError>;
|
|
158
158
|
readonly getPresence: (scope: Presence.Scope) => Effect.Effect<Presence.View, ClientError>;
|
|
159
159
|
readonly watchPresence: (scope: Presence.Scope) => Stream.Stream<Presence.View, ClientError>;
|
|
160
160
|
readonly wake: (input: WakeInput) => Effect.Effect<WakeAccepted, WaitKindMismatch | ClientError>;
|
|
@@ -179,6 +179,116 @@ export interface Interface {
|
|
|
179
179
|
readonly cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError>;
|
|
180
180
|
readonly listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError>;
|
|
181
181
|
}
|
|
182
|
+
export interface Interface {
|
|
183
|
+
readonly executions: {
|
|
184
|
+
readonly start: FlatInterface["startExecution"];
|
|
185
|
+
readonly startByAddress: FlatInterface["startExecutionByAddress"];
|
|
186
|
+
readonly startByAgentDefinition: FlatInterface["startExecutionByAgentDefinition"];
|
|
187
|
+
readonly cancel: FlatInterface["cancelExecution"];
|
|
188
|
+
readonly get: FlatInterface["getExecution"];
|
|
189
|
+
readonly list: FlatInterface["listExecutions"];
|
|
190
|
+
readonly replay: FlatInterface["replayExecution"];
|
|
191
|
+
readonly pageEvents: FlatInterface["pageExecutionEvents"];
|
|
192
|
+
readonly inspect: FlatInterface["inspectExecution"];
|
|
193
|
+
readonly route: FlatInterface["routeExecution"];
|
|
194
|
+
readonly steer: FlatInterface["steer"];
|
|
195
|
+
readonly stream: FlatInterface["streamExecution"];
|
|
196
|
+
readonly follow: FlatInterface["followExecution"];
|
|
197
|
+
readonly watch: FlatInterface["watchExecutions"];
|
|
198
|
+
};
|
|
199
|
+
readonly residents: {
|
|
200
|
+
readonly spawn: FlatInterface["spawnResident"];
|
|
201
|
+
readonly get: FlatInterface["getResident"];
|
|
202
|
+
readonly destroy: FlatInterface["destroyResident"];
|
|
203
|
+
readonly list: FlatInterface["listResidents"];
|
|
204
|
+
readonly ask: FlatInterface["askResident"];
|
|
205
|
+
readonly registerKind: FlatInterface["registerResidentKind"];
|
|
206
|
+
readonly getState: FlatInterface["getResidentState"];
|
|
207
|
+
readonly putState: FlatInterface["putResidentState"];
|
|
208
|
+
readonly deleteState: FlatInterface["deleteResidentState"];
|
|
209
|
+
readonly listState: FlatInterface["listResidentState"];
|
|
210
|
+
};
|
|
211
|
+
readonly agents: {
|
|
212
|
+
readonly register: FlatInterface["registerAgent"];
|
|
213
|
+
readonly registerDefinition: FlatInterface["registerAgentDefinition"];
|
|
214
|
+
readonly getDefinition: FlatInterface["getAgentDefinition"];
|
|
215
|
+
readonly listDefinitions: FlatInterface["listAgentDefinitions"];
|
|
216
|
+
readonly listDefinitionRevisions: FlatInterface["listAgentDefinitionRevisions"];
|
|
217
|
+
};
|
|
218
|
+
readonly skills: {
|
|
219
|
+
readonly getDefinition: FlatInterface["getSkillDefinition"];
|
|
220
|
+
readonly listDefinitions: FlatInterface["listSkillDefinitions"];
|
|
221
|
+
readonly listDefinitionRevisions: FlatInterface["listSkillDefinitionRevisions"];
|
|
222
|
+
};
|
|
223
|
+
readonly sessions: {
|
|
224
|
+
readonly get: FlatInterface["getSession"];
|
|
225
|
+
readonly list: FlatInterface["listSessions"];
|
|
226
|
+
readonly stream: FlatInterface["streamSession"];
|
|
227
|
+
};
|
|
228
|
+
readonly waits: {
|
|
229
|
+
readonly list: FlatInterface["listWaits"];
|
|
230
|
+
readonly await: FlatInterface["awaitWait"];
|
|
231
|
+
readonly wake: FlatInterface["wake"];
|
|
232
|
+
};
|
|
233
|
+
readonly envelopes: {
|
|
234
|
+
readonly send: FlatInterface["send"];
|
|
235
|
+
readonly submitInbound: FlatInterface["submitInboundEnvelope"];
|
|
236
|
+
readonly listInbox: FlatInterface["listInboxMessages"];
|
|
237
|
+
readonly claimReady: FlatInterface["claimEnvelopeReady"];
|
|
238
|
+
readonly ackReady: FlatInterface["ackEnvelopeReady"];
|
|
239
|
+
readonly releaseReady: FlatInterface["releaseEnvelopeReady"];
|
|
240
|
+
};
|
|
241
|
+
readonly tools: {
|
|
242
|
+
readonly listPending: FlatInterface["listPendingToolCalls"];
|
|
243
|
+
readonly fulfill: FlatInterface["fulfillToolCall"];
|
|
244
|
+
readonly claimWork: FlatInterface["claimToolWork"];
|
|
245
|
+
readonly completeWork: FlatInterface["completeToolWork"];
|
|
246
|
+
readonly releaseWork: FlatInterface["releaseToolWork"];
|
|
247
|
+
readonly listAttempts: FlatInterface["listToolAttempts"];
|
|
248
|
+
readonly listPendingApprovals: FlatInterface["listPendingApprovals"];
|
|
249
|
+
readonly resolveApproval: FlatInterface["resolveToolApproval"];
|
|
250
|
+
readonly resolvePermission: FlatInterface["resolvePermission"];
|
|
251
|
+
};
|
|
252
|
+
readonly topics: {
|
|
253
|
+
readonly subscribe: FlatInterface["subscribeTopic"];
|
|
254
|
+
readonly unsubscribe: FlatInterface["unsubscribeTopic"];
|
|
255
|
+
readonly publish: FlatInterface["publishTopic"];
|
|
256
|
+
readonly listSubscriptions: FlatInterface["listTopicSubscriptions"];
|
|
257
|
+
};
|
|
258
|
+
readonly childRuns: {
|
|
259
|
+
readonly spawn: FlatInterface["spawnChildRun"];
|
|
260
|
+
readonly createFanOut: FlatInterface["createChildFanOut"];
|
|
261
|
+
readonly cancelFanOut: FlatInterface["cancelChildFanOut"];
|
|
262
|
+
readonly inspectFanOut: FlatInterface["inspectChildFanOut"];
|
|
263
|
+
};
|
|
264
|
+
readonly schedules: {
|
|
265
|
+
readonly create: FlatInterface["createSchedule"];
|
|
266
|
+
readonly cancel: FlatInterface["cancelSchedule"];
|
|
267
|
+
readonly list: FlatInterface["listSchedules"];
|
|
268
|
+
};
|
|
269
|
+
readonly workflows: {
|
|
270
|
+
readonly registerDefinition: FlatInterface["registerWorkflowDefinition"];
|
|
271
|
+
readonly getDefinitionRevision: FlatInterface["getWorkflowDefinitionRevision"];
|
|
272
|
+
readonly listDefinitionRevisions: FlatInterface["listWorkflowDefinitionRevisions"];
|
|
273
|
+
readonly startRun: FlatInterface["startWorkflowRun"];
|
|
274
|
+
readonly cancelRun: FlatInterface["cancelWorkflowRun"];
|
|
275
|
+
readonly replayRun: FlatInterface["replayWorkflowRun"];
|
|
276
|
+
readonly inspectRun: FlatInterface["inspectWorkflowRun"];
|
|
277
|
+
};
|
|
278
|
+
readonly addressBook: {
|
|
279
|
+
readonly register: FlatInterface["registerAddressBookRoute"];
|
|
280
|
+
readonly get: FlatInterface["getAddressBookRoute"];
|
|
281
|
+
readonly list: FlatInterface["listAddressBookRoutes"];
|
|
282
|
+
};
|
|
283
|
+
readonly presence: {
|
|
284
|
+
readonly get: FlatInterface["getPresence"];
|
|
285
|
+
readonly watch: FlatInterface["watchPresence"];
|
|
286
|
+
};
|
|
287
|
+
readonly runners: {
|
|
288
|
+
readonly list: FlatInterface["listRunners"];
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
export type PublicOperation<Operation> = Operation extends (...args: infer Args) => Effect.Effect<infer A, infer E, infer R> ? (...args: Args) => Effect.Effect<A, E, R | Service> : Operation extends (...args: infer Args) => Stream.Stream<infer A, infer E, infer R> ? (...args: Args) => Stream.Stream<A, E, R | Service> : never;
|
|
182
292
|
export type Identifier = "@relayfx/sdk/client-public/Service";
|
|
183
293
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/client-public/Service", Interface>;
|
|
184
294
|
export declare class Service extends Service_base {
|
|
@@ -189,293 +299,3 @@ export interface FollowExecutionDependencies {
|
|
|
189
299
|
readonly streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, EventLogCursorNotFound | ClientError>;
|
|
190
300
|
}
|
|
191
301
|
export declare const followExecutionFrom: (dependencies: FollowExecutionDependencies) => (input: FollowExecutionInput) => Stream.Stream<FollowExecutionItem, EventLogCursorNotFound | ClientError>;
|
|
192
|
-
export declare const registerAgentDefinition: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, ClientError, Service>;
|
|
193
|
-
export declare const registerEntityKind: (input: Entity.KindDefinition) => Effect.Effect<Entity.KindDefinition, ClientError, Service>;
|
|
194
|
-
export declare const getOrCreateEntity: (input: GetOrCreateEntityInput) => Effect.Effect<Entity.Instance, ClientError, Service>;
|
|
195
|
-
export declare const getEntity: (input: GetEntityInput) => Effect.Effect<Entity.Instance | undefined, ClientError, Service>;
|
|
196
|
-
export declare const destroyEntity: (input: DestroyEntityInput) => Effect.Effect<Entity.Instance, ClientError, Service>;
|
|
197
|
-
export declare const listEntities: (input: ListEntitiesInput) => Effect.Effect<readonly Entity.Instance[], ClientError, Service>;
|
|
198
|
-
export declare function registerAgent<Tools extends Record<string, BatonTool.Any>, Requirements>(input: RegisterBatonAgentInput<Tools, Requirements>): Effect.Effect<Agent.DefinitionRegistered, ClientError, Service>;
|
|
199
|
-
export declare function registerAgent(input: RegisterDefinedAgentInput): Effect.Effect<Agent.DefinitionRegistered, ClientError, Service>;
|
|
200
|
-
export declare const getAgentDefinition: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRecord | undefined, ClientError, Service>;
|
|
201
|
-
export declare const listAgentDefinitions: () => Effect.Effect<Agent.DefinitionList, ClientError, Service>;
|
|
202
|
-
export declare const listAgentDefinitionRevisions: (id: string & import("effect/Brand").Brand<"Relay.AgentId">) => Effect.Effect<Agent.DefinitionRevisionList, ClientError, Service>;
|
|
203
|
-
export declare const getSkillDefinition: (id: string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">) => Effect.Effect<Skill.DefinitionRecord | undefined, ClientError, Service>;
|
|
204
|
-
export declare const listSkillDefinitions: () => Effect.Effect<Skill.DefinitionList, ClientError, Service>;
|
|
205
|
-
export declare const listSkillDefinitionRevisions: (id: string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">) => Effect.Effect<Skill.DefinitionRevisionList, ClientError, Service>;
|
|
206
|
-
export declare const registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered, ClientError | EntityNamespaceReserved, Service>;
|
|
207
|
-
export declare const getAddressBookRoute: (id: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<Address.RouteRecord | undefined, ClientError, Service>;
|
|
208
|
-
export declare const listAddressBookRoutes: () => Effect.Effect<Address.RouteList, ClientError, Service>;
|
|
209
|
-
export declare const startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult, ClientError | EntityNamespaceReserved, Service>;
|
|
210
|
-
export declare const startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult, ClientError | EntityNamespaceReserved, Service>;
|
|
211
|
-
export declare const startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult, ClientError | EntityNamespaceReserved, Service>;
|
|
212
|
-
export declare const cancelExecution: (input: CancelExecutionInput) => Effect.Effect<CancelExecutionAccepted, ClientError, Service>;
|
|
213
|
-
export declare const steer: (input: SteerInput) => Effect.Effect<SteerAccepted, ClientError, Service>;
|
|
214
|
-
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: ListExecutionsInput) => Effect.Effect<ListExecutionsResult, ClientError, Service>;
|
|
216
|
-
export declare const listSessions: (input: ListSessionsInput) => Effect.Effect<ListSessionsResult, ClientError, Service>;
|
|
217
|
-
export declare const getSession: (input: GetSessionInput) => Effect.Effect<GetSessionResult, ClientError, Service>;
|
|
218
|
-
export declare const listWaits: (input: ListWaitsInput) => Effect.Effect<readonly WaitView[], ClientError, Service>;
|
|
219
|
-
export declare const replayExecution: (input: ReplayExecutionInput) => Effect.Effect<ReplayExecutionResult, ClientError, Service>;
|
|
220
|
-
export declare const pageExecutionEvents: (input: PageExecutionEventsInput) => Effect.Effect<PageExecutionEventsResult, ClientError | EventLogCursorNotFound, Service>;
|
|
221
|
-
export declare const listRunners: () => Effect.Effect<ListRunnersResult, ClientError, Service>;
|
|
222
|
-
export declare const routeExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<RouteExecutionResult, ClientError, Service>;
|
|
223
|
-
export declare const subscribeTopic: (input: SubscribeTopicInput) => Effect.Effect<TopicSubscription, ClientError, Service>;
|
|
224
|
-
export declare const unsubscribeTopic: (input: UnsubscribeTopicInput) => Effect.Effect<void, ClientError, Service>;
|
|
225
|
-
export declare const publishTopic: (input: PublishTopicInput) => Effect.Effect<TopicPublishAccepted, ClientError, Service>;
|
|
226
|
-
export declare const listTopicSubscriptions: (input: ListTopicSubscriptionsInput) => Effect.Effect<readonly TopicSubscription[], ClientError, Service>;
|
|
227
|
-
export declare const listInboxMessages: (input: ListInboxMessagesInput) => Effect.Effect<readonly Inbox.Message[], ClientError, Service>;
|
|
228
|
-
export declare const inspectExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<ExecutionInspection, ClientError | ExecutionNotFound, Service>;
|
|
229
|
-
export declare const send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError, Service>;
|
|
230
|
-
export declare const streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError | EventLogCursorNotFound, Service>;
|
|
231
|
-
export declare const followExecution: (input: FollowExecutionInput) => Stream.Stream<Schema.Struct.ReadonlySide<{
|
|
232
|
-
readonly _tag: Schema.tag<"event">;
|
|
233
|
-
readonly event: Schema.Struct<{
|
|
234
|
-
readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
|
|
235
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
|
|
236
|
-
};
|
|
237
|
-
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
238
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
239
|
-
};
|
|
240
|
-
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
241
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
242
|
-
}>;
|
|
243
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
244
|
-
readonly sequence: Schema.Int;
|
|
245
|
-
readonly cursor: Schema.String;
|
|
246
|
-
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
247
|
-
readonly type: Schema.Literal<"text">;
|
|
248
|
-
readonly text: Schema.String;
|
|
249
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
250
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
251
|
-
}>, Schema.Struct<{
|
|
252
|
-
readonly type: Schema.Literal<"structured">;
|
|
253
|
-
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
254
|
-
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
255
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
256
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
257
|
-
}>, Schema.Struct<{
|
|
258
|
-
readonly type: Schema.Literal<"blob-reference">;
|
|
259
|
-
readonly uri: Schema.String;
|
|
260
|
-
readonly media_type: Schema.String;
|
|
261
|
-
readonly filename: Schema.optionalKey<Schema.String>;
|
|
262
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
263
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
264
|
-
}>, Schema.Struct<{
|
|
265
|
-
readonly type: Schema.Literal<"artifact-reference">;
|
|
266
|
-
readonly artifact_id: Schema.String;
|
|
267
|
-
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
268
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
269
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
270
|
-
}>, Schema.Struct<{
|
|
271
|
-
readonly type: Schema.Literal<"tool-call">;
|
|
272
|
-
readonly call: Schema.Struct<{
|
|
273
|
-
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
274
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
275
|
-
};
|
|
276
|
-
readonly name: Schema.String;
|
|
277
|
-
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
278
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
279
|
-
}>;
|
|
280
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
281
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
282
|
-
}>, Schema.Struct<{
|
|
283
|
-
readonly type: Schema.Literal<"tool-result">;
|
|
284
|
-
readonly result: Schema.Struct<{
|
|
285
|
-
readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
286
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
287
|
-
};
|
|
288
|
-
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
289
|
-
readonly error: Schema.optionalKey<Schema.String>;
|
|
290
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
291
|
-
}>;
|
|
292
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
293
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
294
|
-
}>]>>>;
|
|
295
|
-
readonly data: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
296
|
-
readonly created_at: Schema.Int;
|
|
297
|
-
}>;
|
|
298
|
-
}, "Type"> | Schema.Struct.ReadonlySide<{
|
|
299
|
-
readonly _tag: Schema.tag<"reconnecting">;
|
|
300
|
-
readonly message: Schema.String;
|
|
301
|
-
readonly attempt: Schema.Int;
|
|
302
|
-
}, "Type"> | Schema.Struct.ReadonlySide<{
|
|
303
|
-
readonly _tag: Schema.tag<"stopped">;
|
|
304
|
-
readonly reason: Schema.Union<readonly [Schema.Struct<{
|
|
305
|
-
readonly _tag: Schema.tag<"terminal">;
|
|
306
|
-
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
307
|
-
}>, Schema.Struct<{
|
|
308
|
-
readonly _tag: Schema.tag<"actionable_wait">;
|
|
309
|
-
readonly wait: Schema.Struct<{
|
|
310
|
-
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
311
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
312
|
-
};
|
|
313
|
-
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
314
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
315
|
-
};
|
|
316
|
-
readonly envelope_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.EnvelopeId"> & {
|
|
317
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EnvelopeId">;
|
|
318
|
-
}>;
|
|
319
|
-
readonly kind: Schema.optionalKey<Schema.Literals<readonly ["permission", "tool_approval", "tool_placement", "child_join", "inbox", "reply", "timer", "external"]>>;
|
|
320
|
-
readonly mode: Schema.Literals<readonly ["reply", "event", "until", "child"]>;
|
|
321
|
-
readonly correlation_key: Schema.optionalKey<Schema.String>;
|
|
322
|
-
readonly state: Schema.Literals<readonly ["open", "resolved", "timed_out", "cancelled"]>;
|
|
323
|
-
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
324
|
-
readonly created_at: Schema.Int;
|
|
325
|
-
readonly resolved_at: Schema.optionalKey<Schema.Int>;
|
|
326
|
-
}>;
|
|
327
|
-
}>]>;
|
|
328
|
-
readonly cursor: Schema.NullOr<Schema.String>;
|
|
329
|
-
}, "Type">, ClientError | EventLogCursorNotFound, Service>;
|
|
330
|
-
export declare const streamSession: (input: StreamSessionInput) => Stream.Stream<Schema.Struct.ReadonlySide<{
|
|
331
|
-
readonly _tag: Schema.tag<"execution_joined">;
|
|
332
|
-
readonly execution: Schema.Struct<{
|
|
333
|
-
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
334
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
335
|
-
};
|
|
336
|
-
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
337
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
338
|
-
};
|
|
339
|
-
readonly session_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SessionId"> & {
|
|
340
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
341
|
-
}>;
|
|
342
|
-
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
343
|
-
readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
|
|
344
|
-
readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
345
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
346
|
-
}>;
|
|
347
|
-
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
348
|
-
readonly created_at: Schema.Int;
|
|
349
|
-
readonly updated_at: Schema.Int;
|
|
350
|
-
}>;
|
|
351
|
-
}, "Type"> | Schema.Struct.ReadonlySide<{
|
|
352
|
-
readonly _tag: Schema.tag<"execution_event">;
|
|
353
|
-
readonly event: Schema.Struct<{
|
|
354
|
-
readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
|
|
355
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.EventId">;
|
|
356
|
-
};
|
|
357
|
-
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
358
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
359
|
-
};
|
|
360
|
-
readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
|
|
361
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
|
|
362
|
-
}>;
|
|
363
|
-
readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.toolcall.delta", "model.output.completed", "model.usage.reported", "agent.compaction.committed", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "state.updated", "state.deleted", "inbox.enqueued", "inbox.drained", "entity.created", "entity.destroyed", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "child_fan_out.created", "child_fan_out.member.admitted", "child_fan_out.member.terminal", "child_fan_out.terminal", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
|
|
364
|
-
readonly sequence: Schema.Int;
|
|
365
|
-
readonly cursor: Schema.String;
|
|
366
|
-
readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
367
|
-
readonly type: Schema.Literal<"text">;
|
|
368
|
-
readonly text: Schema.String;
|
|
369
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
370
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
371
|
-
}>, Schema.Struct<{
|
|
372
|
-
readonly type: Schema.Literal<"structured">;
|
|
373
|
-
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
374
|
-
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
375
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
376
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
377
|
-
}>, Schema.Struct<{
|
|
378
|
-
readonly type: Schema.Literal<"blob-reference">;
|
|
379
|
-
readonly uri: Schema.String;
|
|
380
|
-
readonly media_type: Schema.String;
|
|
381
|
-
readonly filename: Schema.optionalKey<Schema.String>;
|
|
382
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
383
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
384
|
-
}>, Schema.Struct<{
|
|
385
|
-
readonly type: Schema.Literal<"artifact-reference">;
|
|
386
|
-
readonly artifact_id: Schema.String;
|
|
387
|
-
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
388
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
389
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
390
|
-
}>, Schema.Struct<{
|
|
391
|
-
readonly type: Schema.Literal<"tool-call">;
|
|
392
|
-
readonly call: Schema.Struct<{
|
|
393
|
-
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
394
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
395
|
-
};
|
|
396
|
-
readonly name: Schema.String;
|
|
397
|
-
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
398
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
399
|
-
}>;
|
|
400
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
401
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
402
|
-
}>, Schema.Struct<{
|
|
403
|
-
readonly type: Schema.Literal<"tool-result">;
|
|
404
|
-
readonly result: Schema.Struct<{
|
|
405
|
-
readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
406
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
407
|
-
};
|
|
408
|
-
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
409
|
-
readonly error: Schema.optionalKey<Schema.String>;
|
|
410
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
411
|
-
}>;
|
|
412
|
-
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
413
|
-
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
414
|
-
}>]>>>;
|
|
415
|
-
readonly data: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
416
|
-
readonly created_at: Schema.Int;
|
|
417
|
-
}>;
|
|
418
|
-
}, "Type">, ClientError | EventLogCursorNotFound, Service>;
|
|
419
|
-
export declare const watchExecutions: (input: WatchExecutionsInput) => Stream.Stream<Schema.Struct.ReadonlySide<{
|
|
420
|
-
readonly _tag: Schema.tag<"upsert">;
|
|
421
|
-
readonly record: Schema.Struct<{
|
|
422
|
-
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
423
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
424
|
-
};
|
|
425
|
-
readonly root_address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
426
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
427
|
-
};
|
|
428
|
-
readonly session_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.SessionId"> & {
|
|
429
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
430
|
-
}>;
|
|
431
|
-
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "completed", "failed", "cancelled"]>;
|
|
432
|
-
readonly kind: Schema.Literals<readonly ["user-agent", "agent-agent"]>;
|
|
433
|
-
readonly agent_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.AgentId"> & {
|
|
434
|
-
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
435
|
-
}>;
|
|
436
|
-
readonly metadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
437
|
-
readonly created_at: Schema.Int;
|
|
438
|
-
readonly updated_at: Schema.Int;
|
|
439
|
-
}>;
|
|
440
|
-
}, "Type"> | {
|
|
441
|
-
readonly _tag: "snapshot";
|
|
442
|
-
readonly records: readonly {
|
|
443
|
-
readonly execution_id: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
444
|
-
readonly root_address_id: string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
445
|
-
readonly session_id?: string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
446
|
-
readonly status: "cancelled" | "completed" | "failed" | "queued" | "running" | "waiting";
|
|
447
|
-
readonly kind: "agent-agent" | "user-agent";
|
|
448
|
-
readonly agent_id?: string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
449
|
-
readonly metadata: {
|
|
450
|
-
readonly [x: string]: Schema.Json;
|
|
451
|
-
};
|
|
452
|
-
readonly created_at: number;
|
|
453
|
-
readonly updated_at: number;
|
|
454
|
-
}[];
|
|
455
|
-
readonly next_cursor?: string;
|
|
456
|
-
}, ClientError, Service>;
|
|
457
|
-
export declare const getPresence: (scope: Presence.Scope) => Effect.Effect<Presence.View, ClientError, Service>;
|
|
458
|
-
export declare const watchPresence: (scope: Presence.Scope) => Stream.Stream<Presence.View, ClientError, Service>;
|
|
459
|
-
export declare const wake: (input: WakeInput) => Effect.Effect<WakeAccepted, ClientError | WaitKindMismatch, Service>;
|
|
460
|
-
export declare const listPendingApprovals: (input: ListPendingApprovalsInput) => Effect.Effect<PendingToolApprovalList, ClientError, Service>;
|
|
461
|
-
export declare const resolveToolApproval: (input: ResolveToolApprovalInput) => Effect.Effect<WakeAccepted, ClientError | WaitKindMismatch, Service>;
|
|
462
|
-
export declare const resolvePermission: (input: ResolvePermissionInput) => Effect.Effect<WakeAccepted, ClientError | WaitKindMismatch, Service>;
|
|
463
|
-
export declare const listPendingToolCalls: (input: ListPendingToolCallsInput) => Effect.Effect<PendingToolCallList, ClientError, Service>;
|
|
464
|
-
export declare const fulfillToolCall: (input: FulfillToolCallInput) => Effect.Effect<ToolOutcomeAccepted, ClientError, Service>;
|
|
465
|
-
export declare const claimToolWork: (input: ClaimToolWorkInput) => Effect.Effect<ToolWorkLease | null, ClientError, Service>;
|
|
466
|
-
export declare const completeToolWork: (input: CompleteToolWorkInput) => Effect.Effect<ToolOutcomeAccepted, ClientError, Service>;
|
|
467
|
-
export declare const releaseToolWork: (input: ReleaseToolWorkInput) => Effect.Effect<ToolWorkReleased, ClientError, Service>;
|
|
468
|
-
export declare const listToolAttempts: (input: ListToolAttemptsInput) => Effect.Effect<ToolAttemptList, ClientError, Service>;
|
|
469
|
-
export declare const submitInboundEnvelope: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError | WaitKindMismatch, Service>;
|
|
470
|
-
export declare const spawnChildRun: (input: SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ClientError, Service>;
|
|
471
|
-
export declare const createChildFanOut: (input: CreateChildFanOutInput) => Effect.Effect<ChildOrchestration.FanOutState, ClientError | RuntimeCapabilityUnavailable, Service>;
|
|
472
|
-
export declare const cancelChildFanOut: (input: CancelChildFanOutInput) => Effect.Effect<CancelChildFanOutResult, ClientError, Service>;
|
|
473
|
-
export declare const inspectChildFanOut: (input: InspectChildFanOutInput) => Effect.Effect<InspectChildFanOutResult, ClientError, Service>;
|
|
474
|
-
export declare const claimEnvelopeReady: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError, Service>;
|
|
475
|
-
export declare const ackEnvelopeReady: (input: AckEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyAcked, ClientError, Service>;
|
|
476
|
-
export declare const releaseEnvelopeReady: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError, Service>;
|
|
477
|
-
export declare const createSchedule: (input: CreateScheduleInput) => Effect.Effect<CreateScheduleResult, ClientError, Service>;
|
|
478
|
-
export declare const cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError, Service>;
|
|
479
|
-
export declare const listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError, Service>;
|
|
480
|
-
export declare const askEntity: <Name extends string, I extends Schema.Top, O extends Schema.Top>(input: AskEntityInput<Name, I, O>) => Effect.Effect<O["Type"], ClientError | CommandReplyInvalid | CommandTimedOut | EntityNotFound, Service | I["EncodingServices"] | O["DecodingServices"]>;
|
|
481
|
-
export declare const awaitWait: (input: AwaitWaitInput) => Effect.Effect<WaitOutcome, ClientError, Service>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Interface as EventLogInterface } from "../runtime/execution/event-log-service";
|
|
2
|
+
import type { Interface as WaitServiceInterface } from "../runtime/wait/wait-service";
|
|
3
|
+
import { ExecutionRepository } from "../store-sql/portable";
|
|
4
|
+
import { Effect } from "effect";
|
|
5
|
+
import { ClientError, WaitKindMismatch } from "./client-public";
|
|
6
|
+
import type { WakeAccepted, WakeInput } from "./operation";
|
|
7
|
+
import { type ExecutionClientFactory } from "./client-wait-signal";
|
|
8
|
+
export declare const runtimeWakeInternals: {
|
|
9
|
+
wakeRuntime: (waits: WaitServiceInterface, eventLog: EventLogInterface, executionRepository: ExecutionRepository.Interface, makeExecutionClient: ExecutionClientFactory, input: WakeInput, accepts?: "tool-permission" | "tool-approval") => Effect.Effect<WakeAccepted, ClientError | WaitKindMismatch>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Interface as EventLogInterface } from "../runtime/execution/event-log-service";
|
|
2
|
+
import type { Interface as WaitServiceInterface } from "../runtime/wait/wait-service";
|
|
3
|
+
import { EnvelopeRepository, ExecutionRepository, ToolCallRepository } from "../store-sql/portable";
|
|
4
|
+
import { Effect, Schema } from "effect";
|
|
5
|
+
import { ClientError } from "./client-public";
|
|
6
|
+
import { type ExecutionClientFactory } from "./client-wait-signal";
|
|
7
|
+
export declare const resolveToolOutcomeWait: (waits: WaitServiceInterface, eventLog: EventLogInterface, call: ToolCallRepository.ToolCallRecord, outcome: Schema.Struct.ReadonlySide<{
|
|
8
|
+
readonly kind: Schema.Literal<"success">;
|
|
9
|
+
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
10
|
+
}, "Type"> | Schema.Struct.ReadonlySide<{
|
|
11
|
+
readonly kind: Schema.Literal<"failure">;
|
|
12
|
+
readonly message: Schema.String;
|
|
13
|
+
}, "Type">, completedAt: number) => Effect.Effect<EnvelopeRepository.WaitRecord, ClientError, never>;
|
|
14
|
+
export declare const toolOutcomeInternals: {
|
|
15
|
+
signalToolOutcome: (executionRepository: ExecutionRepository.Interface, makeExecutionClient: ExecutionClientFactory, wait: EnvelopeRepository.WaitRecord, signaledAt: number) => Effect.Effect<void, ClientError>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Execution } from "../schema/index";
|
|
2
|
+
import { ChildExecutionRepository, EnvelopeRepository, ExecutionRepository, SessionRepository, ToolCallRepository } from "../store-sql/portable";
|
|
3
|
+
import type { ChildRunSummary, ConversationSummary, EnvelopeReadyLease, PendingToolApproval, PendingToolCall, SessionSummary, ToolAttempt, ToolCallSummary, ToolOutcomeAccepted, ToolWorkLease, WaitView } from "./operation";
|
|
4
|
+
export declare const toConversationSummary: (record: ExecutionRepository.ExecutionRecord) => ConversationSummary;
|
|
5
|
+
export declare const toExecutionView: (record: ExecutionRepository.ExecutionRecord) => Execution.Execution;
|
|
6
|
+
export declare const toWaitView: (record: EnvelopeRepository.WaitRecord) => WaitView;
|
|
7
|
+
export declare const toSessionSummary: (record: SessionRepository.SessionRecord) => SessionSummary;
|
|
8
|
+
export declare const toToolCallSummary: (record: ToolCallRepository.ToolCallRecord) => ToolCallSummary;
|
|
9
|
+
export declare const toChildRunSummary: (record: ChildExecutionRepository.ChildExecutionRecord) => ChildRunSummary;
|
|
10
|
+
export declare const toPendingToolApproval: (record: EnvelopeRepository.WaitRecord) => PendingToolApproval;
|
|
11
|
+
export declare const isToolApprovalWait: (record: EnvelopeRepository.WaitRecord) => boolean;
|
|
12
|
+
export declare const toToolAttempt: (record: ToolCallRepository.ToolAttemptRecord) => ToolAttempt;
|
|
13
|
+
export declare const toPendingToolCall: (record: ToolCallRepository.ToolCallRecord) => PendingToolCall | undefined;
|
|
14
|
+
export declare const toToolOutcomeAccepted: (accepted: ToolCallRepository.AcceptedOutcome) => ToolOutcomeAccepted;
|
|
15
|
+
export declare const toToolWorkLease: (lease: ToolCallRepository.ToolWorkLease) => ToolWorkLease;
|
|
16
|
+
export declare const toLease: (record: EnvelopeRepository.EnvelopeReadyRecord) => EnvelopeReadyLease;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { client as ExecutionEntityclient } from "../runtime/cluster/execution-entity";
|
|
2
|
+
import { type ExecutionClientFactory as WaitSignalExecutionClientFactory } from "../runtime/wait/wait-signal";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
export type ExecutionClientFactory = Effect.Success<typeof ExecutionEntityclient>;
|
|
5
|
+
export declare const typedWaitSignalClient: (makeExecutionClient: ExecutionClientFactory) => WaitSignalExecutionClientFactory;
|