@ouro.bot/cli 0.1.0-alpha.1601 → 0.1.0-alpha.1602

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,14 +1,25 @@
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.1602",
6
+ "changes": [
7
+ "An agent can now send a local image (png or jpg) with `surface` to a person on iMessage by naming it in `imagePath`; the text goes as its caption. Slugger's relay can deliver a screenshot to a phone instead of saying it can only send text (#1932). The image is checked before anything goes out, so an unreadable or non-image file sends nothing and says so. It needs family trust and refuses the sync-key directory, like `send_file`. Telegram, Teams, voice and held returns do not take an image yet and say so."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1601",
6
12
  "changes": [
7
- "A private-runtime turn can't rest straight past work a tool flagged. When a tool result prints lines starting with `ACT:` (a habit's scan does this for a lane it revived) and no send reaches anyone after them, the first `rest` is refused with the code `act-unanswered` and lists those lines. The prompt no longer tells the agent that resting on a heartbeat is always fine: a habit's body is now its standing order, and `HEARTBEAT_OK` means nothing needed doing.",
8
- "A habit's `send_message` without a `key` is no longer blocked as \"no permitted return route target\". The tool treats `key` as optional and sends to `session`, and the habit route check now does the same, so a heartbeat can text its family friend with just a friend and a channel.",
9
13
  "The eval sandbox image build now retries up to three times when the registry answers a server error or drops the connection while fetching the base image, instead of failing the `integration` check on one Docker Hub hiccup (#1936). Any other build failure still fails at once."
10
14
  ]
11
15
  },
16
+ {
17
+ "version": "0.1.0-alpha.1600",
18
+ "changes": [
19
+ "A private-runtime turn can't rest straight past work a tool flagged. When a tool result prints lines starting with `ACT:` (a habit's scan does this for a lane it revived) and no send reaches anyone after them, the first `rest` is refused with the code `act-unanswered` and lists those lines. The prompt no longer tells the agent that resting on a heartbeat is always fine: a habit's body is now its standing order, and `HEARTBEAT_OK` means nothing needed doing.",
20
+ "A habit's `send_message` without a `key` is no longer blocked as \"no permitted return route target\". The tool treats `key` as optional and sends to `session`, and the habit route check now does the same, so a heartbeat can text its family friend with just a friend and a channel."
21
+ ]
22
+ },
12
23
  {
13
24
  "version": "0.1.0-alpha.1599",
14
25
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1601",
2
+ "runtimeVersion": "0.1.0-alpha.1602",
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.1601</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1602</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -1274,6 +1274,9 @@ function checkTrustLevelGuardrails(toolName, args, context) {
1274
1274
  if (toolName === "send_file" && context.trustLevel !== "family") {
1275
1275
  return deny("sending files from this machine requires family trust.");
1276
1276
  }
1277
+ if (toolName === "surface" && args.imagePath && context.trustLevel !== "family") {
1278
+ return deny("sending files from this machine requires family trust.");
1279
+ }
1277
1280
  const cacheSyncResult = mailCacheSyncShellGuardrail(toolName, args, context);
1278
1281
  if (!cacheSyncResult.allowed)
1279
1282
  return cacheSyncResult;
@@ -1385,6 +1388,9 @@ function guardInvocation(toolName, rawArgs, context) {
1385
1388
  // send_file reads the file it sends, so the sync key's directory is closed to it the same way.
1386
1389
  if (toolName === "send_file" && syncSecretReadRefused("read_file", args, context.agentRoot))
1387
1390
  return deny(REASONS.unreadablePath);
1391
+ // surface's imagePath is read off this machine and sent, so the sync key's directory is closed to it too.
1392
+ if (toolName === "surface" && args.imagePath && syncSecretReadRefused("read_file", { path: args.imagePath }, context.agentRoot))
1393
+ return deny(REASONS.unreadablePath);
1388
1394
  // Layer 1: structural guardrails (always on)
1389
1395
  const structuralResult = checkStructuralGuardrails(toolName, args, context);
1390
1396
  if (!structuralResult.allowed)
@@ -34,7 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.toolCards = exports.surfaceToolDefinition = exports.SPONTANEOUS_OUTREACH_FRESH_DAYS = exports.surfaceToolDef = void 0;
37
+ exports.surfaceImageRefusal = surfaceImageRefusal;
37
38
  exports.sendSpontaneousOutreach = sendSpontaneousOutreach;
39
+ exports.spontaneousOutreachSenders = spontaneousOutreachSenders;
38
40
  exports.routeSurfaceToFriend = routeSurfaceToFriend;
39
41
  const fs = __importStar(require("fs"));
40
42
  const crypto_1 = require("crypto");
@@ -50,6 +52,17 @@ const runtime_1 = require("../nerves/runtime");
50
52
  const path = __importStar(require("path"));
51
53
  const outbound_1 = require("../senses/voice/outbound");
52
54
  const tool_error_code_1 = require("./tool-error-code");
55
+ const IMAGE_ONLY_ON_OUTREACH = "an image goes only with spontaneous outreach to a person (friendId) on iMessage";
56
+ /** Why an image can't ride this delivery, or undefined when it can; nothing is sent when this returns a reason. */
57
+ function surfaceImageRefusal(hint, route) {
58
+ if (!hint?.imagePath)
59
+ return undefined;
60
+ if (!hint.imagePath.startsWith("/"))
61
+ return (0, tool_error_code_1.withCode)("imagePath must be an absolute path to an image.", "relative-path");
62
+ if (hint.channel === "voice" || hint.channel === "teams" || route.heldThought)
63
+ return (0, tool_error_code_1.withCode)(`${IMAGE_ONLY_ON_OUTREACH}, not this delivery; nothing was sent. Send the text without imagePath.`, "image-unsupported");
64
+ return undefined;
65
+ }
53
66
  /* v8 ignore start -- surface voice delivery hints are covered at the outbound voice bridge; this adapter only normalizes optional tool args @preserve */
54
67
  function normalizeSurfaceDeliveryChannel(value) {
55
68
  if (typeof value !== "string")
@@ -107,6 +120,10 @@ exports.surfaceToolDef = {
107
120
  enum: ["auto", "voice", "teams"],
108
121
  description: "optional delivery channel; use voice for a live phone call to a trusted friend, teams to reach them on Teams now, otherwise omit",
109
122
  },
123
+ imagePath: {
124
+ type: "string",
125
+ description: "optional absolute path of a local image (png or jpg) to send with content on iMessage; only for spontaneous outreach (friendId) to a person. content becomes its caption. if the image can't go on iMessage, nothing is sent",
126
+ },
110
127
  phoneNumber: {
111
128
  type: "string",
112
129
  description: "optional E.164 phone override for channel=voice when the trusted friend's record has no usable phone handle",
@@ -167,6 +184,9 @@ async function sendSpontaneousOutreach(friendId, sessions, senders, nowMs) {
167
184
  catch (error) {
168
185
  attempt = { status: "unsent", why: error instanceof Error ? error.message : String(error) };
169
186
  }
187
+ if (attempt.status === "refused" && attempt.imageProblem) {
188
+ return { sent: { status: "failed", detail: (0, tool_error_code_1.withCode)(`the image was not sent, so nothing was sent: ${attempt.why}. Fix the imagePath or send the text without it.`, "image-unsendable") } };
189
+ }
170
190
  if (attempt.status === "refused") {
171
191
  const detail = `blocked: ${PUSH_CHANNEL_LABELS[target.channel]} refused this text as internal (${attempt.why}), so no chat sends it; rewrite it as plain words for them`;
172
192
  return { sent: { status: "failed", detail: (0, tool_error_code_1.withCode)(detail, "delivery-blocked") } };
@@ -204,11 +224,14 @@ const teamsForwardedDetail = (machine) => `handed to ${machine}, which runs Team
204
224
  /** A Teams send_error may have gone out unless Teams said it was not sent. */
205
225
  const teamsSendMayHaveGoneOut = (sent) => sent.delivery?.state === "unknown" || (sent.reason === "send_error" && sent.delivery?.state !== "not_sent");
206
226
  /** How each push sense sends one spontaneous message, and what its outcome means. */
207
- function spontaneousOutreachSenders(agentName, agentRoot, content, queueItem) {
227
+ function spontaneousOutreachSenders(agentName, agentRoot, content, queueItem, imagePath) {
228
+ const noImage = (sense) => imagePath ? { status: "unsent", why: `${sense} does not take an image from surface` } : undefined;
208
229
  return {
209
230
  bluebubbles: async (target) => {
210
231
  const { sendProactiveBlueBubblesMessageToSession } = await Promise.resolve().then(() => __importStar(require("../senses/bluebubbles")));
211
- const sent = await sendProactiveBlueBubblesMessageToSession({ friendId: target.friendId, sessionKey: target.key, text: content, intent: "generic_outreach", origin: "proactive" });
232
+ const sent = await sendProactiveBlueBubblesMessageToSession({ friendId: target.friendId, sessionKey: target.key, text: content, intent: "generic_outreach", origin: "proactive", ...(imagePath ? { imagePath } : {}) });
233
+ if (sent.reason === "image_unsendable")
234
+ return { status: "refused", why: sent.detail ?? "the image could not be sent", imageProblem: true };
212
235
  if (sent.delivered)
213
236
  return { status: "delivered", detail: "texted them by iMessage now" };
214
237
  if (sent.delivery?.state === "unknown")
@@ -218,6 +241,9 @@ function spontaneousOutreachSenders(agentName, agentRoot, content, queueItem) {
218
241
  return { status: "unsent", why: sent.reason ?? "not delivered" };
219
242
  },
220
243
  telegram: async (target) => {
244
+ const skipped = noImage("Telegram");
245
+ if (skipped)
246
+ return skipped;
221
247
  const telegramKey = (0, config_1.canonicalizeTelegramSessionKey)(target.key);
222
248
  const hash = (0, crypto_1.createHash)("sha256").update(`${target.friendId}\0${telegramKey}\0${content}`).digest("hex");
223
249
  const { sendTelegramAwaitFollowUp } = await Promise.resolve().then(() => __importStar(require("../senses/telegram")));
@@ -237,6 +263,9 @@ function spontaneousOutreachSenders(agentName, agentRoot, content, queueItem) {
237
263
  return { status: "unsent", why: delivered.detail ?? delivered.status };
238
264
  },
239
265
  teams: async (target) => {
266
+ const skipped = noImage("Teams");
267
+ if (skipped)
268
+ return skipped;
240
269
  const { sendTeamsOffTurn } = await Promise.resolve().then(() => __importStar(require("../senses/teams-off-turn")));
241
270
  const sent = await sendTeamsOffTurn({ friendId: target.friendId, key: target.key, text: content, origin: "proactive", captureReceipt: true }, { agentRoot });
242
271
  if (sent?.forwardedTo)
@@ -262,6 +291,9 @@ function spontaneousOutreachSenders(agentName, agentRoot, content, queueItem) {
262
291
  async function routeSurfaceToFriend(agentName, friendId, content, queueItem, hint) {
263
292
  if ((0, bluebubbles_meta_guard_1.containsInternalMetaMarkers)(content))
264
293
  return { status: "failed", detail: "blocked: contains internal meta markers" };
294
+ const imageRefusal = surfaceImageRefusal(hint, { heldThought: Boolean(queueItem) });
295
+ if (imageRefusal)
296
+ return { status: "failed", detail: imageRefusal };
265
297
  /* v8 ignore start -- routing: integration path tested via private-runtime routing tests @preserve */
266
298
  try {
267
299
  const agentRoot = (0, identity_1.getAgentRoot)();
@@ -402,6 +434,8 @@ async function routeSurfaceToFriend(agentName, friendId, content, queueItem, hin
402
434
  }
403
435
  })();
404
436
  if (friendKind === "agent" && allFriendSessions[0]) {
437
+ if (hint?.imagePath)
438
+ return { status: "failed", detail: (0, tool_error_code_1.withCode)(`${IMAGE_ONLY_ON_OUTREACH}, not to an agent; nothing was sent. Send the text without imagePath.`, "image-unsupported") };
405
439
  return deliverOrQueue(allFriendSessions[0], `for next interaction via ${allFriendSessions[0].channel}`);
406
440
  }
407
441
  // Priority 2b: spontaneous outreach to a person sends now where it reaches
@@ -411,7 +445,7 @@ async function routeSurfaceToFriend(agentName, friendId, content, queueItem, hin
411
445
  if (contentBlock) {
412
446
  return { status: "failed", detail: (0, tool_error_code_1.withCode)((0, proactive_content_guard_1.proactiveContentBlockGuidance)(contentBlock), "delivery-blocked") };
413
447
  }
414
- const outreach = await sendSpontaneousOutreach(friendId, allFriendSessions, spontaneousOutreachSenders(agentName, agentRoot, content, queueItem), Date.now());
448
+ const outreach = await sendSpontaneousOutreach(friendId, allFriendSessions, spontaneousOutreachSenders(agentName, agentRoot, content, queueItem, hint?.imagePath), Date.now());
415
449
  if ("sent" in outreach)
416
450
  return outreach.sent;
417
451
  // Priority 3: Deferred — nothing sent now; their next message picks it up.
@@ -442,6 +476,9 @@ const surfaceCard = {
442
476
  errors: [
443
477
  { code: "delivery-blocked", means: "The content carries internal meta markers, so nothing was delivered.", fix: "Rewrite the content as plain words for the person and surface it again." },
444
478
  { code: "orientation-hold", means: "This turn is on a correction hold, so surfacing waits.", fix: "Call orientation_get, settle what the person meant, then surface the thought if it still answers them." },
479
+ { code: "relative-path", means: "imagePath didn't start with /, so nothing was sent.", fix: "Call again with the image's absolute path." },
480
+ { code: "image-unsupported", means: "An image goes only with spontaneous outreach to a person on iMessage, so nothing was sent.", fix: "Send the text without imagePath." },
481
+ { code: "image-unsendable", means: "The image could not be read or sent on iMessage, so nothing was sent.", fix: "Fix imagePath (an existing png or jpg under the size cap) and surface again." },
445
482
  { code: "surface-not-sent", means: "No chat sent the message now, so it is saved for the friend's next message; the result says why.", fix: "If it cannot wait and the result offers a call, call them; otherwise let it wait." },
446
483
  ],
447
484
  };
@@ -455,6 +492,7 @@ exports.surfaceToolDefinition = {
455
492
  channel: normalizeSurfaceDeliveryChannel(args.channel),
456
493
  phoneNumber: typeof args.phoneNumber === "string" ? args.phoneNumber : undefined,
457
494
  initialAudio: parseSurfaceVoiceInitialAudio(args),
495
+ imagePath: typeof args.imagePath === "string" && args.imagePath ? args.imagePath : undefined,
458
496
  };
459
497
  if ((0, bluebubbles_meta_guard_1.containsInternalMetaMarkers)(rawContent)) {
460
498
  (0, runtime_1.emitNervesEvent)({
@@ -482,7 +520,7 @@ exports.surfaceToolDefinition = {
482
520
  content: args.content ?? "",
483
521
  delegationId: args.delegationId,
484
522
  friendId: args.friendId,
485
- deliveryHint: deliveryHint.channel !== "auto" || deliveryHint.phoneNumber ? deliveryHint : undefined,
523
+ deliveryHint: deliveryHint.channel !== "auto" || deliveryHint.phoneNumber || deliveryHint.imagePath ? deliveryHint : undefined,
486
524
  queue,
487
525
  routeToFriend,
488
526
  advanceObligation: (obligationId, update) => {
@@ -87,6 +87,7 @@ const client_1 = require("./client");
87
87
  const chat_interaction_1 = require("../../heart/chat-interaction");
88
88
  const reactions_1 = require("./reactions");
89
89
  const send_file_1 = require("./send-file");
90
+ const chat_file_1 = require("../chat-file");
90
91
  const tools_chat_1 = require("../../repertoire/tools-chat");
91
92
  const host_account_verifier_1 = require("./host-account-verifier");
92
93
  const webhook_registration_1 = require("./webhook-registration");
@@ -4133,6 +4134,18 @@ async function watchForTimedOutProactiveSend(deps, client, friend, params, chat,
4133
4134
  message: "a proactive bluebubbles send that timed out never showed up in the chat",
4134
4135
  meta: { friendId: friend.id, sessionKey: params.sessionKey, checks: BLUEBUBBLES_PROACTIVE_ARRIVAL_CHECKS } });
4135
4136
  }
4137
+ /** An image to send off-turn, read before anything goes out so an unreadable one sends nothing. */
4138
+ async function readProactiveImage(client, imagePath) {
4139
+ if (!client.sendAttachment)
4140
+ return { unsendable: "this iMessage connection can't send files" };
4141
+ try {
4142
+ const file = await (0, chat_file_1.readChatFile)(imagePath, send_file_1.MAX_IMESSAGE_FILE_BYTES);
4143
+ return file.contentType.startsWith("image/") ? file : { unsendable: `${file.name} is not an image` };
4144
+ }
4145
+ catch (error) {
4146
+ return { unsendable: error.message };
4147
+ }
4148
+ }
4136
4149
  async function sendProactiveBlueBubblesMessageToSession(params, deps = {}) {
4137
4150
  if ((0, bluebubbles_meta_guard_1.containsInternalMetaMarkers)(params.text)) {
4138
4151
  (0, bluebubbles_meta_guard_1.emitBluebubblesMetaBlocked)({
@@ -4251,8 +4264,23 @@ async function sendProactiveBlueBubblesMessageToSession(params, deps = {}) {
4251
4264
  });
4252
4265
  return { delivered: false, reason: "internal_content_blocked" };
4253
4266
  }
4267
+ let image;
4268
+ if (params.imagePath) {
4269
+ const read = await readProactiveImage(client, params.imagePath);
4270
+ if ("unsendable" in read) {
4271
+ (0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.bluebubbles_proactive_image_refused",
4272
+ message: "proactive bluebubbles image not sent, so nothing was sent", meta: { friendId: params.friendId, sessionKey: params.sessionKey, why: read.unsendable } });
4273
+ return { delivered: false, reason: "image_unsendable", detail: read.unsendable };
4274
+ }
4275
+ image = read;
4276
+ }
4254
4277
  const sentAt = Date.now();
4278
+ let imageSent = false;
4255
4279
  try {
4280
+ if (image) {
4281
+ await client.sendAttachment({ chat, file: image });
4282
+ imageSent = true;
4283
+ }
4256
4284
  const sent = await client.sendText({ chat, text: params.text });
4257
4285
  (0, runtime_1.emitNervesEvent)({
4258
4286
  component: "senses",
@@ -4301,8 +4329,8 @@ async function sendProactiveBlueBubblesMessageToSession(params, deps = {}) {
4301
4329
  },
4302
4330
  });
4303
4331
  const refused = error instanceof client_1.BlueBubblesSendError && error.httpStatus !== null && error.httpStatus >= 400 && error.httpStatus < 500 && error.httpStatus !== 408 && error.httpStatus !== 409;
4304
- const mayHaveGoneOut = error instanceof client_1.BlueBubblesSendError && error.transportInvoked && !refused;
4305
- if (mayHaveGoneOut)
4332
+ const mayHaveGoneOut = imageSent || (error instanceof client_1.BlueBubblesSendError && error.transportInvoked && !refused);
4333
+ if (mayHaveGoneOut && !imageSent)
4306
4334
  void watchForTimedOutProactiveSend(resolvedDeps, client, friend, params, chat, sentAt);
4307
4335
  return { delivered: false, reason: "send_error", ...(mayHaveGoneOut ? { delivery: { state: "unknown" } } : {}) };
4308
4336
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1601",
3
+ "version": "0.1.0-alpha.1602",
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.1601",
9
+ "version": "0.1.0-alpha.1602",
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.1601",
3
+ "version": "0.1.0-alpha.1602",
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": {