@tulcn/lxz 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -30,7 +30,7 @@ lxz --version
30
30
 
31
31
  命令和分组都支持 `-h`(同 `--help`)。使用上面的调用前缀加 `auth -h`,列出授权子命令;加 `auth login -h`,查看登录参数与示例。通过帮助逐级查看当前版本的命令与参数。
32
32
 
33
- 默认使用正式授权中心 `https://ai-cli.tul.cn/linkwise-api`。先向管理员确认该环境中已登记且获准使用的 CLI 标识,把下面的 `<CLI 标识>` 替换为管理员分配的值。管理员要求连接其他授权环境时,在当前终端把 `LINKWISE_ISSUER` 设为管理员提供的地址;各环境的登记、授权和令牌互不通用。
33
+ 默认使用正式授权中心 `https://ai-cli.tul.cn/linkwise-api`。先向管理员确认该环境中已登记且获准使用的 CLI 标识,把下面的 `<CLI 标识>` 替换为管理员分配的值。管理员要求连接其他授权环境时,在当前终端把 `LINKWISE_ISSUER` 设为管理员提供的地址;各环境的登记、授权和令牌互不通用。授权中心域名连不上时,CLI 自动改用备用地址(正式为 `https://linkwise.tul.cn/cli`),并在命令行提示一行。
34
34
 
35
35
  登录时在浏览器核对验证码并允许授权;退出命令会撤销本次授权并删除本机登录信息。
36
36
 
@@ -3,6 +3,7 @@ export * from './store.js';
3
3
  export * from './identity.js';
4
4
  export * from './service.js';
5
5
  export * from './gateway.js';
6
+ export * from './platform.js';
6
7
  export * from './modules.js';
7
8
  export * from './inspection.js';
8
9
  export * from './client.js';
@@ -4,6 +4,7 @@ export * from './store.js';
4
4
  export * from './identity.js';
5
5
  export * from './service.js';
6
6
  export * from './gateway.js';
7
+ export * from './platform.js';
7
8
  export * from './modules.js';
8
9
  export * from './inspection.js';
9
10
  export * from './client.js';
@@ -1,8 +1,10 @@
1
1
  import { CliError, readJson, request } from '../cli/index.js';
2
2
  import { gatewayAddress } from './gateway.js';
3
+ import { platformExchange } from './platform.js';
3
4
  export async function inspectAuthorization(config, signal) {
4
- const business = gatewayAddress(config.clientId, { LINKWISE_ISSUER: config.baseUrl });
5
- const response = await request(business + '/', { signal });
5
+ const primary = gatewayAddress(config.clientId, { LINKWISE_ISSUER: config.baseUrl }) + '/';
6
+ const { response, url } = config.site ? await platformExchange(primary, { signal }, { site: config.site }) : { response: await request(primary, { signal }), url: primary };
7
+ const business = url.replace(/\/$/, '');
6
8
  const requestId = response.headers.get('x-request-id');
7
9
  const details = { status: response.status, ...(requestId ? { requestId } : {}) };
8
10
  let data = {};
@@ -0,0 +1,26 @@
1
+ /** Where the platform is reachable: the issuer origin first, then a fallback root serving the same paths. */
2
+ export interface PlatformSite {
3
+ roots: readonly string[];
4
+ stateDirectory?: string;
5
+ }
6
+ export declare function platformSite(env?: NodeJS.ProcessEnv): PlatformSite;
7
+ /** The path of target under the root that reference was sent to. */
8
+ export declare function atRootOf(target: string, reference: string, site: PlatformSite): string;
9
+ /**
10
+ * Sends a request to the platform. When a root cannot be reached (no connection, or HTTP 502/504 from a proxy) the request is sent
11
+ * at the other root; a request that may already have been delivered (lost connection, 504) only when replay is allowed.
12
+ * Once the fallback answers for an unreachable primary, it goes first for 10 minutes and log is told. URLs outside the platform are sent as they are.
13
+ */
14
+ export declare function platformExchange(url: string | URL, init: RequestInit, { site, replay, log }: {
15
+ site: PlatformSite;
16
+ replay?: boolean;
17
+ log?: (message: string) => void;
18
+ }): Promise<{
19
+ response: Response;
20
+ url: string;
21
+ }>;
22
+ /** Sends a request to the platform of env (LINKWISE_ISSUER), using the fallback address while the primary cannot be reached. */
23
+ export declare function platformRequest(url: string | URL, init?: RequestInit, { env, replay }?: {
24
+ env?: NodeJS.ProcessEnv;
25
+ replay?: boolean;
26
+ }): Promise<Response>;
@@ -0,0 +1,102 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
3
+ import { dirname, join } from 'node:path';
4
+ import { CliError, request, secureUrl } from '../cli/index.js';
5
+ import { deploymentDefaults, deploymentFallbacks } from '../cli/deployment.js';
6
+ import { stateDirectory } from './store.js';
7
+ const FALLBACK_FIRST_MS = 10 * 60 * 1000;
8
+ /** Failures before anything is sent: name resolution, refused or timed-out connections, TLS. */
9
+ const NOT_CONNECTED = new Set(['ENOTFOUND', 'EAI_AGAIN', 'ECONNREFUSED', 'EHOSTUNREACH', 'ENETUNREACH', 'UND_ERR_CONNECT_TIMEOUT',
10
+ 'CERT_HAS_EXPIRED', 'ERR_TLS_CERT_ALTNAME_INVALID', 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', 'DEPTH_ZERO_SELF_SIGNED_CERT', 'SELF_SIGNED_CERT_IN_CHAIN', 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY']);
11
+ /** Connections lost after the request may have been delivered. */
12
+ const DISCONNECTED = new Set(['ECONNRESET', 'EPIPE', 'UND_ERR_SOCKET']);
13
+ export function platformSite(env = process.env) {
14
+ const issuer = env.LINKWISE_ISSUER ?? deploymentDefaults.LINKWISE_ISSUER;
15
+ const allowHttp = /^http:/i.test(issuer.trim());
16
+ const origin = secureUrl(issuer, 'Authorization service URL', { allowHttp }).origin;
17
+ const fallback = env.LINKWISE_FALLBACK_URL ?? deploymentFallbacks[origin];
18
+ const roots = fallback ? [origin, secureUrl(fallback, 'Fallback service URL', { allowHttp }).href.replace(/\/+$/, '')] : [origin];
19
+ return { roots, stateDirectory: env.LXZ_STATE_DIR };
20
+ }
21
+ /** The path of target under the root that reference was sent to. */
22
+ export function atRootOf(target, reference, site) {
23
+ const from = rootOf(target, site);
24
+ const to = rootOf(reference, site);
25
+ return from === undefined || to === undefined ? target : to + target.slice(from.length);
26
+ }
27
+ /**
28
+ * Sends a request to the platform. When a root cannot be reached (no connection, or HTTP 502/504 from a proxy) the request is sent
29
+ * at the other root; a request that may already have been delivered (lost connection, 504) only when replay is allowed.
30
+ * Once the fallback answers for an unreachable primary, it goes first for 10 minutes and log is told. URLs outside the platform are sent as they are.
31
+ */
32
+ export async function platformExchange(url, init, { site, replay = true, log = notice }) {
33
+ const target = String(url);
34
+ const root = rootOf(target, site);
35
+ if (root === undefined || site.roots.length < 2)
36
+ return { response: await request(target, init), url: target };
37
+ const [primary, fallback] = site.roots;
38
+ const marker = join(stateDirectory(site.stateDirectory), `platform-${createHash('sha256').update(primary).digest('hex').slice(0, 16)}.json`);
39
+ const order = await fallbackFirst(marker) ? [fallback, primary] : [primary, fallback];
40
+ for (const [index, base] of order.entries()) {
41
+ const attempt = base + target.slice(root.length);
42
+ const last = index === order.length - 1;
43
+ let response;
44
+ try {
45
+ response = await request(attempt, init);
46
+ }
47
+ catch (error) {
48
+ init.signal?.throwIfAborted();
49
+ if (last || !unreachable(error, replay))
50
+ throw error;
51
+ continue;
52
+ }
53
+ if (!last && unreachable(response.status, replay)) {
54
+ await response.body?.cancel();
55
+ continue;
56
+ }
57
+ if (index > 0 && !unreachable(response.status, replay)) {
58
+ await setFallbackFirst(marker, base === fallback ? Date.now() + FALLBACK_FIRST_MS : 0);
59
+ if (base === fallback)
60
+ log(`The primary platform address is unreachable; using the fallback address ${fallback} for the next 10 minutes.`);
61
+ }
62
+ return { response, url: attempt };
63
+ }
64
+ throw new CliError('INTERNAL', 'No platform address was tried.', 'Contact the lxz maintainer.');
65
+ }
66
+ /** Sends a request to the platform of env (LINKWISE_ISSUER), using the fallback address while the primary cannot be reached. */
67
+ export async function platformRequest(url, init = {}, { env, replay } = {}) {
68
+ return (await platformExchange(url, init, { site: platformSite(env), replay })).response;
69
+ }
70
+ function rootOf(url, site) {
71
+ return [...site.roots].sort((a, b) => b.length - a.length).find(root => url === root || url.startsWith(root + '/') || url.startsWith(root + '?'));
72
+ }
73
+ function unreachable(outcome, replay) {
74
+ if (typeof outcome === 'number')
75
+ return outcome === 502 || (replay && outcome === 504);
76
+ if (!(outcome instanceof CliError) || outcome.code !== 'UNAVAILABLE')
77
+ return false;
78
+ let cause = outcome.cause;
79
+ while (cause && typeof cause.code !== 'string')
80
+ cause = cause.cause;
81
+ const code = cause?.code;
82
+ return code !== undefined && (NOT_CONNECTED.has(code) || (replay && DISCONNECTED.has(code)));
83
+ }
84
+ async function fallbackFirst(marker) {
85
+ try {
86
+ return Number(JSON.parse(await readFile(marker, 'utf8')).until) > Date.now();
87
+ }
88
+ catch {
89
+ return false;
90
+ }
91
+ }
92
+ async function setFallbackFirst(marker, until) {
93
+ // The marker only saves waiting for an unreachable primary; when it cannot be written, the next request tries the primary again.
94
+ try {
95
+ await mkdir(dirname(marker), { recursive: true, mode: 0o700 });
96
+ await writeFile(marker, JSON.stringify({ until }), { mode: 0o600 });
97
+ }
98
+ catch { /* ignored */ }
99
+ }
100
+ function notice(message) {
101
+ process.stderr.write(message + '\n');
102
+ }
@@ -1,5 +1,6 @@
1
1
  import type { Context } from '../cli/index.js';
2
2
  import { openBrowser } from '../cli/browser.js';
3
+ import type { PlatformSite } from './platform.js';
3
4
  export interface AuthConfig {
4
5
  baseUrl: string;
5
6
  clientId: string;
@@ -8,6 +9,8 @@ export interface AuthConfig {
8
9
  revokeEndpoint: string;
9
10
  allowHttp: boolean;
10
11
  stateDirectory?: string;
12
+ /** Addresses the endpoints are also served at; without it requests go only to baseUrl. */
13
+ site?: PlatformSite;
11
14
  }
12
15
  export interface TokenSet {
13
16
  account?: string;
@@ -28,6 +31,7 @@ export declare class OAuthProvider implements AuthProvider {
28
31
  readonly config: AuthConfig;
29
32
  private readonly browser;
30
33
  constructor(config: AuthConfig, browser?: typeof openBrowser);
34
+ private exchange;
31
35
  private send;
32
36
  private post;
33
37
  login(context: Context): Promise<TokenSet>;
@@ -7,6 +7,7 @@ import { authorizationPrompt } from '../cli/device-login.js';
7
7
  import { backendError } from './response.js';
8
8
  import { FileSessionStore } from './store.js';
9
9
  import { deploymentDefaults } from '../cli/deployment.js';
10
+ import { atRootOf, platformExchange, platformSite } from './platform.js';
10
11
  function text(data, name) {
11
12
  if (typeof data[name] === 'string' && data[name])
12
13
  return data[name];
@@ -46,7 +47,7 @@ export function authConfig(env = process.env, clientId = env.LXZ_AUTH_CLIENT_ID)
46
47
  throw new CliError('CONFIGURATION', 'Authorization service URL or client ID is missing.', 'Set LINKWISE_ISSUER and, if no default client ID is configured, LXZ_AUTH_CLIENT_ID. Obtain these values from the administrator.');
47
48
  const allowHttp = /^http:/i.test(issuer.trim());
48
49
  const baseUrl = secureUrl(issuer, 'Authorization service URL', { allowHttp }).href.replace(/\/$/, '');
49
- return { baseUrl, clientId, allowHttp, stateDirectory: env.LXZ_STATE_DIR, deviceEndpoint: `${baseUrl}/oauth2/device_authorization`, tokenEndpoint: `${baseUrl}/oauth2/token`, revokeEndpoint: `${baseUrl}/oauth2/revoke` };
50
+ return { baseUrl, clientId, allowHttp, stateDirectory: env.LXZ_STATE_DIR, site: platformSite(env), deviceEndpoint: `${baseUrl}/oauth2/device_authorization`, tokenEndpoint: `${baseUrl}/oauth2/token`, revokeEndpoint: `${baseUrl}/oauth2/revoke` };
50
51
  }
51
52
  export class OAuthProvider {
52
53
  config;
@@ -55,22 +56,28 @@ export class OAuthProvider {
55
56
  this.config = config;
56
57
  this.browser = browser;
57
58
  }
58
- send(endpoint, values, signal) {
59
- return request(endpoint, { method: 'POST', headers: { 'x-request-id': randomUUID() }, body: new URLSearchParams({ client_id: this.config.clientId, ...values }), signal });
59
+ exchange(endpoint, values, signal, { replay = true, log } = {}) {
60
+ const init = { method: 'POST', headers: { 'x-request-id': randomUUID() }, body: new URLSearchParams({ client_id: this.config.clientId, ...values }), signal };
61
+ return this.config.site ? platformExchange(endpoint, init, { site: this.config.site, replay, log }) : request(endpoint, init).then(response => ({ response, url: endpoint }));
60
62
  }
61
- async post(endpoint, values, signal) {
62
- const response = await this.send(endpoint, values, signal);
63
+ async send(endpoint, values, signal, options) {
64
+ return (await this.exchange(endpoint, values, signal, options)).response;
65
+ }
66
+ async post(endpoint, values, signal, options) {
67
+ const { response, url } = await this.exchange(endpoint, values, signal, options);
63
68
  const data = await readJson(response);
64
- return { response, data };
69
+ return { response, data, url };
65
70
  }
66
71
  async login(context) {
67
72
  if (!context.interactive && !context.allowDeviceLogin)
68
73
  throw new CliError('AUTH_REQUIRED', 'Authorize this CLI before continuing.', 'Run init in a terminal; for scripts, use init --device-login --timeout-ms 660000 and ask the user to approve in a browser.');
69
74
  const os = { win32: 'Windows', darwin: 'macOS', linux: 'Linux' }[platform()] ?? platform();
70
75
  const deviceId = await new FileSessionStore(`${this.config.baseUrl}\n${this.config.clientId}`, this.config.stateDirectory).deviceId(context.signal);
71
- const device = await this.post(this.config.deviceEndpoint, { client_os: os, device_id: deviceId }, context.signal);
76
+ const device = await this.post(this.config.deviceEndpoint, { client_os: os, device_id: deviceId }, context.signal, { log: context.log });
72
77
  if (!device.response.ok)
73
78
  throw backendError(device.response, device.data);
79
+ // The whole device login stays at the address that issued the device code.
80
+ const tokenEndpoint = this.config.site ? atRootOf(this.config.tokenEndpoint, device.url, this.config.site) : this.config.tokenEndpoint;
74
81
  const verification = text(device.data, 'verification_uri_complete');
75
82
  secureUrl(verification, 'Authorization approval URL', { allowHttp: this.config.allowHttp, allowQuery: true });
76
83
  const code = text(device.data, 'user_code');
@@ -97,7 +104,7 @@ export class OAuthProvider {
97
104
  const remaining = AbortSignal.timeout(Math.max(1, deadline - Date.now()));
98
105
  let response;
99
106
  try {
100
- response = await this.send(this.config.tokenEndpoint, { device_code: deviceCode, grant_type: 'urn:ietf:params:oauth:grant-type:device_code' }, AbortSignal.any([context.signal, remaining]));
107
+ response = await request(tokenEndpoint, { method: 'POST', headers: { 'x-request-id': randomUUID() }, body: new URLSearchParams({ client_id: this.config.clientId, device_code: deviceCode, grant_type: 'urn:ietf:params:oauth:grant-type:device_code' }), signal: AbortSignal.any([context.signal, remaining]) });
101
108
  }
102
109
  catch (error) {
103
110
  context.signal.throwIfAborted();
@@ -144,7 +151,8 @@ export class OAuthProvider {
144
151
  throw new CliError('AUTH_EXPIRED', 'The user code has expired.', 'Run init or login again to request a new user code.');
145
152
  }
146
153
  async refresh(refreshToken, signal) {
147
- const { response, data } = await this.post(this.config.tokenEndpoint, { grant_type: 'refresh_token', refresh_token: refreshToken }, signal);
154
+ // A delivered refresh rotates the token, and sending the old one again is treated as replay; move only when nothing was sent.
155
+ const { response, data } = await this.post(this.config.tokenEndpoint, { grant_type: 'refresh_token', refresh_token: refreshToken }, signal, { replay: false });
148
156
  if (!response.ok)
149
157
  throw backendError(response, data, [refreshToken]);
150
158
  return tokens(data);
@@ -1,10 +1,11 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { setTimeout as delay } from 'node:timers/promises';
3
- import { CliError, readJson, request, secureUrl } from '../cli/index.js';
3
+ import { CliError, readJson, secureUrl } from '../cli/index.js';
4
4
  import { backendError } from './response.js';
5
+ import { platformRequest } from './platform.js';
5
6
  export async function serviceJson(identity, input, signal) {
6
7
  const url = secureUrl(String(input), 'Business service URL', { allowHttp: true, allowQuery: true });
7
- return readJson(await serviceRequest(identity, token => request(url, { headers: { authorization: `Bearer ${token}`, 'x-request-id': randomUUID() }, signal }), signal));
8
+ return readJson(await serviceRequest(identity, token => platformRequest(url, { headers: { authorization: `Bearer ${token}`, 'x-request-id': randomUUID() }, signal }), signal));
8
9
  }
9
10
  export async function serviceRequest(identity, send, signal, { replay = true } = {}) {
10
11
  let credential = await identity.credential(signal);
@@ -13,6 +13,7 @@ export interface SessionAccess {
13
13
  write(session: Session): Promise<void>;
14
14
  clear(): Promise<void>;
15
15
  }
16
+ export declare const stateDirectory: (directory?: string | undefined) => string;
16
17
  export declare class FileSessionStore implements SessionStore {
17
18
  readonly directory: string;
18
19
  readonly file: string;
@@ -18,10 +18,11 @@ function protect(input, decrypt, signal) {
18
18
  child.stdin.end(input);
19
19
  });
20
20
  }
21
+ export const stateDirectory = (directory = process.env.LXZ_STATE_DIR) => directory ?? join(homedir(), '.lianxz', 'identity');
21
22
  export class FileSessionStore {
22
23
  directory;
23
24
  file;
24
- constructor(context, directory = process.env.LXZ_STATE_DIR ?? join(homedir(), '.lianxz', 'identity')) {
25
+ constructor(context, directory = stateDirectory()) {
25
26
  this.directory = directory;
26
27
  this.file = join(directory, `${createHash('sha256').update(context).digest('hex')}.json`);
27
28
  }
@@ -1,5 +1,13 @@
1
1
  export declare const deploymentDefaults: {
2
2
  LINKWISE_ISSUER: string;
3
3
  };
4
- /** Fixes the authorization server for this process and the lxz processes it starts: environment, then the file a test build ships with, then production. */
4
+ /**
5
+ * Roots serving the same paths as an issuer origin, used while that origin cannot be reached.
6
+ * LINKWISE_FALLBACK_URL overrides (an empty value disables); a test build ships its own in linkwise.env.json.
7
+ */
8
+ export declare const deploymentFallbacks: Readonly<Record<string, string>>;
9
+ /**
10
+ * Fixes the authorization server for this process and the lxz processes it starts: environment, then the file a test build ships with, then production.
11
+ * The packaged fallback address goes with the packaged issuer only.
12
+ */
5
13
  export declare function applyDeployment(packageRoot: URL, env?: NodeJS.ProcessEnv): void;
@@ -2,7 +2,14 @@ import { readFileSync } from 'node:fs';
2
2
  export const deploymentDefaults = {
3
3
  LINKWISE_ISSUER: 'https://ai-cli.tul.cn/linkwise-api',
4
4
  };
5
- function packagedIssuer(packageRoot) {
5
+ /**
6
+ * Roots serving the same paths as an issuer origin, used while that origin cannot be reached.
7
+ * LINKWISE_FALLBACK_URL overrides (an empty value disables); a test build ships its own in linkwise.env.json.
8
+ */
9
+ export const deploymentFallbacks = {
10
+ 'https://ai-cli.tul.cn': 'https://linkwise.tul.cn/cli',
11
+ };
12
+ function packagedDeployment(packageRoot) {
6
13
  let text;
7
14
  try {
8
15
  text = readFileSync(new URL('linkwise.env.json', packageRoot), 'utf8');
@@ -12,12 +19,17 @@ function packagedIssuer(packageRoot) {
12
19
  return undefined;
13
20
  throw error;
14
21
  }
15
- const value = JSON.parse(text).LINKWISE_ISSUER;
16
- if (typeof value !== 'string' || !value)
22
+ const { LINKWISE_ISSUER: issuer, LINKWISE_FALLBACK_URL: fallback } = JSON.parse(text);
23
+ if (typeof issuer !== 'string' || !issuer)
17
24
  throw new Error('linkwise.env.json must set LINKWISE_ISSUER.');
18
- return value;
25
+ return { LINKWISE_ISSUER: issuer, ...(typeof fallback === 'string' ? { LINKWISE_FALLBACK_URL: fallback } : {}) };
19
26
  }
20
- /** Fixes the authorization server for this process and the lxz processes it starts: environment, then the file a test build ships with, then production. */
27
+ /**
28
+ * Fixes the authorization server for this process and the lxz processes it starts: environment, then the file a test build ships with, then production.
29
+ * The packaged fallback address goes with the packaged issuer only.
30
+ */
21
31
  export function applyDeployment(packageRoot, env = process.env) {
22
- env.LINKWISE_ISSUER ??= packagedIssuer(packageRoot) ?? deploymentDefaults.LINKWISE_ISSUER;
32
+ if (env.LINKWISE_ISSUER !== undefined)
33
+ return;
34
+ Object.assign(env, packagedDeployment(packageRoot) ?? deploymentDefaults);
23
35
  }
package/dist/cli/http.js CHANGED
@@ -22,7 +22,7 @@ export async function request(url, init = {}) {
22
22
  throw init.signal.reason;
23
23
  if (timeout.aborted)
24
24
  throw new CliError('TIMEOUT', 'The service did not respond within 60 seconds.', 'Check the network and service status, then retry.', true);
25
- throw new CliError('UNAVAILABLE', 'Cannot reach the service.', 'Check the network and service URL, then retry.', true);
25
+ throw new CliError('UNAVAILABLE', 'Cannot reach the service.', 'Check the network and service URL, then retry.', true, undefined, error);
26
26
  }
27
27
  }
28
28
  export async function readJson(response) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tulcn/lxz",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "description": "联小助 CLI 主程序与命令、授权、Skill 模块",
6
6
  "license": "UNLICENSED",
package/skills/SKILL.md CHANGED
@@ -5,7 +5,7 @@ description: 管理指定 CLI 的登录授权并检查运行环境
5
5
 
6
6
  # lxz
7
7
 
8
- 此说明对应 @tulcn/lxz@0.3.0。优先使用已安装且版本匹配的 lxz;未安装时,可用 `pnpm dlx @tulcn/lxz@<版本>`(`<版本>` 取上面的版本号)作为调用前缀。以下命令适用于 pwsh 和 bash,选择 dlx 时替换调用前缀。
8
+ 此说明对应 @tulcn/lxz@0.3.1。优先使用已安装且版本匹配的 lxz;未安装时,可用 `pnpm dlx @tulcn/lxz@<版本>`(`<版本>` 取上面的版本号)作为调用前缀。以下命令适用于 pwsh 和 bash,选择 dlx 时替换调用前缀。
9
9
 
10
10
  功能定位可按需读取同目录 [features.md](features.md);它由当前命令注册自动生成,再沿子命令帮助查询参数。
11
11
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lxz",
3
3
  "packageName": "@tulcn/lxz",
4
- "version": "0.3.0",
5
- "cliVersion": "0.3.0",
4
+ "version": "0.3.1",
5
+ "cliVersion": "0.3.1",
6
6
  "contractVersion": "1.0.0"
7
7
  }