@ouro.bot/cli 0.1.0-alpha.1005 → 0.1.0-alpha.1006
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 +6 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/awaiting/await-scheduler.js +12 -0
- package/dist/heart/daemon/daemon-entry.js +2 -2
- package/dist/heart/daemon/doctor.js +1 -1
- package/dist/heart/daemon/os-cron.js +23 -1
- package/dist/heart/habits/habit-scheduler.js +14 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
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.1006",
|
|
6
|
+
"changes": [
|
|
7
|
+
"On Linux outside a container, habits and awaits fire from the daemon's own timers instead of writing launchd plists and spawning launchctl, and are no longer reported as degraded. macOS keeps launchd and containers keep supercronic."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1005",
|
|
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.1006</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -253,6 +253,18 @@ class AwaitScheduler {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
verifyCronAndCreateFallbacks(jobs) {
|
|
256
|
+
if (this.osCronManager.firesInProcess) {
|
|
257
|
+
// Nothing is registered with the OS: every await runs on an in-process timer, which is not degraded.
|
|
258
|
+
for (const job of jobs) {
|
|
259
|
+
const bareName = job.taskId.slice(exports.AWAIT_CRON_LABEL_PREFIX_MARKER.length + 1);
|
|
260
|
+
const ms = (0, cadence_1.parseCadenceToMs)(this.getAwaitFile(bareName)?.cadence);
|
|
261
|
+
if (ms !== null)
|
|
262
|
+
this.createTimerFallback(bareName, ms);
|
|
263
|
+
else
|
|
264
|
+
this.degradedAwaitNames.set(bareName, "cadence cannot be scheduled with an in-process timer");
|
|
265
|
+
}
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
256
268
|
if (!this.execForVerify && !this.verifyJobs)
|
|
257
269
|
return;
|
|
258
270
|
const verifiedLabels = this.verifyJobs?.(jobs)
|
|
@@ -748,7 +748,7 @@ void (0, daemon_bootstrap_startup_1.startDaemonAfterContainerCredentialBootstrap
|
|
|
748
748
|
(0, habit_migration_1.migrateHabitsFromTaskSystem)(bundleRoot);
|
|
749
749
|
const osCronManager = supercronicSupervisor
|
|
750
750
|
? supercronicSupervisor.namespace(`habit:${agent}`)
|
|
751
|
-
: new os_cron_1.LaunchdCronManager(osCronDeps, { ownsLabel: habitCronLabelOwner(agent) });
|
|
751
|
+
: (0, os_cron_1.hostOsCronManager)(process.platform, () => new os_cron_1.LaunchdCronManager(osCronDeps, { ownsLabel: habitCronLabelOwner(agent) }));
|
|
752
752
|
const scheduler = new habit_scheduler_1.HabitScheduler({
|
|
753
753
|
agent,
|
|
754
754
|
habitsDir,
|
|
@@ -847,7 +847,7 @@ void (0, daemon_bootstrap_startup_1.startDaemonAfterContainerCredentialBootstrap
|
|
|
847
847
|
try {
|
|
848
848
|
const awaitOsCronManager = supercronicSupervisor
|
|
849
849
|
? supercronicSupervisor.namespace(`await:${agent}`)
|
|
850
|
-
: new os_cron_1.LaunchdCronManager(osCronDeps, { ownsLabel: awaitCronLabelOwner(agent) });
|
|
850
|
+
: (0, os_cron_1.hostOsCronManager)(process.platform, () => new os_cron_1.LaunchdCronManager(osCronDeps, { ownsLabel: awaitCronLabelOwner(agent) }));
|
|
851
851
|
const awaitScheduler = new await_scheduler_1.AwaitScheduler({
|
|
852
852
|
agent,
|
|
853
853
|
awaitsDir,
|
|
@@ -641,7 +641,7 @@ function checkHabits(deps) {
|
|
|
641
641
|
checks.push({
|
|
642
642
|
label: `${agentDir} launchd plists`,
|
|
643
643
|
status: "pass",
|
|
644
|
-
detail: `launchd not applicable on ${platform}; scheduled habits
|
|
644
|
+
detail: `launchd not applicable on ${platform}; scheduled habits fire from the daemon's timers, or supercronic in a container`,
|
|
645
645
|
});
|
|
646
646
|
continue;
|
|
647
647
|
}
|
|
@@ -33,7 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.CrontabCronManager = exports.LaunchdCronManager = void 0;
|
|
36
|
+
exports.InProcessCronManager = exports.CrontabCronManager = exports.LaunchdCronManager = void 0;
|
|
37
|
+
exports.hostOsCronManager = hostOsCronManager;
|
|
37
38
|
exports.createOsCronManager = createOsCronManager;
|
|
38
39
|
exports.cadenceToSeconds = cadenceToSeconds;
|
|
39
40
|
exports.scheduleToCalendarInterval = scheduleToCalendarInterval;
|
|
@@ -240,6 +241,27 @@ class CrontabCronManager {
|
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
243
|
exports.CrontabCronManager = CrontabCronManager;
|
|
244
|
+
/**
|
|
245
|
+
* For hosts with no per-user scheduler we can own: the daemon's in-process
|
|
246
|
+
* timers fire every job, so nothing is written to the OS. A Linux appliance's
|
|
247
|
+
* crontab is shared with the system, and a supervised daemon (`ouro service`)
|
|
248
|
+
* is already running whenever a timer is due.
|
|
249
|
+
*/
|
|
250
|
+
class InProcessCronManager {
|
|
251
|
+
firesInProcess = true;
|
|
252
|
+
sync(jobs) {
|
|
253
|
+
(0, runtime_1.emitNervesEvent)({ component: "daemon", event: "daemon.os_cron_in_process", message: "scheduled jobs fire from in-process timers", meta: { jobCount: jobs.length } });
|
|
254
|
+
}
|
|
255
|
+
removeAll() { }
|
|
256
|
+
list() {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
exports.InProcessCronManager = InProcessCronManager;
|
|
261
|
+
/** launchd on macOS; in-process timers on every other host outside a container. */
|
|
262
|
+
function hostOsCronManager(platform, launchd) {
|
|
263
|
+
return platform === "darwin" ? launchd() : new InProcessCronManager();
|
|
264
|
+
}
|
|
243
265
|
function createOsCronManager(options = {}) {
|
|
244
266
|
const platform = options.platform ?? process.platform;
|
|
245
267
|
if (platform === "darwin") {
|
|
@@ -270,6 +270,8 @@ class HabitScheduler {
|
|
|
270
270
|
}, intervalMs);
|
|
271
271
|
}
|
|
272
272
|
verifyCronAndCreateFallbacks(state) {
|
|
273
|
+
if (this.osCronManager.firesInProcess)
|
|
274
|
+
return this.scheduleInProcess(state);
|
|
273
275
|
if ((!this.execForVerify && !this.verifyJobs) || state.jobs.length === 0)
|
|
274
276
|
return state;
|
|
275
277
|
let currentState = state;
|
|
@@ -335,6 +337,18 @@ class HabitScheduler {
|
|
|
335
337
|
});
|
|
336
338
|
return null;
|
|
337
339
|
}
|
|
340
|
+
/** Nothing is registered with the OS, so every job runs on an in-process timer; that is not degraded. */
|
|
341
|
+
scheduleInProcess(state) {
|
|
342
|
+
for (const job of state.jobs) {
|
|
343
|
+
const cadence = state.habits.find((habit) => habit.name === job.taskId).cadence;
|
|
344
|
+
const ms = (0, cadence_1.cadenceFallbackDelayMs)(cadence, this.deps.now());
|
|
345
|
+
if (ms !== null)
|
|
346
|
+
this.createTimerFallback(job.taskId, cadence, ms);
|
|
347
|
+
else
|
|
348
|
+
this.degradedHabitNames.set(job.taskId, "cadence cannot be scheduled with an in-process timer");
|
|
349
|
+
}
|
|
350
|
+
return state;
|
|
351
|
+
}
|
|
338
352
|
verifyCronEntries() {
|
|
339
353
|
const verified = new Set();
|
|
340
354
|
try {
|
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.1006",
|
|
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.1006",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@azure/identity": "^4.13.0",
|