dsh-theone 0.0.0-stage → 0.3.12

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 (44) hide show
  1. package/README.md +139 -2
  2. package/README.zh.md +140 -0
  3. package/cordis.patch.yml +12 -0
  4. package/dist/catalog-types.d.ts +60 -0
  5. package/dist/catalog-types.js +1 -0
  6. package/dist/client-locales.d.ts +187 -0
  7. package/dist/client-locales.js +360 -0
  8. package/dist/client-navigation.d.ts +21 -0
  9. package/dist/client-navigation.js +41 -0
  10. package/dist/client.d.ts +8 -0
  11. package/dist/client.js +1512 -0
  12. package/dist/gateway-compaction.d.ts +29 -0
  13. package/dist/gateway-compaction.js +143 -0
  14. package/dist/history-catalog.d.ts +37 -0
  15. package/dist/history-catalog.js +257 -0
  16. package/dist/index.d.ts +179 -0
  17. package/dist/index.js +1491 -0
  18. package/dist/linkage.d.ts +49 -0
  19. package/dist/linkage.js +155 -0
  20. package/dist/llm-router.d.ts +77 -0
  21. package/dist/llm-router.js +176 -0
  22. package/dist/model-json.d.ts +4 -0
  23. package/dist/model-json.js +50 -0
  24. package/dist/router.d.ts +3 -0
  25. package/dist/router.js +52 -0
  26. package/dist/routing-policy.d.ts +17 -0
  27. package/dist/routing-policy.js +51 -0
  28. package/dist/run.d.ts +57 -0
  29. package/dist/run.js +232 -0
  30. package/dist/settings-types.d.ts +45 -0
  31. package/dist/settings-types.js +8 -0
  32. package/dist/settings.d.ts +6 -0
  33. package/dist/settings.js +40 -0
  34. package/dist/store.d.ts +145 -0
  35. package/dist/store.js +646 -0
  36. package/dist/types.d.ts +71 -0
  37. package/dist/types.js +1 -0
  38. package/dist/update.d.ts +55 -0
  39. package/dist/update.js +121 -0
  40. package/docs/plugin-v0.1.md +49 -0
  41. package/docs/plugin-v0.1.zh.md +53 -0
  42. package/docs/plugin-v0.2.md +36 -0
  43. package/docs/plugin-v0.2.zh.md +36 -0
  44. package/package.json +107 -4
package/README.md CHANGED
@@ -1,3 +1,140 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">TheOne</h1>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <p align="center"><b>One chat for everything you're working on.</b><br>It knows which project each message belongs to, and keeps every project's context separate.</p>
4
+
5
+ <p align="center">
6
+ <img alt="DSH 0.2.0-rc.2" src="https://img.shields.io/badge/DSH-0.2.0--rc.2-a75b1e">
7
+ <img alt="Node.js 24" src="https://img.shields.io/badge/Node.js-24-3c873a">
8
+ <img alt="English / 中文" src="https://img.shields.io/badge/UI-English%20%2F%20中文-4a7fb5">
9
+ </p>
10
+
11
+ <p align="center">English | <a href="./README.zh.md">简体中文</a></p>
12
+
13
+ <p align="center"><img src="docs/images/theone-film-preview.webp" alt="TheOne promo film: the One button turns into a 3D key that routes each message to its session" width="100%"></p>
14
+
15
+ ---
16
+
17
+ How many sessions are sitting in your DSH sidebar? Getting back to last week's work means digging through them. Skip creating a new one and everything piles into a single session, where topics bleed into each other and the details vanish at the next compaction.
18
+
19
+ **TheOne takes care of that.** You just talk in one main chat:
20
+
21
+ ```text
22
+ You: FP8 still crashes for Qwen on the 9070 XT
23
+ → Qwen / RX 9070 XT
24
+ You: also fill in the ablation table in chapter 3 of the paper
25
+ → Video Attention Thesis
26
+ You: and add the Qwen speed numbers from earlier
27
+ → Video Attention Thesis · reference: Qwen / RX 9070 XT
28
+ You: wrong topic, that was the GPU one
29
+ → Qwen / RX 9070 XT (the previous message is redone there, and remembered)
30
+ ```
31
+
32
+ <sub>Illustration. By default, a one-line notice appears only when the topic changes.</sub>
33
+
34
+ Each project gets its own background session that reasons, runs tools and compacts on its own. What you see is always one ordinary conversation.
35
+
36
+ ## Why try it
37
+
38
+ | | Usual workflow | With TheOne |
39
+ | --- | --- | --- |
40
+ | Start something new | Create a session, name it | Just say it |
41
+ | Go back to earlier work | Dig through the sidebar | Mention it; TheOne finds it |
42
+ | One session gets cluttered | Topics interfere; compaction drops details | Every project has its own context |
43
+ | Two projects need each other | Copy and paste | The other project's progress comes along |
44
+ | Wrong project | Move it by hand | Say "wrong topic" |
45
+
46
+ - **Feels native.** Thinking streams in its usual place from the first token, and tool cards, approvals, questions, todo lists, retries and mid-reply steering all work as usual.
47
+ - **Related work connects; unrelated work stays out.** Related topics share progress automatically and TheOne learns which ones belong together from how you use them. A topic's constraints (say, "budget figures stay out of the paper") are attached verbatim every time, so compaction never drops them.
48
+ - **Gets better with use.** Say "wrong topic" or click **Move to…** in the directory, and similar messages go to the right place from then on.
49
+ - **Your old sessions become a topic directory.** After install it reads your existing sessions in the background, turns them into topics grouped into workspaces, and you pick up where you left off.
50
+ - **Nothing extra to configure.** No separate API key: routing and the background sessions use the model you chose in DSH. To switch, pick **TheOne · &lt;model&gt;** in main chat's model menu; it still routes through TheOne, with that model doing the work.
51
+
52
+ ![TheOne main chat and topic workspaces](https://raw.githubusercontent.com/YunongDai2005/dsh-theone/main/docs/images/theone-topic-workspaces-en.png)
53
+
54
+ ## Install in 30 seconds
55
+
56
+ 1. Configure an API in DSH and select a model that can chat.
57
+ 2. Open **Plugins → Add plugin**, paste `https://github.com/YunongDai2005/dsh-theone`, and install.
58
+ 3. Click **TheOne · Main chat** in the sidebar and start talking.
59
+
60
+ From the command line: `dsh plugin --profile web add github:YunongDai2005/dsh-theone --ignore-scripts`. Works with DSH `0.2.0-rc.2` and Node.js 24; the interface follows DSH's language (English / Simplified Chinese).
61
+
62
+ > Unofficial community project, maintained independently. It is not affiliated with or endorsed by DeepSeek.
63
+
64
+ ## How it works
65
+
66
+ **Choosing a topic.** Each message is matched to the current topic, an earlier one, or a new one. By default the model you selected makes one short classification (thinking off, at most 2,048 tokens), with candidates recalled through DSH full-text search.
67
+
68
+ - With no credible match it starts a new topic instead of asking whether it is new. It only asks when you refer to an earlier chat it cannot find, or it truly cannot tell which one you mean.
69
+ - When one message draws on several topics, the one doing the work gets it and the others come along as reference.
70
+ - "ok" or "go on" continues the current topic without waiting for a decision, and so does a picture or file sent without words.
71
+ - If the classification call fails, rules decide, staying in the current topic when unsure. Rule-based routing (`THEONE_ROUTER_MODE=rules`) makes no model calls at all.
72
+
73
+ **Linking topics.** A background session starting work receives a reference briefing, and none when there is nothing new:
74
+
75
+ - right after a topic switch, the last few turns of main chat, so "use what we just said" carries over;
76
+ - what changed in related topics since it last heard: their latest compaction summary (dated) and the progress after it;
77
+ - each topic's constraints, verbatim, every time.
78
+
79
+ The briefing is marked as reference, not instructions. For details, the background session can use `theone_read_topic` and `theone_search_history`. Linking scope is **Learn automatically** (default), **Same workspace only** or **Off**. In the directory you can link or unlink topics and mark a topic **Do not share**; your choices always win.
80
+
81
+ **Topic directory.** Each topic card shows its latest progress and constraints. Under **Manage** you can rename, edit the summary and constraints, move to another workspace, merge, delete, or attach an existing DSH session as searchable history; **+ New topic** starts one by hand. **Recent topic routing** lists where each message went, why, with which model and how long it took. With a long history, the first pass takes some time and API quota; set `THEONE_HISTORY_CATALOG=false` to turn it off.
82
+
83
+ <details>
84
+ <summary><b>Settings</b></summary>
85
+
86
+ Right-click the TheOne button in the sidebar and choose **Settings**. Changes apply when saved; only the history catalog settings wait for a DSH restart.
87
+
88
+ | Setting | What it does |
89
+ | --- | --- |
90
+ | Topic notices | How main chat shows topic changes: hidden, one line only when the topic changes (default), or on every message with the reason |
91
+ | Linking scope | Learn automatically (default), same workspace only, or off |
92
+ | Model | Follow DSH (default) or pin the background model from any model configured in DSH; a pinned model takes precedence over main chat's selector |
93
+ | Routing | LLM decision (default) or rule-based |
94
+ | History catalog | On/off and rescan interval |
95
+ | Limits | Topic descriptor length; reply length per background step, thinking included |
96
+ | Manual catalog file | Optional JSON file of hand-written topics, imported when saved |
97
+
98
+ The database location and entry identifier switch TheOne to different data, so they are set only through environment variables: `THEONE_DATABASE_PATH` and `THEONE_GATEWAY_KEY`. Also optional: `THEONE_CONTEXTS_PATH` and `THEONE_WORKER_PROVIDER` / `THEONE_WORKER_MODEL` (set both).
99
+ </details>
100
+
101
+ <details>
102
+ <summary><b>Data and privacy</b></summary>
103
+
104
+ - DSH keeps the original conversations and tool results; TheOne keeps only its catalog, summaries, links and routing records in its own SQLite database (`$DSH_HOME/theone/contexts.db`, `~/.dsh/theone/` by default).
105
+ - Text sent to the router or written into briefings has API keys, passwords and similar secrets removed.
106
+ - A topic marked **Do not share** never appears in other topics' briefings, recent-chat excerpts or lookups.
107
+ - When main chat grows long, DSH compacts it through TheOne: frequently used topics keep longer summaries and their latest turns, rarely used ones keep a short status. This makes no model call.
108
+ - When a new version is out, an **Update** button appears on the right of the TheOne entry in the sidebar: one click installs it through DSH's plugin manager and reloads TheOne in place, without restarting DSH (a DSH without plugin hot reload applies it at the next restart). Your topics stay in the database.
109
+ </details>
110
+
111
+ <details>
112
+ <summary><b>Known limitations</b></summary>
113
+
114
+ - One request runs at a time; messages queued during a reply wait for it to finish.
115
+ - New topics write files under `~/.dsh/theone/gateway`; you cannot yet choose a project folder for a new topic.
116
+ - Main chat stores copies of tool calls, so its log grows with use; entry-log rotation is not implemented yet.
117
+ - The main chat is remembered per browser: another browser or the desktop app gets its own main chat, sharing the same topics. Only one DSH process should use a database at a time.
118
+ - Image output is not forwarded yet; there is no vector search; topics cannot be split yet.
119
+ - Main chat shows tool cards without running them because TheOne sits first in DSH's tool pipeline. If another plugin also places itself first, it may see these mirrored calls, but no tool runs twice.
120
+ </details>
121
+
122
+ <details>
123
+ <summary><b>Development</b></summary>
124
+
125
+ ```sh
126
+ git clone https://github.com/YunongDai2005/dsh-theone.git
127
+ cd dsh-theone
128
+ npm ci --ignore-scripts
129
+ npm run typecheck
130
+ npm test
131
+ ```
132
+
133
+ Tests use the real DSH runtime (AgentLoop, Session, SQLite, JSONL persistence, compaction) with a simulated model, and call no external API. `npm run pack:plugin` builds the install package; `npm run install:local` and `npm run start:local` run a separate DSH profile in `~/.dsh-theone`.
134
+
135
+ Service API: `ctx.theone.searchHistoryDetailed(contextId, query, limit)` searches a topic's reviewed history; `store.addSource(contextId, sessionId, { startSeq, endSeq })` attaches part of a session. Earlier acceptance records: [v0.1](./docs/plugin-v0.1.md) and [v0.2](./docs/plugin-v0.2.md).
136
+ </details>
137
+
138
+ ---
139
+
140
+ <p align="center">If TheOne helps, a ⭐ helps others find it. Questions or ideas? <a href="https://github.com/YunongDai2005/dsh-theone/issues">Open an issue</a>.</p>
package/README.zh.md ADDED
@@ -0,0 +1,140 @@
1
+ <h1 align="center">TheOne</h1>
2
+
3
+ <p align="center"><b>只开一个对话框,聊你所有的事。</b><br>它自己分清每句话属于哪件事,每件事的上下文互不干扰。</p>
4
+
5
+ <p align="center">
6
+ <img alt="DSH 0.2.0-rc.2" src="https://img.shields.io/badge/DSH-0.2.0--rc.2-a75b1e">
7
+ <img alt="Node.js 24" src="https://img.shields.io/badge/Node.js-24-3c873a">
8
+ <img alt="中文 / English" src="https://img.shields.io/badge/界面-中文%20%2F%20English-4a7fb5">
9
+ </p>
10
+
11
+ <p align="center"><a href="./README.md">English</a> | 简体中文</p>
12
+
13
+ <p align="center"><img src="docs/images/theone-film-preview.webp" alt="TheOne 宣传片:One 按钮化作 3D 钥匙,把每条消息路由到对应的会话" width="100%"></p>
14
+
15
+ ---
16
+
17
+ 你的 DSH 侧边栏里是不是躺着几十个会话?想回到上周那件事,得一个个翻;懒得新建,就在一个会话里什么都聊,结果上下文越聊越乱,压缩一次细节就没了。
18
+
19
+ **TheOne 把这些都交给它。** 你只管在一个主聊天里说话:
20
+
21
+ ```text
22
+ 你:Qwen 在 9070 XT 上跑 FP8 还是报错
23
+ → Qwen / RX 9070 XT
24
+ 你:顺便把论文第三章的消融表补上
25
+ → 视频注意力论文
26
+ 你:把刚才 Qwen 的测速结果也放进去
27
+ → 视频注意力论文 · 参考:Qwen / RX 9070 XT
28
+ 你:分错了,是显卡那个的
29
+ → Qwen / RX 9070 XT (上一条交给它重新处理,以后也记住了)
30
+ ```
31
+
32
+ <sub>示意。默认只在切换话题时显示一行提示。</sub>
33
+
34
+ 每件事都有自己的后台会话,在里面推理、调用工具、压缩上下文;你看到的始终是一个普通的对话。
35
+
36
+ ## 为什么值得一试
37
+
38
+ | | 平时的用法 | 装了 TheOne |
39
+ | --- | --- | --- |
40
+ | 开始一件新事 | 新建会话、起名字 | 直接说 |
41
+ | 回到之前的事 | 在侧边栏里翻 | 直接提,它自己找回来 |
42
+ | 一个会话聊杂了 | 上下文互相干扰,压缩后丢细节 | 每件事一份独立上下文 |
43
+ | 两件事要结合 | 来回复制粘贴 | 自动把另一件事的进展带过来 |
44
+ | 分错了 | 手动挪 | 说一句「分错了」 |
45
+
46
+ - **和原生会话一模一样**:思考从第一个字起就在原位置,工具卡片、授权、提问、待办、重试、回答中途插话,全都照常。
47
+ - **相关的事会互通,无关的事互不打扰**:相关话题自动共享进展,并从你的使用中学习哪些话题有关联;话题的约束(比如「预算数字不能写进论文」)每次都原样带上,压缩不会把它丢掉。
48
+ - **越用越准**:说「分错了」或在目录里点「改到…」,TheOne 会记住,类似的消息以后直接分对。
49
+ - **旧会话自动变成话题目录**:装上后它会在后台读取你已有的会话,整理成话题并按工作区分组,直接接着聊。
50
+ - **零额外配置**:不用另填 API Key,路由和后台都用你在 DSH 里选好的模型。想换模型,在主聊天的模型菜单里选 **TheOne · 某个模型**,仍然由 TheOne 分配话题,干活的换成那个模型。
51
+
52
+ ![TheOne 主聊天与话题工作区](https://raw.githubusercontent.com/YunongDai2005/dsh-theone/main/docs/images/theone-topic-workspaces-en.png)
53
+
54
+ ## 30 秒装好
55
+
56
+ 1. 在 DSH 中配置好 API,选一个能正常聊天的模型。
57
+ 2. 打开 **插件 → 添加插件**,粘贴 `https://github.com/YunongDai2005/dsh-theone`,点击安装。
58
+ 3. 点击左侧 **TheOne · 主聊天**,开始说话。
59
+
60
+ 命令行安装:`dsh plugin --profile web add github:YunongDai2005/dsh-theone --ignore-scripts`。兼容 DSH `0.2.0-rc.2` 与 Node.js 24;界面跟随 DSH 的语言(简体中文 / English)。
61
+
62
+ > 非官方社区项目,由社区成员独立维护,与 DeepSeek 不存在隶属或背书关系。
63
+
64
+ ## 它是怎么工作的
65
+
66
+ **分配话题。** 每条消息先判断:接着当前话题、回到某个旧话题,还是开个新的。默认用你选的模型做一次简短分类(关闭深度思考,最多 2048 token),候选话题由 DSH 全文搜索召回。
67
+
68
+ - 没有匹配就直接开新话题,不会问你「是不是新话题」;只有你明确提到一段找不到的旧聊天,或者确实分不清是哪一件时才追问。
69
+ - 一句话同时用到几件事时,交给真正做事的那件,其余作为参考带上。
70
+ - 「好的」「继续」直接接着当前话题,不等判断;只发图片或文件也接着当前话题。
71
+ - 分类调用失败时改用规则判断,拿不准就留在当前话题。规则模式(`THEONE_ROUTER_MODE=rules`)完全不调用模型。
72
+
73
+ **话题联动。** 后台开始工作时会收到一份参考简报,没有新内容就不发:
74
+
75
+ - 刚切换话题时,附上主聊天最近几轮,「把刚才那个……」能接上;
76
+ - 相关话题自上次以来的变化:最近一次压缩摘要(注明截至时间)和之后的进展;
77
+ - 各话题的约束,原样附上,每次都带。
78
+
79
+ 简报标注为参考资料而非指令;需要细节时,后台可以用 `theone_read_topic`、`theone_search_history` 去查。联动范围可选「自动学习」(默认)、「仅同一工作区」或「关闭」。在目录里可以手动关联或解除关联、把话题标记为「不共享」,你的设置永远优先。
80
+
81
+ **话题目录。** 每个话题卡片显示最新进展和约束。点 **管理** 可以重命名、改摘要和约束、移到别的工作区、合并、删除,或把已有的 DSH 会话关联为可检索的历史;**+ 新话题** 手动新建。**最近的话题分配** 列出每条消息去了哪里、原因、所用模型和耗时。历史较多时,第一次整理需要一些时间和 API 额度;设置 `THEONE_HISTORY_CATALOG=false` 可关闭。
82
+
83
+ <details>
84
+ <summary><b>设置</b></summary>
85
+
86
+ 右键左侧的 TheOne 按钮,选择 **设置**。保存后立即生效,只有历史整理相关的设置需要重启 DSH。
87
+
88
+ | 设置 | 说明 |
89
+ | --- | --- |
90
+ | 话题提示 | 主聊天里怎样显示话题切换:隐藏、仅切换时显示一行(默认)、每条都显示并注明原因 |
91
+ | 联动范围 | 自动学习(默认)、仅同一工作区、关闭 |
92
+ | 模型 | 跟随 DSH(默认),或从 DSH 已配置的模型中固定后台模型;固定的设置优先于主聊天里的选择 |
93
+ | 路由方式 | LLM 判断(默认)或规则判断 |
94
+ | 历史整理 | 开关与补扫间隔 |
95
+ | 内容限制 | 话题资料长度;后台每一步回复的长度(含思考) |
96
+ | 人工话题目录文件 | 可选的 JSON 话题目录,保存时导入 |
97
+
98
+ 数据库位置和主入口标识会让 TheOne 换用另一份数据,只能用环境变量 `THEONE_DATABASE_PATH`、`THEONE_GATEWAY_KEY` 设置。另外可选:`THEONE_CONTEXTS_PATH`,以及须一起设置的 `THEONE_WORKER_PROVIDER` / `THEONE_WORKER_MODEL`。
99
+ </details>
100
+
101
+ <details>
102
+ <summary><b>数据与隐私</b></summary>
103
+
104
+ - 原始对话和工具结果由 DSH 保存;TheOne 只在自己的 SQLite 数据库(`$DSH_HOME/theone/contexts.db`,默认 `~/.dsh/theone/`)里保存目录、摘要、关联和路由记录。
105
+ - 发给路由和写进参考简报的内容会去掉 API Key、密码等敏感信息。
106
+ - 标记为「不共享」的话题,不会出现在其他话题的简报、最近对话和查阅结果里。
107
+ - 主聊天变长时,DSH 通过 TheOne 压缩它:常用话题保留较长摘要和最近几轮,不常用的只保留简短状态,不额外调用模型。
108
+ - 有新版本时,左侧 TheOne 入口右边会出现 **更新** 按钮,点一下由 DSH 的插件管理器安装,并就地重新加载 TheOne,不用重启 DSH(不支持插件热加载的 DSH 会在下次启动时生效);话题都保存在数据库里,不受影响。
109
+ </details>
110
+
111
+ <details>
112
+ <summary><b>已知限制</b></summary>
113
+
114
+ - 同一时间只处理一个请求;回答期间排队的消息要等本轮结束。
115
+ - 新话题的文件默认写在 `~/.dsh/theone/gateway`,暂时不能指定项目目录。
116
+ - 主聊天保存了工具调用的副本,长期使用记录会变大;入口日志轮换尚未实现。
117
+ - 主聊天身份按浏览器保存:换浏览器或桌面端会出现另一个主聊天,话题仍然共用。同一数据库同时只应由一个 DSH 进程使用。
118
+ - 图片输出尚未转发;没有向量检索;暂不支持拆分话题。
119
+ - 主聊天里的工具卡片只显示、不执行,这依赖 TheOne 位于 DSH 工具流程的最前面;其他插件也抢到最前面时可能看到这些镜像调用,但工具不会执行两次。
120
+ </details>
121
+
122
+ <details>
123
+ <summary><b>开发</b></summary>
124
+
125
+ ```sh
126
+ git clone https://github.com/YunongDai2005/dsh-theone.git
127
+ cd dsh-theone
128
+ npm ci --ignore-scripts
129
+ npm run typecheck
130
+ npm test
131
+ ```
132
+
133
+ 测试使用真实的 DSH 运行时(AgentLoop、Session、SQLite、JSONL 持久化、压缩),只模拟模型,不调用外部 API。`npm run pack:plugin` 生成安装包;`npm run install:local` 和 `npm run start:local` 会在 `~/.dsh-theone` 启动一个独立的 DSH profile。
134
+
135
+ 服务接口:`ctx.theone.searchHistoryDetailed(contextId, query, limit)` 检索话题的已审核历史;`store.addSource(contextId, sessionId, { startSeq, endSeq })` 关联会话的一部分。旧版本验收记录见 [v0.1](./docs/plugin-v0.1.zh.md) 和 [v0.2](./docs/plugin-v0.2.zh.md)。
136
+ </details>
137
+
138
+ ---
139
+
140
+ <p align="center">觉得有用的话,点个 ⭐ 让更多人看到。遇到问题或有想法,欢迎 <a href="https://github.com/YunongDai2005/dsh-theone/issues">提 Issue</a>。</p>
@@ -0,0 +1,12 @@
1
+ # Uses DSH configured models and credentials; no extra API key.
2
+ - insert:
3
+ - id: theone
4
+ name: dsh-theone
5
+ config:
6
+ historyCatalog: !!js process.env.THEONE_HISTORY_CATALOG !== 'false'
7
+ databasePath: !!js process.env.THEONE_DATABASE_PATH
8
+ contextsPath: !!js process.env.THEONE_CONTEXTS_PATH
9
+ gatewayKey: !!js process.env.THEONE_GATEWAY_KEY || 'default'
10
+ workerProvider: !!js process.env.THEONE_WORKER_PROVIDER
11
+ workerModel: !!js process.env.THEONE_WORKER_MODEL
12
+ routerMode: !!js process.env.THEONE_ROUTER_MODE || 'llm'
@@ -0,0 +1,60 @@
1
+ import type { ContextDescriptor } from './types.ts';
2
+ export interface TopicGroup {
3
+ id: string;
4
+ title: string;
5
+ summary: string;
6
+ contextIds: string[];
7
+ }
8
+ export interface CatalogContext extends ContextDescriptor {
9
+ workingSessionId: string;
10
+ sourceSessionIds: string[];
11
+ }
12
+ export interface CatalogStatus {
13
+ running: boolean;
14
+ scanned: number;
15
+ indexed: number;
16
+ skipped: number;
17
+ failed: number;
18
+ pending: number;
19
+ lastCompletedAt?: number;
20
+ searchUnavailable?: boolean;
21
+ }
22
+ export type LinkReasonName = 'manual' | 'workspace' | 'project' | 'entities' | 'learned' | 'request';
23
+ export interface TopicLinkView {
24
+ id: string;
25
+ title: string;
26
+ reasons: LinkReasonName[];
27
+ }
28
+ /** How topics share context: the scope setting and, per topic, its related topics and sharing flag. */
29
+ export interface LinkageSnapshot {
30
+ scope: 'off' | 'workspace' | 'auto';
31
+ topics: Record<string, {
32
+ private: boolean;
33
+ constraints?: string;
34
+ related: TopicLinkView[];
35
+ }>;
36
+ }
37
+ export interface CatalogSnapshot {
38
+ groups: TopicGroup[];
39
+ contexts: CatalogContext[];
40
+ status: CatalogStatus;
41
+ linkage?: LinkageSnapshot;
42
+ }
43
+ export interface HistoryPart {
44
+ seq: number;
45
+ endSeq: number;
46
+ text: string;
47
+ fingerprint: string;
48
+ }
49
+ export interface ExtractedTopic {
50
+ contextId: string | null;
51
+ title: string;
52
+ summary: string;
53
+ entities: string[];
54
+ keywords: string[];
55
+ lastState: string;
56
+ turns: number[];
57
+ groupId: string | null;
58
+ groupTitle: string | null;
59
+ groupSummary: string;
60
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,187 @@
1
+ export declare const zh: {
2
+ readonly 'gateway.title': "TheOne · 主聊天";
3
+ readonly 'gateway.label': "主聊天";
4
+ readonly 'gateway.subtitle': "从这里继续聊";
5
+ readonly 'gateway.opening': "正在打开 TheOne 主聊天…";
6
+ readonly 'gateway.error': "主聊天暂时无法打开,请检查 DSH 连接和 TheOne 插件状态。";
7
+ readonly retry: "重试";
8
+ readonly 'update.available': "更新";
9
+ readonly 'update.installing': "更新中…";
10
+ readonly 'update.restart': "重启生效";
11
+ readonly 'update.reloading': "正在重新加载…";
12
+ readonly 'update.reloadingHint': "TheOne 正在用新版本重新加载,DSH 不需要重启;完成后页面会自动刷新。";
13
+ readonly 'update.busy': "有回复正在进行,等它结束后再点更新。";
14
+ readonly 'update.failed': "更新失败";
15
+ readonly 'update.hint': "当前 {current},可更新到 {latest}。点击一键更新,不用重启 DSH。";
16
+ readonly 'update.manualHint': "当前 {current},最新 {latest}。这份插件不是从 GitHub 或 npm 安装的,请在「插件」页面重新安装。";
17
+ readonly 'update.restartHint': "已更新,重启 DSH 后生效。";
18
+ readonly 'update.failedHint': "更新没有完成({error})。点击重试,或在「插件」页面重新安装。";
19
+ readonly 'settings.title': "TheOne 设置";
20
+ readonly 'settings.menu': "设置";
21
+ readonly 'settings.subtitle': "查看当前生效的配置和各项用途。";
22
+ readonly 'settings.readOnly': "保存后立即生效;只有「自动整理历史」和「历史补扫间隔」需要重启 DSH。数据库位置和主入口标识只能通过环境变量修改,见各项说明。";
23
+ readonly 'settings.save': "保存设置";
24
+ readonly 'settings.saving': "正在保存…";
25
+ readonly 'settings.saved': "已保存。";
26
+ readonly 'settings.restart': "已保存。历史整理的设置在重启 DSH 后生效,其余已生效。";
27
+ readonly 'settings.unsaved': "有未保存的更改";
28
+ readonly 'settings.reset': "撤销修改";
29
+ readonly 'settings.saveError': "保存失败,请检查输入和 DSH 连接后重试。";
30
+ readonly 'settings.conflict': "配置已被其他页面修改,请重新读取后再保存。";
31
+ readonly 'settings.contextsUnreadable': "无法读取这个话题目录文件,请检查路径和 JSON 格式。";
32
+ readonly 'settings.reload': "重新读取配置";
33
+ readonly 'settings.llm': "LLM 智能判断";
34
+ readonly 'settings.rules': "规则判断";
35
+ readonly 'settings.loading': "正在读取配置…";
36
+ readonly 'settings.error': "暂时无法读取配置,请检查 DSH 连接。";
37
+ readonly 'settings.back': "回到主聊天";
38
+ readonly 'settings.follow': "跟随 DSH";
39
+ readonly 'settings.none': "未设置";
40
+ readonly 'settings.on': "开启";
41
+ readonly 'settings.off': "关闭";
42
+ readonly 'settings.seconds': "{count} 秒";
43
+ readonly 'settings.model': "当前使用模型";
44
+ readonly 'settings.capacity': "上下文容量";
45
+ readonly 'settings.output': "默认输出额度";
46
+ readonly 'settings.modelUnavailable': "模型信息暂时不可用,请检查 DSH 模型配置。";
47
+ readonly 'settings.inherited': "语言、主题、API 凭据和压缩触发阈值由 DSH 管理。入口容量跟随模型;鼠标光晕白天橙色、夜间淡蓝色。";
48
+ readonly 'settings.compression': "压缩保留规则:当前和近期高频话题保留更多细节;30 天未使用的话题保留短摘要。原始聊天继续保存在 DSH。这些规则目前不可单独调整。";
49
+ readonly 'settings.models': "模型与路由";
50
+ readonly 'settings.history': "历史整理";
51
+ readonly 'settings.limits': "内容限制";
52
+ readonly 'settings.linkage': "话题联动";
53
+ readonly 'settings.linkScope': "联动范围";
54
+ readonly 'settings.help.linkScope': "相关话题之间共享进展的范围:关闭、仅同一话题工作区,或根据使用情况自动学习。手动关联和“不共享”始终优先。";
55
+ readonly 'settings.routeNotice': "话题提示";
56
+ readonly 'settings.help.routeNotice': "主聊天里显示话题切换的方式:隐藏、仅切换话题时显示一行,或每条消息都显示。";
57
+ readonly 'settings.scope.off': "关闭";
58
+ readonly 'settings.scope.workspace': "仅同一工作区";
59
+ readonly 'settings.scope.auto': "自动学习";
60
+ readonly 'settings.notice.hidden': "隐藏";
61
+ readonly 'settings.notice.switch': "仅切换时显示";
62
+ readonly 'settings.notice.all': "全部显示";
63
+ readonly 'settings.storage': "数据与入口";
64
+ readonly 'settings.workerProvider': "固定模型服务商";
65
+ readonly 'settings.workerModel': "固定模型名称";
66
+ readonly 'settings.routerMode': "路由判断方式";
67
+ readonly 'settings.historyCatalog': "自动整理历史";
68
+ readonly 'settings.catalogIntervalMs': "历史补扫间隔";
69
+ readonly 'settings.maxDescriptorChars': "话题摘要长度上限";
70
+ readonly 'settings.maxResponseChars': "单步回复长度上限";
71
+ readonly 'settings.databasePath': "话题目录数据库位置";
72
+ readonly 'settings.contextsPath': "人工话题目录文件";
73
+ readonly 'settings.gatewayKey': "主入口标识";
74
+ readonly 'settings.help.workerProvider': "选择服务商后可固定后台模型;留空时跟随主聊天和 DSH 的选择。列表包含 DSH 中配置的全部模型。";
75
+ readonly 'settings.help.workerModel': "固定路由、工作会话及入口容量所使用的模型。";
76
+ readonly 'settings.help.routerMode': "llm 使用模型判断话题;rules 使用规则判断。";
77
+ readonly 'settings.help.historyCatalog': "从已有会话提取话题目录,并自动分组。关闭后已有目录仍保留。";
78
+ readonly 'settings.help.catalogIntervalMs': "定期检查历史变化的间隔,最少 10 秒。";
79
+ readonly 'settings.help.maxDescriptorChars': "挂载到工作会话的话题说明字符上限,最少 128。";
80
+ readonly 'settings.help.maxResponseChars': "后台每一步回复(含思考)的字符上限,最少 128;多步任务不按总长度计算。";
81
+ readonly 'settings.help.databasePath': "保存目录、分组、关联与路由记录;原始聊天由 DSH 保存。改动会让 TheOne 换用另一份数据,因此不在这里修改:如需更换,用环境变量 THEONE_DATABASE_PATH 指定并重启 DSH。";
82
+ readonly 'settings.help.contextsPath': "可选 JSON 文件,用于导入人工准备的话题目录。保存时读取并导入;已导入的话题不会因清空此项而删除。";
83
+ readonly 'settings.help.gatewayKey': "区分不同的主聊天入口状态(当前话题、路由记录、设置)。改动相当于换一个新的入口,因此只能用环境变量 THEONE_GATEWAY_KEY 修改,通常保留 default。";
84
+ readonly 'catalog.title': "话题工作区";
85
+ readonly 'catalog.subtitle': "相关的事情放在一起,随时回到主聊天继续。";
86
+ readonly 'catalog.refresh': "整理历史";
87
+ readonly 'link.label': "关联:";
88
+ readonly 'link.none': "暂无关联话题";
89
+ readonly 'link.add': "+ 关联话题";
90
+ readonly 'link.remove': "解除关联(以后不再自动关联)";
91
+ readonly 'link.private': "不共享";
92
+ readonly 'link.privateHint': "这个话题的内容不会作为参考提供给其他话题";
93
+ readonly 'link.clearLearned': "清空学到的关联";
94
+ readonly 'link.clearLearnedHint': "忘记自动学到的关联,保留你手动设置的关联和解除";
95
+ readonly 'link.off': "话题联动已关闭,可在 TheOne 设置中开启。";
96
+ readonly 'link.error': "关联设置未能保存,请重试。";
97
+ readonly 'link.reason.manual': "手动关联";
98
+ readonly 'link.reason.workspace': "同一话题工作区";
99
+ readonly 'link.reason.project': "同一项目目录";
100
+ readonly 'link.reason.entities': "涉及相同的事物";
101
+ readonly 'link.reason.learned': "经常一起使用";
102
+ readonly 'link.reason.request': "同时被提到";
103
+ readonly 'catalog.reading': "正在读取话题…";
104
+ readonly 'catalog.counts': "{topics} 个话题 · {groups} 个分组";
105
+ readonly 'catalog.indexing': "正在整理历史…";
106
+ readonly 'catalog.pending': "还有 {count} 个会话待整理";
107
+ readonly 'catalog.updated': "历史目录已更新";
108
+ readonly 'catalog.failed': "{count} 个会话暂时未能整理,稍后会重试。已有话题仍可查看。";
109
+ readonly 'catalog.searchUnavailable': "部分历史暂时无法检索,仍可从话题目录继续聊天。";
110
+ readonly 'catalog.loadError': "暂时无法读取话题,请检查 DSH 连接。";
111
+ readonly 'catalog.continueError': "暂时无法继续这个话题,请等当前聊天结束后重试。";
112
+ readonly 'catalog.refreshError': "暂时无法整理历史,请检查 DSH 模型配置。";
113
+ readonly 'catalog.emptyIndexing': "正在从以前的聊天中整理话题。你也可以先回到主聊天。";
114
+ readonly 'catalog.empty': "目前还没有整理出话题。开始聊天后,它们会自动出现在这里。";
115
+ readonly 'catalog.unassigned': "待整理";
116
+ readonly 'catalog.unassignedSummary': "这些话题还在等待自动归类。";
117
+ readonly 'topic.opening': "正在打开…";
118
+ readonly 'topic.continue': "继续聊天";
119
+ readonly 'topic.source': "查看原会话";
120
+ readonly 'topic.state': "进展:";
121
+ readonly 'topic.constraints': "约束:";
122
+ readonly 'manage.open': "管理";
123
+ readonly 'manage.close': "收起";
124
+ readonly 'manage.title': "标题";
125
+ readonly 'manage.summary': "摘要";
126
+ readonly 'manage.constraintsLabel': "约束(相关话题使用这里的信息时必须遵守)";
127
+ readonly 'manage.constraintsPlaceholder': "例如:预算数字只用于采购,不要写进论文";
128
+ readonly 'manage.save': "保存修改";
129
+ readonly 'manage.workspace': "所在工作区";
130
+ readonly 'manage.unassigned': "不归入工作区";
131
+ readonly 'manage.newWorkspace': "新工作区…";
132
+ readonly 'manage.newWorkspaceName': "新工作区名称";
133
+ readonly 'manage.move': "移动";
134
+ readonly 'manage.attach': "关联已有会话";
135
+ readonly 'manage.attachPick': "选择一个 DSH 会话";
136
+ readonly 'manage.loadingSessions': "正在读取会话…";
137
+ readonly 'manage.attachButton': "关联";
138
+ readonly 'manage.attachHint': "整段会话会成为这个话题可以检索的历史,原会话不受影响。";
139
+ readonly 'manage.merge': "合并到另一个话题";
140
+ readonly 'manage.mergePick': "选择目标话题";
141
+ readonly 'manage.mergeButton': "合并";
142
+ readonly 'manage.confirm': "确认合并";
143
+ readonly 'manage.mergeHint': "这个话题的历史、进展、约束和关联会并入目标话题,然后移除这个话题。原会话仍保留在 DSH。";
144
+ readonly 'manage.delete': "删除话题";
145
+ readonly 'manage.deleteConfirm': "确认删除";
146
+ readonly 'manage.deleteHint': "只删除 TheOne 的目录记录,原始会话仍保留在 DSH,之后也不会被重新整理出来。";
147
+ readonly 'manage.error': "操作未能完成,请检查输入后重试。";
148
+ readonly 'manage.busy': "有回复正在进行,请等它结束后再试。";
149
+ readonly 'manage.create': "+ 新话题";
150
+ readonly 'manage.createButton': "创建";
151
+ readonly 'manage.cancel': "取消";
152
+ readonly 'routes.title': "最近的话题分配";
153
+ readonly 'routes.hint': "分错时可以在这里改到正确的话题:TheOne 会记住,类似的消息以后分到那里,下一条消息也接着那个话题。也可以直接在主聊天里说「分错了,是 某某 的」,上一条会交给正确的话题重新处理。";
154
+ readonly 'routes.empty': "还没有分配记录。";
155
+ readonly 'routes.move': "改到…";
156
+ readonly 'routes.corrected': "已改到 {title}";
157
+ readonly 'routes.clarify': "? 追问";
158
+ readonly 'routes.error': "分类出错:{code}";
159
+ readonly 'routes.rules': "规则判断";
160
+ readonly 'routes.removed': "(已删除的话题)";
161
+ readonly 'route.reason.steering': "回复中补充";
162
+ readonly 'route.reason.short-continuation': "接着说";
163
+ readonly 'route.reason.attachment-only': "只有附件";
164
+ readonly 'route.reason.correction': "按你的更正";
165
+ readonly 'route.reason.correction-unclear': "更正时没说清目标";
166
+ readonly 'route.reason.explicit-new-topic': "明确的新话题";
167
+ readonly 'route.reason.no-history-evidence': "新的问题";
168
+ readonly 'route.reason.entity-or-keyword': "提到了这个话题";
169
+ readonly 'route.reason.keyword-only-switch': "提到了这个话题";
170
+ readonly 'route.reason.current-reference': "接着当前话题";
171
+ readonly 'route.reason.combined-contexts': "结合多个话题";
172
+ readonly 'route.reason.insufficient-evidence': "没有匹配的旧话题";
173
+ readonly 'route.reason.multiple-contexts': "多个话题都可能";
174
+ readonly 'route.reason.weak-keyword-match': "新的问题";
175
+ readonly 'route.reason.no-history-match': "新的问题";
176
+ readonly 'route.reason.CATALOG_NOT_READY': "历史还在整理";
177
+ readonly 'route.reason.CATALOG_REVIEW_LIMIT': "没有找到明确相关的旧话题";
178
+ readonly 'route.reason.HISTORY_SEARCH_UNAVAILABLE': "历史检索暂不可用";
179
+ readonly 'route.reason.router-fallback': "分类暂不可用,按规则判断";
180
+ };
181
+ export declare const en: Record<keyof typeof zh, string>;
182
+ export type TheOneLocaleKey = keyof typeof zh;
183
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
184
+ interface LocaleNamespaceMap {
185
+ theone: TheOneLocaleKey;
186
+ }
187
+ }