@ouro.bot/cli 0.1.0-alpha.1025 → 0.1.0-alpha.1029
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,18 @@
|
|
|
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.1029",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Account pool: the fleet burn file is named by this Mac's LocalHostName (else the host name), so two Macs with a generic host name such as \"Mac\" never write the same file."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1026",
|
|
12
|
+
"changes": [
|
|
13
|
+
"Private-runtime sessions no longer grow without bound: superseded system prompts are dropped from session history, so a long-running agent's dialog.json stays small instead of reaching hundreds of megabytes and running Node out of memory."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1025",
|
|
6
18
|
"changes": [
|
|
@@ -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.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1029</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,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.AccountPool = exports.accountKey = void 0;
|
|
37
|
+
exports.defaultMachineName = defaultMachineName;
|
|
37
38
|
exports.apiBaseForHost = apiBaseForHost;
|
|
38
39
|
exports.isWorkAccount = isWorkAccount;
|
|
39
40
|
exports.globMatch = globMatch;
|
|
@@ -59,6 +60,21 @@ const tranche_1 = require("../quota/tranche");
|
|
|
59
60
|
const fleet_readings_1 = require("../quota/fleet-readings");
|
|
60
61
|
const accountKey = (account) => `${account.login}@${account.host}`;
|
|
61
62
|
exports.accountKey = accountKey;
|
|
63
|
+
/**
|
|
64
|
+
* This Mac's name for the fleet gist: macOS's LocalHostName (unique on the network, and what the fleet tooling
|
|
65
|
+
* keys Macs by), else the host name, lowercased with no dots. Generic host names such as "Mac" would make two
|
|
66
|
+
* machines write one file.
|
|
67
|
+
*/
|
|
68
|
+
function defaultMachineName(deps = {}) {
|
|
69
|
+
let name = "";
|
|
70
|
+
if ((deps.platform ?? process.platform) === "darwin") {
|
|
71
|
+
const result = spawnOf(deps)("/usr/sbin/scutil", ["--get", "LocalHostName"], { encoding: "utf8", timeout: 3000 });
|
|
72
|
+
name = result.status === 0 ? String(result.stdout ?? "").trim() : "";
|
|
73
|
+
}
|
|
74
|
+
if (!name)
|
|
75
|
+
name = (deps.hostname ?? os.hostname)().split(".")[0];
|
|
76
|
+
return name.toLowerCase().replace(/[^a-z0-9-]+/g, "-");
|
|
77
|
+
}
|
|
62
78
|
function apiBaseForHost(host) {
|
|
63
79
|
return host === "github.com" ? "https://api.github.com" : `https://api.${host}`;
|
|
64
80
|
}
|
|
@@ -272,6 +288,7 @@ class AccountPool {
|
|
|
272
288
|
lastPublish = -Infinity;
|
|
273
289
|
lastPublished = "";
|
|
274
290
|
loadedReadings = false;
|
|
291
|
+
machineName = null;
|
|
275
292
|
refreshing = null;
|
|
276
293
|
options;
|
|
277
294
|
constructor(accounts, options) {
|
|
@@ -441,7 +458,7 @@ class AccountPool {
|
|
|
441
458
|
this.lastPublished = signature;
|
|
442
459
|
void publish({
|
|
443
460
|
agent: this.options.agent,
|
|
444
|
-
machine: this.options.machine ??
|
|
461
|
+
machine: this.options.machine ?? (this.machineName ??= (this.options.machineName ?? defaultMachineName)()),
|
|
445
462
|
at: new Date(now).toISOString(),
|
|
446
463
|
...content,
|
|
447
464
|
});
|
|
@@ -1395,6 +1395,42 @@ function retainedSourceEventIds(message, existing, used) {
|
|
|
1395
1395
|
&& messageFingerprint(candidate, true) === fingerprint);
|
|
1396
1396
|
return originals.some(matches) || sanitizeProviderMessages(originals).some(matches) ? ids : null;
|
|
1397
1397
|
}
|
|
1398
|
+
/**
|
|
1399
|
+
* The system prompt is rebuilt every turn (it carries live world state), so each turn used to add
|
|
1400
|
+
* a full copy to native history: one long-running private-runtime session held 3,773 of them (329 MB of
|
|
1401
|
+
* 357 MB) and parsing it ran Node out of memory. A system prompt the projection no longer uses is
|
|
1402
|
+
* not conversation, so it is dropped once superseded. System records without text (redaction
|
|
1403
|
+
* markers), events anything refers to, and the newest event (so sequence numbers never repeat)
|
|
1404
|
+
* are always kept.
|
|
1405
|
+
*/
|
|
1406
|
+
function dropSupersededSystemPrompts(events, projectionEventIds, approvalSuspensions) {
|
|
1407
|
+
if (projectionEventIds.length === 0)
|
|
1408
|
+
return events;
|
|
1409
|
+
const keep = new Set(projectionEventIds);
|
|
1410
|
+
for (const event of events) {
|
|
1411
|
+
const relations = event.relations;
|
|
1412
|
+
for (const id of [relations.replyToEventId, relations.threadRootEventId, relations.supersedesEventId, relations.redactsEventId, ...relations.references]) {
|
|
1413
|
+
if (id)
|
|
1414
|
+
keep.add(id);
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
for (const id of JSON.stringify(approvalSuspensions ?? []).match(/evt-\d+/g) ?? [])
|
|
1418
|
+
keep.add(id);
|
|
1419
|
+
const newestSequence = events.reduce((max, event) => Math.max(max, event.sequence), -Infinity);
|
|
1420
|
+
const kept = events.filter((event) => event.role !== "system"
|
|
1421
|
+
|| typeof event.content !== "string"
|
|
1422
|
+
|| keep.has(event.id)
|
|
1423
|
+
|| event.sequence === newestSequence);
|
|
1424
|
+
if (kept.length < events.length) {
|
|
1425
|
+
(0, runtime_1.emitNervesEvent)({
|
|
1426
|
+
component: "mind",
|
|
1427
|
+
event: "mind.session_system_prompts_dropped",
|
|
1428
|
+
message: "dropped superseded system prompts from session history",
|
|
1429
|
+
meta: { dropped: events.length - kept.length, kept: kept.length },
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
return kept;
|
|
1433
|
+
}
|
|
1398
1434
|
function buildCanonicalSessionEnvelope(options) {
|
|
1399
1435
|
const existing = options.existing;
|
|
1400
1436
|
// Callers pass pre-sanitized messages + pre-captured ingress times.
|
|
@@ -1474,14 +1510,15 @@ function buildCanonicalSessionEnvelope(options) {
|
|
|
1474
1510
|
usedEventIds.add(id);
|
|
1475
1511
|
}
|
|
1476
1512
|
const projectionEventIds = selectProjectedEventIds(currentMessages, currentEventIds, trimmedMessages);
|
|
1513
|
+
const keptEvents = dropSupersededSystemPrompts(events, projectionEventIds, existing?.approvalSuspensions);
|
|
1477
1514
|
// Projection omissions are not authority to delete native history.
|
|
1478
1515
|
const projectionIdSet = new Set(projectionEventIds);
|
|
1479
|
-
const effectiveEvents = selectEffectiveSessionEvents(
|
|
1516
|
+
const effectiveEvents = selectEffectiveSessionEvents(keptEvents);
|
|
1480
1517
|
const effectiveIds = new Set(effectiveEvents.map((event) => event.id));
|
|
1481
1518
|
const evictedEvents = effectiveEvents.filter((event) => !projectionIdSet.has(event.id));
|
|
1482
1519
|
const envelope = {
|
|
1483
1520
|
version: 2,
|
|
1484
|
-
events,
|
|
1521
|
+
events: keptEvents,
|
|
1485
1522
|
projection: {
|
|
1486
1523
|
eventIds: projectionEventIds.filter((id) => effectiveIds.has(id)),
|
|
1487
1524
|
trimmed: evictedEvents.length > 0,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1029",
|
|
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.
|
|
9
|
+
"version": "0.1.0-alpha.1029",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.17",
|