@wirecat/cli-core 0.523.0 → 0.524.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
|
@@ -5,7 +5,13 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0,
|
|
|
5
5
|
minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the
|
|
6
6
|
shape of this file.
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## 0.524.0 — 01.11.2026
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **`appDoctorCommand` takes a `local` check.** A CLI that is not a messenger can now put what it reads of its own
|
|
13
|
+
state from disk into `doctor` — a run that stopped half way, an undo window about to close — without `--online`.
|
|
14
|
+
Its fields join the answer and its notes go to stderr; a throw is reported as `local.error`, never a failed doctor.
|
|
9
15
|
|
|
10
16
|
## 0.523.0 — 01.11.2026
|
|
11
17
|
|
|
@@ -18,6 +18,14 @@ export interface AppDoctorOptions {
|
|
|
18
18
|
online?: (env: NodeJS.ProcessEnv) => Promise<{
|
|
19
19
|
ok: boolean;
|
|
20
20
|
} & Record<string, unknown>>;
|
|
21
|
+
/**
|
|
22
|
+
* What the CLI reads of its own state from disk, with no call out: a run left half done, a deadline near. `fields`
|
|
23
|
+
* join the answer; each of `notes` goes to stderr, as a fix does. A throw is reported as `local.error`.
|
|
24
|
+
*/
|
|
25
|
+
local?: (env: NodeJS.ProcessEnv) => {
|
|
26
|
+
fields: Record<string, unknown>;
|
|
27
|
+
notes?: string[];
|
|
28
|
+
};
|
|
21
29
|
}
|
|
22
30
|
/**
|
|
23
31
|
* Run when everything else is broken, so a problem in the config file or the OAuth setting is a field, never a throw.
|
|
@@ -13,6 +13,17 @@ import { itemOf, renderAnswer } from "./envelope.js";
|
|
|
13
13
|
import { privateFiles } from "./messenger/private-files.js";
|
|
14
14
|
import { unknownPermissionIssues } from "./permission-keys.js";
|
|
15
15
|
import { profileFree } from "./profile.js";
|
|
16
|
+
const localCheck = (env, options) => {
|
|
17
|
+
if (!options.local)
|
|
18
|
+
return { fields: {}, notes: [] };
|
|
19
|
+
try {
|
|
20
|
+
const { fields, notes = [] } = options.local(env);
|
|
21
|
+
return { fields, notes };
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
return { fields: { local: { error: error instanceof Error ? error.message : String(error) } }, notes: [] };
|
|
25
|
+
}
|
|
26
|
+
};
|
|
16
27
|
const onlineCheck = async (app, env, fetcher, options) => {
|
|
17
28
|
const started = Date.now();
|
|
18
29
|
let service = { ok: true };
|
|
@@ -133,11 +144,14 @@ export const appDoctorCommand = (app, configuration, options = {}) => profileFre
|
|
|
133
144
|
const environment = environmentOf(this);
|
|
134
145
|
const env = environment.env ?? process.env;
|
|
135
146
|
const { report, fixes } = appDoctorReport(app, configuration, env, this, options);
|
|
147
|
+
const local = localCheck(env, options);
|
|
136
148
|
const online = this.opts().online
|
|
137
149
|
? await onlineCheck(app, env, environment.fetch ?? fetch, options)
|
|
138
150
|
: undefined;
|
|
139
151
|
const output = outputFor(this);
|
|
140
|
-
renderAnswer(this, output, itemOf(
|
|
152
|
+
renderAnswer(this, output, itemOf({ ...report, ...local.fields, ...(online ? { online } : {}) }));
|
|
141
153
|
for (const fix of fixes)
|
|
142
154
|
output.renderer.note(`to make it private: ${fix}`);
|
|
155
|
+
for (const note of local.notes)
|
|
156
|
+
output.renderer.note(note);
|
|
143
157
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.524.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",
|