@ouro.bot/cli 0.1.0-alpha.1155 → 0.1.0-alpha.1157

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,18 @@
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.1157",
6
+ "changes": [
7
+ "The ouro CLI refuses an unknown flag and names the nearest real one, at its front door. Commands other people see need --why, which is kept out of their words, and --dry-run says who will see them without doing it. Its help reads the same under -h and --help."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1156",
12
+ "changes": [
13
+ "The ouro CLI's help can be read as data: `ouro help --json` lists every command with who sees its effect, and the exit codes. The Ouro AX X-ray checks it in CI, and the help's event is recorded in the nerves log."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1155",
6
18
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1155",
2
+ "runtimeVersion": "0.1.0-alpha.1157",
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.1155</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1157</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -110,6 +110,7 @@ const sanctuary_scheduler_origin_1 = require("./sanctuary-scheduler-origin");
110
110
  const cli_parse_1 = require("./cli-parse");
111
111
  const cli_parse_2 = require("./cli-parse");
112
112
  const cli_help_1 = require("./cli-help");
113
+ const cli_manifest_1 = require("./cli-manifest");
113
114
  const plugin_cli_1 = require("./plugin-cli");
114
115
  const cli_desk_1 = require("./cli-desk");
115
116
  const desk_admin_1 = require("./desk-admin");
@@ -6801,6 +6802,11 @@ async function refreshHookSentinel(command, deps) {
6801
6802
  }
6802
6803
  // ── Main CLI execution ──
6803
6804
  async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDeps)()) {
6805
+ if (args.length === 2 && args[1] === "--json" && (args[0] === "help" || args[0] === "--help" || args[0] === "-h")) {
6806
+ const text = (0, cli_manifest_1.cliHelpJson)();
6807
+ deps.writeStdout(text);
6808
+ return text;
6809
+ }
6804
6810
  if (args.length === 1 && (args[0] === "--help" || args[0] === "-h")) {
6805
6811
  const helpText = (0, cli_help_1.getGroupedHelp)();
6806
6812
  const text = ttyBoardEnabled(deps)
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PARSER_FLAGS = void 0;
4
+ exports.gateCommandArgs = gateCommandArgs;
5
+ const runtime_1 = require("../../nerves/runtime");
6
+ const cli_parse_1 = require("./cli-parse");
7
+ const cli_manifest_1 = require("./cli-manifest");
8
+ // The flag and argument gate in front of the legacy dispatcher, in the Ouro AX kit's terms: an unknown flag is
9
+ // refused with the nearest real one, a command that reaches other people needs --why, and --dry-run says who
10
+ // will see it without doing it. The commands still do their own work.
11
+ const GLOBAL_FLAGS = ["--json", "--help", "--why", "--why-file", "--agent"];
12
+ const GLOBAL_VALUE_FLAGS = ["--why", "--why-file", "--agent"];
13
+ // Every flag the CLI's parser and dispatcher read: the literals in cli-parse.ts, cli-exec.ts, cli-help.ts and
14
+ // cli-defaults.ts. cli-gate-flags.test.ts fails when a literal is added or removed, so the gate never refuses a flag
15
+ // the CLI reads.
16
+ exports.PARSER_FLAGS = [
17
+ "--account", "--action", "--admission", "--agent", "--alert-file", "--allow-send", "--answers", "--api-key",
18
+ "--api-key-file", "--apply", "--args", "--await", "--backup", "--base-url", "--binding", "--cadence", "--card-url",
19
+ "--category", "--channel", "--clone", "--clone-path", "--component", "--context", "--cooldown-minutes",
20
+ "--credential-item", "--delegated", "--deployment", "--did", "--discover", "--dry-run", "--email", "--endpoint",
21
+ "--event", "--event-type", "--evidence", "--exit-code", "--expires", "--external-id", "--facing", "--file",
22
+ "--fixture", "--follow", "--force", "--foreground", "--format", "--friend", "--friend-id", "--from", "--full",
23
+ "--generate-unlock-secret", "--github-token", "--habit", "--help", "--home", "--host", "--host-stall-observed",
24
+ "--human", "--id", "--identity-file", "--idle-silence-ms", "--ids", "--init", "--initiative", "--input-file", "--into",
25
+ "--item", "--json", "--keep-versions", "--key", "--keys-dir", "--lane", "--last", "--latest", "--legacy",
26
+ "--legacy-root", "--level", "--limit", "--manifest", "--max-duration-ms", "--max-old-space-size", "--message-guid",
27
+ "--migration-path", "--min-mem-available-mb", "--mode", "--model", "--name", "--native", "--no-chat",
28
+ "--no-delegated-source", "--no-repair", "--no-send", "--no-wake", "--note", "--notify-session", "--oauth-token",
29
+ "--observe-only", "--occasion", "--oom-score-adj", "--operation-id", "--output", "--output-file", "--owner-alone",
30
+ "--owner-email", "--owner-name", "--participants", "--path", "--payload", "--persist", "--port", "--prefix", "--print",
31
+ "--priority", "--process", "--profile", "--provider", "--public-field", "--public-url", "--question", "--reason",
32
+ "--replay-output", "--repo-path", "--report", "--report-title", "--request-id", "--require-sense", "--reserve-mb",
33
+ "--role", "--root", "--rotate-missing-mail-keys", "--run-id", "--scope", "--secret-field", "--secret-file", "--server",
34
+ "--session", "--setup-token", "--silent-consent", "--since", "--socket", "--source", "--state", "--store", "--strict",
35
+ "--summary", "--surface", "--switch", "--task", "--template", "--text", "--title", "--to", "--tool", "--trigger",
36
+ "--trust", "--ttl-minutes", "--type", "--uid", "--unattended", "--upstream", "--username", "--value", "--value-file",
37
+ "--verify", "--version", "--web", "--which", "--workbench-mcp", "--yes",
38
+ ];
39
+ function usageLinesFor(name) {
40
+ const words = name.split(" ");
41
+ const last = words[words.length - 1];
42
+ const head = words.slice(0, -1).map((word) => `${word} `).join("");
43
+ return (0, cli_parse_1.usage)()
44
+ .split("\n")
45
+ .filter((line) => {
46
+ if (!line.startsWith(` ouro ${head}`))
47
+ return false;
48
+ const word = line.slice(` ouro ${head}`.length).split(/[\s[<(]/)[0];
49
+ return word.split("|").includes(last);
50
+ });
51
+ }
52
+ function shapeOf(declaration) {
53
+ const flags = new Map();
54
+ let positionals = 0;
55
+ for (const line of usageLinesFor(declaration.name)) {
56
+ for (const match of line.matchAll(/(?<![\w-])(--[a-z][\w-]*)( <[^>]+>)?/g))
57
+ flags.set(match[1], Boolean(match[2]));
58
+ const bare = line.replace(/\[[^\]]*\]/g, " ").replace(/(?<![\w-])--[a-z][\w-]*( <[^>]+>)?/g, " ");
59
+ const after = bare.split(/\s+/).filter((token) => token.startsWith("<") && !token.includes("|"));
60
+ positionals = Math.max(positionals, after.length);
61
+ }
62
+ return { declaration, words: declaration.name.split(" "), flags, positionals };
63
+ }
64
+ const SHAPES = cli_manifest_1.CLI_COMMANDS.map(shapeOf);
65
+ function nearestFlag(flag, known) {
66
+ const ranked = known
67
+ .map((name) => ({ name, distance: editDistance(flag, name) }))
68
+ .filter((candidate) => candidate.distance <= 2)
69
+ .sort((a, b) => a.distance - b.distance);
70
+ return ranked.length > 0 ? ranked[0].name : null;
71
+ }
72
+ function editDistance(a, b) {
73
+ let row = Array.from({ length: b.length + 1 }, (_, index) => index);
74
+ for (let i = 1; i <= a.length; i++) {
75
+ const next = [i];
76
+ for (let j = 1; j <= b.length; j++) {
77
+ next[j] = Math.min(row[j] + 1, next[j - 1] + 1, row[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
78
+ }
79
+ row = next;
80
+ }
81
+ return row[b.length];
82
+ }
83
+ 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;
86
+ }
87
+ function refuse(name, message) {
88
+ (0, runtime_1.emitNervesEvent)({
89
+ level: "warn",
90
+ component: "daemon",
91
+ event: "daemon.cli_flag_gate_refused",
92
+ message: "the flag gate refused a command",
93
+ meta: { command: name },
94
+ });
95
+ return { kind: "refuse", message };
96
+ }
97
+ /** Checks a command line against its declaration; a pass returns the words the legacy dispatcher should read. */
98
+ function gateCommandArgs(args) {
99
+ const shape = matchCommand(args);
100
+ if (!shape)
101
+ return { kind: "pass", args };
102
+ const { declaration, words, flags } = shape;
103
+ const name = declaration.name;
104
+ const others = declaration.effect === "others";
105
+ const known = [...new Set([...exports.PARSER_FLAGS, ...GLOBAL_FLAGS, ...flags.keys()])];
106
+ const rest = args.slice(words.length);
107
+ for (let index = 0; index < rest.length; index++) {
108
+ const token = rest[index];
109
+ if (!token.startsWith("--"))
110
+ continue;
111
+ if (known.includes(token))
112
+ continue;
113
+ const suggestion = nearestFlag(token, known);
114
+ const fix = suggestion
115
+ ? `use ${suggestion}`
116
+ : `drop ${token}; \`ouro ${name} --help\` lists its flags`;
117
+ return refuse(name, `Unknown flag ${token} for "ouro ${name}". Fix: ${fix}.`);
118
+ }
119
+ if (others) {
120
+ const valued = new Set([...GLOBAL_VALUE_FLAGS, ...[...flags].filter(([, takes]) => takes).map(([flag]) => flag)]);
121
+ let extra = 0;
122
+ for (let index = 0; index < rest.length; index++) {
123
+ const token = rest[index];
124
+ if (token.startsWith("-")) {
125
+ if (valued.has(token))
126
+ index++;
127
+ continue;
128
+ }
129
+ extra++;
130
+ }
131
+ if (shape.positionals === 0 && extra > 0) {
132
+ return refuse(name, `"ouro ${name}" takes no words after its command. Fix: run \`ouro ${name} --help\` and drop the extra words.`);
133
+ }
134
+ if (!rest.includes("--why") && !rest.includes("--why-file")) {
135
+ return refuse(name, `ouro ${name} needs --why: other people will see this, so say who asked you and what they said. Fix: add --why "<who asked you, and what they said>" to the command.`);
136
+ }
137
+ if (rest.includes("--dry-run")) {
138
+ const json = rest.includes("--json");
139
+ const text = json
140
+ ? JSON.stringify({ state: "preview", command: name, effect: declaration.effect, dryRun: true, summary: declaration.summary })
141
+ : `Would ${declaration.summary.replace(/\.$/, "").toLowerCase()}. Other people will see this when it runs; nothing was sent or changed. Run it again without --dry-run to do it.`;
142
+ return { kind: "preview", text };
143
+ }
144
+ }
145
+ return { kind: "pass", args: withoutWhy(args) };
146
+ }
147
+ function withoutWhy(args) {
148
+ const out = [];
149
+ for (let index = 0; index < args.length; index++) {
150
+ if (args[index] === "--why" || args[index] === "--why-file") {
151
+ index++;
152
+ continue;
153
+ }
154
+ out.push(args[index]);
155
+ }
156
+ return out;
157
+ }
@@ -274,7 +274,7 @@ exports.COMMAND_REGISTRY = {
274
274
  },
275
275
  "migrate-to-desk": {
276
276
  category: "Tasks",
277
- description: "Migrate a legacy `tasks/` tree into the new `desk/` shape (copy semantics — source untouched).",
277
+ description: "Migrate a legacy task tree into the desk shape (copy semantics; the source is untouched).",
278
278
  usage: "ouro migrate-to-desk --agent <name> [--root <path>] [--force] [--dry-run]",
279
279
  example: "ouro migrate-to-desk --agent <agent> --dry-run",
280
280
  },
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CLI_EXIT_CODES = exports.CLI_COMMANDS = void 0;
4
+ exports.cliHelpJson = cliHelpJson;
5
+ // The commands of the ouro CLI, declared once: the names `ouro help --json` lists and the X-ray's inventory reads.
6
+ const runtime_1 = require("../../nerves/runtime");
7
+ const PRIVATE = "private";
8
+ const OTHERS = "others";
9
+ exports.CLI_COMMANDS = [
10
+ { name: "auth", effect: PRIVATE, summary: "Store or check provider credentials for an agent." },
11
+ { name: "auth verify", effect: PRIVATE, readOnly: true, summary: "Check that an agent's provider credentials work." },
12
+ { name: "account ensure", effect: PRIVATE, summary: "Make sure an agent has its account and mail keys." },
13
+ { name: "chat", effect: PRIVATE, summary: "Open an interactive chat with an agent." },
14
+ { name: "check", effect: PRIVATE, readOnly: true, summary: "Check an agent's provider lane." },
15
+ { name: "clone", effect: PRIVATE, summary: "Clone an agent bundle from a remote." },
16
+ { name: "connect", effect: PRIVATE, summary: "Guide setup of an integration or local sense." },
17
+ { name: "dev", effect: PRIVATE, summary: "Run the daemon from this checkout, rebuilding as it goes." },
18
+ { name: "dns backup", effect: PRIVATE, summary: "Back up the DNS records of a binding." },
19
+ { name: "dns plan", effect: PRIVATE, readOnly: true, summary: "Show the DNS changes a binding would make." },
20
+ { name: "dns apply", effect: OTHERS, summary: "Apply DNS changes that other people on the internet can reach." },
21
+ { name: "dns verify", effect: PRIVATE, readOnly: true, summary: "Check that the DNS records are live." },
22
+ { name: "dns rollback", effect: PRIVATE, summary: "Restore the DNS records from a backup." },
23
+ { name: "dns certificate", effect: PRIVATE, summary: "Issue or check a certificate for a binding." },
24
+ { name: "doctor", effect: PRIVATE, readOnly: true, summary: "Check the health of this machine's Ouro install." },
25
+ { name: "down", effect: PRIVATE, summary: "Stop the daemon." },
26
+ { name: "event submit", effect: OTHERS, summary: "Submit an event that can wake the agent and reach other people." },
27
+ { name: "friend create", effect: PRIVATE, summary: "Add a friend the agent knows." },
28
+ { name: "friend link", effect: PRIVATE, summary: "Link a friend to an external account." },
29
+ { name: "friend list", effect: PRIVATE, readOnly: true, summary: "List the friends this agent knows." },
30
+ { name: "friend show", effect: PRIVATE, readOnly: true, summary: "Show one friend." },
31
+ { name: "friend unlink", effect: PRIVATE, summary: "Remove a link between a friend and an external account." },
32
+ { name: "friend update", effect: PRIVATE, summary: "Change a friend's trust, admission or initiative." },
33
+ { name: "gateway serve", effect: OTHERS, summary: "Serve the gateway that other agents connect to." },
34
+ { name: "habit cancel", effect: PRIVATE, summary: "Cancel a habit's pending run." },
35
+ { name: "habit create", effect: PRIVATE, summary: "Create a habit that runs on a cadence." },
36
+ { name: "habit inspect", effect: PRIVATE, readOnly: true, summary: "Show one habit run." },
37
+ { name: "habit list", effect: PRIVATE, readOnly: true, summary: "List the agent's habits." },
38
+ { name: "habit probe", effect: PRIVATE, readOnly: true, summary: "Check a habit without sending anything." },
39
+ { name: "habit runs", effect: PRIVATE, readOnly: true, summary: "List recent habit runs." },
40
+ { name: "habit summary", effect: PRIVATE, readOnly: true, summary: "Summarise a habit run." },
41
+ { name: "hatch", effect: PRIVATE, summary: "Create a new agent." },
42
+ { name: "link", effect: PRIVATE, summary: "Link an agent to a friend's external account." },
43
+ { name: "logs", effect: PRIVATE, readOnly: true, summary: "Show the daemon's recent logs." },
44
+ { name: "mail backfill-indexes", effect: PRIVATE, summary: "Rebuild the mail indexes for an agent." },
45
+ { name: "mail import-mbox", effect: PRIVATE, summary: "Import an MBOX export into the agent's mail." },
46
+ { name: "mailbox", effect: PRIVATE, readOnly: true, summary: "Show the agent's mailbox." },
47
+ { name: "mcp call", effect: PRIVATE, summary: "Call a tool on an MCP server." },
48
+ { name: "mcp doctor", effect: PRIVATE, readOnly: true, summary: "Check an agent's MCP servers." },
49
+ { name: "mcp list", effect: PRIVATE, readOnly: true, summary: "List the MCP servers." },
50
+ { name: "msg", effect: OTHERS, summary: "Send a message to another agent." },
51
+ { name: "nerves-review", effect: PRIVATE, readOnly: true, summary: "Review the runtime's nerves events." },
52
+ { name: "poke", effect: PRIVATE, summary: "Wake an agent for a task or habit." },
53
+ { name: "private decisions", effect: PRIVATE, readOnly: true, summary: "List an agent's recent private decisions." },
54
+ { name: "private status", effect: PRIVATE, readOnly: true, summary: "Show an agent's private status." },
55
+ { name: "provider refresh", effect: PRIVATE, summary: "Refresh the daemon's cached provider credentials." },
56
+ { name: "repair", effect: PRIVATE, summary: "Repair an agent's setup." },
57
+ { name: "rollback", effect: PRIVATE, summary: "Roll the install back to an earlier version." },
58
+ { name: "rsvp", effect: PRIVATE, summary: "Work with RSVP events." },
59
+ { name: "session list", effect: PRIVATE, readOnly: true, summary: "List the agent's sessions." },
60
+ { name: "status", effect: PRIVATE, readOnly: true, summary: "Show the daemon and an agent's status." },
61
+ { name: "stop", effect: PRIVATE, summary: "Stop the daemon." },
62
+ { name: "sync", effect: PRIVATE, summary: "Sync an agent bundle with its remote." },
63
+ { name: "thoughts", effect: PRIVATE, readOnly: true, summary: "Show an agent's recent thoughts." },
64
+ { name: "use", effect: PRIVATE, summary: "Choose the provider and model for a lane." },
65
+ { name: "vault config set", effect: PRIVATE, summary: "Set a vault config value." },
66
+ { name: "vault config status", effect: PRIVATE, readOnly: true, summary: "Show the vault config." },
67
+ { name: "vault create", effect: PRIVATE, summary: "Create an agent's vault." },
68
+ { name: "vault item list", effect: PRIVATE, readOnly: true, summary: "List vault items." },
69
+ { name: "vault item set", effect: PRIVATE, summary: "Set a vault item's secret field." },
70
+ { name: "vault item status", effect: PRIVATE, readOnly: true, summary: "Show a vault item's status." },
71
+ { name: "vault ops porkbun set", effect: PRIVATE, summary: "Store the Porkbun account for DNS work." },
72
+ { name: "vault ops porkbun status", effect: PRIVATE, readOnly: true, summary: "Show the Porkbun account status." },
73
+ { name: "vault recover", effect: PRIVATE, summary: "Recover an agent's vault from exported keys." },
74
+ { name: "vault replace", effect: PRIVATE, summary: "Replace an agent's vault." },
75
+ { name: "vault status", effect: PRIVATE, readOnly: true, summary: "Show the vault's status." },
76
+ { name: "vault unlock", effect: PRIVATE, summary: "Unlock an agent's vault." },
77
+ { name: "versions", effect: PRIVATE, readOnly: true, summary: "List the installed and available versions." },
78
+ { name: "voice join", effect: OTHERS, summary: "Join a voice call as the agent." },
79
+ { name: "voice leave", effect: OTHERS, summary: "Leave a voice call." },
80
+ { name: "voice status", effect: PRIVATE, readOnly: true, summary: "Show the agent's voice status." },
81
+ { name: "whoami", effect: PRIVATE, readOnly: true, summary: "Show which agent this is." },
82
+ { name: "work card", effect: PRIVATE, readOnly: true, summary: "Show the agent's work card." },
83
+ { name: "work gauntlet", effect: PRIVATE, readOnly: true, summary: "Show the agent's work gauntlet." },
84
+ { name: "work sentinel", effect: PRIVATE, readOnly: true, summary: "Show the agent's work sentinel." },
85
+ { name: "a2a card", effect: PRIVATE, readOnly: true, summary: "Show the agent's A2A card." },
86
+ { name: "a2a delegated-commands grant", effect: OTHERS, summary: "Let a friend's agent run delegated commands." },
87
+ { name: "a2a delegated-commands list", effect: PRIVATE, readOnly: true, summary: "List the delegated command grants." },
88
+ { name: "a2a delegated-commands revoke", effect: PRIVATE, summary: "Revoke a delegated command grant." },
89
+ { name: "a2a escalation grant", effect: OTHERS, summary: "Let a friend escalate to the person." },
90
+ { name: "a2a escalation list", effect: PRIVATE, readOnly: true, summary: "List escalation grants." },
91
+ { name: "a2a escalation revoke", effect: PRIVATE, summary: "Revoke an escalation grant." },
92
+ { name: "a2a identity", effect: PRIVATE, readOnly: true, summary: "Show the agent's A2A identity." },
93
+ { name: "a2a message", effect: OTHERS, summary: "Send an A2A message to another agent." },
94
+ { name: "a2a onboard", effect: PRIVATE, summary: "Onboard another agent from its card." },
95
+ { name: "a2a outbox ack", effect: OTHERS, summary: "Acknowledge messages another agent sent." },
96
+ { name: "a2a outbox list", effect: PRIVATE, readOnly: true, summary: "List the A2A outbox." },
97
+ { name: "a2a outbox resolve", effect: OTHERS, summary: "Resolve a report another agent filed." },
98
+ { name: "a2a serve", effect: OTHERS, summary: "Serve the agent's A2A endpoint to other agents." },
99
+ { name: "bluebubbles context-smoke", effect: PRIVATE, summary: "Check the context a BlueBubbles message would get." },
100
+ { name: "bluebubbles host", effect: PRIVATE, summary: "Install, check or repair the BlueBubbles host." },
101
+ { name: "bluebubbles replay", effect: PRIVATE, summary: "Replay a BlueBubbles message." },
102
+ ];
103
+ exports.CLI_EXIT_CODES = [
104
+ { code: 0, name: "ok", meaning: "The command did what it was asked." },
105
+ { code: 1, name: "error", meaning: "The command failed or refused; the output says why and how to fix it." },
106
+ ];
107
+ /** The help as data: every declared command with its effect, and the exit codes. */
108
+ function cliHelpJson() {
109
+ (0, runtime_1.emitNervesEvent)({
110
+ component: "daemon",
111
+ event: "daemon.cli_help_json",
112
+ message: "printing ouro help as data",
113
+ meta: { commands: exports.CLI_COMMANDS.length },
114
+ });
115
+ return JSON.stringify({
116
+ tool: "ouro",
117
+ commands: exports.CLI_COMMANDS.map((command) => ({
118
+ name: command.name,
119
+ effect: command.effect,
120
+ summary: command.summary,
121
+ usage: [`ouro ${command.name}`],
122
+ ...(command.readOnly ? { readOnly: true } : {}),
123
+ })),
124
+ exitCodes: exports.CLI_EXIT_CODES,
125
+ }, null, 2);
126
+ }
@@ -6,6 +6,7 @@ const compile_cache_1 = require("./compile-cache");
6
6
  const runtime_1 = require("../../nerves/runtime");
7
7
  const cli_arg_redaction_1 = require("./cli-arg-redaction");
8
8
  const daemon_cli_1 = require("./daemon-cli");
9
+ const cli_gate_1 = require("./cli-gate");
9
10
  const runtime_logging_1 = require("./runtime-logging");
10
11
  const portable_git_1 = require("./portable-git");
11
12
  if (process.argv[2] === "shepherd" && process.argv[3] !== "chat")
@@ -19,15 +20,25 @@ else
19
20
  message: "starting ouro CLI entrypoint",
20
21
  meta: { args: (0, cli_arg_redaction_1.redactCliArgs)(process.argv.slice(2)), compileCache: compile_cache_1.ouroCompileCacheDirectory },
21
22
  });
22
- void (0, daemon_cli_1.runOuroCli)(process.argv.slice(2)).catch((error) => {
23
- const message = error instanceof Error ? error.message : String(error);
24
- process.stderr.write(`${message}\n`);
25
- (0, runtime_1.emitNervesEvent)({
26
- level: "error",
27
- component: "daemon",
28
- event: "daemon.cli_entry_error",
29
- message: "ouro CLI entrypoint failed",
30
- meta: { error: message },
23
+ const gate = (0, cli_gate_1.gateCommandArgs)(process.argv.slice(2));
24
+ if (gate.kind === "refuse") {
25
+ process.stderr.write(`${gate.message}\n`);
26
+ process.exitCode = 1;
27
+ }
28
+ else if (gate.kind === "preview") {
29
+ process.stdout.write(`${gate.text}\n`);
30
+ }
31
+ else {
32
+ void (0, daemon_cli_1.runOuroCli)(gate.args).catch((error) => {
33
+ const message = error instanceof Error ? error.message : String(error);
34
+ process.stderr.write(`${message}\n`);
35
+ (0, runtime_1.emitNervesEvent)({
36
+ level: "error",
37
+ component: "daemon",
38
+ event: "daemon.cli_entry_error",
39
+ message: "ouro CLI entrypoint failed",
40
+ meta: { error: message },
41
+ });
42
+ process.exit(1);
31
43
  });
32
- process.exit(1);
33
- });
44
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1155",
3
+ "version": "0.1.0-alpha.1157",
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.1155",
9
+ "version": "0.1.0-alpha.1157",
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.1155",
3
+ "version": "0.1.0-alpha.1157",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },