@ouro.bot/cli 0.1.0-alpha.1384 → 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.
@@ -6,9 +6,9 @@
6
6
  <meta name="color-scheme" content="dark" />
7
7
  <title>Ouro Mailbox</title>
8
8
  <meta name="description" content="The daemon-hosted shared orientation surface for agents alive on this machine." />
9
- <script type="module" crossorigin src="/assets/index-CmMXMK-O.js"></script>
10
- <link rel="modulepreload" crossorigin href="/assets/vendor-C-KA_woR.js">
11
- <link rel="stylesheet" crossorigin href="/assets/index-DrBzo6CV.css">
9
+ <script type="module" crossorigin src="/assets/index-B5PHJ96n.js"></script>
10
+ <link rel="modulepreload" crossorigin href="/assets/vendor-BfcLUM_P.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-C1x3aMJb.css">
12
12
  </head>
13
13
  <body>
14
14
  <script>(function(w,d){if(w.__ouroFragmentFocus)return;var s=d.currentScript,n=s;while(n&&!n.nextSibling)n=n.parentNode;w.__ouroFragmentFocus={parsed:d.readyState==="loading"&&!!s&&!n,script:s};var ua=navigator.userAgent;if(!/AppleWebKit/.test(ua)||/Chrome\/|Edg\//.test(ua))return;var done=new WeakSet,failed=new WeakSet,jump=null,until=0,i,l=d.querySelectorAll('link[rel~="stylesheet"]');for(i=0;i<l.length;i++)done.add(l[i]);function pending(x){return !done.has(x)&&x.getAttribute("href")&&!x.disabled&&!/\balternate\b/i.test(x.rel)}function sheets(){return d.querySelectorAll('link[rel~="stylesheet"]')}function loading(){var a=sheets(),j;for(j=0;j<a.length;j++)if(pending(a[j]))return true;return false}function importing(s){try{for(var r=s.cssRules,i=0;i<r.length;i++)if(r[i] instanceof CSSImportRule&&(!r[i].styleSheet||importing(r[i].styleSheet)))return true}catch(e){}return false}function renew(x){if(!x.sheet&&!failed.has(x))x.replaceWith(x.cloneNode(true))}d.addEventListener("DOMContentLoaded",function(){w.addEventListener("DOMContentLoaded",setAside,{once:true})});function setAside(){var a=sheets(),held=[],j;for(j=0;j<a.length;j++)if(pending(a[j])&&(importing(a[j].sheet)||!a[j].sheet)){a[j].disabled=true;held.push(a[j])}if(held.length)setTimeout(function(){for(var k=0;k<held.length;k++){var x=held[k];x.disabled=false;if(!x.sheet){if(done.has(x))renew(x);else x.addEventListener("load",renew.bind(null,x),{once:true})}}})}function here(){return location.href.split("#")[0]}function follow(){if(jump&&(!loading()||Date.now()>=until)){var h=jump;jump=null;if(h.split("#")[0]===here())location.assign(h)}}function drop(){jump=null}w.addEventListener("popstate",drop);w.addEventListener("hashchange",drop);function settle(e){if(e.target&&e.target.localName==="link"){done.add(e.target);if(e.type==="error")failed.add(e.target);setTimeout(follow)}}d.addEventListener("load",settle,true);d.addEventListener("error",settle,true);w.addEventListener("click",function(e){var p=e.composedPath(),a,k,h;for(k=0;k<p.length;k++)if((p[k].localName==="a"||p[k].localName==="area")&&typeof p[k].href==="string"&&p[k].hasAttribute("href")){a=p[k];break}if(!a)return;jump=null;if(e.defaultPrevented||e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(a.target&&a.target!=="_self")||a.hasAttribute("download"))return;h=a.href;if(h.indexOf("#")<0||h.split("#")[0]!==here()||!loading())return;e.preventDefault();jump=h;until=Date.now()+2000;setTimeout(follow,2000)})})(window,document)</script>
@@ -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.1384",
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.1384",
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.1384",
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": {