@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.mjs
CHANGED
|
@@ -2496,7 +2496,15 @@ function createToolsNode(initialTools, opts) {
|
|
|
2496
2496
|
status: "success"
|
|
2497
2497
|
});
|
|
2498
2498
|
}
|
|
2499
|
-
|
|
2499
|
+
let toolMessageContent = responsePolicy.content;
|
|
2500
|
+
if (responsePolicy.retentionPolicy === "summarize_archive") {
|
|
2501
|
+
toolMessageContent = `ARCHIVED_TOOL_RESPONSE [executionId=${executionId}]: ${responsePolicy.summary}
|
|
2502
|
+
Use get_tool_response with executionId "${executionId}" to retrieve the full output.`;
|
|
2503
|
+
} else if (responsePolicy.retentionPolicy === "drop") {
|
|
2504
|
+
toolMessageContent = `DROPPED_TOOL_RESPONSE [executionId=${executionId}]: ${responsePolicy.summary}
|
|
2505
|
+
Use get_tool_response with executionId "${executionId}" to retrieve the full output.`;
|
|
2506
|
+
}
|
|
2507
|
+
appended.push({ role: "tool", content: toolMessageContent, tool_call_id: tc.id || `${tc.name}_${appended.length}`, name: tc.name });
|
|
2500
2508
|
onEvent?.({ type: "tool_call", phase: "success", name: toolName, id: tc.id, args, result: output, durationMs });
|
|
2501
2509
|
onProgress?.({ stage: "tools", message: `Tool ${tc.name} completed`, detail: { durationMs } });
|
|
2502
2510
|
if (needsApproval && approvalEntry) {
|
|
@@ -4205,7 +4213,7 @@ function createContextTools(stateRef, opts) {
|
|
|
4205
4213
|
}
|
|
4206
4214
|
const getTool = createTool({
|
|
4207
4215
|
name: "get_tool_response",
|
|
4208
|
-
description: "RETRIEVE tool execution response
|
|
4216
|
+
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.",
|
|
4209
4217
|
schema: z.object({ executionId: z.string().describe("Tool execution id") }),
|
|
4210
4218
|
func: async ({ executionId }) => {
|
|
4211
4219
|
const matchesExecution = (t) => t?.executionId === executionId || t?.tool_call_id === executionId;
|