neurastream 0.2.43 → 0.2.44

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/README.md CHANGED
@@ -38,6 +38,8 @@ flowchart LR
38
38
 
39
39
  neurastream runs only under `neurastream main`. That launcher sets `NEURASTREAM_MAIN_LAUNCHER=1` for the omp it starts, and only then does the adapter register its hooks and commands. Plain `omp` runs with no guard, queue summary, rules or rollover, as if neurastream were not installed.
40
40
 
41
+ Your own Main-only lines go in `MAIN.md` in `paths.agent_dir` (for example `~/.omp/agent/MAIN.md`); Main gets them after its managed rules.
42
+
41
43
  ```sh
42
44
  neurastream main # Main: guards, queue, rules, rollover
43
45
  omp -p "say hi" # plain omp: no neurastream hook, no guard-log line
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neurastream",
3
- "version": "0.2.43",
3
+ "version": "0.2.44",
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",
@@ -2,7 +2,7 @@
2
2
  // between two markers. Main puts them in its system prompt; install only strips an old copy from
3
3
  // the owner's AGENTS.md, and everything outside the markers stays the owner's.
4
4
 
5
- import { readFileSync } from "node:fs";
5
+ import { existsSync, readFileSync } from "node:fs";
6
6
  import { dirname, join } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import type { Config } from "./config.ts";
@@ -14,7 +14,15 @@ export const END_MARK = "<!-- neurastream:end -->";
14
14
 
15
15
  export function renderBlock(cfg: Config, template: string = readFileSync(AGENTS_TEMPLATE, "utf8")): string {
16
16
  const body = template.trimEnd().split("{{AGENT_DIR}}").join(cfg.paths.agent_dir);
17
- return `${BEGIN_MARK}\n${body}\n${END_MARK}`;
17
+ const own = ownMainRules(cfg.paths.agent_dir);
18
+ const tail = own === "" ? "" : `\n\n${own}`;
19
+ return `${BEGIN_MARK}\n${body}${tail}\n${END_MARK}`;
20
+ }
21
+
22
+ // The owner's own Main-only lines: MAIN.md in the agent dir, trimmed. "" when the file is missing or blank.
23
+ function ownMainRules(agentDir: string): string {
24
+ const file = join(agentDir, "MAIN.md");
25
+ return existsSync(file) ? readFileSync(file, "utf8").trim() : "";
18
26
  }
19
27
 
20
28
  function occurrences(text: string, mark: string): number[] {