@ouro.bot/cli 0.1.0-alpha.1097 → 0.1.0-alpha.1098

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.1098",
6
+ "changes": [
7
+ "The daemon's disk-space health check reads the real volume (it always said \"healthy (0%)\" because nothing supplied a reading), and says so when it can't read it."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1097",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1097",
2
+ "runtimeVersion": "0.1.0-alpha.1098",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1097</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1098</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -416,6 +416,7 @@ const senseManager = new sense_manager_1.DaemonSenseManager({
416
416
  const healthMonitor = new health_monitor_1.HealthMonitor({
417
417
  processManager,
418
418
  scheduler,
419
+ diskUsagePercent: () => (0, health_monitor_1.readDiskUsagePercent)((0, identity_1.getAgentBundlesRoot)()),
419
420
  sentinelChecker: async (resultsSoFar) => {
420
421
  const sentinels = await Promise.all(managedAgents.map((agent) => refreshDaemonSentinel(agent, "daemon_health", resultsSoFar)));
421
422
  // Each agent runs on one machine: stop any agent whose lease (on disk or
@@ -1,7 +1,54 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.HealthMonitor = void 0;
37
+ exports.readDiskUsagePercent = readDiskUsagePercent;
38
+ const fs = __importStar(require("fs"));
4
39
  const runtime_1 = require("../../nerves/runtime");
40
+ /** Percent of the volume holding `dir` that is in use, as `df` reports it, or null when it can't be read. */
41
+ function readDiskUsagePercent(dir, statfs = fs.statfsSync) {
42
+ try {
43
+ const { blocks, bavail } = statfs(dir);
44
+ if (!(blocks > 0) || !(bavail >= 0) || bavail > blocks)
45
+ return null;
46
+ return Math.round((100 * (blocks - bavail)) / blocks);
47
+ }
48
+ catch {
49
+ return null;
50
+ }
51
+ }
5
52
  class HealthMonitor {
6
53
  processManager;
7
54
  scheduler;
@@ -129,7 +176,14 @@ class HealthMonitor {
129
176
  results.push({ name: "cron-health", status: "ok", message: `cron jobs are healthy${firstRunSuffix}` });
130
177
  }
131
178
  const diskPercent = this.diskUsagePercent();
132
- if (diskPercent >= 90) {
179
+ if (diskPercent === null) {
180
+ results.push({
181
+ name: "disk-space",
182
+ status: "warn",
183
+ message: "disk usage could not be read",
184
+ });
185
+ }
186
+ else if (diskPercent >= 90) {
133
187
  results.push({
134
188
  name: "disk-space",
135
189
  status: "critical",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1097",
3
+ "version": "0.1.0-alpha.1098",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1097",
9
+ "version": "0.1.0-alpha.1098",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@ouro.bot/friends": "0.1.0-alpha.18",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1097",
3
+ "version": "0.1.0-alpha.1098",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },