@animalabs/membrane 0.5.69 → 0.5.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/formatters/index.d.ts +1 -0
- package/dist/formatters/index.d.ts.map +1 -1
- package/dist/formatters/index.js +1 -0
- package/dist/formatters/index.js.map +1 -1
- package/dist/formatters/native.d.ts.map +1 -1
- package/dist/formatters/native.js +6 -0
- package/dist/formatters/native.js.map +1 -1
- package/dist/formatters/openai-responses.d.ts +23 -0
- package/dist/formatters/openai-responses.d.ts.map +1 -0
- package/dist/formatters/openai-responses.js +188 -0
- package/dist/formatters/openai-responses.js.map +1 -0
- package/dist/membrane.d.ts.map +1 -1
- package/dist/membrane.js +29 -2
- package/dist/membrane.js.map +1 -1
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +32 -3
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +1 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai-responses-api.d.ts +129 -0
- package/dist/providers/openai-responses-api.d.ts.map +1 -0
- package/dist/providers/openai-responses-api.js +479 -0
- package/dist/providers/openai-responses-api.js.map +1 -0
- package/dist/types/content.d.ts +26 -0
- package/dist/types/content.d.ts.map +1 -1
- package/dist/types/content.js.map +1 -1
- package/package.json +1 -1
- package/src/formatters/index.ts +4 -0
- package/src/formatters/native.ts +5 -0
- package/src/formatters/openai-responses.ts +220 -0
- package/src/membrane.ts +28 -2
- package/src/providers/anthropic.ts +32 -4
- package/src/providers/index.ts +11 -0
- package/src/providers/openai-responses-api.ts +653 -0
- package/src/types/content.ts +26 -0
package/src/types/content.ts
CHANGED
|
@@ -38,6 +38,14 @@ export interface TextContent {
|
|
|
38
38
|
text: string;
|
|
39
39
|
/** Cache control for Anthropic prompt caching */
|
|
40
40
|
cache_control?: CacheControl;
|
|
41
|
+
/**
|
|
42
|
+
* Opaque provider-native item this block was derived from (e.g. an OpenAI
|
|
43
|
+
* Responses output item). Provider-native formatters replay it verbatim;
|
|
44
|
+
* other providers must ignore it. A zero-width carrier (`text: ''` plus
|
|
45
|
+
* `rawItem`) has no normalized equivalent and must be filtered out of
|
|
46
|
+
* requests for providers that reject empty text blocks (Anthropic).
|
|
47
|
+
*/
|
|
48
|
+
rawItem?: unknown;
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
// ============================================================================
|
|
@@ -52,24 +60,32 @@ export interface ImageContent {
|
|
|
52
60
|
* can auto-fetch URLs from text (like Gemini 3.x) when inlineData is
|
|
53
61
|
* not viable (e.g., missing thought_signature on model-role images). */
|
|
54
62
|
sourceUrl?: string;
|
|
63
|
+
/** See {@link TextContent.rawItem}. */
|
|
64
|
+
rawItem?: unknown;
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
export interface DocumentContent {
|
|
58
68
|
type: 'document';
|
|
59
69
|
source: Base64Source;
|
|
60
70
|
filename?: string;
|
|
71
|
+
/** See {@link TextContent.rawItem}. */
|
|
72
|
+
rawItem?: unknown;
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
export interface AudioContent {
|
|
64
76
|
type: 'audio';
|
|
65
77
|
source: Base64Source;
|
|
66
78
|
duration?: number; // seconds
|
|
79
|
+
/** See {@link TextContent.rawItem}. */
|
|
80
|
+
rawItem?: unknown;
|
|
67
81
|
}
|
|
68
82
|
|
|
69
83
|
export interface VideoContent {
|
|
70
84
|
type: 'video';
|
|
71
85
|
source: Base64Source;
|
|
72
86
|
duration?: number; // seconds
|
|
87
|
+
/** See {@link TextContent.rawItem}. */
|
|
88
|
+
rawItem?: unknown;
|
|
73
89
|
}
|
|
74
90
|
|
|
75
91
|
// ============================================================================
|
|
@@ -81,6 +97,8 @@ export interface GeneratedImageContent {
|
|
|
81
97
|
data: string;
|
|
82
98
|
mimeType: string;
|
|
83
99
|
isPreview?: boolean; // Streaming: preview vs final
|
|
100
|
+
/** See {@link TextContent.rawItem}. */
|
|
101
|
+
rawItem?: unknown;
|
|
84
102
|
}
|
|
85
103
|
|
|
86
104
|
// ============================================================================
|
|
@@ -92,6 +110,8 @@ export interface ToolUseContent {
|
|
|
92
110
|
id: string;
|
|
93
111
|
name: string;
|
|
94
112
|
input: Record<string, unknown>;
|
|
113
|
+
/** See {@link TextContent.rawItem}. */
|
|
114
|
+
rawItem?: unknown;
|
|
95
115
|
}
|
|
96
116
|
|
|
97
117
|
export interface ToolResultContent {
|
|
@@ -99,6 +119,8 @@ export interface ToolResultContent {
|
|
|
99
119
|
toolUseId: string;
|
|
100
120
|
content: string | ContentBlock[];
|
|
101
121
|
isError?: boolean;
|
|
122
|
+
/** See {@link TextContent.rawItem}. */
|
|
123
|
+
rawItem?: unknown;
|
|
102
124
|
}
|
|
103
125
|
|
|
104
126
|
// ============================================================================
|
|
@@ -109,6 +131,8 @@ export interface ThinkingContent {
|
|
|
109
131
|
type: 'thinking';
|
|
110
132
|
thinking: string;
|
|
111
133
|
signature?: string;
|
|
134
|
+
/** See {@link TextContent.rawItem}. */
|
|
135
|
+
rawItem?: unknown;
|
|
112
136
|
}
|
|
113
137
|
|
|
114
138
|
export interface RedactedThinkingContent {
|
|
@@ -119,6 +143,8 @@ export interface RedactedThinkingContent {
|
|
|
119
143
|
* (the API decrypts it to reconstruct prior reasoning).
|
|
120
144
|
*/
|
|
121
145
|
data: string;
|
|
146
|
+
/** See {@link TextContent.rawItem}. */
|
|
147
|
+
rawItem?: unknown;
|
|
122
148
|
}
|
|
123
149
|
|
|
124
150
|
// ============================================================================
|