@ouro.bot/cli 0.1.0-alpha.300 → 0.1.0-alpha.301

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.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.301",
6
+ "changes": [
7
+ "fix(daemon): add an injectable `statusWriter` seam to `DaemonProcessManager` so human-visible config-failure lines still default to stderr in production, but tests can route or silence them intentionally. Status-writer failures are now swallowed with a `daemon.status_writer_error` nerves event instead of breaking agent startup bookkeeping. `process-manager.test.ts` now passes a no-op writer in the snapshot-focused config-check tests that were leaking expected fixture noise into the full coverage log, and adds a regression test proving a throwing status writer does not prevent the crashed snapshot/fix hint from being recorded."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.300",
6
12
  "changes": [
@@ -55,6 +55,7 @@ class DaemonProcessManager {
55
55
  maxCooldownRetries;
56
56
  existsSyncFn;
57
57
  configCheckFn;
58
+ statusWriterFn;
58
59
  onSnapshotChangeFn;
59
60
  /**
60
61
  * Notify the snapshot-change observer (if registered). Swallows any
@@ -80,6 +81,23 @@ class DaemonProcessManager {
80
81
  });
81
82
  }
82
83
  }
84
+ writeStatus(agent, text) {
85
+ try {
86
+ this.statusWriterFn(text);
87
+ }
88
+ catch (error) {
89
+ (0, runtime_1.emitNervesEvent)({
90
+ level: "warn",
91
+ component: "daemon",
92
+ event: "daemon.status_writer_error",
93
+ message: "daemon status writer threw",
94
+ meta: {
95
+ agent,
96
+ error: error instanceof Error ? error.message : String(error),
97
+ },
98
+ });
99
+ }
100
+ }
83
101
  constructor(options) {
84
102
  this.maxRestartsPerHour = options.maxRestartsPerHour ?? 10;
85
103
  this.stabilityThresholdMs = options.stabilityThresholdMs ?? 60_000;
@@ -93,6 +111,9 @@ class DaemonProcessManager {
93
111
  this.clearTimeoutFn = options.clearTimeoutFn ?? ((timer) => clearTimeout(timer));
94
112
  this.existsSyncFn = options.existsSync ?? null;
95
113
  this.configCheckFn = options.configCheck ?? null;
114
+ this.statusWriterFn = options.statusWriter ?? ((text) => {
115
+ process.stderr.write(text);
116
+ });
96
117
  this.onSnapshotChangeFn = options.onSnapshotChange ?? null;
97
118
  for (const agent of options.agents) {
98
119
  this.agents.set(agent.name, {
@@ -153,7 +174,7 @@ class DaemonProcessManager {
153
174
  message: result.error ?? "agent config validation failed",
154
175
  meta: { agent, fix: result.fix ?? null },
155
176
  });
156
- process.stderr.write(`[daemon] ${agent}: ${result.error}\n` +
177
+ this.writeStatus(agent, `[daemon] ${agent}: ${result.error}\n` +
157
178
  (result.fix ? ` Fix: ${result.fix}\n` : ""));
158
179
  this.notifySnapshotChange(state.snapshot);
159
180
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.300",
3
+ "version": "0.1.0-alpha.301",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",