@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/cli.js CHANGED
@@ -4,8 +4,8 @@ import "chalk";
4
4
  import "node:fs";
5
5
  import "node:url";
6
6
  import "node:path";
7
- import { _ } from "./cli-DmsyaX1E.js";
7
+ import { q } from "./cli-BAr1IsMF.js";
8
8
  export {
9
- _ as createProgram
9
+ q as createProgram
10
10
  };
11
11
  //# sourceMappingURL=cli.js.map
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-DmsyaX1E.js";
2
- import { V, aa, W, ab, Y, a9, X, Z, U, a2, w, F, G, ag, af, y, J, h, k, c, _, B, I, o, L, ae, M, n, K, Q, j, a0, p, m, O, S, g, i, f, t, E, ac, ad, C, D, $, a7, R, q, a8, e, d, s, T, A, z, a3, a4, a5, a6, x, u, N, a1, H, v } from "./cli-DmsyaX1E.js";
3
- import { readFile, access, writeFile, readdir, mkdir } from "node:fs/promises";
4
- import { resolve, join, isAbsolute, relative, basename, dirname } from "node:path";
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 tableMatch = content.match(
154
- /\|\s*Step\s*\|\s*Name\s*\|[^\n]*\n\|[-\s|]+\n([\s\S]*?)(?=\n\n|\n##|$)/i
155
- );
156
- if (!tableMatch) return steps;
157
- const tableRows = tableMatch[1].split("\n").filter((row) => row.trim());
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 regex = new RegExp(
229
- `##\\s*${name}[^\\n]*\\n([\\s\\S]*?)(?=\\n##|\\n---|$)`,
230
- "i"
231
- );
232
- const match = content.match(regex);
233
- return match ? match[1].trim() : void 0;
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
- const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
243
- if (frontmatterMatch) {
244
- const frontmatter = frontmatterMatch[1];
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 sectionMatch = content.match(
284
- /##\s+Related\s+Plans?\s*\n([\s\S]*?)(?=\n##|\n#\s|$)/i
285
- );
286
- if (sectionMatch) {
287
- const section = sectionMatch[1];
288
- const lines = section.split("\n");
289
- for (const line of lines) {
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
- content = content.replace(/\n##\s+Related\s+Plans?\s*\n[\s\S]*?(?=\n##|\n#\s|$)/i, "");
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
- V as BasicTemplate,
1528
- aa as CRITERIA_PATTERNS,
1588
+ B as BasicTemplate,
1589
+ C as CRITERIA_PATTERNS,
1529
1590
  CliError,
1530
- W as FeatureTemplate,
1531
- ab as HEALTH_THRESHOLDS,
1532
- Y as MigrationTemplate,
1591
+ F as FeatureTemplate,
1592
+ H as HEALTH_THRESHOLDS,
1593
+ M as MigrationTemplate,
1533
1594
  MockStepExecutor,
1534
1595
  PLAN_CONVENTIONS,
1535
- a9 as PRIORITY_WEIGHTS,
1536
- X as RefactoringTemplate,
1537
- Z as SprintTemplate,
1596
+ c as PRIORITY_WEIGHTS,
1597
+ R as RefactoringTemplate,
1598
+ S as SprintTemplate,
1538
1599
  VERSION,
1539
1600
  addRelationship,
1540
- U as applyTemplate,
1541
- a2 as archiveCommand,
1542
- w as blockStep,
1543
- F as buildDependencyGraph,
1544
- G as buildDependencyGraphFromMap,
1545
- ag as checkCompletion,
1546
- af as checkCoverage,
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
- y as completeStep,
1549
- J as computeExecutionOrder,
1550
- h as createAnalysisDirectory,
1609
+ k as completeStep,
1610
+ m as computeExecutionOrder,
1611
+ n as createAnalysisDirectory,
1551
1612
  createBidirectionalRelationship,
1552
1613
  createExecutor,
1553
- k as createFeedback,
1614
+ o as createFeedback,
1554
1615
  createMilestone,
1555
- c as createPlan,
1556
- _ as createProgram,
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
- B as failStep,
1564
- I as findCriticalPath,
1624
+ s as failStep,
1625
+ t as findCriticalPath,
1565
1626
  formatStatus,
1566
1627
  generateRelationshipsMarkdown,
1567
1628
  generateRetrospective,
1568
1629
  generateRetrospectiveMarkdown,
1569
- o as generateStatus,
1630
+ u as generateStatus,
1570
1631
  getBlockedPlans,
1571
- L as getBlockedSteps,
1632
+ v as getBlockedSteps,
1572
1633
  getBlockingPlans,
1573
1634
  getChildPlans,
1574
- ae as getCriteriaSummary,
1635
+ w as getCriteriaSummary,
1575
1636
  getDefaultRegistryPath,
1576
- M as getDependencyChain,
1577
- n as getFeedback,
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
- K as getReadySteps,
1647
+ z as getReadySteps,
1587
1648
  getRegistryStats,
1588
1649
  getRelatedPlans,
1589
1650
  getRelationshipsByType,
1590
1651
  getRevision,
1591
1652
  getStatusIcon,
1592
- Q as getTemplate,
1653
+ A as getTemplate,
1593
1654
  handleError,
1594
- j as hasAnalysis,
1595
- a0 as initCommand,
1655
+ D as hasAnalysis,
1656
+ E as initCommand,
1596
1657
  initHistory,
1597
- p as insertStep,
1598
- m as listFeedback,
1658
+ G as insertStep,
1659
+ I as listFeedback,
1599
1660
  listMilestones,
1600
1661
  listRevisions,
1601
- O as listTemplates,
1602
- S as listTemplatesByCategory,
1603
- g as loadAmendmentPrompts,
1604
- i as loadAnalysis,
1605
- f as loadElaborationPrompts,
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
- t as moveStep,
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
- E as parseAllDependencies,
1620
- ac as parseCriteria,
1621
- ad as parseCriteriaFromContent,
1622
- C as parseDependenciesFromContent,
1623
- D as parseDependenciesFromFile,
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
- $ as registerPlanCommands,
1631
- a7 as registerRenderCommands,
1632
- R as registerTemplate,
1691
+ Y as registerPlanCommands,
1692
+ Z as registerRenderCommands,
1693
+ _ as registerTemplate,
1633
1694
  removeRelationship,
1634
- q as removeStep,
1635
- a8 as renderCommand,
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
- e as saveAmendmentPrompt,
1643
- d as saveElaborationPrompt,
1703
+ a1 as saveAmendmentPrompt,
1704
+ a2 as saveElaborationPrompt,
1644
1705
  saveHistory,
1645
- s as saveInitialPrompt,
1706
+ a3 as saveInitialPrompt,
1646
1707
  saveRegistry,
1647
1708
  scanForPlans,
1648
1709
  searchPlans,
1649
- T as searchTemplatesByTag,
1650
- A as skipStep,
1651
- z as startStep,
1652
- a3 as templateCommand,
1653
- a4 as templateListCommand,
1654
- a5 as templateShowCommand,
1655
- a6 as templateUseCommand,
1656
- x as unblockStep,
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
- u as updateStatus,
1661
- N as updateStepDependencies,
1662
- a1 as validateCommand,
1663
- H as validateDependencies,
1664
- v as validatePlan,
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