@ouro.bot/cli 0.1.0-alpha.1364 → 0.1.0-alpha.1365

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.1365",
6
+ "changes": [
7
+ "With an owner route, the approvals the Butler needs from its owner (tool approval prompts, admission cards) go to the owner's primary agent first as urgent; the card still reaches Telegram so its buttons work, silently when the primary agent has it."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1364",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1364",
2
+ "runtimeVersion": "0.1.0-alpha.1365",
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.1364</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1365</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -118,7 +118,7 @@ function validateArtifact(artifact, expectedId) {
118
118
  ? boundedText(effect.text, 150_000)
119
119
  && (effect.kind !== "text" || effect.replyToMessageId === undefined || (Number.isSafeInteger(effect.replyToMessageId) && effect.replyToMessageId > 0))
120
120
  : effect?.kind === "card"
121
- ? boundedText(effect.text) && Array.isArray(effect.buttons) && effect.buttons.length > 0 && effect.buttons.length <= 20
121
+ ? boundedText(effect.text) && (effect.silent === undefined || effect.silent === true) && Array.isArray(effect.buttons) && effect.buttons.length > 0 && effect.buttons.length <= 20
122
122
  && effect.buttons.every((row) => Array.isArray(row) && row.length > 0 && row.length <= 8
123
123
  && row.every((button) => boundedText(button?.text, 256) && boundedText(button?.callbackData, 64) && Buffer.byteLength(button.callbackData, "utf8") <= 64))
124
124
  : effect?.kind === "edit"
@@ -392,14 +392,15 @@ async function executePart(api, artifact, part, chatId, signal) {
392
392
  }
393
393
  if (effect.kind === "card") {
394
394
  const reply_markup = { inline_keyboard: effect.buttons.map((row) => row.map((button) => ({ text: button.text, callback_data: button.callbackData }))) };
395
+ const quiet = effect.silent ? { disable_notification: true } : {};
395
396
  let result;
396
397
  try {
397
- result = await api.request("sendMessage", { chat_id: chatId, text: (0, telegram_client_1.escapeTelegramHtml)(effect.text), parse_mode: "HTML", reply_markup }, signal);
398
+ result = await api.request("sendMessage", { chat_id: chatId, text: (0, telegram_client_1.escapeTelegramHtml)(effect.text), parse_mode: "HTML", reply_markup, ...quiet }, signal);
398
399
  }
399
400
  catch (error) {
400
401
  if (!(error instanceof telegram_client_1.TelegramApiError) || error.status !== 400)
401
402
  throw error;
402
- result = await api.request("sendMessage", { chat_id: chatId, text: effect.text, reply_markup }, signal);
403
+ result = await api.request("sendMessage", { chat_id: chatId, text: effect.text, reply_markup, ...quiet }, signal);
403
404
  }
404
405
  return canonicalMessageId(result);
405
406
  }
@@ -831,12 +831,33 @@ function createTelegramSenseApp(options) {
831
831
  const authorizeEffect = options.authorizeEffect ?? defaultEffectAuthorization;
832
832
  let recordAcceptedEffects;
833
833
  const configuredOwnerTarget = () => ({ kind: "approved_relationship", friendId: configuredOwnerFriendId, sessionKey: configuredOwnerSessionKey });
834
- const executeAuthorizedEffect = (0, telegram_effect_adapter_1.createTelegramAuthorizedEffectExecutor)({
834
+ const fallbackText = (text) => `${telegram_owner_route_1.OWNER_ROUTE_FALLBACK_PREFIX}\n\n${text}`;
835
+ const executeOnTelegram = (0, telegram_effect_adapter_1.createTelegramAuthorizedEffectExecutor)({
835
836
  store: getEffectJournal,
836
837
  api,
837
838
  authorize: authorizeEffect,
838
839
  barrier: acceptanceAuditBarrier,
839
840
  });
841
+ /**
842
+ * An approval card the agent wants from the owner (a tool approval's prompt, a newcomer's admission card) goes to the owner
843
+ * route first, as urgent. The card still goes to Telegram so its buttons work: silently when the primary agent has it,
844
+ * and with the fallback line when it can't be reached. A resend of a card already in the journal is left as it was.
845
+ */
846
+ const executeAuthorizedEffect = async (input) => {
847
+ const route = options.ownerRoute;
848
+ if (!route || input.effect.kind !== "card" || input.target.kind !== "approved_relationship" || input.target.friendId !== configuredOwnerFriendId
849
+ || !/^(?:approval:.+:prompt|owner-card:.+)$/u.test(input.idempotencyKey) || getEffectJournal().readByIdempotencyKey(input.idempotencyKey)) {
850
+ return executeOnTelegram(input);
851
+ }
852
+ const effect = input.effect;
853
+ const choices = effect.buttons.flat().map((button) => button.text).join(", ");
854
+ const outcome = await route((0, telegram_owner_route_1.ownerRouteItem)(input.idempotencyKey, `${effect.text}\n\nOptions: ${choices}. The buttons are on the card in the Butler's Telegram chat.`, true));
855
+ (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.telegram_owner_route_approval", message: "offered an approval card to the owner's primary agent", meta: { agentName: options.agentName, outcome: outcome.status } });
856
+ return executeOnTelegram({
857
+ ...input,
858
+ effect: outcome.status === "delivered" ? { ...effect, silent: true } : { ...effect, text: fallbackText(effect.text) },
859
+ });
860
+ };
840
861
  const recordConfiguredOwnerEffect = async (artifact, causalEventId) => {
841
862
  await recordAcceptedEffects((0, shared_turn_1.getSenseSessionPath)(options.agentName, configuredOwnerFriendId, "telegram", configuredOwnerSessionKey, agentRoot), [artifact], undefined, causalEventId ? { [artifact.id]: causalEventId } : undefined);
842
863
  };
@@ -1057,7 +1078,6 @@ function createTelegramSenseApp(options) {
1057
1078
  };
1058
1079
  // Keys the owner's primary agent accepted, so a retry is already sent (as with the effect journal for Telegram).
1059
1080
  const routedKeysPath = path.join(agentRoot, "state", "telegram", "routed-owner-notices.json");
1060
- const fallbackText = (text) => `${telegram_owner_route_1.OWNER_ROUTE_FALLBACK_PREFIX}\n\n${text}`;
1061
1081
  /**
1062
1082
  * Offers a self-started message to the owner route. Returns null when it is handled (the peer has it, or it waits in the
1063
1083
  * held file for the peer), or the text Telegram should send: the message itself with no route, or, for an urgent message
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1364",
3
+ "version": "0.1.0-alpha.1365",
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.1364",
9
+ "version": "0.1.0-alpha.1365",
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.1364",
3
+ "version": "0.1.0-alpha.1365",
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": {