@mytegroupinc/myte-core 0.0.29 → 0.0.31
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/cli.js +16 -13
- package/package.json +1 -1
- package/scripts/feedback-live-full-harness.js +18 -8
package/cli.js
CHANGED
|
@@ -3401,22 +3401,25 @@ function writeFeedbackSnapshot({ snapshot, wrapperRoot, outputDir }) {
|
|
|
3401
3401
|
let prdFileCount = 0;
|
|
3402
3402
|
const materializedItems = items.map((rawItem, index) => {
|
|
3403
3403
|
const item = isPlainObject(rawItem) ? { ...rawItem } : {};
|
|
3404
|
-
const feedbackId = stableItemId(item, ["feedback_id", "id"], `F${String(index + 1).padStart(3, "0")}`);
|
|
3405
|
-
const conversationTurns = normalizeFeedbackConversationTurns(item.conversation_turns);
|
|
3406
|
-
const prdText = String(item.prd_text || "").trim();
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
let
|
|
3410
|
-
let
|
|
3404
|
+
const feedbackId = stableItemId(item, ["feedback_id", "id"], `F${String(index + 1).padStart(3, "0")}`);
|
|
3405
|
+
const conversationTurns = normalizeFeedbackConversationTurns(item.conversation_turns);
|
|
3406
|
+
const prdText = String(item.prd_text || "").trim();
|
|
3407
|
+
const attachmentDocuments = Array.isArray(item.attachment_documents) ? item.attachment_documents : [];
|
|
3408
|
+
|
|
3409
|
+
let contextSource = "description_only";
|
|
3410
|
+
let contextNote = "No separate PRD. Use feedback_text as the context for this feedback item.";
|
|
3411
|
+
let prdFile = null;
|
|
3411
3412
|
|
|
3412
3413
|
if (prdText) {
|
|
3413
3414
|
const prdFilename = `${sanitizeFileSegment(feedbackId, `feedback-${index + 1}`)}.md`;
|
|
3414
|
-
const prdPath = path.join(prdSyncDir, prdFilename);
|
|
3415
|
-
writeTextFile(prdPath, ensureTrailingNewline(prdText));
|
|
3416
|
-
prdFile = toPosixRelativePath(targetRoot, prdPath);
|
|
3417
|
-
contextSource = "prd_file";
|
|
3418
|
-
contextNote =
|
|
3419
|
-
|
|
3415
|
+
const prdPath = path.join(prdSyncDir, prdFilename);
|
|
3416
|
+
writeTextFile(prdPath, ensureTrailingNewline(prdText));
|
|
3417
|
+
prdFile = toPosixRelativePath(targetRoot, prdPath);
|
|
3418
|
+
contextSource = attachmentDocuments.length > 0 ? "attachment_file" : "prd_file";
|
|
3419
|
+
contextNote = attachmentDocuments.length > 0
|
|
3420
|
+
? "Readable feedback attachment documents are stored in the linked file."
|
|
3421
|
+
: "Full PRD context is stored in the linked file.";
|
|
3422
|
+
prdFileCount += 1;
|
|
3420
3423
|
} else if (item.has_prd_text) {
|
|
3421
3424
|
contextSource = "prd_declared_but_unavailable";
|
|
3422
3425
|
contextNote = "A separate PRD exists for this feedback item, but readable PRD text was not included in this sync snapshot.";
|
package/package.json
CHANGED
|
@@ -90,14 +90,24 @@ function writePrd(workspace, title, index) {
|
|
|
90
90
|
return filePath;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
function loadFeedbackManifest(workspace) {
|
|
94
|
-
const manifestPath = path.join(workspace, "MyteCommandCenter", "data", "feedback.yml");
|
|
95
|
-
if (!fs.existsSync(manifestPath)) {
|
|
96
|
-
return { items: [] };
|
|
97
|
-
}
|
|
98
|
-
const text = fs.readFileSync(manifestPath, "utf8");
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
function loadFeedbackManifest(workspace) {
|
|
94
|
+
const manifestPath = path.join(workspace, "MyteCommandCenter", "data", "feedback.yml");
|
|
95
|
+
if (!fs.existsSync(manifestPath)) {
|
|
96
|
+
return { items: [] };
|
|
97
|
+
}
|
|
98
|
+
const text = fs.readFileSync(manifestPath, "utf8");
|
|
99
|
+
try {
|
|
100
|
+
const parsed = JSON.parse(text);
|
|
101
|
+
const items = []
|
|
102
|
+
.concat(Array.isArray(parsed.items) ? parsed.items : [])
|
|
103
|
+
.concat(Array.isArray(parsed.queue) ? parsed.queue : []);
|
|
104
|
+
return { items };
|
|
105
|
+
} catch (_err) {
|
|
106
|
+
// Older local files may still be YAML-like. Keep a small fallback parser so
|
|
107
|
+
// the harness can validate either shape without adding runtime deps.
|
|
108
|
+
}
|
|
109
|
+
const items = [];
|
|
110
|
+
let current = null;
|
|
101
111
|
for (const line of text.split(/\r?\n/)) {
|
|
102
112
|
const feedbackMatch = line.match(/^\s*-\s+feedback_id:\s*["']?([^"'\s]+)["']?\s*$/) || line.match(/^\s*feedback_id:\s*["']?([^"'\s]+)["']?\s*$/);
|
|
103
113
|
if (feedbackMatch) {
|