@ouro.bot/cli 0.1.0-alpha.1473 → 0.1.0-alpha.1475

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,30 @@
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.1475",
6
+ "changes": [
7
+ "When a release's verify-npm step still sees the `latest` tag behind the version it published after its 10-minute wait, it now prints read-only diagnostics from several registry read paths (npm view dist-tags, `npm dist-tag ls`, the registry's dist-tags endpoint with its cache headers, and recent publish times) before failing. The wait length and the failure are unchanged; the diagnostics record what each path returned, not a cause."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1474",
12
+ "changes": [
13
+ "Once an agent's mail is hosted (`mailroom.azureAccountUrl`), the daemon gzips the leftover local mail file store (`state/mailroom/messages` and `raw`), for messages older than 30 days. It never touches the file store while it holds the agent's mail, or when the daemon can't tell where the mail lives. It keeps `registry.json`, checks every gzip before removing the original, and logs counts only (`daemon.state_retention_mailroom`)."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1473",
6
18
  "changes": [
7
- "Update the Ouro UI files to Ouro UI v1.3.486.",
8
19
  "The daemon now gzips session archives (`*.archive.ndjson`) that nothing has written for a week, 10 minutes after it starts and then once a day. Nothing has read these files since May 2026. Each gzip is checked to give back the same bytes before the original is removed, and the daemon logs counts only (`daemon.state_retention_session_archives`)."
9
20
  ]
10
21
  },
22
+ {
23
+ "version": "0.1.0-alpha.1472",
24
+ "changes": [
25
+ "Update the Ouro UI files to Ouro UI v1.3.486."
26
+ ]
27
+ },
11
28
  {
12
29
  "version": "0.1.0-alpha.1471",
13
30
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1473",
2
+ "runtimeVersion": "0.1.0-alpha.1475",
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.1473</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1475</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -34,6 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.compactLegacySessionArchives = compactLegacySessionArchives;
37
+ exports.compactUnusedMailroomFileStore = compactUnusedMailroomFileStore;
38
+ exports.mailroomStoreFromRuntimeConfig = mailroomStoreFromRuntimeConfig;
37
39
  exports.runAgentStateRetention = runAgentStateRetention;
38
40
  const crypto_1 = require("crypto");
39
41
  const fs = __importStar(require("fs"));
@@ -42,8 +44,11 @@ const stream_1 = require("stream");
42
44
  const promises_1 = require("stream/promises");
43
45
  const zlib = __importStar(require("zlib"));
44
46
  const runtime_1 = require("../../nerves/runtime");
47
+ const runtime_credentials_1 = require("../runtime-credentials");
45
48
  const ARCHIVE_SUFFIX = ".archive.ndjson";
46
49
  const DEFAULT_MIN_IDLE_MS = 7 * 24 * 60 * 60_000;
50
+ const MAILROOM_MIN_IDLE_MS = 30 * 24 * 60 * 60_000;
51
+ const MAILROOM_FILE_STORE_DIRS = ["messages", "raw"];
47
52
  function emptyResult() {
48
53
  return { compacted: 0, skippedRecent: 0, failed: 0, bytesBefore: 0, bytesAfter: 0 };
49
54
  }
@@ -121,17 +126,15 @@ async function compactArchive(file, before, beforeCommit) {
121
126
  throw error;
122
127
  }
123
128
  }
124
- async function compactLegacySessionArchives(input) {
125
- const now = (input.now ?? Date.now)();
126
- const minIdleMs = input.minIdleMs ?? DEFAULT_MIN_IDLE_MS;
129
+ async function compactFiles(files, now, minIdleMs, beforeCommit) {
127
130
  const result = emptyResult();
128
- for (const file of findArchives(input.sessionsRoot)) {
131
+ for (const file of files) {
129
132
  const before = fs.statSync(file);
130
133
  if (now - before.mtimeMs < minIdleMs) {
131
134
  result.skippedRecent += 1;
132
135
  continue;
133
136
  }
134
- const packedSize = await compactArchive(file, before, input.beforeCommit).catch(() => null);
137
+ const packedSize = await compactArchive(file, before, beforeCommit).catch(() => null);
135
138
  if (packedSize === null) {
136
139
  result.failed += 1;
137
140
  continue;
@@ -142,6 +145,40 @@ async function compactLegacySessionArchives(input) {
142
145
  }
143
146
  return result;
144
147
  }
148
+ async function compactLegacySessionArchives(input) {
149
+ return compactFiles(findArchives(input.sessionsRoot), (input.now ?? Date.now)(), input.minIdleMs ?? DEFAULT_MIN_IDLE_MS, input.beforeCommit);
150
+ }
151
+ function findMailroomFiles(root) {
152
+ return MAILROOM_FILE_STORE_DIRS.flatMap((dir) => {
153
+ const full = path.join(root, dir);
154
+ let entries;
155
+ try {
156
+ entries = fs.readdirSync(full, { withFileTypes: true });
157
+ }
158
+ catch {
159
+ return [];
160
+ }
161
+ return entries
162
+ .filter((entry) => entry.isFile() && !entry.name.endsWith(".gz") && !entry.name.includes(".gz.tmp-"))
163
+ .map((entry) => path.join(full, entry.name))
164
+ .sort();
165
+ });
166
+ }
167
+ /** Gzips the local mailroom file store's messages, only once the agent's mail is hosted somewhere else. */
168
+ async function compactUnusedMailroomFileStore(input) {
169
+ if (input.store !== "hosted")
170
+ return { store: input.store, ...emptyResult() };
171
+ const result = await compactFiles(findMailroomFiles(input.mailroomRoot), (input.now ?? Date.now)(), input.minIdleMs ?? MAILROOM_MIN_IDLE_MS);
172
+ return { store: input.store, ...result };
173
+ }
174
+ /** Where the agent's mail lives, by the same rule as `mailroom/reader.ts`: hosted when it names an Azure account. */
175
+ function mailroomStoreFromRuntimeConfig(runtime) {
176
+ if (!runtime.ok)
177
+ return "unknown";
178
+ const mailroom = runtime.config?.mailroom;
179
+ const account = mailroom && typeof mailroom === "object" ? mailroom.azureAccountUrl : undefined;
180
+ return typeof account === "string" && account.trim().length > 0 ? "hosted" : "local";
181
+ }
145
182
  /** Runs retention for each agent in turn; one agent's failure doesn't stop the rest. Telemetry is counts only. */
146
183
  async function runAgentStateRetention(input) {
147
184
  const compactSessions = input.compactSessions ?? compactLegacySessionArchives;
@@ -156,7 +193,19 @@ async function runAgentStateRetention(input) {
156
193
  message: "gzipped session archives nothing reads any more",
157
194
  meta: { agent, ...sessionArchives },
158
195
  });
159
- results.push({ agent, sessionArchives });
196
+ const store = (input.mailroomStore ?? ((name) => mailroomStoreFromRuntimeConfig((0, runtime_credentials_1.readRuntimeCredentialConfig)(name))))(agent);
197
+ const mailroom = await compactUnusedMailroomFileStore({
198
+ mailroomRoot: path.join(input.bundlesRoot, `${agent}.ouro`, "state", "mailroom"),
199
+ store,
200
+ now: input.now,
201
+ });
202
+ (0, runtime_1.emitNervesEvent)({
203
+ component: "daemon",
204
+ event: "daemon.state_retention_mailroom",
205
+ message: "gzipped the local mail file store once the agent's mail is hosted",
206
+ meta: { agent, ...mailroom },
207
+ });
208
+ results.push({ agent, sessionArchives, mailroom });
160
209
  }
161
210
  catch (error) {
162
211
  (0, runtime_1.emitNervesEvent)({
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1473",
3
+ "version": "0.1.0-alpha.1475",
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.1473",
9
+ "version": "0.1.0-alpha.1475",
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.1473",
3
+ "version": "0.1.0-alpha.1475",
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": {