@relayfx/sdk 0.2.13 → 0.2.15
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 +2 -2
- package/dist/{index-kghdnamr.js → index-d8q4kfjy.js} +1 -1
- package/dist/index-gxskhyra.js +69 -0
- package/dist/{index-rmaq3qc8.js → index-xbbfagnb.js} +744 -395
- package/dist/{index-3e4cs8s6.js → index-z9xk02sv.js} +650 -531
- package/dist/index.js +10 -4
- package/dist/mysql.js +122 -0
- package/dist/postgres.js +77 -0
- package/dist/sqlite.js +84 -3
- package/dist/types/relay/client.d.ts +6 -4
- package/dist/types/relay/index.d.ts +3 -1
- package/dist/types/relay/migration-errors.d.ts +4 -0
- package/dist/types/relay/mysql-migrations.d.ts +1 -0
- package/dist/types/relay/mysql.d.ts +13 -0
- package/dist/types/relay/operation.d.ts +60 -10
- package/dist/types/relay/postgres.d.ts +13 -0
- package/dist/types/relay/runtime-capability-policy.d.ts +19 -0
- package/dist/types/relay/runtime-database-adapter.d.ts +12 -0
- package/dist/types/relay/runtime-database.d.ts +21 -0
- package/dist/types/relay/runtime.d.ts +198 -0
- package/dist/types/relay/sqlite-runtime.d.ts +9 -0
- package/dist/types/relay/sqlite.d.ts +2 -0
- package/dist/types/runtime/address/address-resolution-service.d.ts +32 -10
- package/dist/types/runtime/agent/relay-compaction.d.ts +3 -2
- package/dist/types/runtime/child/child-fan-out-runtime.d.ts +2 -0
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +7 -0
- package/dist/types/runtime/model/language-model-service.d.ts +1 -0
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +30 -30
- package/dist/types/runtime/workflow/definition-runtime.d.ts +2 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +64 -20
- package/dist/types/schema/agent-schema.d.ts +220 -60
- package/dist/types/schema/child-orchestration-schema.d.ts +21 -0
- package/dist/types/schema/execution-schema.d.ts +74 -10
- package/dist/types/store-sql/workflow/workflow-definition-repository.d.ts +6 -2
- package/package.json +11 -2
|
@@ -91,11 +91,22 @@ export declare const StartExecutionInput: Schema.Struct<{
|
|
|
91
91
|
readonly [x: string]: Schema.Json;
|
|
92
92
|
};
|
|
93
93
|
readonly instructions?: string;
|
|
94
|
-
readonly compaction_policy?:
|
|
95
|
-
readonly context_window:
|
|
96
|
-
readonly reserve_tokens:
|
|
97
|
-
readonly keep_recent_tokens:
|
|
98
|
-
|
|
94
|
+
readonly compaction_policy?: {
|
|
95
|
+
readonly context_window: number;
|
|
96
|
+
readonly reserve_tokens: number;
|
|
97
|
+
readonly keep_recent_tokens: number;
|
|
98
|
+
readonly summary_model?: {
|
|
99
|
+
readonly provider: string;
|
|
100
|
+
readonly model: string;
|
|
101
|
+
readonly metadata?: {
|
|
102
|
+
readonly [x: string]: Schema.Json;
|
|
103
|
+
};
|
|
104
|
+
readonly registration_key?: string;
|
|
105
|
+
readonly request_options?: {
|
|
106
|
+
readonly [x: string]: Schema.Json;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
99
110
|
readonly output_schema_ref?: string;
|
|
100
111
|
readonly skill_definition_ids?: readonly string[];
|
|
101
112
|
readonly permission_rules?: {
|
|
@@ -128,11 +139,22 @@ export declare const StartExecutionInput: Schema.Struct<{
|
|
|
128
139
|
};
|
|
129
140
|
};
|
|
130
141
|
readonly instructions?: string;
|
|
131
|
-
readonly compaction_policy?:
|
|
132
|
-
readonly context_window:
|
|
133
|
-
readonly reserve_tokens:
|
|
134
|
-
readonly keep_recent_tokens:
|
|
135
|
-
|
|
142
|
+
readonly compaction_policy?: {
|
|
143
|
+
readonly context_window: number;
|
|
144
|
+
readonly reserve_tokens: number;
|
|
145
|
+
readonly keep_recent_tokens: number;
|
|
146
|
+
readonly summary_model?: {
|
|
147
|
+
readonly provider: string;
|
|
148
|
+
readonly model: string;
|
|
149
|
+
readonly metadata?: {
|
|
150
|
+
readonly [x: string]: Schema.Json;
|
|
151
|
+
};
|
|
152
|
+
readonly registration_key?: string;
|
|
153
|
+
readonly request_options?: {
|
|
154
|
+
readonly [x: string]: Schema.Json;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
136
158
|
readonly tool_names?: readonly string[];
|
|
137
159
|
readonly workspace_policy?: {
|
|
138
160
|
readonly mode: "share" | "fork";
|
|
@@ -1088,6 +1110,13 @@ export declare const SpawnChildRunInput: Schema.Struct<{
|
|
|
1088
1110
|
readonly context_window: Schema.Number;
|
|
1089
1111
|
readonly reserve_tokens: Schema.Number;
|
|
1090
1112
|
readonly keep_recent_tokens: Schema.Number;
|
|
1113
|
+
readonly summary_model: Schema.optionalKey<Schema.Struct<{
|
|
1114
|
+
readonly provider: Schema.String;
|
|
1115
|
+
readonly model: Schema.String;
|
|
1116
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
1117
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1118
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1119
|
+
}>>;
|
|
1091
1120
|
}>>;
|
|
1092
1121
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1093
1122
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -1177,6 +1206,13 @@ export declare const CreateChildFanOutInput: Schema.Struct<{
|
|
|
1177
1206
|
readonly context_window: Schema.Number;
|
|
1178
1207
|
readonly reserve_tokens: Schema.Number;
|
|
1179
1208
|
readonly keep_recent_tokens: Schema.Number;
|
|
1209
|
+
readonly summary_model: Schema.optionalKey<Schema.Struct<{
|
|
1210
|
+
readonly provider: Schema.String;
|
|
1211
|
+
readonly model: Schema.String;
|
|
1212
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
1213
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1214
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1215
|
+
}>>;
|
|
1180
1216
|
}>>;
|
|
1181
1217
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1182
1218
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -1346,6 +1382,13 @@ export declare const CancelChildFanOutResult: Schema.Struct<{
|
|
|
1346
1382
|
readonly context_window: Schema.Number;
|
|
1347
1383
|
readonly reserve_tokens: Schema.Number;
|
|
1348
1384
|
readonly keep_recent_tokens: Schema.Number;
|
|
1385
|
+
readonly summary_model: Schema.optionalKey<Schema.Struct<{
|
|
1386
|
+
readonly provider: Schema.String;
|
|
1387
|
+
readonly model: Schema.String;
|
|
1388
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
1389
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1390
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1391
|
+
}>>;
|
|
1349
1392
|
}>>;
|
|
1350
1393
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1351
1394
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -1514,6 +1557,13 @@ export declare const InspectChildFanOutResult: Schema.Struct<{
|
|
|
1514
1557
|
readonly context_window: Schema.Number;
|
|
1515
1558
|
readonly reserve_tokens: Schema.Number;
|
|
1516
1559
|
readonly keep_recent_tokens: Schema.Number;
|
|
1560
|
+
readonly summary_model: Schema.optionalKey<Schema.Struct<{
|
|
1561
|
+
readonly provider: Schema.String;
|
|
1562
|
+
readonly model: Schema.String;
|
|
1563
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
1564
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1565
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
1566
|
+
}>>;
|
|
1517
1567
|
}>>;
|
|
1518
1568
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1519
1569
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Effect, type Layer } from "effect";
|
|
2
|
+
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
3
|
+
import type { DatabaseIdentity, DatabaseLayer, RuntimeConfigurationError, RuntimeMigrationError } from "./runtime";
|
|
4
|
+
export interface PostgresRuntimeDatabaseOptions<E, R> {
|
|
5
|
+
readonly clientLayer: Layer.Layer<SqlClient, E, R>;
|
|
6
|
+
readonly databaseIdentity: DatabaseIdentity;
|
|
7
|
+
}
|
|
8
|
+
export declare const runtimeDatabaseLayer: <E, R>(options: PostgresRuntimeDatabaseOptions<E, R>) => DatabaseLayer<"pg", RuntimeConfigurationError | RuntimeMigrationError, R>;
|
|
9
|
+
export declare const migrate: <E, R>(options: PostgresRuntimeDatabaseOptions<E, R>) => Effect.Effect<void, RuntimeConfigurationError | RuntimeMigrationError, R>;
|
|
10
|
+
export declare const Postgres: {
|
|
11
|
+
readonly runtimeDatabaseLayer: typeof runtimeDatabaseLayer;
|
|
12
|
+
readonly migrate: typeof migrate;
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
declare const RuntimeCapabilityUnavailable_base: Schema.Class<RuntimeCapabilityUnavailable, Schema.TaggedStruct<"RuntimeCapabilityUnavailable", {
|
|
3
|
+
readonly capability: Schema.Literals<readonly ["fan-out", "workflow-definition"]>;
|
|
4
|
+
readonly role: Schema.Literals<readonly ["embedded", "runner", "client"]>;
|
|
5
|
+
readonly nextAction: Schema.Literals<readonly ["enable-embedded-capability", "use-embedded-runtime"]>;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
export declare class RuntimeCapabilityUnavailable extends RuntimeCapabilityUnavailable_base {
|
|
8
|
+
}
|
|
9
|
+
export interface Interface {
|
|
10
|
+
readonly admit: (capability: "fan-out" | "workflow-definition") => Effect.Effect<void, RuntimeCapabilityUnavailable>;
|
|
11
|
+
}
|
|
12
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/RuntimeCapabilityPolicy", Interface>;
|
|
13
|
+
export declare class Service extends Service_base {
|
|
14
|
+
}
|
|
15
|
+
export declare const layer: (role: "embedded" | "runner" | "client", capabilities: {
|
|
16
|
+
readonly fanOut: boolean;
|
|
17
|
+
readonly workflowDefinition: boolean;
|
|
18
|
+
}) => Layer.Layer<Service, never, never>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
3
|
+
import { RuntimeConfigurationError, RuntimeMigrationError, type DatabaseIdentity, type DatabaseLayer, type Dialect } from "./runtime";
|
|
4
|
+
export declare const normalizeClientLayer: <E, R>(clientLayer: Layer.Layer<SqlClient, E, R>) => Layer.Layer<SqlClient, RuntimeConfigurationError, R>;
|
|
5
|
+
export declare const runtimeDatabaseLayer: <D extends Dialect, E, R>(options: {
|
|
6
|
+
readonly dialect: D;
|
|
7
|
+
readonly clientLayer: Layer.Layer<SqlClient, E, R>;
|
|
8
|
+
readonly databaseIdentity: DatabaseIdentity;
|
|
9
|
+
readonly ownership: "runtime-exclusive" | "shared-multi-node";
|
|
10
|
+
readonly schemaHead: string;
|
|
11
|
+
readonly schema: Effect.Effect<void, RuntimeMigrationError, SqlClient>;
|
|
12
|
+
}) => DatabaseLayer<D, RuntimeConfigurationError | RuntimeMigrationError, R>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Context, type Effect } from "effect";
|
|
2
|
+
import type { DatabaseIdentity, RuntimeMigrationError } from "./runtime";
|
|
3
|
+
export { Dialect } from "./runtime";
|
|
4
|
+
export type Interface = {
|
|
5
|
+
readonly dialect: "sqlite";
|
|
6
|
+
readonly databaseIdentity: DatabaseIdentity;
|
|
7
|
+
readonly ownership: "runtime-exclusive";
|
|
8
|
+
readonly schemaHead: string;
|
|
9
|
+
readonly notification: "in-process";
|
|
10
|
+
readonly acquireSchema: Effect.Effect<void, RuntimeMigrationError>;
|
|
11
|
+
} | {
|
|
12
|
+
readonly dialect: "pg" | "mysql";
|
|
13
|
+
readonly databaseIdentity: DatabaseIdentity;
|
|
14
|
+
readonly ownership: "shared-multi-node";
|
|
15
|
+
readonly schemaHead: string;
|
|
16
|
+
readonly notification: "pg-listen-notify" | "polling";
|
|
17
|
+
readonly verifySchema: Effect.Effect<void, RuntimeMigrationError>;
|
|
18
|
+
};
|
|
19
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/RuntimeDatabase", Interface>;
|
|
20
|
+
export declare class Service extends Service_base {
|
|
21
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { ArtifactStore, BlobStore, ChildFanOutRuntime, EmbeddingModelService, LanguageModelService, PromptAssembler, RunnerRuntime, SchemaRegistry, ToolRuntime, WorkflowDefinitionRuntime } from "../runtime/index";
|
|
2
|
+
import { Cause, Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import type { Duration } from "effect";
|
|
4
|
+
import type { HttpServer } from "effect/unstable/http/HttpServer";
|
|
5
|
+
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
6
|
+
import { Service as ClientService, type RuntimeRequirements as ClientRuntimeRequirements } from "./client";
|
|
7
|
+
import { Service as RuntimeDatabaseService } from "./runtime-database";
|
|
8
|
+
export { RuntimeCapabilityUnavailable } from "./runtime-capability-policy";
|
|
9
|
+
export * as RuntimeDatabase from "./runtime-database";
|
|
10
|
+
export declare const DatabaseIdentity: Schema.brand<Schema.NonEmptyString, "@relayfx/sdk/DatabaseIdentity">;
|
|
11
|
+
export type DatabaseIdentity = typeof DatabaseIdentity.Type;
|
|
12
|
+
export declare const makeDatabaseIdentity: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"@relayfx/sdk/DatabaseIdentity">;
|
|
13
|
+
export declare const Dialect: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
14
|
+
export type Dialect = typeof Dialect.Type;
|
|
15
|
+
export declare const DatabaseDialect: unique symbol;
|
|
16
|
+
export type DatabaseLayer<D extends Dialect, E = never, R = never> = Layer.Layer<RuntimeDatabaseService | SqlClient, E, R> & {
|
|
17
|
+
readonly [DatabaseDialect]: D;
|
|
18
|
+
};
|
|
19
|
+
declare const HostLayerError_base: Schema.Class<HostLayerError, Schema.TaggedStruct<"HostLayerError", {
|
|
20
|
+
readonly service: Schema.String;
|
|
21
|
+
readonly reason: Schema.String;
|
|
22
|
+
}>, Cause.YieldableError>;
|
|
23
|
+
export declare class HostLayerError extends HostLayerError_base {
|
|
24
|
+
}
|
|
25
|
+
declare const ConfigFailure_base: Schema.Class<ConfigFailure, Schema.TaggedStruct<"ConfigFailure", {
|
|
26
|
+
readonly reason: Schema.String;
|
|
27
|
+
}>, Cause.YieldableError>;
|
|
28
|
+
export declare class ConfigFailure extends ConfigFailure_base {
|
|
29
|
+
readonly originalCause?: unknown;
|
|
30
|
+
}
|
|
31
|
+
declare const NotificationFailure_base: Schema.Class<NotificationFailure, Schema.TaggedStruct<"NotificationFailure", {
|
|
32
|
+
readonly reason: Schema.String;
|
|
33
|
+
}>, Cause.YieldableError>;
|
|
34
|
+
export declare class NotificationFailure extends NotificationFailure_base {
|
|
35
|
+
readonly originalCause?: unknown;
|
|
36
|
+
}
|
|
37
|
+
declare const ClusterFailure_base: Schema.Class<ClusterFailure, Schema.TaggedStruct<"ClusterFailure", {
|
|
38
|
+
readonly reason: Schema.String;
|
|
39
|
+
}>, Cause.YieldableError>;
|
|
40
|
+
export declare class ClusterFailure extends ClusterFailure_base {
|
|
41
|
+
readonly originalCause?: unknown;
|
|
42
|
+
}
|
|
43
|
+
declare const SqlFailure_base: Schema.Class<SqlFailure, Schema.TaggedStruct<"SqlFailure", {
|
|
44
|
+
readonly category: Schema.Literals<readonly ["connection", "statement", "unknown"]>;
|
|
45
|
+
readonly operation: Schema.Literals<readonly ["acquire", "migrate", "verify", "notify", "readiness"]>;
|
|
46
|
+
readonly retryable: Schema.Boolean;
|
|
47
|
+
}>, Cause.YieldableError>;
|
|
48
|
+
export declare class SqlFailure extends SqlFailure_base {
|
|
49
|
+
readonly originalCause?: unknown;
|
|
50
|
+
}
|
|
51
|
+
export declare const SqlDialect: Schema.Literals<readonly ["sqlite", "pg", "mysql", "mssql", "clickhouse"]>;
|
|
52
|
+
declare const DatabaseDialectMismatch_base: Schema.Class<DatabaseDialectMismatch, Schema.TaggedStruct<"DatabaseDialectMismatch", {
|
|
53
|
+
readonly expected: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
54
|
+
readonly actual: Schema.Literals<readonly ["sqlite", "pg", "mysql", "mssql", "clickhouse"]>;
|
|
55
|
+
}>, Cause.YieldableError>;
|
|
56
|
+
export declare class DatabaseDialectMismatch extends DatabaseDialectMismatch_base {
|
|
57
|
+
}
|
|
58
|
+
declare const DatabaseAlreadyOwned_base: Schema.Class<DatabaseAlreadyOwned, Schema.TaggedStruct<"DatabaseAlreadyOwned", {
|
|
59
|
+
readonly databaseIdentity: Schema.brand<Schema.NonEmptyString, "@relayfx/sdk/DatabaseIdentity">;
|
|
60
|
+
}>, Cause.YieldableError>;
|
|
61
|
+
export declare class DatabaseAlreadyOwned extends DatabaseAlreadyOwned_base {
|
|
62
|
+
}
|
|
63
|
+
declare const UnsupportedTopology_base: Schema.Class<UnsupportedTopology, Schema.TaggedStruct<"UnsupportedTopology", {
|
|
64
|
+
readonly reason: Schema.String;
|
|
65
|
+
}>, Cause.YieldableError>;
|
|
66
|
+
export declare class UnsupportedTopology extends UnsupportedTopology_base {
|
|
67
|
+
}
|
|
68
|
+
declare const MigratorError_base: Schema.Class<MigratorError, Schema.TaggedStruct<"MigratorError", {
|
|
69
|
+
readonly reason: Schema.String;
|
|
70
|
+
}>, Cause.YieldableError>;
|
|
71
|
+
export declare class MigratorError extends MigratorError_base {
|
|
72
|
+
}
|
|
73
|
+
declare const SchemaHeadMismatch_base: Schema.Class<SchemaHeadMismatch, Schema.TaggedStruct<"SchemaHeadMismatch", {
|
|
74
|
+
readonly expected: Schema.String;
|
|
75
|
+
readonly actual: Schema.String;
|
|
76
|
+
}>, Cause.YieldableError>;
|
|
77
|
+
export declare class SchemaHeadMismatch extends SchemaHeadMismatch_base {
|
|
78
|
+
}
|
|
79
|
+
declare const HostUnavailable_base: Schema.Class<HostUnavailable, Schema.TaggedStruct<"HostUnavailable", {
|
|
80
|
+
readonly host: Schema.String;
|
|
81
|
+
readonly reason: Schema.String;
|
|
82
|
+
}>, Cause.YieldableError>;
|
|
83
|
+
export declare class HostUnavailable extends HostUnavailable_base {
|
|
84
|
+
}
|
|
85
|
+
export type RuntimeConfigurationCause = ConfigFailure | HostLayerError;
|
|
86
|
+
export type RuntimeTopologyCause = ClusterFailure | DatabaseDialectMismatch | DatabaseAlreadyOwned | UnsupportedTopology;
|
|
87
|
+
export type RuntimeMigrationCause = SqlFailure | MigratorError | SchemaHeadMismatch;
|
|
88
|
+
export type RuntimeReadinessCause = SqlFailure | NotificationFailure | ClusterFailure | HostUnavailable;
|
|
89
|
+
export declare const RuntimeConfigurationCause: Schema.Schema<RuntimeConfigurationCause>;
|
|
90
|
+
export declare const RuntimeTopologyCause: Schema.Schema<RuntimeTopologyCause>;
|
|
91
|
+
export declare const RuntimeMigrationCause: Schema.Schema<RuntimeMigrationCause>;
|
|
92
|
+
export declare const RuntimeReadinessCause: Schema.Schema<RuntimeReadinessCause>;
|
|
93
|
+
declare const RuntimeConfigurationError_base: Schema.Class<RuntimeConfigurationError, Schema.TaggedStruct<"RuntimeConfigurationError", {
|
|
94
|
+
readonly setting: Schema.String;
|
|
95
|
+
readonly nextAction: Schema.Literals<readonly ["provide-setting", "provide-host-layer"]>;
|
|
96
|
+
readonly cause: Schema.Schema<RuntimeConfigurationCause>;
|
|
97
|
+
}>, Cause.YieldableError>;
|
|
98
|
+
export declare class RuntimeConfigurationError extends RuntimeConfigurationError_base {
|
|
99
|
+
}
|
|
100
|
+
declare const RuntimeTopologyError_base: Schema.Class<RuntimeTopologyError, Schema.TaggedStruct<"RuntimeTopologyError", {
|
|
101
|
+
readonly dialect: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
102
|
+
readonly role: Schema.Literals<readonly ["embedded", "runner", "client"]>;
|
|
103
|
+
readonly nextAction: Schema.Literals<readonly ["use-embedded", "use-postgres-or-mysql", "use-client-constructor", "reuse-runtime", "use-different-database"]>;
|
|
104
|
+
readonly cause: Schema.Schema<RuntimeTopologyCause>;
|
|
105
|
+
}>, Cause.YieldableError>;
|
|
106
|
+
export declare class RuntimeTopologyError extends RuntimeTopologyError_base {
|
|
107
|
+
}
|
|
108
|
+
declare const RuntimeMigrationError_base: Schema.Class<RuntimeMigrationError, Schema.TaggedStruct<"RuntimeMigrationError", {
|
|
109
|
+
readonly dialect: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
110
|
+
readonly phase: Schema.Literals<readonly ["apply", "verify"]>;
|
|
111
|
+
readonly nextAction: Schema.Literals<readonly ["retry", "inspect-schema", "run-compatible-release"]>;
|
|
112
|
+
readonly cause: Schema.Schema<RuntimeMigrationCause>;
|
|
113
|
+
}>, Cause.YieldableError>;
|
|
114
|
+
export declare class RuntimeMigrationError extends RuntimeMigrationError_base {
|
|
115
|
+
}
|
|
116
|
+
declare const RuntimeReadinessError_base: Schema.Class<RuntimeReadinessError, Schema.TaggedStruct<"RuntimeReadinessError", {
|
|
117
|
+
readonly phase: Schema.Literals<readonly ["database", "notification", "cluster", "hosts"]>;
|
|
118
|
+
readonly cause: Schema.Schema<RuntimeReadinessCause>;
|
|
119
|
+
}>, Cause.YieldableError>;
|
|
120
|
+
export declare class RuntimeReadinessError extends RuntimeReadinessError_base {
|
|
121
|
+
}
|
|
122
|
+
export type AcquisitionError = RuntimeConfigurationError | RuntimeTopologyError | RuntimeMigrationError;
|
|
123
|
+
export type RuntimeCapabilityStatus = {
|
|
124
|
+
readonly enabled: false;
|
|
125
|
+
readonly source: "local-host" | "role-unavailable";
|
|
126
|
+
readonly health: "not-applicable";
|
|
127
|
+
} | {
|
|
128
|
+
readonly enabled: true;
|
|
129
|
+
readonly source: "local-host";
|
|
130
|
+
readonly health: "healthy" | "unhealthy";
|
|
131
|
+
};
|
|
132
|
+
export interface ReadinessStatus {
|
|
133
|
+
readonly ready: true;
|
|
134
|
+
readonly role: "embedded" | "runner" | "client";
|
|
135
|
+
readonly dialect: Dialect;
|
|
136
|
+
readonly databaseIdentity: DatabaseIdentity;
|
|
137
|
+
readonly schemaHead: string;
|
|
138
|
+
readonly notification: "pg-listen-notify" | "polling" | "in-process";
|
|
139
|
+
readonly capabilities: {
|
|
140
|
+
readonly fanOut: RuntimeCapabilityStatus;
|
|
141
|
+
readonly workflowDefinition: RuntimeCapabilityStatus;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export interface Interface {
|
|
145
|
+
readonly readiness: Effect.Effect<ReadinessStatus, RuntimeReadinessError>;
|
|
146
|
+
}
|
|
147
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/Runtime", Interface>;
|
|
148
|
+
export declare class Service extends Service_base {
|
|
149
|
+
}
|
|
150
|
+
export interface ClusterHttpOptions {
|
|
151
|
+
readonly runnerHost: string;
|
|
152
|
+
readonly rpcPort: number;
|
|
153
|
+
readonly assignedShardGroups: ReadonlyArray<string>;
|
|
154
|
+
readonly availableShardGroups?: ReadonlyArray<string>;
|
|
155
|
+
readonly shardsPerGroup?: number;
|
|
156
|
+
readonly shardLockRefreshInterval?: Duration.Input;
|
|
157
|
+
readonly shardLockExpiration?: Duration.Input;
|
|
158
|
+
readonly shardLockDisableAdvisory?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export interface ClusterClientOptions {
|
|
161
|
+
readonly availableShardGroups?: ReadonlyArray<string>;
|
|
162
|
+
readonly shardsPerGroup?: number;
|
|
163
|
+
readonly shardLockRefreshInterval?: Duration.Input;
|
|
164
|
+
readonly shardLockExpiration?: Duration.Input;
|
|
165
|
+
readonly shardLockDisableAdvisory?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export type MultiNodeDatabaseLayer<E = never, R = never> = DatabaseLayer<"pg", E, R> | DatabaseLayer<"mysql", E, R>;
|
|
168
|
+
type HostOptions<HostE, HostR, ToolE = HostE, ToolR = HostR> = {
|
|
169
|
+
readonly languageModelLayer: Layer.Layer<LanguageModelService.Service, HostE, HostR>;
|
|
170
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolE, ToolR>;
|
|
171
|
+
readonly embeddingModelLayer?: Layer.Layer<EmbeddingModelService.Service, HostE, HostR>;
|
|
172
|
+
readonly blobStoreLayer?: Layer.Layer<BlobStore.Service, HostE, HostR>;
|
|
173
|
+
readonly artifactStoreLayer?: Layer.Layer<ArtifactStore.Service, HostE, HostR>;
|
|
174
|
+
readonly promptAssemblerLayer?: Layer.Layer<PromptAssembler.Service, HostE, HostR>;
|
|
175
|
+
readonly schemaRegistryLayer?: Layer.Layer<SchemaRegistry.Service, HostE, HostR>;
|
|
176
|
+
};
|
|
177
|
+
type EmbeddedHostOptions<HostE, HostR, ChildE, ChildR, WorkflowE, WorkflowR, ToolE, ToolR> = HostOptions<HostE, HostR, ToolE, ToolR> & {
|
|
178
|
+
readonly childFanOutHandlersLayer?: Layer.Layer<ChildFanOutRuntime.HandlerService, ChildE, ChildR>;
|
|
179
|
+
readonly workflowDefinitionHandlersLayer?: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, WorkflowE, WorkflowR>;
|
|
180
|
+
};
|
|
181
|
+
export interface RunnerOptions<DBE, DBR, HostE, HostR> extends HostOptions<HostE, HostR> {
|
|
182
|
+
readonly databaseLayer: MultiNodeDatabaseLayer<DBE, DBR>;
|
|
183
|
+
readonly cluster: ClusterHttpOptions;
|
|
184
|
+
}
|
|
185
|
+
export interface ClientOptions<DBE, DBR> {
|
|
186
|
+
readonly databaseLayer: MultiNodeDatabaseLayer<DBE, DBR>;
|
|
187
|
+
readonly cluster?: ClusterClientOptions;
|
|
188
|
+
}
|
|
189
|
+
export type EmbeddedOutput = Service | ClientService;
|
|
190
|
+
export type RunnerOutput = Service | ClientService;
|
|
191
|
+
export type ClientOutput = Service | ClientService;
|
|
192
|
+
export declare const layerEmbedded: <D extends Dialect, DBE, DBR, HostE, HostR, ChildE = never, ChildR = never, WorkflowE = never, WorkflowR = never, ToolE = never, ToolR = never>(options: EmbeddedHostOptions<HostE, HostR, ChildE, ChildR, WorkflowE, WorkflowR, ToolE, ToolR> & {
|
|
193
|
+
readonly databaseLayer: DatabaseLayer<D, DBE, DBR>;
|
|
194
|
+
}) => Layer.Layer<EmbeddedOutput, AcquisitionError, DBR | HostR | ToolR | Exclude<ChildR, RunnerRuntime.Service | ClientRuntimeRequirements> | Exclude<WorkflowR, RunnerRuntime.Service | ChildFanOutRuntime.Service | ClientRuntimeRequirements>>;
|
|
195
|
+
export declare const layerRunner: <DBE, DBR, HostE, HostR, ToolE, ToolR>(options: Omit<RunnerOptions<DBE, DBR, HostE, HostR>, "toolRuntimeLayer"> & {
|
|
196
|
+
readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolE, ToolR>;
|
|
197
|
+
}) => Layer.Layer<RunnerOutput, AcquisitionError, DBR | HostR | ToolR | HttpServer>;
|
|
198
|
+
export declare const layerClient: <DBE, DBR>(options: ClientOptions<DBE, DBR>) => Layer.Layer<ClientOutput, AcquisitionError, DBR>;
|
|
@@ -3,7 +3,16 @@ import { ChildFanOutRuntime, WorkflowDefinitionRuntime } from "../runtime/index"
|
|
|
3
3
|
import { WorkflowDefinitionRepository } from "../store-sql/portable";
|
|
4
4
|
import { Layer } from "effect";
|
|
5
5
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
6
|
+
import { RuntimeConfigurationError, RuntimeMigrationError, RuntimeTopologyError, type DatabaseLayer } from "./runtime";
|
|
6
7
|
export declare const clientLayer: (options: SqliteClientConfig) => Layer.Layer<SqlClient | import("@effect/sql-sqlite-bun/SqliteClient").SqliteClient, never, never>;
|
|
8
|
+
export interface SQLiteRuntimeDatabaseOptions {
|
|
9
|
+
readonly filename: string;
|
|
10
|
+
readonly disableWAL?: boolean;
|
|
11
|
+
readonly spanAttributes?: Record<string, unknown>;
|
|
12
|
+
readonly transformResultNames?: (name: string) => string;
|
|
13
|
+
readonly transformQueryNames?: (name: string) => string;
|
|
14
|
+
}
|
|
15
|
+
export declare const runtimeDatabaseLayer: (options: SQLiteRuntimeDatabaseOptions) => DatabaseLayer<"sqlite", RuntimeConfigurationError | RuntimeTopologyError | RuntimeMigrationError>;
|
|
7
16
|
export declare const migrationsLayer: Layer.Layer<never, import("effect/unstable/sql/SqlError").SqlError | import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError, SqlClient>;
|
|
8
17
|
export declare const layer: (options: SqliteClientConfig) => Layer.Layer<SqlClient, import("effect/unstable/sql/SqlError").SqlError | import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError, never>;
|
|
9
18
|
export declare const workflowLayer: <E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, E, R>) => Layer.Layer<SqlClient | WorkflowDefinitionRepository.Service | WorkflowDefinitionRuntime.HandlerService | WorkflowDefinitionRuntime.Service, unknown, Exclude<R, SqlClient | WorkflowDefinitionRepository.Service>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as Client from "./client";
|
|
2
2
|
export * as Operation from "./operation";
|
|
3
3
|
export * as SQLite from "./sqlite-runtime";
|
|
4
|
+
export * as Runtime from "./runtime";
|
|
4
5
|
export { Address, Agent, Content, Entity, Envelope, Execution, Ids, Schedule, Shared, Skill, Tool, Workflow, } from "../schema/index";
|
|
5
6
|
export * as AddressBook from "../runtime/address/address-book-service";
|
|
6
7
|
export * as AddressResolution from "../runtime/address/address-resolution-service";
|
|
@@ -16,6 +17,7 @@ export * as EventLog from "../runtime/execution/event-log-service";
|
|
|
16
17
|
export * as ExecutionEntity from "../runtime/cluster/execution-entity";
|
|
17
18
|
export * as ExecutionService from "../runtime/execution/execution-service";
|
|
18
19
|
export * as ExecutionWorkflow from "../runtime/workflow/execution-workflow";
|
|
20
|
+
export * as EmbeddingModelService from "../runtime/model/embedding-model-service";
|
|
19
21
|
export * as LanguageModelService from "../runtime/model/language-model-service";
|
|
20
22
|
export * as ModelCallPolicy from "../runtime/model/model-call-policy";
|
|
21
23
|
export * as PromptAssembler from "../runtime/agent/prompt-assembler-service";
|
|
@@ -79,11 +79,22 @@ export declare const LocalAgentTarget: Schema.Struct<{
|
|
|
79
79
|
readonly [x: string]: Schema.Json;
|
|
80
80
|
};
|
|
81
81
|
readonly instructions?: string;
|
|
82
|
-
readonly compaction_policy?:
|
|
83
|
-
readonly context_window:
|
|
84
|
-
readonly reserve_tokens:
|
|
85
|
-
readonly keep_recent_tokens:
|
|
86
|
-
|
|
82
|
+
readonly compaction_policy?: {
|
|
83
|
+
readonly context_window: number;
|
|
84
|
+
readonly reserve_tokens: number;
|
|
85
|
+
readonly keep_recent_tokens: number;
|
|
86
|
+
readonly summary_model?: {
|
|
87
|
+
readonly provider: string;
|
|
88
|
+
readonly model: string;
|
|
89
|
+
readonly metadata?: {
|
|
90
|
+
readonly [x: string]: Schema.Json;
|
|
91
|
+
};
|
|
92
|
+
readonly registration_key?: string;
|
|
93
|
+
readonly request_options?: {
|
|
94
|
+
readonly [x: string]: Schema.Json;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
87
98
|
readonly output_schema_ref?: string;
|
|
88
99
|
readonly skill_definition_ids?: readonly string[];
|
|
89
100
|
readonly permission_rules?: {
|
|
@@ -116,11 +127,22 @@ export declare const LocalAgentTarget: Schema.Struct<{
|
|
|
116
127
|
};
|
|
117
128
|
};
|
|
118
129
|
readonly instructions?: string;
|
|
119
|
-
readonly compaction_policy?:
|
|
120
|
-
readonly context_window:
|
|
121
|
-
readonly reserve_tokens:
|
|
122
|
-
readonly keep_recent_tokens:
|
|
123
|
-
|
|
130
|
+
readonly compaction_policy?: {
|
|
131
|
+
readonly context_window: number;
|
|
132
|
+
readonly reserve_tokens: number;
|
|
133
|
+
readonly keep_recent_tokens: number;
|
|
134
|
+
readonly summary_model?: {
|
|
135
|
+
readonly provider: string;
|
|
136
|
+
readonly model: string;
|
|
137
|
+
readonly metadata?: {
|
|
138
|
+
readonly [x: string]: Schema.Json;
|
|
139
|
+
};
|
|
140
|
+
readonly registration_key?: string;
|
|
141
|
+
readonly request_options?: {
|
|
142
|
+
readonly [x: string]: Schema.Json;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
};
|
|
124
146
|
readonly tool_names?: readonly string[];
|
|
125
147
|
readonly workspace_policy?: {
|
|
126
148
|
readonly mode: "share" | "fork";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Compaction } from "@batonfx/core";
|
|
1
|
+
import { Compaction, ModelRegistry } from "@batonfx/core";
|
|
2
2
|
import { Ids } from "../../schema/index";
|
|
3
3
|
import { CompactionRepository } from "../../store-sql/portable";
|
|
4
|
-
import { Layer } from "effect";
|
|
4
|
+
import { Effect, Layer } from "effect";
|
|
5
5
|
export interface Options {
|
|
6
6
|
readonly contextWindow?: number;
|
|
7
7
|
readonly reserveTokens?: number;
|
|
8
8
|
readonly keepRecentTokens?: number;
|
|
9
|
+
readonly summaryModel?: Effect.Effect<Layer.Layer<ModelRegistry.ModelEnvironment>, Compaction.CompactionError>;
|
|
9
10
|
}
|
|
10
11
|
export interface Config {
|
|
11
12
|
readonly executionId: Ids.ExecutionId;
|
|
@@ -29,6 +29,8 @@ export interface Interface {
|
|
|
29
29
|
declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/ChildFanOutRuntime", Interface>;
|
|
30
30
|
export declare class Service extends Service_base {
|
|
31
31
|
}
|
|
32
|
+
export declare const layerFromRuntime: Layer.Layer<Service, ChildFanOutRuntimeError, ChildFanOutRepository.Service | TransitionService | HandlerService>;
|
|
32
33
|
export declare const layer: Layer.Layer<Service, ChildFanOutRuntimeError, ChildFanOutRepository.Service | TransitionService | HandlerService>;
|
|
34
|
+
export declare const handlersLayer: (handlers: Handlers) => Layer.Layer<HandlerService, never, never>;
|
|
33
35
|
export declare const testHandlersLayer: (handlers: Handlers) => Layer.Layer<HandlerService, never, never>;
|
|
34
36
|
export {};
|
|
@@ -20,6 +20,13 @@ export declare const Input: Schema.Struct<{
|
|
|
20
20
|
readonly context_window: Schema.Number;
|
|
21
21
|
readonly reserve_tokens: Schema.Number;
|
|
22
22
|
readonly keep_recent_tokens: Schema.Number;
|
|
23
|
+
readonly summary_model: Schema.optionalKey<Schema.Struct<{
|
|
24
|
+
readonly provider: Schema.String;
|
|
25
|
+
readonly model: Schema.String;
|
|
26
|
+
readonly registration_key: Schema.optionalKey<Schema.String>;
|
|
27
|
+
readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
28
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
29
|
+
}>>;
|
|
23
30
|
}>>;
|
|
24
31
|
readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
25
32
|
readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -29,6 +29,7 @@ export declare const memoryLayer: (initialRegistrations?: ReadonlyArray<Registra
|
|
|
29
29
|
export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
|
|
30
30
|
export declare const register: (input: ModelRegistry.RegisterInput) => Effect.Effect<void, never, Service>;
|
|
31
31
|
export declare const registrations: () => Effect.Effect<readonly ModelRegistry.Registration[], never, Service>;
|
|
32
|
+
export declare const resolve: (selection: Agent.ModelSelection) => Effect.Effect<ModelRegistry.Registration, ModelRegistry.LanguageModelNotRegistered, Service>;
|
|
32
33
|
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>>;
|
|
33
34
|
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>>;
|
|
34
35
|
export {};
|