@relayfx/sdk 0.0.39 → 0.0.40
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/index.js +1185 -1086
- 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/relay/adapter-outbox.d.ts +11 -11
- package/dist/types/relay/client.d.ts +50 -163
- 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 +6 -6
- 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 +3 -14
|
@@ -4,25 +4,13 @@ declare const BlobNotResolvable_base: Schema.Class<BlobNotResolvable, Schema.Tag
|
|
|
4
4
|
readonly uri: Schema.String;
|
|
5
5
|
readonly reason: Schema.String;
|
|
6
6
|
}>, import("effect/Cause").YieldableError>;
|
|
7
|
-
/**
|
|
8
|
-
* @experimental
|
|
9
|
-
*/
|
|
10
7
|
export declare class BlobNotResolvable extends BlobNotResolvable_base {
|
|
11
8
|
}
|
|
12
9
|
declare const BlobStoreError_base: Schema.Class<BlobStoreError, Schema.TaggedStruct<"BlobStoreError", {
|
|
13
10
|
readonly message: Schema.String;
|
|
14
11
|
}>, import("effect/Cause").YieldableError>;
|
|
15
|
-
/**
|
|
16
|
-
* @experimental
|
|
17
|
-
*/
|
|
18
12
|
export declare class BlobStoreError extends BlobStoreError_base {
|
|
19
13
|
}
|
|
20
|
-
/**
|
|
21
|
-
* What a resolved blob looks like to the loop. `Url` means "pass this through to
|
|
22
|
-
* the provider as-is"; `Bytes` means "hand these bytes to the provider".
|
|
23
|
-
*
|
|
24
|
-
* @experimental
|
|
25
|
-
*/
|
|
26
14
|
export type ResolvedBlob = {
|
|
27
15
|
readonly _tag: "Bytes";
|
|
28
16
|
readonly bytes: Uint8Array;
|
|
@@ -34,41 +22,20 @@ export type ResolvedBlob = {
|
|
|
34
22
|
readonly mediaType: string;
|
|
35
23
|
readonly fileName?: string;
|
|
36
24
|
};
|
|
37
|
-
/**
|
|
38
|
-
* @experimental
|
|
39
|
-
*/
|
|
40
25
|
export interface PutBlobInput {
|
|
41
26
|
readonly bytes: Uint8Array;
|
|
42
27
|
readonly mediaType: string;
|
|
43
28
|
readonly fileName?: string;
|
|
44
29
|
readonly metadata?: Shared.Metadata;
|
|
45
30
|
}
|
|
46
|
-
/**
|
|
47
|
-
* @experimental
|
|
48
|
-
*/
|
|
49
31
|
export interface Interface {
|
|
50
32
|
readonly resolve: (part: Content.BlobReferencePart) => Effect.Effect<ResolvedBlob, BlobNotResolvable | BlobStoreError>;
|
|
51
33
|
readonly put: (input: PutBlobInput) => Effect.Effect<Content.BlobReferencePart, BlobStoreError>;
|
|
52
34
|
}
|
|
53
35
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/BlobStore", Interface>;
|
|
54
|
-
/**
|
|
55
|
-
* @experimental
|
|
56
|
-
*/
|
|
57
36
|
export declare class Service extends Service_base {
|
|
58
37
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Default store: preserves today's behavior bit-for-bit. `resolve` returns the
|
|
61
|
-
* reference uri as a passthrough `Url`; `put` is unsupported.
|
|
62
|
-
*
|
|
63
|
-
* @experimental
|
|
64
|
-
*/
|
|
65
38
|
export declare const passthroughLayer: Layer.Layer<Service>;
|
|
66
|
-
/**
|
|
67
|
-
* In-memory store. `put` mints monotonic `memory://blob/<n>` uris (no
|
|
68
|
-
* `Math.random`); `resolve` fails typed when the uri is unknown.
|
|
69
|
-
*
|
|
70
|
-
* @experimental
|
|
71
|
-
*/
|
|
72
39
|
export declare const memoryLayer: Layer.Layer<Service>;
|
|
73
40
|
/**
|
|
74
41
|
* Wraps a custom store implementation as a layer.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Envelope, Execution, Ids } from "../../schema/index";
|
|
2
2
|
import { EnvelopeRepository } from "../../store-sql/index";
|
|
3
3
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { Route, Service as AddressBookService } from "../address/address-book-service";
|
|
5
|
+
import { Service as EventLogService } from "../execution/event-log-service";
|
|
6
6
|
declare const EnvelopeAddressNotFound_base: Schema.Class<EnvelopeAddressNotFound, Schema.TaggedStruct<"EnvelopeAddressNotFound", {
|
|
7
7
|
readonly address_id: Schema.brand<Schema.String, "Relay.AddressId"> & {
|
|
8
8
|
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
@@ -45,8 +45,8 @@ export interface Interface {
|
|
|
45
45
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EnvelopeService", Interface>;
|
|
46
46
|
export declare class Service extends Service_base {
|
|
47
47
|
}
|
|
48
|
-
export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service |
|
|
49
|
-
export declare const memoryLayer: (routes?: Iterable<readonly [Ids.AddressId,
|
|
48
|
+
export declare const layer: Layer.Layer<Service, never, EnvelopeRepository.Service | AddressBookService | EventLogService>;
|
|
49
|
+
export declare const memoryLayer: (routes?: Iterable<readonly [Ids.AddressId, Route]>) => Layer.Layer<Service, never, never>;
|
|
50
50
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
51
51
|
export declare const send: (input: SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, EnvelopeAddressNotFound | EnvelopeRouteUnavailable | EnvelopeRouteDeferred | EnvelopeServiceError, Service>;
|
|
52
52
|
export {};
|
|
@@ -41,11 +41,6 @@ export interface Interface {
|
|
|
41
41
|
readonly findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
42
42
|
readonly findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, EventLogError>;
|
|
43
43
|
readonly maxSequence: (executionId: Ids.ExecutionId) => Effect.Effect<Execution.ExecutionEventSequence | undefined, EventLogError>;
|
|
44
|
-
/**
|
|
45
|
-
* Total tokens (input + output) reported across every `model.usage.reported`
|
|
46
|
-
* event for the execution. Used to seed per-agent budget accounting on resume
|
|
47
|
-
* without replaying the full log.
|
|
48
|
-
*/
|
|
49
44
|
readonly sumUsage: (executionId: Ids.ExecutionId) => Effect.Effect<number, EventLogError>;
|
|
50
45
|
}
|
|
51
46
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/EventLog", Interface>;
|
|
@@ -2,8 +2,9 @@ import { Agent, Envelope, Execution, Ids, Shared } from "../../schema/index";
|
|
|
2
2
|
import { ExecutionRepository } from "../../store-sql/index";
|
|
3
3
|
import { Context, Effect, Layer, Schema, Stream } from "effect";
|
|
4
4
|
import { ShardingConfig } from "effect/unstable/cluster";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import { Service as ChildRunServiceService } from "../child/child-run-service";
|
|
6
|
+
import { Service as EventLogService } from "./event-log-service";
|
|
7
|
+
import type { ReplayInput } from "./event-log-service";
|
|
7
8
|
declare const ExecutionServiceError_base: Schema.Class<ExecutionServiceError, Schema.TaggedStruct<"ExecutionServiceError", {
|
|
8
9
|
readonly message: Schema.String;
|
|
9
10
|
readonly next_event_sequence: Schema.optionalKey<Schema.Int>;
|
|
@@ -17,9 +18,9 @@ export interface AcceptInput {
|
|
|
17
18
|
readonly eventSequence: Execution.ExecutionEventSequence;
|
|
18
19
|
readonly createdAt: number;
|
|
19
20
|
readonly agentId?: Ids.AgentId;
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
21
|
+
readonly agentRevision?: Agent.DefinitionRevision;
|
|
22
|
+
readonly agentSnapshot?: Agent.Definition;
|
|
23
|
+
readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
|
|
23
24
|
readonly metadata?: Shared.Metadata;
|
|
24
25
|
}
|
|
25
26
|
export interface RunInput {
|
|
@@ -47,12 +48,12 @@ export interface Interface {
|
|
|
47
48
|
readonly cancel: (input: CancelInput) => Effect.Effect<Execution.Execution, ExecutionServiceError>;
|
|
48
49
|
readonly send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ExecutionServiceError>;
|
|
49
50
|
readonly spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ExecutionServiceError>;
|
|
50
|
-
readonly stream: (input:
|
|
51
|
+
readonly stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, ExecutionServiceError>;
|
|
51
52
|
}
|
|
52
53
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ExecutionService", Interface>;
|
|
53
54
|
export declare class Service extends Service_base {
|
|
54
55
|
}
|
|
55
|
-
export declare const layer: Layer.Layer<Service, never, ExecutionRepository.Service |
|
|
56
|
+
export declare const layer: Layer.Layer<Service, never, ExecutionRepository.Service | EventLogService | ChildRunServiceService | ShardingConfig.ShardingConfig>;
|
|
56
57
|
export declare const memoryLayer: Layer.Layer<Service, never, never>;
|
|
57
58
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
58
59
|
export declare const accept: (input: AcceptInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
|
|
@@ -60,5 +61,5 @@ export declare const run: (input: RunInput) => Effect.Effect<Execution.Execution
|
|
|
60
61
|
export declare const cancel: (input: CancelInput) => Effect.Effect<Execution.Execution, ExecutionServiceError, Service>;
|
|
61
62
|
export declare const send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ExecutionServiceError, Service>;
|
|
62
63
|
export declare const spawnChildRun: (input: Execution.SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ExecutionServiceError, Service>;
|
|
63
|
-
export declare const stream: (input:
|
|
64
|
+
export declare const stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, ExecutionServiceError, Service>;
|
|
64
65
|
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { Memory } from "@batonfx/core";
|
|
2
2
|
import { MemoryRepository } from "../../store-sql/index";
|
|
3
3
|
import { Context, Effect, Layer } from "effect";
|
|
4
|
-
import
|
|
4
|
+
import { Service as EmbeddingModelServiceService } from "../model/embedding-model-service";
|
|
5
|
+
import type { ModelSelection } from "../model/embedding-model-service";
|
|
5
6
|
export interface Options {
|
|
6
7
|
readonly topK?: number | undefined;
|
|
7
8
|
readonly minScore?: number | undefined;
|
|
8
|
-
readonly embeddingSelection?:
|
|
9
|
+
readonly embeddingSelection?: ModelSelection | undefined;
|
|
9
10
|
}
|
|
10
11
|
export interface Interface extends Memory.Interface {
|
|
11
12
|
}
|
|
12
13
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/MemoryService", Interface>;
|
|
13
14
|
export declare class Service extends Service_base {
|
|
14
15
|
}
|
|
15
|
-
export declare const layer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service |
|
|
16
|
-
export declare const memoryLayer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service |
|
|
16
|
+
export declare const layer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service | EmbeddingModelServiceService>;
|
|
17
|
+
export declare const memoryLayer: (options?: Options) => Layer.Layer<Service | Memory.Memory, never, MemoryRepository.Service | EmbeddingModelServiceService>;
|
|
17
18
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service | Memory.Memory>;
|
|
18
19
|
export declare const recall: (input: Memory.RecallInput) => Effect.Effect<readonly Memory.Item[], Memory.MemoryError, Service>;
|
|
19
20
|
export declare const remember: (input: Memory.RememberInput) => Effect.Effect<void, Memory.MemoryError, Service>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Agent, Shared } from "../../schema/index";
|
|
2
2
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
-
import
|
|
3
|
+
import { EmbeddingModel, Model } from "effect/unstable/ai";
|
|
4
4
|
declare const EmbeddingModelNotRegistered_base: Schema.Class<EmbeddingModelNotRegistered, Schema.TaggedStruct<"EmbeddingModelNotRegistered", {
|
|
5
5
|
readonly provider: Schema.String;
|
|
6
6
|
readonly model: Schema.String;
|
|
@@ -13,7 +13,7 @@ export interface ModelSelection {
|
|
|
13
13
|
readonly model: string;
|
|
14
14
|
readonly registrationKey?: string | undefined;
|
|
15
15
|
}
|
|
16
|
-
export type ModelEnvironment =
|
|
16
|
+
export type ModelEnvironment = EmbeddingModel.EmbeddingModel | EmbeddingModel.Dimensions | Model.ProviderName | Model.ModelName;
|
|
17
17
|
export interface Registration {
|
|
18
18
|
readonly provider: string;
|
|
19
19
|
readonly model: string;
|
|
@@ -57,7 +57,7 @@ export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>,
|
|
|
57
57
|
export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>, options?: LayerOptions) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
|
|
58
58
|
export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>, options?: LayerOptions) => Layer.Layer<Service, never, never>;
|
|
59
59
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
60
|
-
export declare const deterministicLayer: (options?: DeterministicOptions) => Layer.Layer<
|
|
60
|
+
export declare const deterministicLayer: (options?: DeterministicOptions) => Layer.Layer<EmbeddingModel.EmbeddingModel | EmbeddingModel.Dimensions, never, never>;
|
|
61
61
|
export declare const deterministicRegistration: (options?: DeterministicOptions) => Effect.Effect<Registration, never, never>;
|
|
62
62
|
export declare const deterministicTestLayer: (options?: DeterministicOptions) => Layer.Layer<Service, never, never>;
|
|
63
63
|
export declare const register: (input: RegisterInput) => Effect.Effect<void, never, Service>;
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Delegates to `@batonfx/core` `ModelRegistry`. Import Baton's
|
|
3
|
-
* `ModelRegistry` directly in new code; this module remains only so existing
|
|
4
|
-
* Relay runtime consumers keep their `Agent.ModelSelection`-based surface.
|
|
5
|
-
*/
|
|
6
1
|
import { ModelRegistry } from "@batonfx/core";
|
|
7
2
|
import { Agent } from "../../schema/index";
|
|
8
3
|
import { Context, Effect, Layer } from "effect";
|
|
9
|
-
/** @deprecated Use `ModelRegistry.LanguageModelNotRegistered`. */
|
|
10
4
|
export declare const LanguageModelNotRegistered: typeof ModelRegistry.LanguageModelNotRegistered;
|
|
11
|
-
/** @deprecated Use `ModelRegistry.LanguageModelNotRegistered`. */
|
|
12
5
|
export type LanguageModelNotRegistered = ModelRegistry.LanguageModelNotRegistered;
|
|
13
|
-
/** @deprecated Use `ModelRegistry.Registration`. */
|
|
14
6
|
export type Registration = ModelRegistry.Registration;
|
|
15
|
-
/**
|
|
16
|
-
* Throughput governance for the model registry layer.
|
|
17
|
-
*
|
|
18
|
-
* @deprecated Use `ModelRegistry.GovernanceOptions`.
|
|
19
|
-
*/
|
|
20
7
|
export type GovernanceOptions = ModelRegistry.GovernanceOptions;
|
|
21
|
-
/** @deprecated Use `ModelRegistry.RegisterInput`. */
|
|
22
8
|
export type RegisterInput = ModelRegistry.RegisterInput;
|
|
23
|
-
/** @deprecated Use `ModelRegistry.ModelEnvironment`. */
|
|
24
9
|
export type ModelEnvironment = ModelRegistry.ModelEnvironment;
|
|
25
|
-
/** @deprecated Use `ModelRegistry.Interface`. */
|
|
26
10
|
export interface Interface {
|
|
27
11
|
readonly register: (input: RegisterInput) => Effect.Effect<void>;
|
|
28
12
|
readonly registrations: Effect.Effect<ReadonlyArray<Registration>>;
|
|
@@ -30,14 +14,8 @@ export interface Interface {
|
|
|
30
14
|
readonly provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | LanguageModelNotRegistered, Exclude<R, ModelEnvironment>>;
|
|
31
15
|
}
|
|
32
16
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/LanguageModelService", Interface>;
|
|
33
|
-
/** @deprecated Use `ModelRegistry.Service`. */
|
|
34
17
|
export declare class Service extends Service_base {
|
|
35
18
|
}
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Use `ModelRegistry.registrationFromLayer`. Note the `metadata`
|
|
38
|
-
* parameter type widens from `Shared.Metadata` to `ModelRegistry.Metadata`,
|
|
39
|
-
* which `Shared.Metadata` satisfies.
|
|
40
|
-
*/
|
|
41
19
|
export declare const registrationFromLayer: <R>(input: {
|
|
42
20
|
readonly provider: string;
|
|
43
21
|
readonly model: string;
|
|
@@ -45,20 +23,12 @@ export declare const registrationFromLayer: <R>(input: {
|
|
|
45
23
|
readonly layer: Layer.Layer<import("effect/unstable/ai/LanguageModel").LanguageModel, never, R>;
|
|
46
24
|
readonly metadata?: ModelRegistry.Metadata;
|
|
47
25
|
}) => Effect.Effect<ModelRegistry.Registration, never, R>;
|
|
48
|
-
/** @deprecated Use `ModelRegistry.layer`. */
|
|
49
26
|
export declare const layer: (initialRegistrations?: ReadonlyArray<Registration>, options?: GovernanceOptions) => Layer.Layer<Service, never, never>;
|
|
50
|
-
/** @deprecated Use `ModelRegistry.layerFromRegistrationEffects`. */
|
|
51
27
|
export declare const layerFromRegistrationEffects: <E, R>(registrations: ReadonlyArray<Effect.Effect<Registration, E, R>>, options?: GovernanceOptions) => Layer.Layer<Service, E, Exclude<R, import("effect/Scope").Scope>>;
|
|
52
|
-
/** @deprecated Use `ModelRegistry.memoryLayer`. */
|
|
53
28
|
export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registration>, options?: GovernanceOptions) => Layer.Layer<Service, never, never>;
|
|
54
|
-
/** @deprecated Use `ModelRegistry.testLayer`. */
|
|
55
29
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
56
|
-
/** @deprecated Use `ModelRegistry.register`. */
|
|
57
30
|
export declare const register: (input: ModelRegistry.RegisterInput) => Effect.Effect<void, never, Service>;
|
|
58
|
-
/** @deprecated Use `ModelRegistry.registrations`. */
|
|
59
31
|
export declare const registrations: () => Effect.Effect<readonly ModelRegistry.Registration[], never, Service>;
|
|
60
|
-
/** @deprecated Use `ModelRegistry.provide`. */
|
|
61
32
|
export declare const provide: <A, E, R>(selection: Agent.ModelSelection, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, ModelRegistry.LanguageModelNotRegistered | E, Service | Exclude<R, ModelRegistry.ModelEnvironment>>;
|
|
62
|
-
/** @deprecated Use `ModelRegistry.provide` with the agent's model selection. */
|
|
63
33
|
export declare const provideForAgent: <A, E, R>(agent: Agent.Definition, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, ModelRegistry.LanguageModelNotRegistered | E, Service | Exclude<R, ModelRegistry.ModelEnvironment>>;
|
|
64
34
|
export {};
|
|
@@ -1,72 +1,14 @@
|
|
|
1
1
|
import { ModelResilience } from "@batonfx/core";
|
|
2
2
|
import { Context, Layer, Schedule } from "effect";
|
|
3
|
-
/**
|
|
4
|
-
* Shim over `@batonfx/core`'s `ModelResilience` seam. Baton's `Agent.stream`
|
|
5
|
-
* resolves `ModelResilience.ModelResilience` via `Effect.serviceOption` and
|
|
6
|
-
* applies `ModelResilience.apply` to the model internally, so Relay no longer
|
|
7
|
-
* hand-wraps the model with its own retry logic (see `agent-loop-service.ts`,
|
|
8
|
-
* which resolves this policy and re-provides it under Baton's own tag —
|
|
9
|
-
* `Baton.ModelResilience.ModelResilience` — for the duration of a run).
|
|
10
|
-
*
|
|
11
|
-
* This module keeps its own local service tag (rather than re-exporting
|
|
12
|
-
* Baton's tag directly) because `@batonfx/core` ships its `exports` field
|
|
13
|
-
* pointed at TS source under `node_modules`; a re-exported tag's nominal type
|
|
14
|
-
* resolves to that nested source path, which `tsc --declaration` cannot name
|
|
15
|
-
* portably from deeply composed call sites (TS2742) such as
|
|
16
|
-
* `runner-runtime-service.ts`'s layer-composition helpers. Keeping a local,
|
|
17
|
-
* package-owned tag avoids that while still sharing Baton's `Interface`
|
|
18
|
-
* shape, `Classification` type, and `defaultClassify` implementation
|
|
19
|
-
* one-for-one — and `agent-loop-service.ts` explicitly re-provides the
|
|
20
|
-
* resolved policy under Baton's tag at the one call site that needs it, so
|
|
21
|
-
* the two tags never need to be identical for Baton to see the seam.
|
|
22
|
-
*
|
|
23
|
-
* Preserves every historical export name and Relay's historical default
|
|
24
|
-
* schedule (jittered exponential from 1s, up to 4 retries) — Baton's own
|
|
25
|
-
* `ModelResilience.make()` defaults to `Schedule.recurs(0)` (no retry), so
|
|
26
|
-
* Relay must keep supplying its own default or retries silently vanish.
|
|
27
|
-
*
|
|
28
|
-
* @experimental
|
|
29
|
-
*/
|
|
30
3
|
export type Classification = ModelResilience.Classification;
|
|
31
|
-
/**
|
|
32
|
-
* @experimental
|
|
33
|
-
*/
|
|
34
4
|
export type Interface = ModelResilience.Interface;
|
|
35
5
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ModelCallPolicy", ModelResilience.Interface>;
|
|
36
|
-
/**
|
|
37
|
-
* @experimental
|
|
38
|
-
*/
|
|
39
6
|
export declare class Service extends Service_base {
|
|
40
7
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Default classification: malformed model output is terminal, other failures follow Baton.
|
|
43
|
-
*
|
|
44
|
-
* @experimental
|
|
45
|
-
*/
|
|
46
8
|
export declare const defaultClassify: (error: unknown) => Classification;
|
|
47
|
-
/**
|
|
48
|
-
* Default schedule: jittered exponential from 1s, at most 4 retries. Relay's
|
|
49
|
-
* historical default — Baton's own default is `Schedule.recurs(0)` (no retry).
|
|
50
|
-
*
|
|
51
|
-
* @experimental
|
|
52
|
-
*/
|
|
53
9
|
export declare const defaultSchedule: Schedule.Schedule<unknown>;
|
|
54
|
-
/**
|
|
55
|
-
* @experimental
|
|
56
|
-
*/
|
|
57
10
|
export declare const make: (input?: Partial<Interface>) => Interface;
|
|
58
|
-
/**
|
|
59
|
-
* @experimental
|
|
60
|
-
*/
|
|
61
11
|
export declare const layer: (input?: Partial<Interface>) => Layer.Layer<Service, never, never>;
|
|
62
|
-
/**
|
|
63
|
-
* Never retries — useful for tests that assert single-attempt behavior.
|
|
64
|
-
*
|
|
65
|
-
* @experimental
|
|
66
|
-
*/
|
|
67
12
|
export declare const noRetryLayer: Layer.Layer<Service, never, never>;
|
|
68
|
-
/**
|
|
69
|
-
* @experimental
|
|
70
|
-
*/
|
|
71
13
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
72
14
|
export {};
|