@ouro.bot/cli 0.1.0-alpha.1385 → 0.1.0-alpha.1386

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,12 @@
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.1386",
6
+ "changes": [
7
+ "A delegated command counts as noticed only once Telegram accepted its audit notice, and its refusal no longer says the owner's chat is down when the chat is only handed to someone else."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1385",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1385",
2
+ "runtimeVersion": "0.1.0-alpha.1386",
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.1385</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1386</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -68,7 +68,10 @@ function delegatedCommandWasNoticed(agentRoot, commandId, principalFriendId, del
68
68
  throw error;
69
69
  }
70
70
  const artifact = JSON.parse(raw);
71
- return artifact.idempotencyKey === idempotencyKey && artifact.authorClass === "butler" && artifact.target?.friendId === principalFriendId;
71
+ // The journal entry is written before the send, so only parts Telegram accepted count as the owner having been told.
72
+ const delivered = Array.isArray(artifact.parts) && artifact.parts.length > 0
73
+ && artifact.parts.every((part) => typeof part === "object" && part !== null && ["accepted", "session_recorded"].includes(part.state));
74
+ return delivered && artifact.idempotencyKey === idempotencyKey && artifact.authorClass === "butler" && artifact.target?.friendId === principalFriendId;
72
75
  }
73
76
  /**
74
77
  * What a refused sender is told. Every refusal says that nothing ran and names the next step; the reason code stays
@@ -97,7 +100,7 @@ function delegationRefusalGuidance(reason, hints) {
97
100
  case "principal_unresolved":
98
101
  return { message: "the agent cannot tell whose command this is (its owner record is missing or ambiguous)", next: "Ask the operator to check the owner's friend record on the agent's host.", retry: false };
99
102
  case "notice_failed":
100
- return { message: "the agent could not tell its owner about this command first, so it did not run it", next: "Retry in a minute. If it keeps failing, the owner's chat channel is down: tell the operator.", retry: true };
103
+ return { message: "the agent could not tell its owner about this command first, so it did not run it", next: "Retry in a minute. If it keeps failing, the owner can't be told in their own chat right now (it may be handed to someone else, or unreachable): tell the operator.", retry: true };
101
104
  }
102
105
  }
103
106
  /** Invisible and bidirectional-control characters a sender could slip inside the banner to keep it from matching. */
@@ -1077,6 +1077,26 @@ function createTelegramSenseApp(options) {
1077
1077
  (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_notice_held_for_pacing", message: "held a house notice for quiet hours or the daily message cap", meta: { agentName: options.agentName, reason: pacingReason } });
1078
1078
  return true;
1079
1079
  };
1080
+ // A delegated command's audit notice (see `TelegramSenseApp.sendDelegatedAuditNotice`): sent now, or it throws.
1081
+ const sendDelegatedAuditNotice = async (input) => {
1082
+ const noticeId = requiredText(input.noticeId, "delegated audit notice id");
1083
+ if (!noticeId.startsWith("delegated:") || Buffer.byteLength(noticeId) > 512)
1084
+ throw new Error("Telegram delegated audit notice id is invalid");
1085
+ const key = `owner-notice:${noticeId}`;
1086
+ await runWithAcceptanceAuditOwner(async () => {
1087
+ const text = requiredText(input.text, "delegated audit notice");
1088
+ if (ownerChatIsHandedOff()) {
1089
+ (0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.telegram_delegated_notice_refused", message: "refused a delegated command's audit notice while the owner's chat is handed to someone else", meta: { agentName: options.agentName, reason: "handed_off" } });
1090
+ throw new Error("the owner's Telegram chat is handed to someone else, so a delegated command's notice can't be sent");
1091
+ }
1092
+ const pacingReason = options.proactivePacing ? (0, telegram_handoff_1.proactiveHoldReason)(proactiveLedgerPath, new Date(), options.proactivePacing) : null;
1093
+ const silent = options.ownerRoute !== undefined || pacingReason === "quiet_hours";
1094
+ const effect = await deliverButlerEffect(text, key, input.signal, undefined, false, undefined, silent);
1095
+ (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_delegated_notice_sent", message: "sent a delegated command's audit notice to the owner's Telegram chat", meta: { agentName: options.agentName, silent } });
1096
+ const sessionPath = (0, shared_turn_1.getSenseSessionPath)(options.agentName, configuredOwnerFriendId, "telegram", configuredOwnerSessionKey, agentRoot);
1097
+ await recordAcceptedEffects(sessionPath, [effect]);
1098
+ });
1099
+ };
1080
1100
  // Keys the owner's primary agent accepted, so a retry is already sent (as with the effect journal for Telegram).
1081
1101
  const routedKeysPath = path.join(agentRoot, "state", "telegram", "routed-owner-notices.json");
1082
1102
  /**
@@ -2071,7 +2091,7 @@ function createTelegramSenseApp(options) {
2071
2091
  if (Buffer.byteLength(noticeId) > 512)
2072
2092
  throw new Error("Telegram owner notice id is invalid");
2073
2093
  if (noticeId.startsWith("delegated:"))
2074
- return this.sendDelegatedAuditNotice({ ...input, noticeId });
2094
+ return sendDelegatedAuditNotice({ ...input, noticeId });
2075
2095
  await runWithAcceptanceAuditOwner(async () => {
2076
2096
  const text = requiredText(input.text, "owner notice");
2077
2097
  const telegramText = await routeSelfStarted(text, `owner-notice:${noticeId}`, undefined, input.signal);
@@ -2086,25 +2106,7 @@ function createTelegramSenseApp(options) {
2086
2106
  await recordAcceptedEffects(sessionPath, [effect]);
2087
2107
  });
2088
2108
  },
2089
- async sendDelegatedAuditNotice(input) {
2090
- const noticeId = requiredText(input.noticeId, "delegated audit notice id");
2091
- if (!noticeId.startsWith("delegated:") || Buffer.byteLength(noticeId) > 512)
2092
- throw new Error("Telegram delegated audit notice id is invalid");
2093
- const key = `owner-notice:${noticeId}`;
2094
- await runWithAcceptanceAuditOwner(async () => {
2095
- const text = requiredText(input.text, "delegated audit notice");
2096
- if (ownerChatIsHandedOff()) {
2097
- (0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.telegram_delegated_notice_refused", message: "refused a delegated command's audit notice while the owner's chat is handed to someone else", meta: { agentName: options.agentName, reason: "handed_off" } });
2098
- throw new Error("the owner's Telegram chat is handed to someone else, so a delegated command's notice can't be sent");
2099
- }
2100
- const pacingReason = options.proactivePacing ? (0, telegram_handoff_1.proactiveHoldReason)(proactiveLedgerPath, new Date(), options.proactivePacing) : null;
2101
- const silent = options.ownerRoute !== undefined || pacingReason === "quiet_hours";
2102
- const effect = await deliverButlerEffect(text, key, input.signal, undefined, false, undefined, silent);
2103
- (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_delegated_notice_sent", message: "sent a delegated command's audit notice to the owner's Telegram chat", meta: { agentName: options.agentName, silent } });
2104
- const sessionPath = (0, shared_turn_1.getSenseSessionPath)(options.agentName, configuredOwnerFriendId, "telegram", configuredOwnerSessionKey, agentRoot);
2105
- await recordAcceptedEffects(sessionPath, [effect]);
2106
- });
2107
- },
2109
+ sendDelegatedAuditNotice,
2108
2110
  stop() {
2109
2111
  if (stopPromise)
2110
2112
  return stopPromise;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1385",
3
+ "version": "0.1.0-alpha.1386",
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.1385",
9
+ "version": "0.1.0-alpha.1386",
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.1385",
3
+ "version": "0.1.0-alpha.1386",
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": {