@ouro.bot/cli 0.1.0-alpha.1041 → 0.1.0-alpha.1046
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.1046",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Account pool: the fleet gist write cadence (at most every 30 minutes) is shared by all of an agent's processes through state/account-burn-published.json, not kept per process."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1041",
|
|
6
12
|
"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.1046</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -449,7 +449,10 @@ class AccountPool {
|
|
|
449
449
|
const now = this.now();
|
|
450
450
|
const publish = this.options.publishBurn;
|
|
451
451
|
const loaded = this.loadedReadings || !this.options.loadReadings;
|
|
452
|
-
if (!publish || !loaded
|
|
452
|
+
if (!publish || !loaded)
|
|
453
|
+
return;
|
|
454
|
+
this.loadSharedPublish();
|
|
455
|
+
if (now - this.lastPublish < (this.options.publishMs ?? 30 * 60 * 1000))
|
|
453
456
|
return;
|
|
454
457
|
const content = {
|
|
455
458
|
current: this.currentKey,
|
|
@@ -465,6 +468,7 @@ class AccountPool {
|
|
|
465
468
|
return;
|
|
466
469
|
this.lastPublish = now;
|
|
467
470
|
this.lastPublished = signature;
|
|
471
|
+
this.saveSharedPublish();
|
|
468
472
|
void publish({
|
|
469
473
|
agent: this.options.agent,
|
|
470
474
|
machine: this.options.machine ?? (this.machineName ??= (this.options.machineName ?? defaultMachineName)()),
|
|
@@ -472,6 +476,44 @@ class AccountPool {
|
|
|
472
476
|
...content,
|
|
473
477
|
});
|
|
474
478
|
}
|
|
479
|
+
/** Take in a later gist write by another of the agent's processes. */
|
|
480
|
+
loadSharedPublish() {
|
|
481
|
+
const file = this.options.publishedFile;
|
|
482
|
+
if (!file)
|
|
483
|
+
return;
|
|
484
|
+
try {
|
|
485
|
+
const shared = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
486
|
+
if (typeof shared.at === "number" && shared.at > this.lastPublish) {
|
|
487
|
+
this.lastPublish = shared.at;
|
|
488
|
+
this.lastPublished = typeof shared.signature === "string" ? shared.signature : "";
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
catch {
|
|
492
|
+
// No file yet, or another process is mid-write.
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/** Claim this write before it goes out, so the agent's other processes hold off. */
|
|
496
|
+
saveSharedPublish() {
|
|
497
|
+
const file = this.options.publishedFile;
|
|
498
|
+
if (!file)
|
|
499
|
+
return;
|
|
500
|
+
try {
|
|
501
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
502
|
+
const temp = `${file}.${process.pid}.tmp`;
|
|
503
|
+
fs.writeFileSync(temp, JSON.stringify({ at: this.lastPublish, signature: this.lastPublished }));
|
|
504
|
+
fs.renameSync(temp, file);
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
(0, runtime_1.emitNervesEvent)({
|
|
508
|
+
level: "warn",
|
|
509
|
+
component: "engine",
|
|
510
|
+
event: "engine.account_publish_share_failed",
|
|
511
|
+
message: "could not share the gist write time with the agent's other processes",
|
|
512
|
+
// fs only throws Errors.
|
|
513
|
+
meta: { agent: this.options.agent, error: error.message },
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
}
|
|
475
517
|
/** Share this process's last-hour request times with the agent's other processes. */
|
|
476
518
|
shareRequests() {
|
|
477
519
|
const dir = this.options.burnDir;
|
|
@@ -86,6 +86,7 @@ function createGithubCopilotPooledCaller(config, owner) {
|
|
|
86
86
|
switchLog: path.join(owner.agentRoot, "state", "account-switches.jsonl"),
|
|
87
87
|
burnDir: path.join(owner.agentRoot, "state", "account-burn"),
|
|
88
88
|
refusalsFile: path.join(owner.agentRoot, "state", "account-refusals.json"),
|
|
89
|
+
publishedFile: path.join(owner.agentRoot, "state", "account-burn-published.json"),
|
|
89
90
|
/* v8 ignore start -- network readers and publisher: each is tested in its own module @preserve */
|
|
90
91
|
loadReadings: async () => (0, fleet_readings_1.mergeReadings)(await (0, fleet_readings_1.loadFleetQuota)(gist), await (0, account_pool_1.fetchDirectReadings)(accounts)),
|
|
91
92
|
publishBurn: gist ? (burn) => (0, fleet_readings_1.publishAgentBurn)(gist, burn) : undefined,
|
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.1046",
|
|
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.1046",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|