@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
package/README.md CHANGED
@@ -500,7 +500,7 @@ Dinox 的待办来自笔记内容中的任务列表。CLI 提供了 4 个最常
500
500
  ```bash
501
501
  dino todo search
502
502
  dino todo search "付款"
503
- dino todo search "付款" --status uncompleted
503
+ dino todo search "付款" --status backlog,todo,in_progress
504
504
  dino todo search --from 2026-03-01 --to 2026-03-07 --limit 100
505
505
  ```
506
506
 
@@ -540,22 +540,23 @@ dino todo append --note-id <note-id> --tasks @./todo.txt
540
540
  #### 更新待办状态
541
541
 
542
542
  ```bash
543
- dino todo update <task-id> --status completed
544
- dino todo update <task-id> --note-id <note-id> --status completed
545
- dino todo update <task-id> --status uncompleted
543
+ dino todo update <task-id> --status done
544
+ dino todo update <task-id> --note-id <note-id> --status done
545
+ dino todo update <task-id> --status todo
546
+ dino todo update <task-id> --status cancelled
546
547
  ```
547
548
 
548
- 兼容写法也支持:
549
+ 任务状态只有 5 个值:
549
550
 
550
- ```bash
551
- dino todo update <task-id> --status done
552
- dino todo update <task-id> --status false
553
- ```
551
+ - `backlog`:以后再说(Markdown `[>]`)
552
+ - `todo`:待办(`[ ]`)
553
+ - `in_progress`:进行中(`[/]`)
554
+ - `done`:完成(`[x]`)
555
+ - `cancelled`:取消(`[-]`)
554
556
 
555
- 但为了可读性,推荐始终使用:
557
+ `done`/`cancelled` 是已关闭,其余是未关闭。设为 `done` 或 `cancelled` 时,未关闭的子任务会一并设为同一状态(已关闭的子任务保持原状);设为未关闭状态时,已关闭的父任务会重新打开为 `todo`;`backlog`/`in_progress` 不向下传递。父任务不会自动完成。
556
558
 
557
- - `completed`
558
- - `uncompleted`
559
+ 3.0 起旧写法(`completed`/`uncompleted`/`all`、`undone`/`true`/`false`/`1`/`0`、JSON 里的 `checked`)全部移除,不再兼容。
559
560
 
560
561
  对没有持久 task id 的旧笔记,`todo search` 会返回 `legacy-task-*` 合成 id。该 id 绑定搜索时的任务位置和内容;如果笔记结构随后变化,更新会安全失败,必须重新搜索,避免把状态写到另一条任务。建议始终把搜索结果中的 `note_id` 一并传给 `--note-id`。
561
562
 
@@ -786,13 +787,13 @@ dino note delete <id>
786
787
  dino todo search [query]
787
788
  dino todo append [task]
788
789
  dino todo create [task]
789
- dino todo update <task-id> --status completed
790
+ dino todo update <task-id> --status done
790
791
  ```
791
792
 
792
793
  重点参数:
793
794
 
794
795
  - `todo search`
795
- - `--status <all|completed|uncompleted>`
796
+ - `--status <list>`:逗号分隔的状态(`backlog,todo,in_progress,done,cancelled`),不传即全部
796
797
  - `--tags <list>`
797
798
  - `--from <date>` / `--to <date>` / `--days <n>`
798
799
  - `--limit <n>`
@@ -807,7 +808,7 @@ dino todo update <task-id> --status completed
807
808
  - `--title <string>`
808
809
  - `--dry-run`
809
810
  - `todo update`
810
- - `--status <status>` 必填
811
+ - `--status <backlog|todo|in_progress|done|cancelled>`
811
812
  - `--note-id <id>`:用搜索结果中的笔记 id 精确限定目标
812
813
  - `--dry-run`
813
814
 
@@ -987,7 +988,7 @@ dino update
987
988
  ```bash
988
989
  dino note search "dinox" --limit 5 --format json
989
990
  dino note detail <id> --format json
990
- dino todo search --status uncompleted --format json
991
+ dino todo search --status backlog,todo,in_progress --format json
991
992
  ```
992
993
 
993
994
  `--format json` 会返回稳定的结构化 envelope,适合被脚本、自动化任务和 AI Agent 解析。
@@ -8,11 +8,11 @@ import {
8
8
  import {
9
9
  downloadAudio,
10
10
  formatDuration
11
- } from "./chunk-GTDX2LIJ.js";
11
+ } from "./chunk-RSSEVU2F.js";
12
12
  import {
13
13
  composeClipMarkdown
14
- } from "./chunk-FIQYJ6KZ.js";
15
- import "./chunk-XMMTGPZ6.js";
14
+ } from "./chunk-LLAXR5EG.js";
15
+ import "./chunk-AZ43P73A.js";
16
16
  import "./chunk-URYABAYN.js";
17
17
  import {
18
18
  ytdlpOptionsFor
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-X36EIV25.js";
7
7
  import {
8
8
  downloadWebImages
9
- } from "./chunk-TILRKKRN.js";
9
+ } from "./chunk-MKEL2KNU.js";
10
10
  import "./chunk-2LW76QIL.js";
11
11
  import "./chunk-PTFGE4KS.js";
12
12
  import {
@@ -27,8 +27,8 @@ import {
27
27
  import "./chunk-QZQRG3JY.js";
28
28
  import {
29
29
  composeClipMarkdown
30
- } from "./chunk-FIQYJ6KZ.js";
31
- import "./chunk-XMMTGPZ6.js";
30
+ } from "./chunk-LLAXR5EG.js";
31
+ import "./chunk-AZ43P73A.js";
32
32
  import "./chunk-URYABAYN.js";
33
33
  import {
34
34
  clipEngineConfig
@@ -13,13 +13,16 @@ import {
13
13
  createRequestSpacer
14
14
  } from "./chunk-FZGEWY5L.js";
15
15
  import {
16
+ currentVideoByteBudget,
16
17
  loadCookieHeader
17
- } from "./chunk-FGQRYB7F.js";
18
+ } from "./chunk-MZMOE3RX.js";
18
19
  import {
20
+ VideoExtractError,
19
21
  buildVideoMarkdown,
20
22
  downloadVideo,
21
- resolveVideoMetadata
22
- } from "./chunk-GTDX2LIJ.js";
23
+ pickBudgetedFormat,
24
+ resolveVideoInfo
25
+ } from "./chunk-RSSEVU2F.js";
23
26
  import {
24
27
  summarizeImageFailures
25
28
  } from "./chunk-5KU25TMX.js";
@@ -29,8 +32,8 @@ import {
29
32
  } from "./chunk-QZQRG3JY.js";
30
33
  import {
31
34
  composeClipMarkdown
32
- } from "./chunk-FIQYJ6KZ.js";
33
- import "./chunk-XMMTGPZ6.js";
35
+ } from "./chunk-LLAXR5EG.js";
36
+ import "./chunk-AZ43P73A.js";
34
37
  import "./chunk-URYABAYN.js";
35
38
  import {
36
39
  clipEngineConfig,
@@ -63,6 +66,8 @@ var TOO_FREQUENT_CODES = /* @__PURE__ */ new Set([-509, -799]);
63
66
  var BILIBILI_API_MIN_INTERVAL_MS = 5e3;
64
67
  var apiSpacer = createRequestSpacer({ intervalMs: BILIBILI_API_MIN_INTERVAL_MS });
65
68
  var NOT_FOUND_CODES = /* @__PURE__ */ new Set([-404, 4101131, 4101152, 4128002]);
69
+ var VIDEO_GONE_CODES = /* @__PURE__ */ new Set([-404, 62002, 62004, 62012]);
70
+ var VIDEO_VIEW_URL = "https://api.bilibili.com/x/web-interface/view";
66
71
  async function fetchBilibiliDynamic(id, options = {}) {
67
72
  const url = `${DYNAMIC_DETAIL_URL}?id=${encodeURIComponent(id)}&features=itemOpusStyle`;
68
73
  const data = await getApiData(url, { id, kind: "dynamic" }, options);
@@ -117,6 +122,23 @@ async function fetchBilibiliArticle(id, options = {}) {
117
122
  }
118
123
  return data;
119
124
  }
125
+ async function fetchBilibiliVideoGone(videoUrl, options = {}) {
126
+ const id = /\/video\/(BV[0-9A-Za-z]+|av\d+)/i.exec(videoUrl)?.[1];
127
+ if (!id) return null;
128
+ const query = /^av/i.test(id) ? `aid=${id.slice(2)}` : `bvid=${id}`;
129
+ try {
130
+ const intervalMs = options.minIntervalMs ?? (options.fetcher ? 0 : BILIBILI_API_MIN_INTERVAL_MS);
131
+ const envelope = await apiSpacer.run(
132
+ () => requestJson(`${VIDEO_VIEW_URL}?${query}`, { id, kind: "video" }, options),
133
+ { intervalMs }
134
+ );
135
+ const code = typeof envelope.code === "number" ? envelope.code : Number(envelope.code);
136
+ if (!VIDEO_GONE_CODES.has(code)) return null;
137
+ return { code, message: typeof envelope.message === "string" ? envelope.message : "" };
138
+ } catch {
139
+ return null;
140
+ }
141
+ }
120
142
  async function resolveB23Url(url, options = {}) {
121
143
  try {
122
144
  const response = await fetchWithTimeout(
@@ -769,12 +791,12 @@ async function extractBilibiliClip(inputUrl, ctx, options = {}) {
769
791
  logInfo("bilibili.runner", "post.is-video", { id: target.ref.id, kind: target.ref.kind, url });
770
792
  }
771
793
  const videoUrl = target.url;
772
- const metadata = await resolveVideoMetadata(videoUrl, ytdlpOptionsFor("bilibili"));
794
+ const { info, metadata } = await resolveBilibiliVideo(videoUrl);
773
795
  const markdown = buildVideoMarkdown(
774
796
  { ...metadata, description: cleanBilibiliVideoDescription(metadata.description) },
775
797
  { site: "Bilibili" }
776
798
  );
777
- const video = await downloadBilibiliVideo(ctx.workDir, videoUrl);
799
+ const video = await downloadBilibiliVideo(ctx.workDir, videoUrl, info);
778
800
  logInfo("bilibili.runner", "extract.ok", { primaryVideo: Boolean(video), title: metadata.title });
779
801
  return {
780
802
  author: metadata.author,
@@ -817,9 +839,41 @@ async function extractPost(post, workDir) {
817
839
  title: post.title
818
840
  };
819
841
  }
820
- async function downloadBilibiliVideo(workDir, url) {
842
+ async function resolveBilibiliVideo(videoUrl) {
843
+ try {
844
+ return await resolveVideoInfo(videoUrl, ytdlpOptionsFor("bilibili"));
845
+ } catch (error) {
846
+ if (!(error instanceof VideoExtractError) || error.code !== "METADATA_FAILED") throw error;
847
+ const cookieHeader = await loadCookieHeader(platformCookiesFile("bilibili"), BILIBILI_COOKIE_DOMAIN_RE);
848
+ const gone = await fetchBilibiliVideoGone(videoUrl, { cookieHeader });
849
+ if (!gone) throw error;
850
+ logInfo("bilibili.runner", "video.gone", { code: gone.code, url: videoUrl });
851
+ throw new VideoExtractError("CONTENT_NOT_FOUND", `bilibili video is deleted or not visible (${gone.code} ${gone.message})`, {
852
+ code: gone.code,
853
+ url: videoUrl
854
+ });
855
+ }
856
+ }
857
+ async function downloadBilibiliVideo(workDir, url, info) {
858
+ const opts = ytdlpOptionsFor("bilibili");
859
+ const budget = currentVideoByteBudget();
860
+ const pick = budget ? pickBudgetedFormat(info, { budgetBytes: budget.bytes, maxHeight: opts.maxHeight }) : void 0;
861
+ if (budget && pick) {
862
+ logInfo("bilibili.runner", "video.format.budgeted", {
863
+ budgetBytes: budget.bytes,
864
+ estimatedBytes: pick.estimatedBytes,
865
+ fits: pick.fits,
866
+ height: pick.height,
867
+ measured: budget.measured,
868
+ url
869
+ });
870
+ if (!pick.fits && budget.measured) {
871
+ logWarn("bilibili.runner", "video.skipped", { reason: "over-upload-budget", url });
872
+ return null;
873
+ }
874
+ }
821
875
  try {
822
- const video = await downloadVideo({ opts: ytdlpOptionsFor("bilibili"), outDir: workDir, url });
876
+ const video = await downloadVideo({ opts, outDir: workDir, ...pick ? { preferredFormat: pick.selector } : {}, url });
823
877
  if (!video) logWarn("bilibili.runner", "video.skipped", { reason: "oversize-or-unavailable", url });
824
878
  return video;
825
879
  } catch (error) {
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-NGIIELO4.js";
7
7
  import {
8
8
  downloadWebImages
9
- } from "./chunk-TILRKKRN.js";
9
+ } from "./chunk-MKEL2KNU.js";
10
10
  import "./chunk-2LW76QIL.js";
11
11
  import "./chunk-PTFGE4KS.js";
12
12
  import {
@@ -24,8 +24,8 @@ import {
24
24
  import "./chunk-QZQRG3JY.js";
25
25
  import {
26
26
  composeClipMarkdown
27
- } from "./chunk-FIQYJ6KZ.js";
28
- import "./chunk-XMMTGPZ6.js";
27
+ } from "./chunk-LLAXR5EG.js";
28
+ import "./chunk-AZ43P73A.js";
29
29
  import "./chunk-URYABAYN.js";
30
30
  import {
31
31
  clipEngineConfig
@@ -4,7 +4,7 @@ import {
4
4
  getRequestedStructuredOutputFormat,
5
5
  requestContext,
6
6
  writeToStderr
7
- } from "./chunk-6D3QLMRM.js";
7
+ } from "./chunk-TOGYWN3D.js";
8
8
 
9
9
  // src/utils/progress.ts
10
10
  var MIN_INTERVAL_MS = 200;
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-XZLFMJOG.js";
6
6
  import {
7
7
  DinoxError
8
- } from "./chunk-3VZNZWDG.js";
8
+ } from "./chunk-LAWV5XGL.js";
9
9
  import {
10
10
  launchCamoufox,
11
11
  setBrowserLauncher
@@ -66,33 +66,33 @@ import { spawnSync } from "node:child_process";
66
66
  // ../../packages/clip-engine/src/clip/registry.ts
67
67
  var spec = (load, needs = {}) => ({ browser: false, cookies: false, ffmpeg: false, ytDlp: false, ...needs, load });
68
68
  var CLIP_PLATFORM_SPECS = {
69
- apple_podcast: spec(async () => (await import("./applePodcast-V4FSJOC5.js")).extractApplePodcastClip, { cookies: true, ytDlp: true }),
70
- bbc: spec(async () => (await import("./bbc-NTMRPYRF.js")).extractBbcClip),
71
- bilibili: spec(async () => (await import("./bilibili-UA3MBSPH.js")).extractBilibiliClip, { cookies: true, ffmpeg: true, ytDlp: true }),
72
- bohaishibei: spec(async () => (await import("./bohaishibei-B7UVXH4Y.js")).extractBohaishibeiClip),
69
+ apple_podcast: spec(async () => (await import("./applePodcast-YDYM4JYQ.js")).extractApplePodcastClip, { cookies: true, ytDlp: true }),
70
+ bbc: spec(async () => (await import("./bbc-N3BM2EGG.js")).extractBbcClip),
71
+ bilibili: spec(async () => (await import("./bilibili-V4XVW33T.js")).extractBilibiliClip, { cookies: true, ffmpeg: true, ytDlp: true }),
72
+ bohaishibei: spec(async () => (await import("./bohaishibei-IQO5CZTN.js")).extractBohaishibeiClip),
73
73
  dedao_note: spec(async () => (await import("./dedaoNote-KJ32ZQLS.js")).extractDedaoNoteClip),
74
- douban_group: spec(async () => (await import("./doubanGroup-HR4K2KMY.js")).extractDoubanGroupClip, { browser: true, cookies: true }),
75
- douban_topic: spec(async () => (await import("./doubanGroup-HR4K2KMY.js")).extractDoubanTopicClip, { browser: true, cookies: true }),
76
- doubao: spec(async () => (await import("./doubao-MXUHPLUB.js")).extractDoubaoClip),
77
- douyin: spec(async () => (await import("./douyin-UU2FSQPS.js")).extractDouyinClip, { cookies: true }),
78
- facebook: spec(async () => (await import("./facebook-SZFOVE7R.js")).extractFacebookClip, { browser: true, cookies: true }),
79
- feishu: spec(async () => (await import("./feishu-ISWRJ7HI.js")).extractFeishuClip, { browser: true }),
80
- ima: spec(async () => (await import("./ima-D7CX5WR4.js")).extractImaClip),
81
- instagram: spec(async () => (await import("./instagram-HNDPO37H.js")).extractInstagramClip, { browser: true, cookies: true }),
82
- jike: spec(async () => (await import("./jike-H7L4LJTN.js")).extractJikeClip, { browser: true }),
83
- metaso: spec(async () => (await import("./metaso-ZVZW5UBB.js")).extractMetasoClip),
84
- threads: spec(async () => (await import("./threads-ADW6IANQ.js")).extractThreadsClip, { browser: true }),
85
- twitter: spec(async () => (await import("./twitter-NAGCB3NI.js")).extractTwitterClip),
86
- web: spec(async () => (await import("./web-QFKZCM4F.js")).extractWebClip, { browser: true, cookies: true }),
87
- wechat_official_account: spec(async () => (await import("./wechat-OXNNLT4J.js")).extractWechatClip, { browser: true }),
88
- weibo: spec(async () => (await import("./weibo-PMVGDNQU.js")).extractWeiboClip, { browser: true, ffmpeg: "video", ytDlp: "video" }),
89
- workbuddy: spec(async () => (await import("./workbuddy-NNAXIIIZ.js")).extractWorkbuddyClip),
90
- xiaoheihe: spec(async () => (await import("./xiaoheihe-WFQJRBAD.js")).extractXiaoheiheClip, { browser: true }),
91
- xiaohongshu: spec(async () => (await import("./xiaohongshu-5CXBELGW.js")).extractXiaohongshuClip, { browser: true }),
92
- xiaoyuzhou: spec(async () => (await import("./xiaoyuzhou-6L6IB46Y.js")).extractXiaoyuzhouClip),
93
- youtube: spec(async () => (await import("./youtube-52NGBTQC.js")).extractYoutubeClip, { cookies: true, ffmpeg: true, ytDlp: true }),
94
- zcool: spec(async () => (await import("./zcool-HDSWK4KD.js")).extractZcoolClip),
95
- zhihu: spec(async () => (await import("./zhihu-EX2VRJYY.js")).extractZhihuClip, { browser: true })
74
+ douban_group: spec(async () => (await import("./doubanGroup-MADXDGDI.js")).extractDoubanGroupClip, { browser: true, cookies: true }),
75
+ douban_topic: spec(async () => (await import("./doubanGroup-MADXDGDI.js")).extractDoubanTopicClip, { browser: true, cookies: true }),
76
+ doubao: spec(async () => (await import("./doubao-DKZERP6Y.js")).extractDoubaoClip),
77
+ douyin: spec(async () => (await import("./douyin-PIWFZHK7.js")).extractDouyinClip, { cookies: true }),
78
+ facebook: spec(async () => (await import("./facebook-TI2CF5UY.js")).extractFacebookClip, { browser: true, cookies: true }),
79
+ feishu: spec(async () => (await import("./feishu-XSSEBWQD.js")).extractFeishuClip, { browser: true }),
80
+ ima: spec(async () => (await import("./ima-SKE2C64C.js")).extractImaClip),
81
+ instagram: spec(async () => (await import("./instagram-4W4HCWJN.js")).extractInstagramClip, { browser: true, cookies: true }),
82
+ jike: spec(async () => (await import("./jike-GS64MEEO.js")).extractJikeClip, { browser: true }),
83
+ metaso: spec(async () => (await import("./metaso-RRYEUXIL.js")).extractMetasoClip),
84
+ threads: spec(async () => (await import("./threads-JKMT3E73.js")).extractThreadsClip, { browser: true }),
85
+ twitter: spec(async () => (await import("./twitter-WNBOJELM.js")).extractTwitterClip),
86
+ web: spec(async () => (await import("./web-LJESVHHV.js")).extractWebClip, { browser: true, cookies: true }),
87
+ wechat_official_account: spec(async () => (await import("./wechat-N7O77CB4.js")).extractWechatClip, { browser: true }),
88
+ weibo: spec(async () => (await import("./weibo-XPEV5CLQ.js")).extractWeiboClip, { browser: true, ffmpeg: "video", ytDlp: "video" }),
89
+ workbuddy: spec(async () => (await import("./workbuddy-ZXNDX7O7.js")).extractWorkbuddyClip),
90
+ xiaoheihe: spec(async () => (await import("./xiaoheihe-WXFAORLQ.js")).extractXiaoheiheClip, { browser: true }),
91
+ xiaohongshu: spec(async () => (await import("./xiaohongshu-3N3ZVSXJ.js")).extractXiaohongshuClip, { browser: true }),
92
+ xiaoyuzhou: spec(async () => (await import("./xiaoyuzhou-OGIWFABL.js")).extractXiaoyuzhouClip),
93
+ youtube: spec(async () => (await import("./youtube-YRSK7CWC.js")).extractYoutubeClip, { cookies: true, ffmpeg: true, ytDlp: true }),
94
+ zcool: spec(async () => (await import("./zcool-K5KJ2KDG.js")).extractZcoolClip),
95
+ zhihu: spec(async () => (await import("./zhihu-X6XSPD6B.js")).extractZhihuClip, { browser: true })
96
96
  };
97
97
  function clipPlatformSpec(platform) {
98
98
  return CLIP_PLATFORM_SPECS[platform];
@@ -427,7 +427,7 @@ function decodeResidualDoubleHtmlEntities(text) {
427
427
  return current;
428
428
  }
429
429
  function normalizeClipMarkdownBody(markdown) {
430
- const lines = fixCjkLabelLayout(splitHeadingImages(dropStrandedParagraphClosers(closeOrphanStandaloneBold(closeBoldBrokenByBlockImages(splitOrCloseParagraphSpanningItalic(splitParagraphSpanningBold(unwrapSpanningLinkListBold(joinListPunctuationContinuations(joinStrandedEmphasis(unwrapDiscourseLightboxMarkdown(markdown).split("\n")))))))))));
430
+ const lines = fixCjkLabelLayout(splitHeadingImages(dropStrandedParagraphClosers(liftBoldOffAtxHeadings(closeOrphanStandaloneBold(closeBoldBrokenByBlockImages(splitOrCloseParagraphSpanningItalic(splitParagraphSpanningBold(unwrapSpanningLinkListBold(joinListPunctuationContinuations(joinStrandedEmphasis(unwrapDiscourseLightboxMarkdown(markdown).split("\n"))))))))))));
431
431
  const out = [];
432
432
  let fence = null;
433
433
  let dropBlank = false;
@@ -856,6 +856,41 @@ function closeBoldBrokenByBlockImages(lines) {
856
856
  }
857
857
  return out;
858
858
  }
859
+ var BOLD_ATX_HEADING_OPEN_RE = /^([ \t]*)\*\*(#{1,6}[ \t]+\S.*?)(?:\*\*)?\s*$/;
860
+ var BOLD_ATX_HEADING_CLOSE_MAX = 80;
861
+ function liftBoldOffAtxHeadings(lines) {
862
+ const out = [...lines];
863
+ let fence = null;
864
+ for (let index = 0; index < out.length; index += 1) {
865
+ const line = out[index];
866
+ const marker = line.match(/^\s{0,3}(`{3,}|~{3,})/)?.[1];
867
+ if (fence) {
868
+ if (marker && marker[0] === fence[0] && marker.length >= fence.length) fence = null;
869
+ continue;
870
+ }
871
+ if (marker) {
872
+ fence = marker;
873
+ continue;
874
+ }
875
+ const open = BOLD_ATX_HEADING_OPEN_RE.exec(line);
876
+ if (!open) continue;
877
+ const stars = line.match(/\*\*/g) ?? [];
878
+ if (stars.length > 2) continue;
879
+ out[index] = `${open[1]}${open[2].replace(/\s+$/, "")}`;
880
+ if (stars.length !== 1) continue;
881
+ for (let look = index + 1; look < out.length && look - index <= BOLD_ATX_HEADING_CLOSE_MAX; look += 1) {
882
+ const later = out[look];
883
+ const laterMarker = later.match(/^\s{0,3}(`{3,}|~{3,})/)?.[1];
884
+ if (laterMarker) break;
885
+ if ((later.match(/\*\*/g) ?? []).length % 2 !== 1) continue;
886
+ const close = /^(.*[^*\s])\*\*\s*$/.exec(later) ?? /^([ \t]*)\*\*[ \t]*$/.exec(later);
887
+ if (!close) break;
888
+ out[look] = close[1].replace(/\s+$/, "");
889
+ break;
890
+ }
891
+ }
892
+ return out;
893
+ }
859
894
  var ORPHAN_STANDALONE_BOLD_RE = /^([ \t]*)\*\*(?![\s*])([^*]+?)\s*$/;
860
895
  var ORPHAN_STANDALONE_BOLD_MAX = 40;
861
896
  function closeOrphanStandaloneBold(lines) {
@@ -1001,6 +1036,12 @@ var BOLD_IMAGES_THEN_TEXT_RE = new RegExp(
1001
1036
  // comment ("**![](a) <!-- … -->**"), not text after the image.
1002
1037
  String.raw`^(\s*)${EMPTY_BOLD}\*\*${HSPACE}*((?:${IMAGE_UNIT_RE}${HSPACE}*)+?)${HSPACE}*((?!<!--)[^*\s\])][^*]*?)\*\*${HSPACE}*${EMPTY_BOLD}$`
1003
1038
  );
1039
+ var BOLD_IMAGES_CLOSED_THEN_REST_RE = new RegExp(
1040
+ String.raw`^(\s*)${EMPTY_BOLD}\*\*${HSPACE}*((?:${IMAGE_UNIT_RE}${HSPACE}*)+?)${HSPACE}*\*\*${HSPACE}*(\S[\s\S]*)$`
1041
+ );
1042
+ var BOLD_IMAGES_THEN_REST_RE = new RegExp(
1043
+ String.raw`^(\s*)${EMPTY_BOLD}\*\*${HSPACE}*((?:${IMAGE_UNIT_RE}${HSPACE}*)+?)${HSPACE}*((?!<!--)[^*\s\])][\s\S]*)$`
1044
+ );
1004
1045
  function canCloseBoldBeforeEdgeImages(line) {
1005
1046
  return line.includes("![") && line.includes("**") && !line.includes("`") && !line.includes("\\*");
1006
1047
  }
@@ -1017,6 +1058,20 @@ function closeBoldBeforeEdgeImages(line) {
1017
1058
  if (imagesFirst && isBlockImages(imagesFirst[2] ?? "")) {
1018
1059
  return `${imagesFirst[1]}${(imagesFirst[2] ?? "").trim()} **${(imagesFirst[3] ?? "").trimEnd()}**`;
1019
1060
  }
1061
+ const restHasText = (value) => value.replace(new RegExp(IMAGE_UNIT_RE, "g"), "").replace(/[\s*_]/g, "").length > 0;
1062
+ const closedThenRest = BOLD_IMAGES_CLOSED_THEN_REST_RE.exec(line);
1063
+ if (closedThenRest && isBlockImages(closedThenRest[2] ?? "") && restHasText(closedThenRest[3] ?? "")) {
1064
+ const rest = (closedThenRest[3] ?? "").trim();
1065
+ if (rest) return `${closedThenRest[1]}${(closedThenRest[2] ?? "").trim()} ${rest}`;
1066
+ }
1067
+ const imagesThenRest = BOLD_IMAGES_THEN_REST_RE.exec(line);
1068
+ if (imagesThenRest && isBlockImages(imagesThenRest[2] ?? "") && restHasText(imagesThenRest[3] ?? "")) {
1069
+ const rest = (imagesThenRest[3] ?? "").trim();
1070
+ if (rest) {
1071
+ const text = /^\*\*|^__/.test(rest) ? rest : `**${rest}`;
1072
+ return `${imagesThenRest[1]}${(imagesThenRest[2] ?? "").trim()} ${text}`;
1073
+ }
1074
+ }
1020
1075
  return line;
1021
1076
  }
1022
1077
  function mapOutsideCode(line, fn) {
@@ -1191,7 +1246,6 @@ function fixRunsOfSize(line, size) {
1191
1246
  let match;
1192
1247
  while (match = re.exec(masked)) {
1193
1248
  if (match[0].length !== size) {
1194
- if (match[0].length >= 3) return line;
1195
1249
  continue;
1196
1250
  }
1197
1251
  if (match.index > 0 && masked[match.index - 1] === "\\") continue;
@@ -4,15 +4,15 @@ import {
4
4
  requestIdFromArgv,
5
5
  runWithRequestId,
6
6
  tryForwardToDaemon
7
- } from "./chunk-CHGKDZV6.js";
7
+ } from "./chunk-WCY3EKJQ.js";
8
8
  import {
9
9
  localCommandExecution,
10
10
  requestContext
11
- } from "./chunk-6D3QLMRM.js";
11
+ } from "./chunk-TOGYWN3D.js";
12
12
 
13
13
  // src/requests/execute.ts
14
14
  async function runCapturedInProcess(argv, onFatalError) {
15
- const { runCli } = await import("./runCli-ZJ7WYHJ7.js");
15
+ const { runCli } = await import("./runCli-GKTCIDBF.js");
16
16
  const context = {
17
17
  stdout: [],
18
18
  stderr: [],