agent-planner-mcp 1.5.8 → 1.5.9
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/package.json +1 -1
- package/src/tools/bdi/intentions.js +10 -1
package/package.json
CHANGED
|
@@ -738,6 +738,15 @@ function validateTreeShape(tree, depth = 0) {
|
|
|
738
738
|
return null;
|
|
739
739
|
}
|
|
740
740
|
|
|
741
|
+
// Count every node in a returned tree, recursing through `children`. The facade
|
|
742
|
+
// response's `tree` is the array of top-level nodes; `tree.length` alone counts
|
|
743
|
+
// only those (e.g. 2 phases) and contradicts structure.task_count, so report
|
|
744
|
+
// the true recursive total.
|
|
745
|
+
function countTreeNodes(tree) {
|
|
746
|
+
if (!Array.isArray(tree)) return 0;
|
|
747
|
+
return tree.reduce((sum, node) => sum + 1 + countTreeNodes(node?.children), 0);
|
|
748
|
+
}
|
|
749
|
+
|
|
741
750
|
const formIntentionDefinition = {
|
|
742
751
|
name: 'form_intention',
|
|
743
752
|
description:
|
|
@@ -862,7 +871,7 @@ async function formIntentionHandler(args, apiClient) {
|
|
|
862
871
|
goal_id,
|
|
863
872
|
status: result.plan?.status || status,
|
|
864
873
|
is_draft: (result.plan?.status || status) === 'draft',
|
|
865
|
-
nodes_created: Array.isArray(result.tree) ? result.tree
|
|
874
|
+
nodes_created: Array.isArray(result.tree) ? countTreeNodes(result.tree) : undefined,
|
|
866
875
|
next_step: (result.plan?.status || status) === 'draft'
|
|
867
876
|
? "Plan created as draft. Will surface in dashboard pending for human review. Auto-promotes to active when first task moves to in_progress."
|
|
868
877
|
: `Plan active. Claim a task with claim_next_task({plan_id}) to begin work. Shareable link: ${planUrl(facadePlanId)} (set visibility:'unlisted' for a rich Slack/social preview).`,
|