diacode 0.2.0 → 0.2.1
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/CHANGELOG.md +22 -0
- package/bin/dcursed.js +35 -5
- package/editor/app/index.html +1 -1
- package/editor/assets/{app-CSD76pDG.js → app-0Ti-gp9D.js} +32 -32
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1 (2026-11-10)
|
|
4
|
+
|
|
5
|
+
A fix release: **run `npx diacode init <agent>` again** in each repository to get the permission rule (below), then restart the agent's
|
|
6
|
+
session. Nothing else changes: plans and architectures are read as they were.
|
|
7
|
+
|
|
8
|
+
From walking a whole task, from a description to a finished app, with a live Claude Code (`docs/assessment/paper-shelf.md`):
|
|
9
|
+
|
|
10
|
+
- **`init` lets Claude Code call DiaCode's own tools without asking.** In Claude Code's manual mode every plan call asked permission:
|
|
11
|
+
about fifty prompts for one small app. `init claude-code` now adds one rule, `mcp__dcursed`, to `.claude/settings.local.json`
|
|
12
|
+
(`settings.json` with `--shared`). It covers only the plan and architecture tools; writing files and running commands still ask,
|
|
13
|
+
as you have set them to. `init --remove` takes the rule out and leaves your own rules; `doctor` notes a setup without it (run
|
|
14
|
+
`init` again, or leave it if you want the prompts).
|
|
15
|
+
- **Stop refuses the prompt an agent is waiting on.** A permission prompt the agent had already raised stayed in its window after
|
|
16
|
+
Stop, and Allow there would still run the command. It is now refused at once ("the person pressed Stop") when you press Stop.
|
|
17
|
+
- **A rename flags nothing, and a finished plan shows no review flags.** Renaming a step marked every step after it *needs review*
|
|
18
|
+
for good, and the flags still showed on the finished plan and in the compact view. A step's name is not what the steps after it
|
|
19
|
+
rely on: only a new description, kind or file list flags them, and a plan that is done asks nothing of you (reopen it and the flags
|
|
20
|
+
are back).
|
|
21
|
+
- **The inbox opens by itself for a permission prompt.** With a plan open, *Allow* and *Deny* were inside a folded line. It now opens
|
|
22
|
+
once for each new prompt (fold it and it stays folded until the next one).
|
|
23
|
+
- The text an agent is told when you deny a prompt says DiaCode, not DcurseD.
|
|
24
|
+
|
|
3
25
|
## 0.2.0 (2026-11-10)
|
|
4
26
|
|
|
5
27
|
**DcurseD is now DiaCode.** The package and the command are `diacode` (`npx diacode init claude-code`, `npx diacode serve`);
|
package/bin/dcursed.js
CHANGED
|
@@ -423,7 +423,7 @@ function step(p, op, ctx) {
|
|
|
423
423
|
["status", "statusFrom", "statusBy", "note", "owner"]
|
|
424
424
|
) delete n[k];
|
|
425
425
|
ctx.touched.add(op.id);
|
|
426
|
-
const meaningChanged = n.
|
|
426
|
+
const meaningChanged = n.kind !== before.kind || n.detail !== before.detail || JSON.stringify(n.files) !== JSON.stringify(before.files);
|
|
427
427
|
if (meaningChanged) {
|
|
428
428
|
for (const [d, dist] of downstreamOf(p, op.id, true)) affect(d, dist, `${op.id} changed`);
|
|
429
429
|
sharers(op.id, [...before.files ?? [], ...n.files ?? []], "changed");
|
|
@@ -3424,7 +3424,8 @@ var PlanStore = class extends EventEmitter {
|
|
|
3424
3424
|
plan: e.plan,
|
|
3425
3425
|
layout: e.layout,
|
|
3426
3426
|
derived: { blocked: Object.fromEntries(blocked), held: Object.fromEntries(held), gates, ready: [...ready], proposed: Object.fromEntries(proposed), atRisk: Object.fromEntries(atRisk), progress },
|
|
3427
|
-
|
|
3427
|
+
// A finished plan is history: what was flagged while it ran no longer asks anything of you (reopen it and it does).
|
|
3428
|
+
review: e.plan.phase === "done" ? {} : Object.fromEntries(e.review),
|
|
3428
3429
|
// The latest changes, newest last: who did what, for the editor's Changes panel.
|
|
3429
3430
|
recent: e.log.filter((l) => !l.snapshot).slice(-30),
|
|
3430
3431
|
error: e.error
|
|
@@ -6510,9 +6511,20 @@ var Permissions = class extends EventEmitter6 {
|
|
|
6510
6511
|
decide(id, decision, reason) {
|
|
6511
6512
|
const p = this.pending.get(id);
|
|
6512
6513
|
if (!p) return false;
|
|
6513
|
-
p.settle(decision === "allow" ? { behavior: "allow" } : { behavior: "deny", message: reason?.trim() ? `The person denied this in the
|
|
6514
|
+
p.settle(decision === "allow" ? { behavior: "allow" } : { behavior: "deny", message: reason?.trim() ? `The person denied this in the DiaCode editor: ${reason.trim().slice(0, 500)}` : "The person denied this in the DiaCode editor." });
|
|
6514
6515
|
return true;
|
|
6515
6516
|
}
|
|
6517
|
+
/**
|
|
6518
|
+
* You stopped the plan this agent is working on: whatever it has asked and not been answered is refused now, and it is
|
|
6519
|
+
* told why. Without this its window keeps the prompt, and Allow there would run a command you stopped it from running.
|
|
6520
|
+
* @param {string} actor @param {string} message what the agent is told
|
|
6521
|
+
* @returns {number} how many prompts were refused
|
|
6522
|
+
*/
|
|
6523
|
+
denyAll(actor, message) {
|
|
6524
|
+
const asked = [...this.pending.values()].filter((p) => p.actor === actor);
|
|
6525
|
+
for (const p of asked) p.settle({ behavior: "deny", message });
|
|
6526
|
+
return asked.length;
|
|
6527
|
+
}
|
|
6516
6528
|
/** The session was heard from again: what it asked has been answered in its own window. @param {string} actor @param {string} [session] */
|
|
6517
6529
|
heard(actor, session) {
|
|
6518
6530
|
for (const p of [...this.pending.values()]) if (p.actor === actor && (session === void 0 || p.session === void 0 || p.session === session)) p.settle(null);
|
|
@@ -6553,6 +6565,12 @@ function createServer({ root: root2, port: port2 = 7300, host = "127.0.0.1", all
|
|
|
6553
6565
|
});
|
|
6554
6566
|
const permissions = new Permissions();
|
|
6555
6567
|
permissions.on("change", () => presence.announce?.());
|
|
6568
|
+
calls.on("stops", () => {
|
|
6569
|
+
for (const actor of calls.stops.keys()) {
|
|
6570
|
+
const plan2 = calls.stoppedFor(actor);
|
|
6571
|
+
if (plan2) permissions.denyAll(actor, `The person pressed Stop in the DiaCode editor: plan ${plan2} is stopped. Do not run this. Say that you have stopped, and end your turn.`);
|
|
6572
|
+
}
|
|
6573
|
+
});
|
|
6556
6574
|
const heard = (agents2) => {
|
|
6557
6575
|
const on = new Set(calls.listening());
|
|
6558
6576
|
return agents2.map((a) => {
|
|
@@ -7255,6 +7273,7 @@ async function mergeJson(root2, rel, change, what, snippet) {
|
|
|
7255
7273
|
}
|
|
7256
7274
|
var curlHook = (port2, harness, hook, agent, fallback = "{}") => `curl -s --max-time 2 -X POST -H 'content-type: application/json' --data-binary @- 'http://127.0.0.1:${port2}/hooks/${harness}/${hook}?agent=${agent}' || echo '${fallback}'`;
|
|
7257
7275
|
var askHook = (port2, harness, hook, agent) => `curl -s --max-time 2 -X POST -H 'content-type: application/json' --data-binary @- 'http://127.0.0.1:${port2}/hooks/${harness}/${hook}?agent=${agent}&pid='"$PPID" || echo '{}'`;
|
|
7276
|
+
var ALLOW_TOOLS = "mcp__dcursed";
|
|
7258
7277
|
var WAKE_SECONDS = 86400;
|
|
7259
7278
|
var wakeHook = (port2, harness, agent) => `out=$(curl -sf --max-time ${WAKE_SECONDS - 30} -X POST -H 'content-type: application/json' --data-binary @- 'http://127.0.0.1:${port2}/hooks/${harness}/wake?agent=${agent}&hold=${(WAKE_SECONDS - 40) * 1e3}') && [ -n "$out" ] && { printf '%s' "$out" >&2; exit 2; }; exit 0`;
|
|
7260
7279
|
var PERMISSION_SECONDS = 600;
|
|
@@ -7328,7 +7347,10 @@ async function initClaudeCode({ root: root2, port: port2 = 7300, agent = "main",
|
|
|
7328
7347
|
said.push(await mergeJson(root2, settings, (d) => {
|
|
7329
7348
|
d.hooks = d.hooks ?? {};
|
|
7330
7349
|
for (const [event, group] of Object.entries(ours)) d.hooks[event] = [...(d.hooks[event] ?? []).filter((g) => !mine(g)), group];
|
|
7331
|
-
|
|
7350
|
+
d.permissions = d.permissions ?? {};
|
|
7351
|
+
const allow = Array.isArray(d.permissions.allow) ? d.permissions.allow : [];
|
|
7352
|
+
d.permissions.allow = allow.includes(ALLOW_TOOLS) ? allow : [...allow, ALLOW_TOOLS];
|
|
7353
|
+
}, "the hooks that tell the plan server what the agent does and what changed, and the rule that lets it call these plan tools without asking", `"hooks": ${JSON.stringify(ours)}, "permissions": { "allow": ["${ALLOW_TOOLS}"] }`));
|
|
7332
7354
|
if (!shared) {
|
|
7333
7355
|
const kept = await keepOutOfGit(root2, ".claude/settings.local.json");
|
|
7334
7356
|
if (kept) said.push(kept);
|
|
@@ -7497,7 +7519,12 @@ async function removeClaudeCode({ root: root2 }) {
|
|
|
7497
7519
|
pruneEmpty(d.hooks, event);
|
|
7498
7520
|
}
|
|
7499
7521
|
pruneEmpty(d, "hooks");
|
|
7500
|
-
|
|
7522
|
+
if (Array.isArray(d.permissions?.allow)) {
|
|
7523
|
+
d.permissions.allow = d.permissions.allow.filter((r) => r !== ALLOW_TOOLS);
|
|
7524
|
+
pruneEmpty(d.permissions, "allow");
|
|
7525
|
+
pruneEmpty(d, "permissions");
|
|
7526
|
+
}
|
|
7527
|
+
}, (d) => onlyOurs(d), /\/hooks\/claude-code\/|mcp__dcursed/, 'the hooks whose address contains /hooks/claude-code/, and the "mcp__dcursed" allow rule'));
|
|
7501
7528
|
}
|
|
7502
7529
|
said.push(await drop(root2, ".claude/rules/dcursed.md", "the rules"));
|
|
7503
7530
|
const unhidden = await letGitSeeAgain(root2, ".claude/settings.local.json");
|
|
@@ -7668,6 +7695,9 @@ async function claudeCode(root2) {
|
|
|
7668
7695
|
if (hookText.includes("/hooks/claude-code/Stop") && !hookText.includes("/hooks/claude-code/PreToolUse")) {
|
|
7669
7696
|
findings.push(problem("no PreToolUse hook: Stop in the editor cannot halt the agent mid-turn (it hears it at its next dcursed tool)", "{init}"));
|
|
7670
7697
|
}
|
|
7698
|
+
if (hookText.includes("/hooks/claude-code/Stop") && !hookText.includes(ALLOW_TOOLS)) {
|
|
7699
|
+
findings.push(note(`Claude Code asks permission before each plan call; init adds one rule, "${ALLOW_TOOLS}", that covers only the plan tools (run init again to add it, or skip it if you want the prompts)`));
|
|
7700
|
+
}
|
|
7671
7701
|
return { harness: "claude-code", label: "Claude Code", ports: [...mcp.ports, ...hooks.ports], findings };
|
|
7672
7702
|
}
|
|
7673
7703
|
async function cursor(root2) {
|
package/editor/app/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<meta name="description" content="A plan you and your coding agents share: a diagram in your repository that you edit by hand, with each step showing who has it and how that is known.">
|
|
9
9
|
<meta name="theme-color" content="#FBFAF8">
|
|
10
10
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
11
|
-
<script type="module" crossorigin src="/assets/app-
|
|
11
|
+
<script type="module" crossorigin src="/assets/app-0Ti-gp9D.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/fonts-C71K6yRy.js">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/fonts-CdeCoHOe.css">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/app-1SR3-4wc.css">
|