@ouro.bot/cli 0.1.0-alpha.1621 → 0.1.0-alpha.1623

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,13 +1,27 @@
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.1623",
6
+ "changes": [
7
+ "iMessage: the BlueBubbles webhook now listens only on 127.0.0.1, the address Ouro registers it at, and refuses a post without the server's password (before, a post with no password at all got through). Each refused post is logged as `senses.bluebubbles_webhook_unauthorized`.",
8
+ "Turns asked for over the daemon socket (MCP `send_message`, `agent.ask`, `agent.senseTurn`) and over the frontend socket are now marked as socket turns. `friend_link_code` refuses them with code `socket-turn`, since a socket caller picks its own friend and channel and so can't prove the family member is there.",
9
+ "The file and shell tools now refuse writes under `state/letters/`, the mailbox's letters. Paths are normalised before the check, so `state//letters/` and quoted paths are caught. The shell check now looks at every redirect and `tee` target in a command, `>>`, `>|`, `&>` and chained commands included, not just the first.",
10
+ "Update the Ouro UI files to Ouro UI v1.3.587."
11
+ ]
12
+ },
4
13
  {
5
14
  "version": "0.1.0-alpha.1621",
15
+ "changes": [
16
+ "The Ouro AX census the harness runs in CI is now Ouro UI v1.3.585's, up from v1.3.465, and it is listed in `upstream-sources.lock.json`, so Ouro Current's update pull requests move it with every Ouro UI release instead of it waiting for a hand copy. The newer census also checks that a passthrough tool's call arguments come from its declared third-party source."
17
+ ]
18
+ },
19
+ {
20
+ "version": "0.1.0-alpha.1620",
6
21
  "changes": [
7
22
  "The Butler's behaviour (its Telegram sense, owner escalation, house-care and media tools, health habit, acceptance markers and download-credit text) now turns on for an agent named `butler` as well as `sanctuary`. This is the first step of the rename: an install runs the same whichever name its bundle has.",
8
23
  "The Butler's saved records and messages from the host (the Usenet event spool, its replay record, the Telegram failsafe and the scheduler's cron proof) are now accepted under the name `butler` as well as `sanctuary`, so the Butler keeps working through the rename from `sanctuary.ouro` to `butler.ouro`. Records written before the rename still say `sanctuary` and are read as before.",
9
- "The blind interviews now know pre-registration version 3 (seed 20261126, registered 2026-11-26), which runs only the reduced design. Under version 3, a call that gets a 429 is sent again after 15 s, 45 s and 120 s before the study stops, and the runner waits 60 s between sessions. Each session's record, report and summary line count its rate-limit retries. Versions 1 and 2 behave as before: the first 429 stops the study. A 402 still stops every version at once.",
10
- "The Ouro AX census the harness runs in CI is now Ouro UI v1.3.585's, up from v1.3.465, and it is listed in `upstream-sources.lock.json`, so Ouro Current's update pull requests move it with every Ouro UI release instead of it waiting for a hand copy. The newer census also checks that a passthrough tool's call arguments come from its declared third-party source."
24
+ "The blind interviews now know pre-registration version 3 (seed 20261126, registered 2026-11-26), which runs only the reduced design. Under version 3, a call that gets a 429 is sent again after 15 s, 45 s and 120 s before the study stops, and the runner waits 60 s between sessions. Each session's record, report and summary line count its rate-limit retries. Versions 1 and 2 behave as before: the first 429 stops the study. A 402 still stops every version at once."
11
25
  ]
12
26
  },
13
27
  {
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1621",
2
+ "runtimeVersion": "0.1.0-alpha.1623",
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.1621</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1623</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -573,7 +573,8 @@ async function handleAgentSenseTurn(command, runtime) {
573
573
  sessionKey: command.sessionKey,
574
574
  friendId: command.friendId,
575
575
  userMessage: command.message,
576
- ...(runtime?.socketPath ? { toolContext: { daemonSocketPath: runtime.socketPath } } : {}),
576
+ // The socket's caller chose friendId and channel, so the turn is marked as a socket turn.
577
+ toolContext: { turnOrigin: "socket", ...(runtime?.socketPath ? { daemonSocketPath: runtime.socketPath } : {}) },
577
578
  // Per-turn, per-agent runtime MCP injection (e.g. Workbench's ouro_workbench).
578
579
  // Scoped to THIS turn only — never stored as module state, so a concurrent
579
580
  // turn for a different agent cannot inherit these servers.
@@ -237,6 +237,8 @@ class FrontendSessionService {
237
237
  ...(normalized.shepherdSession ? { shepherdSession: normalized.shepherdSession } : {}),
238
238
  signal: controller.signal,
239
239
  latencyMode: "live",
240
+ // The frontend socket's caller names the friend and channel, as agent.senseTurn's does, so it is a socket turn.
241
+ toolContext: { turnOrigin: "socket" },
240
242
  frontendEventSink,
241
243
  ...(normalized.disableTools ? { disableTools: true } : {}),
242
244
  ...(normalized.ephemeral ? { disablePersistence: true } : {}),
@@ -83,6 +83,9 @@ const PROTECTED_PATH_SEGMENTS = [
83
83
  "state/senses/",
84
84
  "state/outbox/",
85
85
  "state/reports/",
86
+ // The mailbox's letters, its answering handle and its answered-message ledger: only the daemon's writer and the
87
+ // owner's mailbox handle command write them (design §3.4).
88
+ "state/letters/",
86
89
  ];
87
90
  const PROTECTED_FILENAMES = ["agent.json", "tool-profiles.json"];
88
91
  /** How many symlinks a dangling-link walk follows before refusing (the Linux kernel's own limit is 40). */
@@ -403,7 +406,11 @@ function isFriendTurn(context) {
403
406
  function psycheEditNote(file) {
404
407
  return `psyche edit: I changed psyche/${file}. I tell my owner in one line which file changed and why.`;
405
408
  }
406
- function isProtectedPath(filePath) {
409
+ function isProtectedPath(rawPath) {
410
+ // Read the path as the filesystem would: quotes a shell strips, then doubled slashes and dot segments collapsed, so
411
+ // `state//letters/` or `state/./letters/` is the same folder as `state/letters/`.
412
+ const unquoted = rawPath.replace(/^(['"])(.*)\1$/, "$2").replace(/^['"]/, "");
413
+ const filePath = path.posix.normalize(unquoted);
407
414
  for (const segment of PROTECTED_PATH_SEGMENTS) {
408
415
  if (filePath.includes(`/${segment}`) || filePath.startsWith(segment))
409
416
  return true;
@@ -422,13 +429,19 @@ function splitShellCommands(command) {
422
429
  return command.split(COMPOUND_SEPARATORS).filter(Boolean);
423
430
  }
424
431
  // --- shell commands that write to protected paths ---
432
+ // Every output redirect's target: `>`, `>>`, `>|`, `&>` and `2>`, each with or without a space before the path.
433
+ const REDIRECT_TARGET = /&?\d*>>?\|?\s*([^\s>|&;]+)/g;
434
+ // Every file a `tee` writes, after its flags.
435
+ const TEE_TARGETS = /\btee\s+((?:-\w+\s+)*)([^|;&]*)/g;
425
436
  function shellWritesToProtectedPath(command) {
426
- const redirectMatch = command.match(/>\s*(\S+)/);
427
- if (redirectMatch && isProtectedPath(redirectMatch[1]))
428
- return true;
429
- const teeMatch = command.match(/tee\s+(?:-\w+\s+)*(\S+)/);
430
- if (teeMatch && isProtectedPath(teeMatch[1]))
431
- return true;
437
+ for (const match of command.matchAll(REDIRECT_TARGET)) {
438
+ if (isProtectedPath(match[1]))
439
+ return true;
440
+ }
441
+ for (const match of command.matchAll(TEE_TARGETS)) {
442
+ if (match[2].split(/\s+/).filter(Boolean).some(isProtectedPath))
443
+ return true;
444
+ }
432
445
  return false;
433
446
  }
434
447
  // --- structural guardrail checks (always on, all trust levels) ---
@@ -33,6 +33,9 @@ exports.friendLinkToolDefinition = {
33
33
  message: "friend_link_code invoked",
34
34
  meta: { channel: args.channel ?? "any" },
35
35
  });
36
+ // A socket turn's caller names the friend and channel itself, so it can't prove the person is here (design §3.4).
37
+ if (ctx?.turnOrigin === "socket")
38
+ return (0, tool_error_code_1.withCode)("link codes are issued only in a chat the person started, not in a turn asked for over the daemon socket.", "socket-turn");
36
39
  const context = ctx?.context;
37
40
  if (!context?.friend)
38
41
  return (0, tool_error_code_1.withCode)("no friend context: I can only issue a link code to the person I'm talking to.", "no-friend-context");
@@ -56,6 +59,7 @@ exports.friendLinkToolDefinition = {
56
59
  summaryKeys: ["channel"],
57
60
  riskProfile: { mutates: "durable_state_write", risk: "high", reason: "issues a code that links a new account to a family friend" },
58
61
  ax: { id: "tool:friend_link_code", group: "turn-friends", when: "Pick this when a family member wants another of their own accounts, such as Teams, recognised as them.", effect: "write", errors: [
62
+ { code: "socket-turn", means: "This turn was asked for over the daemon socket (an MCP or CLI caller), which can't prove the person is present.", fix: "Issue the code from a chat the family member started with you." },
59
63
  { code: "no-friend-context", means: "This turn has no known person to issue a code for.", fix: "Issue the code from a chat with that family member." },
60
64
  { code: "family-only", means: "Link codes are only for family, and this person isn't family.", fix: "Tell them plainly; their owner can raise their trust level if that is wanted." },
61
65
  { code: "group-chat", means: "Codes aren't issued in group chats.", fix: "Ask them to message you one to one, then issue it there." },
@@ -1531,9 +1531,11 @@ function writeSemanticCaptureFailure(res) {
1531
1531
  res.setHeader("Content-Type", "application/json");
1532
1532
  res.end('{"ok":false,"error":"semantic_capture_failed"}');
1533
1533
  }
1534
+ /** The webhook takes a post only with the server's password; one without it is refused, not let through. */
1534
1535
  function isWebhookPasswordValid(url, expectedPassword) {
1535
- const provided = url.searchParams.get("password");
1536
- return !provided || provided === expectedPassword;
1536
+ const provided = Buffer.from(url.searchParams.get("password") ?? "", "utf8");
1537
+ const expected = Buffer.from(expectedPassword, "utf8");
1538
+ return expected.length > 0 && provided.length === expected.length && (0, node_crypto_1.timingSafeEqual)(provided, expected);
1537
1539
  }
1538
1540
  function normalizeHandleForSelfMatch(handle) {
1539
1541
  const trimmed = handle.trim().toLowerCase();
@@ -2209,6 +2211,7 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source, opt
2209
2211
  signin: async () => undefined,
2210
2212
  ...safeToolContext,
2211
2213
  ...mcpOwner,
2214
+ turnOrigin: "sense-ingress",
2212
2215
  summarize,
2213
2216
  chatActions: (0, tools_chat_1.chatActionsForTurn)({
2214
2217
  setReplyTarget: (selection) => replyTarget.setSelection(selection),
@@ -2248,6 +2251,7 @@ async function handleBlueBubblesNormalizedEvent(event, resolvedDeps, source, opt
2248
2251
  toolContext: {
2249
2252
  signin: async () => undefined,
2250
2253
  ...mcpOwner,
2254
+ turnOrigin: "sense-ingress",
2251
2255
  currentIngressEvidence: options.currentIngressEvidence,
2252
2256
  },
2253
2257
  ...(options.isReactionSignal ? { isReactionSignal: true } : {}),
@@ -3876,6 +3880,8 @@ function createBlueBubblesWebhookHandler(deps = {}, options = {}) {
3876
3880
  return;
3877
3881
  }
3878
3882
  if (!isWebhookPasswordValid(url, runtimeConfig.password)) {
3883
+ // Seen in the logs, so a webhook registered without the password (or a stray post) shows up.
3884
+ (0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.bluebubbles_webhook_unauthorized", message: "bluebubbles webhook post refused: wrong or missing password", meta: { hasPassword: url.searchParams.has("password") } });
3879
3885
  writeJson(res, 401, { error: "Unauthorized" });
3880
3886
  return;
3881
3887
  }
@@ -4704,7 +4710,9 @@ function startBlueBubblesApp(deps = {}) {
4704
4710
  }
4705
4711
  server.on?.("close", shutdown);
4706
4712
  runningBlueBubblesApps.set(server, shutdown);
4707
- server.listen(channelConfig.port, () => {
4713
+ // Loopback only: the reconciler registers the webhook at http://127.0.0.1 (webhook-registration.ts), so nothing
4714
+ // off this Mac has a reason to reach it.
4715
+ server.listen(channelConfig.port, "127.0.0.1", () => {
4708
4716
  const blueBubblesConfig = (0, config_1.getBlueBubblesConfig)();
4709
4717
  webhookReconciler = (0, webhook_registration_1.createBlueBubblesWebhookReconciler)({
4710
4718
  serverUrl: blueBubblesConfig.serverUrl,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1621",
3
+ "version": "0.1.0-alpha.1623",
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.1621",
9
+ "version": "0.1.0-alpha.1623",
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.1621",
3
+ "version": "0.1.0-alpha.1623",
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": {