@cognipeer/agent-sdk 0.9.5 → 0.9.6
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 +18 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.mjs +18 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -647,7 +647,7 @@ function fromLangchainModel(lcModel) {
|
|
|
647
647
|
var DEFAULT_TODO_LIST_PROMPT = `Planning tools are available when they materially improve execution.
|
|
648
648
|
|
|
649
649
|
Rules:
|
|
650
|
-
1) Use "
|
|
650
|
+
1) Use "manage_plan" for multi-step work, delegation, recovery after a failed attempt, or when the user explicitly asks for a plan.
|
|
651
651
|
2) Do NOT create a plan for direct Q&A, simple recall from existing context, or a single straightforward tool lookup unless the user asks for one.
|
|
652
652
|
3) If a task is multi-step and no valid plan exists yet, create one before substantial execution.
|
|
653
653
|
4) Use operation="write" only to create or fully replace the entire plan. After a plan exists, default to operation="update" for progress, evidence, status, owner changes, blockers, or reprioritization.
|
|
@@ -2763,6 +2763,7 @@ function coerceObject(def, value, depth) {
|
|
|
2763
2763
|
// src/smart/toolResponses.ts
|
|
2764
2764
|
var CONTROL_PLANE_TOOL_NAMES = [
|
|
2765
2765
|
"response",
|
|
2766
|
+
"manage_plan",
|
|
2766
2767
|
"manage_todo_list",
|
|
2767
2768
|
"get_tool_response",
|
|
2768
2769
|
"ask_user_question",
|
|
@@ -3020,7 +3021,7 @@ function describeField(field, depth = 0) {
|
|
|
3020
3021
|
}
|
|
3021
3022
|
|
|
3022
3023
|
// src/smart/runtimeConfig.ts
|
|
3023
|
-
var DEFAULT_CRITICAL_TOOLS = ["response", "manage_todo_list", "get_tool_response"];
|
|
3024
|
+
var DEFAULT_CRITICAL_TOOLS = ["response", "manage_plan", "manage_todo_list", "get_tool_response"];
|
|
3024
3025
|
var BASE_DEFAULTS = {
|
|
3025
3026
|
limits: { maxToolCalls: 20, maxParallelTools: 5, maxContextTokens: 96e3, maxTotalOutputTokens: 0, maxCostUsd: 0, maxWallClockMs: 0 },
|
|
3026
3027
|
summarization: {
|
|
@@ -7558,10 +7559,10 @@ function hasToolResponseRecoveryReference(messages, executionId) {
|
|
|
7558
7559
|
return executionId ? content.includes(executionId) : true;
|
|
7559
7560
|
});
|
|
7560
7561
|
}
|
|
7561
|
-
function
|
|
7562
|
+
function createPlanTool(stateRef, toolName, description) {
|
|
7562
7563
|
const manageTodo = createTool({
|
|
7563
|
-
name:
|
|
7564
|
-
description
|
|
7564
|
+
name: toolName,
|
|
7565
|
+
description,
|
|
7565
7566
|
schema: zod.z.object({
|
|
7566
7567
|
operation: zod.z.enum(["write", "read", "update"]),
|
|
7567
7568
|
expectedVersion: zod.z.number().int().min(0).optional(),
|
|
@@ -7574,7 +7575,7 @@ function createManageTodoTool(stateRef) {
|
|
|
7574
7575
|
const version = stateRef.planVersion || 1;
|
|
7575
7576
|
const adherenceScore = stateRef.adherenceScore || 0;
|
|
7576
7577
|
const planData = {
|
|
7577
|
-
source:
|
|
7578
|
+
source: toolName,
|
|
7578
7579
|
operation,
|
|
7579
7580
|
version,
|
|
7580
7581
|
adherenceScore,
|
|
@@ -7585,7 +7586,7 @@ function createManageTodoTool(stateRef) {
|
|
|
7585
7586
|
recordTraceEvent(traceSession, {
|
|
7586
7587
|
type: "plan",
|
|
7587
7588
|
label: `Plan ${operation}`,
|
|
7588
|
-
actor: { scope: "agent", name:
|
|
7589
|
+
actor: { scope: "agent", name: toolName, role: "planner" },
|
|
7589
7590
|
sections: [
|
|
7590
7591
|
{
|
|
7591
7592
|
kind: "summary",
|
|
@@ -7724,6 +7725,14 @@ function createManageTodoTool(stateRef) {
|
|
|
7724
7725
|
manageTodo._stateRef = stateRef;
|
|
7725
7726
|
return manageTodo;
|
|
7726
7727
|
}
|
|
7728
|
+
var MANAGE_PLAN_DESCRIPTION = "Manage a structured execution plan to track progress and sequence steps throughout your run.\n\nOperations:\n- read: return the current plan\n- write: replace the full plan with a complete ordered set of steps (pass as `todoList`)\n- update: patch existing plan steps by id without resending the whole plan\n\nRules:\n- Use write only when creating or fully rewriting the plan\n- After a plan exists, prefer update for status, evidence, or owner changes\n- Update payloads should contain only the changed items\n- When using update, pass expectedVersion to avoid overwriting a newer plan\n- Keep ids unique; write operations must keep ids sequential starting from 1\n- Keep at most ONE item in-progress at a time\n- If update fails due to version mismatch, read the latest plan and retry";
|
|
7729
|
+
var LEGACY_MANAGE_TODO_LIST_DESCRIPTION = "DEPRECATED \u2014 identical to, and shares state with, `manage_plan`. Kept only so a run already in flight (or a caller still on the old name) keeps working; prefer `manage_plan` for anything new.\n\n" + MANAGE_PLAN_DESCRIPTION;
|
|
7730
|
+
function createManageTodoTool(stateRef) {
|
|
7731
|
+
return createPlanTool(stateRef, "manage_plan", MANAGE_PLAN_DESCRIPTION);
|
|
7732
|
+
}
|
|
7733
|
+
function createManageTodoListAliasTool(stateRef) {
|
|
7734
|
+
return createPlanTool(stateRef, "manage_todo_list", LEGACY_MANAGE_TODO_LIST_DESCRIPTION);
|
|
7735
|
+
}
|
|
7727
7736
|
function createGetToolResponseTool(stateRef) {
|
|
7728
7737
|
const getTool = createTool({
|
|
7729
7738
|
name: "get_tool_response",
|
|
@@ -7765,6 +7774,7 @@ function createContextTools(stateRef, opts) {
|
|
|
7765
7774
|
const tools = [];
|
|
7766
7775
|
if (opts?.planningEnabled) {
|
|
7767
7776
|
tools.push(createManageTodoTool(stateRef));
|
|
7777
|
+
tools.push(createManageTodoListAliasTool(stateRef));
|
|
7768
7778
|
}
|
|
7769
7779
|
if (opts?.includeGetToolResponse ?? true) {
|
|
7770
7780
|
tools.push(createGetToolResponseTool(stateRef));
|
|
@@ -11859,6 +11869,7 @@ exports.createDelegateTool = createDelegateTool;
|
|
|
11859
11869
|
exports.createGetToolResponseTool = createGetToolResponseTool;
|
|
11860
11870
|
exports.createGuardrail = createGuardrail;
|
|
11861
11871
|
exports.createJsonGuardrail = createJsonGuardrail;
|
|
11872
|
+
exports.createManageTodoListAliasTool = createManageTodoListAliasTool;
|
|
11862
11873
|
exports.createManageTodoTool = createManageTodoTool;
|
|
11863
11874
|
exports.createOpenSkillTool = createOpenSkillTool;
|
|
11864
11875
|
exports.createParallelTool = createParallelTool;
|