@ouro.bot/cli 0.1.0-alpha.1643 → 0.1.0-alpha.1644

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,16 @@
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.1644",
6
+ "changes": [
7
+ "`ouro doctor` now says how far each agent's BlueBubbles address can be trusted with the server password, which every request carries. A server on the same Mac, behind https, or at a tailnet address passes. Plain http to anything else warns, as does an address that isn't an http or https URL; each says the mailbox won't read letter answers from it and names the fix. A MagicDNS name counts only over https.",
8
+ "`ouro doctor` also says whether a shell beside the daemon could send iMessages as the agent's person. It compares the uid that owns the daemon's socket with the uid of the declared host account (`senses.bluebubbles.hostUsername`), the one signed in to the agent's own Apple ID, so it holds when `ouro doctor` runs as the person and the daemon doesn't. It passes when they match. A socket no daemon answers on counts as no daemon. Otherwise it warns that each letter answer is marked `shared-apple-id` until a human runs the daemon under that account."
9
+ ]
10
+ },
4
11
  {
5
12
  "version": "0.1.0-alpha.1643",
6
13
  "changes": [
7
- "Update the Ouro UI files to Ouro UI v1.3.590.",
8
14
  "The daemon can now record a person's answer to a letter from their own iMessage. Given only a message's GUID, it reads that message from the agent's BlueBubbles server and records the answer only when every check holds on the server's own fields:",
9
15
  "The text is exactly the letter's code and an option number, such as `L7 2`, with an optional note after a dash. The note loses format characters and is capped at 200 characters.",
10
16
  "It comes from the letter's answering handle, in that handle's one-to-one iMessage chat. It is not sent by SMS, not by the agent (a message whose direction the server doesn't state counts as the agent's), and not as a threaded reply, an edit or a retraction.",
@@ -14,6 +20,12 @@
14
20
  "A message that already answered its letter gets the same answer when it is checked again, so a retry or a recovery replay is never also run as a chat turn. The asker can set a deadline, and nothing is recorded after it."
15
21
  ]
16
22
  },
23
+ {
24
+ "version": "0.1.0-alpha.1642",
25
+ "changes": [
26
+ "Update the Ouro UI files to Ouro UI v1.3.590."
27
+ ]
28
+ },
17
29
  {
18
30
  "version": "0.1.0-alpha.1641",
19
31
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1643",
2
+ "runtimeVersion": "0.1.0-alpha.1644",
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.1643</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1644</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -44,6 +44,8 @@ exports.KNOWN_DOCTOR_CATEGORIES = exports.DEFAULT_MEMORY_FLOOR_MB = exports.DEFA
44
44
  exports.checkCliPath = checkCliPath;
45
45
  exports.checkDaemon = checkDaemon;
46
46
  exports.senseInboundDeliveryCheck = senseInboundDeliveryCheck;
47
+ exports.daemonAccount = daemonAccount;
48
+ exports.accountUid = accountUid;
47
49
  exports.checkAgents = checkAgents;
48
50
  exports.checkSenses = checkSenses;
49
51
  exports.checkHabits = checkHabits;
@@ -57,11 +59,15 @@ exports.checkDisk = checkDisk;
57
59
  exports.checkLifecycle = checkLifecycle;
58
60
  exports.checkGit = checkGit;
59
61
  exports.runDoctorChecks = runDoctorChecks;
62
+ const child_process_1 = require("child_process");
63
+ const fs = __importStar(require("fs"));
64
+ const os = __importStar(require("os"));
60
65
  const path = __importStar(require("path"));
61
66
  const portable_git_1 = require("./portable-git");
62
67
  const runtime_1 = require("../../nerves/runtime");
63
68
  const bluebubbles_health_diagnostics_1 = require("./bluebubbles-health-diagnostics");
64
69
  const webhook_registration_1 = require("../../senses/bluebubbles/webhook-registration");
70
+ const url_trust_1 = require("../../senses/bluebubbles/url-trust");
65
71
  const freshness_1 = require("./freshness");
66
72
  const ouro_path_installer_1 = require("../versioning/ouro-path-installer");
67
73
  const runtime_credentials_1 = require("../runtime-credentials");
@@ -280,6 +286,74 @@ const DEFINITIVE_BLUEBUBBLES_WEBHOOK_STATES = new Set([
280
286
  "listener-not-ready",
281
287
  "host-account-refused",
282
288
  ]);
289
+ const URL_TRUST_DETAIL = {
290
+ loopback: "on this Mac: the server password stays on this machine, and the mailbox reads letter answers from it",
291
+ tls: "over https: the server password is encrypted in transit, and the mailbox reads letter answers from it",
292
+ tailnet: "at a tailnet address: Tailscale's tunnel encrypts the server password in transit while it is up, and the mailbox reads letter answers from it",
293
+ };
294
+ /** Whether the BlueBubbles address keeps the server password, which every request carries, from the network. */
295
+ function blueBubblesAddressCheck(agentDir, agentName, serverUrl) {
296
+ const label = `${agentDir} bluebubbles server address`;
297
+ const fix = `then re-attach with \`ouro connect bluebubbles --agent ${agentName}\``;
298
+ if (!URL.canParse(serverUrl) || !/^https?:$/.test(new URL(serverUrl).protocol)) {
299
+ return { label, status: "warn", detail: `${serverUrl} isn't an http or https URL, so the mailbox won't read letter answers from it. Correct it, ${fix}` };
300
+ }
301
+ const trust = (0, url_trust_1.blueBubblesUrlTrust)(serverUrl);
302
+ if (trust !== "untrusted")
303
+ return { label, status: "pass", detail: URL_TRUST_DETAIL[trust] };
304
+ return {
305
+ label,
306
+ status: "warn",
307
+ detail: `plain http to an address outside this Mac and the tailnet, so the server password crosses the network readable and the mailbox won't read letter answers from it. Use https, the server's tailnet address, or a server on this Mac, ${fix}`,
308
+ };
309
+ }
310
+ /** The daemon's macOS account, from its socket's owner; when no daemon is running, this process's account. */
311
+ function daemonAccount(socketPath, me = os.userInfo()) {
312
+ let uid;
313
+ try {
314
+ uid = fs.statSync(socketPath).uid;
315
+ }
316
+ catch {
317
+ return { running: false, user: me.username, uid: me.uid };
318
+ }
319
+ return { running: true, user: uid === me.uid ? me.username : null, uid };
320
+ }
321
+ /** A macOS account's uid, or null when no such account exists here. */
322
+ function accountUid(username, run = child_process_1.execFileSync) {
323
+ try {
324
+ const uid = Number(String(run("id", ["-u", username], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] })).trim());
325
+ return Number.isInteger(uid) ? uid : null;
326
+ }
327
+ catch {
328
+ return null;
329
+ }
330
+ }
331
+ /**
332
+ * Whether a shell on the daemon's account could send iMessages from the person's Apple ID (design §3.4). The declared
333
+ * host account is the one signed in to the agent's own Apple ID, so a daemon running under it can at most send as the
334
+ * agent. Accounts are compared by uid, so the check holds when ouro doctor runs as the person and the daemon doesn't.
335
+ */
336
+ async function blueBubblesIMessageHostCheck(agentDir, hostUsername, deps) {
337
+ const label = `${agentDir} bluebubbles iMessage host`;
338
+ let account = (deps.daemonAccount ?? (() => daemonAccount(deps.socketPath)))();
339
+ // A socket left behind by a daemon that died names no running daemon.
340
+ if (account.running && !(await deps.checkSocketAlive(deps.socketPath))) {
341
+ const me = os.userInfo();
342
+ account = { running: false, user: me.username, uid: me.uid };
343
+ }
344
+ const judged = account.running ? "" : " The daemon isn't running, so this judges the account ouro doctor runs as.";
345
+ const hostUid = (deps.accountUid ?? accountUid)(hostUsername);
346
+ if (hostUid !== null && hostUid === account.uid) {
347
+ return { label, status: "pass", detail: `the daemon runs as ${hostUsername}, the account declared as signed in to the agent's own Apple ID, so a shell beside it can send as the agent, not from the person's Messages.${judged}` };
348
+ }
349
+ const missing = hostUid === null ? ` (no macOS account ${hostUsername} exists on this Mac)` : "";
350
+ const who = account.user ?? `uid ${account.uid}`;
351
+ return {
352
+ label,
353
+ status: "warn",
354
+ detail: `the daemon runs as ${who}, not ${hostUsername}${missing}, the account declared for the agent's own Apple ID, so a shell on ${who} could send iMessages from whatever Apple ID that account's Messages uses, perhaps the person's. Each letter answer is marked shared-apple-id until a human runs the daemon under ${hostUsername}.${judged}`,
355
+ };
356
+ }
283
357
  function blueBubblesUpstreamEvidence(probe) {
284
358
  if (probe.ok)
285
359
  return "healthy";
@@ -516,6 +590,8 @@ async function checkSenses(deps) {
516
590
  status: "pass",
517
591
  detail: `${serverUrl} (host account ${hostUsername})`,
518
592
  });
593
+ checks.push(blueBubblesAddressCheck(agentDir, agentName, serverUrl));
594
+ checks.push(await blueBubblesIMessageHostCheck(agentDir, hostUsername, deps));
519
595
  let upstreamContext = "upstream probe not run in this pass";
520
596
  let infrastructure = { upstream: "not-run", webhook: null };
521
597
  if (deps.fetchImpl) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1643",
3
+ "version": "0.1.0-alpha.1644",
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.1643",
9
+ "version": "0.1.0-alpha.1644",
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.1643",
3
+ "version": "0.1.0-alpha.1644",
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": {