@wirecat/cli-core 0.736.0 → 0.738.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 +27 -0
- package/dist/cli/documents/words.d.ts +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1 -0
- package/dist/cli/setup-command.js +6 -3
- package/dist/cli/token-session.d.ts +7 -0
- package/dist/cli/token-session.js +13 -3
- package/dist/setup/plain.d.ts +9 -0
- package/dist/setup/plain.js +11 -0
- package/dist/terminal/hyperlink.d.ts +8 -0
- package/dist/terminal/hyperlink.js +21 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ 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.738.0 — 24.11.2026
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **A token guide and the setup walk-through draw their links as links** in a terminal known to show OSC 8 links
|
|
13
|
+
(GNOME Terminal and other VTE ones, iTerm2, kitty, WezTerm, Windows Terminal, VS Code, Ghostty; `FORCE_HYPERLINK`
|
|
14
|
+
decides elsewhere), so a long address no longer fills the screen. Elsewhere the address is printed beside the words.
|
|
15
|
+
`session start` prints its guide as plain text with its own headings, not as a note line.
|
|
16
|
+
|
|
17
|
+
## 0.737.0 — 23.11.2026
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **`tokenSessionCommand` takes a `guide`**: how a person who never made one gets the token, step by step with its
|
|
22
|
+
links. `session start` prints it before the question at a terminal and at the end of `session start --help`, never
|
|
23
|
+
before piped input.
|
|
24
|
+
- **`plainSetupText`**: a setup text for a terminal, with `**`, code marks and `[words](link)` turned into plain words
|
|
25
|
+
and the address. The terminal walk-through `<profile> setup` shows its texts that way, so a person no longer sees
|
|
26
|
+
raw Markdown.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- **A release passes parity again while four CLIs adopt `schedule exec` leaving MCP.** #3258 stopped offering
|
|
31
|
+
`schedule exec` to agents; cli-memo, mail-cli and bitrix24-cli test that it is offered, and max-cli's docs/mcp.md
|
|
32
|
+
does not list it among the commands kept off MCP. They are on the parity known-broken list until 2026-11-30 and
|
|
33
|
+
update those tests and docs when they bump cli-core.
|
|
34
|
+
|
|
8
35
|
## 0.736.0 — 23.11.2026
|
|
9
36
|
|
|
10
37
|
### Added
|
|
@@ -58,8 +58,8 @@ export interface CopyAge {
|
|
|
58
58
|
}
|
|
59
59
|
export declare const ageOf: (lastSync: string | undefined, now?: number) => CopyAge;
|
|
60
60
|
export declare const staleCopy: (provider: string, lastSync: string | undefined, now?: number) => {
|
|
61
|
-
missing?: undefined;
|
|
62
61
|
next?: undefined;
|
|
62
|
+
readonly missing?: undefined;
|
|
63
63
|
meta?: undefined;
|
|
64
64
|
} | {
|
|
65
65
|
missing: {
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export { openRequestTask } from "../services/task-rules.js";
|
|
|
48
48
|
export { TASK_PAIR_QUERY, TASK_QUERY } from "../services/tasks.js";
|
|
49
49
|
export { defineSetup, type Setup, type SetupCheck, type SetupCheckInput, type SetupDefinition, type SetupKeep, setupProblems, } from "../setup/define.js";
|
|
50
50
|
export { type Asset as SetupAsset, BLOCK_ROLES, BLOCK_TYPES, type Block as SetupBlock, BUILT_IN_ACTIONS, type Condition as SetupCondition, DISPLAY_CLASSES, INPUT_KINDS, SETUP_FORMAT, SETUP_LIMITS, SETUP_PATTERNS, SETUP_VERSION, type SetupDocument, type Step as SetupStep, setupDocumentSchema, setupJsonSchema, } from "../setup/document.js";
|
|
51
|
+
export { plainSetupText } from "../setup/plain.js";
|
|
51
52
|
export { answerStdinOption, type Need, type SignInSteps, type SignInStepsOptions, signInSteps, } from "../terminal/sign-in-steps.js";
|
|
52
53
|
export { type AccountRemoval, type AccountRemovalContext, type AccountRemoveOptions, type AccountSecrets, accountRemoveCommand, mayRevoke, type SignedOut, } from "./account-remove.js";
|
|
53
54
|
export { type AccountRenameOptions, type AccountRenaming, accountRenameCommand } from "./account-rename.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -43,6 +43,7 @@ export { openRequestTask } from "../services/task-rules.js";
|
|
|
43
43
|
export { TASK_PAIR_QUERY, TASK_QUERY } from "../services/tasks.js";
|
|
44
44
|
export { defineSetup, setupProblems, } from "../setup/define.js";
|
|
45
45
|
export { BLOCK_ROLES, BLOCK_TYPES, BUILT_IN_ACTIONS, DISPLAY_CLASSES, INPUT_KINDS, SETUP_FORMAT, SETUP_LIMITS, SETUP_PATTERNS, SETUP_VERSION, setupDocumentSchema, setupJsonSchema, } from "../setup/document.js";
|
|
46
|
+
export { plainSetupText } from "../setup/plain.js";
|
|
46
47
|
export { answerStdinOption, signInSteps, } from "../terminal/sign-in-steps.js";
|
|
47
48
|
export { accountRemoveCommand, mayRevoke, } from "./account-remove.js";
|
|
48
49
|
export { accountRenameCommand } from "./account-rename.js";
|
|
@@ -5,6 +5,8 @@ import { Command } from "commander";
|
|
|
5
5
|
import { agentOf } from "../runs/run-context.js";
|
|
6
6
|
import { checkField, holds, nextOf, walk, } from "../setup/answers.js";
|
|
7
7
|
import { SETUP_LIMITS } from "../setup/document.js";
|
|
8
|
+
import { plainSetupText } from "../setup/plain.js";
|
|
9
|
+
import { drawsHyperlinks, hyperlink } from "../terminal/hyperlink.js";
|
|
8
10
|
import { answerStdinOption, lineReader, signInSteps } from "../terminal/sign-in-steps.js";
|
|
9
11
|
import { refuseGuardedKey } from "./config-command.js";
|
|
10
12
|
import { baseContext, environmentOf, secretInputOf } from "./context.js";
|
|
@@ -264,7 +266,8 @@ export const setupCommand = (setup) => {
|
|
|
264
266
|
const text = (id, params = {}) => id === undefined
|
|
265
267
|
? ""
|
|
266
268
|
: (document.texts[language]?.[id] ?? document.texts.en[id] ?? id).replace(/\{([a-z][a-z0-9_]*)\}/g, (all, name) => params[name] ?? all);
|
|
267
|
-
const
|
|
269
|
+
const drawn = drawsHyperlinks(env) ? { link: hyperlink } : {};
|
|
270
|
+
const say = (line) => renderer.note(plainSetupText(line, drawn));
|
|
268
271
|
const environment = environmentOf(command);
|
|
269
272
|
const input = secretInputOf(command);
|
|
270
273
|
const ask = async (prompt, hidden) => {
|
|
@@ -361,14 +364,14 @@ export const setupCommand = (setup) => {
|
|
|
361
364
|
say(`\n${text(block.text, block.params)}`);
|
|
362
365
|
break;
|
|
363
366
|
case "code":
|
|
364
|
-
|
|
367
|
+
renderer.note(` ${block.code}`);
|
|
365
368
|
break;
|
|
366
369
|
case "image":
|
|
367
370
|
if (block.caption)
|
|
368
371
|
say(text(block.caption));
|
|
369
372
|
break;
|
|
370
373
|
case "link":
|
|
371
|
-
say(
|
|
374
|
+
say(`[${text(block.text)}](${block.href})`);
|
|
372
375
|
break;
|
|
373
376
|
case "requirement":
|
|
374
377
|
say(`${text(block.text)}${block.fix ? ` — ${text(block.fix)}` : ""}`);
|
|
@@ -47,6 +47,13 @@ export interface TokenSessionOptions {
|
|
|
47
47
|
token?: string;
|
|
48
48
|
/** One sentence more for `session start --help`: which token, and what it can see. */
|
|
49
49
|
about?: string;
|
|
50
|
+
/**
|
|
51
|
+
* How a person who never made one gets the token: the steps and their links, in plain words, as the restricted
|
|
52
|
+
* Markdown of a setup text (a `##` heading, `**bold**`, `[words](link)`). `session start` prints it before the
|
|
53
|
+
* question at a terminal, its links drawn as links where the terminal shows them, and `session start --help` ends
|
|
54
|
+
* with it.
|
|
55
|
+
*/
|
|
56
|
+
guide?: string;
|
|
50
57
|
/** One sentence more for `session end --help`, such as what of the service's own tools it leaves alone. */
|
|
51
58
|
endNote?: string;
|
|
52
59
|
}
|
|
@@ -2,6 +2,8 @@ import { CliError } from "@wirecat/cli-base";
|
|
|
2
2
|
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
import { at as valueAt } from "../crm/manifest/map.js";
|
|
5
|
+
import { plainSetupText } from "../setup/plain.js";
|
|
6
|
+
import { drawsHyperlinks, hyperlink } from "../terminal/hyperlink.js";
|
|
5
7
|
import { readSecret } from "../terminal/prompt.js";
|
|
6
8
|
import { baseContext, environmentOf, outputFor, secretInputOf } from "./context.js";
|
|
7
9
|
import { refuseOffline } from "./early-refusal.js";
|
|
@@ -74,12 +76,14 @@ export const tokenSessionCommand = (options) => {
|
|
|
74
76
|
`checked with ${service}, and only then kept in the keyring, or in a private file` +
|
|
75
77
|
(options.about ? `. ${options.about}` : ""))
|
|
76
78
|
.option("--credential-storage <storage>", "where the token is kept: keyring, which falls back to a private file by itself, or file", storageOf, "keyring");
|
|
79
|
+
if (options.guide)
|
|
80
|
+
start.addHelpText("after", `\n${plainSetupText(options.guide)}`);
|
|
77
81
|
if (options.login)
|
|
78
82
|
start.option("--login <name>", `the ${service} user name the password belongs to`);
|
|
79
83
|
if (options.site)
|
|
80
84
|
start.option("--site <address>", `the ${service} site, as https://${options.site.example} or ${options.site.example}`);
|
|
81
85
|
start.action(async function (args) {
|
|
82
|
-
const { env, profile, tokens, run, renderer, keyring } = contextOf(this);
|
|
86
|
+
const { env, profile, tokens, run, renderer, keyring, streams } = contextOf(this);
|
|
83
87
|
refuseCommandName(profile, commandWords(rootOf(this)), app.command);
|
|
84
88
|
if (options.site && args.site === undefined)
|
|
85
89
|
throw new CliError("validation_error", `give the ${service} site: --site ${options.site.example}`);
|
|
@@ -94,8 +98,14 @@ export const tokenSessionCommand = (options) => {
|
|
|
94
98
|
const page = options.login?.page?.(site);
|
|
95
99
|
const input = secretInputOf(this).input ?? process.stdin;
|
|
96
100
|
// Only a person at a terminal pastes it; piped in, the note would stand before the answer on stderr.
|
|
97
|
-
if (
|
|
98
|
-
|
|
101
|
+
if (input.isTTY) {
|
|
102
|
+
if (options.guide) {
|
|
103
|
+
const link = drawsHyperlinks(env) ? hyperlink : undefined;
|
|
104
|
+
streams.diagnostic(`${plainSetupText(options.guide, link ? { link } : {})}\n\n`);
|
|
105
|
+
}
|
|
106
|
+
if (page)
|
|
107
|
+
renderer.note(`the ${word} of ${login}: make one at ${page}, then paste it here`);
|
|
108
|
+
}
|
|
99
109
|
// A secret is never an argument: it would land in shell history and in the run record (WC-SECR-5).
|
|
100
110
|
const secret = (await readSecret(`${service} ${word}: `, secretInputOf(this))).trim();
|
|
101
111
|
if (!secret)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A setup text for a terminal: Desktop draws its restricted Markdown, a terminal shows `#`, `**`, backticks and
|
|
3
|
+
* `[…](…)` as typed. Headings, bold and code lose their marks. A link keeps its address beside its words, since the
|
|
4
|
+
* address is what a person copies, unless `link` draws it, as a terminal that shows OSC 8 links does. Single `*` and
|
|
5
|
+
* `_` stay: in plain text they are as often a product or a name as italics.
|
|
6
|
+
*/
|
|
7
|
+
export declare const plainSetupText: (text: string, { link, }?: {
|
|
8
|
+
link?: (label: string, href: string) => string;
|
|
9
|
+
}) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A setup text for a terminal: Desktop draws its restricted Markdown, a terminal shows `#`, `**`, backticks and
|
|
3
|
+
* `[…](…)` as typed. Headings, bold and code lose their marks. A link keeps its address beside its words, since the
|
|
4
|
+
* address is what a person copies, unless `link` draws it, as a terminal that shows OSC 8 links does. Single `*` and
|
|
5
|
+
* `_` stay: in plain text they are as often a product or a name as italics.
|
|
6
|
+
*/
|
|
7
|
+
export const plainSetupText = (text, { link = (label, href) => `${label} (${href})`, } = {}) => text
|
|
8
|
+
.replace(/^#{1,3} +/gm, "")
|
|
9
|
+
.replace(/\[([^\]\n]*)\]\(([^)\s]*)\)/g, (_all, label, href) => !label || [href, href.replace(/^https:\/\//, "")].includes(label) ? href : link(label, href))
|
|
10
|
+
.replace(/\*\*([^*\n]+)\*\*/g, "$1")
|
|
11
|
+
.replace(/`([^`\n]+)`/g, "$1");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the terminal draws an OSC 8 link. One that does not drops the escape and shows only the words, so the address
|
|
3
|
+
* would be lost: only terminals known to draw it get one, and `FORCE_HYPERLINK=1` or `=0` decides for any other.
|
|
4
|
+
* tmux and screen pass the escape on only when set up to, so they get the address.
|
|
5
|
+
*/
|
|
6
|
+
export declare const drawsHyperlinks: (env: NodeJS.ProcessEnv) => boolean;
|
|
7
|
+
/** The words as a link to the address; a BEL or ESC in either would end the sequence early, so they are dropped. */
|
|
8
|
+
export declare const hyperlink: (label: string, href: string) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the terminal draws an OSC 8 link. One that does not drops the escape and shows only the words, so the address
|
|
3
|
+
* would be lost: only terminals known to draw it get one, and `FORCE_HYPERLINK=1` or `=0` decides for any other.
|
|
4
|
+
* tmux and screen pass the escape on only when set up to, so they get the address.
|
|
5
|
+
*/
|
|
6
|
+
export const drawsHyperlinks = (env) => {
|
|
7
|
+
if (env.FORCE_HYPERLINK !== undefined)
|
|
8
|
+
return env.FORCE_HYPERLINK !== "0";
|
|
9
|
+
if (env.TMUX || env.STY || env.CI || env.TERM === "dumb")
|
|
10
|
+
return false;
|
|
11
|
+
if (Number(env.VTE_VERSION) >= 5000)
|
|
12
|
+
return true;
|
|
13
|
+
if (env.WT_SESSION || env.KITTY_WINDOW_ID || env.KONSOLE_VERSION || env.WEZTERM_EXECUTABLE)
|
|
14
|
+
return true;
|
|
15
|
+
return ["iTerm.app", "WezTerm", "vscode", "ghostty"].includes(env.TERM_PROGRAM ?? "");
|
|
16
|
+
};
|
|
17
|
+
/** The words as a link to the address; a BEL or ESC in either would end the sequence early, so they are dropped. */
|
|
18
|
+
export const hyperlink = (label, href) => {
|
|
19
|
+
const clean = (text) => [...text].filter((char) => char >= " " && char !== "\u007f").join("");
|
|
20
|
+
return `\u001b]8;;${clean(href)}\u0007${clean(label)}\u001b]8;;\u0007`;
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.738.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",
|