@ouro.bot/cli 0.1.0-alpha.1323 → 0.1.0-alpha.1324

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.1324",
6
+ "changes": [
7
+ "note, consult_notes, read_config and update_config have Ouro AX cards; their failures end with a code, and read_config states a low-risk profile."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1323",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1323",
2
+ "runtimeVersion": "0.1.0-alpha.1324",
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.1323</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1324</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -39,6 +39,7 @@ const path = __importStar(require("path"));
39
39
  const runtime_1 = require("../nerves/runtime");
40
40
  const identity_1 = require("../heart/identity");
41
41
  const config_registry_1 = require("../heart/config-registry");
42
+ const tool_error_code_1 = require("./tool-error-code");
42
43
  exports.configToolDefinitions = [
43
44
  {
44
45
  tool: {
@@ -112,6 +113,10 @@ exports.configToolDefinitions = [
112
113
  (0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.read_config", message: `read_config returned ${result.length} entries`, meta: { count: result.length, topic: a.related_to ?? null } });
113
114
  return JSON.stringify({ entries: result }, null, 2);
114
115
  },
116
+ riskProfile: { mutates: "none", risk: "low" },
117
+ ax: { id: "tool:read_config", group: "turn-config", when: "Pick this to see your settings with current values, defaults and effects, optionally by topic, before you change one with update_config.", effect: "read", idempotent: true, errors: [
118
+ { code: "invalid-arguments", means: "related_to isn't text.", fix: "Call read_config again with a topic word such as model or logging, or with no arguments." },
119
+ ] },
115
120
  },
116
121
  {
117
122
  tool: {
@@ -133,7 +138,7 @@ exports.configToolDefinitions = [
133
138
  const entry = (0, config_registry_1.getRegistryEntry)(a.path);
134
139
  if (!entry) {
135
140
  (0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.update_config_error", message: `unknown config path: ${a.path}`, meta: { path: a.path } });
136
- return `Error: unknown config path "${a.path}". Use read_config to see available paths.`;
141
+ return (0, tool_error_code_1.withCode)(`Error: unknown config path "${a.path}". Use read_config to see available paths.`, "unknown-config-path");
137
142
  }
138
143
  let parsedValue;
139
144
  try {
@@ -141,7 +146,7 @@ exports.configToolDefinitions = [
141
146
  }
142
147
  catch {
143
148
  (0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.update_config_error", message: `invalid JSON value for ${a.path}`, meta: { path: a.path, value: a.value } });
144
- return `Error: invalid JSON value. Provide value as valid JSON (e.g., 25, "debug", ["terminal"]).`;
149
+ return (0, tool_error_code_1.withCode)(`Error: invalid JSON value. Provide value as valid JSON (e.g., 25, "debug", ["terminal"]).`, "invalid-json");
145
150
  }
146
151
  // Validate value against registry entry's validator
147
152
  /* v8 ignore next -- all current entries have validators; guard kept for future entries without one @preserve */
@@ -149,13 +154,13 @@ exports.configToolDefinitions = [
149
154
  const validationError = entry.validate(parsedValue);
150
155
  if (validationError) {
151
156
  (0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.update_config_error", message: `validation failed for ${a.path}: ${validationError}`, meta: { path: a.path, value: a.value, validationError } });
152
- return `Error: validation failed for "${a.path}": ${validationError}`;
157
+ return (0, tool_error_code_1.withCode)(`Error: validation failed for "${a.path}": ${validationError}`, "invalid-config-value");
153
158
  }
154
159
  }
155
160
  // Managed: refuse
156
161
  if (entry.tier === "managed") {
157
162
  (0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.update_config_refused", message: `refused managed change to ${a.path}`, meta: { path: a.path, tier: "managed" } });
158
- return `This key is managed by the harness and cannot be modified directly.`;
163
+ return (0, tool_error_code_1.withCode)(`This key is managed by the harness and cannot be modified directly.`, "managed-key");
159
164
  }
160
165
  const agentRoot = (0, identity_1.getAgentRoot)();
161
166
  const configPath = path.join(agentRoot, "agent.json");
@@ -165,7 +170,7 @@ exports.configToolDefinitions = [
165
170
  }
166
171
  catch {
167
172
  /* v8 ignore next -- defensive: agent.json read failure in update_config @preserve */
168
- return `Error: failed to read agent.json at ${configPath}`;
173
+ return (0, tool_error_code_1.withCode)(`Error: failed to read agent.json at ${configPath}`, "config-unreadable");
169
174
  }
170
175
  // Apply change immediately
171
176
  const parts = entry.path.split(".");
@@ -182,5 +187,13 @@ exports.configToolDefinitions = [
182
187
  return `Success: "${a.path}" updated to ${JSON.stringify(parsedValue)}. Change applied immediately.`;
183
188
  },
184
189
  riskProfile: { mutates: "durable_state_write", risk: "high", reason: "writes agent.json" },
190
+ ax: { id: "tool:update_config", group: "turn-config", when: "Pick this to change one of your own settings in agent.json, taking effect at once; read_config lists the paths and allowed values.", effect: "write", idempotent: true, errors: [
191
+ { code: "unknown-config-path", means: "No setting has that dot path.", fix: "Call read_config and copy a path from its entries." },
192
+ { code: "invalid-json", means: "value isn't valid JSON; a string needs its own quotes.", fix: "Send value as JSON, such as 25, \"debug\" or [\"terminal\"]." },
193
+ { code: "invalid-config-value", means: "The value is valid JSON but not allowed for this setting; the message says why.", fix: "Check the setting's description and default in read_config, then send an allowed value." },
194
+ { code: "managed-key", means: "The harness owns this setting, so it can't be changed here.", fix: "Leave it; ask your owner if it really needs to change." },
195
+ { code: "config-unreadable", means: "agent.json couldn't be read or parsed, so nothing was changed.", fix: "Read agent.json with read_file to see what is wrong, and tell your owner." },
196
+ { code: "orientation-hold", means: "This turn is on a correction hold, so settings changes wait.", fix: "Call orientation_get, settle what the person meant, then change the setting if it is still wanted." },
197
+ ] },
185
198
  },
186
199
  ];
@@ -43,6 +43,7 @@ const record_paths_1 = require("../mind/record-paths");
43
43
  const friends_1 = require("@ouro.bot/friends");
44
44
  const runtime_1 = require("../nerves/runtime");
45
45
  const identity_1 = require("../heart/identity");
46
+ const tool_error_code_1 = require("./tool-error-code");
46
47
  const NOTES_INDEX_VERSION = 1;
47
48
  const NOTE_SLUG_MAX_CHARS = 40;
48
49
  const DEFAULT_LIMIT = 5;
@@ -317,7 +318,7 @@ async function getFreshIndex(notesDir, indexPath, provider) {
317
318
  function createProviderForTool(toolName) {
318
319
  const provider = (0, embedding_provider_1.createDefaultEmbeddingProvider)();
319
320
  if (!provider) {
320
- return `error: ${toolName} couldn't use notes because embeddings are not configured.`;
321
+ return (0, tool_error_code_1.withCode)(`error: ${toolName} couldn't use notes because embeddings are not configured.`, "embeddings-not-configured");
321
322
  }
322
323
  return provider;
323
324
  }
@@ -361,11 +362,11 @@ exports.recordToolDefinitions = [
361
362
  },
362
363
  handler: async (args, ctx) => {
363
364
  if (!hasSelfTrust(ctx))
364
- return "error: note requires self trust and cannot be used from an external caller context.";
365
+ return (0, tool_error_code_1.withCode)("error: note requires self trust and cannot be used from an external caller context.", "self-trust-required");
365
366
  const rawArgs = args;
366
367
  const content = typeof rawArgs.content === "string" ? rawArgs.content.trim() : "";
367
368
  if (!content)
368
- return "content is required";
369
+ return (0, tool_error_code_1.withCode)("content is required", "missing-argument");
369
370
  const provider = createProviderForTool("note");
370
371
  if (typeof provider === "string")
371
372
  return provider;
@@ -400,11 +401,18 @@ exports.recordToolDefinitions = [
400
401
  message: "canonical note save failed",
401
402
  meta: { reason: error instanceof Error ? error.message : String(error) },
402
403
  });
403
- return "error: couldn't save the note right now.";
404
+ return (0, tool_error_code_1.withCode)("error: couldn't save the note right now.", "note-save-failed");
404
405
  }
405
406
  },
406
407
  summaryKeys: ["content", "tags"],
407
408
  riskProfile: { mutates: "durable_state_write", risk: "high", reason: "writes canonical Desk record note" },
409
+ ax: { id: "tool:note", group: "turn-record", when: "Pick this to keep a longer tagged markdown note in your own record, from your own context only; short facts suit diary_write.", effect: "write", errors: [
410
+ { code: "self-trust-required", means: "note runs only in your own private context, and this call came from someone else's.", fix: "Use diary_write for a fact from this chat, or write the note later in your own private runtime." },
411
+ { code: "missing-argument", means: "content is empty or isn't text.", fix: "Call note again with the note's text as content." },
412
+ { code: "embeddings-not-configured", means: "No embedding provider is set up, so notes can't be indexed.", fix: "Keep the fact with diary_write, and tell your owner notes need an embedding provider." },
413
+ { code: "note-save-failed", means: "Writing the note file or its index failed.", fix: "Try once more; if it fails again, keep the fact with diary_write." },
414
+ { code: "orientation-hold", means: "This turn is on a correction hold, so new notes wait.", fix: "Call orientation_get, settle what the person meant, then write the note if it still holds." },
415
+ ] },
408
416
  },
409
417
  {
410
418
  tool: {
@@ -426,7 +434,7 @@ exports.recordToolDefinitions = [
426
434
  },
427
435
  handler: async (args, ctx) => {
428
436
  if (!hasRecordReadTrust(ctx))
429
- return "error: consult_notes requires trusted record-read access.";
437
+ return (0, tool_error_code_1.withCode)("error: consult_notes requires trusted record-read access.", "record-read-denied");
430
438
  const rawArgs = args;
431
439
  const query = typeof rawArgs.query === "string" ? rawArgs.query.trim() : "";
432
440
  if (!query)
@@ -474,9 +482,15 @@ exports.recordToolDefinitions = [
474
482
  message: "canonical notes consult failed",
475
483
  meta: { reason: error instanceof Error ? error.message : String(error) },
476
484
  });
477
- return "error: consult_notes couldn't search notes right now.";
485
+ return (0, tool_error_code_1.withCode)("error: consult_notes couldn't search notes right now.", "notes-search-failed");
478
486
  }
479
487
  },
480
488
  summaryKeys: ["query"],
489
+ // A stale notes index is rebuilt and saved before the search, so this changes the agent's own files.
490
+ ax: { id: "tool:consult_notes", group: "turn-record", when: "Pick this to search your longer markdown notes by meaning, paging with cursor; diary entries are searched with search_facts.", effect: "write", idempotent: true, errors: [
491
+ { code: "record-read-denied", means: "This caller isn't trusted to read your notes.", fix: "Answer without the notes, or look them up from a chat with a trusted person." },
492
+ { code: "embeddings-not-configured", means: "No embedding provider is set up, so notes can't be searched.", fix: "Search the diary with search_facts, or grep the notes folder for exact words." },
493
+ { code: "notes-search-failed", means: "Building the index or embedding the query failed.", fix: "Try again once; then fall back to grep over the notes folder." },
494
+ ] },
481
495
  },
482
496
  ];
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1323",
3
+ "version": "0.1.0-alpha.1324",
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.1323",
9
+ "version": "0.1.0-alpha.1324",
10
10
  "bundleDependencies": [
11
11
  "@ouro.bot/friends"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1323",
3
+ "version": "0.1.0-alpha.1324",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },