@relayfx/sdk 0.0.7 → 0.0.9

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 (29) hide show
  1. package/dist/index.js +5848 -5140
  2. package/dist/migrations/20260706185931_regular_shadow_king/migration.sql +166 -0
  3. package/dist/migrations/20260706185931_regular_shadow_king/snapshot.json +4844 -0
  4. package/dist/migrations/20260706233300_equal_cyclops/migration.sql +3 -0
  5. package/dist/migrations/20260706233300_equal_cyclops/snapshot.json +4883 -0
  6. package/dist/types/relay/client.d.ts +5 -0
  7. package/dist/types/relay/index.d.ts +1 -1
  8. package/dist/types/relay/operation.d.ts +2 -1
  9. package/dist/types/runtime/address/address-resolution-service.d.ts +1 -0
  10. package/dist/types/runtime/agent/agent-loop-service.d.ts +1 -5
  11. package/dist/types/runtime/child/spawn-child-run-tool.d.ts +2 -0
  12. package/dist/types/runtime/cluster/execution-entity.d.ts +3 -0
  13. package/dist/types/runtime/execution/execution-service.d.ts +1 -0
  14. package/dist/types/runtime/index.d.ts +2 -0
  15. package/dist/types/runtime/runner/runner-runtime-service.d.ts +14 -14
  16. package/dist/types/runtime/tool/tool-input-schema-digest.d.ts +6 -0
  17. package/dist/types/runtime/workflow/activity-version-registry.d.ts +89 -0
  18. package/dist/types/runtime/workflow/execution-workflow.d.ts +39 -1
  19. package/dist/types/schema/agent-schema.d.ts +34 -0
  20. package/dist/types/schema/execution-schema.d.ts +3 -2
  21. package/dist/types/schema/ids-schema.d.ts +5 -0
  22. package/dist/types/schema/shared-schema.d.ts +2 -0
  23. package/dist/types/store-sql/agent/agent-definition-repository.d.ts +3 -0
  24. package/dist/types/store-sql/execution/execution-repository.d.ts +2 -0
  25. package/dist/types/store-sql/index.d.ts +1 -0
  26. package/dist/types/store-sql/schema/relay-schema.d.ts +487 -22
  27. package/dist/types/store-sql/session/session-repository.d.ts +1 -0
  28. package/dist/types/store-sql/tenant/tenant-id.d.ts +15 -0
  29. package/package.json +1 -1
@@ -1,4 +1,7 @@
1
1
  import { Schema } from "effect";
2
+ import { AgentDefinitionId, SkillDefinitionId } from "./ids-schema";
3
+ import { Metadata, NonEmptyString } from "./shared-schema";
4
+ import { Permission } from "./tool-schema";
2
5
  export declare const DefinitionRevision: Schema.Int;
3
6
  export type DefinitionRevision = typeof DefinitionRevision.Type;
4
7
  export declare const ModelSelection: Schema.Struct<{
@@ -61,6 +64,9 @@ export declare const PermissionRuleset: Schema.Struct<{
61
64
  }>;
62
65
  export interface PermissionRuleset extends Schema.Schema.Type<typeof PermissionRuleset> {
63
66
  }
67
+ export declare const ToolInputSchemaDigests: Schema.$Record<Schema.String, Schema.String>;
68
+ export interface ToolInputSchemaDigests extends Schema.Schema.Type<typeof ToolInputSchemaDigests> {
69
+ }
64
70
  /**
65
71
  * Default per-`AgentLoop.run` tool-turn budget when `max_tool_turns` is absent.
66
72
  * Preserves pre-configuration behavior bit-for-bit.
@@ -128,6 +134,29 @@ export declare const Definition: Schema.Struct<{
128
134
  }>;
129
135
  export interface Definition extends Schema.Schema.Type<typeof Definition> {
130
136
  }
137
+ export type ToolRef = {
138
+ readonly name: string;
139
+ } | ({
140
+ readonly name: string;
141
+ } & Readonly<Record<string, unknown>>);
142
+ export interface DefineInput {
143
+ readonly id: AgentDefinitionId;
144
+ readonly name: NonEmptyString;
145
+ readonly instructions?: string;
146
+ readonly model: ModelSelection;
147
+ readonly tools?: ReadonlyArray<ToolRef>;
148
+ readonly permissions: ReadonlyArray<Permission>;
149
+ readonly skill_definition_ids?: ReadonlyArray<SkillDefinitionId>;
150
+ readonly permission_rules?: PermissionRuleset;
151
+ readonly max_tool_turns?: number;
152
+ readonly max_wait_turns?: number;
153
+ readonly token_budget?: number;
154
+ readonly child_run_presets?: Readonly<Record<string, ChildRunPreset>>;
155
+ readonly handoff_targets?: ReadonlyArray<HandoffTarget>;
156
+ readonly output_schema_ref?: string;
157
+ readonly metadata?: Metadata;
158
+ }
159
+ export declare const define: (input: DefineInput) => RegisterDefinitionPayload;
131
160
  export declare const DefinitionRecord: Schema.Struct<{
132
161
  readonly id: Schema.brand<Schema.String, "Relay.AgentDefinitionId"> & {
133
162
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AgentDefinitionId">;
@@ -188,6 +217,7 @@ export declare const DefinitionRecord: Schema.Struct<{
188
217
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
189
218
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
190
219
  }>;
220
+ readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
191
221
  readonly created_at: Schema.Int;
192
222
  readonly updated_at: Schema.Int;
193
223
  }>;
@@ -253,6 +283,7 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
253
283
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
254
284
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
255
285
  }>;
286
+ readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
256
287
  readonly created_at: Schema.Int;
257
288
  }>;
258
289
  export interface DefinitionRevisionRecord extends Schema.Schema.Type<typeof DefinitionRevisionRecord> {
@@ -380,6 +411,7 @@ export declare const DefinitionRegistered: Schema.Struct<{
380
411
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
381
412
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
382
413
  }>;
414
+ readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
383
415
  readonly created_at: Schema.Int;
384
416
  readonly updated_at: Schema.Int;
385
417
  }>;
@@ -447,6 +479,7 @@ export declare const DefinitionList: Schema.Struct<{
447
479
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
448
480
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
449
481
  }>;
482
+ readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
450
483
  readonly created_at: Schema.Int;
451
484
  readonly updated_at: Schema.Int;
452
485
  }>>;
@@ -514,6 +547,7 @@ export declare const DefinitionRevisionList: Schema.Struct<{
514
547
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
515
548
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
516
549
  }>;
550
+ readonly tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
517
551
  readonly created_at: Schema.Int;
518
552
  }>>;
519
553
  }>;
@@ -71,6 +71,7 @@ export declare const Execution: Schema.Struct<{
71
71
  readonly output_schema_ref: Schema.optionalKey<Schema.String>;
72
72
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
73
73
  }>>;
74
+ readonly agent_definition_tool_input_schema_digests: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
74
75
  readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
75
76
  readonly created_at: Schema.Int;
76
77
  readonly updated_at: Schema.Int;
@@ -259,7 +260,7 @@ export declare const ChildRunAccepted: Schema.Struct<{
259
260
  }>;
260
261
  export interface ChildRunAccepted extends Schema.Schema.Type<typeof ChildRunAccepted> {
261
262
  }
262
- export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "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"]>;
263
+ export declare const ExecutionEventType: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "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"]>;
263
264
  export type ExecutionEventType = typeof ExecutionEventType.Type;
264
265
  export declare const ExecutionEvent: Schema.Struct<{
265
266
  readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
@@ -271,7 +272,7 @@ export declare const ExecutionEvent: Schema.Struct<{
271
272
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
272
273
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
273
274
  }>;
274
- readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "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"]>;
275
+ readonly type: Schema.Literals<readonly ["execution.accepted", "execution.started", "execution.completed", "execution.failed", "execution.cancelled", "model.input.prepared", "model.output.delta", "model.reasoning.delta", "model.output.completed", "model.usage.reported", "budget.exceeded", "tool.call.requested", "tool.result.received", "tool.approval.requested", "tool.approval.resolved", "permission.ask.requested", "permission.ask.resolved", "steering.received", "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"]>;
275
276
  readonly sequence: Schema.Int;
276
277
  readonly cursor: Schema.String;
277
278
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -3,6 +3,11 @@ export declare const AddressId: Schema.brand<Schema.String, "Relay.AddressId"> &
3
3
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressId">;
4
4
  };
5
5
  export type AddressId = typeof AddressId.Type;
6
+ export declare const TenantId: Schema.brand<Schema.String, "Relay.TenantId"> & {
7
+ make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.TenantId">;
8
+ };
9
+ export type TenantId = typeof TenantId.Type;
10
+ export declare const SystemTenantId: string & import("effect/Brand").Brand<"Relay.TenantId">;
6
11
  export declare const AddressBookEntryId: Schema.brand<Schema.String, "Relay.AddressBookEntryId"> & {
7
12
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.AddressBookEntryId">;
8
13
  };
@@ -9,3 +9,5 @@ export declare const TimestampMillis: Schema.Int;
9
9
  export type TimestampMillis = typeof TimestampMillis.Type;
10
10
  export declare const NonEmptyString: Schema.String;
11
11
  export type NonEmptyString = typeof NonEmptyString.Type;
12
+ export declare const canonicalValue: (value: unknown) => unknown;
13
+ export declare const canonicalString: (value: unknown) => string;
@@ -10,6 +10,7 @@ export interface AgentDefinitionRecord {
10
10
  readonly id: Ids.AgentDefinitionId;
11
11
  readonly currentRevision: Agent.DefinitionRevision;
12
12
  readonly definition: Agent.Definition;
13
+ readonly toolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
13
14
  readonly createdAt: number;
14
15
  readonly updatedAt: number;
15
16
  }
@@ -17,11 +18,13 @@ export interface AgentDefinitionRevisionRecord {
17
18
  readonly id: Ids.AgentDefinitionId;
18
19
  readonly revision: Agent.DefinitionRevision;
19
20
  readonly definition: Agent.Definition;
21
+ readonly toolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
20
22
  readonly createdAt: number;
21
23
  }
22
24
  export interface PutAgentDefinitionInput {
23
25
  readonly id: Ids.AgentDefinitionId;
24
26
  readonly definition: Agent.Definition;
27
+ readonly toolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
25
28
  readonly now: number;
26
29
  }
27
30
  export interface GetAgentDefinitionRevisionInput {
@@ -28,6 +28,7 @@ export interface ExecutionRecord {
28
28
  readonly agentDefinitionId?: Ids.AgentDefinitionId;
29
29
  readonly agentDefinitionRevision?: Agent.DefinitionRevision;
30
30
  readonly agentDefinitionSnapshot?: Agent.Definition;
31
+ readonly agentDefinitionToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
31
32
  readonly metadata: Shared.Metadata;
32
33
  readonly createdAt: number;
33
34
  readonly updatedAt: number;
@@ -40,6 +41,7 @@ export interface CreateExecutionInput {
40
41
  readonly agentDefinitionId?: Ids.AgentDefinitionId;
41
42
  readonly agentDefinitionRevision?: Agent.DefinitionRevision;
42
43
  readonly agentDefinitionSnapshot?: Agent.Definition;
44
+ readonly agentDefinitionToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
43
45
  readonly metadata?: Shared.Metadata;
44
46
  readonly createdAt: number;
45
47
  }
@@ -18,5 +18,6 @@ export * as SessionRepository from "./session/session-repository";
18
18
  export * as SkillDefinitionRepository from "./skill/skill-definition-repository";
19
19
  export * as SteeringRepository from "./steering/steering-repository";
20
20
  export * as ToolCallRepository from "./tool/tool-call-repository";
21
+ export * as TenantId from "./tenant/tenant-id";
21
22
  export * as WorkspaceLeaseRepository from "./workspace/workspace-lease-repository";
22
23
  export declare const storeSqlPackage = "./index";