@relayfx/sdk 0.0.7 → 0.0.8

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.
@@ -3,7 +3,7 @@ export * as Client from "./client";
3
3
  export * as Database from "./database";
4
4
  export * as Operation from "./operation";
5
5
  export { Address, Agent, Content, Envelope, Execution, Ids, Schedule, Shared, Skill, Tool } from "../schema/index";
6
- export { AddressBook, AddressResolution, AgentLoop, AgentRegistry, ArtifactStore, BlobStore, ChildRunService, EnvelopeService, EventLog, ExecutionEntity, ExecutionService, ExecutionWorkflow, LanguageModelService, ModelCallPolicy, PromptAssembler, SchedulerService, SchemaRegistry, SkillRegistry, ToolRuntime, WaitService, } from "../runtime/index";
6
+ export { AddressBook, AddressResolution, AgentLoop, AgentRegistry, ActivityVersionRegistry, ArtifactStore, BlobStore, ChildRunService, EnvelopeService, EventLog, ExecutionEntity, ExecutionService, ExecutionWorkflow, LanguageModelService, ModelCallPolicy, PromptAssembler, SchedulerService, SchemaRegistry, SkillRegistry, ToolRuntime, WaitService, } from "../runtime/index";
7
7
  export { RunnerRuntime } from "../runtime/index";
8
8
  export { LanguageModelRegistration } from "../ai/index";
9
9
  export { RelaySchema, SkillDefinitionRepository } from "../store-sql/index";
@@ -1076,7 +1076,7 @@ export declare const ReplayExecutionResult: Schema.Struct<{
1076
1076
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
1077
1077
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
1078
1078
  }>;
1079
- 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"]>;
1079
+ 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"]>;
1080
1080
  readonly sequence: Schema.Int;
1081
1081
  readonly cursor: Schema.String;
1082
1082
  readonly content: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -37,11 +37,6 @@ declare const AgentLoopBudgetExceeded_base: Schema.Class<AgentLoopBudgetExceeded
37
37
  readonly token_budget: Schema.Int;
38
38
  readonly next_event_sequence: Schema.Int;
39
39
  }>, import("effect/Cause").YieldableError>;
40
- /**
41
- * Raised when an agent's per-execution `token_budget` is reached. Checked
42
- * between turns at durable boundaries (never mid-stream); the execution fails
43
- * terminally, exactly like `AgentLoopError` (docs/spec/07 + ADR-0021).
44
- */
45
40
  export declare class AgentLoopBudgetExceeded extends AgentLoopBudgetExceeded_base {
46
41
  }
47
42
  export interface RunInput {
@@ -32,4 +32,5 @@ export * as WorkspacePlanner from "./workspace/workspace-planner-service";
32
32
  export * as WorkspaceProvider from "./workspace/workspace-provider-service";
33
33
  export * as WorkspaceRuntime from "./workspace/workspace-runtime-service";
34
34
  export * as ExecutionWorkflow from "./workflow/execution-workflow";
35
+ export * as ActivityVersionRegistry from "./workflow/activity-version-registry";
35
36
  export declare const runtimePackage = "./index";
@@ -0,0 +1,89 @@
1
+ import { Crypto, Effect, Schema } from "effect";
2
+ export declare const ActivityManifestEntry: Schema.Struct<{
3
+ readonly name: Schema.String;
4
+ readonly signature_hash: Schema.String;
5
+ }>;
6
+ export interface ActivityManifestEntry extends Schema.Schema.Type<typeof ActivityManifestEntry> {
7
+ }
8
+ export declare const ActivityManifest: Schema.Struct<{
9
+ readonly version: Schema.Literal<1>;
10
+ readonly generated_from: Schema.String;
11
+ readonly hash_algorithm: Schema.Literal<"sha256-json-schema-v1">;
12
+ readonly activities: Schema.$Array<Schema.Struct<{
13
+ readonly name: Schema.String;
14
+ readonly signature_hash: Schema.String;
15
+ }>>;
16
+ }>;
17
+ export interface ActivityManifest extends Schema.Schema.Type<typeof ActivityManifest> {
18
+ }
19
+ export declare const ActivityManifestChange: Schema.Struct<{
20
+ readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
21
+ readonly name: Schema.String;
22
+ readonly baseline_hash: Schema.optionalKey<Schema.String>;
23
+ readonly current_hash: Schema.optionalKey<Schema.String>;
24
+ }>;
25
+ export interface ActivityManifestChange extends Schema.Schema.Type<typeof ActivityManifestChange> {
26
+ }
27
+ export declare const ActivityManifestGuardResult: Schema.Struct<{
28
+ readonly status: Schema.Literals<readonly ["pass", "fail"]>;
29
+ readonly waiting_executions: Schema.Int;
30
+ readonly breaking_changes: Schema.$Array<Schema.Struct<{
31
+ readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
32
+ readonly name: Schema.String;
33
+ readonly baseline_hash: Schema.optionalKey<Schema.String>;
34
+ readonly current_hash: Schema.optionalKey<Schema.String>;
35
+ }>>;
36
+ readonly additive_changes: Schema.$Array<Schema.Struct<{
37
+ readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
38
+ readonly name: Schema.String;
39
+ readonly baseline_hash: Schema.optionalKey<Schema.String>;
40
+ readonly current_hash: Schema.optionalKey<Schema.String>;
41
+ }>>;
42
+ }>;
43
+ export interface ActivityManifestGuardResult extends Schema.Schema.Type<typeof ActivityManifestGuardResult> {
44
+ }
45
+ declare const ActivityManifestGuardFailed_base: Schema.Class<ActivityManifestGuardFailed, Schema.TaggedStruct<"ActivityManifestGuardFailed", {
46
+ readonly message: Schema.String;
47
+ readonly result: Schema.Struct<{
48
+ readonly status: Schema.Literals<readonly ["pass", "fail"]>;
49
+ readonly waiting_executions: Schema.Int;
50
+ readonly breaking_changes: Schema.$Array<Schema.Struct<{
51
+ readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
52
+ readonly name: Schema.String;
53
+ readonly baseline_hash: Schema.optionalKey<Schema.String>;
54
+ readonly current_hash: Schema.optionalKey<Schema.String>;
55
+ }>>;
56
+ readonly additive_changes: Schema.$Array<Schema.Struct<{
57
+ readonly type: Schema.Literals<readonly ["removed", "changed", "added"]>;
58
+ readonly name: Schema.String;
59
+ readonly baseline_hash: Schema.optionalKey<Schema.String>;
60
+ readonly current_hash: Schema.optionalKey<Schema.String>;
61
+ }>>;
62
+ }>;
63
+ }>, import("effect/Cause").YieldableError>;
64
+ export declare class ActivityManifestGuardFailed extends ActivityManifestGuardFailed_base {
65
+ }
66
+ export declare const currentManifest: () => Effect.Effect<{
67
+ version: 1;
68
+ generated_from: string;
69
+ hash_algorithm: "sha256-json-schema-v1";
70
+ activities: {
71
+ name: string;
72
+ signature_hash: string;
73
+ }[];
74
+ }, import("effect/PlatformError").PlatformError, Crypto.Crypto>;
75
+ export declare const diffManifests: (baseline: ActivityManifest, current: ActivityManifest) => {
76
+ breaking: ActivityManifestChange[];
77
+ additive: ActivityManifestChange[];
78
+ };
79
+ export declare const evaluateGuard: (input: {
80
+ readonly baseline: ActivityManifest;
81
+ readonly current: ActivityManifest;
82
+ readonly waitingExecutions: number;
83
+ }) => ActivityManifestGuardResult;
84
+ export declare const guard: (input: {
85
+ readonly baseline: ActivityManifest;
86
+ readonly current: ActivityManifest;
87
+ readonly waitingExecutions: number;
88
+ }) => Effect.Effect<ActivityManifestGuardResult, ActivityManifestGuardFailed, never>;
89
+ export {};
@@ -4,6 +4,7 @@ import { Workflow } from "effect/unstable/workflow";
4
4
  import { Effect, Layer, Option, Schema } from "effect";
5
5
  import * as AddressResolution from "../address/address-resolution-service";
6
6
  import * as AgentLoop from "../agent/agent-loop-service";
7
+ import * as ParentNotifier from "../child/parent-notifier-service";
7
8
  import * as SkillRegistry from "../skill/skill-registry-service";
8
9
  import * as EventLog from "../execution/event-log-service";
9
10
  import * as ExecutionService from "../execution/execution-service";
@@ -222,6 +223,41 @@ export declare const StartResult: Schema.Struct<{
222
223
  }>;
223
224
  export interface StartResult extends Schema.Schema.Type<typeof StartResult> {
224
225
  }
226
+ export declare const StartExecutionWorkflowName = "Relay/Execution/Start";
227
+ export declare const ActivityNames: {
228
+ readonly resolveLocalAgent: "Relay/Execution/Start/ResolveLocalAgent";
229
+ readonly accept: "Relay/Execution/Start/Accept";
230
+ readonly cancel: (turn: number) => string;
231
+ readonly checkCancel: (turn: number) => string;
232
+ readonly loadWaitBeforeSleep: (waitId: Ids.WaitId) => string;
233
+ readonly loadWaitAfterWake: (waitId: Ids.WaitId) => string;
234
+ readonly markWaiting: (waitId: Ids.WaitId) => string;
235
+ readonly ensureWorkspace: "Relay/Execution/Start/EnsureWorkspace";
236
+ readonly suspendWorkspace: (key: string) => string;
237
+ readonly resumeWorkspace: (key: string) => string;
238
+ readonly releaseWorkspace: "Relay/Execution/Start/ReleaseWorkspace";
239
+ readonly complete: (turn: number) => string;
240
+ readonly checkQueuedChildCancellation: "Relay/Execution/Start/CheckQueuedChildCancellation";
241
+ readonly notifyParent: (status: ParentNotifier.ChildTerminalStatus) => string;
242
+ readonly continueAsNew: (turn: number) => string;
243
+ };
244
+ export declare const ActivityNameTemplates: {
245
+ readonly resolveLocalAgent: "Relay/Execution/Start/ResolveLocalAgent";
246
+ readonly accept: "Relay/Execution/Start/Accept";
247
+ readonly cancel: "Relay/Execution/Start/Cancel/:turn";
248
+ readonly checkCancel: "Relay/Execution/Start/CheckCancel/:turn";
249
+ readonly loadWaitBeforeSleep: "Relay/Execution/Start/LoadWaitBeforeSleep/:wait_id";
250
+ readonly loadWaitAfterWake: "Relay/Execution/Start/LoadWaitAfterWake/:wait_id";
251
+ readonly markWaiting: "Relay/Execution/Start/MarkWaiting/:wait_id";
252
+ readonly ensureWorkspace: "Relay/Execution/Start/EnsureWorkspace";
253
+ readonly suspendWorkspace: "Relay/Execution/Start/SuspendWorkspace/:key";
254
+ readonly resumeWorkspace: "Relay/Execution/Start/ResumeWorkspace/:key";
255
+ readonly releaseWorkspace: "Relay/Execution/Start/ReleaseWorkspace";
256
+ readonly complete: "Relay/Execution/Start/Complete/:turn";
257
+ readonly checkQueuedChildCancellation: "Relay/Execution/Start/CheckQueuedChildCancellation";
258
+ readonly notifyParent: "Relay/Execution/Start/NotifyParent/:status";
259
+ readonly continueAsNew: "Relay/Execution/Start/ContinueAsNew/:turn";
260
+ };
225
261
  export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/Start", Schema.Struct<{
226
262
  readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
227
263
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ExecutionId">;
@@ -259,7 +259,7 @@ export declare const ChildRunAccepted: Schema.Struct<{
259
259
  }>;
260
260
  export interface ChildRunAccepted extends Schema.Schema.Type<typeof ChildRunAccepted> {
261
261
  }
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"]>;
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", "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
263
  export type ExecutionEventType = typeof ExecutionEventType.Type;
264
264
  export declare const ExecutionEvent: Schema.Struct<{
265
265
  readonly id: Schema.brand<Schema.String, "Relay.EventId"> & {
@@ -271,7 +271,7 @@ export declare const ExecutionEvent: Schema.Struct<{
271
271
  readonly child_execution_id: Schema.optionalKey<Schema.brand<Schema.String, "Relay.ChildExecutionId"> & {
272
272
  make: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string & import("effect/Brand").Brand<"Relay.ChildExecutionId">;
273
273
  }>;
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"]>;
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", "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
275
  readonly sequence: Schema.Int;
276
276
  readonly cursor: Schema.String;
277
277
  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
  };
@@ -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";