@openrouter/sdk 1.3.20 → 1.3.22

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 (252) hide show
  1. package/esm/funcs/alphaDecisionsCreate.js +5 -5
  2. package/esm/funcs/analyticsGetAnalyticsMeta.js +4 -4
  3. package/esm/funcs/analyticsGetUserActivity.js +5 -5
  4. package/esm/funcs/analyticsQueryAnalytics.js +4 -4
  5. package/esm/funcs/apiKeysCreate.js +4 -4
  6. package/esm/funcs/apiKeysDelete.js +4 -4
  7. package/esm/funcs/apiKeysGet.js +4 -4
  8. package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +4 -4
  9. package/esm/funcs/apiKeysList.js +4 -4
  10. package/esm/funcs/apiKeysUpdate.js +4 -4
  11. package/esm/funcs/benchmarksGetBenchmarks.js +5 -5
  12. package/esm/funcs/byokCreate.js +5 -5
  13. package/esm/funcs/byokDelete.js +5 -5
  14. package/esm/funcs/byokGet.js +5 -5
  15. package/esm/funcs/byokList.js +5 -5
  16. package/esm/funcs/byokUpdate.js +5 -5
  17. package/esm/funcs/chatSend.js +4 -4
  18. package/esm/funcs/classificationsGetTaskClassifications.js +5 -5
  19. package/esm/funcs/containersDownloadContainerFileContent.js +4 -4
  20. package/esm/funcs/containersGetContainerFile.js +5 -5
  21. package/esm/funcs/containersListContainerFiles.js +5 -5
  22. package/esm/funcs/containersPromoteContainerFile.js +5 -5
  23. package/esm/funcs/creditsGetCredits.js +4 -4
  24. package/esm/funcs/datasetsGetAppRankings.js +5 -5
  25. package/esm/funcs/datasetsGetRankingsDaily.js +5 -5
  26. package/esm/funcs/datasetsGetSessionCost.js +5 -5
  27. package/esm/funcs/embeddingsGenerate.js +5 -5
  28. package/esm/funcs/embeddingsListModels.js +5 -5
  29. package/esm/funcs/endpointsList.js +4 -4
  30. package/esm/funcs/endpointsListZdrEndpoints.js +4 -4
  31. package/esm/funcs/filesDelete.js +5 -5
  32. package/esm/funcs/filesDownload.js +4 -4
  33. package/esm/funcs/filesList.js +4 -4
  34. package/esm/funcs/filesRetrieve.js +5 -5
  35. package/esm/funcs/filesUpload.js +5 -5
  36. package/esm/funcs/generationsGetGeneration.js +5 -5
  37. package/esm/funcs/generationsListGenerationContent.js +5 -5
  38. package/esm/funcs/generationsSubmitFeedback.js +5 -5
  39. package/esm/funcs/guardrailsBulkAssignKeys.js +5 -5
  40. package/esm/funcs/guardrailsBulkAssignMembers.js +5 -5
  41. package/esm/funcs/guardrailsBulkUnassignKeys.js +5 -5
  42. package/esm/funcs/guardrailsBulkUnassignMembers.js +5 -5
  43. package/esm/funcs/guardrailsCreate.js +5 -5
  44. package/esm/funcs/guardrailsDelete.js +5 -5
  45. package/esm/funcs/guardrailsGet.js +5 -5
  46. package/esm/funcs/guardrailsList.js +5 -5
  47. package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +5 -5
  48. package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +4 -4
  49. package/esm/funcs/guardrailsListKeyAssignments.js +5 -5
  50. package/esm/funcs/guardrailsListMemberAssignments.js +5 -5
  51. package/esm/funcs/guardrailsUpdate.js +5 -5
  52. package/esm/funcs/imagesGenerate.js +4 -4
  53. package/esm/funcs/imagesListModelEndpoints.js +5 -5
  54. package/esm/funcs/imagesListModels.js +5 -5
  55. package/esm/funcs/internsChat.js +8 -8
  56. package/esm/funcs/internsCreateIntern.js +5 -5
  57. package/esm/funcs/internsDeleteIntern.js +5 -5
  58. package/esm/funcs/internsGetIntern.js +5 -5
  59. package/esm/funcs/internsInvoke.d.ts +26 -0
  60. package/esm/funcs/internsInvoke.js +119 -0
  61. package/esm/funcs/internsListInterns.js +5 -5
  62. package/esm/funcs/internsProvisionIntern.js +5 -5
  63. package/esm/funcs/internsSuspendIntern.js +5 -5
  64. package/esm/funcs/internsUpdateIntern.js +5 -5
  65. package/esm/funcs/modelsCount.js +5 -5
  66. package/esm/funcs/modelsGet.js +5 -5
  67. package/esm/funcs/modelsList.js +4 -4
  68. package/esm/funcs/modelsListForUser.js +5 -5
  69. package/esm/funcs/oAuthCreateAuthCode.js +4 -4
  70. package/esm/funcs/oAuthCreateOauthToken.js +5 -5
  71. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +4 -4
  72. package/esm/funcs/oAuthListOauthJwks.js +5 -5
  73. package/esm/funcs/observabilityCreate.js +5 -5
  74. package/esm/funcs/observabilityDelete.js +5 -5
  75. package/esm/funcs/observabilityGet.js +5 -5
  76. package/esm/funcs/observabilityList.js +4 -4
  77. package/esm/funcs/observabilityUpdate.js +5 -5
  78. package/esm/funcs/organizationListMembers.js +5 -5
  79. package/esm/funcs/presetsCreatePresetsChatCompletions.js +5 -5
  80. package/esm/funcs/presetsCreatePresetsMessages.js +5 -5
  81. package/esm/funcs/presetsCreatePresetsResponses.js +5 -5
  82. package/esm/funcs/presetsGet.js +5 -5
  83. package/esm/funcs/presetsGetVersion.js +5 -5
  84. package/esm/funcs/presetsList.js +5 -5
  85. package/esm/funcs/presetsListVersions.js +5 -5
  86. package/esm/funcs/providersList.js +4 -4
  87. package/esm/funcs/rerankRerank.js +5 -5
  88. package/esm/funcs/responsesSend.js +4 -4
  89. package/esm/funcs/scimCreate.js +5 -5
  90. package/esm/funcs/scimCreateSyncJob.js +5 -5
  91. package/esm/funcs/scimDelete.js +5 -5
  92. package/esm/funcs/scimGetSyncJob.js +5 -5
  93. package/esm/funcs/scimListGroups.js +5 -5
  94. package/esm/funcs/scimListMappings.js +5 -5
  95. package/esm/funcs/scimRead.js +5 -5
  96. package/esm/funcs/scimUpdate.js +5 -5
  97. package/esm/funcs/sttCreateTranscription.js +5 -5
  98. package/esm/funcs/sttCreateTranscriptionMultipart.js +5 -5
  99. package/esm/funcs/systemOneCreate.js +5 -5
  100. package/esm/funcs/ttsCreateSpeech.js +4 -4
  101. package/esm/funcs/vaultCopyVaultSecretsToIntern.js +5 -5
  102. package/esm/funcs/vaultDeleteInternVaultSecret.js +4 -4
  103. package/esm/funcs/vaultDeleteVaultSecret.js +4 -4
  104. package/esm/funcs/vaultListInternVaultSecrets.js +5 -5
  105. package/esm/funcs/vaultListVaultSecrets.js +5 -5
  106. package/esm/funcs/vaultStoreInternVaultSecret.js +5 -5
  107. package/esm/funcs/vaultStoreVaultSecret.js +5 -5
  108. package/esm/funcs/videoGenerationGenerate.js +5 -5
  109. package/esm/funcs/videoGenerationGetGeneration.js +5 -5
  110. package/esm/funcs/videoGenerationGetVideoContent.js +4 -4
  111. package/esm/funcs/videoGenerationListVideosModels.js +5 -5
  112. package/esm/funcs/workspacesBulkAddMembers.js +5 -5
  113. package/esm/funcs/workspacesBulkRemoveMembers.js +5 -5
  114. package/esm/funcs/workspacesCreate.js +5 -5
  115. package/esm/funcs/workspacesDelete.js +5 -5
  116. package/esm/funcs/workspacesDeleteBudget.js +5 -5
  117. package/esm/funcs/workspacesGet.js +5 -5
  118. package/esm/funcs/workspacesGetBudget.js +5 -5
  119. package/esm/funcs/workspacesList.js +5 -5
  120. package/esm/funcs/workspacesListBudgets.js +5 -5
  121. package/esm/funcs/workspacesListMembers.js +5 -5
  122. package/esm/funcs/workspacesSetBudget.js +5 -5
  123. package/esm/funcs/workspacesUpdate.js +5 -5
  124. package/esm/lib/anthropic-compat.d.ts +2 -2
  125. package/esm/lib/async-params.d.ts +4 -4
  126. package/esm/lib/chat-compat.d.ts +3 -2
  127. package/esm/lib/config.d.ts +2 -2
  128. package/esm/lib/config.js +2 -2
  129. package/esm/lib/conversation-state.d.ts +7 -5
  130. package/esm/lib/model-result.d.ts +7 -4
  131. package/esm/lib/next-turn-params.d.ts +4 -4
  132. package/esm/lib/stream-transformers.d.ts +26 -17
  133. package/esm/lib/stream-type-guards.d.ts +41 -21
  134. package/esm/lib/tool-orchestrator.d.ts +7 -5
  135. package/esm/lib/tool-types.d.ts +14 -10
  136. package/esm/lib/turn-context.d.ts +6 -4
  137. package/esm/lib/turn-context.js +2 -2
  138. package/esm/models/customtoolcallitem.d.ts +8 -8
  139. package/esm/models/customtoolcallitem.js +4 -4
  140. package/esm/models/errors/badgatewayresponseerror.js +2 -2
  141. package/esm/models/errors/badrequestresponseerror.js +2 -2
  142. package/esm/models/errors/conflictresponseerror.js +2 -2
  143. package/esm/models/errors/edgenetworktimeoutresponseerror.js +2 -2
  144. package/esm/models/errors/forbiddenresponseerror.js +2 -2
  145. package/esm/models/errors/gatewaytimeoutresponseerror.js +2 -2
  146. package/esm/models/errors/goneresponseerror.js +2 -2
  147. package/esm/models/errors/internalserverresponseerror.js +2 -2
  148. package/esm/models/errors/internchaterrorresponse.js +2 -2
  149. package/esm/models/errors/internlifecycleerror.js +2 -2
  150. package/esm/models/errors/notfoundresponseerror.js +2 -2
  151. package/esm/models/errors/oautherrorresponse.js +2 -2
  152. package/esm/models/errors/payloadtoolargeresponseerror.js +2 -2
  153. package/esm/models/errors/paymentrequiredresponseerror.js +2 -2
  154. package/esm/models/errors/provideroverloadedresponseerror.js +2 -2
  155. package/esm/models/errors/requesttimeoutresponseerror.js +2 -2
  156. package/esm/models/errors/serviceunavailableresponseerror.js +2 -2
  157. package/esm/models/errors/toomanyrequestsresponseerror.js +2 -2
  158. package/esm/models/errors/unauthorizedresponseerror.js +2 -2
  159. package/esm/models/errors/unprocessableentityresponseerror.js +2 -2
  160. package/esm/models/functioncallitem.d.ts +12 -12
  161. package/esm/models/functioncallitem.js +6 -6
  162. package/esm/models/index.d.ts +2 -0
  163. package/esm/models/index.js +2 -0
  164. package/esm/models/inputsunion.d.ts +4 -6
  165. package/esm/models/inputsunion.js +2 -8
  166. package/esm/models/interninvokeacceptedresponse.d.ts +34 -0
  167. package/esm/models/interninvokeacceptedresponse.js +30 -0
  168. package/esm/models/interninvokerequest.d.ts +23 -0
  169. package/esm/models/interninvokerequest.js +19 -0
  170. package/esm/models/operations/bulkaddworkspacemembers.js +2 -2
  171. package/esm/models/operations/bulkassignkeystoguardrail.js +2 -2
  172. package/esm/models/operations/bulkassignmemberstoguardrail.js +2 -2
  173. package/esm/models/operations/bulkremoveworkspacemembers.js +2 -2
  174. package/esm/models/operations/bulkunassignkeysfromguardrail.js +2 -2
  175. package/esm/models/operations/bulkunassignmembersfromguardrail.js +2 -2
  176. package/esm/models/operations/copyvaultsecretstointern.js +2 -2
  177. package/esm/models/operations/createapialphadecisions.js +2 -2
  178. package/esm/models/operations/createaudiospeech.js +2 -2
  179. package/esm/models/operations/createaudiotranscriptions.js +2 -2
  180. package/esm/models/operations/createbyokkey.js +2 -2
  181. package/esm/models/operations/createembeddings.js +10 -10
  182. package/esm/models/operations/createguardrail.js +2 -2
  183. package/esm/models/operations/createimages.js +4 -4
  184. package/esm/models/operations/createintern.js +2 -2
  185. package/esm/models/operations/createinternchatcompletion.js +6 -6
  186. package/esm/models/operations/createoauthtoken.js +2 -2
  187. package/esm/models/operations/createobservabilitydestination.js +2 -2
  188. package/esm/models/operations/createpresetschatcompletions.js +2 -2
  189. package/esm/models/operations/createpresetsmessages.js +2 -2
  190. package/esm/models/operations/createpresetsresponses.js +2 -2
  191. package/esm/models/operations/creatererank.js +3 -3
  192. package/esm/models/operations/createresponses.js +5 -5
  193. package/esm/models/operations/createscimgroupmapping.js +2 -2
  194. package/esm/models/operations/createscimsyncjob.js +2 -2
  195. package/esm/models/operations/createsystemone.js +2 -2
  196. package/esm/models/operations/createvideos.js +2 -2
  197. package/esm/models/operations/createworkspace.js +2 -2
  198. package/esm/models/operations/deletefile.js +2 -2
  199. package/esm/models/operations/deleteintern.js +2 -2
  200. package/esm/models/operations/deleteworkspacebudget.js +2 -2
  201. package/esm/models/operations/downloadfilecontent.js +2 -2
  202. package/esm/models/operations/getapprankings.js +2 -2
  203. package/esm/models/operations/getcurrentkey.js +2 -2
  204. package/esm/models/operations/getfilemetadata.js +2 -2
  205. package/esm/models/operations/getmodels.js +2 -2
  206. package/esm/models/operations/getsessioncost.js +2 -2
  207. package/esm/models/operations/getworkspacebudget.js +2 -2
  208. package/esm/models/operations/index.d.ts +1 -0
  209. package/esm/models/operations/index.js +1 -0
  210. package/esm/models/operations/invokeintern.d.ts +72 -0
  211. package/esm/models/operations/invokeintern.js +38 -0
  212. package/esm/models/operations/listbyokkeys.js +2 -2
  213. package/esm/models/operations/listembeddingsmodels.js +2 -2
  214. package/esm/models/operations/listendpoints.js +2 -2
  215. package/esm/models/operations/listendpointszdr.js +2 -2
  216. package/esm/models/operations/listfiles.js +3 -3
  217. package/esm/models/operations/listguardrailkeyassignments.js +2 -2
  218. package/esm/models/operations/listguardrailmemberassignments.js +2 -2
  219. package/esm/models/operations/listguardrails.js +2 -2
  220. package/esm/models/operations/listkeyassignments.js +2 -2
  221. package/esm/models/operations/listmemberassignments.js +2 -2
  222. package/esm/models/operations/listmodelsuser.js +2 -2
  223. package/esm/models/operations/listobservabilitydestinations.js +2 -2
  224. package/esm/models/operations/listpresets.js +2 -2
  225. package/esm/models/operations/listpresetversions.js +2 -2
  226. package/esm/models/operations/listscimgroupmappings.js +2 -2
  227. package/esm/models/operations/listscimgroups.js +2 -2
  228. package/esm/models/operations/listworkspacemembers.js +2 -2
  229. package/esm/models/operations/listworkspaces.js +2 -2
  230. package/esm/models/operations/sendchatcompletionrequest.js +5 -5
  231. package/esm/models/operations/storeinternvaultsecret.js +2 -2
  232. package/esm/models/operations/storevaultsecret.js +2 -2
  233. package/esm/models/operations/submitgenerationfeedback.js +2 -2
  234. package/esm/models/operations/updatebyokkey.js +2 -2
  235. package/esm/models/operations/updateguardrail.js +2 -2
  236. package/esm/models/operations/updateintern.js +2 -2
  237. package/esm/models/operations/updateobservabilitydestination.js +2 -2
  238. package/esm/models/operations/updatescimgroupmapping.js +2 -2
  239. package/esm/models/operations/updateworkspace.js +2 -2
  240. package/esm/models/operations/uploadfile.js +2 -2
  241. package/esm/models/operations/upsertworkspacebudget.js +3 -3
  242. package/esm/models/outputcustomtoolcallitem.d.ts +2 -26
  243. package/esm/models/outputcustomtoolcallitem.js +1 -28
  244. package/esm/models/outputfunctioncallitem.d.ts +1 -44
  245. package/esm/models/outputfunctioncallitem.js +1 -64
  246. package/esm/models/outputitems.d.ts +2 -6
  247. package/esm/models/outputitems.js +2 -2
  248. package/esm/sdk/interns.d.ts +13 -0
  249. package/esm/sdk/interns.js +16 -0
  250. package/jsr.json +1 -1
  251. package/package.json +11 -9
  252. package/scripts/unbarrel-imports.js +296 -0
@@ -1,4 +1,6 @@
1
- import type * as models from '../models/index.js';
1
+ import type { InputsUnion } from '../models/inputsunion.js';
2
+ import type { OpenResponsesResult } from '../models/openresponsesresult.js';
3
+ import type { ResponsesRequest } from '../models/responsesrequest.js';
2
4
  import type { APITool, Tool, ToolExecutionResult } from './tool-types.js';
3
5
  /**
4
6
  * Options for tool execution
@@ -10,10 +12,10 @@ export interface ToolExecutionOptions {
10
12
  * Result of the tool execution loop
11
13
  */
12
14
  export interface ToolOrchestrationResult {
13
- finalResponse: models.OpenResponsesResult;
14
- allResponses: models.OpenResponsesResult[];
15
+ finalResponse: OpenResponsesResult;
16
+ allResponses: OpenResponsesResult[];
15
17
  toolExecutionResults: ToolExecutionResult<Tool>[];
16
- conversationInput: models.InputsUnion;
18
+ conversationInput: InputsUnion;
17
19
  }
18
20
  /**
19
21
  * Execute tool calls and manage multi-turn conversations
@@ -27,7 +29,7 @@ export interface ToolOrchestrationResult {
27
29
  * @param options - Execution options
28
30
  * @returns Result containing final response and all execution data
29
31
  */
30
- export declare function executeToolLoop(sendRequest: (input: models.InputsUnion, tools: APITool[]) => Promise<models.OpenResponsesResult>, initialInput: models.InputsUnion, initialRequest: models.ResponsesRequest, tools: Tool[], apiTools: APITool[], options?: ToolExecutionOptions): Promise<ToolOrchestrationResult>;
32
+ export declare function executeToolLoop(sendRequest: (input: InputsUnion, tools: APITool[]) => Promise<OpenResponsesResult>, initialInput: InputsUnion, initialRequest: ResponsesRequest, tools: Tool[], apiTools: APITool[], options?: ToolExecutionOptions): Promise<ToolOrchestrationResult>;
31
33
  /**
32
34
  * Convert tool execution results to a map for easy lookup
33
35
  */
@@ -1,6 +1,10 @@
1
1
  import type { $ZodObject, $ZodShape, $ZodType, infer as zodInfer } from 'zod/v4/core';
2
- import type * as models from '../models/index.js';
3
- import type { StreamEvents } from '../models/index.js';
2
+ import type { FunctionCallItem } from '../models/functioncallitem.js';
3
+ import type { FunctionCallOutputItem } from '../models/functioncalloutputitem.js';
4
+ import type { InputsUnion } from '../models/inputsunion.js';
5
+ import type { OpenResponsesResult, Usage } from '../models/openresponsesresult.js';
6
+ import type { ResponsesRequest } from '../models/responsesrequest.js';
7
+ import type { StreamEvents } from '../models/streamevents.js';
4
8
  import type { ModelResult } from './model-result.js';
5
9
  /**
6
10
  * Tool type enum for enhanced tools
@@ -14,11 +18,11 @@ export declare enum ToolType {
14
18
  */
15
19
  export interface TurnContext {
16
20
  /** The specific tool call being executed (only available during tool execution) */
17
- toolCall?: models.FunctionCallItem;
21
+ toolCall?: FunctionCallItem;
18
22
  /** Number of tool execution turns so far (1-indexed: first turn = 1, 0 = initial request) */
19
23
  numberOfTurns: number;
20
24
  /** The full request being sent to the API (only available during tool execution) */
21
- turnRequest?: models.ResponsesRequest;
25
+ turnRequest?: ResponsesRequest;
22
26
  }
23
27
  /**
24
28
  * Extract context schema type from a tool definition
@@ -83,7 +87,7 @@ export declare const SHARED_CONTEXT_KEY: "shared";
83
87
  */
84
88
  export type NextTurnParamsContext = {
85
89
  /** Current input (messages) */
86
- input: models.InputsUnion;
90
+ input: InputsUnion;
87
91
  /** Current model selection */
88
92
  model: string;
89
93
  /** Current models array */
@@ -315,8 +319,8 @@ export interface StepResult<TTools extends readonly Tool[] = readonly Tool[]> {
315
319
  readonly text: string;
316
320
  readonly toolCalls: TypedToolCallUnion<TTools>[];
317
321
  readonly toolResults: ToolExecutionResultUnion<TTools>[];
318
- readonly response: models.OpenResponsesResult;
319
- readonly usage?: models.Usage | null | undefined;
322
+ readonly response: OpenResponsesResult;
323
+ readonly usage?: Usage | null | undefined;
320
324
  readonly finishReason?: string | undefined;
321
325
  readonly warnings?: Warning[] | undefined;
322
326
  readonly experimental_providerMetadata?: Record<string, unknown> | undefined;
@@ -388,7 +392,7 @@ export type ToolResultEvent<TResult = unknown, TPreliminaryResults = unknown> =
388
392
  */
389
393
  export type ToolCallOutputEvent = {
390
394
  type: 'tool.call_output';
391
- output: models.FunctionCallOutputItem;
395
+ output: FunctionCallOutputItem;
392
396
  timestamp: number;
393
397
  };
394
398
  /**
@@ -459,7 +463,7 @@ export type ChatStreamEvent<TEvent = unknown> = {
459
463
  delta: string;
460
464
  } | {
461
465
  type: 'message.complete';
462
- response: models.OpenResponsesResult;
466
+ response: OpenResponsesResult;
463
467
  } | {
464
468
  type: 'tool.preliminary_result';
465
469
  toolCallId: string;
@@ -505,7 +509,7 @@ export interface ConversationState<TTools extends readonly Tool[] = readonly Too
505
509
  /** Unique identifier for this conversation */
506
510
  id: string;
507
511
  /** Full message history */
508
- messages: models.InputsUnion;
512
+ messages: InputsUnion;
509
513
  /** Previous response ID for chaining (OpenRouter server-side optimization) */
510
514
  previousResponseId?: string;
511
515
  /** Tool calls awaiting human approval */
@@ -1,4 +1,6 @@
1
- import * as models from '../models/index.js';
1
+ import type { FunctionCallItem } from '../models/functioncallitem.js';
2
+ import type { InputsUnion, InputsUnion1 } from '../models/inputsunion.js';
3
+ import type { ResponsesRequest } from '../models/responsesrequest.js';
2
4
  import type { TurnContext } from './tool-types.js';
3
5
  /**
4
6
  * Options for building a turn context
@@ -7,9 +9,9 @@ export interface BuildTurnContextOptions {
7
9
  /** Number of turns so far (1-indexed for tool execution, 0 for initial request) */
8
10
  numberOfTurns: number;
9
11
  /** The specific tool call being executed (optional for initial/async resolution contexts) */
10
- toolCall?: models.FunctionCallItem;
12
+ toolCall?: FunctionCallItem;
11
13
  /** The full request being sent to the API (optional for initial/async resolution contexts) */
12
- turnRequest?: models.ResponsesRequest;
14
+ turnRequest?: ResponsesRequest;
13
15
  }
14
16
  /**
15
17
  * Build a turn context for tool execution or async parameter resolution
@@ -46,5 +48,5 @@ export declare function buildTurnContext(options: BuildTurnContextOptions): Turn
46
48
  * // Returns: [{ role: "user", content: "Hello!" }]
47
49
  * ```
48
50
  */
49
- export declare function normalizeInputToArray(input: models.InputsUnion): Array<models.InputsUnion1>;
51
+ export declare function normalizeInputToArray(input: InputsUnion): Array<InputsUnion1>;
50
52
  //# sourceMappingURL=turn-context.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as models from '../models/index.js';
1
+ import { EasyInputMessageRoleUser } from '../models/easyinputmessage.js';
2
2
  /**
3
3
  * Build a turn context for tool execution or async parameter resolution
4
4
  *
@@ -49,7 +49,7 @@ export function normalizeInputToArray(input) {
49
49
  if (typeof input === 'string') {
50
50
  // Construct object with all required fields - type is optional
51
51
  const message = {
52
- role: models.EasyInputMessageRoleUser.User,
52
+ role: EasyInputMessageRoleUser.User,
53
53
  content: input,
54
54
  };
55
55
  return [message];
@@ -12,30 +12,30 @@ export type CustomToolCallItem = {
12
12
  /**
13
13
  * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
14
14
  */
15
- async?: boolean | undefined;
15
+ async?: boolean | null | undefined;
16
16
  callId: string;
17
- id?: string | undefined;
17
+ id?: string | null | undefined;
18
18
  input: string;
19
19
  name: string;
20
20
  /**
21
21
  * Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)
22
22
  */
23
- namespace?: string | undefined;
23
+ namespace?: string | null | undefined;
24
+ status?: ToolCallStatus | null | undefined;
24
25
  type: CustomToolCallItemType;
25
- status?: ToolCallStatus | undefined;
26
26
  };
27
27
  /** @internal */
28
28
  export declare const CustomToolCallItemType$outboundSchema: z.ZodEnum<typeof CustomToolCallItemType>;
29
29
  /** @internal */
30
30
  export type CustomToolCallItem$Outbound = {
31
- async?: boolean | undefined;
31
+ async?: boolean | null | undefined;
32
32
  call_id: string;
33
- id?: string | undefined;
33
+ id?: string | null | undefined;
34
34
  input: string;
35
35
  name: string;
36
- namespace?: string | undefined;
36
+ namespace?: string | null | undefined;
37
+ status?: string | null | undefined;
37
38
  type: string;
38
- status?: string | undefined;
39
39
  };
40
40
  /** @internal */
41
41
  export declare const CustomToolCallItem$outboundSchema: z.ZodType<CustomToolCallItem$Outbound, CustomToolCallItem>;
@@ -12,14 +12,14 @@ export const CustomToolCallItemType = {
12
12
  export const CustomToolCallItemType$outboundSchema = z.enum(CustomToolCallItemType);
13
13
  /** @internal */
14
14
  export const CustomToolCallItem$outboundSchema = z.object({
15
- async: z.boolean().optional(),
15
+ async: z.nullable(z.boolean()).optional(),
16
16
  callId: z.string(),
17
- id: z.string().optional(),
17
+ id: z.nullable(z.string()).optional(),
18
18
  input: z.string(),
19
19
  name: z.string(),
20
- namespace: z.string().optional(),
20
+ namespace: z.nullable(z.string()).optional(),
21
+ status: z.nullable(ToolCallStatus$outboundSchema).optional(),
21
22
  type: CustomToolCallItemType$outboundSchema,
22
- status: ToolCallStatus$outboundSchema.optional(),
23
23
  }).transform((v) => {
24
24
  return remap$(v, {
25
25
  callId: "call_id",
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { BadGatewayResponseErrorData$inboundSchema as models_BadGatewayResponseErrorData$inboundSchema } from "../badgatewayresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Bad Gateway - Provider/upstream API failure
@@ -26,7 +26,7 @@ export class BadGatewayResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const BadGatewayResponseError$inboundSchema = z.object({
29
- error: models.BadGatewayResponseErrorData$inboundSchema,
29
+ error: models_BadGatewayResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { BadRequestResponseErrorData$inboundSchema as models_BadRequestResponseErrorData$inboundSchema } from "../badrequestresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Bad Request - Invalid request parameters or malformed input
@@ -26,7 +26,7 @@ export class BadRequestResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const BadRequestResponseError$inboundSchema = z.object({
29
- error: models.BadRequestResponseErrorData$inboundSchema,
29
+ error: models_BadRequestResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { ConflictResponseErrorData$inboundSchema as models_ConflictResponseErrorData$inboundSchema } from "../conflictresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Conflict - Resource conflict or concurrent modification
@@ -26,7 +26,7 @@ export class ConflictResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const ConflictResponseError$inboundSchema = z.object({
29
- error: models.ConflictResponseErrorData$inboundSchema,
29
+ error: models_ConflictResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { EdgeNetworkTimeoutResponseErrorData$inboundSchema as models_EdgeNetworkTimeoutResponseErrorData$inboundSchema } from "../edgenetworktimeoutresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Infrastructure Timeout - Provider request timed out at edge network
@@ -26,7 +26,7 @@ export class EdgeNetworkTimeoutResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const EdgeNetworkTimeoutResponseError$inboundSchema = z.object({
29
- error: models.EdgeNetworkTimeoutResponseErrorData$inboundSchema,
29
+ error: models_EdgeNetworkTimeoutResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { ForbiddenResponseErrorData$inboundSchema as models_ForbiddenResponseErrorData$inboundSchema } from "../forbiddenresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Forbidden - Authentication successful but insufficient permissions
@@ -26,7 +26,7 @@ export class ForbiddenResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const ForbiddenResponseError$inboundSchema = z.object({
29
- error: models.ForbiddenResponseErrorData$inboundSchema,
29
+ error: models_ForbiddenResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { GatewayTimeoutResponseErrorData$inboundSchema as models_GatewayTimeoutResponseErrorData$inboundSchema } from "../gatewaytimeoutresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Gateway Timeout - Provider did not respond before the upstream deadline
@@ -26,7 +26,7 @@ export class GatewayTimeoutResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const GatewayTimeoutResponseError$inboundSchema = z.object({
29
- error: models.GatewayTimeoutResponseErrorData$inboundSchema,
29
+ error: models_GatewayTimeoutResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { GoneResponseErrorData$inboundSchema as models_GoneResponseErrorData$inboundSchema } from "../goneresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Gone - Endpoint has been permanently removed or deprecated
@@ -26,7 +26,7 @@ export class GoneResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const GoneResponseError$inboundSchema = z.object({
29
- error: models.GoneResponseErrorData$inboundSchema,
29
+ error: models_GoneResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { InternalServerResponseErrorData$inboundSchema as models_InternalServerResponseErrorData$inboundSchema } from "../internalserverresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Internal Server Error - Unexpected server error
@@ -26,7 +26,7 @@ export class InternalServerResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const InternalServerResponseError$inboundSchema = z.object({
29
- error: models.InternalServerResponseErrorData$inboundSchema,
29
+ error: models_InternalServerResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -3,7 +3,7 @@
3
3
  * @generated-id: bb73eae2fe73
4
4
  */
5
5
  import * as z from "zod/v4";
6
- import * as models from "../index.js";
6
+ import { InternChatError$inboundSchema as models_InternChatError$inboundSchema } from "../internchaterror.js";
7
7
  import { OpenRouterError } from "./openroutererror.js";
8
8
  /**
9
9
  * A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead.
@@ -20,7 +20,7 @@ export class InternChatErrorResponse extends OpenRouterError {
20
20
  }
21
21
  /** @internal */
22
22
  export const InternChatErrorResponse$inboundSchema = z.object({
23
- error: models.InternChatError$inboundSchema,
23
+ error: models_InternChatError$inboundSchema,
24
24
  request$: z.custom(x => x instanceof Request),
25
25
  response$: z.custom(x => x instanceof Response),
26
26
  body$: z.string(),
@@ -3,7 +3,7 @@
3
3
  * @generated-id: 31cfc72977f7
4
4
  */
5
5
  import * as z from "zod/v4";
6
- import * as models from "../index.js";
6
+ import { InternLifecycleErrorError$inboundSchema as models_InternLifecycleErrorError$inboundSchema } from "../internlifecycleerror.js";
7
7
  import { OpenRouterError } from "./openroutererror.js";
8
8
  /**
9
9
  * Intern lifecycle request failure.
@@ -20,7 +20,7 @@ export class InternLifecycleError extends OpenRouterError {
20
20
  }
21
21
  /** @internal */
22
22
  export const InternLifecycleError$inboundSchema = z.object({
23
- error: z.lazy(() => models.InternLifecycleErrorError$inboundSchema),
23
+ error: z.lazy(() => models_InternLifecycleErrorError$inboundSchema),
24
24
  request$: z.custom(x => x instanceof Request),
25
25
  response$: z.custom(x => x instanceof Response),
26
26
  body$: z.string(),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { NotFoundResponseErrorData$inboundSchema as models_NotFoundResponseErrorData$inboundSchema } from "../notfoundresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Not Found - Resource does not exist
@@ -26,7 +26,7 @@ export class NotFoundResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const NotFoundResponseError$inboundSchema = z.object({
29
- error: models.NotFoundResponseErrorData$inboundSchema,
29
+ error: models_NotFoundResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { ErrorEnum$inboundSchema as models_ErrorEnum$inboundSchema } from "../oautherrorresponse.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * RFC 6749 §5.2 error response.
@@ -23,7 +23,7 @@ export class OAuthErrorResponse extends OpenRouterError {
23
23
  }
24
24
  /** @internal */
25
25
  export const OAuthErrorResponse$inboundSchema = z.object({
26
- error: models.ErrorEnum$inboundSchema,
26
+ error: models_ErrorEnum$inboundSchema,
27
27
  error_description: z.string(),
28
28
  request$: z.custom(x => x instanceof Request),
29
29
  response$: z.custom(x => x instanceof Response),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { PayloadTooLargeResponseErrorData$inboundSchema as models_PayloadTooLargeResponseErrorData$inboundSchema } from "../payloadtoolargeresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Payload Too Large - Request payload exceeds size limits
@@ -26,7 +26,7 @@ export class PayloadTooLargeResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const PayloadTooLargeResponseError$inboundSchema = z.object({
29
- error: models.PayloadTooLargeResponseErrorData$inboundSchema,
29
+ error: models_PayloadTooLargeResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { PaymentRequiredResponseErrorData$inboundSchema as models_PaymentRequiredResponseErrorData$inboundSchema } from "../paymentrequiredresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Payment Required - Insufficient credits or quota to complete request
@@ -26,7 +26,7 @@ export class PaymentRequiredResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const PaymentRequiredResponseError$inboundSchema = z.object({
29
- error: models.PaymentRequiredResponseErrorData$inboundSchema,
29
+ error: models_PaymentRequiredResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { ProviderOverloadedResponseErrorData$inboundSchema as models_ProviderOverloadedResponseErrorData$inboundSchema } from "../provideroverloadedresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Provider Overloaded - Provider is temporarily overloaded
@@ -26,7 +26,7 @@ export class ProviderOverloadedResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const ProviderOverloadedResponseError$inboundSchema = z.object({
29
- error: models.ProviderOverloadedResponseErrorData$inboundSchema,
29
+ error: models_ProviderOverloadedResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { RequestTimeoutResponseErrorData$inboundSchema as models_RequestTimeoutResponseErrorData$inboundSchema } from "../requesttimeoutresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Request Timeout - Operation exceeded time limit
@@ -26,7 +26,7 @@ export class RequestTimeoutResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const RequestTimeoutResponseError$inboundSchema = z.object({
29
- error: models.RequestTimeoutResponseErrorData$inboundSchema,
29
+ error: models_RequestTimeoutResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { ServiceUnavailableResponseErrorData$inboundSchema as models_ServiceUnavailableResponseErrorData$inboundSchema } from "../serviceunavailableresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Service Unavailable - Service temporarily unavailable
@@ -26,7 +26,7 @@ export class ServiceUnavailableResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const ServiceUnavailableResponseError$inboundSchema = z.object({
29
- error: models.ServiceUnavailableResponseErrorData$inboundSchema,
29
+ error: models_ServiceUnavailableResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { TooManyRequestsResponseErrorData$inboundSchema as models_TooManyRequestsResponseErrorData$inboundSchema } from "../toomanyrequestsresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Too Many Requests - Rate limit exceeded
@@ -26,7 +26,7 @@ export class TooManyRequestsResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const TooManyRequestsResponseError$inboundSchema = z.object({
29
- error: models.TooManyRequestsResponseErrorData$inboundSchema,
29
+ error: models_TooManyRequestsResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { UnauthorizedResponseErrorData$inboundSchema as models_UnauthorizedResponseErrorData$inboundSchema } from "../unauthorizedresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Unauthorized - Authentication required or invalid credentials
@@ -26,7 +26,7 @@ export class UnauthorizedResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const UnauthorizedResponseError$inboundSchema = z.object({
29
- error: models.UnauthorizedResponseErrorData$inboundSchema,
29
+ error: models_UnauthorizedResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import * as models from "../index.js";
7
+ import { UnprocessableEntityResponseErrorData$inboundSchema as models_UnprocessableEntityResponseErrorData$inboundSchema } from "../unprocessableentityresponseerrordata.js";
8
8
  import { OpenRouterError } from "./openroutererror.js";
9
9
  /**
10
10
  * Unprocessable Entity - Semantic validation failure
@@ -26,7 +26,7 @@ export class UnprocessableEntityResponseError extends OpenRouterError {
26
26
  }
27
27
  /** @internal */
28
28
  export const UnprocessableEntityResponseError$inboundSchema = z.object({
29
- error: models.UnprocessableEntityResponseErrorData$inboundSchema,
29
+ error: models_UnprocessableEntityResponseErrorData$inboundSchema,
30
30
  openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
31
31
  user_id: z.nullable(z.string()).optional(),
32
32
  request$: z.custom(x => x instanceof Request),
@@ -19,23 +19,23 @@ export type FunctionCallItem = {
19
19
  /**
20
20
  * True when the model called a tool declared with `async: true` and may continue its turn before the output is returned. Return the result in a later request as a `function_call_output` with this `call_id`.
21
21
  */
22
- async?: boolean | undefined;
22
+ async?: boolean | null | undefined;
23
23
  callId: string;
24
- id: string;
24
+ id?: string | null | undefined;
25
25
  name: string;
26
26
  /**
27
27
  * Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)
28
28
  */
29
- namespace?: string | undefined;
30
- status?: ToolCallStatus | undefined;
29
+ namespace?: string | null | undefined;
30
+ status?: ToolCallStatus | null | undefined;
31
31
  /**
32
32
  * EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.
33
33
  */
34
- subagentId?: string | undefined;
34
+ subagentId?: string | null | undefined;
35
35
  /**
36
36
  * EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.
37
37
  */
38
- subagentItems?: Array<FunctionCallItemSubagentItem> | undefined;
38
+ subagentItems?: Array<FunctionCallItemSubagentItem> | null | undefined;
39
39
  type: FunctionCallItemType;
40
40
  };
41
41
  /** @internal */
@@ -51,14 +51,14 @@ export declare const FunctionCallItemType$outboundSchema: z.ZodEnum<typeof Funct
51
51
  /** @internal */
52
52
  export type FunctionCallItem$Outbound = {
53
53
  arguments: string;
54
- async?: boolean | undefined;
54
+ async?: boolean | null | undefined;
55
55
  call_id: string;
56
- id: string;
56
+ id?: string | null | undefined;
57
57
  name: string;
58
- namespace?: string | undefined;
59
- status?: string | undefined;
60
- subagent_id?: string | undefined;
61
- subagent_items?: Array<FunctionCallItemSubagentItem$Outbound> | undefined;
58
+ namespace?: string | null | undefined;
59
+ status?: string | null | undefined;
60
+ subagent_id?: string | null | undefined;
61
+ subagent_items?: Array<FunctionCallItemSubagentItem$Outbound> | null | undefined;
62
62
  type: string;
63
63
  };
64
64
  /** @internal */