@relayfx/sdk 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,16 @@ export declare const ChildRunPreset: Schema.Struct<{
36
36
  }>;
37
37
  export interface ChildRunPreset extends Schema.Schema.Type<typeof ChildRunPreset> {
38
38
  }
39
+ /**
40
+ * Default per-`AgentLoop.run` tool-turn budget when `max_tool_turns` is absent.
41
+ * Preserves pre-configuration behavior bit-for-bit.
42
+ */
43
+ export declare const defaultMaxToolTurns = 8;
44
+ /**
45
+ * Default per-execution wait-turn budget when `max_wait_turns` is absent.
46
+ * Preserves pre-configuration behavior bit-for-bit.
47
+ */
48
+ export declare const defaultMaxWaitTurns = 8;
39
49
  export declare const Definition: Schema.Struct<{
40
50
  readonly name: Schema.String;
41
51
  readonly instructions: Schema.optionalKey<Schema.String>;
@@ -52,6 +62,9 @@ export declare const Definition: Schema.Struct<{
52
62
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
53
63
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
54
64
  }>>;
65
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
66
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
67
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
55
68
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
56
69
  readonly instructions: Schema.optionalKey<Schema.String>;
57
70
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -96,6 +109,9 @@ export declare const DefinitionRecord: Schema.Struct<{
96
109
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
97
110
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
98
111
  }>>;
112
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
113
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
114
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
99
115
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
100
116
  readonly instructions: Schema.optionalKey<Schema.String>;
101
117
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -143,6 +159,9 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
143
159
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
144
160
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
145
161
  }>>;
162
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
163
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
164
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
146
165
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
147
166
  readonly instructions: Schema.optionalKey<Schema.String>;
148
167
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -188,6 +207,9 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
188
207
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
189
208
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
190
209
  }>>;
210
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
211
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
212
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
191
213
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
192
214
  readonly instructions: Schema.optionalKey<Schema.String>;
193
215
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -234,6 +256,9 @@ export declare const DefinitionRegistered: Schema.Struct<{
234
256
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
235
257
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
236
258
  }>>;
259
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
260
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
261
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
237
262
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
238
263
  readonly instructions: Schema.optionalKey<Schema.String>;
239
264
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -283,6 +308,9 @@ export declare const DefinitionList: Schema.Struct<{
283
308
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
284
309
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
285
310
  }>>;
311
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
312
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
313
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
286
314
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
287
315
  readonly instructions: Schema.optionalKey<Schema.String>;
288
316
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -332,6 +360,9 @@ export declare const DefinitionRevisionList: Schema.Struct<{
332
360
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
333
361
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
334
362
  }>>;
363
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
364
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
365
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
335
366
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
336
367
  readonly instructions: Schema.optionalKey<Schema.String>;
337
368
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -29,6 +29,9 @@ export declare const Execution: Schema.Struct<{
29
29
  readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
30
30
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
31
31
  }>>;
32
+ readonly max_tool_turns: Schema.optionalKey<Schema.Int>;
33
+ readonly max_wait_turns: Schema.optionalKey<Schema.Int>;
34
+ readonly token_budget: Schema.optionalKey<Schema.Int>;
32
35
  readonly child_run_presets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
33
36
  readonly instructions: Schema.optionalKey<Schema.String>;
34
37
  readonly model: Schema.optionalKey<Schema.Struct<{
@@ -232,7 +235,7 @@ export declare const ChildRunAccepted: Schema.Struct<{
232
235
  }>;
233
236
  export interface ChildRunAccepted extends Schema.Schema.Type<typeof ChildRunAccepted> {
234
237
  }
235
- export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.output.completed", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
238
+ export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.output.completed", "model.usage.reported", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
236
239
  export type ExecutionEventType = typeof ExecutionEventType.Type;
237
240
  export declare const ExecutionEvent: Schema.Struct<{
238
241
  readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
@@ -244,7 +247,7 @@ export declare const ExecutionEvent: Schema.Struct<{
244
247
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
245
248
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
246
249
  }>;
247
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.output.completed", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
250
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.output.completed", "model.usage.reported", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "envelope.accepted", "envelope.routed", "envelope.ready", "delivery.attempt", "wait.created", "wait.woken", "wait.timed_out", "wait.cancelled", "child_run.spawned", "child_run.event", "workspace.lease.planned", "workspace.lease.acquired", "workspace.suspended", "workspace.resumed", "workspace.snapshot.created", "workspace.lease.released", "workspace.lease.failed"]>;
248
251
  readonly sequence: Schema.Int;
249
252
  readonly cursor: Schema.String;
250
253
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -64,6 +64,7 @@ export interface Interface {
64
64
  readonly findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
65
65
  readonly findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
66
66
  readonly maxSequence: (executionId: Ids.ExecutionId) => Effect.Effect<Execution.ExecutionEventSequence | undefined, ExecutionEventRepositoryError>;
67
+ readonly sumUsage: (executionId: Ids.ExecutionId) => Effect.Effect<number, ExecutionEventRepositoryError>;
67
68
  readonly notifyAppended: (event: Execution.ExecutionEvent) => Effect.Effect<void, ExecutionEventRepositoryError>;
68
69
  readonly appendedSignals: (executionId: Ids.ExecutionId) => Stream.Stream<Execution.ExecutionEventSequence, ExecutionEventRepositoryError>;
69
70
  readonly listAfterSequence: (input: ListAfterSequenceInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
@@ -80,6 +81,7 @@ export declare const findBySequenceOrCursor: (input: FindBySequenceOrCursorInput
80
81
  export declare const findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
81
82
  export declare const findFirstByTypeAfterSequence: (input: FindFirstByTypeAfterSequenceInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError, Service>;
82
83
  export declare const maxSequence: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number | undefined, ExecutionEventRepositoryError, Service>;
84
+ export declare const sumUsage: (executionId: string & import("effect/Brand").Brand<"Relay.ExecutionId">) => Effect.Effect<number, ExecutionEventRepositoryError, Service>;
83
85
  export declare const notifyAppended: (event: Execution.ExecutionEvent) => Effect.Effect<void, ExecutionEventRepositoryError, Service>;
84
86
  export declare const appendedSignals: (executionId: Ids.ExecutionId) => Stream.Stream<number, ExecutionEventRepositoryError, Service>;
85
87
  export declare const listAfterSequence: (input: ListAfterSequenceInput) => Effect.Effect<readonly Execution.ExecutionEvent[], ExecutionEventRepositoryError, Service>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@relayfx/sdk",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {