@ouro.bot/cli 0.1.0-alpha.1160 → 0.1.0-alpha.1161

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-Dbska1tZ.js"></script>
10
- <link rel="modulepreload" crossorigin href="/assets/vendor-CcN1XpQ9.js">
11
- <link rel="stylesheet" crossorigin href="/assets/index-DsiKaPyH.css">
9
+ <script type="module" crossorigin src="/assets/index-DqdAt_p5.js"></script>
10
+ <link rel="modulepreload" crossorigin href="/assets/vendor-mqLhL5Io.js">
11
+ <link rel="stylesheet" crossorigin href="/assets/index-BI1pAais.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="app"></div>
@@ -355,6 +355,7 @@ async function listAppSessions(options = {}) {
355
355
  continue;
356
356
  const session = isRecord(workspace.session) ? workspace.session : {};
357
357
  const binding = arr(workspace.checkoutBindings)[0];
358
+ const openPr = arr(workspace.repoContexts).map(context => isRecord(context.createdPullRequest) ? context.createdPullRequest : null).find(pr => pr && !/^(merged|closed)$/i.test(str(pr.state) ?? ""));
358
359
  add(str(session.sessionId) ?? str(workspace.activeSessionId), {
359
360
  name: str(workspace.name) ?? str(session.title) ?? "(unnamed)", kind: "workspace", workspaceId: str(workspace.id), workspaceType: str(workspace.workspaceType),
360
361
  project: str(workspace.projectName), projectId: str(workspace.projectId), projectRepo: str(binding?.repoFullName), branch: str(workspace.branch), path: str(workspace.displayPath),
@@ -362,6 +363,8 @@ async function listAppSessions(options = {}) {
362
363
  isRunning: session.isRunning === true, wasInterrupted: session.wasInterrupted === true,
363
364
  remote: (str(workspace.hostId) ?? "local") !== "local" || (str(session.executionLocation) ?? "local") !== "local",
364
365
  createdAt: str(workspace.createdAt), updatedAt: str(session.updatedAt) ?? str(workspace.updatedAt),
366
+ ...(openPr ? { openPullRequest: str(openPr.htmlUrl) ?? `#${String(openPr.number)}` } : {}),
367
+ ...(session.sessionAutomation || workspace.agentMergeEnabled === true ? { automation: true } : {}),
365
368
  }, session.isRunning === true);
366
369
  }
367
370
  for (const chat of chats) {
@@ -69,6 +69,7 @@ const NAME_MAX = 60;
69
69
  const ARCHIVE_REASONS = {
70
70
  "owner-asked": "you asked",
71
71
  "handed-off": "handed off to a successor",
72
+ finished: "finished: idle a day after its coordinator went",
72
73
  "oversize-idle": "over the size limit and idle 30 min after the hand-off ask",
73
74
  "memory-pressure": "over the size limit and idle while memory ran short",
74
75
  };
@@ -33,53 +33,153 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.readSuccessions = exports.FIRST_MESSAGE_SCAN_BYTES = exports.MESSAGE_HEAD_CHARS = exports.SUCCEEDS_LINE = void 0;
37
+ exports.namedPredecessor = namedPredecessor;
38
+ exports.refreshSuccessions = refreshSuccessions;
39
+ exports.successorOf = successorOf;
36
40
  exports.isHandedOff = isHandedOff;
37
41
  const fs = __importStar(require("node:fs"));
38
42
  const path = __importStar(require("node:path"));
39
43
  const runtime_1 = require("../../nerves/runtime");
40
44
  const client_1 = require("./client");
41
45
  const store_1 = require("./store");
42
- const HEAD_BYTES = 16384;
43
- const RECENT_MS = 7 * 86_400_000;
44
- const HANDOFF_WORDS = /successor|hand-?off|handed off|carry on from/i;
45
46
  /**
46
- * Whether an oversize session has been handed off: it is in the oversize list, and a session newer than it opens by
47
- * naming it in a hand-off. Only the first bytes of each recent log are read, so no large history is loaded.
47
+ * Who succeeds whom. A session that takes over another's job says so in its first message: the contract is a line of its
48
+ * own, `Succeeds: <predecessor session id>`, within the message's first 16 KB. Kickoffs written before that line existed
49
+ * are read too, when "successor to" or "successor of" opens the message and is followed closely by a session id, for
50
+ * example `the successor to "desk epoch 3" (cfb84353-…)` or `the fresh successor to session 2fa5297c`.
51
+ *
52
+ * The first message sits after the start-up hooks' events, tens of KB into the history, so each history is read forward
53
+ * at most 1 MB until its first message, once; after that only for the successor's first finished turn.
48
54
  */
49
- function isHandedOff(agentRoot, row, options = {}) {
50
- const flagged = (0, store_1.readJson)(path.join((0, store_1.appSessionsStateDir)(agentRoot), "oversize.json"), {}).sessions ?? {};
51
- if (!flagged[row.id])
52
- return false;
53
- const root = path.dirname(path.dirname((0, client_1.eventLogPath)(row.id, options)));
54
- const born = Date.parse(String(row.createdAt));
55
- let names;
55
+ exports.SUCCEEDS_LINE = "Succeeds:";
56
+ const STRUCTURED = /^[ \t>*_`]*Succeeds:[ \t*_`]*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\b/im;
57
+ const FREE_TEXT = /\bsuccessor (?:to|of)\b/gi;
58
+ const SESSION_ID = /\b[0-9a-f]{8}(?:-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?\b/i;
59
+ /** How much of the first message is read for the line. */
60
+ exports.MESSAGE_HEAD_CHARS = 16_384;
61
+ /** The free-text wording counts only where the message opens, and the id only close after it. */
62
+ const FREE_TEXT_OPENING_CHARS = 2_000;
63
+ const FREE_TEXT_ID_WINDOW = 240;
64
+ /** How far into a history the first message is looked for, and the most read per pass while waiting for the first turn. */
65
+ exports.FIRST_MESSAGE_SCAN_BYTES = 1024 * 1024;
66
+ /** Histories untouched this long are not read for a first message (an old one cannot hand off a live session). */
67
+ const RECENT_MS = 7 * 86_400_000;
68
+ const stateFile = (agentRoot) => path.join((0, store_1.appSessionsStateDir)(agentRoot), "successions.json");
69
+ const readSuccessions = (agentRoot) => (0, store_1.readJson)(stateFile(agentRoot), { sessions: {} }).sessions;
70
+ exports.readSuccessions = readSuccessions;
71
+ /** The session a first message says it succeeds: the `Succeeds:` line, else the older wording. `known` resolves a short id. */
72
+ function namedPredecessor(message, self, known) {
73
+ const head = message.slice(0, exports.MESSAGE_HEAD_CHARS);
74
+ const line = STRUCTURED.exec(head)?.[1]?.toLowerCase();
75
+ if (line && line !== self)
76
+ return { predecessor: line, marker: "structured" };
77
+ const opening = head.slice(0, FREE_TEXT_OPENING_CHARS);
78
+ for (const phrase of opening.matchAll(FREE_TEXT)) {
79
+ const after = head.slice(phrase.index + phrase[0].length, phrase.index + phrase[0].length + FREE_TEXT_ID_WINDOW);
80
+ const id = SESSION_ID.exec(after)?.[0]?.toLowerCase();
81
+ const resolved = id ? known(id) : null;
82
+ if (resolved && resolved !== self)
83
+ return { predecessor: resolved, marker: "free-text" };
84
+ }
85
+ return null;
86
+ }
87
+ const sessionsRoot = (client) => path.dirname(path.dirname((0, client_1.eventLogPath)("x", client)));
88
+ function historyIds(client) {
56
89
  try {
57
- names = fs.readdirSync(root);
90
+ return fs.readdirSync(sessionsRoot(client)).filter(name => /^[0-9a-f-]{36}$/i.test(name));
58
91
  }
59
92
  catch {
60
- return false;
93
+ return [];
61
94
  }
62
- for (const name of names) {
63
- if (name === row.id)
95
+ }
96
+ /** Read what is new in each recent history, as far as succession needs, and remember it. Returns every succession known. */
97
+ function refreshSuccessions(agentRoot, client, now = Date.now()) {
98
+ const before = (0, exports.readSuccessions)(agentRoot);
99
+ const ids = historyIds(client);
100
+ const known = (value) => {
101
+ const matches = ids.filter(id => id.toLowerCase().startsWith(value));
102
+ return matches.length === 1 ? matches[0] : null;
103
+ };
104
+ const next = {};
105
+ for (const id of ids) {
106
+ const was = before[id];
107
+ if (was && !was.pending && (!was.predecessor || was.turned)) {
108
+ next[id] = was;
64
109
  continue;
110
+ }
111
+ let modified;
65
112
  try {
66
- const file = path.join(root, name, "events.jsonl");
67
- const stat = fs.statSync(file);
68
- if (Date.now() - stat.mtimeMs > RECENT_MS || stat.birthtimeMs <= born)
69
- continue;
70
- const fd = fs.openSync(file, "r");
71
- const buf = Buffer.alloc(HEAD_BYTES);
72
- const len = fs.readSync(fd, buf, 0, buf.length, 0);
73
- fs.closeSync(fd);
74
- const head = buf.toString("utf8", 0, len);
75
- if ((head.includes(row.id) || head.includes(row.id.slice(0, 8))) && HANDOFF_WORDS.test(head)) {
76
- (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.app_sessions_handoff_found", message: "found the successor that a session was handed off to", meta: { session: row.id, successor: name } });
77
- return true;
78
- }
113
+ modified = fs.statSync((0, client_1.eventLogPath)(id, client)).mtimeMs;
79
114
  }
80
115
  catch {
81
116
  continue;
82
117
  }
118
+ if (!was && now - modified > RECENT_MS)
119
+ continue;
120
+ const entry = was ? { ...was } : { predecessor: null, offset: 0, pending: true };
121
+ let message = null;
122
+ let turned = false;
123
+ const read = (0, client_1.readNewAppEvents)(id, entry.offset, exports.FIRST_MESSAGE_SCAN_BYTES, event => {
124
+ if (event.agentId !== undefined)
125
+ return;
126
+ const data = event.data && typeof event.data === "object" ? event.data : {};
127
+ if (entry.pending && !message && event.type === "user.message" && typeof data.content === "string")
128
+ message = { text: data.content, ...(typeof event.timestamp === "string" ? { at: event.timestamp } : {}) };
129
+ else if ((message || !entry.pending) && event.type === "assistant.turn_end")
130
+ turned = true;
131
+ }, client);
132
+ entry.offset = read.offset;
133
+ if (entry.pending) {
134
+ const first = message;
135
+ if (first) {
136
+ delete entry.pending;
137
+ const named = namedPredecessor(first.text, id, known);
138
+ Object.assign(entry, named ?? {}, first.at ? { at: first.at } : {});
139
+ }
140
+ else if (entry.offset >= exports.FIRST_MESSAGE_SCAN_BYTES)
141
+ delete entry.pending;
142
+ }
143
+ if (entry.predecessor && turned)
144
+ entry.turned = true;
145
+ next[id] = entry;
83
146
  }
84
- return false;
147
+ (0, store_1.writeJson)(stateFile(agentRoot), { sessions: next });
148
+ return next;
149
+ }
150
+ /** The newest session that took over `id`'s job, following the chain of hand-offs to the live end; null when none did. */
151
+ function successorOf(id, successions) {
152
+ // The newest claim wins when two sessions name the same predecessor.
153
+ const direct = (of) => {
154
+ let newest = null;
155
+ for (const [claimant, entry] of Object.entries(successions)) {
156
+ const at = Date.parse(String(entry.at)) || 0;
157
+ if (entry.predecessor === of && (!newest || at > newest.at))
158
+ newest = { id: claimant, at };
159
+ }
160
+ return newest?.id ?? null;
161
+ };
162
+ let current = id;
163
+ const seen = new Set([id]);
164
+ for (let later = direct(current); later; later = direct(current)) {
165
+ // Sessions that claim to succeed each other own nothing for certain, so none of them is retired.
166
+ if (seen.has(later))
167
+ return null;
168
+ seen.add(later);
169
+ current = later;
170
+ }
171
+ return current === id ? null : current;
172
+ }
173
+ /**
174
+ * Whether an oversize session has been handed off: it is in the oversize list, and a newer session's first message
175
+ * names it as the session it succeeds.
176
+ */
177
+ function isHandedOff(agentRoot, row, options = {}) {
178
+ const flagged = (0, store_1.readJson)(path.join((0, store_1.appSessionsStateDir)(agentRoot), "oversize.json"), {}).sessions ?? {};
179
+ if (!flagged[row.id])
180
+ return false;
181
+ const successor = successorOf(row.id, refreshSuccessions(agentRoot, options));
182
+ if (successor)
183
+ (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.app_sessions_handoff_found", message: "found the successor that a session was handed off to", meta: { session: row.id, successor } });
184
+ return successor !== null;
85
185
  }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FINISHED_IDLE_MS = exports.HANDOFF_QUIET_MS = void 0;
4
+ exports.childrenNote = childrenNote;
5
+ exports.retireSessions = retireSessions;
6
+ const runtime_1 = require("../../nerves/runtime");
7
+ const owner_notice_1 = require("../shepherd/owner-notice");
8
+ const app_interface_1 = require("./app-interface");
9
+ const handoff_1 = require("./handoff");
10
+ const size_watch_1 = require("./size-watch");
11
+ /**
12
+ * The sidebar shows live jobs only. Each minute, with no model turn, two kinds of session leave it, through the app's
13
+ * archive (reversible, worktree kept), logged and listed in the status digest:
14
+ *
15
+ * - **Handed off.** A session whose job has a newer owner: a later session's first message says `Succeeds: <its id>`
16
+ * (see `handoff.ts`). It goes once that successor has finished its first turn and it has itself been idle for
17
+ * `HANDOFF_QUIET_MS`, whatever its size.
18
+ * - **Finished.** An idle session whose coordinator is archived or gone, with no open pull request and no automation,
19
+ * and no turn for `FINISHED_IDLE_MS`.
20
+ *
21
+ * Neither ever goes while it runs, waits on a person (a question, plan or permission) or is stuck, or while a session it
22
+ * coordinates still does: the app archives a session without its children, which keep running but can no longer report
23
+ * to it, so a predecessor stays until its children are idle, and its successor is then told which children it had.
24
+ */
25
+ exports.HANDOFF_QUIET_MS = 5 * 60_000;
26
+ /** A day: an orphan quiet this long has had a full day for its coordinator's successor to pick it up. */
27
+ exports.FINISHED_IDLE_MS = 24 * 3_600_000;
28
+ const quietSince = (row) => Math.max(Date.parse(row.lastActivity ?? "") || 0, Date.parse(row.updatedAt ?? "") || 0);
29
+ const settled = (row) => !row.isRunning && row.state === "idle" && !row.awaiting && !row.remote;
30
+ const coordinatorOf = (row) => row.coordinatingCreatorSessionId ?? row.parentSessionId;
31
+ const short = (id) => id.slice(0, 8);
32
+ function childrenNote(predecessor, children) {
33
+ const list = children.map(child => `"${(0, owner_notice_1.plain)(child.name, 60)}" (${child.id})`).join(", ");
34
+ return `I archived "${(0, owner_notice_1.plain)(predecessor.name, 60)}" (${predecessor.id}), the session you succeed, now that you have taken over and it is idle. It coordinated ${list}. They are idle and can no longer report to it; message them by id if their work continues. The archive is reversible from the app.`;
35
+ }
36
+ /** Archive the handed-off and the finished sessions among `rows`. Returns the ids archived. */
37
+ async function retireSessions(agentRoot, rows, deps) {
38
+ const send = deps.send ?? ((id, text) => (0, app_interface_1.deliverMessage)(id, text, "immediate", deps.client));
39
+ const archive = deps.archive ?? (async (row, reason, note) => (await (0, app_interface_1.archiveRow)(agentRoot, row, reason, deps.client, { note, keepWorktree: true })).ok === true);
40
+ const successions = (0, handoff_1.refreshSuccessions)(agentRoot, deps.client, deps.now);
41
+ const listed = new Map(rows.map(row => [row.id, row]));
42
+ const childrenOf = (id) => rows.filter(row => coordinatorOf(row) === id);
43
+ const busyChildren = (id, except) => childrenOf(id).filter(child => child.id !== except && !(settled(child) || (child.remote && !child.isRunning)));
44
+ const archived = [];
45
+ for (const row of rows) {
46
+ if (!settled(row) || deps.now - quietSince(row) < exports.HANDOFF_QUIET_MS)
47
+ continue;
48
+ const direct = Object.entries(successions).find(([, entry]) => entry.predecessor === row.id && entry.turned)?.[0];
49
+ if (!direct)
50
+ continue;
51
+ const successor = (0, handoff_1.successorOf)(row.id, successions);
52
+ if (!successor)
53
+ continue;
54
+ const busy = busyChildren(row.id, direct);
55
+ if (busy.length) {
56
+ (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.app_sessions_handoff_held", message: "held a handed-off session while sessions it coordinates still work", meta: { session: row.id, successor, children: busy.map(child => child.id) } });
57
+ continue;
58
+ }
59
+ const heir = listed.get(successor);
60
+ // The app deletes an archived session's automation, and restoring it does not bring it back.
61
+ const note = `succeeded by ${heir ? `"${(0, owner_notice_1.plain)(heir.name, 60)}" ` : ""}(${short(successor)}); ${(0, size_watch_1.whereItLeftOff)(row, deps.client)}${row.automation ? "; its automation was removed with it" : ""}`;
62
+ if (!(await archive(row, "handed-off", note).catch(() => false)))
63
+ continue;
64
+ archived.push(row.id);
65
+ (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.app_sessions_handoff_archived", message: "archived a session whose successor took over", meta: { session: row.id, successor } });
66
+ const orphans = childrenOf(row.id).filter(child => child.id !== direct && child.id !== successor);
67
+ if (orphans.length && heir)
68
+ await send(successor, childrenNote(row, orphans)).catch(() => undefined);
69
+ }
70
+ for (const row of rows) {
71
+ if (archived.includes(row.id) || !settled(row) || row.openPullRequest || row.automation)
72
+ continue;
73
+ const coordinator = coordinatorOf(row);
74
+ if (!coordinator || (listed.has(coordinator) && !archived.includes(coordinator)))
75
+ continue;
76
+ if (deps.now - quietSince(row) < exports.FINISHED_IDLE_MS || busyChildren(row.id, null).length)
77
+ continue;
78
+ const note = `${row.detail || "idle"}; ${(0, size_watch_1.whereItLeftOff)(row, deps.client)}`;
79
+ if (!(await archive(row, "finished", note).catch(() => false)))
80
+ continue;
81
+ archived.push(row.id);
82
+ (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.app_sessions_finished_archived", message: "archived an idle session whose coordinator is gone", meta: { session: row.id, coordinator } });
83
+ }
84
+ return archived;
85
+ }
@@ -54,6 +54,7 @@ const digest_push_1 = require("./digest-push");
54
54
  const client_1 = require("./client");
55
55
  const prompts_1 = require("./prompts");
56
56
  const store_1 = require("./store");
57
+ const retire_1 = require("./retire");
57
58
  const size_watch_1 = require("./size-watch");
58
59
  const waiting_prompts_1 = require("./waiting-prompts");
59
60
  const wake_runner_1 = require("./wake-runner");
@@ -254,7 +255,14 @@ function startAppSessionsSense(options) {
254
255
  waitingPoll = waitingPoll.then(() => recordSnapshot(agentRoot, client, now())).then(taken => (0, waiting_prompts_1.noticeWaitingPrompts)(agentRoot, taken, { notify: notifyOwner, now: now() })).catch((error) => {
255
256
  (0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.app_sessions_waiting_error", message: "could not check the sessions waiting on a prompt", meta: { error: error.message } });
256
257
  });
257
- sizePoll = sizePoll.then(async () => (0, size_watch_1.noticeOversizedSessions)(agentRoot, await (0, client_1.listAppSessions)({ ...client, now: () => now() }), { notify: notifyOwner, now: now(), client, ...(options.memory ? { memory: options.memory } : {}) })).then(() => undefined).catch((error) => {
258
+ sizePoll = sizePoll.then(async () => {
259
+ const rows = await (0, client_1.listAppSessions)({ ...client, now: () => now() });
260
+ const retired = await (0, retire_1.retireSessions)(agentRoot, rows, { now: now(), client }).catch((error) => {
261
+ (0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.app_sessions_retire_error", message: "could not retire handed-off or finished sessions", meta: { error: error.message } });
262
+ return [];
263
+ });
264
+ await (0, size_watch_1.noticeOversizedSessions)(agentRoot, rows.filter(row => !retired.includes(row.id)), { notify: notifyOwner, now: now(), client, ...(options.memory ? { memory: options.memory } : {}) });
265
+ }).catch((error) => {
258
266
  (0, runtime_1.emitNervesEvent)({ level: "warn", component: "senses", event: "senses.app_sessions_oversize_error", message: "could not check the sessions' history sizes", meta: { error: error.message } });
259
267
  });
260
268
  cancelSnapshot = schedule(snapshotTick, exports.SNAPSHOT_MS);
@@ -76,9 +76,9 @@ exports.readOversize = readOversize;
76
76
  const neverResume = (agentRoot) => Object.keys((0, exports.readOversize)(agentRoot));
77
77
  exports.neverResume = neverResume;
78
78
  const mb = (bytes) => bytes >= 1024 ** 3 ? `${(bytes / 1024 ** 3).toFixed(1)} GB` : `${Math.round(bytes / 1024 ** 2)} MB`;
79
- function handoffNudge(name, bytes, asked = 0, askedAtBytes) {
79
+ function handoffNudge(name, bytes, asked = 0, askedAtBytes, id = "<its session id>") {
80
80
  const again = asked ? ` This is ask ${asked + 1}${askedAtBytes ? `: it was ${mb(askedAtBytes)} at the last one and is still growing` : ""}.` : "";
81
- return `The session "${(0, owner_notice_1.plain)(name, 60)}" has a ${mb(bytes)} history, over the ${mb(exports.OVERSIZE_BYTES)} limit: the app loads all of it into memory every time that session resumes, and a few like it froze this Mac.${again} Please hand it off now: write a checkpoint of its purpose and open work, start a fresh successor session that reads that checkpoint plus the tail of the old log, then archive the old one. This goes to the session and to its coordinator; the coordinator starts the successor when there is one. Once it has been idle for ${exports.IDLE_ARCHIVE_MS / 60_000} minutes it is archived for you (reversibly) to free its memory. Keep images out of chat (save screenshots and art as files and link the path): inline images are nearly all of the size.`;
81
+ return `The session "${(0, owner_notice_1.plain)(name, 60)}" has a ${mb(bytes)} history, over the ${mb(exports.OVERSIZE_BYTES)} limit: the app loads all of it into memory every time that session resumes, and a few like it froze this Mac.${again} Please hand it off now: write a checkpoint of its purpose and open work, then start a fresh successor session whose first message begins with the line \`Succeeds: ${id}\` and has it read that checkpoint plus the tail of the old log. That line is how the old session is retired: it is archived for you (reversibly) once the successor has taken its first turn and the old one is idle, or in any case once it has been idle ${exports.IDLE_ARCHIVE_MS / 60_000} minutes after this ask. This goes to the session and to its coordinator; the coordinator starts the successor when there is one. Keep images out of chat (save screenshots and art as files and link the path): inline images are nearly all of the size.`;
82
82
  }
83
83
  function archivedNote(name, id, bytes, where) {
84
84
  return `I archived the session "${(0, owner_notice_1.plain)(name, 60)}" (${id}) to free memory: its ${mb(bytes)} history is over the ${mb(exports.OVERSIZE_BYTES)} limit and it sat idle after the hand-off ask. The archive is reversible from the app, and its worktree was kept. Where it left off: ${where}. If its work is not finished, start a fresh successor session from there and the tail of its log (~/.copilot/session-state/${id}/events.jsonl).`;
@@ -203,7 +203,7 @@ async function noticeOversizedSessions(agentRoot, rows, deps) {
203
203
  }
204
204
  // An entry from before asks were counted had one ask.
205
205
  const asked = entry.nudges ?? (entry.nudgedAt ? 1 : 0);
206
- const text = handoffNudge(row.name, entry.bytes, asked, entry.nudgedBytes);
206
+ const text = handoffNudge(row.name, entry.bytes, asked, entry.nudgedBytes, row.id);
207
207
  const reached = [];
208
208
  for (const id of to)
209
209
  if ((await send(id, text).catch(failed)).ok)
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1160",
3
+ "version": "0.1.0-alpha.1161",
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.1160",
9
+ "version": "0.1.0-alpha.1161",
10
+ "bundleDependencies": [
11
+ "@ouro.bot/friends"
12
+ ],
10
13
  "dependencies": {
11
14
  "@anthropic-ai/sdk": "^0.78.0",
12
15
  "@ouro.bot/friends": "0.1.0-alpha.18",
@@ -1427,6 +1430,7 @@
1427
1430
  "version": "0.1.0-alpha.18",
1428
1431
  "resolved": "https://registry.npmjs.org/@ouro.bot/friends/-/friends-0.1.0-alpha.18.tgz",
1429
1432
  "integrity": "sha512-28DqPjiZ3kOVNBbFNGWqvfRO11xDn7V0ggaMUZvSx8pY9rHgnbMRzSc5NPtdjDTUpaYS28mRQCNqTgx+R5F8fQ==",
1433
+ "inBundle": true,
1430
1434
  "license": "Apache-2.0",
1431
1435
  "dependencies": {
1432
1436
  "libsodium-wrappers": "0.8.4"
@@ -5761,12 +5765,14 @@
5761
5765
  "version": "0.8.4",
5762
5766
  "resolved": "https://registry.npmjs.org/libsodium/-/libsodium-0.8.4.tgz",
5763
5767
  "integrity": "sha512-lMcYaRi0zcs7tarATsQUYC7rstliIXZuoq0c6zXSgNtSNtdvBgkSegjWhpMJAXzKX3SUSwIp7+zEsob+j3LuRw==",
5768
+ "inBundle": true,
5764
5769
  "license": "ISC"
5765
5770
  },
5766
5771
  "node_modules/libsodium-wrappers": {
5767
5772
  "version": "0.8.4",
5768
5773
  "resolved": "https://registry.npmjs.org/libsodium-wrappers/-/libsodium-wrappers-0.8.4.tgz",
5769
5774
  "integrity": "sha512-mu8aAWucZjTB5O/BtGXtW4e1agy7uHxNYG7zPthmmD1jU43LCDmSWZLN4JhflbdPXj3yDO4lxM1O9hLDgIOXDw==",
5775
+ "inBundle": true,
5770
5776
  "license": "ISC",
5771
5777
  "dependencies": {
5772
5778
  "libsodium": "^0.8.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1160",
3
+ "version": "0.1.0-alpha.1161",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },