@relayfx/sdk 0.3.1 → 0.3.3
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-25gwk9tj.js +3423 -0
- package/dist/{index-3sv8mmz5.js → index-49fm2rdv.js} +23 -30
- package/dist/{index-c2skef55.js → index-8pa5e2yn.js} +16521 -18783
- package/dist/index-cphmds30.js +2852 -0
- package/dist/index-nb39b5ae.js +17 -0
- 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
package/dist/sqlite.js
CHANGED
|
@@ -1,80 +1,27 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./index-
|
|
3
|
+
database,
|
|
4
|
+
normalizeMigrationCause
|
|
5
|
+
} from "./index-49fm2rdv.js";
|
|
6
6
|
import {
|
|
7
7
|
DatabaseAlreadyOwned,
|
|
8
|
-
DatabaseDialect,
|
|
9
|
-
HostLayerError,
|
|
10
8
|
RuntimeConfigurationError,
|
|
11
9
|
RuntimeMigrationError,
|
|
12
10
|
RuntimeTopologyError,
|
|
13
11
|
SchemaHeadMismatch,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
exports_address_book_service,
|
|
23
|
-
exports_address_resolution_service,
|
|
24
|
-
exports_address_schema,
|
|
25
|
-
exports_agent_loop_service,
|
|
26
|
-
exports_agent_registry_service,
|
|
27
|
-
exports_agent_schema,
|
|
28
|
-
exports_artifact_store_service,
|
|
29
|
-
exports_blob_store_service,
|
|
30
|
-
exports_child_fan_out_repository,
|
|
31
|
-
exports_child_fan_out_runtime,
|
|
32
|
-
exports_child_fan_out_transition_service,
|
|
33
|
-
exports_child_run_service,
|
|
34
|
-
exports_content_schema,
|
|
35
|
-
exports_definition_runtime,
|
|
36
|
-
exports_embedding_model_service,
|
|
37
|
-
exports_entity_schema,
|
|
38
|
-
exports_envelope_schema,
|
|
39
|
-
exports_envelope_service,
|
|
40
|
-
exports_event_log_service,
|
|
41
|
-
exports_execution_entity,
|
|
42
|
-
exports_execution_event_repository,
|
|
43
|
-
exports_execution_schema,
|
|
44
|
-
exports_execution_service,
|
|
45
|
-
exports_execution_workflow,
|
|
46
|
-
exports_ids_schema,
|
|
47
|
-
exports_language_model_service,
|
|
48
|
-
exports_model_call_policy,
|
|
49
|
-
exports_notification_bus,
|
|
50
|
-
exports_prompt_assembler_service,
|
|
51
|
-
exports_runner_runtime_service,
|
|
52
|
-
exports_schedule_schema,
|
|
53
|
-
exports_scheduler_service,
|
|
54
|
-
exports_schema_registry_service,
|
|
55
|
-
exports_shared_schema,
|
|
56
|
-
exports_skill_registry_service,
|
|
57
|
-
exports_skill_schema,
|
|
58
|
-
exports_tool_runtime_service,
|
|
59
|
-
exports_tool_schema,
|
|
60
|
-
exports_wait_service,
|
|
61
|
-
exports_workflow_definition_repository,
|
|
62
|
-
exports_workflow_schema
|
|
63
|
-
} from "./index-c2skef55.js";
|
|
12
|
+
make,
|
|
13
|
+
makeDatabaseIdentity,
|
|
14
|
+
runtimeLayer
|
|
15
|
+
} from "./index-8pa5e2yn.js";
|
|
16
|
+
import"./index-25gwk9tj.js";
|
|
17
|
+
import"./index-cphmds30.js";
|
|
18
|
+
import"./index-nb39b5ae.js";
|
|
19
|
+
|
|
64
20
|
// src/sqlite-runtime.ts
|
|
65
|
-
var exports_sqlite_runtime = {};
|
|
66
|
-
__export(exports_sqlite_runtime, {
|
|
67
|
-
workflowLayer: () => workflowLayer,
|
|
68
|
-
runtimeDatabaseLayer: () => runtimeDatabaseLayer2,
|
|
69
|
-
migrationsLayer: () => migrationsLayer,
|
|
70
|
-
layer: () => layer,
|
|
71
|
-
clientLayer: () => clientLayer,
|
|
72
|
-
childFanOutLayer: () => childFanOutLayer
|
|
73
|
-
});
|
|
74
21
|
import { layer as sqliteClientLayer } from "@effect/sql-sqlite-bun/SqliteClient";
|
|
75
|
-
import {
|
|
22
|
+
import { run as runSqliteMigrator } from "@effect/sql-sqlite-bun/SqliteMigrator";
|
|
76
23
|
import { layer as bunServicesLayer } from "@effect/platform-bun/BunServices";
|
|
77
|
-
import {
|
|
24
|
+
import { Effect as Effect2, FileSystem, Layer, Path } from "effect";
|
|
78
25
|
import { SqlClient as SqlClient2 } from "effect/unstable/sql/SqlClient";
|
|
79
26
|
|
|
80
27
|
// ../../migrations/sqlite/0001_baseline.sql
|
|
@@ -689,23 +636,38 @@ var canonicalFilename = Effect2.fn("SQLite.canonicalFilename")(function* (filena
|
|
|
689
636
|
const absolute = path.resolve(filename);
|
|
690
637
|
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))));
|
|
691
638
|
});
|
|
692
|
-
var
|
|
639
|
+
var database2 = (options) => {
|
|
693
640
|
if (options.filename.length === 0) {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
cause: {
|
|
698
|
-
|
|
641
|
+
const failure = RuntimeConfigurationError.make({
|
|
642
|
+
category: "database-config",
|
|
643
|
+
scope: "database-client",
|
|
644
|
+
cause: {
|
|
645
|
+
reasons: [{ _tag: "Fail", category: "database-config", errorTag: "RuntimeHostLayerFailure" }],
|
|
646
|
+
truncated: false
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
return make({
|
|
650
|
+
dialect: "sqlite",
|
|
651
|
+
migrate: Effect2.fail(failure),
|
|
652
|
+
verify: Effect2.fail(failure),
|
|
653
|
+
runtimeLayer: Layer.unwrap(Effect2.fail(failure))
|
|
654
|
+
});
|
|
699
655
|
}
|
|
656
|
+
const memoryOwnerIdentity = options.filename === ":memory:" ? `sqlite:memory:${memoryIdentity++}` : undefined;
|
|
700
657
|
const resolvedFilename = options.filename === ":memory:" ? Effect2.succeed(options.filename) : Effect2.scoped(Layer.build(bunServicesLayer).pipe(Effect2.flatMap((context) => Effect2.provide(canonicalFilename(options.filename), context))));
|
|
701
|
-
const
|
|
702
|
-
return
|
|
658
|
+
const resolveDatabase = resolvedFilename.pipe(Effect2.map((filename) => makeSqliteDatabase(options, filename, memoryOwnerIdentity)));
|
|
659
|
+
return make({
|
|
660
|
+
dialect: "sqlite",
|
|
661
|
+
runtimeLayer: Layer.unwrap(resolveDatabase.pipe(Effect2.map(runtimeLayer))),
|
|
662
|
+
migrate: resolveDatabase.pipe(Effect2.flatMap((value) => value.migrate)),
|
|
663
|
+
verify: resolveDatabase.pipe(Effect2.flatMap((value) => value.verify))
|
|
664
|
+
});
|
|
703
665
|
};
|
|
704
|
-
var
|
|
705
|
-
const identity =
|
|
666
|
+
var makeSqliteDatabase = (options, filename, memoryOwnerIdentity) => {
|
|
667
|
+
const identity = memoryOwnerIdentity ?? `sqlite:file:${filename}`;
|
|
706
668
|
const databaseIdentity = makeDatabaseIdentity(identity);
|
|
707
|
-
const
|
|
708
|
-
|
|
669
|
+
const migrateSchema = runSqliteMigrator(migrationOptions).pipe((effect) => normalizeMigrationCause(effect, "sqlite", "apply"));
|
|
670
|
+
const verifySchema = Effect2.gen(function* () {
|
|
709
671
|
const sql = yield* SqlClient2;
|
|
710
672
|
const rows = yield* sql`SELECT migration_id, name FROM relay_migrations ORDER BY migration_id`.pipe((effect) => normalizeMigrationCause(effect, "sqlite", "verify"));
|
|
711
673
|
const actual = rows.map((row) => `${row.migration_id}:${row.name}`).join(",");
|
|
@@ -719,15 +681,17 @@ var makeSqliteDatabaseLayer = (options, filename) => {
|
|
|
719
681
|
});
|
|
720
682
|
}
|
|
721
683
|
});
|
|
722
|
-
const
|
|
684
|
+
const adapterDatabase = database({
|
|
723
685
|
dialect: "sqlite",
|
|
724
686
|
clientLayer: clientLayer({ ...options, filename }),
|
|
725
687
|
databaseIdentity,
|
|
726
688
|
ownership: "runtime-exclusive",
|
|
727
689
|
schemaHead: String(migrations.at(-1)?.id ?? 0),
|
|
728
|
-
|
|
690
|
+
acquire: migrateSchema.pipe(Effect2.andThen(verifySchema)),
|
|
691
|
+
migrate: migrateSchema.pipe(Effect2.andThen(verifySchema)),
|
|
692
|
+
verify: verifySchema
|
|
729
693
|
});
|
|
730
|
-
const
|
|
694
|
+
const claim = Effect2.suspend(() => {
|
|
731
695
|
if (ownedDatabases.has(identity)) {
|
|
732
696
|
return Effect2.fail(RuntimeTopologyError.make({
|
|
733
697
|
dialect: "sqlite",
|
|
@@ -738,99 +702,24 @@ var makeSqliteDatabaseLayer = (options, filename) => {
|
|
|
738
702
|
}
|
|
739
703
|
ownedDatabases.add(identity);
|
|
740
704
|
return Effect2.void;
|
|
741
|
-
})
|
|
742
|
-
const
|
|
743
|
-
|
|
705
|
+
});
|
|
706
|
+
const release = () => Effect2.sync(() => ownedDatabases.delete(identity));
|
|
707
|
+
const ownership = Layer.effectDiscard(Effect2.acquireRelease(claim, release));
|
|
708
|
+
const withOwnership = (operation) => Effect2.scoped(Effect2.acquireRelease(claim, release).pipe(Effect2.andThen(operation)));
|
|
709
|
+
return make({
|
|
710
|
+
dialect: "sqlite",
|
|
711
|
+
migrate: withOwnership(adapterDatabase.migrate),
|
|
712
|
+
verify: withOwnership(adapterDatabase.verify),
|
|
713
|
+
runtimeLayer: runtimeLayer(adapterDatabase).pipe(Layer.provideMerge(ownership))
|
|
714
|
+
});
|
|
744
715
|
};
|
|
745
716
|
var migrationOptions = {
|
|
746
717
|
loader,
|
|
747
718
|
table: "relay_migrations"
|
|
748
719
|
};
|
|
749
|
-
var migrationsLayer = sqliteMigratorLayer(migrationOptions);
|
|
750
|
-
var layer = (options) => {
|
|
751
|
-
const client = clientLayer(options);
|
|
752
|
-
return Layer.effect(SqlClient2, Effect2.gen(function* () {
|
|
753
|
-
const sql = yield* SqlClient2;
|
|
754
|
-
yield* runSqliteMigrator(migrationOptions);
|
|
755
|
-
return sql;
|
|
756
|
-
})).pipe(Layer.provide(client));
|
|
757
|
-
};
|
|
758
|
-
var isAcquisitionError = (error) => typeof error === "object" && error !== null && ("_tag" in error) && (error._tag === "RuntimeConfigurationError" || error._tag === "RuntimeTopologyError" || error._tag === "RuntimeMigrationError");
|
|
759
|
-
var normalizeHostError = (error) => {
|
|
760
|
-
if (isAcquisitionError(error))
|
|
761
|
-
return error;
|
|
762
|
-
const hostFailure = HostLayerError.make({
|
|
763
|
-
service: "SQLite compatibility host graph",
|
|
764
|
-
reason: "host layer acquisition failed"
|
|
765
|
-
});
|
|
766
|
-
Object.defineProperty(hostFailure, "originalCause", { value: error, enumerable: false });
|
|
767
|
-
return RuntimeConfigurationError.make({
|
|
768
|
-
setting: "host layers",
|
|
769
|
-
nextAction: "provide-host-layer",
|
|
770
|
-
cause: hostFailure
|
|
771
|
-
});
|
|
772
|
-
};
|
|
773
|
-
var normalizeHostLayer = (source) => source.pipe(Layer.catchCause((cause) => {
|
|
774
|
-
if (Cause.hasInterrupts(cause))
|
|
775
|
-
return Layer.unwrap(Effect2.failCause(Cause.map(cause, normalizeHostError)));
|
|
776
|
-
return Layer.unwrap(Effect2.fail(normalizeHostError(Cause.squash(cause))));
|
|
777
|
-
}));
|
|
778
|
-
var workflowLayer = Function.dual(2, (options, handlersLayer) => {
|
|
779
|
-
const sqlite = layer(options);
|
|
780
|
-
const repository = exports_workflow_definition_repository.layer.pipe(Layer.provideMerge(sqlite));
|
|
781
|
-
return normalizeHostLayer(exports_definition_runtime.layer.pipe(Layer.provideMerge(handlersLayer), Layer.provideMerge(repository)));
|
|
782
|
-
});
|
|
783
|
-
var childFanOutLayer = Function.dual(2, (options, handlersLayer) => {
|
|
784
|
-
const sqlite = layer(options);
|
|
785
|
-
const repository = exports_child_fan_out_repository.layer.pipe(Layer.provideMerge(sqlite));
|
|
786
|
-
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));
|
|
787
|
-
const transitions = exports_child_fan_out_transition_service.layer.pipe(Layer.provide(repository), Layer.provide(events));
|
|
788
|
-
return normalizeHostLayer(exports_child_fan_out_runtime.layer.pipe(Layer.provide(handlersLayer), Layer.provide(repository), Layer.provide(transitions)));
|
|
789
|
-
});
|
|
790
720
|
|
|
791
721
|
// src/sqlite.ts
|
|
792
|
-
var
|
|
722
|
+
var SQLite = { database: database2 };
|
|
793
723
|
export {
|
|
794
|
-
|
|
795
|
-
exports_definition_runtime as WorkflowDefinitionRuntime,
|
|
796
|
-
exports_workflow_schema as Workflow,
|
|
797
|
-
exports_wait_service as WaitService,
|
|
798
|
-
exports_tool_runtime_service as ToolRuntime,
|
|
799
|
-
exports_tool_schema as Tool,
|
|
800
|
-
exports_skill_registry_service as SkillRegistry,
|
|
801
|
-
exports_skill_schema as Skill,
|
|
802
|
-
exports_shared_schema as Shared,
|
|
803
|
-
exports_schema_registry_service as SchemaRegistry,
|
|
804
|
-
exports_scheduler_service as SchedulerService,
|
|
805
|
-
exports_schedule_schema as Schedule,
|
|
806
|
-
exports_sqlite_runtime as SQLite,
|
|
807
|
-
exports_runtime as Runtime,
|
|
808
|
-
exports_runner_runtime_service as RunnerRuntime,
|
|
809
|
-
exports_prompt_assembler_service as PromptAssembler,
|
|
810
|
-
exports_operation as Operation,
|
|
811
|
-
exports_model_call_policy as ModelCallPolicy,
|
|
812
|
-
exports_language_model_service as LanguageModelService,
|
|
813
|
-
exports_ids_schema as Ids,
|
|
814
|
-
exports_execution_workflow as ExecutionWorkflow,
|
|
815
|
-
exports_execution_service as ExecutionService,
|
|
816
|
-
exports_execution_entity as ExecutionEntity,
|
|
817
|
-
exports_execution_schema as Execution,
|
|
818
|
-
exports_event_log_service as EventLog,
|
|
819
|
-
exports_envelope_service as EnvelopeService,
|
|
820
|
-
exports_envelope_schema as Envelope,
|
|
821
|
-
exports_entity_schema as Entity,
|
|
822
|
-
exports_embedding_model_service as EmbeddingModelService,
|
|
823
|
-
exports_content_schema as Content,
|
|
824
|
-
exports_client as Client,
|
|
825
|
-
exports_child_run_service as ChildRunService,
|
|
826
|
-
exports_child_fan_out_runtime as ChildFanOutRuntime,
|
|
827
|
-
exports_blob_store_service as BlobStore,
|
|
828
|
-
exports_artifact_store_service as ArtifactStore,
|
|
829
|
-
exports_agent_registry_service as AgentRegistry,
|
|
830
|
-
exports_agent_loop_service as AgentLoop,
|
|
831
|
-
exports_agent_schema as Agent,
|
|
832
|
-
exports_address_resolution_service as AddressResolution,
|
|
833
|
-
exports_address_book_service as AddressBook,
|
|
834
|
-
exports_address_schema as Address,
|
|
835
|
-
exports_activity_version_registry as ActivityVersionRegistry
|
|
724
|
+
SQLite
|
|
836
725
|
};
|
package/dist/types/ai/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as EmbeddingModelRegistration from "./embedding-model/embedding-model-registration";
|
|
2
2
|
export * as LanguageModelRegistration from "./language-model/language-model-registration";
|
|
3
|
-
export { Agent, AgentEvent, AgentTool, AiError, Approvals, Chat, Compaction, EmbeddingModel, Guardrail, Handoff, IdGenerator, Instructions,
|
|
3
|
+
export { Agent, AgentEvent, AgentTool, AiError, Approvals, Chat, Compaction, EmbeddingModel, Guardrail, Handoff, IdGenerator, Instructions, Memory, Model, ModelMiddleware, ModelRegistry, ModelResilience, Permissions, Prompt, Response, ResponseIdTracker, Session, SkillSource, Steering, Telemetry, Tokenizer, Tool, ToolContext, ToolExecutor, Toolkit, ToolOutput, TurnPolicy, } from "@batonfx/core";
|
|
4
|
+
export * as LanguageModel from "effect/unstable/ai/LanguageModel";
|
|
4
5
|
export declare const aiPackage = "./index";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { ModelRegistry } from "@batonfx/core";
|
|
2
|
+
import type { Effect } from "effect";
|
|
1
3
|
export type { AnthropicInput, WithAnthropicOptions } from "@batonfx/providers/anthropic";
|
|
2
|
-
export { anthropic, anthropicClientLayerConfig, withAnthropic } from "@batonfx/providers/anthropic";
|
|
4
|
+
export { anthropic, anthropicClientLayerConfig, withAnthropic, withAnthropicFetch } from "@batonfx/providers/anthropic";
|
|
3
5
|
export type { DeterministicInput, WithOpenAiOrDeterministicOptions } from "@batonfx/providers/deterministic";
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
6
|
+
export { withDeterministic, withOpenAiOrDeterministic, withOpenAiOrDeterministicFetch, } from "@batonfx/providers/deterministic";
|
|
7
|
+
export declare const deterministicModel: (input: import("@batonfx/providers/deterministic").DeterministicInput) => Effect.Effect<ModelRegistry.Registration>;
|
|
8
|
+
export type { OpenAiAccountCredential, OpenAiAccountCredentials, OpenAiAccountInput, OpenAiInput, RegistrationOptions, WithOpenAiOptions, } from "@batonfx/providers/openai";
|
|
9
|
+
export { openAi, openAiAccount, OpenAiAccountCredentialError, openAiClientLayerConfig, withOpenAi, withOpenAiAccount, withOpenAiAccountFetch, withOpenAiFetch, } from "@batonfx/providers/openai";
|
|
7
10
|
export type { OpenAiCompatibleInput, WithOpenAiCompatibleOptions } from "@batonfx/providers/openai-compat";
|
|
8
|
-
export { openAiCompatible, openAiCompatibleClientLayerConfig, withOpenAiCompatible, } from "@batonfx/providers/openai-compat";
|
|
11
|
+
export { openAiCompatible, openAiCompatibleClientLayerConfig, withOpenAiCompatible, withOpenAiCompatibleFetch, } from "@batonfx/providers/openai-compat";
|
|
9
12
|
export type { OpenRouterInput, WithOpenRouterOptions } from "@batonfx/providers/openrouter";
|
|
10
|
-
export { openRouter, openRouterClientLayerConfig, withOpenRouter } from "@batonfx/providers/openrouter";
|
|
13
|
+
export { openRouter, openRouterClientLayerConfig, withOpenRouter, withOpenRouterFetch, } from "@batonfx/providers/openrouter";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
import { ClientError, Service as ClientService, WaitKindMismatch } from "./client";
|
|
2
|
+
import { ClientError, Service as ClientService, WaitKindMismatch } from "./client-public";
|
|
3
3
|
import { AckEnvelopeReadyInput, ClaimEnvelopeReadyInput, EnvelopeReadyAcked, EnvelopeReadyLease, EnvelopeReadyReleased, ReleaseEnvelopeReadyInput, SubmitInboundEnvelopeAccepted, SubmitInboundEnvelopeInput } from "./operation";
|
|
4
4
|
export interface Interface {
|
|
5
5
|
readonly claim: (input: ClaimEnvelopeReadyInput) => Effect.Effect<EnvelopeReadyLease | null, ClientError>;
|
package/dist/types/relay/ai.d.ts
CHANGED
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { Agent as BatonAgent, AgentEvent as BatonAgentEvent, AgentTool as BatonAgentTool, AiError as BatonAiError, Approvals as BatonApprovals, Chat as BatonChat, Compaction as BatonCompaction, EmbeddingModel as BatonEmbeddingModel, Guardrail as BatonGuardrail, Handoff as BatonHandoff, IdGenerator as BatonIdGenerator, Instructions as BatonInstructions, Memory as BatonMemory, Model as BatonModel, ModelMiddleware as BatonModelMiddleware, ModelRegistry as BatonModelRegistry, ModelResilience as BatonModelResilience, Permissions as BatonPermissions, Prompt as BatonPrompt, Response as BatonResponse, ResponseIdTracker as BatonResponseIdTracker, Session as BatonSession, SkillSource as BatonSkillSource, Steering as BatonSteering, Telemetry as BatonTelemetry, Tokenizer as BatonTokenizer, Tool as BatonTool, ToolContext as BatonToolContext, ToolExecutor as BatonToolExecutor, Toolkit as BatonToolkit, ToolOutput as BatonToolOutput, TurnPolicy as BatonTurnPolicy } from "@batonfx/core";
|
|
2
|
+
export * as LanguageModel from "effect/unstable/ai/LanguageModel";
|
|
3
|
+
export import Agent = BatonAgent;
|
|
4
|
+
export import AgentEvent = BatonAgentEvent;
|
|
5
|
+
export import AgentTool = BatonAgentTool;
|
|
6
|
+
export import AiError = BatonAiError;
|
|
7
|
+
export import Approvals = BatonApprovals;
|
|
8
|
+
export import Chat = BatonChat;
|
|
9
|
+
export import Compaction = BatonCompaction;
|
|
10
|
+
export import EmbeddingModel = BatonEmbeddingModel;
|
|
11
|
+
export import Guardrail = BatonGuardrail;
|
|
12
|
+
export import Handoff = BatonHandoff;
|
|
13
|
+
export import IdGenerator = BatonIdGenerator;
|
|
14
|
+
export import Instructions = BatonInstructions;
|
|
15
|
+
export import Memory = BatonMemory;
|
|
16
|
+
export import Model = BatonModel;
|
|
17
|
+
export import ModelMiddleware = BatonModelMiddleware;
|
|
18
|
+
export import ModelRegistry = BatonModelRegistry;
|
|
19
|
+
export import ModelResilience = BatonModelResilience;
|
|
20
|
+
export import Permissions = BatonPermissions;
|
|
21
|
+
export import Prompt = BatonPrompt;
|
|
22
|
+
export import Response = BatonResponse;
|
|
23
|
+
export import ResponseIdTracker = BatonResponseIdTracker;
|
|
24
|
+
export import Session = BatonSession;
|
|
25
|
+
export import SkillSource = BatonSkillSource;
|
|
26
|
+
export import Steering = BatonSteering;
|
|
27
|
+
export import Telemetry = BatonTelemetry;
|
|
28
|
+
export import Tokenizer = BatonTokenizer;
|
|
29
|
+
export import Tool = BatonTool;
|
|
30
|
+
export import ToolContext = BatonToolContext;
|
|
31
|
+
export import ToolExecutor = BatonToolExecutor;
|
|
32
|
+
export import Toolkit = BatonToolkit;
|
|
33
|
+
export import ToolOutput = BatonToolOutput;
|
|
34
|
+
export import TurnPolicy = BatonTurnPolicy;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Interface as ChildFanOutRuntimeInterface } from "../runtime/child/child-fan-out-runtime";
|
|
2
|
+
import { WorkflowRuntimeError as WorkflowDefinitionRuntimeWorkflowRuntimeError } from "../runtime/workflow/definition-runtime";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
/** Admission follows confirmed persistence. A successful sweep means the fan-out was admitted or already settled. */
|
|
5
|
+
export declare const recoverPersistedFanOut: (recover: ChildFanOutRuntimeInterface["recover"]) => Effect.Effect<void, WorkflowDefinitionRuntimeWorkflowRuntimeError>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ChildOrchestration, Ids } from "../schema/index";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
export declare const Result: Schema.Struct<{
|
|
4
|
+
readonly status: Schema.Literals<readonly ["completed", "failed", "cancelled"]>;
|
|
5
|
+
readonly output: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
6
|
+
readonly type: Schema.Literal<"text">;
|
|
7
|
+
readonly text: Schema.String;
|
|
8
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
9
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
10
|
+
}>, Schema.Struct<{
|
|
11
|
+
readonly type: Schema.Literal<"structured">;
|
|
12
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
13
|
+
readonly schema_ref: Schema.optionalKey<Schema.String>;
|
|
14
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
15
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
16
|
+
}>, Schema.Struct<{
|
|
17
|
+
readonly type: Schema.Literal<"blob-reference">;
|
|
18
|
+
readonly uri: Schema.String;
|
|
19
|
+
readonly media_type: Schema.String;
|
|
20
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
21
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
22
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
23
|
+
}>, Schema.Struct<{
|
|
24
|
+
readonly type: Schema.Literal<"artifact-reference">;
|
|
25
|
+
readonly artifact_id: Schema.String;
|
|
26
|
+
readonly media_type: Schema.optionalKey<Schema.String>;
|
|
27
|
+
readonly provider_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
|
+
}>, Schema.Struct<{
|
|
30
|
+
readonly type: Schema.Literal<"tool-call">;
|
|
31
|
+
readonly call: Schema.Struct<{
|
|
32
|
+
readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
33
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
34
|
+
};
|
|
35
|
+
readonly name: Schema.String;
|
|
36
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
37
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
38
|
+
}>;
|
|
39
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
40
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
41
|
+
}>, Schema.Struct<{
|
|
42
|
+
readonly type: Schema.Literal<"tool-result">;
|
|
43
|
+
readonly result: Schema.Struct<{
|
|
44
|
+
readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
|
|
45
|
+
make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
|
|
46
|
+
};
|
|
47
|
+
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
48
|
+
readonly error: Schema.optionalKey<Schema.String>;
|
|
49
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
50
|
+
}>;
|
|
51
|
+
readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
52
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
53
|
+
}>]>>;
|
|
54
|
+
readonly error: Schema.optionalKey<Schema.String>;
|
|
55
|
+
readonly completed_at: Schema.optionalKey<Schema.Finite>;
|
|
56
|
+
}>;
|
|
57
|
+
export interface Result extends Schema.Schema.Type<typeof Result> {
|
|
58
|
+
}
|
|
59
|
+
declare const HandlerError_base: Schema.Class<HandlerError, Schema.TaggedStruct<"ChildFanOutHostHandlerError", {
|
|
60
|
+
readonly message: Schema.String;
|
|
61
|
+
}>, import("effect/Cause").YieldableError>;
|
|
62
|
+
export declare class HandlerError extends HandlerError_base {
|
|
63
|
+
}
|
|
64
|
+
export interface Handlers {
|
|
65
|
+
readonly execute: (child: ChildOrchestration.FanOutChild, fanOut: ChildOrchestration.FanOutState, idempotencyKey: string) => Effect.Effect<Result, HandlerError>;
|
|
66
|
+
readonly cancel: (childExecutionId: Ids.ChildExecutionId, reason: string) => Effect.Effect<void, HandlerError>;
|
|
67
|
+
}
|
|
68
|
+
export type Interface = Handlers;
|
|
69
|
+
declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/child-fan-out-host/Service", Handlers>;
|
|
70
|
+
export declare class Service extends Service_base {
|
|
71
|
+
}
|
|
72
|
+
export declare const layer: (handlers: Handlers) => Layer.Layer<Service, never, never>;
|
|
73
|
+
export {};
|