@kaddo/cli 3.90.0 → 3.90.1
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/core.js +22 -2
- package/dist/index.js +26 -2
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -9400,6 +9400,21 @@ function buildRefinementHandoff(dir, workItemId) {
|
|
|
9400
9400
|
import crypto3 from "crypto";
|
|
9401
9401
|
import matter8 from "gray-matter";
|
|
9402
9402
|
var MAX_INPUT_BYTES = 102400;
|
|
9403
|
+
var LIFECYCLE_FIELDS = /* @__PURE__ */ new Set([
|
|
9404
|
+
"id",
|
|
9405
|
+
"status",
|
|
9406
|
+
"phase",
|
|
9407
|
+
"knowledge_level",
|
|
9408
|
+
"refined_by",
|
|
9409
|
+
"implemented_by",
|
|
9410
|
+
"closed_by",
|
|
9411
|
+
"ready_at",
|
|
9412
|
+
"generated_by",
|
|
9413
|
+
"template_version",
|
|
9414
|
+
"implementation_status",
|
|
9415
|
+
"validation_status",
|
|
9416
|
+
"release_status"
|
|
9417
|
+
]);
|
|
9403
9418
|
function detectFormat(raw) {
|
|
9404
9419
|
const trimmed = raw.trim();
|
|
9405
9420
|
if (!trimmed) throw new ImportError("EMPTY_INPUT", "Import content is empty.");
|
|
@@ -9485,6 +9500,10 @@ function extractSections(body) {
|
|
|
9485
9500
|
return sections;
|
|
9486
9501
|
}
|
|
9487
9502
|
function normalizeImportFields(parsed, opts) {
|
|
9503
|
+
const discardedFields = [];
|
|
9504
|
+
for (const key of Object.keys(parsed.candidateFields)) {
|
|
9505
|
+
if (LIFECYCLE_FIELDS.has(key)) discardedFields.push(key);
|
|
9506
|
+
}
|
|
9488
9507
|
const type = opts.userType ? normalizeType(opts.userType) ?? "feature" : parsed.type ?? "feature";
|
|
9489
9508
|
const intent = parsed.body && parsed.body !== parsed.title ? `${parsed.title}
|
|
9490
9509
|
|
|
@@ -9503,7 +9522,7 @@ ${parsed.body}` : parsed.title;
|
|
|
9503
9522
|
const labels = parsed.candidateFields.labels.filter((l) => typeof l === "string");
|
|
9504
9523
|
if (labels.length > 0) snapshot.labels = labels;
|
|
9505
9524
|
}
|
|
9506
|
-
return { type, intent, source, snapshot };
|
|
9525
|
+
return { type, intent, source, snapshot, discardedFields };
|
|
9507
9526
|
}
|
|
9508
9527
|
function computeContentHash(raw) {
|
|
9509
9528
|
return crypto3.createHash("sha256").update(raw.trim(), "utf-8").digest("hex");
|
|
@@ -9575,7 +9594,8 @@ function importWorkItem(dir, opts) {
|
|
|
9575
9594
|
sourceFormat: parsed.format,
|
|
9576
9595
|
sourceHash,
|
|
9577
9596
|
executed: false,
|
|
9578
|
-
refinementHandoff
|
|
9597
|
+
refinementHandoff,
|
|
9598
|
+
...normalized.discardedFields.length > 0 ? { discardedFields: normalized.discardedFields } : {}
|
|
9579
9599
|
};
|
|
9580
9600
|
}
|
|
9581
9601
|
var ImportError = class extends Error {
|
package/dist/index.js
CHANGED
|
@@ -20842,6 +20842,21 @@ function buildRefinementHandoff(dir, workItemId) {
|
|
|
20842
20842
|
|
|
20843
20843
|
// src/core/work-item-import.ts
|
|
20844
20844
|
var MAX_INPUT_BYTES = 102400;
|
|
20845
|
+
var LIFECYCLE_FIELDS = /* @__PURE__ */ new Set([
|
|
20846
|
+
"id",
|
|
20847
|
+
"status",
|
|
20848
|
+
"phase",
|
|
20849
|
+
"knowledge_level",
|
|
20850
|
+
"refined_by",
|
|
20851
|
+
"implemented_by",
|
|
20852
|
+
"closed_by",
|
|
20853
|
+
"ready_at",
|
|
20854
|
+
"generated_by",
|
|
20855
|
+
"template_version",
|
|
20856
|
+
"implementation_status",
|
|
20857
|
+
"validation_status",
|
|
20858
|
+
"release_status"
|
|
20859
|
+
]);
|
|
20845
20860
|
function detectFormat(raw) {
|
|
20846
20861
|
const trimmed = raw.trim();
|
|
20847
20862
|
if (!trimmed) throw new ImportError("EMPTY_INPUT", "Import content is empty.");
|
|
@@ -20927,6 +20942,10 @@ function extractSections(body) {
|
|
|
20927
20942
|
return sections;
|
|
20928
20943
|
}
|
|
20929
20944
|
function normalizeImportFields(parsed, opts) {
|
|
20945
|
+
const discardedFields = [];
|
|
20946
|
+
for (const key of Object.keys(parsed.candidateFields)) {
|
|
20947
|
+
if (LIFECYCLE_FIELDS.has(key)) discardedFields.push(key);
|
|
20948
|
+
}
|
|
20930
20949
|
const type = opts.userType ? normalizeType(opts.userType) ?? "feature" : parsed.type ?? "feature";
|
|
20931
20950
|
const intent = parsed.body && parsed.body !== parsed.title ? `${parsed.title}
|
|
20932
20951
|
|
|
@@ -20945,7 +20964,7 @@ ${parsed.body}` : parsed.title;
|
|
|
20945
20964
|
const labels = parsed.candidateFields.labels.filter((l) => typeof l === "string");
|
|
20946
20965
|
if (labels.length > 0) snapshot.labels = labels;
|
|
20947
20966
|
}
|
|
20948
|
-
return { type, intent, source, snapshot };
|
|
20967
|
+
return { type, intent, source, snapshot, discardedFields };
|
|
20949
20968
|
}
|
|
20950
20969
|
function computeContentHash(raw) {
|
|
20951
20970
|
return crypto3.createHash("sha256").update(raw.trim(), "utf-8").digest("hex");
|
|
@@ -21017,7 +21036,8 @@ function importWorkItem(dir, opts) {
|
|
|
21017
21036
|
sourceFormat: parsed.format,
|
|
21018
21037
|
sourceHash,
|
|
21019
21038
|
executed: false,
|
|
21020
|
-
refinementHandoff
|
|
21039
|
+
refinementHandoff,
|
|
21040
|
+
...normalized.discardedFields.length > 0 ? { discardedFields: normalized.discardedFields } : {}
|
|
21021
21041
|
};
|
|
21022
21042
|
}
|
|
21023
21043
|
var ImportError = class extends Error {
|
|
@@ -21095,6 +21115,10 @@ async function runWorkItemImport(dir, fileOrText, opts) {
|
|
|
21095
21115
|
}
|
|
21096
21116
|
log2.info(`Created ${result.workItemId} (Draft, needs refinement).`);
|
|
21097
21117
|
log2.info(`Path: ${result.path}`);
|
|
21118
|
+
if (result.discardedFields?.length) {
|
|
21119
|
+
log2.warn(`Lifecycle fields discarded from import: ${result.discardedFields.join(", ")}`);
|
|
21120
|
+
log2.message("Kaddo always generates its own id and status \u2014 external values are ignored.");
|
|
21121
|
+
}
|
|
21098
21122
|
log2.message("executed = false \u2014 the Work Item has NOT been implemented.");
|
|
21099
21123
|
if (result.refinementHandoff) {
|
|
21100
21124
|
log2.step("Refinement handoff");
|