mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 04:45:33 -08:00
Add Stop with a handoff, handoff chips on the dashboard, and a one-step delete for fixed bugs
AI Assisted
This commit is contained in:
1 parent
33a0dbd34a
commit
36843e4bc9
34 files changed
+1926
-267
No files matched your search
@@ -75,6 +75,7 @@ import { cleanSetting, defaultSetting, offered } from "./public/subagents.js";
|
||||
import { ACCENTS, DEFAULT_ACCENT, DEFAULT_CARD_WIDTH, cardWidth } from "./public/palette.js";
|
||||
import { defaultName, freeName, nameProblem } from "./public/workspace.js";
|
||||
import { checkForUpdate } from "./update-check.mjs";
|
||||
import { handoffsDir, isHandoffId } from "./handoffs.mjs";
|
||||
import { WORKSPACE_PICKER_PROMPT, pickFolder, pickerCommand } from "./picker.mjs";
|
||||
|
||||
const args = parseArgs(process.argv.slice(2));
|
||||
@@ -1211,6 +1212,21 @@ const server = http.createServer((req, res) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// A handoff's document, read-only, for the dashboard's "Read it all". Only a
|
||||
// dashboard serves it, and only an id its own scan listed: a used or unknown
|
||||
// id, or anything that is not a bare handoff id, is a 404.
|
||||
if (pathname === "/handoff" && req.method === "GET") {
|
||||
const state = readState() || {};
|
||||
const id = url.searchParams.get("id");
|
||||
const listed = state.workflow === "dashboard" && isHandoffId(id) && (state.scan?.handoffs || []).some((h) => h && h.id === id);
|
||||
if (!listed) return send(res, 404, "", "text/plain");
|
||||
fs.readFile(path.join(handoffsDir(), id + ".md"), "utf8", (err, text) => {
|
||||
if (err) return send(res, 404, "", "text/plain");
|
||||
send(res, 200, text, "text/markdown; charset=utf-8", { "cache-control": "no-store" });
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (pathname === "/version" && req.method === "GET") {
|
||||
const version = installedVersion();
|
||||
if (version) return json(res, 200, { version, latest: updateLatest });
|
||||
|
||||
Reference in new issue
Block a user