@tarquinen/opencode-dcp 0.3.30 → 0.4.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.
- package/README.md +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/api-formats/prunable-list.d.ts +49 -0
- package/dist/lib/api-formats/prunable-list.d.ts.map +1 -0
- package/dist/lib/api-formats/prunable-list.js +112 -0
- package/dist/lib/api-formats/prunable-list.js.map +1 -0
- package/dist/lib/api-formats/synth-instruction.d.ts +29 -0
- package/dist/lib/api-formats/synth-instruction.d.ts.map +1 -0
- package/dist/lib/api-formats/synth-instruction.js +171 -0
- package/dist/lib/api-formats/synth-instruction.js.map +1 -0
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +13 -7
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/core/janitor.d.ts +60 -0
- package/dist/lib/core/janitor.d.ts.map +1 -0
- package/dist/lib/core/janitor.js +301 -0
- package/dist/lib/core/janitor.js.map +1 -0
- package/dist/lib/core/prompt.d.ts.map +1 -0
- package/dist/lib/{prompt.js → core/prompt.js} +1 -1
- package/dist/lib/core/prompt.js.map +1 -0
- package/dist/lib/core/strategies/deduplication.d.ts +7 -0
- package/dist/lib/core/strategies/deduplication.d.ts.map +1 -0
- package/dist/lib/core/strategies/deduplication.js +76 -0
- package/dist/lib/core/strategies/deduplication.js.map +1 -0
- package/dist/lib/core/strategies/index.d.ts +21 -0
- package/dist/lib/core/strategies/index.d.ts.map +1 -0
- package/dist/lib/core/strategies/index.js +48 -0
- package/dist/lib/core/strategies/index.js.map +1 -0
- package/dist/lib/core/strategies/types.d.ts +35 -0
- package/dist/lib/core/strategies/types.d.ts.map +1 -0
- package/dist/lib/core/strategies/types.js +6 -0
- package/dist/lib/core/strategies/types.js.map +1 -0
- package/dist/lib/fetch-wrapper/formats/bedrock.d.ts +14 -0
- package/dist/lib/fetch-wrapper/formats/bedrock.d.ts.map +1 -0
- package/dist/lib/fetch-wrapper/formats/bedrock.js +128 -0
- package/dist/lib/fetch-wrapper/formats/bedrock.js.map +1 -0
- package/dist/lib/fetch-wrapper/formats/gemini.d.ts +14 -0
- package/dist/lib/fetch-wrapper/formats/gemini.d.ts.map +1 -0
- package/dist/lib/fetch-wrapper/formats/gemini.js +138 -0
- package/dist/lib/fetch-wrapper/formats/gemini.js.map +1 -0
- package/dist/lib/fetch-wrapper/formats/index.d.ts +5 -0
- package/dist/lib/fetch-wrapper/formats/index.d.ts.map +1 -0
- package/dist/lib/fetch-wrapper/formats/index.js +5 -0
- package/dist/lib/fetch-wrapper/formats/index.js.map +1 -0
- package/dist/lib/fetch-wrapper/formats/openai-chat.d.ts +14 -0
- package/dist/lib/fetch-wrapper/formats/openai-chat.d.ts.map +1 -0
- package/dist/lib/fetch-wrapper/formats/openai-chat.js +106 -0
- package/dist/lib/fetch-wrapper/formats/openai-chat.js.map +1 -0
- package/dist/lib/fetch-wrapper/formats/openai-responses.d.ts +11 -0
- package/dist/lib/fetch-wrapper/formats/openai-responses.d.ts.map +1 -0
- package/dist/lib/fetch-wrapper/formats/openai-responses.js +69 -0
- package/dist/lib/fetch-wrapper/formats/openai-responses.js.map +1 -0
- package/dist/lib/fetch-wrapper/gc-tracker.d.ts +4 -0
- package/dist/lib/fetch-wrapper/gc-tracker.d.ts.map +1 -0
- package/dist/lib/fetch-wrapper/gc-tracker.js +61 -0
- package/dist/lib/fetch-wrapper/gc-tracker.js.map +1 -0
- package/dist/lib/fetch-wrapper/handler.d.ts +13 -0
- package/dist/lib/fetch-wrapper/handler.d.ts.map +1 -0
- package/dist/lib/fetch-wrapper/handler.js +85 -0
- package/dist/lib/fetch-wrapper/handler.js.map +1 -0
- package/dist/lib/fetch-wrapper/index.d.ts +3 -2
- package/dist/lib/fetch-wrapper/index.d.ts.map +1 -1
- package/dist/lib/fetch-wrapper/index.js +41 -15
- package/dist/lib/fetch-wrapper/index.js.map +1 -1
- package/dist/lib/fetch-wrapper/types.d.ts +36 -1
- package/dist/lib/fetch-wrapper/types.d.ts.map +1 -1
- package/dist/lib/fetch-wrapper/types.js +7 -1
- package/dist/lib/fetch-wrapper/types.js.map +1 -1
- package/dist/lib/hooks.d.ts +3 -3
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/hooks.js +25 -15
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/prompts/tool.txt +18 -5
- package/dist/lib/pruning-tool.d.ts +14 -6
- package/dist/lib/pruning-tool.d.ts.map +1 -1
- package/dist/lib/pruning-tool.js +121 -19
- package/dist/lib/pruning-tool.js.map +1 -1
- package/dist/lib/state/id-mapping.d.ts +26 -0
- package/dist/lib/state/id-mapping.d.ts.map +1 -0
- package/dist/lib/state/id-mapping.js +54 -0
- package/dist/lib/state/id-mapping.js.map +1 -0
- package/dist/lib/state/index.d.ts +25 -0
- package/dist/lib/state/index.d.ts.map +1 -0
- package/dist/lib/{state.js → state/index.js} +10 -6
- package/dist/lib/state/index.js.map +1 -0
- package/dist/lib/{state-persistence.d.ts → state/persistence.d.ts} +3 -3
- package/dist/lib/state/persistence.d.ts.map +1 -0
- package/dist/lib/{state-persistence.js → state/persistence.js} +1 -1
- package/dist/lib/state/persistence.js.map +1 -0
- package/dist/lib/state/tool-cache.d.ts +22 -0
- package/dist/lib/state/tool-cache.d.ts.map +1 -0
- package/dist/lib/state/tool-cache.js +102 -0
- package/dist/lib/state/tool-cache.js.map +1 -0
- package/dist/lib/tokenizer.js +2 -2
- package/dist/lib/tokenizer.js.map +1 -1
- package/dist/lib/ui/display-utils.d.ts.map +1 -0
- package/dist/lib/{display-utils.js → ui/display-utils.js} +0 -3
- package/dist/lib/ui/display-utils.js.map +1 -0
- package/dist/lib/ui/notification.d.ts +32 -0
- package/dist/lib/ui/notification.d.ts.map +1 -0
- package/dist/lib/ui/notification.js +180 -0
- package/dist/lib/ui/notification.js.map +1 -0
- package/dist/lib/version-checker.d.ts +1 -1
- package/dist/lib/version-checker.d.ts.map +1 -1
- package/dist/lib/version-checker.js +4 -1
- package/dist/lib/version-checker.js.map +1 -1
- package/package.json +6 -6
- package/dist/lib/deduplicator.d.ts +0 -16
- package/dist/lib/deduplicator.d.ts.map +0 -1
- package/dist/lib/deduplicator.js +0 -68
- package/dist/lib/deduplicator.js.map +0 -1
- package/dist/lib/display-utils.d.ts.map +0 -1
- package/dist/lib/display-utils.js.map +0 -1
- package/dist/lib/fetch-wrapper/gemini.d.ts +0 -7
- package/dist/lib/fetch-wrapper/gemini.d.ts.map +0 -1
- package/dist/lib/fetch-wrapper/gemini.js +0 -120
- package/dist/lib/fetch-wrapper/gemini.js.map +0 -1
- package/dist/lib/fetch-wrapper/openai-chat.d.ts +0 -7
- package/dist/lib/fetch-wrapper/openai-chat.d.ts.map +0 -1
- package/dist/lib/fetch-wrapper/openai-chat.js +0 -101
- package/dist/lib/fetch-wrapper/openai-chat.js.map +0 -1
- package/dist/lib/fetch-wrapper/openai-responses.d.ts +0 -7
- package/dist/lib/fetch-wrapper/openai-responses.d.ts.map +0 -1
- package/dist/lib/fetch-wrapper/openai-responses.js +0 -74
- package/dist/lib/fetch-wrapper/openai-responses.js.map +0 -1
- package/dist/lib/janitor.d.ts +0 -57
- package/dist/lib/janitor.d.ts.map +0 -1
- package/dist/lib/janitor.js +0 -547
- package/dist/lib/janitor.js.map +0 -1
- package/dist/lib/prompt.d.ts.map +0 -1
- package/dist/lib/prompt.js.map +0 -1
- package/dist/lib/state-persistence.d.ts.map +0 -1
- package/dist/lib/state-persistence.js.map +0 -1
- package/dist/lib/state.d.ts +0 -43
- package/dist/lib/state.d.ts.map +0 -1
- package/dist/lib/state.js.map +0 -1
- package/dist/lib/synth-instruction.d.ts +0 -16
- package/dist/lib/synth-instruction.d.ts.map +0 -1
- package/dist/lib/synth-instruction.js +0 -209
- package/dist/lib/synth-instruction.js.map +0 -1
- package/dist/lib/tool-cache.d.ts +0 -12
- package/dist/lib/tool-cache.d.ts.map +0 -1
- package/dist/lib/tool-cache.js +0 -52
- package/dist/lib/tool-cache.js.map +0 -1
- /package/dist/lib/{prompt.d.ts → core/prompt.d.ts} +0 -0
- /package/dist/lib/{display-utils.d.ts → ui/display-utils.d.ts} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common interface for rule-based pruning strategies.
|
|
3
|
+
* Each strategy analyzes tool metadata and returns IDs that should be pruned.
|
|
4
|
+
*/
|
|
5
|
+
export interface ToolMetadata {
|
|
6
|
+
tool: string;
|
|
7
|
+
parameters?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface StrategyResult {
|
|
10
|
+
/** Tool call IDs that should be pruned */
|
|
11
|
+
prunedIds: string[];
|
|
12
|
+
/** Optional details about what was pruned and why */
|
|
13
|
+
details?: Map<string, StrategyDetail>;
|
|
14
|
+
}
|
|
15
|
+
export interface StrategyDetail {
|
|
16
|
+
toolName: string;
|
|
17
|
+
parameterKey: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
/** Additional info specific to the strategy */
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
export interface PruningStrategy {
|
|
23
|
+
/** Unique identifier for this strategy */
|
|
24
|
+
name: string;
|
|
25
|
+
/**
|
|
26
|
+
* Analyze tool metadata and determine which tool calls should be pruned.
|
|
27
|
+
*
|
|
28
|
+
* @param toolMetadata - Map of tool call ID to metadata (tool name + parameters)
|
|
29
|
+
* @param unprunedIds - Tool call IDs that haven't been pruned yet (chronological order)
|
|
30
|
+
* @param protectedTools - Tool names that should never be pruned
|
|
31
|
+
* @returns IDs to prune and optional details
|
|
32
|
+
*/
|
|
33
|
+
detect(toolMetadata: Map<string, ToolMetadata>, unprunedIds: string[], protectedTools: string[]): StrategyResult;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../lib/core/strategies/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,GAAG,CAAA;CACnB;AAED,MAAM,WAAW,cAAc;IAC3B,0CAA0C;IAC1C,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,+CAA+C;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB;AAED,MAAM,WAAW,eAAe;IAC5B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IAEZ;;;;;;;OAOG;IACH,MAAM,CACF,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACvC,WAAW,EAAE,MAAM,EAAE,EACrB,cAAc,EAAE,MAAM,EAAE,GACzB,cAAc,CAAA;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../lib/core/strategies/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FormatDescriptor } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Format descriptor for AWS Bedrock Converse API.
|
|
4
|
+
*
|
|
5
|
+
* Bedrock format characteristics:
|
|
6
|
+
* - Top-level `system` array for system messages
|
|
7
|
+
* - `messages` array with only 'user' and 'assistant' roles
|
|
8
|
+
* - `inferenceConfig` for model parameters (maxTokens, temperature, etc.)
|
|
9
|
+
* - Tool calls: `toolUse` blocks in assistant content with `toolUseId`
|
|
10
|
+
* - Tool results: `toolResult` blocks in user content with `toolUseId`
|
|
11
|
+
* - Cache points: `cachePoint` blocks that should be preserved
|
|
12
|
+
*/
|
|
13
|
+
export declare const bedrockFormat: FormatDescriptor;
|
|
14
|
+
//# sourceMappingURL=bedrock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bedrock.d.ts","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/bedrock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,UAAU,CAAA;AAQ5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,EAAE,gBAgI3B,CAAA"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { cacheToolParametersFromMessages } from "../../state/tool-cache";
|
|
2
|
+
import { injectSynth, trackNewToolResults } from "../../api-formats/synth-instruction";
|
|
3
|
+
import { injectPrunableList } from "../../api-formats/prunable-list";
|
|
4
|
+
/**
|
|
5
|
+
* Format descriptor for AWS Bedrock Converse API.
|
|
6
|
+
*
|
|
7
|
+
* Bedrock format characteristics:
|
|
8
|
+
* - Top-level `system` array for system messages
|
|
9
|
+
* - `messages` array with only 'user' and 'assistant' roles
|
|
10
|
+
* - `inferenceConfig` for model parameters (maxTokens, temperature, etc.)
|
|
11
|
+
* - Tool calls: `toolUse` blocks in assistant content with `toolUseId`
|
|
12
|
+
* - Tool results: `toolResult` blocks in user content with `toolUseId`
|
|
13
|
+
* - Cache points: `cachePoint` blocks that should be preserved
|
|
14
|
+
*/
|
|
15
|
+
export const bedrockFormat = {
|
|
16
|
+
name: 'bedrock',
|
|
17
|
+
detect(body) {
|
|
18
|
+
// Bedrock has a top-level system array AND inferenceConfig (not model params in messages)
|
|
19
|
+
// This distinguishes it from OpenAI/Anthropic which put system in messages
|
|
20
|
+
return (Array.isArray(body.system) &&
|
|
21
|
+
body.inferenceConfig !== undefined &&
|
|
22
|
+
Array.isArray(body.messages));
|
|
23
|
+
},
|
|
24
|
+
getDataArray(body) {
|
|
25
|
+
return body.messages;
|
|
26
|
+
},
|
|
27
|
+
cacheToolParameters(data, state, logger) {
|
|
28
|
+
// Bedrock stores tool calls in assistant message content as toolUse blocks
|
|
29
|
+
// We need to extract toolUseId and tool name for later correlation
|
|
30
|
+
for (const m of data) {
|
|
31
|
+
if (m.role === 'assistant' && Array.isArray(m.content)) {
|
|
32
|
+
for (const block of m.content) {
|
|
33
|
+
if (block.toolUse && block.toolUse.toolUseId) {
|
|
34
|
+
const toolUseId = block.toolUse.toolUseId.toLowerCase();
|
|
35
|
+
state.toolParameters.set(toolUseId, {
|
|
36
|
+
tool: block.toolUse.name,
|
|
37
|
+
parameters: block.toolUse.input
|
|
38
|
+
});
|
|
39
|
+
logger?.debug("bedrock", "Cached tool parameters", {
|
|
40
|
+
toolUseId,
|
|
41
|
+
toolName: block.toolUse.name
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Also use the generic message caching for any compatible structures
|
|
48
|
+
cacheToolParametersFromMessages(data, state, logger);
|
|
49
|
+
},
|
|
50
|
+
injectSynth(data, instruction, nudgeText) {
|
|
51
|
+
return injectSynth(data, instruction, nudgeText);
|
|
52
|
+
},
|
|
53
|
+
trackNewToolResults(data, tracker, protectedTools) {
|
|
54
|
+
return trackNewToolResults(data, tracker, protectedTools);
|
|
55
|
+
},
|
|
56
|
+
injectPrunableList(data, injection) {
|
|
57
|
+
return injectPrunableList(data, injection);
|
|
58
|
+
},
|
|
59
|
+
extractToolOutputs(data, state) {
|
|
60
|
+
const outputs = [];
|
|
61
|
+
for (const m of data) {
|
|
62
|
+
// Bedrock tool results are in user messages as toolResult blocks
|
|
63
|
+
if (m.role === 'user' && Array.isArray(m.content)) {
|
|
64
|
+
for (const block of m.content) {
|
|
65
|
+
if (block.toolResult && block.toolResult.toolUseId) {
|
|
66
|
+
const toolUseId = block.toolResult.toolUseId.toLowerCase();
|
|
67
|
+
const metadata = state.toolParameters.get(toolUseId);
|
|
68
|
+
outputs.push({
|
|
69
|
+
id: toolUseId,
|
|
70
|
+
toolName: metadata?.tool
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return outputs;
|
|
77
|
+
},
|
|
78
|
+
replaceToolOutput(data, toolId, prunedMessage, _state) {
|
|
79
|
+
const toolIdLower = toolId.toLowerCase();
|
|
80
|
+
let replaced = false;
|
|
81
|
+
for (let i = 0; i < data.length; i++) {
|
|
82
|
+
const m = data[i];
|
|
83
|
+
// Tool results are in user messages as toolResult blocks
|
|
84
|
+
if (m.role === 'user' && Array.isArray(m.content)) {
|
|
85
|
+
let messageModified = false;
|
|
86
|
+
const newContent = m.content.map((block) => {
|
|
87
|
+
if (block.toolResult && block.toolResult.toolUseId?.toLowerCase() === toolIdLower) {
|
|
88
|
+
messageModified = true;
|
|
89
|
+
// Replace the content array inside toolResult with pruned message
|
|
90
|
+
return {
|
|
91
|
+
...block,
|
|
92
|
+
toolResult: {
|
|
93
|
+
...block.toolResult,
|
|
94
|
+
content: [{ text: prunedMessage }]
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return block;
|
|
99
|
+
});
|
|
100
|
+
if (messageModified) {
|
|
101
|
+
data[i] = { ...m, content: newContent };
|
|
102
|
+
replaced = true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return replaced;
|
|
107
|
+
},
|
|
108
|
+
hasToolOutputs(data) {
|
|
109
|
+
for (const m of data) {
|
|
110
|
+
if (m.role === 'user' && Array.isArray(m.content)) {
|
|
111
|
+
for (const block of m.content) {
|
|
112
|
+
if (block.toolResult)
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return false;
|
|
118
|
+
},
|
|
119
|
+
getLogMetadata(data, replacedCount, inputUrl) {
|
|
120
|
+
return {
|
|
121
|
+
url: inputUrl,
|
|
122
|
+
replacedCount,
|
|
123
|
+
totalMessages: data.length,
|
|
124
|
+
format: 'bedrock'
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=bedrock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bedrock.js","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/bedrock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAEpE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC3C,IAAI,EAAE,SAAS;IAEf,MAAM,CAAC,IAAS;QACZ,0FAA0F;QAC1F,2EAA2E;QAC3E,OAAO,CACH,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,eAAe,KAAK,SAAS;YAClC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAC/B,CAAA;IACL,CAAC;IAED,YAAY,CAAC,IAAS;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAA;IACxB,CAAC;IAED,mBAAmB,CAAC,IAAW,EAAE,KAAkB,EAAE,MAAe;QAChE,2EAA2E;QAC3E,mEAAmE;QACnE,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;gBACrD,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;oBAC5B,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;wBAC3C,MAAM,SA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I,EAAE,aAAa,EAAE,CAAC;6BACrC;yBACJ,CAAA;oBACL,CAAC;oBACD,OAAO,KAAK,CAAA;gBAChB,CAAC,CAAC,CAAA;gBACF,IAAI,eAAe,EAAE,CAAC;oBAClB,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;oBACvC,QAAQ,GAAG,IAAI,CAAA;gBACnB,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAA;IACnB,CAAC;IAED,cAAc,CAAC,IAAW;QACtB,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChD,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;oBAC5B,IAAI,KAAK,CAAC,UAAU;wBAAE,OAAO,IAAI,CAAA;gBACrC,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,cAAc,CAAC,IAAW,EAAE,aAAqB,EAAE,QAAgB;QAC/D,OAAO;YACH,GAAG,EAAE,QAAQ;YACb,aAAa;YACb,aAAa,EAAE,IAAI,CAAC,MAAM;YAC1B,MAAM,EAAE,SAAS;SACpB,CAAA;IACL,CAAC;CACJ,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FormatDescriptor } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Format descriptor for Google/Gemini API.
|
|
4
|
+
*
|
|
5
|
+
* Uses body.contents array with:
|
|
6
|
+
* - parts[].functionCall for tool invocations
|
|
7
|
+
* - parts[].functionResponse for tool results
|
|
8
|
+
*
|
|
9
|
+
* IMPORTANT: Gemini doesn't include tool call IDs in its native format.
|
|
10
|
+
* We use position-based correlation via state.googleToolCallMapping which maps
|
|
11
|
+
* "toolName:index" -> "toolCallId" (populated by hooks.ts from message events).
|
|
12
|
+
*/
|
|
13
|
+
export declare const geminiFormat: FormatDescriptor;
|
|
14
|
+
//# sourceMappingURL=gemini.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/gemini.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,UAAU,CAAA;AAQ5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,gBAqJ1B,CAAA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { injectSynthGemini, trackNewToolResultsGemini } from "../../api-formats/synth-instruction";
|
|
2
|
+
import { injectPrunableListGemini } from "../../api-formats/prunable-list";
|
|
3
|
+
/**
|
|
4
|
+
* Format descriptor for Google/Gemini API.
|
|
5
|
+
*
|
|
6
|
+
* Uses body.contents array with:
|
|
7
|
+
* - parts[].functionCall for tool invocations
|
|
8
|
+
* - parts[].functionResponse for tool results
|
|
9
|
+
*
|
|
10
|
+
* IMPORTANT: Gemini doesn't include tool call IDs in its native format.
|
|
11
|
+
* We use position-based correlation via state.googleToolCallMapping which maps
|
|
12
|
+
* "toolName:index" -> "toolCallId" (populated by hooks.ts from message events).
|
|
13
|
+
*/
|
|
14
|
+
export const geminiFormat = {
|
|
15
|
+
name: 'gemini',
|
|
16
|
+
detect(body) {
|
|
17
|
+
return body.contents && Array.isArray(body.contents);
|
|
18
|
+
},
|
|
19
|
+
getDataArray(body) {
|
|
20
|
+
return body.contents;
|
|
21
|
+
},
|
|
22
|
+
cacheToolParameters(_data, _state, _logger) {
|
|
23
|
+
// Gemini format doesn't include tool parameters in the request body.
|
|
24
|
+
// Tool parameters are captured via message events in hooks.ts and stored
|
|
25
|
+
// in state.googleToolCallMapping for position-based correlation.
|
|
26
|
+
// No-op here.
|
|
27
|
+
},
|
|
28
|
+
injectSynth(data, instruction, nudgeText) {
|
|
29
|
+
return injectSynthGemini(data, instruction, nudgeText);
|
|
30
|
+
},
|
|
31
|
+
trackNewToolResults(data, tracker, protectedTools) {
|
|
32
|
+
return trackNewToolResultsGemini(data, tracker, protectedTools);
|
|
33
|
+
},
|
|
34
|
+
injectPrunableList(data, injection) {
|
|
35
|
+
return injectPrunableListGemini(data, injection);
|
|
36
|
+
},
|
|
37
|
+
extractToolOutputs(data, state) {
|
|
38
|
+
const outputs = [];
|
|
39
|
+
let positionMapping;
|
|
40
|
+
for (const [_sessionId, mapping] of state.googleToolCallMapping) {
|
|
41
|
+
if (mapping && mapping.size > 0) {
|
|
42
|
+
positionMapping = mapping;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!positionMapping) {
|
|
47
|
+
return outputs;
|
|
48
|
+
}
|
|
49
|
+
const toolPositionCounters = new Map();
|
|
50
|
+
for (const content of data) {
|
|
51
|
+
if (!Array.isArray(content.parts))
|
|
52
|
+
continue;
|
|
53
|
+
for (const part of content.parts) {
|
|
54
|
+
if (part.functionResponse) {
|
|
55
|
+
const funcName = part.functionResponse.name?.toLowerCase();
|
|
56
|
+
if (funcName) {
|
|
57
|
+
const currentIndex = toolPositionCounters.get(funcName) || 0;
|
|
58
|
+
toolPositionCounters.set(funcName, currentIndex + 1);
|
|
59
|
+
const positionKey = `${funcName}:${currentIndex}`;
|
|
60
|
+
const toolCallId = positionMapping.get(positionKey);
|
|
61
|
+
if (toolCallId) {
|
|
62
|
+
outputs.push({
|
|
63
|
+
id: toolCallId.toLowerCase(),
|
|
64
|
+
toolName: funcName
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return outputs;
|
|
72
|
+
},
|
|
73
|
+
replaceToolOutput(data, toolId, prunedMessage, state) {
|
|
74
|
+
let positionMapping;
|
|
75
|
+
for (const [_sessionId, mapping] of state.googleToolCallMapping) {
|
|
76
|
+
if (mapping && mapping.size > 0) {
|
|
77
|
+
positionMapping = mapping;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!positionMapping) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
const toolIdLower = toolId.toLowerCase();
|
|
85
|
+
const toolPositionCounters = new Map();
|
|
86
|
+
let replaced = false;
|
|
87
|
+
for (let i = 0; i < data.length; i++) {
|
|
88
|
+
const content = data[i];
|
|
89
|
+
if (!Array.isArray(content.parts))
|
|
90
|
+
continue;
|
|
91
|
+
let contentModified = false;
|
|
92
|
+
const newParts = content.parts.map((part) => {
|
|
93
|
+
if (part.functionResponse) {
|
|
94
|
+
const funcName = part.functionResponse.name?.toLowerCase();
|
|
95
|
+
if (funcName) {
|
|
96
|
+
const currentIndex = toolPositionCounters.get(funcName) || 0;
|
|
97
|
+
toolPositionCounters.set(funcName, currentIndex + 1);
|
|
98
|
+
const positionKey = `${funcName}:${currentIndex}`;
|
|
99
|
+
const mappedToolId = positionMapping.get(positionKey);
|
|
100
|
+
if (mappedToolId?.toLowerCase() === toolIdLower) {
|
|
101
|
+
contentModified = true;
|
|
102
|
+
replaced = true;
|
|
103
|
+
// Preserve thoughtSignature if present (required for Gemini 3 Pro)
|
|
104
|
+
return {
|
|
105
|
+
...part,
|
|
106
|
+
functionResponse: {
|
|
107
|
+
...part.functionResponse,
|
|
108
|
+
response: {
|
|
109
|
+
name: part.functionResponse.name,
|
|
110
|
+
content: prunedMessage
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return part;
|
|
118
|
+
});
|
|
119
|
+
if (contentModified) {
|
|
120
|
+
data[i] = { ...content, parts: newParts };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return replaced;
|
|
124
|
+
},
|
|
125
|
+
hasToolOutputs(data) {
|
|
126
|
+
return data.some((content) => Array.isArray(content.parts) &&
|
|
127
|
+
content.parts.some((part) => part.functionResponse));
|
|
128
|
+
},
|
|
129
|
+
getLogMetadata(data, replacedCount, inputUrl) {
|
|
130
|
+
return {
|
|
131
|
+
url: inputUrl,
|
|
132
|
+
replacedCount,
|
|
133
|
+
totalContents: data.length,
|
|
134
|
+
format: 'google-gemini'
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=gemini.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/gemini.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAE1E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC1C,IAAI,EAAE,QAAQ;IAEd,MAAM,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxD,CAAC;IAED,YAAY,CAAC,IAAS;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAA;IACxB,CAAC;IAED,mBAAmB,CAAC,KAAY,EAAE,MAAmB,EAAE,OAAgB;QACnE,qEAAqE;QACrE,yEAAyE;QACzE,iEAAiE;QACjE,cAAc;IAClB,CAAC;IAED,WAAW,CAAC,IAAW,EAAE,WAAmB,EAAE,SAAiB;QAC3D,OAAO,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,CAAA;IAC1D,CAAC;IAED,mBAAmB,CAAC,IAAW,EAAE,OAAoB,EAAE,cAA2B;QAC9E,OAAO,yBAAyB,CAAC,IAAI,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IACnE,CAAC;IAED,kBAAkB,CAAC,IAAW,EAAE,SAAi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,GAAG,EAAE,QAAQ;YACb,aAAa;YACb,aAAa,EAAE,IAAI,CAAC,MAAM;YAC1B,MAAM,EAAE,eAAe;SAC1B,CAAA;IACL,CAAC;CACJ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FormatDescriptor } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Format descriptor for OpenAI Chat Completions and Anthropic APIs.
|
|
4
|
+
*
|
|
5
|
+
* OpenAI Chat format:
|
|
6
|
+
* - Messages with role='tool' and tool_call_id
|
|
7
|
+
* - Assistant messages with tool_calls[] array
|
|
8
|
+
*
|
|
9
|
+
* Anthropic format:
|
|
10
|
+
* - Messages with role='user' containing content[].type='tool_result' and tool_use_id
|
|
11
|
+
* - Assistant messages with content[].type='tool_use'
|
|
12
|
+
*/
|
|
13
|
+
export declare const openaiChatFormat: FormatDescriptor;
|
|
14
|
+
//# sourceMappingURL=openai-chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-chat.d.ts","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/openai-chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,UAAU,CAAA;AAS5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAyG9B,CAAA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { cacheToolParametersFromMessages } from "../../state/tool-cache";
|
|
2
|
+
import { injectSynth, trackNewToolResults } from "../../api-formats/synth-instruction";
|
|
3
|
+
import { injectPrunableList } from "../../api-formats/prunable-list";
|
|
4
|
+
/**
|
|
5
|
+
* Format descriptor for OpenAI Chat Completions and Anthropic APIs.
|
|
6
|
+
*
|
|
7
|
+
* OpenAI Chat format:
|
|
8
|
+
* - Messages with role='tool' and tool_call_id
|
|
9
|
+
* - Assistant messages with tool_calls[] array
|
|
10
|
+
*
|
|
11
|
+
* Anthropic format:
|
|
12
|
+
* - Messages with role='user' containing content[].type='tool_result' and tool_use_id
|
|
13
|
+
* - Assistant messages with content[].type='tool_use'
|
|
14
|
+
*/
|
|
15
|
+
export const openaiChatFormat = {
|
|
16
|
+
name: 'openai-chat',
|
|
17
|
+
detect(body) {
|
|
18
|
+
return body.messages && Array.isArray(body.messages);
|
|
19
|
+
},
|
|
20
|
+
getDataArray(body) {
|
|
21
|
+
return body.messages;
|
|
22
|
+
},
|
|
23
|
+
cacheToolParameters(data, state, logger) {
|
|
24
|
+
cacheToolParametersFromMessages(data, state, logger);
|
|
25
|
+
},
|
|
26
|
+
injectSynth(data, instruction, nudgeText) {
|
|
27
|
+
return injectSynth(data, instruction, nudgeText);
|
|
28
|
+
},
|
|
29
|
+
trackNewToolResults(data, tracker, protectedTools) {
|
|
30
|
+
return trackNewToolResults(data, tracker, protectedTools);
|
|
31
|
+
},
|
|
32
|
+
injectPrunableList(data, injection) {
|
|
33
|
+
return injectPrunableList(data, injection);
|
|
34
|
+
},
|
|
35
|
+
extractToolOutputs(data, state) {
|
|
36
|
+
const outputs = [];
|
|
37
|
+
for (const m of data) {
|
|
38
|
+
if (m.role === 'tool' && m.tool_call_id) {
|
|
39
|
+
const metadata = state.toolParameters.get(m.tool_call_id.toLowerCase());
|
|
40
|
+
outputs.push({
|
|
41
|
+
id: m.tool_call_id.toLowerCase(),
|
|
42
|
+
toolName: metadata?.tool
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (m.role === 'user' && Array.isArray(m.content)) {
|
|
46
|
+
for (const part of m.content) {
|
|
47
|
+
if (part.type === 'tool_result' && part.tool_use_id) {
|
|
48
|
+
const metadata = state.toolParameters.get(part.tool_use_id.toLowerCase());
|
|
49
|
+
outputs.push({
|
|
50
|
+
id: part.tool_use_id.toLowerCase(),
|
|
51
|
+
toolName: metadata?.tool
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return outputs;
|
|
58
|
+
},
|
|
59
|
+
replaceToolOutput(data, toolId, prunedMessage, _state) {
|
|
60
|
+
const toolIdLower = toolId.toLowerCase();
|
|
61
|
+
let replaced = false;
|
|
62
|
+
for (let i = 0; i < data.length; i++) {
|
|
63
|
+
const m = data[i];
|
|
64
|
+
if (m.role === 'tool' && m.tool_call_id?.toLowerCase() === toolIdLower) {
|
|
65
|
+
data[i] = { ...m, content: prunedMessage };
|
|
66
|
+
replaced = true;
|
|
67
|
+
}
|
|
68
|
+
if (m.role === 'user' && Array.isArray(m.content)) {
|
|
69
|
+
let messageModified = false;
|
|
70
|
+
const newContent = m.content.map((part) => {
|
|
71
|
+
if (part.type === 'tool_result' && part.tool_use_id?.toLowerCase() === toolIdLower) {
|
|
72
|
+
messageModified = true;
|
|
73
|
+
return { ...part, content: prunedMessage };
|
|
74
|
+
}
|
|
75
|
+
return part;
|
|
76
|
+
});
|
|
77
|
+
if (messageModified) {
|
|
78
|
+
data[i] = { ...m, content: newContent };
|
|
79
|
+
replaced = true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return replaced;
|
|
84
|
+
},
|
|
85
|
+
hasToolOutputs(data) {
|
|
86
|
+
for (const m of data) {
|
|
87
|
+
if (m.role === 'tool')
|
|
88
|
+
return true;
|
|
89
|
+
if (m.role === 'user' && Array.isArray(m.content)) {
|
|
90
|
+
for (const part of m.content) {
|
|
91
|
+
if (part.type === 'tool_result')
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
},
|
|
98
|
+
getLogMetadata(data, replacedCount, inputUrl) {
|
|
99
|
+
return {
|
|
100
|
+
url: inputUrl,
|
|
101
|
+
replacedCount,
|
|
102
|
+
totalMessages: data.length
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=openai-chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-chat.js","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/openai-chat.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAEpE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAC9C,IAAI,EAAE,aAAa;IAEnB,MAAM,CAAC,IAAS;QACZ,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxD,CAAC;IAED,YAAY,CAAC,IAAS;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAA;IACxB,CAAC;IAED,mBAAmB,CAAC,IAAW,EAAE,KAAkB,EAAE,MAAe;QAChE,+BAA+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AAO,EAAE,aAAa,EAAE,CAAA;oBAC9C,CAAC;oBACD,OAAO,IAAI,CAAA;gBACf,CAAC,CAAC,CAAA;gBACF,IAAI,eAAe,EAAE,CAAC;oBAClB,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;oBACvC,QAAQ,GAAG,IAAI,CAAA;gBACnB,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAA;IACnB,CAAC;IAED,cAAc,CAAC,IAAW;QACtB,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;gBAAE,OAAO,IAAI,CAAA;YAClC,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChD,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;oBAC3B,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa;wBAAE,OAAO,IAAI,CAAA;gBAChD,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,cAAc,CAAC,IAAW,EAAE,aAAqB,EAAE,QAAgB;QAC/D,OAAO;YACH,GAAG,EAAE,QAAQ;YACb,aAAa;YACb,aAAa,EAAE,IAAI,CAAC,MAAM;SAC7B,CAAA;IACL,CAAC;CACJ,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormatDescriptor } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Format descriptor for OpenAI Responses API (GPT-5 models via sdk.responses()).
|
|
4
|
+
*
|
|
5
|
+
* Uses body.input array with:
|
|
6
|
+
* - type='function_call' items for tool calls
|
|
7
|
+
* - type='function_call_output' items for tool results
|
|
8
|
+
* - type='message' items for user/assistant messages
|
|
9
|
+
*/
|
|
10
|
+
export declare const openaiResponsesFormat: FormatDescriptor;
|
|
11
|
+
//# sourceMappingURL=openai-responses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-responses.d.ts","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/openai-responses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,UAAU,CAAA;AAS5D;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,gBAsEnC,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { cacheToolParametersFromInput } from "../../state/tool-cache";
|
|
2
|
+
import { injectSynthResponses, trackNewToolResultsResponses } from "../../api-formats/synth-instruction";
|
|
3
|
+
import { injectPrunableListResponses } from "../../api-formats/prunable-list";
|
|
4
|
+
/**
|
|
5
|
+
* Format descriptor for OpenAI Responses API (GPT-5 models via sdk.responses()).
|
|
6
|
+
*
|
|
7
|
+
* Uses body.input array with:
|
|
8
|
+
* - type='function_call' items for tool calls
|
|
9
|
+
* - type='function_call_output' items for tool results
|
|
10
|
+
* - type='message' items for user/assistant messages
|
|
11
|
+
*/
|
|
12
|
+
export const openaiResponsesFormat = {
|
|
13
|
+
name: 'openai-responses',
|
|
14
|
+
detect(body) {
|
|
15
|
+
return body.input && Array.isArray(body.input);
|
|
16
|
+
},
|
|
17
|
+
getDataArray(body) {
|
|
18
|
+
return body.input;
|
|
19
|
+
},
|
|
20
|
+
cacheToolParameters(data, state, logger) {
|
|
21
|
+
cacheToolParametersFromInput(data, state, logger);
|
|
22
|
+
},
|
|
23
|
+
injectSynth(data, instruction, nudgeText) {
|
|
24
|
+
return injectSynthResponses(data, instruction, nudgeText);
|
|
25
|
+
},
|
|
26
|
+
trackNewToolResults(data, tracker, protectedTools) {
|
|
27
|
+
return trackNewToolResultsResponses(data, tracker, protectedTools);
|
|
28
|
+
},
|
|
29
|
+
injectPrunableList(data, injection) {
|
|
30
|
+
return injectPrunableListResponses(data, injection);
|
|
31
|
+
},
|
|
32
|
+
extractToolOutputs(data, state) {
|
|
33
|
+
const outputs = [];
|
|
34
|
+
for (const item of data) {
|
|
35
|
+
if (item.type === 'function_call_output' && item.call_id) {
|
|
36
|
+
const metadata = state.toolParameters.get(item.call_id.toLowerCase());
|
|
37
|
+
outputs.push({
|
|
38
|
+
id: item.call_id.toLowerCase(),
|
|
39
|
+
toolName: metadata?.tool ?? item.name
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return outputs;
|
|
44
|
+
},
|
|
45
|
+
replaceToolOutput(data, toolId, prunedMessage, _state) {
|
|
46
|
+
const toolIdLower = toolId.toLowerCase();
|
|
47
|
+
let replaced = false;
|
|
48
|
+
for (let i = 0; i < data.length; i++) {
|
|
49
|
+
const item = data[i];
|
|
50
|
+
if (item.type === 'function_call_output' && item.call_id?.toLowerCase() === toolIdLower) {
|
|
51
|
+
data[i] = { ...item, output: prunedMessage };
|
|
52
|
+
replaced = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return replaced;
|
|
56
|
+
},
|
|
57
|
+
hasToolOutputs(data) {
|
|
58
|
+
return data.some((item) => item.type === 'function_call_output');
|
|
59
|
+
},
|
|
60
|
+
getLogMetadata(data, replacedCount, inputUrl) {
|
|
61
|
+
return {
|
|
62
|
+
url: inputUrl,
|
|
63
|
+
replacedCount,
|
|
64
|
+
totalItems: data.length,
|
|
65
|
+
format: 'openai-responses-api'
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=openai-responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-responses.js","sourceRoot":"","sources":["../../../../lib/fetch-wrapper/formats/openai-responses.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAA;AAC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