@wirecat/cli-core 0.602.0 → 0.603.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 +16 -0
- package/dist/calendar/cli/search-all.js +2 -1
- package/dist/cli/command-availability.js +2 -2
- package/dist/cli/early-refusal.d.ts +5 -4
- package/dist/cli/early-refusal.js +7 -6
- package/dist/crm/cli/search-all.js +2 -1
- package/dist/crm/writer.d.ts +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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
|
+
## Unreleased
|
|
9
|
+
|
|
10
|
+
## 0.603.0 — 07.11.2026
|
|
11
|
+
|
|
12
|
+
### Changed — may break callers
|
|
13
|
+
|
|
14
|
+
- **A keyed command that declares no `effects` now counts as a write in a CLI with `commandPermissions`:** a
|
|
15
|
+
`readonly` profile and the read-only lock refuse it before it runs, where before it ran. Declare `effects` on every
|
|
16
|
+
keyed command.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **`search all` in a CRM or calendar CLI without `models` no longer names a download command it lacks.** Its notes
|
|
21
|
+
hint said `b24 models download e5-small`; a CLI with no `models download` now names the tools that have it (tg, max
|
|
22
|
+
or wa), which share the model folder.
|
|
23
|
+
|
|
8
24
|
## 0.602.0 — 07.11.2026
|
|
9
25
|
|
|
10
26
|
### Fixed
|
|
@@ -7,6 +7,7 @@ import { historySkipsOf } from "../../cli/messenger/history-gaps.js";
|
|
|
7
7
|
import { allAnswer, offsetOf, SOURCE_SEARCHED } from "../../cli/messenger/search-answers.js";
|
|
8
8
|
import { searchAllLine, searchAllOptions } from "../../cli/messenger/search-command.js";
|
|
9
9
|
import { deniedKinds } from "../../cli/search-left-out.js";
|
|
10
|
+
import { commandAt, rootOf } from "../../cli/steps.js";
|
|
10
11
|
import { SAVE_HELP } from "../../meetings/index.js";
|
|
11
12
|
import { meaningLane } from "../../services/messages-meaning.js";
|
|
12
13
|
import { searchAllWithMeetings } from "../../services/search-all-meetings.js";
|
|
@@ -53,7 +54,7 @@ export const addSearchAll = (searches, { within, app, zone, example }) => {
|
|
|
53
54
|
...(opts.source === undefined ? {} : { source: opts.source }),
|
|
54
55
|
...(opts.maxMeetings === undefined ? {} : { maxMeetings: opts.maxMeetings }),
|
|
55
56
|
...(run.locked ? { scope: { events: [run.account] } } : {}),
|
|
56
|
-
}, { app }, undefined, meaningLane({ env, messenger: { app }, store: async () => store }));
|
|
57
|
+
}, { app, hintCommand: commandAt(rootOf(leaf), "models download") ? app.command : null }, undefined, meaningLane({ env, messenger: { app }, store: async () => store }));
|
|
57
58
|
const note = (text) => outputFor(leaf).renderer.note(text);
|
|
58
59
|
for (const { why } of denied)
|
|
59
60
|
note(why);
|
|
@@ -15,8 +15,8 @@ export const commandAvailability = (info, levels, keyOf, authority, readOnly = f
|
|
|
15
15
|
? { permission, level: levelFor(levels, permission).level }
|
|
16
16
|
: {}),
|
|
17
17
|
});
|
|
18
|
-
// As `refuseByCommandPermissions` judges it before the run: a keyed write to the service.
|
|
19
|
-
const declaredChange = Boolean(declaredKey) && info.effects
|
|
18
|
+
// As `refuseByCommandPermissions` judges it before the run: a keyed write to the service, or undeclared effects.
|
|
19
|
+
const declaredChange = Boolean(declaredKey) && (info.effects === undefined || info.effects.remote === "write");
|
|
20
20
|
if (readOnly && (changesMessenger(info) || declaredChange || authority?.(info.path)))
|
|
21
21
|
return blocked("the read-only lock blocks this change");
|
|
22
22
|
if (mcp && authority?.(info.path) && !authorityAllowed(levels))
|
|
@@ -20,10 +20,11 @@ export declare const refuseWriteBeforeConnecting: (action: Command, { app, env,
|
|
|
20
20
|
}) => void;
|
|
21
21
|
/**
|
|
22
22
|
* A command of a CLI that declares its own keys (`commandPermissions`), refused by its key before anything connects:
|
|
23
|
-
* `deny` stops it, `readonly` stops a write, and the read-only lock stops a write to the service
|
|
24
|
-
* the write guard, which can put the question. A saved or
|
|
25
|
-
* command; housekeeping still runs, so `config unset` can
|
|
26
|
-
* a `--dry-run`, which sends nothing (WC-PERM-12); a
|
|
23
|
+
* `deny` stops it, `readonly` stops a write, and the read-only lock stops a write to the service; a command that
|
|
24
|
+
* declares no effects counts as both. `ask` is left to the write guard, which can put the question. A saved or
|
|
25
|
+
* `--permission` key that names no command stops every keyed command; housekeeping still runs, so `config unset` can
|
|
26
|
+
* remove it. Under the lock a non-messenger CLI still previews a `--dry-run`, which sends nothing (WC-PERM-12); a
|
|
27
|
+
* messenger's preview stays refused (SEC-65).
|
|
27
28
|
*/
|
|
28
29
|
export declare const refuseByCommandPermissions: (action: Command, permissions: CommandPermissions, { app, env, dryRun, resolve }: {
|
|
29
30
|
app: AppIdentity;
|
|
@@ -77,10 +77,11 @@ export const refuseWriteBeforeConnecting = (action, { app, env, dryRun, resolve
|
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
79
|
* A command of a CLI that declares its own keys (`commandPermissions`), refused by its key before anything connects:
|
|
80
|
-
* `deny` stops it, `readonly` stops a write, and the read-only lock stops a write to the service
|
|
81
|
-
* the write guard, which can put the question. A saved or
|
|
82
|
-
* command; housekeeping still runs, so `config unset` can
|
|
83
|
-
* a `--dry-run`, which sends nothing (WC-PERM-12); a
|
|
80
|
+
* `deny` stops it, `readonly` stops a write, and the read-only lock stops a write to the service; a command that
|
|
81
|
+
* declares no effects counts as both. `ask` is left to the write guard, which can put the question. A saved or
|
|
82
|
+
* `--permission` key that names no command stops every keyed command; housekeeping still runs, so `config unset` can
|
|
83
|
+
* remove it. Under the lock a non-messenger CLI still previews a `--dry-run`, which sends nothing (WC-PERM-12); a
|
|
84
|
+
* messenger's preview stays refused (SEC-65).
|
|
84
85
|
*/
|
|
85
86
|
export const refuseByCommandPermissions = (action, permissions, { app, env, dryRun, resolve }) => {
|
|
86
87
|
const key = permissions.keyOf(commandPathOf(action));
|
|
@@ -89,7 +90,7 @@ export const refuseByCommandPermissions = (action, permissions, { app, env, dryR
|
|
|
89
90
|
const { effects } = metaOf(action);
|
|
90
91
|
const lock = readOnlyLockOf(app, env);
|
|
91
92
|
const preview = dryRun && app.messenger === false;
|
|
92
|
-
if (lock && effects
|
|
93
|
+
if (lock && (effects === undefined || effects.remote === "write") && !preview)
|
|
93
94
|
throw readOnlyRefusal(lock, `run ${commandPathOf(action).join(" ")}`);
|
|
94
95
|
const settings = resolve(withAgentLevels(action, action.optsWithGlobals()), {
|
|
95
96
|
env,
|
|
@@ -106,7 +107,7 @@ export const refuseByCommandPermissions = (action, permissions, { app, env, dryR
|
|
|
106
107
|
throw new CliError("permission_error", `profile ${settings.profile} denies ${key} (permissions.${named} is deny, from the ` +
|
|
107
108
|
`${settings.permissionSources[named ?? ""] ?? "default"})`, { permission: key });
|
|
108
109
|
}
|
|
109
|
-
if (level === "readonly" &&
|
|
110
|
+
if (level === "readonly" && writes(effects))
|
|
110
111
|
throw levelRefusal({
|
|
111
112
|
profile: settings.profile,
|
|
112
113
|
command: app.command,
|
|
@@ -7,6 +7,7 @@ import { historySkipsOf } from "../../cli/messenger/history-gaps.js";
|
|
|
7
7
|
import { allAnswer, offsetOf, SOURCE_SEARCHED } from "../../cli/messenger/search-answers.js";
|
|
8
8
|
import { searchAllOptions } from "../../cli/messenger/search-command.js";
|
|
9
9
|
import { deniedKinds } from "../../cli/search-left-out.js";
|
|
10
|
+
import { commandAt, rootOf } from "../../cli/steps.js";
|
|
10
11
|
import { DEAL_KINDS } from "../../domain/deals.js";
|
|
11
12
|
import { SAVE_HELP } from "../../meetings/index.js";
|
|
12
13
|
import { meaningLane } from "../../services/messages-meaning.js";
|
|
@@ -57,7 +58,7 @@ export const addCrmSearchAll = (searches, { within, app, example, }) => {
|
|
|
57
58
|
...(opts.source === undefined ? {} : { source: opts.source }),
|
|
58
59
|
...(opts.maxMeetings === undefined ? {} : { maxMeetings: opts.maxMeetings }),
|
|
59
60
|
...(run.locked ? { scope: { crm: [run.account] } } : {}),
|
|
60
|
-
}, { app }, undefined, meaningLane({ env, messenger: { app }, store: async () => run.store }));
|
|
61
|
+
}, { app, hintCommand: commandAt(rootOf(leaf), "models download") ? app.command : null }, undefined, meaningLane({ env, messenger: { app }, store: async () => run.store }));
|
|
61
62
|
const note = (text) => outputFor(leaf).renderer.note(text);
|
|
62
63
|
for (const { why } of denied)
|
|
63
64
|
note(why);
|
package/dist/crm/writer.d.ts
CHANGED
|
@@ -9,8 +9,9 @@ export interface CrmWriteCapabilities {
|
|
|
9
9
|
kinds: readonly DealKind[];
|
|
10
10
|
verbs: readonly CrmVerb[];
|
|
11
11
|
/**
|
|
12
|
-
* The CRM answers a repeat of an `operationId` from its record instead of doing the write again
|
|
13
|
-
*
|
|
12
|
+
* The CRM answers a repeat of an `operationId` from its record instead of doing the write again. Only then may the
|
|
13
|
+
* owner repeat a write whose answer was lost with the same id. Bitrix24 is not: a live portal (2026-11-07) made a
|
|
14
|
+
* create repeated with one REST 3.0 `Idempotency-Key` a second time.
|
|
14
15
|
*/
|
|
15
16
|
idempotent: boolean;
|
|
16
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.603.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",
|