@kaddo/cli 3.58.0 → 3.60.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/dist/index.js +60 -47
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8916,7 +8916,9 @@ function buildDeliveryState(dir) {
|
|
|
8916
8916
|
phase: "",
|
|
8917
8917
|
draft_work_items: byState("draft"),
|
|
8918
8918
|
refined_draft_work_items: wis.filter((w) => w.lifecycle === "draft" && w.rawFrontmatter.refined_by).length,
|
|
8919
|
+
refined_draft_ids: wis.filter((w) => w.lifecycle === "draft" && w.rawFrontmatter.refined_by).map((w) => w.id),
|
|
8919
8920
|
ready_work_items: byState("ready"),
|
|
8921
|
+
ready_work_item_ids: wis.filter((w) => w.lifecycle === "ready").map((w) => w.id),
|
|
8920
8922
|
in_progress_work_items: byState("in-progress"),
|
|
8921
8923
|
blocked_work_items: byState("blocked"),
|
|
8922
8924
|
total_work_items: total,
|
|
@@ -9042,60 +9044,42 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
9042
9044
|
const st = buildDeliveryState(dir);
|
|
9043
9045
|
const secondary = buildSecondaryRecommendations(st);
|
|
9044
9046
|
const roadmap = roadmapSignal(dir);
|
|
9045
|
-
if (roadmap !== "has-candidates" && st.draft_work_items > 0) {
|
|
9046
|
-
if (st.refined_draft_work_items > 0) {
|
|
9047
|
-
return {
|
|
9048
|
-
id: "review-work-item",
|
|
9049
|
-
phase: "Active Delivery",
|
|
9050
|
-
label: "Review the refined draft Work Item and mark it ready with `kaddo ready`.",
|
|
9051
|
-
command: "kaddo ready",
|
|
9052
|
-
mcpAction: "kaddo_mark_work_item_ready",
|
|
9053
|
-
reason: `There ${st.refined_draft_work_items === 1 ? "is" : "are"} ${st.refined_draft_work_items} refined draft Work Item${st.refined_draft_work_items === 1 ? "" : "s"} awaiting human review.`,
|
|
9054
|
-
...secondary.length ? { secondary } : {}
|
|
9055
|
-
};
|
|
9056
|
-
}
|
|
9057
|
-
return {
|
|
9058
|
-
id: "refine-work-item",
|
|
9059
|
-
phase: "Active Delivery",
|
|
9060
|
-
label: "Refine the existing draft Work Item with the work-item-agent.",
|
|
9061
|
-
agent: "work-item-agent",
|
|
9062
|
-
skill: "work-item-refinement",
|
|
9063
|
-
reason: `There ${st.draft_work_items === 1 ? "is" : "are"} ${st.draft_work_items} draft Work Item${st.draft_work_items === 1 ? "" : "s"}. Refine before defining roadmap candidates.`,
|
|
9064
|
-
...secondary.length ? { secondary } : {}
|
|
9065
|
-
};
|
|
9066
|
-
}
|
|
9067
|
-
if (roadmap !== "has-candidates") {
|
|
9068
|
-
return { id: "roadmap", phase: "Planning", label: "Use roadmap-agent to define roadmap candidates (`kaddo roadmap`).", command: "kaddo roadmap", agent: "roadmap-agent", target: "knowledge/delivery/roadmap.md", reason: "The roadmap has no candidates yet." };
|
|
9069
|
-
}
|
|
9070
|
-
if (st.total_work_items === 0) {
|
|
9071
|
-
return {
|
|
9072
|
-
id: "create-work-item",
|
|
9073
|
-
phase: "Delivery Preparation",
|
|
9074
|
-
label: "Run `kaddo create --from roadmap` to materialize the first Work Item.",
|
|
9075
|
-
command: "kaddo create --from roadmap",
|
|
9076
|
-
reason: "The roadmap has candidates but no Work Item exists yet.",
|
|
9077
|
-
...secondary.length ? { secondary } : {}
|
|
9078
|
-
};
|
|
9079
|
-
}
|
|
9080
9047
|
const adapters = st.adapters_installed;
|
|
9081
9048
|
if (st.ready_work_items > 0) {
|
|
9049
|
+
const ids = st.ready_work_item_ids;
|
|
9050
|
+
const single = ids.length === 1;
|
|
9051
|
+
const sec = [...secondary];
|
|
9052
|
+
if (roadmap !== "has-candidates" && st.remaining_work_item_candidates === 0) {
|
|
9053
|
+
sec.push({
|
|
9054
|
+
id: "roadmap",
|
|
9055
|
+
label: "Roadmap has no candidates. Consider running `kaddo roadmap` after handling ready Work Items.",
|
|
9056
|
+
command: "kaddo roadmap",
|
|
9057
|
+
agent: "roadmap-agent",
|
|
9058
|
+
reason: "The roadmap has no candidates yet, but ready Work Items exist."
|
|
9059
|
+
});
|
|
9060
|
+
}
|
|
9082
9061
|
if (adapters === 0) {
|
|
9083
9062
|
return {
|
|
9084
|
-
id: "
|
|
9063
|
+
id: "prepare-implementation",
|
|
9085
9064
|
phase: "Active Delivery",
|
|
9086
|
-
label:
|
|
9065
|
+
label: single ? `Prepare implementation for ${ids[0]}.` : "Prepare implementation for ready Work Items.",
|
|
9087
9066
|
command: "kaddo adapters list",
|
|
9088
|
-
|
|
9089
|
-
|
|
9067
|
+
agent: "implementation-agent",
|
|
9068
|
+
skill: "implementation-planning",
|
|
9069
|
+
...single ? { target: ids[0] } : { targets: ids },
|
|
9070
|
+
reason: single ? `${ids[0]} is ready for implementation but no adapter is installed.` : `There are ${ids.length} ready Work Items awaiting implementation but no adapter is installed.`,
|
|
9071
|
+
...sec.length ? { secondary: sec } : {}
|
|
9090
9072
|
};
|
|
9091
9073
|
}
|
|
9092
9074
|
return {
|
|
9093
|
-
id: "implement",
|
|
9075
|
+
id: "implement-work-item",
|
|
9094
9076
|
phase: "Active Delivery",
|
|
9095
|
-
label:
|
|
9077
|
+
label: single ? `Use implementation-agent to implement ${ids[0]}.` : "Use implementation-agent to implement ready Work Items.",
|
|
9096
9078
|
agent: "implementation-agent",
|
|
9097
|
-
|
|
9098
|
-
...
|
|
9079
|
+
skill: "implementation-planning",
|
|
9080
|
+
...single ? { target: ids[0] } : { targets: ids },
|
|
9081
|
+
reason: single ? `${ids[0]} is ready for implementation.` : `There are ${ids.length} ready Work Items awaiting implementation.`,
|
|
9082
|
+
...sec.length ? { secondary: sec } : {}
|
|
9099
9083
|
};
|
|
9100
9084
|
}
|
|
9101
9085
|
if (st.in_progress_work_items > 0) {
|
|
@@ -9108,6 +9092,20 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
9108
9092
|
...secondary.length ? { secondary } : {}
|
|
9109
9093
|
};
|
|
9110
9094
|
}
|
|
9095
|
+
if (st.refined_draft_work_items > 0) {
|
|
9096
|
+
const ids = st.refined_draft_ids;
|
|
9097
|
+
const single = ids.length === 1;
|
|
9098
|
+
return {
|
|
9099
|
+
id: "review-work-item",
|
|
9100
|
+
phase: "Active Delivery",
|
|
9101
|
+
label: single ? `Review ${ids[0]} and mark it ready for implementation.` : "Review refined draft Work Items and mark one ready for implementation.",
|
|
9102
|
+
command: single ? `kaddo ready ${ids[0]}` : "kaddo ready <WI-ID>",
|
|
9103
|
+
mcpAction: "kaddo_mark_work_item_ready",
|
|
9104
|
+
...single ? { target: ids[0], mcpArgs: { id: ids[0] } } : { targets: ids },
|
|
9105
|
+
reason: single ? `${ids[0]} is a refined draft Work Item awaiting human review.` : `There are ${ids.length} refined draft Work Items awaiting human review.`,
|
|
9106
|
+
...secondary.length ? { secondary } : {}
|
|
9107
|
+
};
|
|
9108
|
+
}
|
|
9111
9109
|
if (st.draft_work_items > 0) {
|
|
9112
9110
|
return {
|
|
9113
9111
|
id: "refine-work-item",
|
|
@@ -9115,7 +9113,7 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
9115
9113
|
label: "Refine the existing draft Work Item with the work-item-agent.",
|
|
9116
9114
|
agent: "work-item-agent",
|
|
9117
9115
|
skill: "work-item-refinement",
|
|
9118
|
-
reason: `There ${st.draft_work_items === 1 ? "is" : "are"} ${st.draft_work_items} draft Work Item${st.draft_work_items === 1 ? "" : "s"}
|
|
9116
|
+
reason: `There ${st.draft_work_items === 1 ? "is" : "are"} ${st.draft_work_items} draft Work Item${st.draft_work_items === 1 ? "" : "s"}. Refine before defining roadmap candidates.`,
|
|
9119
9117
|
...secondary.length ? { secondary } : {}
|
|
9120
9118
|
};
|
|
9121
9119
|
}
|
|
@@ -9129,6 +9127,19 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
|
|
|
9129
9127
|
...secondary.length ? { secondary } : {}
|
|
9130
9128
|
};
|
|
9131
9129
|
}
|
|
9130
|
+
if (roadmap !== "has-candidates") {
|
|
9131
|
+
return { id: "roadmap", phase: "Planning", label: "Use roadmap-agent to define roadmap candidates (`kaddo roadmap`).", command: "kaddo roadmap", agent: "roadmap-agent", target: "knowledge/delivery/roadmap.md", reason: "The roadmap has no candidates yet." };
|
|
9132
|
+
}
|
|
9133
|
+
if (st.total_work_items === 0) {
|
|
9134
|
+
return {
|
|
9135
|
+
id: "create-work-item",
|
|
9136
|
+
phase: "Delivery Preparation",
|
|
9137
|
+
label: "Run `kaddo create --from roadmap` to materialize the first Work Item.",
|
|
9138
|
+
command: "kaddo create --from roadmap",
|
|
9139
|
+
reason: "The roadmap has candidates but no Work Item exists yet.",
|
|
9140
|
+
...secondary.length ? { secondary } : {}
|
|
9141
|
+
};
|
|
9142
|
+
}
|
|
9132
9143
|
if (st.remaining_work_item_candidates > 0) {
|
|
9133
9144
|
return {
|
|
9134
9145
|
id: "materialize-more-work-items",
|
|
@@ -9860,7 +9871,9 @@ function mapNextStepId(id) {
|
|
|
9860
9871
|
"refine-capabilities": "discover-capabilities",
|
|
9861
9872
|
"refine-current-state": "describe-architecture",
|
|
9862
9873
|
"refine-codebase": "describe-architecture",
|
|
9863
|
-
"review-work-item": "refine-work-item"
|
|
9874
|
+
"review-work-item": "refine-work-item",
|
|
9875
|
+
"prepare-implementation": "prepare-implementation",
|
|
9876
|
+
"implement-work-item": "prepare-implementation"
|
|
9864
9877
|
};
|
|
9865
9878
|
return MAP[id] ?? id;
|
|
9866
9879
|
}
|
|
@@ -11530,11 +11543,11 @@ function renderUnderstand(plan) {
|
|
|
11530
11543
|
outputs.push("- Refined Work Item content.");
|
|
11531
11544
|
if (rec.id === "create-work-item")
|
|
11532
11545
|
outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
|
|
11533
|
-
if (rec.id === "implement")
|
|
11546
|
+
if (rec.id === "implement" || rec.id === "implement-work-item")
|
|
11534
11547
|
outputs.push("- Implementation plan or code changes guided by the Work Item.");
|
|
11535
11548
|
if (rec.id === "guard")
|
|
11536
11549
|
outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
|
|
11537
|
-
if (rec.id === "install-adapter")
|
|
11550
|
+
if (rec.id === "install-adapter" || rec.id === "prepare-implementation")
|
|
11538
11551
|
outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
|
|
11539
11552
|
if (outputs.length > 0) {
|
|
11540
11553
|
parts.push("The LLM should produce:\n");
|