@ouro.bot/cli 0.1.0-alpha.1415 → 0.1.0-alpha.1417

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,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.1417",
6
+ "changes": [
7
+ "steward_policy_manage says what correct_provenance does and leaves the census baseline; it was the last Butler tool listed there.",
8
+ "settle can leave a check-back: on a turn that may file await_condition, it also takes check_back_at and condition, and files them as an await that wakes at that time. If the check-back can't be filed, nothing is sent and the agent is told why."
9
+ ]
10
+ },
4
11
  {
5
12
  "version": "0.1.0-alpha.1415",
6
13
  "changes": [
7
- "The Butler's media tools say what happened or what the tool does, instead of giving the agent rules (\"never\", \"do not\"). A test checks every string in the media server and the MCP write guard for those words.",
8
14
  "While the relay switch is on, the Butler hands an approval prompt to Ari's primary agent as a sealed request only its harness can open, so Ari can answer it in iMessage. A peer that hangs is given up on after 15 seconds and Ari gets the Telegram card."
9
15
  ]
10
16
  },
17
+ {
18
+ "version": "0.1.0-alpha.1414",
19
+ "changes": [
20
+ "The Butler's media tools say what happened or what the tool does, instead of giving the agent rules (\"never\", \"do not\"). A test checks every string in the media server and the MCP write guard for those words."
21
+ ]
22
+ },
11
23
  {
12
24
  "version": "0.1.0-alpha.1413",
13
25
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1415",
2
+ "runtimeVersion": "0.1.0-alpha.1417",
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.1415</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1417</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -2333,7 +2333,55 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2333
2333
  })
2334
2334
  ?? getSettleRetryError(mustResolveBeforeHandoffActive, intent, sawSteeringFollowUp, options?.delegationDecision, sawSendMessageSelf, sawPonder, sawQuerySession, options?.currentObligation ?? null, options?.activeWorkFrame?.inner?.job, sawExternalStateQuery);
2335
2335
  const validDirectReply = mustResolveBeforeHandoffActive && intent === "direct_reply" && sawSteeringFollowUp;
2336
- if (retryError === null) {
2336
+ // A check-back is filed only once every gate has passed, through await_condition itself, so it is bound and
2337
+ // permitted exactly as that tool would be. If it can't be filed, nothing is sent and the model is told why.
2338
+ let checkBackError = null;
2339
+ let checkBackFiled = null;
2340
+ if (retryError === null && (settleArgs.check_back_at !== undefined || settleArgs.condition !== undefined)) {
2341
+ // The schema gate has already made both strings when present.
2342
+ const at = (settleArgs.check_back_at ?? "").trim();
2343
+ const condition = (settleArgs.condition ?? "").trim();
2344
+ if (!at || !condition) {
2345
+ checkBackError = tools_flow_1.FLOW_TOOL_REFUSALS.settleCheckBackIncomplete;
2346
+ }
2347
+ else {
2348
+ const awaitArgs = { name: `check-back-${Date.now().toString(36)}`, condition, cadence: tools_flow_1.SETTLE_CHECK_BACK_CADENCE, wake_at: at };
2349
+ let filedText;
2350
+ try {
2351
+ if (options?.execTool && !relationship) {
2352
+ filedText = await options.execTool("await_condition", awaitArgs, trustedToolContext);
2353
+ }
2354
+ else {
2355
+ // A failed execution's text is its error, which reads below as the reason.
2356
+ filedText = (await (0, tools_1.executeTool)("await_condition", awaitArgs, augmentedToolContext, options?.execTool)).text;
2357
+ }
2358
+ }
2359
+ catch (error) {
2360
+ filedText = JSON.stringify({ error: error instanceof Error ? error.message : String(error) });
2361
+ }
2362
+ let parsed = {};
2363
+ try {
2364
+ parsed = JSON.parse(filedText);
2365
+ }
2366
+ catch {
2367
+ parsed = { error: filedText };
2368
+ }
2369
+ if (parsed.filed === awaitArgs.name) {
2370
+ checkBackFiled = { name: awaitArgs.name, at };
2371
+ }
2372
+ else {
2373
+ checkBackError = tools_flow_1.FLOW_TOOL_REFUSALS.settleCheckBackNotFiled(typeof parsed.error === "string" ? parsed.error : "await_condition gave no receipt");
2374
+ }
2375
+ }
2376
+ (0, runtime_1.emitNervesEvent)({
2377
+ level: checkBackError ? "warn" : "info",
2378
+ component: "engine",
2379
+ event: "engine.settle_check_back",
2380
+ message: "settle asked to leave a check-back",
2381
+ meta: { filed: checkBackFiled !== null },
2382
+ });
2383
+ }
2384
+ if (retryError === null && checkBackError === null) {
2337
2385
  const finalAnswer = replacement ?? deliveredAnswer;
2338
2386
  const rewritten = replacement !== null;
2339
2387
  try {
@@ -2365,7 +2413,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2365
2413
  providerRuntime.appendToolOutput(result.toolCalls[0].id, resumeWork);
2366
2414
  }
2367
2415
  else {
2368
- const delivered = "(delivered)";
2416
+ const delivered = checkBackFiled ? `(delivered; check-back ${checkBackFiled.name} filed for ${checkBackFiled.at})` : "(delivered)";
2369
2417
  pushGenerated({ role: "tool", tool_call_id: result.toolCalls[0].id, content: delivered });
2370
2418
  providerRuntime.appendToolOutput(result.toolCalls[0].id, delivered);
2371
2419
  outcome = intent === "blocked" ? "blocked" : "settled";
@@ -2378,7 +2426,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
2378
2426
  streamCallbackBuffer?.discard();
2379
2427
  callbacks.onToolEnd("settle", (0, tools_1.summarizeArgs)("settle", settleArgs, toolSelection), false);
2380
2428
  callbacks.onClearText?.();
2381
- rejectToolBatch(msg, [retryError]);
2429
+ rejectToolBatch(msg, [(retryError ?? checkBackError)]);
2382
2430
  }
2383
2431
  continue;
2384
2432
  }
@@ -1568,7 +1568,7 @@ async function readDefaultSanctuaryScenarioFacts(label, scenarioHandleDigest, de
1568
1568
  providerCapabilities: [...runtime.capabilities], schemaDigest: digest(schemas), schemaToolNames,
1569
1569
  ordinaryDefinitionCount: selection.ordinary.length, engineSchemaCount: selection.engine.length,
1570
1570
  profileExact: true, schemasExact: (0, node_util_1.isDeepStrictEqual)([...schemaToolNames].sort(), [...expectedNames].sort()),
1571
- handlersExact: selection.ordinary.every((definition) => typeof definition.handler === "function") && selection.engine.every((schema) => [tools_1.ponderTool, tools_1.settleTool, tools_1.speakTool, tools_1.restTool].includes(schema)),
1571
+ handlersExact: selection.ordinary.every((definition) => typeof definition.handler === "function") && selection.engine.every((schema) => [tools_1.ponderTool, tools_1.settleTool, tools_1.settleCheckBackTool, tools_1.speakTool, tools_1.restTool].includes(schema)),
1572
1572
  poisonedSchemaIntersectionCount: (0, tools_1.toolSelectionSchemas)(poisoned).filter((schema) => !schemaToolNames.includes(schema.function.name)).length,
1573
1573
  excludedToolNames: excludedAttempts.map((receipt) => receipt.name),
1574
1574
  excludedSchemaIntersectionCount: schemaToolNames.filter((name) => excludedNames.includes(name)).length,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toolCards = exports.FLOW_TOOL_REFUSALS = exports.restTool = exports.speakTool = exports.settleTool = exports.observeTool = exports.ponderTool = void 0;
3
+ exports.toolCards = exports.FLOW_TOOL_REFUSALS = exports.restTool = exports.speakTool = exports.SETTLE_CHECK_BACK_CADENCE = exports.settleTool = exports.SETTLE_DESCRIPTION = exports.observeTool = exports.ponderTool = void 0;
4
4
  const tool_error_code_1 = require("./tool-error-code");
5
5
  exports.ponderTool = {
6
6
  type: "function",
@@ -69,11 +69,13 @@ exports.observeTool = {
69
69
  },
70
70
  },
71
71
  };
72
+ /** What settle does. A turn's progress goes through speak; settle is the turn's end. */
73
+ exports.SETTLE_DESCRIPTION = "delivers answer to the person and ends the turn, handing control back to them. it is the move for finished work, a real block, a question from them that needs an answer now, or a confirmation, stop or pause point. feedback that arrives during active work is input to the loop, and progress while i keep working goes through speak. an answer like 'I'll look into that' means a tool call is the next step. when the block is a missing tool (not a missing answer from them), report_failure tells the engineers about the gap, and settle with intent blocked ends the turn.";
72
74
  exports.settleTool = {
73
75
  type: "function",
74
76
  function: {
75
77
  name: "settle",
76
- description: "deliver your response and end your turn — this hands control back to the user. only settle when your work is complete, you're genuinely blocked, the user asked a direct question that needs an answer now, or a required confirmation/stop/pause boundary is reached. process feedback during active work is loop input, not a settle reason. do not settle with status updates mid-task. if you're settling with 'I'll look into that,' you probably should be using a tool instead. if you're blocked because a tool you need doesn't exist (not because you need an answer from them), call report_failure first so the engineers hear about the gap, then settle with intent blocked.",
78
+ description: exports.SETTLE_DESCRIPTION,
77
79
  parameters: {
78
80
  type: "object",
79
81
  properties: {
@@ -84,6 +86,8 @@ exports.settleTool = {
84
86
  },
85
87
  },
86
88
  };
89
+ /** How often a check-back filed by settle is looked at again after its time, until it is resolved or canceled. */
90
+ exports.SETTLE_CHECK_BACK_CADENCE = "1d";
87
91
  exports.speakTool = {
88
92
  type: "function",
89
93
  function: {
@@ -126,6 +130,8 @@ exports.FLOW_TOOL_REFUSALS = {
126
130
  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
131
  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
132
  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"),
133
+ settleCheckBackIncomplete: (0, tool_error_code_1.withCode)("settle takes check_back_at and condition together: give both to leave a check-back, or neither. nothing was sent.", "check-back-incomplete"),
134
+ settleCheckBackNotFiled: (detail) => (0, tool_error_code_1.withCode)(`settle couldn't leave the check-back: ${detail}. nothing was sent; fix it and settle again, or settle without check_back_at.`, "check-back-not-filed"),
129
135
  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
136
  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
137
  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"),
@@ -140,6 +146,8 @@ exports.FLOW_TOOL_REFUSALS = {
140
146
  exports.toolCards = [
141
147
  { 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: [
142
148
  { 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." },
149
+ { code: "check-back-incomplete", means: "settle had check_back_at or condition but not both, so nothing was sent.", fix: "Give both to leave a check-back, or neither." },
150
+ { code: "check-back-not-filed", means: "The check-back couldn't be filed (the reason is in the reply), so nothing was sent.", fix: "Fix what the reply names, such as the time's format, then settle again, or settle without check_back_at." },
143
151
  ] },
144
152
  { 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: [
145
153
  { code: "empty-message", means: "The message was empty, so nothing was sent.", fix: "Call speak again with the words you mean to send." },
@@ -17,7 +17,7 @@ exports.stewardPolicyToolDefinition = {
17
17
  type: "function",
18
18
  function: {
19
19
  name: "steward_policy_manage",
20
- description: "Read or update the household steward's typed desired-state and routine-action policy. Updates require the current authenticated owner Telegram request and fresh authorization. Replay identities can never update it. correct_provenance (key, source, correction) is only for fixing a wrong attribution on an existing desired state: it replaces the recorded source and records the correction note, never changes the value, and leaves an audit row; do not use it to change a value. expectedVersion is optional; omit it to apply against the current policy version, or supply a version from read for explicit stale-write detection.",
20
+ description: "Read or update the household steward's typed desired-state and routine-action policy. Updates require the current authenticated owner Telegram request and fresh authorization. Replay identities can't update it. correct_provenance (key, source, correction) fixes a wrong attribution on an existing desired state: it replaces the recorded source, records the correction note and leaves an audit row, and the value stays as it was; a value changes through set_desired_state. expectedVersion is optional; omit it to apply against the current policy version, or supply a version from read for explicit stale-write detection.",
21
21
  parameters: {
22
22
  type: "object",
23
23
  properties: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APPROVAL_UNAVAILABLE_REJECTION = exports.ToolSelectionError = exports.surfaceToolDef = exports.speakTool = exports.restTool = exports.ponderTool = exports.observeTool = exports.settleTool = exports.tools = exports.SANCTUARY_OWNER_ADDITIONS = exports.SANCTUARY_MCP_PROVIDED_TOOLS = void 0;
3
+ exports.APPROVAL_UNAVAILABLE_REJECTION = exports.ToolSelectionError = exports.surfaceToolDef = exports.settleCheckBackTool = exports.speakTool = exports.restTool = exports.ponderTool = exports.observeTool = exports.settleTool = exports.tools = exports.SANCTUARY_OWNER_ADDITIONS = exports.SANCTUARY_MCP_PROVIDED_TOOLS = void 0;
4
4
  exports.toolSelectionSchemas = toolSelectionSchemas;
5
5
  exports.selectToolsForChannel = selectToolsForChannel;
6
6
  exports.getToolsForChannel = getToolsForChannel;
@@ -106,6 +106,21 @@ Object.defineProperty(exports, "observeTool", { enumerable: true, get: function
106
106
  Object.defineProperty(exports, "ponderTool", { enumerable: true, get: function () { return tools_base_2.ponderTool; } });
107
107
  Object.defineProperty(exports, "restTool", { enumerable: true, get: function () { return tools_base_2.restTool; } });
108
108
  Object.defineProperty(exports, "speakTool", { enumerable: true, get: function () { return tools_base_2.speakTool; } });
109
+ /**
110
+ * settle for a turn that may also file await_condition: two more arguments leave a watch behind, filed exactly as
111
+ * await_condition would file it. Offered only where await_condition is, so elsewhere the arguments don't exist.
112
+ * Built from settleTool, so the door is defined once.
113
+ */
114
+ exports.settleCheckBackTool = withCheckBack(tools_flow_1.settleTool);
115
+ function withCheckBack(tool) {
116
+ const variant = structuredClone(tool);
117
+ variant.function.description = `${tools_flow_1.SETTLE_DESCRIPTION} with check_back_at and condition, it also files an await that wakes at that time, so the follow-up happens without anyone asking again.`;
118
+ Object.assign(variant.function.parameters.properties, {
119
+ check_back_at: { type: "string", description: "optional: when to look at this again, an ISO time with a zone such as 2026-11-23T15:00:00Z. give condition with it." },
120
+ condition: { type: "string", description: "optional, with check_back_at: one sentence of what to check then." },
121
+ });
122
+ return variant;
123
+ }
109
124
  // Re-export surface tool schema for consumers (e.g. heart/core.ts)
110
125
  var tools_surface_2 = require("./tools-surface");
111
126
  Object.defineProperty(exports, "surfaceToolDef", { enumerable: true, get: function () { return tools_surface_2.surfaceToolDef; } });
@@ -226,9 +241,11 @@ function selectToolsForChannel(capabilities, toolPreferences, _context, provider
226
241
  &&
227
242
  (!relationship || relationship.advertisedToolNames.includes(definition.tool.function.name))
228
243
  && (!definition.requiredCapability || providerCapabilities?.has(definition.requiredCapability) === true));
244
+ // settle can leave a check-back only where the turn may file await_condition itself.
245
+ const offersCheckBack = ordinary.some((definition) => definition.tool.function.name === "await_condition");
229
246
  const engine = [
230
247
  ...(context?.noSend ? [] : [tools_flow_1.ponderTool]),
231
- ...(inner ? [tools_flow_1.restTool] : [tools_flow_1.observeTool, tools_flow_1.settleTool]),
248
+ ...(inner ? [tools_flow_1.restTool] : [tools_flow_1.observeTool, offersCheckBack ? exports.settleCheckBackTool : tools_flow_1.settleTool]),
232
249
  ...(capabilities?.chatStyle ? [tools_flow_1.speakTool] : []),
233
250
  ].filter((tool) => (!sanctuary || (knownSanctuaryProfile && tool.function.name !== "observe"))
234
251
  && (!relationship || relationship.advertisedToolNames.includes(tool.function.name))
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1415",
3
+ "version": "0.1.0-alpha.1417",
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.1415",
9
+ "version": "0.1.0-alpha.1417",
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.1415",
3
+ "version": "0.1.0-alpha.1417",
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": {