@relayfx/sdk 0.0.23 → 0.0.24
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/index.js +582 -542
- package/dist/migrations/mysql/0001_baseline.sql +429 -0
- package/dist/migrations/sqlite/0001_baseline.sql +429 -0
- package/dist/types/store-sql/database/database-service.d.ts +16 -2
- package/package.json +1 -1
- /package/dist/migrations/{20260701002839_sour_cerebro → pg/20260701002839_sour_cerebro}/migration.sql +0 -0
- /package/dist/migrations/{20260701002839_sour_cerebro → pg/20260701002839_sour_cerebro}/snapshot.json +0 -0
- /package/dist/migrations/{20260701041134_acoustic_hulk → pg/20260701041134_acoustic_hulk}/migration.sql +0 -0
- /package/dist/migrations/{20260701041134_acoustic_hulk → pg/20260701041134_acoustic_hulk}/snapshot.json +0 -0
- /package/dist/migrations/{20260701160543_condemned_stryfe → pg/20260701160543_condemned_stryfe}/migration.sql +0 -0
- /package/dist/migrations/{20260701160543_condemned_stryfe → pg/20260701160543_condemned_stryfe}/snapshot.json +0 -0
- /package/dist/migrations/{20260701220315_heavy_gorgon → pg/20260701220315_heavy_gorgon}/migration.sql +0 -0
- /package/dist/migrations/{20260701220315_heavy_gorgon → pg/20260701220315_heavy_gorgon}/snapshot.json +0 -0
- /package/dist/migrations/{20260701225444_polite_lord_hawal → pg/20260701225444_polite_lord_hawal}/migration.sql +0 -0
- /package/dist/migrations/{20260701225444_polite_lord_hawal → pg/20260701225444_polite_lord_hawal}/snapshot.json +0 -0
- /package/dist/migrations/{20260702030128_flaky_misty_knight → pg/20260702030128_flaky_misty_knight}/migration.sql +0 -0
- /package/dist/migrations/{20260702030128_flaky_misty_knight → pg/20260702030128_flaky_misty_knight}/snapshot.json +0 -0
- /package/dist/migrations/{20260705003847_nervous_banshee → pg/20260705003847_nervous_banshee}/migration.sql +0 -0
- /package/dist/migrations/{20260705003847_nervous_banshee → pg/20260705003847_nervous_banshee}/snapshot.json +0 -0
- /package/dist/migrations/{20260705012626_common_stryfe → pg/20260705012626_common_stryfe}/migration.sql +0 -0
- /package/dist/migrations/{20260705012626_common_stryfe → pg/20260705012626_common_stryfe}/snapshot.json +0 -0
- /package/dist/migrations/{20260705015420_sweet_captain_marvel → pg/20260705015420_sweet_captain_marvel}/migration.sql +0 -0
- /package/dist/migrations/{20260705015420_sweet_captain_marvel → pg/20260705015420_sweet_captain_marvel}/snapshot.json +0 -0
- /package/dist/migrations/{20260705023041_chunky_scalphunter → pg/20260705023041_chunky_scalphunter}/migration.sql +0 -0
- /package/dist/migrations/{20260705023041_chunky_scalphunter → pg/20260705023041_chunky_scalphunter}/snapshot.json +0 -0
- /package/dist/migrations/{20260705030344_short_patriot → pg/20260705030344_short_patriot}/migration.sql +0 -0
- /package/dist/migrations/{20260705030344_short_patriot → pg/20260705030344_short_patriot}/snapshot.json +0 -0
- /package/dist/migrations/{20260705045546_heavy_ben_grimm → pg/20260705045546_heavy_ben_grimm}/migration.sql +0 -0
- /package/dist/migrations/{20260705045546_heavy_ben_grimm → pg/20260705045546_heavy_ben_grimm}/snapshot.json +0 -0
- /package/dist/migrations/{20260706185931_regular_shadow_king → pg/20260706185931_regular_shadow_king}/migration.sql +0 -0
- /package/dist/migrations/{20260706185931_regular_shadow_king → pg/20260706185931_regular_shadow_king}/snapshot.json +0 -0
- /package/dist/migrations/{20260706233300_equal_cyclops → pg/20260706233300_equal_cyclops}/migration.sql +0 -0
- /package/dist/migrations/{20260706233300_equal_cyclops → pg/20260706233300_equal_cyclops}/snapshot.json +0 -0
package/dist/index.js
CHANGED
|
@@ -865,26 +865,39 @@ __export(exports_address_book_repository, {
|
|
|
865
865
|
AddressBookRepositoryError: () => AddressBookRepositoryError
|
|
866
866
|
});
|
|
867
867
|
import { asc, eq as eq2, sql as sql3 } from "drizzle-orm";
|
|
868
|
-
import { Context as Context3, Effect as Effect3, Layer as Layer3, Schema as
|
|
868
|
+
import { Context as Context3, Effect as Effect3, Layer as Layer3, Schema as Schema13 } from "effect";
|
|
869
869
|
|
|
870
870
|
// ../store-sql/src/database/database-service.ts
|
|
871
871
|
var exports_database_service = {};
|
|
872
872
|
__export(exports_database_service, {
|
|
873
873
|
toPgDate: () => toPgDate,
|
|
874
|
+
timestampParam: () => timestampParam,
|
|
874
875
|
testLayer: () => testLayer,
|
|
875
876
|
pgTypeParsers: () => pgTypeParsers,
|
|
876
877
|
layerFromPgClient: () => layerFromPgClient,
|
|
877
878
|
layer: () => layer,
|
|
878
879
|
fromPgDate: () => fromPgDate,
|
|
879
880
|
fromNullablePgDate: () => fromNullablePgDate,
|
|
881
|
+
fromNullableDbTimestamp: () => fromNullableDbTimestamp,
|
|
882
|
+
fromDbTimestamp: () => fromDbTimestamp,
|
|
883
|
+
encodeJson: () => encodeJson,
|
|
884
|
+
dialect: () => dialect,
|
|
885
|
+
decodeJson: () => decodeJson,
|
|
886
|
+
decodeBool: () => decodeBool,
|
|
880
887
|
check: () => check,
|
|
888
|
+
SqliteClientLive: () => SqliteClientLive,
|
|
881
889
|
Service: () => Service,
|
|
882
|
-
PgClientLive: () => PgClientLive
|
|
890
|
+
PgClientLive: () => PgClientLive,
|
|
891
|
+
MysqlClientLive: () => MysqlClientLive,
|
|
892
|
+
Dialect: () => Dialect
|
|
883
893
|
});
|
|
894
|
+
import * as MysqlClient from "@effect/sql-mysql2/MysqlClient";
|
|
884
895
|
import * as PgClient from "@effect/sql-pg/PgClient";
|
|
896
|
+
import * as SqliteClient from "@effect/sql-sqlite-bun/SqliteClient";
|
|
885
897
|
import * as PgDrizzle from "drizzle-orm/effect-postgres";
|
|
886
898
|
import { sql } from "drizzle-orm";
|
|
887
|
-
import { Config, Context, DateTime, Effect, Layer, Redacted } from "effect";
|
|
899
|
+
import { Config, Context, DateTime, Effect, Layer, Redacted, Schema as Schema12 } from "effect";
|
|
900
|
+
import * as SqlClient from "effect/unstable/sql/SqlClient";
|
|
888
901
|
import { types } from "pg";
|
|
889
902
|
|
|
890
903
|
class Service extends Context.Service()("@relayfx/store-sql/Database") {
|
|
@@ -913,6 +926,33 @@ var check = Effect.fn("Database.check")(function* () {
|
|
|
913
926
|
const db = yield* Service;
|
|
914
927
|
yield* db.execute(sql`select 1 as ok`).pipe(Effect.asVoid);
|
|
915
928
|
});
|
|
929
|
+
var Dialect = Schema12.Literals(["pg", "mysql", "sqlite"]);
|
|
930
|
+
var dialect = Effect.gen(function* () {
|
|
931
|
+
const client = yield* SqlClient.SqlClient;
|
|
932
|
+
const detected = client.onDialectOrElse({
|
|
933
|
+
pg: () => "pg",
|
|
934
|
+
mysql: () => "mysql",
|
|
935
|
+
sqlite: () => "sqlite",
|
|
936
|
+
orElse: () => null
|
|
937
|
+
});
|
|
938
|
+
return detected ?? (yield* Effect.die(new Error("unsupported SQL dialect")));
|
|
939
|
+
});
|
|
940
|
+
var MysqlClientLive = MysqlClient.layerConfig({
|
|
941
|
+
url: Config.redacted("DATABASE_URL").pipe(Config.withDefault(Redacted.make("mysql://relay:relay@localhost:5546/relay"))),
|
|
942
|
+
maxConnections: Config.int("RELAY_SQL_MAX_CONNECTIONS").pipe(Config.withDefault(8))
|
|
943
|
+
});
|
|
944
|
+
var SqliteClientLive = SqliteClient.layerConfig({
|
|
945
|
+
filename: Config.string("RELAY_SQLITE_FILE").pipe(Config.withDefault("relay.sqlite"))
|
|
946
|
+
});
|
|
947
|
+
var timestampParam = (client, millis) => client.onDialectOrElse({
|
|
948
|
+
sqlite: () => millis,
|
|
949
|
+
orElse: () => toPgDate(millis)
|
|
950
|
+
});
|
|
951
|
+
var fromDbTimestamp = fromPgDate;
|
|
952
|
+
var fromNullableDbTimestamp = fromNullablePgDate;
|
|
953
|
+
var encodeJson = (value) => JSON.stringify(value);
|
|
954
|
+
var decodeJson = (value) => typeof value === "string" ? JSON.parse(value) : value;
|
|
955
|
+
var decodeBool = (value) => value === true || value === 1 || value === "1";
|
|
916
956
|
|
|
917
957
|
// ../store-sql/src/schema/relay-schema.ts
|
|
918
958
|
var exports_relay_schema = {};
|
|
@@ -1385,13 +1425,13 @@ var predicate = (tenantId2, tenantColumn, ...conditions) => and(eq(tenantColumn,
|
|
|
1385
1425
|
// ../store-sql/src/address/address-book-repository.ts
|
|
1386
1426
|
var RouteKind2 = exports_address_schema.RouteKind;
|
|
1387
1427
|
|
|
1388
|
-
class AddressNotFound extends
|
|
1428
|
+
class AddressNotFound extends Schema13.TaggedErrorClass()("AddressNotFound", {
|
|
1389
1429
|
address_id: exports_ids_schema.AddressId
|
|
1390
1430
|
}) {
|
|
1391
1431
|
}
|
|
1392
1432
|
|
|
1393
|
-
class AddressBookRepositoryError extends
|
|
1394
|
-
message:
|
|
1433
|
+
class AddressBookRepositoryError extends Schema13.TaggedErrorClass()("AddressBookRepositoryError", {
|
|
1434
|
+
message: Schema13.String
|
|
1395
1435
|
}) {
|
|
1396
1436
|
}
|
|
1397
1437
|
|
|
@@ -1502,9 +1542,9 @@ __export(exports_agent_chat_repository, {
|
|
|
1502
1542
|
AgentChatRepositoryError: () => AgentChatRepositoryError
|
|
1503
1543
|
});
|
|
1504
1544
|
import { eq as eq3 } from "drizzle-orm";
|
|
1505
|
-
import { Context as Context4, Effect as Effect4, Layer as Layer4, Schema as
|
|
1506
|
-
class AgentChatRepositoryError extends
|
|
1507
|
-
message:
|
|
1545
|
+
import { Context as Context4, Effect as Effect4, Layer as Layer4, Schema as Schema14 } from "effect";
|
|
1546
|
+
class AgentChatRepositoryError extends Schema14.TaggedErrorClass()("AgentChatRepositoryError", {
|
|
1547
|
+
message: Schema14.String
|
|
1508
1548
|
}) {
|
|
1509
1549
|
}
|
|
1510
1550
|
|
|
@@ -1583,9 +1623,9 @@ __export(exports_agent_definition_repository, {
|
|
|
1583
1623
|
AgentDefinitionRepositoryError: () => AgentDefinitionRepositoryError
|
|
1584
1624
|
});
|
|
1585
1625
|
import { asc as asc2, desc, eq as eq4, sql as sql4 } from "drizzle-orm";
|
|
1586
|
-
import { Context as Context5, Effect as Effect5, Layer as Layer5, Schema as
|
|
1587
|
-
class AgentDefinitionRepositoryError extends
|
|
1588
|
-
message:
|
|
1626
|
+
import { Context as Context5, Effect as Effect5, Layer as Layer5, Schema as Schema15 } from "effect";
|
|
1627
|
+
class AgentDefinitionRepositoryError extends Schema15.TaggedErrorClass()("AgentDefinitionRepositoryError", {
|
|
1628
|
+
message: Schema15.String
|
|
1589
1629
|
}) {
|
|
1590
1630
|
}
|
|
1591
1631
|
|
|
@@ -1613,7 +1653,7 @@ var toRevisionRecord = (row) => {
|
|
|
1613
1653
|
createdAt: fromPgDate(row.createdAt)
|
|
1614
1654
|
};
|
|
1615
1655
|
};
|
|
1616
|
-
var cloneDefinition = (definition) =>
|
|
1656
|
+
var cloneDefinition = (definition) => Schema15.decodeUnknownSync(exports_agent_schema.Definition)(globalThis.structuredClone(definition));
|
|
1617
1657
|
var cloneRecord = (record) => ({
|
|
1618
1658
|
...record,
|
|
1619
1659
|
definition: cloneDefinition(record.definition),
|
|
@@ -1785,18 +1825,18 @@ __export(exports_child_execution_repository, {
|
|
|
1785
1825
|
ChildExecutionNotFound: () => ChildExecutionNotFound
|
|
1786
1826
|
});
|
|
1787
1827
|
import { asc as asc3, eq as eq5 } from "drizzle-orm";
|
|
1788
|
-
import { Context as Context6, Effect as Effect6, Layer as Layer6, Schema as
|
|
1789
|
-
class ChildExecutionRepositoryError extends
|
|
1790
|
-
message:
|
|
1828
|
+
import { Context as Context6, Effect as Effect6, Layer as Layer6, Schema as Schema16 } from "effect";
|
|
1829
|
+
class ChildExecutionRepositoryError extends Schema16.TaggedErrorClass()("ChildExecutionRepositoryError", {
|
|
1830
|
+
message: Schema16.String
|
|
1791
1831
|
}) {
|
|
1792
1832
|
}
|
|
1793
1833
|
|
|
1794
|
-
class DuplicateChildExecution extends
|
|
1834
|
+
class DuplicateChildExecution extends Schema16.TaggedErrorClass()("DuplicateChildExecution", {
|
|
1795
1835
|
id: exports_ids_schema.ChildExecutionId
|
|
1796
1836
|
}) {
|
|
1797
1837
|
}
|
|
1798
1838
|
|
|
1799
|
-
class ChildExecutionNotFound extends
|
|
1839
|
+
class ChildExecutionNotFound extends Schema16.TaggedErrorClass()("ChildExecutionNotFound", {
|
|
1800
1840
|
id: exports_ids_schema.ChildExecutionId
|
|
1801
1841
|
}) {
|
|
1802
1842
|
}
|
|
@@ -1931,24 +1971,24 @@ __export(exports_cluster_registry_repository, {
|
|
|
1931
1971
|
LockRow: () => LockRow,
|
|
1932
1972
|
ClusterRegistryError: () => ClusterRegistryError
|
|
1933
1973
|
});
|
|
1934
|
-
import { Context as Context7, Effect as Effect7, Layer as Layer7, Schema as
|
|
1935
|
-
import { SqlClient, SqlSchema } from "effect/unstable/sql";
|
|
1974
|
+
import { Context as Context7, Effect as Effect7, Layer as Layer7, Schema as Schema17 } from "effect";
|
|
1975
|
+
import { SqlClient as SqlClient3, SqlSchema } from "effect/unstable/sql";
|
|
1936
1976
|
|
|
1937
|
-
class ClusterRegistryError extends
|
|
1938
|
-
message:
|
|
1977
|
+
class ClusterRegistryError extends Schema17.TaggedErrorClass()("ClusterRegistryError", {
|
|
1978
|
+
message: Schema17.String
|
|
1939
1979
|
}) {
|
|
1940
1980
|
}
|
|
1941
1981
|
|
|
1942
1982
|
class Service7 extends Context7.Service()("@relayfx/store-sql/ClusterRegistryRepository") {
|
|
1943
1983
|
}
|
|
1944
|
-
var RunnerRow =
|
|
1945
|
-
address:
|
|
1946
|
-
healthy:
|
|
1947
|
-
last_heartbeat:
|
|
1948
|
-
owned_shards:
|
|
1984
|
+
var RunnerRow = Schema17.Struct({
|
|
1985
|
+
address: Schema17.String,
|
|
1986
|
+
healthy: Schema17.Boolean,
|
|
1987
|
+
last_heartbeat: Schema17.Union([Schema17.Date, Schema17.DateFromString]),
|
|
1988
|
+
owned_shards: Schema17.Union([Schema17.Number, Schema17.NumberFromString])
|
|
1949
1989
|
}).annotate({ identifier: "Relay.ClusterRegistry.RunnerRow" });
|
|
1950
|
-
var LockRow =
|
|
1951
|
-
address:
|
|
1990
|
+
var LockRow = Schema17.Struct({
|
|
1991
|
+
address: Schema17.String
|
|
1952
1992
|
}).annotate({ identifier: "Relay.ClusterRegistry.LockRow" });
|
|
1953
1993
|
var toRunnerRecord = (row) => ({
|
|
1954
1994
|
address: row.address,
|
|
@@ -1958,9 +1998,9 @@ var toRunnerRecord = (row) => ({
|
|
|
1958
1998
|
});
|
|
1959
1999
|
var toRegistryError = (error) => new ClusterRegistryError({ message: String(error) });
|
|
1960
2000
|
var layer7 = Layer7.effect(Service7, Effect7.gen(function* () {
|
|
1961
|
-
const sql5 = yield*
|
|
2001
|
+
const sql5 = yield* SqlClient3.SqlClient;
|
|
1962
2002
|
const runnersQuery = SqlSchema.findAll({
|
|
1963
|
-
Request:
|
|
2003
|
+
Request: Schema17.Void,
|
|
1964
2004
|
Result: RunnerRow,
|
|
1965
2005
|
execute: () => sql5`
|
|
1966
2006
|
SELECT r.address, r.healthy, r.last_heartbeat, COUNT(l.shard_id) AS owned_shards
|
|
@@ -1971,7 +2011,7 @@ var layer7 = Layer7.effect(Service7, Effect7.gen(function* () {
|
|
|
1971
2011
|
`
|
|
1972
2012
|
});
|
|
1973
2013
|
const ownerQuery = SqlSchema.findAll({
|
|
1974
|
-
Request:
|
|
2014
|
+
Request: Schema17.Struct({ shard_id: Schema17.String }),
|
|
1975
2015
|
Result: LockRow,
|
|
1976
2016
|
execute: ({ shard_id }) => sql5`SELECT address FROM cluster_locks WHERE shard_id = ${shard_id}`
|
|
1977
2017
|
});
|
|
@@ -2012,9 +2052,9 @@ __export(exports_compaction_repository, {
|
|
|
2012
2052
|
CompactionRepositoryError: () => CompactionRepositoryError
|
|
2013
2053
|
});
|
|
2014
2054
|
import { asc as asc4, eq as eq6 } from "drizzle-orm";
|
|
2015
|
-
import { Context as Context8, Effect as Effect8, Layer as Layer8, Schema as
|
|
2016
|
-
class CompactionRepositoryError extends
|
|
2017
|
-
message:
|
|
2055
|
+
import { Context as Context8, Effect as Effect8, Layer as Layer8, Schema as Schema18 } from "effect";
|
|
2056
|
+
class CompactionRepositoryError extends Schema18.TaggedErrorClass()("CompactionRepositoryError", {
|
|
2057
|
+
message: Schema18.String
|
|
2018
2058
|
}) {
|
|
2019
2059
|
}
|
|
2020
2060
|
|
|
@@ -2141,37 +2181,37 @@ __export(exports_envelope_repository, {
|
|
|
2141
2181
|
EnvelopeNotFound: () => EnvelopeNotFound
|
|
2142
2182
|
});
|
|
2143
2183
|
import { and as and2, asc as asc5, desc as desc2, eq as eq7, inArray, lte, or, sql as sql5 } from "drizzle-orm";
|
|
2144
|
-
import { Context as Context9, Effect as Effect9, Layer as Layer9, Schema as
|
|
2145
|
-
var WaitState =
|
|
2184
|
+
import { Context as Context9, Effect as Effect9, Layer as Layer9, Schema as Schema19 } from "effect";
|
|
2185
|
+
var WaitState = Schema19.Literals(["open", "resolved", "timed_out", "cancelled"]).annotate({
|
|
2146
2186
|
identifier: "Relay.Store.WaitState"
|
|
2147
2187
|
});
|
|
2148
|
-
var EnvelopeReadyState =
|
|
2188
|
+
var EnvelopeReadyState = Schema19.Literals(["ready", "claimed", "acknowledged"]).annotate({
|
|
2149
2189
|
identifier: "Relay.Store.EnvelopeReadyState"
|
|
2150
2190
|
});
|
|
2151
2191
|
|
|
2152
|
-
class EnvelopeRepositoryError extends
|
|
2153
|
-
message:
|
|
2192
|
+
class EnvelopeRepositoryError extends Schema19.TaggedErrorClass()("EnvelopeRepositoryError", {
|
|
2193
|
+
message: Schema19.String
|
|
2154
2194
|
}) {
|
|
2155
2195
|
}
|
|
2156
2196
|
|
|
2157
|
-
class EnvelopeNotFound extends
|
|
2197
|
+
class EnvelopeNotFound extends Schema19.TaggedErrorClass()("EnvelopeNotFound", {
|
|
2158
2198
|
id: exports_ids_schema.EnvelopeId
|
|
2159
2199
|
}) {
|
|
2160
2200
|
}
|
|
2161
2201
|
|
|
2162
|
-
class WaitNotFound extends
|
|
2202
|
+
class WaitNotFound extends Schema19.TaggedErrorClass()("WaitNotFound", {
|
|
2163
2203
|
id: exports_ids_schema.WaitId
|
|
2164
2204
|
}) {
|
|
2165
2205
|
}
|
|
2166
2206
|
|
|
2167
|
-
class EnvelopeReadyNotFound extends
|
|
2207
|
+
class EnvelopeReadyNotFound extends Schema19.TaggedErrorClass()("EnvelopeReadyNotFound", {
|
|
2168
2208
|
id: exports_ids_schema.EnvelopeReadyId
|
|
2169
2209
|
}) {
|
|
2170
2210
|
}
|
|
2171
2211
|
|
|
2172
|
-
class EnvelopeReadyClaimMismatch extends
|
|
2212
|
+
class EnvelopeReadyClaimMismatch extends Schema19.TaggedErrorClass()("EnvelopeReadyClaimMismatch", {
|
|
2173
2213
|
id: exports_ids_schema.EnvelopeReadyId,
|
|
2174
|
-
worker_id:
|
|
2214
|
+
worker_id: Schema19.String
|
|
2175
2215
|
}) {
|
|
2176
2216
|
}
|
|
2177
2217
|
|
|
@@ -2629,31 +2669,31 @@ __export(exports_execution_event_repository, {
|
|
|
2629
2669
|
DuplicateExecutionEvent: () => DuplicateExecutionEvent
|
|
2630
2670
|
});
|
|
2631
2671
|
import { asc as asc6, desc as desc3, eq as eq8, gt, max, or as or2, sql as sql6 } from "drizzle-orm";
|
|
2632
|
-
import { Context as Context10, Effect as Effect10, Filter, Layer as Layer10, Option as Option2, Schema as
|
|
2672
|
+
import { Context as Context10, Effect as Effect10, Filter, Layer as Layer10, Option as Option2, Schema as Schema20, Stream } from "effect";
|
|
2633
2673
|
var executionEventsChannel = "relay_execution_events";
|
|
2634
2674
|
|
|
2635
|
-
class DuplicateExecutionEvent extends
|
|
2675
|
+
class DuplicateExecutionEvent extends Schema20.TaggedErrorClass()("DuplicateExecutionEvent", {
|
|
2636
2676
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2637
2677
|
sequence: exports_execution_schema.ExecutionEventSequence,
|
|
2638
2678
|
cursor: exports_shared_schema.NonEmptyString
|
|
2639
2679
|
}) {
|
|
2640
2680
|
}
|
|
2641
2681
|
|
|
2642
|
-
class ExecutionEventOrderViolation extends
|
|
2682
|
+
class ExecutionEventOrderViolation extends Schema20.TaggedErrorClass()("ExecutionEventOrderViolation", {
|
|
2643
2683
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2644
2684
|
sequence: exports_execution_schema.ExecutionEventSequence,
|
|
2645
2685
|
previous_sequence: exports_execution_schema.ExecutionEventSequence
|
|
2646
2686
|
}) {
|
|
2647
2687
|
}
|
|
2648
2688
|
|
|
2649
|
-
class ExecutionEventCursorNotFound extends
|
|
2689
|
+
class ExecutionEventCursorNotFound extends Schema20.TaggedErrorClass()("ExecutionEventCursorNotFound", {
|
|
2650
2690
|
execution_id: exports_ids_schema.ExecutionId,
|
|
2651
2691
|
cursor: exports_shared_schema.NonEmptyString
|
|
2652
2692
|
}) {
|
|
2653
2693
|
}
|
|
2654
2694
|
|
|
2655
|
-
class ExecutionEventRepositoryError extends
|
|
2656
|
-
message:
|
|
2695
|
+
class ExecutionEventRepositoryError extends Schema20.TaggedErrorClass()("ExecutionEventRepositoryError", {
|
|
2696
|
+
message: Schema20.String
|
|
2657
2697
|
}) {
|
|
2658
2698
|
}
|
|
2659
2699
|
|
|
@@ -2938,18 +2978,18 @@ __export(exports_execution_repository, {
|
|
|
2938
2978
|
DuplicateExecution: () => DuplicateExecution
|
|
2939
2979
|
});
|
|
2940
2980
|
import { and as and3, desc as desc4, eq as eq9, lt, or as or3 } from "drizzle-orm";
|
|
2941
|
-
import { Context as Context11, Effect as Effect11, Layer as Layer11, Schema as
|
|
2942
|
-
class ExecutionRepositoryError extends
|
|
2943
|
-
message:
|
|
2981
|
+
import { Context as Context11, Effect as Effect11, Layer as Layer11, Schema as Schema21 } from "effect";
|
|
2982
|
+
class ExecutionRepositoryError extends Schema21.TaggedErrorClass()("ExecutionRepositoryError", {
|
|
2983
|
+
message: Schema21.String
|
|
2944
2984
|
}) {
|
|
2945
2985
|
}
|
|
2946
2986
|
|
|
2947
|
-
class DuplicateExecution extends
|
|
2987
|
+
class DuplicateExecution extends Schema21.TaggedErrorClass()("DuplicateExecution", {
|
|
2948
2988
|
id: exports_ids_schema.ExecutionId
|
|
2949
2989
|
}) {
|
|
2950
2990
|
}
|
|
2951
2991
|
|
|
2952
|
-
class ExecutionNotFound extends
|
|
2992
|
+
class ExecutionNotFound extends Schema21.TaggedErrorClass()("ExecutionNotFound", {
|
|
2953
2993
|
id: exports_ids_schema.ExecutionId
|
|
2954
2994
|
}) {
|
|
2955
2995
|
}
|
|
@@ -2981,7 +3021,7 @@ var validateCreateInput = (input) => {
|
|
|
2981
3021
|
}
|
|
2982
3022
|
return Effect11.void;
|
|
2983
3023
|
};
|
|
2984
|
-
var cloneAgentDefinition = (definition) =>
|
|
3024
|
+
var cloneAgentDefinition = (definition) => Schema21.decodeUnknownSync(exports_agent_schema.Definition)(globalThis.structuredClone(definition));
|
|
2985
3025
|
var cloneRecord3 = (record2) => ({
|
|
2986
3026
|
...record2,
|
|
2987
3027
|
metadata: globalThis.structuredClone(record2.metadata),
|
|
@@ -3148,9 +3188,9 @@ var transition = Effect11.fn("ExecutionRepository.transition.call")(function* (i
|
|
|
3148
3188
|
});
|
|
3149
3189
|
// ../store-sql/src/idempotency/idempotency-repository.ts
|
|
3150
3190
|
import { eq as eq10, sql as sql7 } from "drizzle-orm";
|
|
3151
|
-
import { Context as Context12, Effect as Effect12, HashMap, Layer as Layer12, Option as Option3, Ref, Schema as
|
|
3152
|
-
class IdempotencyRepositoryError extends
|
|
3153
|
-
message:
|
|
3191
|
+
import { Context as Context12, Effect as Effect12, HashMap, Layer as Layer12, Option as Option3, Ref, Schema as Schema22, Semaphore } from "effect";
|
|
3192
|
+
class IdempotencyRepositoryError extends Schema22.TaggedErrorClass()("IdempotencyRepositoryError", {
|
|
3193
|
+
message: Schema22.String
|
|
3154
3194
|
}) {
|
|
3155
3195
|
}
|
|
3156
3196
|
|
|
@@ -3248,9 +3288,9 @@ __export(exports_memory_repository, {
|
|
|
3248
3288
|
MemoryRepositoryError: () => MemoryRepositoryError
|
|
3249
3289
|
});
|
|
3250
3290
|
import { sql as sql8 } from "drizzle-orm";
|
|
3251
|
-
import { Context as Context13, Effect as Effect13, Layer as Layer13, Ref as Ref2, Schema as
|
|
3252
|
-
class MemoryRepositoryError extends
|
|
3253
|
-
message:
|
|
3291
|
+
import { Context as Context13, Effect as Effect13, Layer as Layer13, Ref as Ref2, Schema as Schema23 } from "effect";
|
|
3292
|
+
class MemoryRepositoryError extends Schema23.TaggedErrorClass()("MemoryRepositoryError", {
|
|
3293
|
+
message: Schema23.String
|
|
3254
3294
|
}) {
|
|
3255
3295
|
}
|
|
3256
3296
|
|
|
@@ -3490,9 +3530,9 @@ __export(exports_permission_rule_repository, {
|
|
|
3490
3530
|
PermissionRuleRepositoryError: () => PermissionRuleRepositoryError
|
|
3491
3531
|
});
|
|
3492
3532
|
import { asc as asc7, eq as eq11 } from "drizzle-orm";
|
|
3493
|
-
import { Context as Context14, Effect as Effect14, Layer as Layer14, Schema as
|
|
3494
|
-
class PermissionRuleRepositoryError extends
|
|
3495
|
-
message:
|
|
3533
|
+
import { Context as Context14, Effect as Effect14, Layer as Layer14, Schema as Schema24 } from "effect";
|
|
3534
|
+
class PermissionRuleRepositoryError extends Schema24.TaggedErrorClass()("PermissionRuleRepositoryError", {
|
|
3535
|
+
message: Schema24.String
|
|
3496
3536
|
}) {
|
|
3497
3537
|
}
|
|
3498
3538
|
|
|
@@ -3581,9 +3621,9 @@ __export(exports_context_epoch_repository, {
|
|
|
3581
3621
|
ContextEpochRepositoryError: () => ContextEpochRepositoryError
|
|
3582
3622
|
});
|
|
3583
3623
|
import { eq as eq12 } from "drizzle-orm";
|
|
3584
|
-
import { Context as Context15, Effect as Effect15, Layer as Layer15, Schema as
|
|
3585
|
-
class ContextEpochRepositoryError extends
|
|
3586
|
-
message:
|
|
3624
|
+
import { Context as Context15, Effect as Effect15, Layer as Layer15, Schema as Schema25 } from "effect";
|
|
3625
|
+
class ContextEpochRepositoryError extends Schema25.TaggedErrorClass()("ContextEpochRepositoryError", {
|
|
3626
|
+
message: Schema25.String
|
|
3587
3627
|
}) {
|
|
3588
3628
|
}
|
|
3589
3629
|
|
|
@@ -3683,20 +3723,20 @@ __export(exports_schedule_repository, {
|
|
|
3683
3723
|
ScheduleClaimMismatch: () => ScheduleClaimMismatch
|
|
3684
3724
|
});
|
|
3685
3725
|
import { and as and4, asc as asc8, eq as eq13, inArray as inArray2, lte as lte2, or as or4, sql as sql9 } from "drizzle-orm";
|
|
3686
|
-
import { Context as Context16, Effect as Effect16, Layer as Layer16, Schema as
|
|
3687
|
-
class ScheduleRepositoryError extends
|
|
3688
|
-
message:
|
|
3726
|
+
import { Context as Context16, Effect as Effect16, Layer as Layer16, Schema as Schema26 } from "effect";
|
|
3727
|
+
class ScheduleRepositoryError extends Schema26.TaggedErrorClass()("ScheduleRepositoryError", {
|
|
3728
|
+
message: Schema26.String
|
|
3689
3729
|
}) {
|
|
3690
3730
|
}
|
|
3691
3731
|
|
|
3692
|
-
class ScheduleNotFound extends
|
|
3732
|
+
class ScheduleNotFound extends Schema26.TaggedErrorClass()("ScheduleNotFound", {
|
|
3693
3733
|
id: exports_ids_schema.ScheduleId
|
|
3694
3734
|
}) {
|
|
3695
3735
|
}
|
|
3696
3736
|
|
|
3697
|
-
class ScheduleClaimMismatch extends
|
|
3737
|
+
class ScheduleClaimMismatch extends Schema26.TaggedErrorClass()("ScheduleClaimMismatch", {
|
|
3698
3738
|
id: exports_ids_schema.ScheduleId,
|
|
3699
|
-
worker_id:
|
|
3739
|
+
worker_id: Schema26.String
|
|
3700
3740
|
}) {
|
|
3701
3741
|
}
|
|
3702
3742
|
|
|
@@ -4020,13 +4060,13 @@ __export(exports_session_repository, {
|
|
|
4020
4060
|
DuplicateSession: () => DuplicateSession
|
|
4021
4061
|
});
|
|
4022
4062
|
import { and as and5, count, desc as desc5, eq as eq14, lt as lt2, or as or5 } from "drizzle-orm";
|
|
4023
|
-
import { Context as Context17, Effect as Effect17, Layer as Layer17, Schema as
|
|
4024
|
-
class SessionRepositoryError extends
|
|
4025
|
-
message:
|
|
4063
|
+
import { Context as Context17, Effect as Effect17, Layer as Layer17, Schema as Schema27 } from "effect";
|
|
4064
|
+
class SessionRepositoryError extends Schema27.TaggedErrorClass()("SessionRepositoryError", {
|
|
4065
|
+
message: Schema27.String
|
|
4026
4066
|
}) {
|
|
4027
4067
|
}
|
|
4028
4068
|
|
|
4029
|
-
class DuplicateSession extends
|
|
4069
|
+
class DuplicateSession extends Schema27.TaggedErrorClass()("DuplicateSession", {
|
|
4030
4070
|
id: exports_ids_schema.SessionId
|
|
4031
4071
|
}) {
|
|
4032
4072
|
}
|
|
@@ -4509,9 +4549,9 @@ __export(exports_skill_definition_repository, {
|
|
|
4509
4549
|
Service: () => Service18
|
|
4510
4550
|
});
|
|
4511
4551
|
import { asc as asc9, desc as desc6, eq as eq15, inArray as inArray3, sql as sql10 } from "drizzle-orm";
|
|
4512
|
-
import { Context as Context18, Effect as Effect18, HashSet, Layer as Layer18, Schema as
|
|
4513
|
-
class SkillDefinitionRepositoryError extends
|
|
4514
|
-
message:
|
|
4552
|
+
import { Context as Context18, Effect as Effect18, HashSet, Layer as Layer18, Schema as Schema28, Semaphore as Semaphore2 } from "effect";
|
|
4553
|
+
class SkillDefinitionRepositoryError extends Schema28.TaggedErrorClass()("SkillDefinitionRepositoryError", {
|
|
4554
|
+
message: Schema28.String
|
|
4515
4555
|
}) {
|
|
4516
4556
|
}
|
|
4517
4557
|
|
|
@@ -4537,7 +4577,7 @@ var toPinRecord = (row) => ({
|
|
|
4537
4577
|
skillDefinitionSnapshot: row.skillDefinitionSnapshotJson,
|
|
4538
4578
|
createdAt: fromPgDate(row.createdAt)
|
|
4539
4579
|
});
|
|
4540
|
-
var cloneDefinition2 = (definition) =>
|
|
4580
|
+
var cloneDefinition2 = (definition) => Schema28.decodeUnknownSync(exports_skill_schema.Definition)(globalThis.structuredClone(definition));
|
|
4541
4581
|
var cloneRecord6 = (record2) => ({
|
|
4542
4582
|
...record2,
|
|
4543
4583
|
definition: cloneDefinition2(record2.definition)
|
|
@@ -4812,22 +4852,22 @@ __export(exports_steering_repository, {
|
|
|
4812
4852
|
Service: () => Service19
|
|
4813
4853
|
});
|
|
4814
4854
|
import { asc as asc10, eq as eq16, inArray as inArray4, isNull, max as max2, sql as sql11 } from "drizzle-orm";
|
|
4815
|
-
import { Context as Context19, Effect as Effect19, Layer as Layer19, Ref as Ref3, Schema as
|
|
4816
|
-
class SteeringRepositoryError extends
|
|
4817
|
-
message:
|
|
4855
|
+
import { Context as Context19, Effect as Effect19, Layer as Layer19, Ref as Ref3, Schema as Schema29 } from "effect";
|
|
4856
|
+
class SteeringRepositoryError extends Schema29.TaggedErrorClass()("SteeringRepositoryError", {
|
|
4857
|
+
message: Schema29.String
|
|
4818
4858
|
}) {
|
|
4819
4859
|
}
|
|
4820
4860
|
|
|
4821
4861
|
class Service19 extends Context19.Service()("@relayfx/store-sql/SteeringRepository") {
|
|
4822
4862
|
}
|
|
4823
|
-
var SteeringKindSchema =
|
|
4863
|
+
var SteeringKindSchema = Schema29.Literals(["steering", "follow_up"]);
|
|
4824
4864
|
var mapDatabaseError15 = (effect) => effect.pipe(Effect19.mapError((error) => new SteeringRepositoryError({ message: String(error) })));
|
|
4825
4865
|
var mapTransactionError = (effect) => effect.pipe(Effect19.mapError((error) => error instanceof SteeringRepositoryError ? error : new SteeringRepositoryError({ message: String(error) })));
|
|
4826
4866
|
var toMessageRecord = (row) => {
|
|
4827
4867
|
const consumedAt = fromNullablePgDate(row.consumedAt);
|
|
4828
4868
|
return {
|
|
4829
4869
|
executionId: exports_ids_schema.ExecutionId.make(row.executionId),
|
|
4830
|
-
kind:
|
|
4870
|
+
kind: Schema29.decodeUnknownSync(SteeringKindSchema)(row.kind),
|
|
4831
4871
|
sequence: row.sequence,
|
|
4832
4872
|
content: row.contentJson,
|
|
4833
4873
|
...row.drainId === null || row.drainId === undefined ? {} : { drainId: row.drainId },
|
|
@@ -4837,7 +4877,7 @@ var toMessageRecord = (row) => {
|
|
|
4837
4877
|
};
|
|
4838
4878
|
var toDrainRecord = (row) => ({
|
|
4839
4879
|
executionId: exports_ids_schema.ExecutionId.make(row.executionId),
|
|
4840
|
-
kind:
|
|
4880
|
+
kind: Schema29.decodeUnknownSync(SteeringKindSchema)(row.kind),
|
|
4841
4881
|
drainId: row.drainId,
|
|
4842
4882
|
messageSequences: row.messageSequencesJson,
|
|
4843
4883
|
createdAt: fromPgDate(row.createdAt)
|
|
@@ -5048,23 +5088,23 @@ __export(exports_tool_call_repository, {
|
|
|
5048
5088
|
DuplicateToolCall: () => DuplicateToolCall
|
|
5049
5089
|
});
|
|
5050
5090
|
import { asc as asc11, eq as eq17 } from "drizzle-orm";
|
|
5051
|
-
import { Context as Context20, Effect as Effect20, Layer as Layer20, Schema as
|
|
5052
|
-
class ToolCallRepositoryError extends
|
|
5053
|
-
message:
|
|
5091
|
+
import { Context as Context20, Effect as Effect20, Layer as Layer20, Schema as Schema30 } from "effect";
|
|
5092
|
+
class ToolCallRepositoryError extends Schema30.TaggedErrorClass()("ToolCallRepositoryError", {
|
|
5093
|
+
message: Schema30.String
|
|
5054
5094
|
}) {
|
|
5055
5095
|
}
|
|
5056
5096
|
|
|
5057
|
-
class ToolCallNotFound extends
|
|
5097
|
+
class ToolCallNotFound extends Schema30.TaggedErrorClass()("ToolCallNotFound", {
|
|
5058
5098
|
id: exports_ids_schema.ToolCallId
|
|
5059
5099
|
}) {
|
|
5060
5100
|
}
|
|
5061
5101
|
|
|
5062
|
-
class DuplicateToolCall extends
|
|
5102
|
+
class DuplicateToolCall extends Schema30.TaggedErrorClass()("DuplicateToolCall", {
|
|
5063
5103
|
id: exports_ids_schema.ToolCallId
|
|
5064
5104
|
}) {
|
|
5065
5105
|
}
|
|
5066
5106
|
|
|
5067
|
-
class DuplicateToolResult extends
|
|
5107
|
+
class DuplicateToolResult extends Schema30.TaggedErrorClass()("DuplicateToolResult", {
|
|
5068
5108
|
call_id: exports_ids_schema.ToolCallId
|
|
5069
5109
|
}) {
|
|
5070
5110
|
}
|
|
@@ -5233,18 +5273,18 @@ __export(exports_workspace_lease_repository, {
|
|
|
5233
5273
|
DuplicateWorkspaceLease: () => DuplicateWorkspaceLease
|
|
5234
5274
|
});
|
|
5235
5275
|
import { eq as eq18, notInArray } from "drizzle-orm";
|
|
5236
|
-
import { Context as Context21, Effect as Effect21, Layer as Layer21, Schema as
|
|
5237
|
-
class WorkspaceLeaseRepositoryError extends
|
|
5238
|
-
message:
|
|
5276
|
+
import { Context as Context21, Effect as Effect21, Layer as Layer21, Schema as Schema31 } from "effect";
|
|
5277
|
+
class WorkspaceLeaseRepositoryError extends Schema31.TaggedErrorClass()("WorkspaceLeaseRepositoryError", {
|
|
5278
|
+
message: Schema31.String
|
|
5239
5279
|
}) {
|
|
5240
5280
|
}
|
|
5241
5281
|
|
|
5242
|
-
class DuplicateWorkspaceLease extends
|
|
5282
|
+
class DuplicateWorkspaceLease extends Schema31.TaggedErrorClass()("DuplicateWorkspaceLease", {
|
|
5243
5283
|
execution_id: exports_ids_schema.ExecutionId
|
|
5244
5284
|
}) {
|
|
5245
5285
|
}
|
|
5246
5286
|
|
|
5247
|
-
class WorkspaceLeaseNotFound extends
|
|
5287
|
+
class WorkspaceLeaseNotFound extends Schema31.TaggedErrorClass()("WorkspaceLeaseNotFound", {
|
|
5248
5288
|
execution_id: exports_ids_schema.ExecutionId
|
|
5249
5289
|
}) {
|
|
5250
5290
|
}
|
|
@@ -5254,8 +5294,8 @@ class Service21 extends Context21.Service()("@relayfx/store-sql/WorkspaceLeaseRe
|
|
|
5254
5294
|
var metadata9 = (input) => input ?? {};
|
|
5255
5295
|
var terminalStatuses = ["released", "failed"];
|
|
5256
5296
|
var isActive = (record2) => !terminalStatuses.includes(record2.status);
|
|
5257
|
-
var cloneLease = (record2) =>
|
|
5258
|
-
var cloneSnapshot = (record2) =>
|
|
5297
|
+
var cloneLease = (record2) => Schema31.decodeUnknownSync(exports_workspace_schema.WorkspaceLeaseRecord)(globalThis.structuredClone(record2));
|
|
5298
|
+
var cloneSnapshot = (record2) => Schema31.decodeUnknownSync(exports_workspace_schema.WorkspaceSnapshotRecord)(globalThis.structuredClone(record2));
|
|
5259
5299
|
var toPlanInsert = (tenantId2, input) => ({
|
|
5260
5300
|
tenantId: tenantId2,
|
|
5261
5301
|
id: input.id,
|
|
@@ -5518,7 +5558,7 @@ var markFailed = Effect21.fn("WorkspaceLeaseRepository.markFailed.call")(functio
|
|
|
5518
5558
|
return yield* repository.markFailed(input);
|
|
5519
5559
|
});
|
|
5520
5560
|
// ../runtime/src/address/address-book-service.ts
|
|
5521
|
-
import { Context as Context22, Effect as Effect23, Layer as Layer22, Ref as Ref4, Schema as
|
|
5561
|
+
import { Context as Context22, Effect as Effect23, Layer as Layer22, Ref as Ref4, Schema as Schema32 } from "effect";
|
|
5522
5562
|
|
|
5523
5563
|
// ../runtime/src/observability/runtime-metrics.ts
|
|
5524
5564
|
import { Effect as Effect22, Metric } from "effect";
|
|
@@ -5563,25 +5603,25 @@ var RouteKind3 = exports_address_schema.RouteKind;
|
|
|
5563
5603
|
var Route2 = exports_address_schema.Route;
|
|
5564
5604
|
var RouteRecord2 = exports_address_schema.RouteRecord;
|
|
5565
5605
|
|
|
5566
|
-
class AddressNotFound2 extends
|
|
5606
|
+
class AddressNotFound2 extends Schema32.TaggedErrorClass()("AddressNotFound", {
|
|
5567
5607
|
address_id: exports_ids_schema.AddressId
|
|
5568
5608
|
}) {
|
|
5569
5609
|
}
|
|
5570
5610
|
|
|
5571
|
-
class AddressUnavailable extends
|
|
5611
|
+
class AddressUnavailable extends Schema32.TaggedErrorClass()("AddressUnavailable", {
|
|
5572
5612
|
address_id: exports_ids_schema.AddressId,
|
|
5573
|
-
route_key:
|
|
5613
|
+
route_key: Schema32.String
|
|
5574
5614
|
}) {
|
|
5575
5615
|
}
|
|
5576
5616
|
|
|
5577
|
-
class AddressDeferred extends
|
|
5617
|
+
class AddressDeferred extends Schema32.TaggedErrorClass()("AddressDeferred", {
|
|
5578
5618
|
address_id: exports_ids_schema.AddressId,
|
|
5579
|
-
route_key:
|
|
5619
|
+
route_key: Schema32.String
|
|
5580
5620
|
}) {
|
|
5581
5621
|
}
|
|
5582
5622
|
|
|
5583
|
-
class AddressBookServiceError extends
|
|
5584
|
-
message:
|
|
5623
|
+
class AddressBookServiceError extends Schema32.TaggedErrorClass()("AddressBookServiceError", {
|
|
5624
|
+
message: Schema32.String
|
|
5585
5625
|
}) {
|
|
5586
5626
|
}
|
|
5587
5627
|
|
|
@@ -5609,7 +5649,7 @@ var recordFromEntry = (entry) => ({
|
|
|
5609
5649
|
updated_at: entry.updatedAt
|
|
5610
5650
|
});
|
|
5611
5651
|
var entryIdFor = (addressId) => exports_ids_schema.AddressBookEntryId.make(`address-book:${addressId}`);
|
|
5612
|
-
var validateRoute = (route) =>
|
|
5652
|
+
var validateRoute = (route) => Schema32.decodeUnknownEffect(Route2)(route).pipe(Effect23.mapError((error) => new AddressBookServiceError({ message: String(error) })));
|
|
5613
5653
|
var mapRepositoryError = (error) => {
|
|
5614
5654
|
if (error._tag === "AddressNotFound") {
|
|
5615
5655
|
return new AddressNotFound2({ address_id: error.address_id });
|
|
@@ -5749,7 +5789,7 @@ __export(exports_address_resolution_service, {
|
|
|
5749
5789
|
AddressResolutionError: () => AddressResolutionError,
|
|
5750
5790
|
AddressAgentDefinitionNotFound: () => AddressAgentDefinitionNotFound
|
|
5751
5791
|
});
|
|
5752
|
-
import { Context as Context27, Effect as Effect29, Layer as Layer27, Schema as
|
|
5792
|
+
import { Context as Context27, Effect as Effect29, Layer as Layer27, Schema as Schema37 } from "effect";
|
|
5753
5793
|
|
|
5754
5794
|
// ../runtime/src/agent/agent-registry-service.ts
|
|
5755
5795
|
var exports_agent_registry_service = {};
|
|
@@ -5765,7 +5805,7 @@ __export(exports_agent_registry_service, {
|
|
|
5765
5805
|
AgentRegistryError: () => AgentRegistryError,
|
|
5766
5806
|
AgentDefinitionInvalid: () => AgentDefinitionInvalid
|
|
5767
5807
|
});
|
|
5768
|
-
import { Clock, Context as Context26, Crypto as Crypto2, Effect as Effect28, HashSet as HashSet4, Layer as Layer26, Option as Option7, Schema as
|
|
5808
|
+
import { Clock, Context as Context26, Crypto as Crypto2, Effect as Effect28, HashSet as HashSet4, Layer as Layer26, Option as Option7, Schema as Schema36 } from "effect";
|
|
5769
5809
|
|
|
5770
5810
|
// ../runtime/src/tool/tool-input-schema-digest.ts
|
|
5771
5811
|
import { Crypto, Effect as Effect24 } from "effect";
|
|
@@ -5809,7 +5849,7 @@ __export(exports_tool_runtime_service, {
|
|
|
5809
5849
|
Service: () => Service25
|
|
5810
5850
|
});
|
|
5811
5851
|
import * as Ai from "effect/unstable/ai";
|
|
5812
|
-
import { Chunk, Context as Context25, Effect as Effect27, HashSet as HashSet3, Layer as Layer25, Option as Option6, Ref as Ref6, Schema as
|
|
5852
|
+
import { Chunk, Context as Context25, Effect as Effect27, HashSet as HashSet3, Layer as Layer25, Option as Option6, Ref as Ref6, Schema as Schema35, Sink, Stream as Stream3 } from "effect";
|
|
5813
5853
|
|
|
5814
5854
|
// ../runtime/src/execution/event-log-service.ts
|
|
5815
5855
|
var exports_event_log_service = {};
|
|
@@ -5843,17 +5883,17 @@ import {
|
|
|
5843
5883
|
Option as Option4,
|
|
5844
5884
|
PubSub,
|
|
5845
5885
|
Ref as Ref5,
|
|
5846
|
-
Schema as
|
|
5886
|
+
Schema as Schema33,
|
|
5847
5887
|
Stream as Stream2
|
|
5848
5888
|
} from "effect";
|
|
5849
|
-
class EventLogCursorNotFound extends
|
|
5889
|
+
class EventLogCursorNotFound extends Schema33.TaggedErrorClass()("EventLogCursorNotFound", {
|
|
5850
5890
|
execution_id: exports_ids_schema.ExecutionId,
|
|
5851
5891
|
cursor: exports_shared_schema.NonEmptyString
|
|
5852
5892
|
}) {
|
|
5853
5893
|
}
|
|
5854
5894
|
|
|
5855
|
-
class EventLogError extends
|
|
5856
|
-
message:
|
|
5895
|
+
class EventLogError extends Schema33.TaggedErrorClass()("EventLogError", {
|
|
5896
|
+
message: Schema33.String
|
|
5857
5897
|
}) {
|
|
5858
5898
|
}
|
|
5859
5899
|
|
|
@@ -6112,19 +6152,19 @@ __export(exports_wait_service, {
|
|
|
6112
6152
|
WaitDefinitionMissing: () => WaitDefinitionMissing,
|
|
6113
6153
|
Service: () => Service24
|
|
6114
6154
|
});
|
|
6115
|
-
import { Context as Context24, Duration as Duration2, Effect as Effect26, Layer as Layer24, Option as Option5, Schema as
|
|
6116
|
-
class WaitNotFound2 extends
|
|
6155
|
+
import { Context as Context24, Duration as Duration2, Effect as Effect26, Layer as Layer24, Option as Option5, Schema as Schema34 } from "effect";
|
|
6156
|
+
class WaitNotFound2 extends Schema34.TaggedErrorClass()("WaitNotFound", {
|
|
6117
6157
|
wait_id: exports_ids_schema.WaitId
|
|
6118
6158
|
}) {
|
|
6119
6159
|
}
|
|
6120
6160
|
|
|
6121
|
-
class WaitDefinitionMissing extends
|
|
6161
|
+
class WaitDefinitionMissing extends Schema34.TaggedErrorClass()("WaitDefinitionMissing", {
|
|
6122
6162
|
envelope_id: exports_ids_schema.EnvelopeId
|
|
6123
6163
|
}) {
|
|
6124
6164
|
}
|
|
6125
6165
|
|
|
6126
|
-
class WaitServiceError extends
|
|
6127
|
-
message:
|
|
6166
|
+
class WaitServiceError extends Schema34.TaggedErrorClass()("WaitServiceError", {
|
|
6167
|
+
message: Schema34.String
|
|
6128
6168
|
}) {
|
|
6129
6169
|
}
|
|
6130
6170
|
|
|
@@ -6312,37 +6352,37 @@ var cancel2 = Effect26.fn("WaitService.cancel.call")(function* (input) {
|
|
|
6312
6352
|
});
|
|
6313
6353
|
|
|
6314
6354
|
// ../runtime/src/tool/tool-runtime-service.ts
|
|
6315
|
-
class ToolNotRegistered extends
|
|
6355
|
+
class ToolNotRegistered extends Schema35.TaggedErrorClass()("ToolNotRegistered", {
|
|
6316
6356
|
tool_name: exports_shared_schema.NonEmptyString
|
|
6317
6357
|
}) {
|
|
6318
6358
|
}
|
|
6319
6359
|
|
|
6320
|
-
class ToolPermissionDenied extends
|
|
6360
|
+
class ToolPermissionDenied extends Schema35.TaggedErrorClass()("ToolPermissionDenied", {
|
|
6321
6361
|
tool_name: exports_shared_schema.NonEmptyString,
|
|
6322
6362
|
permission_name: exports_shared_schema.NonEmptyString
|
|
6323
6363
|
}) {
|
|
6324
6364
|
}
|
|
6325
6365
|
|
|
6326
|
-
class ToolInputInvalid extends
|
|
6366
|
+
class ToolInputInvalid extends Schema35.TaggedErrorClass()("ToolInputInvalid", {
|
|
6327
6367
|
tool_name: exports_shared_schema.NonEmptyString,
|
|
6328
|
-
message:
|
|
6368
|
+
message: Schema35.String
|
|
6329
6369
|
}) {
|
|
6330
6370
|
}
|
|
6331
6371
|
|
|
6332
|
-
class ToolExecutionFailed extends
|
|
6372
|
+
class ToolExecutionFailed extends Schema35.TaggedErrorClass()("ToolExecutionFailed", {
|
|
6333
6373
|
tool_name: exports_shared_schema.NonEmptyString,
|
|
6334
|
-
message:
|
|
6374
|
+
message: Schema35.String
|
|
6335
6375
|
}) {
|
|
6336
6376
|
}
|
|
6337
6377
|
|
|
6338
|
-
class ToolExecutionWaitRequested extends
|
|
6378
|
+
class ToolExecutionWaitRequested extends Schema35.TaggedErrorClass()("ToolExecutionWaitRequested", {
|
|
6339
6379
|
tool_name: exports_shared_schema.NonEmptyString,
|
|
6340
6380
|
wait_id: exports_ids_schema.WaitId
|
|
6341
6381
|
}) {
|
|
6342
6382
|
}
|
|
6343
6383
|
|
|
6344
|
-
class ToolRuntimeError extends
|
|
6345
|
-
message:
|
|
6384
|
+
class ToolRuntimeError extends Schema35.TaggedErrorClass()("ToolRuntimeError", {
|
|
6385
|
+
message: Schema35.String
|
|
6346
6386
|
}) {
|
|
6347
6387
|
}
|
|
6348
6388
|
|
|
@@ -6363,7 +6403,7 @@ var ensureAllowed = (tool, input) => {
|
|
|
6363
6403
|
var validateInput = (tool, input) => {
|
|
6364
6404
|
if (tool.inputSchema === undefined)
|
|
6365
6405
|
return Effect27.void;
|
|
6366
|
-
return
|
|
6406
|
+
return Schema35.decodeUnknownEffect(tool.inputSchema)(input.call.input).pipe(Effect27.mapError((error) => new ToolInputInvalid({ tool_name: input.call.name, message: error.message })), Effect27.asVoid);
|
|
6367
6407
|
};
|
|
6368
6408
|
var mapRepositoryError3 = (error) => new ToolRuntimeError({ message: error._tag });
|
|
6369
6409
|
var mapEventLogError2 = (error) => new ToolRuntimeError({ message: error._tag });
|
|
@@ -6418,8 +6458,8 @@ var upsertTool = (registry, tool) => {
|
|
|
6418
6458
|
return Chunk.map(registry, (registered) => registered.definition.name === tool.definition.name ? tool : registered);
|
|
6419
6459
|
};
|
|
6420
6460
|
var registerTool = (tools, tool) => Ref6.update(tools, (registry) => upsertTool(registry, tool));
|
|
6421
|
-
var jsonValue = (value) =>
|
|
6422
|
-
var fallbackParametersSchema =
|
|
6461
|
+
var jsonValue = (value) => Schema35.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
6462
|
+
var fallbackParametersSchema = Schema35.Struct({});
|
|
6423
6463
|
var parametersForRegisteredTool = (inputSchema) => {
|
|
6424
6464
|
const schema = exports_tool_schema.parametersSchema(inputSchema);
|
|
6425
6465
|
return schema.ast._tag === "Unknown" ? { parameters: fallbackParametersSchema, jsonSchema: inputSchema } : { parameters: schema };
|
|
@@ -6432,7 +6472,7 @@ var aiToolFromRegistered = (tool) => {
|
|
|
6432
6472
|
return attachJsonSchema(Ai.Tool.dynamic(tool.definition.name, {
|
|
6433
6473
|
description: tool.definition.description,
|
|
6434
6474
|
parameters: parameters.parameters,
|
|
6435
|
-
success:
|
|
6475
|
+
success: Schema35.Unknown,
|
|
6436
6476
|
needsApproval: tool.definition.needs_approval
|
|
6437
6477
|
}), parameters.jsonSchema);
|
|
6438
6478
|
};
|
|
@@ -6621,13 +6661,13 @@ var run = Effect27.fn("ToolRuntime.run.call")(function* (input) {
|
|
|
6621
6661
|
});
|
|
6622
6662
|
|
|
6623
6663
|
// ../runtime/src/agent/agent-registry-service.ts
|
|
6624
|
-
class AgentDefinitionInvalid extends
|
|
6625
|
-
message:
|
|
6664
|
+
class AgentDefinitionInvalid extends Schema36.TaggedErrorClass()("AgentDefinitionInvalid", {
|
|
6665
|
+
message: Schema36.String
|
|
6626
6666
|
}) {
|
|
6627
6667
|
}
|
|
6628
6668
|
|
|
6629
|
-
class AgentRegistryError extends
|
|
6630
|
-
message:
|
|
6669
|
+
class AgentRegistryError extends Schema36.TaggedErrorClass()("AgentRegistryError", {
|
|
6670
|
+
message: Schema36.String
|
|
6631
6671
|
}) {
|
|
6632
6672
|
}
|
|
6633
6673
|
|
|
@@ -6771,41 +6811,41 @@ var listRevisions3 = Effect28.fn("AgentRegistry.listRevisions.call")(function* (
|
|
|
6771
6811
|
});
|
|
6772
6812
|
|
|
6773
6813
|
// ../runtime/src/address/address-resolution-service.ts
|
|
6774
|
-
class AddressRouteNotFound extends
|
|
6814
|
+
class AddressRouteNotFound extends Schema37.TaggedErrorClass()("AddressRouteNotFound", {
|
|
6775
6815
|
address_id: exports_ids_schema.AddressId
|
|
6776
6816
|
}) {
|
|
6777
6817
|
}
|
|
6778
6818
|
|
|
6779
|
-
class AddressRouteKindMismatch extends
|
|
6819
|
+
class AddressRouteKindMismatch extends Schema37.TaggedErrorClass()("AddressRouteKindMismatch", {
|
|
6780
6820
|
address_id: exports_ids_schema.AddressId,
|
|
6781
|
-
expected:
|
|
6821
|
+
expected: Schema37.Literal("local-agent"),
|
|
6782
6822
|
actual: exports_address_schema.RouteKind,
|
|
6783
|
-
route_key:
|
|
6823
|
+
route_key: Schema37.String
|
|
6784
6824
|
}) {
|
|
6785
6825
|
}
|
|
6786
6826
|
|
|
6787
|
-
class AddressAgentDefinitionNotFound extends
|
|
6827
|
+
class AddressAgentDefinitionNotFound extends Schema37.TaggedErrorClass()("AddressAgentDefinitionNotFound", {
|
|
6788
6828
|
address_id: exports_ids_schema.AddressId,
|
|
6789
6829
|
agent_definition_id: exports_ids_schema.AgentDefinitionId
|
|
6790
6830
|
}) {
|
|
6791
6831
|
}
|
|
6792
6832
|
|
|
6793
|
-
class AddressResolutionError extends
|
|
6794
|
-
message:
|
|
6833
|
+
class AddressResolutionError extends Schema37.TaggedErrorClass()("AddressResolutionError", {
|
|
6834
|
+
message: Schema37.String
|
|
6795
6835
|
}) {
|
|
6796
6836
|
}
|
|
6797
|
-
var LocalAgentRoute =
|
|
6798
|
-
kind:
|
|
6837
|
+
var LocalAgentRoute = Schema37.Struct({
|
|
6838
|
+
kind: Schema37.Literal("local-agent"),
|
|
6799
6839
|
route_key: exports_shared_schema.NonEmptyString,
|
|
6800
|
-
metadata:
|
|
6840
|
+
metadata: Schema37.optionalKey(exports_shared_schema.Metadata)
|
|
6801
6841
|
}).annotate({ identifier: "Relay.AddressResolution.LocalAgentRoute" });
|
|
6802
|
-
var LocalAgentTarget =
|
|
6842
|
+
var LocalAgentTarget = Schema37.Struct({
|
|
6803
6843
|
address_id: exports_ids_schema.AddressId,
|
|
6804
6844
|
route: LocalAgentRoute,
|
|
6805
6845
|
agent_definition_id: exports_ids_schema.AgentDefinitionId,
|
|
6806
6846
|
agent_definition_revision: exports_agent_schema.DefinitionRevision,
|
|
6807
6847
|
agent_definition_snapshot: exports_agent_schema.Definition,
|
|
6808
|
-
tool_input_schema_digests:
|
|
6848
|
+
tool_input_schema_digests: Schema37.optionalKey(exports_agent_schema.ToolInputSchemaDigests)
|
|
6809
6849
|
}).annotate({ identifier: "Relay.AddressResolution.LocalAgentTarget" });
|
|
6810
6850
|
|
|
6811
6851
|
class Service27 extends Context27.Service()("@relayfx/runtime/AddressResolution") {
|
|
@@ -6838,7 +6878,7 @@ var layer25 = Layer27.effect(Service27, Effect29.gen(function* () {
|
|
|
6838
6878
|
return yield* Effect29.fail(new AddressRouteNotFound({ address_id: addressId }));
|
|
6839
6879
|
}
|
|
6840
6880
|
const route = yield* routeToLocalAgent(addressId, record2.route);
|
|
6841
|
-
const agentDefinitionId = yield*
|
|
6881
|
+
const agentDefinitionId = yield* Schema37.decodeUnknownEffect(exports_ids_schema.AgentDefinitionId)(route.route_key).pipe(Effect29.mapError((error) => new AddressResolutionError({ message: String(error) })));
|
|
6842
6882
|
const definition = yield* agentRegistry.get(agentDefinitionId).pipe(Effect29.mapError(mapAgentRegistryError));
|
|
6843
6883
|
if (definition === undefined) {
|
|
6844
6884
|
return yield* Effect29.fail(new AddressAgentDefinitionNotFound({
|
|
@@ -6903,7 +6943,7 @@ __export(exports_agent_event, {
|
|
|
6903
6943
|
AgentSuspended: () => AgentSuspended,
|
|
6904
6944
|
AgentError: () => AgentError
|
|
6905
6945
|
});
|
|
6906
|
-
import { Schema as
|
|
6946
|
+
import { Schema as Schema38 } from "effect";
|
|
6907
6947
|
import * as Ai2 from "effect/unstable/ai";
|
|
6908
6948
|
var addUsageField = (left, right) => left === undefined && right === undefined ? undefined : (left ?? 0) + (right ?? 0);
|
|
6909
6949
|
var addUsage = (left, right) => new Ai2.Response.Usage({
|
|
@@ -6920,34 +6960,34 @@ var addUsage = (left, right) => new Ai2.Response.Usage({
|
|
|
6920
6960
|
}
|
|
6921
6961
|
});
|
|
6922
6962
|
|
|
6923
|
-
class AgentError extends
|
|
6924
|
-
message:
|
|
6925
|
-
turn:
|
|
6926
|
-
cause:
|
|
6963
|
+
class AgentError extends Schema38.TaggedErrorClass()("@batonfx/core/AgentError", {
|
|
6964
|
+
message: Schema38.String,
|
|
6965
|
+
turn: Schema38.Number,
|
|
6966
|
+
cause: Schema38.optionalKey(Schema38.Defect())
|
|
6927
6967
|
}) {
|
|
6928
6968
|
}
|
|
6929
6969
|
|
|
6930
|
-
class TurnLimitExceeded extends
|
|
6931
|
-
turn:
|
|
6932
|
-
pending:
|
|
6933
|
-
tool_call_id:
|
|
6934
|
-
tool_name:
|
|
6970
|
+
class TurnLimitExceeded extends Schema38.TaggedErrorClass()("@batonfx/core/TurnLimitExceeded", {
|
|
6971
|
+
turn: Schema38.Number,
|
|
6972
|
+
pending: Schema38.Array(Schema38.Struct({
|
|
6973
|
+
tool_call_id: Schema38.String,
|
|
6974
|
+
tool_name: Schema38.String
|
|
6935
6975
|
}))
|
|
6936
6976
|
}) {
|
|
6937
6977
|
}
|
|
6938
6978
|
|
|
6939
|
-
class MiddlewareViolation extends
|
|
6940
|
-
turn:
|
|
6941
|
-
detail:
|
|
6979
|
+
class MiddlewareViolation extends Schema38.TaggedErrorClass()("@batonfx/core/MiddlewareViolation", {
|
|
6980
|
+
turn: Schema38.Number,
|
|
6981
|
+
detail: Schema38.String
|
|
6942
6982
|
}) {
|
|
6943
6983
|
}
|
|
6944
6984
|
|
|
6945
|
-
class AgentSuspended extends
|
|
6946
|
-
token:
|
|
6947
|
-
reason:
|
|
6948
|
-
tool_call_id:
|
|
6949
|
-
tool_name:
|
|
6950
|
-
tool_params:
|
|
6985
|
+
class AgentSuspended extends Schema38.TaggedErrorClass()("@batonfx/core/AgentSuspended", {
|
|
6986
|
+
token: Schema38.String,
|
|
6987
|
+
reason: Schema38.Literals(["tool-wait", "approval"]),
|
|
6988
|
+
tool_call_id: Schema38.String,
|
|
6989
|
+
tool_name: Schema38.String,
|
|
6990
|
+
tool_params: Schema38.Unknown
|
|
6951
6991
|
}) {
|
|
6952
6992
|
}
|
|
6953
6993
|
|
|
@@ -6982,7 +7022,7 @@ __export(exports_compaction, {
|
|
|
6982
7022
|
CompactionError: () => CompactionError,
|
|
6983
7023
|
Compaction: () => Compaction
|
|
6984
7024
|
});
|
|
6985
|
-
import { Context as Context31, Effect as Effect33, Layer as Layer31, Option as Option10, Schema as
|
|
7025
|
+
import { Context as Context31, Effect as Effect33, Layer as Layer31, Option as Option10, Schema as Schema41 } from "effect";
|
|
6986
7026
|
import * as Ai4 from "effect/unstable/ai";
|
|
6987
7027
|
|
|
6988
7028
|
// ../../node_modules/.bun/@batonfx+core@0.1.1/node_modules/@batonfx/core/src/session.ts
|
|
@@ -6994,11 +7034,11 @@ __export(exports_session, {
|
|
|
6994
7034
|
SessionStoreError: () => SessionStoreError,
|
|
6995
7035
|
SessionStore: () => SessionStore
|
|
6996
7036
|
});
|
|
6997
|
-
import { Context as Context29, Effect as Effect31, HashMap as HashMap3, Layer as Layer29, Option as Option8, Ref as Ref7, Schema as
|
|
7037
|
+
import { Context as Context29, Effect as Effect31, HashMap as HashMap3, Layer as Layer29, Option as Option8, Ref as Ref7, Schema as Schema39 } from "effect";
|
|
6998
7038
|
import * as Ai3 from "effect/unstable/ai";
|
|
6999
7039
|
|
|
7000
|
-
class SessionStoreError extends
|
|
7001
|
-
message:
|
|
7040
|
+
class SessionStoreError extends Schema39.TaggedErrorClass()("@batonfx/core/SessionStoreError", {
|
|
7041
|
+
message: Schema39.String
|
|
7002
7042
|
}) {
|
|
7003
7043
|
}
|
|
7004
7044
|
|
|
@@ -7127,13 +7167,13 @@ __export(exports_tool_output, {
|
|
|
7127
7167
|
ToolOutputStore: () => ToolOutputStore,
|
|
7128
7168
|
ToolOutputError: () => ToolOutputError
|
|
7129
7169
|
});
|
|
7130
|
-
import { Context as Context30, Effect as Effect32, HashMap as HashMap4, Layer as Layer30, Option as Option9, Ref as Ref8, Schema as
|
|
7170
|
+
import { Context as Context30, Effect as Effect32, HashMap as HashMap4, Layer as Layer30, Option as Option9, Ref as Ref8, Schema as Schema40 } from "effect";
|
|
7131
7171
|
|
|
7132
7172
|
class ToolOutputStore extends Context30.Service()("@batonfx/core/ToolOutputStore") {
|
|
7133
7173
|
}
|
|
7134
7174
|
|
|
7135
|
-
class ToolOutputError extends
|
|
7136
|
-
message:
|
|
7175
|
+
class ToolOutputError extends Schema40.TaggedErrorClass()("@batonfx/core/ToolOutputError", {
|
|
7176
|
+
message: Schema40.String
|
|
7137
7177
|
}) {
|
|
7138
7178
|
}
|
|
7139
7179
|
var layerNoop = Layer30.succeed(ToolOutputStore, ToolOutputStore.of({ put: () => Effect32.succeed(Option9.none()) }));
|
|
@@ -7196,9 +7236,9 @@ Use Markdown with these sections:
|
|
|
7196
7236
|
|
|
7197
7237
|
Do not mention that context was compacted.`;
|
|
7198
7238
|
|
|
7199
|
-
class CompactionError extends
|
|
7200
|
-
message:
|
|
7201
|
-
cause:
|
|
7239
|
+
class CompactionError extends Schema41.TaggedErrorClass()("@batonfx/core/CompactionError", {
|
|
7240
|
+
message: Schema41.String,
|
|
7241
|
+
cause: Schema41.optionalKey(Schema41.Defect())
|
|
7202
7242
|
}) {
|
|
7203
7243
|
}
|
|
7204
7244
|
|
|
@@ -7417,10 +7457,10 @@ __export(exports_memory, {
|
|
|
7417
7457
|
MemoryError: () => MemoryError,
|
|
7418
7458
|
Memory: () => Memory
|
|
7419
7459
|
});
|
|
7420
|
-
import { Context as Context33, Effect as Effect35, Layer as Layer33, Schema as
|
|
7460
|
+
import { Context as Context33, Effect as Effect35, Layer as Layer33, Schema as Schema42 } from "effect";
|
|
7421
7461
|
|
|
7422
|
-
class MemoryError extends
|
|
7423
|
-
message:
|
|
7462
|
+
class MemoryError extends Schema42.TaggedErrorClass()("@batonfx/core/MemoryError", {
|
|
7463
|
+
message: Schema42.String
|
|
7424
7464
|
}) {
|
|
7425
7465
|
}
|
|
7426
7466
|
|
|
@@ -7510,10 +7550,10 @@ __export(exports_permissions, {
|
|
|
7510
7550
|
Permissions: () => Permissions,
|
|
7511
7551
|
PermissionError: () => PermissionError
|
|
7512
7552
|
});
|
|
7513
|
-
import { Context as Context36, Effect as Effect38, Layer as Layer36, Option as Option13, Ref as Ref9, Schema as
|
|
7553
|
+
import { Context as Context36, Effect as Effect38, Layer as Layer36, Option as Option13, Ref as Ref9, Schema as Schema43 } from "effect";
|
|
7514
7554
|
|
|
7515
|
-
class PermissionError extends
|
|
7516
|
-
message:
|
|
7555
|
+
class PermissionError extends Schema43.TaggedErrorClass()("@batonfx/core/PermissionError", {
|
|
7556
|
+
message: Schema43.String
|
|
7517
7557
|
}) {
|
|
7518
7558
|
}
|
|
7519
7559
|
|
|
@@ -8309,16 +8349,16 @@ var generateObject = (agent, options) => Stream6.runFold(streamObject(agent, opt
|
|
|
8309
8349
|
})
|
|
8310
8350
|
})));
|
|
8311
8351
|
// ../../node_modules/.bun/@batonfx+core@0.1.1/node_modules/@batonfx/core/src/agent-tool.ts
|
|
8312
|
-
import { Cause as Cause4, Effect as Effect44, Schema as
|
|
8352
|
+
import { Cause as Cause4, Effect as Effect44, Schema as Schema44 } from "effect";
|
|
8313
8353
|
import * as Ai7 from "effect/unstable/ai";
|
|
8314
|
-
var defaultParameters =
|
|
8354
|
+
var defaultParameters = Schema44.Struct({ prompt: Schema44.String });
|
|
8315
8355
|
// ../../node_modules/.bun/@batonfx+core@0.1.1/node_modules/@batonfx/core/src/guardrail.ts
|
|
8316
8356
|
import { Effect as Effect45, Option as Option16 } from "effect";
|
|
8317
8357
|
import * as Ai8 from "effect/unstable/ai";
|
|
8318
8358
|
// ../../node_modules/.bun/@batonfx+core@0.1.1/node_modules/@batonfx/core/src/handoff.ts
|
|
8319
|
-
import { Effect as Effect46, Schema as
|
|
8359
|
+
import { Effect as Effect46, Schema as Schema45 } from "effect";
|
|
8320
8360
|
import * as Ai9 from "effect/unstable/ai";
|
|
8321
|
-
var defaultTransferParameters =
|
|
8361
|
+
var defaultTransferParameters = Schema45.Struct({ prompt: Schema45.String });
|
|
8322
8362
|
// ../../node_modules/.bun/@batonfx+core@0.1.1/node_modules/@batonfx/core/src/model-registry.ts
|
|
8323
8363
|
var exports_model_registry = {};
|
|
8324
8364
|
__export(exports_model_registry, {
|
|
@@ -8333,13 +8373,13 @@ __export(exports_model_registry, {
|
|
|
8333
8373
|
Service: () => Service28,
|
|
8334
8374
|
LanguageModelNotRegistered: () => LanguageModelNotRegistered
|
|
8335
8375
|
});
|
|
8336
|
-
import { Chunk as Chunk2, Context as Context40, Effect as Effect47, Layer as Layer41, Option as Option17, Ref as Ref11, Schema as
|
|
8376
|
+
import { Chunk as Chunk2, Context as Context40, Effect as Effect47, Layer as Layer41, Option as Option17, Ref as Ref11, Schema as Schema46, Semaphore as Semaphore3 } from "effect";
|
|
8337
8377
|
import * as Ai10 from "effect/unstable/ai";
|
|
8338
8378
|
|
|
8339
|
-
class LanguageModelNotRegistered extends
|
|
8340
|
-
provider:
|
|
8341
|
-
model:
|
|
8342
|
-
registration_key:
|
|
8379
|
+
class LanguageModelNotRegistered extends Schema46.TaggedErrorClass()("LanguageModelNotRegistered", {
|
|
8380
|
+
provider: Schema46.String,
|
|
8381
|
+
model: Schema46.String,
|
|
8382
|
+
registration_key: Schema46.optionalKey(Schema46.String)
|
|
8343
8383
|
}) {
|
|
8344
8384
|
}
|
|
8345
8385
|
|
|
@@ -8417,12 +8457,12 @@ __export(exports_skill_source, {
|
|
|
8417
8457
|
SkillSource: () => SkillSource,
|
|
8418
8458
|
DESCRIPTION_CAP: () => DESCRIPTION_CAP
|
|
8419
8459
|
});
|
|
8420
|
-
import { Context as Context41, Effect as Effect48, Layer as Layer42, Schema as
|
|
8460
|
+
import { Context as Context41, Effect as Effect48, Layer as Layer42, Schema as Schema47 } from "effect";
|
|
8421
8461
|
|
|
8422
|
-
class SkillSourceError extends
|
|
8423
|
-
source:
|
|
8424
|
-
message:
|
|
8425
|
-
cause:
|
|
8462
|
+
class SkillSourceError extends Schema47.TaggedErrorClass()("@batonfx/core/SkillSourceError", {
|
|
8463
|
+
source: Schema47.String,
|
|
8464
|
+
message: Schema47.String,
|
|
8465
|
+
cause: Schema47.optionalKey(Schema47.Defect())
|
|
8426
8466
|
}) {
|
|
8427
8467
|
}
|
|
8428
8468
|
var DESCRIPTION_CAP = 1536;
|
|
@@ -8463,7 +8503,7 @@ var selectListings = (skills, budgetTokens, recentlyUsed) => {
|
|
|
8463
8503
|
return selected;
|
|
8464
8504
|
};
|
|
8465
8505
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
8466
|
-
import { Config as Config3, Context as Context53, Crypto as Crypto3, Effect as Effect66, HashSet as HashSet6, Layer as Layer59, Option as Option22, Ref as Ref18, Schema as
|
|
8506
|
+
import { Config as Config3, Context as Context53, Crypto as Crypto3, Effect as Effect66, HashSet as HashSet6, Layer as Layer59, Option as Option22, Ref as Ref18, Schema as Schema60, Stream as Stream7 } from "effect";
|
|
8467
8507
|
import * as Ai17 from "effect/unstable/ai";
|
|
8468
8508
|
|
|
8469
8509
|
// ../runtime/src/child/child-run-service.ts
|
|
@@ -8483,31 +8523,31 @@ __export(exports_child_run_service, {
|
|
|
8483
8523
|
ChildRunScopeBroadened: () => ChildRunScopeBroadened,
|
|
8484
8524
|
ChildRunModelMissing: () => ChildRunModelMissing
|
|
8485
8525
|
});
|
|
8486
|
-
import { Context as Context43, Effect as Effect50, HashSet as HashSet5, Layer as Layer44, Option as Option18, Result as Result2, Schema as
|
|
8526
|
+
import { Context as Context43, Effect as Effect50, HashSet as HashSet5, Layer as Layer44, Option as Option18, Result as Result2, Schema as Schema49 } from "effect";
|
|
8487
8527
|
|
|
8488
8528
|
// ../runtime/src/workspace/workspace-provider-service.ts
|
|
8489
|
-
import { Context as Context42, Effect as Effect49, Layer as Layer43, Ref as Ref12, Schema as
|
|
8529
|
+
import { Context as Context42, Effect as Effect49, Layer as Layer43, Ref as Ref12, Schema as Schema48 } from "effect";
|
|
8490
8530
|
|
|
8491
|
-
class WorkspaceNotFound extends
|
|
8531
|
+
class WorkspaceNotFound extends Schema48.TaggedErrorClass()("WorkspaceNotFound", {
|
|
8492
8532
|
sandbox_ref: exports_ids_schema.WorkspaceRef
|
|
8493
8533
|
}) {
|
|
8494
8534
|
}
|
|
8495
8535
|
|
|
8496
|
-
class WorkspaceUnavailable extends
|
|
8536
|
+
class WorkspaceUnavailable extends Schema48.TaggedErrorClass()("WorkspaceUnavailable", {
|
|
8497
8537
|
sandbox_ref: exports_ids_schema.WorkspaceRef,
|
|
8498
|
-
message:
|
|
8538
|
+
message: Schema48.String
|
|
8499
8539
|
}) {
|
|
8500
8540
|
}
|
|
8501
8541
|
|
|
8502
|
-
class WorkspaceCapabilityUnsupported extends
|
|
8503
|
-
capability:
|
|
8542
|
+
class WorkspaceCapabilityUnsupported extends Schema48.TaggedErrorClass()("WorkspaceCapabilityUnsupported", {
|
|
8543
|
+
capability: Schema48.Literals(["suspend", "snapshot", "fork"]),
|
|
8504
8544
|
provider_key: exports_workspace_schema.WorkspaceProviderKey
|
|
8505
8545
|
}) {
|
|
8506
8546
|
}
|
|
8507
8547
|
|
|
8508
|
-
class WorkspaceProviderError extends
|
|
8548
|
+
class WorkspaceProviderError extends Schema48.TaggedErrorClass()("WorkspaceProviderError", {
|
|
8509
8549
|
provider_key: exports_workspace_schema.WorkspaceProviderKey,
|
|
8510
|
-
message:
|
|
8550
|
+
message: Schema48.String
|
|
8511
8551
|
}) {
|
|
8512
8552
|
}
|
|
8513
8553
|
|
|
@@ -8539,28 +8579,28 @@ var destroy = Effect49.fn("WorkspaceProvider.destroy.call")(function* (ref) {
|
|
|
8539
8579
|
});
|
|
8540
8580
|
|
|
8541
8581
|
// ../runtime/src/child/child-run-service.ts
|
|
8542
|
-
class StaticChildRunPresetNotFound extends
|
|
8582
|
+
class StaticChildRunPresetNotFound extends Schema49.TaggedErrorClass()("StaticChildRunPresetNotFound", {
|
|
8543
8583
|
preset_name: exports_shared_schema.NonEmptyString
|
|
8544
8584
|
}) {
|
|
8545
8585
|
}
|
|
8546
8586
|
|
|
8547
|
-
class ChildRunScopeBroadened extends
|
|
8548
|
-
field:
|
|
8587
|
+
class ChildRunScopeBroadened extends Schema49.TaggedErrorClass()("ChildRunScopeBroadened", {
|
|
8588
|
+
field: Schema49.Literals(["tool_names", "permissions"]),
|
|
8549
8589
|
value: exports_shared_schema.NonEmptyString
|
|
8550
8590
|
}) {
|
|
8551
8591
|
}
|
|
8552
8592
|
|
|
8553
|
-
class ChildRunServiceError extends
|
|
8554
|
-
message:
|
|
8593
|
+
class ChildRunServiceError extends Schema49.TaggedErrorClass()("ChildRunServiceError", {
|
|
8594
|
+
message: Schema49.String
|
|
8555
8595
|
}) {
|
|
8556
8596
|
}
|
|
8557
8597
|
|
|
8558
|
-
class ChildRunWorkspaceUnavailable extends
|
|
8559
|
-
reason:
|
|
8598
|
+
class ChildRunWorkspaceUnavailable extends Schema49.TaggedErrorClass()("ChildRunWorkspaceUnavailable", {
|
|
8599
|
+
reason: Schema49.String
|
|
8560
8600
|
}) {
|
|
8561
8601
|
}
|
|
8562
8602
|
|
|
8563
|
-
class ChildRunModelMissing extends
|
|
8603
|
+
class ChildRunModelMissing extends Schema49.TaggedErrorClass()("ChildRunModelMissing", {}) {
|
|
8564
8604
|
}
|
|
8565
8605
|
|
|
8566
8606
|
class Service30 extends Context43.Service()("@relayfx/runtime/ChildRunService") {
|
|
@@ -8788,34 +8828,34 @@ var spawnDynamic = Effect50.fn("ChildRunService.spawnDynamic.call")(function* (i
|
|
|
8788
8828
|
});
|
|
8789
8829
|
|
|
8790
8830
|
// ../runtime/src/child/spawn-child-run-tool.ts
|
|
8791
|
-
import { Effect as Effect51, Schema as
|
|
8831
|
+
import { Effect as Effect51, Schema as Schema50 } from "effect";
|
|
8792
8832
|
import * as Ai11 from "effect/unstable/ai";
|
|
8793
8833
|
var toolName = "spawn_child_run";
|
|
8794
8834
|
var permissionName = "relay.child_run.spawn";
|
|
8795
|
-
var Input =
|
|
8796
|
-
preset_name:
|
|
8797
|
-
instructions:
|
|
8798
|
-
model:
|
|
8799
|
-
tool_names:
|
|
8800
|
-
permissions:
|
|
8801
|
-
output_schema_ref:
|
|
8802
|
-
metadata:
|
|
8803
|
-
input:
|
|
8835
|
+
var Input = Schema50.Struct({
|
|
8836
|
+
preset_name: Schema50.optionalKey(exports_shared_schema.NonEmptyString),
|
|
8837
|
+
instructions: Schema50.optionalKey(Schema50.String),
|
|
8838
|
+
model: Schema50.optionalKey(exports_agent_schema.ModelSelection),
|
|
8839
|
+
tool_names: Schema50.optionalKey(Schema50.Array(Schema50.String)),
|
|
8840
|
+
permissions: Schema50.optionalKey(Schema50.Array(Schema50.String)),
|
|
8841
|
+
output_schema_ref: Schema50.optionalKey(Schema50.String),
|
|
8842
|
+
metadata: Schema50.optionalKey(exports_shared_schema.Metadata),
|
|
8843
|
+
input: Schema50.optionalKey(Schema50.Array(exports_content_schema.Part))
|
|
8804
8844
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Input" });
|
|
8805
|
-
var Output =
|
|
8845
|
+
var Output = Schema50.Struct({
|
|
8806
8846
|
child_execution_id: exports_ids_schema.ChildExecutionId,
|
|
8807
|
-
status:
|
|
8808
|
-
output:
|
|
8847
|
+
status: Schema50.Literals(["completed", "failed", "cancelled"]),
|
|
8848
|
+
output: Schema50.Array(exports_content_schema.Part)
|
|
8809
8849
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.Output" });
|
|
8810
|
-
var TransferInput =
|
|
8811
|
-
input:
|
|
8850
|
+
var TransferInput = Schema50.Struct({
|
|
8851
|
+
input: Schema50.optionalKey(Schema50.Array(exports_content_schema.Part))
|
|
8812
8852
|
}).annotate({ identifier: "Relay.SpawnChildRunTool.TransferInput" });
|
|
8813
8853
|
var aiTool = Ai11.Tool.dynamic(toolName, {
|
|
8814
8854
|
description: "Spawn a durable child run and wait for its terminal output.",
|
|
8815
8855
|
parameters: Input,
|
|
8816
8856
|
success: Output
|
|
8817
8857
|
});
|
|
8818
|
-
var jsonValue2 = (value) =>
|
|
8858
|
+
var jsonValue2 = (value) => Schema50.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
8819
8859
|
var enabled = (agent) => agent.metadata?.multi_agent_enabled === true;
|
|
8820
8860
|
var parentContext = (agent) => ({
|
|
8821
8861
|
...agent.instructions === undefined ? {} : { instructions: agent.instructions },
|
|
@@ -8937,7 +8977,7 @@ var resultFromTerminal = Effect51.fn("SpawnChildRunTool.resultFromTerminal")(fun
|
|
|
8937
8977
|
return jsonValue2({ child_execution_id: id2, status, output });
|
|
8938
8978
|
});
|
|
8939
8979
|
var run2 = (config, activeToolName = toolName, fixedPresetName) => Effect51.fn("SpawnChildRunTool.run")(function* (rawInput, context) {
|
|
8940
|
-
const input = fixedPresetName === undefined ? yield*
|
|
8980
|
+
const input = fixedPresetName === undefined ? yield* Schema50.decodeUnknownEffect(Input)(rawInput).pipe(Effect51.mapError((error) => new ToolExecutionFailed({ tool_name: activeToolName, message: error.message }))) : yield* Schema50.decodeUnknownEffect(TransferInput)(rawInput).pipe(Effect51.map((transfer) => ({ preset_name: fixedPresetName, input: transfer.input ?? [] })), Effect51.mapError((error) => new ToolExecutionFailed({ tool_name: activeToolName, message: error.message })));
|
|
8941
8981
|
if (fixedPresetName === undefined)
|
|
8942
8982
|
yield* ensureStaticOrDynamic(input);
|
|
8943
8983
|
const id2 = childExecutionId(context);
|
|
@@ -9010,17 +9050,17 @@ var transferTools = (config) => (config.agent.handoff_targets ?? []).map((target
|
|
|
9010
9050
|
});
|
|
9011
9051
|
|
|
9012
9052
|
// ../runtime/src/memory/memory-service.ts
|
|
9013
|
-
import { Clock as Clock2, Context as Context45, Effect as Effect53, Layer as Layer46, Schema as
|
|
9053
|
+
import { Clock as Clock2, Context as Context45, Effect as Effect53, Layer as Layer46, Schema as Schema52 } from "effect";
|
|
9014
9054
|
import * as Ai13 from "effect/unstable/ai";
|
|
9015
9055
|
|
|
9016
9056
|
// ../runtime/src/model/embedding-model-service.ts
|
|
9017
|
-
import { Context as Context44, Effect as Effect52, Layer as Layer45, Ref as Ref13, Schema as
|
|
9057
|
+
import { Context as Context44, Effect as Effect52, Layer as Layer45, Ref as Ref13, Schema as Schema51 } from "effect";
|
|
9018
9058
|
import * as Ai12 from "effect/unstable/ai";
|
|
9019
9059
|
|
|
9020
|
-
class EmbeddingModelNotRegistered extends
|
|
9021
|
-
provider:
|
|
9022
|
-
model:
|
|
9023
|
-
registration_key:
|
|
9060
|
+
class EmbeddingModelNotRegistered extends Schema51.TaggedErrorClass()("EmbeddingModelNotRegistered", {
|
|
9061
|
+
provider: Schema51.String,
|
|
9062
|
+
model: Schema51.String,
|
|
9063
|
+
registration_key: Schema51.optionalKey(Schema51.String)
|
|
9024
9064
|
}) {
|
|
9025
9065
|
}
|
|
9026
9066
|
|
|
@@ -9146,7 +9186,7 @@ var defaultTopK = 5;
|
|
|
9146
9186
|
var memoryError = (error) => new exports_memory.MemoryError({
|
|
9147
9187
|
message: error instanceof Error ? `${error.name}: ${error.message}` : String(error)
|
|
9148
9188
|
});
|
|
9149
|
-
var decodeSubject = (subject) =>
|
|
9189
|
+
var decodeSubject = (subject) => Schema52.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(subject).pipe(Effect53.mapError(memoryError));
|
|
9150
9190
|
var textPart = (text3) => Ai13.Prompt.makePart("text", { text: text3 });
|
|
9151
9191
|
var textFromParts = (parts) => parts.filter((part) => part.type === "text").map((part) => part.text).join(`
|
|
9152
9192
|
`).trim();
|
|
@@ -9368,9 +9408,9 @@ __export(exports_schema_registry_service, {
|
|
|
9368
9408
|
Service: () => Service35,
|
|
9369
9409
|
SchemaRefNotRegistered: () => SchemaRefNotRegistered
|
|
9370
9410
|
});
|
|
9371
|
-
import { Context as Context48, Effect as Effect55, Layer as Layer49, Ref as Ref14, Schema as
|
|
9411
|
+
import { Context as Context48, Effect as Effect55, Layer as Layer49, Ref as Ref14, Schema as Schema53 } from "effect";
|
|
9372
9412
|
|
|
9373
|
-
class SchemaRefNotRegistered extends
|
|
9413
|
+
class SchemaRefNotRegistered extends Schema53.TaggedErrorClass()("SchemaRefNotRegistered", { schema_ref: exports_shared_schema.NonEmptyString }) {
|
|
9374
9414
|
}
|
|
9375
9415
|
|
|
9376
9416
|
class Service35 extends Context48.Service()("@relayfx/runtime/SchemaRegistry") {
|
|
@@ -9503,16 +9543,16 @@ __export(exports_blob_store_service, {
|
|
|
9503
9543
|
BlobStoreError: () => BlobStoreError,
|
|
9504
9544
|
BlobNotResolvable: () => BlobNotResolvable
|
|
9505
9545
|
});
|
|
9506
|
-
import { Context as Context50, Effect as Effect57, Layer as Layer51, Ref as Ref16, Schema as
|
|
9546
|
+
import { Context as Context50, Effect as Effect57, Layer as Layer51, Ref as Ref16, Schema as Schema54 } from "effect";
|
|
9507
9547
|
|
|
9508
|
-
class BlobNotResolvable extends
|
|
9509
|
-
uri:
|
|
9510
|
-
reason:
|
|
9548
|
+
class BlobNotResolvable extends Schema54.TaggedErrorClass()("BlobNotResolvable", {
|
|
9549
|
+
uri: Schema54.String,
|
|
9550
|
+
reason: Schema54.String
|
|
9511
9551
|
}) {
|
|
9512
9552
|
}
|
|
9513
9553
|
|
|
9514
|
-
class BlobStoreError extends
|
|
9515
|
-
message:
|
|
9554
|
+
class BlobStoreError extends Schema54.TaggedErrorClass()("BlobStoreError", {
|
|
9555
|
+
message: Schema54.String
|
|
9516
9556
|
}) {
|
|
9517
9557
|
}
|
|
9518
9558
|
|
|
@@ -9585,7 +9625,7 @@ __export(exports_prompt_assembler_service, {
|
|
|
9585
9625
|
Service: () => Service39,
|
|
9586
9626
|
PromptAssemblerError: () => PromptAssemblerError
|
|
9587
9627
|
});
|
|
9588
|
-
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as
|
|
9628
|
+
import { Context as Context52, Effect as Effect59, Layer as Layer53, Schema as Schema56 } from "effect";
|
|
9589
9629
|
import * as Ai15 from "effect/unstable/ai";
|
|
9590
9630
|
|
|
9591
9631
|
// ../runtime/src/content/artifact-store-service.ts
|
|
@@ -9600,11 +9640,11 @@ __export(exports_artifact_store_service, {
|
|
|
9600
9640
|
Memory: () => Memory2,
|
|
9601
9641
|
ArtifactNotResolvable: () => ArtifactNotResolvable
|
|
9602
9642
|
});
|
|
9603
|
-
import { Context as Context51, Effect as Effect58, Layer as Layer52, Schema as
|
|
9643
|
+
import { Context as Context51, Effect as Effect58, Layer as Layer52, Schema as Schema55 } from "effect";
|
|
9604
9644
|
|
|
9605
|
-
class ArtifactNotResolvable extends
|
|
9606
|
-
artifact_id:
|
|
9607
|
-
reason:
|
|
9645
|
+
class ArtifactNotResolvable extends Schema55.TaggedErrorClass()("ArtifactNotResolvable", {
|
|
9646
|
+
artifact_id: Schema55.String,
|
|
9647
|
+
reason: Schema55.String
|
|
9608
9648
|
}) {
|
|
9609
9649
|
}
|
|
9610
9650
|
|
|
@@ -9646,14 +9686,14 @@ var register8 = Effect58.fn("ArtifactStore.register.call")(function* (artifact_i
|
|
|
9646
9686
|
});
|
|
9647
9687
|
|
|
9648
9688
|
// ../runtime/src/agent/prompt-assembler-service.ts
|
|
9649
|
-
class PromptAssemblerError extends
|
|
9650
|
-
message:
|
|
9689
|
+
class PromptAssemblerError extends Schema56.TaggedErrorClass()("PromptAssemblerError", {
|
|
9690
|
+
message: Schema56.String
|
|
9651
9691
|
}) {
|
|
9652
9692
|
}
|
|
9653
9693
|
|
|
9654
9694
|
class Service39 extends Context52.Service()("@relayfx/runtime/PromptAssembler") {
|
|
9655
9695
|
}
|
|
9656
|
-
var jsonValue3 = (value) =>
|
|
9696
|
+
var jsonValue3 = (value) => Schema56.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
9657
9697
|
var stringifyJson = (value) => JSON.stringify(jsonValue3(value));
|
|
9658
9698
|
var contentToPromptPart = (part) => {
|
|
9659
9699
|
const options = part.provider_options;
|
|
@@ -9797,8 +9837,8 @@ var make9 = (config) => exports_compaction.make(strategy(config), defaultOptions
|
|
|
9797
9837
|
var layerFromEpoch = (epoch) => exports_instructions.layer(epoch.baseline.length === 0 ? [] : [exports_instructions.staticSource("relay:context-epoch", epoch.baseline)]);
|
|
9798
9838
|
|
|
9799
9839
|
// ../runtime/src/agent/relay-permissions.ts
|
|
9800
|
-
import { Clock as Clock5, Effect as Effect61, Equal as Equal2, Layer as Layer55, Option as Option19, Schema as
|
|
9801
|
-
var jsonValue4 = (value) =>
|
|
9840
|
+
import { Clock as Clock5, Effect as Effect61, Equal as Equal2, Layer as Layer55, Option as Option19, Schema as Schema57 } from "effect";
|
|
9841
|
+
var jsonValue4 = (value) => Schema57.decodeUnknownSync(exports_shared_schema.JsonValue)(value === undefined ? null : value);
|
|
9802
9842
|
var waitIdForToolCall = (toolCallId) => exports_ids_schema.WaitId.make(`wait:permission:${toolCallId}`);
|
|
9803
9843
|
var fallbackToolCallId = (request) => `${request.agentName}:${request.turn}:${request.tool}`;
|
|
9804
9844
|
var tokenFor2 = (request) => waitIdForToolCall(request.toolCallId ?? fallbackToolCallId(request));
|
|
@@ -9964,7 +10004,7 @@ var awaitAnswer = Effect61.fn("RelayPermissions.awaitAnswer")(function* (config,
|
|
|
9964
10004
|
});
|
|
9965
10005
|
var rememberRule = Effect61.fn("RelayPermissions.rememberRule")(function* (config, rule) {
|
|
9966
10006
|
const createdAt = yield* Clock5.currentTimeMillis;
|
|
9967
|
-
const decodedRule = yield*
|
|
10007
|
+
const decodedRule = yield* Schema57.decodeUnknownEffect(exports_agent_schema.PermissionRule)(rule).pipe(Effect61.mapError((error) => permissionError(error.message)));
|
|
9968
10008
|
yield* config.repository.remember({
|
|
9969
10009
|
agent: config.agentName,
|
|
9970
10010
|
scope: config.scope,
|
|
@@ -9980,9 +10020,9 @@ var layer40 = (config) => Layer55.mergeAll(Layer55.succeed(exports_permissions.P
|
|
|
9980
10020
|
})));
|
|
9981
10021
|
|
|
9982
10022
|
// ../runtime/src/agent/relay-steering.ts
|
|
9983
|
-
import { Clock as Clock6, Effect as Effect62, Layer as Layer56, Schema as
|
|
10023
|
+
import { Clock as Clock6, Effect as Effect62, Layer as Layer56, Schema as Schema58 } from "effect";
|
|
9984
10024
|
import * as Ai16 from "effect/unstable/ai";
|
|
9985
|
-
var jsonValue5 = (value) =>
|
|
10025
|
+
var jsonValue5 = (value) => Schema58.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
9986
10026
|
var stringifyJson2 = (value) => JSON.stringify(jsonValue5(value));
|
|
9987
10027
|
var createdAtForSequence2 = (config, sequence) => config.startedAt + sequence - config.eventSequence;
|
|
9988
10028
|
var drainId = (config, kind, sequence) => `drain:${config.executionId}:steering:${kind}:sequence:${sequence}`;
|
|
@@ -10015,7 +10055,7 @@ var contentFromMessage = (message) => {
|
|
|
10015
10055
|
const textParts = promptTextParts(prompt);
|
|
10016
10056
|
if (textParts.length > 0)
|
|
10017
10057
|
return textParts;
|
|
10018
|
-
return [exports_content_schema.text(stringifyJson2(
|
|
10058
|
+
return [exports_content_schema.text(stringifyJson2(Schema58.encodeSync(Ai16.Prompt.Prompt)(prompt)))];
|
|
10019
10059
|
};
|
|
10020
10060
|
var steeringReceivedEvent = (config, kind, drain2, messages, sequence) => ({
|
|
10021
10061
|
id: exports_ids_schema.EventId.make(`event:${drain2.drainId}:received`),
|
|
@@ -10060,8 +10100,8 @@ var layer41 = (config) => Layer56.succeed(exports_steering.Steering, exports_ste
|
|
|
10060
10100
|
}));
|
|
10061
10101
|
|
|
10062
10102
|
// ../runtime/src/agent/relay-tool-executor.ts
|
|
10063
|
-
import { Effect as Effect63, Layer as Layer57, Option as Option20, Schema as
|
|
10064
|
-
var jsonValue6 = (value) =>
|
|
10103
|
+
import { Effect as Effect63, Layer as Layer57, Option as Option20, Schema as Schema59 } from "effect";
|
|
10104
|
+
var jsonValue6 = (value) => Schema59.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
10065
10105
|
var errorDetail = (error) => {
|
|
10066
10106
|
switch (error._tag) {
|
|
10067
10107
|
case "ToolNotRegistered":
|
|
@@ -10168,29 +10208,29 @@ var make12 = (first) => Ref17.make(first).pipe(Effect65.map((ref) => ({
|
|
|
10168
10208
|
})));
|
|
10169
10209
|
|
|
10170
10210
|
// ../runtime/src/agent/agent-loop-service.ts
|
|
10171
|
-
class AgentLoopError extends
|
|
10172
|
-
message:
|
|
10173
|
-
next_event_sequence:
|
|
10211
|
+
class AgentLoopError extends Schema60.TaggedErrorClass()("AgentLoopError", {
|
|
10212
|
+
message: Schema60.String,
|
|
10213
|
+
next_event_sequence: Schema60.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
10174
10214
|
}) {
|
|
10175
10215
|
}
|
|
10176
10216
|
|
|
10177
|
-
class AgentLoopWaitRequested extends
|
|
10217
|
+
class AgentLoopWaitRequested extends Schema60.TaggedErrorClass()("AgentLoopWaitRequested", {
|
|
10178
10218
|
wait_id: exports_ids_schema.WaitId,
|
|
10179
10219
|
tool_call: exports_tool_schema.Call,
|
|
10180
10220
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
10181
10221
|
}) {
|
|
10182
10222
|
}
|
|
10183
10223
|
|
|
10184
|
-
class AgentLoopBudgetExceeded extends
|
|
10185
|
-
tokens_used:
|
|
10186
|
-
token_budget:
|
|
10224
|
+
class AgentLoopBudgetExceeded extends Schema60.TaggedErrorClass()("AgentLoopBudgetExceeded", {
|
|
10225
|
+
tokens_used: Schema60.Int,
|
|
10226
|
+
token_budget: Schema60.Int,
|
|
10187
10227
|
next_event_sequence: exports_execution_schema.ExecutionEventSequence
|
|
10188
10228
|
}) {
|
|
10189
10229
|
}
|
|
10190
10230
|
|
|
10191
10231
|
class Service40 extends Context53.Service()("@relayfx/runtime/AgentLoop") {
|
|
10192
10232
|
}
|
|
10193
|
-
var jsonValue7 = (value) =>
|
|
10233
|
+
var jsonValue7 = (value) => Schema60.decodeUnknownSync(exports_shared_schema.JsonValue)(value);
|
|
10194
10234
|
var toolNames = (agent) => HashSet6.fromIterable(agent.tool_names);
|
|
10195
10235
|
var availableRegisteredTools = (agent, registered) => {
|
|
10196
10236
|
const names = toolNames(agent);
|
|
@@ -10752,7 +10792,7 @@ __export(exports_execution_entity, {
|
|
|
10752
10792
|
});
|
|
10753
10793
|
import { ClusterSchema, Entity } from "effect/unstable/cluster";
|
|
10754
10794
|
import { Rpc } from "effect/unstable/rpc";
|
|
10755
|
-
import { Schema as
|
|
10795
|
+
import { Schema as Schema67 } from "effect";
|
|
10756
10796
|
|
|
10757
10797
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
10758
10798
|
var exports_execution_workflow = {};
|
|
@@ -10783,15 +10823,15 @@ __export(exports_execution_workflow, {
|
|
|
10783
10823
|
ActivityNameTemplates: () => ActivityNameTemplates
|
|
10784
10824
|
});
|
|
10785
10825
|
import { Activity, DurableDeferred, Workflow } from "effect/unstable/workflow";
|
|
10786
|
-
import { Effect as Effect72, Exit as Exit2, Option as Option26, Schema as
|
|
10826
|
+
import { Effect as Effect72, Exit as Exit2, Option as Option26, Schema as Schema66 } from "effect";
|
|
10787
10827
|
|
|
10788
10828
|
// ../runtime/src/child/parent-notifier-service.ts
|
|
10789
|
-
import { Context as Context54, Effect as Effect67, Layer as Layer60, Option as Option23, Ref as Ref19, Schema as
|
|
10790
|
-
class ParentNotifyError extends
|
|
10791
|
-
message:
|
|
10829
|
+
import { Context as Context54, Effect as Effect67, Layer as Layer60, Option as Option23, Ref as Ref19, Schema as Schema61 } from "effect";
|
|
10830
|
+
class ParentNotifyError extends Schema61.TaggedErrorClass()("ParentNotifyError", {
|
|
10831
|
+
message: Schema61.String
|
|
10792
10832
|
}) {
|
|
10793
10833
|
}
|
|
10794
|
-
var ChildTerminalStatus =
|
|
10834
|
+
var ChildTerminalStatus = Schema61.Literals(["completed", "failed", "cancelled"]).annotate({
|
|
10795
10835
|
identifier: "Relay.ParentNotifier.ChildTerminalStatus"
|
|
10796
10836
|
});
|
|
10797
10837
|
|
|
@@ -10890,15 +10930,15 @@ __export(exports_skill_registry_service, {
|
|
|
10890
10930
|
SkillDefinitionInvalid: () => SkillDefinitionInvalid,
|
|
10891
10931
|
Service: () => Service42
|
|
10892
10932
|
});
|
|
10893
|
-
import { Clock as Clock7, Context as Context55, Effect as Effect68, Layer as Layer61, Schema as
|
|
10933
|
+
import { Clock as Clock7, Context as Context55, Effect as Effect68, Layer as Layer61, Schema as Schema62 } from "effect";
|
|
10894
10934
|
|
|
10895
|
-
class SkillDefinitionInvalid extends
|
|
10896
|
-
message:
|
|
10935
|
+
class SkillDefinitionInvalid extends Schema62.TaggedErrorClass()("SkillDefinitionInvalid", {
|
|
10936
|
+
message: Schema62.String
|
|
10897
10937
|
}) {
|
|
10898
10938
|
}
|
|
10899
10939
|
|
|
10900
|
-
class SkillRegistryError extends
|
|
10901
|
-
message:
|
|
10940
|
+
class SkillRegistryError extends Schema62.TaggedErrorClass()("SkillRegistryError", {
|
|
10941
|
+
message: Schema62.String
|
|
10902
10942
|
}) {
|
|
10903
10943
|
}
|
|
10904
10944
|
|
|
@@ -11067,11 +11107,11 @@ __export(exports_execution_service, {
|
|
|
11067
11107
|
Service: () => Service43,
|
|
11068
11108
|
ExecutionServiceError: () => ExecutionServiceError
|
|
11069
11109
|
});
|
|
11070
|
-
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Option as Option24, Schema as
|
|
11110
|
+
import { Clock as Clock8, Context as Context56, Effect as Effect69, Layer as Layer62, Option as Option24, Schema as Schema63, Stream as Stream8 } from "effect";
|
|
11071
11111
|
import { ShardingConfig } from "effect/unstable/cluster";
|
|
11072
|
-
class ExecutionServiceError extends
|
|
11073
|
-
message:
|
|
11074
|
-
next_event_sequence:
|
|
11112
|
+
class ExecutionServiceError extends Schema63.TaggedErrorClass()("ExecutionServiceError", {
|
|
11113
|
+
message: Schema63.String,
|
|
11114
|
+
next_event_sequence: Schema63.optionalKey(exports_execution_schema.ExecutionEventSequence)
|
|
11075
11115
|
}) {
|
|
11076
11116
|
}
|
|
11077
11117
|
|
|
@@ -11391,13 +11431,13 @@ var spawnChildRun = Effect69.fn("ExecutionService.spawnChildRun.call")(function*
|
|
|
11391
11431
|
var stream3 = (input) => Stream8.unwrap(Service43.pipe(Effect69.map((service) => service.stream(input))));
|
|
11392
11432
|
|
|
11393
11433
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
11394
|
-
import { Context as Context58, Effect as Effect71, HashSet as HashSet7, Layer as Layer64, Option as Option25, Schema as
|
|
11434
|
+
import { Context as Context58, Effect as Effect71, HashSet as HashSet7, Layer as Layer64, Option as Option25, Schema as Schema65 } from "effect";
|
|
11395
11435
|
|
|
11396
11436
|
// ../runtime/src/workspace/workspace-runtime-service.ts
|
|
11397
|
-
import { Context as Context57, Effect as Effect70, Layer as Layer63, Schema as
|
|
11437
|
+
import { Context as Context57, Effect as Effect70, Layer as Layer63, Schema as Schema64 } from "effect";
|
|
11398
11438
|
|
|
11399
|
-
class WorkspaceRuntimeError extends
|
|
11400
|
-
message:
|
|
11439
|
+
class WorkspaceRuntimeError extends Schema64.TaggedErrorClass()("WorkspaceRuntimeError", {
|
|
11440
|
+
message: Schema64.String
|
|
11401
11441
|
}) {
|
|
11402
11442
|
}
|
|
11403
11443
|
|
|
@@ -11425,18 +11465,18 @@ var exec = Effect70.fn("WorkspaceRuntime.exec.call")(function* (input) {
|
|
|
11425
11465
|
});
|
|
11426
11466
|
|
|
11427
11467
|
// ../runtime/src/workspace/workspace-planner-service.ts
|
|
11428
|
-
class WorkspaceRuntimeMissing extends
|
|
11468
|
+
class WorkspaceRuntimeMissing extends Schema65.TaggedErrorClass()("WorkspaceRuntimeMissing", {
|
|
11429
11469
|
execution_id: exports_ids_schema.ExecutionId
|
|
11430
11470
|
}) {
|
|
11431
11471
|
}
|
|
11432
11472
|
|
|
11433
|
-
class WorkspaceLeaseMissingRef extends
|
|
11473
|
+
class WorkspaceLeaseMissingRef extends Schema65.TaggedErrorClass()("WorkspaceLeaseMissingRef", {
|
|
11434
11474
|
execution_id: exports_ids_schema.ExecutionId
|
|
11435
11475
|
}) {
|
|
11436
11476
|
}
|
|
11437
11477
|
|
|
11438
|
-
class WorkspacePlannerError extends
|
|
11439
|
-
message:
|
|
11478
|
+
class WorkspacePlannerError extends Schema65.TaggedErrorClass()("WorkspacePlannerError", {
|
|
11479
|
+
message: Schema65.String
|
|
11440
11480
|
}) {
|
|
11441
11481
|
}
|
|
11442
11482
|
|
|
@@ -11622,67 +11662,67 @@ var fail = Effect71.fn("WorkspacePlanner.fail.call")(function* (input) {
|
|
|
11622
11662
|
});
|
|
11623
11663
|
|
|
11624
11664
|
// ../runtime/src/workflow/execution-workflow.ts
|
|
11625
|
-
class ExecutionWorkflowFailed extends
|
|
11626
|
-
message:
|
|
11665
|
+
class ExecutionWorkflowFailed extends Schema66.TaggedErrorClass()("ExecutionWorkflowFailed", {
|
|
11666
|
+
message: Schema66.String
|
|
11627
11667
|
}) {
|
|
11628
11668
|
}
|
|
11629
|
-
var StartInput =
|
|
11669
|
+
var StartInput = Schema66.Struct({
|
|
11630
11670
|
execution_id: exports_ids_schema.ExecutionId,
|
|
11631
11671
|
root_address_id: exports_ids_schema.AddressId,
|
|
11632
|
-
session_id:
|
|
11633
|
-
input:
|
|
11672
|
+
session_id: Schema66.optionalKey(exports_ids_schema.SessionId),
|
|
11673
|
+
input: Schema66.optionalKey(Schema66.Array(exports_content_schema.Part)),
|
|
11634
11674
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
11635
11675
|
started_at: exports_shared_schema.TimestampMillis,
|
|
11636
11676
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
11637
|
-
agent_definition_id:
|
|
11638
|
-
agent_definition_revision:
|
|
11639
|
-
agent_definition_snapshot:
|
|
11640
|
-
agent_definition_tool_input_schema_digests:
|
|
11641
|
-
wait_id:
|
|
11642
|
-
resume_tool_call:
|
|
11643
|
-
workflow_generation:
|
|
11644
|
-
metadata:
|
|
11677
|
+
agent_definition_id: Schema66.optionalKey(exports_ids_schema.AgentDefinitionId),
|
|
11678
|
+
agent_definition_revision: Schema66.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
11679
|
+
agent_definition_snapshot: Schema66.optionalKey(exports_agent_schema.Definition),
|
|
11680
|
+
agent_definition_tool_input_schema_digests: Schema66.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
11681
|
+
wait_id: Schema66.optionalKey(exports_ids_schema.WaitId),
|
|
11682
|
+
resume_tool_call: Schema66.optionalKey(exports_tool_schema.Call),
|
|
11683
|
+
workflow_generation: Schema66.optionalKey(Schema66.Int.check(Schema66.isGreaterThanOrEqualTo(0))),
|
|
11684
|
+
metadata: Schema66.optionalKey(exports_shared_schema.Metadata)
|
|
11645
11685
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartInput" });
|
|
11646
|
-
var WaitSignalState =
|
|
11686
|
+
var WaitSignalState = Schema66.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
11647
11687
|
identifier: "Relay.ExecutionWorkflow.WaitSignalState"
|
|
11648
11688
|
});
|
|
11649
|
-
var WaitSignal =
|
|
11689
|
+
var WaitSignal = Schema66.Struct({
|
|
11650
11690
|
wait_id: exports_ids_schema.WaitId,
|
|
11651
11691
|
state: WaitSignalState,
|
|
11652
11692
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
11653
11693
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSignal" });
|
|
11654
|
-
var SignalWaitInput =
|
|
11655
|
-
workflow_execution_id:
|
|
11694
|
+
var SignalWaitInput = Schema66.Struct({
|
|
11695
|
+
workflow_execution_id: Schema66.String,
|
|
11656
11696
|
wait_id: exports_ids_schema.WaitId,
|
|
11657
11697
|
state: WaitSignalState,
|
|
11658
11698
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
11659
11699
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.SignalWaitInput" });
|
|
11660
|
-
var CancelExecutionInput =
|
|
11700
|
+
var CancelExecutionInput = Schema66.Struct({
|
|
11661
11701
|
execution_id: exports_ids_schema.ExecutionId,
|
|
11662
11702
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
11663
|
-
reason:
|
|
11703
|
+
reason: Schema66.optionalKey(Schema66.String)
|
|
11664
11704
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionInput" });
|
|
11665
|
-
var CancelExecutionResult =
|
|
11705
|
+
var CancelExecutionResult = Schema66.Struct({
|
|
11666
11706
|
execution_id: exports_ids_schema.ExecutionId,
|
|
11667
11707
|
status: exports_execution_schema.ExecutionStatus
|
|
11668
11708
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.CancelExecutionResult" });
|
|
11669
|
-
var WaitSnapshot =
|
|
11709
|
+
var WaitSnapshot = Schema66.Struct({
|
|
11670
11710
|
id: exports_ids_schema.WaitId,
|
|
11671
11711
|
execution_id: exports_ids_schema.ExecutionId,
|
|
11672
|
-
envelope_id:
|
|
11712
|
+
envelope_id: Schema66.optionalKey(exports_ids_schema.EnvelopeId),
|
|
11673
11713
|
mode: exports_envelope_schema.WaitMode,
|
|
11674
|
-
correlation_key:
|
|
11675
|
-
state:
|
|
11714
|
+
correlation_key: Schema66.optionalKey(Schema66.String),
|
|
11715
|
+
state: Schema66.Literals(["open", "resolved", "timed_out", "cancelled"]),
|
|
11676
11716
|
metadata: exports_shared_schema.Metadata,
|
|
11677
11717
|
created_at: exports_shared_schema.TimestampMillis,
|
|
11678
|
-
resolved_at:
|
|
11718
|
+
resolved_at: Schema66.optionalKey(exports_shared_schema.TimestampMillis)
|
|
11679
11719
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.WaitSnapshot" });
|
|
11680
|
-
var StartResult =
|
|
11720
|
+
var StartResult = Schema66.Struct({
|
|
11681
11721
|
execution_id: exports_ids_schema.ExecutionId,
|
|
11682
11722
|
status: exports_execution_schema.ExecutionStatus,
|
|
11683
|
-
wait_id:
|
|
11684
|
-
wait_state:
|
|
11685
|
-
metadata:
|
|
11723
|
+
wait_id: Schema66.optionalKey(exports_ids_schema.WaitId),
|
|
11724
|
+
wait_state: Schema66.optionalKey(Schema66.Literals(["resolved", "timed_out", "cancelled"])),
|
|
11725
|
+
metadata: Schema66.optionalKey(exports_shared_schema.Metadata)
|
|
11686
11726
|
}).annotate({ identifier: "Relay.ExecutionWorkflow.StartResult" });
|
|
11687
11727
|
var StartExecutionWorkflowName = "Relay/Execution/Start";
|
|
11688
11728
|
var ActivityNames = {
|
|
@@ -11896,7 +11936,7 @@ var cancelExecution = (input, turn, reason) => Activity.make({
|
|
|
11896
11936
|
});
|
|
11897
11937
|
var loadCancellationRequested = (input, turn) => Activity.make({
|
|
11898
11938
|
name: ActivityNames.checkCancel(turn),
|
|
11899
|
-
success:
|
|
11939
|
+
success: Schema66.Boolean,
|
|
11900
11940
|
error: ExecutionWorkflowFailed,
|
|
11901
11941
|
execute: Effect72.gen(function* () {
|
|
11902
11942
|
const repository = yield* exports_execution_repository.Service;
|
|
@@ -11906,7 +11946,7 @@ var loadCancellationRequested = (input, turn) => Activity.make({
|
|
|
11906
11946
|
});
|
|
11907
11947
|
var loadWait = (name, waitId) => Activity.make({
|
|
11908
11948
|
name,
|
|
11909
|
-
success:
|
|
11949
|
+
success: Schema66.UndefinedOr(WaitSnapshot),
|
|
11910
11950
|
error: ExecutionWorkflowFailed,
|
|
11911
11951
|
execute: get11(waitId).pipe(Effect72.map((record2) => record2 === undefined ? undefined : toWaitSnapshot(record2)), Effect72.mapError(mapWaitError2))
|
|
11912
11952
|
});
|
|
@@ -11997,7 +12037,7 @@ var compactionForStart = Effect72.fn("ExecutionWorkflow.compactionForStart")(fun
|
|
|
11997
12037
|
...keepRecentTokens === undefined ? {} : { keepRecentTokens }
|
|
11998
12038
|
};
|
|
11999
12039
|
});
|
|
12000
|
-
var decodeMemorySubject = (value) => typeof value === "string" ?
|
|
12040
|
+
var decodeMemorySubject = (value) => typeof value === "string" ? Schema66.decodeUnknownEffect(exports_ids_schema.MemorySubjectId)(value).pipe(Effect72.mapError(() => new ExecutionWorkflowFailed({ message: `Invalid memory_subject_id metadata value: ${value}` }))) : Effect72.fail(new ExecutionWorkflowFailed({ message: "memory_subject_id metadata value must be a string" }));
|
|
12001
12041
|
var memorySubjectForStart = Effect72.fn("ExecutionWorkflow.memorySubjectForStart")(function* (input) {
|
|
12002
12042
|
const executionSubject = memorySubjectFromMetadata(input.metadata);
|
|
12003
12043
|
if (executionSubject !== undefined)
|
|
@@ -12015,7 +12055,7 @@ var steeringEnabledForStart = (input) => {
|
|
|
12015
12055
|
var nextEventSequence4 = (eventLog, executionId) => eventLog.maxSequence(executionId).pipe(Effect72.map((max3) => max3 === undefined ? 0 : max3 + 1), Effect72.mapError(mapEventLogError6));
|
|
12016
12056
|
var ensureWorkspace = (input) => Activity.make({
|
|
12017
12057
|
name: ActivityNames.ensureWorkspace,
|
|
12018
|
-
success:
|
|
12058
|
+
success: Schema66.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
12019
12059
|
error: ExecutionWorkflowFailed,
|
|
12020
12060
|
execute: Effect72.gen(function* () {
|
|
12021
12061
|
if (input.agent_definition_snapshot === undefined)
|
|
@@ -12032,19 +12072,19 @@ var ensureWorkspace = (input) => Activity.make({
|
|
|
12032
12072
|
});
|
|
12033
12073
|
var suspendWorkspace = (input, key2) => Activity.make({
|
|
12034
12074
|
name: ActivityNames.suspendWorkspace(key2),
|
|
12035
|
-
success:
|
|
12075
|
+
success: Schema66.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
12036
12076
|
error: ExecutionWorkflowFailed,
|
|
12037
12077
|
execute: suspend2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect72.mapError(mapWorkspaceError))
|
|
12038
12078
|
});
|
|
12039
12079
|
var resumeWorkspace = (input, key2) => Activity.make({
|
|
12040
12080
|
name: ActivityNames.resumeWorkspace(key2),
|
|
12041
|
-
success:
|
|
12081
|
+
success: Schema66.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
12042
12082
|
error: ExecutionWorkflowFailed,
|
|
12043
12083
|
execute: resume2({ executionId: input.execution_id, now: input.started_at }).pipe(Effect72.map((plan2) => plan2?.lease), Effect72.mapError(mapWorkspaceError))
|
|
12044
12084
|
});
|
|
12045
12085
|
var releaseWorkspace = (input) => Activity.make({
|
|
12046
12086
|
name: ActivityNames.releaseWorkspace,
|
|
12047
|
-
success:
|
|
12087
|
+
success: Schema66.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
12048
12088
|
error: ExecutionWorkflowFailed,
|
|
12049
12089
|
execute: release2({ executionId: input.execution_id, now: input.completed_at }).pipe(Effect72.mapError(mapWorkspaceError))
|
|
12050
12090
|
});
|
|
@@ -12145,7 +12185,7 @@ var childDispatchContext = (input) => {
|
|
|
12145
12185
|
};
|
|
12146
12186
|
var loadChildCancellationRequested = (input) => Activity.make({
|
|
12147
12187
|
name: ActivityNames.checkQueuedChildCancellation,
|
|
12148
|
-
success:
|
|
12188
|
+
success: Schema66.Boolean,
|
|
12149
12189
|
error: ExecutionWorkflowFailed,
|
|
12150
12190
|
execute: Effect72.gen(function* () {
|
|
12151
12191
|
const context = childDispatchContext(input);
|
|
@@ -12157,7 +12197,7 @@ var loadChildCancellationRequested = (input) => Activity.make({
|
|
|
12157
12197
|
});
|
|
12158
12198
|
var notifyParentActivity = (input, context, status, output) => Activity.make({
|
|
12159
12199
|
name: ActivityNames.notifyParent(status),
|
|
12160
|
-
success:
|
|
12200
|
+
success: Schema66.Void,
|
|
12161
12201
|
error: ExecutionWorkflowFailed,
|
|
12162
12202
|
execute: Effect72.gen(function* () {
|
|
12163
12203
|
const notifier = yield* Effect72.serviceOption(Service41);
|
|
@@ -12210,7 +12250,7 @@ var waitIdFromExecution = (execution) => {
|
|
|
12210
12250
|
};
|
|
12211
12251
|
var pendingToolCallFromExecution = (execution) => {
|
|
12212
12252
|
const pending = execution.metadata?.pending_tool_call;
|
|
12213
|
-
return
|
|
12253
|
+
return Schema66.decodeUnknownOption(exports_tool_schema.Call)(pending).pipe(Option26.getOrUndefined);
|
|
12214
12254
|
};
|
|
12215
12255
|
var finishCancelledWait = Effect72.fn("ExecutionWorkflow.finishCancelledWait")(function* (startInput, turn, waitId) {
|
|
12216
12256
|
const cancelled = yield* cancelExecution(startInput, turn, "wait cancelled");
|
|
@@ -12424,7 +12464,7 @@ var Start = Rpc.make("start", {
|
|
|
12424
12464
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
12425
12465
|
var SignalWait = Rpc.make("signalWait", {
|
|
12426
12466
|
payload: SignalWaitInput,
|
|
12427
|
-
success:
|
|
12467
|
+
success: Schema67.Void,
|
|
12428
12468
|
error: ExecutionWorkflowFailed
|
|
12429
12469
|
}).annotate(ClusterSchema.Persisted, true).annotate(ClusterSchema.Uninterruptible, "server");
|
|
12430
12470
|
var Cancel = Rpc.make("cancel", {
|
|
@@ -12452,26 +12492,26 @@ __export(exports_envelope_service, {
|
|
|
12452
12492
|
EnvelopeRouteDeferred: () => EnvelopeRouteDeferred,
|
|
12453
12493
|
EnvelopeAddressNotFound: () => EnvelopeAddressNotFound
|
|
12454
12494
|
});
|
|
12455
|
-
import { Context as Context59, Effect as Effect73, Layer as Layer66, Schema as
|
|
12456
|
-
class EnvelopeAddressNotFound extends
|
|
12495
|
+
import { Context as Context59, Effect as Effect73, Layer as Layer66, Schema as Schema68 } from "effect";
|
|
12496
|
+
class EnvelopeAddressNotFound extends Schema68.TaggedErrorClass()("EnvelopeAddressNotFound", {
|
|
12457
12497
|
address_id: exports_ids_schema.AddressId
|
|
12458
12498
|
}) {
|
|
12459
12499
|
}
|
|
12460
12500
|
|
|
12461
|
-
class EnvelopeRouteUnavailable extends
|
|
12501
|
+
class EnvelopeRouteUnavailable extends Schema68.TaggedErrorClass()("EnvelopeRouteUnavailable", {
|
|
12462
12502
|
address_id: exports_ids_schema.AddressId,
|
|
12463
|
-
route_key:
|
|
12503
|
+
route_key: Schema68.String
|
|
12464
12504
|
}) {
|
|
12465
12505
|
}
|
|
12466
12506
|
|
|
12467
|
-
class EnvelopeRouteDeferred extends
|
|
12507
|
+
class EnvelopeRouteDeferred extends Schema68.TaggedErrorClass()("EnvelopeRouteDeferred", {
|
|
12468
12508
|
address_id: exports_ids_schema.AddressId,
|
|
12469
|
-
route_key:
|
|
12509
|
+
route_key: Schema68.String
|
|
12470
12510
|
}) {
|
|
12471
12511
|
}
|
|
12472
12512
|
|
|
12473
|
-
class EnvelopeServiceError extends
|
|
12474
|
-
message:
|
|
12513
|
+
class EnvelopeServiceError extends Schema68.TaggedErrorClass()("EnvelopeServiceError", {
|
|
12514
|
+
message: Schema68.String
|
|
12475
12515
|
}) {
|
|
12476
12516
|
}
|
|
12477
12517
|
|
|
@@ -12629,7 +12669,7 @@ __export(exports_runner_runtime_service, {
|
|
|
12629
12669
|
DatabaseMode: () => DatabaseMode,
|
|
12630
12670
|
ClusterConfigMismatch: () => ClusterConfigMismatch
|
|
12631
12671
|
});
|
|
12632
|
-
import { Config as Config5, Context as Context61, Crypto as Crypto4, Duration as Duration5, Effect as Effect76, Layer as Layer68, Option as Option27, Schema as
|
|
12672
|
+
import { Config as Config5, Context as Context61, Crypto as Crypto4, Duration as Duration5, Effect as Effect76, Layer as Layer68, Option as Option27, Schema as Schema70, Stream as Stream9 } from "effect";
|
|
12633
12673
|
import {
|
|
12634
12674
|
ClusterWorkflowEngine,
|
|
12635
12675
|
HttpRunner,
|
|
@@ -12666,7 +12706,7 @@ __export(exports_scheduler_service, {
|
|
|
12666
12706
|
SchedulerError: () => SchedulerError,
|
|
12667
12707
|
ScheduleCronInvalid: () => ScheduleCronInvalid
|
|
12668
12708
|
});
|
|
12669
|
-
import { Clock as Clock9, Config as Config4, Context as Context60, Cron, Duration as Duration4, Effect as Effect75, Layer as Layer67, Random, Result as Result3, Schema as
|
|
12709
|
+
import { Clock as Clock9, Config as Config4, Context as Context60, Cron, Duration as Duration4, Effect as Effect75, Layer as Layer67, Random, Result as Result3, Schema as Schema69 } from "effect";
|
|
12670
12710
|
|
|
12671
12711
|
// ../runtime/src/wait/wait-signal.ts
|
|
12672
12712
|
var exports_wait_signal = {};
|
|
@@ -12686,14 +12726,14 @@ var signalWorkflowWait = Effect74.fn("WaitSignal.signalWorkflowWait")(function*
|
|
|
12686
12726
|
});
|
|
12687
12727
|
|
|
12688
12728
|
// ../runtime/src/schedule/scheduler-service.ts
|
|
12689
|
-
class SchedulerError extends
|
|
12690
|
-
message:
|
|
12729
|
+
class SchedulerError extends Schema69.TaggedErrorClass()("SchedulerError", {
|
|
12730
|
+
message: Schema69.String
|
|
12691
12731
|
}) {
|
|
12692
12732
|
}
|
|
12693
12733
|
|
|
12694
|
-
class ScheduleCronInvalid extends
|
|
12695
|
-
cron_expr:
|
|
12696
|
-
message:
|
|
12734
|
+
class ScheduleCronInvalid extends Schema69.TaggedErrorClass()("ScheduleCronInvalid", {
|
|
12735
|
+
cron_expr: Schema69.String,
|
|
12736
|
+
message: Schema69.String
|
|
12697
12737
|
}) {
|
|
12698
12738
|
}
|
|
12699
12739
|
|
|
@@ -12844,25 +12884,25 @@ var runOnce = Effect75.fn("SchedulerService.runOnce.call")(function* () {
|
|
|
12844
12884
|
});
|
|
12845
12885
|
|
|
12846
12886
|
// ../runtime/src/runner/runner-runtime-service.ts
|
|
12847
|
-
var DatabaseMode =
|
|
12887
|
+
var DatabaseMode = Schema70.Literals(["sql", "memory"]).annotate({
|
|
12848
12888
|
identifier: "Relay.RunnerRuntime.DatabaseMode"
|
|
12849
12889
|
});
|
|
12850
|
-
var ReadinessStatus =
|
|
12890
|
+
var ReadinessStatus = Schema70.Struct({
|
|
12851
12891
|
database: DatabaseMode,
|
|
12852
|
-
cluster:
|
|
12853
|
-
workflow:
|
|
12854
|
-
executionEntity:
|
|
12892
|
+
cluster: Schema70.Literal("ready"),
|
|
12893
|
+
workflow: Schema70.Literals(["ready", "client"]),
|
|
12894
|
+
executionEntity: Schema70.Literals(["registered", "client"])
|
|
12855
12895
|
}).annotate({ identifier: "Relay.RunnerRuntime.ReadinessStatus" });
|
|
12856
12896
|
|
|
12857
|
-
class RunnerRuntimeError extends
|
|
12858
|
-
message:
|
|
12897
|
+
class RunnerRuntimeError extends Schema70.TaggedErrorClass()("RunnerRuntimeError", {
|
|
12898
|
+
message: Schema70.String
|
|
12859
12899
|
}) {
|
|
12860
12900
|
}
|
|
12861
12901
|
|
|
12862
|
-
class ClusterConfigMismatch extends
|
|
12863
|
-
field:
|
|
12864
|
-
expected:
|
|
12865
|
-
actual:
|
|
12902
|
+
class ClusterConfigMismatch extends Schema70.TaggedErrorClass()("ClusterConfigMismatch", {
|
|
12903
|
+
field: Schema70.String,
|
|
12904
|
+
expected: Schema70.String,
|
|
12905
|
+
actual: Schema70.String
|
|
12866
12906
|
}) {
|
|
12867
12907
|
}
|
|
12868
12908
|
|
|
@@ -12876,7 +12916,7 @@ var memoryClusterLayer = Sharding.layer.pipe(Layer68.provideMerge(Runners.layerN
|
|
|
12876
12916
|
var clusterHost = Config5.string("RELAY_CLUSTER_HOST").pipe(Config5.withDefault("localhost"));
|
|
12877
12917
|
var clusterPort = Config5.int("RELAY_CLUSTER_PORT").pipe(Config5.withDefault(34431));
|
|
12878
12918
|
var clusterShardsPerGroup = Config5.int("RELAY_CLUSTER_SHARDS_PER_GROUP").pipe(Config5.withDefault(300));
|
|
12879
|
-
var clusterShardGroups = Config5.schema(Config5.Array(
|
|
12919
|
+
var clusterShardGroups = Config5.schema(Config5.Array(Schema70.String), "RELAY_CLUSTER_SHARD_GROUPS").pipe(Config5.withDefault(["default", "execution"]));
|
|
12880
12920
|
var runnerAddressKey = (address) => `${address.host}:${address.port}`;
|
|
12881
12921
|
var runnerAddressEquals = (left, right) => left.host === right.host && left.port === right.port;
|
|
12882
12922
|
var shardingConfigFromEnv = () => Layer68.effect(ShardingConfig2.ShardingConfig, Effect76.gen(function* () {
|
|
@@ -13180,51 +13220,51 @@ __export(exports_activity_version_registry, {
|
|
|
13180
13220
|
ActivityManifestChange: () => ActivityManifestChange,
|
|
13181
13221
|
ActivityManifest: () => ActivityManifest
|
|
13182
13222
|
});
|
|
13183
|
-
import { Crypto as Crypto5, Effect as Effect77, Schema as
|
|
13223
|
+
import { Crypto as Crypto5, Effect as Effect77, Schema as Schema71 } from "effect";
|
|
13184
13224
|
var generatedFrom = "@relayfx/runtime/ExecutionWorkflow";
|
|
13185
|
-
var ActivityManifestEntry =
|
|
13186
|
-
name:
|
|
13187
|
-
signature_hash:
|
|
13225
|
+
var ActivityManifestEntry = Schema71.Struct({
|
|
13226
|
+
name: Schema71.String,
|
|
13227
|
+
signature_hash: Schema71.String
|
|
13188
13228
|
}).annotate({ identifier: "Relay.ActivityManifestEntry" });
|
|
13189
|
-
var ActivityManifest =
|
|
13190
|
-
version:
|
|
13191
|
-
generated_from:
|
|
13192
|
-
hash_algorithm:
|
|
13193
|
-
activities:
|
|
13229
|
+
var ActivityManifest = Schema71.Struct({
|
|
13230
|
+
version: Schema71.Literal(1),
|
|
13231
|
+
generated_from: Schema71.String,
|
|
13232
|
+
hash_algorithm: Schema71.Literal("sha256-json-schema-v1"),
|
|
13233
|
+
activities: Schema71.Array(ActivityManifestEntry)
|
|
13194
13234
|
}).annotate({ identifier: "Relay.ActivityManifest" });
|
|
13195
|
-
var ActivityManifestChange =
|
|
13196
|
-
type:
|
|
13197
|
-
name:
|
|
13198
|
-
baseline_hash:
|
|
13199
|
-
current_hash:
|
|
13235
|
+
var ActivityManifestChange = Schema71.Struct({
|
|
13236
|
+
type: Schema71.Literals(["removed", "changed", "added"]),
|
|
13237
|
+
name: Schema71.String,
|
|
13238
|
+
baseline_hash: Schema71.optionalKey(Schema71.String),
|
|
13239
|
+
current_hash: Schema71.optionalKey(Schema71.String)
|
|
13200
13240
|
}).annotate({ identifier: "Relay.ActivityManifestChange" });
|
|
13201
|
-
var ActivityManifestGuardResult =
|
|
13202
|
-
status:
|
|
13203
|
-
waiting_executions:
|
|
13204
|
-
breaking_changes:
|
|
13205
|
-
additive_changes:
|
|
13241
|
+
var ActivityManifestGuardResult = Schema71.Struct({
|
|
13242
|
+
status: Schema71.Literals(["pass", "fail"]),
|
|
13243
|
+
waiting_executions: Schema71.Int.check(Schema71.isGreaterThanOrEqualTo(0)),
|
|
13244
|
+
breaking_changes: Schema71.Array(ActivityManifestChange),
|
|
13245
|
+
additive_changes: Schema71.Array(ActivityManifestChange)
|
|
13206
13246
|
}).annotate({ identifier: "Relay.ActivityManifestGuardResult" });
|
|
13207
13247
|
|
|
13208
|
-
class ActivityManifestGuardFailed extends
|
|
13209
|
-
message:
|
|
13248
|
+
class ActivityManifestGuardFailed extends Schema71.TaggedErrorClass()("ActivityManifestGuardFailed", {
|
|
13249
|
+
message: Schema71.String,
|
|
13210
13250
|
result: ActivityManifestGuardResult
|
|
13211
13251
|
}) {
|
|
13212
13252
|
}
|
|
13213
|
-
var TurnInput =
|
|
13253
|
+
var TurnInput = Schema71.Struct({
|
|
13214
13254
|
start: StartInput,
|
|
13215
|
-
turn:
|
|
13255
|
+
turn: Schema71.Int.check(Schema71.isGreaterThanOrEqualTo(0))
|
|
13216
13256
|
});
|
|
13217
|
-
var WaitIdInput =
|
|
13257
|
+
var WaitIdInput = Schema71.Struct({
|
|
13218
13258
|
wait_id: exports_ids_schema.WaitId
|
|
13219
13259
|
});
|
|
13220
|
-
var WorkspaceKeyInput =
|
|
13260
|
+
var WorkspaceKeyInput = Schema71.Struct({
|
|
13221
13261
|
start: StartInput,
|
|
13222
|
-
key:
|
|
13262
|
+
key: Schema71.String
|
|
13223
13263
|
});
|
|
13224
13264
|
var contracts = [
|
|
13225
13265
|
{
|
|
13226
13266
|
name: ActivityNameTemplates.resolveLocalAgent,
|
|
13227
|
-
input:
|
|
13267
|
+
input: Schema71.Struct({ address_id: exports_ids_schema.AddressId }),
|
|
13228
13268
|
success: LocalAgentTarget,
|
|
13229
13269
|
error: ExecutionWorkflowFailed
|
|
13230
13270
|
},
|
|
@@ -13236,66 +13276,66 @@ var contracts = [
|
|
|
13236
13276
|
},
|
|
13237
13277
|
{
|
|
13238
13278
|
name: ActivityNameTemplates.cancel,
|
|
13239
|
-
input:
|
|
13279
|
+
input: Schema71.Struct({ start: StartInput, turn: Schema71.Int, reason: Schema71.String }),
|
|
13240
13280
|
success: exports_execution_schema.Execution,
|
|
13241
13281
|
error: ExecutionWorkflowFailed
|
|
13242
13282
|
},
|
|
13243
13283
|
{
|
|
13244
13284
|
name: ActivityNameTemplates.checkCancel,
|
|
13245
13285
|
input: TurnInput,
|
|
13246
|
-
success:
|
|
13286
|
+
success: Schema71.Boolean,
|
|
13247
13287
|
error: ExecutionWorkflowFailed
|
|
13248
13288
|
},
|
|
13249
13289
|
{
|
|
13250
13290
|
name: ActivityNameTemplates.loadWaitBeforeSleep,
|
|
13251
13291
|
input: WaitIdInput,
|
|
13252
|
-
success:
|
|
13292
|
+
success: Schema71.UndefinedOr(WaitSnapshot),
|
|
13253
13293
|
error: ExecutionWorkflowFailed
|
|
13254
13294
|
},
|
|
13255
13295
|
{
|
|
13256
13296
|
name: ActivityNameTemplates.loadWaitAfterWake,
|
|
13257
13297
|
input: WaitIdInput,
|
|
13258
|
-
success:
|
|
13298
|
+
success: Schema71.UndefinedOr(WaitSnapshot),
|
|
13259
13299
|
error: ExecutionWorkflowFailed
|
|
13260
13300
|
},
|
|
13261
13301
|
{
|
|
13262
13302
|
name: ActivityNameTemplates.markWaiting,
|
|
13263
|
-
input:
|
|
13303
|
+
input: Schema71.Struct({ start: StartInput, wait: WaitSnapshot }),
|
|
13264
13304
|
success: exports_execution_schema.Execution,
|
|
13265
13305
|
error: ExecutionWorkflowFailed
|
|
13266
13306
|
},
|
|
13267
13307
|
{
|
|
13268
13308
|
name: ActivityNameTemplates.ensureWorkspace,
|
|
13269
13309
|
input: StartInput,
|
|
13270
|
-
success:
|
|
13310
|
+
success: Schema71.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13271
13311
|
error: ExecutionWorkflowFailed
|
|
13272
13312
|
},
|
|
13273
13313
|
{
|
|
13274
13314
|
name: ActivityNameTemplates.suspendWorkspace,
|
|
13275
13315
|
input: WorkspaceKeyInput,
|
|
13276
|
-
success:
|
|
13316
|
+
success: Schema71.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13277
13317
|
error: ExecutionWorkflowFailed
|
|
13278
13318
|
},
|
|
13279
13319
|
{
|
|
13280
13320
|
name: ActivityNameTemplates.resumeWorkspace,
|
|
13281
13321
|
input: WorkspaceKeyInput,
|
|
13282
|
-
success:
|
|
13322
|
+
success: Schema71.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13283
13323
|
error: ExecutionWorkflowFailed
|
|
13284
13324
|
},
|
|
13285
13325
|
{
|
|
13286
13326
|
name: ActivityNameTemplates.releaseWorkspace,
|
|
13287
13327
|
input: StartInput,
|
|
13288
|
-
success:
|
|
13328
|
+
success: Schema71.UndefinedOr(exports_workspace_schema.WorkspaceLeaseRecord),
|
|
13289
13329
|
error: ExecutionWorkflowFailed
|
|
13290
13330
|
},
|
|
13291
13331
|
{
|
|
13292
13332
|
name: ActivityNameTemplates.complete,
|
|
13293
|
-
input:
|
|
13333
|
+
input: Schema71.Struct({
|
|
13294
13334
|
start: StartInput,
|
|
13295
|
-
turn:
|
|
13296
|
-
wait_id:
|
|
13297
|
-
wait_state:
|
|
13298
|
-
pending_tool_call:
|
|
13335
|
+
turn: Schema71.Int.check(Schema71.isGreaterThanOrEqualTo(0)),
|
|
13336
|
+
wait_id: Schema71.optionalKey(exports_ids_schema.WaitId),
|
|
13337
|
+
wait_state: Schema71.optionalKey(WaitSignalState),
|
|
13338
|
+
pending_tool_call: Schema71.optionalKey(exports_tool_schema.Call)
|
|
13299
13339
|
}),
|
|
13300
13340
|
success: exports_execution_schema.Execution,
|
|
13301
13341
|
error: ExecutionWorkflowFailed
|
|
@@ -13303,24 +13343,24 @@ var contracts = [
|
|
|
13303
13343
|
{
|
|
13304
13344
|
name: ActivityNameTemplates.checkQueuedChildCancellation,
|
|
13305
13345
|
input: StartInput,
|
|
13306
|
-
success:
|
|
13346
|
+
success: Schema71.Boolean,
|
|
13307
13347
|
error: ExecutionWorkflowFailed
|
|
13308
13348
|
},
|
|
13309
13349
|
{
|
|
13310
13350
|
name: ActivityNameTemplates.notifyParent,
|
|
13311
|
-
input:
|
|
13351
|
+
input: Schema71.Struct({
|
|
13312
13352
|
start: StartInput,
|
|
13313
13353
|
status: ChildTerminalStatus,
|
|
13314
|
-
output:
|
|
13354
|
+
output: Schema71.Array(exports_content_schema.Part)
|
|
13315
13355
|
}),
|
|
13316
|
-
success:
|
|
13356
|
+
success: Schema71.Void,
|
|
13317
13357
|
error: ExecutionWorkflowFailed
|
|
13318
13358
|
},
|
|
13319
13359
|
{
|
|
13320
13360
|
name: ActivityNameTemplates.continueAsNew,
|
|
13321
|
-
input:
|
|
13361
|
+
input: Schema71.Struct({
|
|
13322
13362
|
start: StartInput,
|
|
13323
|
-
turn:
|
|
13363
|
+
turn: Schema71.Int.check(Schema71.isGreaterThanOrEqualTo(0)),
|
|
13324
13364
|
wait_id: exports_ids_schema.WaitId,
|
|
13325
13365
|
pending_tool_call: exports_tool_schema.Call
|
|
13326
13366
|
}),
|
|
@@ -13328,7 +13368,7 @@ var contracts = [
|
|
|
13328
13368
|
error: ExecutionWorkflowFailed
|
|
13329
13369
|
}
|
|
13330
13370
|
];
|
|
13331
|
-
var schemaJson = (schema) =>
|
|
13371
|
+
var schemaJson = (schema) => Schema71.decodeUnknownSync(exports_shared_schema.JsonValue)(Schema71.toJsonSchemaDocument(schema));
|
|
13332
13372
|
var canonical = (value) => {
|
|
13333
13373
|
if (value === null || typeof value !== "object")
|
|
13334
13374
|
return value;
|
|
@@ -13419,11 +13459,11 @@ var guard = Effect77.fn("ActivityVersionRegistry.guard")(function* (input) {
|
|
|
13419
13459
|
}));
|
|
13420
13460
|
});
|
|
13421
13461
|
// src/client.ts
|
|
13422
|
-
import { Clock as Clock10, Context as Context62, Effect as Effect78, Layer as Layer69, Option as Option28, Schema as
|
|
13462
|
+
import { Clock as Clock10, Context as Context62, Effect as Effect78, Layer as Layer69, Option as Option28, Schema as Schema72, SchemaGetter, SchemaIssue, Stream as Stream10 } from "effect";
|
|
13423
13463
|
import { EntityId, ShardId, Sharding as Sharding2, ShardingConfig as ShardingConfig3 } from "effect/unstable/cluster";
|
|
13424
13464
|
|
|
13425
|
-
class ClientError extends
|
|
13426
|
-
message:
|
|
13465
|
+
class ClientError extends Schema72.TaggedErrorClass()("ClientError", {
|
|
13466
|
+
message: Schema72.String
|
|
13427
13467
|
}) {
|
|
13428
13468
|
}
|
|
13429
13469
|
|
|
@@ -13455,11 +13495,11 @@ var decodeCursorFields = (wire) => Effect78.gen(function* () {
|
|
|
13455
13495
|
return yield* Effect78.fail(malformedCursor(wire));
|
|
13456
13496
|
return { updatedAt, id: decoded.slice(separator + 1) };
|
|
13457
13497
|
});
|
|
13458
|
-
var ExecutionCursorFromString = exports_shared_schema.NonEmptyString.pipe(
|
|
13498
|
+
var ExecutionCursorFromString = exports_shared_schema.NonEmptyString.pipe(Schema72.decodeTo(Schema72.Struct({ updatedAt: Schema72.Int, id: exports_ids_schema.ExecutionId }), {
|
|
13459
13499
|
decode: SchemaGetter.transformOrFail((wire) => decodeCursorFields(wire)),
|
|
13460
13500
|
encode: SchemaGetter.transform((cursor) => globalThis.btoa(`${cursor.updatedAt}:${cursor.id}`))
|
|
13461
13501
|
})).annotate({ identifier: "Relay.Client.ExecutionCursor" });
|
|
13462
|
-
var SessionCursorFromString = exports_shared_schema.NonEmptyString.pipe(
|
|
13502
|
+
var SessionCursorFromString = exports_shared_schema.NonEmptyString.pipe(Schema72.decodeTo(Schema72.Struct({ updatedAt: Schema72.Int, id: exports_ids_schema.SessionId }), {
|
|
13463
13503
|
decode: SchemaGetter.transformOrFail((wire) => decodeCursorFields(wire)),
|
|
13464
13504
|
encode: SchemaGetter.transform((cursor) => globalThis.btoa(`${cursor.updatedAt}:${cursor.id}`))
|
|
13465
13505
|
})).annotate({ identifier: "Relay.Client.SessionCursor" });
|
|
@@ -13765,27 +13805,27 @@ var layerFromRuntime = Layer69.effect(Service49, Effect78.gen(function* () {
|
|
|
13765
13805
|
return records.map(toWaitView);
|
|
13766
13806
|
}),
|
|
13767
13807
|
listExecutions: Effect78.fn("Client.runtime.listExecutions")(function* (input) {
|
|
13768
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
13808
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema72.decodeEffect(ExecutionCursorFromString)(input.cursor).pipe(Effect78.mapError(toClientError));
|
|
13769
13809
|
const result = yield* executionRepository.list({
|
|
13770
13810
|
...input.root_address_id === undefined ? {} : { rootAddressId: input.root_address_id },
|
|
13771
13811
|
...input.status === undefined ? {} : { status: input.status },
|
|
13772
13812
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
13773
13813
|
...cursor === undefined ? {} : { cursor }
|
|
13774
13814
|
}).pipe(Effect78.mapError(toClientError));
|
|
13775
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
13815
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema72.encodeEffect(ExecutionCursorFromString)(result.nextCursor).pipe(Effect78.mapError(toClientError));
|
|
13776
13816
|
return {
|
|
13777
13817
|
records: result.records.map(toConversationSummary),
|
|
13778
13818
|
...nextCursor === undefined ? {} : { next_cursor: nextCursor }
|
|
13779
13819
|
};
|
|
13780
13820
|
}),
|
|
13781
13821
|
listSessions: Effect78.fn("Client.runtime.listSessions")(function* (input) {
|
|
13782
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
13822
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema72.decodeEffect(SessionCursorFromString)(input.cursor).pipe(Effect78.mapError(toClientError));
|
|
13783
13823
|
const result = yield* sessionRepository.list({
|
|
13784
13824
|
...input.root_address_id === undefined ? {} : { rootAddressId: input.root_address_id },
|
|
13785
13825
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
13786
13826
|
...cursor === undefined ? {} : { cursor }
|
|
13787
13827
|
}).pipe(Effect78.mapError(toClientError));
|
|
13788
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
13828
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema72.encodeEffect(SessionCursorFromString)(result.nextCursor).pipe(Effect78.mapError(toClientError));
|
|
13789
13829
|
return {
|
|
13790
13830
|
records: result.records.map(toSessionSummary),
|
|
13791
13831
|
...nextCursor === undefined ? {} : { next_cursor: nextCursor }
|
|
@@ -13795,13 +13835,13 @@ var layerFromRuntime = Layer69.effect(Service49, Effect78.gen(function* () {
|
|
|
13795
13835
|
const session = yield* sessionRepository.get(input.session_id).pipe(Effect78.mapError(toClientError));
|
|
13796
13836
|
if (session === undefined)
|
|
13797
13837
|
return yield* new ClientError({ message: `Session not found: ${input.session_id}` });
|
|
13798
|
-
const cursor = input.cursor === undefined ? undefined : yield*
|
|
13838
|
+
const cursor = input.cursor === undefined ? undefined : yield* Schema72.decodeEffect(ExecutionCursorFromString)(input.cursor).pipe(Effect78.mapError(toClientError));
|
|
13799
13839
|
const result = yield* executionRepository.list({
|
|
13800
13840
|
sessionId: input.session_id,
|
|
13801
13841
|
...input.limit === undefined ? {} : { limit: input.limit },
|
|
13802
13842
|
...cursor === undefined ? {} : { cursor }
|
|
13803
13843
|
}).pipe(Effect78.mapError(toClientError));
|
|
13804
|
-
const nextCursor = result.nextCursor === undefined ? undefined : yield*
|
|
13844
|
+
const nextCursor = result.nextCursor === undefined ? undefined : yield* Schema72.encodeEffect(ExecutionCursorFromString)(result.nextCursor).pipe(Effect78.mapError(toClientError));
|
|
13805
13845
|
return {
|
|
13806
13846
|
session: toSessionSummary(session),
|
|
13807
13847
|
executions: result.records.map(toConversationSummary),
|
|
@@ -14210,92 +14250,92 @@ __export(exports_operation, {
|
|
|
14210
14250
|
CancelExecutionAccepted: () => CancelExecutionAccepted,
|
|
14211
14251
|
AckEnvelopeReadyInput: () => AckEnvelopeReadyInput
|
|
14212
14252
|
});
|
|
14213
|
-
import { Schema as
|
|
14214
|
-
var StartExecutionInput =
|
|
14253
|
+
import { Schema as Schema73 } from "effect";
|
|
14254
|
+
var StartExecutionInput = Schema73.Struct({
|
|
14215
14255
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14216
14256
|
root_address_id: exports_ids_schema.AddressId,
|
|
14217
|
-
session_id:
|
|
14218
|
-
input:
|
|
14257
|
+
session_id: Schema73.optionalKey(exports_ids_schema.SessionId),
|
|
14258
|
+
input: Schema73.optionalKey(Schema73.Array(exports_content_schema.Part)),
|
|
14219
14259
|
event_sequence: exports_execution_schema.ExecutionEventSequence,
|
|
14220
14260
|
started_at: exports_shared_schema.TimestampMillis,
|
|
14221
14261
|
completed_at: exports_shared_schema.TimestampMillis,
|
|
14222
|
-
agent_definition_id:
|
|
14223
|
-
agent_definition_revision:
|
|
14224
|
-
agent_definition_snapshot:
|
|
14225
|
-
agent_definition_tool_input_schema_digests:
|
|
14226
|
-
wait_id:
|
|
14227
|
-
metadata:
|
|
14262
|
+
agent_definition_id: Schema73.optionalKey(exports_ids_schema.AgentDefinitionId),
|
|
14263
|
+
agent_definition_revision: Schema73.optionalKey(exports_agent_schema.DefinitionRevision),
|
|
14264
|
+
agent_definition_snapshot: Schema73.optionalKey(exports_agent_schema.Definition),
|
|
14265
|
+
agent_definition_tool_input_schema_digests: Schema73.optionalKey(exports_agent_schema.ToolInputSchemaDigests),
|
|
14266
|
+
wait_id: Schema73.optionalKey(exports_ids_schema.WaitId),
|
|
14267
|
+
metadata: Schema73.optionalKey(exports_shared_schema.Metadata)
|
|
14228
14268
|
}).annotate({ identifier: "Relay.Operation.StartExecutionInput" });
|
|
14229
|
-
var StartExecutionResult =
|
|
14269
|
+
var StartExecutionResult = Schema73.Struct({
|
|
14230
14270
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14231
14271
|
status: exports_execution_schema.ExecutionStatus,
|
|
14232
|
-
metadata:
|
|
14272
|
+
metadata: Schema73.optionalKey(exports_shared_schema.Metadata)
|
|
14233
14273
|
}).annotate({ identifier: "Relay.Operation.StartExecutionResult" });
|
|
14234
|
-
var StreamExecutionInput =
|
|
14274
|
+
var StreamExecutionInput = Schema73.Struct({
|
|
14235
14275
|
execution_id: exports_execution_schema.Execution.fields.id,
|
|
14236
|
-
after_cursor:
|
|
14237
|
-
limit:
|
|
14276
|
+
after_cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString),
|
|
14277
|
+
limit: Schema73.optionalKey(Schema73.Int.check(Schema73.isGreaterThan(0)))
|
|
14238
14278
|
}).annotate({ identifier: "Relay.Operation.StreamExecutionInput" });
|
|
14239
|
-
var WaitTerminalState =
|
|
14279
|
+
var WaitTerminalState = Schema73.Literals(["resolved", "timed_out", "cancelled"]).annotate({
|
|
14240
14280
|
identifier: "Relay.Operation.WaitTerminalState"
|
|
14241
14281
|
});
|
|
14242
|
-
var CancelExecutionInput2 =
|
|
14282
|
+
var CancelExecutionInput2 = Schema73.Struct({
|
|
14243
14283
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14244
14284
|
cancelled_at: exports_shared_schema.TimestampMillis,
|
|
14245
|
-
reason:
|
|
14285
|
+
reason: Schema73.optionalKey(Schema73.String)
|
|
14246
14286
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionInput" });
|
|
14247
|
-
var CancelExecutionAccepted =
|
|
14287
|
+
var CancelExecutionAccepted = Schema73.Struct({
|
|
14248
14288
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14249
14289
|
status: exports_execution_schema.ExecutionStatus
|
|
14250
14290
|
}).annotate({ identifier: "Relay.Operation.CancelExecutionAccepted" });
|
|
14251
|
-
var SteeringKind =
|
|
14291
|
+
var SteeringKind = Schema73.Literals(["steering", "follow_up"]).annotate({
|
|
14252
14292
|
identifier: "Relay.Operation.SteeringKind"
|
|
14253
14293
|
});
|
|
14254
|
-
var SteerInput =
|
|
14294
|
+
var SteerInput = Schema73.Struct({
|
|
14255
14295
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14256
14296
|
kind: SteeringKind,
|
|
14257
|
-
content:
|
|
14297
|
+
content: Schema73.Array(exports_content_schema.Part),
|
|
14258
14298
|
created_at: exports_shared_schema.TimestampMillis
|
|
14259
14299
|
}).annotate({ identifier: "Relay.Operation.SteerInput" });
|
|
14260
|
-
var SteerAccepted =
|
|
14300
|
+
var SteerAccepted = Schema73.Struct({
|
|
14261
14301
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14262
14302
|
kind: SteeringKind,
|
|
14263
|
-
sequence:
|
|
14303
|
+
sequence: Schema73.Int.check(Schema73.isGreaterThanOrEqualTo(0))
|
|
14264
14304
|
}).annotate({ identifier: "Relay.Operation.SteerAccepted" });
|
|
14265
|
-
var WakeInput =
|
|
14305
|
+
var WakeInput = Schema73.Struct({
|
|
14266
14306
|
wait_id: exports_ids_schema.WaitId,
|
|
14267
14307
|
state: WaitTerminalState,
|
|
14268
14308
|
signaled_at: exports_shared_schema.TimestampMillis,
|
|
14269
|
-
from:
|
|
14270
|
-
content:
|
|
14271
|
-
correlation_key:
|
|
14272
|
-
metadata:
|
|
14309
|
+
from: Schema73.optionalKey(exports_ids_schema.AddressId),
|
|
14310
|
+
content: Schema73.optionalKey(Schema73.Array(exports_content_schema.Part)),
|
|
14311
|
+
correlation_key: Schema73.optionalKey(Schema73.String),
|
|
14312
|
+
metadata: Schema73.optionalKey(exports_shared_schema.Metadata)
|
|
14273
14313
|
}).annotate({ identifier: "Relay.Operation.WakeInput" });
|
|
14274
|
-
var WakeAccepted =
|
|
14314
|
+
var WakeAccepted = Schema73.Struct({
|
|
14275
14315
|
wait_id: exports_ids_schema.WaitId,
|
|
14276
14316
|
state: WaitTerminalState,
|
|
14277
14317
|
signaled_at: exports_shared_schema.TimestampMillis
|
|
14278
14318
|
}).annotate({ identifier: "Relay.Operation.WakeAccepted" });
|
|
14279
|
-
var WaitState2 =
|
|
14319
|
+
var WaitState2 = Schema73.Literals(["open", "resolved", "timed_out", "cancelled"]).annotate({
|
|
14280
14320
|
identifier: "Relay.Operation.WaitState"
|
|
14281
14321
|
});
|
|
14282
|
-
var ListWaitsInput =
|
|
14283
|
-
state:
|
|
14284
|
-
execution_id:
|
|
14285
|
-
limit:
|
|
14322
|
+
var ListWaitsInput = Schema73.Struct({
|
|
14323
|
+
state: Schema73.optionalKey(WaitState2),
|
|
14324
|
+
execution_id: Schema73.optionalKey(exports_ids_schema.ExecutionId),
|
|
14325
|
+
limit: Schema73.optionalKey(Schema73.Int.check(Schema73.isGreaterThan(0)))
|
|
14286
14326
|
}).annotate({ identifier: "Relay.Operation.ListWaitsInput" });
|
|
14287
|
-
var WaitView =
|
|
14327
|
+
var WaitView = Schema73.Struct({
|
|
14288
14328
|
wait_id: exports_ids_schema.WaitId,
|
|
14289
14329
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14290
|
-
envelope_id:
|
|
14330
|
+
envelope_id: Schema73.optionalKey(exports_ids_schema.EnvelopeId),
|
|
14291
14331
|
mode: exports_envelope_schema.WaitMode,
|
|
14292
|
-
correlation_key:
|
|
14332
|
+
correlation_key: Schema73.optionalKey(Schema73.String),
|
|
14293
14333
|
state: WaitState2,
|
|
14294
14334
|
metadata: exports_shared_schema.Metadata,
|
|
14295
14335
|
created_at: exports_shared_schema.TimestampMillis,
|
|
14296
|
-
resolved_at:
|
|
14336
|
+
resolved_at: Schema73.optionalKey(exports_shared_schema.TimestampMillis)
|
|
14297
14337
|
}).annotate({ identifier: "Relay.Operation.WaitView" });
|
|
14298
|
-
var PendingToolApproval =
|
|
14338
|
+
var PendingToolApproval = Schema73.Struct({
|
|
14299
14339
|
wait_id: exports_ids_schema.WaitId,
|
|
14300
14340
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14301
14341
|
tool_call_id: exports_ids_schema.ToolCallId,
|
|
@@ -14303,169 +14343,169 @@ var PendingToolApproval = Schema72.Struct({
|
|
|
14303
14343
|
input: exports_shared_schema.JsonValue,
|
|
14304
14344
|
requested_at: exports_shared_schema.TimestampMillis
|
|
14305
14345
|
}).annotate({ identifier: "Relay.Operation.PendingToolApproval" });
|
|
14306
|
-
var ListPendingApprovalsInput =
|
|
14346
|
+
var ListPendingApprovalsInput = Schema73.Struct({
|
|
14307
14347
|
execution_id: exports_ids_schema.ExecutionId
|
|
14308
14348
|
}).annotate({ identifier: "Relay.Operation.ListPendingApprovalsInput" });
|
|
14309
|
-
var PendingToolApprovalList =
|
|
14310
|
-
approvals:
|
|
14349
|
+
var PendingToolApprovalList = Schema73.Struct({
|
|
14350
|
+
approvals: Schema73.Array(PendingToolApproval)
|
|
14311
14351
|
}).annotate({ identifier: "Relay.Operation.PendingToolApprovalList" });
|
|
14312
|
-
var ResolveToolApprovalInput =
|
|
14352
|
+
var ResolveToolApprovalInput = Schema73.Struct({
|
|
14313
14353
|
wait_id: exports_ids_schema.WaitId,
|
|
14314
|
-
approved:
|
|
14315
|
-
comment:
|
|
14354
|
+
approved: Schema73.Boolean,
|
|
14355
|
+
comment: Schema73.optionalKey(Schema73.String),
|
|
14316
14356
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
14317
14357
|
}).annotate({ identifier: "Relay.Operation.ResolveToolApprovalInput" });
|
|
14318
|
-
var PermissionAnswer =
|
|
14358
|
+
var PermissionAnswer = Schema73.Literals(["Approved", "Denied", "Always"]).annotate({
|
|
14319
14359
|
identifier: "Relay.Operation.PermissionAnswer"
|
|
14320
14360
|
});
|
|
14321
|
-
var ResolvePermissionInput =
|
|
14361
|
+
var ResolvePermissionInput = Schema73.Struct({
|
|
14322
14362
|
wait_id: exports_ids_schema.WaitId,
|
|
14323
14363
|
answer: PermissionAnswer,
|
|
14324
|
-
reason:
|
|
14364
|
+
reason: Schema73.optionalKey(Schema73.String),
|
|
14325
14365
|
resolved_at: exports_shared_schema.TimestampMillis
|
|
14326
14366
|
}).annotate({ identifier: "Relay.Operation.ResolvePermissionInput" });
|
|
14327
|
-
var SubmitInboundEnvelopeInput =
|
|
14367
|
+
var SubmitInboundEnvelopeInput = Schema73.Struct({
|
|
14328
14368
|
envelope: exports_envelope_schema.SendInput,
|
|
14329
14369
|
wake: WakeInput
|
|
14330
14370
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeInput" });
|
|
14331
|
-
var SubmitInboundEnvelopeAccepted =
|
|
14371
|
+
var SubmitInboundEnvelopeAccepted = Schema73.Struct({
|
|
14332
14372
|
envelope: exports_envelope_schema.EnvelopeAccepted,
|
|
14333
14373
|
wake: WakeAccepted
|
|
14334
14374
|
}).annotate({ identifier: "Relay.Operation.SubmitInboundEnvelopeAccepted" });
|
|
14335
|
-
var ClaimEnvelopeReadyInput =
|
|
14375
|
+
var ClaimEnvelopeReadyInput = Schema73.Struct({
|
|
14336
14376
|
route_type: exports_address_schema.RouteKind,
|
|
14337
|
-
route_key:
|
|
14377
|
+
route_key: Schema73.optionalKey(Schema73.String),
|
|
14338
14378
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
14339
14379
|
now: exports_shared_schema.TimestampMillis,
|
|
14340
14380
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
14341
14381
|
}).annotate({ identifier: "Relay.Operation.ClaimEnvelopeReadyInput" });
|
|
14342
|
-
var EnvelopeReadyLease =
|
|
14382
|
+
var EnvelopeReadyLease = Schema73.Struct({
|
|
14343
14383
|
ready: exports_envelope_schema.EnvelopeReady,
|
|
14344
14384
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
14345
14385
|
claim_expires_at: exports_shared_schema.TimestampMillis
|
|
14346
14386
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyLease" });
|
|
14347
|
-
var AckEnvelopeReadyInput =
|
|
14387
|
+
var AckEnvelopeReadyInput = Schema73.Struct({
|
|
14348
14388
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
14349
14389
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
14350
14390
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
14351
14391
|
}).annotate({ identifier: "Relay.Operation.AckEnvelopeReadyInput" });
|
|
14352
|
-
var EnvelopeReadyAcked =
|
|
14392
|
+
var EnvelopeReadyAcked = Schema73.Struct({
|
|
14353
14393
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
14354
|
-
state:
|
|
14394
|
+
state: Schema73.Literal("acknowledged"),
|
|
14355
14395
|
acknowledged_at: exports_shared_schema.TimestampMillis
|
|
14356
14396
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyAcked" });
|
|
14357
|
-
var ReleaseEnvelopeReadyInput =
|
|
14397
|
+
var ReleaseEnvelopeReadyInput = Schema73.Struct({
|
|
14358
14398
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
14359
14399
|
worker_id: exports_shared_schema.NonEmptyString,
|
|
14360
14400
|
next_available_at: exports_shared_schema.TimestampMillis,
|
|
14361
|
-
error:
|
|
14401
|
+
error: Schema73.optionalKey(Schema73.String)
|
|
14362
14402
|
}).annotate({ identifier: "Relay.Operation.ReleaseEnvelopeReadyInput" });
|
|
14363
|
-
var EnvelopeReadyReleased =
|
|
14403
|
+
var EnvelopeReadyReleased = Schema73.Struct({
|
|
14364
14404
|
envelope_ready_id: exports_ids_schema.EnvelopeReadyId,
|
|
14365
|
-
state:
|
|
14405
|
+
state: Schema73.Literal("ready"),
|
|
14366
14406
|
next_available_at: exports_shared_schema.TimestampMillis
|
|
14367
14407
|
}).annotate({ identifier: "Relay.Operation.EnvelopeReadyReleased" });
|
|
14368
|
-
var CreateScheduleInput =
|
|
14408
|
+
var CreateScheduleInput = Schema73.Struct({
|
|
14369
14409
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
14370
14410
|
kind: exports_schedule_schema.ScheduleKind,
|
|
14371
14411
|
target_kind: exports_schedule_schema.ScheduleTargetKind,
|
|
14372
|
-
address_id:
|
|
14373
|
-
wait_id:
|
|
14374
|
-
cron_expr:
|
|
14375
|
-
input:
|
|
14412
|
+
address_id: Schema73.optionalKey(exports_ids_schema.AddressId),
|
|
14413
|
+
wait_id: Schema73.optionalKey(exports_ids_schema.WaitId),
|
|
14414
|
+
cron_expr: Schema73.optionalKey(exports_shared_schema.NonEmptyString),
|
|
14415
|
+
input: Schema73.optionalKey(Schema73.Array(exports_content_schema.Part)),
|
|
14376
14416
|
next_run_at: exports_shared_schema.TimestampMillis,
|
|
14377
|
-
idempotency_key:
|
|
14378
|
-
metadata:
|
|
14417
|
+
idempotency_key: Schema73.optionalKey(exports_shared_schema.NonEmptyString),
|
|
14418
|
+
metadata: Schema73.optionalKey(exports_shared_schema.Metadata)
|
|
14379
14419
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleInput" });
|
|
14380
|
-
var CreateScheduleResult =
|
|
14420
|
+
var CreateScheduleResult = Schema73.Struct({
|
|
14381
14421
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
14382
14422
|
}).annotate({ identifier: "Relay.Operation.CreateScheduleResult" });
|
|
14383
|
-
var CancelScheduleInput =
|
|
14423
|
+
var CancelScheduleInput = Schema73.Struct({
|
|
14384
14424
|
schedule_id: exports_ids_schema.ScheduleId,
|
|
14385
14425
|
cancelled_at: exports_shared_schema.TimestampMillis
|
|
14386
14426
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleInput" });
|
|
14387
|
-
var CancelScheduleResult =
|
|
14427
|
+
var CancelScheduleResult = Schema73.Struct({
|
|
14388
14428
|
schedule: exports_schedule_schema.ScheduleRecord
|
|
14389
14429
|
}).annotate({ identifier: "Relay.Operation.CancelScheduleResult" });
|
|
14390
|
-
var ListSchedulesInput =
|
|
14391
|
-
state:
|
|
14430
|
+
var ListSchedulesInput = Schema73.Struct({
|
|
14431
|
+
state: Schema73.optionalKey(exports_schedule_schema.ScheduleState)
|
|
14392
14432
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesInput" });
|
|
14393
|
-
var ListSchedulesResult =
|
|
14394
|
-
schedules:
|
|
14433
|
+
var ListSchedulesResult = Schema73.Struct({
|
|
14434
|
+
schedules: Schema73.Array(exports_schedule_schema.ScheduleRecord)
|
|
14395
14435
|
}).annotate({ identifier: "Relay.Operation.ListSchedulesResult" });
|
|
14396
|
-
var ListExecutionsInput =
|
|
14397
|
-
root_address_id:
|
|
14398
|
-
status:
|
|
14399
|
-
limit:
|
|
14400
|
-
cursor:
|
|
14436
|
+
var ListExecutionsInput = Schema73.Struct({
|
|
14437
|
+
root_address_id: Schema73.optionalKey(exports_ids_schema.AddressId),
|
|
14438
|
+
status: Schema73.optionalKey(exports_execution_schema.ExecutionStatus),
|
|
14439
|
+
limit: Schema73.optionalKey(Schema73.Int.check(Schema73.isGreaterThan(0))),
|
|
14440
|
+
cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString)
|
|
14401
14441
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsInput" });
|
|
14402
|
-
var ConversationKind =
|
|
14442
|
+
var ConversationKind = Schema73.Literals(["user-agent", "agent-agent"]).annotate({
|
|
14403
14443
|
identifier: "Relay.Operation.ConversationKind"
|
|
14404
14444
|
});
|
|
14405
|
-
var ConversationSummary =
|
|
14445
|
+
var ConversationSummary = Schema73.Struct({
|
|
14406
14446
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14407
14447
|
root_address_id: exports_ids_schema.AddressId,
|
|
14408
|
-
session_id:
|
|
14448
|
+
session_id: Schema73.optionalKey(exports_ids_schema.SessionId),
|
|
14409
14449
|
status: exports_execution_schema.ExecutionStatus,
|
|
14410
14450
|
kind: ConversationKind,
|
|
14411
|
-
agent_definition_id:
|
|
14451
|
+
agent_definition_id: Schema73.optionalKey(exports_ids_schema.AgentDefinitionId),
|
|
14412
14452
|
metadata: exports_shared_schema.Metadata,
|
|
14413
14453
|
created_at: exports_shared_schema.TimestampMillis,
|
|
14414
14454
|
updated_at: exports_shared_schema.TimestampMillis
|
|
14415
14455
|
}).annotate({ identifier: "Relay.Operation.ConversationSummary" });
|
|
14416
|
-
var ListExecutionsResult =
|
|
14417
|
-
records:
|
|
14418
|
-
next_cursor:
|
|
14456
|
+
var ListExecutionsResult = Schema73.Struct({
|
|
14457
|
+
records: Schema73.Array(ConversationSummary),
|
|
14458
|
+
next_cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString)
|
|
14419
14459
|
}).annotate({ identifier: "Relay.Operation.ListExecutionsResult" });
|
|
14420
|
-
var ListSessionsInput =
|
|
14421
|
-
root_address_id:
|
|
14422
|
-
limit:
|
|
14423
|
-
cursor:
|
|
14460
|
+
var ListSessionsInput = Schema73.Struct({
|
|
14461
|
+
root_address_id: Schema73.optionalKey(exports_ids_schema.AddressId),
|
|
14462
|
+
limit: Schema73.optionalKey(Schema73.Int.check(Schema73.isGreaterThan(0))),
|
|
14463
|
+
cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString)
|
|
14424
14464
|
}).annotate({ identifier: "Relay.Operation.ListSessionsInput" });
|
|
14425
|
-
var SessionSummary =
|
|
14465
|
+
var SessionSummary = Schema73.Struct({
|
|
14426
14466
|
session_id: exports_ids_schema.SessionId,
|
|
14427
14467
|
root_address_id: exports_ids_schema.AddressId,
|
|
14428
14468
|
metadata: exports_shared_schema.Metadata,
|
|
14429
14469
|
created_at: exports_shared_schema.TimestampMillis,
|
|
14430
14470
|
updated_at: exports_shared_schema.TimestampMillis
|
|
14431
14471
|
}).annotate({ identifier: "Relay.Operation.SessionSummary" });
|
|
14432
|
-
var ListSessionsResult =
|
|
14433
|
-
records:
|
|
14434
|
-
next_cursor:
|
|
14472
|
+
var ListSessionsResult = Schema73.Struct({
|
|
14473
|
+
records: Schema73.Array(SessionSummary),
|
|
14474
|
+
next_cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString)
|
|
14435
14475
|
}).annotate({ identifier: "Relay.Operation.ListSessionsResult" });
|
|
14436
|
-
var GetSessionInput =
|
|
14476
|
+
var GetSessionInput = Schema73.Struct({
|
|
14437
14477
|
session_id: exports_ids_schema.SessionId,
|
|
14438
|
-
limit:
|
|
14439
|
-
cursor:
|
|
14478
|
+
limit: Schema73.optionalKey(Schema73.Int.check(Schema73.isGreaterThan(0))),
|
|
14479
|
+
cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString)
|
|
14440
14480
|
}).annotate({ identifier: "Relay.Operation.GetSessionInput" });
|
|
14441
|
-
var GetSessionResult =
|
|
14481
|
+
var GetSessionResult = Schema73.Struct({
|
|
14442
14482
|
session: SessionSummary,
|
|
14443
|
-
executions:
|
|
14444
|
-
next_cursor:
|
|
14483
|
+
executions: Schema73.Array(ConversationSummary),
|
|
14484
|
+
next_cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString)
|
|
14445
14485
|
}).annotate({ identifier: "Relay.Operation.GetSessionResult" });
|
|
14446
|
-
var ReplayExecutionInput =
|
|
14486
|
+
var ReplayExecutionInput = Schema73.Struct({
|
|
14447
14487
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14448
|
-
after_cursor:
|
|
14449
|
-
limit:
|
|
14488
|
+
after_cursor: Schema73.optionalKey(exports_shared_schema.NonEmptyString),
|
|
14489
|
+
limit: Schema73.optionalKey(Schema73.Int.check(Schema73.isGreaterThan(0)))
|
|
14450
14490
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionInput" });
|
|
14451
|
-
var ReplayExecutionResult =
|
|
14452
|
-
events:
|
|
14491
|
+
var ReplayExecutionResult = Schema73.Struct({
|
|
14492
|
+
events: Schema73.Array(exports_execution_schema.ExecutionEvent)
|
|
14453
14493
|
}).annotate({ identifier: "Relay.Operation.ReplayExecutionResult" });
|
|
14454
|
-
var RunnerSummary =
|
|
14455
|
-
address:
|
|
14456
|
-
healthy:
|
|
14494
|
+
var RunnerSummary = Schema73.Struct({
|
|
14495
|
+
address: Schema73.String,
|
|
14496
|
+
healthy: Schema73.Boolean,
|
|
14457
14497
|
last_heartbeat: exports_shared_schema.TimestampMillis,
|
|
14458
|
-
owned_shards:
|
|
14498
|
+
owned_shards: Schema73.Int
|
|
14459
14499
|
}).annotate({ identifier: "Relay.Operation.RunnerSummary" });
|
|
14460
|
-
var ListRunnersResult =
|
|
14461
|
-
runners:
|
|
14462
|
-
total_shards:
|
|
14500
|
+
var ListRunnersResult = Schema73.Struct({
|
|
14501
|
+
runners: Schema73.Array(RunnerSummary),
|
|
14502
|
+
total_shards: Schema73.Int
|
|
14463
14503
|
}).annotate({ identifier: "Relay.Operation.ListRunnersResult" });
|
|
14464
|
-
var RouteExecutionResult =
|
|
14504
|
+
var RouteExecutionResult = Schema73.Struct({
|
|
14465
14505
|
execution_id: exports_ids_schema.ExecutionId,
|
|
14466
|
-
shard:
|
|
14467
|
-
runner_address:
|
|
14468
|
-
owned:
|
|
14506
|
+
shard: Schema73.String,
|
|
14507
|
+
runner_address: Schema73.NullOr(Schema73.String),
|
|
14508
|
+
owned: Schema73.Boolean
|
|
14469
14509
|
}).annotate({ identifier: "Relay.Operation.RouteExecutionResult" });
|
|
14470
14510
|
// ../ai/src/embedding-model/embedding-model-registration.ts
|
|
14471
14511
|
import * as OpenAiClient from "@effect/ai-openai/OpenAiClient";
|