@riotprompt/riotplan 1.0.0 → 1.0.2-dev.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/bin.js +1 -1
- package/dist/{cli-DmsyaX1E.js → cli-BAr1IsMF.js} +175 -106
- package/dist/cli-BAr1IsMF.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +153 -92
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
- package/dist/cli-DmsyaX1E.js.map +0 -1
package/dist/bin.js
CHANGED
|
@@ -64,20 +64,34 @@ const PLAN_CONVENTIONS = {
|
|
|
64
64
|
};
|
|
65
65
|
function parseDependenciesFromContent(content) {
|
|
66
66
|
const dependencies = /* @__PURE__ */ new Set();
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
nums
|
|
67
|
+
const frontmatterEnd = content.indexOf("---", 4);
|
|
68
|
+
if (content.startsWith("---\n") && frontmatterEnd > 0) {
|
|
69
|
+
const frontmatter = content.substring(4, frontmatterEnd);
|
|
70
|
+
const dependsOnMatch = frontmatter.match(/depends-on:\s*([^\n]+)/);
|
|
71
|
+
if (dependsOnMatch) {
|
|
72
|
+
const nums = dependsOnMatch[1].match(/\d+/g);
|
|
73
|
+
if (nums) {
|
|
74
|
+
nums.forEach((n) => dependencies.add(parseInt(n)));
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const lines = content.split("\n");
|
|
79
|
+
const sectionLines = [];
|
|
80
|
+
let inSection = false;
|
|
81
|
+
for (const line of lines) {
|
|
82
|
+
if (/^##\s+Dependencies$/i.test(line)) {
|
|
83
|
+
inSection = true;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (inSection && /^#/.test(line)) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (inSection) {
|
|
90
|
+
sectionLines.push(line);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (sectionLines.length > 0) {
|
|
94
|
+
const section = sectionLines.join("\n");
|
|
81
95
|
const bulletMatches = section.matchAll(
|
|
82
96
|
/[-*]\s*(?:Step\s*)?(\d+)/gi
|
|
83
97
|
);
|
|
@@ -887,12 +901,15 @@ function parseEvidenceFile(filename, content) {
|
|
|
887
901
|
};
|
|
888
902
|
}
|
|
889
903
|
function parseFrontmatter(content) {
|
|
890
|
-
|
|
891
|
-
|
|
904
|
+
if (!content.startsWith("---\n")) {
|
|
905
|
+
return { frontmatter: {}, body: content };
|
|
906
|
+
}
|
|
907
|
+
const endMarker = content.indexOf("\n---\n", 4);
|
|
908
|
+
if (endMarker === -1) {
|
|
892
909
|
return { frontmatter: {}, body: content };
|
|
893
910
|
}
|
|
894
|
-
const frontmatterStr =
|
|
895
|
-
const body = content.
|
|
911
|
+
const frontmatterStr = content.substring(4, endMarker);
|
|
912
|
+
const body = content.substring(endMarker + 5);
|
|
896
913
|
const frontmatter = {};
|
|
897
914
|
const lines = frontmatterStr.split("\n");
|
|
898
915
|
let currentKey = null;
|
|
@@ -2019,12 +2036,22 @@ function parseFeedbackFile(filename, content) {
|
|
|
2019
2036
|
};
|
|
2020
2037
|
}
|
|
2021
2038
|
function extractSection(content, sectionName) {
|
|
2022
|
-
const
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
)
|
|
2026
|
-
|
|
2027
|
-
|
|
2039
|
+
const lines = content.split("\n");
|
|
2040
|
+
const sectionLines = [];
|
|
2041
|
+
let inSection = false;
|
|
2042
|
+
for (const line of lines) {
|
|
2043
|
+
if (new RegExp(`^##\\s+${sectionName}`, "i").test(line)) {
|
|
2044
|
+
inSection = true;
|
|
2045
|
+
continue;
|
|
2046
|
+
}
|
|
2047
|
+
if (inSection && /^##/.test(line)) {
|
|
2048
|
+
break;
|
|
2049
|
+
}
|
|
2050
|
+
if (inSection) {
|
|
2051
|
+
sectionLines.push(line);
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
return sectionLines.length > 0 ? sectionLines.join("\n").trim() : void 0;
|
|
2028
2055
|
}
|
|
2029
2056
|
function formatDate$3(date, format) {
|
|
2030
2057
|
if (!date) return "-";
|
|
@@ -2176,11 +2203,23 @@ function generateStatus$2(plan, options = {}) {
|
|
|
2176
2203
|
} = options;
|
|
2177
2204
|
let existingNotes;
|
|
2178
2205
|
if (preserveNotes && existingContent) {
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2206
|
+
const lines = existingContent.split("\n");
|
|
2207
|
+
const noteLines = [];
|
|
2208
|
+
let inNotes = false;
|
|
2209
|
+
for (const line of lines) {
|
|
2210
|
+
if (/^## Notes$/i.test(line)) {
|
|
2211
|
+
inNotes = true;
|
|
2212
|
+
continue;
|
|
2213
|
+
}
|
|
2214
|
+
if (inNotes && (/^##/.test(line) || /^---/.test(line))) {
|
|
2215
|
+
break;
|
|
2216
|
+
}
|
|
2217
|
+
if (inNotes) {
|
|
2218
|
+
noteLines.push(line);
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
if (noteLines.length > 0) {
|
|
2222
|
+
existingNotes = noteLines.join("\n").trim();
|
|
2184
2223
|
}
|
|
2185
2224
|
}
|
|
2186
2225
|
let content = `# ${plan.metadata.name} Status
|
|
@@ -4235,9 +4274,15 @@ JSON structure:
|
|
|
4235
4274
|
function parsePlanResponse(content, _stepCount) {
|
|
4236
4275
|
try {
|
|
4237
4276
|
let jsonContent = content.trim();
|
|
4238
|
-
const
|
|
4239
|
-
if (
|
|
4240
|
-
|
|
4277
|
+
const startMarker = jsonContent.indexOf("```");
|
|
4278
|
+
if (startMarker !== -1) {
|
|
4279
|
+
const endMarker = jsonContent.indexOf("```", startMarker + 3);
|
|
4280
|
+
if (endMarker !== -1) {
|
|
4281
|
+
jsonContent = jsonContent.substring(startMarker + 3, endMarker).trim();
|
|
4282
|
+
if (jsonContent.startsWith("json")) {
|
|
4283
|
+
jsonContent = jsonContent.substring(4).trim();
|
|
4284
|
+
}
|
|
4285
|
+
}
|
|
4241
4286
|
}
|
|
4242
4287
|
const firstBrace = jsonContent.indexOf("{");
|
|
4243
4288
|
const lastBrace = jsonContent.lastIndexOf("}");
|
|
@@ -4910,8 +4955,11 @@ async function loadInitialPrompt(planPath, planName) {
|
|
|
4910
4955
|
try {
|
|
4911
4956
|
const promptPath = join(planPath, `${planName}-prompt.md`);
|
|
4912
4957
|
const content = await readFile(promptPath, "utf-8");
|
|
4913
|
-
const
|
|
4914
|
-
|
|
4958
|
+
const separatorIndex = content.indexOf("---\n\n");
|
|
4959
|
+
if (separatorIndex !== -1) {
|
|
4960
|
+
return content.substring(separatorIndex + 5).trim();
|
|
4961
|
+
}
|
|
4962
|
+
return content;
|
|
4915
4963
|
} catch {
|
|
4916
4964
|
return null;
|
|
4917
4965
|
}
|
|
@@ -5675,10 +5723,17 @@ async function loadStatusMap(planPath) {
|
|
|
5675
5723
|
try {
|
|
5676
5724
|
const statusPath = join(planPath, "STATUS.md");
|
|
5677
5725
|
const content = await readFile(statusPath, "utf-8");
|
|
5678
|
-
const
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5726
|
+
const lines = content.split("\n");
|
|
5727
|
+
let inTable = false;
|
|
5728
|
+
for (const line of lines) {
|
|
5729
|
+
if (/\|\s*Step\s*\|\s*Name\s*\|\s*Status/i.test(line)) {
|
|
5730
|
+
inTable = true;
|
|
5731
|
+
continue;
|
|
5732
|
+
}
|
|
5733
|
+
if (inTable && (/^##/.test(line) || line.trim() === "")) {
|
|
5734
|
+
break;
|
|
5735
|
+
}
|
|
5736
|
+
if (inTable && line.includes("|")) {
|
|
5682
5737
|
const match = line.match(/\|\s*(\d+)\s*\|[^|]+\|\s*([^|]+)\|/);
|
|
5683
5738
|
if (match) {
|
|
5684
5739
|
const stepNum = parseInt(match[1]);
|
|
@@ -5722,11 +5777,25 @@ function analyzeStep(stepNum, content, markedStatus) {
|
|
|
5722
5777
|
}
|
|
5723
5778
|
function extractAcceptanceCriteria(content, stepNum) {
|
|
5724
5779
|
const criteria = [];
|
|
5725
|
-
const
|
|
5726
|
-
|
|
5780
|
+
const lines = content.split("\n");
|
|
5781
|
+
const sectionLines = [];
|
|
5782
|
+
let inSection = false;
|
|
5783
|
+
for (const line of lines) {
|
|
5784
|
+
if (/^##\s*Acceptance\s+Criteria$/i.test(line)) {
|
|
5785
|
+
inSection = true;
|
|
5786
|
+
continue;
|
|
5787
|
+
}
|
|
5788
|
+
if (inSection && /^##/.test(line)) {
|
|
5789
|
+
break;
|
|
5790
|
+
}
|
|
5791
|
+
if (inSection) {
|
|
5792
|
+
sectionLines.push(line);
|
|
5793
|
+
}
|
|
5794
|
+
}
|
|
5795
|
+
if (sectionLines.length === 0) {
|
|
5727
5796
|
return criteria;
|
|
5728
5797
|
}
|
|
5729
|
-
const sectionContent =
|
|
5798
|
+
const sectionContent = sectionLines.join("\n");
|
|
5730
5799
|
const checkboxRegex = /^[-*]\s*\[([x ])\]\s*(.+)$/gim;
|
|
5731
5800
|
let match;
|
|
5732
5801
|
while ((match = checkboxRegex.exec(sectionContent)) !== null) {
|
|
@@ -6114,76 +6183,76 @@ function createProgram() {
|
|
|
6114
6183
|
return program;
|
|
6115
6184
|
}
|
|
6116
6185
|
export {
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6186
|
+
removeStep as $,
|
|
6187
|
+
getTemplate as A,
|
|
6188
|
+
BasicTemplate as B,
|
|
6189
|
+
CRITERIA_PATTERNS as C,
|
|
6190
|
+
hasAnalysis as D,
|
|
6191
|
+
initCommand as E,
|
|
6192
|
+
FeatureTemplate as F,
|
|
6193
|
+
insertStep as G,
|
|
6194
|
+
HEALTH_THRESHOLDS as H,
|
|
6195
|
+
listFeedback as I,
|
|
6196
|
+
listTemplates as J,
|
|
6197
|
+
listTemplatesByCategory as K,
|
|
6198
|
+
loadAmendmentPrompts as L,
|
|
6199
|
+
MigrationTemplate as M,
|
|
6200
|
+
loadAnalysis as N,
|
|
6201
|
+
loadElaborationPrompts as O,
|
|
6133
6202
|
PLAN_CONVENTIONS as P,
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6203
|
+
moveStep as Q,
|
|
6204
|
+
RefactoringTemplate as R,
|
|
6205
|
+
SprintTemplate as S,
|
|
6206
|
+
parseAllDependencies as T,
|
|
6207
|
+
parseCriteria as U,
|
|
6208
|
+
parseCriteriaFromContent as V,
|
|
6209
|
+
parseDependenciesFromContent as W,
|
|
6210
|
+
parseDependenciesFromFile as X,
|
|
6211
|
+
registerPlanCommands as Y,
|
|
6212
|
+
registerRenderCommands as Z,
|
|
6213
|
+
registerTemplate as _,
|
|
6145
6214
|
renderToJson as a,
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6215
|
+
renderCommand as a0,
|
|
6216
|
+
saveAmendmentPrompt as a1,
|
|
6217
|
+
saveElaborationPrompt as a2,
|
|
6218
|
+
saveInitialPrompt as a3,
|
|
6219
|
+
searchTemplatesByTag as a4,
|
|
6220
|
+
skipStep as a5,
|
|
6221
|
+
startStep as a6,
|
|
6222
|
+
templateCommand as a7,
|
|
6223
|
+
templateListCommand as a8,
|
|
6224
|
+
templateShowCommand as a9,
|
|
6225
|
+
templateUseCommand as aa,
|
|
6226
|
+
unblockStep as ab,
|
|
6227
|
+
updateStatus as ac,
|
|
6228
|
+
updateStepDependencies as ad,
|
|
6229
|
+
validateCommand as ae,
|
|
6230
|
+
validateDependencies as af,
|
|
6231
|
+
validatePlan as ag,
|
|
6163
6232
|
renderToMarkdown as b,
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6233
|
+
PRIORITY_WEIGHTS as c,
|
|
6234
|
+
applyTemplate as d,
|
|
6235
|
+
archiveCommand as e,
|
|
6236
|
+
blockStep as f,
|
|
6237
|
+
buildDependencyGraph as g,
|
|
6238
|
+
buildDependencyGraphFromMap as h,
|
|
6239
|
+
checkCompletion as i,
|
|
6240
|
+
checkCoverage as j,
|
|
6241
|
+
completeStep as k,
|
|
6173
6242
|
loadPlan as l,
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6243
|
+
computeExecutionOrder as m,
|
|
6244
|
+
createAnalysisDirectory as n,
|
|
6245
|
+
createFeedback as o,
|
|
6246
|
+
createPlan as p,
|
|
6247
|
+
createProgram as q,
|
|
6179
6248
|
renderToHtml as r,
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6249
|
+
failStep as s,
|
|
6250
|
+
findCriticalPath as t,
|
|
6251
|
+
generateStatus$2 as u,
|
|
6252
|
+
getBlockedSteps as v,
|
|
6253
|
+
getCriteriaSummary as w,
|
|
6254
|
+
getDependencyChain as x,
|
|
6255
|
+
getFeedback as y,
|
|
6256
|
+
getReadySteps as z
|
|
6188
6257
|
};
|
|
6189
|
-
//# sourceMappingURL=cli-
|
|
6258
|
+
//# sourceMappingURL=cli-BAr1IsMF.js.map
|