@wirecat/cli-core 0.655.0 → 0.656.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 +13 -0
- package/dist/kit/sync-after-install.js +13 -3
- package/dist/store/shared-config.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ 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
|
+
## 0.656.0 — 13.11.2026
|
|
9
|
+
|
|
10
|
+
### Changed — may break callers
|
|
11
|
+
|
|
12
|
+
- **`syncAfterInstallCases` asks only "no `permission_error`" of a shared config that is not JSON or is a folder.** A
|
|
13
|
+
step that reads such a file may fail and name it; the other states must still exit 0.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **The shared config is read with a byte-order mark.** `~/.config/WireCat/config.json` saved by a Windows editor
|
|
18
|
+
starts with one; every reader of the file (setup's answer, task categories, models, search settings) refused it as
|
|
19
|
+
not JSON, and a sync that reads the meaning-search model ended incomplete.
|
|
20
|
+
|
|
8
21
|
## 0.655.0 — 13.11.2026
|
|
9
22
|
|
|
10
23
|
### Added
|
|
@@ -8,12 +8,20 @@ import { join } from "node:path";
|
|
|
8
8
|
*/
|
|
9
9
|
const SHARED_CONFIGS = [
|
|
10
10
|
{ state: "no shared config, as on a fresh install" },
|
|
11
|
-
{
|
|
11
|
+
{
|
|
12
|
+
state: "a shared config that is not JSON",
|
|
13
|
+
write: (dir) => writeFileSync(join(dir, "config.json"), "{ setup: "),
|
|
14
|
+
broken: true,
|
|
15
|
+
},
|
|
12
16
|
{
|
|
13
17
|
state: "a shared config with a byte-order mark",
|
|
14
18
|
write: (dir) => writeFileSync(join(dir, "config.json"), '{"setup":{"permissions":"allow"}}'),
|
|
15
19
|
},
|
|
16
|
-
{
|
|
20
|
+
{
|
|
21
|
+
state: "a folder where the shared config should be",
|
|
22
|
+
write: (dir) => mkdirSync(join(dir, "config.json")),
|
|
23
|
+
broken: true,
|
|
24
|
+
},
|
|
17
25
|
{
|
|
18
26
|
state: "a setup section in a shape this version does not take",
|
|
19
27
|
write: (dir) => writeFileSync(join(dir, "config.json"), JSON.stringify({ setup: { languages: ["en"], permissions: "ask" } })),
|
|
@@ -53,7 +61,9 @@ export const syncAfterInstallCases = (options) => {
|
|
|
53
61
|
run: async () => {
|
|
54
62
|
const ran = await cli(sync, shared);
|
|
55
63
|
assert.notEqual(errorCodeOf(ran.err), "permission_error", `sync was refused: ${ran.err}`);
|
|
56
|
-
|
|
64
|
+
// A file no reader can parse may fail a step that reads it, loudly and by name; it never restricts.
|
|
65
|
+
if (!shared.broken)
|
|
66
|
+
assert.equal(ran.code, 0, `sync exited ${ran.code}: ${ran.out}${ran.err}`);
|
|
57
67
|
},
|
|
58
68
|
})),
|
|
59
69
|
...(refusedUnderReadOnly
|
|
@@ -28,7 +28,8 @@ const readJson = (path) => {
|
|
|
28
28
|
}
|
|
29
29
|
let parsed;
|
|
30
30
|
try {
|
|
31
|
-
|
|
31
|
+
// Windows editors save JSON with a byte-order mark, which JSON.parse refuses.
|
|
32
|
+
parsed = JSON.parse(text.replace(/^\uFEFF/u, ""));
|
|
32
33
|
}
|
|
33
34
|
catch (error) {
|
|
34
35
|
throw new CliError("configuration_error", `${path} is not valid JSON: ${error.message}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.656.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",
|