@ouro.bot/cli 0.1.0-alpha.1485 → 0.1.0-alpha.1487

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": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1487",
6
+ "changes": [
7
+ "The npm publish step now prints npm's own output (stdout and stderr, each bounded to its first 20 lines of 300 characters) when `npm publish` exits 0. That output was previously discarded, which left a gap in the evidence when a published version was not seen by later reads. This records evidence only; it is not a fix for any cause."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1486",
12
+ "changes": [
13
+ "Eval sandbox: an agent profile names the agent a sandboxed run puts in its container, where that agent's bundle comes from and which bundle paths the turn may write. The Butler's profile is today's bundle projection and today's writable paths, and is still the default; the sandbox itself moves onto profiles in a later change. The sandbox's guests no longer pick the Butler's bundle themselves. The Telegram guest takes the bundle its `--agent` names, though the Telegram turn still runs only the Butler. The interview guest runs on whichever one bundle the sandbox mounted. A new test pins every Docker command and every file a default run hands the agent container, for the replay eval and the interviews, byte for byte against recordings taken before this change."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1485",
6
18
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1485",
2
+ "runtimeVersion": "0.1.0-alpha.1487",
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.1485</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1487</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  * read from the turn file the sandbox mounts at `/eval/turn.json`, with its provider served by the host over stdin
6
6
  * and stdout (see `sandbox/guest.ts`). It takes no arguments, so it is no command an agent's shell is offered.
7
7
  */
8
+ const identity_1 = require("../heart/identity");
8
9
  const runtime_1 = require("../nerves/runtime");
9
10
  const guest_1 = require("./sandbox/guest");
10
11
  const telegram_turn_1 = require("./transport/telegram-turn");
11
- void (0, guest_1.runGuest)({ stdin: process.stdin, stdout: process.stdout, turnFile: "/eval/turn.json", runTurn: telegram_turn_1.runTelegramTurn }).then((outcome) => {
12
+ // The sandbox starts this with `--agent <name>`, the agent whose bundle it mounted.
13
+ void Promise.resolve().then(() => (0, guest_1.runGuest)({ stdin: process.stdin, stdout: process.stdout, turnFile: "/eval/turn.json", runTurn: telegram_turn_1.runTelegramTurn, agentRoot: (0, identity_1.getAgentRoot)() })).then((outcome) => {
12
14
  process.exit(outcome.ok ? 0 : 1);
13
15
  }).catch((error) => {
14
16
  (0, runtime_1.emitNervesEvent)({ component: "eval", level: "error", event: "eval.guest_entry_error", message: "sandbox guest failed outside its turn", meta: { error: String(error) } });
@@ -9,7 +9,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const identity_1 = require("../heart/identity");
10
10
  const runtime_1 = require("../nerves/runtime");
11
11
  const run_1 = require("./interviews/guest/run");
12
- void (0, run_1.runInterviewGuest)({ stdin: process.stdin, stdout: process.stdout, turnFile: "/eval/turn.json", bundle: (0, identity_1.getAgentRoot)("sanctuary") }).then((outcome) => {
12
+ const guest_1 = require("./sandbox/guest");
13
+ // The bundle is whichever one the sandbox mounted, so this command is the same for every agent.
14
+ void Promise.resolve().then(() => (0, run_1.runInterviewGuest)({ stdin: process.stdin, stdout: process.stdout, turnFile: "/eval/turn.json", bundle: (0, guest_1.mountedAgentRoot)((0, identity_1.getAgentBundlesRoot)()) })).then((outcome) => {
13
15
  process.exit(outcome.ok ? 0 : 1);
14
16
  }).catch((error) => {
15
17
  (0, runtime_1.emitNervesEvent)({ component: "eval", level: "error", event: "eval.interview_guest_entry_error", message: "interview guest failed outside its conversation", meta: { error: String(error) } });
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SANCTUARY_WRITABLE = exports.CONTAINER_BUNDLES = void 0;
7
+ exports.sanctuaryProfile = sanctuaryProfile;
8
+ exports.containerBundle = containerBundle;
9
+ exports.checkProfile = checkProfile;
10
+ exports.bundleMounts = bundleMounts;
11
+ /**
12
+ * Which agent a sandboxed run puts in the agent container. A profile names the agent, says where its bundle comes
13
+ * from and lists the bundle paths the turn may write; everything else in the bundle is mounted read-only.
14
+ *
15
+ * - The bundle sits where the agent's own runtime looks for it, `/home/ouro/AgentBundles/<agent>.ouro`, and the
16
+ * Telegram guest is started with `--agent <agent>`.
17
+ * - The bundle source fills the run's bundle folder from the case's `include` paths and says what it left out (the
18
+ * gaps every report lists). The Butler's source projects the bundle under test over the public seed bundle; a
19
+ * later slice adds a source that exports a committed bundle.
20
+ * - The writable paths are relative to the bundle, inside it, and each mounted over its read-only copy.
21
+ *
22
+ * `sanctuaryProfile` is the Butler's, and what every run used before profiles existed; it is still the default, so
23
+ * the replay eval and the interviews run exactly as they did.
24
+ */
25
+ const node_path_1 = __importDefault(require("node:path"));
26
+ const runtime_1 = require("../../nerves/runtime");
27
+ const projection_1 = require("./projection");
28
+ /** Where every agent's bundles sit in the agent container. */
29
+ exports.CONTAINER_BUNDLES = "/home/ouro/AgentBundles";
30
+ /** What the Butler's turn and its books CLI write. */
31
+ exports.SANCTUARY_WRITABLE = ["books/work", "books/removed", "books/ledger.ndjson", "state", "friends", "arc", "desk/_record"];
32
+ const AGENT_NAME = /^[a-z][a-z0-9-]{0,62}$/;
33
+ const WRITABLE_PATH = /^[A-Za-z0-9._-][A-Za-z0-9._/-]*$/;
34
+ /** The Butler's profile: its bundle under test projected over the public seed bundle. */
35
+ function sanctuaryProfile(input) {
36
+ return {
37
+ agent: "sanctuary",
38
+ bundleSource: ({ include, out }) => (0, projection_1.projectBundle)({ bundleDir: input.bundleDir, seedBundleDir: input.seedBundleDir, include, out }),
39
+ writable: exports.SANCTUARY_WRITABLE,
40
+ };
41
+ }
42
+ /** The bundle's path in the agent container. */
43
+ function containerBundle(profile) {
44
+ return `${exports.CONTAINER_BUNDLES}/${profile.agent}.ouro`;
45
+ }
46
+ /** Throws unless the agent's name is a plain name and every writable path stays inside the bundle, once. */
47
+ function checkProfile(profile) {
48
+ const problems = [];
49
+ if (!AGENT_NAME.test(profile.agent))
50
+ problems.push("the agent's name must be lowercase letters, digits and dashes");
51
+ if (profile.writable.length === 0)
52
+ problems.push("it lists no writable path");
53
+ const seen = new Set();
54
+ for (const entry of profile.writable) {
55
+ // Docker splits a `-v` value on `:` and its options on `,`, so a path is held to plain characters.
56
+ if (!WRITABLE_PATH.test(entry) || entry !== node_path_1.default.posix.normalize(entry) || entry === "." || entry.split("/").includes("..") || entry.endsWith("/")) {
57
+ problems.push(`writable path ${JSON.stringify(entry)} must be a plain path inside the bundle`);
58
+ }
59
+ else if (seen.has(entry)) {
60
+ problems.push(`writable path ${entry} is listed twice`);
61
+ }
62
+ seen.add(entry);
63
+ }
64
+ if (problems.length > 0) {
65
+ (0, runtime_1.emitNervesEvent)({ level: "error", component: "eval", event: "eval.sandbox_profile_refused", message: "refused an agent profile", meta: { agent: profile.agent, problems: problems.length } });
66
+ throw new Error(`agent profile ${JSON.stringify(profile.agent)}: ${problems.join("; ")}`);
67
+ }
68
+ }
69
+ /** The agent container's bundle mounts: the whole bundle read-only, then each writable path over it. Checks the profile first. */
70
+ function bundleMounts(profile, hostBundle) {
71
+ checkProfile(profile);
72
+ const target = containerBundle(profile);
73
+ return ["-v", `${hostBundle}:${target}:ro`, ...profile.writable.flatMap((entry) => ["-v", `${node_path_1.default.join(hostBundle, entry)}:${target}/${entry}`])];
74
+ }
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.mountedAgentRoot = mountedAgentRoot;
6
7
  exports.runGuest = runGuest;
7
8
  /**
8
9
  * What runs inside the agent container: one Telegram turn whose provider is served by the host over the container's
@@ -11,9 +12,22 @@ exports.runGuest = runGuest;
11
12
  * host builds the scored observation from its own sources and uses this result only for the replies and their order.
12
13
  */
13
14
  const node_fs_1 = __importDefault(require("node:fs"));
15
+ const node_path_1 = __importDefault(require("node:path"));
14
16
  const identity_1 = require("../../heart/identity");
15
17
  const runtime_1 = require("../../nerves/runtime");
16
18
  const provider_proxy_1 = require("../transport/provider-proxy");
19
+ /**
20
+ * The one bundle the sandbox mounted in the bundles folder (`$HOME/AgentBundles`, as `getAgentBundlesRoot()` gives
21
+ * it), so a guest needs no agent name of its own and its command line stays the same for every agent. Every guest
22
+ * entry other than the Telegram one, which takes `--agent`, finds its bundle this way. It lives here because the
23
+ * agent image keeps only this file of the sandbox's. Throws if there is no bundle, or more than one.
24
+ */
25
+ function mountedAgentRoot(bundlesRoot, list = (dir) => node_fs_1.default.readdirSync(dir)) {
26
+ const bundles = list(bundlesRoot).filter((name) => name.endsWith(".ouro")).sort();
27
+ if (bundles.length !== 1)
28
+ throw new Error(`expected one agent bundle in ${bundlesRoot}, found ${bundles.length}`);
29
+ return node_path_1.default.join(bundlesRoot, bundles[0]);
30
+ }
17
31
  function readTurnFile(file) {
18
32
  const value = JSON.parse(node_fs_1.default.readFileSync(file, "utf8"));
19
33
  if (!Array.isArray(value.prefix) || typeof value.userText !== "string")
@@ -27,7 +41,7 @@ async function runGuest(input) {
27
41
  try {
28
42
  const turn = readTurnFile(input.turnFile);
29
43
  const providerRuntime = await (0, provider_proxy_1.createProxyRuntime)(channel);
30
- const result = await input.runTurn({ agentRoot: (0, identity_1.getAgentRoot)("sanctuary"), prefix: turn.prefix, userText: turn.userText, providerRuntime });
44
+ const result = await input.runTurn({ agentRoot: input.agentRoot ?? (0, identity_1.getAgentRoot)("sanctuary"), prefix: turn.prefix, userText: turn.userText, providerRuntime });
31
45
  outcome = { ok: true, result };
32
46
  (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.guest_end", message: "sandbox guest finished its turn", meta: { outcome: result.outcome } });
33
47
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1485",
3
+ "version": "0.1.0-alpha.1487",
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.1485",
9
+ "version": "0.1.0-alpha.1487",
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.1485",
3
+ "version": "0.1.0-alpha.1487",
4
4
  "description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
5
5
  "homepage": "https://ouroboros.bot/",
6
6
  "engines": {