@relayfx/sdk 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +67 -37
- package/dist/http-server.js +22 -0
- package/dist/{index-c2skef55.js → index-70m3hgk1.js} +16521 -18783
- package/dist/index-bknsjvwf.js +3423 -0
- package/dist/index-cphmds30.js +2852 -0
- package/dist/index-nb39b5ae.js +17 -0
- package/dist/{index-3sv8mmz5.js → index-szzswx0z.js} +23 -30
- package/dist/index.js +315 -844
- package/dist/mysql.js +18 -18
- package/dist/postgres.js +724 -24
- package/dist/sqlite.js +57 -168
- package/dist/types/ai/index.d.ts +2 -1
- package/dist/types/ai/language-model/language-model-registration.d.ts +9 -6
- package/dist/types/relay/adapter-outbox.d.ts +1 -1
- package/dist/types/relay/ai.d.ts +34 -2
- package/dist/types/relay/child-fan-out-admission.d.ts +5 -0
- package/dist/types/relay/child-fan-out-host.d.ts +73 -0
- package/dist/types/relay/client-public.d.ts +481 -0
- package/dist/types/relay/client.d.ts +1 -478
- package/dist/types/relay/database-identity.d.ts +4 -0
- package/dist/types/relay/http-server.d.ts +95 -0
- package/dist/types/relay/index.d.ts +37 -14
- package/dist/types/relay/internal-client.d.ts +22 -0
- package/dist/types/relay/language-model-registration.d.ts +13 -0
- package/dist/types/relay/mysql.d.ts +6 -7
- package/dist/types/relay/operation.d.ts +4 -4
- package/dist/types/relay/postgres.d.ts +10 -7
- package/dist/types/relay/runtime-acquisition-error.d.ts +61 -0
- package/dist/types/relay/runtime-database-adapter.d.ts +8 -5
- package/dist/types/relay/runtime-database-owner.d.ts +13 -0
- package/dist/types/relay/runtime-database-public.d.ts +10 -0
- package/dist/types/relay/runtime.d.ts +77 -72
- package/dist/types/relay/sqlite-runtime.d.ts +5 -18
- package/dist/types/relay/sqlite.d.ts +4 -31
- package/dist/types/relay/state-version-conflict.d.ts +12 -0
- package/dist/types/relay/tool-runtime.d.ts +44 -0
- package/dist/types/relay/tool-worker.d.ts +2 -2
- package/dist/types/relay/workflow-definition-host.d.ts +32 -0
- package/dist/types/runtime/agent/agent-loop-error.d.ts +21 -0
- package/dist/types/runtime/agent/agent-loop-service.d.ts +6 -16
- package/dist/types/runtime/agent/prompt-assembler-service.d.ts +3 -3
- package/dist/types/runtime/cluster/execution-entity.d.ts +3 -3
- package/dist/types/runtime/execution/execution-service.d.ts +3 -0
- package/dist/types/runtime/index.d.ts +1 -0
- package/dist/types/runtime/model/language-model-service.d.ts +5 -12
- package/dist/types/runtime/model/model-hub.d.ts +27 -0
- package/dist/types/runtime/presence/presence-contract.d.ts +24 -0
- package/dist/types/runtime/presence/presence-service.d.ts +6 -24
- package/dist/types/runtime/runner/runner-runtime-service.d.ts +29 -13
- package/dist/types/runtime/session/session-store-service.d.ts +4 -1
- package/dist/types/runtime/tool/tool-runtime-contract.d.ts +121 -0
- package/dist/types/runtime/tool/tool-runtime-service.d.ts +6 -120
- package/dist/types/runtime/workflow/execution-workflow.d.ts +22 -24
- package/dist/types/schema/agent-schema.d.ts +4 -1
- package/dist/types/schema/execution-schema.d.ts +13 -2
- package/dist/types/schema/index.d.ts +1 -0
- package/dist/types/schema/pagination-schema.d.ts +17 -0
- package/dist/types/schema/shared-schema.d.ts +4 -0
- package/dist/types/store-sql/schema/relay-schema.d.ts +12 -12
- package/dist/types/store-sql/session/session-repository.d.ts +54 -11
- package/package.json +17 -14
- package/dist/index-9k4k3wq1.js +0 -2860
- package/dist/index-d3dme13d.js +0 -141
- package/dist/types/relay/database.d.ts +0 -16
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __returnValue = (v) => v;
|
|
4
|
+
function __exportSetter(name, newValue) {
|
|
5
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
6
|
+
}
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
set: __exportSetter.bind(all, name)
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { __export };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
ConfigFailure,
|
|
4
|
-
DatabaseDialect,
|
|
5
3
|
MigratorError,
|
|
6
4
|
RuntimeConfigurationError,
|
|
7
5
|
RuntimeMigrationError,
|
|
6
|
+
RuntimeTopologyError,
|
|
7
|
+
Service,
|
|
8
8
|
SqlFailure,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
make,
|
|
10
|
+
normalizeAcquisitionCause
|
|
11
|
+
} from "./index-70m3hgk1.js";
|
|
11
12
|
|
|
12
13
|
// src/migration-errors.ts
|
|
13
14
|
import { Cause, Effect, Function } from "effect";
|
|
@@ -24,46 +25,38 @@ var migrationFailure = Function.dual(3, (dialect, phase, cause) => retain(Runtim
|
|
|
24
25
|
var normalizeMigrationCause = Function.dual(3, (effect, dialect, phase) => effect.pipe(Effect.catchCause((cause) => Cause.hasInterrupts(cause) ? Effect.interrupt : Effect.fail(migrationFailure(dialect, phase, cause)))));
|
|
25
26
|
|
|
26
27
|
// src/runtime-database-adapter.ts
|
|
27
|
-
import {
|
|
28
|
+
import { Effect as Effect2, Layer, Schema } from "effect";
|
|
28
29
|
import { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
Object.defineProperty(configFailure, "originalCause", { value: cause, enumerable: false });
|
|
32
|
-
return RuntimeConfigurationError.make({
|
|
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) => {
|
|
30
|
+
var normalizeClientLayer = (clientLayer) => clientLayer.pipe(Layer.catchCause((cause) => Layer.unwrap(Effect2.failCause(normalizeAcquisitionCause(cause, "database-client", (error) => Schema.is(RuntimeConfigurationError)(error) || Schema.is(RuntimeTopologyError)(error) || Schema.is(RuntimeMigrationError)(error))))));
|
|
31
|
+
var database = (options) => {
|
|
45
32
|
const normalizedClientLayer = normalizeClientLayer(options.clientLayer);
|
|
46
|
-
const databaseLayer = Layer.effect(
|
|
33
|
+
const databaseLayer = Layer.effect(Service, Effect2.gen(function* () {
|
|
47
34
|
const sql = yield* SqlClient;
|
|
48
|
-
const
|
|
35
|
+
const runtimeDatabase = options.dialect === "sqlite" ? Service.of({
|
|
49
36
|
dialect: "sqlite",
|
|
50
37
|
databaseIdentity: options.databaseIdentity,
|
|
51
38
|
ownership: "runtime-exclusive",
|
|
52
39
|
schemaHead: options.schemaHead,
|
|
53
40
|
notification: "in-process",
|
|
54
|
-
acquireSchema: options.
|
|
55
|
-
}) :
|
|
41
|
+
acquireSchema: options.acquire.pipe(Effect2.provideService(SqlClient, sql))
|
|
42
|
+
}) : Service.of({
|
|
56
43
|
dialect: options.dialect,
|
|
57
44
|
databaseIdentity: options.databaseIdentity,
|
|
58
45
|
ownership: "shared-multi-node",
|
|
59
46
|
schemaHead: options.schemaHead,
|
|
60
47
|
notification: options.dialect === "pg" ? "pg-listen-notify" : "polling",
|
|
61
|
-
verifySchema: options.
|
|
48
|
+
verifySchema: options.acquire.pipe(Effect2.provideService(SqlClient, sql))
|
|
62
49
|
});
|
|
63
|
-
return
|
|
50
|
+
return runtimeDatabase;
|
|
64
51
|
})).pipe(Layer.provide(normalizedClientLayer));
|
|
65
|
-
const
|
|
66
|
-
|
|
52
|
+
const runtimeLayer = Layer.merge(normalizedClientLayer, databaseLayer);
|
|
53
|
+
const withClient = (effect) => Effect2.scoped(Layer.build(normalizedClientLayer).pipe(Effect2.flatMap((context) => Effect2.provide(effect, context))));
|
|
54
|
+
return make({
|
|
55
|
+
dialect: options.dialect,
|
|
56
|
+
runtimeLayer,
|
|
57
|
+
migrate: withClient(options.migrate),
|
|
58
|
+
verify: withClient(options.verify)
|
|
59
|
+
});
|
|
67
60
|
};
|
|
68
61
|
|
|
69
|
-
export { normalizeMigrationCause,
|
|
62
|
+
export { normalizeMigrationCause, database };
|