@dinoxx/dinox-cli 2.20.2 → 3.1.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.
Files changed (62) hide show
  1. package/README.md +17 -16
  2. package/dist/chunks/{applePodcast-V4FSJOC5.js → applePodcast-YDYM4JYQ.js} +3 -3
  3. package/dist/chunks/{bbc-NTMRPYRF.js → bbc-N3BM2EGG.js} +3 -3
  4. package/dist/chunks/{bilibili-UA3MBSPH.js → bilibili-V4XVW33T.js} +63 -9
  5. package/dist/chunks/{bohaishibei-B7UVXH4Y.js → bohaishibei-IQO5CZTN.js} +3 -3
  6. package/dist/chunks/{chunk-BZQYECIH.js → chunk-52XLDO77.js} +1 -1
  7. package/dist/chunks/{chunk-XEPDFQYD.js → chunk-5SORBZTD.js} +27 -27
  8. package/dist/chunks/{chunk-XMMTGPZ6.js → chunk-AZ43P73A.js} +56 -2
  9. package/dist/chunks/{chunk-W4EWLODY.js → chunk-DKY574LO.js} +3 -3
  10. package/dist/chunks/{chunk-4GM3PRSK.js → chunk-G6Y3MOUL.js} +6167 -3846
  11. package/dist/chunks/{chunk-BKCNERPB.js → chunk-JNRA4TTH.js} +99 -18
  12. package/dist/chunks/{chunk-3VZNZWDG.js → chunk-LAWV5XGL.js} +5 -0
  13. package/dist/chunks/{chunk-FIQYJ6KZ.js → chunk-LLAXR5EG.js} +1 -1
  14. package/dist/chunks/{chunk-MLOITAK6.js → chunk-LXC3IW4L.js} +2 -2
  15. package/dist/chunks/{chunk-TILRKKRN.js → chunk-MKEL2KNU.js} +893 -468
  16. package/dist/chunks/{chunk-7MGDG5BW.js → chunk-MMO7CINX.js} +499 -651
  17. package/dist/chunks/{chunk-FGQRYB7F.js → chunk-MZMOE3RX.js} +13 -1
  18. package/dist/chunks/{chunk-D3CETVY5.js → chunk-OZXS77HJ.js} +7 -7
  19. package/dist/chunks/{chunk-MDWXLRRN.js → chunk-PCB2JD6H.js} +6 -6
  20. package/dist/chunks/{chunk-6AZT4ARG.js → chunk-R2CGNGOT.js} +3 -3
  21. package/dist/chunks/{chunk-GTDX2LIJ.js → chunk-RSSEVU2F.js} +58 -10
  22. package/dist/chunks/{chunk-6D3QLMRM.js → chunk-TOGYWN3D.js} +1 -1
  23. package/dist/chunks/{chunk-CHGKDZV6.js → chunk-WCY3EKJQ.js} +4 -4
  24. package/dist/chunks/{chunk-QFSMFANX.js → chunk-YFGDTC2F.js} +9 -2
  25. package/dist/chunks/{chunk-QFUD3I7W.js → chunk-YX4SIEVS.js} +3 -4
  26. package/dist/chunks/{cookies-6QQHSM26.js → cookies-UUQZXH4R.js} +4 -6
  27. package/dist/chunks/{doubanGroup-HR4K2KMY.js → doubanGroup-MADXDGDI.js} +4 -4
  28. package/dist/chunks/{doubao-MXUHPLUB.js → doubao-DKZERP6Y.js} +2 -2
  29. package/dist/chunks/{douyin-UU2FSQPS.js → douyin-PIWFZHK7.js} +91 -5
  30. package/dist/chunks/{ensure-E3DIRHSQ.js → ensure-2OPNFDRW.js} +7 -7
  31. package/dist/chunks/{execute-YP2N2AMS.js → execute-C5W5ZJDC.js} +5 -5
  32. package/dist/chunks/{facebook-SZFOVE7R.js → facebook-TI2CF5UY.js} +2 -2
  33. package/dist/chunks/{feishu-ISWRJ7HI.js → feishu-XSSEBWQD.js} +2 -2
  34. package/dist/chunks/{ima-D7CX5WR4.js → ima-SKE2C64C.js} +2 -2
  35. package/dist/chunks/{instagram-HNDPO37H.js → instagram-4W4HCWJN.js} +2 -2
  36. package/dist/chunks/{install-IIMVFNAT.js → install-VBMWNPO6.js} +1 -3
  37. package/dist/chunks/{jike-H7L4LJTN.js → jike-GS64MEEO.js} +4 -4
  38. package/dist/chunks/{mcp-AK373P5P.js → mcp-WK7KIU44.js} +14 -12
  39. package/dist/chunks/{mcpServer-7VL4KJH2.js → mcpServer-M4HJFSNU.js} +17 -15
  40. package/dist/chunks/{metaso-ZVZW5UBB.js → metaso-RRYEUXIL.js} +2 -2
  41. package/dist/chunks/{run-OYMMVKCB.js → run-WNHMZLSJ.js} +11 -11
  42. package/dist/chunks/{runCli-ZJ7WYHJ7.js → runCli-GKTCIDBF.js} +12 -12
  43. package/dist/chunks/{setup-EEU6GSWX.js → setup-UYCLFOZH.js} +6 -6
  44. package/dist/chunks/{threads-ADW6IANQ.js → threads-JKMT3E73.js} +3 -3
  45. package/dist/chunks/{twitter-NAGCB3NI.js → twitter-WNBOJELM.js} +2 -2
  46. package/dist/chunks/{web-QFKZCM4F.js → web-LJESVHHV.js} +4 -4
  47. package/dist/chunks/{wechat-OXNNLT4J.js → wechat-N7O77CB4.js} +40 -1
  48. package/dist/chunks/{weibo-PMVGDNQU.js → weibo-XPEV5CLQ.js} +4 -4
  49. package/dist/chunks/{workbuddy-NNAXIIIZ.js → workbuddy-ZXNDX7O7.js} +5 -5
  50. package/dist/chunks/{xiaoheihe-WFQJRBAD.js → xiaoheihe-WXFAORLQ.js} +3 -3
  51. package/dist/chunks/{xiaohongshu-5CXBELGW.js → xiaohongshu-3N3ZVSXJ.js} +2 -2
  52. package/dist/chunks/{xiaoyuzhou-6L6IB46Y.js → xiaoyuzhou-OGIWFABL.js} +3 -3
  53. package/dist/chunks/{youtube-52NGBTQC.js → youtube-YRSK7CWC.js} +3 -3
  54. package/dist/chunks/{zcool-HDSWK4KD.js → zcool-K5KJ2KDG.js} +2 -2
  55. package/dist/chunks/{zhihu-EX2VRJYY.js → zhihu-X6XSPD6B.js} +2 -2
  56. package/dist/dinox.js +7 -7
  57. package/dist/dsh-plugin/lib/client.js +1030 -578
  58. package/dist/dsh-plugin/lib/index.js +11 -7
  59. package/dist/dsh-plugin/package.json +1 -1
  60. package/dist/dsh-plugin/runtime.json +2 -2
  61. package/dist/editor-ui/mcp-app.html +449 -583
  62. package/package.json +25 -12
@@ -41,7 +41,7 @@ var McpStdioClient = class {
41
41
  }
42
42
  connect() {
43
43
  if (this.closed) return Promise.reject(new Error("The Dinox editor connection closed"));
44
- if (this.ready) return this.ready;
44
+ if (this.ready !== null) return this.ready;
45
45
  const wait = Math.max(0, this.retryAt - Date.now());
46
46
  this.ready = (async () => {
47
47
  if (wait) await new Promise((resolve) => setTimeout(resolve, wait));
@@ -180,8 +180,10 @@ var inject = ["tools", "webServer", "agents"];
180
180
  var ROUTE = "/dinox-editor";
181
181
  var SESSION_PREFIX = "dsh:";
182
182
  var MAX_BODY = 8 * 1024 * 1024;
183
+ var MAX_UPLOAD_BODY = 511 * 1024 * 1024;
184
+ var UPLOAD_TIMEOUT_MS = 15 * 6e4;
183
185
  var MAX_WAIT_MS = 25e3;
184
- var UI_METHODS = /* @__PURE__ */ new Set(["sync", "save", "resolve", "search", "open", "log", "catalog", "updateMeta", "todos", "todoUpdate", "todoAppend", "todoRestore", "todoSuggestion"]);
186
+ var UI_METHODS = /* @__PURE__ */ new Set(["sync", "save", "resolve", "search", "excerpt", "open", "log", "catalog", "updateMeta", "todos", "todoUpdate", "todoAppend", "todoRestore", "todoSuggestion", "upload", "linkPreview", "views", "viewEmbed"]);
185
187
  var SESSION_META_KEY = "dinox.ai/editorSession";
186
188
  function resolveRuntime(pluginLib = path.dirname(fileURLToPath(import.meta.url)), env = process.env) {
187
189
  const fallbackCli = path.resolve(pluginLib, "..", "..", "dinox.js");
@@ -249,7 +251,7 @@ function apply(ctx, options = {}) {
249
251
  if (!String(req.headers["content-type"] ?? "").toLowerCase().startsWith("application/json")) {
250
252
  return send(res, 415, { error: { message: "Expected application/json" } });
251
253
  }
252
- const body = await readJson(req);
254
+ const { value: body, size } = await readJson(req, action === "rpc" ? MAX_UPLOAD_BODY : MAX_BODY);
253
255
  if (action === "opens") {
254
256
  const waitMs2 = clampWait(body.waitMs);
255
257
  const value2 = await call("watchOpens", { cursor: body.cursor, waitMs: waitMs2 }, waitMs2 + 15e3);
@@ -264,10 +266,11 @@ function apply(ctx, options = {}) {
264
266
  }
265
267
  const method = String(body.method);
266
268
  if (!UI_METHODS.has(method)) return send(res, 400, { error: { message: `Unknown editor method ${method}` } });
269
+ if (method !== "upload" && size > MAX_BODY) return send(res, 413, { error: { message: "Request body exceeds 8MB" } });
267
270
  const params = body.params && typeof body.params === "object" && !Array.isArray(body.params) ? body.params : {};
268
271
  const waitMs = method === "sync" ? clampWait(params.waitMs) : 0;
269
272
  const forwarded = { ...params, session: SESSION_PREFIX + sessionId, ...method === "sync" ? { waitMs } : {} };
270
- const value = await call(method, forwarded, method === "sync" ? waitMs + 15e3 : 4e4);
273
+ const value = await call(method, forwarded, method === "sync" ? waitMs + 15e3 : method === "upload" ? UPLOAD_TIMEOUT_MS : 4e4);
271
274
  return send(res, 200, { value });
272
275
  } catch (error) {
273
276
  if (res.writableEnded) return;
@@ -337,23 +340,24 @@ function allowedOrigin(req) {
337
340
  function clampWait(value) {
338
341
  return Math.max(0, Math.min(MAX_WAIT_MS, Number(value) || 0));
339
342
  }
340
- async function readJson(req) {
343
+ async function readJson(req, maxBytes) {
341
344
  const chunks = [];
342
345
  let size = 0;
343
346
  for await (const chunk of req) {
344
347
  const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
345
348
  size += buffer.length;
346
- if (size > MAX_BODY) throw Object.assign(new Error("Request body exceeds 8MB"), { status: 413 });
349
+ if (size > maxBytes) throw Object.assign(new Error(`Request body exceeds ${Math.round(maxBytes / 1024 / 1024)}MB`), { status: 413 });
347
350
  chunks.push(buffer);
348
351
  }
349
352
  let value;
350
353
  try {
351
354
  value = JSON.parse(Buffer.concat(chunks).toString("utf8"));
352
355
  } catch {
356
+ if (size > MAX_BODY) throw Object.assign(new Error("Request body exceeds 8MB"), { status: 413 });
353
357
  throw Object.assign(new Error("Request body is not JSON"), { status: 400 });
354
358
  }
355
359
  if (!value || typeof value !== "object" || Array.isArray(value)) throw Object.assign(new Error("Expected a JSON object"), { status: 400 });
356
- return value;
360
+ return { value, size };
357
361
  }
358
362
  function send(res, status, value) {
359
363
  res.statusCode = status;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinox-editor-dsh",
3
- "version": "2.20.2",
3
+ "version": "3.1.0",
4
4
  "private": true,
5
5
  "description": "Dinox note editor for DeepSeek Harness Desktop (built by @dinoxx/dinox-cli)",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "node": "/Users/shanks/.nvm/versions/node/v24.16.0/bin/node",
3
- "cli": "/private/tmp/dinox-cli-release.yeKp/repo/apps/cli/dist/dinox.js",
4
- "version": "2.20.2"
3
+ "cli": "/private/tmp/dinox-cli-release/apps/cli/dist/dinox.js",
4
+ "version": "3.1.0"
5
5
  }