@ouro.bot/cli 0.1.0-alpha.1293 → 0.1.0-alpha.1295

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,10 +1,23 @@
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.1295",
6
+ "changes": [
7
+ "Update the Ouro UI files to Ouro UI v1.3.417."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1294",
12
+ "changes": [
13
+ "The CLI's flag gate and the shell's approval check now find an ouro command by its words wherever its flags sit, so putting --agent before a subcommand no longer skips --why or approval."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1293",
6
18
  "changes": [
7
- "The replay eval has a fake household: calibre-web, libgen mirrors and an SMTP sink that record every request, a hand-written books command that talks to them, and deterministic synthetic fixture editions, so the book cases can run with no real library, mirror or mail server."
19
+ "The replay eval has a fake household: calibre-web, libgen mirrors and an SMTP sink that record every request, a hand-written books command that talks to them, and deterministic synthetic fixture editions, so the book cases can run with no real library, mirror or mail server.",
20
+ "Update the Ouro UI files to Ouro UI v1.3.417."
8
21
  ]
9
22
  },
10
23
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1293",
2
+ "runtimeVersion": "0.1.0-alpha.1295",
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.1293</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1295</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PARSER_FLAGS = void 0;
4
+ exports.commandWordIndexes = commandWordIndexes;
5
+ exports.commandWords = commandWords;
4
6
  exports.gateCommandArgs = gateCommandArgs;
5
7
  const runtime_1 = require("../../nerves/runtime");
6
8
  const cli_parse_1 = require("./cli-parse");
@@ -80,9 +82,34 @@ function editDistance(a, b) {
80
82
  }
81
83
  return row[b.length];
82
84
  }
85
+ /**
86
+ * Where a command line's words sit: every token that isn't a flag, skipping the value after a global flag such as
87
+ * --agent. Parsers strip those flags wherever they appear, so `a2a --agent x message` names `a2a message`.
88
+ */
89
+ function commandWordIndexes(args) {
90
+ const indexes = [];
91
+ for (let index = 0; index < args.length; index++) {
92
+ const token = args[index];
93
+ if (GLOBAL_VALUE_FLAGS.includes(token))
94
+ index++;
95
+ else if (!token.startsWith("-"))
96
+ indexes.push(index);
97
+ }
98
+ return indexes;
99
+ }
100
+ /** The words of a command line, without its flags and global flag values (see commandWordIndexes). */
101
+ function commandWords(args) {
102
+ return commandWordIndexes(args).map((index) => args[index]);
103
+ }
83
104
  function matchCommand(args) {
84
- const found = SHAPES.filter((shape) => shape.words.every((word, index) => args[index] === word)).sort((a, b) => b.words.length - a.words.length);
85
- return found.length > 0 ? found[0] : null;
105
+ const indexes = commandWordIndexes(args);
106
+ const words = indexes.map((index) => args[index]);
107
+ const found = SHAPES.filter((shape) => shape.words.every((word, index) => words[index] === word)).sort((a, b) => b.words.length - a.words.length);
108
+ if (found.length === 0)
109
+ return null;
110
+ const shape = found[0];
111
+ const matched = new Set(indexes.slice(0, shape.words.length));
112
+ return { shape, rest: args.filter((_, index) => !matched.has(index)) };
86
113
  }
87
114
  function refuse(name, code, message) {
88
115
  (0, runtime_1.emitNervesEvent)({
@@ -96,14 +123,14 @@ function refuse(name, code, message) {
96
123
  }
97
124
  /** Checks a command line against its declaration; a pass returns the words the legacy dispatcher should read. */
98
125
  function gateCommandArgs(args) {
99
- const shape = matchCommand(args);
100
- if (!shape)
126
+ const match = matchCommand(args);
127
+ if (!match)
101
128
  return { kind: "pass", args };
102
- const { declaration, words, flags } = shape;
129
+ const { shape, rest } = match;
130
+ const { declaration, flags } = shape;
103
131
  const name = declaration.name;
104
132
  const others = declaration.effect === "others";
105
133
  const known = [...new Set([...exports.PARSER_FLAGS, ...GLOBAL_FLAGS, ...flags.keys()])];
106
- const rest = args.slice(words.length);
107
134
  if (others && rest.includes("--help")) {
108
135
  const text = [
109
136
  "Usage:",
@@ -47,6 +47,7 @@ const tool_approval_1 = require("../heart/tool-approval");
47
47
  const tools_voice_local_1 = require("./tools-voice-local");
48
48
  const tools_sanctuary_host_1 = require("./tools-sanctuary-host");
49
49
  const cli_manifest_1 = require("../heart/daemon/cli-manifest");
50
+ const cli_gate_1 = require("../heart/daemon/cli-gate");
50
51
  function safeGetAgentRoot() {
51
52
  try {
52
53
  return (0, identity_1.getAgentRoot)();
@@ -306,18 +307,21 @@ function shellTokens(command) {
306
307
  return command.trim().split(/\s+/).filter(Boolean);
307
308
  }
308
309
  /**
309
- * The declared command a shell line names: the longest declaration whose words start it, as the CLI's gate reads it.
310
- * A group's declaration (one with longer declarations under it) followed by another word names no command, since
311
- * that word is an undeclared one under the group.
310
+ * The declared command a shell line names: the longest declaration its words start with, read past flags as the
311
+ * CLI's gate reads them (see commandWords), so `ouro a2a --agent x message` names `a2a message`. A group's
312
+ * declaration (one with longer declarations under it) followed by any other word names no command, since that word
313
+ * is an undeclared one under the group.
312
314
  */
313
- function declaredOuroCommand(words) {
315
+ function declaredOuroCommand(args) {
316
+ if (args.length > 0 && OURO_INFO_FLAGS.includes(args[0]))
317
+ return args[0];
318
+ const words = (0, cli_gate_1.commandWords)(args);
314
319
  for (let length = words.length; length > 0; length--) {
315
320
  const name = words.slice(0, length).join(" ");
316
- if (!DECLARED_OURO_COMMANDS.includes(name) && !OURO_INFO_FLAGS.includes(name))
321
+ if (!DECLARED_OURO_COMMANDS.includes(name))
317
322
  continue;
318
- const next = words[length];
319
323
  const isGroup = DECLARED_OURO_COMMANDS.some((other) => other.startsWith(`${name} `));
320
- return next !== undefined && !next.startsWith("-") && isGroup ? null : name;
324
+ return length < words.length && isGroup ? null : name;
321
325
  }
322
326
  return null;
323
327
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1293",
3
+ "version": "0.1.0-alpha.1295",
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.1293",
9
+ "version": "0.1.0-alpha.1295",
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.1293",
3
+ "version": "0.1.0-alpha.1295",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },