@riotprompt/riotplan 1.0.0 → 1.0.3
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/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as PLAN_CONVENTIONS, l as loadPlan, r as renderToHtml, a as renderToJson, b as renderToMarkdown } from "./cli-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { P as PLAN_CONVENTIONS, l as loadPlan, r as renderToHtml, a as renderToJson, b as renderToMarkdown } from "./cli-BAr1IsMF.js";
|
|
2
|
+
import { B, C, F, H, M, c, R, S, d, e, f, g, h, i, j, k, m, n, o, p, q, s, t, u, v, w, x, y, z, A, D, E, G, I, J, K, L, N, O, Q, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag } from "./cli-BAr1IsMF.js";
|
|
3
|
+
import { access, readFile, writeFile, readdir, mkdir } from "node:fs/promises";
|
|
4
|
+
import { isAbsolute, resolve, relative, join, basename, dirname } from "node:path";
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
function parseStatus(content, options = {}) {
|
|
@@ -150,11 +150,29 @@ function parseStatusText(text) {
|
|
|
150
150
|
}
|
|
151
151
|
function parseStepProgress(content) {
|
|
152
152
|
const steps = [];
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const
|
|
153
|
+
const lines = content.split("\n");
|
|
154
|
+
let inTable = false;
|
|
155
|
+
let headerFound = false;
|
|
156
|
+
const tableRows = [];
|
|
157
|
+
for (const line of lines) {
|
|
158
|
+
if (!headerFound && /\|\s*Step\s*\|\s*Name\s*\|/i.test(line)) {
|
|
159
|
+
headerFound = true;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (headerFound && !inTable && /^\|[-\s|]+\|$/.test(line)) {
|
|
163
|
+
inTable = true;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (inTable) {
|
|
167
|
+
if (!line.trim() || /^##/.test(line)) {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
if (line.includes("|")) {
|
|
171
|
+
tableRows.push(line);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (tableRows.length === 0) return steps;
|
|
158
176
|
for (const row of tableRows) {
|
|
159
177
|
if (row.match(/^\|[-\s|]+\|$/)) continue;
|
|
160
178
|
const cells = row.split("|").map((c2) => c2.trim()).filter((c2) => c2);
|
|
@@ -225,12 +243,22 @@ function parseNotes(content) {
|
|
|
225
243
|
return trimmed;
|
|
226
244
|
}
|
|
227
245
|
function extractSection(content, name) {
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
)
|
|
232
|
-
|
|
233
|
-
|
|
246
|
+
const lines = content.split("\n");
|
|
247
|
+
const sectionLines = [];
|
|
248
|
+
let inSection = false;
|
|
249
|
+
for (const line of lines) {
|
|
250
|
+
if (new RegExp(`^##\\s*${name}`, "i").test(line)) {
|
|
251
|
+
inSection = true;
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (inSection && (/^##/.test(line) || /^---/.test(line))) {
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
if (inSection) {
|
|
258
|
+
sectionLines.push(line);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return sectionLines.length > 0 ? sectionLines.join("\n").trim() : void 0;
|
|
234
262
|
}
|
|
235
263
|
function extractStepNumber(stepRef) {
|
|
236
264
|
if (!stepRef) return void 0;
|
|
@@ -239,9 +267,14 @@ function extractStepNumber(stepRef) {
|
|
|
239
267
|
}
|
|
240
268
|
function parseRelationshipsFromContent(content) {
|
|
241
269
|
const relationships = [];
|
|
242
|
-
|
|
243
|
-
if (
|
|
244
|
-
const
|
|
270
|
+
let frontmatter = null;
|
|
271
|
+
if (content.startsWith("---\n")) {
|
|
272
|
+
const endMarker = content.indexOf("\n---", 4);
|
|
273
|
+
if (endMarker !== -1) {
|
|
274
|
+
frontmatter = content.substring(4, endMarker);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (frontmatter) {
|
|
245
278
|
const spawnedFrom = frontmatter.match(/spawned-from:\s*(.+)/);
|
|
246
279
|
if (spawnedFrom) {
|
|
247
280
|
relationships.push({
|
|
@@ -280,13 +313,25 @@ function parseRelationshipsFromContent(content) {
|
|
|
280
313
|
}
|
|
281
314
|
}
|
|
282
315
|
}
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
316
|
+
const lines = content.split("\n");
|
|
317
|
+
const sectionLines = [];
|
|
318
|
+
let inSection = false;
|
|
319
|
+
for (const line of lines) {
|
|
320
|
+
if (/^##\s+Related\s+Plans?$/i.test(line)) {
|
|
321
|
+
inSection = true;
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
if (inSection && /^#/.test(line)) {
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
if (inSection) {
|
|
328
|
+
sectionLines.push(line);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (sectionLines.length > 0) {
|
|
332
|
+
const section = sectionLines.join("\n");
|
|
333
|
+
const lines2 = section.split("\n");
|
|
334
|
+
for (const line of lines2) {
|
|
290
335
|
const trimmed = line.trim();
|
|
291
336
|
if (!trimmed.startsWith("-")) continue;
|
|
292
337
|
const itemContent = trimmed.slice(1).trim();
|
|
@@ -569,7 +614,23 @@ ${plan.metadata.description || "Plan summary."}
|
|
|
569
614
|
|
|
570
615
|
`;
|
|
571
616
|
}
|
|
572
|
-
|
|
617
|
+
const lines = content.split("\n");
|
|
618
|
+
const filtered = [];
|
|
619
|
+
let inRelatedSection = false;
|
|
620
|
+
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
621
|
+
const line = lines[i2];
|
|
622
|
+
if (/^##\s+Related\s+Plans?$/i.test(line)) {
|
|
623
|
+
inRelatedSection = true;
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
if (inRelatedSection && /^#/.test(line)) {
|
|
627
|
+
inRelatedSection = false;
|
|
628
|
+
}
|
|
629
|
+
if (!inRelatedSection) {
|
|
630
|
+
filtered.push(line);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
content = filtered.join("\n");
|
|
573
634
|
const relSection = generateRelationshipsMarkdown(plan);
|
|
574
635
|
if (relSection) {
|
|
575
636
|
content = content.trimEnd() + "\n\n" + relSection;
|
|
@@ -1524,57 +1585,57 @@ function updatePlanState(_plan, _stepNumber, _result) {
|
|
|
1524
1585
|
);
|
|
1525
1586
|
}
|
|
1526
1587
|
export {
|
|
1527
|
-
|
|
1528
|
-
|
|
1588
|
+
B as BasicTemplate,
|
|
1589
|
+
C as CRITERIA_PATTERNS,
|
|
1529
1590
|
CliError,
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1591
|
+
F as FeatureTemplate,
|
|
1592
|
+
H as HEALTH_THRESHOLDS,
|
|
1593
|
+
M as MigrationTemplate,
|
|
1533
1594
|
MockStepExecutor,
|
|
1534
1595
|
PLAN_CONVENTIONS,
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1596
|
+
c as PRIORITY_WEIGHTS,
|
|
1597
|
+
R as RefactoringTemplate,
|
|
1598
|
+
S as SprintTemplate,
|
|
1538
1599
|
VERSION,
|
|
1539
1600
|
addRelationship,
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1601
|
+
d as applyTemplate,
|
|
1602
|
+
e as archiveCommand,
|
|
1603
|
+
f as blockStep,
|
|
1604
|
+
g as buildDependencyGraph,
|
|
1605
|
+
h as buildDependencyGraphFromMap,
|
|
1606
|
+
i as checkCompletion,
|
|
1607
|
+
j as checkCoverage,
|
|
1547
1608
|
compareRevisions,
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1609
|
+
k as completeStep,
|
|
1610
|
+
m as computeExecutionOrder,
|
|
1611
|
+
n as createAnalysisDirectory,
|
|
1551
1612
|
createBidirectionalRelationship,
|
|
1552
1613
|
createExecutor,
|
|
1553
|
-
|
|
1614
|
+
o as createFeedback,
|
|
1554
1615
|
createMilestone,
|
|
1555
|
-
|
|
1556
|
-
|
|
1616
|
+
p as createPlan,
|
|
1617
|
+
q as createProgram,
|
|
1557
1618
|
createRegistry,
|
|
1558
1619
|
createRetrospective,
|
|
1559
1620
|
createRevision,
|
|
1560
1621
|
executePendingSteps,
|
|
1561
1622
|
executeStep,
|
|
1562
1623
|
executeStep$1 as executeStepWithExecutor,
|
|
1563
|
-
|
|
1564
|
-
|
|
1624
|
+
s as failStep,
|
|
1625
|
+
t as findCriticalPath,
|
|
1565
1626
|
formatStatus,
|
|
1566
1627
|
generateRelationshipsMarkdown,
|
|
1567
1628
|
generateRetrospective,
|
|
1568
1629
|
generateRetrospectiveMarkdown,
|
|
1569
|
-
|
|
1630
|
+
u as generateStatus,
|
|
1570
1631
|
getBlockedPlans,
|
|
1571
|
-
|
|
1632
|
+
v as getBlockedSteps,
|
|
1572
1633
|
getBlockingPlans,
|
|
1573
1634
|
getChildPlans,
|
|
1574
|
-
|
|
1635
|
+
w as getCriteriaSummary,
|
|
1575
1636
|
getDefaultRegistryPath,
|
|
1576
|
-
|
|
1577
|
-
|
|
1637
|
+
x as getDependencyChain,
|
|
1638
|
+
y as getFeedback,
|
|
1578
1639
|
getInverseRelationType,
|
|
1579
1640
|
getLatestMilestone,
|
|
1580
1641
|
getLatestRevision,
|
|
@@ -1583,30 +1644,30 @@ export {
|
|
|
1583
1644
|
getPlanByCode,
|
|
1584
1645
|
getPlanByPath,
|
|
1585
1646
|
getPlansByStatus,
|
|
1586
|
-
|
|
1647
|
+
z as getReadySteps,
|
|
1587
1648
|
getRegistryStats,
|
|
1588
1649
|
getRelatedPlans,
|
|
1589
1650
|
getRelationshipsByType,
|
|
1590
1651
|
getRevision,
|
|
1591
1652
|
getStatusIcon,
|
|
1592
|
-
|
|
1653
|
+
A as getTemplate,
|
|
1593
1654
|
handleError,
|
|
1594
|
-
|
|
1595
|
-
|
|
1655
|
+
D as hasAnalysis,
|
|
1656
|
+
E as initCommand,
|
|
1596
1657
|
initHistory,
|
|
1597
|
-
|
|
1598
|
-
|
|
1658
|
+
G as insertStep,
|
|
1659
|
+
I as listFeedback,
|
|
1599
1660
|
listMilestones,
|
|
1600
1661
|
listRevisions,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1662
|
+
J as listTemplates,
|
|
1663
|
+
K as listTemplatesByCategory,
|
|
1664
|
+
L as loadAmendmentPrompts,
|
|
1665
|
+
N as loadAnalysis,
|
|
1666
|
+
O as loadElaborationPrompts,
|
|
1606
1667
|
loadHistory,
|
|
1607
1668
|
loadPlan,
|
|
1608
1669
|
loadRegistry,
|
|
1609
|
-
|
|
1670
|
+
Q as moveStep,
|
|
1610
1671
|
nextVersion,
|
|
1611
1672
|
notImplemented,
|
|
1612
1673
|
outputError,
|
|
@@ -1616,52 +1677,52 @@ export {
|
|
|
1616
1677
|
outputStepList,
|
|
1617
1678
|
outputSuccess,
|
|
1618
1679
|
outputWarning,
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1680
|
+
T as parseAllDependencies,
|
|
1681
|
+
U as parseCriteria,
|
|
1682
|
+
V as parseCriteriaFromContent,
|
|
1683
|
+
W as parseDependenciesFromContent,
|
|
1684
|
+
X as parseDependenciesFromFile,
|
|
1624
1685
|
parseRelationshipsFromContent,
|
|
1625
1686
|
parseRelationshipsFromPlan,
|
|
1626
1687
|
parseStatus,
|
|
1627
1688
|
refreshAllPlans,
|
|
1628
1689
|
refreshPlan,
|
|
1629
1690
|
registerPlan,
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1691
|
+
Y as registerPlanCommands,
|
|
1692
|
+
Z as registerRenderCommands,
|
|
1693
|
+
_ as registerTemplate,
|
|
1633
1694
|
removeRelationship,
|
|
1634
|
-
|
|
1635
|
-
|
|
1695
|
+
$ as removeStep,
|
|
1696
|
+
a0 as renderCommand,
|
|
1636
1697
|
renderPlan,
|
|
1637
1698
|
renderToHtml,
|
|
1638
1699
|
renderToJson,
|
|
1639
1700
|
renderToMarkdown,
|
|
1640
1701
|
resumePlan,
|
|
1641
1702
|
rollbackToMilestone,
|
|
1642
|
-
|
|
1643
|
-
|
|
1703
|
+
a1 as saveAmendmentPrompt,
|
|
1704
|
+
a2 as saveElaborationPrompt,
|
|
1644
1705
|
saveHistory,
|
|
1645
|
-
|
|
1706
|
+
a3 as saveInitialPrompt,
|
|
1646
1707
|
saveRegistry,
|
|
1647
1708
|
scanForPlans,
|
|
1648
1709
|
searchPlans,
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1710
|
+
a4 as searchTemplatesByTag,
|
|
1711
|
+
a5 as skipStep,
|
|
1712
|
+
a6 as startStep,
|
|
1713
|
+
a7 as templateCommand,
|
|
1714
|
+
a8 as templateListCommand,
|
|
1715
|
+
a9 as templateShowCommand,
|
|
1716
|
+
aa as templateUseCommand,
|
|
1717
|
+
ab as unblockStep,
|
|
1657
1718
|
unregisterPlan,
|
|
1658
1719
|
updatePlanRelationships,
|
|
1659
1720
|
updatePlanState,
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1721
|
+
ac as updateStatus,
|
|
1722
|
+
ad as updateStepDependencies,
|
|
1723
|
+
ae as validateCommand,
|
|
1724
|
+
af as validateDependencies,
|
|
1725
|
+
ag as validatePlan,
|
|
1665
1726
|
validateRelationships
|
|
1666
1727
|
};
|
|
1667
1728
|
//# sourceMappingURL=index.js.map
|