neurastream 0.2.34 → 0.2.36
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/package.json +1 -1
- package/src/cli/pages.ts +9 -3
- package/src/core/owner-ui.ts +1 -1
- package/src/core/wip-backup.ts +2 -2
- package/src/core/wip-snapshot.ts +2 -2
- package/templates/AGENTS.md +2 -0
package/package.json
CHANGED
package/src/cli/pages.ts
CHANGED
|
@@ -24,11 +24,17 @@ export async function runPages(args: string[] = [], deps: PagesDeps = {}): Promi
|
|
|
24
24
|
return new Promise<number>(() => {});
|
|
25
25
|
}
|
|
26
26
|
if (args[0] === "publish" && args[1]) {
|
|
27
|
-
let force = false, keep = false
|
|
28
|
-
|
|
27
|
+
let force = false, keep = false;
|
|
28
|
+
const rest: string[] = [];
|
|
29
|
+
for (const arg of args.slice(1)) { if (arg === "--force") force = true; else if (arg === "--keep") keep = true; else rest.push(arg); }
|
|
30
|
+
// file first, then the optional name; flags may sit anywhere (2026-10-27: `--force <file>` used
|
|
31
|
+
// to be read as file "--force" because only args.slice(2) was scanned)
|
|
32
|
+
const file = rest[0];
|
|
33
|
+
const name = rest[1];
|
|
34
|
+
if (!file || rest.length > 2) return 2;
|
|
29
35
|
const now = clock();
|
|
30
36
|
sweepPages(cfg.pages.dir, cfg.pages.keep_days, now);
|
|
31
|
-
const n = publishPage(
|
|
37
|
+
const n = publishPage(file, name, force, cfg.pages.dir, keep, cfg.pages.keep_days, now);
|
|
32
38
|
const host = (deps.tailscale ?? realTailscale).dnsName() ?? "tailnet";
|
|
33
39
|
console.log(`http://${host}:${cfg.pages.port}/${encodeURIComponent(n)}`);
|
|
34
40
|
const expires = readExpiry(cfg.pages.dir)[n]?.expires;
|
package/src/core/owner-ui.ts
CHANGED
|
@@ -866,7 +866,7 @@ var qlist=main.querySelector("#qlist");
|
|
|
866
866
|
if(qlist){
|
|
867
867
|
var moveCard=function(card,how){if(how==="top"){var f=qlist.querySelector(".qcard");if(f&&f!==card)qlist.insertBefore(card,f);}else if(how==="up"){var p=card.previousElementSibling;if(p&&p.classList.contains("qcard"))qlist.insertBefore(card,p);}else if(how==="down"){var n=card.nextElementSibling;if(n&&n.classList.contains("qcard"))qlist.insertBefore(card,n.nextSibling);}};
|
|
868
868
|
qlist.addEventListener("click",function(e){var t=e.target;if(!t||!t.closest)return;var b=t.closest(".qmove");if(!b)return;var card=t.closest(".qcard");if(!card)return;moveCard(card,b.getAttribute("data-move"));sendReorder(card.getAttribute("data-plan"),qlist);});
|
|
869
|
-
qlist.addEventListener("pointerdown",function(e){var t=e.target;if(!t||!t.closest)return;var h=t.closest(".qhandle");if(h&&!drag){var card=t.closest(".qcard");if(card){e.preventDefault();dragging=true;var r=card.getBoundingClientRect();var ph=document.createElement("li");ph.className="qph";ph.style.height=r.height+"px";qlist.insertBefore(ph,card);card.classList.add("dragging");card.style.width=r.width+"px";card.style.left=r.left+"px";card.style.top=r.top+"px";drag={card:card,ph:ph,y0:e.clientY,y:e.clientY,id:e.pointerId,list:qlist,raf:0};try{h.setPointerCapture(e.pointerId);}catch(_){}requestAnimationFrame(dragFrame);}}}
|
|
869
|
+
qlist.addEventListener("pointerdown",function(e){var t=e.target;if(!t||!t.closest)return;var h=t.closest(".qhandle");if(h&&!drag){var card=t.closest(".qcard");if(card){e.preventDefault();dragging=true;var r=card.getBoundingClientRect();var ph=document.createElement("li");ph.className="qph";ph.style.height=r.height+"px";qlist.insertBefore(ph,card);card.classList.add("dragging");card.style.width=r.width+"px";card.style.left=r.left+"px";card.style.top=r.top+"px";drag={card:card,ph:ph,y0:e.clientY,y:e.clientY,id:e.pointerId,list:qlist,raf:0};try{h.setPointerCapture(e.pointerId);}catch(_){}requestAnimationFrame(dragFrame);}}});
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
872
|
function busy(){if(dragging)return true;var els=document.querySelectorAll("input:not([type=hidden]), textarea");for(var k=0;k<els.length;k++){if(els[k]===document.activeElement||els[k].value)return true;}return false;}
|
package/src/core/wip-backup.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { accessSync, constants, existsSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { join, relative } from "node:path";
|
|
2
|
+
import { join, relative, resolve } from "node:path";
|
|
3
3
|
import type { Config } from "./config.ts";
|
|
4
4
|
import { nowSec, strftime } from "./clock.ts";
|
|
5
5
|
import { printText } from "./help.ts";
|
|
@@ -40,7 +40,7 @@ export function wipBackup(args: string[], cfg: Config): number {
|
|
|
40
40
|
|
|
41
41
|
for (const repo of repos(cfg.paths.work_roots)) {
|
|
42
42
|
const commonRaw = gitRaw(repo, ["rev-parse", "--git-common-dir"]).stdout || ".";
|
|
43
|
-
const common = realpathSync(
|
|
43
|
+
const common = realpathSync(resolve(repo, commonRaw));
|
|
44
44
|
if (seen.has(common)) continue;
|
|
45
45
|
seen.add(common);
|
|
46
46
|
const du = cmd(["du", "-sm", common]);
|
package/src/core/wip-snapshot.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { copyFileSync, existsSync, lstatSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
4
|
import type { Config } from "./config.ts";
|
|
5
5
|
import { nowSec, strftime } from "./clock.ts";
|
|
6
6
|
import { printText } from "./help.ts";
|
|
@@ -39,7 +39,7 @@ export function wipSnapshot(args: string[], cfg: Config): number {
|
|
|
39
39
|
const worktrees: string[] = [];
|
|
40
40
|
for (const repo of repos(cfg.paths.work_roots)) {
|
|
41
41
|
const commonRaw = gitRaw(repo, ["rev-parse", "--git-common-dir"]).stdout || ".";
|
|
42
|
-
const common = realpathSync(
|
|
42
|
+
const common = realpathSync(resolve(repo, commonRaw));
|
|
43
43
|
if (seen.has(common)) continue;
|
|
44
44
|
seen.add(common);
|
|
45
45
|
const out = gitRaw(repo, ["worktree", "list", "--porcelain"]).stdout;
|
package/templates/AGENTS.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
You are Main, the orchestrator. Main plans, delegates, reviews and lands; implementers do the work.
|
|
4
4
|
|
|
5
5
|
## Plans
|
|
6
|
+
- Code is a burden: every line we add must be maintained forever, so it must justify its keep. Before adding a file, function, option or dependency, say in one sentence why existing code cannot do it; no sentence → don't add it. Main is the judge: in review, code that cannot justify its keep is deleted, and dead code found anywhere is removed.
|
|
7
|
+
- Tests cost tokens and time: if the repo's CI runs a suite on the MR (e.g. a witnessed end-to-end job), never run that suite locally. Run only the targeted tests for the changed code locally; the MR pipeline is the proof, and Main reads its result.
|
|
6
8
|
- When the owner asks for work in a repo, write the plan to `<main checkout>/docs/plans/` and list its absolute path in the one index `{{AGENT_DIR}}/INDEX.md` (one plan file per line, never a repo directory). One plan = one worktree: the plan's Worktree line names a worktree no other open plan names.
|
|
7
9
|
- INDEX.md order is priority: free agents go to the top plans first. A lower plan goes first only when the higher one says `Waits on: <plan>`, is WAITING on owner, or the brief quotes the owner: `Priority skip: <plan> — owner: "<his words>"`.
|
|
8
10
|
- A hold is one line: `WAITING on owner: <what to do> — blocked: <what stays stuck until then> — why you: <why Main cannot do it>`. The phone page shows those three parts; a missing part is left out.
|