@ouro.bot/cli 0.1.0-alpha.673 → 0.1.0-alpha.674

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.674",
6
+ "changes": [
7
+ "Add an inner-dialog auto-start guard so enabled agents can stay online without autonomous model-spending boot turns, including client-side self-message fallback paths and daemon health/status surfaces that respect intentionally parked agents."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.673",
6
12
  "changes": [
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.isLibraryKind = isLibraryKind;
37
37
  exports.listAllBundleAgents = listAllBundleAgents;
38
38
  exports.listEnabledBundleAgents = listEnabledBundleAgents;
39
+ exports.isInnerDialogAutoStartEnabled = isInnerDialogAutoStartEnabled;
39
40
  exports.listBundleSyncRows = listBundleSyncRows;
40
41
  const fs = __importStar(require("fs"));
41
42
  const path = __importStar(require("path"));
@@ -116,6 +117,44 @@ function listEnabledBundleAgents(options = {}) {
116
117
  .filter((row) => row.enabled && !isLibraryKind(row.kind))
117
118
  .map((row) => row.name);
118
119
  }
120
+ /**
121
+ * Per-agent runtime policy for the always-on inner-dialog worker. Agents
122
+ * default to the historic behavior (auto-start on daemon boot), but a bundle
123
+ * can opt out with:
124
+ *
125
+ * "innerDialog": { "autoStart": false }
126
+ *
127
+ * This keeps the agent enabled for sync/status/senses while preventing an
128
+ * autonomous boot turn from spending model credits.
129
+ */
130
+ function isInnerDialogAutoStartEnabled(agent, options = {}) {
131
+ const bundlesRoot = options.bundlesRoot ?? (0, identity_1.getAgentBundlesRoot)();
132
+ const readFileSync = options.readFileSync ?? fs.readFileSync;
133
+ const configPath = path.join(bundlesRoot, `${agent}.ouro`, "agent.json");
134
+ try {
135
+ const raw = readFileSync(configPath, "utf-8");
136
+ const parsed = JSON.parse(raw);
137
+ const innerDialog = parsed.innerDialog;
138
+ if (innerDialog && typeof innerDialog === "object" && !Array.isArray(innerDialog)) {
139
+ return innerDialog.autoStart !== false;
140
+ }
141
+ return true;
142
+ }
143
+ catch (error) {
144
+ (0, runtime_1.emitNervesEvent)({
145
+ level: "warn",
146
+ component: "daemon",
147
+ event: "daemon.inner_dialog_policy_read_failed",
148
+ message: "failed to read inner-dialog auto-start policy; refusing autonomous worker start",
149
+ meta: {
150
+ agent,
151
+ configPath,
152
+ error: error instanceof Error ? error.message : String(error),
153
+ },
154
+ });
155
+ return false;
156
+ }
157
+ }
119
158
  /**
120
159
  * Read the per-agent sync block from each enabled bundle's agent.json.
121
160
  * Used by the daemon (and stopped-state status renderer) to build per-agent
@@ -123,11 +123,19 @@ const processManager = new process_manager_1.DaemonProcessManager({
123
123
  name: agent,
124
124
  entry: "heart/agent-entry.js",
125
125
  channel: "inner-dialog",
126
- autoStart: true,
126
+ autoStart: (0, agent_discovery_1.isInnerDialogAutoStartEnabled)(agent),
127
127
  })),
128
128
  existsSync: fs.existsSync,
129
129
  /* v8 ignore next 4 -- wiring: delegates to checkAgentConfigWithProviderHealth which has full unit tests @preserve */
130
130
  configCheck: async (agent) => {
131
+ if (!(0, agent_discovery_1.isInnerDialogAutoStartEnabled)(agent)) {
132
+ return {
133
+ ok: true,
134
+ skip: true,
135
+ error: "inner-dialog auto-start is disabled in agent.json",
136
+ fix: "Set innerDialog.autoStart to true and rerun `ouro up` to resume autonomous inner-dialog turns.",
137
+ };
138
+ }
131
139
  const bundlesRoot = (0, identity_1.getAgentBundlesRoot)();
132
140
  return (0, agent_config_check_1.checkAgentConfigWithProviderHealth)(agent, bundlesRoot);
133
141
  },
@@ -266,7 +274,7 @@ const degradedComponents = [];
266
274
  function buildDaemonHealthState() {
267
275
  const snapshots = processManager.listAgentSnapshots();
268
276
  const agentDegradedComponents = snapshots
269
- .filter((snapshot) => snapshot.status !== "running")
277
+ .filter((snapshot) => snapshot.status !== "running" && snapshot.autoStart !== false)
270
278
  .map((snapshot) => {
271
279
  const reasonParts = [
272
280
  snapshot.errorReason ?? `${snapshot.channel} is ${snapshot.status}`,
@@ -305,7 +313,9 @@ function buildDaemonHealthState() {
305
313
  const rollupStatus = (0, daemon_rollup_1.computeDaemonRollup)({
306
314
  enabledAgents: snapshots.map((snapshot) => ({
307
315
  name: snapshot.name,
308
- status: snapshot.status,
316
+ // A parked non-autostart worker is intentionally not serving; it should
317
+ // remain visible in worker status but should not degrade daemon health.
318
+ status: snapshot.autoStart === false ? "running" : snapshot.status,
309
319
  })),
310
320
  bootstrapDegraded: degradedComponents,
311
321
  safeMode: false,
@@ -69,7 +69,8 @@ class HealthMonitor {
69
69
  async runChecks() {
70
70
  const results = [];
71
71
  const snapshots = this.processManager.listAgentSnapshots();
72
- const unhealthy = snapshots.filter((snapshot) => snapshot.status !== "running");
72
+ const unhealthy = snapshots.filter((snapshot) => snapshot.status !== "running" && snapshot.autoStart !== false);
73
+ const parked = snapshots.filter((snapshot) => snapshot.status !== "running" && snapshot.autoStart === false);
73
74
  if (unhealthy.length > 0) {
74
75
  const unhealthySummary = unhealthy.map((item) => {
75
76
  const detail = [
@@ -105,7 +106,10 @@ class HealthMonitor {
105
106
  }
106
107
  }
107
108
  else {
108
- results.push({ name: "agent-processes", status: "ok", message: "all managed agents running" });
109
+ const message = parked.length > 0
110
+ ? `all auto-start managed agents running; parked agents: ${parked.map((item) => item.name).join(", ")}`
111
+ : "all managed agents running";
112
+ results.push({ name: "agent-processes", status: "ok", message });
109
113
  }
110
114
  const jobs = this.scheduler.listJobs();
111
115
  const neverRan = jobs.filter((job) => !job.lastRun);
@@ -172,6 +172,7 @@ class DaemonProcessManager {
172
172
  snapshot: {
173
173
  name: agent.name,
174
174
  channel: agent.channel,
175
+ autoStart: agent.autoStart,
175
176
  status: "stopped",
176
177
  pid: null,
177
178
  restartCount: 0,
@@ -42,6 +42,7 @@ const identity_1 = require("../heart/identity");
42
42
  const session_events_1 = require("../heart/session-events");
43
43
  const runtime_1 = require("../nerves/runtime");
44
44
  const socket_client_1 = require("../heart/daemon/socket-client");
45
+ const agent_discovery_1 = require("../heart/daemon/agent-discovery");
45
46
  const thoughts_1 = require("../heart/daemon/thoughts");
46
47
  const manager_1 = require("../heart/bridges/manager");
47
48
  const session_transcript_1 = require("../heart/session-transcript");
@@ -711,6 +712,14 @@ exports.sessionToolDefinitions = [
711
712
  wakeResponse = null;
712
713
  }
713
714
  if (!wakeResponse?.ok) {
715
+ if (!(0, agent_discovery_1.isInnerDialogAutoStartEnabled)(agentName)) {
716
+ return renderInnerProgressStatus({
717
+ queue: "queued to inner/dialog",
718
+ wake: "parked by innerDialog.autoStart=false",
719
+ processing: "pending",
720
+ surfaced: "nothing yet",
721
+ });
722
+ }
714
723
  const { runInnerDialogTurn } = await Promise.resolve().then(() => __importStar(require("../senses/inner-dialog")));
715
724
  if (ctx?.context?.channel?.channel === "inner") {
716
725
  queueMicrotask(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.673",
3
+ "version": "0.1.0-alpha.674",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",