@modelrelay/sdk 2.1.0 → 4.0.0

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 (42) hide show
  1. package/dist/api-Bitsm1tl.d.cts +5290 -0
  2. package/dist/api-Bitsm1tl.d.ts +5290 -0
  3. package/dist/{api-Ct5bpI3U.d.cts → api-CzFaWgs_.d.cts} +2636 -2113
  4. package/dist/{api-Ct5bpI3U.d.ts → api-CzFaWgs_.d.ts} +2636 -2113
  5. package/dist/{api-Bb7sw9L4.d.cts → api-D0wnVpwn.d.cts} +2598 -2148
  6. package/dist/{api-Bb7sw9L4.d.ts → api-D0wnVpwn.d.ts} +2598 -2148
  7. package/dist/billing/index.d.cts +1 -1
  8. package/dist/billing/index.d.ts +1 -1
  9. package/dist/{chunk-AZD5EKLV.js → chunk-5O4NJXLJ.js} +1 -1
  10. package/dist/{chunk-4FXUTSRZ.js → chunk-ADQ74R7T.js} +1 -1
  11. package/dist/{chunk-CXJZB6MA.js → chunk-CV3DTA6P.js} +1 -1
  12. package/dist/{chunk-VOFLESGQ.js → chunk-EMQKOEF3.js} +10 -8
  13. package/dist/{chunk-R6O6UQYM.js → chunk-JZRSCFQH.js} +1 -1
  14. package/dist/{chunk-MXXJDLGU.js → chunk-LW6SC7NQ.js} +2 -63
  15. package/dist/index.cjs +58 -51
  16. package/dist/index.d.cts +27 -21
  17. package/dist/index.d.ts +27 -21
  18. package/dist/index.js +58 -51
  19. package/dist/node.cjs +1 -1
  20. package/dist/node.js +1 -1
  21. package/dist/{tools-B7444ZtV.d.cts → tools-DAqAFZ8F.d.cts} +11 -13
  22. package/dist/{tools-B7444ZtV.d.ts → tools-DAqAFZ8F.d.ts} +11 -13
  23. package/package.json +1 -1
  24. package/dist/api-DWUVls-S.d.cts +0 -4762
  25. package/dist/api-DWUVls-S.d.ts +0 -4762
  26. package/dist/api-DZpC1zuz.d.cts +0 -4691
  27. package/dist/api-DZpC1zuz.d.ts +0 -4691
  28. package/dist/api-D_hE36Ps.d.cts +0 -4535
  29. package/dist/api-D_hE36Ps.d.ts +0 -4535
  30. package/dist/api-Dz9HcUTt.d.cts +0 -4522
  31. package/dist/api-Dz9HcUTt.d.ts +0 -4522
  32. package/dist/chunk-BP5HUQ4M.js +0 -1194
  33. package/dist/chunk-CYGWZYYJ.js +0 -1194
  34. package/dist/chunk-PLZWDUOP.js +0 -1194
  35. package/dist/chunk-SCOP57J4.js +0 -1194
  36. package/dist/chunk-SXNP5Y5L.js +0 -1194
  37. package/dist/tools-CWEBFsql.d.cts +0 -1192
  38. package/dist/tools-CWEBFsql.d.ts +0 -1192
  39. package/dist/tools-CvfwPjC5.d.cts +0 -1098
  40. package/dist/tools-CvfwPjC5.d.ts +0 -1098
  41. package/dist/tools-DUYHZdZP.d.cts +0 -982
  42. package/dist/tools-DUYHZdZP.d.ts +0 -982
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { A as ApiKey, R as RetryConfig, M as MetricsCallbacks, T as TraceCallbacks, a as RequestContext, b as TokenProvider, C as CustomerTokenRequest, c as CustomerToken, G as GetOrCreateCustomerTokenRequest, P as ProviderId, d as ModelId, I as InputItem, O as OutputFormat, e as Tool, f as ToolChoice, Z as ZodLikeSchema, g as ResponseEvent, h as Response$1, S as StructuredJSONEvent, F as FieldError, i as RetryMetadata, j as TransportErrorKind, k as ToolRegistry, l as ToolExecutionResult, m as TierCode, n as SecretKey, o as ModelRelayKeyOptions, p as ModelRelayOptions } from './tools-bCt1QwNk.js';
2
2
  export { ba as APICheckoutSession, b9 as APICustomerRef, bd as APIKey, bc as APIResponsesResponse, bb as APIUsage, ak as BillingProvider, aj as BillingProviders, aT as Citation, aL as CodeExecConfig, ay as ContentPart, ax as ContentPartType, aw as ContentPartTypes, al as CustomerMetadata, D as DEFAULT_BASE_URL, a7 as DEFAULT_CLIENT_HEADER, a8 as DEFAULT_CONNECT_TIMEOUT_MS, a9 as DEFAULT_REQUEST_TIMEOUT_MS, b8 as DeepPartial, aO as FunctionCall, b6 as FunctionCallDelta, aI as FunctionTool, aU as HttpRequestMetrics, aA as InputItemType, az as InputItemTypes, aS as JSONSchemaFormat, a2 as JsonSchemaOptions, ac as KnownStopReason, b3 as MessageDeltaData, av as MessageRole, au as MessageRoles, b2 as MessageStartData, b4 as MessageStopData, am as ModelRelayBaseOptions, an as ModelRelayTokenOptions, ao as ModelRelayTokenProviderOptions, aa as NonEmptyArray, aR as OutputFormatType, aQ as OutputFormatTypes, aD as OutputItem, aC as OutputItemType, aB as OutputItemTypes, at as Project, b1 as ResponseEventType, a5 as RetryOptions, a6 as SDK_VERSION, a3 as Schema, ad as StopReason, ab as StopReasons, aV as StreamFirstTokenMetrics, b7 as StructuredJSONRecordType, ai as SubscriptionStatusKind, ah as SubscriptionStatuses, ap as TokenType, aW as TokenUsageMetrics, X as ToolArgsError, aP as ToolCall, N as ToolCallAccumulator, b5 as ToolCallDelta, aN as ToolChoiceType, aM as ToolChoiceTypes, a4 as ToolHandler, aF as ToolType, aE as ToolTypes, aq as Usage, as as UsageSummary, aJ as WebSearchConfig, aH as WebToolIntent, aG as WebToolIntents, aK as XSearchConfig, af as asModelId, ae as asProviderId, ag as asTierCode, J as assistantMessageWithToolCalls, z as createAssistantMessage, L as createFunctionCall, q as createFunctionTool, r as createFunctionToolFromSchema, a0 as createRetryMessages, B as createSystemMessage, K as createToolCall, ar as createUsage, y as createUserMessage, s as createWebTool, a1 as executeWithRetry, x as firstToolCall, Y as formatToolErrorForModel, $ as getRetryableErrors, _ as hasRetryableErrors, w as hasToolCalls, aX as mergeMetrics, aY as mergeTrace, b0 as modelToString, a$ as normalizeModelId, aZ as normalizeStopReason, U as parseToolArgs, W as parseToolArgsRaw, H as respondToToolCall, a_ as stopReasonToString, t as toolChoiceAuto, v as toolChoiceNone, u as toolChoiceRequired, E as toolResultMessage, V as tryParseToolArgs, Q as zodToJsonSchema } from './tools-bCt1QwNk.js';
3
- import { c as components, $ as $defs, o as operations, p as paths, w as webhooks } from './api-D_hE36Ps.js';
3
+ import { c as components, $ as $defs, o as operations, p as paths, w as webhooks } from './api-Bitsm1tl.js';
4
4
 
5
5
  interface RequestOptions {
6
6
  method?: string;
@@ -819,6 +819,10 @@ type TokenUsageV0$1 = {
819
819
  output_tokens?: number;
820
820
  total_tokens?: number;
821
821
  };
822
+ type PayloadArtifactV0$1 = {
823
+ artifact_key: string;
824
+ info: PayloadInfoV0$1;
825
+ };
822
826
  type NodeLLMCallV0$1 = {
823
827
  step: number;
824
828
  request_id: string;
@@ -828,7 +832,12 @@ type NodeLLMCallV0$1 = {
828
832
  stop_reason?: string;
829
833
  usage?: TokenUsageV0$1;
830
834
  };
831
- type FunctionToolCallV0$1 = {
835
+ type ToolCallV0$1 = {
836
+ id: string;
837
+ name: string;
838
+ arguments?: string;
839
+ };
840
+ type ToolCallWithArgumentsV0$1 = {
832
841
  id: string;
833
842
  name: string;
834
843
  arguments: string;
@@ -836,19 +845,17 @@ type FunctionToolCallV0$1 = {
836
845
  type NodeToolCallV0$1 = {
837
846
  step: number;
838
847
  request_id: string;
839
- tool_call: FunctionToolCallV0$1;
848
+ tool_call: ToolCallWithArgumentsV0$1;
840
849
  };
841
850
  type NodeToolResultV0$1 = {
842
851
  step: number;
843
852
  request_id: string;
844
- tool_call_id: string;
845
- name: string;
853
+ tool_call: ToolCallV0$1;
846
854
  output: string;
855
+ error?: string;
847
856
  };
848
857
  type PendingToolCallV0$1 = {
849
- tool_call_id: string;
850
- name: string;
851
- arguments: string;
858
+ tool_call: ToolCallWithArgumentsV0$1;
852
859
  };
853
860
  type NodeWaitingV0$1 = {
854
861
  step: number;
@@ -857,7 +864,7 @@ type NodeWaitingV0$1 = {
857
864
  reason: string;
858
865
  };
859
866
  type RunEventBaseV0 = {
860
- envelope_version: "v0";
867
+ envelope_version: "v2";
861
868
  run_id: RunId$1;
862
869
  seq: number;
863
870
  ts: string;
@@ -873,8 +880,7 @@ type RunEventRunStartedV0 = RunEventBaseV0 & {
873
880
  type RunEventRunCompletedV0 = RunEventBaseV0 & {
874
881
  type: "run_completed";
875
882
  plan_hash: PlanHash$1;
876
- outputs_artifact_key: string;
877
- outputs_info: PayloadInfoV0$1;
883
+ outputs: PayloadArtifactV0$1;
878
884
  };
879
885
  type RunEventRunFailedV0 = RunEventBaseV0 & {
880
886
  type: "run_failed";
@@ -927,8 +933,7 @@ type RunEventNodeOutputDeltaV0 = RunEventBaseV0 & {
927
933
  type RunEventNodeOutputV0 = RunEventBaseV0 & {
928
934
  type: "node_output";
929
935
  node_id: NodeId$1;
930
- artifact_key: string;
931
- output_info: PayloadInfoV0$1;
936
+ output: PayloadArtifactV0$1;
932
937
  };
933
938
  type RunEventV0 = RunEventRunCompiledV0 | RunEventRunStartedV0 | RunEventRunCompletedV0 | RunEventRunFailedV0 | RunEventRunCanceledV0 | RunEventNodeLLMCallV0 | RunEventNodeToolCallV0 | RunEventNodeToolResultV0 | RunEventNodeWaitingV0 | RunEventNodeStartedV0 | RunEventNodeSucceededV0 | RunEventNodeFailedV0 | RunEventNodeOutputDeltaV0 | RunEventNodeOutputV0;
934
939
 
@@ -938,8 +943,7 @@ type RunsToolResultsRequest = {
938
943
  step: number;
939
944
  request_id: string;
940
945
  results: Array<{
941
- tool_call_id: string;
942
- name: string;
946
+ tool_call: ToolCallV0$1;
943
947
  output: string;
944
948
  }>;
945
949
  };
@@ -954,9 +958,7 @@ type RunsPendingToolsResponse = {
954
958
  step: number;
955
959
  request_id: string;
956
960
  tool_calls: Array<{
957
- tool_call_id: string;
958
- name: string;
959
- arguments: string;
961
+ tool_call: ToolCallWithArgumentsV0$1;
960
962
  }>;
961
963
  }>;
962
964
  };
@@ -2996,9 +2998,11 @@ type NodeToolCallV0 = NodeToolCallV0$1;
2996
2998
  type NodeToolResultV0 = NodeToolResultV0$1;
2997
2999
  type NodeWaitingV0 = NodeWaitingV0$1;
2998
3000
  type PendingToolCallV0 = PendingToolCallV0$1;
2999
- type FunctionToolCallV0 = FunctionToolCallV0$1;
3001
+ type ToolCallV0 = ToolCallV0$1;
3002
+ type ToolCallWithArgumentsV0 = ToolCallWithArgumentsV0$1;
3000
3003
  type TokenUsageV0 = TokenUsageV0$1;
3001
3004
  type PayloadInfoV0 = PayloadInfoV0$1;
3005
+ type PayloadArtifactV0 = PayloadArtifactV0$1;
3002
3006
  type StreamEventKind = StreamEventKind$1;
3003
3007
  declare const KindV1: "workflow.v1";
3004
3008
  declare const NodeTypesV1: {
@@ -3050,7 +3054,6 @@ type index_EventV0 = EventV0;
3050
3054
  type index_FanoutReduceConfigV1 = FanoutReduceConfigV1;
3051
3055
  type index_FanoutReduceV1 = FanoutReduceV1;
3052
3056
  declare const index_FanoutReduceV1: typeof FanoutReduceV1;
3053
- type index_FunctionToolCallV0 = FunctionToolCallV0;
3054
3057
  type index_Kind = Kind;
3055
3058
  declare const index_KindV1: typeof KindV1;
3056
3059
  declare const index_LLM_TEXT_OUTPUT: typeof LLM_TEXT_OUTPUT;
@@ -3067,6 +3070,7 @@ type index_NodeV1 = NodeV1;
3067
3070
  type index_NodeWaitingV0 = NodeWaitingV0;
3068
3071
  type index_OutputName = OutputName;
3069
3072
  type index_OutputRefV1 = OutputRefV1;
3073
+ type index_PayloadArtifactV0 = PayloadArtifactV0;
3070
3074
  type index_PayloadInfoV0 = PayloadInfoV0;
3071
3075
  type index_PendingToolCallV0 = PendingToolCallV0;
3072
3076
  type index_PlanHash = PlanHash;
@@ -3079,6 +3083,8 @@ type index_SpecV1 = SpecV1;
3079
3083
  type index_StatusV0 = StatusV0;
3080
3084
  type index_StreamEventKind = StreamEventKind;
3081
3085
  type index_TokenUsageV0 = TokenUsageV0;
3086
+ type index_ToolCallV0 = ToolCallV0;
3087
+ type index_ToolCallWithArgumentsV0 = ToolCallWithArgumentsV0;
3082
3088
  type index_ToolExecutionModeV1 = ToolExecutionModeV1;
3083
3089
  declare const index_ToolExecutionModes: typeof ToolExecutionModes;
3084
3090
  type index_ToolExecutionV1 = ToolExecutionV1;
@@ -3100,7 +3106,7 @@ declare const index_whenStatusExists: typeof whenStatusExists;
3100
3106
  declare const index_whenStatusMatches: typeof whenStatusMatches;
3101
3107
  declare const index_workflowV1: typeof workflowV1;
3102
3108
  declare namespace index {
3103
- export { index_BindingBuilder as BindingBuilder, type index_BindingEncodingV1 as BindingEncodingV1, index_BindingEncodings as BindingEncodings, type index_BindingOptions as BindingOptions, type index_BindingV1 as BindingV1, type index_ConditionOpV1 as ConditionOpV1, type index_ConditionSourceV1 as ConditionSourceV1, type index_ConditionV1 as ConditionV1, type index_EdgeV1 as EdgeV1, type index_EventBaseV0 as EventBaseV0, type index_EventNodeFailedV0 as EventNodeFailedV0, type index_EventNodeLLMCallV0 as EventNodeLLMCallV0, type index_EventNodeOutputDeltaV0 as EventNodeOutputDeltaV0, type index_EventNodeOutputV0 as EventNodeOutputV0, type index_EventNodeStartedV0 as EventNodeStartedV0, type index_EventNodeSucceededV0 as EventNodeSucceededV0, type index_EventNodeToolCallV0 as EventNodeToolCallV0, type index_EventNodeToolResultV0 as EventNodeToolResultV0, type index_EventNodeWaitingV0 as EventNodeWaitingV0, type index_EventRunCanceledV0 as EventRunCanceledV0, type index_EventRunCompiledV0 as EventRunCompiledV0, type index_EventRunCompletedV0 as EventRunCompletedV0, type index_EventRunFailedV0 as EventRunFailedV0, type index_EventRunStartedV0 as EventRunStartedV0, type index_EventTypeV0 as EventTypeV0, type index_EventV0 as EventV0, type index_FanoutReduceConfigV1 as FanoutReduceConfigV1, index_FanoutReduceV1 as FanoutReduceV1, type index_FunctionToolCallV0 as FunctionToolCallV0, type index_Kind as Kind, index_KindV1 as KindV1, index_LLM_TEXT_OUTPUT as LLM_TEXT_OUTPUT, index_LLM_USER_MESSAGE_TEXT as LLM_USER_MESSAGE_TEXT, type index_NodeErrorV0 as NodeErrorV0, type index_NodeId as NodeId, type index_NodeLLMCallV0 as NodeLLMCallV0, type index_NodeOutputDeltaV0 as NodeOutputDeltaV0, type index_NodeToolCallV0 as NodeToolCallV0, type index_NodeToolResultV0 as NodeToolResultV0, type index_NodeTypeV1 as NodeTypeV1, index_NodeTypesV1 as NodeTypesV1, type index_NodeV1 as NodeV1, type index_NodeWaitingV0 as NodeWaitingV0, type index_OutputName as OutputName, type index_OutputRefV1 as OutputRefV1, type index_PayloadInfoV0 as PayloadInfoV0, type index_PendingToolCallV0 as PendingToolCallV0, type index_PlanHash as PlanHash, type index_RouterConfigV1 as RouterConfigV1, type index_RouterRouteV1 as RouterRouteV1, index_RouterV1 as RouterV1, type index_RunId as RunId, type index_SpecV1 as SpecV1, type index_StatusV0 as StatusV0, type index_StreamEventKind as StreamEventKind, type index_TokenUsageV0 as TokenUsageV0, type index_ToolExecutionModeV1 as ToolExecutionModeV1, index_ToolExecutionModes as ToolExecutionModes, type index_ToolExecutionV1 as ToolExecutionV1, type index_ToolLimitsV1 as ToolLimitsV1, index_WorkflowBuilderV1 as WorkflowBuilderV1, index_bindFrom as bindFrom, index_bindToPlaceholder as bindToPlaceholder, index_bindToPointer as bindToPointer, index_parseNodeId as parseNodeId, index_parseOutputName as parseOutputName, index_parsePlanHash as parsePlanHash, index_parseRunId as parseRunId, index_whenOutputEquals as whenOutputEquals, index_whenOutputExists as whenOutputExists, index_whenOutputMatches as whenOutputMatches, index_whenStatusEquals as whenStatusEquals, index_whenStatusExists as whenStatusExists, index_whenStatusMatches as whenStatusMatches, index_workflowV1 as workflowV1 };
3109
+ export { index_BindingBuilder as BindingBuilder, type index_BindingEncodingV1 as BindingEncodingV1, index_BindingEncodings as BindingEncodings, type index_BindingOptions as BindingOptions, type index_BindingV1 as BindingV1, type index_ConditionOpV1 as ConditionOpV1, type index_ConditionSourceV1 as ConditionSourceV1, type index_ConditionV1 as ConditionV1, type index_EdgeV1 as EdgeV1, type index_EventBaseV0 as EventBaseV0, type index_EventNodeFailedV0 as EventNodeFailedV0, type index_EventNodeLLMCallV0 as EventNodeLLMCallV0, type index_EventNodeOutputDeltaV0 as EventNodeOutputDeltaV0, type index_EventNodeOutputV0 as EventNodeOutputV0, type index_EventNodeStartedV0 as EventNodeStartedV0, type index_EventNodeSucceededV0 as EventNodeSucceededV0, type index_EventNodeToolCallV0 as EventNodeToolCallV0, type index_EventNodeToolResultV0 as EventNodeToolResultV0, type index_EventNodeWaitingV0 as EventNodeWaitingV0, type index_EventRunCanceledV0 as EventRunCanceledV0, type index_EventRunCompiledV0 as EventRunCompiledV0, type index_EventRunCompletedV0 as EventRunCompletedV0, type index_EventRunFailedV0 as EventRunFailedV0, type index_EventRunStartedV0 as EventRunStartedV0, type index_EventTypeV0 as EventTypeV0, type index_EventV0 as EventV0, type index_FanoutReduceConfigV1 as FanoutReduceConfigV1, index_FanoutReduceV1 as FanoutReduceV1, type index_Kind as Kind, index_KindV1 as KindV1, index_LLM_TEXT_OUTPUT as LLM_TEXT_OUTPUT, index_LLM_USER_MESSAGE_TEXT as LLM_USER_MESSAGE_TEXT, type index_NodeErrorV0 as NodeErrorV0, type index_NodeId as NodeId, type index_NodeLLMCallV0 as NodeLLMCallV0, type index_NodeOutputDeltaV0 as NodeOutputDeltaV0, type index_NodeToolCallV0 as NodeToolCallV0, type index_NodeToolResultV0 as NodeToolResultV0, type index_NodeTypeV1 as NodeTypeV1, index_NodeTypesV1 as NodeTypesV1, type index_NodeV1 as NodeV1, type index_NodeWaitingV0 as NodeWaitingV0, type index_OutputName as OutputName, type index_OutputRefV1 as OutputRefV1, type index_PayloadArtifactV0 as PayloadArtifactV0, type index_PayloadInfoV0 as PayloadInfoV0, type index_PendingToolCallV0 as PendingToolCallV0, type index_PlanHash as PlanHash, type index_RouterConfigV1 as RouterConfigV1, type index_RouterRouteV1 as RouterRouteV1, index_RouterV1 as RouterV1, type index_RunId as RunId, type index_SpecV1 as SpecV1, type index_StatusV0 as StatusV0, type index_StreamEventKind as StreamEventKind, type index_TokenUsageV0 as TokenUsageV0, type index_ToolCallV0 as ToolCallV0, type index_ToolCallWithArgumentsV0 as ToolCallWithArgumentsV0, type index_ToolExecutionModeV1 as ToolExecutionModeV1, index_ToolExecutionModes as ToolExecutionModes, type index_ToolExecutionV1 as ToolExecutionV1, type index_ToolLimitsV1 as ToolLimitsV1, index_WorkflowBuilderV1 as WorkflowBuilderV1, index_bindFrom as bindFrom, index_bindToPlaceholder as bindToPlaceholder, index_bindToPointer as bindToPointer, index_parseNodeId as parseNodeId, index_parseOutputName as parseOutputName, index_parsePlanHash as parsePlanHash, index_parseRunId as parseRunId, index_whenOutputEquals as whenOutputEquals, index_whenOutputExists as whenOutputExists, index_whenOutputMatches as whenOutputMatches, index_whenStatusEquals as whenStatusEquals, index_whenStatusExists as whenStatusExists, index_whenStatusMatches as whenStatusMatches, index_workflowV1 as workflowV1 };
3104
3110
  }
3105
3111
 
3106
3112
  /**
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ import {
64
64
  toolResultMessage,
65
65
  tryParseToolArgs,
66
66
  zodToJsonSchema
67
- } from "./chunk-AZD5EKLV.js";
67
+ } from "./chunk-5O4NJXLJ.js";
68
68
  import {
69
69
  __export
70
70
  } from "./chunk-MLKGABMK.js";
@@ -1747,7 +1747,7 @@ var ResponsesClient = class {
1747
1747
 
1748
1748
  // src/runs_request.ts
1749
1749
  var RUNS_PATH = "/runs";
1750
- var RUN_EVENT_V0_SCHEMA_PATH = "/schemas/run_event_v0.schema.json";
1750
+ var RUN_EVENT_V0_SCHEMA_PATH = "/schemas/run_event.schema.json";
1751
1751
  function runByIdPath(runId) {
1752
1752
  return `${RUNS_PATH}/${encodeURIComponent(runId)}`;
1753
1753
  }
@@ -1824,6 +1824,10 @@ var payloadInfoSchema = z.object({
1824
1824
  sha256: z.string().min(1),
1825
1825
  included: z.boolean()
1826
1826
  }).strict();
1827
+ var payloadArtifactSchema = z.object({
1828
+ artifact_key: z.string().min(1),
1829
+ info: payloadInfoSchema
1830
+ }).strict();
1827
1831
  var nodeOutputDeltaSchema = z.object({
1828
1832
  kind: z.string().min(1),
1829
1833
  text_delta: z.string().optional(),
@@ -1844,27 +1848,28 @@ var nodeLLMCallSchema = z.object({
1844
1848
  stop_reason: z.string().optional(),
1845
1849
  usage: tokenUsageSchema.optional()
1846
1850
  }).strict();
1847
- var functionToolCallSchema = z.object({
1851
+ var toolCallSchema = z.object({
1848
1852
  id: z.string().min(1),
1849
1853
  name: z.string().min(1),
1850
- arguments: z.string()
1854
+ arguments: z.string().optional()
1851
1855
  }).strict();
1856
+ var toolCallWithArgumentsSchema = toolCallSchema.extend({
1857
+ arguments: z.string()
1858
+ });
1852
1859
  var nodeToolCallSchema = z.object({
1853
1860
  step: z.number().int().nonnegative(),
1854
1861
  request_id: z.string().min(1),
1855
- tool_call: functionToolCallSchema
1862
+ tool_call: toolCallWithArgumentsSchema
1856
1863
  }).strict();
1857
1864
  var nodeToolResultSchema = z.object({
1858
1865
  step: z.number().int().nonnegative(),
1859
1866
  request_id: z.string().min(1),
1860
- tool_call_id: z.string().min(1),
1861
- name: z.string().min(1),
1862
- output: z.string()
1867
+ tool_call: toolCallSchema,
1868
+ output: z.string(),
1869
+ error: z.string().optional()
1863
1870
  }).strict();
1864
1871
  var pendingToolCallSchema = z.object({
1865
- tool_call_id: z.string().min(1),
1866
- name: z.string().min(1),
1867
- arguments: z.string()
1872
+ tool_call: toolCallWithArgumentsSchema
1868
1873
  }).strict();
1869
1874
  var nodeWaitingSchema = z.object({
1870
1875
  step: z.number().int().nonnegative(),
@@ -1873,7 +1878,7 @@ var nodeWaitingSchema = z.object({
1873
1878
  reason: z.string().min(1)
1874
1879
  }).strict();
1875
1880
  var baseSchema = {
1876
- envelope_version: z.literal("v0").optional().default("v0"),
1881
+ envelope_version: z.literal("v2").optional().default("v2"),
1877
1882
  run_id: z.string().min(1),
1878
1883
  seq: z.number().int().min(1),
1879
1884
  ts: z.string().min(1)
@@ -1885,8 +1890,7 @@ var runEventWireSchema = z.discriminatedUnion("type", [
1885
1890
  ...baseSchema,
1886
1891
  type: z.literal("run_completed"),
1887
1892
  plan_hash: z.string().min(1),
1888
- outputs_artifact_key: z.string().min(1),
1889
- outputs_info: payloadInfoSchema
1893
+ outputs: payloadArtifactSchema
1890
1894
  }).strict(),
1891
1895
  z.object({
1892
1896
  ...baseSchema,
@@ -1942,23 +1946,22 @@ var runEventWireSchema = z.discriminatedUnion("type", [
1942
1946
  ...baseSchema,
1943
1947
  type: z.literal("node_output"),
1944
1948
  node_id: z.string().min(1),
1945
- artifact_key: z.string().min(1),
1946
- output_info: payloadInfoSchema
1949
+ output: payloadArtifactSchema
1947
1950
  }).strict()
1948
1951
  ]).superRefine((v, ctx) => {
1949
1952
  if (v.type === "node_output") {
1950
- if (v.output_info.included !== false) {
1953
+ if (v.output.info.included !== false) {
1951
1954
  ctx.addIssue({
1952
1955
  code: z.ZodIssueCode.custom,
1953
- message: "node_output output_info.included must be false"
1956
+ message: "node_output output.info.included must be false"
1954
1957
  });
1955
1958
  }
1956
1959
  }
1957
1960
  if (v.type === "run_completed") {
1958
- if (v.outputs_info.included !== false) {
1961
+ if (v.outputs.info.included !== false) {
1959
1962
  ctx.addIssue({
1960
1963
  code: z.ZodIssueCode.custom,
1961
- message: "run_completed outputs_info.included must be false"
1964
+ message: "run_completed outputs.info.included must be false"
1962
1965
  });
1963
1966
  }
1964
1967
  }
@@ -1977,7 +1980,7 @@ function parseRunEventV0(line) {
1977
1980
  );
1978
1981
  }
1979
1982
  const base = {
1980
- envelope_version: "v0",
1983
+ envelope_version: "v2",
1981
1984
  run_id: parseRunId(res.data.run_id),
1982
1985
  seq: res.data.seq,
1983
1986
  ts: res.data.ts
@@ -1992,8 +1995,7 @@ function parseRunEventV0(line) {
1992
1995
  ...base,
1993
1996
  type: "run_completed",
1994
1997
  plan_hash: parsePlanHash(res.data.plan_hash),
1995
- outputs_artifact_key: res.data.outputs_artifact_key,
1996
- outputs_info: res.data.outputs_info
1998
+ outputs: res.data.outputs
1997
1999
  };
1998
2000
  case "run_failed":
1999
2001
  return {
@@ -2040,8 +2042,7 @@ function parseRunEventV0(line) {
2040
2042
  ...base,
2041
2043
  type: "node_output",
2042
2044
  node_id: parseNodeId(res.data.node_id),
2043
- artifact_key: res.data.artifact_key,
2044
- output_info: res.data.output_info
2045
+ output: res.data.output
2045
2046
  };
2046
2047
  default:
2047
2048
  throw new TransportError(`Unknown run event type: ${res.data.type}`, { kind: "request" });
@@ -2917,8 +2918,10 @@ var LocalSession = class _LocalSession {
2917
2918
  step: this.currentWaiting.step,
2918
2919
  request_id: this.currentWaiting.request_id,
2919
2920
  results: results.map((r) => ({
2920
- tool_call_id: r.toolCallId,
2921
- name: r.toolName,
2921
+ tool_call: {
2922
+ id: r.toolCallId,
2923
+ name: r.toolName
2924
+ },
2922
2925
  output: r.error ? `Error: ${r.error}` : typeof r.result === "string" ? r.result : JSON.stringify(r.result)
2923
2926
  }))
2924
2927
  });
@@ -3059,9 +3062,9 @@ var LocalSession = class _LocalSession {
3059
3062
  return {
3060
3063
  status: "waiting_for_tools",
3061
3064
  pendingTools: event.waiting.pending_tool_calls.map((tc) => ({
3062
- toolCallId: tc.tool_call_id,
3063
- name: tc.name,
3064
- arguments: tc.arguments
3065
+ toolCallId: tc.tool_call.id,
3066
+ name: tc.tool_call.name,
3067
+ arguments: tc.tool_call.arguments
3065
3068
  })),
3066
3069
  runId: this.currentRunId,
3067
3070
  usage: this.currentUsage,
@@ -3122,19 +3125,19 @@ var LocalSession = class _LocalSession {
3122
3125
  for (const pending of pendingTools) {
3123
3126
  try {
3124
3127
  const result = await this.toolRegistry.execute({
3125
- id: pending.tool_call_id,
3128
+ id: pending.tool_call.id,
3126
3129
  type: "function",
3127
3130
  function: {
3128
- name: pending.name,
3129
- arguments: pending.arguments
3131
+ name: pending.tool_call.name,
3132
+ arguments: pending.tool_call.arguments
3130
3133
  }
3131
3134
  });
3132
3135
  results.push(result);
3133
3136
  } catch (err) {
3134
3137
  const error = err instanceof Error ? err : new Error(String(err));
3135
3138
  results.push({
3136
- toolCallId: pending.tool_call_id,
3137
- toolName: pending.name,
3139
+ toolCallId: pending.tool_call.id,
3140
+ toolName: pending.tool_call.name,
3138
3141
  result: null,
3139
3142
  error: error.message
3140
3143
  });
@@ -3414,8 +3417,10 @@ var RemoteSession = class _RemoteSession {
3414
3417
  step: this.currentWaiting.step,
3415
3418
  request_id: this.currentWaiting.request_id,
3416
3419
  results: results.map((r) => ({
3417
- tool_call_id: r.toolCallId,
3418
- name: r.toolName,
3420
+ tool_call: {
3421
+ id: r.toolCallId,
3422
+ name: r.toolName
3423
+ },
3419
3424
  output: r.error ? `Error: ${r.error}` : typeof r.result === "string" ? r.result : JSON.stringify(r.result)
3420
3425
  }))
3421
3426
  });
@@ -3542,9 +3547,9 @@ var RemoteSession = class _RemoteSession {
3542
3547
  status: "waiting_for_tools",
3543
3548
  pendingTools: event.waiting.pending_tool_calls.map(
3544
3549
  (tc) => ({
3545
- toolCallId: tc.tool_call_id,
3546
- name: tc.name,
3547
- arguments: tc.arguments
3550
+ toolCallId: tc.tool_call.id,
3551
+ name: tc.tool_call.name,
3552
+ arguments: tc.tool_call.arguments
3548
3553
  })
3549
3554
  ),
3550
3555
  runId: this.currentRunId,
@@ -3618,18 +3623,18 @@ var RemoteSession = class _RemoteSession {
3618
3623
  async executeToolsLocally(toolCalls) {
3619
3624
  if (!this.toolRegistry) return null;
3620
3625
  for (const tc of toolCalls) {
3621
- if (!this.toolRegistry.has(tc.name)) {
3626
+ if (!this.toolRegistry.has(tc.tool_call.name)) {
3622
3627
  return null;
3623
3628
  }
3624
3629
  }
3625
3630
  const results = [];
3626
3631
  for (const tc of toolCalls) {
3627
3632
  const toolCall = {
3628
- id: tc.tool_call_id,
3633
+ id: tc.tool_call.id,
3629
3634
  type: "function",
3630
3635
  function: {
3631
- name: tc.name,
3632
- arguments: tc.arguments
3636
+ name: tc.tool_call.name,
3637
+ arguments: tc.tool_call.arguments
3633
3638
  }
3634
3639
  };
3635
3640
  const result = await this.toolRegistry.execute(toolCall);
@@ -4888,9 +4893,9 @@ var ToolRunner = class {
4888
4893
  try {
4889
4894
  await this.onBeforeExecute?.(pending);
4890
4895
  const toolCall = createToolCall(
4891
- pending.tool_call_id,
4892
- pending.name,
4893
- pending.arguments
4896
+ pending.tool_call.id,
4897
+ pending.tool_call.name,
4898
+ pending.tool_call.arguments
4894
4899
  );
4895
4900
  const result = await this.registry.execute(toolCall);
4896
4901
  results.push(result);
@@ -4899,8 +4904,8 @@ var ToolRunner = class {
4899
4904
  const error = err instanceof Error ? err : new Error(String(err));
4900
4905
  await this.onError?.(error, pending);
4901
4906
  results.push({
4902
- toolCallId: pending.tool_call_id,
4903
- toolName: pending.name,
4907
+ toolCallId: pending.tool_call.id,
4908
+ toolName: pending.tool_call.name,
4904
4909
  result: null,
4905
4910
  error: error.message
4906
4911
  });
@@ -4913,8 +4918,10 @@ var ToolRunner = class {
4913
4918
  step: waiting.step,
4914
4919
  request_id: waiting.request_id,
4915
4920
  results: results.map((r) => ({
4916
- tool_call_id: r.toolCallId,
4917
- name: r.toolName,
4921
+ tool_call: {
4922
+ id: r.toolCallId,
4923
+ name: r.toolName
4924
+ },
4918
4925
  output: r.error ? `Error: ${r.error}` : typeof r.result === "string" ? r.result : JSON.stringify(r.result)
4919
4926
  }))
4920
4927
  },
package/dist/node.cjs CHANGED
@@ -52,7 +52,7 @@ var import_child_process = require("child_process");
52
52
  // package.json
53
53
  var package_default = {
54
54
  name: "@modelrelay/sdk",
55
- version: "2.1.0",
55
+ version: "4.0.0",
56
56
  description: "TypeScript SDK for the ModelRelay API",
57
57
  type: "module",
58
58
  main: "dist/index.cjs",
package/dist/node.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  ToolArgumentError,
4
4
  ToolRegistry,
5
5
  ToolTypes
6
- } from "./chunk-AZD5EKLV.js";
6
+ } from "./chunk-5O4NJXLJ.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
 
9
9
  // src/tools_local_fs.ts
@@ -268,14 +268,14 @@ interface FrontendToken {
268
268
  sessionId: string;
269
269
  /** The project ID this token is scoped to. */
270
270
  projectId: string;
271
- /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
272
- customerId?: string;
271
+ /** The internal customer ID (UUID). */
272
+ customerId: string;
273
273
  /** The external customer ID provided by the application. */
274
274
  customerExternalId: string;
275
275
  /** The tier code for the customer (e.g., "free", "pro", "enterprise").
276
276
  * Optional for BYOB (external billing) projects where customers may not have subscriptions.
277
277
  */
278
- tierCode?: TierCode;
278
+ tierCode?: string;
279
279
  /**
280
280
  * Publishable key used for issuance. Added client-side for caching.
281
281
  */
@@ -304,11 +304,10 @@ interface CustomerToken {
304
304
  expiresIn: number;
305
305
  tokenType: TokenType;
306
306
  projectId: string;
307
- /** Only present for managed billing projects; BYOB projects have end-users but not customers. */
308
- customerId?: string;
307
+ customerId: string;
309
308
  customerExternalId: string;
310
309
  /** Optional for BYOB (external billing) projects */
311
- tierCode?: TierCode;
310
+ tierCode?: string;
312
311
  }
313
312
  interface OIDCExchangeRequest {
314
313
  idToken: string;
@@ -356,12 +355,12 @@ interface DeviceTokenResponse {
356
355
  tokenType: TokenType;
357
356
  /** The project ID this token is scoped to */
358
357
  projectId: string;
359
- /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
360
- customerId?: string;
358
+ /** The internal customer ID (UUID) */
359
+ customerId: string;
361
360
  /** The external customer ID */
362
361
  customerExternalId: string;
363
362
  /** The tier code for the customer (optional for BYOB projects) */
364
- tierCode?: TierCode;
363
+ tierCode?: string;
365
364
  }
366
365
  /**
367
366
  * Pending response from polling device token endpoint.
@@ -705,10 +704,9 @@ interface APIFrontendToken {
705
704
  key_id: string;
706
705
  session_id: string;
707
706
  project_id: string;
708
- /** Optional for BYOB projects where customers are not created in the billing sense. */
709
- customer_id?: string;
707
+ customer_id: string;
710
708
  customer_external_id: string;
711
- tier_code?: TierCode;
709
+ tier_code?: string;
712
710
  }
713
711
  interface APICustomerRef {
714
712
  id: string;
@@ -1171,4 +1169,4 @@ interface RetryOptions {
1171
1169
  */
1172
1170
  declare function executeWithRetry(registry: ToolRegistry, toolCalls: ToolCall[], options?: RetryOptions): Promise<ToolExecutionResult[]>;
1173
1171
 
1174
- export { ToolCallAccumulator as $, type ApiKey as A, createFunctionToolFromSchema as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, createWebTool as E, type FrontendCustomer as F, toolChoiceAuto as G, toolChoiceRequired as H, type InputItem as I, toolChoiceNone as J, hasToolCalls as K, firstToolCall as L, type MetricsCallbacks as M, createUserMessage as N, type OIDCExchangeRequest as O, type ProviderId as P, createAssistantMessage as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, createSystemMessage as U, toolResultMessage as V, respondToToolCall as W, assistantMessageWithToolCalls as X, createToolCall as Y, type ZodLikeSchema as Z, createFunctionCall as _, type RequestContext as a, type OutputFormatType as a$, zodToJsonSchema as a0, parseToolArgs as a1, tryParseToolArgs as a2, parseToolArgsRaw as a3, ToolArgsError as a4, formatToolErrorForModel as a5, hasRetryableErrors as a6, getRetryableErrors as a7, createRetryMessages as a8, executeWithRetry as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, type JsonSchemaOptions as aa, type Schema as ab, type ToolHandler as ac, type RetryOptions as ad, SDK_VERSION as ae, DEFAULT_CLIENT_HEADER as af, DEFAULT_CONNECT_TIMEOUT_MS as ag, DEFAULT_REQUEST_TIMEOUT_MS as ah, type NonEmptyArray as ai, StopReasons as aj, type KnownStopReason as ak, type StopReason as al, asProviderId as am, asModelId as an, asTierCode as ao, SubscriptionStatuses as ap, type SubscriptionStatusKind as aq, BillingProviders as ar, type BillingProvider as as, type CustomerMetadata as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, ToolRegistry as r, type ToolExecutionResult as s, type TierCode as t, type PublishableKey as u, type SecretKey as v, type ModelRelayKeyOptions as w, type ModelRelayOptions as x, DEFAULT_BASE_URL as y, createFunctionTool as z };
1172
+ export { assistantMessageWithToolCalls as $, type ApiKey as A, type BillingProvider as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, DEFAULT_BASE_URL as E, type FrontendCustomer as F, createFunctionTool as G, createFunctionToolFromSchema as H, type InputItem as I, createWebTool as J, toolChoiceAuto as K, toolChoiceRequired as L, type MetricsCallbacks as M, toolChoiceNone as N, type OIDCExchangeRequest as O, type ProviderId as P, hasToolCalls as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, firstToolCall as U, createUserMessage as V, createAssistantMessage as W, createSystemMessage as X, toolResultMessage as Y, type ZodLikeSchema as Z, respondToToolCall as _, type RequestContext as a, type OutputFormatType as a$, createToolCall as a0, createFunctionCall as a1, ToolCallAccumulator as a2, zodToJsonSchema as a3, parseToolArgs as a4, tryParseToolArgs as a5, parseToolArgsRaw as a6, ToolArgsError as a7, formatToolErrorForModel as a8, hasRetryableErrors as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, getRetryableErrors as aa, createRetryMessages as ab, executeWithRetry as ac, type JsonSchemaOptions as ad, type Schema as ae, type ToolHandler as af, type RetryOptions as ag, SDK_VERSION as ah, DEFAULT_CLIENT_HEADER as ai, DEFAULT_CONNECT_TIMEOUT_MS as aj, DEFAULT_REQUEST_TIMEOUT_MS as ak, type NonEmptyArray as al, StopReasons as am, type KnownStopReason as an, type StopReason as ao, asProviderId as ap, asModelId as aq, asTierCode as ar, SubscriptionStatuses as as, BillingProviders as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, type CustomerMetadata as r, type TierCode as s, type SubscriptionStatusKind as t, ToolRegistry as u, type ToolExecutionResult as v, type PublishableKey as w, type SecretKey as x, type ModelRelayKeyOptions as y, type ModelRelayOptions as z };
@@ -268,14 +268,14 @@ interface FrontendToken {
268
268
  sessionId: string;
269
269
  /** The project ID this token is scoped to. */
270
270
  projectId: string;
271
- /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
272
- customerId?: string;
271
+ /** The internal customer ID (UUID). */
272
+ customerId: string;
273
273
  /** The external customer ID provided by the application. */
274
274
  customerExternalId: string;
275
275
  /** The tier code for the customer (e.g., "free", "pro", "enterprise").
276
276
  * Optional for BYOB (external billing) projects where customers may not have subscriptions.
277
277
  */
278
- tierCode?: TierCode;
278
+ tierCode?: string;
279
279
  /**
280
280
  * Publishable key used for issuance. Added client-side for caching.
281
281
  */
@@ -304,11 +304,10 @@ interface CustomerToken {
304
304
  expiresIn: number;
305
305
  tokenType: TokenType;
306
306
  projectId: string;
307
- /** Only present for managed billing projects; BYOB projects have end-users but not customers. */
308
- customerId?: string;
307
+ customerId: string;
309
308
  customerExternalId: string;
310
309
  /** Optional for BYOB (external billing) projects */
311
- tierCode?: TierCode;
310
+ tierCode?: string;
312
311
  }
313
312
  interface OIDCExchangeRequest {
314
313
  idToken: string;
@@ -356,12 +355,12 @@ interface DeviceTokenResponse {
356
355
  tokenType: TokenType;
357
356
  /** The project ID this token is scoped to */
358
357
  projectId: string;
359
- /** The internal customer ID (UUID). Only present for managed billing projects; BYOB projects have end-users but not customers. */
360
- customerId?: string;
358
+ /** The internal customer ID (UUID) */
359
+ customerId: string;
361
360
  /** The external customer ID */
362
361
  customerExternalId: string;
363
362
  /** The tier code for the customer (optional for BYOB projects) */
364
- tierCode?: TierCode;
363
+ tierCode?: string;
365
364
  }
366
365
  /**
367
366
  * Pending response from polling device token endpoint.
@@ -705,10 +704,9 @@ interface APIFrontendToken {
705
704
  key_id: string;
706
705
  session_id: string;
707
706
  project_id: string;
708
- /** Optional for BYOB projects where customers are not created in the billing sense. */
709
- customer_id?: string;
707
+ customer_id: string;
710
708
  customer_external_id: string;
711
- tier_code?: TierCode;
709
+ tier_code?: string;
712
710
  }
713
711
  interface APICustomerRef {
714
712
  id: string;
@@ -1171,4 +1169,4 @@ interface RetryOptions {
1171
1169
  */
1172
1170
  declare function executeWithRetry(registry: ToolRegistry, toolCalls: ToolCall[], options?: RetryOptions): Promise<ToolExecutionResult[]>;
1173
1171
 
1174
- export { ToolCallAccumulator as $, type ApiKey as A, createFunctionToolFromSchema as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, createWebTool as E, type FrontendCustomer as F, toolChoiceAuto as G, toolChoiceRequired as H, type InputItem as I, toolChoiceNone as J, hasToolCalls as K, firstToolCall as L, type MetricsCallbacks as M, createUserMessage as N, type OIDCExchangeRequest as O, type ProviderId as P, createAssistantMessage as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, createSystemMessage as U, toolResultMessage as V, respondToToolCall as W, assistantMessageWithToolCalls as X, createToolCall as Y, type ZodLikeSchema as Z, createFunctionCall as _, type RequestContext as a, type OutputFormatType as a$, zodToJsonSchema as a0, parseToolArgs as a1, tryParseToolArgs as a2, parseToolArgsRaw as a3, ToolArgsError as a4, formatToolErrorForModel as a5, hasRetryableErrors as a6, getRetryableErrors as a7, createRetryMessages as a8, executeWithRetry as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, type JsonSchemaOptions as aa, type Schema as ab, type ToolHandler as ac, type RetryOptions as ad, SDK_VERSION as ae, DEFAULT_CLIENT_HEADER as af, DEFAULT_CONNECT_TIMEOUT_MS as ag, DEFAULT_REQUEST_TIMEOUT_MS as ah, type NonEmptyArray as ai, StopReasons as aj, type KnownStopReason as ak, type StopReason as al, asProviderId as am, asModelId as an, asTierCode as ao, SubscriptionStatuses as ap, type SubscriptionStatusKind as aq, BillingProviders as ar, type BillingProvider as as, type CustomerMetadata as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, ToolRegistry as r, type ToolExecutionResult as s, type TierCode as t, type PublishableKey as u, type SecretKey as v, type ModelRelayKeyOptions as w, type ModelRelayOptions as x, DEFAULT_BASE_URL as y, createFunctionTool as z };
1172
+ export { assistantMessageWithToolCalls as $, type ApiKey as A, type BillingProvider as B, type CustomerTokenRequest as C, type DeviceStartRequest as D, DEFAULT_BASE_URL as E, type FrontendCustomer as F, createFunctionTool as G, createFunctionToolFromSchema as H, type InputItem as I, createWebTool as J, toolChoiceAuto as K, toolChoiceRequired as L, type MetricsCallbacks as M, toolChoiceNone as N, type OIDCExchangeRequest as O, type ProviderId as P, hasToolCalls as Q, type RetryConfig as R, type StructuredJSONEvent as S, type TraceCallbacks as T, firstToolCall as U, createUserMessage as V, createAssistantMessage as W, createSystemMessage as X, toolResultMessage as Y, type ZodLikeSchema as Z, respondToToolCall as _, type RequestContext as a, type OutputFormatType as a$, createToolCall as a0, createFunctionCall as a1, ToolCallAccumulator as a2, zodToJsonSchema as a3, parseToolArgs as a4, tryParseToolArgs as a5, parseToolArgsRaw as a6, ToolArgsError as a7, formatToolErrorForModel as a8, hasRetryableErrors as a9, type Usage as aA, createUsage as aB, type UsageSummary as aC, type Project as aD, MessageRoles as aE, type MessageRole as aF, ContentPartTypes as aG, type ContentPartType as aH, type ContentPart as aI, InputItemTypes as aJ, type InputItemType as aK, OutputItemTypes as aL, type OutputItemType as aM, type OutputItem as aN, ToolTypes as aO, type ToolType as aP, WebToolIntents as aQ, type WebToolIntent as aR, type FunctionTool as aS, type WebSearchConfig as aT, type XSearchConfig as aU, type CodeExecConfig as aV, ToolChoiceTypes as aW, type ToolChoiceType as aX, type FunctionCall as aY, type ToolCall as aZ, OutputFormatTypes as a_, getRetryableErrors as aa, createRetryMessages as ab, executeWithRetry as ac, type JsonSchemaOptions as ad, type Schema as ae, type ToolHandler as af, type RetryOptions as ag, SDK_VERSION as ah, DEFAULT_CLIENT_HEADER as ai, DEFAULT_CONNECT_TIMEOUT_MS as aj, DEFAULT_REQUEST_TIMEOUT_MS as ak, type NonEmptyArray as al, StopReasons as am, type KnownStopReason as an, type StopReason as ao, asProviderId as ap, asModelId as aq, asTierCode as ar, SubscriptionStatuses as as, BillingProviders as at, type ModelRelayBaseOptions as au, type ModelRelayTokenOptions as av, type ModelRelayTokenProviderOptions as aw, type TokenType as ax, type DeviceTokenResponse as ay, type DeviceTokenPending as az, type TokenProvider as b, type JSONSchemaFormat as b0, type Citation as b1, type HttpRequestMetrics as b2, type StreamFirstTokenMetrics as b3, type TokenUsageMetrics as b4, mergeMetrics as b5, mergeTrace as b6, normalizeStopReason as b7, stopReasonToString as b8, normalizeModelId as b9, modelToString as ba, type ResponseEventType as bb, type MessageStartData as bc, type MessageDeltaData as bd, type MessageStopData as be, type ToolCallDelta as bf, type FunctionCallDelta as bg, type StructuredJSONRecordType as bh, type DeepPartial as bi, type APIFrontendToken as bj, type APICustomerRef as bk, type APICheckoutSession as bl, type APIUsage as bm, type APIResponsesResponse as bn, type APIKey as bo, type FrontendTokenRequest as c, type FrontendToken as d, type FrontendTokenAutoProvisionRequest as e, type CustomerToken as f, type DeviceStartResponse as g, type DeviceTokenResult as h, type ModelId as i, type OutputFormat as j, type Tool as k, type ToolChoice as l, type ResponseEvent as m, type Response as n, type FieldError as o, type RetryMetadata as p, type TransportErrorKind as q, type CustomerMetadata as r, type TierCode as s, type SubscriptionStatusKind as t, ToolRegistry as u, type ToolExecutionResult as v, type PublishableKey as w, type SecretKey as x, type ModelRelayKeyOptions as y, type ModelRelayOptions as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelrelay/sdk",
3
- "version": "2.1.0",
3
+ "version": "4.0.0",
4
4
  "description": "TypeScript SDK for the ModelRelay API",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",