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.
- package/README.md +87 -6
- package/bin/bilisum.js +372 -172
- package/lib/api.js +174 -0
- package/lib/args.js +127 -0
- package/lib/output.js +115 -0
- package/lib/runtime.js +134 -0
- package/lib/server.js +376 -0
- package/lib/token.js +63 -0
- package/package.json +39 -40
- package/runtime/VERSION +0 -1
- package/runtime/apps/service/pyproject.toml +0 -29
- package/runtime/apps/service/src/video_sum_service/__init__.py +0 -1
- package/runtime/apps/service/src/video_sum_service/__main__.py +0 -5
- package/runtime/apps/service/src/video_sum_service/app.py +0 -480
- package/runtime/apps/service/src/video_sum_service/context.py +0 -24
- package/runtime/apps/service/src/video_sum_service/integrations.py +0 -264
- package/runtime/apps/service/src/video_sum_service/knowledge/__init__.py +0 -5
- package/runtime/apps/service/src/video_sum_service/knowledge/index_service.py +0 -408
- package/runtime/apps/service/src/video_sum_service/knowledge/local_llm.py +0 -319
- package/runtime/apps/service/src/video_sum_service/knowledge/rag_service.py +0 -492
- package/runtime/apps/service/src/video_sum_service/knowledge/tag_service.py +0 -242
- package/runtime/apps/service/src/video_sum_service/main.py +0 -31
- package/runtime/apps/service/src/video_sum_service/repository.py +0 -942
- package/runtime/apps/service/src/video_sum_service/routers/__init__.py +0 -1
- package/runtime/apps/service/src/video_sum_service/routers/knowledge.py +0 -272
- package/runtime/apps/service/src/video_sum_service/routers/system.py +0 -280
- package/runtime/apps/service/src/video_sum_service/routers/tasks.py +0 -287
- package/runtime/apps/service/src/video_sum_service/routers/videos.py +0 -766
- package/runtime/apps/service/src/video_sum_service/runtime_support.py +0 -1007
- package/runtime/apps/service/src/video_sum_service/schemas.py +0 -418
- package/runtime/apps/service/src/video_sum_service/settings_manager.py +0 -130
- package/runtime/apps/service/src/video_sum_service/task_artifacts.py +0 -102
- package/runtime/apps/service/src/video_sum_service/task_exports.py +0 -108
- package/runtime/apps/service/src/video_sum_service/transcribe_worker.py +0 -9
- package/runtime/apps/service/src/video_sum_service/video_assets.py +0 -623
- package/runtime/apps/service/src/video_sum_service/worker.py +0 -381
- package/runtime/apps/web/static/apple-touch-icon.png +0 -0
- package/runtime/apps/web/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/runtime/apps/web/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/runtime/apps/web/static/assets/icons/icon-180.png +0 -0
- package/runtime/apps/web/static/assets/icons/icon-512.png +0 -0
- package/runtime/apps/web/static/assets/icons/icon.svg +0 -17
- package/runtime/apps/web/static/assets/index-Cj5PVjQg.js +0 -388
- package/runtime/apps/web/static/assets/index-DU2t4_7s.css +0 -1
- package/runtime/apps/web/static/favicon-32x32.png +0 -0
- package/runtime/apps/web/static/favicon.ico +0 -0
- package/runtime/apps/web/static/favicon.svg +0 -17
- package/runtime/apps/web/static/index.html +0 -19
- package/runtime/apps/web/static/js/api.js +0 -123
- package/runtime/apps/web/static/js/main.js +0 -932
- package/runtime/apps/web/static/js/state.js +0 -28
- package/runtime/apps/web/static/js/utils.js +0 -81
- package/runtime/apps/web/static/js/views/home.js +0 -604
- package/runtime/apps/web/static/js/views/settings.js +0 -477
- package/runtime/apps/web/static/styles.css +0 -2206
- package/runtime/packages/core/pyproject.toml +0 -18
- package/runtime/packages/core/src/video_sum_core/__init__.py +0 -1
- package/runtime/packages/core/src/video_sum_core/errors.py +0 -22
- package/runtime/packages/core/src/video_sum_core/markdown_exports.py +0 -154
- package/runtime/packages/core/src/video_sum_core/models/__init__.py +0 -1
- package/runtime/packages/core/src/video_sum_core/models/tasks.py +0 -70
- package/runtime/packages/core/src/video_sum_core/pipeline/__init__.py +0 -1
- package/runtime/packages/core/src/video_sum_core/pipeline/base.py +0 -46
- package/runtime/packages/core/src/video_sum_core/pipeline/real.py +0 -3467
- package/runtime/packages/core/src/video_sum_core/transcribe_subprocess.py +0 -173
- package/runtime/packages/core/src/video_sum_core/utils.py +0 -127
- package/runtime/packages/infra/pyproject.toml +0 -16
- package/runtime/packages/infra/src/video_sum_infra/__init__.py +0 -1
- package/runtime/packages/infra/src/video_sum_infra/app.py +0 -39
- package/runtime/packages/infra/src/video_sum_infra/config.py +0 -393
- package/runtime/packages/infra/src/video_sum_infra/db.py +0 -34
- package/runtime/packages/infra/src/video_sum_infra/logging.py +0 -54
- package/runtime/packages/infra/src/video_sum_infra/paths.py +0 -6
- 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`
|
|
3
|
+
`bilisum` 是 BiliSum 的命令行控制面:**直接控制已安装的 BiliSum(桌面端 / 已运行的服务)**,让 Agent / 脚本做视频理解(转写 + 摘要),不打开浏览器、不复用任何独立环境。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
+
```
|