@wirecat/cli-core 0.518.0 → 0.519.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.519.0 — 01.11.2026
11
+
12
+ ### Added
13
+
14
+ - **`scheduleCommandFor(host)`** mounts the `schedule` command on a CLI that is not a messenger (mail-cli): the host
15
+ gives its identity and a context with the environment, the profile and the output. `scheduleCommand(messenger)`
16
+ is the same command, unchanged.
17
+
10
18
  ## 0.518.0 — 01.11.2026
11
19
 
12
20
  ### Added
@@ -96,6 +96,7 @@ export { httpTokenFile, type McpEnvironment, type McpHost, serverEntry } from ".
96
96
  export { type MessageItem, messageItem, type ReadMessage } from "./messenger/message-items.js";
97
97
  export { type ModeProblem, type PrivateFiles, privateFiles, withSqliteSidecars } from "./messenger/private-files.js";
98
98
  export { buildReport as buildDoctorReport, type Report as DoctorReport, type ReportContext as DoctorReportContext, reportFileName as doctorReportFileName, } from "./messenger/report.js";
99
+ export type { ScheduleHost } from "./messenger/schedule-command.js";
99
100
  export { allAnswer, allHitItem, coverageGaps, type HitItem, type MessageHitItem, messageHitItem, type NoteHitItem, noteHitItem, shownOf, } from "./messenger/search-answers.js";
100
101
  export { SEARCHES_QUERY } from "./messenger/searches-command.js";
101
102
  export { servingProfiles } from "./messenger/serve-command.js";
@@ -114,7 +115,7 @@ export { fieldsOf, projectFields } from "./result-fields.js";
114
115
  export { type Config, type Configuration, count, first, flag, fromFile, type GlobalFlags, NONE_NAMED, namedProfile, type ProfileKind, plain, type ResolveOptions, type Settings, type SettingsExtension, type SettingsExtensionContext, type Source, settingsFor, } from "./settings.js";
115
116
  export { type PermissionAnswer, readSetupAnswers, type SetupAnswers, setupPermissionCeiling } from "./setup-answers.js";
116
117
  export { AGENTS, type Agent, agentFor, screenFor } from "./setup-screen.js";
117
- export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
118
+ export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
118
119
  export { assertSharedContracts, customizeSharedCommand, hasSharedContract, overrideSharedContract, type SharedContractOverride, sharedContractOverrides, sharedContracts, } from "./shared-contracts.js";
119
120
  export { runnable, withSafety } from "./steps.js";
120
121
  export { type StoreInfo, sharedStoreCommand, storeInfo, storeInfoCommand } from "./store-info.js";
package/dist/cli/index.js CHANGED
@@ -104,7 +104,7 @@ export { fieldsOf, projectFields } from "./result-fields.js";
104
104
  export { count, first, flag, fromFile, NONE_NAMED, namedProfile, plain, settingsFor, } from "./settings.js";
105
105
  export { readSetupAnswers, setupPermissionCeiling } from "./setup-answers.js";
106
106
  export { AGENTS, agentFor, screenFor } from "./setup-screen.js";
107
- export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
107
+ export { accountCommand, addMeetingBatchCommand, addMeetingPreparationCommand, addMeetingProjectCandidatesCommand, addMeetingSeriesInventoryCommand, appDoctorCommand, appMcpCommand, attachmentsCommand, botAdminsCommand, botCommand, botMcpCommand, botMembersCommand, botMessagesCommand, callsCommand, chatsCommand, commandsCommand, completeCommand, configCommand, contactsCommand, conversationsCommand, deleteCommand, doctorCommand, editCommand, floodCommand, forwardCommand, generatedApiCommand, guideCommand, imagesCommand, inboxCommand, markReadCommand, mcpCommand, mentionsCommand, messagesCommand, metadataCommand, modelCatalogueCommand, modelsCommand, pinCommand, pollsCommand, projectsCommand, reactionsCommand, recipientsCommand, repliesCommand, reviewCommand, runsCommand, scheduleCommand, scheduleCommandFor, searchCommand, searchesCommand, sendCommand, sendsCommand, serveCommand, serverCommand, skillCommand, starCommands, statsCommand, stickersCommand, storeCommand, tagsCommand, tasksCommand, tasksStatsCommand, topicsCommand, unpinCommand, upgradeCommand, watchCommand, } from "./shared-command-exports.js";
108
108
  export { assertSharedContracts, customizeSharedCommand, hasSharedContract, overrideSharedContract, sharedContractOverrides, sharedContracts, } from "./shared-contracts.js";
109
109
  export { runnable, withSafety } from "./steps.js";
110
110
  export { sharedStoreCommand, storeInfo, storeInfoCommand } from "./store-info.js";
@@ -1,8 +1,19 @@
1
1
  import { Command } from "commander";
2
+ import { type AppIdentity } from "../../ports/app.js";
3
+ import { type AnswerOutput } from "../envelope.js";
2
4
  import { type Messenger } from "./context.js";
5
+ /** What the schedule command needs of a CLI: who it is and, per command, where it prints and which profile runs. */
6
+ export interface ScheduleHost {
7
+ app: AppIdentity;
8
+ context(command: Command): AnswerOutput & {
9
+ env: NodeJS.ProcessEnv;
10
+ profile: string;
11
+ };
12
+ }
3
13
  /**
4
14
  * Runs the CLI's own commands, or an agent, later or on a timer — through systemd (Linux), launchd
5
15
  * (macOS) or Task Scheduler (Windows). Every timer runs `schedule exec <file>`; the schedule file holds
6
16
  * the rest, so what runs and with which variables is the same on all three.
7
17
  */
18
+ export declare const scheduleCommandFor: ({ app, context: contextOf }: ScheduleHost) => Command;
8
19
  export declare const scheduleCommand: (messenger: Messenger) => Command;
@@ -61,11 +61,10 @@ const withWhen = (command) => command
61
61
  * (macOS) or Task Scheduler (Windows). Every timer runs `schedule exec <file>`; the schedule file holds
62
62
  * the rest, so what runs and with which variables is the same on all three.
63
63
  */
64
- export const scheduleCommand = (messenger) => {
65
- const { app } = messenger;
64
+ export const scheduleCommandFor = ({ app, context: contextOf }) => {
66
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`);
67
66
  const prepare = (self) => {
68
- const context = messengerContext(self, messenger);
67
+ const context = contextOf(self);
69
68
  const system = environmentOf(self).system ?? thisMachine();
70
69
  const state = resolvePaths({ appName: app.appName, prefix: app.envPrefix, env: context.env }).state;
71
70
  const say = (value, lines) => renderAnswer(self, context, itemOf(value), () => lines.join("\n"));
@@ -230,3 +229,4 @@ export const scheduleCommand = (messenger) => {
230
229
  });
231
230
  return command;
232
231
  };
232
+ export const scheduleCommand = (messenger) => scheduleCommandFor({ app: messenger.app, context: (command) => messengerContext(command, messenger) });
@@ -764,6 +764,7 @@ export declare const stickersCommand: (messenger: import("./index.js").Messenger
764
764
  export declare const repliesCommand: (messenger: import("./index.js").Messenger) => import("commander").Command;
765
765
  export declare const reviewCommand: (messenger: import("./index.js").Messenger) => import("commander").Command;
766
766
  export declare const scheduleCommand: (messenger: import("./index.js").Messenger) => import("commander").Command;
767
+ export declare const scheduleCommandFor: (args_0: import("./messenger/schedule-command.js").ScheduleHost) => import("commander").Command;
767
768
  export declare const searchCommand: (messenger: import("./index.js").Messenger, args_1?: {
768
769
  topics?: boolean;
769
770
  } | undefined) => import("commander").Command;
@@ -41,7 +41,7 @@ import { reactionsCommand as reactionsCommandDefinition } from "./messenger/reac
41
41
  import { callsCommand as callsCommandDefinition, stickersCommand as stickersCommandDefinition, } from "./messenger/records-command.js";
42
42
  import { repliesCommand as repliesCommandDefinition } from "./messenger/replies-command.js";
43
43
  import { reviewCommand as reviewCommandDefinition } from "./messenger/review.js";
44
- import { scheduleCommand as scheduleCommandDefinition } from "./messenger/schedule-command.js";
44
+ import { scheduleCommand as scheduleCommandDefinition, scheduleCommandFor as scheduleCommandForDefinition, } from "./messenger/schedule-command.js";
45
45
  import { searchCommand as searchCommandDefinition } from "./messenger/search-command.js";
46
46
  import { searchesCommand as searchesCommandDefinition } from "./messenger/searches-command.js";
47
47
  import { serveCommand as serveCommandDefinition } from "./messenger/serve-command.js";
@@ -104,6 +104,7 @@ export const stickersCommand = sharedCommand(stickersCommandDefinition);
104
104
  export const repliesCommand = sharedCommand(repliesCommandDefinition);
105
105
  export const reviewCommand = sharedCommand(reviewCommandDefinition);
106
106
  export const scheduleCommand = sharedCommand(scheduleCommandDefinition);
107
+ export const scheduleCommandFor = sharedCommand(scheduleCommandForDefinition);
107
108
  export const searchCommand = sharedCommand(searchCommandDefinition);
108
109
  export const searchesCommand = sharedCommand(searchesCommandDefinition);
109
110
  export const serveCommand = sharedCommand(serveCommandDefinition);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-core",
3
- "version": "0.518.0",
3
+ "version": "0.519.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",