@qoder-ai/qmind-cli 3.5.0 → 4.0.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
@@ -4,6 +4,16 @@ English (default) | [简体中文](CHANGELOG.zh-CN.md)
4
4
 
5
5
  Published versions below describe the Global CLI/shared implementation, not historical CN releases. CN will join the shared history with the future joint release.
6
6
 
7
+ ## 4.0.0
8
+
9
+ ### Major Changes
10
+
11
+ - c0df079: Require Node.js 22.19.0 or later. Upgrade Node.js before installing this release if you use an older runtime.
12
+
13
+ Upgrade undici to 8.12.2, commander to 15.0.0, entities to 8.1.0, eventsource-parser to 4.1.2, open to 11.0.4, p-limit to 7.3.3, picomatch to 4.0.7, and zod to 4.6.7. Preserve existing HTTP/1.1 transport behavior and proxy policies.
14
+
15
+ Explicitly select English as the Global npm README and Chinese as the CN npm README. Use Qoder CN consistently as the CN product name in both languages.
16
+
7
17
  ## 3.5.0
8
18
 
9
19
  ### Minor Changes
@@ -62,7 +72,7 @@ Published versions below describe the Global CLI/shared implementation, not hist
62
72
 
63
73
  ### Major Changes
64
74
 
65
- - 28508e5: Release QMind CLI as one shared-version Global/CN cohort. Keep `@qoder-ai/qmind-cli` / `qmind` for Qoder Global and introduce `@qodercn-ai/qmind-cli` / `qmind-cn` for Qoder China. Each distribution now has a build-time-fixed product identity and production target, isolated product/target file credentials, bilingual package documentation and changelog, and an immutable dual-distribution candidate that is published automatically after its Changeset reaches `main`. The CLI no longer reads legacy root state or OS Keyring entries; upgrade the Global package and sign in again, and install the CN package separately when it is published.
75
+ - 28508e5: Release QMind CLI as one shared-version Global/CN cohort. Keep `@qoder-ai/qmind-cli` / `qmind` for Qoder Global and introduce `@qodercn-ai/qmind-cli` / `qmind-cn` for Qoder CN. Each distribution now has a build-time-fixed product identity and production target, isolated product/target file credentials, bilingual package documentation and changelog, and an immutable dual-distribution candidate that is published automatically after its Changeset reaches `main`. The CLI no longer reads legacy root state or OS Keyring entries; upgrade the Global package and sign in again, and install the CN package separately when it is published.
66
76
 
67
77
  ### Changes without version bumps
68
78
 
@@ -4,6 +4,16 @@
4
4
 
5
5
  以下已发布版本属于 Global CLI / 共享实现,不代表 CN 曾发布过这些版本。CN 将在后续共同发行版加入同一历史。
6
6
 
7
+ ## 4.0.0
8
+
9
+ ### Major Changes
10
+
11
+ - c0df079: 要求 Node.js 22.19.0 及以上版本。使用较旧运行时的用户须先升级 Node.js,再安装此版本。
12
+
13
+ 将 undici 升级至 8.12.2、commander 升级至 15.0.0、entities 升级至 8.1.0、eventsource-parser 升级至 4.1.2、open 升级至 11.0.4、p-limit 升级至 7.3.3、picomatch 升级至 4.0.7、zod 升级至 4.6.7。保留既有 HTTP/1.1 传输行为与代理策略。
14
+
15
+ 显式指定 Global npm README 默认为英文、CN npm README 默认为中文,并在中英文文档中统一使用 Qoder CN 产品名称。
16
+
7
17
  ## 3.5.0
8
18
 
9
19
  ### Minor Changes
@@ -62,7 +72,7 @@
62
72
 
63
73
  ### Major Changes
64
74
 
65
- - 28508e5: 将 QMind CLI 作为共享版本的 Global/CN 共同发行版发布:Qoder Global 继续使用 `@qoder-ai/qmind-cli` / `qmind`,Qoder 中国版新增 `@qodercn-ai/qmind-cli` / `qmind-cn`。每个发行版都具有构建时固定的产品身份与正式目标、按产品/目标隔离的文件凭证、中英文 package 文档与 changelog,以及一个在 Changeset 进入 `main` 后自动发布的双发行物不可变候选。CLI 不再读取旧根目录状态或 OS Keyring 项;Global 用户升级后需要重新登录,CN 包正式发布后需单独安装。
75
+ - 28508e5: 将 QMind CLI 作为共享版本的 Global/CN 共同发行版发布:Qoder Global 继续使用 `@qoder-ai/qmind-cli` / `qmind`,Qoder CN 新增 `@qodercn-ai/qmind-cli` / `qmind-cn`。每个发行版都具有构建时固定的产品身份与正式目标、按产品/目标隔离的文件凭证、中英文 package 文档与 changelog,以及一个在 Changeset 进入 `main` 后自动发布的双发行物不可变候选。CLI 不再读取旧根目录状态或 OS Keyring 项;Global 用户升级后需要重新登录,CN 包正式发布后需单独安装。
66
76
 
67
77
  ### Changes without version bumps
68
78
 
package/README.md CHANGED
@@ -8,7 +8,7 @@ Package: `@qoder-ai/qmind-cli` · command: `qmind`
8
8
 
9
9
  ## Install
10
10
 
11
- Node.js `>=20.18.1` is required.
11
+ Node.js `>=22.19.0` is required.
12
12
 
13
13
  ```sh
14
14
  npm install --global @qoder-ai/qmind-cli
package/README.zh-CN.md CHANGED
@@ -8,7 +8,7 @@ npm 包:`@qoder-ai/qmind-cli` · 命令:`qmind`
8
8
 
9
9
  ## 安装
10
10
 
11
- 需要 Node.js `>=20.18.1`。
11
+ 需要 Node.js `>=22.19.0`。
12
12
 
13
13
  ```sh
14
14
  npm install --global @qoder-ai/qmind-cli
package/bin/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as nodeModule from 'node:module';
4
4
 
5
- // Keep Node 20 compatibility while enabling the cache before the application graph is loaded.
5
+ // Enable the cache before the application graph is loaded.
6
6
  nodeModule.enableCompileCache?.();
7
7
 
8
8
  await import('../dist/qmind.js');
@@ -1,4 +1,4 @@
1
- import { Z as timestampSchema, a as invalidArgument, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch, u as optionalTrimmedString } from "./shared-DsqZroGJ.js";
1
+ import { Z as timestampSchema, a as invalidArgument, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch, u as optionalTrimmedString } from "./shared-53S5tNf6.js";
2
2
  import { z } from "zod";
3
3
  //#region ../sdk/src/operations/bot-gateway-codecs.ts
4
4
  const botTimestamp = z.preprocess((value) => typeof value === "object" && value !== null && !Array.isArray(value) && !("seconds" in value) ? {
@@ -1,4 +1,4 @@
1
- import { O as importProvidersSchema, T as fullSiteURLImportDiscoverySchema, _ as aliDingImportRunItemListSchema, a as invalidArgument, d as pagination, m as requiredString, n as call, nt as assertCapability, p as queryPath, tt as qmindFullSiteURLImportPageLimit, v as aliDingImportRunSchema, w as fullSiteURLImportConfirmationSchema } from "./shared-DsqZroGJ.js";
1
+ import { O as importProvidersSchema, T as fullSiteURLImportDiscoverySchema, _ as aliDingImportRunItemListSchema, a as invalidArgument, d as pagination, m as requiredString, n as call, nt as assertCapability, p as queryPath, tt as qmindFullSiteURLImportPageLimit, v as aliDingImportRunSchema, w as fullSiteURLImportConfirmationSchema } from "./shared-53S5tNf6.js";
2
2
  //#region ../sdk/src/operations/imports.ts
3
3
  const aliDingHost = "alidocs.dingtalk.com";
4
4
  const requestIdPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
@@ -1,4 +1,4 @@
1
- import { Q as voidResponseSchema, a as invalidArgument, c as optionalRecord, f as positiveInteger, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-DsqZroGJ.js";
1
+ import { Q as voidResponseSchema, a as invalidArgument, c as optionalRecord, f as positiveInteger, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-53S5tNf6.js";
2
2
  import { z } from "zod";
3
3
  //#region ../sdk/src/operations/management-schemas.ts
4
4
  const memberPermissionSchema = z.enum([
@@ -46,7 +46,7 @@ const scheduledTaskSceneSchema = z.enum([
46
46
  "source_refresh",
47
47
  "source_binding_sync"
48
48
  ]);
49
- const scheduledTaskSchema = z.object({
49
+ const scheduledTaskWireSchema = z.object({
50
50
  config: z.record(z.string(), z.unknown()).default({}),
51
51
  createdAt: z.string().default(""),
52
52
  enabled: z.boolean().default(true),
@@ -59,6 +59,16 @@ const scheduledTaskSchema = z.object({
59
59
  updatedAt: z.string().default(""),
60
60
  userId: z.string().default("")
61
61
  });
62
+ const scheduledTaskSchema = scheduledTaskWireSchema;
63
+ const confirmedScheduledTaskSchema = scheduledTaskWireSchema.extend({
64
+ config: z.record(z.string(), z.unknown()).nullish().transform((config) => config ?? {}),
65
+ notebookId: z.string().min(1),
66
+ schedule: z.string().min(1),
67
+ enabled: z.boolean()
68
+ });
69
+ const sashScheduledTaskDeletionSchema = z.union([z.object({}).strict(), z.undefined()]).transform(() => void 0);
70
+ const dashboardScheduledTaskDeletionSchema = z.union([z.object({ status: z.literal("ok") }).strict(), z.undefined()]).transform(() => void 0);
71
+ const sashScheduledTaskListSchema = z.object({ tasks: z.array(confirmedScheduledTaskSchema).nullable().transform((tasks) => tasks ?? []) });
62
72
  const scheduledTaskListSchema = z.object({ tasks: z.array(scheduledTaskSchema).nullish().transform((tasks) => tasks ?? []) });
63
73
  const compilationRunSchema = z.object({
64
74
  compiledSourceCount: z.number().int().nonnegative().default(0),
@@ -223,7 +233,7 @@ function createManagementOperations(context) {
223
233
  method: "POST",
224
234
  operation: "scheduledTasks.create",
225
235
  path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks"),
226
- schema: scheduledTaskSchema
236
+ schema: confirmedScheduledTaskSchema
227
237
  });
228
238
  },
229
239
  async deleteScheduledTask(notebookId, taskId, options) {
@@ -236,7 +246,7 @@ function createManagementOperations(context) {
236
246
  method: "DELETE",
237
247
  operation: "scheduledTasks.delete",
238
248
  path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks", task),
239
- schema: voidResponseSchema
249
+ schema: context.profile.access === "sash" ? sashScheduledTaskDeletionSchema : dashboardScheduledTaskDeletionSchema
240
250
  });
241
251
  },
242
252
  async getCompilationSettings(notebookId, options) {
@@ -284,7 +294,7 @@ function createManagementOperations(context) {
284
294
  method: "GET",
285
295
  operation: "scheduledTasks.list",
286
296
  path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks"),
287
- schema: scheduledTaskListSchema
297
+ schema: context.profile.access === "sash" ? sashScheduledTaskListSchema : scheduledTaskListSchema
288
298
  });
289
299
  },
290
300
  async removeMember(notebookId, memberId, options) {
@@ -367,7 +377,7 @@ function createManagementOperations(context) {
367
377
  method: "PUT",
368
378
  operation: "scheduledTasks.update",
369
379
  path: context.profile.apiPath("notebooks", notebook, "scheduled-tasks", task),
370
- schema: scheduledTaskSchema
380
+ schema: confirmedScheduledTaskSchema
371
381
  });
372
382
  }
373
383
  };
@@ -1,4 +1,4 @@
1
- import { Q as voidResponseSchema, Z as timestampSchema, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, t as assertNonEmptyPatch } from "./shared-DsqZroGJ.js";
1
+ import { Q as voidResponseSchema, Z as timestampSchema, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, t as assertNonEmptyPatch } from "./shared-53S5tNf6.js";
2
2
  import { z } from "zod";
3
3
  //#region ../sdk/src/operations/note-schemas.ts
4
4
  const noteSchema = z.object({
package/dist/qmind.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A as notebookSchema, B as sourceQuotaSchema, C as chatSessionSchema, D as imageUrlsSchema, E as imageUploadTicketSchema, F as sourceChildrenCountsSchema, H as sourceSchema, I as sourceContentSchema, J as streamWireEventSchema, K as sourceWebOfficeSessionSchema, L as sourceImportResultsSchema, M as retrieveResultSchema, N as sharedNotebookListSchema, P as sourceActionAccessSchema, Q as voidResponseSchema, R as sourceListSchema, S as chatSessionListSchema, U as sourceTreeSchema, V as sourceRawContentSchema, W as sourceUploadCapabilitiesSchema, X as taskRunSchema, Y as taskRunListSchema, a as invalidArgument$1, at as QMindError, b as cancelQuestionResultSchema, c as optionalRecord, d as pagination$1, f as positiveInteger$1, g as stringList, i as httpUrl, j as retrieveNotebooksResultSchema, k as notebookListSchema, l as optionalString$1, m as requiredString$2, n as call, nt as assertCapability, o as nonNegativeInteger$1, p as queryPath, q as sourceWebOfficeTokenSchema, r as compactUndefined, rt as executeStream, s as optionalBoolean, t as assertNonEmptyPatch, u as optionalTrimmedString, x as chatMessageListSchema, y as batchDeleteResultSchema, z as sourcePreviewSchema } from "./shared-DsqZroGJ.js";
2
- import { t as preflightSourceUpload } from "./source-upload-DdZ0J4gC.js";
1
+ import { A as notebookSchema, B as sourceQuotaSchema, C as chatSessionSchema, D as imageUrlsSchema, E as imageUploadTicketSchema, F as sourceChildrenCountsSchema, H as sourceSchema, I as sourceContentSchema, J as streamWireEventSchema, K as sourceWebOfficeSessionSchema, L as sourceImportResultsSchema, M as retrieveResultSchema, N as sharedNotebookListSchema, P as sourceActionAccessSchema, Q as voidResponseSchema, R as sourceListSchema, S as chatSessionListSchema, U as sourceTreeSchema, V as sourceRawContentSchema, W as sourceUploadCapabilitiesSchema, X as taskRunSchema, Y as taskRunListSchema, a as invalidArgument$1, at as QMindError, b as cancelQuestionResultSchema, c as optionalRecord, d as pagination$1, f as positiveInteger$1, g as stringList, i as httpUrl, j as retrieveNotebooksResultSchema, k as notebookListSchema, l as optionalString$1, m as requiredString$2, n as call, nt as assertCapability, o as nonNegativeInteger$1, p as queryPath, q as sourceWebOfficeTokenSchema, r as compactUndefined, rt as executeStream, s as optionalBoolean, t as assertNonEmptyPatch, u as optionalTrimmedString, x as chatMessageListSchema, y as batchDeleteResultSchema, z as sourcePreviewSchema } from "./shared-53S5tNf6.js";
2
+ import { t as preflightSourceUpload } from "./source-upload-DlOLtECT.js";
3
3
  import { createInterface } from "node:readline/promises";
4
4
  import { basename, dirname, extname, join, relative, resolve, sep } from "node:path";
5
5
  import { z } from "zod";
@@ -399,7 +399,7 @@ function createAgentOperations(context) {
399
399
  //#region ../sdk/src/operations/notebooks.ts
400
400
  function createNotebookOperations(context) {
401
401
  let wikiOperations;
402
- const loadWiki = () => wikiOperations ??= import("./wiki-branches-CNLpYYCl.js").then(({ createWikiBranchOperations }) => createWikiBranchOperations(context));
402
+ const loadWiki = () => wikiOperations ??= import("./wiki-branches-DmgHlIxc.js").then(({ createWikiBranchOperations }) => createWikiBranchOperations(context));
403
403
  return {
404
404
  async copyFeaturedNotebook(notebookId, options) {
405
405
  const notebook = requiredString$2(notebookId, "notebookId");
@@ -483,10 +483,12 @@ function createNotebookOperations(context) {
483
483
  },
484
484
  async listNotebooks(input = {}, options) {
485
485
  const normalizedPage = pagination$1(input);
486
+ const retrievalEligibleOnly = optionalBoolean(input.retrievalEligibleOnly, "retrievalEligibleOnly");
486
487
  const client = optionalTrimmedString(input.client, "client");
487
488
  if (client !== void 0 && !context.profile.capabilities["notebooks.filterByClient"]) assertCapability(context.profile, "notebooks.filterByClient", "notebooks.list");
488
489
  const normalized = {
489
490
  ...normalizedPage,
491
+ ...retrievalEligibleOnly === void 0 ? {} : { retrievalEligibleOnly },
490
492
  ...client === void 0 ? {} : { client }
491
493
  };
492
494
  return call(context, {
@@ -500,7 +502,11 @@ function createNotebookOperations(context) {
500
502
  });
501
503
  },
502
504
  async listSharedNotebooks(input = {}, options) {
503
- const normalized = pagination$1(input);
505
+ const retrievalEligibleOnly = optionalBoolean(input.retrievalEligibleOnly, "retrievalEligibleOnly");
506
+ const normalized = {
507
+ ...pagination$1(input),
508
+ ...retrievalEligibleOnly === void 0 ? {} : { retrievalEligibleOnly }
509
+ };
504
510
  return call(context, {
505
511
  callOptions: options,
506
512
  capability: "sharedNotebooks.read",
@@ -1392,7 +1398,7 @@ const sashCapabilities = Object.freeze({
1392
1398
  "notes.write": true,
1393
1399
  "notes.saveCondensation": false,
1394
1400
  retrieval: true,
1395
- scheduledTasks: false,
1401
+ scheduledTasks: true,
1396
1402
  "sharedNotebooks.read": true,
1397
1403
  "sources.children": true,
1398
1404
  "sources.childrenCount": false,
@@ -1401,7 +1407,7 @@ const sashCapabilities = Object.freeze({
1401
1407
  "sources.preview": true,
1402
1408
  "sources.rawContent": true,
1403
1409
  "sources.read": true,
1404
- "sources.quota": false,
1410
+ "sources.quota": true,
1405
1411
  "sources.search": false,
1406
1412
  "sources.tree": true,
1407
1413
  "sources.webOffice": true,
@@ -1565,11 +1571,16 @@ function createProfile(access, apiPrefix) {
1565
1571
  return appendQuery(`${apiPrefix}/notebooks`, [
1566
1572
  ["page", input.page],
1567
1573
  ["page_size", input.pageSize],
1568
- ["client", input.client]
1574
+ ["client", input.client],
1575
+ ["retrieval_eligible_only", input.retrievalEligibleOnly]
1569
1576
  ]);
1570
1577
  },
1571
1578
  listSharedNotebooksPath(input) {
1572
- return appendQuery(`${apiPrefix}/notebooks/shared`, [["page", input.page], ["page_size", input.pageSize]]);
1579
+ return appendQuery(`${apiPrefix}/notebooks/shared`, [
1580
+ ["page", input.page],
1581
+ ["page_size", input.pageSize],
1582
+ ["retrieval_eligible_only", input.retrievalEligibleOnly]
1583
+ ]);
1573
1584
  },
1574
1585
  mindPath(...segments) {
1575
1586
  return `/api/v1/mind/${segments.map((segment) => encodeId(segment)).join("/")}`;
@@ -1656,7 +1667,7 @@ const botGatewayOperationNames = [
1656
1667
  function createLazyTransferOperations(context) {
1657
1668
  let operations;
1658
1669
  const load = () => {
1659
- operations ??= import("./transfers-SJE97RLg.js").then(({ createTransferOperations }) => createTransferOperations(context));
1670
+ operations ??= import("./transfers-cf1MXHdB.js").then(({ createTransferOperations }) => createTransferOperations(context));
1660
1671
  return operations;
1661
1672
  };
1662
1673
  return {
@@ -1667,7 +1678,7 @@ function createLazyTransferOperations(context) {
1667
1678
  function createLazyBotGatewayOperations(context) {
1668
1679
  let operations;
1669
1680
  const load = () => {
1670
- operations ??= import("./bot-gateway-eajGWyYA.js").then(({ createBotGatewayOperations }) => createBotGatewayOperations(context));
1681
+ operations ??= import("./bot-gateway-B5cW3ErV.js").then(({ createBotGatewayOperations }) => createBotGatewayOperations(context));
1671
1682
  return operations;
1672
1683
  };
1673
1684
  return Object.fromEntries(botGatewayOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -1675,7 +1686,7 @@ function createLazyBotGatewayOperations(context) {
1675
1686
  function createLazyNoteOperations(context) {
1676
1687
  let operations;
1677
1688
  const load = () => {
1678
- operations ??= import("./notes-PwqGFJvk.js").then(({ createNoteOperations }) => createNoteOperations(context));
1689
+ operations ??= import("./notes-BRnv_Z10.js").then(({ createNoteOperations }) => createNoteOperations(context));
1679
1690
  return operations;
1680
1691
  };
1681
1692
  return Object.fromEntries(noteOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -1683,7 +1694,7 @@ function createLazyNoteOperations(context) {
1683
1694
  function createLazyImportOperations(context) {
1684
1695
  let operations;
1685
1696
  const load = () => {
1686
- operations ??= import("./imports-CebWSRju.js").then(({ createImportOperations }) => createImportOperations(context));
1697
+ operations ??= import("./imports-Cmd6ys9g.js").then(({ createImportOperations }) => createImportOperations(context));
1687
1698
  return operations;
1688
1699
  };
1689
1700
  return Object.fromEntries(importOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -1691,7 +1702,7 @@ function createLazyImportOperations(context) {
1691
1702
  function createLazyManagementOperations(context) {
1692
1703
  let operations;
1693
1704
  const load = () => {
1694
- operations ??= import("./management-Avpo7nTn.js").then(({ createManagementOperations }) => createManagementOperations(context));
1705
+ operations ??= import("./management-CgWDLle_.js").then(({ createManagementOperations }) => createManagementOperations(context));
1695
1706
  return operations;
1696
1707
  };
1697
1708
  return Object.fromEntries(managementOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -2626,15 +2637,22 @@ function createDispatchers(options) {
2626
2637
  const connect = tlsConnectOptions(options);
2627
2638
  const networkProxy = options.networkProxy === void 0 ? void 0 : parseQMindNodeNetworkProxy(options.networkProxy);
2628
2639
  if (networkProxy?.mode === "manual") {
2629
- const createAgent = () => new Agent({ factory(origin) {
2630
- const hostname = new URL(origin).hostname.replace(/\.$/, "");
2631
- return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "[::1]" || /^127\.\d+\.\d+\.\d+$/.test(hostname) ? new Pool(origin, { connect }) : new ProxyAgent({
2632
- uri: networkProxy.url,
2633
- requestTls: connect,
2634
- proxyTls: connect,
2635
- proxyTunnel: true
2636
- });
2637
- } });
2640
+ const createAgent = () => new Agent({
2641
+ allowH2: false,
2642
+ factory(origin) {
2643
+ const hostname = new URL(origin).hostname.replace(/\.$/, "");
2644
+ return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "[::1]" || /^127\.\d+\.\d+\.\d+$/.test(hostname) ? new Pool(origin, {
2645
+ allowH2: false,
2646
+ connect
2647
+ }) : new ProxyAgent({
2648
+ allowH2: false,
2649
+ uri: networkProxy.url,
2650
+ requestTls: connect,
2651
+ proxyTls: connect,
2652
+ proxyTunnel: true
2653
+ });
2654
+ }
2655
+ });
2638
2656
  return {
2639
2657
  host: createAgent(),
2640
2658
  signed: createAgent()
@@ -2642,15 +2660,27 @@ function createDispatchers(options) {
2642
2660
  }
2643
2661
  const environment = options.environment ?? process.env;
2644
2662
  if (networkProxy?.mode === "direct" || options.proxyFromEnvironment === false) return {
2645
- host: new Agent({ connect }),
2646
- signed: new Agent({ connect })
2663
+ host: new Agent({
2664
+ allowH2: false,
2665
+ connect
2666
+ }),
2667
+ signed: new Agent({
2668
+ allowH2: false,
2669
+ connect
2670
+ })
2647
2671
  };
2648
2672
  const httpProxy = environmentValue(environment, "HTTP_PROXY", "http_proxy");
2649
2673
  const httpsProxy = environmentValue(environment, "HTTPS_PROXY", "https_proxy");
2650
2674
  const noProxy = environmentValue(environment, "NO_PROXY", "no_proxy");
2651
2675
  if (httpProxy === void 0 && httpsProxy === void 0) return {
2652
- host: new Agent({ connect }),
2653
- signed: new Agent({ connect })
2676
+ host: new Agent({
2677
+ allowH2: false,
2678
+ connect
2679
+ }),
2680
+ signed: new Agent({
2681
+ allowH2: false,
2682
+ connect
2683
+ })
2654
2684
  };
2655
2685
  const proxy = {
2656
2686
  httpProxy: httpProxy ?? "",
@@ -2660,10 +2690,12 @@ function createDispatchers(options) {
2660
2690
  return {
2661
2691
  host: new EnvHttpProxyAgent({
2662
2692
  ...proxy,
2693
+ allowH2: false,
2663
2694
  requestTls: connect
2664
2695
  }),
2665
2696
  signed: new EnvHttpProxyAgent({
2666
2697
  ...proxy,
2698
+ allowH2: false,
2667
2699
  requestTls: connect
2668
2700
  })
2669
2701
  };
@@ -3296,8 +3328,8 @@ function requestsJsonOutput(argv) {
3296
3328
  //#region src/build-info.ts
3297
3329
  /** Bundled identity, never inferred from argv, environment, or an endpoint. */
3298
3330
  const QMIND_CLI_DISTRIBUTION = "global";
3299
- const QMIND_CLI_VERSION = "3.5.0";
3300
- const QMIND_CLI_BUILD_TIME = "2026-09-28T09:35:44.000Z";
3331
+ const QMIND_CLI_VERSION = "4.0.0";
3332
+ const QMIND_CLI_BUILD_TIME = "2026-10-19T13:00:47.000Z";
3301
3333
  function qmindCliPlatform() {
3302
3334
  return process.platform === "win32" ? "windows" : process.platform;
3303
3335
  }
@@ -3330,8 +3362,8 @@ const CLI_DISTRIBUTIONS = Object.freeze({
3330
3362
  gitTagSlug: "qmind-cli-cn",
3331
3363
  readmeDirectory: "readmes/cn",
3332
3364
  productNames: {
3333
- en: "Qoder China",
3334
- zhCN: "Qoder 中国版"
3365
+ en: "Qoder CN",
3366
+ zhCN: "Qoder CN"
3335
3367
  }
3336
3368
  }
3337
3369
  });
@@ -4990,7 +5022,7 @@ async function runQMindCli(argv, options = {}) {
4990
5022
  updater: options.updater ?? createQMindCliUpdater({ identity: {
4991
5023
  artifactKind: "npm",
4992
5024
  command: distribution.command,
4993
- currentVersion: "3.5.0",
5025
+ currentVersion: "4.0.0",
4994
5026
  distribution: distribution.id,
4995
5027
  executablePath: process.execPath,
4996
5028
  package: distribution.package,
@@ -423,12 +423,14 @@ const notebookSchema = z.object({
423
423
  userId: z.string().default("")
424
424
  });
425
425
  const notebookListSchema = z.object({
426
+ retrievalEligibleOnlyApplied: z.boolean().optional(),
426
427
  currentPage: wirePageNumberSchema,
427
428
  notebooks: z.array(notebookSchema).nullish().transform((notebooks) => notebooks ?? []),
428
429
  pageSize: wirePageNumberSchema,
429
430
  totalSize: z.number().int().nonnegative().default(0)
430
431
  });
431
432
  const sharedNotebookListSchema = z.object({
433
+ retrievalEligibleOnlyApplied: z.boolean().optional(),
432
434
  currentPage: wirePageNumberSchema,
433
435
  notebooks: z.array(z.object({
434
436
  notebook: notebookSchema,
@@ -1,4 +1,4 @@
1
- import { W as sourceUploadCapabilitiesSchema, m as requiredString, n as call } from "./shared-DsqZroGJ.js";
1
+ import { W as sourceUploadCapabilitiesSchema, m as requiredString, n as call } from "./shared-53S5tNf6.js";
2
2
  //#region ../sdk/src/operations/source-upload.ts
3
3
  /** Notebook-scoped edit preflight, not the deployment-level capabilities lookup. */
4
4
  async function preflightSourceUpload(context, notebookId, options) {
@@ -1,5 +1,5 @@
1
- import { $ as QMIND_MULTIPART_UPLOAD_MAX_BYTES, E as imageUploadTicketSchema, G as sourceUploadTicketSchema, H as sourceSchema, Q as voidResponseSchema, a as invalidArgument, at as QMindError, et as QMIND_SOURCE_UPLOAD_MAX_BYTES, it as executeUnary, l as optionalString, m as requiredString, p as queryPath, r as compactUndefined, u as optionalTrimmedString } from "./shared-DsqZroGJ.js";
2
- import { t as preflightSourceUpload } from "./source-upload-DdZ0J4gC.js";
1
+ import { $ as QMIND_MULTIPART_UPLOAD_MAX_BYTES, E as imageUploadTicketSchema, G as sourceUploadTicketSchema, H as sourceSchema, Q as voidResponseSchema, a as invalidArgument, at as QMindError, et as QMIND_SOURCE_UPLOAD_MAX_BYTES, it as executeUnary, l as optionalString, m as requiredString, p as queryPath, r as compactUndefined, u as optionalTrimmedString } from "./shared-53S5tNf6.js";
2
+ import { t as preflightSourceUpload } from "./source-upload-DlOLtECT.js";
3
3
  //#region ../sdk/src/operations/transfers.ts
4
4
  function isRecord(value) {
5
5
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -28,9 +28,12 @@ function transferOptions(options) {
28
28
  function uploadMetadata(value) {
29
29
  if (value === void 0) return {};
30
30
  if (!isRecord(value)) throw invalidArgument("metadata must be an object", "metadata");
31
+ const parentSourceId = optionalString(value.parentSourceId, "parentSourceId");
32
+ const path = optionalString(value.path, "path");
33
+ if (parentSourceId && !path?.trim()) throw invalidArgument("path is required when parentSourceId is set", "path");
31
34
  return {
32
- parentSourceId: optionalString(value.parentSourceId, "parentSourceId"),
33
- path: optionalString(value.path, "path"),
35
+ parentSourceId,
36
+ path,
34
37
  sha256: optionalTrimmedString(value.sha256, "sha256"),
35
38
  sourceType: optionalTrimmedString(value.sourceType, "sourceType"),
36
39
  title: optionalTrimmedString(value.title, "title")
@@ -1,4 +1,4 @@
1
- import { Z as timestampSchema, a as invalidArgument, d as pagination, m as requiredString, n as call, p as queryPath, u as optionalTrimmedString } from "./shared-DsqZroGJ.js";
1
+ import { Z as timestampSchema, a as invalidArgument, d as pagination, m as requiredString, n as call, p as queryPath, u as optionalTrimmedString } from "./shared-53S5tNf6.js";
2
2
  import { z } from "zod";
3
3
  //#region ../sdk/src/operations/wiki-branches.ts
4
4
  function isRecord(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoder-ai/qmind-cli",
3
- "version": "3.5.0",
3
+ "version": "4.0.0",
4
4
  "description": "QMind command line interface",
5
5
  "bin": {
6
6
  "qmind": "bin/cli.js"
@@ -16,31 +16,33 @@
16
16
  "README.zh-CN.md"
17
17
  ],
18
18
  "engines": {
19
- "node": ">=20.18.1"
19
+ "node": ">=22.19.0"
20
20
  },
21
21
  "publishConfig": {
22
22
  "access": "public",
23
23
  "registry": "https://registry.npmjs.org"
24
24
  },
25
25
  "dependencies": {
26
- "commander": "14.0.2",
27
- "entities": "6.0.1",
28
- "eventsource-parser": "3.1.1",
29
- "open": "11.0.0",
30
- "p-limit": "7.3.1",
31
- "picomatch": "4.0.5",
26
+ "commander": "15.0.0",
27
+ "entities": "8.1.0",
28
+ "eventsource-parser": "4.1.2",
29
+ "open": "11.0.4",
30
+ "p-limit": "7.3.3",
31
+ "picomatch": "4.0.7",
32
32
  "proper-lockfile": "4.1.2",
33
33
  "semver": "7.8.5",
34
- "undici": "7.29.0",
35
- "zod": "4.3.6"
34
+ "undici": "8.12.2",
35
+ "zod": "4.6.7"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "24.13.3",
39
39
  "@types/picomatch": "4.0.3",
40
40
  "@types/proper-lockfile": "4.1.4",
41
41
  "@types/semver": "7.8.0",
42
- "@ali/qmind-node-host": "^2.5.3",
43
- "@ali/qmind-sdk": "^0.29.0"
42
+ "@ali/qmind-node-host": "^3.0.0",
43
+ "@ali/qmind-sdk": "^0.33.1"
44
44
  },
45
- "license": "UNLICENSED"
45
+ "license": "UNLICENSED",
46
+ "readme": "# QMind CLI for Qoder Global\n\n[简体中文](./README.zh-CN.md)\n\nThe QMind command-line interface for Qoder Global lets you sign in, manage knowledge bases and sources, retrieve content, run RAG and task workflows, and synchronize local directories.\n\nPackage: `@qoder-ai/qmind-cli` · command: `qmind`\n\n## Install\n\nNode.js `>=22.19.0` is required.\n\n```sh\nnpm install --global @qoder-ai/qmind-cli\nqmind version\nqmind --help\n```\n\nUpgrade and uninstall through npm. `qmind self-update` only prints the npm upgrade command and never modifies npm-managed files.\n\n```sh\nnpm update --global @qoder-ai/qmind-cli\nnpm uninstall --global @qoder-ai/qmind-cli\n```\n\nThe Native standalone CLI uses the verified Global release channel instead. An installer-managed\nNative executable can check or apply the latest release without Node.js or npm:\n\n```sh\nqmind update --check\nqmind update\n```\n\n`self-update` remains an alias for `update`. The updater rejects channel/URL overrides, downgrades,\nunowned executables, release checksum mismatches, and modified installer bytes. Windows schedules\nreplacement after the running executable exits and records details beside the executable.\n\n## Quick start\n\n```sh\nqmind login\nqmind notebook list\nqmind source list --nb <notebook-id>\nqmind retrieve --nb <notebook-id> \"What must be checked before release?\"\n```\n\nInteractive login opens a browser and stores the session in a local file vault. For CI and agents, prefer an environment variable and structured output:\n\n```sh\nexport QMIND_TOKEN='<token>'\nqmind notebook list --non-interactive --format json\nqmind retrieve --nb <notebook-id> --format agent \"What is the deployment process?\"\n```\n\nDo not put tokens in command arguments, repositories, or logs. Run `qmind logout` to remove the current local session.\n\n## Commands\n\n| Command | Purpose |\n| ------------------------ | ---------------------------------------- |\n| `login` / `logout` | Sign in or remove local credentials |\n| `notebook` | Manage knowledge bases |\n| `source` | Manage knowledge-base sources |\n| `retrieve` | Retrieve context without invoking an LLM |\n| `rag` | Ask questions using a knowledge base |\n| `task` | Manage task runs |\n| `upload-folder` / `sync` | Synchronize a local directory |\n| `image` | Obtain image upload or access URLs |\n| `version` | Print version and build information |\n| `update` / `self-update` | Update an installer-managed Native CLI |\n\n`task create` does not start `compilation` or `lint` runs; `task list` and `task get` can still inspect historical runs for those scenes. `source import-site` does not provide an automatic compilation option.\n\nRun `qmind <command> --help` for complete options. Domain commands support formats such as `table`, `json`, `agent`, and `ndjson`. stdout contains results; progress and diagnostics go to stderr. Exit codes are `0` for success, `1` for runtime failure/partial success/cancellation, and `2` for invalid usage.\n\n## Multi-notebook retrieval\n\n`retrieve --nb` accepts comma-separated or repeated Notebook IDs, deduplicating up to 5 distinct notebooks:\n\n```sh\nqmind retrieve --nb nb-1,nb-2 \"What is the deployment process?\" --format json\nqmind retrieve --nb nb-1 --nb nb-2 \"What is the deployment process?\" --format agent\n```\n\n- Selection is explicit; the CLI never defaults to all accessible notebooks.\n- Multiple notebooks use one unified retrieval request. The server jointly retrieves and reranks Source chunks; output retains server ranking and each chunk/citation's `notebookId` and `notebookTitle`.\n- `--top-k` controls the joint recall candidate budget per route/query/channel; it is not multiplied by notebook count. `--max-results` limits the final results across all selected notebooks. Zero uses server defaults.\n- `--sources` requires a single notebook. A single deduplicated notebook keeps the existing retrieval endpoint. All retrieval output formats expose chunks and citations without knowledge cards.\n- Multi-notebook JSON returns `{ chunks, citations, promptContext, total, reranked }`. NDJSON emits one `kind: \"chunk\"` record per returned chunk, in server order; zero hits emit no records. Table and agent output also identify each evidence item's notebook.\n- Unified retrieval fails as one request when a target is invalid or inaccessible. The CLI reports the error without retrying notebooks individually or constructing partial-success results. Retrieval results no longer contain a `cards` field.\n\n## Directory synchronization\n\nReview the plan before allowing remote deletions:\n\n```sh\nqmind upload-folder --nb <notebook-id> --dir ./docs --mode if-changed --dry-run\n```\n\nRemoving `--dry-run` enables writes. `--delete` treats the remote source root as a mirror of the local directory and removes extra remote entries. Concurrency must be between `1` and `10`.\n\n## Configuration and authentication\n\nThis package has a fixed Qoder Global identity. Renaming the executable, changing its install path, or setting product-selection environment variables cannot switch products. Production is the default; `--env test` and `--env daily` select supported debug presets. A custom target requires both `--sash` and `--dashboard` and cannot be combined with an explicit `--env`.\n\n```sh\nqmind login --env test\nQMIND_DEBUG_TOKEN='<debug-token>' qmind notebook list --env test --non-interactive --format json\nqmind login --sash http://localhost:8080 --dashboard http://localhost:3000\n```\n\nProduction token priority is `--token > QMIND_TOKEN > current production vault`. Debug token priority is `--token > QMIND_DEBUG_TOKEN > current debug vault`; credentials are never borrowed across targets.\n\nState is stored under `<state-root>/cli/global/<target>/`, where the state root is `QMIND_HOME` or `~/.qmind`. The CLI does not install, load, or access the OS Keyring. Credential files are plaintext JSON, not encrypted storage. On POSIX, partition directories use mode `0700` and files use `0600`; these modes do not represent Windows ACLs. Writes use atomic replacement, file locking, and compare-and-swap protection for refreshes.\n\nAfter upgrading from the legacy unpartitioned store, sign in again. Root-level config/credential files, `~/.qmind-env`, and old Keyring entries are not read, imported, or deleted automatically.\n\nThe shared 3.x Global/CN release is a breaking upgrade from Global 2.x. Upgrade this package with npm, then run `qmind login`; do not copy legacy credentials into the new partition. Existing versions before the shared release describe the Global/shared implementation only and do not imply a historical CN publication.\n\nCommon variables include `QMIND_TOKEN`, `QMIND_DEBUG_TOKEN`, `QMIND_HOME`, `QMIND_CLIENT`, `QMIND_NON_INTERACTIVE`, `QMIND_REQUEST_TIMEOUT_MS`, `QMIND_STREAM_IDLE_TIMEOUT_MS`, and `QMIND_TLS_CA_FILE`. `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are supported. TLS verification is strict by default, and credentials are not forwarded to signed object-storage URLs.\n\n## Shared notebook discovery and access\n\n```sh\nqmind notebook list --shared --page 1 --page-size 20\nqmind notebook list --shared --format json\nqmind notebook get <notebook-id> --format json\n```\n\nBoth notebook collections support `--page` and `--page-size`. `--shared` cannot be combined with `--filter-client`. Shared results use the same flat `notebooks` output as the ordinary list and preserve the membership `permission`. JSON/NDJSON preserve server-provided `access` (current role, member count and action permissions); Agent output expands these fields. Table lists show role and member count, while details show action permissions. Missing permissions are not inferred and display as `unknown` in tables.\n",
47
+ "readmeFilename": "README.md"
46
48
  }