@animalabs/membrane 0.5.63 → 0.5.65
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/membrane.d.ts +24 -0
- package/dist/membrane.d.ts.map +1 -1
- package/dist/membrane.js +104 -44
- package/dist/membrane.js.map +1 -1
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +11 -1
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/bedrock.d.ts.map +1 -1
- package/dist/providers/bedrock.js +14 -4
- package/dist/providers/bedrock.js.map +1 -1
- package/dist/types/content.d.ts +6 -0
- package/dist/types/content.d.ts.map +1 -1
- package/dist/types/content.js.map +1 -1
- package/dist/types/tools.d.ts +9 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/membrane.ts +119 -49
- package/src/providers/anthropic.ts +13 -2
- package/src/providers/bedrock.ts +13 -4
- package/src/types/content.ts +6 -0
- package/src/types/tools.ts +14 -4
package/src/types/content.ts
CHANGED
|
@@ -113,6 +113,12 @@ export interface ThinkingContent {
|
|
|
113
113
|
|
|
114
114
|
export interface RedactedThinkingContent {
|
|
115
115
|
type: 'redacted_thinking';
|
|
116
|
+
/**
|
|
117
|
+
* Encrypted reasoning payload from the provider. Opaque — must be
|
|
118
|
+
* round-tripped verbatim in assistant turns or the block is worthless
|
|
119
|
+
* (the API decrypts it to reconstruct prior reasoning).
|
|
120
|
+
*/
|
|
121
|
+
data: string;
|
|
116
122
|
}
|
|
117
123
|
|
|
118
124
|
// ============================================================================
|
package/src/types/tools.ts
CHANGED
|
@@ -59,18 +59,28 @@ export type ToolResultContentBlock =
|
|
|
59
59
|
export interface ToolContext {
|
|
60
60
|
/** The raw text that contained the tool calls */
|
|
61
61
|
rawText: string;
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
/** Text before the tool calls (already streamed to user) */
|
|
64
64
|
preamble: string;
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
/** Current depth in tool execution loop */
|
|
67
67
|
depth: number;
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
/** Previous tool results in this execution chain */
|
|
70
70
|
previousResults: ToolResult[];
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
/** Accumulated output so far */
|
|
73
73
|
accumulated: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Normalized content blocks of the current assistant round, in provider
|
|
77
|
+
* order (thinking / redacted_thinking / text / tool_use). Present on the
|
|
78
|
+
* native-tools yielding path. Consumers persisting the assistant turn
|
|
79
|
+
* should use these verbatim instead of rebuilding from `preamble` +
|
|
80
|
+
* `calls` — signed thinking blocks must precede their tool_use in the
|
|
81
|
+
* same turn or the next request fails API validation.
|
|
82
|
+
*/
|
|
83
|
+
roundContent?: import('./content.js').ContentBlock[];
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
// ============================================================================
|