@relayfx/sdk 0.3.0 → 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-vwbatywf.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 -147
- 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-d3dme13d.js +0 -141
- package/dist/index-pn652eef.js +0 -2860
- package/dist/types/relay/database.d.ts +0 -16
package/dist/sqlite.js
CHANGED
|
@@ -1,79 +1,27 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./index-
|
|
3
|
+
database,
|
|
4
|
+
normalizeMigrationCause
|
|
5
|
+
} from "./index-szzswx0z.js";
|
|
6
6
|
import {
|
|
7
7
|
DatabaseAlreadyOwned,
|
|
8
|
-
DatabaseDialect,
|
|
9
8
|
RuntimeConfigurationError,
|
|
10
9
|
RuntimeMigrationError,
|
|
11
10
|
RuntimeTopologyError,
|
|
12
11
|
SchemaHeadMismatch,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
exports_address_book_service,
|
|
22
|
-
exports_address_resolution_service,
|
|
23
|
-
exports_address_schema,
|
|
24
|
-
exports_agent_loop_service,
|
|
25
|
-
exports_agent_registry_service,
|
|
26
|
-
exports_agent_schema,
|
|
27
|
-
exports_artifact_store_service,
|
|
28
|
-
exports_blob_store_service,
|
|
29
|
-
exports_child_fan_out_repository,
|
|
30
|
-
exports_child_fan_out_runtime,
|
|
31
|
-
exports_child_fan_out_transition_service,
|
|
32
|
-
exports_child_run_service,
|
|
33
|
-
exports_content_schema,
|
|
34
|
-
exports_definition_runtime,
|
|
35
|
-
exports_embedding_model_service,
|
|
36
|
-
exports_entity_schema,
|
|
37
|
-
exports_envelope_schema,
|
|
38
|
-
exports_envelope_service,
|
|
39
|
-
exports_event_log_service,
|
|
40
|
-
exports_execution_entity,
|
|
41
|
-
exports_execution_event_repository,
|
|
42
|
-
exports_execution_schema,
|
|
43
|
-
exports_execution_service,
|
|
44
|
-
exports_execution_workflow,
|
|
45
|
-
exports_ids_schema,
|
|
46
|
-
exports_language_model_service,
|
|
47
|
-
exports_model_call_policy,
|
|
48
|
-
exports_notification_bus,
|
|
49
|
-
exports_prompt_assembler_service,
|
|
50
|
-
exports_runner_runtime_service,
|
|
51
|
-
exports_schedule_schema,
|
|
52
|
-
exports_scheduler_service,
|
|
53
|
-
exports_schema_registry_service,
|
|
54
|
-
exports_shared_schema,
|
|
55
|
-
exports_skill_registry_service,
|
|
56
|
-
exports_skill_schema,
|
|
57
|
-
exports_tool_runtime_service,
|
|
58
|
-
exports_tool_schema,
|
|
59
|
-
exports_wait_service,
|
|
60
|
-
exports_workflow_definition_repository,
|
|
61
|
-
exports_workflow_schema
|
|
62
|
-
} from "./index-c2skef55.js";
|
|
12
|
+
make,
|
|
13
|
+
makeDatabaseIdentity,
|
|
14
|
+
runtimeLayer
|
|
15
|
+
} from "./index-70m3hgk1.js";
|
|
16
|
+
import"./index-bknsjvwf.js";
|
|
17
|
+
import"./index-cphmds30.js";
|
|
18
|
+
import"./index-nb39b5ae.js";
|
|
19
|
+
|
|
63
20
|
// src/sqlite-runtime.ts
|
|
64
|
-
var exports_sqlite_runtime = {};
|
|
65
|
-
__export(exports_sqlite_runtime, {
|
|
66
|
-
workflowLayer: () => workflowLayer,
|
|
67
|
-
runtimeDatabaseLayer: () => runtimeDatabaseLayer2,
|
|
68
|
-
migrationsLayer: () => migrationsLayer,
|
|
69
|
-
layer: () => layer,
|
|
70
|
-
clientLayer: () => clientLayer,
|
|
71
|
-
childFanOutLayer: () => childFanOutLayer
|
|
72
|
-
});
|
|
73
21
|
import { layer as sqliteClientLayer } from "@effect/sql-sqlite-bun/SqliteClient";
|
|
74
|
-
import {
|
|
22
|
+
import { run as runSqliteMigrator } from "@effect/sql-sqlite-bun/SqliteMigrator";
|
|
75
23
|
import { layer as bunServicesLayer } from "@effect/platform-bun/BunServices";
|
|
76
|
-
import { Effect as Effect2, FileSystem,
|
|
24
|
+
import { Effect as Effect2, FileSystem, Layer, Path } from "effect";
|
|
77
25
|
import { SqlClient as SqlClient2 } from "effect/unstable/sql/SqlClient";
|
|
78
26
|
|
|
79
27
|
// ../../migrations/sqlite/0001_baseline.sql
|
|
@@ -688,23 +636,38 @@ var canonicalFilename = Effect2.fn("SQLite.canonicalFilename")(function* (filena
|
|
|
688
636
|
const absolute = path.resolve(filename);
|
|
689
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))));
|
|
690
638
|
});
|
|
691
|
-
var
|
|
639
|
+
var database2 = (options) => {
|
|
692
640
|
if (options.filename.length === 0) {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
cause: {
|
|
697
|
-
|
|
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
|
+
});
|
|
698
655
|
}
|
|
656
|
+
const memoryOwnerIdentity = options.filename === ":memory:" ? `sqlite:memory:${memoryIdentity++}` : undefined;
|
|
699
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))));
|
|
700
|
-
const
|
|
701
|
-
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
|
+
});
|
|
702
665
|
};
|
|
703
|
-
var
|
|
704
|
-
const identity =
|
|
666
|
+
var makeSqliteDatabase = (options, filename, memoryOwnerIdentity) => {
|
|
667
|
+
const identity = memoryOwnerIdentity ?? `sqlite:file:${filename}`;
|
|
705
668
|
const databaseIdentity = makeDatabaseIdentity(identity);
|
|
706
|
-
const
|
|
707
|
-
|
|
669
|
+
const migrateSchema = runSqliteMigrator(migrationOptions).pipe((effect) => normalizeMigrationCause(effect, "sqlite", "apply"));
|
|
670
|
+
const verifySchema = Effect2.gen(function* () {
|
|
708
671
|
const sql = yield* SqlClient2;
|
|
709
672
|
const rows = yield* sql`SELECT migration_id, name FROM relay_migrations ORDER BY migration_id`.pipe((effect) => normalizeMigrationCause(effect, "sqlite", "verify"));
|
|
710
673
|
const actual = rows.map((row) => `${row.migration_id}:${row.name}`).join(",");
|
|
@@ -718,15 +681,17 @@ var makeSqliteDatabaseLayer = (options, filename) => {
|
|
|
718
681
|
});
|
|
719
682
|
}
|
|
720
683
|
});
|
|
721
|
-
const
|
|
684
|
+
const adapterDatabase = database({
|
|
722
685
|
dialect: "sqlite",
|
|
723
686
|
clientLayer: clientLayer({ ...options, filename }),
|
|
724
687
|
databaseIdentity,
|
|
725
688
|
ownership: "runtime-exclusive",
|
|
726
689
|
schemaHead: String(migrations.at(-1)?.id ?? 0),
|
|
727
|
-
|
|
690
|
+
acquire: migrateSchema.pipe(Effect2.andThen(verifySchema)),
|
|
691
|
+
migrate: migrateSchema.pipe(Effect2.andThen(verifySchema)),
|
|
692
|
+
verify: verifySchema
|
|
728
693
|
});
|
|
729
|
-
const
|
|
694
|
+
const claim = Effect2.suspend(() => {
|
|
730
695
|
if (ownedDatabases.has(identity)) {
|
|
731
696
|
return Effect2.fail(RuntimeTopologyError.make({
|
|
732
697
|
dialect: "sqlite",
|
|
@@ -737,79 +702,24 @@ var makeSqliteDatabaseLayer = (options, filename) => {
|
|
|
737
702
|
}
|
|
738
703
|
ownedDatabases.add(identity);
|
|
739
704
|
return Effect2.void;
|
|
740
|
-
})
|
|
741
|
-
const
|
|
742
|
-
|
|
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
|
+
});
|
|
743
715
|
};
|
|
744
716
|
var migrationOptions = {
|
|
745
717
|
loader,
|
|
746
718
|
table: "relay_migrations"
|
|
747
719
|
};
|
|
748
|
-
var migrationsLayer = sqliteMigratorLayer(migrationOptions);
|
|
749
|
-
var layer = (options) => {
|
|
750
|
-
const client = clientLayer(options);
|
|
751
|
-
return Layer.effect(SqlClient2, Effect2.gen(function* () {
|
|
752
|
-
const sql = yield* SqlClient2;
|
|
753
|
-
yield* runSqliteMigrator(migrationOptions);
|
|
754
|
-
return sql;
|
|
755
|
-
})).pipe(Layer.provide(client));
|
|
756
|
-
};
|
|
757
|
-
var workflowLayer = Function.dual(2, (options, handlersLayer) => {
|
|
758
|
-
const sqlite = layer(options);
|
|
759
|
-
const repository = exports_workflow_definition_repository.layer.pipe(Layer.provideMerge(sqlite));
|
|
760
|
-
return exports_definition_runtime.layer.pipe(Layer.provideMerge(handlersLayer), Layer.provideMerge(repository));
|
|
761
|
-
});
|
|
762
|
-
var childFanOutLayer = Function.dual(2, (options, handlersLayer) => {
|
|
763
|
-
const sqlite = layer(options);
|
|
764
|
-
const repository = exports_child_fan_out_repository.layer.pipe(Layer.provideMerge(sqlite));
|
|
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));
|
|
766
|
-
const transitions = exports_child_fan_out_transition_service.layer.pipe(Layer.provide(repository), Layer.provide(events));
|
|
767
|
-
return exports_child_fan_out_runtime.layer.pipe(Layer.provide(handlersLayer), Layer.provide(repository), Layer.provide(transitions));
|
|
768
|
-
});
|
|
769
720
|
|
|
770
721
|
// src/sqlite.ts
|
|
771
|
-
var
|
|
722
|
+
var SQLite = { database: database2 };
|
|
772
723
|
export {
|
|
773
|
-
|
|
774
|
-
exports_definition_runtime as WorkflowDefinitionRuntime,
|
|
775
|
-
exports_workflow_schema as Workflow,
|
|
776
|
-
exports_wait_service as WaitService,
|
|
777
|
-
exports_tool_runtime_service as ToolRuntime,
|
|
778
|
-
exports_tool_schema as Tool,
|
|
779
|
-
exports_skill_registry_service as SkillRegistry,
|
|
780
|
-
exports_skill_schema as Skill,
|
|
781
|
-
exports_shared_schema as Shared,
|
|
782
|
-
exports_schema_registry_service as SchemaRegistry,
|
|
783
|
-
exports_scheduler_service as SchedulerService,
|
|
784
|
-
exports_schedule_schema as Schedule,
|
|
785
|
-
exports_sqlite_runtime as SQLite,
|
|
786
|
-
exports_runtime as Runtime,
|
|
787
|
-
exports_runner_runtime_service as RunnerRuntime,
|
|
788
|
-
exports_prompt_assembler_service as PromptAssembler,
|
|
789
|
-
exports_operation as Operation,
|
|
790
|
-
exports_model_call_policy as ModelCallPolicy,
|
|
791
|
-
exports_language_model_service as LanguageModelService,
|
|
792
|
-
exports_ids_schema as Ids,
|
|
793
|
-
exports_execution_workflow as ExecutionWorkflow,
|
|
794
|
-
exports_execution_service as ExecutionService,
|
|
795
|
-
exports_execution_entity as ExecutionEntity,
|
|
796
|
-
exports_execution_schema as Execution,
|
|
797
|
-
exports_event_log_service as EventLog,
|
|
798
|
-
exports_envelope_service as EnvelopeService,
|
|
799
|
-
exports_envelope_schema as Envelope,
|
|
800
|
-
exports_entity_schema as Entity,
|
|
801
|
-
exports_embedding_model_service as EmbeddingModelService,
|
|
802
|
-
exports_content_schema as Content,
|
|
803
|
-
exports_client as Client,
|
|
804
|
-
exports_child_run_service as ChildRunService,
|
|
805
|
-
exports_child_fan_out_runtime as ChildFanOutRuntime,
|
|
806
|
-
exports_blob_store_service as BlobStore,
|
|
807
|
-
exports_artifact_store_service as ArtifactStore,
|
|
808
|
-
exports_agent_registry_service as AgentRegistry,
|
|
809
|
-
exports_agent_loop_service as AgentLoop,
|
|
810
|
-
exports_agent_schema as Agent,
|
|
811
|
-
exports_address_resolution_service as AddressResolution,
|
|
812
|
-
exports_address_book_service as AddressBook,
|
|
813
|
-
exports_address_schema as Address,
|
|
814
|
-
exports_activity_version_registry as ActivityVersionRegistry
|
|
724
|
+
SQLite
|
|
815
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 {};
|