@ouro.bot/cli 0.1.0-alpha.25 → 0.1.0-alpha.26

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.26",
6
+ "changes": [
7
+ "The daemon now auto-checks npm for new runtime versions every 30 minutes and performs a staged restart when an update is available. You no longer need to manually run npm install."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.25",
6
12
  "changes": [
@@ -43,6 +43,9 @@ const runtime_metadata_1 = require("./runtime-metadata");
43
43
  const update_hooks_1 = require("./update-hooks");
44
44
  const bundle_meta_1 = require("./hooks/bundle-meta");
45
45
  const bundle_manifest_1 = require("../../mind/bundle-manifest");
46
+ const update_checker_1 = require("./update-checker");
47
+ const staged_restart_1 = require("./staged-restart");
48
+ const child_process_1 = require("child_process");
46
49
  function buildWorkerRows(snapshots) {
47
50
  return snapshots.map((snapshot) => ({
48
51
  agent: snapshot.name,
@@ -112,7 +115,42 @@ class OuroDaemon {
112
115
  });
113
116
  // Register update hooks and apply pending updates before starting agents
114
117
  (0, update_hooks_1.registerUpdateHook)(bundle_meta_1.bundleMetaHook);
115
- await (0, update_hooks_1.applyPendingUpdates)(this.bundlesRoot, (0, bundle_manifest_1.getPackageVersion)());
118
+ const currentVersion = (0, bundle_manifest_1.getPackageVersion)();
119
+ await (0, update_hooks_1.applyPendingUpdates)(this.bundlesRoot, currentVersion);
120
+ // Start periodic update checker (polls npm registry every 30 minutes)
121
+ const bundlesRoot = this.bundlesRoot;
122
+ const daemon = this;
123
+ (0, update_checker_1.startUpdateChecker)({
124
+ currentVersion,
125
+ deps: {
126
+ distTag: "alpha",
127
+ fetchRegistryJson: /* v8 ignore next -- integration: real HTTP fetch @preserve */ async () => {
128
+ const res = await fetch("https://registry.npmjs.org/@ouro.bot/cli");
129
+ return res.json();
130
+ },
131
+ },
132
+ onUpdate: /* v8 ignore start -- integration: real npm install + process spawn @preserve */ async (result) => {
133
+ if (!result.latestVersion)
134
+ return;
135
+ await (0, staged_restart_1.performStagedRestart)(result.latestVersion, {
136
+ execSync: (cmd) => (0, child_process_1.execSync)(cmd, { stdio: "inherit" }),
137
+ spawnSync: child_process_1.spawnSync,
138
+ resolveNewCodePath: (_version) => {
139
+ try {
140
+ const resolved = (0, child_process_1.execSync)(`node -e "console.log(require.resolve('@ouro.bot/cli/package.json'))"`, { encoding: "utf-8" }).trim();
141
+ return resolved ? path.dirname(resolved) : null;
142
+ }
143
+ catch {
144
+ return null;
145
+ }
146
+ },
147
+ gracefulShutdown: () => daemon.stop(),
148
+ nodePath: process.execPath,
149
+ bundlesRoot,
150
+ });
151
+ },
152
+ /* v8 ignore stop */
153
+ });
116
154
  await this.processManager.startAutoStartAgents();
117
155
  await this.senseManager?.startAutoStartSenses();
118
156
  this.scheduler.start?.();
@@ -200,6 +238,7 @@ class OuroDaemon {
200
238
  message: "stopping daemon server",
201
239
  meta: { socketPath: this.socketPath },
202
240
  });
241
+ (0, update_checker_1.stopUpdateChecker)();
203
242
  this.scheduler.stop?.();
204
243
  await this.processManager.stopAll();
205
244
  await this.senseManager?.stopAll();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.25",
3
+ "version": "0.1.0-alpha.26",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",