@ouro.bot/cli 0.1.0-alpha.1340 → 0.1.0-alpha.1343

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": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1343",
6
+ "changes": [
7
+ "settle, speak, observe, rest and ponder have Ouro AX cards in a new turn-flow group, and the engine's refusals for them end with a code their cards name."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1342",
12
+ "changes": [
13
+ "The Butler's replay gate takes another timed turn when a post-turn commit was skipped because another sync held the lock, instead of failing sync-latency on that one turn."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1340",
6
18
  "changes": [
@@ -1137,7 +1137,9 @@ export function syncIntervals(events) {
1137
1137
  const end = sorted.findIndex((event, index) => index > start && ends.includes(event.event))
1138
1138
  if (end < 0) return { ms: null, problem: `no end was logged after ${startName}`, next: start + 1 }
1139
1139
  const ended = sorted[end].event
1140
- return ended === ends[0] ? { ms: sorted[end].at - sorted[start].at, next: end + 1 } : { ms: null, problem: `it ended with ${ended}`, next: end + 1 }
1140
+ if (ended === ends[0]) return { ms: sorted[end].at - sorted[start].at, next: end + 1 }
1141
+ // A post-turn push_end straight after push_start is the commit skipped for a busy sync lock: nothing was timed.
1142
+ return { ms: null, problem: `it ended with ${ended}`, ...(startName === "heart.sync_push_start" && ended === "heart.sync_push_end" ? { skipped: true } : {}), next: end + 1 }
1141
1143
  }
1142
1144
  const pull = span("heart.sync_pull_start", PULL_ENDS, 0)
1143
1145
  const commit = span("heart.sync_push_start", COMMIT_ENDS, pull.next)
@@ -1175,12 +1177,16 @@ export async function syncLatencyResult(host) {
1175
1177
  if (timed.error) return { id: "sync-latency", status: "fail", checks: [check("the read-only turn answered", false, timed.error)] }
1176
1178
  turns.push(timed.intervals)
1177
1179
  const first = turns[0]
1178
- if (!first.complete || (fast(first.pull) && fast(first.commit))) break
1180
+ if (first.complete && fast(first.pull) && fast(first.commit)) break
1181
+ // A turn whose commit was skipped for a busy lock times nothing, so another turn is taken; any other gap fails now.
1182
+ if (!timed.intervals.complete && !timed.intervals.commit.skipped) break
1179
1183
  }
1180
1184
  const median = (key) => {
1181
- const spans = turns.map((intervals) => intervals[key])
1185
+ const all = turns.map((intervals) => intervals[key])
1186
+ // Skipped commits are left out; when every turn's commit was skipped, that is the result.
1187
+ const spans = all.some((span) => !span.skipped) ? all.filter((span) => !span.skipped) : all
1182
1188
  const missing = spans.find((span) => span.ms === null)
1183
- if (missing) return missing
1189
+ if (missing) return missing.skipped ? { ...missing, problem: `every turn's commit was skipped while another sync held the lock (${missing.problem})` } : missing
1184
1190
  const ms = spans.map((span) => span.ms).sort((a, b) => a - b)
1185
1191
  return { ms: ms[Math.floor(ms.length / 2)], detail: ms.length > 1 ? `median ${ms[Math.floor(ms.length / 2)]} ms of ${ms.join(", ")} ms` : `${ms[0]} ms` }
1186
1192
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1340",
2
+ "runtimeVersion": "0.1.0-alpha.1343",
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.1340</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1343</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -30,6 +30,7 @@ const reply_style_1 = require("./reply-style");
30
30
  const deferred_tools_1 = require("../repertoire/deferred-tools");
31
31
  const tools_1 = require("../repertoire/tools");
32
32
  const tools_base_1 = require("../repertoire/tools-base");
33
+ const tools_flow_1 = require("../repertoire/tools-flow");
33
34
  const tool_images_1 = require("./tool-images");
34
35
  const tool_arguments_1 = require("../repertoire/tool-arguments");
35
36
  const session_events_1 = require("./session-events");
@@ -536,9 +537,9 @@ function bindCurrentIngressEvidenceLocator(toolList, evidence) {
536
537
  // Sole-call tools must be the only tool call in a turn. When they appear
537
538
  // alongside other tools, the sole-call tool is rejected with this message.
538
539
  const SOLE_CALL_REJECTION = {
539
- settle: "rejected: settle must be the only tool call. finish your work first, then call settle alone.",
540
- observe: "rejected: observe must be the only tool call. call observe alone when you want to stay silent.",
541
- rest: "rejected: rest must be the only tool call. finish your work first, then call rest alone.",
540
+ settle: tools_flow_1.FLOW_TOOL_REFUSALS.settleAlone,
541
+ observe: tools_flow_1.FLOW_TOOL_REFUSALS.observeAlone,
542
+ rest: tools_flow_1.FLOW_TOOL_REFUSALS.restAlone,
542
543
  };
543
544
  function parseSettlePayload(argumentsText) {
544
545
  const parsed = JSON.parse(argumentsText);
@@ -2199,7 +2200,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2199
2200
  streamCallbackBuffer?.discard();
2200
2201
  callbacks.onToolEnd("settle", (0, tools_1.summarizeArgs)("settle", settleArgs, toolSelection), false);
2201
2202
  callbacks.onClearText?.();
2202
- const gateMessage = "current held-work frame still has unsurfaced items — return each listed item with surface(delegationId=...) before you settle. Older transcript claims are historical; only the current held-work frame is the gate.";
2203
+ const gateMessage = tools_flow_1.FLOW_TOOL_REFUSALS.settleHeldWork;
2203
2204
  rejectToolBatch(msg, [gateMessage]);
2204
2205
  continue;
2205
2206
  }
@@ -2332,14 +2333,14 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2332
2333
  const attentionQueue = augmentedToolContext?.delegatedOrigins;
2333
2334
  if (!wrappingUp && attentionQueue && attentionQueue.length > 0) {
2334
2335
  callbacks.onToolEnd("rest", (0, tools_1.summarizeArgs)("rest", restArgs, toolSelection), false);
2335
- const gateMessage = "current held-work frame still has unsurfaced items — return each listed item with surface(delegationId=...) before you rest. Older transcript claims are historical; only the current held-work frame is the gate.";
2336
+ const gateMessage = tools_flow_1.FLOW_TOOL_REFUSALS.restHeldWork;
2336
2337
  rejectToolBatch(msg, [gateMessage]);
2337
2338
  continue;
2338
2339
  }
2339
2340
  if (!wrappingUp && hasFreshPendingWork(options) && !freshWorkGateFired) {
2340
2341
  freshWorkGateFired = true;
2341
2342
  callbacks.onToolEnd("rest", (0, tools_1.summarizeArgs)("rest", restArgs, toolSelection), false);
2342
- const gateMessage = "fresh work arrived for me this turn — inspect the pending messages above and take the next concrete action before you rest.";
2343
+ const gateMessage = tools_flow_1.FLOW_TOOL_REFUSALS.restFreshWork;
2343
2344
  rejectToolBatch(msg, [gateMessage]);
2344
2345
  (0, runtime_1.emitNervesEvent)({
2345
2346
  level: "info",
@@ -2539,7 +2540,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2539
2540
  const argSummary = (0, tools_1.summarizeArgs)("speak", { message: speakMessage }, toolSelection);
2540
2541
  callbacks.onToolStart("speak", { message: speakMessage });
2541
2542
  if (speakMessage.trim().length === 0) {
2542
- const err = "speak requires a non-empty `message` string.";
2543
+ const err = tools_flow_1.FLOW_TOOL_REFUSALS.speakEmpty;
2543
2544
  callbacks.onToolEnd("speak", argSummary, false);
2544
2545
  pushGenerated({ role: "tool", tool_call_id: tc.id, content: err });
2545
2546
  providerRuntime.appendToolOutput(tc.id, err);
@@ -2562,7 +2563,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2562
2563
  }
2563
2564
  if (speakDeliveryError) {
2564
2565
  callbacks.onToolEnd("speak", argSummary, false);
2565
- const failMsg = `speak delivery failed: ${speakDeliveryError.message}. the message did not reach your friend; do not assume they saw it.`;
2566
+ const failMsg = tools_flow_1.FLOW_TOOL_REFUSALS.speakNotDelivered(speakDeliveryError.message);
2566
2567
  pushGenerated({ role: "tool", tool_call_id: tc.id, content: failMsg });
2567
2568
  providerRuntime.appendToolOutput(tc.id, failMsg);
2568
2569
  (0, runtime_1.emitNervesEvent)({
@@ -2609,7 +2610,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2609
2610
  let privateReturnSourceRequest = "";
2610
2611
  if (action === "create") {
2611
2612
  if (isInnerChannel && attentionQueue.length > 0) {
2612
- throw new Error("private runtime already has held return work in the attention queue; surface the existing delegationId instead of creating a replacement ponder packet.");
2613
+ throw new Error(tools_flow_1.FLOW_TOOL_REFUSALS.ponderHeldWork);
2613
2614
  }
2614
2615
  const kind = parsedArgs.kind;
2615
2616
  const objective = typeof parsedArgs.objective === "string" ? parsedArgs.objective.trim() : "";
@@ -2617,7 +2618,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2617
2618
  const sourceRequest = currentOrigin && !isInnerChannel ? latestUserMessageText(messages) : "";
2618
2619
  privateReturnSourceRequest = sourceRequest;
2619
2620
  if (!kind || !objective || !successCriteria || !payload) {
2620
- throw new Error("ponder create requires kind, objective, success_criteria, and valid payload_json.");
2621
+ throw new Error(tools_flow_1.FLOW_TOOL_REFUSALS.ponderCreateIncomplete);
2621
2622
  }
2622
2623
  const packetPayload = sourceRequest
2623
2624
  ? { ...payload, sourceRequest }
@@ -2697,7 +2698,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2697
2698
  const objective = typeof parsedArgs.objective === "string" ? parsedArgs.objective.trim() : "";
2698
2699
  const summary = typeof parsedArgs.summary === "string" ? parsedArgs.summary.trim() : "";
2699
2700
  if (!packetId || !kind || !objective || !successCriteria || !payload) {
2700
- throw new Error("ponder revise requires packet_id, kind, objective, success_criteria, and valid payload_json.");
2701
+ throw new Error(tools_flow_1.FLOW_TOOL_REFUSALS.ponderReviseIncomplete);
2701
2702
  }
2702
2703
  packet = (0, packets_1.revisePonderPacket)((0, identity_2.getAgentRoot)(), packetId, {
2703
2704
  kind,
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.restTool = exports.speakTool = exports.settleTool = exports.observeTool = exports.ponderTool = void 0;
3
+ exports.toolCards = exports.FLOW_TOOL_REFUSALS = exports.restTool = exports.speakTool = exports.settleTool = exports.observeTool = exports.ponderTool = void 0;
4
+ const tool_error_code_1 = require("./tool-error-code");
4
5
  exports.ponderTool = {
5
6
  type: "function",
6
7
  function: {
@@ -117,3 +118,42 @@ exports.restTool = {
117
118
  },
118
119
  },
119
120
  };
121
+ /**
122
+ * The engine's refusals for the flow tools above, which it handles itself rather than through a definition's handler.
123
+ * Each ends with the code its card below names; they live here so the census finds each code beside its tool.
124
+ */
125
+ exports.FLOW_TOOL_REFUSALS = {
126
+ settleAlone: (0, tool_error_code_1.withCode)("rejected: settle must be the only tool call. finish your work first, then call settle alone.", "settle-alone"),
127
+ observeAlone: (0, tool_error_code_1.withCode)("rejected: observe must be the only tool call. call observe alone when you want to stay silent.", "observe-alone"),
128
+ restAlone: (0, tool_error_code_1.withCode)("rejected: rest must be the only tool call. finish your work first, then call rest alone.", "rest-alone"),
129
+ settleHeldWork: (0, tool_error_code_1.withCode)("current held-work frame still has unsurfaced items — return each listed item with surface(delegationId=...) before you settle. Older transcript claims are historical; only the current held-work frame is the gate.", "held-work-unsurfaced"),
130
+ restHeldWork: (0, tool_error_code_1.withCode)("current held-work frame still has unsurfaced items — return each listed item with surface(delegationId=...) before you rest. Older transcript claims are historical; only the current held-work frame is the gate.", "held-work-unsurfaced"),
131
+ restFreshWork: (0, tool_error_code_1.withCode)("fresh work arrived for me this turn — inspect the pending messages above and take the next concrete action before you rest.", "fresh-work-pending"),
132
+ speakEmpty: (0, tool_error_code_1.withCode)("speak requires a non-empty `message` string.", "empty-message"),
133
+ 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"),
134
+ ponderCreateIncomplete: (0, tool_error_code_1.withCode)("ponder create requires kind, objective, success_criteria, and valid payload_json.", "ponder-fields-missing"),
135
+ ponderReviseIncomplete: (0, tool_error_code_1.withCode)("ponder revise requires packet_id, kind, objective, success_criteria, and valid payload_json.", "ponder-fields-missing"),
136
+ 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"),
137
+ };
138
+ /** The flow tools' Ouro AX cards. The schemas above are bare (the engine runs them), so the census reads cards here. */
139
+ exports.toolCards = [
140
+ { id: "tool:settle", group: "turn-flow", when: "Pick this to give your final answer and hand the turn back: the work is done, you're blocked, or the person asked something that needs an answer now. For progress while you keep working, use speak.", effect: "write", errors: [
141
+ { code: "settle-alone", means: "settle 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 settle on its own." },
142
+ ] },
143
+ { 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: [
144
+ { code: "empty-message", means: "The message was empty, so nothing was sent.", fix: "Call speak again with the words you mean to send." },
145
+ { 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." },
146
+ ] },
147
+ { 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: [
148
+ { 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." },
149
+ ] },
150
+ { id: "tool:rest", group: "turn-flow", when: "Pick this to close a private turn once nothing is left to do there; outward chats end with settle instead.", effect: "write", errors: [
151
+ { code: "rest-alone", means: "rest 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 rest on its own." },
152
+ { code: "held-work-unsurfaced", means: "This private turn still holds work someone is waiting on.", fix: "Return each listed item with surface(delegationId=...), then rest." },
153
+ { code: "fresh-work-pending", means: "New messages arrived during this turn, so rest waits once.", fix: "Read the pending messages and act on them, then rest." },
154
+ ] },
155
+ { id: "tool:ponder", group: "turn-flow", when: "Pick this when a question needs more thought than this turn allows, or harness friction should be worked on privately later.", effect: "write", errors: [
156
+ { code: "ponder-fields-missing", means: "A field ponder needs was missing, or payload_json was not a JSON object.", fix: "Call ponder again with kind, objective, success_criteria and payload_json, plus packet_id to revise." },
157
+ { code: "held-work-unsurfaced", means: "This private turn already holds work someone is waiting on, so no new packet was made.", fix: "Return the held item with surface(delegationId=...) instead of pondering a replacement." },
158
+ ] },
159
+ ];
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1340",
3
+ "version": "0.1.0-alpha.1343",
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.1340",
9
+ "version": "0.1.0-alpha.1343",
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.1340",
3
+ "version": "0.1.0-alpha.1343",
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": {