neurastream 0.2.74 → 0.2.76

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neurastream",
3
- "version": "0.2.74",
3
+ "version": "0.2.76",
4
4
  "description": "Guardrails for running many AI coding agents at once: plan queue, blockers, call budgets, provider caps, scoring, merge-verified close.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -152,6 +152,7 @@ export async function mainStartText(args: string[], cfg: Config, opts: { inherit
152
152
  const mgLines = mg.stdout.trim().split("\n");
153
153
  say(mgLines.at(-1) ?? "");
154
154
  say(loadavgLine());
155
+ say(terminalLine(process.env));
155
156
  say("");
156
157
  say(`=== agents (last ${h}h; DIED = check its worktree, relaunch FRESH with its progress file)`);
157
158
  const ledger = await run(bin("agent-ledger", cfg), ["--hours", h], { stderr: "ignore" });
@@ -209,6 +210,17 @@ export async function mainStart(args: string[], cfg: Config, deps: MainStartDeps
209
210
  return 0;
210
211
  }
211
212
 
213
+ // The terminal the session runs in, from the environment alone (TERM is "dumb" under a harness, so it is not used).
214
+ // What the terminal can do (images, links) is not claimed: only its name is.
215
+ export function terminalLine(env: NodeJS.ProcessEnv): string {
216
+ const prog = env.TERM_PROGRAM
217
+ ? `${env.TERM_PROGRAM}${env.TERM_PROGRAM_VERSION ? ` ${env.TERM_PROGRAM_VERSION}` : ""}`
218
+ : env.KITTY_WINDOW_ID ? "kitty"
219
+ : env.ALACRITTY_WINDOW_ID || env.ALACRITTY_SOCKET ? "alacritty"
220
+ : env.WT_SESSION ? "windows-terminal" : "unknown";
221
+ return `terminal: ${prog}${env.XDG_SESSION_TYPE ? `, ${env.XDG_SESSION_TYPE}` : ""}`;
222
+ }
223
+
212
224
  // Due line for the weekly self-metrics report; null when notes/metrics.md is fresh.
213
225
  export function metricsDueLine(cfg: Config, nowMs: number): string | null {
214
226
  const reportFile = join(cfg.paths.notes, "metrics.md");
@@ -35,6 +35,17 @@ You are Main, the orchestrator. Main plans, delegates, reviews and lands; implem
35
35
  |`neurastream incident list --open`|session start, before status reports, when a spawn or stop is blocked|
36
36
  |`machine-guard`, `heavy-run`|machine-guard at session start and before launches; every test run goes through heavy-run|
37
37
 
38
+ ## Call formats (the guards refuse anything else)
39
+ |Call|Exact form|
40
+ |---|---|
41
+ |Planner spawn|the task's first line is `Planner role for <absolute plan path>.md` and nothing else on that line|
42
+ |Spawn while an incident is open|refused: first `neurastream incident dismiss <id> --why "<text>"` (or `incident plan <id> <plan.md>`)|
43
+ |Owner message flagged as a cancel|`queue-cancel --not-a-cancel "<why>"`; a real cancel is `queue-cancel <plan> "<owner words>"` or `queue-cancel --never "<what>" "<owner words>" --repo <repo>`|
44
+ |A done claim in `## Progress`|quote the phase's verify command verbatim plus a result mark: `exit 0`, `N pass`, `fail` or `result` (`EXIT=0` does not count)|
45
+ |Implementer spawn|needs a Main Progress entry newer than the agent's last run, a reviewer PASS, an `MR: none open` or `MR !N:` line, and `Branch X: … — this task: …` for an unmerged branch|
46
+ |Plan edits in `planner delegated` mode|an implementer cannot write its own Progress bullet; Main enters it, marked as entered on its behalf|
47
+ |`edit` on a plan or code file|absolute path, tag from a read that showed the lines you anchor to|
48
+
38
49
  Guard files are locked for every agent; the owner unlocks with `touch {{AGENT_DIR}}/.guard-unlock` (30 min), or — when `guards.chat_unlock` is on in the config — by typing `unlock 30` in chat (`lock` closes it again).
39
50
 
40
51
  Autonomy tiers: the owner sets how much Main does unattended with one word — `tier strict` (edit cap `autonomy.strict_edit_limit`, at most `guards.main_max_calls` tool calls per turn; every `git push`, `glab mr merge` or `gh pr merge` also waits until the owner types the approve phrase from `autonomy.go_phrase` (default `go push`; a bare `go` is an ordinary message), which approves exactly one landing for `autonomy.go_minutes` minutes), `tier opinionated` (the limits above), or `tier full` (no edit cap or call cap, and a `Priority skip: <plan> — Main: "<reason>"` line with a reason of at least four words may skip an idle higher plan). Pushes stay owner-ruled in strict and opinionated as above; whatever the tier, guard files, the phone page, notify secrets and the unlock stay owner-only.
@@ -6,6 +6,7 @@ THRESH_IO=${THRESH_IO:-40}
6
6
  COOLDOWN=${COOLDOWN:-600}
7
7
  STATE_DIR=${ALERT_STATE:?}
8
8
  mkdir -p "$STATE_DIR"
9
+ NOTIFY_TIMEOUT_MS=${NOTIFY_TIMEOUT_MS:-10000}
9
10
 
10
11
  alert() {
11
12
  local last now
@@ -13,7 +14,7 @@ alert() {
13
14
  now=$(date +%s)
14
15
  if (( now - last >= COOLDOWN )); then
15
16
  echo "$now" > "$STATE_DIR/$1"
16
- notify-send -u critical -a "resource-alerts" "$2" "$3" || true
17
+ notify-send -u normal -t "$NOTIFY_TIMEOUT_MS" -a "resource-alerts" "$2" "$3" || true
17
18
  fi
18
19
  }
19
20