maxsimcli 2.5.1 → 2.5.2
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.
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap"
|
|
11
11
|
rel="stylesheet"
|
|
12
12
|
/>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-DnL8rwuQ.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/index-SwFemGUT.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
@@ -41941,6 +41941,24 @@ app.get("/api/roadmap", (_req, res) => {
|
|
|
41941
41941
|
if (!data) return res.status(404).json({ error: "ROADMAP.md not found" });
|
|
41942
41942
|
return res.json(data);
|
|
41943
41943
|
});
|
|
41944
|
+
app.patch("/api/roadmap", (req, res) => {
|
|
41945
|
+
const roadmapPath = node_path.join(projectCwd, ".planning", "ROADMAP.md");
|
|
41946
|
+
if (!node_fs.existsSync(roadmapPath)) return res.status(404).json({ error: "ROADMAP.md not found" });
|
|
41947
|
+
const { phaseNumber, checked } = req.body;
|
|
41948
|
+
if (!phaseNumber || checked === void 0) return res.status(400).json({ error: "phaseNumber and checked are required" });
|
|
41949
|
+
let content = node_fs.readFileSync(roadmapPath, "utf-8");
|
|
41950
|
+
const escapedNum = phaseNumber.replace(".", "\\.");
|
|
41951
|
+
const pattern = new RegExp(`(-\\s*\\[)(x| )(\\]\\s*.*Phase\\s+${escapedNum})`, "i");
|
|
41952
|
+
if (!content.match(pattern)) return res.status(404).json({ error: `Phase ${phaseNumber} checkbox not found in ROADMAP.md` });
|
|
41953
|
+
content = content.replace(pattern, `$1${checked ? "x" : " "}$3`);
|
|
41954
|
+
suppressPath(roadmapPath);
|
|
41955
|
+
node_fs.writeFileSync(roadmapPath, content, "utf-8");
|
|
41956
|
+
return res.json({
|
|
41957
|
+
updated: true,
|
|
41958
|
+
phaseNumber,
|
|
41959
|
+
checked
|
|
41960
|
+
});
|
|
41961
|
+
});
|
|
41944
41962
|
app.get("/api/state", (_req, res) => {
|
|
41945
41963
|
const data = parseState(projectCwd);
|
|
41946
41964
|
if (!data) return res.status(404).json({ error: "STATE.md not found" });
|
|
@@ -41961,6 +41979,70 @@ app.patch("/api/state", (req, res) => {
|
|
|
41961
41979
|
field
|
|
41962
41980
|
});
|
|
41963
41981
|
});
|
|
41982
|
+
function ensureStateMd(statePath) {
|
|
41983
|
+
if (node_fs.existsSync(statePath)) return;
|
|
41984
|
+
const planningDir = node_path.dirname(statePath);
|
|
41985
|
+
node_fs.mkdirSync(planningDir, { recursive: true });
|
|
41986
|
+
const template = `# Project State
|
|
41987
|
+
|
|
41988
|
+
## Current Position
|
|
41989
|
+
|
|
41990
|
+
Phase: 1
|
|
41991
|
+
Status: In progress
|
|
41992
|
+
Last activity: ${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]} — State file created
|
|
41993
|
+
|
|
41994
|
+
## Accumulated Context
|
|
41995
|
+
|
|
41996
|
+
### Decisions
|
|
41997
|
+
|
|
41998
|
+
None yet.
|
|
41999
|
+
|
|
42000
|
+
### Blockers/Concerns
|
|
42001
|
+
|
|
42002
|
+
None yet.
|
|
42003
|
+
`;
|
|
42004
|
+
node_fs.writeFileSync(statePath, template, "utf-8");
|
|
42005
|
+
}
|
|
42006
|
+
function appendToStateSection(statePath, sectionPattern, entry) {
|
|
42007
|
+
let content = node_fs.readFileSync(statePath, "utf-8");
|
|
42008
|
+
const match = content.match(sectionPattern);
|
|
42009
|
+
if (!match) return {
|
|
42010
|
+
success: false,
|
|
42011
|
+
reason: "Section not found in STATE.md"
|
|
42012
|
+
};
|
|
42013
|
+
let sectionBody = match[2];
|
|
42014
|
+
sectionBody = sectionBody.replace(/None yet\.?\s*\n?/gi, "").replace(/No decisions yet\.?\s*\n?/gi, "").replace(/None\.?\s*\n?/gi, "");
|
|
42015
|
+
sectionBody = sectionBody.trimEnd() + "\n" + entry + "\n";
|
|
42016
|
+
content = content.replace(sectionPattern, (_m, header) => `${header}${sectionBody}`);
|
|
42017
|
+
suppressPath(statePath);
|
|
42018
|
+
node_fs.writeFileSync(statePath, content, "utf-8");
|
|
42019
|
+
return { success: true };
|
|
42020
|
+
}
|
|
42021
|
+
app.post("/api/state/decision", (req, res) => {
|
|
42022
|
+
const statePath = node_path.join(projectCwd, ".planning", "STATE.md");
|
|
42023
|
+
ensureStateMd(statePath);
|
|
42024
|
+
const { phase, text } = req.body;
|
|
42025
|
+
if (!text?.trim()) return res.status(400).json({ error: "text is required" });
|
|
42026
|
+
const entry = `- [Phase ${phase?.trim() || "?"}]: ${text.trim()}`;
|
|
42027
|
+
const result = appendToStateSection(statePath, /(###?\s*(?:Decisions|Decisions Made|Accumulated.*Decisions)\s*\n)([\s\S]*?)(?=\n###?|\n##[^#]|$)/i, entry);
|
|
42028
|
+
if (!result.success) return res.status(404).json({ error: result.reason });
|
|
42029
|
+
return res.json({
|
|
42030
|
+
added: true,
|
|
42031
|
+
decision: entry
|
|
42032
|
+
});
|
|
42033
|
+
});
|
|
42034
|
+
app.post("/api/state/blocker", (req, res) => {
|
|
42035
|
+
const statePath = node_path.join(projectCwd, ".planning", "STATE.md");
|
|
42036
|
+
ensureStateMd(statePath);
|
|
42037
|
+
const { text } = req.body;
|
|
42038
|
+
if (!text?.trim()) return res.status(400).json({ error: "text is required" });
|
|
42039
|
+
const result = appendToStateSection(statePath, /(###?\s*(?:Blockers|Blockers\/Concerns|Concerns)\s*\n)([\s\S]*?)(?=\n###?|\n##[^#]|$)/i, `- ${text.trim()}`);
|
|
42040
|
+
if (!result.success) return res.status(404).json({ error: result.reason });
|
|
42041
|
+
return res.json({
|
|
42042
|
+
added: true,
|
|
42043
|
+
blocker: text.trim()
|
|
42044
|
+
});
|
|
42045
|
+
});
|
|
41964
42046
|
app.get("/api/phases", (_req, res) => {
|
|
41965
42047
|
const phases = parsePhases(projectCwd);
|
|
41966
42048
|
return res.json(phases);
|
package/package.json
CHANGED