@relayfx/sdk 0.0.48 → 0.0.49

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 (34) hide show
  1. package/dist/ai.js +2050 -576
  2. package/dist/index.js +2879 -859
  3. package/dist/migrations/20260709214238_faithful_black_widow/migration.sql +53 -0
  4. package/dist/migrations/20260709214238_faithful_black_widow/snapshot.json +5426 -0
  5. package/dist/migrations/20260709220016_fearless_aaron_stack/migration.sql +2 -0
  6. package/dist/migrations/20260709220016_fearless_aaron_stack/snapshot.json +5426 -0
  7. package/dist/migrations/mysql/0002_durable_tool_placement.sql +75 -0
  8. package/dist/migrations/pg/20260709214238_faithful_black_widow/migration.sql +53 -0
  9. package/dist/migrations/pg/20260709214238_faithful_black_widow/snapshot.json +5426 -0
  10. package/dist/migrations/pg/20260709220016_fearless_aaron_stack/migration.sql +2 -0
  11. package/dist/migrations/pg/20260709220016_fearless_aaron_stack/snapshot.json +5426 -0
  12. package/dist/migrations/sqlite/0002_durable_tool_placement.sql +71 -0
  13. package/dist/types/relay/client.d.ts +27 -6
  14. package/dist/types/relay/index.d.ts +1 -0
  15. package/dist/types/relay/operation.d.ts +525 -53
  16. package/dist/types/relay/tool-worker.d.ts +19 -0
  17. package/dist/types/runtime/address/address-resolution-service.d.ts +69 -54
  18. package/dist/types/runtime/agent/relay-compaction.d.ts +1 -0
  19. package/dist/types/runtime/cluster/execution-entity.d.ts +10 -477
  20. package/dist/types/runtime/execution/event-log-service.d.ts +6 -0
  21. package/dist/types/runtime/index.d.ts +1 -0
  22. package/dist/types/runtime/runner/runner-runtime-service.d.ts +18 -15
  23. package/dist/types/runtime/tool/tool-runtime-service.d.ts +17 -1
  24. package/dist/types/runtime/tool/tool-transition-coordinator.d.ts +13 -0
  25. package/dist/types/runtime/workflow/execution-workflow.d.ts +146 -114
  26. package/dist/types/schema/agent-schema.d.ts +431 -320
  27. package/dist/types/schema/execution-schema.d.ts +69 -53
  28. package/dist/types/schema/ids-schema.d.ts +4 -0
  29. package/dist/types/schema/tool-schema.d.ts +29 -0
  30. package/dist/types/store-sql/envelope/envelope-repository.d.ts +6 -0
  31. package/dist/types/store-sql/execution/execution-event-repository.d.ts +6 -0
  32. package/dist/types/store-sql/schema/relay-schema.d.ts +386 -7
  33. package/dist/types/store-sql/tool/tool-call-repository.d.ts +160 -1
  34. package/package.json +3 -3
@@ -67,9 +67,26 @@ export interface PermissionRuleset extends Schema.Schema.Type<typeof PermissionR
67
67
  export declare const ToolInputSchemaDigests: Schema.$Record<Schema.String, Schema.String>;
68
68
  export interface ToolInputSchemaDigests extends Schema.Schema.Type<typeof ToolInputSchemaDigests> {
69
69
  }
70
+ export interface RecursTurnPolicySnapshot {
71
+ readonly kind: "recurs";
72
+ readonly count: number;
73
+ }
74
+ export interface UntilToolCallTurnPolicySnapshot {
75
+ readonly kind: "until-tool-call";
76
+ readonly name: string;
77
+ }
78
+ export interface BothTurnPolicySnapshot {
79
+ readonly kind: "both";
80
+ readonly first: TurnPolicySnapshot;
81
+ readonly second: TurnPolicySnapshot;
82
+ }
83
+ export type TurnPolicySnapshot = RecursTurnPolicySnapshot | UntilToolCallTurnPolicySnapshot | BothTurnPolicySnapshot;
84
+ export declare const maxTurnPolicySnapshotDepth = 16;
85
+ export declare const maxTurnPolicySnapshotNodes = 64;
86
+ export declare const TurnPolicySnapshot: Schema.Codec<TurnPolicySnapshot>;
70
87
  export declare const defaultMaxToolTurns = 8;
71
88
  export declare const defaultMaxWaitTurns = 8;
72
- export declare const Definition: Schema.Struct<{
89
+ declare const DefinitionSchema: Schema.Struct<{
73
90
  readonly name: Schema.String;
74
91
  readonly instructions: Schema.optionalKey<Schema.String>;
75
92
  readonly model: Schema.Struct<{
@@ -96,6 +113,7 @@ export declare const Definition: Schema.Struct<{
96
113
  }>>;
97
114
  readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
98
115
  }>>;
116
+ readonly turn_policy: Schema.optionalKey<Schema.Codec<TurnPolicySnapshot, TurnPolicySnapshot, never, never>>;
99
117
  readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
100
118
  readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
101
119
  readonly token_budget: Schema.optionalKey<Schema.Int>;
@@ -124,8 +142,9 @@ export declare const Definition: Schema.Struct<{
124
142
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
125
143
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
126
144
  }>;
127
- export interface Definition extends Schema.Schema.Type<typeof Definition> {
145
+ export interface Definition extends Schema.Schema.Type<typeof DefinitionSchema> {
128
146
  }
147
+ export declare const Definition: Schema.Codec<Definition, Schema.Codec.Encoded<typeof DefinitionSchema>>;
129
148
  export type ToolRef = {
130
149
  readonly name: string;
131
150
  } | ({
@@ -140,6 +159,7 @@ export interface DefineInput {
140
159
  readonly permissions: ReadonlyArray<Permission>;
141
160
  readonly skill_definition_ids?: ReadonlyArray<SkillDefinitionId>;
142
161
  readonly permission_rules?: PermissionRuleset;
162
+ readonly turn_policy?: TurnPolicySnapshot;
143
163
  readonly max_tool_turns?: number;
144
164
  readonly max_wait_turns?: number;
145
165
  readonly token_budget?: number;
@@ -154,61 +174,76 @@ export declare const DefinitionRecord: Schema.Struct<{
154
174
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
155
175
  };
156
176
  readonly current_revision: Schema.Int;
157
- readonly definition: Schema.Struct<{
158
- readonly name: Schema.String;
159
- readonly instructions: Schema.optionalKey<Schema.String>;
160
- readonly model: Schema.Struct<{
161
- readonly provider: Schema.String;
162
- readonly model: Schema.String;
163
- readonly registration_key: Schema.optionalKey<Schema.String>;
164
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
165
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
166
- }>;
167
- readonly tool_names: Schema.$Array<Schema.String>;
168
- readonly permissions: Schema.$Array<Schema.Struct<{
169
- readonly name: Schema.String;
170
- readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
171
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
172
- }>>;
173
- readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
174
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
175
- }>>;
176
- readonly permission_rules: Schema.optionalKey<Schema.Struct<{
177
- readonly rules: Schema.$Array<Schema.Struct<{
178
- readonly pattern: Schema.String;
179
- readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
180
- readonly reason: Schema.optionalKey<Schema.String>;
181
- }>>;
182
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
183
- }>>;
184
- readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
185
- readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
186
- readonly token_budget: Schema.optionalKey<Schema.Int>;
187
- readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
188
- readonly instructions: Schema.optionalKey<Schema.String>;
189
- readonly model: Schema.optionalKey<Schema.Struct<{
190
- readonly provider: Schema.String;
191
- readonly model: Schema.String;
192
- readonly registration_key: Schema.optionalKey<Schema.String>;
193
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
194
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
195
- }>>;
196
- readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
197
- readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
198
- readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
199
- readonly mode: Schema.Literals<readonly ["share", "fork"]>;
200
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
201
- }>>;
202
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
203
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
204
- }>>>;
205
- readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
177
+ readonly definition: Schema.Codec<Definition, {
178
+ readonly name: string;
179
+ readonly permissions: readonly {
180
+ readonly name: string;
181
+ readonly value: Schema.Json;
182
+ readonly metadata?: {
183
+ readonly [x: string]: Schema.Json;
184
+ };
185
+ }[];
186
+ readonly model: {
187
+ readonly provider: string;
188
+ readonly model: string;
189
+ readonly metadata?: {
190
+ readonly [x: string]: Schema.Json;
191
+ };
192
+ readonly registration_key?: string;
193
+ readonly request_options?: {
194
+ readonly [x: string]: Schema.Json;
195
+ };
196
+ };
197
+ readonly tool_names: readonly string[];
198
+ readonly metadata?: {
199
+ readonly [x: string]: Schema.Json;
200
+ };
201
+ readonly instructions?: string;
202
+ readonly output_schema_ref?: string;
203
+ readonly skill_definition_ids?: readonly string[];
204
+ readonly permission_rules?: {
205
+ readonly rules: readonly {
206
+ readonly pattern: string;
207
+ readonly level: "allow" | "deny" | "ask";
208
+ readonly reason?: string;
209
+ }[];
210
+ readonly fallback?: "allow" | "deny" | "ask";
211
+ };
212
+ readonly turn_policy?: TurnPolicySnapshot;
213
+ readonly max_tool_turns?: number;
214
+ readonly max_wait_turns?: number;
215
+ readonly token_budget?: number;
216
+ readonly child_run_presets?: {
217
+ readonly [x: string]: {
218
+ readonly metadata?: {
219
+ readonly [x: string]: Schema.Json;
220
+ };
221
+ readonly permissions?: readonly string[];
222
+ readonly model?: {
223
+ readonly provider: string;
224
+ readonly model: string;
225
+ readonly metadata?: {
226
+ readonly [x: string]: Schema.Json;
227
+ };
228
+ readonly registration_key?: string;
229
+ readonly request_options?: {
230
+ readonly [x: string]: Schema.Json;
231
+ };
232
+ };
233
+ readonly instructions?: string;
234
+ readonly tool_names?: readonly string[];
235
+ readonly workspace_policy?: {
236
+ readonly mode: "share" | "fork";
237
+ readonly fallback?: "fail" | "fresh";
238
+ };
239
+ readonly output_schema_ref?: string;
240
+ };
241
+ };
242
+ readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
206
243
  readonly name: Schema.String;
207
244
  readonly preset_name: Schema.String;
208
- }>>>;
209
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
210
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
211
- }>;
245
+ }, "Encoded">[];
246
+ }, never, never>;
212
247
  readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
213
248
  readonly created_at: Schema.Int;
214
249
  readonly updated_at: Schema.Int;
@@ -220,61 +255,76 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
220
255
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
221
256
  };
222
257
  readonly revision: Schema.Int;
223
- readonly definition: Schema.Struct<{
224
- readonly name: Schema.String;
225
- readonly instructions: Schema.optionalKey<Schema.String>;
226
- readonly model: Schema.Struct<{
227
- readonly provider: Schema.String;
228
- readonly model: Schema.String;
229
- readonly registration_key: Schema.optionalKey<Schema.String>;
230
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
231
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
232
- }>;
233
- readonly tool_names: Schema.$Array<Schema.String>;
234
- readonly permissions: Schema.$Array<Schema.Struct<{
235
- readonly name: Schema.String;
236
- readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
237
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
238
- }>>;
239
- readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
240
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
241
- }>>;
242
- readonly permission_rules: Schema.optionalKey<Schema.Struct<{
243
- readonly rules: Schema.$Array<Schema.Struct<{
244
- readonly pattern: Schema.String;
245
- readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
246
- readonly reason: Schema.optionalKey<Schema.String>;
247
- }>>;
248
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
249
- }>>;
250
- readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
251
- readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
252
- readonly token_budget: Schema.optionalKey<Schema.Int>;
253
- readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
254
- readonly instructions: Schema.optionalKey<Schema.String>;
255
- readonly model: Schema.optionalKey<Schema.Struct<{
256
- readonly provider: Schema.String;
257
- readonly model: Schema.String;
258
- readonly registration_key: Schema.optionalKey<Schema.String>;
259
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
260
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
261
- }>>;
262
- readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
263
- readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
264
- readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
265
- readonly mode: Schema.Literals<readonly ["share", "fork"]>;
266
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
267
- }>>;
268
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
269
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
270
- }>>>;
271
- readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
258
+ readonly definition: Schema.Codec<Definition, {
259
+ readonly name: string;
260
+ readonly permissions: readonly {
261
+ readonly name: string;
262
+ readonly value: Schema.Json;
263
+ readonly metadata?: {
264
+ readonly [x: string]: Schema.Json;
265
+ };
266
+ }[];
267
+ readonly model: {
268
+ readonly provider: string;
269
+ readonly model: string;
270
+ readonly metadata?: {
271
+ readonly [x: string]: Schema.Json;
272
+ };
273
+ readonly registration_key?: string;
274
+ readonly request_options?: {
275
+ readonly [x: string]: Schema.Json;
276
+ };
277
+ };
278
+ readonly tool_names: readonly string[];
279
+ readonly metadata?: {
280
+ readonly [x: string]: Schema.Json;
281
+ };
282
+ readonly instructions?: string;
283
+ readonly output_schema_ref?: string;
284
+ readonly skill_definition_ids?: readonly string[];
285
+ readonly permission_rules?: {
286
+ readonly rules: readonly {
287
+ readonly pattern: string;
288
+ readonly level: "allow" | "deny" | "ask";
289
+ readonly reason?: string;
290
+ }[];
291
+ readonly fallback?: "allow" | "deny" | "ask";
292
+ };
293
+ readonly turn_policy?: TurnPolicySnapshot;
294
+ readonly max_tool_turns?: number;
295
+ readonly max_wait_turns?: number;
296
+ readonly token_budget?: number;
297
+ readonly child_run_presets?: {
298
+ readonly [x: string]: {
299
+ readonly metadata?: {
300
+ readonly [x: string]: Schema.Json;
301
+ };
302
+ readonly permissions?: readonly string[];
303
+ readonly model?: {
304
+ readonly provider: string;
305
+ readonly model: string;
306
+ readonly metadata?: {
307
+ readonly [x: string]: Schema.Json;
308
+ };
309
+ readonly registration_key?: string;
310
+ readonly request_options?: {
311
+ readonly [x: string]: Schema.Json;
312
+ };
313
+ };
314
+ readonly instructions?: string;
315
+ readonly tool_names?: readonly string[];
316
+ readonly workspace_policy?: {
317
+ readonly mode: "share" | "fork";
318
+ readonly fallback?: "fail" | "fresh";
319
+ };
320
+ readonly output_schema_ref?: string;
321
+ };
322
+ };
323
+ readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
272
324
  readonly name: Schema.String;
273
325
  readonly preset_name: Schema.String;
274
- }>>>;
275
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
276
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
277
- }>;
326
+ }, "Encoded">[];
327
+ }, never, never>;
278
328
  readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
279
329
  readonly created_at: Schema.Int;
280
330
  }>;
@@ -284,61 +334,76 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
284
334
  readonly id: Schema.brand<Schema.String, "Relay.AgentId"> & {
285
335
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
286
336
  };
287
- readonly definition: Schema.Struct<{
288
- readonly name: Schema.String;
289
- readonly instructions: Schema.optionalKey<Schema.String>;
290
- readonly model: Schema.Struct<{
291
- readonly provider: Schema.String;
292
- readonly model: Schema.String;
293
- readonly registration_key: Schema.optionalKey<Schema.String>;
294
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
295
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
296
- }>;
297
- readonly tool_names: Schema.$Array<Schema.String>;
298
- readonly permissions: Schema.$Array<Schema.Struct<{
299
- readonly name: Schema.String;
300
- readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
301
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
302
- }>>;
303
- readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
304
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
305
- }>>;
306
- readonly permission_rules: Schema.optionalKey<Schema.Struct<{
307
- readonly rules: Schema.$Array<Schema.Struct<{
308
- readonly pattern: Schema.String;
309
- readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
310
- readonly reason: Schema.optionalKey<Schema.String>;
311
- }>>;
312
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
313
- }>>;
314
- readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
315
- readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
316
- readonly token_budget: Schema.optionalKey<Schema.Int>;
317
- readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
318
- readonly instructions: Schema.optionalKey<Schema.String>;
319
- readonly model: Schema.optionalKey<Schema.Struct<{
320
- readonly provider: Schema.String;
321
- readonly model: Schema.String;
322
- readonly registration_key: Schema.optionalKey<Schema.String>;
323
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
324
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
325
- }>>;
326
- readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
327
- readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
328
- readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
329
- readonly mode: Schema.Literals<readonly ["share", "fork"]>;
330
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
331
- }>>;
332
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
333
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
334
- }>>>;
335
- readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
337
+ readonly definition: Schema.Codec<Definition, {
338
+ readonly name: string;
339
+ readonly permissions: readonly {
340
+ readonly name: string;
341
+ readonly value: Schema.Json;
342
+ readonly metadata?: {
343
+ readonly [x: string]: Schema.Json;
344
+ };
345
+ }[];
346
+ readonly model: {
347
+ readonly provider: string;
348
+ readonly model: string;
349
+ readonly metadata?: {
350
+ readonly [x: string]: Schema.Json;
351
+ };
352
+ readonly registration_key?: string;
353
+ readonly request_options?: {
354
+ readonly [x: string]: Schema.Json;
355
+ };
356
+ };
357
+ readonly tool_names: readonly string[];
358
+ readonly metadata?: {
359
+ readonly [x: string]: Schema.Json;
360
+ };
361
+ readonly instructions?: string;
362
+ readonly output_schema_ref?: string;
363
+ readonly skill_definition_ids?: readonly string[];
364
+ readonly permission_rules?: {
365
+ readonly rules: readonly {
366
+ readonly pattern: string;
367
+ readonly level: "allow" | "deny" | "ask";
368
+ readonly reason?: string;
369
+ }[];
370
+ readonly fallback?: "allow" | "deny" | "ask";
371
+ };
372
+ readonly turn_policy?: TurnPolicySnapshot;
373
+ readonly max_tool_turns?: number;
374
+ readonly max_wait_turns?: number;
375
+ readonly token_budget?: number;
376
+ readonly child_run_presets?: {
377
+ readonly [x: string]: {
378
+ readonly metadata?: {
379
+ readonly [x: string]: Schema.Json;
380
+ };
381
+ readonly permissions?: readonly string[];
382
+ readonly model?: {
383
+ readonly provider: string;
384
+ readonly model: string;
385
+ readonly metadata?: {
386
+ readonly [x: string]: Schema.Json;
387
+ };
388
+ readonly registration_key?: string;
389
+ readonly request_options?: {
390
+ readonly [x: string]: Schema.Json;
391
+ };
392
+ };
393
+ readonly instructions?: string;
394
+ readonly tool_names?: readonly string[];
395
+ readonly workspace_policy?: {
396
+ readonly mode: "share" | "fork";
397
+ readonly fallback?: "fail" | "fresh";
398
+ };
399
+ readonly output_schema_ref?: string;
400
+ };
401
+ };
402
+ readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
336
403
  readonly name: Schema.String;
337
404
  readonly preset_name: Schema.String;
338
- }>>>;
339
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
340
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
341
- }>;
405
+ }, "Encoded">[];
406
+ }, never, never>;
342
407
  }>;
343
408
  export interface RegisterDefinitionPayload extends Schema.Schema.Type<typeof RegisterDefinitionPayload> {
344
409
  }
@@ -348,61 +413,76 @@ export declare const DefinitionRegistered: Schema.Struct<{
348
413
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
349
414
  };
350
415
  readonly current_revision: Schema.Int;
351
- readonly definition: Schema.Struct<{
352
- readonly name: Schema.String;
353
- readonly instructions: Schema.optionalKey<Schema.String>;
354
- readonly model: Schema.Struct<{
355
- readonly provider: Schema.String;
356
- readonly model: Schema.String;
357
- readonly registration_key: Schema.optionalKey<Schema.String>;
358
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
359
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
360
- }>;
361
- readonly tool_names: Schema.$Array<Schema.String>;
362
- readonly permissions: Schema.$Array<Schema.Struct<{
363
- readonly name: Schema.String;
364
- readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
365
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
366
- }>>;
367
- readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
368
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
369
- }>>;
370
- readonly permission_rules: Schema.optionalKey<Schema.Struct<{
371
- readonly rules: Schema.$Array<Schema.Struct<{
372
- readonly pattern: Schema.String;
373
- readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
374
- readonly reason: Schema.optionalKey<Schema.String>;
375
- }>>;
376
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
377
- }>>;
378
- readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
379
- readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
380
- readonly token_budget: Schema.optionalKey<Schema.Int>;
381
- readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
382
- readonly instructions: Schema.optionalKey<Schema.String>;
383
- readonly model: Schema.optionalKey<Schema.Struct<{
384
- readonly provider: Schema.String;
385
- readonly model: Schema.String;
386
- readonly registration_key: Schema.optionalKey<Schema.String>;
387
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
388
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
389
- }>>;
390
- readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
391
- readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
392
- readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
393
- readonly mode: Schema.Literals<readonly ["share", "fork"]>;
394
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
395
- }>>;
396
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
397
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
398
- }>>>;
399
- readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
416
+ readonly definition: Schema.Codec<Definition, {
417
+ readonly name: string;
418
+ readonly permissions: readonly {
419
+ readonly name: string;
420
+ readonly value: Schema.Json;
421
+ readonly metadata?: {
422
+ readonly [x: string]: Schema.Json;
423
+ };
424
+ }[];
425
+ readonly model: {
426
+ readonly provider: string;
427
+ readonly model: string;
428
+ readonly metadata?: {
429
+ readonly [x: string]: Schema.Json;
430
+ };
431
+ readonly registration_key?: string;
432
+ readonly request_options?: {
433
+ readonly [x: string]: Schema.Json;
434
+ };
435
+ };
436
+ readonly tool_names: readonly string[];
437
+ readonly metadata?: {
438
+ readonly [x: string]: Schema.Json;
439
+ };
440
+ readonly instructions?: string;
441
+ readonly output_schema_ref?: string;
442
+ readonly skill_definition_ids?: readonly string[];
443
+ readonly permission_rules?: {
444
+ readonly rules: readonly {
445
+ readonly pattern: string;
446
+ readonly level: "allow" | "deny" | "ask";
447
+ readonly reason?: string;
448
+ }[];
449
+ readonly fallback?: "allow" | "deny" | "ask";
450
+ };
451
+ readonly turn_policy?: TurnPolicySnapshot;
452
+ readonly max_tool_turns?: number;
453
+ readonly max_wait_turns?: number;
454
+ readonly token_budget?: number;
455
+ readonly child_run_presets?: {
456
+ readonly [x: string]: {
457
+ readonly metadata?: {
458
+ readonly [x: string]: Schema.Json;
459
+ };
460
+ readonly permissions?: readonly string[];
461
+ readonly model?: {
462
+ readonly provider: string;
463
+ readonly model: string;
464
+ readonly metadata?: {
465
+ readonly [x: string]: Schema.Json;
466
+ };
467
+ readonly registration_key?: string;
468
+ readonly request_options?: {
469
+ readonly [x: string]: Schema.Json;
470
+ };
471
+ };
472
+ readonly instructions?: string;
473
+ readonly tool_names?: readonly string[];
474
+ readonly workspace_policy?: {
475
+ readonly mode: "share" | "fork";
476
+ readonly fallback?: "fail" | "fresh";
477
+ };
478
+ readonly output_schema_ref?: string;
479
+ };
480
+ };
481
+ readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
400
482
  readonly name: Schema.String;
401
483
  readonly preset_name: Schema.String;
402
- }>>>;
403
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
404
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
405
- }>;
484
+ }, "Encoded">[];
485
+ }, never, never>;
406
486
  readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
407
487
  readonly created_at: Schema.Int;
408
488
  readonly updated_at: Schema.Int;
@@ -416,61 +496,76 @@ export declare const DefinitionList: Schema.Struct<{
416
496
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
417
497
  };
418
498
  readonly current_revision: Schema.Int;
419
- readonly definition: Schema.Struct<{
420
- readonly name: Schema.String;
421
- readonly instructions: Schema.optionalKey<Schema.String>;
422
- readonly model: Schema.Struct<{
423
- readonly provider: Schema.String;
424
- readonly model: Schema.String;
425
- readonly registration_key: Schema.optionalKey<Schema.String>;
426
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
427
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
428
- }>;
429
- readonly tool_names: Schema.$Array<Schema.String>;
430
- readonly permissions: Schema.$Array<Schema.Struct<{
431
- readonly name: Schema.String;
432
- readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
433
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
434
- }>>;
435
- readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
436
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
437
- }>>;
438
- readonly permission_rules: Schema.optionalKey<Schema.Struct<{
439
- readonly rules: Schema.$Array<Schema.Struct<{
440
- readonly pattern: Schema.String;
441
- readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
442
- readonly reason: Schema.optionalKey<Schema.String>;
443
- }>>;
444
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
445
- }>>;
446
- readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
447
- readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
448
- readonly token_budget: Schema.optionalKey<Schema.Int>;
449
- readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
450
- readonly instructions: Schema.optionalKey<Schema.String>;
451
- readonly model: Schema.optionalKey<Schema.Struct<{
452
- readonly provider: Schema.String;
453
- readonly model: Schema.String;
454
- readonly registration_key: Schema.optionalKey<Schema.String>;
455
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
456
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
457
- }>>;
458
- readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
459
- readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
460
- readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
461
- readonly mode: Schema.Literals<readonly ["share", "fork"]>;
462
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
463
- }>>;
464
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
465
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
466
- }>>>;
467
- readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
499
+ readonly definition: Schema.Codec<Definition, {
500
+ readonly name: string;
501
+ readonly permissions: readonly {
502
+ readonly name: string;
503
+ readonly value: Schema.Json;
504
+ readonly metadata?: {
505
+ readonly [x: string]: Schema.Json;
506
+ };
507
+ }[];
508
+ readonly model: {
509
+ readonly provider: string;
510
+ readonly model: string;
511
+ readonly metadata?: {
512
+ readonly [x: string]: Schema.Json;
513
+ };
514
+ readonly registration_key?: string;
515
+ readonly request_options?: {
516
+ readonly [x: string]: Schema.Json;
517
+ };
518
+ };
519
+ readonly tool_names: readonly string[];
520
+ readonly metadata?: {
521
+ readonly [x: string]: Schema.Json;
522
+ };
523
+ readonly instructions?: string;
524
+ readonly output_schema_ref?: string;
525
+ readonly skill_definition_ids?: readonly string[];
526
+ readonly permission_rules?: {
527
+ readonly rules: readonly {
528
+ readonly pattern: string;
529
+ readonly level: "allow" | "deny" | "ask";
530
+ readonly reason?: string;
531
+ }[];
532
+ readonly fallback?: "allow" | "deny" | "ask";
533
+ };
534
+ readonly turn_policy?: TurnPolicySnapshot;
535
+ readonly max_tool_turns?: number;
536
+ readonly max_wait_turns?: number;
537
+ readonly token_budget?: number;
538
+ readonly child_run_presets?: {
539
+ readonly [x: string]: {
540
+ readonly metadata?: {
541
+ readonly [x: string]: Schema.Json;
542
+ };
543
+ readonly permissions?: readonly string[];
544
+ readonly model?: {
545
+ readonly provider: string;
546
+ readonly model: string;
547
+ readonly metadata?: {
548
+ readonly [x: string]: Schema.Json;
549
+ };
550
+ readonly registration_key?: string;
551
+ readonly request_options?: {
552
+ readonly [x: string]: Schema.Json;
553
+ };
554
+ };
555
+ readonly instructions?: string;
556
+ readonly tool_names?: readonly string[];
557
+ readonly workspace_policy?: {
558
+ readonly mode: "share" | "fork";
559
+ readonly fallback?: "fail" | "fresh";
560
+ };
561
+ readonly output_schema_ref?: string;
562
+ };
563
+ };
564
+ readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
468
565
  readonly name: Schema.String;
469
566
  readonly preset_name: Schema.String;
470
- }>>>;
471
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
472
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
473
- }>;
567
+ }, "Encoded">[];
568
+ }, never, never>;
474
569
  readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
475
570
  readonly created_at: Schema.Int;
476
571
  readonly updated_at: Schema.Int;
@@ -484,64 +579,80 @@ export declare const DefinitionRevisionList: Schema.Struct<{
484
579
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentId">;
485
580
  };
486
581
  readonly revision: Schema.Int;
487
- readonly definition: Schema.Struct<{
488
- readonly name: Schema.String;
489
- readonly instructions: Schema.optionalKey<Schema.String>;
490
- readonly model: Schema.Struct<{
491
- readonly provider: Schema.String;
492
- readonly model: Schema.String;
493
- readonly registration_key: Schema.optionalKey<Schema.String>;
494
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
495
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
496
- }>;
497
- readonly tool_names: Schema.$Array<Schema.String>;
498
- readonly permissions: Schema.$Array<Schema.Struct<{
499
- readonly name: Schema.String;
500
- readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
501
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
502
- }>>;
503
- readonly skill_definition_ids: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "Relay.SkillDefinitionId"> & {
504
- make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.SkillDefinitionId">;
505
- }>>;
506
- readonly permission_rules: Schema.optionalKey<Schema.Struct<{
507
- readonly rules: Schema.$Array<Schema.Struct<{
508
- readonly pattern: Schema.String;
509
- readonly level: Schema.Literals<readonly ["allow", "deny", "ask"]>;
510
- readonly reason: Schema.optionalKey<Schema.String>;
511
- }>>;
512
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
513
- }>>;
514
- readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
515
- readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
516
- readonly token_budget: Schema.optionalKey<Schema.Int>;
517
- readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
518
- readonly instructions: Schema.optionalKey<Schema.String>;
519
- readonly model: Schema.optionalKey<Schema.Struct<{
520
- readonly provider: Schema.String;
521
- readonly model: Schema.String;
522
- readonly registration_key: Schema.optionalKey<Schema.String>;
523
- readonly request_options: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
524
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
525
- }>>;
526
- readonly tool_names: Schema.optionalKey<Schema.$Array<Schema.String>>;
527
- readonly permissions: Schema.optionalKey<Schema.$Array<Schema.String>>;
528
- readonly workspace_policy: Schema.optionalKey<Schema.Struct<{
529
- readonly mode: Schema.Literals<readonly ["share", "fork"]>;
530
- readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["fail", "fresh"]>>;
531
- }>>;
532
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
533
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
534
- }>>>;
535
- readonly handoff_targets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
582
+ readonly definition: Schema.Codec<Definition, {
583
+ readonly name: string;
584
+ readonly permissions: readonly {
585
+ readonly name: string;
586
+ readonly value: Schema.Json;
587
+ readonly metadata?: {
588
+ readonly [x: string]: Schema.Json;
589
+ };
590
+ }[];
591
+ readonly model: {
592
+ readonly provider: string;
593
+ readonly model: string;
594
+ readonly metadata?: {
595
+ readonly [x: string]: Schema.Json;
596
+ };
597
+ readonly registration_key?: string;
598
+ readonly request_options?: {
599
+ readonly [x: string]: Schema.Json;
600
+ };
601
+ };
602
+ readonly tool_names: readonly string[];
603
+ readonly metadata?: {
604
+ readonly [x: string]: Schema.Json;
605
+ };
606
+ readonly instructions?: string;
607
+ readonly output_schema_ref?: string;
608
+ readonly skill_definition_ids?: readonly string[];
609
+ readonly permission_rules?: {
610
+ readonly rules: readonly {
611
+ readonly pattern: string;
612
+ readonly level: "allow" | "deny" | "ask";
613
+ readonly reason?: string;
614
+ }[];
615
+ readonly fallback?: "allow" | "deny" | "ask";
616
+ };
617
+ readonly turn_policy?: TurnPolicySnapshot;
618
+ readonly max_tool_turns?: number;
619
+ readonly max_wait_turns?: number;
620
+ readonly token_budget?: number;
621
+ readonly child_run_presets?: {
622
+ readonly [x: string]: {
623
+ readonly metadata?: {
624
+ readonly [x: string]: Schema.Json;
625
+ };
626
+ readonly permissions?: readonly string[];
627
+ readonly model?: {
628
+ readonly provider: string;
629
+ readonly model: string;
630
+ readonly metadata?: {
631
+ readonly [x: string]: Schema.Json;
632
+ };
633
+ readonly registration_key?: string;
634
+ readonly request_options?: {
635
+ readonly [x: string]: Schema.Json;
636
+ };
637
+ };
638
+ readonly instructions?: string;
639
+ readonly tool_names?: readonly string[];
640
+ readonly workspace_policy?: {
641
+ readonly mode: "share" | "fork";
642
+ readonly fallback?: "fail" | "fresh";
643
+ };
644
+ readonly output_schema_ref?: string;
645
+ };
646
+ };
647
+ readonly handoff_targets?: readonly Schema.Struct.ReadonlySide<{
536
648
  readonly name: Schema.String;
537
649
  readonly preset_name: Schema.String;
538
- }>>>;
539
- readonly output_schema_ref: Schema.optionalKey<Schema.String>;
540
- readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
541
- }>;
650
+ }, "Encoded">[];
651
+ }, never, never>;
542
652
  readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
543
653
  readonly created_at: Schema.Int;
544
654
  }>>;
545
655
  }>;
546
656
  export interface DefinitionRevisionList extends Schema.Schema.Type<typeof DefinitionRevisionList> {
547
657
  }
658
+ export {};