@relayfx/sdk 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sqlite.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  database,
4
4
  normalizeMigrationCause
5
- } from "./index-2vsf6dks.js";
5
+ } from "./index-h8rx4xya.js";
6
6
  import {
7
7
  DatabaseAlreadyOwned,
8
8
  RuntimeConfigurationError,
@@ -12,9 +12,9 @@ import {
12
12
  make,
13
13
  makeDatabaseIdentity,
14
14
  runtimeLayer
15
- } from "./index-e02krw55.js";
16
- import"./index-8fpd6kvj.js";
17
- import"./index-mtvz1bjn.js";
15
+ } from "./index-8awt651b.js";
16
+ import"./index-t5bbk8cp.js";
17
+ import"./index-pw46cfne.js";
18
18
  import"./index-nb39b5ae.js";
19
19
 
20
20
  // src/sqlite-runtime.ts
@@ -98,6 +98,9 @@ export declare const StartExecutionInput: Schema.Struct<{
98
98
  readonly fallback?: "allow" | "ask" | "deny";
99
99
  };
100
100
  readonly turn_policy?: Agent.TurnPolicySnapshot;
101
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
102
+ readonly concurrency: Schema.Finite;
103
+ }, "Encoded">;
101
104
  readonly compaction_policy?: {
102
105
  readonly context_window: number;
103
106
  readonly reserve_tokens: number;
@@ -86,6 +86,9 @@ export declare const LocalAgentTarget: Schema.Struct<{
86
86
  readonly fallback?: "allow" | "ask" | "deny";
87
87
  };
88
88
  readonly turn_policy?: Agent.TurnPolicySnapshot;
89
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
90
+ readonly concurrency: Schema.Finite;
91
+ }, "Encoded">;
89
92
  readonly compaction_policy?: {
90
93
  readonly context_window: number;
91
94
  readonly reserve_tokens: number;
@@ -8,7 +8,7 @@ export interface Config {
8
8
  readonly eventLog: EventLogInterface;
9
9
  readonly allocator: {
10
10
  readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
11
- readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
11
+ readonly advanceTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
12
12
  };
13
13
  readonly executionId: Ids.ExecutionId;
14
14
  readonly permissions: ReadonlyArray<Tool.Permission>;
@@ -18,5 +18,5 @@ export interface Config {
18
18
  readonly resumedToolCallId?: Ids.ToolCallId;
19
19
  readonly extraTools?: ReadonlyArray<RegisteredTool>;
20
20
  }
21
- export declare const make: (config: Config) => ToolExecutor.Interface;
21
+ export declare const make: (config: Config) => Effect.Effect<ToolExecutor.Interface>;
22
22
  export declare const layer: (config: Config) => Layer.Layer<ToolExecutor.ToolExecutor>;
@@ -3,6 +3,7 @@ import { Effect } from "effect";
3
3
  export interface SequenceAllocator {
4
4
  readonly allocate: (count: number) => Effect.Effect<Execution.ExecutionEventSequence>;
5
5
  readonly current: Effect.Effect<Execution.ExecutionEventSequence>;
6
+ readonly advanceTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
6
7
  readonly resetTo: (sequence: Execution.ExecutionEventSequence) => Effect.Effect<void>;
7
8
  }
8
9
  export declare const make: (first: Execution.ExecutionEventSequence) => Effect.Effect<SequenceAllocator>;
@@ -58,6 +58,7 @@ export interface FindFirstByTypeAfterSequenceInput {
58
58
  }
59
59
  export interface Interface {
60
60
  readonly append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError>;
61
+ readonly appendNext: (input: ExecutionEventRepository.AppendNextInput) => Effect.Effect<Execution.ExecutionEvent, EventLogError>;
61
62
  readonly replay: (input: ReplayInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, EventLogCursorNotFound | EventLogError>;
62
63
  readonly stream: (input: ReplayInput) => Stream.Stream<Execution.ExecutionEvent, EventLogCursorNotFound | EventLogError>;
63
64
  readonly page: (input: PageInput) => Effect.Effect<PageResult, EventLogCursorNotFound | EventLogError>;
@@ -73,13 +74,14 @@ export declare class Service extends Service_base {
73
74
  }
74
75
  export declare const layerFromRepository: Layer.Layer<Service, never, ExecutionEventRepository.Service>;
75
76
  export declare const memoryLayer: Layer.Layer<Service, never, never>;
76
- type TestImplementation = Omit<Interface, "page"> & Partial<Pick<Interface, "page">>;
77
+ type TestImplementation = Omit<Interface, "appendNext" | "page"> & Partial<Pick<Interface, "appendNext" | "page">>;
77
78
  export declare const testLayer: (implementation: TestImplementation) => Layer.Layer<Service, never, never>;
78
79
  export declare const appendIdempotentTo: {
79
80
  (eventLog: Interface, input: Execution.ExecutionEvent): Effect.Effect<Execution.ExecutionEvent, EventLogError>;
80
81
  (input: Execution.ExecutionEvent): (eventLog: Interface) => Effect.Effect<Execution.ExecutionEvent, EventLogError>;
81
82
  };
82
83
  export declare const append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError, Service>;
84
+ export declare const appendNext: (input: ExecutionEventRepository.AppendNextInput) => Effect.Effect<Execution.ExecutionEvent, EventLogError, Service>;
83
85
  export declare const appendIdempotent: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, EventLogError, Service>;
84
86
  export declare const replay: (input: ReplayInput) => Effect.Effect<readonly Execution.ExecutionEvent[], EventLogCursorNotFound | EventLogError, Service>;
85
87
  export declare const page: (input: PageInput) => Effect.Effect<PageResult, EventLogCursorNotFound | EventLogError, Service>;
@@ -105,6 +105,8 @@ export interface RunInput {
105
105
  readonly eventSequence: Execution.ExecutionEventSequence;
106
106
  readonly createdAt: number;
107
107
  readonly extraTools?: ReadonlyArray<RegisteredTool>;
108
+ readonly onRequested?: Effect.Effect<void>;
109
+ readonly beforeSettlement?: Effect.Effect<Execution.ExecutionEventSequence>;
108
110
  readonly transformResult?: (result: Tool.Result) => Effect.Effect<Tool.Result, ToolRuntimeError>;
109
111
  }
110
112
  export type RunError = ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolExecutionFailed | ToolExecutionWaitRequested | ToolRuntimeError;
@@ -112,10 +114,11 @@ export interface Interface {
112
114
  readonly register: (tool: RegisteredTool) => Effect.Effect<void>;
113
115
  readonly definitions: Effect.Effect<ReadonlyArray<Tool.Definition>>;
114
116
  readonly registeredTools: Effect.Effect<ReadonlyArray<RegisteredTool>>;
117
+ readonly prepare: (input: RunInput) => Effect.Effect<void, ToolNotRegistered | ToolPermissionDenied | ToolInputInvalid | ToolRuntimeError>;
115
118
  readonly run: (input: RunInput) => Effect.Effect<Tool.Result, RunError>;
116
119
  }
117
120
  declare const Service_base: Context.ServiceClass<Service, "@relayfx/runtime/tool/tool-runtime-contract/Service", Interface>;
118
121
  export declare class Service extends Service_base {
119
122
  }
120
- export declare const testLayer: (implementation: Interface) => Layer.Layer<Service>;
123
+ export declare const testLayer: (implementation: Omit<Interface, "prepare"> & Partial<Pick<Interface, "prepare">>) => Layer.Layer<Service>;
121
124
  export {};
@@ -120,6 +120,9 @@ export declare const StartInput: Schema.Struct<{
120
120
  readonly fallback?: "allow" | "ask" | "deny";
121
121
  };
122
122
  readonly turn_policy?: Agent.TurnPolicySnapshot;
123
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
124
+ readonly concurrency: Schema.Finite;
125
+ }, "Encoded">;
123
126
  readonly compaction_policy?: {
124
127
  readonly context_window: number;
125
128
  readonly reserve_tokens: number;
@@ -405,6 +408,9 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
405
408
  readonly fallback?: "allow" | "ask" | "deny";
406
409
  };
407
410
  readonly turn_policy?: Agent.TurnPolicySnapshot;
411
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
412
+ readonly concurrency: Schema.Finite;
413
+ }, "Encoded">;
408
414
  readonly compaction_policy?: {
409
415
  readonly context_window: number;
410
416
  readonly reserve_tokens: number;
@@ -143,6 +143,9 @@ declare const DefinitionSchema: Schema.Struct<{
143
143
  readonly fallback: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
144
144
  }>>;
145
145
  readonly turn_policy: Schema.optionalKey<Schema.Codec<TurnPolicySnapshot, TurnPolicySnapshot, never, never>>;
146
+ readonly tool_execution: Schema.optionalKey<Schema.Struct<{
147
+ readonly concurrency: Schema.Finite;
148
+ }>>;
146
149
  readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
147
150
  readonly context_window: Schema.Finite;
148
151
  readonly reserve_tokens: Schema.Finite;
@@ -213,6 +216,9 @@ export interface DefineInput {
213
216
  readonly skill_definition_ids?: ReadonlyArray<SkillDefinitionId>;
214
217
  readonly permission_rules?: PermissionRuleset;
215
218
  readonly turn_policy?: TurnPolicySnapshot;
219
+ readonly tool_execution?: {
220
+ readonly concurrency: number;
221
+ };
216
222
  readonly compaction_policy?: CompactionPolicy;
217
223
  readonly max_tool_turns?: number;
218
224
  readonly max_wait_turns?: number;
@@ -260,6 +266,9 @@ export declare const DefinitionRecord: Schema.Struct<{
260
266
  readonly fallback?: "allow" | "ask" | "deny";
261
267
  };
262
268
  readonly turn_policy?: TurnPolicySnapshot;
269
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
270
+ readonly concurrency: Schema.Finite;
271
+ }, "Encoded">;
263
272
  readonly compaction_policy?: {
264
273
  readonly context_window: number;
265
274
  readonly reserve_tokens: number;
@@ -373,6 +382,9 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
373
382
  readonly fallback?: "allow" | "ask" | "deny";
374
383
  };
375
384
  readonly turn_policy?: TurnPolicySnapshot;
385
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
386
+ readonly concurrency: Schema.Finite;
387
+ }, "Encoded">;
376
388
  readonly compaction_policy?: {
377
389
  readonly context_window: number;
378
390
  readonly reserve_tokens: number;
@@ -484,6 +496,9 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
484
496
  readonly fallback?: "allow" | "ask" | "deny";
485
497
  };
486
498
  readonly turn_policy?: TurnPolicySnapshot;
499
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
500
+ readonly concurrency: Schema.Finite;
501
+ }, "Encoded">;
487
502
  readonly compaction_policy?: {
488
503
  readonly context_window: number;
489
504
  readonly reserve_tokens: number;
@@ -595,6 +610,9 @@ export declare const DefinitionRegistered: Schema.Struct<{
595
610
  readonly fallback?: "allow" | "ask" | "deny";
596
611
  };
597
612
  readonly turn_policy?: TurnPolicySnapshot;
613
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
614
+ readonly concurrency: Schema.Finite;
615
+ }, "Encoded">;
598
616
  readonly compaction_policy?: {
599
617
  readonly context_window: number;
600
618
  readonly reserve_tokens: number;
@@ -710,6 +728,9 @@ export declare const DefinitionList: Schema.Struct<{
710
728
  readonly fallback?: "allow" | "ask" | "deny";
711
729
  };
712
730
  readonly turn_policy?: TurnPolicySnapshot;
731
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
732
+ readonly concurrency: Schema.Finite;
733
+ }, "Encoded">;
713
734
  readonly compaction_policy?: {
714
735
  readonly context_window: number;
715
736
  readonly reserve_tokens: number;
@@ -825,6 +846,9 @@ export declare const DefinitionRevisionList: Schema.Struct<{
825
846
  readonly fallback?: "allow" | "ask" | "deny";
826
847
  };
827
848
  readonly turn_policy?: TurnPolicySnapshot;
849
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
850
+ readonly concurrency: Schema.Finite;
851
+ }, "Encoded">;
828
852
  readonly compaction_policy?: {
829
853
  readonly context_window: number;
830
854
  readonly reserve_tokens: number;
@@ -50,6 +50,9 @@ export declare const Execution: Schema.Struct<{
50
50
  readonly fallback?: "allow" | "ask" | "deny";
51
51
  };
52
52
  readonly turn_policy?: import("./agent-schema").TurnPolicySnapshot;
53
+ readonly tool_execution?: Schema.Struct.ReadonlySide<{
54
+ readonly concurrency: Schema.Finite;
55
+ }, "Encoded">;
53
56
  readonly compaction_policy?: {
54
57
  readonly context_window: number;
55
58
  readonly reserve_tokens: number;
@@ -39,6 +39,13 @@ export interface ListInput {
39
39
  readonly afterCursor?: string;
40
40
  readonly limit?: number;
41
41
  }
42
+ export interface AppendNextInput extends Omit<Execution.ExecutionEvent, "sequence"> {
43
+ readonly minimumSequence?: Execution.ExecutionEventSequence;
44
+ }
45
+ export interface AppendNextResult {
46
+ readonly event: Execution.ExecutionEvent;
47
+ readonly inserted: boolean;
48
+ }
42
49
  export interface FindBySequenceOrCursorInput {
43
50
  readonly executionId: Ids.ExecutionId;
44
51
  readonly sequence: Execution.ExecutionEventSequence;
@@ -84,6 +91,7 @@ export interface PageResult {
84
91
  export interface Interface {
85
92
  readonly signalTransport: Transport;
86
93
  readonly append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, DuplicateExecutionEvent | ExecutionEventOrderViolation | ExecutionEventRepositoryError>;
94
+ readonly appendNext: (input: AppendNextInput) => Effect.Effect<AppendNextResult, DuplicateExecutionEvent | ExecutionEventRepositoryError>;
87
95
  readonly list: (input: ListInput) => Effect.Effect<ReadonlyArray<Execution.ExecutionEvent>, ExecutionEventCursorNotFound | ExecutionEventRepositoryError>;
88
96
  readonly findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
89
97
  readonly findByCursor: (input: FindByCursorInput) => Effect.Effect<Option.Option<Execution.ExecutionEvent>, ExecutionEventRepositoryError>;
@@ -113,9 +121,10 @@ export declare const ExecutionEventRow: Schema.Struct<{
113
121
  export declare const layer: Layer.Layer<Service, never, NotificationBusService | SqlClient>;
114
122
  export declare const layerWithBus: Layer.Layer<Service, never, SqlClient>;
115
123
  export declare const memoryLayer: Layer.Layer<Service, never, never>;
116
- type TestImplementation = Omit<Interface, "page"> & Partial<Pick<Interface, "page">>;
124
+ export type TestImplementation = Omit<Interface, "appendNext" | "page"> & Partial<Pick<Interface, "appendNext" | "page">>;
117
125
  export declare const testLayer: (implementation: TestImplementation) => Layer.Layer<Service, never, never>;
118
126
  export declare const append: (input: Execution.ExecutionEvent) => Effect.Effect<Execution.ExecutionEvent, DuplicateExecutionEvent | ExecutionEventOrderViolation | ExecutionEventRepositoryError, Service>;
127
+ export declare const appendNext: (input: AppendNextInput) => Effect.Effect<AppendNextResult, DuplicateExecutionEvent | ExecutionEventRepositoryError, Service>;
119
128
  export declare const list: (input: ListInput) => Effect.Effect<readonly Execution.ExecutionEvent[], ExecutionEventCursorNotFound | ExecutionEventRepositoryError, Service>;
120
129
  export declare const page: (input: PageInput) => Effect.Effect<PageResult, ExecutionEventCursorNotFound | ExecutionEventRepositoryError, Service>;
121
130
  export declare const findBySequenceOrCursor: (input: FindBySequenceOrCursorInput) => Effect.Effect<Option.Option<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.3.6",
4
+ "version": "0.3.7",
5
5
  "description": "Effect-native durable execution SDK for addressable agents and tools",
6
6
  "type": "module",
7
7
  "exports": {
@@ -57,8 +57,8 @@
57
57
  "typecheck": "bun tsc --noEmit"
58
58
  },
59
59
  "dependencies": {
60
- "@batonfx/core": "0.6.2",
61
- "@batonfx/providers": "0.6.2",
60
+ "@batonfx/core": "0.6.4",
61
+ "@batonfx/providers": "0.6.4",
62
62
  "@effect/ai-anthropic": "4.0.0-beta.98",
63
63
  "@effect/ai-openai": "4.0.0-beta.98",
64
64
  "@effect/ai-openai-compat": "4.0.0-beta.98",