@relayfx/sdk 0.7.2 → 0.7.4
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/ai.js +1 -1
- package/dist/http-server.js +1 -1
- package/dist/{index-sp77tb7c.js → index-8jjqgjhf.js} +567 -196
- package/dist/{index-qa93yf6j.js → index-etc2cnk2.js} +47 -47
- package/dist/{index-75gb7ftn.js → index-ex8w3c48.js} +1 -1
- package/dist/{index-q7xzf506.js → index-nb078xsy.js} +835 -592
- package/dist/index.js +11 -11
- package/dist/mysql.js +4 -4
- package/dist/postgres.js +4 -4
- package/dist/sqlite.js +4 -4
- package/dist/types/relay/client-child-runs.d.ts +11 -0
- package/dist/types/relay/client-public-executions.d.ts +2 -2
- package/dist/types/relay/client-public.d.ts +2 -0
- package/dist/types/relay/operation.d.ts +282 -5
- package/dist/types/runtime/address/address-resolution-service.d.ts +1 -1
- package/dist/types/runtime/agent/agent-loop-events.d.ts +16 -5
- package/dist/types/runtime/agent/agent-loop-service.d.ts +1 -0
- package/dist/types/runtime/child/spawn-child-run-tool.d.ts +2 -0
- package/dist/types/runtime/workflow/execution-workflow.d.ts +22 -2
- package/dist/types/schema/agent-schema.d.ts +8 -8
- package/dist/types/schema/execution-analytics-schema.d.ts +507 -0
- package/dist/types/schema/execution-schema.d.ts +34 -20
- package/dist/types/store-sql/child/child-fan-out-repository.d.ts +2 -0
- package/package.json +4 -4
|
@@ -87,7 +87,7 @@ export declare const LocalAgentTarget: Schema.Struct<{
|
|
|
87
87
|
};
|
|
88
88
|
readonly turn_policy?: Agent.TurnPolicySnapshot;
|
|
89
89
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
90
|
-
readonly concurrency: Schema.Finite
|
|
90
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
91
91
|
}, "Encoded">;
|
|
92
92
|
readonly compaction_policy?: {
|
|
93
93
|
readonly context_window: number;
|
|
@@ -1,24 +1,35 @@
|
|
|
1
|
+
import type { AgentEvent, ModelTelemetry } from "@batonfx/core";
|
|
1
2
|
import { Content, Execution, Shared, Tool } from "../../schema/index";
|
|
2
3
|
import type { Response } from "effect/unstable/ai";
|
|
3
4
|
import type { RunInput } from "./agent-loop-service";
|
|
5
|
+
declare const legacyTelemetryCursor: (input: RunInput, event: ModelTelemetry.Event) => string;
|
|
6
|
+
declare const legacyUsageCursor: (input: RunInput, event: ModelTelemetry.ModelAttemptCompleted) => string;
|
|
7
|
+
declare const telemetryEvent: (input: RunInput, sessionId: string, event: ModelTelemetry.Event, sequence: number, createdAt: number) => Execution.ExecutionEvent;
|
|
4
8
|
declare const inputPreparedEvent: (input: RunInput, definitions: ReadonlyArray<Tool.Definition>) => Execution.ExecutionEvent;
|
|
5
|
-
declare const usageReportedEvent: (input: RunInput,
|
|
9
|
+
declare const usageReportedEvent: (input: RunInput, sessionId: string, event: ModelTelemetry.ModelAttemptCompleted, sequence: Execution.ExecutionEventSequence, createdAt: number) => Execution.ExecutionEvent;
|
|
6
10
|
declare const budgetExceededEvent: (input: RunInput, tokensUsed: number, tokenBudget: number, sequence: Execution.ExecutionEventSequence) => Execution.ExecutionEvent;
|
|
7
|
-
declare const outputDeltaEvent: (input: RunInput, part: Response.TextDeltaPart, deltaIndex: number) => Execution.ExecutionEvent;
|
|
8
|
-
declare const reasoningDeltaEvent: (input: RunInput, part: Response.ReasoningPart | Response.ReasoningDeltaPart, deltaIndex: number) => Execution.ExecutionEvent;
|
|
9
|
-
declare const toolCallDeltaEvent: (input: RunInput, part: Response.ToolParamsDeltaPart, toolCallName: string | undefined, sequence: Execution.ExecutionEventSequence, deltaIndex: number) => Execution.ExecutionEvent;
|
|
10
|
-
declare const outputCompletedEvent: (input: RunInput, content: ReadonlyArray<Content.Part>, outputText: string, sequence: Execution.ExecutionEventSequence, structuredOutput?: Shared.JsonValue
|
|
11
|
+
declare const outputDeltaEvent: (input: RunInput, modelPart: AgentEvent.ModelPart, part: Response.TextDeltaPart, deltaIndex: number, createdAt: number) => Execution.ExecutionEvent;
|
|
12
|
+
declare const reasoningDeltaEvent: (input: RunInput, modelPart: AgentEvent.ModelPart, part: Response.ReasoningPart | Response.ReasoningDeltaPart, deltaIndex: number, createdAt: number) => Execution.ExecutionEvent;
|
|
13
|
+
declare const toolCallDeltaEvent: (input: RunInput, modelPart: AgentEvent.ModelPart, part: Response.ToolParamsDeltaPart, toolCallName: string | undefined, sequence: Execution.ExecutionEventSequence, deltaIndex: number, createdAt: number) => Execution.ExecutionEvent;
|
|
14
|
+
declare const outputCompletedEvent: (input: RunInput, content: ReadonlyArray<Content.Part>, outputText: string, sequence: Execution.ExecutionEventSequence, structuredOutput?: Shared.JsonValue, structuredIdentity?: {
|
|
15
|
+
readonly modelCallId: string;
|
|
16
|
+
readonly modelAttemptId: string;
|
|
17
|
+
readonly attempt: number;
|
|
18
|
+
}) => Execution.ExecutionEvent;
|
|
11
19
|
declare const completedContent: (outputText: string) => ReadonlyArray<Content.Part>;
|
|
12
20
|
declare const modelOutputMetadata: (event: Execution.ExecutionEvent) => Shared.Metadata;
|
|
13
21
|
export declare const AgentLoopEvents: {
|
|
14
22
|
budgetExceededEvent: typeof budgetExceededEvent;
|
|
15
23
|
completedContent: typeof completedContent;
|
|
16
24
|
inputPreparedEvent: typeof inputPreparedEvent;
|
|
25
|
+
legacyTelemetryCursor: typeof legacyTelemetryCursor;
|
|
26
|
+
legacyUsageCursor: typeof legacyUsageCursor;
|
|
17
27
|
modelOutputMetadata: typeof modelOutputMetadata;
|
|
18
28
|
outputCompletedEvent: typeof outputCompletedEvent;
|
|
19
29
|
outputDeltaEvent: typeof outputDeltaEvent;
|
|
20
30
|
reasoningDeltaEvent: typeof reasoningDeltaEvent;
|
|
21
31
|
toolCallDeltaEvent: typeof toolCallDeltaEvent;
|
|
32
|
+
telemetryEvent: typeof telemetryEvent;
|
|
22
33
|
usageReportedEvent: typeof usageReportedEvent;
|
|
23
34
|
};
|
|
24
35
|
export {};
|
|
@@ -32,6 +32,7 @@ export declare class AgentLoopWaitRequested extends AgentLoopWaitRequested_base
|
|
|
32
32
|
}
|
|
33
33
|
export interface RunInput {
|
|
34
34
|
readonly executionId: Ids.ExecutionId;
|
|
35
|
+
readonly origin?: Execution.ExecutionOrigin;
|
|
35
36
|
readonly sessionId?: Ids.SessionId;
|
|
36
37
|
readonly agent: Agent.Definition;
|
|
37
38
|
readonly agentId?: Ids.AgentId;
|
|
@@ -197,6 +197,7 @@ export interface TransferInput extends Schema.Schema.Type<typeof TransferInput>
|
|
|
197
197
|
}
|
|
198
198
|
export interface DispatchInput {
|
|
199
199
|
readonly executionId: Ids.ExecutionId;
|
|
200
|
+
readonly origin?: Execution.ExecutionOrigin;
|
|
200
201
|
readonly rootAddressId: Ids.AddressId;
|
|
201
202
|
readonly sessionId: Ids.SessionId;
|
|
202
203
|
readonly input: ReadonlyArray<Content.Part>;
|
|
@@ -211,6 +212,7 @@ export interface DispatchInput {
|
|
|
211
212
|
}
|
|
212
213
|
export interface Config {
|
|
213
214
|
readonly agent: Agent.Definition;
|
|
215
|
+
readonly origin?: Execution.ExecutionOrigin;
|
|
214
216
|
readonly agentId: Ids.AgentId;
|
|
215
217
|
readonly agentRevision: Agent.DefinitionRevision;
|
|
216
218
|
readonly agentToolInputSchemaDigests?: Agent.ToolInputSchemaDigests;
|
|
@@ -121,7 +121,7 @@ export declare const StartInput: Schema.Struct<{
|
|
|
121
121
|
};
|
|
122
122
|
readonly turn_policy?: Agent.TurnPolicySnapshot;
|
|
123
123
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
124
|
-
readonly concurrency: Schema.Finite
|
|
124
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
125
125
|
}, "Encoded">;
|
|
126
126
|
readonly compaction_policy?: {
|
|
127
127
|
readonly context_window: number;
|
|
@@ -199,6 +199,16 @@ export declare const StartInput: Schema.Struct<{
|
|
|
199
199
|
}>;
|
|
200
200
|
readonly resume_suspension: Schema.optionalKey<typeof AgentEvent.AgentSuspended>;
|
|
201
201
|
readonly workflow_generation: Schema.optionalKey<Schema.Int>;
|
|
202
|
+
readonly origin: Schema.optionalKey<Schema.Struct<{
|
|
203
|
+
readonly owner_kind: Schema.Literals<readonly ["service", "user", "workflow", "system"]>;
|
|
204
|
+
readonly owner: Schema.String;
|
|
205
|
+
readonly purpose: Schema.String;
|
|
206
|
+
readonly build: Schema.optionalKey<Schema.Struct<{
|
|
207
|
+
readonly name: Schema.String;
|
|
208
|
+
readonly version: Schema.optionalKey<Schema.String>;
|
|
209
|
+
readonly commit: Schema.optionalKey<Schema.String>;
|
|
210
|
+
}>>;
|
|
211
|
+
}>>;
|
|
202
212
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
203
213
|
}>;
|
|
204
214
|
export interface StartInput extends Schema.Schema.Type<typeof StartInput> {
|
|
@@ -409,7 +419,7 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
|
|
|
409
419
|
};
|
|
410
420
|
readonly turn_policy?: Agent.TurnPolicySnapshot;
|
|
411
421
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
412
|
-
readonly concurrency: Schema.Finite
|
|
422
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
413
423
|
}, "Encoded">;
|
|
414
424
|
readonly compaction_policy?: {
|
|
415
425
|
readonly context_window: number;
|
|
@@ -487,6 +497,16 @@ export declare const StartExecutionWorkflow: Workflow.Workflow<"Relay/Execution/
|
|
|
487
497
|
}>;
|
|
488
498
|
readonly resume_suspension: Schema.optionalKey<typeof AgentEvent.AgentSuspended>;
|
|
489
499
|
readonly workflow_generation: Schema.optionalKey<Schema.Int>;
|
|
500
|
+
readonly origin: Schema.optionalKey<Schema.Struct<{
|
|
501
|
+
readonly owner_kind: Schema.Literals<readonly ["service", "user", "workflow", "system"]>;
|
|
502
|
+
readonly owner: Schema.String;
|
|
503
|
+
readonly purpose: Schema.String;
|
|
504
|
+
readonly build: Schema.optionalKey<Schema.Struct<{
|
|
505
|
+
readonly name: Schema.String;
|
|
506
|
+
readonly version: Schema.optionalKey<Schema.String>;
|
|
507
|
+
readonly commit: Schema.optionalKey<Schema.String>;
|
|
508
|
+
}>>;
|
|
509
|
+
}>>;
|
|
490
510
|
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
491
511
|
}>, Schema.Struct<{
|
|
492
512
|
readonly execution_id: Schema.brand<Schema.String, "Relay.ExecutionId"> & {
|
|
@@ -144,7 +144,7 @@ declare const DefinitionSchema: Schema.Struct<{
|
|
|
144
144
|
}>>;
|
|
145
145
|
readonly turn_policy: Schema.optionalKey<Schema.Codec<TurnPolicySnapshot, TurnPolicySnapshot, never, never>>;
|
|
146
146
|
readonly tool_execution: Schema.optionalKey<Schema.Struct<{
|
|
147
|
-
readonly concurrency: Schema.Finite
|
|
147
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
148
148
|
}>>;
|
|
149
149
|
readonly compaction_policy: Schema.optionalKey<Schema.Struct<{
|
|
150
150
|
readonly context_window: Schema.Finite;
|
|
@@ -217,7 +217,7 @@ export interface DefineInput {
|
|
|
217
217
|
readonly permission_rules?: PermissionRuleset;
|
|
218
218
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
219
219
|
readonly tool_execution?: {
|
|
220
|
-
readonly concurrency: number;
|
|
220
|
+
readonly concurrency: number | "unbounded";
|
|
221
221
|
};
|
|
222
222
|
readonly compaction_policy?: CompactionPolicy;
|
|
223
223
|
readonly max_tool_turns?: number;
|
|
@@ -267,7 +267,7 @@ export declare const DefinitionRecord: Schema.Struct<{
|
|
|
267
267
|
};
|
|
268
268
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
269
269
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
270
|
-
readonly concurrency: Schema.Finite
|
|
270
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
271
271
|
}, "Encoded">;
|
|
272
272
|
readonly compaction_policy?: {
|
|
273
273
|
readonly context_window: number;
|
|
@@ -383,7 +383,7 @@ export declare const DefinitionRevisionRecord: Schema.Struct<{
|
|
|
383
383
|
};
|
|
384
384
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
385
385
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
386
|
-
readonly concurrency: Schema.Finite
|
|
386
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
387
387
|
}, "Encoded">;
|
|
388
388
|
readonly compaction_policy?: {
|
|
389
389
|
readonly context_window: number;
|
|
@@ -497,7 +497,7 @@ export declare const RegisterDefinitionPayload: Schema.Struct<{
|
|
|
497
497
|
};
|
|
498
498
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
499
499
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
500
|
-
readonly concurrency: Schema.Finite
|
|
500
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
501
501
|
}, "Encoded">;
|
|
502
502
|
readonly compaction_policy?: {
|
|
503
503
|
readonly context_window: number;
|
|
@@ -611,7 +611,7 @@ export declare const DefinitionRegistered: Schema.Struct<{
|
|
|
611
611
|
};
|
|
612
612
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
613
613
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
614
|
-
readonly concurrency: Schema.Finite
|
|
614
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
615
615
|
}, "Encoded">;
|
|
616
616
|
readonly compaction_policy?: {
|
|
617
617
|
readonly context_window: number;
|
|
@@ -729,7 +729,7 @@ export declare const DefinitionList: Schema.Struct<{
|
|
|
729
729
|
};
|
|
730
730
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
731
731
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
732
|
-
readonly concurrency: Schema.Finite
|
|
732
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
733
733
|
}, "Encoded">;
|
|
734
734
|
readonly compaction_policy?: {
|
|
735
735
|
readonly context_window: number;
|
|
@@ -847,7 +847,7 @@ export declare const DefinitionRevisionList: Schema.Struct<{
|
|
|
847
847
|
};
|
|
848
848
|
readonly turn_policy?: TurnPolicySnapshot;
|
|
849
849
|
readonly tool_execution?: Schema.Struct.ReadonlySide<{
|
|
850
|
-
readonly concurrency: Schema.Finite
|
|
850
|
+
readonly concurrency: Schema.Union<readonly [Schema.Finite, Schema.Literal<"unbounded">]>;
|
|
851
851
|
}, "Encoded">;
|
|
852
852
|
readonly compaction_policy?: {
|
|
853
853
|
readonly context_window: number;
|