@openrouter/sdk 1.5.55 → 1.5.57

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 (104) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/additionaltoolsitem.d.ts +5 -4
  4. package/esm/models/additionaltoolsitem.js +3 -0
  5. package/esm/models/alignmentresponsesrejected.d.ts +4 -1
  6. package/esm/models/alignmentresponsesrejected.js +6 -0
  7. package/esm/models/byokproviderslug.d.ts +1 -0
  8. package/esm/models/byokproviderslug.js +1 -0
  9. package/esm/models/createworkspacerequest.d.ts +1 -0
  10. package/esm/models/createworkspacerequest.js +1 -0
  11. package/esm/models/decisionschoicequestion.d.ts +4 -4
  12. package/esm/models/decisionschoicequestion.js +1 -5
  13. package/esm/models/decisionsnoulquestion.d.ts +12 -12
  14. package/esm/models/decisionsnoulquestion.js +3 -7
  15. package/esm/models/decisionsscorequestion.d.ts +4 -4
  16. package/esm/models/decisionsscorequestion.js +1 -5
  17. package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
  18. package/esm/models/imagegenerationproviderpreferences.js +1 -0
  19. package/esm/models/imagegenerationrequest.d.ts +51 -4
  20. package/esm/models/imagegenerationrequest.js +32 -1
  21. package/esm/models/index.d.ts +6 -0
  22. package/esm/models/index.js +6 -0
  23. package/esm/models/mcpapprovalrequestitem.d.ts +7 -0
  24. package/esm/models/mcpapprovalrequestitem.js +19 -1
  25. package/esm/models/mcpcallitem.d.ts +17 -1
  26. package/esm/models/mcpcallitem.js +18 -0
  27. package/esm/models/mcpservertool.d.ts +78 -69
  28. package/esm/models/mcpservertool.js +135 -105
  29. package/esm/models/mcpservertoolopenrouter.d.ts +28 -0
  30. package/esm/models/mcpservertoolopenrouter.js +20 -0
  31. package/esm/models/mcpservertoolparameters.d.ts +152 -0
  32. package/esm/models/mcpservertoolparameters.js +134 -0
  33. package/esm/models/openairesponsestoolchoiceunion.d.ts +3 -2
  34. package/esm/models/openairesponsestoolchoiceunion.js +3 -0
  35. package/esm/models/operations/listbyokkeys.d.ts +1 -0
  36. package/esm/models/operations/listbyokkeys.js +1 -0
  37. package/esm/models/outputitemmcpapprovalrequest.d.ts +14 -0
  38. package/esm/models/outputitemmcpapprovalrequest.js +23 -0
  39. package/esm/models/outputitemmcpcall.d.ts +74 -0
  40. package/esm/models/outputitemmcpcall.js +94 -0
  41. package/esm/models/outputitemmcplisttools.d.ts +25 -0
  42. package/esm/models/outputitemmcplisttools.js +37 -0
  43. package/esm/models/outputitems.d.ts +3 -0
  44. package/esm/models/outputitems.js +2 -0
  45. package/esm/models/providername.d.ts +1 -0
  46. package/esm/models/providername.js +1 -0
  47. package/esm/models/provideroptions.d.ts +6 -0
  48. package/esm/models/provideroptions.js +1 -0
  49. package/esm/models/providerresponse.d.ts +1 -0
  50. package/esm/models/providerresponse.js +1 -0
  51. package/esm/models/responsesrequest.d.ts +9 -0
  52. package/esm/models/responsesrequest.js +3 -0
  53. package/esm/models/toolchoicemcp.d.ts +33 -0
  54. package/esm/models/toolchoicemcp.js +42 -0
  55. package/esm/models/toolsearchoutputitem.d.ts +5 -4
  56. package/esm/models/toolsearchoutputitem.js +3 -0
  57. package/esm/models/updateworkspacerequest.d.ts +1 -0
  58. package/esm/models/updateworkspacerequest.js +1 -0
  59. package/esm/models/videogenerationrequest.d.ts +6 -0
  60. package/esm/models/videogenerationrequest.js +1 -0
  61. package/esm/sdk/sdk.d.ts +0 -9
  62. package/esm/sdk/sdk.js +1 -7
  63. package/jsr.json +1 -1
  64. package/package.json +5 -5
  65. package/esm/funcs/call-model.d.ts +0 -67
  66. package/esm/funcs/call-model.js +0 -98
  67. package/esm/lib/anthropic-compat.d.ts +0 -51
  68. package/esm/lib/anthropic-compat.js +0 -222
  69. package/esm/lib/async-params.d.ts +0 -107
  70. package/esm/lib/async-params.js +0 -88
  71. package/esm/lib/chat-compat.d.ts +0 -47
  72. package/esm/lib/chat-compat.js +0 -111
  73. package/esm/lib/claude-constants.d.ts +0 -22
  74. package/esm/lib/claude-constants.js +0 -20
  75. package/esm/lib/claude-type-guards.d.ts +0 -10
  76. package/esm/lib/claude-type-guards.js +0 -70
  77. package/esm/lib/conversation-state.d.ts +0 -63
  78. package/esm/lib/conversation-state.js +0 -210
  79. package/esm/lib/model-result.d.ts +0 -373
  80. package/esm/lib/model-result.js +0 -1414
  81. package/esm/lib/next-turn-params.d.ts +0 -30
  82. package/esm/lib/next-turn-params.js +0 -135
  83. package/esm/lib/reusable-stream.d.ts +0 -39
  84. package/esm/lib/reusable-stream.js +0 -192
  85. package/esm/lib/stop-conditions.d.ts +0 -80
  86. package/esm/lib/stop-conditions.js +0 -104
  87. package/esm/lib/stream-transformers.d.ts +0 -118
  88. package/esm/lib/stream-transformers.js +0 -852
  89. package/esm/lib/stream-type-guards.d.ts +0 -49
  90. package/esm/lib/stream-type-guards.js +0 -85
  91. package/esm/lib/tool-context.d.ts +0 -68
  92. package/esm/lib/tool-context.js +0 -175
  93. package/esm/lib/tool-event-broadcaster.d.ts +0 -44
  94. package/esm/lib/tool-event-broadcaster.js +0 -146
  95. package/esm/lib/tool-executor.d.ts +0 -74
  96. package/esm/lib/tool-executor.js +0 -267
  97. package/esm/lib/tool-orchestrator.d.ts +0 -52
  98. package/esm/lib/tool-orchestrator.js +0 -180
  99. package/esm/lib/tool-types.d.ts +0 -573
  100. package/esm/lib/tool-types.js +0 -80
  101. package/esm/lib/tool.d.ts +0 -108
  102. package/esm/lib/tool.js +0 -74
  103. package/esm/lib/turn-context.d.ts +0 -52
  104. package/esm/lib/turn-context.js +0 -59
@@ -1,118 +0,0 @@
1
- import type { ChatAssistantMessage } from '../models/chatassistantmessage.js';
2
- import type { FunctionCallOutputItem } from '../models/functioncalloutputitem.js';
3
- import type { OpenResponsesResult } from '../models/openresponsesresult.js';
4
- import type { OutputFileSearchCallItem } from '../models/outputfilesearchcallitem.js';
5
- import type { OutputFunctionCallItem } from '../models/outputfunctioncallitem.js';
6
- import type { OutputImageGenerationCallItem } from '../models/outputimagegenerationcallitem.js';
7
- import type { OutputMessage } from '../models/outputmessage.js';
8
- import type { OutputReasoningItem } from '../models/outputreasoningitem.js';
9
- import type { OutputWebSearchCallItem } from '../models/outputwebsearchcallitem.js';
10
- import type { StreamEvents } from '../models/streamevents.js';
11
- import type { ClaudeMessage, UnsupportedContent } from '../models/claude-message.js';
12
- import type { ReusableReadableStream } from './reusable-stream.js';
13
- import type { ParsedToolCall, Tool } from './tool-types.js';
14
- /**
15
- * Extract text deltas from responses stream events
16
- */
17
- export declare function extractTextDeltas(stream: ReusableReadableStream<StreamEvents>): AsyncIterableIterator<string>;
18
- /**
19
- * Extract reasoning deltas from responses stream events
20
- */
21
- export declare function extractReasoningDeltas(stream: ReusableReadableStream<StreamEvents>): AsyncIterableIterator<string>;
22
- /**
23
- * Extract tool call argument deltas from responses stream events
24
- */
25
- export declare function extractToolDeltas(stream: ReusableReadableStream<StreamEvents>): AsyncIterableIterator<string>;
26
- /**
27
- * Build incremental message updates from responses stream events
28
- * Returns OutputMessage (assistant/responses format)
29
- */
30
- export declare function buildResponsesMessageStream(stream: ReusableReadableStream<StreamEvents>): AsyncIterableIterator<OutputMessage>;
31
- /**
32
- * Output item types that can be streamed from a response.
33
- * This is the union of all item types that appear in response output,
34
- * plus function_call_output for tool results.
35
- */
36
- export type StreamableOutputItem = OutputMessage | OutputFunctionCallItem | OutputReasoningItem | OutputWebSearchCallItem | OutputFileSearchCallItem | OutputImageGenerationCallItem | FunctionCallOutputItem;
37
- /**
38
- * Discriminated union for tracking items in progress.
39
- * Each variant has only the fields relevant to that item type.
40
- */
41
- export type ItemInProgress = {
42
- type: 'message';
43
- id: string;
44
- textContent: string;
45
- } | {
46
- type: 'function_call';
47
- id: string;
48
- name: string;
49
- callId: string;
50
- argumentsAccumulated: string;
51
- } | {
52
- type: 'reasoning';
53
- id: string;
54
- reasoningContent: string;
55
- };
56
- type ItemsStreamHandler = (event: StreamEvents, itemsInProgress: Map<string, ItemInProgress>) => StreamableOutputItem | undefined;
57
- export declare const itemsStreamHandlers: Record<string, ItemsStreamHandler>;
58
- export declare const streamTerminationEvents: Set<string>;
59
- /**
60
- * Build incremental output item updates from responses stream events.
61
- * Yields all item types cumulatively - same item may be emitted multiple times
62
- * with the same ID but progressively updated content as streaming progresses.
63
- */
64
- export declare function buildItemsStream(stream: ReusableReadableStream<StreamEvents>): AsyncIterableIterator<StreamableOutputItem>;
65
- /**
66
- * Build incremental message updates from responses stream events
67
- * Returns ChatAssistantMessage (chat format) instead of OutputMessage
68
- */
69
- export declare function buildMessageStream(stream: ReusableReadableStream<StreamEvents>): AsyncIterableIterator<ChatAssistantMessage>;
70
- /**
71
- * Consume stream until completion and return the complete response
72
- */
73
- export declare function consumeStreamForCompletion(stream: ReusableReadableStream<StreamEvents>): Promise<OpenResponsesResult>;
74
- /**
75
- * Extract the first message from a completed response (chat format)
76
- */
77
- export declare function extractMessageFromResponse(response: OpenResponsesResult): ChatAssistantMessage;
78
- /**
79
- * Extract the first message from a completed response (responses format)
80
- */
81
- export declare function extractResponsesMessageFromResponse(response: OpenResponsesResult): OutputMessage;
82
- /**
83
- * Extract text from a response, either from outputText or by concatenating message content
84
- */
85
- export declare function extractTextFromResponse(response: OpenResponsesResult): string;
86
- /**
87
- * Extract all tool calls from a completed response
88
- * Returns parsed tool calls with arguments as objects (not JSON strings)
89
- */
90
- export declare function extractToolCallsFromResponse(response: OpenResponsesResult): ParsedToolCall<Tool>[];
91
- /**
92
- * Build incremental tool call updates from responses stream events
93
- * Yields structured tool call objects as they're built from deltas
94
- */
95
- export declare function buildToolCallStream(stream: ReusableReadableStream<StreamEvents>): AsyncIterableIterator<ParsedToolCall<Tool>>;
96
- /**
97
- * Check if a response contains any tool calls
98
- */
99
- export declare function responseHasToolCalls(response: OpenResponsesResult): boolean;
100
- /**
101
- * Convert OpenResponsesResult to ClaudeMessage format
102
- * Compatible with the Anthropic SDK BetaMessage type
103
- */
104
- export declare function convertToClaudeMessage(response: OpenResponsesResult): ClaudeMessage;
105
- /**
106
- * Extract unsupported content by original type
107
- */
108
- export declare function extractUnsupportedContent(message: ClaudeMessage, originalType: string): UnsupportedContent[];
109
- /**
110
- * Check if message has any unsupported content
111
- */
112
- export declare function hasUnsupportedContent(message: ClaudeMessage): boolean;
113
- /**
114
- * Get summary of unsupported content types
115
- */
116
- export declare function getUnsupportedContentSummary(message: ClaudeMessage): Record<string, number>;
117
- export {};
118
- //# sourceMappingURL=stream-transformers.d.ts.map