@relayfx/sdk 0.2.14 → 0.2.16
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-9q3yh32k.js → index-5x686v8w.js} +1815 -1543
- package/dist/{index-15f2ewt8.js → index-6dv1dqq1.js} +8 -8
- package/dist/{index-gb7d1wfm.js → index-a6vwwhcp.js} +116 -105
- package/dist/{index-qg0hy7s1.js → index-per7tyzq.js} +12 -8
- package/dist/index.js +5 -5
- package/dist/mysql.js +24 -9
- package/dist/postgres.js +18 -13
- package/dist/sqlite.js +26 -29
- package/dist/types/ai/embedding-model/embedding-model-registration.d.ts +2 -2
- package/dist/types/relay/adapter-outbox.d.ts +1 -1
- package/dist/types/relay/client.d.ts +28 -28
- package/dist/types/relay/command.d.ts +10 -4
- package/dist/types/relay/database.d.ts +4 -4
- package/dist/types/relay/migration-errors.d.ts +8 -2
- package/dist/types/relay/mysql.d.ts +2 -2
- package/dist/types/relay/operation.d.ts +173 -123
- package/dist/types/relay/postgres.d.ts +2 -2
- package/dist/types/relay/runtime-capability-policy.d.ts +11 -5
- package/dist/types/relay/runtime-database.d.ts +1 -1
- package/dist/types/relay/runtime.d.ts +4 -4
- package/dist/types/relay/sqlite-migrations.d.ts +1 -1
- package/dist/types/relay/sqlite-runtime.d.ts +10 -5
- package/dist/types/relay/tool-worker.d.ts +6 -5
- package/dist/types/runtime/address/address-book-service.d.ts +3 -3
- package/dist/types/runtime/address/address-resolution-service.d.ts +60 -38
- package/dist/types/runtime/agent/agent-loop-service.d.ts +14 -5
- package/dist/types/runtime/agent/agent-registry-service.d.ts +2 -2
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +1 -1
- package/dist/types/runtime/agent/relay-compaction.d.ts +3 -2
- package/dist/types/runtime/agent/relay-tool-output.d.ts +4 -1
- package/dist/types/runtime/child/child-fan-out-admission-service.d.ts +1 -1
- package/dist/types/runtime/child/child-fan-out-runtime.d.ts +12 -8
- package/dist/types/runtime/child/child-fan-out-transition-service.d.ts +1 -1
- package/dist/types/runtime/child/child-run-service.d.ts +7 -4
- package/dist/types/runtime/child/parent-notifier-service.d.ts +4 -2
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +12 -4
- package/dist/types/runtime/cluster/execution-entity.d.ts +2 -2
- package/dist/types/runtime/content/artifact-store-service.d.ts +2 -2
- package/dist/types/runtime/content/blob-store-service.d.ts +1 -1
- package/dist/types/runtime/entity/entity-instance-service.d.ts +14 -5
- package/dist/types/runtime/entity/entity-registry-service.d.ts +2 -2
- package/dist/types/runtime/envelope/envelope-service.d.ts +2 -2
- package/dist/types/runtime/execution/active-execution-registry.d.ts +1 -1
- package/dist/types/runtime/execution/event-log-service.d.ts +5 -2
- package/dist/types/runtime/execution/execution-service.d.ts +1 -1
- package/dist/types/runtime/execution/execution-watch-service.d.ts +1 -1
- package/dist/types/runtime/execution/session-stream-service.d.ts +1 -1
- package/dist/types/runtime/inbox/inbox-service.d.ts +1 -1
- package/dist/types/runtime/memory/memory-service.d.ts +1 -1
- package/dist/types/runtime/model/embedding-model-service.d.ts +23 -10
- package/dist/types/runtime/model/language-model-service.d.ts +20 -6
- package/dist/types/runtime/model/model-call-policy.d.ts +1 -1
- package/dist/types/runtime/observability/runtime-metrics.d.ts +12 -3
- package/dist/types/runtime/presence/presence-service.d.ts +1 -1
- package/dist/types/runtime/presence/presence-tool.d.ts +1 -1
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +19 -19
- package/dist/types/runtime/schedule/scheduler-service.d.ts +3 -3
- package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +2 -2
- package/dist/types/runtime/session/session-store-service.d.ts +13 -4
- package/dist/types/runtime/skill/skill-registry-service.d.ts +2 -2
- package/dist/types/runtime/state/execution-state-service.d.ts +5 -2
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +42 -19
- package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +2 -2
- package/dist/types/runtime/topic/topic-service.d.ts +1 -1
- package/dist/types/runtime/wait/wait-service.d.ts +1 -1
- package/dist/types/runtime/wait/wait-signal.d.ts +12 -3
- package/dist/types/runtime/workflow/activity-version-registry.d.ts +7 -3
- package/dist/types/runtime/workflow/definition-runtime.d.ts +37 -22
- package/dist/types/runtime/workflow/execution-workflow.d.ts +143 -104
- package/dist/types/runtime/workspace/workspace-planner-service.d.ts +6 -6
- package/dist/types/runtime/workspace/workspace-provider-service.d.ts +11 -7
- package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +1 -1
- package/dist/types/schema/agent-schema.d.ts +388 -228
- package/dist/types/schema/child-orchestration-schema.d.ts +78 -57
- package/dist/types/schema/execution-schema.d.ts +118 -54
- package/dist/types/schema/workflow-schema.d.ts +243 -243
- package/dist/types/schema/workspace-schema.d.ts +1 -1
- package/dist/types/store-sql/address/address-book-repository.d.ts +5 -5
- package/dist/types/store-sql/agent/agent-definition-repository.d.ts +7 -7
- package/dist/types/store-sql/chat/agent-chat-repository.d.ts +2 -2
- package/dist/types/store-sql/child/child-execution-repository.d.ts +4 -4
- package/dist/types/store-sql/child/child-fan-out-repository.d.ts +2 -2
- package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +5 -5
- package/dist/types/store-sql/compaction/compaction-repository.d.ts +3 -3
- package/dist/types/store-sql/database/database-service.d.ts +3 -3
- package/dist/types/store-sql/database/notification-bus.d.ts +1 -1
- package/dist/types/store-sql/database/sql-dialect.d.ts +4 -1
- package/dist/types/store-sql/entity/entity-repository.d.ts +2 -2
- package/dist/types/store-sql/envelope/envelope-repository.d.ts +13 -13
- package/dist/types/store-sql/execution/execution-event-repository.d.ts +4 -4
- package/dist/types/store-sql/execution/execution-repository.d.ts +8 -8
- package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +5 -5
- package/dist/types/store-sql/inbox/inbox-repository.d.ts +1 -1
- package/dist/types/store-sql/memory/memory-repository.d.ts +3 -3
- package/dist/types/store-sql/permission/permission-rule-repository.d.ts +2 -2
- package/dist/types/store-sql/presence/presence-repository.d.ts +2 -2
- package/dist/types/store-sql/schedule/schedule-repository.d.ts +9 -9
- package/dist/types/store-sql/schema/relay-schema.d.ts +257 -257
- package/dist/types/store-sql/session/context-epoch-repository.d.ts +2 -2
- package/dist/types/store-sql/session/session-repository.d.ts +5 -5
- package/dist/types/store-sql/skill/skill-definition-repository.d.ts +9 -9
- package/dist/types/store-sql/state/execution-state-repository.d.ts +2 -2
- package/dist/types/store-sql/steering/steering-repository.d.ts +5 -5
- package/dist/types/store-sql/tenant/tenant-id.d.ts +2 -2
- package/dist/types/store-sql/tool/tool-call-repository.d.ts +19 -16
- package/dist/types/store-sql/topic/topic-repository.d.ts +1 -1
- package/dist/types/store-sql/workflow/workflow-definition-repository.d.ts +16 -14
- package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +11 -11
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
__export,
|
|
4
4
|
exports_model_registry
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-5x686v8w.js";
|
|
6
6
|
|
|
7
7
|
// ../ai/src/language-model/language-model-registration.ts
|
|
8
8
|
var exports_language_model_registration = {};
|
|
@@ -24,7 +24,7 @@ __export(exports_language_model_registration, {
|
|
|
24
24
|
anthropic: () => anthropic
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
// ../../node_modules/.bun/@batonfx+providers@0.4.
|
|
27
|
+
// ../../node_modules/.bun/@batonfx+providers@0.4.4/node_modules/@batonfx/providers/dist/anthropic.js
|
|
28
28
|
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
|
|
29
29
|
import { Config, Layer, Redacted } from "effect";
|
|
30
30
|
import { FetchHttpClient } from "effect/unstable/http";
|
|
@@ -40,13 +40,13 @@ var anthropic = (input) => exports_model_registry.registrationFromLayer({
|
|
|
40
40
|
});
|
|
41
41
|
var anthropicClientLayerConfig = AnthropicClient.layerConfig;
|
|
42
42
|
var withAnthropic = (options) => exports_model_registry.layerFromRegistrationEffects([anthropic(options)]).pipe(Layer.provide(AnthropicClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer.provide(FetchHttpClient.layer));
|
|
43
|
-
// ../../node_modules/.bun/@batonfx+providers@0.4.
|
|
43
|
+
// ../../node_modules/.bun/@batonfx+providers@0.4.4/node_modules/@batonfx/providers/dist/deterministic.js
|
|
44
44
|
import { OpenAiClient as OpenAiClient2 } from "@effect/ai-openai";
|
|
45
45
|
import { Effect, Layer as Layer3, Option, Stream } from "effect";
|
|
46
46
|
import { LanguageModel, Response } from "effect/unstable/ai";
|
|
47
47
|
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
48
48
|
|
|
49
|
-
// ../../node_modules/.bun/@batonfx+providers@0.4.
|
|
49
|
+
// ../../node_modules/.bun/@batonfx+providers@0.4.4/node_modules/@batonfx/providers/dist/openai.js
|
|
50
50
|
import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai";
|
|
51
51
|
import { Config as Config2, Layer as Layer2, Redacted as Redacted2 } from "effect";
|
|
52
52
|
import { FetchHttpClient as FetchHttpClient2 } from "effect/unstable/http";
|
|
@@ -63,7 +63,7 @@ var openAi = (input) => exports_model_registry.registrationFromLayer({
|
|
|
63
63
|
var openAiClientLayerConfig = OpenAiClient.layerConfig;
|
|
64
64
|
var withOpenAi = (options) => exports_model_registry.layerFromRegistrationEffects([openAi(options)]).pipe(Layer2.provide(OpenAiClient.layerConfig({ ...options.clientConfig, apiKey: options.apiKey })), Layer2.provide(FetchHttpClient2.layer));
|
|
65
65
|
|
|
66
|
-
// ../../node_modules/.bun/@batonfx+providers@0.4.
|
|
66
|
+
// ../../node_modules/.bun/@batonfx+providers@0.4.4/node_modules/@batonfx/providers/dist/deterministic.js
|
|
67
67
|
var deterministicModelLayer = Layer3.effect(LanguageModel.LanguageModel, LanguageModel.make({
|
|
68
68
|
generateText: () => Effect.succeed([{ type: "text", text: "deterministic response" }]),
|
|
69
69
|
streamText: () => Stream.make(Response.makePart("text-delta", { id: "text", delta: "deterministic response" }))
|
|
@@ -81,13 +81,17 @@ var withOpenAiOrDeterministic = (options) => Layer3.unwrap(Effect.gen(function*
|
|
|
81
81
|
provider: options.fallbackProvider ?? "deterministic",
|
|
82
82
|
model: options.fallbackModel
|
|
83
83
|
});
|
|
84
|
-
const
|
|
84
|
+
const providerLayer = OpenAiClient2.layerConfig({
|
|
85
|
+
...options.clientConfig,
|
|
86
|
+
apiKey: options.apiKey
|
|
87
|
+
}).pipe(Layer3.provide(FetchHttpClient3.layer));
|
|
88
|
+
const openAiRegistration = yield* Effect.scoped(Layer3.build(providerLayer).pipe(Effect.flatMap((context) => openAi(options).pipe(Effect.provide(context))), Effect.asSome, Effect.catchTag("ConfigError", () => Effect.succeedNone)));
|
|
85
89
|
return exports_model_registry.layer([
|
|
86
90
|
deterministic,
|
|
87
91
|
...Option.isSome(openAiRegistration) ? [openAiRegistration.value] : []
|
|
88
92
|
]);
|
|
89
93
|
}));
|
|
90
|
-
// ../../node_modules/.bun/@batonfx+providers@0.4.
|
|
94
|
+
// ../../node_modules/.bun/@batonfx+providers@0.4.4/node_modules/@batonfx/providers/dist/openai-compat.js
|
|
91
95
|
import { OpenAiClient as OpenAiClient3, OpenAiLanguageModel as OpenAiLanguageModel2 } from "@effect/ai-openai-compat";
|
|
92
96
|
import { Config as Config3, Layer as Layer4, Redacted as Redacted3 } from "effect";
|
|
93
97
|
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
@@ -108,7 +112,7 @@ var clientLayerConfig = (options) => OpenAiClient3.layerConfig({
|
|
|
108
112
|
...options.baseUrl === undefined ? {} : { apiUrl: Config3.succeed(options.baseUrl) }
|
|
109
113
|
});
|
|
110
114
|
var withOpenAiCompatible = (options) => exports_model_registry.layerFromRegistrationEffects([openAiCompatible(options)]).pipe(Layer4.provide(clientLayerConfig(options)), Layer4.provide(FetchHttpClient4.layer));
|
|
111
|
-
// ../../node_modules/.bun/@batonfx+providers@0.4.
|
|
115
|
+
// ../../node_modules/.bun/@batonfx+providers@0.4.4/node_modules/@batonfx/providers/dist/openrouter.js
|
|
112
116
|
import { OpenRouterClient, OpenRouterLanguageModel } from "@effect/ai-openrouter";
|
|
113
117
|
import { Config as Config4, Layer as Layer5, Redacted as Redacted4 } from "effect";
|
|
114
118
|
import { FetchHttpClient as FetchHttpClient5 } from "effect/unstable/http";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
exports_language_model_registration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-per7tyzq.js";
|
|
5
5
|
import {
|
|
6
6
|
Service,
|
|
7
7
|
exports_client,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
exports_operation,
|
|
10
10
|
exports_runtime,
|
|
11
11
|
makeDatabaseIdentity
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-a6vwwhcp.js";
|
|
13
13
|
import {
|
|
14
14
|
Dialect,
|
|
15
15
|
__export,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
fromDbTimestamp,
|
|
63
63
|
fromNullableDbTimestamp,
|
|
64
64
|
timestampParam
|
|
65
|
-
} from "./index-
|
|
65
|
+
} from "./index-5x686v8w.js";
|
|
66
66
|
|
|
67
67
|
// src/adapter-outbox.ts
|
|
68
68
|
var exports_adapter_outbox = {};
|
|
@@ -76,7 +76,7 @@ __export(exports_adapter_outbox, {
|
|
|
76
76
|
Service: () => Service2
|
|
77
77
|
});
|
|
78
78
|
import { Context, Effect, Layer } from "effect";
|
|
79
|
-
class Service2 extends Context.Service()("@relayfx/sdk/
|
|
79
|
+
class Service2 extends Context.Service()("@relayfx/sdk/adapter-outbox/Service") {
|
|
80
80
|
}
|
|
81
81
|
var layer = Layer.effect(Service2, Effect.gen(function* () {
|
|
82
82
|
const client = yield* Service;
|
|
@@ -151,7 +151,7 @@ import { sql } from "drizzle-orm";
|
|
|
151
151
|
import { Config, Context as Context2, Effect as Effect2, Layer as Layer2, Redacted } from "effect";
|
|
152
152
|
import { types } from "pg";
|
|
153
153
|
|
|
154
|
-
class Service3 extends Context2.Service()("@relayfx/store-sql/
|
|
154
|
+
class Service3 extends Context2.Service()("@relayfx/store-sql/database/database-service/Service") {
|
|
155
155
|
}
|
|
156
156
|
var pgTypeParsers = {
|
|
157
157
|
getTypeParser: (typeId, format) => {
|
package/dist/mysql.js
CHANGED
|
@@ -3,12 +3,16 @@ import {
|
|
|
3
3
|
normalizeClientLayer,
|
|
4
4
|
normalizeMigrationCause,
|
|
5
5
|
runtimeDatabaseLayer
|
|
6
|
-
} from "./index-
|
|
7
|
-
import
|
|
8
|
-
|
|
6
|
+
} from "./index-6dv1dqq1.js";
|
|
7
|
+
import {
|
|
8
|
+
MigratorError,
|
|
9
|
+
RuntimeMigrationError,
|
|
10
|
+
SqlFailure
|
|
11
|
+
} from "./index-a6vwwhcp.js";
|
|
12
|
+
import"./index-5x686v8w.js";
|
|
9
13
|
|
|
10
14
|
// src/mysql.ts
|
|
11
|
-
import { Effect } from "effect";
|
|
15
|
+
import { Effect, Layer } from "effect";
|
|
12
16
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
13
17
|
|
|
14
18
|
// ../../migrations/mysql/0001_baseline.sql
|
|
@@ -94,8 +98,14 @@ var verifySchema = Effect.gen(function* () {
|
|
|
94
98
|
const rows = yield* sql`SELECT migration_id, name FROM relay_migrations ORDER BY migration_id`;
|
|
95
99
|
const actual = rows.map((row) => `${row.migration_id}:${row.name}`).join(",");
|
|
96
100
|
const expected = migrations.map(([id, name]) => `${id}:${name}`).join(",");
|
|
97
|
-
if (actual !== expected)
|
|
98
|
-
return yield*
|
|
101
|
+
if (actual !== expected) {
|
|
102
|
+
return yield* RuntimeMigrationError.make({
|
|
103
|
+
dialect: "mysql",
|
|
104
|
+
phase: "verify",
|
|
105
|
+
nextAction: "inspect-schema",
|
|
106
|
+
cause: SqlFailure.make({ category: "statement", operation: "verify", retryable: false })
|
|
107
|
+
});
|
|
108
|
+
}
|
|
99
109
|
}).pipe((effect) => normalizeMigrationCause(effect, "mysql", "verify"));
|
|
100
110
|
var runMigrations = Effect.gen(function* () {
|
|
101
111
|
const sql = yield* SqlClient;
|
|
@@ -103,8 +113,13 @@ var runMigrations = Effect.gen(function* () {
|
|
|
103
113
|
const rows = yield* sql`SELECT migration_id, name FROM relay_migrations ORDER BY migration_id`;
|
|
104
114
|
const current = rows.map((row) => [Number(row.migration_id), row.name]);
|
|
105
115
|
const expectedPrefix = migrations.slice(0, current.length).map(([id, name]) => [id, name]);
|
|
106
|
-
if (
|
|
107
|
-
return yield*
|
|
116
|
+
if (current.length !== expectedPrefix.length || current.some(([id, name], index) => expectedPrefix[index]?.[0] !== id || expectedPrefix[index]?.[1] !== name)) {
|
|
117
|
+
return yield* RuntimeMigrationError.make({
|
|
118
|
+
dialect: "mysql",
|
|
119
|
+
phase: "apply",
|
|
120
|
+
nextAction: "inspect-schema",
|
|
121
|
+
cause: MigratorError.make({ reason: "migration history is not a packaged manifest prefix" })
|
|
122
|
+
});
|
|
108
123
|
}
|
|
109
124
|
for (const [id, name, source] of migrations.slice(current.length)) {
|
|
110
125
|
for (const statement of source.split("--> statement-breakpoint").map((value) => value.trim()).filter(Boolean)) {
|
|
@@ -113,7 +128,7 @@ var runMigrations = Effect.gen(function* () {
|
|
|
113
128
|
yield* sql`INSERT INTO relay_migrations (migration_id, name) VALUES (${id}, ${name})`;
|
|
114
129
|
}
|
|
115
130
|
});
|
|
116
|
-
var migrate = (options) => normalizeMigrationCause(runMigrations, "mysql", "apply").pipe(Effect.andThen(normalizeMigrationCause(verifySchema, "mysql", "verify")),
|
|
131
|
+
var migrate = (options) => Effect.scoped(Layer.build(normalizeClientLayer(options.clientLayer)).pipe(Effect.flatMap((context) => Effect.provide(normalizeMigrationCause(runMigrations, "mysql", "apply").pipe(Effect.andThen(normalizeMigrationCause(verifySchema, "mysql", "verify"))), context)))).pipe(Effect.asVoid);
|
|
117
132
|
var MySQL = { runtimeDatabaseLayer: runtimeDatabaseLayer2, migrate };
|
|
118
133
|
export {
|
|
119
134
|
runtimeDatabaseLayer2 as runtimeDatabaseLayer,
|
package/dist/postgres.js
CHANGED
|
@@ -3,17 +3,19 @@ import {
|
|
|
3
3
|
normalizeClientLayer,
|
|
4
4
|
normalizeMigrationCause,
|
|
5
5
|
runtimeDatabaseLayer
|
|
6
|
-
} from "./index-
|
|
7
|
-
import
|
|
8
|
-
|
|
6
|
+
} from "./index-6dv1dqq1.js";
|
|
7
|
+
import {
|
|
8
|
+
RuntimeMigrationError,
|
|
9
|
+
SqlFailure
|
|
10
|
+
} from "./index-a6vwwhcp.js";
|
|
11
|
+
import"./index-5x686v8w.js";
|
|
9
12
|
|
|
10
13
|
// src/postgres.ts
|
|
11
14
|
import { PgClient } from "@effect/sql-pg/PgClient";
|
|
12
15
|
import { makeWithDefaults } from "drizzle-orm/effect-postgres";
|
|
13
16
|
import { migrate as runDrizzleMigrator } from "drizzle-orm/effect-postgres/migrator";
|
|
14
|
-
import { Effect } from "effect";
|
|
17
|
+
import { Effect, Layer } from "effect";
|
|
15
18
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
16
|
-
import { existsSync } from "fs";
|
|
17
19
|
import { fileURLToPath } from "url";
|
|
18
20
|
var schemaHead = "20260712200000_workflow_runtime";
|
|
19
21
|
var migrationNames = [
|
|
@@ -43,17 +45,20 @@ var migrationNames = [
|
|
|
43
45
|
"20260712190000_workflow_definitions",
|
|
44
46
|
schemaHead
|
|
45
47
|
];
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
return existsSync(packaged) ? packaged : fileURLToPath(new URL("../../../migrations/pg", import.meta.url));
|
|
49
|
-
};
|
|
48
|
+
var migrationsFolderUrl = import.meta.url.endsWith("/src/postgres.ts") ? new URL("../../../migrations/pg", import.meta.url) : new URL("./migrations/pg", import.meta.url);
|
|
49
|
+
var migrationsFolder = fileURLToPath(migrationsFolderUrl);
|
|
50
50
|
var verifySchema = Effect.gen(function* () {
|
|
51
51
|
const sql = yield* SqlClient;
|
|
52
52
|
const rows = yield* sql`SELECT name FROM drizzle.__drizzle_migrations ORDER BY id`;
|
|
53
53
|
const actual = rows.map((row) => row.name).join(",");
|
|
54
54
|
const expected = migrationNames.join(",");
|
|
55
55
|
if (actual !== expected) {
|
|
56
|
-
return yield*
|
|
56
|
+
return yield* RuntimeMigrationError.make({
|
|
57
|
+
dialect: "pg",
|
|
58
|
+
phase: "verify",
|
|
59
|
+
nextAction: "inspect-schema",
|
|
60
|
+
cause: SqlFailure.make({ category: "statement", operation: "verify", retryable: false })
|
|
61
|
+
});
|
|
57
62
|
}
|
|
58
63
|
}).pipe((effect) => normalizeMigrationCause(effect, "pg", "verify"));
|
|
59
64
|
var runtimeDatabaseLayer2 = (options) => runtimeDatabaseLayer({
|
|
@@ -63,12 +68,12 @@ var runtimeDatabaseLayer2 = (options) => runtimeDatabaseLayer({
|
|
|
63
68
|
schemaHead,
|
|
64
69
|
schema: verifySchema
|
|
65
70
|
});
|
|
66
|
-
var migrate = (options) => normalizeMigrationCause(Effect.gen(function* () {
|
|
71
|
+
var migrate = (options) => Effect.scoped(Layer.build(normalizeClientLayer(options.clientLayer)).pipe(Effect.flatMap((context) => Effect.provide(normalizeMigrationCause(Effect.gen(function* () {
|
|
67
72
|
const sql = yield* SqlClient;
|
|
68
73
|
const pg = sql;
|
|
69
74
|
const database = yield* makeWithDefaults().pipe(Effect.provideService(PgClient, pg));
|
|
70
|
-
yield* runDrizzleMigrator(database, { migrationsFolder
|
|
71
|
-
}), "pg", "apply").pipe(Effect.andThen(normalizeMigrationCause(verifySchema, "pg", "verify")),
|
|
75
|
+
yield* runDrizzleMigrator(database, { migrationsFolder });
|
|
76
|
+
}), "pg", "apply").pipe(Effect.andThen(normalizeMigrationCause(verifySchema, "pg", "verify"))), context)))).pipe(Effect.asVoid);
|
|
72
77
|
var Postgres = { runtimeDatabaseLayer: runtimeDatabaseLayer2, migrate };
|
|
73
78
|
export {
|
|
74
79
|
runtimeDatabaseLayer2 as runtimeDatabaseLayer,
|
package/dist/sqlite.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
normalizeMigrationCause,
|
|
4
4
|
runtimeDatabaseLayer
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-6dv1dqq1.js";
|
|
6
6
|
import {
|
|
7
7
|
DatabaseAlreadyOwned,
|
|
8
8
|
DatabaseDialect,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
exports_operation,
|
|
15
15
|
exports_runtime,
|
|
16
16
|
makeDatabaseIdentity
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-a6vwwhcp.js";
|
|
18
18
|
import {
|
|
19
19
|
__export,
|
|
20
20
|
exports_activity_version_registry,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
exports_wait_service,
|
|
60
60
|
exports_workflow_definition_repository,
|
|
61
61
|
exports_workflow_schema
|
|
62
|
-
} from "./index-
|
|
62
|
+
} from "./index-5x686v8w.js";
|
|
63
63
|
// src/sqlite-runtime.ts
|
|
64
64
|
var exports_sqlite_runtime = {};
|
|
65
65
|
__export(exports_sqlite_runtime, {
|
|
@@ -72,10 +72,9 @@ __export(exports_sqlite_runtime, {
|
|
|
72
72
|
});
|
|
73
73
|
import { layer as sqliteClientLayer } from "@effect/sql-sqlite-bun/SqliteClient";
|
|
74
74
|
import { layer as sqliteMigratorLayer, run as runSqliteMigrator } from "@effect/sql-sqlite-bun/SqliteMigrator";
|
|
75
|
-
import {
|
|
75
|
+
import { layer as bunServicesLayer } from "@effect/platform-bun/BunServices";
|
|
76
|
+
import { Effect as Effect2, FileSystem, Function, Layer, Path } from "effect";
|
|
76
77
|
import { SqlClient as SqlClient2 } from "effect/unstable/sql/SqlClient";
|
|
77
|
-
import { dirname, resolve } from "path";
|
|
78
|
-
import { realpathSync } from "fs";
|
|
79
78
|
|
|
80
79
|
// ../../migrations/sqlite/0001_baseline.sql
|
|
81
80
|
var _0001_baseline_default = `CREATE TABLE "relay_address_book_entries" (
|
|
@@ -683,27 +682,25 @@ var loader = Effect.succeed(migrations.map(({ id, name, source }) => [id, name,
|
|
|
683
682
|
var clientLayer = (options) => sqliteClientLayer(options);
|
|
684
683
|
var memoryIdentity = 0;
|
|
685
684
|
var ownedDatabases = new Set;
|
|
686
|
-
var canonicalFilename = (filename)
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
return resolve(realpathSync(dirname(absolute)), absolute.slice(dirname(absolute).length + 1));
|
|
693
|
-
} catch {
|
|
694
|
-
return absolute;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
};
|
|
685
|
+
var canonicalFilename = Effect2.fn("SQLite.canonicalFilename")(function* (filename) {
|
|
686
|
+
const fs = yield* FileSystem.FileSystem;
|
|
687
|
+
const path = yield* Path.Path;
|
|
688
|
+
const absolute = path.resolve(filename);
|
|
689
|
+
return yield* fs.realPath(absolute).pipe(Effect2.catch(() => fs.realPath(path.dirname(absolute)).pipe(Effect2.map((parent) => path.resolve(parent, path.basename(absolute))), Effect2.orElseSucceed(() => absolute))));
|
|
690
|
+
});
|
|
698
691
|
var runtimeDatabaseLayer2 = (options) => {
|
|
699
692
|
if (options.filename.length === 0) {
|
|
700
|
-
return Object.assign(Layer.effectContext(Effect2.fail(
|
|
693
|
+
return Object.assign(Layer.effectContext(Effect2.fail(RuntimeConfigurationError.make({
|
|
701
694
|
setting: "filename",
|
|
702
695
|
nextAction: "provide-setting",
|
|
703
696
|
cause: { _tag: "ConfigFailure", reason: "SQLite Runtime requires a non-empty filename" }
|
|
704
697
|
}))), { [DatabaseDialect]: "sqlite" });
|
|
705
698
|
}
|
|
706
|
-
const
|
|
699
|
+
const resolvedFilename = options.filename === ":memory:" ? Effect2.succeed(options.filename) : Effect2.scoped(Layer.build(bunServicesLayer).pipe(Effect2.flatMap((context) => Effect2.provide(canonicalFilename(options.filename), context))));
|
|
700
|
+
const database = Layer.unwrap(resolvedFilename.pipe(Effect2.map((filename) => makeSqliteDatabaseLayer(options, filename))));
|
|
701
|
+
return Object.assign(database, { [DatabaseDialect]: "sqlite" });
|
|
702
|
+
};
|
|
703
|
+
var makeSqliteDatabaseLayer = (options, filename) => {
|
|
707
704
|
const identity = options.filename === ":memory:" ? `sqlite:memory:${memoryIdentity++}` : `sqlite:file:${filename}`;
|
|
708
705
|
const databaseIdentity = makeDatabaseIdentity(identity);
|
|
709
706
|
const acquireSchema = Effect2.gen(function* () {
|
|
@@ -713,11 +710,11 @@ var runtimeDatabaseLayer2 = (options) => {
|
|
|
713
710
|
const actual = rows.map((row) => `${row.migration_id}:${row.name}`).join(",");
|
|
714
711
|
const expected = migrations.map((migration) => `${migration.id}:${migration.name}`).join(",");
|
|
715
712
|
if (actual !== expected) {
|
|
716
|
-
return yield*
|
|
713
|
+
return yield* RuntimeMigrationError.make({
|
|
717
714
|
dialect: "sqlite",
|
|
718
715
|
phase: "verify",
|
|
719
716
|
nextAction: "run-compatible-release",
|
|
720
|
-
cause:
|
|
717
|
+
cause: SchemaHeadMismatch.make({ expected, actual })
|
|
721
718
|
});
|
|
722
719
|
}
|
|
723
720
|
});
|
|
@@ -731,18 +728,18 @@ var runtimeDatabaseLayer2 = (options) => {
|
|
|
731
728
|
});
|
|
732
729
|
const ownership = Layer.effectDiscard(Effect2.acquireRelease(Effect2.suspend(() => {
|
|
733
730
|
if (ownedDatabases.has(identity)) {
|
|
734
|
-
return Effect2.fail(
|
|
731
|
+
return Effect2.fail(RuntimeTopologyError.make({
|
|
735
732
|
dialect: "sqlite",
|
|
736
733
|
role: "embedded",
|
|
737
734
|
nextAction: "reuse-runtime",
|
|
738
|
-
cause:
|
|
735
|
+
cause: DatabaseAlreadyOwned.make({ databaseIdentity })
|
|
739
736
|
}));
|
|
740
737
|
}
|
|
741
738
|
ownedDatabases.add(identity);
|
|
742
739
|
return Effect2.void;
|
|
743
740
|
}), () => Effect2.sync(() => ownedDatabases.delete(identity))));
|
|
744
741
|
const ownedDatabase = database.pipe(Layer.provideMerge(ownership));
|
|
745
|
-
return
|
|
742
|
+
return ownedDatabase;
|
|
746
743
|
};
|
|
747
744
|
var migrationOptions = {
|
|
748
745
|
loader,
|
|
@@ -757,18 +754,18 @@ var layer = (options) => {
|
|
|
757
754
|
return sql;
|
|
758
755
|
})).pipe(Layer.provide(client));
|
|
759
756
|
};
|
|
760
|
-
var workflowLayer = (options, handlersLayer) => {
|
|
757
|
+
var workflowLayer = Function.dual(2, (options, handlersLayer) => {
|
|
761
758
|
const sqlite = layer(options);
|
|
762
759
|
const repository = exports_workflow_definition_repository.layer.pipe(Layer.provideMerge(sqlite));
|
|
763
760
|
return exports_definition_runtime.layer.pipe(Layer.provideMerge(handlersLayer), Layer.provideMerge(repository));
|
|
764
|
-
};
|
|
765
|
-
var childFanOutLayer = (options, handlersLayer) => {
|
|
761
|
+
});
|
|
762
|
+
var childFanOutLayer = Function.dual(2, (options, handlersLayer) => {
|
|
766
763
|
const sqlite = layer(options);
|
|
767
764
|
const repository = exports_child_fan_out_repository.layer.pipe(Layer.provideMerge(sqlite));
|
|
768
765
|
const events = exports_event_log_service.layerFromRepository.pipe(Layer.provide(exports_execution_event_repository.layer.pipe(Layer.provide(exports_notification_bus.inProcessLayer))), Layer.provideMerge(sqlite));
|
|
769
766
|
const transitions = exports_child_fan_out_transition_service.layer.pipe(Layer.provide(repository), Layer.provide(events));
|
|
770
767
|
return exports_child_fan_out_runtime.layer.pipe(Layer.provide(handlersLayer), Layer.provide(repository), Layer.provide(transitions));
|
|
771
|
-
};
|
|
768
|
+
});
|
|
772
769
|
|
|
773
770
|
// src/sqlite.ts
|
|
774
771
|
var relaySqlitePackage = "@relayfx/sdk/sqlite";
|
|
@@ -3,7 +3,7 @@ import { OpenAiClient as OpenAiCompatibleClient, OpenAiEmbeddingModel as OpenAiC
|
|
|
3
3
|
import { EmbeddingModelService } from "../../runtime/index";
|
|
4
4
|
export interface OpenAiEmbeddingInput {
|
|
5
5
|
readonly model: OpenAiEmbeddingModel.Model | (string & {});
|
|
6
|
-
readonly dimensions
|
|
6
|
+
readonly dimensions: number;
|
|
7
7
|
readonly config?: Omit<typeof OpenAiEmbeddingModel.Config.Service, "model" | "dimensions"> | undefined;
|
|
8
8
|
readonly registrationKey?: string | undefined;
|
|
9
9
|
readonly provider?: string | undefined;
|
|
@@ -11,7 +11,7 @@ export interface OpenAiEmbeddingInput {
|
|
|
11
11
|
}
|
|
12
12
|
export interface OpenAiCompatibleEmbeddingInput {
|
|
13
13
|
readonly model: string;
|
|
14
|
-
readonly dimensions
|
|
14
|
+
readonly dimensions: number;
|
|
15
15
|
readonly config?: Omit<typeof OpenAiCompatibleEmbeddingModel.Config.Service, "model" | "dimensions"> | undefined;
|
|
16
16
|
readonly registrationKey?: string | undefined;
|
|
17
17
|
readonly provider?: string | undefined;
|
|
@@ -7,7 +7,7 @@ export interface Interface {
|
|
|
7
7
|
readonly release: (input: ReleaseEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyReleased, ClientError>;
|
|
8
8
|
readonly submitInbound: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, WaitKindMismatch | ClientError>;
|
|
9
9
|
}
|
|
10
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/
|
|
10
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/adapter-outbox/Service", Interface>;
|
|
11
11
|
export declare class Service extends Service_base {
|
|
12
12
|
}
|
|
13
13
|
export declare const layer: Layer.Layer<Service, never, ClientService>;
|
|
@@ -112,14 +112,14 @@ export interface Interface {
|
|
|
112
112
|
readonly registerAgent: (input: RegisterAgentInput) => Effect.Effect<Agent.DefinitionRegistered, ClientError>;
|
|
113
113
|
readonly registerAgentDefinition: (input: Agent.RegisterDefinitionPayload) => Effect.Effect<Agent.DefinitionRegistered, ClientError>;
|
|
114
114
|
readonly getAgentDefinition: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRecord | undefined, ClientError>;
|
|
115
|
-
readonly listAgentDefinitions: () => Effect.Effect<Agent.DefinitionList, ClientError>;
|
|
115
|
+
readonly listAgentDefinitions: (_?: void) => Effect.Effect<Agent.DefinitionList, ClientError>;
|
|
116
116
|
readonly listAgentDefinitionRevisions: (id: Ids.AgentId) => Effect.Effect<Agent.DefinitionRevisionList, ClientError>;
|
|
117
117
|
readonly getSkillDefinition: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRecord | undefined, ClientError>;
|
|
118
|
-
readonly listSkillDefinitions: () => Effect.Effect<Skill.DefinitionList, ClientError>;
|
|
118
|
+
readonly listSkillDefinitions: (_?: void) => Effect.Effect<Skill.DefinitionList, ClientError>;
|
|
119
119
|
readonly listSkillDefinitionRevisions: (id: Ids.SkillDefinitionId) => Effect.Effect<Skill.DefinitionRevisionList, ClientError>;
|
|
120
120
|
readonly registerAddressBookRoute: (input: Address.RegisterRoutePayload) => Effect.Effect<Address.RouteRegistered, EntityNamespaceReserved | ClientError>;
|
|
121
121
|
readonly getAddressBookRoute: (id: Ids.AddressId) => Effect.Effect<Address.RouteRecord | undefined, ClientError>;
|
|
122
|
-
readonly listAddressBookRoutes: () => Effect.Effect<Address.RouteList, ClientError>;
|
|
122
|
+
readonly listAddressBookRoutes: (_?: void) => Effect.Effect<Address.RouteList, ClientError>;
|
|
123
123
|
readonly startExecution: (input: StartExecutionInput) => Effect.Effect<StartExecutionResult, EntityNamespaceReserved | ClientError>;
|
|
124
124
|
readonly startExecutionByAddress: (input: StartExecutionByAddressInput) => Effect.Effect<StartExecutionResult, EntityNamespaceReserved | ClientError>;
|
|
125
125
|
readonly startExecutionByAgentDefinition: (input: StartExecutionByAgentDefinitionInput) => Effect.Effect<StartExecutionResult, EntityNamespaceReserved | ClientError>;
|
|
@@ -137,7 +137,7 @@ export interface Interface {
|
|
|
137
137
|
readonly getSession: (input: GetSessionInput) => Effect.Effect<GetSessionResult, ClientError>;
|
|
138
138
|
readonly listWaits: (input: ListWaitsInput) => Effect.Effect<ReadonlyArray<WaitView>, ClientError>;
|
|
139
139
|
readonly replayExecution: (input: ReplayExecutionInput) => Effect.Effect<ReplayExecutionResult, ClientError>;
|
|
140
|
-
readonly listRunners: () => Effect.Effect<ListRunnersResult, ClientError>;
|
|
140
|
+
readonly listRunners: (_?: void) => Effect.Effect<ListRunnersResult, ClientError>;
|
|
141
141
|
readonly routeExecution: (executionId: Ids.ExecutionId) => Effect.Effect<RouteExecutionResult, ClientError>;
|
|
142
142
|
readonly send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError>;
|
|
143
143
|
readonly askEntity: <Name extends string, I extends Schema.Top, O extends Schema.Top>(input: AskEntityInput<Name, I, O>) => Effect.Effect<O["Type"], CommandTimedOut | CommandReplyInvalid | EntityNotFound | ClientError, I["EncodingServices"] | O["DecodingServices"]>;
|
|
@@ -174,7 +174,7 @@ export interface Interface {
|
|
|
174
174
|
readonly cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError>;
|
|
175
175
|
readonly listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError>;
|
|
176
176
|
}
|
|
177
|
-
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/
|
|
177
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/client/Service", Interface>;
|
|
178
178
|
export declare class Service extends Service_base {
|
|
179
179
|
}
|
|
180
180
|
export interface FollowExecutionDependencies {
|
|
@@ -222,7 +222,7 @@ export declare const listTopicSubscriptions: (input: ListTopicSubscriptionsInput
|
|
|
222
222
|
export declare const listInboxMessages: (input: ListInboxMessagesInput) => Effect.Effect<readonly Inbox.Message[], ClientError, Service>;
|
|
223
223
|
export declare const inspectExecution: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<ExecutionInspection, ClientError | ExecutionNotFound, Service>;
|
|
224
224
|
export declare const send: (input: Envelope.SendInput) => Effect.Effect<Envelope.EnvelopeAccepted, ClientError, Service>;
|
|
225
|
-
export declare const streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent,
|
|
225
|
+
export declare const streamExecution: (input: StreamExecutionInput) => Stream.Stream<Execution.ExecutionEvent, ClientError | EventLogCursorNotFound, Service>;
|
|
226
226
|
export declare const followExecution: (input: FollowExecutionInput) => Stream.Stream<Schema.Struct.ReadonlySide<{
|
|
227
227
|
readonly _tag: Schema.tag<"event">;
|
|
228
228
|
readonly event: Schema.Struct<{
|
|
@@ -321,7 +321,7 @@ export declare const followExecution: (input: FollowExecutionInput) => Stream.St
|
|
|
321
321
|
}>;
|
|
322
322
|
}>]>;
|
|
323
323
|
readonly cursor: Schema.NullOr<Schema.String>;
|
|
324
|
-
}, "Type">,
|
|
324
|
+
}, "Type">, ClientError | EventLogCursorNotFound, Service>;
|
|
325
325
|
export declare const streamSession: (input: StreamSessionInput) => Stream.Stream<Schema.Struct.ReadonlySide<{
|
|
326
326
|
readonly _tag: Schema.tag<"execution_joined">;
|
|
327
327
|
readonly execution: Schema.Struct<{
|
|
@@ -410,24 +410,8 @@ export declare const streamSession: (input: StreamSessionInput) => Stream.Stream
|
|
|
410
410
|
readonly data: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
411
411
|
readonly created_at: Schema.Int;
|
|
412
412
|
}>;
|
|
413
|
-
}, "Type">,
|
|
414
|
-
export declare const watchExecutions: (input: WatchExecutionsInput) => Stream.Stream<{
|
|
415
|
-
readonly records: readonly {
|
|
416
|
-
readonly metadata: {
|
|
417
|
-
readonly [x: string]: Schema.Json;
|
|
418
|
-
};
|
|
419
|
-
readonly kind: "user-agent" | "agent-agent";
|
|
420
|
-
readonly created_at: number;
|
|
421
|
-
readonly updated_at: number;
|
|
422
|
-
readonly root_address_id: string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
423
|
-
readonly status: "waiting" | "running" | "completed" | "failed" | "queued" | "cancelled";
|
|
424
|
-
readonly execution_id: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
425
|
-
readonly session_id?: string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
426
|
-
readonly agent_id?: string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
427
|
-
}[];
|
|
428
|
-
readonly _tag: "snapshot";
|
|
429
|
-
readonly next_cursor?: string;
|
|
430
|
-
} | Schema.Struct.ReadonlySide<{
|
|
413
|
+
}, "Type">, ClientError | EventLogCursorNotFound, Service>;
|
|
414
|
+
export declare const watchExecutions: (input: WatchExecutionsInput) => Stream.Stream<Schema.Struct.ReadonlySide<{
|
|
431
415
|
readonly _tag: Schema.tag<"upsert">;
|
|
432
416
|
readonly record: Schema.Struct<{
|
|
433
417
|
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
@@ -448,7 +432,23 @@ export declare const watchExecutions: (input: WatchExecutionsInput) => Stream.St
|
|
|
448
432
|
readonly created_at: Schema.Int;
|
|
449
433
|
readonly updated_at: Schema.Int;
|
|
450
434
|
}>;
|
|
451
|
-
}, "Type"
|
|
435
|
+
}, "Type"> | {
|
|
436
|
+
readonly _tag: "snapshot";
|
|
437
|
+
readonly records: readonly {
|
|
438
|
+
readonly execution_id: string & import("effect/Brand").Brand<"Relay.ExecutionId">;
|
|
439
|
+
readonly root_address_id: string & import("effect/Brand").Brand<"Relay.AddressId">;
|
|
440
|
+
readonly session_id?: string & import("effect/Brand").Brand<"Relay.SessionId">;
|
|
441
|
+
readonly status: "cancelled" | "completed" | "failed" | "queued" | "running" | "waiting";
|
|
442
|
+
readonly kind: "agent-agent" | "user-agent";
|
|
443
|
+
readonly agent_id?: string & import("effect/Brand").Brand<"Relay.AgentId">;
|
|
444
|
+
readonly metadata: {
|
|
445
|
+
readonly [x: string]: Schema.Json;
|
|
446
|
+
};
|
|
447
|
+
readonly created_at: number;
|
|
448
|
+
readonly updated_at: number;
|
|
449
|
+
}[];
|
|
450
|
+
readonly next_cursor?: string;
|
|
451
|
+
}, ClientError, Service>;
|
|
452
452
|
export declare const getPresence: (scope: Presence.Scope) => Effect.Effect<Presence.View, ClientError, Service>;
|
|
453
453
|
export declare const watchPresence: (scope: Presence.Scope) => Stream.Stream<Presence.View, ClientError, Service>;
|
|
454
454
|
export declare const wake: (input: WakeInput) => Effect.Effect<WakeAccepted, ClientError | WaitKindMismatch, Service>;
|
|
@@ -463,7 +463,7 @@ export declare const releaseToolWork: (input: ReleaseToolWorkInput) => Effect.Ef
|
|
|
463
463
|
export declare const listToolAttempts: (input: ListToolAttemptsInput) => Effect.Effect<ToolAttemptList, ClientError, Service>;
|
|
464
464
|
export declare const submitInboundEnvelope: (input: SubmitInboundEnvelopeInput) => Effect.Effect<SubmitInboundEnvelopeAccepted, ClientError | WaitKindMismatch, Service>;
|
|
465
465
|
export declare const spawnChildRun: (input: SpawnChildRunInput) => Effect.Effect<Execution.ChildRunAccepted, ClientError, Service>;
|
|
466
|
-
export declare const createChildFanOut: (input: CreateChildFanOutInput) => Effect.Effect<ChildOrchestration.FanOutState,
|
|
466
|
+
export declare const createChildFanOut: (input: CreateChildFanOutInput) => Effect.Effect<ChildOrchestration.FanOutState, ClientError | RuntimeCapabilityUnavailable, Service>;
|
|
467
467
|
export declare const cancelChildFanOut: (input: CancelChildFanOutInput) => Effect.Effect<CancelChildFanOutResult, ClientError, Service>;
|
|
468
468
|
export declare const inspectChildFanOut: (input: InspectChildFanOutInput) => Effect.Effect<InspectChildFanOutResult, ClientError, Service>;
|
|
469
469
|
export declare const claimEnvelopeReady: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError, Service>;
|
|
@@ -472,5 +472,5 @@ export declare const releaseEnvelopeReady: (input: ReleaseEnvelopeReadyInput) =>
|
|
|
472
472
|
export declare const createSchedule: (input: CreateScheduleInput) => Effect.Effect<CreateScheduleResult, ClientError, Service>;
|
|
473
473
|
export declare const cancelSchedule: (input: CancelScheduleInput) => Effect.Effect<CancelScheduleResult, ClientError, Service>;
|
|
474
474
|
export declare const listSchedules: (input: ListSchedulesInput) => Effect.Effect<ListSchedulesResult, ClientError, Service>;
|
|
475
|
-
export declare const askEntity: <Name extends string, I extends Schema.Top, O extends Schema.Top>(input: AskEntityInput<Name, I, O>) => Effect.Effect<O["Type"],
|
|
475
|
+
export declare const askEntity: <Name extends string, I extends Schema.Top, O extends Schema.Top>(input: AskEntityInput<Name, I, O>) => Effect.Effect<O["Type"], ClientError | CommandReplyInvalid | CommandTimedOut | EntityNotFound, Service | I["EncodingServices"] | O["DecodingServices"]>;
|
|
476
476
|
export declare const awaitWait: (input: AwaitWaitInput) => Effect.Effect<WaitOutcome, ClientError, Service>;
|
|
@@ -4,10 +4,16 @@ export interface Command<Name extends string, Input extends Schema.Top, Output e
|
|
|
4
4
|
readonly input: Input;
|
|
5
5
|
readonly output: Output;
|
|
6
6
|
}
|
|
7
|
-
export declare const make:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export declare const make: {
|
|
8
|
+
<Input extends Schema.Top, Output extends Schema.Top>(options: {
|
|
9
|
+
readonly input: Input;
|
|
10
|
+
readonly output: Output;
|
|
11
|
+
}): <Name extends string>(name: Name) => Command<Name, Input, Output>;
|
|
12
|
+
<Name extends string, Input extends Schema.Top, Output extends Schema.Top>(name: Name, options: {
|
|
13
|
+
readonly input: Input;
|
|
14
|
+
readonly output: Output;
|
|
15
|
+
}): Command<Name, Input, Output>;
|
|
16
|
+
};
|
|
11
17
|
export declare const inputSchemaRef: (name: string) => string;
|
|
12
18
|
export declare const outputSchemaRef: (name: string) => string;
|
|
13
19
|
declare const CommandTimedOut_base: Schema.Class<CommandTimedOut, Schema.TaggedStruct<"CommandTimedOut", {
|
|
@@ -3,14 +3,14 @@ import type { Context, Effect } from "effect";
|
|
|
3
3
|
export type Drizzle = Context.Service.Shape<typeof Database.Service>;
|
|
4
4
|
export type PgTimestamp = Parameters<typeof Database.fromPgDate>[0];
|
|
5
5
|
export type DatabaseError = Effect.Error<ReturnType<typeof Database.check>>;
|
|
6
|
-
export type Dialect =
|
|
6
|
+
export type Dialect = Database.Dialect;
|
|
7
7
|
export declare const Service: typeof Database.Service;
|
|
8
|
-
export declare const PgClientLive: import("effect/Layer").Layer<import("effect/
|
|
8
|
+
export declare const PgClientLive: import("effect/Layer").Layer<import("@effect/sql-pg/PgClient").PgClient | import("effect/unstable/sql/SqlClient").SqlClient, import("effect/Config").ConfigError | import("effect/unstable/sql/SqlError").SqlError, never>;
|
|
9
9
|
export declare const layerFromPgClient: import("effect/Layer").Layer<Database.Service, never, import("@effect/sql-pg/PgClient").PgClient>;
|
|
10
|
-
export declare const testLayer:
|
|
10
|
+
export declare const testLayer: typeof Database.testLayer;
|
|
11
11
|
export declare const check: () => Effect.Effect<void, import("drizzle-orm/effect-core").EffectDrizzleQueryError, Database.Service>;
|
|
12
12
|
export declare const pgTypeParsers: {
|
|
13
13
|
getTypeParser: (typeId: number, format?: "text" | "binary") => any;
|
|
14
14
|
};
|
|
15
15
|
export declare const Dialect: import("effect/Schema").Literals<readonly ["pg", "mysql", "sqlite"]>;
|
|
16
|
-
export declare const dialect: Effect.Effect<"
|
|
16
|
+
export declare const dialect: Effect.Effect<"mysql" | "pg" | "sqlite", never, import("effect/unstable/sql/SqlClient").SqlClient>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { RuntimeMigrationError, type Dialect } from "./runtime";
|
|
3
|
-
export declare const migrationFailure:
|
|
4
|
-
|
|
3
|
+
export declare const migrationFailure: {
|
|
4
|
+
(phase: "apply" | "verify", cause: unknown): (dialect: Dialect) => RuntimeMigrationError;
|
|
5
|
+
(dialect: Dialect, phase: "apply" | "verify", cause: unknown): RuntimeMigrationError;
|
|
6
|
+
};
|
|
7
|
+
export declare const normalizeMigrationCause: {
|
|
8
|
+
(dialect: Dialect, phase: "apply" | "verify"): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, RuntimeMigrationError, R>;
|
|
9
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, dialect: Dialect, phase: "apply" | "verify"): Effect.Effect<A, RuntimeMigrationError, R>;
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Effect,
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
2
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
3
|
-
import type
|
|
3
|
+
import { RuntimeMigrationError, type DatabaseIdentity, type DatabaseLayer, type RuntimeConfigurationError } from "./runtime";
|
|
4
4
|
export interface MySQLRuntimeDatabaseOptions<E, R> {
|
|
5
5
|
readonly clientLayer: Layer.Layer<SqlClient, E, R>;
|
|
6
6
|
readonly databaseIdentity: DatabaseIdentity;
|