@wirecat/cli-core 0.520.0 → 0.521.0
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.md
CHANGED
|
@@ -7,6 +7,14 @@ shape of this file.
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## 0.521.0 — 01.11.2026
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`schedule exec` runs without a profile.** A timer starts `<cli> schedule exec <file>` with no profile named, and a
|
|
15
|
+
CLI with several profiles refused it ("name a profile") before reading the schedule, so no timed run ever ran. The
|
|
16
|
+
schedule's own environment carries the profile.
|
|
17
|
+
|
|
10
18
|
## 0.520.0 — 01.11.2026
|
|
11
19
|
|
|
12
20
|
### Added
|
|
@@ -5,7 +5,9 @@ import { type Messenger } from "./context.js";
|
|
|
5
5
|
/** What the schedule command needs of a CLI: who it is and, per command, where it prints and which profile runs. */
|
|
6
6
|
export interface ScheduleHost {
|
|
7
7
|
app: AppIdentity;
|
|
8
|
-
context(command: Command
|
|
8
|
+
context(command: Command, resolving?: {
|
|
9
|
+
needsProfile?: boolean;
|
|
10
|
+
}): AnswerOutput & {
|
|
9
11
|
env: NodeJS.ProcessEnv;
|
|
10
12
|
profile: string;
|
|
11
13
|
};
|
|
@@ -63,8 +63,8 @@ const withWhen = (command) => command
|
|
|
63
63
|
*/
|
|
64
64
|
export const scheduleCommandFor = ({ app, context: contextOf }) => {
|
|
65
65
|
const command = new Command("schedule").description(`run a ${app.command} command or an agent later or on a timer (systemd, launchd, Task Scheduler); an agent cannot send`);
|
|
66
|
-
const prepare = (self) => {
|
|
67
|
-
const context = contextOf(self);
|
|
66
|
+
const prepare = (self, resolving = {}) => {
|
|
67
|
+
const context = contextOf(self, resolving);
|
|
68
68
|
const system = environmentOf(self).system ?? thisMachine();
|
|
69
69
|
const state = resolvePaths({ appName: app.appName, prefix: app.envPrefix, env: context.env }).state;
|
|
70
70
|
const say = (value, lines) => renderAnswer(self, context, itemOf(value), () => lines.join("\n"));
|
|
@@ -222,11 +222,15 @@ export const scheduleCommandFor = ({ app, context: contextOf }) => {
|
|
|
222
222
|
.description("what a timer runs, given the schedule's file; to run one by hand, use run")
|
|
223
223
|
.argument("<file>")
|
|
224
224
|
.action(async function (file) {
|
|
225
|
-
|
|
225
|
+
// A timer starts it with no profile named; the schedule's own environment carries the profile.
|
|
226
|
+
const { context, system, timer } = prepare(this, { needsProfile: false });
|
|
226
227
|
const last = await runSchedule(app, system, context.env, file, { timer: timer() });
|
|
227
228
|
if (last.exitCode !== 0)
|
|
228
229
|
setExitCode(this, 1);
|
|
229
230
|
});
|
|
230
231
|
return command;
|
|
231
232
|
};
|
|
232
|
-
export const scheduleCommand = (messenger) => scheduleCommandFor({
|
|
233
|
+
export const scheduleCommand = (messenger) => scheduleCommandFor({
|
|
234
|
+
app: messenger.app,
|
|
235
|
+
context: (command, resolving) => messengerContext(command, messenger, resolving),
|
|
236
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.521.0",
|
|
4
4
|
"description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|