declare-cc 1.0.5 → 1.0.8
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/declare-tools.cjs +49 -34
- package/dist/public/app.js +127 -813
- package/dist/public/index.html +12 -355
- package/package.json +1 -1
package/dist/declare-tools.cjs
CHANGED
|
@@ -319,12 +319,14 @@ var require_milestones = __commonJS({
|
|
|
319
319
|
function parseMarkdownTable(text) {
|
|
320
320
|
const lines = text.trim().split("\n").filter((l) => l.trim().startsWith("|"));
|
|
321
321
|
if (lines.length < 2) return [];
|
|
322
|
-
const
|
|
322
|
+
const raw = lines[0].split("|").map((h) => h.trim());
|
|
323
|
+
const headers = raw.slice(1, raw.length - 1);
|
|
323
324
|
return lines.slice(2).map((line) => {
|
|
324
|
-
const
|
|
325
|
+
const raw2 = line.split("|").map((c) => c.trim());
|
|
326
|
+
const cells = raw2.slice(1, raw2.length - 1);
|
|
325
327
|
const row = {};
|
|
326
328
|
headers.forEach((h, i) => {
|
|
327
|
-
row[h] = cells[i] || "";
|
|
329
|
+
row[h] = (cells[i] || "").trim();
|
|
328
330
|
});
|
|
329
331
|
return row;
|
|
330
332
|
});
|
|
@@ -1552,7 +1554,7 @@ var require_help = __commonJS({
|
|
|
1552
1554
|
usage: "/declare:help"
|
|
1553
1555
|
}
|
|
1554
1556
|
],
|
|
1555
|
-
version: "1.0.
|
|
1557
|
+
version: "1.0.8"
|
|
1556
1558
|
};
|
|
1557
1559
|
}
|
|
1558
1560
|
module2.exports = { runHelp: runHelp2 };
|
|
@@ -4302,7 +4304,7 @@ var require_ai_runner = __commonJS({
|
|
|
4302
4304
|
const env = { ...process.env };
|
|
4303
4305
|
delete env.CLAUDECODE;
|
|
4304
4306
|
const queryOpts = {
|
|
4305
|
-
model: opts.model || "
|
|
4307
|
+
model: opts.model || "sonnet",
|
|
4306
4308
|
maxTurns: opts.maxTurns || 1,
|
|
4307
4309
|
cwd: opts.cwd || process.cwd(),
|
|
4308
4310
|
abortController,
|
|
@@ -4712,7 +4714,7 @@ data: ${JSON.stringify(data)}
|
|
|
4712
4714
|
sessions.set(sessionId, { milestoneId: milestone.id, agentId, abortController, startTime: Date.now() });
|
|
4713
4715
|
runAI(prompt, {
|
|
4714
4716
|
cwd,
|
|
4715
|
-
model: "
|
|
4717
|
+
model: "opus",
|
|
4716
4718
|
maxTurns: 1,
|
|
4717
4719
|
abortController,
|
|
4718
4720
|
onText: (text) => {
|
|
@@ -7396,7 +7398,7 @@ If the current version is already good, output exactly: LGTM \u2014 no changes n
|
|
|
7396
7398
|
const isWriteMode = mode === "write";
|
|
7397
7399
|
runAI(prompt, {
|
|
7398
7400
|
cwd,
|
|
7399
|
-
model: "
|
|
7401
|
+
model: "opus",
|
|
7400
7402
|
maxTurns: isWriteMode ? 10 : 1,
|
|
7401
7403
|
withTools: isWriteMode,
|
|
7402
7404
|
abortController,
|
|
@@ -7608,7 +7610,7 @@ The options array is optional \u2014 include it only when there are clear altern
|
|
|
7608
7610
|
discussSession = { sessionId, nodeId: id, abortController, agentId };
|
|
7609
7611
|
runAI(prompt, {
|
|
7610
7612
|
cwd,
|
|
7611
|
-
model: "
|
|
7613
|
+
model: "opus",
|
|
7612
7614
|
maxTurns: 1,
|
|
7613
7615
|
abortController,
|
|
7614
7616
|
onText: (text) => {
|
|
@@ -7944,7 +7946,7 @@ The options array is optional \u2014 include it only when there are clear altern
|
|
|
7944
7946
|
persistOnboardSession(cwd);
|
|
7945
7947
|
runAI(prompt, {
|
|
7946
7948
|
cwd,
|
|
7947
|
-
model: "
|
|
7949
|
+
model: "opus",
|
|
7948
7950
|
maxTurns: 1,
|
|
7949
7951
|
abortController,
|
|
7950
7952
|
onText: (text) => {
|
|
@@ -8267,6 +8269,33 @@ data: ${JSON.stringify({ reason: "archive", nodeId: id })}
|
|
|
8267
8269
|
const projectNameMatch = content.match(/^# Future:\s*(.+)/m);
|
|
8268
8270
|
const projectName = projectNameMatch ? projectNameMatch[1].trim() : "Project";
|
|
8269
8271
|
fs.writeFileSync(futurePath, writeFutureFile(filtered, projectName), "utf-8");
|
|
8272
|
+
const msPath = path.join(planningDir, "MILESTONES.md");
|
|
8273
|
+
if (fs.existsSync(msPath)) {
|
|
8274
|
+
const msContent = fs.readFileSync(msPath, "utf-8");
|
|
8275
|
+
const { milestones } = parseMilestonesFile(msContent);
|
|
8276
|
+
const orphaned = [];
|
|
8277
|
+
const surviving = [];
|
|
8278
|
+
for (const m of milestones) {
|
|
8279
|
+
if (!m.realizes.includes(id)) {
|
|
8280
|
+
surviving.push(m);
|
|
8281
|
+
} else if (m.realizes.length === 1) {
|
|
8282
|
+
orphaned.push(m);
|
|
8283
|
+
} else {
|
|
8284
|
+
surviving.push({ ...m, realizes: m.realizes.filter((r) => r !== id) });
|
|
8285
|
+
}
|
|
8286
|
+
}
|
|
8287
|
+
for (const m of orphaned) {
|
|
8288
|
+
const folder = findMilestoneFolder(planningDir, m.id);
|
|
8289
|
+
if (folder) {
|
|
8290
|
+
fs.rmSync(folder, { recursive: true, force: true });
|
|
8291
|
+
}
|
|
8292
|
+
}
|
|
8293
|
+
if (orphaned.length > 0 || surviving.length !== milestones.length) {
|
|
8294
|
+
const msProjectMatch = msContent.match(/^# Milestones:\s*(.+)/m);
|
|
8295
|
+
const msProjectName = msProjectMatch ? msProjectMatch[1].trim() : "Project";
|
|
8296
|
+
fs.writeFileSync(msPath, writeMilestonesFile(surviving, msProjectName), "utf-8");
|
|
8297
|
+
}
|
|
8298
|
+
}
|
|
8270
8299
|
} else if (prefix === "M") {
|
|
8271
8300
|
const msPath = path.join(planningDir, "MILESTONES.md");
|
|
8272
8301
|
const content = fs.readFileSync(msPath, "utf-8");
|
|
@@ -8723,6 +8752,10 @@ data: ${JSON.stringify({ reason: "delete", nodeId: id })}
|
|
|
8723
8752
|
req.on("close", () => sseClients.delete(res));
|
|
8724
8753
|
return;
|
|
8725
8754
|
}
|
|
8755
|
+
if (urlPath === "/api/version") {
|
|
8756
|
+
sendJson(res, 200, { version: true ? "1.0.8" : "dev" });
|
|
8757
|
+
return;
|
|
8758
|
+
}
|
|
8726
8759
|
if (urlPath === "/api/graph") {
|
|
8727
8760
|
handleGraph(res, cwd);
|
|
8728
8761
|
return;
|
|
@@ -8974,8 +9007,8 @@ var require_open = __commonJS({
|
|
|
8974
9007
|
var fs = require("fs");
|
|
8975
9008
|
var path = require("path");
|
|
8976
9009
|
var http = require("http");
|
|
8977
|
-
var { spawn } = require("child_process");
|
|
8978
9010
|
var { runInit: runInit2 } = require_init();
|
|
9011
|
+
var { startServer } = require_server();
|
|
8979
9012
|
function checkServer(port) {
|
|
8980
9013
|
return new Promise((resolve) => {
|
|
8981
9014
|
const req = http.get(`http://localhost:${port}/api/graph`, (res) => {
|
|
@@ -8989,18 +9022,6 @@ var require_open = __commonJS({
|
|
|
8989
9022
|
});
|
|
8990
9023
|
});
|
|
8991
9024
|
}
|
|
8992
|
-
async function waitForPortFile(portFile, maxAttempts = 30, intervalMs = 200) {
|
|
8993
|
-
for (let i = 0; i < maxAttempts; i++) {
|
|
8994
|
-
try {
|
|
8995
|
-
const content = fs.readFileSync(portFile, "utf8").trim();
|
|
8996
|
-
const port = parseInt(content, 10);
|
|
8997
|
-
if (!isNaN(port) && port > 0) return port;
|
|
8998
|
-
} catch (_) {
|
|
8999
|
-
}
|
|
9000
|
-
await new Promise((r) => setTimeout(r, intervalMs));
|
|
9001
|
-
}
|
|
9002
|
-
return null;
|
|
9003
|
-
}
|
|
9004
9025
|
async function runOpen2(cwd, args) {
|
|
9005
9026
|
const planningDir = path.join(cwd, ".planning");
|
|
9006
9027
|
if (!fs.existsSync(planningDir)) {
|
|
@@ -9025,19 +9046,13 @@ var require_open = __commonJS({
|
|
|
9025
9046
|
}
|
|
9026
9047
|
}
|
|
9027
9048
|
}
|
|
9028
|
-
const
|
|
9029
|
-
|
|
9030
|
-
|
|
9031
|
-
|
|
9032
|
-
|
|
9049
|
+
const { server, url } = await startServer(cwd);
|
|
9050
|
+
console.log(`Dashboard: ${url}`);
|
|
9051
|
+
const shutdown = () => server.close(() => process.exit(0));
|
|
9052
|
+
process.on("SIGINT", shutdown);
|
|
9053
|
+
process.on("SIGTERM", shutdown);
|
|
9054
|
+
await new Promise(() => {
|
|
9033
9055
|
});
|
|
9034
|
-
child.unref();
|
|
9035
|
-
const port = await waitForPortFile(portFile);
|
|
9036
|
-
if (!port) {
|
|
9037
|
-
console.error("[declare] Server failed to start (no port file after 6s)");
|
|
9038
|
-
process.exit(1);
|
|
9039
|
-
}
|
|
9040
|
-
console.log(`Dashboard: http://localhost:${port}`);
|
|
9041
9056
|
}
|
|
9042
9057
|
module2.exports = { runOpen: runOpen2 };
|
|
9043
9058
|
}
|