@wirecat/cli-core 0.520.0 → 0.522.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,22 @@ shape of this file.
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 0.522.0 — 01.11.2026
11
+
12
+ ### Added
13
+
14
+ - **Mail actions in the send journal.** `AccountAction` takes `message-flag`, `message-move`, `message-copy`,
15
+ `message-delete` and `message-restore`, so a mail CLI journals its changes to a mailbox under its own words. Like
16
+ the other `account` actions they count toward no hourly limit: organising mail reaches nobody.
17
+
18
+ ## 0.521.0 — 01.11.2026
19
+
20
+ ### Fixed
21
+
22
+ - **`schedule exec` runs without a profile.** A timer starts `<cli> schedule exec <file>` with no profile named, and a
23
+ CLI with several profiles refused it ("name a profile") before reading the schedule, so no timed run ever ran. The
24
+ schedule's own environment carries the profile.
25
+
10
26
  ## 0.520.0 — 01.11.2026
11
27
 
12
28
  ### 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): AnswerOutput & {
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
- const { context, system, timer } = prepare(this);
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({ app: messenger.app, context: (command) => messengerContext(command, messenger) });
233
+ export const scheduleCommand = (messenger) => scheduleCommandFor({
234
+ app: messenger.app,
235
+ context: (command, resolving) => messengerContext(command, messenger, resolving),
236
+ });
@@ -8,7 +8,7 @@ export type SendKind = "message" | "reaction" | "edit" | "forward" | "pin" | "re
8
8
  /** What a `chat` entry did. Never a title, a description or a link — only which action. */
9
9
  export type ChatAction = "create" | "join" | "leave" | "delete" | "clear" | "members.add" | "members.remove" | "admins.add" | "admins.remove" | "update" | "settings" | "requests.accept" | "requests.decline" | "link.reset" | "link.create" | "link.revoke" | "link.update" | "forum-upgrade" | "forum-enable" | "topic-create" | "topic-edit" | "topic-delete" | "topic-close" | "topic-reopen" | "topic-pin" | "topic-unpin" | "topic-order" | "topic-hide" | "topic-unhide";
10
10
  /** What an `account` entry changed. Never the value it changed it to — no name, number or title. */
11
- export type AccountAction = "contact-add" | "contact-remove" | "contact-import" | "contact-rename" | "contact-block" | "contact-unblock" | "profile" | "folder-create" | "folder-update" | "folder-delete" | "folder-order" | "folder-join" | "sessions-end" | "chat-mute" | "chat-unmute" | "chat-archive" | "chat-unarchive" | "chat-pin" | "chat-unpin" | "chat-mark-unread" | "message-star" | "message-unstar" | "privacy";
11
+ export type AccountAction = "contact-add" | "contact-remove" | "contact-import" | "contact-rename" | "contact-block" | "contact-unblock" | "profile" | "folder-create" | "folder-update" | "folder-delete" | "folder-order" | "folder-join" | "sessions-end" | "chat-mute" | "chat-unmute" | "chat-archive" | "chat-unarchive" | "chat-pin" | "chat-unpin" | "chat-mark-unread" | "message-star" | "message-unstar" | "message-flag" | "message-move" | "message-copy" | "message-delete" | "message-restore" | "privacy";
12
12
  /** One attempt to send. **Never the text** — only its length. */
13
13
  export interface SendEntry {
14
14
  at: string;
@@ -173,6 +173,12 @@ const ACCOUNT_KEYS = {
173
173
  "chat-mark-unread": "chats.mark-unread",
174
174
  "message-star": "messages.star",
175
175
  "message-unstar": "messages.unstar",
176
+ // A mail CLI names its own key on every write; these only answer `keyForWrite` when one is left out.
177
+ "message-flag": "messages.update",
178
+ "message-move": "messages.move",
179
+ "message-copy": "messages.copy",
180
+ "message-delete": "messages.trash",
181
+ "message-restore": "messages.restore",
176
182
  privacy: "account.privacy.set",
177
183
  };
178
184
  const KIND_KEYS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-core",
3
- "version": "0.520.0",
3
+ "version": "0.522.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",