@qoder-ai/qmind-cli 3.2.0 → 3.3.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,18 @@ 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
+ ## 3.3.0
8
+
9
+ ### Minor Changes
10
+
11
+ - c024d97: Add `notebook list --shared` with pagination and preserve server-provided notebook permissions in CLI output.
12
+
13
+ ## 3.2.1
14
+
15
+ ### Patch Changes
16
+
17
+ - cb40928: Bundle the SDK fix for Source ID citations in streamed messages so qmind and qmind-cn finish RAG responses with references instead of failing with STREAM_ERROR.
18
+
7
19
  ## 3.2.0
8
20
 
9
21
  ### Minor Changes
@@ -4,6 +4,18 @@
4
4
 
5
5
  以下已发布版本属于 Global CLI / 共享实现,不代表 CN 曾发布过这些版本。CN 将在后续共同发行版加入同一历史。
6
6
 
7
+ ## 3.3.0
8
+
9
+ ### Minor Changes
10
+
11
+ - c024d97: 新增 `notebook list --shared` 及分页参数,并在 CLI 输出中保留服务端返回的知识库权限信息。
12
+
13
+ ## 3.2.1
14
+
15
+ ### Patch Changes
16
+
17
+ - cb40928: 打包 SDK 的流消息 Source ID 引用兼容修复,使 qmind 和 qmind-cn 能正常完成带引用的 RAG 回复,避免 STREAM_ERROR。
18
+
7
19
  ## 3.2.0
8
20
 
9
21
  ### Minor Changes
package/README.md CHANGED
@@ -102,3 +102,13 @@ After upgrading from the legacy unpartitioned store, sign in again. Root-level c
102
102
  The 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.
103
103
 
104
104
  Common 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.
105
+
106
+ ## Shared notebook discovery and access
107
+
108
+ ```sh
109
+ qmind notebook list --shared --page 1 --page-size 20
110
+ qmind notebook list --shared --format json
111
+ qmind notebook get <notebook-id> --format json
112
+ ```
113
+
114
+ Both 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.
package/README.zh-CN.md CHANGED
@@ -102,3 +102,13 @@ qmind login --sash http://localhost:8080 --dashboard http://localhost:3000
102
102
  共享 3.x Global/CN 发行版相对 Global 2.x 是 breaking upgrade。通过 npm 升级本包后执行 `qmind login`,不要把旧凭证复制到新分区。共同发行版之前的历史版本只描述 Global/共享实现,不代表 CN 曾经发布。
103
103
 
104
104
  常用变量包括 `QMIND_TOKEN`、`QMIND_DEBUG_TOKEN`、`QMIND_HOME`、`QMIND_CLIENT`、`QMIND_NON_INTERACTIVE`、`QMIND_REQUEST_TIMEOUT_MS`、`QMIND_STREAM_IDLE_TIMEOUT_MS` 和 `QMIND_TLS_CA_FILE`。支持 `HTTP_PROXY`、`HTTPS_PROXY` 和 `NO_PROXY`。TLS 默认严格校验,访问签名对象存储地址时不会转发凭证。
105
+
106
+ ## 共享知识库发现与权限
107
+
108
+ ```sh
109
+ qmind notebook list --shared --page 1 --page-size 20
110
+ qmind notebook list --shared --format json
111
+ qmind notebook get <notebook-id> --format json
112
+ ```
113
+
114
+ 普通列表和共享列表均支持 `--page`、`--page-size`;`--shared` 不可与 `--filter-client` 组合。共享列表使用与普通列表一致的扁平 `notebooks` 输出,并保留共享关系的 `permission`。JSON/NDJSON 保留服务端返回的 `access`(当前角色、成员数及各操作权限);Agent 输出展开这些字段,表格列表显示角色与成员数,详情显示操作权限。缺失的权限不进行推断,表格显示 `unknown`。
@@ -1,4 +1,4 @@
1
- import { Y 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-OBSNlxAo.js";
1
+ import { Y 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-BFU7amCH.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 { S as cardSchema, a as invalidArgument, c as optionalRecord, d as pagination, g as stringList, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, u as optionalTrimmedString, x as cardListSchema, y as batchMutationResultSchema } from "./shared-OBSNlxAo.js";
1
+ import { S as cardSchema, a as invalidArgument, c as optionalRecord, d as pagination, g as stringList, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, u as optionalTrimmedString, x as cardListSchema, y as batchMutationResultSchema } from "./shared-BFU7amCH.js";
2
2
  import { z } from "zod";
3
3
  //#region ../sdk/src/operations/compilation-results.ts
4
4
  function linksBody(value, field) {
@@ -1,4 +1,4 @@
1
- import { O as importProvidersSchema, _ as aliDingImportRunItemListSchema, a as invalidArgument, d as pagination, et as assertCapability, m as requiredString, n as call, p as queryPath, v as aliDingImportRunSchema } from "./shared-OBSNlxAo.js";
1
+ import { O as importProvidersSchema, _ as aliDingImportRunItemListSchema, a as invalidArgument, d as pagination, et as assertCapability, m as requiredString, n as call, p as queryPath, v as aliDingImportRunSchema } from "./shared-BFU7amCH.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 { X as voidResponseSchema, a as invalidArgument, c as optionalRecord, l as optionalString, m as requiredString, n as call, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-OBSNlxAo.js";
1
+ import { X as voidResponseSchema, a as invalidArgument, c as optionalRecord, l as optionalString, m as requiredString, n as call, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-BFU7amCH.js";
2
2
  import { z } from "zod";
3
3
  //#region ../sdk/src/operations/management-schemas.ts
4
4
  const memberPermissionSchema = z.enum([
@@ -1,4 +1,4 @@
1
- import { X as voidResponseSchema, Y 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-OBSNlxAo.js";
1
+ import { X as voidResponseSchema, Y 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-BFU7amCH.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 sourceSchema, C as chatMessageListSchema, D as imageUrlsSchema, E as imageUploadTicketSchema, F as sourceContentSchema, G as sourceWebOfficeTokenSchema, H as sourceUploadCapabilitiesSchema, I as sourceImportResultsSchema, J as taskRunSchema, K as streamWireEventSchema, L as sourceListSchema, M as sharedNotebookListSchema, N as sourceActionAccessSchema, P as sourceChildrenCountsSchema, R as sourcePreviewSchema, T as chatSessionSchema, V as sourceTreeSchema, W as sourceWebOfficeSessionSchema, X as voidResponseSchema, Z as wikiBranchListSchema, a as invalidArgument$1, b as cancelQuestionResultSchema, c as optionalRecord, d as pagination$1, et as assertCapability, f as positiveInteger$1, g as stringList, i as httpUrl, j as retrieveResultSchema, k as notebookListSchema, l as optionalString$1, m as requiredString$2, n as call, o as nonNegativeInteger$1, p as queryPath, q as taskRunListSchema, r as compactUndefined, rt as QMindError, s as optionalBoolean, t as assertNonEmptyPatch, tt as executeStream, u as optionalTrimmedString, w as chatSessionListSchema, y as batchMutationResultSchema, z as sourceRawContentSchema } from "./shared-OBSNlxAo.js";
2
- import { t as preflightSourceUpload } from "./source-upload-B0EAhkG2.js";
1
+ import { A as notebookSchema, B as sourceSchema, C as chatMessageListSchema, D as imageUrlsSchema, E as imageUploadTicketSchema, F as sourceContentSchema, G as sourceWebOfficeTokenSchema, H as sourceUploadCapabilitiesSchema, I as sourceImportResultsSchema, J as taskRunSchema, K as streamWireEventSchema, L as sourceListSchema, M as sharedNotebookListSchema, N as sourceActionAccessSchema, P as sourceChildrenCountsSchema, R as sourcePreviewSchema, T as chatSessionSchema, V as sourceTreeSchema, W as sourceWebOfficeSessionSchema, X as voidResponseSchema, Z as wikiBranchListSchema, a as invalidArgument$1, b as cancelQuestionResultSchema, c as optionalRecord, d as pagination$1, et as assertCapability, f as positiveInteger$1, g as stringList, i as httpUrl, j as retrieveResultSchema, k as notebookListSchema, l as optionalString$1, m as requiredString$2, n as call, o as nonNegativeInteger$1, p as queryPath, q as taskRunListSchema, r as compactUndefined, rt as QMindError, s as optionalBoolean, t as assertNonEmptyPatch, tt as executeStream, u as optionalTrimmedString, w as chatSessionListSchema, y as batchMutationResultSchema, z as sourceRawContentSchema } from "./shared-BFU7amCH.js";
2
+ import { t as preflightSourceUpload } from "./source-upload-D3rcA1v1.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";
@@ -1274,7 +1274,7 @@ const sashCapabilities = Object.freeze({
1274
1274
  "notes.saveCondensation": false,
1275
1275
  retrieval: true,
1276
1276
  scheduledTasks: false,
1277
- "sharedNotebooks.read": false,
1277
+ "sharedNotebooks.read": true,
1278
1278
  "sources.children": true,
1279
1279
  "sources.childrenCount": false,
1280
1280
  "sources.actionAccess": true,
@@ -1552,7 +1552,7 @@ const botGatewayOperationNames = [
1552
1552
  function createLazyTransferOperations(context) {
1553
1553
  let operations;
1554
1554
  const load = () => {
1555
- operations ??= import("./transfers-BB__MPG8.js").then(({ createTransferOperations }) => createTransferOperations(context));
1555
+ operations ??= import("./transfers-CzWL9766.js").then(({ createTransferOperations }) => createTransferOperations(context));
1556
1556
  return operations;
1557
1557
  };
1558
1558
  return {
@@ -1563,7 +1563,7 @@ function createLazyTransferOperations(context) {
1563
1563
  function createLazyBotGatewayOperations(context) {
1564
1564
  let operations;
1565
1565
  const load = () => {
1566
- operations ??= import("./bot-gateway-C3AvO7gR.js").then(({ createBotGatewayOperations }) => createBotGatewayOperations(context));
1566
+ operations ??= import("./bot-gateway-C0KmAiBy.js").then(({ createBotGatewayOperations }) => createBotGatewayOperations(context));
1567
1567
  return operations;
1568
1568
  };
1569
1569
  return Object.fromEntries(botGatewayOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -1571,7 +1571,7 @@ function createLazyBotGatewayOperations(context) {
1571
1571
  function createLazyNoteOperations(context) {
1572
1572
  let operations;
1573
1573
  const load = () => {
1574
- operations ??= import("./notes-BWrCOixr.js").then(({ createNoteOperations }) => createNoteOperations(context));
1574
+ operations ??= import("./notes-B9mcsP2n.js").then(({ createNoteOperations }) => createNoteOperations(context));
1575
1575
  return operations;
1576
1576
  };
1577
1577
  return Object.fromEntries(noteOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -1579,7 +1579,7 @@ function createLazyNoteOperations(context) {
1579
1579
  function createLazyCardOperations(context) {
1580
1580
  let operations;
1581
1581
  const load = () => {
1582
- operations ??= import("./cards-D3WYzf7s.js").then(({ createCardOperations }) => createCardOperations(context));
1582
+ operations ??= import("./cards-YqfPPr12.js").then(({ createCardOperations }) => createCardOperations(context));
1583
1583
  return operations;
1584
1584
  };
1585
1585
  return Object.fromEntries(cardOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -1587,7 +1587,7 @@ function createLazyCardOperations(context) {
1587
1587
  function createLazyImportOperations(context) {
1588
1588
  let operations;
1589
1589
  const load = () => {
1590
- operations ??= import("./imports-D6n1sOFM.js").then(({ createImportOperations }) => createImportOperations(context));
1590
+ operations ??= import("./imports-CkLS3Vqu.js").then(({ createImportOperations }) => createImportOperations(context));
1591
1591
  return operations;
1592
1592
  };
1593
1593
  return Object.fromEntries(importOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -1595,7 +1595,7 @@ function createLazyImportOperations(context) {
1595
1595
  function createLazyManagementOperations(context) {
1596
1596
  let operations;
1597
1597
  const load = () => {
1598
- operations ??= import("./management-uK44XohU.js").then(({ createManagementOperations }) => createManagementOperations(context));
1598
+ operations ??= import("./management-BqqR6Ihj.js").then(({ createManagementOperations }) => createManagementOperations(context));
1599
1599
  return operations;
1600
1600
  };
1601
1601
  return Object.fromEntries(managementOperationNames.map((name) => [name, (...args) => load().then((loaded) => Reflect.apply(loaded[name], loaded, args))]));
@@ -2393,6 +2393,26 @@ async function atomicQMindWrite(path, content, overwrite = false) {
2393
2393
  }
2394
2394
  }
2395
2395
  //#endregion
2396
+ //#region ../node-host/src/request-budget.ts
2397
+ function createRequestBudgetTransport(transport, budget) {
2398
+ const withinBudget = (request) => {
2399
+ const current = budget();
2400
+ if (!current) return request;
2401
+ const remaining = Math.ceil(current.deadlineAt - Date.now());
2402
+ if (remaining <= 0) throw new QMindError("TIMEOUT", "Request deadline exceeded.");
2403
+ if (current.signal.aborted) throw new QMindError("ABORTED", "QMind request was aborted");
2404
+ return {
2405
+ ...request,
2406
+ timeoutMs: Math.min(request.timeoutMs ?? remaining, remaining),
2407
+ signal: request.signal ? AbortSignal.any([request.signal, current.signal]) : current.signal
2408
+ };
2409
+ };
2410
+ return {
2411
+ request: async (request) => await transport.request(withinBudget(request)),
2412
+ stream: async (request) => await transport.stream(withinBudget(request))
2413
+ };
2414
+ }
2415
+ //#endregion
2396
2416
  //#region ../node-host/src/node-transport.ts
2397
2417
  const RETRYABLE_STATUS = /* @__PURE__ */ new Set([
2398
2418
  408,
@@ -2409,6 +2429,7 @@ const CREDENTIAL_HEADERS = /* @__PURE__ */ new Set([
2409
2429
  "x-csrf-token",
2410
2430
  "x-xsrf-token"
2411
2431
  ]);
2432
+ const DOWNLOAD_ERROR_MAX_BYTES = 65536;
2412
2433
  const SSE_MAX_BUFFER_SIZE = 8388608;
2413
2434
  function invalidArgument(message, field) {
2414
2435
  return new QMindError("INVALID_ARGUMENT", message, { details: { field } });
@@ -2499,8 +2520,26 @@ function parseRawBody(rawBody) {
2499
2520
  return rawBody;
2500
2521
  }
2501
2522
  }
2502
- async function wireResponse(response) {
2503
- const rawBody = await response.body.text();
2523
+ async function wireResponse(response, maxBytes) {
2524
+ let rawBody;
2525
+ if (maxBytes === void 0) rawBody = await response.body.text();
2526
+ else {
2527
+ const chunks = [];
2528
+ let bytes = 0;
2529
+ try {
2530
+ if (Number(response.headers["content-length"]) > maxBytes) throw new QMindError("FILE_TOO_LARGE", "Response exceeds read limit");
2531
+ for await (const chunk of response.body) {
2532
+ const value = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
2533
+ bytes += value.byteLength;
2534
+ if (bytes > maxBytes) throw new QMindError("FILE_TOO_LARGE", "Response exceeds read limit");
2535
+ chunks.push(value);
2536
+ }
2537
+ rawBody = Buffer.concat(chunks, bytes).toString("utf8");
2538
+ } finally {
2539
+ response.body.on("error", () => {});
2540
+ response.body.destroy();
2541
+ }
2542
+ }
2504
2543
  return {
2505
2544
  body: parseRawBody(rawBody),
2506
2545
  headers: headersToRecord(response.headers),
@@ -2509,6 +2548,7 @@ async function wireResponse(response) {
2509
2548
  };
2510
2549
  }
2511
2550
  function assertWireRequest(request) {
2551
+ if (request.maxResponseBytes !== void 0) positiveInteger(request.maxResponseBytes, request.maxResponseBytes, "maxResponseBytes");
2512
2552
  if (request.timeoutMs !== void 0) positiveInteger(request.timeoutMs, request.timeoutMs, "timeoutMs");
2513
2553
  if (request.destination.kind === "host") {
2514
2554
  if (!request.destination.path.startsWith("/") || request.destination.path.startsWith("//")) throw new QMindError("HOST_POLICY_ERROR", "host destination must be root-relative");
@@ -2751,7 +2791,7 @@ function createQMindNodeTransport(options) {
2751
2791
  ...download.signal === void 0 ? {} : { signal: download.signal }
2752
2792
  });
2753
2793
  if (response.statusCode < 200 || response.statusCode >= 300) {
2754
- const decoded = await wireResponse(response);
2794
+ const decoded = await wireResponse(response, DOWNLOAD_ERROR_MAX_BYTES);
2755
2795
  throw new QMindError("REMOTE_ERROR", "download request failed", {
2756
2796
  ...decoded.rawBody === void 0 ? {} : { rawBody: decoded.rawBody },
2757
2797
  status: decoded.status
@@ -2794,12 +2834,17 @@ function createQMindNodeTransport(options) {
2794
2834
  signal: deadline.signal
2795
2835
  });
2796
2836
  if (attempt + 1 < attempts && RETRYABLE_STATUS.has(response.statusCode)) {
2797
- await response.body.dump();
2837
+ if (request$2.maxResponseBytes === void 0) await response.body.dump();
2838
+ else {
2839
+ response.body.on("error", () => {});
2840
+ response.body.destroy();
2841
+ }
2798
2842
  await abortableSleep(250 * 2 ** attempt, deadline.signal);
2799
2843
  continue;
2800
2844
  }
2801
- return await wireResponse(response);
2845
+ return await wireResponse(response, request$2.maxResponseBytes);
2802
2846
  } catch (cause) {
2847
+ if (cause instanceof QMindError && cause.code === "FILE_TOO_LARGE") throw cause;
2803
2848
  lastFailure = cause;
2804
2849
  if (attempt + 1 >= attempts || request$2.signal?.aborted === true || deadline.timedOut) break;
2805
2850
  try {
@@ -2844,7 +2889,7 @@ function createQMindNodeTransport(options) {
2844
2889
  const headers = headersToRecord(response.headers);
2845
2890
  if (response.statusCode < 200 || response.statusCode >= 300 || !headers["content-type"]?.toLowerCase().includes("text/event-stream")) try {
2846
2891
  return {
2847
- ...await wireResponse(response),
2892
+ ...await wireResponse(response, request$3.maxResponseBytes),
2848
2893
  kind: "response"
2849
2894
  };
2850
2895
  } finally {
@@ -2972,7 +3017,8 @@ async function createQMindCliHost(options = {}) {
2972
3017
  }
2973
3018
  };
2974
3019
  const ownedTransport = options.adapters?.transport === void 0 ? createQMindNodeTransport(nodeOptions) : void 0;
2975
- const rawTransport = options.adapters?.transport ?? ownedTransport;
3020
+ const baseTransport = options.adapters?.transport ?? ownedTransport;
3021
+ const rawTransport = baseTransport && options.adapters?.requestBudget ? createRequestBudgetTransport(baseTransport, options.adapters.requestBudget) : baseTransport;
2976
3022
  if (rawTransport === void 0) throw new QMindError("HOST_POLICY_ERROR", "unable to initialize the QMind transport");
2977
3023
  const auth = createQMindCliAuthManager({
2978
3024
  browser: options.adapters?.browser ?? defaultBrowser(),
@@ -3058,8 +3104,8 @@ function requestsJsonOutput(argv) {
3058
3104
  //#region src/build-info.ts
3059
3105
  /** Bundled identity, never inferred from argv, environment, or an endpoint. */
3060
3106
  const QMIND_CLI_DISTRIBUTION = "global";
3061
- const QMIND_CLI_VERSION = "3.2.0";
3062
- const QMIND_CLI_BUILD_TIME = "2026-09-07T06:53:56.000Z";
3107
+ const QMIND_CLI_VERSION = "3.3.0";
3108
+ const QMIND_CLI_BUILD_TIME = "2026-09-08T13:16:12.000Z";
3063
3109
  function qmindCliPlatform() {
3064
3110
  return process.platform === "win32" ? "windows" : process.platform;
3065
3111
  }
@@ -3518,6 +3564,8 @@ function goNotebook(value) {
3518
3564
  const settings = optionalMap(source.settings);
3519
3565
  return {
3520
3566
  id: stringValue(source.id),
3567
+ ...value.access === void 0 ? {} : { access: value.access },
3568
+ ...value.permission === void 0 ? {} : { permission: value.permission },
3521
3569
  orgId: stringValue(source.orgId),
3522
3570
  userId: stringValue(source.userId),
3523
3571
  title: stringValue(source.title),
@@ -3645,6 +3693,8 @@ function renderAgentNotebook(writer, value, index = 0) {
3645
3693
  agentField(writer, "id", value.id);
3646
3694
  agentField(writer, "orgId", value.orgId);
3647
3695
  agentField(writer, "userId", value.userId);
3696
+ agentField(writer, "permission", value.permission);
3697
+ if (value.access != null) for (const [key, field] of Object.entries(value.access)) agentField(writer, key, field);
3648
3698
  agentField(writer, "status", value.status);
3649
3699
  agentField(writer, "title", value.title);
3650
3700
  agentField(writer, "createdAt", timestamp(value.createdAt));
@@ -3679,6 +3729,8 @@ function renderNotebook(value, format) {
3679
3729
  else {
3680
3730
  writer.line(`ID: ${value.id}`);
3681
3731
  writer.line(`Title: ${value.title}`);
3732
+ writer.line(`Permission: ${value.access?.currentUserPermission ?? value.permission ?? "unknown"}`);
3733
+ if (value.access != null) for (const [key, field] of Object.entries(value.access)) writer.line(`${key}: ${field}`);
3682
3734
  writer.line(`Status: ${value.status}`);
3683
3735
  writer.line(`OrgID: ${value.orgId}`);
3684
3736
  writer.line(`UserID: ${value.userId}`);
@@ -3704,20 +3756,26 @@ function renderNotebookList(value, format) {
3704
3756
  "STATUS",
3705
3757
  "TITLE",
3706
3758
  "USER",
3759
+ "PERMISSION",
3760
+ "MEMBERS",
3707
3761
  "UPDATED"
3708
3762
  ], value.notebooks.map((item) => [
3709
3763
  truncate(item.id, 36),
3710
3764
  truncate(item.status, 10),
3711
3765
  truncate(item.title, 28),
3712
3766
  truncate(item.userId, 18),
3767
+ item.access?.currentUserPermission ?? item.permission ?? "unknown",
3768
+ item.access?.memberCount ?? "-",
3713
3769
  timestamp(item.updatedAt)
3714
3770
  ]), [
3715
3771
  36,
3716
3772
  10,
3717
3773
  28,
3718
3774
  18,
3775
+ 12,
3776
+ 7,
3719
3777
  20
3720
- ], 120);
3778
+ ], 143);
3721
3779
  }
3722
3780
  return writer.toString();
3723
3781
  }
@@ -3897,6 +3955,13 @@ function renderQMindCliPresentation(presentation, format) {
3897
3955
  switch (presentation.kind) {
3898
3956
  case "notebook": return renderNotebook(presentation.value, format);
3899
3957
  case "notebookList": return renderNotebookList(presentation.value, format);
3958
+ case "sharedNotebookList": return renderNotebookList({
3959
+ ...presentation.value,
3960
+ notebooks: presentation.value.notebooks.map(({ notebook, permission }) => ({
3961
+ ...notebook,
3962
+ ...permission === void 0 ? {} : { permission }
3963
+ }))
3964
+ }, format);
3900
3965
  case "source": return renderSource(presentation.value, format);
3901
3966
  case "sourceList": return renderSourceList(presentation.value, format);
3902
3967
  case "retrieve": return renderRetrieve(presentation.value, format);
@@ -4401,12 +4466,23 @@ function registerCoreCommands(context, program) {
4401
4466
  })
4402
4467
  });
4403
4468
  });
4404
- withCommon(notebook.command("list").description("List notebooks")).option("--filter-client <name>", "filter by originating client", "").action(async (raw) => {
4469
+ withCommon(notebook.command("list").description("List notebooks")).option("--filter-client <name>", "filter by originating client", "").addOption(new Option("--shared", "list notebooks shared with you").conflicts("filterClient")).option("--page <number>", "page number", integer).option("--page-size <number>", "items per page", integer).action(async (raw) => {
4405
4470
  const host = await hostFor(context, raw);
4406
4471
  const client = optionalString(raw, "filterClient");
4407
- render(context, raw, {
4472
+ const pagination = {
4473
+ ...raw.page === void 0 ? {} : { page: Number(raw.page) },
4474
+ ...raw.pageSize === void 0 ? {} : { pageSize: Number(raw.pageSize) }
4475
+ };
4476
+ if (raw.shared === true) render(context, raw, {
4477
+ kind: "sharedNotebookList",
4478
+ value: await host.client.listSharedNotebooks(pagination)
4479
+ });
4480
+ else render(context, raw, {
4408
4481
  kind: "notebookList",
4409
- value: await host.client.listNotebooks(client === void 0 ? {} : { client })
4482
+ value: await host.client.listNotebooks({
4483
+ ...pagination,
4484
+ ...client === void 0 ? {} : { client }
4485
+ })
4410
4486
  });
4411
4487
  });
4412
4488
  withCommon(notebook.command("get <notebook_id>").description("Get a notebook")).action(async (notebookId, raw) => {
@@ -4736,7 +4812,7 @@ async function runQMindCli(argv, options = {}) {
4736
4812
  updater: options.updater ?? createQMindCliUpdater({ identity: {
4737
4813
  artifactKind: "npm",
4738
4814
  command: distribution.command,
4739
- currentVersion: "3.2.0",
4815
+ currentVersion: "3.3.0",
4740
4816
  distribution: distribution.id,
4741
4817
  executablePath: process.execPath,
4742
4818
  package: distribution.package,
@@ -903,8 +903,12 @@ const chatMessageSchema = z.object({
903
903
  updatedAt: timestampSchema.optional(),
904
904
  userId: z.string().optional()
905
905
  });
906
+ const streamChatMessageSchema = z.preprocess((value) => isRecord(value) && Array.isArray(value.citations) ? {
907
+ ...value,
908
+ citations: value.citations.map((citation) => typeof citation === "string" ? { sourceId: citation } : citation)
909
+ } : value, chatMessageSchema);
906
910
  const streamWireEventSchema = z.object({
907
- assistantMessage: chatMessageSchema.optional(),
911
+ assistantMessage: streamChatMessageSchema.optional(),
908
912
  assistantMessageId: z.string().optional(),
909
913
  cancelReason: z.string().optional(),
910
914
  canceled: z.boolean().optional(),
@@ -924,7 +928,7 @@ const streamWireEventSchema = z.object({
924
928
  toolResult: z.string().optional(),
925
929
  totalContextChunks: z.number().int().nonnegative().optional(),
926
930
  type: z.string().optional(),
927
- userMessage: chatMessageSchema.optional()
931
+ userMessage: streamChatMessageSchema.optional()
928
932
  });
929
933
  const sourceUploadTicketSchema = z.object({
930
934
  expiresAt: z.string().optional(),
@@ -1129,6 +1133,8 @@ function queryPath(path, entries) {
1129
1133
  function wireRequest(options) {
1130
1134
  const timeoutMs = options.callOptions?.timeoutMs;
1131
1135
  if (timeoutMs !== void 0 && (!Number.isFinite(timeoutMs) || timeoutMs <= 0)) throw invalidArgument("timeoutMs must be a positive finite number", "timeoutMs");
1136
+ const maxResponseBytes = options.callOptions?.maxResponseBytes;
1137
+ if (maxResponseBytes !== void 0 && (!Number.isSafeInteger(maxResponseBytes) || maxResponseBytes <= 0)) throw invalidArgument("maxResponseBytes must be a positive integer", "maxResponseBytes");
1132
1138
  const authorization = options.callOptions?.authorization?.trim();
1133
1139
  return {
1134
1140
  ...options.body === void 0 ? {} : { body: {
@@ -1143,7 +1149,8 @@ function wireRequest(options) {
1143
1149
  idempotent: options.idempotent,
1144
1150
  method: options.method,
1145
1151
  ...options.callOptions?.signal === void 0 ? {} : { signal: options.callOptions.signal },
1146
- ...timeoutMs === void 0 ? {} : { timeoutMs }
1152
+ ...timeoutMs === void 0 ? {} : { timeoutMs },
1153
+ ...maxResponseBytes === void 0 ? {} : { maxResponseBytes }
1147
1154
  };
1148
1155
  }
1149
1156
  function call(context, options) {
@@ -1,4 +1,4 @@
1
- import { H as sourceUploadCapabilitiesSchema, m as requiredString, n as call } from "./shared-OBSNlxAo.js";
1
+ import { H as sourceUploadCapabilitiesSchema, m as requiredString, n as call } from "./shared-BFU7amCH.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_SOURCE_UPLOAD_MAX_BYTES, B as sourceSchema, E as imageUploadTicketSchema, Q as QMIND_MULTIPART_UPLOAD_MAX_BYTES, U as sourceUploadTicketSchema, X as voidResponseSchema, a as invalidArgument, l as optionalString, m as requiredString, nt as executeUnary, p as queryPath, r as compactUndefined, rt as QMindError, u as optionalTrimmedString } from "./shared-OBSNlxAo.js";
2
- import { t as preflightSourceUpload } from "./source-upload-B0EAhkG2.js";
1
+ import { $ as QMIND_SOURCE_UPLOAD_MAX_BYTES, B as sourceSchema, E as imageUploadTicketSchema, Q as QMIND_MULTIPART_UPLOAD_MAX_BYTES, U as sourceUploadTicketSchema, X as voidResponseSchema, a as invalidArgument, l as optionalString, m as requiredString, nt as executeUnary, p as queryPath, r as compactUndefined, rt as QMindError, u as optionalTrimmedString } from "./shared-BFU7amCH.js";
2
+ import { t as preflightSourceUpload } from "./source-upload-D3rcA1v1.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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoder-ai/qmind-cli",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "QMind command line interface",
5
5
  "bin": {
6
6
  "qmind": "bin/cli.js"
@@ -39,8 +39,8 @@
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.2.40",
43
- "@ali/qmind-sdk": "^0.17.0"
42
+ "@ali/qmind-node-host": "^2.3.4",
43
+ "@ali/qmind-sdk": "^0.19.0"
44
44
  },
45
45
  "license": "UNLICENSED"
46
46
  }