@relayfx/sdk 0.2.12 → 0.2.14
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-15f2ewt8.js +69 -0
- package/dist/{index-33d4k6kk.js → index-9q3yh32k.js} +617 -526
- package/dist/{index-236a3f4t.js → index-gb7d1wfm.js} +745 -397
- package/dist/{index-aph699jp.js → index-qg0hy7s1.js} +1 -1
- 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/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/child/child-fan-out-runtime.d.ts +2 -0
- package/dist/types/runtime/child/spawn-child-run-tool.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/schema/execution-schema.d.ts +2 -0
- package/dist/types/store-sql/workflow/workflow-definition-repository.d.ts +6 -2
- package/package.json +11 -2
package/dist/ai.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./index-
|
|
2
|
+
import"./index-qg0hy7s1.js";
|
|
3
3
|
import {
|
|
4
4
|
AiError,
|
|
5
5
|
Chat,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
exports_tool_executor,
|
|
35
35
|
exports_tool_output,
|
|
36
36
|
exports_turn_policy
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-9q3yh32k.js";
|
|
38
38
|
|
|
39
39
|
// src/ai.ts
|
|
40
40
|
var relayAiPackage = "@relayfx/sdk/ai";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ConfigFailure,
|
|
4
|
+
DatabaseDialect,
|
|
5
|
+
MigratorError,
|
|
6
|
+
RuntimeConfigurationError,
|
|
7
|
+
RuntimeMigrationError,
|
|
8
|
+
SqlFailure,
|
|
9
|
+
exports_runtime_database
|
|
10
|
+
} from "./index-gb7d1wfm.js";
|
|
11
|
+
|
|
12
|
+
// src/migration-errors.ts
|
|
13
|
+
import { Cause, Effect } from "effect";
|
|
14
|
+
var retain = (value, cause) => {
|
|
15
|
+
Object.defineProperty(value, "originalCause", { value: cause, enumerable: false });
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
var migrationFailure = (dialect, phase, cause) => retain(new RuntimeMigrationError({
|
|
19
|
+
dialect,
|
|
20
|
+
phase,
|
|
21
|
+
nextAction: phase === "apply" ? "retry" : "inspect-schema",
|
|
22
|
+
cause: retain(phase === "apply" ? new MigratorError({ reason: `packaged ${dialect} migration failed` }) : new SqlFailure({ category: "statement", operation: "verify", retryable: false }), cause)
|
|
23
|
+
}), cause);
|
|
24
|
+
var normalizeMigrationCause = (effect, dialect, phase) => effect.pipe(Effect.catchCause((cause) => Cause.hasInterrupts(cause) ? Effect.failCause(cause) : Effect.fail(migrationFailure(dialect, phase, cause))));
|
|
25
|
+
|
|
26
|
+
// src/runtime-database-adapter.ts
|
|
27
|
+
import { Cause as Cause2, Effect as Effect2, Layer } from "effect";
|
|
28
|
+
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
29
|
+
var configurationFailure = (cause) => {
|
|
30
|
+
const configFailure = new ConfigFailure({ reason: "database client layer acquisition failed" });
|
|
31
|
+
Object.defineProperty(configFailure, "originalCause", { value: cause, enumerable: false });
|
|
32
|
+
return new RuntimeConfigurationError({
|
|
33
|
+
setting: "databaseLayer",
|
|
34
|
+
nextAction: "provide-setting",
|
|
35
|
+
cause: configFailure
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var normalizeClientLayer = (clientLayer) => clientLayer.pipe(Layer.catchCause((cause) => {
|
|
39
|
+
if (Cause2.hasInterrupts(cause)) {
|
|
40
|
+
return Layer.unwrap(Effect2.failCause(Cause2.map(cause, configurationFailure)));
|
|
41
|
+
}
|
|
42
|
+
return Layer.unwrap(Effect2.fail(configurationFailure(Cause2.squash(cause))));
|
|
43
|
+
}));
|
|
44
|
+
var runtimeDatabaseLayer = (options) => {
|
|
45
|
+
const normalizedClientLayer = normalizeClientLayer(options.clientLayer);
|
|
46
|
+
const databaseLayer = Layer.effect(exports_runtime_database.Service, Effect2.gen(function* () {
|
|
47
|
+
const sql = yield* SqlClient;
|
|
48
|
+
const database = options.dialect === "sqlite" ? exports_runtime_database.Service.of({
|
|
49
|
+
dialect: "sqlite",
|
|
50
|
+
databaseIdentity: options.databaseIdentity,
|
|
51
|
+
ownership: "runtime-exclusive",
|
|
52
|
+
schemaHead: options.schemaHead,
|
|
53
|
+
notification: "in-process",
|
|
54
|
+
acquireSchema: options.schema.pipe(Effect2.provideService(SqlClient, sql))
|
|
55
|
+
}) : exports_runtime_database.Service.of({
|
|
56
|
+
dialect: options.dialect,
|
|
57
|
+
databaseIdentity: options.databaseIdentity,
|
|
58
|
+
ownership: "shared-multi-node",
|
|
59
|
+
schemaHead: options.schemaHead,
|
|
60
|
+
notification: options.dialect === "pg" ? "pg-listen-notify" : "polling",
|
|
61
|
+
verifySchema: options.schema.pipe(Effect2.provideService(SqlClient, sql))
|
|
62
|
+
});
|
|
63
|
+
return database;
|
|
64
|
+
})).pipe(Layer.provide(normalizedClientLayer));
|
|
65
|
+
const layer = Layer.merge(normalizedClientLayer, databaseLayer);
|
|
66
|
+
return Object.assign(layer, { [DatabaseDialect]: options.dialect });
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { normalizeMigrationCause, normalizeClientLayer, runtimeDatabaseLayer };
|