bilisum 1.13.3 → 1.20.0-alpha.1

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 (131) hide show
  1. package/README.md +87 -6
  2. package/bin/bilisum.js +372 -172
  3. package/lib/api.js +174 -0
  4. package/lib/args.js +127 -0
  5. package/lib/output.js +115 -0
  6. package/lib/runtime.js +134 -0
  7. package/lib/server.js +376 -0
  8. package/lib/token.js +63 -0
  9. package/package.json +39 -40
  10. package/runtime/VERSION +0 -1
  11. package/runtime/apps/service/pyproject.toml +0 -29
  12. package/runtime/apps/service/src/video_sum_service/__init__.py +0 -1
  13. package/runtime/apps/service/src/video_sum_service/__main__.py +0 -5
  14. package/runtime/apps/service/src/video_sum_service/app.py +0 -480
  15. package/runtime/apps/service/src/video_sum_service/context.py +0 -24
  16. package/runtime/apps/service/src/video_sum_service/integrations.py +0 -264
  17. package/runtime/apps/service/src/video_sum_service/knowledge/__init__.py +0 -5
  18. package/runtime/apps/service/src/video_sum_service/knowledge/index_service.py +0 -408
  19. package/runtime/apps/service/src/video_sum_service/knowledge/local_llm.py +0 -319
  20. package/runtime/apps/service/src/video_sum_service/knowledge/rag_service.py +0 -492
  21. package/runtime/apps/service/src/video_sum_service/knowledge/tag_service.py +0 -242
  22. package/runtime/apps/service/src/video_sum_service/main.py +0 -31
  23. package/runtime/apps/service/src/video_sum_service/repository.py +0 -942
  24. package/runtime/apps/service/src/video_sum_service/routers/__init__.py +0 -1
  25. package/runtime/apps/service/src/video_sum_service/routers/knowledge.py +0 -272
  26. package/runtime/apps/service/src/video_sum_service/routers/system.py +0 -280
  27. package/runtime/apps/service/src/video_sum_service/routers/tasks.py +0 -287
  28. package/runtime/apps/service/src/video_sum_service/routers/videos.py +0 -766
  29. package/runtime/apps/service/src/video_sum_service/runtime_support.py +0 -1007
  30. package/runtime/apps/service/src/video_sum_service/schemas.py +0 -418
  31. package/runtime/apps/service/src/video_sum_service/settings_manager.py +0 -130
  32. package/runtime/apps/service/src/video_sum_service/task_artifacts.py +0 -102
  33. package/runtime/apps/service/src/video_sum_service/task_exports.py +0 -108
  34. package/runtime/apps/service/src/video_sum_service/transcribe_worker.py +0 -9
  35. package/runtime/apps/service/src/video_sum_service/video_assets.py +0 -623
  36. package/runtime/apps/service/src/video_sum_service/worker.py +0 -381
  37. package/runtime/apps/web/static/apple-touch-icon.png +0 -0
  38. package/runtime/apps/web/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  39. package/runtime/apps/web/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  40. package/runtime/apps/web/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  41. package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  42. package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  43. package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  44. package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  45. package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  46. package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  47. package/runtime/apps/web/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  48. package/runtime/apps/web/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  49. package/runtime/apps/web/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  50. package/runtime/apps/web/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  51. package/runtime/apps/web/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  52. package/runtime/apps/web/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  53. package/runtime/apps/web/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  54. package/runtime/apps/web/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  55. package/runtime/apps/web/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  56. package/runtime/apps/web/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  57. package/runtime/apps/web/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  58. package/runtime/apps/web/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  59. package/runtime/apps/web/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  60. package/runtime/apps/web/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  61. package/runtime/apps/web/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  62. package/runtime/apps/web/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  63. package/runtime/apps/web/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  64. package/runtime/apps/web/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  65. package/runtime/apps/web/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  66. package/runtime/apps/web/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  67. package/runtime/apps/web/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  68. package/runtime/apps/web/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  69. package/runtime/apps/web/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  70. package/runtime/apps/web/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  71. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  72. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  73. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  74. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  75. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  76. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  77. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  78. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  79. package/runtime/apps/web/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  80. package/runtime/apps/web/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  81. package/runtime/apps/web/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  82. package/runtime/apps/web/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  83. package/runtime/apps/web/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  84. package/runtime/apps/web/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  85. package/runtime/apps/web/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  86. package/runtime/apps/web/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  87. package/runtime/apps/web/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  88. package/runtime/apps/web/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  89. package/runtime/apps/web/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  90. package/runtime/apps/web/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  91. package/runtime/apps/web/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  92. package/runtime/apps/web/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  93. package/runtime/apps/web/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  94. package/runtime/apps/web/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  95. package/runtime/apps/web/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  96. package/runtime/apps/web/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  97. package/runtime/apps/web/static/assets/icons/icon-180.png +0 -0
  98. package/runtime/apps/web/static/assets/icons/icon-512.png +0 -0
  99. package/runtime/apps/web/static/assets/icons/icon.svg +0 -17
  100. package/runtime/apps/web/static/assets/index-Cj5PVjQg.js +0 -388
  101. package/runtime/apps/web/static/assets/index-DU2t4_7s.css +0 -1
  102. package/runtime/apps/web/static/favicon-32x32.png +0 -0
  103. package/runtime/apps/web/static/favicon.ico +0 -0
  104. package/runtime/apps/web/static/favicon.svg +0 -17
  105. package/runtime/apps/web/static/index.html +0 -19
  106. package/runtime/apps/web/static/js/api.js +0 -123
  107. package/runtime/apps/web/static/js/main.js +0 -932
  108. package/runtime/apps/web/static/js/state.js +0 -28
  109. package/runtime/apps/web/static/js/utils.js +0 -81
  110. package/runtime/apps/web/static/js/views/home.js +0 -604
  111. package/runtime/apps/web/static/js/views/settings.js +0 -477
  112. package/runtime/apps/web/static/styles.css +0 -2206
  113. package/runtime/packages/core/pyproject.toml +0 -18
  114. package/runtime/packages/core/src/video_sum_core/__init__.py +0 -1
  115. package/runtime/packages/core/src/video_sum_core/errors.py +0 -22
  116. package/runtime/packages/core/src/video_sum_core/markdown_exports.py +0 -154
  117. package/runtime/packages/core/src/video_sum_core/models/__init__.py +0 -1
  118. package/runtime/packages/core/src/video_sum_core/models/tasks.py +0 -70
  119. package/runtime/packages/core/src/video_sum_core/pipeline/__init__.py +0 -1
  120. package/runtime/packages/core/src/video_sum_core/pipeline/base.py +0 -46
  121. package/runtime/packages/core/src/video_sum_core/pipeline/real.py +0 -3467
  122. package/runtime/packages/core/src/video_sum_core/transcribe_subprocess.py +0 -173
  123. package/runtime/packages/core/src/video_sum_core/utils.py +0 -127
  124. package/runtime/packages/infra/pyproject.toml +0 -16
  125. package/runtime/packages/infra/src/video_sum_infra/__init__.py +0 -1
  126. package/runtime/packages/infra/src/video_sum_infra/app.py +0 -39
  127. package/runtime/packages/infra/src/video_sum_infra/config.py +0 -393
  128. package/runtime/packages/infra/src/video_sum_infra/db.py +0 -34
  129. package/runtime/packages/infra/src/video_sum_infra/logging.py +0 -54
  130. package/runtime/packages/infra/src/video_sum_infra/paths.py +0 -6
  131. package/runtime/packages/infra/src/video_sum_infra/runtime.py +0 -485
package/README.md CHANGED
@@ -1,11 +1,92 @@
1
- # BiliSum
1
+ # BiliSum CLI
2
2
 
3
- `bilisum` starts the local BiliSum browser service from npx.
3
+ `bilisum` BiliSum 的命令行控制面:**直接控制已安装的 BiliSum(桌面端 / 已运行的服务)**,让 Agent / 脚本做视频理解(转写 + 摘要),不打开浏览器、不复用任何独立环境。
4
4
 
5
5
  ```bash
6
- npx bilisum
7
- npx bilisum start --port 3839
8
- npx bilisum doctor
6
+ # 摘要一个视频(默认输出:元数据 + 总结内容,不含字幕)
7
+ bilisum summarize "https://www.bilibili.com/video/BV1xxxx"
8
+
9
+ # 输出 JSON 给 Agent 解析(stdout 只含 JSON,进度在 stderr)
10
+ bilisum summarize "https://www.bilibili.com/video/BV1xxxx" --format json
11
+
12
+ # 总结 + 追加转写全文 / 只要转写
13
+ bilisum summarize "https://www.bilibili.com/video/BV1xxxx" --with-transcript
14
+ bilisum transcribe ./demo.mp4 --output transcript.txt
15
+
16
+ # 多 P / 异步
17
+ bilisum summarize "https://www.bilibili.com/video/BV1xxxx" --page 2
18
+ bilisum summarize "https://www.bilibili.com/video/BV1xxxx" --all-pages --no-wait
19
+
20
+ # 任务管理
21
+ bilisum status <task-id> --json
22
+ bilisum tasks --limit 10
23
+
24
+ # 帮助(无参数执行也会显示 help,不会自动启动服务)
25
+ bilisum --help
26
+ bilisum summarize --help
27
+ ```
28
+
29
+ ## 输出格式
30
+
31
+ - **`markdown`(默认)**:YAML 元数据头(task_id / status / title / video_id / source)+ 总结内容(知识笔记或概览+要点),**不含字幕**;加 `--with-transcript` 会追加转写全文。
32
+ - **`json`**:完整任务对象(含 `result`,字幕在 `result.transcript_text`)。
33
+ - **`transcript`**:仅转写全文(`bilisum transcribe` 的默认输出)。
34
+
35
+ ## 它如何"控制现有程序"
36
+
37
+ - 默认连接桌面端服务 `http://127.0.0.1:3838`,任务、结果、知识库都与桌面端**同一个数据库**。
38
+ - 访问令牌自动获取:`--token` → `VIDEO_SUM_ACCESS_TOKEN` → 桌面端自己的 token 文件(`%APPDATA%\BiliSum\access-token.json` 等)→ 服务侧 `{数据根}\data\auth.json`。桌面端正在运行时通常无需任何配置。
39
+ - 数据根默认与桌面端一致(Windows `%LOCALAPPDATA%\bilisum`,macOS `~/Library/Application Support/bilisum`),可用 `--data` / `BILISUM_DATA_ROOT` 覆盖。
40
+ - 配置(LLM / ASR Key 等)跟随服务端设置,桌面端里配好了,CLI 直接用。
41
+
42
+ ## 服务不在线时
43
+
44
+ `summarize / transcribe / status / tasks` 会先探活;如果 `127.0.0.1:3838` 没有服务,就**用桌面端数据目录自动后台拉起一个**(优先用桌面端自带的托管 Python 运行时,其次系统 Python 3.12),等 `/health` 就绪后继续。CLI 拉起的服务进程记录在 `{数据根}\cli-runtime.json`:
45
+
46
+ ```bash
47
+ bilisum start --no-open # 前台启动(可选,一般不用)
48
+ bilisum stop # 停止 CLI 拉起的服务
9
49
  ```
10
50
 
11
- Python 3.12 is required. On first run, BiliSum creates a managed Python virtual environment under the user's local app data directory.
51
+ > 注意:桌面端自己运行的服务不受 `bilisum stop` 影响(没有 cli-runtime 记录时会提示)。
52
+
53
+ ## 安装
54
+
55
+ ```bash
56
+ npm install -g bilisum # 或 npx bilisum ...
57
+ ```
58
+
59
+ 包内**不包含 Python 运行时**(CLI 是纯客户端),首次使用要求机器上已有桌面版 BiliSum 或 Python 3.12。
60
+
61
+ ## 常用选项
62
+
63
+ | 选项 | 说明 |
64
+ |------|------|
65
+ | `--host / --port` | 服务地址(默认 `127.0.0.1:3838`) |
66
+ | `--data <path>` | 桌面端数据根(默认 `%LOCALAPPDATA%\bilisum`) |
67
+ | `--token <token>` | 访问令牌(默认自动读桌面端 token) |
68
+ | `--format json\|markdown\|transcript` | 输出格式,默认 markdown |
69
+ | `--output <path> / -o` | 结果写入文件 |
70
+ | `--with-transcript` | markdown 输出追加转写全文(默认不含字幕) |
71
+ | `--page <n> / --all-pages` | 多 P 视频分 P 选择 |
72
+ | `--visual-note <mode>` | `text` / `frame_insert` / `vlm_integrated` |
73
+ | `--no-wait` | 只创建任务,立即返回 task_id |
74
+ | `--timeout <sec>` | 等待完成超时(默认 3600) |
75
+ | `--quiet` | 抑制 stderr 进度输出 |
76
+
77
+ > 说明:任务转写与摘要在服务端一体执行;`transcribe` 输出转写全文,任务仍会顺带生成摘要。语言 / 摘要模式等参数跟随服务端设置。
78
+
79
+ ## 桌面端内置
80
+
81
+ 桌面版 BiliSum 打包时会把 CLI 一并放进安装目录的 `resources/cli`,可用:
82
+
83
+ ```bash
84
+ node "<安装目录>\resources\cli\bin\bilisum.js" summarize "https://..."
85
+ ```
86
+
87
+ ## 开发
88
+
89
+ ```bash
90
+ npm test --prefix packages/npx # node:test 单元测试
91
+ npm run npx:test # 版本 + 单测 + npm pack 校验(根目录)
92
+ ```