@ouro.bot/cli 0.1.0-alpha.1710 → 0.1.0-alpha.1712

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,20 +1,44 @@
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.1712",
6
+ "changes": [
7
+ "Internal: the Butler's release gate now waits for an await's delivery, not just its archive, before it judges the two await cases. The Butler archives an await and then delivers its outcome. On 0.1.0-alpha.1704 the gate read the peer's outbox 57 ms before the delivery landed, and rolled back a release that had delivered. A delivery that never comes still fails the case, 30 s after the archive."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1711",
12
+ "changes": [
13
+ "Nobody is left on read. When an agent can't answer a chat message in one quick reply, it now sends a short ack in its own words before going heads down, then keeps the person posted. On iMessage, Teams and Telegram, once the person has waited 15 seconds with nothing from the agent (5 seconds on a voice call), the engine holds the agent's next work call until it speaks, and it holds again if 5 minutes pass without an update (45 seconds on voice). The agent writes every word; the engine only holds the work and says why. Quick replies, group chats, reactions and habit turns are left alone.",
14
+ "iMessage agents can speak mid-turn again. The `speak` tool was hidden on iMessage while its sense could send only one reply per turn; the sense has recorded each mid-turn message durably since mid-November, so agents now get it there too. After a mid-turn iMessage lands, the typing dots come back while the agent keeps working.",
15
+ "Every agent's guidance says the same: tell the person first, in a line that shows you understood, keep them posted on real progress, then deliver. On mail, which sends one reply per turn, the agent replies with what it's doing and sends the result when it's done."
16
+ ]
17
+ },
4
18
  {
5
19
  "version": "0.1.0-alpha.1710",
6
20
  "changes": [
7
- "Update the Ouro UI files to Ouro UI v1.3.637.",
8
21
  "Made a flaky sync test steadier (#2056): after a SIGTERM during push, \"no git child\" now waits for the whole process group to be gone, not only its leader, before asserting. No change to the shipped sync code."
9
22
  ]
10
23
  },
24
+ {
25
+ "version": "0.1.0-alpha.1709",
26
+ "changes": [
27
+ "Update the Ouro UI files to Ouro UI v1.3.637."
28
+ ]
29
+ },
11
30
  {
12
31
  "version": "0.1.0-alpha.1708",
13
32
  "changes": [
14
- "Internal: the release script's npm-wait tests that run an hour on a fake clock now have a 60 s timeout, so they no longer fail on a busy CI runner (#2053).",
15
33
  "iMessage no longer misses a message that iMessage delivers minutes after it was sent. Catch-up used to look only at messages sent in the last 90 seconds, so a late message that BlueBubbles sent no webhook for waited until the next outage to be found (8.5 minutes on 2026-11-27). Each 30-second catch-up now also reads the rows that reached the Messages database since the last one, by arrival order, so the agent gets such a message within about 30 seconds of it landing, and the log says how late iMessage delivered it. If that turn fails, the next catch-up reaches back to the message again, for up to a day."
16
34
  ]
17
35
  },
36
+ {
37
+ "version": "0.1.0-alpha.1707",
38
+ "changes": [
39
+ "Internal: the release script's npm-wait tests that run an hour on a fake clock now have a 60 s timeout, so they no longer fail on a busy CI runner (#2053)."
40
+ ]
41
+ },
18
42
  {
19
43
  "version": "0.1.0-alpha.1706",
20
44
  "changes": [
@@ -84,6 +84,12 @@ export const GATE_PLANTED_STRINGS = ["english subtitles", "ISOLATION-CANARY", "(
84
84
  export const DEFAULT_WINDOW_MINUTES = 85
85
85
  export const AWAIT_TIMEOUT_MS = 8 * 60 * 1000
86
86
  export const AWAIT_POLL_MS = 15 * 1000
87
+ /**
88
+ * How long a polled case keeps reading after its await is archived, for the delivery that follows it. The Butler archives
89
+ * the await, then delivers: alpha.1704's gate read the peer's outbox 57 ms before the delivery landed and failed a release
90
+ * that had delivered. A delivery that never comes still fails, after this grace instead of the whole poll timeout.
91
+ */
92
+ export const DELIVERY_GRACE_MS = 30 * 1000
87
93
  export const MESSAGE_TIMEOUT_MS = 330 * 1000
88
94
  // The Butler's A2A server cuts a request at five minutes while the turn itself keeps running. A send that errors after this
89
95
  // long was cut, not refused (a refusal answers at once), so the gate waits for the turn to finish before it reads anything back.
@@ -193,6 +199,13 @@ const check = (name, ok, detail = "") => ({ name, ok: Boolean(ok), ...(detail ?
193
199
  const sinkFor = (sink, friendId, predicate) => sink.filter((line) => line.friendId === friendId && predicate(line))
194
200
  const isDelegatedNotice = (line) => String(line.noticeId).startsWith("delegated:")
195
201
 
202
+ /** Sink lines present after that were not present before, by notice id and friend. */
203
+ export function newSinkLines(before, after) {
204
+ const key = (line) => `${line.friendId}|${line.noticeId}`
205
+ const known = new Set((before.sink ?? []).map(key))
206
+ return (after.sink ?? []).filter((line) => !known.has(key(line)))
207
+ }
208
+
196
209
  /** Outbox entry ids per friend that appeared between two observations. */
197
210
  export function newOutboxEntries(before, after) {
198
211
  const out = {}
@@ -587,6 +600,7 @@ export const CASES = [
587
600
  timeoutMs: AWAIT_TIMEOUT_MS,
588
601
  intervalMs: AWAIT_POLL_MS,
589
602
  until: ({ after, before, context }) => caseAwaitsSettled(before, after, context),
603
+ delivered: ({ after, before, friends }) => newSinkLines(before, after).some((line) => line.friendId === friends.principal && !isDelegatedNotice(line)),
590
604
  },
591
605
  readback: ({ before, after, sink, friends, context }) => {
592
606
  const { mine: filed, others } = caseAwaits(before, after, context)
@@ -870,6 +884,7 @@ export const CASES = [
870
884
  timeoutMs: AWAIT_TIMEOUT_MS,
871
885
  intervalMs: AWAIT_POLL_MS,
872
886
  until: ({ after, before, context }) => caseAwaitsSettled(before, after, context),
887
+ delivered: ({ after, before, friends }) => (newOutboxEntries(before, after)[friends.principal] ?? []).length > 0,
873
888
  },
874
889
  readback: ({ before, after, sink, friends, context }) => {
875
890
  const { mine: filed, others } = caseAwaits(before, after, context)
@@ -995,7 +1010,14 @@ export async function runCase(host, testCase, { plant, deadline = Infinity } = {
995
1010
  let after = await host.observe()
996
1011
  if (testCase.poll) {
997
1012
  const deadline = host.now() + testCase.poll.timeoutMs
998
- while (!testCase.poll.until({ before, after, context }) && host.now() < deadline) {
1013
+ let settledAt = null
1014
+ while (host.now() < deadline) {
1015
+ if (testCase.poll.until({ before, after, context })) {
1016
+ // Settled is not delivered: the delivery lands just after the archive, so wait for it, but only for the grace.
1017
+ if (!testCase.poll.delivered || testCase.poll.delivered({ before, after, context, friends: host.friends })) break
1018
+ settledAt ??= host.now()
1019
+ if (host.now() - settledAt >= DELIVERY_GRACE_MS) break
1020
+ }
999
1021
  await host.sleep(testCase.poll.intervalMs)
1000
1022
  after = await host.observe()
1001
1023
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1710",
2
+ "runtimeVersion": "0.1.0-alpha.1712",
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.1710</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1712</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -37,6 +37,7 @@ const skill_summaries_1 = require("../repertoire/skill-summaries");
37
37
  const tools_1 = require("../repertoire/tools");
38
38
  const tools_base_1 = require("../repertoire/tools-base");
39
39
  const tools_flow_1 = require("../repertoire/tools-flow");
40
+ const keep_in_touch_1 = require("./keep-in-touch");
40
41
  const tool_images_1 = require("./tool-images");
41
42
  const tool_arguments_1 = require("../repertoire/tool-arguments");
42
43
  const session_events_1 = require("./session-events");
@@ -568,11 +569,10 @@ async function habitToolBatchBlockReason(habitSession, toolCalls, delegatedOrigi
568
569
  }
569
570
  return null;
570
571
  }
571
- /** Channels that deliberately support mid-turn delivery expose `speak`.
572
- * BlueBubbles is final-only: its adapter owns one accepted visibility boundary.
572
+ /** Channels whose sense delivers `speak` mid-turn (see `offersMidTurnSpeech`).
573
573
  * The private runtime has `ponder`; MCP returns synchronously; mail is batch. */
574
574
  function isChatStyleChannel(channel) {
575
- return (0, friends_1.getChannelCapabilities)(channel).chatStyle;
575
+ return (0, keep_in_touch_1.offersMidTurnSpeech)((0, friends_1.getChannelCapabilities)(channel));
576
576
  }
577
577
  function bindCurrentIngressEvidenceLocator(toolList, evidence) {
578
578
  if (!evidence
@@ -1239,6 +1239,10 @@ async function runCountedTurn(turnTally, messages, callbacks, channel, signal, o
1239
1239
  const provider = providerRuntime.id;
1240
1240
  const toolChoiceRequired = options?.hardDisableTools ? false : options?.toolChoiceRequired ?? true;
1241
1241
  const traceId = options?.traceId;
1242
+ const turnStartedAt = Date.now();
1243
+ // Null where nobody is waiting on a reply.
1244
+ let keepInTouch = null;
1245
+ let keepInTouchBuilt = false;
1242
1246
  (0, runtime_1.emitNervesEvent)({
1243
1247
  event: "engine.turn_start",
1244
1248
  trace_id: traceId,
@@ -2607,6 +2611,28 @@ async function runCountedTurn(turnTally, messages, callbacks, channel, signal, o
2607
2611
  done = true;
2608
2612
  continue;
2609
2613
  }
2614
+ // Built at the first batch that offers speak: a step narrowed to other tools (a forced retry) waits for a later one.
2615
+ if (!keepInTouchBuilt && activeToolNames.has("speak")) {
2616
+ keepInTouchBuilt = true;
2617
+ const turnContext = augmentedToolContext;
2618
+ keepInTouch = (0, keep_in_touch_1.createKeepInTouch)({
2619
+ channel,
2620
+ speakOffered: true,
2621
+ answersAPerson: !isPrivateRuntimeChannel && !turnContext.noSend && !habitSession && !turnContext.autonomousTurnKind
2622
+ && !options?.isReactionSignal && !turnContext.context?.isGroupChat,
2623
+ startedAt: turnStartedAt,
2624
+ });
2625
+ }
2626
+ const keepInTouchHold = keepInTouch?.hold(result.toolCalls.map((call) => call.name)) ?? null;
2627
+ if (keepInTouchHold) {
2628
+ // The person has waited long enough: nothing runs until the agent tells them something in its own words.
2629
+ streamCallbackBuffer?.discard();
2630
+ const reason = keepInTouchHold.kind === "ack"
2631
+ ? tools_flow_1.FLOW_TOOL_REFUSALS.speakFirstAck(Math.round(keepInTouchHold.quietMs / 1000))
2632
+ : tools_flow_1.FLOW_TOOL_REFUSALS.speakFirstUpdate(Math.round(keepInTouchHold.quietMs / 60_000));
2633
+ rejectToolBatch(msg, result.toolCalls.map(() => reason));
2634
+ continue;
2635
+ }
2610
2636
  const requiredDispatchRejections = new Map();
2611
2637
  for (const entry of validCalls) {
2612
2638
  const requiredArgs = entry.validated.arguments;
@@ -2802,6 +2828,9 @@ async function runCountedTurn(turnTally, messages, callbacks, channel, signal, o
2802
2828
  continue;
2803
2829
  }
2804
2830
  callbacks.onToolDispatch?.("speak");
2831
+ // A sense that can't stream holds the model's narration unsent (settle clears it); keep it out of the speak.
2832
+ if (channel && !(0, friends_1.getChannelCapabilities)(channel).supportsStreaming)
2833
+ callbacks.onClearText?.();
2805
2834
  callbacks.onTextChunk(speakMessage);
2806
2835
  let speakDeliveryError = null;
2807
2836
  try {
@@ -2811,6 +2840,7 @@ async function runCountedTurn(turnTally, messages, callbacks, channel, signal, o
2811
2840
  speakDeliveryError = err instanceof Error ? err : new Error(String(err));
2812
2841
  }
2813
2842
  if (speakDeliveryError) {
2843
+ keepInTouch?.undeliverable();
2814
2844
  callbacks.onToolEnd("speak", argSummary, false);
2815
2845
  const failMsg = withBudgetNote(tools_flow_1.FLOW_TOOL_REFUSALS.speakNotDelivered(speakDeliveryError.message), isLastCall(tc), candidateToolNames);
2816
2846
  pushGenerated({ role: "tool", tool_call_id: tc.id, content: failMsg });
@@ -2824,6 +2854,7 @@ async function runCountedTurn(turnTally, messages, callbacks, channel, signal, o
2824
2854
  });
2825
2855
  continue;
2826
2856
  }
2857
+ keepInTouch?.spoke();
2827
2858
  callbacks.onToolEnd("speak", argSummary, true);
2828
2859
  const ack = withBudgetNote("(spoken)", isLastCall(tc), candidateToolNames);
2829
2860
  pushGenerated({ role: "tool", tool_call_id: tc.id, content: ack });
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KEEP_IN_TOUCH_MAX_HOLDS = exports.KEEP_IN_TOUCH_TIMING = void 0;
4
+ exports.offersMidTurnSpeech = offersMidTurnSpeech;
5
+ exports.createKeepInTouch = createKeepInTouch;
6
+ const runtime_1 = require("../nerves/runtime");
7
+ /**
8
+ * Chats that get the guarantee. The CLI is left out because its terminal shows each tool as it runs; mail, A2A and
9
+ * MCP can't speak mid-turn, so their guidance is in the prompt only.
10
+ */
11
+ exports.KEEP_IN_TOUCH_TIMING = Object.freeze({
12
+ bluebubbles: Object.freeze({ ackAfterMs: 15_000, updateEveryMs: 5 * 60_000 }),
13
+ teams: Object.freeze({ ackAfterMs: 15_000, updateEveryMs: 5 * 60_000 }),
14
+ telegram: Object.freeze({ ackAfterMs: 15_000, updateEveryMs: 5 * 60_000 }),
15
+ voice: Object.freeze({ ackAfterMs: 5_000, updateEveryMs: 45_000 }),
16
+ });
17
+ /** After this many holds in a row the engine lets the work through, so a model that won't speak can't stall a turn. */
18
+ exports.KEEP_IN_TOUCH_MAX_HOLDS = 2;
19
+ /** Turn tools the person isn't waiting on: they end the turn, speak, think privately or load a door. */
20
+ const NOT_WORK = new Set(["settle", "observe", "rest", "speak", "ponder", "surface", "find_tools"]);
21
+ /**
22
+ * Whether the channel's sense delivers `speak` mid-turn. The Friends package still marks iMessage `chatStyle: false`
23
+ * from when its adapter took one reply per turn; since the adapter records each mid-turn send durably, it speaks too.
24
+ */
25
+ function offersMidTurnSpeech(capabilities) {
26
+ return capabilities?.chatStyle === true || capabilities?.channel === "bluebubbles";
27
+ }
28
+ function createKeepInTouch(input) {
29
+ const timing = input.channel ? exports.KEEP_IN_TOUCH_TIMING[input.channel] : undefined;
30
+ if (!timing || !input.speakOffered || !input.answersAPerson)
31
+ return null;
32
+ const now = input.now ?? Date.now;
33
+ let lastSpokeAt = null;
34
+ let holdsInARow = 0;
35
+ let off = false;
36
+ return {
37
+ hold(callNames) {
38
+ if (off)
39
+ return null;
40
+ const firstWork = callNames.findIndex((name) => !NOT_WORK.has(name));
41
+ if (firstWork === -1)
42
+ return null;
43
+ const firstSpeak = callNames.indexOf("speak");
44
+ if (firstSpeak !== -1 && firstSpeak < firstWork)
45
+ return null;
46
+ const quietMs = now() - (lastSpokeAt ?? input.startedAt);
47
+ const kind = lastSpokeAt === null ? "ack" : "update";
48
+ if (quietMs < (kind === "ack" ? timing.ackAfterMs : timing.updateEveryMs))
49
+ return null;
50
+ if (holdsInARow >= exports.KEEP_IN_TOUCH_MAX_HOLDS) {
51
+ off = true;
52
+ (0, runtime_1.emitNervesEvent)({
53
+ level: "warn", component: "engine", event: "engine.keep_in_touch_released",
54
+ message: "work let through after repeated holds without a speak",
55
+ meta: { channel: input.channel, kind, quietMs, holds: holdsInARow },
56
+ });
57
+ return null;
58
+ }
59
+ holdsInARow += 1;
60
+ (0, runtime_1.emitNervesEvent)({
61
+ component: "engine", event: "engine.keep_in_touch_held",
62
+ message: "work held until the agent tells the person something",
63
+ meta: { channel: input.channel, kind, quietMs },
64
+ });
65
+ return { kind, quietMs };
66
+ },
67
+ spoke() {
68
+ lastSpokeAt = now();
69
+ holdsInARow = 0;
70
+ },
71
+ undeliverable() {
72
+ off = true;
73
+ },
74
+ };
75
+ }
@@ -96,6 +96,7 @@ const store_1 = require("../senses/app-sessions/store");
96
96
  const store_2 = require("../trips/store");
97
97
  const orientation_frame_1 = require("../heart/orientation-frame");
98
98
  const flight_recorder_1 = require("../arc/flight-recorder");
99
+ const keep_in_touch_1 = require("../heart/keep-in-touch");
99
100
  function flattenSystemPrompt(sp) {
100
101
  const parts = [sp.stable, sp.volatile].filter(Boolean);
101
102
  return parts.join("\n\n");
@@ -741,7 +742,7 @@ function toolBehaviorSection(channel, options) {
741
742
  lines.push(`- \`settle\` follows the last real tool call, with no no-op call before it.`);
742
743
  lines.push(`- when told to work autonomously, I use ponder to absorb new messages and continue using tools. I settle only with the final result.`);
743
744
  lines.push(`- In an active browser, tool, or task flow, process feedback from the user is loop input, not a stop signal. I absorb it and keep working unless it asks a direct blocking question, changes scope, asks me to stop or pause, requires confirmation, or exposes a real blocker.`);
744
- lines.push(`- For a short mid-flow acknowledgement, I call \`speak\` once when that tool is available, then continue with tools.`);
745
+ lines.push(`- When \`speak\` is available and I can't answer in one quick reply, my first batch opens with a \`speak\` ack, then my work calls.`);
745
746
  lines.push(`- if nothing calls for words, I observe.`);
746
747
  if (channel === "voice") {
747
748
  lines.push(`- voice is synchronous: I keep \`speak\` and \`settle\` short, plain, and fast. If I need a tool, I first call \`speak\` with a tiny status line, then call the tool, then \`settle\` with the shortest useful answer. If the caller interrupts, I acknowledge the interruption and answer the newest thing first.`);
@@ -1160,6 +1161,14 @@ when i notice meaningful friction in my own harness, i pin it first and keep the
1160
1161
 
1161
1162
  identity, voice, provider config, outbound messages, and hosted infrastructure require reviewer-gated authority. credential mutation remains human-required. desk is the cockpit and mirror, not runtime authority; runtime truth lives in the evolution case and trace. no direct-to-main, no invisible self-modification, no claiming verification i did not personally perform.`;
1162
1163
  }
1164
+ /** The engine's ack bound, stated where the agent learns the habit, so it acks first instead of being held. */
1165
+ function keepInTouchLine(channel) {
1166
+ const timing = keep_in_touch_1.KEEP_IN_TOUCH_TIMING[channel];
1167
+ if (!timing)
1168
+ return [];
1169
+ const update = timing.updateEveryMs >= 60_000 ? `${timing.updateEveryMs / 60_000} minutes` : `${timing.updateEveryMs / 1000} seconds`;
1170
+ return [`- in a one-to-one chat, if they've had nothing from me for ${timing.ackAfterMs / 1000} seconds, or for ${update} since my last word, the engine holds my next work call until i speak (code: speak-first).`];
1171
+ }
1163
1172
  function speakSopsSection(channel) {
1164
1173
  const isChatStyle = channel === "cli" || channel === "teams" || channel === "bluebubbles" || channel === "voice";
1165
1174
  if (!isChatStyle)
@@ -1167,7 +1176,8 @@ function speakSopsSection(channel) {
1167
1176
  return [
1168
1177
  "## speaking mid-turn",
1169
1178
  "",
1170
- "`speak` sends words to my friend without ending my turn. if my next step depends on a reply, i settle; otherwise i speak, at phase boundaries during heavy work (after acking a heavy ask, hitting a major constraint, before switching strategy or a long externally-visible step), not per tool call. speak is progress, not invitation: if i need steering, i settle.",
1179
+ "`speak` sends words to my friend without ending my turn. nobody waits on me in silence. when i can't answer in one quick reply, my first batch opens with a speak, then my first work call: a short ack in my own voice that shows i got the ask and says what i'm doing first (\"pulling up your imbox to see what's left\", not a stock \"on it!\"). then i speak at phase boundaries during heavy work: a finding, a finished step, a snag, a change of plan, not one per tool call. if my next step depends on a reply, i settle. speak is progress, not invitation: if i need steering, i settle.",
1180
+ ...keepInTouchLine(channel),
1171
1181
  ...(channel === "voice"
1172
1182
  ? [
1173
1183
  "- in voice, i keep spoken updates brief and natural. before tool work that may take more than a moment, i say a tiny bridge line.",
@@ -1180,6 +1190,8 @@ exports.TALKING_WITH_PEOPLE_GUIDANCE = `## talking with people
1180
1190
 
1181
1191
  my voice is the one in my identity, in every chat, however much formal text i've been reading. reports, task cards, changelogs, notices and agent intake are written in report-speak; that register belongs on formal surfaces (PRs, task cards, docs, emails to strangers, handoffs between agents), and i don't carry it into chat: no bolded headers or status sections in a chat reply. a notice or tool output isn't the body of my reply; my own words come first.
1182
1192
 
1193
+ nobody is left on read. when a message needs more than one quick reply, i tell them first, in a line that shows i understood, then keep them posted on real progress, then deliver. on chats i do that with speak. where a sense sends one reply per turn, like mail, i don't make the reply wait on long work: i reply with what i'm doing, and send the result when it's done.
1194
+
1183
1195
  i ask a person only for what needs their body: a number or prompt to approve on their own phone, their card, an irreversible call that's theirs, or the vault's unlock secret. i have standing authority, so the rest is mine: sign-ins with the password from my vault, codes in their mail, prompts, terminals and machines, which they're usually nowhere near. before i pass on "you need to sign in" i check it (\`gh auth status\` for gh) and drop it if it's false, and an agent that hands me an ask that isn't the person's gets it back: do it yourself, you have standing authority. i collect those asks and send them together with the next message i'm already sending, so they can do them in one sitting, rather than one at a time or held for a clock window. an item marked now goes out at once. when something they can try lands, i tell them "Ready: <what>, at <where>" as soon as it lands. when other agents hand me items for a person, a repeat with the same dedupe key and the same ask is dropped; the same key with a changed ask replaces the old one and goes on as new.`;
1184
1196
  function contextSection(context, options) {
1185
1197
  if (!context)
@@ -92,7 +92,7 @@ exports.speakTool = {
92
92
  type: "function",
93
93
  function: {
94
94
  name: "speak",
95
- description: "i speak to send words to my friend mid-turn without ending it. for progress, acknowledgment, or phase-boundary updates during heavy work. after speaking, continue with tools unless the next step needs a reply. i settle when my work is done or i need a reply.",
95
+ description: "i speak to send words to my friend mid-turn without ending it. when i can't answer in one quick reply, my first move is a speak: a short ack that shows i got the ask and says what i'm doing first, in the same batch as my first work call. while i work, i speak again when something real changes. after speaking, continue with tools unless the next step needs a reply. i settle when my work is done or i need a reply.",
96
96
  parameters: {
97
97
  type: "object",
98
98
  properties: {
@@ -140,6 +140,8 @@ exports.FLOW_TOOL_REFUSALS = {
140
140
  restSurfaceNotSent: (surfaceResult) => (0, tool_error_code_1.withCode)(`your surface this turn did not reach them: ${surfaceResult.replace(/ \(code: [a-z0-9-]+\)$/u, "").replace(/\.$/u, "")}. reach them another way now if the result names one, or rest again and it waits for their next message.`, "surface-not-sent"),
141
141
  speakEmpty: (0, tool_error_code_1.withCode)("speak requires a non-empty `message` string.", "empty-message"),
142
142
  speakNotDelivered: (detail) => (0, tool_error_code_1.withCode)(`speak delivery failed: ${detail}. the message did not reach your friend; do not assume they saw it.`, "speak-not-delivered"),
143
+ speakFirstAck: (quietSeconds) => (0, tool_error_code_1.withCode)(`held: they've had nothing from you for ${quietSeconds}s, so nothing in this batch ran. before more work, speak: a short note in your own voice that shows you got what they asked and says what you're doing first. no stock "on it", no times you can't keep. then make these calls again: after the speak in one batch, or on their own next if one must be the only call.`, "speak-first"),
144
+ speakFirstUpdate: (quietMinutes) => (0, tool_error_code_1.withCode)(`held: your last word to them was ${quietMinutes} min ago and you're still working, so nothing in this batch ran. speak first with real progress in your own voice: what you've found or finished since, and what's next. then make these calls again: after the speak in one batch, or on their own next if one must be the only call.`, "speak-first"),
143
145
  ponderCreateIncomplete: (0, tool_error_code_1.withCode)("ponder create requires kind, objective, success_criteria, and valid payload_json.", "ponder-fields-missing"),
144
146
  ponderReviseIncomplete: (0, tool_error_code_1.withCode)("ponder revise requires packet_id, kind, objective, success_criteria, and valid payload_json.", "ponder-fields-missing"),
145
147
  ponderHeldWork: (0, tool_error_code_1.withCode)("private runtime already has held return work in the attention queue; surface the existing delegationId instead of creating a replacement ponder packet.", "held-work-unsurfaced"),
@@ -155,6 +157,7 @@ exports.toolCards = [
155
157
  { id: "tool:speak", group: "turn-flow", when: "Pick this to tell the person something now, like progress on long work, while you keep working; settle gives the final answer.", effect: "write", errors: [
156
158
  { code: "empty-message", means: "The message was empty, so nothing was sent.", fix: "Call speak again with the words you mean to send." },
157
159
  { code: "speak-not-delivered", means: "The channel failed to deliver the message, so the person has not seen it.", fix: "Say it again in your settle answer, or retry speak once if the failure looks brief." },
160
+ { code: "speak-first", means: "In a one-to-one chat the person waited past the bound (15 s for a first word, 5 min since the last; voice 5 s and 45 s) with no word, so nothing in the batch ran.", fix: "Speak first: an ack that shows you understood, or real progress. Then repeat the held calls after it, or alone next if one must be the only call." },
158
161
  ] },
159
162
  { id: "tool:observe", group: "turn-flow", when: "Pick this in a group chat or passing moment where a reply would add nothing, to end the turn and stay quiet.", effect: "write", errors: [
160
163
  { code: "observe-alone", means: "observe came in one batch with other tool calls, so nothing in the batch ran.", fix: "Make the other calls first, read their results, then call observe on its own, or settle if you do mean to reply." },
@@ -41,6 +41,7 @@ const tools_voice_1 = require("./tools-voice");
41
41
  const shell_sessions_1 = require("./shell-sessions");
42
42
  const tools_unraid_1 = require("./tools-unraid");
43
43
  const tools_flow_1 = require("./tools-flow");
44
+ const keep_in_touch_1 = require("../heart/keep-in-touch");
44
45
  const tools_steward_policy_1 = require("./tools-steward-policy");
45
46
  const tools_house_care_1 = require("./tools-house-care");
46
47
  const tools_shepherd_1 = require("./tools-shepherd");
@@ -263,7 +264,7 @@ function selectToolsForChannel(capabilities, toolPreferences, _context, provider
263
264
  const engine = [
264
265
  ...(context?.noSend ? [] : [tools_flow_1.ponderTool]),
265
266
  ...(inner ? [tools_flow_1.restTool] : [tools_flow_1.observeTool, offersCheckBack ? exports.settleCheckBackTool : tools_flow_1.settleTool]),
266
- ...(capabilities?.chatStyle ? [tools_flow_1.speakTool] : []),
267
+ ...((0, keep_in_touch_1.offersMidTurnSpeech)(capabilities) ? [tools_flow_1.speakTool] : []),
267
268
  ].filter((tool) => (!sanctuary || (knownSanctuaryProfile && tool.function.name !== "observe"))
268
269
  && (!relationship || relationship.advertisedToolNames.includes(tool.function.name))
269
270
  && (!context?.allowedEngineTools || context.allowedEngineTools.includes(tool.function.name)));
@@ -1297,8 +1297,11 @@ function createBlueBubblesCallbacks(client, chat, replyTarget, isGroupChat, onVi
1297
1297
  acceptedAt,
1298
1298
  ...(speakResponse?.messageGuid ? { messageGuid: speakResponse.messageGuid } : {}),
1299
1299
  }));
1300
- // Note: do NOT call client.setTyping(chat, false) here — the agent is
1301
- // still mid-turn, so the typing indicator stays ACTIVE.
1300
+ // The agent is still mid-turn, so typing stays on. iMessage clears the dots when a message lands, so a one-to-one
1301
+ // chat gets them back: the person sees the agent is still working after its ack.
1302
+ if (typingActive && !isGroupChat) {
1303
+ enqueue("typing_resume", async (signal) => { await client.setTyping(chat, true, signal); });
1304
+ }
1302
1305
  (0, runtime_1.emitNervesEvent)({
1303
1306
  component: "senses",
1304
1307
  event: "bluebubbles.speak_flush",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1710",
3
+ "version": "0.1.0-alpha.1712",
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.1710",
9
+ "version": "0.1.0-alpha.1712",
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.1710",
3
+ "version": "0.1.0-alpha.1712",
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": {