@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
@@ -2,11 +2,79 @@ import { createRequire as __dinoxCreateRequire } from 'node:module';
2
2
  const require = __dinoxCreateRequire(import.meta.url);
3
3
  import {
4
4
  DinoxError
5
- } from "./chunk-3VZNZWDG.js";
5
+ } from "./chunk-LAWV5XGL.js";
6
+
7
+ // ../../packages/note-schema/src/tasks/taskStatus.ts
8
+ var TASK_STATUS_VALUES = [
9
+ "backlog",
10
+ "todo",
11
+ "in_progress",
12
+ "done",
13
+ "cancelled"
14
+ ];
15
+ var OPEN_TASK_STATUSES = ["backlog", "todo", "in_progress"];
16
+ var TASK_STATUS_MARKDOWN_MARKER = {
17
+ backlog: ">",
18
+ todo: " ",
19
+ in_progress: "/",
20
+ done: "x",
21
+ cancelled: "-"
22
+ };
23
+ var TASK_STATUS_MARKER_CHARS = "[ xX>/-]";
24
+ function isTaskStatus(value) {
25
+ return typeof value === "string" && TASK_STATUS_VALUES.includes(value);
26
+ }
27
+ function isTaskClosed(status) {
28
+ return status === "done" || status === "cancelled";
29
+ }
30
+ function normalizeStoredTaskStatus(value) {
31
+ return value === "backlog" || value === "in_progress" || value === "cancelled" ? value : null;
32
+ }
33
+ function resolveTaskStatus(attrs) {
34
+ const stored = normalizeStoredTaskStatus(attrs?.status);
35
+ if (attrs?.checked === true) return stored === "cancelled" ? "cancelled" : "done";
36
+ return stored === "backlog" || stored === "in_progress" ? stored : "todo";
37
+ }
38
+ function taskStatusAttrs(status) {
39
+ switch (status) {
40
+ case "backlog":
41
+ case "in_progress":
42
+ return { checked: false, status };
43
+ case "todo":
44
+ return { checked: false, status: null };
45
+ case "done":
46
+ return { checked: true, status: null };
47
+ case "cancelled":
48
+ return { checked: true, status: "cancelled" };
49
+ }
50
+ }
51
+ function taskStatusFromMarkdownMarker(marker) {
52
+ switch (marker) {
53
+ case " ":
54
+ return "todo";
55
+ case "x":
56
+ case "X":
57
+ return "done";
58
+ case ">":
59
+ return "backlog";
60
+ case "/":
61
+ return "in_progress";
62
+ case "-":
63
+ return "cancelled";
64
+ default:
65
+ return null;
66
+ }
67
+ }
68
+ function cascadedChildTaskStatus(parent, child) {
69
+ if (isTaskClosed(parent) && !isTaskClosed(child)) return parent;
70
+ return child;
71
+ }
72
+ function reopenedAncestorTaskStatus(ancestor) {
73
+ return isTaskClosed(ancestor) ? "todo" : ancestor;
74
+ }
6
75
 
7
76
  // src/editor/todos.ts
8
- var DEFAULT_TODO_FILTER = { status: "uncompleted", query: "", tags: [], priority: [], from: null, to: null };
9
- var STATUSES = ["uncompleted", "completed", "all"];
77
+ var DEFAULT_TODO_FILTER = { status: [...OPEN_TASK_STATUSES], query: "", tags: [], priority: [], from: null, to: null };
10
78
  var PRIORITIES = ["high", "medium", "low", "none"];
11
79
  var DATE = /^\d{4}-\d{2}-\d{2}$/;
12
80
  var TIME = /^([01]\d|2[0-3]):[0-5]\d$/;
@@ -37,14 +105,18 @@ function parseTodoFilter(raw, base = DEFAULT_TODO_FILTER) {
37
105
  if (raw === void 0 || raw === null) return { ...base };
38
106
  if (typeof raw !== "object" || Array.isArray(raw)) throw invalid("filter must be an object");
39
107
  const input = raw;
40
- const status = input.status === void 0 ? base.status : input.status;
41
- if (!STATUSES.includes(status)) throw invalid(`status must be one of ${STATUSES.join(", ")}`);
42
108
  const list = (value, name) => {
43
109
  if (value === void 0 || value === null) return [];
44
110
  const items = Array.isArray(value) ? value : [value];
45
111
  if (items.length > 20) throw invalid(`${name} has too many values`);
46
112
  return items.map((item) => text(item, name, 100)).filter(Boolean);
47
113
  };
114
+ let status = base.status;
115
+ if (input.status !== void 0) {
116
+ const wanted = new Set(list(input.status, "status"));
117
+ for (const value of wanted) if (!isTaskStatus(value)) throw invalid(`status must be a list of ${TASK_STATUS_VALUES.join(", ")}`);
118
+ status = TASK_STATUS_VALUES.filter((value) => wanted.has(value));
119
+ }
48
120
  const tags = input.tags === void 0 ? base.tags : [...new Set(list(input.tags, "tags").map((tag) => tag.replace(/^#/, "")))];
49
121
  const priority = input.priority === void 0 ? base.priority : [...new Set(list(input.priority, "priority"))];
50
122
  for (const value of priority) if (!PRIORITIES.includes(value)) throw invalid(`priority must be one of ${PRIORITIES.join(", ")}`);
@@ -52,7 +124,7 @@ function parseTodoFilter(raw, base = DEFAULT_TODO_FILTER) {
52
124
  const to = input.to === void 0 ? base.to : localDate(input.to, "to");
53
125
  if (from && to && from > to) throw invalid("from must not be after to");
54
126
  return {
55
- status,
127
+ status: [...status],
56
128
  query: input.query === void 0 ? base.query : text(input.query, "query", 500),
57
129
  tags,
58
130
  priority,
@@ -88,10 +160,7 @@ function parseTodoUpdates(raw) {
88
160
  const update = { taskId };
89
161
  const noteId = text(input.noteId, `updates[${index}].noteId`, 200);
90
162
  if (noteId) update.noteId = noteId;
91
- if (input.checked !== void 0) {
92
- if (typeof input.checked !== "boolean") throw invalid(`updates[${index}].checked must be true or false`);
93
- update.checked = input.checked;
94
- }
163
+ if (input.status !== void 0) update.status = statusValue(input.status, `updates[${index}].status`);
95
164
  if (input.priority !== void 0) {
96
165
  if (input.priority !== null && input.priority !== "none" && !["high", "medium", "low"].includes(input.priority)) {
97
166
  throw invalid(`updates[${index}].priority must be high, medium, low or null`);
@@ -115,7 +184,7 @@ function parseTodoUpdates(raw) {
115
184
  if (!words) throw invalid(`updates[${index}].text cannot be empty`);
116
185
  update.text = words;
117
186
  }
118
- if (update.checked === void 0 && update.priority === void 0 && update.schedule === void 0 && update.text === void 0) {
187
+ if (update.status === void 0 && update.priority === void 0 && update.schedule === void 0 && update.text === void 0) {
119
188
  throw invalid(`updates[${index}] changes nothing`);
120
189
  }
121
190
  return update;
@@ -123,6 +192,10 @@ function parseTodoUpdates(raw) {
123
192
  }
124
193
  var MAX_APPEND = 20;
125
194
  var POINT_FORMATS = ["date", "datetime", "datetime-seconds", "time"];
195
+ function statusValue(value, name) {
196
+ if (!isTaskStatus(value)) throw invalid(`${name} must be one of ${TASK_STATUS_VALUES.join(", ")}`);
197
+ return value;
198
+ }
126
199
  function priorityValue(value, name) {
127
200
  if (value === null || value === "none") return null;
128
201
  if (!["high", "medium", "low"].includes(value)) throw invalid(`${name} must be high, medium, low or null`);
@@ -183,10 +256,7 @@ function parseTodoRestore(raw) {
183
256
  if (!taskId || !noteId) throw invalid(`entries[${index}] needs taskId and noteId`);
184
257
  const restore = { taskId, noteId };
185
258
  if (input.remove === true) return { ...restore, remove: true };
186
- if (input.checked !== void 0) {
187
- if (typeof input.checked !== "boolean") throw invalid(`entries[${index}].checked must be true or false`);
188
- restore.checked = input.checked;
189
- }
259
+ if (input.status !== void 0) restore.status = statusValue(input.status, `entries[${index}].status`);
190
260
  if (input.priority !== void 0) restore.priority = priorityValue(input.priority, `entries[${index}].priority`);
191
261
  if (input.due !== void 0) {
192
262
  if (input.due === null) {
@@ -200,7 +270,7 @@ function parseTodoRestore(raw) {
200
270
  }
201
271
  }
202
272
  if (input.paragraph !== void 0) restore.paragraph = restoreParagraph(input.paragraph, `entries[${index}].paragraph`);
203
- if (restore.checked === void 0 && restore.priority === void 0 && restore.dueAt === void 0 && restore.paragraph === void 0) {
273
+ if (restore.status === void 0 && restore.priority === void 0 && restore.dueAt === void 0 && restore.paragraph === void 0) {
204
274
  throw invalid(`entries[${index}] changes nothing`);
205
275
  }
206
276
  return restore;
@@ -218,7 +288,7 @@ function dueText(task) {
218
288
  function formatTodoList(list, max = 40) {
219
289
  const { filter } = list;
220
290
  const scope = [
221
- filter.status === "all" ? "all tasks" : `${filter.status} tasks`,
291
+ filter.status.length === 0 || filter.status.length === TASK_STATUS_VALUES.length ? "all tasks" : `${filter.status.join("/")} tasks`,
222
292
  filter.query ? `matching "${filter.query}"` : "",
223
293
  filter.tags.length ? `tagged ${filter.tags.map((tag) => `#${tag}`).join(" ")}` : "",
224
294
  filter.priority.length ? `priority ${filter.priority.join("/")}` : "",
@@ -227,13 +297,24 @@ function formatTodoList(list, max = 40) {
227
297
  const lines = [`${list.total}${list.hasMore ? "+" : ""} ${scope}.`];
228
298
  for (const task of list.tasks.slice(0, max)) {
229
299
  const extras = [PRIORITY_MARK[task.priority ?? ""], dueText(task) && `due ${dueText(task)}`, `in "${task.note_title || "Untitled"}"`].filter(Boolean).join(" \xB7 ");
230
- lines.push(`${" ".repeat(Math.min(task.depth, 4))}- [${task.checked ? "x" : " "}] ${task.text} (${extras}) [${task.task_id}]`);
300
+ lines.push(`${" ".repeat(Math.min(task.depth, 4))}- [${TASK_STATUS_MARKDOWN_MARKER[task.status]}] ${task.text} (${extras}) [${task.task_id}]`);
231
301
  }
232
302
  if (list.tasks.length > max) lines.push(`\u2026 ${list.tasks.length - max} more in the panel.`);
233
303
  return lines.join("\n");
234
304
  }
235
305
 
236
306
  export {
307
+ TASK_STATUS_VALUES,
308
+ TASK_STATUS_MARKDOWN_MARKER,
309
+ TASK_STATUS_MARKER_CHARS,
310
+ isTaskStatus,
311
+ isTaskClosed,
312
+ normalizeStoredTaskStatus,
313
+ resolveTaskStatus,
314
+ taskStatusAttrs,
315
+ taskStatusFromMarkdownMarker,
316
+ cascadedChildTaskStatus,
317
+ reopenedAncestorTaskStatus,
237
318
  DEFAULT_TODO_FILTER,
238
319
  parseTodoFilter,
239
320
  todoSearchWire,
@@ -41,10 +41,15 @@ var ERROR_CODES = {
41
41
  EDITOR_ANCHOR_AMBIGUOUS: { exitCode: 2, description: "The suggestion anchor occurs more than once in the open note." },
42
42
  EDITOR_ANCHOR_MISSING: { exitCode: 2, description: "The suggestion anchor does not occur in the open note." },
43
43
  EDITOR_INVALID_DOCUMENT: { exitCode: 2, description: "The editor document cannot be saved without losing content." },
44
+ EDITOR_LINK_PREVIEW_BLOCKED: { exitCode: 2, description: "The link preview URL is not a public http(s) address (loopback, private and link-local hosts are refused)." },
45
+ EDITOR_LINK_PREVIEW_FAILED: { exitCode: 1, description: "Fetching the page for a link preview failed or timed out." },
44
46
  EDITOR_NOTE_NOT_OPEN: { exitCode: 5, description: "The editor session has no open note." },
45
47
  EDITOR_STALE_SEQUENCE: { exitCode: 5, description: "The editor request targets a note the session has since replaced." },
46
48
  EDITOR_UNKNOWN_BLOCK: { exitCode: 2, description: "The suggestion targets a block that is no longer in the open note." },
47
49
  EDITOR_UNSAVED_CHANGES: { exitCode: 5, description: "The editor session has unsaved changes." },
50
+ EDITOR_UPLOAD_FAILED: { exitCode: 1, description: "Uploading the editor panel's file to Dinox storage failed." },
51
+ EDITOR_UPLOAD_INVALID: { exitCode: 2, description: "The editor upload has no data, invalid base64, or a missing name / media type." },
52
+ EDITOR_UPLOAD_TOO_LARGE: { exitCode: 2, description: "The editor upload exceeds its size limit (25 MB for images, 500 MB otherwise)." },
48
53
  INTERNAL_ERROR: { exitCode: 1, description: "Unexpected internal error; not a DinoxError." },
49
54
  INVALID_ARGUMENT: { exitCode: 2, description: "An argument or option value is invalid." },
50
55
  INVALID_PROPERTY_DEF_CONFIG: { exitCode: 1, description: "A property definition config could not be serialized." },
@@ -3,7 +3,7 @@ const require = __dinoxCreateRequire(import.meta.url);
3
3
  import {
4
4
  normalizeClipMarkdownBody,
5
5
  stripClipBoilerplate
6
- } from "./chunk-XMMTGPZ6.js";
6
+ } from "./chunk-AZ43P73A.js";
7
7
  import {
8
8
  formatClipFooter
9
9
  } from "./chunk-AHRCI2RW.js";
@@ -2,10 +2,10 @@ import { createRequire as __dinoxCreateRequire } from 'node:module';
2
2
  const require = __dinoxCreateRequire(import.meta.url);
3
3
  import {
4
4
  resolveUserPath
5
- } from "./chunk-6D3QLMRM.js";
5
+ } from "./chunk-TOGYWN3D.js";
6
6
  import {
7
7
  DinoxError
8
- } from "./chunk-3VZNZWDG.js";
8
+ } from "./chunk-LAWV5XGL.js";
9
9
 
10
10
  // src/utils/argValue.ts
11
11
  import fs from "node:fs/promises";