@relayfx/sdk 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +67 -37
- package/dist/http-server.js +22 -0
- package/dist/{index-c2skef55.js → index-70m3hgk1.js} +16521 -18783
- package/dist/index-bknsjvwf.js +3423 -0
- package/dist/index-cphmds30.js +2852 -0
- package/dist/index-nb39b5ae.js +17 -0
- package/dist/{index-vwbatywf.js → index-szzswx0z.js} +23 -30
- package/dist/index.js +315 -844
- package/dist/mysql.js +18 -18
- package/dist/postgres.js +724 -24
- package/dist/sqlite.js +57 -147
- package/dist/types/ai/index.d.ts +2 -1
- package/dist/types/ai/language-model/language-model-registration.d.ts +9 -6
- package/dist/types/relay/adapter-outbox.d.ts +1 -1
- package/dist/types/relay/ai.d.ts +34 -2
- package/dist/types/relay/child-fan-out-admission.d.ts +5 -0
- package/dist/types/relay/child-fan-out-host.d.ts +73 -0
- package/dist/types/relay/client-public.d.ts +481 -0
- package/dist/types/relay/client.d.ts +1 -478
- package/dist/types/relay/database-identity.d.ts +4 -0
- package/dist/types/relay/http-server.d.ts +95 -0
- package/dist/types/relay/index.d.ts +37 -14
- package/dist/types/relay/internal-client.d.ts +22 -0
- package/dist/types/relay/language-model-registration.d.ts +13 -0
- package/dist/types/relay/mysql.d.ts +6 -7
- package/dist/types/relay/operation.d.ts +4 -4
- package/dist/types/relay/postgres.d.ts +10 -7
- package/dist/types/relay/runtime-acquisition-error.d.ts +61 -0
- package/dist/types/relay/runtime-database-adapter.d.ts +8 -5
- package/dist/types/relay/runtime-database-owner.d.ts +13 -0
- package/dist/types/relay/runtime-database-public.d.ts +10 -0
- package/dist/types/relay/runtime.d.ts +77 -72
- package/dist/types/relay/sqlite-runtime.d.ts +5 -18
- package/dist/types/relay/sqlite.d.ts +4 -31
- package/dist/types/relay/state-version-conflict.d.ts +12 -0
- package/dist/types/relay/tool-runtime.d.ts +44 -0
- package/dist/types/relay/tool-worker.d.ts +2 -2
- package/dist/types/relay/workflow-definition-host.d.ts +32 -0
- package/dist/types/runtime/agent/agent-loop-error.d.ts +21 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +6 -16
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +3 -3
- package/dist/types/runtime/cluster/execution-entity.d.ts +3 -3
- package/dist/types/runtime/execution/execution-service.d.ts +3 -0
- package/dist/types/runtime/index.d.ts +1 -0
- package/dist/types/runtime/model/language-model-service.d.ts +5 -12
- package/dist/types/runtime/model/model-hub.d.ts +27 -0
- package/dist/types/runtime/presence/presence-contract.d.ts +24 -0
- package/dist/types/runtime/presence/presence-service.d.ts +6 -24
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +29 -13
- package/dist/types/runtime/session/session-store-service.d.ts +4 -1
- package/dist/types/runtime/tool/tool-runtime-contract.d.ts +121 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +6 -120
- package/dist/types/runtime/workflow/execution-workflow.d.ts +22 -24
- package/dist/types/schema/agent-schema.d.ts +4 -1
- package/dist/types/schema/execution-schema.d.ts +13 -2
- package/dist/types/schema/index.d.ts +1 -0
- package/dist/types/schema/pagination-schema.d.ts +17 -0
- package/dist/types/schema/shared-schema.d.ts +4 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +12 -12
- package/dist/types/store-sql/session/session-repository.d.ts +54 -11
- package/package.json +17 -14
- package/dist/index-d3dme13d.js +0 -141
- package/dist/index-pn652eef.js +0 -2860
- package/dist/types/relay/database.d.ts +0 -16
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export * from "../runtime/tool/tool-runtime-contract";
|
|
2
|
+
import type { DynamicToolOptions, Interface, PlacedToolOptions, RegisteredTool, RunError, RunInput, Service, ToolkitRegistrationOptions, ToolOptions } from "../runtime/tool/tool-runtime-contract";
|
|
3
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
+
import type { Tool as AiTool, Toolkit } from "effect/unstable/ai";
|
|
5
|
+
import type { Tool } from "../schema/index";
|
|
6
|
+
export declare const tool: {
|
|
7
|
+
<const Name extends string, Input extends Schema.ConstraintCodec<unknown, unknown, never, never>, Output extends Schema.ConstraintCodec<unknown, unknown, never, never>>(name: Name, options: ToolOptions<Input, Output>): RegisteredTool;
|
|
8
|
+
<Input extends Schema.ConstraintCodec<unknown, unknown, never, never>, Output extends Schema.ConstraintCodec<unknown, unknown, never, never>>(options: ToolOptions<Input, Output>): <const Name extends string>(name: Name) => RegisteredTool;
|
|
9
|
+
};
|
|
10
|
+
export declare const dynamicTool: {
|
|
11
|
+
<const Name extends string>(name: Name, options: DynamicToolOptions): RegisteredTool;
|
|
12
|
+
(options: DynamicToolOptions): <const Name extends string>(name: Name) => RegisteredTool;
|
|
13
|
+
};
|
|
14
|
+
export declare const clientTool: {
|
|
15
|
+
(modelTool: AiTool.Any, options?: PlacedToolOptions): RegisteredTool;
|
|
16
|
+
(options?: PlacedToolOptions): (modelTool: AiTool.Any) => RegisteredTool;
|
|
17
|
+
};
|
|
18
|
+
export declare const remoteTool: {
|
|
19
|
+
(modelTool: AiTool.Any, options: PlacedToolOptions & {
|
|
20
|
+
readonly queue: Tool.PlacementKey;
|
|
21
|
+
}): RegisteredTool;
|
|
22
|
+
(options: PlacedToolOptions & {
|
|
23
|
+
readonly queue: Tool.PlacementKey;
|
|
24
|
+
}): (modelTool: AiTool.Any) => RegisteredTool;
|
|
25
|
+
};
|
|
26
|
+
export interface HostInterface {
|
|
27
|
+
readonly registeredTools: Effect.Effect<ReadonlyArray<RegisteredTool>>;
|
|
28
|
+
}
|
|
29
|
+
declare const HostService_base: Context.ServiceClass<HostService, "@relayfx/sdk/tool-runtime/HostService", HostInterface>;
|
|
30
|
+
export declare class HostService extends HostService_base {
|
|
31
|
+
}
|
|
32
|
+
export declare const memoryLayer: (tools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<Service>;
|
|
33
|
+
/** Consumer tool registration layer. Runtime persistence is supplied by `Runtime.layerEmbedded` or `Runtime.layerRunner`. */
|
|
34
|
+
export declare const layer: (tools?: ReadonlyArray<RegisteredTool>) => Layer.Layer<HostService>;
|
|
35
|
+
export declare const memoryLayerFromToolkit: {
|
|
36
|
+
<Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>, options?: ToolkitRegistrationOptions): Layer.Layer<Service, never, AiTool.HandlersFor<Tools>>;
|
|
37
|
+
(options?: ToolkitRegistrationOptions): <Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Layer.Layer<Service, never, AiTool.HandlersFor<Tools>>;
|
|
38
|
+
};
|
|
39
|
+
export declare const layerFromToolkit: {
|
|
40
|
+
<Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>, options?: ToolkitRegistrationOptions): Layer.Layer<HostService, never, AiTool.HandlersFor<Tools>>;
|
|
41
|
+
(options?: ToolkitRegistrationOptions): <Tools extends Record<string, AiTool.Any>>(toolkit: Toolkit.Toolkit<Tools>) => Layer.Layer<HostService, never, AiTool.HandlersFor<Tools>>;
|
|
42
|
+
};
|
|
43
|
+
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service>;
|
|
44
|
+
export declare const run: (input: RunInput) => Effect.Effect<Tool.Result, RunError, Service>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Shared, Tool } from "../schema/index";
|
|
2
2
|
import { Duration, Effect } from "effect";
|
|
3
|
-
import { Service as ClientService } from "./client";
|
|
4
|
-
import type { ClientError } from "./client";
|
|
3
|
+
import { Service as ClientService } from "./client-public";
|
|
4
|
+
import type { ClientError } from "./client-public";
|
|
5
5
|
import type { ToolWorkLease } from "./operation";
|
|
6
6
|
export interface HandlerContext {
|
|
7
7
|
readonly lease: ToolWorkLease;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Ids, Shared, Workflow } from "../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
export declare const SideEffectContext: Schema.Struct<{
|
|
4
|
+
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
5
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
6
|
+
};
|
|
7
|
+
readonly operation_id: Schema.brand<Schema.String, "Relay.WorkflowOperationId"> & {
|
|
8
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WorkflowOperationId">;
|
|
9
|
+
};
|
|
10
|
+
readonly idempotency_key: Schema.String;
|
|
11
|
+
}>;
|
|
12
|
+
export interface SideEffectContext extends Schema.Schema.Type<typeof SideEffectContext> {
|
|
13
|
+
}
|
|
14
|
+
declare const HandlerError_base: Schema.Class<HandlerError, Schema.TaggedStruct<"WorkflowDefinitionHostHandlerError", {
|
|
15
|
+
readonly message: Schema.String;
|
|
16
|
+
}>, import("effect/Cause").YieldableError>;
|
|
17
|
+
export declare class HandlerError extends HandlerError_base {
|
|
18
|
+
}
|
|
19
|
+
export interface Handlers {
|
|
20
|
+
readonly tool?: (executionId: Ids.ExecutionId, operation: typeof Workflow.ToolOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, HandlerError>;
|
|
21
|
+
readonly child: (executionId: Ids.ExecutionId, operation: typeof Workflow.ChildOperation.Type | typeof Workflow.DispatchableChildOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, HandlerError>;
|
|
22
|
+
readonly approval: (executionId: Ids.ExecutionId, operation: typeof Workflow.ApprovalOperation.Type, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, HandlerError>;
|
|
23
|
+
readonly timer: (executionId: Ids.ExecutionId, operation: typeof Workflow.TimerOperation.Type, context: SideEffectContext) => Effect.Effect<void, HandlerError>;
|
|
24
|
+
readonly branch: (executionId: Ids.ExecutionId, operation: typeof Workflow.BranchOperation.Type, context: SideEffectContext) => Effect.Effect<boolean, HandlerError>;
|
|
25
|
+
readonly structuredCompletion: (schemaRef: string, value: Shared.JsonValue | undefined, context: SideEffectContext) => Effect.Effect<Shared.JsonValue, HandlerError>;
|
|
26
|
+
}
|
|
27
|
+
export type Interface = Handlers;
|
|
28
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/workflow-definition-host/Service", Handlers>;
|
|
29
|
+
export declare class Service extends Service_base {
|
|
30
|
+
}
|
|
31
|
+
export declare const layer: (handlers: Handlers) => Layer.Layer<Service, never, never>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AgentEvent, ModelRegistry, ToolExecutor, TurnPolicy } from "@batonfx/core";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { AiError } from "effect/unstable/ai";
|
|
4
|
+
declare const AgentLoopError_base: Schema.Class<AgentLoopError, Schema.TaggedStruct<"AgentLoopError", {
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
readonly failure_classification: Schema.optionalKey<Schema.Literal<"context-overflow">>;
|
|
7
|
+
readonly baton_failure: Schema.optionalKey<Schema.Union<readonly [typeof AgentEvent.AgentError, typeof AgentEvent.ResumeMismatch, typeof TurnPolicy.TurnPolicyError, typeof AgentEvent.TurnPolicyStopped, typeof AgentEvent.TurnLimitExceeded, typeof AgentEvent.MiddlewareViolation, typeof AgentEvent.DuplicateToolCallId, typeof AgentEvent.ProgressOverflowError, typeof AgentEvent.ToolNameCollision, typeof AiError.AiError, typeof ModelRegistry.LanguageModelNotRegistered, typeof ToolExecutor.FrameworkFailure]>>;
|
|
8
|
+
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
9
|
+
}>, import("effect/Cause").YieldableError>;
|
|
10
|
+
export declare class AgentLoopError extends AgentLoopError_base {
|
|
11
|
+
}
|
|
12
|
+
declare const AgentLoopBudgetExceeded_base: Schema.Class<AgentLoopBudgetExceeded, Schema.TaggedStruct<"AgentLoopBudgetExceeded", {
|
|
13
|
+
readonly tokens_used: Schema.Int;
|
|
14
|
+
readonly token_budget: Schema.Int;
|
|
15
|
+
readonly next_event_sequence: Schema.Int;
|
|
16
|
+
}>, import("effect/Cause").YieldableError>;
|
|
17
|
+
export declare class AgentLoopBudgetExceeded extends AgentLoopBudgetExceeded_base {
|
|
18
|
+
}
|
|
19
|
+
export declare const AgentTerminalFailure: Schema.Union<readonly [typeof AgentLoopError, typeof AgentLoopBudgetExceeded]>;
|
|
20
|
+
export type AgentTerminalFailure = typeof AgentTerminalFailure.Type;
|
|
21
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AgentEvent, ModelRegistry } from "@batonfx/core";
|
|
1
2
|
import { Agent, Content, Execution, Ids, Shared, Tool } from "../../schema/index";
|
|
2
3
|
import { AgentChatRepository } from "../../store-sql/portable";
|
|
3
4
|
import { Cause, Context, Effect, Layer, Schema } from "effect";
|
|
@@ -10,12 +11,8 @@ import { Service as SchemaRegistryService } from "../schema-registry/schema-regi
|
|
|
10
11
|
import { Service as ToolRuntimeService } from "../tool/tool-runtime-service";
|
|
11
12
|
import type { ToolRuntimeError } from "../tool/tool-runtime-service";
|
|
12
13
|
import { Service as PromptAssemblerService } from "./prompt-assembler-service";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
16
|
-
}>, Cause.YieldableError>;
|
|
17
|
-
export declare class AgentLoopError extends AgentLoopError_base {
|
|
18
|
-
}
|
|
14
|
+
import { AgentLoopBudgetExceeded, AgentLoopError } from "./agent-loop-error";
|
|
15
|
+
export { AgentLoopBudgetExceeded, AgentLoopError, AgentTerminalFailure } from "./agent-loop-error";
|
|
19
16
|
declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested, Schema.TaggedStruct<"AgentLoopWaitRequested", {
|
|
20
17
|
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
21
18
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.WaitId">;
|
|
@@ -28,17 +25,11 @@ declare const AgentLoopWaitRequested_base: Schema.Class<AgentLoopWaitRequested,
|
|
|
28
25
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
29
26
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
30
27
|
}>;
|
|
28
|
+
readonly suspension: typeof AgentEvent.AgentSuspended;
|
|
31
29
|
readonly next_event_sequence: Schema.Int;
|
|
32
30
|
}>, Cause.YieldableError>;
|
|
33
31
|
export declare class AgentLoopWaitRequested extends AgentLoopWaitRequested_base {
|
|
34
32
|
}
|
|
35
|
-
declare const AgentLoopBudgetExceeded_base: Schema.Class<AgentLoopBudgetExceeded, Schema.TaggedStruct<"AgentLoopBudgetExceeded", {
|
|
36
|
-
readonly tokens_used: Schema.Int;
|
|
37
|
-
readonly token_budget: Schema.Int;
|
|
38
|
-
readonly next_event_sequence: Schema.Int;
|
|
39
|
-
}>, Cause.YieldableError>;
|
|
40
|
-
export declare class AgentLoopBudgetExceeded extends AgentLoopBudgetExceeded_base {
|
|
41
|
-
}
|
|
42
33
|
export interface RunInput {
|
|
43
34
|
readonly executionId: Ids.ExecutionId;
|
|
44
35
|
readonly sessionId?: Ids.SessionId;
|
|
@@ -47,7 +38,7 @@ export interface RunInput {
|
|
|
47
38
|
readonly agentRevision?: Agent.DefinitionRevision;
|
|
48
39
|
readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
|
|
49
40
|
readonly input: ReadonlyArray<Content.Part>;
|
|
50
|
-
readonly
|
|
41
|
+
readonly resumeSuspension?: AgentEvent.AgentSuspended;
|
|
51
42
|
readonly memorySubjectId?: Ids.MemorySubjectId;
|
|
52
43
|
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
53
44
|
readonly startedAt: number;
|
|
@@ -84,9 +75,8 @@ export declare const toolFromDefinition: (definition: Tool.Definition) => AiTool
|
|
|
84
75
|
/** Map a Baton run failure (or an upstream model error) to the public error types. */
|
|
85
76
|
export declare const mapBoundaryError: {
|
|
86
77
|
(current: Execution.ExecutionEventSequence): (error: unknown) => AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
|
|
87
|
-
(error: unknown, current: Execution.ExecutionEventSequence): AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
|
|
78
|
+
(error: unknown, current: Execution.ExecutionEventSequence, failureClassification?: ModelRegistry.FailureClassification): AgentLoopError | AgentLoopWaitRequested | AgentLoopBudgetExceeded;
|
|
88
79
|
};
|
|
89
80
|
export declare const layer: Layer.Layer<Service, never, AgentChatRepository.Service | EventLogService | ToolRuntimeService | LanguageModelServiceService | ModelCallPolicyService | SchemaRegistryService | PromptAssemblerService>;
|
|
90
81
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
91
82
|
export declare const run: (input: RunInput) => Effect.Effect<RunResult, AgentLoopBudgetExceeded | AgentLoopError | AgentLoopWaitRequested, Service>;
|
|
92
|
-
export {};
|
|
@@ -31,16 +31,16 @@ export declare const contentToPromptPart: (part: PureContentPart) => Prompt.User
|
|
|
31
31
|
* Default assembler that resolves reference content parts through the
|
|
32
32
|
* {@link BlobStore} and {@link ArtifactStore} it reads from context. Requires
|
|
33
33
|
* both stores to be provided (`runner-runtime-service.ts` wires passthrough
|
|
34
|
-
* stores by default; see `docs/
|
|
34
|
+
* stores by default; see `docs/features/agents-and-tools.md`).
|
|
35
35
|
*
|
|
36
36
|
* @experimental
|
|
37
37
|
*/
|
|
38
38
|
export declare const defaultLayerWithStores: Layer.Layer<Service, never, BlobStoreService | ArtifactStoreService>;
|
|
39
39
|
/**
|
|
40
40
|
* Default assembler: reproduces the agent loop's historical prompt construction,
|
|
41
|
-
* minus the model-selection dump (see `docs/
|
|
41
|
+
* minus the model-selection dump (see `docs/features/agents-and-tools.md`).
|
|
42
42
|
* Bakes in passthrough stores so it stays self-contained and behavior is
|
|
43
|
-
* preserved bit-for-bit (see `docs/
|
|
43
|
+
* preserved bit-for-bit (see `docs/features/agents-and-tools.md`).
|
|
44
44
|
*
|
|
45
45
|
* @experimental
|
|
46
46
|
*/
|
|
@@ -4,13 +4,13 @@ import { Rpc } from "effect/unstable/rpc";
|
|
|
4
4
|
import type { WorkflowEngine } from "effect/unstable/workflow";
|
|
5
5
|
import { Schema } from "effect";
|
|
6
6
|
import type { Effect } from "effect";
|
|
7
|
-
import { ExecutionWorkflowFailed, StartInput, StartResult } from "../workflow/execution-workflow";
|
|
7
|
+
import { ExecutionWorkflowError, ExecutionWorkflowFailed, StartInput, StartResult } from "../workflow/execution-workflow";
|
|
8
8
|
import type { Service as ActiveExecutionRegistryService } from "../execution/active-execution-registry";
|
|
9
9
|
import type { Service as EventLogService } from "../execution/event-log-service";
|
|
10
10
|
import type { Service as ExecutionServiceService } from "../execution/execution-service";
|
|
11
11
|
import type { Service as ToolTransitionCoordinatorService } from "../tool/tool-transition-coordinator";
|
|
12
12
|
import type { Service as WaitServiceService } from "../wait/wait-service";
|
|
13
|
-
export declare const Start: Rpc.Rpc<"start", typeof StartInput, typeof StartResult, typeof
|
|
13
|
+
export declare const Start: Rpc.Rpc<"start", typeof StartInput, typeof StartResult, typeof ExecutionWorkflowError>;
|
|
14
14
|
export declare const SignalWait: Rpc.Rpc<"signalWait", Schema.Struct<{
|
|
15
15
|
readonly workflow_execution_id: Schema.String;
|
|
16
16
|
readonly wait_id: Schema.brand<Schema.String, "Relay.WaitId"> & {
|
|
@@ -19,7 +19,7 @@ export declare const SignalWait: Rpc.Rpc<"signalWait", Schema.Struct<{
|
|
|
19
19
|
readonly state: Schema.Literals<readonly ["resolved", "timed_out", "cancelled"]>;
|
|
20
20
|
readonly signaled_at: Schema.Int;
|
|
21
21
|
}>, Schema.Void, typeof ExecutionWorkflowFailed, never, never>;
|
|
22
|
-
export declare const Dispatch: Rpc.Rpc<"dispatch", typeof StartInput, typeof Schema.Void, typeof
|
|
22
|
+
export declare const Dispatch: Rpc.Rpc<"dispatch", typeof StartInput, typeof Schema.Void, typeof ExecutionWorkflowError>;
|
|
23
23
|
export declare const Cancel: Rpc.Rpc<"cancel", Schema.Struct<{
|
|
24
24
|
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
25
25
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
@@ -5,8 +5,11 @@ import { ShardingConfig } from "effect/unstable/cluster";
|
|
|
5
5
|
import { Service as ChildRunServiceService } from "../child/child-run-service";
|
|
6
6
|
import { Service as EventLogService } from "./event-log-service";
|
|
7
7
|
import type { ReplayInput } from "./event-log-service";
|
|
8
|
+
export declare const ExecutionServiceErrorDetails: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
9
|
+
export type ExecutionServiceErrorDetails = typeof ExecutionServiceErrorDetails.Type;
|
|
8
10
|
declare const ExecutionServiceError_base: Schema.Class<ExecutionServiceError, Schema.TaggedStruct<"ExecutionServiceError", {
|
|
9
11
|
readonly message: Schema.String;
|
|
12
|
+
readonly details: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
10
13
|
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
11
14
|
}>, import("effect/Cause").YieldableError>;
|
|
12
15
|
export declare class ExecutionServiceError extends ExecutionServiceError_base {
|
|
@@ -25,6 +25,7 @@ export * as ExecutionService from "./execution/execution-service";
|
|
|
25
25
|
export * as SessionStream from "./execution/session-stream-service";
|
|
26
26
|
export * as EmbeddingModelService from "./model/embedding-model-service";
|
|
27
27
|
export * as LanguageModelService from "./model/language-model-service";
|
|
28
|
+
export * as ModelHub from "./model/model-hub";
|
|
28
29
|
export * as MemoryService from "./memory/memory-service";
|
|
29
30
|
export * as ModelCallPolicy from "./model/model-call-policy";
|
|
30
31
|
export * as ParentNotifier from "./child/parent-notifier-service";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ModelRegistry } from "@batonfx/core";
|
|
2
2
|
import { Agent } from "../../schema/index";
|
|
3
3
|
import { Context, Effect, Layer } from "effect";
|
|
4
|
+
import { LanguageModel, Model } from "effect/unstable/ai";
|
|
4
5
|
export declare const LanguageModelNotRegistered: typeof ModelRegistry.LanguageModelNotRegistered;
|
|
5
6
|
export type LanguageModelNotRegistered = ModelRegistry.LanguageModelNotRegistered;
|
|
6
7
|
export type Registration = ModelRegistry.Registration;
|
|
7
8
|
export type GovernanceOptions = ModelRegistry.GovernanceOptions;
|
|
8
9
|
export type RegisterInput = ModelRegistry.RegisterInput;
|
|
9
|
-
export type ModelEnvironment =
|
|
10
|
+
export type ModelEnvironment = LanguageModel.LanguageModel | Model.ProviderName | Model.ModelName;
|
|
10
11
|
export interface Interface {
|
|
11
12
|
readonly register: (input: RegisterInput) => Effect.Effect<void>;
|
|
12
13
|
readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
|
|
@@ -20,19 +21,11 @@ export declare const registrationFromLayer: <R>(input: {
|
|
|
20
21
|
readonly provider: string;
|
|
21
22
|
readonly model: string;
|
|
22
23
|
readonly registrationKey?: string;
|
|
23
|
-
readonly layer: Layer.Layer<
|
|
24
|
+
readonly layer: Layer.Layer<LanguageModel.LanguageModel, never, R>;
|
|
24
25
|
readonly metadata?: ModelRegistry.Metadata;
|
|
26
|
+
readonly classifyFailure?: ModelRegistry.FailureClassifier;
|
|
25
27
|
}) => Effect.Effect<ModelRegistry.Registration, never, R>;
|
|
26
|
-
export declare const
|
|
27
|
-
(): Layer.Layer<Service>;
|
|
28
|
-
(options?: GovernanceOptions): (initialRegistrations?: ReadonlyArray<Registration>) => Layer.Layer<Service>;
|
|
29
|
-
(initialRegistrations?: ReadonlyArray<Registration>, options?: GovernanceOptions): Layer.Layer<Service>;
|
|
30
|
-
};
|
|
31
|
-
export declare const layerFromRegistrationEffects: {
|
|
32
|
-
<E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>, options?: GovernanceOptions): Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
|
|
33
|
-
(options?: GovernanceOptions): <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
|
|
34
|
-
};
|
|
35
|
-
export declare const memoryLayer: typeof layer;
|
|
28
|
+
export declare const fromModelRegistry: (registry: ModelRegistry.Interface) => Interface;
|
|
36
29
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
37
30
|
export declare const register: (input: ModelRegistry.RegisterInput) => Effect.Effect<void, never, Service>;
|
|
38
31
|
export declare const registrations: () => Effect.Effect<readonly ModelRegistry.Registration[], never, Service>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ModelRegistry } from "@batonfx/core";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import { type Interface as LanguageModelServiceInterface, Service as LanguageModelService } from "./language-model-service";
|
|
4
|
+
declare const ModelRegistrationCollision_base: Schema.Class<ModelRegistrationCollision, Schema.TaggedStruct<"ModelRegistrationCollision", {
|
|
5
|
+
readonly provider: Schema.String;
|
|
6
|
+
readonly model: Schema.String;
|
|
7
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
8
|
+
}>, import("effect/Cause").YieldableError>;
|
|
9
|
+
export declare class ModelRegistrationCollision extends ModelRegistrationCollision_base {
|
|
10
|
+
}
|
|
11
|
+
export interface Interface {
|
|
12
|
+
readonly modelRegistry: ModelRegistry.Interface;
|
|
13
|
+
readonly languageModelService: LanguageModelServiceInterface;
|
|
14
|
+
}
|
|
15
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/model/model-hub/Service", Interface>;
|
|
16
|
+
export declare class Service extends Service_base {
|
|
17
|
+
}
|
|
18
|
+
export declare const layer: {
|
|
19
|
+
(registrations: ReadonlyArray<ModelRegistry.Registration>, options?: ModelRegistry.GovernanceOptions): Layer.Layer<Service | LanguageModelService | ModelRegistry.Service, ModelRegistrationCollision>;
|
|
20
|
+
(options?: ModelRegistry.GovernanceOptions): (registrations: ReadonlyArray<ModelRegistry.Registration>) => Layer.Layer<Service | LanguageModelService | ModelRegistry.Service, ModelRegistrationCollision>;
|
|
21
|
+
};
|
|
22
|
+
export declare const layerFromRegistrationEffects: {
|
|
23
|
+
<E, R>(declarations: ReadonlyArray<Effect.Effect<ModelRegistry.Registration, E, R>>, options?: ModelRegistry.GovernanceOptions): Layer.Layer<Service | LanguageModelService | ModelRegistry.Service, E | ModelRegistrationCollision, Exclude<R, import("effect/Scope").Scope>>;
|
|
24
|
+
(options?: ModelRegistry.GovernanceOptions): <E, R>(declarations: ReadonlyArray<Effect.Effect<ModelRegistry.Registration, E, R>>) => Layer.Layer<Service | LanguageModelService | ModelRegistry.Service, E | ModelRegistrationCollision, Exclude<R, import("effect/Scope").Scope>>;
|
|
25
|
+
};
|
|
26
|
+
export declare const testLayer: (modelRegistry: ModelRegistry.Interface) => Layer.Layer<ModelRegistry.Service | LanguageModelService | Service, never, never>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Presence, Shared } from "../../schema/index";
|
|
2
|
+
import { Context, Effect, Schema, Scope, Stream } from "effect";
|
|
3
|
+
declare const PresenceError_base: Schema.Class<PresenceError, Schema.TaggedStruct<"PresenceError", {
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
export declare class PresenceError extends PresenceError_base {
|
|
7
|
+
}
|
|
8
|
+
export interface RegisterInput {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly scope: Presence.Scope;
|
|
11
|
+
readonly metadata?: Shared.Metadata;
|
|
12
|
+
}
|
|
13
|
+
export interface Interface {
|
|
14
|
+
readonly register: (input: RegisterInput) => Effect.Effect<void, never, Scope.Scope>;
|
|
15
|
+
readonly tracked: (scope: Presence.Scope, metadata?: Shared.Metadata) => <A, E, R>(stream: Stream.Stream<A, E, R>) => Stream.Stream<A, E, R>;
|
|
16
|
+
readonly list: (scope: Presence.Scope) => Effect.Effect<Presence.View, PresenceError>;
|
|
17
|
+
readonly watch: (scope: Presence.Scope) => Stream.Stream<Presence.View, PresenceError>;
|
|
18
|
+
}
|
|
19
|
+
export type Identifier = "@relayfx/runtime/presence/presence-contract/Service";
|
|
20
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/presence/presence-contract/Service", Interface>;
|
|
21
|
+
export declare class Service extends Service_base {
|
|
22
|
+
}
|
|
23
|
+
export declare const PresenceIdentity: Context.Reference<Shared.Metadata>;
|
|
24
|
+
export {};
|
|
@@ -1,30 +1,12 @@
|
|
|
1
|
-
import { Presence
|
|
1
|
+
import { Presence } from "../../schema/index";
|
|
2
2
|
import { PresenceRepository } from "../../store-sql/portable";
|
|
3
|
-
import { Config,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export declare class PresenceError extends PresenceError_base {
|
|
8
|
-
}
|
|
9
|
-
export interface RegisterInput {
|
|
10
|
-
readonly id: string;
|
|
11
|
-
readonly scope: Presence.Scope;
|
|
12
|
-
readonly metadata?: Shared.Metadata;
|
|
13
|
-
}
|
|
14
|
-
export interface Interface {
|
|
15
|
-
readonly register: (input: RegisterInput) => Effect.Effect<void, never, Scope.Scope>;
|
|
16
|
-
readonly tracked: (scope: Presence.Scope, metadata?: Shared.Metadata) => <A, E, R>(stream: Stream.Stream<A, E, R>) => Stream.Stream<A, E, R>;
|
|
17
|
-
readonly list: (scope: Presence.Scope) => Effect.Effect<Presence.View, PresenceError>;
|
|
18
|
-
readonly watch: (scope: Presence.Scope) => Stream.Stream<Presence.View, PresenceError>;
|
|
19
|
-
}
|
|
20
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/presence/presence-service/Service", Interface>;
|
|
21
|
-
export declare class Service extends Service_base {
|
|
22
|
-
}
|
|
23
|
-
export declare const PresenceIdentity: Context.Reference<Shared.Metadata>;
|
|
3
|
+
import { Config, Effect, Layer, Stream } from "effect";
|
|
4
|
+
export * from "./presence-contract";
|
|
5
|
+
import { PresenceError, Service } from "./presence-contract";
|
|
6
|
+
import type { Interface, RegisterInput } from "./presence-contract";
|
|
24
7
|
export declare const layerFromRepository: Layer.Layer<Service, Config.ConfigError, PresenceRepository.Service>;
|
|
25
8
|
export declare const memoryLayer: Layer.Layer<Service, Config.ConfigError, never>;
|
|
26
9
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
27
|
-
export declare const register: (input: RegisterInput) => Effect.Effect<void, never, Scope.Scope | Service>;
|
|
10
|
+
export declare const register: (input: RegisterInput) => Effect.Effect<void, never, import("effect/Scope").Scope | Service>;
|
|
28
11
|
export declare const list: (scope: Presence.Scope) => Effect.Effect<Presence.View, PresenceError, Service>;
|
|
29
12
|
export declare const watch: (scope: Presence.Scope) => Stream.Stream<Presence.View, PresenceError, Service>;
|
|
30
|
-
export {};
|