@relayfx/sdk 0.2.15 → 0.2.16

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.
Files changed (109) hide show
  1. package/dist/ai.js +2 -2
  2. package/dist/{index-z9xk02sv.js → index-5x686v8w.js} +1782 -1542
  3. package/dist/{index-gxskhyra.js → index-6dv1dqq1.js} +8 -8
  4. package/dist/{index-xbbfagnb.js → index-a6vwwhcp.js} +116 -105
  5. package/dist/{index-d8q4kfjy.js → index-per7tyzq.js} +12 -8
  6. package/dist/index.js +5 -5
  7. package/dist/mysql.js +24 -9
  8. package/dist/postgres.js +18 -13
  9. package/dist/sqlite.js +26 -29
  10. package/dist/types/ai/embedding-model/embedding-model-registration.d.ts +2 -2
  11. package/dist/types/relay/adapter-outbox.d.ts +1 -1
  12. package/dist/types/relay/client.d.ts +28 -28
  13. package/dist/types/relay/command.d.ts +10 -4
  14. package/dist/types/relay/database.d.ts +4 -4
  15. package/dist/types/relay/migration-errors.d.ts +8 -2
  16. package/dist/types/relay/mysql.d.ts +2 -2
  17. package/dist/types/relay/operation.d.ts +126 -126
  18. package/dist/types/relay/postgres.d.ts +2 -2
  19. package/dist/types/relay/runtime-capability-policy.d.ts +11 -5
  20. package/dist/types/relay/runtime-database.d.ts +1 -1
  21. package/dist/types/relay/runtime.d.ts +4 -4
  22. package/dist/types/relay/sqlite-migrations.d.ts +1 -1
  23. package/dist/types/relay/sqlite-runtime.d.ts +10 -5
  24. package/dist/types/relay/tool-worker.d.ts +6 -5
  25. package/dist/types/runtime/address/address-book-service.d.ts +3 -3
  26. package/dist/types/runtime/address/address-resolution-service.d.ts +41 -41
  27. package/dist/types/runtime/agent/agent-loop-service.d.ts +14 -5
  28. package/dist/types/runtime/agent/agent-registry-service.d.ts +2 -2
  29. package/dist/types/runtime/agent/prompt-assembler-service.d.ts +1 -1
  30. package/dist/types/runtime/agent/relay-tool-output.d.ts +4 -1
  31. package/dist/types/runtime/child/child-fan-out-admission-service.d.ts +1 -1
  32. package/dist/types/runtime/child/child-fan-out-runtime.d.ts +12 -8
  33. package/dist/types/runtime/child/child-fan-out-transition-service.d.ts +1 -1
  34. package/dist/types/runtime/child/child-run-service.d.ts +7 -4
  35. package/dist/types/runtime/child/parent-notifier-service.d.ts +4 -2
  36. package/dist/types/runtime/child/spawn-child-run-tool.d.ts +5 -4
  37. package/dist/types/runtime/cluster/execution-entity.d.ts +2 -2
  38. package/dist/types/runtime/content/artifact-store-service.d.ts +2 -2
  39. package/dist/types/runtime/content/blob-store-service.d.ts +1 -1
  40. package/dist/types/runtime/entity/entity-instance-service.d.ts +14 -5
  41. package/dist/types/runtime/entity/entity-registry-service.d.ts +2 -2
  42. package/dist/types/runtime/envelope/envelope-service.d.ts +2 -2
  43. package/dist/types/runtime/execution/active-execution-registry.d.ts +1 -1
  44. package/dist/types/runtime/execution/event-log-service.d.ts +5 -2
  45. package/dist/types/runtime/execution/execution-service.d.ts +1 -1
  46. package/dist/types/runtime/execution/execution-watch-service.d.ts +1 -1
  47. package/dist/types/runtime/execution/session-stream-service.d.ts +1 -1
  48. package/dist/types/runtime/inbox/inbox-service.d.ts +1 -1
  49. package/dist/types/runtime/memory/memory-service.d.ts +1 -1
  50. package/dist/types/runtime/model/embedding-model-service.d.ts +23 -10
  51. package/dist/types/runtime/model/language-model-service.d.ts +19 -6
  52. package/dist/types/runtime/model/model-call-policy.d.ts +1 -1
  53. package/dist/types/runtime/observability/runtime-metrics.d.ts +12 -3
  54. package/dist/types/runtime/presence/presence-service.d.ts +1 -1
  55. package/dist/types/runtime/presence/presence-tool.d.ts +1 -1
  56. package/dist/types/runtime/runner/runner-runtime-service.d.ts +19 -19
  57. package/dist/types/runtime/schedule/scheduler-service.d.ts +3 -3
  58. package/dist/types/runtime/schema-registry/schema-registry-service.d.ts +2 -2
  59. package/dist/types/runtime/session/session-store-service.d.ts +13 -4
  60. package/dist/types/runtime/skill/skill-registry-service.d.ts +2 -2
  61. package/dist/types/runtime/state/execution-state-service.d.ts +5 -2
  62. package/dist/types/runtime/tool/tool-runtime-service.d.ts +42 -19
  63. package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +2 -2
  64. package/dist/types/runtime/topic/topic-service.d.ts +1 -1
  65. package/dist/types/runtime/wait/wait-service.d.ts +1 -1
  66. package/dist/types/runtime/wait/wait-signal.d.ts +12 -3
  67. package/dist/types/runtime/workflow/activity-version-registry.d.ts +7 -3
  68. package/dist/types/runtime/workflow/definition-runtime.d.ts +37 -22
  69. package/dist/types/runtime/workflow/execution-workflow.d.ts +105 -110
  70. package/dist/types/runtime/workspace/workspace-planner-service.d.ts +6 -6
  71. package/dist/types/runtime/workspace/workspace-provider-service.d.ts +11 -7
  72. package/dist/types/runtime/workspace/workspace-runtime-service.d.ts +1 -1
  73. package/dist/types/schema/agent-schema.d.ts +246 -246
  74. package/dist/types/schema/child-orchestration-schema.d.ts +64 -64
  75. package/dist/types/schema/execution-schema.d.ts +57 -57
  76. package/dist/types/schema/workflow-schema.d.ts +243 -243
  77. package/dist/types/schema/workspace-schema.d.ts +1 -1
  78. package/dist/types/store-sql/address/address-book-repository.d.ts +5 -5
  79. package/dist/types/store-sql/agent/agent-definition-repository.d.ts +7 -7
  80. package/dist/types/store-sql/chat/agent-chat-repository.d.ts +2 -2
  81. package/dist/types/store-sql/child/child-execution-repository.d.ts +4 -4
  82. package/dist/types/store-sql/child/child-fan-out-repository.d.ts +2 -2
  83. package/dist/types/store-sql/cluster/cluster-registry-repository.d.ts +5 -5
  84. package/dist/types/store-sql/compaction/compaction-repository.d.ts +3 -3
  85. package/dist/types/store-sql/database/database-service.d.ts +3 -3
  86. package/dist/types/store-sql/database/notification-bus.d.ts +1 -1
  87. package/dist/types/store-sql/database/sql-dialect.d.ts +4 -1
  88. package/dist/types/store-sql/entity/entity-repository.d.ts +2 -2
  89. package/dist/types/store-sql/envelope/envelope-repository.d.ts +13 -13
  90. package/dist/types/store-sql/execution/execution-event-repository.d.ts +4 -4
  91. package/dist/types/store-sql/execution/execution-repository.d.ts +8 -8
  92. package/dist/types/store-sql/idempotency/idempotency-repository.d.ts +5 -5
  93. package/dist/types/store-sql/inbox/inbox-repository.d.ts +1 -1
  94. package/dist/types/store-sql/memory/memory-repository.d.ts +3 -3
  95. package/dist/types/store-sql/permission/permission-rule-repository.d.ts +2 -2
  96. package/dist/types/store-sql/presence/presence-repository.d.ts +2 -2
  97. package/dist/types/store-sql/schedule/schedule-repository.d.ts +9 -9
  98. package/dist/types/store-sql/schema/relay-schema.d.ts +257 -257
  99. package/dist/types/store-sql/session/context-epoch-repository.d.ts +2 -2
  100. package/dist/types/store-sql/session/session-repository.d.ts +5 -5
  101. package/dist/types/store-sql/skill/skill-definition-repository.d.ts +9 -9
  102. package/dist/types/store-sql/state/execution-state-repository.d.ts +2 -2
  103. package/dist/types/store-sql/steering/steering-repository.d.ts +5 -5
  104. package/dist/types/store-sql/tenant/tenant-id.d.ts +2 -2
  105. package/dist/types/store-sql/tool/tool-call-repository.d.ts +19 -16
  106. package/dist/types/store-sql/topic/topic-repository.d.ts +1 -1
  107. package/dist/types/store-sql/workflow/workflow-definition-repository.d.ts +16 -14
  108. package/dist/types/store-sql/workspace/workspace-lease-repository.d.ts +11 -11
  109. package/package.json +3 -3
@@ -68,29 +68,36 @@ export declare const StartExecutionInput: Schema.Struct<{
68
68
  readonly agent_revision: Schema.optionalKey<Schema.Int>;
69
69
  readonly agent_snapshot: Schema.optionalKey<Schema.Codec<Agent.Definition, {
70
70
  readonly name: string;
71
- readonly permissions: readonly {
72
- readonly name: string;
73
- readonly value: Schema.Json;
74
- readonly metadata?: {
75
- readonly [x: string]: Schema.Json;
76
- };
77
- }[];
71
+ readonly instructions?: string;
78
72
  readonly model: {
79
73
  readonly provider: string;
80
74
  readonly model: string;
81
- readonly metadata?: {
82
- readonly [x: string]: Schema.Json;
83
- };
84
75
  readonly registration_key?: string;
85
76
  readonly request_options?: {
86
77
  readonly [x: string]: Schema.Json;
87
78
  };
79
+ readonly metadata?: {
80
+ readonly [x: string]: Schema.Json;
81
+ };
88
82
  };
89
83
  readonly tool_names: readonly string[];
90
- readonly metadata?: {
91
- readonly [x: string]: Schema.Json;
84
+ readonly permissions: readonly {
85
+ readonly name: string;
86
+ readonly value: Schema.Json;
87
+ readonly metadata?: {
88
+ readonly [x: string]: Schema.Json;
89
+ };
90
+ }[];
91
+ readonly skill_definition_ids?: readonly string[];
92
+ readonly permission_rules?: {
93
+ readonly rules: readonly {
94
+ readonly pattern: string;
95
+ readonly level: "allow" | "ask" | "deny";
96
+ readonly reason?: string;
97
+ }[];
98
+ readonly fallback?: "allow" | "ask" | "deny";
92
99
  };
93
- readonly instructions?: string;
100
+ readonly turn_policy?: Agent.TurnPolicySnapshot;
94
101
  readonly compaction_policy?: {
95
102
  readonly context_window: number;
96
103
  readonly reserve_tokens: number;
@@ -98,47 +105,32 @@ export declare const StartExecutionInput: Schema.Struct<{
98
105
  readonly summary_model?: {
99
106
  readonly provider: string;
100
107
  readonly model: string;
101
- readonly metadata?: {
102
- readonly [x: string]: Schema.Json;
103
- };
104
108
  readonly registration_key?: string;
105
109
  readonly request_options?: {
106
110
  readonly [x: string]: Schema.Json;
107
111
  };
112
+ readonly metadata?: {
113
+ readonly [x: string]: Schema.Json;
114
+ };
108
115
  };
109
116
  };
110
- readonly output_schema_ref?: string;
111
- readonly skill_definition_ids?: readonly string[];
112
- readonly permission_rules?: {
113
- readonly rules: readonly {
114
- readonly pattern: string;
115
- readonly level: "allow" | "deny" | "ask";
116
- readonly reason?: string;
117
- }[];
118
- readonly fallback?: "allow" | "deny" | "ask";
119
- };
120
- readonly turn_policy?: Agent.TurnPolicySnapshot;
121
117
  readonly max_tool_turns?: number;
122
118
  readonly max_wait_turns?: number;
123
119
  readonly token_budget?: number;
124
120
  readonly child_run_presets?: {
125
121
  readonly [x: string]: {
126
- readonly metadata?: {
127
- readonly [x: string]: Schema.Json;
128
- };
129
- readonly permissions?: readonly string[];
122
+ readonly instructions?: string;
130
123
  readonly model?: {
131
124
  readonly provider: string;
132
125
  readonly model: string;
133
- readonly metadata?: {
134
- readonly [x: string]: Schema.Json;
135
- };
136
126
  readonly registration_key?: string;
137
127
  readonly request_options?: {
138
128
  readonly [x: string]: Schema.Json;
139
129
  };
130
+ readonly metadata?: {
131
+ readonly [x: string]: Schema.Json;
132
+ };
140
133
  };
141
- readonly instructions?: string;
142
134
  readonly compaction_policy?: {
143
135
  readonly context_window: number;
144
136
  readonly reserve_tokens: number;
@@ -146,27 +138,35 @@ export declare const StartExecutionInput: Schema.Struct<{
146
138
  readonly summary_model?: {
147
139
  readonly provider: string;
148
140
  readonly model: string;
149
- readonly metadata?: {
150
- readonly [x: string]: Schema.Json;
151
- };
152
141
  readonly registration_key?: string;
153
142
  readonly request_options?: {
154
143
  readonly [x: string]: Schema.Json;
155
144
  };
145
+ readonly metadata?: {
146
+ readonly [x: string]: Schema.Json;
147
+ };
156
148
  };
157
149
  };
158
150
  readonly tool_names?: readonly string[];
151
+ readonly permissions?: readonly string[];
159
152
  readonly workspace_policy?: {
160
- readonly mode: "share" | "fork";
153
+ readonly mode: "fork" | "share";
161
154
  readonly fallback?: "fail" | "fresh";
162
155
  };
163
156
  readonly output_schema_ref?: string;
157
+ readonly metadata?: {
158
+ readonly [x: string]: Schema.Json;
159
+ };
164
160
  };
165
161
  };
166
162
  readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
167
163
  readonly name: Schema.String;
168
164
  readonly preset_name: Schema.String;
169
165
  }, "Encoded">[];
166
+ readonly output_schema_ref?: string;
167
+ readonly metadata?: {
168
+ readonly [x: string]: Schema.Json;
169
+ };
170
170
  }, never, never>>;
171
171
  readonly agent_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
172
172
  readonly wait_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.WaitId"> & {
@@ -1107,9 +1107,9 @@ export declare const SpawnChildRunInput: Schema.Struct<{
1107
1107
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1108
1108
  }>>;
1109
1109
  readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1110
- readonly context_window: Schema.Number;
1111
- readonly reserve_tokens: Schema.Number;
1112
- readonly keep_recent_tokens: Schema.Number;
1110
+ readonly context_window: Schema.Finite;
1111
+ readonly reserve_tokens: Schema.Finite;
1112
+ readonly keep_recent_tokens: Schema.Finite;
1113
1113
  readonly summary_model: Schema.optionalKey<Schema.Struct<{
1114
1114
  readonly provider: Schema.String;
1115
1115
  readonly model: Schema.String;
@@ -1203,9 +1203,9 @@ export declare const CreateChildFanOutInput: Schema.Struct<{
1203
1203
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1204
1204
  }>>;
1205
1205
  readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1206
- readonly context_window: Schema.Number;
1207
- readonly reserve_tokens: Schema.Number;
1208
- readonly keep_recent_tokens: Schema.Number;
1206
+ readonly context_window: Schema.Finite;
1207
+ readonly reserve_tokens: Schema.Finite;
1208
+ readonly keep_recent_tokens: Schema.Finite;
1209
1209
  readonly summary_model: Schema.optionalKey<Schema.Struct<{
1210
1210
  readonly provider: Schema.String;
1211
1211
  readonly model: Schema.String;
@@ -1294,68 +1294,6 @@ export interface CancelChildFanOutInput extends Schema.Schema.Type<typeof Cancel
1294
1294
  }
1295
1295
  export declare const CancelChildFanOutResult: Schema.Struct<{
1296
1296
  readonly fan_out: Schema.Struct<{
1297
- readonly state: Schema.Literals<readonly ["joining", "satisfied", "failed", "cancelled"]>;
1298
- readonly members: Schema.$Array<Schema.Struct<{
1299
- readonly child_execution_id: Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
1300
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
1301
- };
1302
- readonly ordinal: Schema.Int;
1303
- readonly state: Schema.Literals<readonly ["queued", "running", "completed", "failed", "cancelled"]>;
1304
- readonly output: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1305
- readonly type: Schema.Literal<"text">;
1306
- readonly text: Schema.String;
1307
- readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1308
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1309
- }>, Schema.Struct<{
1310
- readonly type: Schema.Literal<"structured">;
1311
- readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1312
- readonly schema_ref: Schema.optionalKey<Schema.String>;
1313
- readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1314
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1315
- }>, Schema.Struct<{
1316
- readonly type: Schema.Literal<"blob-reference">;
1317
- readonly uri: Schema.String;
1318
- readonly media_type: Schema.String;
1319
- readonly filename: Schema.optionalKey<Schema.String>;
1320
- readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1321
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1322
- }>, Schema.Struct<{
1323
- readonly type: Schema.Literal<"artifact-reference">;
1324
- readonly artifact_id: Schema.String;
1325
- readonly media_type: Schema.optionalKey<Schema.String>;
1326
- readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1327
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1328
- }>, Schema.Struct<{
1329
- readonly type: Schema.Literal<"tool-call">;
1330
- readonly call: Schema.Struct<{
1331
- readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
1332
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
1333
- };
1334
- readonly name: Schema.String;
1335
- readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1336
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1337
- }>;
1338
- readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1339
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1340
- }>, Schema.Struct<{
1341
- readonly type: Schema.Literal<"tool-result">;
1342
- readonly result: Schema.Struct<{
1343
- readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
1344
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
1345
- };
1346
- readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1347
- readonly error: Schema.optionalKey<Schema.String>;
1348
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1349
- }>;
1350
- readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1351
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1352
- }>]>>>;
1353
- readonly error: Schema.optionalKey<Schema.String>;
1354
- readonly completed_at: Schema.optionalKey<Schema.Int>;
1355
- }>>;
1356
- readonly satisfied_at: Schema.optionalKey<Schema.Int>;
1357
- readonly failed_at: Schema.optionalKey<Schema.Int>;
1358
- readonly cancelled_at: Schema.optionalKey<Schema.Int>;
1359
1297
  readonly fan_out_id: Schema.brand<Schema.String, "Relay.ChildFanOutId"> & {
1360
1298
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildFanOutId">;
1361
1299
  };
@@ -1379,9 +1317,9 @@ export declare const CancelChildFanOutResult: Schema.Struct<{
1379
1317
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1380
1318
  }>>;
1381
1319
  readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1382
- readonly context_window: Schema.Number;
1383
- readonly reserve_tokens: Schema.Number;
1384
- readonly keep_recent_tokens: Schema.Number;
1320
+ readonly context_window: Schema.Finite;
1321
+ readonly reserve_tokens: Schema.Finite;
1322
+ readonly keep_recent_tokens: Schema.Finite;
1385
1323
  readonly summary_model: Schema.optionalKey<Schema.Struct<{
1386
1324
  readonly provider: Schema.String;
1387
1325
  readonly model: Schema.String;
@@ -1456,19 +1394,6 @@ export declare const CancelChildFanOutResult: Schema.Struct<{
1456
1394
  }>, Schema.TaggedStruct<"best-effort", {}>]>;
1457
1395
  readonly created_at: Schema.Int;
1458
1396
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1459
- }>;
1460
- }>;
1461
- export interface CancelChildFanOutResult extends Schema.Schema.Type<typeof CancelChildFanOutResult> {
1462
- }
1463
- export declare const InspectChildFanOutInput: Schema.Struct<{
1464
- readonly fan_out_id: Schema.brand<Schema.String, "Relay.ChildFanOutId"> & {
1465
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildFanOutId">;
1466
- };
1467
- }>;
1468
- export interface InspectChildFanOutInput extends Schema.Schema.Type<typeof InspectChildFanOutInput> {
1469
- }
1470
- export declare const InspectChildFanOutResult: Schema.Struct<{
1471
- readonly fan_out: Schema.NullOr<Schema.Struct<{
1472
1397
  readonly state: Schema.Literals<readonly ["joining", "satisfied", "failed", "cancelled"]>;
1473
1398
  readonly members: Schema.$Array<Schema.Struct<{
1474
1399
  readonly child_execution_id: Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
@@ -1531,6 +1456,19 @@ export declare const InspectChildFanOutResult: Schema.Struct<{
1531
1456
  readonly satisfied_at: Schema.optionalKey<Schema.Int>;
1532
1457
  readonly failed_at: Schema.optionalKey<Schema.Int>;
1533
1458
  readonly cancelled_at: Schema.optionalKey<Schema.Int>;
1459
+ }>;
1460
+ }>;
1461
+ export interface CancelChildFanOutResult extends Schema.Schema.Type<typeof CancelChildFanOutResult> {
1462
+ }
1463
+ export declare const InspectChildFanOutInput: Schema.Struct<{
1464
+ readonly fan_out_id: Schema.brand<Schema.String, "Relay.ChildFanOutId"> & {
1465
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildFanOutId">;
1466
+ };
1467
+ }>;
1468
+ export interface InspectChildFanOutInput extends Schema.Schema.Type<typeof InspectChildFanOutInput> {
1469
+ }
1470
+ export declare const InspectChildFanOutResult: Schema.Struct<{
1471
+ readonly fan_out: Schema.NullOr<Schema.Struct<{
1534
1472
  readonly fan_out_id: Schema.brand<Schema.String, "Relay.ChildFanOutId"> & {
1535
1473
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildFanOutId">;
1536
1474
  };
@@ -1554,9 +1492,9 @@ export declare const InspectChildFanOutResult: Schema.Struct<{
1554
1492
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1555
1493
  }>>;
1556
1494
  readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
1557
- readonly context_window: Schema.Number;
1558
- readonly reserve_tokens: Schema.Number;
1559
- readonly keep_recent_tokens: Schema.Number;
1495
+ readonly context_window: Schema.Finite;
1496
+ readonly reserve_tokens: Schema.Finite;
1497
+ readonly keep_recent_tokens: Schema.Finite;
1560
1498
  readonly summary_model: Schema.optionalKey<Schema.Struct<{
1561
1499
  readonly provider: Schema.String;
1562
1500
  readonly model: Schema.String;
@@ -1631,6 +1569,68 @@ export declare const InspectChildFanOutResult: Schema.Struct<{
1631
1569
  }>, Schema.TaggedStruct<"best-effort", {}>]>;
1632
1570
  readonly created_at: Schema.Int;
1633
1571
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1572
+ readonly state: Schema.Literals<readonly ["joining", "satisfied", "failed", "cancelled"]>;
1573
+ readonly members: Schema.$Array<Schema.Struct<{
1574
+ readonly child_execution_id: Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
1575
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
1576
+ };
1577
+ readonly ordinal: Schema.Int;
1578
+ readonly state: Schema.Literals<readonly ["queued", "running", "completed", "failed", "cancelled"]>;
1579
+ readonly output: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
1580
+ readonly type: Schema.Literal<"text">;
1581
+ readonly text: Schema.String;
1582
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1583
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1584
+ }>, Schema.Struct<{
1585
+ readonly type: Schema.Literal<"structured">;
1586
+ readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1587
+ readonly schema_ref: Schema.optionalKey<Schema.String>;
1588
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1589
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1590
+ }>, Schema.Struct<{
1591
+ readonly type: Schema.Literal<"blob-reference">;
1592
+ readonly uri: Schema.String;
1593
+ readonly media_type: Schema.String;
1594
+ readonly filename: Schema.optionalKey<Schema.String>;
1595
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1596
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1597
+ }>, Schema.Struct<{
1598
+ readonly type: Schema.Literal<"artifact-reference">;
1599
+ readonly artifact_id: Schema.String;
1600
+ readonly media_type: Schema.optionalKey<Schema.String>;
1601
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1602
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1603
+ }>, Schema.Struct<{
1604
+ readonly type: Schema.Literal<"tool-call">;
1605
+ readonly call: Schema.Struct<{
1606
+ readonly id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
1607
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
1608
+ };
1609
+ readonly name: Schema.String;
1610
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1611
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1612
+ }>;
1613
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1614
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1615
+ }>, Schema.Struct<{
1616
+ readonly type: Schema.Literal<"tool-result">;
1617
+ readonly result: Schema.Struct<{
1618
+ readonly call_id: Schema.brand<Schema.String, "Relay.ToolCallId"> & {
1619
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ToolCallId">;
1620
+ };
1621
+ readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
1622
+ readonly error: Schema.optionalKey<Schema.String>;
1623
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1624
+ }>;
1625
+ readonly provider_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1626
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
1627
+ }>]>>>;
1628
+ readonly error: Schema.optionalKey<Schema.String>;
1629
+ readonly completed_at: Schema.optionalKey<Schema.Int>;
1630
+ }>>;
1631
+ readonly satisfied_at: Schema.optionalKey<Schema.Int>;
1632
+ readonly failed_at: Schema.optionalKey<Schema.Int>;
1633
+ readonly cancelled_at: Schema.optionalKey<Schema.Int>;
1634
1634
  }>>;
1635
1635
  }>;
1636
1636
  export interface InspectChildFanOutResult extends Schema.Schema.Type<typeof InspectChildFanOutResult> {
@@ -1,6 +1,6 @@
1
- import { Effect, type Layer } from "effect";
1
+ import { Effect, Layer } from "effect";
2
2
  import { SqlClient } from "effect/unstable/sql/SqlClient";
3
- import type { DatabaseIdentity, DatabaseLayer, RuntimeConfigurationError, RuntimeMigrationError } from "./runtime";
3
+ import { RuntimeMigrationError, type DatabaseIdentity, type DatabaseLayer, type RuntimeConfigurationError } from "./runtime";
4
4
  export interface PostgresRuntimeDatabaseOptions<E, R> {
5
5
  readonly clientLayer: Layer.Layer<SqlClient, E, R>;
6
6
  readonly databaseIdentity: DatabaseIdentity;
@@ -9,11 +9,17 @@ export declare class RuntimeCapabilityUnavailable extends RuntimeCapabilityUnava
9
9
  export interface Interface {
10
10
  readonly admit: (capability: "fan-out" | "workflow-definition") => Effect.Effect<void, RuntimeCapabilityUnavailable>;
11
11
  }
12
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/RuntimeCapabilityPolicy", Interface>;
12
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/runtime-capability-policy/Service", Interface>;
13
13
  export declare class Service extends Service_base {
14
14
  }
15
- export declare const layer: (role: "embedded" | "runner" | "client", capabilities: {
16
- readonly fanOut: boolean;
17
- readonly workflowDefinition: boolean;
18
- }) => Layer.Layer<Service, never, never>;
15
+ export declare const layer: {
16
+ (capabilities: {
17
+ readonly fanOut: boolean;
18
+ readonly workflowDefinition: boolean;
19
+ }): (role: "embedded" | "runner" | "client") => Layer.Layer<Service>;
20
+ (role: "embedded" | "runner" | "client", capabilities: {
21
+ readonly fanOut: boolean;
22
+ readonly workflowDefinition: boolean;
23
+ }): Layer.Layer<Service>;
24
+ };
19
25
  export {};
@@ -16,6 +16,6 @@ export type Interface = {
16
16
  readonly notification: "pg-listen-notify" | "polling";
17
17
  readonly verifySchema: Effect.Effect<void, RuntimeMigrationError>;
18
18
  };
19
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/RuntimeDatabase", Interface>;
19
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/runtime-database/Service", Interface>;
20
20
  export declare class Service extends Service_base {
21
21
  }
@@ -9,7 +9,7 @@ export { RuntimeCapabilityUnavailable } from "./runtime-capability-policy";
9
9
  export * as RuntimeDatabase from "./runtime-database";
10
10
  export declare const DatabaseIdentity: Schema.brand<Schema.NonEmptyString, "@relayfx/sdk/DatabaseIdentity">;
11
11
  export type DatabaseIdentity = typeof DatabaseIdentity.Type;
12
- export declare const makeDatabaseIdentity: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"@relayfx/sdk/DatabaseIdentity">;
12
+ export declare const makeDatabaseIdentity: (input: unknown) => DatabaseIdentity;
13
13
  export declare const Dialect: Schema.Literals<readonly ["pg", "mysql", "sqlite"]>;
14
14
  export type Dialect = typeof Dialect.Type;
15
15
  export declare const DatabaseDialect: unique symbol;
@@ -144,7 +144,7 @@ export interface ReadinessStatus {
144
144
  export interface Interface {
145
145
  readonly readiness: Effect.Effect<ReadinessStatus, RuntimeReadinessError>;
146
146
  }
147
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/Runtime", Interface>;
147
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/sdk/runtime/Service", Interface>;
148
148
  export declare class Service extends Service_base {
149
149
  }
150
150
  export interface ClusterHttpOptions {
@@ -189,9 +189,9 @@ export interface ClientOptions<DBE, DBR> {
189
189
  export type EmbeddedOutput = Service | ClientService;
190
190
  export type RunnerOutput = Service | ClientService;
191
191
  export type ClientOutput = Service | ClientService;
192
- export declare const layerEmbedded: <D extends Dialect, DBE, DBR, HostE, HostR, ChildE = never, ChildR = never, WorkflowE = never, WorkflowR = never, ToolE = never, ToolR = never>(options: EmbeddedHostOptions<HostE, HostR, ChildE, ChildR, WorkflowE, WorkflowR, ToolE, ToolR> & {
192
+ export declare function layerEmbedded<D extends Dialect, DBE, DBR, HostE, HostR, ChildE = never, ChildR = never, WorkflowE = never, WorkflowR = never, ToolE = never, ToolR = never>(options: EmbeddedHostOptions<HostE, HostR, ChildE, ChildR, WorkflowE, WorkflowR, ToolE, ToolR> & {
193
193
  readonly databaseLayer: DatabaseLayer<D, DBE, DBR>;
194
- }) => Layer.Layer<EmbeddedOutput, AcquisitionError, DBR | HostR | ToolR | Exclude<ChildR, RunnerRuntime.Service | ClientRuntimeRequirements> | Exclude<WorkflowR, RunnerRuntime.Service | ChildFanOutRuntime.Service | ClientRuntimeRequirements>>;
194
+ }): Layer.Layer<EmbeddedOutput, AcquisitionError, DBR | HostR | ToolR | Exclude<ChildR, RunnerRuntime.Service | ClientRuntimeRequirements> | Exclude<WorkflowR, RunnerRuntime.Service | ChildFanOutRuntime.Service | ClientRuntimeRequirements>>;
195
195
  export declare const layerRunner: <DBE, DBR, HostE, HostR, ToolE, ToolR>(options: Omit<RunnerOptions<DBE, DBR, HostE, HostR>, "toolRuntimeLayer"> & {
196
196
  readonly toolRuntimeLayer: Layer.Layer<ToolRuntime.Service, ToolE, ToolR>;
197
197
  }) => Layer.Layer<RunnerOutput, AcquisitionError, DBR | HostR | ToolR | HttpServer>;
@@ -51,4 +51,4 @@ export declare const migrations: readonly [{
51
51
  readonly file: "0010_workflow_runtime.sql";
52
52
  readonly source: string;
53
53
  }];
54
- export declare const loader: Effect.Effect<(readonly [1 | 2 | 6 | 3 | 4 | 7 | 5 | 8 | 9 | 10, "baseline" | "durable_tool_placement" | "durable_inbox" | "execution_state" | "durable_entities" | "ephemeral_presence" | "topic_subscriptions" | "child_fan_out" | "workflow_definitions" | "workflow_runtime", Effect.Effect<Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>, never, never>])[], never, never>;
54
+ export declare const loader: Effect.Effect<(readonly [1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, "baseline" | "child_fan_out" | "durable_entities" | "durable_inbox" | "durable_tool_placement" | "ephemeral_presence" | "execution_state" | "topic_subscriptions" | "workflow_definitions" | "workflow_runtime", Effect.Effect<Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>, never, never>])[], never, never>;
@@ -1,6 +1,5 @@
1
1
  import { type SqliteClientConfig } from "@effect/sql-sqlite-bun/SqliteClient";
2
2
  import { ChildFanOutRuntime, WorkflowDefinitionRuntime } from "../runtime/index";
3
- import { WorkflowDefinitionRepository } from "../store-sql/portable";
4
3
  import { Layer } from "effect";
5
4
  import { SqlClient } from "effect/unstable/sql/SqlClient";
6
5
  import { RuntimeConfigurationError, RuntimeMigrationError, RuntimeTopologyError, type DatabaseLayer } from "./runtime";
@@ -13,7 +12,13 @@ export interface SQLiteRuntimeDatabaseOptions {
13
12
  readonly transformQueryNames?: (name: string) => string;
14
13
  }
15
14
  export declare const runtimeDatabaseLayer: (options: SQLiteRuntimeDatabaseOptions) => DatabaseLayer<"sqlite", RuntimeConfigurationError | RuntimeTopologyError | RuntimeMigrationError>;
16
- export declare const migrationsLayer: Layer.Layer<never, import("effect/unstable/sql/SqlError").SqlError | import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError, SqlClient>;
17
- export declare const layer: (options: SqliteClientConfig) => Layer.Layer<SqlClient, import("effect/unstable/sql/SqlError").SqlError | import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError, never>;
18
- export declare const workflowLayer: <E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, E, R>) => Layer.Layer<SqlClient | WorkflowDefinitionRepository.Service | WorkflowDefinitionRuntime.HandlerService | WorkflowDefinitionRuntime.Service, unknown, Exclude<R, SqlClient | WorkflowDefinitionRepository.Service>>;
19
- export declare const childFanOutLayer: <E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<ChildFanOutRuntime.HandlerService, E, R>) => Layer.Layer<ChildFanOutRuntime.Service, unknown, R>;
15
+ export declare const migrationsLayer: Layer.Layer<never, import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, SqlClient>;
16
+ export declare const layer: (options: SqliteClientConfig) => Layer.Layer<SqlClient, import("@effect/sql-sqlite-bun/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
17
+ export declare const workflowLayer: {
18
+ <E, R>(handlersLayer: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, E, R>): (options: SqliteClientConfig) => ReturnType<typeof workflowLayer<E, R>>;
19
+ <E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<WorkflowDefinitionRuntime.HandlerService, E, R>): Layer.Layer<WorkflowDefinitionRuntime.Service, unknown, R>;
20
+ };
21
+ export declare const childFanOutLayer: {
22
+ <E, R>(handlersLayer: Layer.Layer<ChildFanOutRuntime.HandlerService, E, R>): (options: SqliteClientConfig) => Layer.Layer<ChildFanOutRuntime.Service, unknown, R>;
23
+ <E, R>(options: SqliteClientConfig, handlersLayer: Layer.Layer<ChildFanOutRuntime.HandlerService, E, R>): Layer.Layer<ChildFanOutRuntime.Service, unknown, R>;
24
+ };
@@ -1,19 +1,20 @@
1
1
  import { Shared, Tool } from "../schema/index";
2
2
  import { Duration, Effect } from "effect";
3
+ import { Service as ClientService } from "./client";
3
4
  import type { ClientError } from "./client";
4
5
  import type { ToolWorkLease } from "./operation";
5
6
  export interface HandlerContext {
6
7
  readonly lease: ToolWorkLease;
7
8
  readonly idempotencyKey: string;
8
9
  }
9
- export type Handler = (input: Shared.JsonValue, context: HandlerContext) => Effect.Effect<Shared.JsonValue, unknown, any>;
10
- export interface Options {
10
+ export type Handler<E = Error, R = never> = (input: Shared.JsonValue, context: HandlerContext) => Effect.Effect<Shared.JsonValue, E, R>;
11
+ export interface Options<E = Error, R = never> {
11
12
  readonly queue: Tool.PlacementKey;
12
13
  readonly workerId: Tool.WorkerId;
13
14
  readonly leaseDuration: Duration.Input;
14
15
  readonly pollInterval?: Duration.Input | undefined;
15
- readonly handlers: Readonly<Record<string, Handler>>;
16
+ readonly handlers: Readonly<Record<string, Handler<E, R>>>;
16
17
  }
17
- export declare const runOnce: (options: Options) => Effect.Effect<boolean, ClientError, any>;
18
- export declare const run: (options: Options) => Effect.Effect<never, ClientError, any>;
18
+ export declare const runOnce: <E, R>(options: Options<E, R>) => Effect.Effect<boolean, ClientError, R | ClientService>;
19
+ export declare const run: <E, R>(options: Options<E, R>) => Effect.Effect<never, ClientError, R | ClientService>;
19
20
  export type Error = ClientError;
@@ -59,15 +59,15 @@ export interface Interface {
59
59
  readonly resolve: (addressId: Ids.AddressId) => Effect.Effect<Route, AddressNotFound | AddressUnavailable | AddressDeferred | AddressBookServiceError>;
60
60
  readonly register: (addressId: Ids.AddressId, route: Route) => Effect.Effect<Address.RouteRegistered, AddressBookServiceError>;
61
61
  readonly get: (addressId: Ids.AddressId) => Effect.Effect<RouteRecord | undefined, AddressBookServiceError>;
62
- readonly list: () => Effect.Effect<Address.RouteList, AddressBookServiceError>;
62
+ readonly list: Effect.Effect<Address.RouteList, AddressBookServiceError>;
63
63
  }
64
- declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/AddressBook", Interface>;
64
+ declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/address/address-book-service/Service", Interface>;
65
65
  export declare class Service extends Service_base {
66
66
  }
67
67
  export declare const layerFromRepository: Layer.Layer<Service, never, AddressBookRepository.Service>;
68
68
  export declare const memoryLayer: (entries?: Iterable<readonly [Ids.AddressId, Route]>) => Layer.Layer<Service, never, never>;
69
69
  export declare const testLayer: (implementation: Interface) => Layer.Layer<Service, never, never>;
70
- export declare const resolve: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<Route, AddressNotFound | AddressUnavailable | AddressDeferred | AddressBookServiceError, Service>;
70
+ export declare const resolve: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<Route, AddressBookServiceError | AddressDeferred | AddressNotFound | AddressUnavailable, Service>;
71
71
  export declare const register: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">, route: Route) => Effect.Effect<Address.RouteRegistered, AddressBookServiceError, Service>;
72
72
  export declare const get: (addressId: string & import("effect/Brand").Brand<"Relay.AddressId">) => Effect.Effect<RouteRecord | undefined, AddressBookServiceError, Service>;
73
73
  export declare const list: () => Effect.Effect<Address.RouteList, AddressBookServiceError, Service>;