@wirecat/cli-core 0.599.0 → 0.600.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 +15 -0
- package/dist/background/deliver.js +1 -1
- package/dist/background/schedules.d.ts +1 -1
- package/dist/cli/schedule/schedule-command.js +10 -8
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/list-results.d.ts +1 -1
- package/dist/entities/list-results.js +1 -1
- package/package.json +3 -3
- package/parity.json +14 -10
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ shape of this file.
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## 0.600.0 — 07.11.2026
|
|
11
|
+
|
|
12
|
+
### Changed — may break callers
|
|
13
|
+
|
|
14
|
+
- **`schedule agent` and `schedule command` take `--deliver-to <route>`, no longer `--to <route>`.** `--to` names who a
|
|
15
|
+
message is for in every CLI (mail's `<address>`, a messenger's `<chat>`), so mail's command lint refused the route
|
|
16
|
+
flag. `schedule list` and the answer of `schedule agent|command` name the routes `deliver_to`. The schedule file
|
|
17
|
+
still keeps them as `to`, so a schedule saved with `--to` goes on delivering; `deliveries[].to` in `last.json` is
|
|
18
|
+
unchanged.
|
|
19
|
+
- **The shared commands pass `cli-dev lint` with no overrides.** `lint/overrides.json` is gone: an override here never
|
|
20
|
+
reached a CLI that mounts the commands, so each CLI failed on its bump or copied it. Needs cli-base 0.80.7, whose
|
|
21
|
+
vocabulary has `--notify-on`, `--deliver-to`, `--max-cost-per-day`, `--who`, `--open-new`, `waiting` and `recover`. A CLI that
|
|
22
|
+
copied those overrides removes them when it bumps (`cli-dev lint` reports them as stale). `stats tasks show
|
|
23
|
+
--chat` moved to the baseline.
|
|
24
|
+
|
|
10
25
|
## 0.599.0 — 07.11.2026
|
|
11
26
|
|
|
12
27
|
### Added
|
|
@@ -16,7 +16,7 @@ const ADDRESS = /^[^\s@/,<>"]+@[^\s@/,<>"]+\.[^\s@/,<>"]+$/;
|
|
|
16
16
|
export const ROUTE_HELP = "telegram-bot:<profile>/<chat id or user:id>, or email:<profile>/<address>";
|
|
17
17
|
export const parseRoute = (text) => {
|
|
18
18
|
const [, kind = "", profile = "", target = ""] = /^([a-z-]+):([^/]+)\/(.+)$/.exec(text.trim()) ?? [];
|
|
19
|
-
const refuse = (why) => new CliError("validation_error", `--to ${text}: ${why} — ${ROUTE_HELP}`);
|
|
19
|
+
const refuse = (why) => new CliError("validation_error", `--deliver-to ${text}: ${why} — ${ROUTE_HELP}`);
|
|
20
20
|
if (!(kind in PROGRAMS))
|
|
21
21
|
throw refuse(kind ? `${kind} is not a route` : "a route is <kind>:<profile>/<where>");
|
|
22
22
|
if (!PROFILE.test(profile))
|
|
@@ -27,7 +27,7 @@ export interface Schedule {
|
|
|
27
27
|
maxCostPerDay?: number;
|
|
28
28
|
/** When a finished run shows a desktop notice and goes along `to`; absent means `notifyOf`'s default. */
|
|
29
29
|
notify?: Notify;
|
|
30
|
-
/**
|
|
30
|
+
/** `--deliver-to`'s routes (`telegram-bot:<profile>/<chat>`, `email:<profile>/<address>`), answered as `deliver_to`. */
|
|
31
31
|
to?: string[];
|
|
32
32
|
}
|
|
33
33
|
export declare const NOTIFY_WHEN: readonly ["always", "failures", "never"];
|
|
@@ -71,8 +71,10 @@ const untilChildEnds = async (command, wait) => {
|
|
|
71
71
|
environment.endUntilStopped?.();
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
|
|
74
|
+
// The file keeps `to`, as schedules saved before the flag was renamed have it; the answer names it as the flag does.
|
|
75
|
+
const scheduleAnswer = ({ environment, createdAt, to, ...schedule }, extra) => ({
|
|
75
76
|
...snakeKeys(schedule),
|
|
77
|
+
...(to?.length ? { deliver_to: to } : {}),
|
|
76
78
|
environment,
|
|
77
79
|
created_at: createdAt,
|
|
78
80
|
...snakeKeys(extra),
|
|
@@ -82,11 +84,11 @@ const withWhen = (command) => command
|
|
|
82
84
|
.option("--at <HH:MM>", "every day at this local time")
|
|
83
85
|
.option("--at-time <time>", "one run: 30m, 2d from now, or an ISO time; the schedule removes itself after it")
|
|
84
86
|
.addOption(new Option("--notify-on <when>", "desktop notice after a run (default failures for an agent that repeats with --every, else always)").choices(NOTIFY_WHEN))
|
|
85
|
-
.option("--to <route>", `also send the result, when --notify-on says so, by the owner's own tg or mail: ${ROUTE_HELP}; repeat it for more`, (route, routes = []) => [...routes, routeText(parseRoute(route))]);
|
|
86
|
-
/** What a schedule keeps of `--notify-on` and `--to`. */
|
|
87
|
-
const deliveryOf = ({ notifyOn,
|
|
87
|
+
.option("--deliver-to <route>", `also send the result, when --notify-on says so, by the owner's own tg or mail: ${ROUTE_HELP}; repeat it for more`, (route, routes = []) => [...routes, routeText(parseRoute(route))]);
|
|
88
|
+
/** What a schedule keeps of `--notify-on` and `--deliver-to`. */
|
|
89
|
+
const deliveryOf = ({ notifyOn, deliverTo }) => ({
|
|
88
90
|
...(notifyOn ? { notify: notifyOn } : {}),
|
|
89
|
-
...(
|
|
91
|
+
...(deliverTo?.length ? { to: deliverTo } : {}),
|
|
90
92
|
});
|
|
91
93
|
/** What the schedule command needs of a CLI: who it is and, per command, where it prints and which profile runs. */
|
|
92
94
|
/** `skill show follow-ups` exists only for messenger CLIs; any other CLI gets a read-only summary it can run. */
|
|
@@ -365,7 +367,7 @@ export const scheduleCommandFor = ({ app, context: contextOf, newMail, agentInpu
|
|
|
365
367
|
kind: schedule.kind,
|
|
366
368
|
when: describeWhen(schedule.when),
|
|
367
369
|
notify: notifyOf(schedule),
|
|
368
|
-
...(schedule.to?.length ? {
|
|
370
|
+
...(schedule.to?.length ? { deliverTo: schedule.to } : {}),
|
|
369
371
|
last: lastRun(scheduleFile(state, schedule.name)) ?? null,
|
|
370
372
|
...(schedule.kind === "agent"
|
|
371
373
|
? {
|
|
@@ -386,12 +388,12 @@ export const scheduleCommandFor = ({ app, context: contextOf, newMail, agentInpu
|
|
|
386
388
|
return "";
|
|
387
389
|
}
|
|
388
390
|
return rows
|
|
389
|
-
.map(({ name, kind, when, notify,
|
|
391
|
+
.map(({ name, kind, when, notify, deliverTo, last, spentTodayUsd, maxCostPerDayUsd }) => [
|
|
390
392
|
name,
|
|
391
393
|
kind,
|
|
392
394
|
when,
|
|
393
395
|
`notify ${notify}`,
|
|
394
|
-
...(
|
|
396
|
+
...(deliverTo ? [`to ${deliverTo.join(", ")}`] : []),
|
|
395
397
|
last
|
|
396
398
|
? `last ${last.at.slice(0, 16).replace("T", " ")} exit ${last.exitCode}` +
|
|
397
399
|
(last.failures
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -4124,7 +4124,7 @@ export declare const ENTITIES: {
|
|
|
4124
4124
|
readonly kind: v.PicklistSchema<["command", "agent"], undefined>;
|
|
4125
4125
|
readonly when: v.StringSchema<undefined>;
|
|
4126
4126
|
readonly notify: v.OptionalSchema<v.PicklistSchema<["always", "failures", "never"], undefined>, undefined>;
|
|
4127
|
-
readonly
|
|
4127
|
+
readonly deliver_to: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
4128
4128
|
readonly last: v.NullableSchema<v.StrictObjectSchema<{
|
|
4129
4129
|
readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
4130
4130
|
readonly exit_code: v.NumberSchema<undefined>;
|
|
@@ -51,7 +51,7 @@ export declare const scheduledJob: v.StrictObjectSchema<{
|
|
|
51
51
|
/** When a finished run shows a desktop notice: `always`, `failures` or `never`; the default is shown, not left out. */
|
|
52
52
|
readonly notify: v.OptionalSchema<v.PicklistSchema<["always", "failures", "never"], undefined>, undefined>;
|
|
53
53
|
/** Where a run's result is sent after it: `telegram-bot:<profile>/<chat>` or `email:<profile>/<address>`. */
|
|
54
|
-
readonly
|
|
54
|
+
readonly deliver_to: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
55
55
|
readonly last: v.NullableSchema<v.StrictObjectSchema<{
|
|
56
56
|
readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
|
|
57
57
|
readonly exit_code: v.NumberSchema<undefined>;
|
|
@@ -35,7 +35,7 @@ export const scheduledJob = v.strictObject({
|
|
|
35
35
|
/** When a finished run shows a desktop notice: `always`, `failures` or `never`; the default is shown, not left out. */
|
|
36
36
|
notify: v.optional(v.picklist(["always", "failures", "never"])),
|
|
37
37
|
/** Where a run's result is sent after it: `telegram-bot:<profile>/<chat>` or `email:<profile>/<address>`. */
|
|
38
|
-
|
|
38
|
+
deliver_to: v.optional(v.array(text)),
|
|
39
39
|
last: v.nullable(v.strictObject({
|
|
40
40
|
at: time,
|
|
41
41
|
exit_code: v.number(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.600.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",
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
"@types/node": "^22.20.5",
|
|
277
277
|
"@types/pngjs": "6.0.5",
|
|
278
278
|
"@vitest/coverage-v8": "^5.0.5",
|
|
279
|
-
"@wirecat/cli-base": "0.80.
|
|
279
|
+
"@wirecat/cli-base": "0.80.7",
|
|
280
280
|
"@wirecat/cli-core-legacy-tags": "npm:@wirecat/cli-core@0.414.0",
|
|
281
281
|
"commander": "15.0.0",
|
|
282
282
|
"cspell": "10.4.0",
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
},
|
|
297
297
|
"peerDependencies": {
|
|
298
298
|
"@napi-rs/canvas": ">=0.1.69 <2",
|
|
299
|
-
"@wirecat/cli-base": ">=0.
|
|
299
|
+
"@wirecat/cli-base": ">=0.80.7 <0.81.0",
|
|
300
300
|
"commander": ">=15"
|
|
301
301
|
},
|
|
302
302
|
"bin": {
|
package/parity.json
CHANGED
|
@@ -304,6 +304,10 @@
|
|
|
304
304
|
"--defaults": {
|
|
305
305
|
"meaning": "change what every profile gets, rather than this profile"
|
|
306
306
|
},
|
|
307
|
+
"--deliver-to": {
|
|
308
|
+
"value": "<route>",
|
|
309
|
+
"meaning": "where a schedule's result also goes, when --notify-on says so: telegram-bot:<profile>/<chat>, email:<profile>/<address>; repeat it for more"
|
|
310
|
+
},
|
|
307
311
|
"--deny-chats": {
|
|
308
312
|
"meaning": "replace denied chat ids, comma-separated; empty clears; deny wins",
|
|
309
313
|
"value": "<ids>"
|
|
@@ -1065,7 +1069,7 @@
|
|
|
1065
1069
|
},
|
|
1066
1070
|
"--to": {
|
|
1067
1071
|
"value": "<chat>",
|
|
1068
|
-
"meaning": "where it goes: the chat to forward it to (an id, or part of a chat name)
|
|
1072
|
+
"meaning": "where it goes: the chat to forward it to (an id, or part of a chat name)",
|
|
1069
1073
|
"note": "the sentence says how to name a chat the messenger's way, so it differs on purpose (Help text rule 4)"
|
|
1070
1074
|
},
|
|
1071
1075
|
"--topic": {
|
|
@@ -3959,37 +3963,37 @@
|
|
|
3959
3963
|
"wa": "wa backlog: mount the shared schedule command"
|
|
3960
3964
|
}
|
|
3961
3965
|
},
|
|
3962
|
-
"--
|
|
3966
|
+
"--deliver-to": {
|
|
3963
3967
|
"in": ["max", "tg"],
|
|
3964
3968
|
"planned": {
|
|
3965
3969
|
"wa": "wa backlog: mount the shared schedule command"
|
|
3966
3970
|
}
|
|
3967
3971
|
},
|
|
3968
|
-
"--
|
|
3972
|
+
"--every": {
|
|
3969
3973
|
"in": ["max", "tg"],
|
|
3970
3974
|
"planned": {
|
|
3971
3975
|
"wa": "wa backlog: mount the shared schedule command"
|
|
3972
3976
|
}
|
|
3973
3977
|
},
|
|
3974
|
-
"--max-cost
|
|
3978
|
+
"--max-cost": {
|
|
3975
3979
|
"in": ["max", "tg"],
|
|
3976
3980
|
"planned": {
|
|
3977
3981
|
"wa": "wa backlog: mount the shared schedule command"
|
|
3978
3982
|
}
|
|
3979
3983
|
},
|
|
3980
|
-
"--
|
|
3984
|
+
"--max-cost-per-day": {
|
|
3981
3985
|
"in": ["max", "tg"],
|
|
3982
3986
|
"planned": {
|
|
3983
3987
|
"wa": "wa backlog: mount the shared schedule command"
|
|
3984
3988
|
}
|
|
3985
3989
|
},
|
|
3986
|
-
"--
|
|
3990
|
+
"--model": {
|
|
3987
3991
|
"in": ["max", "tg"],
|
|
3988
3992
|
"planned": {
|
|
3989
3993
|
"wa": "wa backlog: mount the shared schedule command"
|
|
3990
3994
|
}
|
|
3991
3995
|
},
|
|
3992
|
-
"--
|
|
3996
|
+
"--notify-on": {
|
|
3993
3997
|
"in": ["max", "tg"],
|
|
3994
3998
|
"planned": {
|
|
3995
3999
|
"wa": "wa backlog: mount the shared schedule command"
|
|
@@ -4015,19 +4019,19 @@
|
|
|
4015
4019
|
"wa": "wa backlog: mount the shared schedule command"
|
|
4016
4020
|
}
|
|
4017
4021
|
},
|
|
4018
|
-
"--
|
|
4022
|
+
"--deliver-to": {
|
|
4019
4023
|
"in": ["max", "tg"],
|
|
4020
4024
|
"planned": {
|
|
4021
4025
|
"wa": "wa backlog: mount the shared schedule command"
|
|
4022
4026
|
}
|
|
4023
4027
|
},
|
|
4024
|
-
"--
|
|
4028
|
+
"--every": {
|
|
4025
4029
|
"in": ["max", "tg"],
|
|
4026
4030
|
"planned": {
|
|
4027
4031
|
"wa": "wa backlog: mount the shared schedule command"
|
|
4028
4032
|
}
|
|
4029
4033
|
},
|
|
4030
|
-
"--
|
|
4034
|
+
"--notify-on": {
|
|
4031
4035
|
"in": ["max", "tg"],
|
|
4032
4036
|
"planned": {
|
|
4033
4037
|
"wa": "wa backlog: mount the shared schedule command"
|