@cognipeer/agent-sdk 0.4.1 → 0.4.2
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/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2506,7 +2506,15 @@ function createToolsNode(initialTools, opts) {
|
|
|
2506
2506
|
status: "success"
|
|
2507
2507
|
});
|
|
2508
2508
|
}
|
|
2509
|
-
|
|
2509
|
+
let toolMessageContent = responsePolicy.content;
|
|
2510
|
+
if (responsePolicy.retentionPolicy === "summarize_archive") {
|
|
2511
|
+
toolMessageContent = `ARCHIVED_TOOL_RESPONSE [executionId=${executionId}]: ${responsePolicy.summary}
|
|
2512
|
+
Use get_tool_response with executionId "${executionId}" to retrieve the full output.`;
|
|
2513
|
+
} else if (responsePolicy.retentionPolicy === "drop") {
|
|
2514
|
+
toolMessageContent = `DROPPED_TOOL_RESPONSE [executionId=${executionId}]: ${responsePolicy.summary}
|
|
2515
|
+
Use get_tool_response with executionId "${executionId}" to retrieve the full output.`;
|
|
2516
|
+
}
|
|
2517
|
+
appended.push({ role: "tool", content: toolMessageContent, tool_call_id: tc.id || `${tc.name}_${appended.length}`, name: tc.name });
|
|
2510
2518
|
onEvent?.({ type: "tool_call", phase: "success", name: toolName, id: tc.id, args, result: output, durationMs });
|
|
2511
2519
|
onProgress?.({ stage: "tools", message: `Tool ${tc.name} completed`, detail: { durationMs } });
|
|
2512
2520
|
if (needsApproval && approvalEntry) {
|
|
@@ -4215,7 +4223,7 @@ function createContextTools(stateRef, opts) {
|
|
|
4215
4223
|
}
|
|
4216
4224
|
const getTool = createTool({
|
|
4217
4225
|
name: "get_tool_response",
|
|
4218
|
-
description: "RETRIEVE tool execution response
|
|
4226
|
+
description: "RETRIEVE the full output of a tool execution whose response was archived or dropped. When a tool response appears as 'ARCHIVED_TOOL_RESPONSE [executionId=xxx]' or 'DROPPED_TOOL_RESPONSE [executionId=xxx]', pass that exact executionId to this tool to get the complete data. You can also pass the tool_call_id from your original tool call.",
|
|
4219
4227
|
schema: zod.z.object({ executionId: zod.z.string().describe("Tool execution id") }),
|
|
4220
4228
|
func: async ({ executionId }) => {
|
|
4221
4229
|
const matchesExecution = (t) => t?.executionId === executionId || t?.tool_call_id === executionId;
|