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