dsh-theone 0.3.19 → 0.3.21
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 +77 -14
- package/README.zh.md +76 -14
- package/dist/catalog-types.d.ts +5 -0
- package/dist/client-locales.d.ts +8 -0
- package/dist/client-locales.js +16 -0
- package/dist/client.js +26 -7
- package/dist/fact-flow.d.ts +39 -0
- package/dist/fact-flow.js +135 -0
- package/dist/facts.d.ts +127 -0
- package/dist/facts.js +177 -0
- package/dist/history-catalog.d.ts +9 -0
- package/dist/history-catalog.js +48 -2
- package/dist/index.d.ts +28 -1
- package/dist/index.js +229 -28
- package/dist/linkage.d.ts +9 -0
- package/dist/linkage.js +31 -1
- package/dist/llm-router.d.ts +8 -1
- package/dist/llm-router.js +29 -6
- package/dist/run.d.ts +2 -0
- package/dist/run.js +2 -0
- package/dist/settings-types.d.ts +6 -2
- package/dist/settings-types.js +3 -3
- package/dist/settings.js +3 -2
- package/dist/store.d.ts +104 -2
- package/dist/store.js +269 -2
- package/dist/topic-memory.d.ts +61 -0
- package/dist/topic-memory.js +78 -0
- package/dist/types.d.ts +4 -0
- package/dist/update.d.ts +11 -1
- package/dist/update.js +47 -5
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -18,18 +18,10 @@ How many sessions are sitting in your DSH sidebar? Getting back to last week's w
|
|
|
18
18
|
|
|
19
19
|
**TheOne takes care of that.** You just talk in one main chat:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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>
|
|
21
|
+
<picture>
|
|
22
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/YunongDai2005/dsh-theone/main/docs/images/theone-architecture-en-dark.svg">
|
|
23
|
+
<img alt="How TheOne works: main chat sends each message through the router to its topic session; answers stream back, and the topic directory keeps progress, constraints and links" src="https://raw.githubusercontent.com/YunongDai2005/dsh-theone/main/docs/images/theone-architecture-en-light.svg" width="100%">
|
|
24
|
+
</picture>
|
|
33
25
|
|
|
34
26
|
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
27
|
|
|
@@ -46,6 +38,7 @@ Each project gets its own background session that reasons, runs tools and compac
|
|
|
46
38
|
- **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
39
|
- **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
40
|
- **Gets better with use.** Say "wrong topic" or click **Move to…** in the directory, and TheOne learns which terms tie that kind of message to the right topic (one small model call), so similar messages go there from then on. The directory shows how often routing was kept as is.
|
|
41
|
+
- **Knows each topic early.** After a topic's first reply, and once more when it is clearer, a short card (what it is, other names you use for it, the people, places and files involved, what is still open) is written in the background, so routing recognises the topic in your own words from the start. Routing also sees when each topic was last active; topics left alone longer than you usually come back to one (learned from your own use, 7 days until there is enough) are set aside: still reachable, just considered last. Nothing to set up and nothing shown.
|
|
49
42
|
- **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
43
|
- **Nothing extra to configure.** No separate API key: routing and the background sessions use the model you chose in DSH. When TheOne is the selected model, a button with a layers icon appears beside the model menu: it shows which model does the routing and the work, and switches it.
|
|
51
44
|
|
|
@@ -54,13 +47,67 @@ Each project gets its own background session that reasons, runs tools and compac
|
|
|
54
47
|
## Install in 30 seconds
|
|
55
48
|
|
|
56
49
|
1. Configure an API in DSH and select a model that can chat.
|
|
57
|
-
2. Open **Plugins → Add plugin**,
|
|
50
|
+
2. Open **Plugins → Add plugin**, enter `dsh-theone` under *Package name or address*, and install.
|
|
58
51
|
3. Click **TheOne · Main chat** in the sidebar and start talking.
|
|
59
52
|
|
|
60
|
-
|
|
53
|
+
That's it. Works with DSH `0.2.0-rc.2` and Node.js 24; the interface follows DSH's language (English / Simplified Chinese).
|
|
54
|
+
|
|
55
|
+
<details>
|
|
56
|
+
<summary><b>New to DSH? A step-by-step walkthrough (about 3 minutes)</b></summary>
|
|
57
|
+
|
|
58
|
+
No coding needed:
|
|
59
|
+
|
|
60
|
+
1. **Make sure DSH itself can chat.** Add your model provider's API key (DeepSeek's, for example) in DSH's settings, open an ordinary chat and say "hi". If it answers, you're set. TheOne uses that same model; there is no other key to enter.
|
|
61
|
+
2. **Install TheOne.** Click **Plugins** in the sidebar, then **Add plugin**, and enter:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
dsh-theone
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Click install and wait for it to finish.
|
|
68
|
+
3. **Start.** A new **TheOne · Main chat** appears in the sidebar. Open it and just talk about whatever is on your plate: today's work, the weekend trip, the paper you're writing. No new chats to create, nothing to name.
|
|
69
|
+
4. **Updates.** When a new version is out, a download icon appears next to the TheOne entry. One click installs it, no restart.
|
|
70
|
+
5. **Changed your mind?** Uninstall it on the Plugins page. Your DSH chats are all still there; TheOne organises them and never deletes them.
|
|
71
|
+
|
|
72
|
+
**Small things you may run into**
|
|
73
|
+
|
|
74
|
+
- **"Too new" and it won't install:** DSH only installs versions published at least 24 hours ago. That's a safety rule, not an error. Wait a day, or enter the GitHub address `https://github.com/YunongDai2005/dsh-theone` instead, which installs right away.
|
|
75
|
+
- **No TheOne in the sidebar after installing:** restart DSH.
|
|
76
|
+
- **Will it cost a lot?** Each message adds one short classification call (no deep thinking, at most 2,048 output tokens), and "ok" or "go on" skips even that. After installing, TheOne also organises your existing chats into a topic directory in the background; with many chats that first pass uses some of your quota. You can turn **History catalog** off in the settings.
|
|
77
|
+
</details>
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary><b>Command line and other sources</b></summary>
|
|
81
|
+
|
|
82
|
+
- npm: `dsh plugin --profile web add dsh-theone --ignore-scripts` (use `desktop` instead of `web` for the desktop app)
|
|
83
|
+
- GitHub (always the latest main): `dsh plugin --profile web add github:YunongDai2005/dsh-theone --ignore-scripts`
|
|
84
|
+
|
|
85
|
+
A new version from npm installs once it has been published for 24 hours; when an update is newer than that, the update button explains it and can exempt TheOne alone so it installs right away.
|
|
86
|
+
</details>
|
|
61
87
|
|
|
62
88
|
> Unofficial community project, maintained independently. It is not affiliated with or endorsed by DeepSeek.
|
|
63
89
|
|
|
90
|
+
## How well does it route?
|
|
91
|
+
|
|
92
|
+
Claims are cheap, so we built a public benchmark, **InterleaveBench**: one person pushing 3–5 things forward in the same chat at once (a trip, a budget, a paper, a training plan…), half in Chinese and half in English, 50 conversations and 2,466 messages, each labelled in advance with the thing it belongs to. We replayed them message by message through TheOne's own routing code with DeepSeek V4.1 Flash (dev split, 40 conversations; messages even a careful human could not attribute are not scored):
|
|
93
|
+
|
|
94
|
+
| Approach | Messages routed correctly |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| TheOne, topic list given up front | **91.6%** |
|
|
97
|
+
| TheOne, starting from nothing and creating topics as it goes (your first day) | **86.6%** |
|
|
98
|
+
| Keyword search (BM25), topic list given up front | 73.3% |
|
|
99
|
+
| No routing, everything in one chat | 44.5% |
|
|
100
|
+
| Keyword search, starting from nothing | 39.9% |
|
|
101
|
+
| A new topic for every message | 9.8% |
|
|
102
|
+
|
|
103
|
+
A few numbers worth knowing:
|
|
104
|
+
|
|
105
|
+
- **A message landing in another thing's topic**, the mistake that hurts context most: about 3.7% when starting from nothing.
|
|
106
|
+
- The main weakness today is **opening new topics too eagerly**: one thing ends up split over 2.1 topics on average. 0.3.21's topic cards go after exactly that.
|
|
107
|
+
- The whole run cost about one US dollar. Data, code and scoring live in [`eval/`](./eval/README.md); reproduce it, or try another model.
|
|
108
|
+
|
|
109
|
+
The conversations are model-written from a script and this version has no assistant replies, so it measures whether messages are routed right, not everything about how chatting feels.
|
|
110
|
+
|
|
64
111
|
## How it works
|
|
65
112
|
|
|
66
113
|
**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.
|
|
@@ -89,6 +136,8 @@ Right-click the TheOne button in the sidebar and choose **Settings**. Changes ap
|
|
|
89
136
|
| --- | --- |
|
|
90
137
|
| 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
138
|
| Linking scope | Learn automatically (default), same workspace only, or off |
|
|
139
|
+
| Share confirmed facts (experimental) | Off by default. Topics share only facts the user confirmed (a figure, a decision, where a file is), with version and source; a topic that used one is told when it changes or is withdrawn. Applies after a DSH restart |
|
|
140
|
+
| Record facts automatically (experimental) | Off by default. With shared facts on, one small model call after each turn records facts the topic session left out; only user-confirmed ones are shared |
|
|
92
141
|
| 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
142
|
| Routing | LLM decision (default) or rule-based |
|
|
94
143
|
| History catalog | On/off and rescan interval |
|
|
@@ -136,6 +185,20 @@ Tests use the real DSH runtime (AgentLoop, Session, SQLite, JSONL persistence, c
|
|
|
136
185
|
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).
|
|
137
186
|
</details>
|
|
138
187
|
|
|
188
|
+
|
|
189
|
+
<details>
|
|
190
|
+
<summary>🥚</summary>
|
|
191
|
+
|
|
192
|
+
<br>
|
|
193
|
+
|
|
194
|
+
Congratulations, you found the easter egg.
|
|
195
|
+
|
|
196
|
+
In the benchmark, TheOne once made a very human mistake. The user said "the café's autumn menu was due on September 25, let's push it to October 8", and TheOne filed it under the October holiday trip to Yunnan. Both were in October, after all.
|
|
197
|
+
|
|
198
|
+
We're still training it; 0.3.21's topic cards came out of moments like this. If it ever files something of yours in the wrong place, just say "wrong topic" in the main chat. It will remember, and it won't take it personally.
|
|
199
|
+
|
|
200
|
+
</details>
|
|
201
|
+
|
|
139
202
|
---
|
|
140
203
|
|
|
141
204
|
<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
CHANGED
|
@@ -18,18 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
**TheOne 把这些都交给它。** 你只管在一个主聊天里说话:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
→ 视频注意力论文
|
|
26
|
-
你:把刚才 Qwen 的测速结果也放进去
|
|
27
|
-
→ 视频注意力论文 · 参考:Qwen / RX 9070 XT
|
|
28
|
-
你:分错了,是显卡那个的
|
|
29
|
-
→ Qwen / RX 9070 XT (上一条交给它重新处理,以后也记住了)
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
<sub>示意。默认只在切换话题时显示一行提示。</sub>
|
|
21
|
+
<picture>
|
|
22
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/YunongDai2005/dsh-theone/main/docs/images/theone-architecture-zh-dark.svg">
|
|
23
|
+
<img alt="TheOne 的结构:主聊天把每条消息交给分配话题,送到对应的后台会话,结果实时回到主聊天;话题目录保存进展、约束和关联" src="https://raw.githubusercontent.com/YunongDai2005/dsh-theone/main/docs/images/theone-architecture-zh-light.svg" width="100%">
|
|
24
|
+
</picture>
|
|
33
25
|
|
|
34
26
|
每件事都有自己的后台会话,在里面推理、调用工具、压缩上下文;你看到的始终是一个普通的对话。
|
|
35
27
|
|
|
@@ -46,6 +38,7 @@
|
|
|
46
38
|
- **和原生会话一模一样**:思考从第一个字起就在原位置,工具卡片、授权、提问、待办、重试、回答中途插话,全都照常。
|
|
47
39
|
- **相关的事会互通,无关的事互不打扰**:相关话题自动共享进展,并从你的使用中学习哪些话题有关联;话题的约束(比如「预算数字不能写进论文」)每次都原样带上,压缩不会把它丢掉。
|
|
48
40
|
- **越用越准**:说「分错了」或在目录里点「改到…」,TheOne 会学到哪些词把这类消息和正确话题联系起来(只需一次很小的模型调用),类似的消息以后直接分对;话题目录里能看到分配的准确率。
|
|
41
|
+
- **新话题也认得出**:话题第一次回复后(以及事情更清楚时再一次),后台会写一张简短的卡片:这件事是什么、你会用哪些别的说法叫它、涉及的人名地名和文件、还有什么没定,所以换个说法也能分对。路由还知道每个话题多久前活跃过;超过你平时回头的间隔没动的话题(从你自己的使用中学出来,数据不够时按 7 天)会被视为搁置:仍然可以被分到,只是排在最后。无需设置,也不会打扰你。
|
|
49
42
|
- **旧会话自动变成话题目录**:装上后它会在后台读取你已有的会话,整理成话题并按工作区分组,直接接着聊。
|
|
50
43
|
- **零额外配置**:不用另填 API Key,路由和后台都用你在 DSH 里选好的模型。选中 TheOne 时,模型按钮旁边会出现一个带图层图标的按钮,显示并切换分配话题和干活用的模型。
|
|
51
44
|
|
|
@@ -54,13 +47,67 @@
|
|
|
54
47
|
## 30 秒装好
|
|
55
48
|
|
|
56
49
|
1. 在 DSH 中配置好 API,选一个能正常聊天的模型。
|
|
57
|
-
2. 打开 **插件 →
|
|
50
|
+
2. 打开 **插件 → 添加插件**,在「包名或地址」里填 `dsh-theone`,点击安装。
|
|
58
51
|
3. 点击左侧 **TheOne · 主聊天**,开始说话。
|
|
59
52
|
|
|
60
|
-
|
|
53
|
+
就这三步。兼容 DSH `0.2.0-rc.2` 与 Node.js 24;界面跟随 DSH 的语言(简体中文 / English)。
|
|
54
|
+
|
|
55
|
+
<details>
|
|
56
|
+
<summary><b>第一次用 DSH?手把手来一遍(约 3 分钟)</b></summary>
|
|
57
|
+
|
|
58
|
+
不用懂代码,跟着做就行:
|
|
59
|
+
|
|
60
|
+
1. **先让 DSH 自己能聊天。** 在 DSH 的设置里填好模型服务的 API Key(比如 DeepSeek 的),新建一个普通会话发一句「你好」。能收到回复,说明这一步好了。TheOne 用的就是这个模型,不用再填别的 Key。
|
|
61
|
+
2. **装 TheOne。** 点左侧的 **插件**,再点 **添加插件**,在「包名或地址」一栏输入:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
dsh-theone
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
点安装,等它跑完。
|
|
68
|
+
3. **开始用。** 左侧会多出一个 **TheOne · 主聊天**。点进去,把你手头的事一件件说出来就行:今天的工作、周末的旅行、要写的论文……不用新建会话,也不用起名字。
|
|
69
|
+
4. **以后更新。** 有新版本时,TheOne 入口右边会出现一个下载图标,点一下就装好,不用重启。
|
|
70
|
+
5. **不想用了?** 在插件页卸载即可。你原来的 DSH 会话都还在,TheOne 只是帮你整理,从来不删它们。
|
|
71
|
+
|
|
72
|
+
**可能遇到的小状况**
|
|
73
|
+
|
|
74
|
+
- **提示版本「太新」、装不上:** DSH 默认只安装发布满 24 小时的版本,这是它的安全规则,不是出错。可以等一天再装,也可以改填 GitHub 地址 `https://github.com/YunongDai2005/dsh-theone`,马上就能装。
|
|
75
|
+
- **装完左侧没看到 TheOne:** 重启一下 DSH。
|
|
76
|
+
- **会不会很费钱:** 每条消息多一次很短的分类调用(关闭深度思考,输出不超过 2048 token),「好的」「继续」这类连调用都省了。装好后它会在后台把你已有的会话整理成话题目录,会话多的话,这一次会用掉一些额度;不需要的话可以在设置里关掉「历史整理」。
|
|
77
|
+
</details>
|
|
78
|
+
|
|
79
|
+
<details>
|
|
80
|
+
<summary><b>命令行安装与其他方式</b></summary>
|
|
81
|
+
|
|
82
|
+
- npm:`dsh plugin --profile web add dsh-theone --ignore-scripts`(桌面端把 `web` 换成 `desktop`)
|
|
83
|
+
- GitHub(总是最新的 main):`dsh plugin --profile web add github:YunongDai2005/dsh-theone --ignore-scripts`
|
|
84
|
+
|
|
85
|
+
从 npm 安装的新版本要发布满 24 小时才装得上;遇到这种情况,更新按钮会说明原因,并可以只为 TheOne 放行、立即安装。
|
|
86
|
+
</details>
|
|
61
87
|
|
|
62
88
|
> 非官方社区项目,由社区成员独立维护,与 DeepSeek 不存在隶属或背书关系。
|
|
63
89
|
|
|
90
|
+
## 它分得有多准
|
|
91
|
+
|
|
92
|
+
口说无凭,我们做了一套公开评测 **InterleaveBench**:模拟一个人在同一个对话框里同时推进 3–5 件事(旅行、记账、论文、健身……),中英文各半,共 50 段对话、2466 条消息,每条消息属于哪件事都事先定好。再用 TheOne 自己的路由代码、DeepSeek V4.1 Flash 逐条重放(开发集 40 段;连人都分不清的消息不计分):
|
|
93
|
+
|
|
94
|
+
| 做法 | 分对的比例 |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| TheOne,事先给好话题列表 | **91.6%** |
|
|
97
|
+
| TheOne,从零开始边聊边建话题(就是你第一次用的样子) | **86.6%** |
|
|
98
|
+
| 关键词检索(BM25),事先给好话题列表 | 73.3% |
|
|
99
|
+
| 什么都不分,全塞进一个会话 | 44.5% |
|
|
100
|
+
| 关键词检索,从零开始 | 39.9% |
|
|
101
|
+
| 每句话都开一个新话题 | 9.8% |
|
|
102
|
+
|
|
103
|
+
几个值得一说的数字:
|
|
104
|
+
|
|
105
|
+
- **把一件事的消息放进另一件事的话题**(最伤上下文的那种错):从零开始时约占 3.7%。
|
|
106
|
+
- 现在最主要的毛病是**太爱开新话题**:同一件事平均被拆成 2.1 个话题。0.3.21 的「话题卡片」就是冲着它去的。
|
|
107
|
+
- 整套评测花了大约 1 美元。数据、代码和打分脚本都在 [`eval/`](./eval/README.md),可以自己复现,换成别的模型也行。
|
|
108
|
+
|
|
109
|
+
评测数据是模型按剧本生成的,而且这一版还没有助手回复,所以它衡量的是「能不能分对」,不代表真实聊天体验的全部。
|
|
110
|
+
|
|
64
111
|
## 它是怎么工作的
|
|
65
112
|
|
|
66
113
|
**分配话题。** 每条消息先判断:接着当前话题、回到某个旧话题,还是开个新的。默认用你选的模型做一次简短分类(关闭深度思考,最多 2048 token),候选话题由 DSH 全文搜索召回。
|
|
@@ -89,6 +136,8 @@
|
|
|
89
136
|
| --- | --- |
|
|
90
137
|
| 话题提示 | 主聊天里怎样显示话题切换:隐藏、仅切换时显示一行(默认)、每条都显示并注明原因 |
|
|
91
138
|
| 联动范围 | 自动学习(默认)、仅同一工作区、关闭 |
|
|
139
|
+
| 共享已确认的要点(实验) | 默认关闭。话题之间只共享用户亲自确认过的要点(数字、决定、文件位置),带版本和出处;要点改了或撤回了,用到它的话题会收到提示。重启 DSH 后生效 |
|
|
140
|
+
| 自动记录要点(实验) | 默认关闭。开启共享后,每轮结束多用一次小模型调用,补记后台会话没记下的要点;只有用户确认过的才会共享 |
|
|
92
141
|
| 模型 | 跟随 DSH(默认),或从 DSH 已配置的模型中固定后台模型;固定的设置优先于主聊天里的选择 |
|
|
93
142
|
| 路由方式 | LLM 判断(默认)或规则判断 |
|
|
94
143
|
| 历史整理 | 开关与补扫间隔 |
|
|
@@ -136,6 +185,19 @@ npm test
|
|
|
136
185
|
服务接口:`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)。
|
|
137
186
|
</details>
|
|
138
187
|
|
|
188
|
+
<details>
|
|
189
|
+
<summary>🥚</summary>
|
|
190
|
+
|
|
191
|
+
<br>
|
|
192
|
+
|
|
193
|
+
恭喜,你找到了彩蛋。
|
|
194
|
+
|
|
195
|
+
在评测里,TheOne 犯过一个很有人味的错:用户说「咖啡店秋季新品本来定 9 月 25 上,现在想推到 10 月 8 号」,它把这句话放进了「国庆云南六日游」,因为都在十月。
|
|
196
|
+
|
|
197
|
+
我们还在调教它,0.3.21 的话题卡片就是这么来的。如果你也被它分错了,在主聊天里说一句「分错了」就行,它会记住,不会生气。
|
|
198
|
+
|
|
199
|
+
</details>
|
|
200
|
+
|
|
139
201
|
---
|
|
140
202
|
|
|
141
203
|
<p align="center">觉得有用的话,点个 ⭐ 让更多人看到。遇到问题或有想法,欢迎 <a href="https://github.com/YunongDai2005/dsh-theone/issues">提 Issue</a>。</p>
|
package/dist/catalog-types.d.ts
CHANGED
|
@@ -5,9 +5,13 @@ export interface TopicGroup {
|
|
|
5
5
|
summary: string;
|
|
6
6
|
contextIds: string[];
|
|
7
7
|
}
|
|
8
|
+
/** Every conversation a topic draws on is gone from disk (`orphaned`) or archived in DSH (`archived`). */
|
|
9
|
+
export type HiddenReason = 'orphaned' | 'archived';
|
|
10
|
+
/** `hidden` says why routing and briefings skip this topic; the directory still lists it. */
|
|
8
11
|
export interface CatalogContext extends ContextDescriptor {
|
|
9
12
|
workingSessionId: string;
|
|
10
13
|
sourceSessionIds: string[];
|
|
14
|
+
hidden?: HiddenReason;
|
|
11
15
|
}
|
|
12
16
|
export interface CatalogStatus {
|
|
13
17
|
running: boolean;
|
|
@@ -18,6 +22,7 @@ export interface CatalogStatus {
|
|
|
18
22
|
pending: number;
|
|
19
23
|
lastCompletedAt?: number;
|
|
20
24
|
searchUnavailable?: boolean;
|
|
25
|
+
hidden?: number;
|
|
21
26
|
}
|
|
22
27
|
export type LinkReasonName = 'manual' | 'workspace' | 'project' | 'entities' | 'learned' | 'request';
|
|
23
28
|
export interface TopicLinkView {
|
package/dist/client-locales.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export declare const zh: {
|
|
|
7
7
|
readonly retry: "重试";
|
|
8
8
|
readonly 'settings.other': "其他";
|
|
9
9
|
readonly 'settings.notices': "显示公告";
|
|
10
|
+
readonly 'settings.factLinks': "共享已确认的要点(实验)";
|
|
11
|
+
readonly 'settings.help.factLinks': "话题之间只共享用户亲自确认过的要点(数字、决定、文件位置),带版本和出处;要点改了或撤回了,用到它的话题会收到提示。默认关闭,重启 DSH 后生效。";
|
|
12
|
+
readonly 'settings.factExtraction': "自动记录要点(实验)";
|
|
13
|
+
readonly 'settings.help.factExtraction': "开启「共享已确认的要点」后,每轮结束多用一次小模型调用,补记后台会话没记下的要点;同样只有用户确认过的才会共享。默认关闭,重启 DSH 后生效。";
|
|
10
14
|
readonly 'settings.help.notices': "显示 TheOne 作者发布的公告(新版本、重要提醒等)。只从 yulid.org 读取一个公告文件,不发送任何你的数据。";
|
|
11
15
|
readonly 'notice.label': "公告";
|
|
12
16
|
readonly 'notice.more': "查看详情";
|
|
@@ -39,6 +43,8 @@ export declare const zh: {
|
|
|
39
43
|
readonly 'update.busy': "有回复正在进行,等它结束后再点更新。";
|
|
40
44
|
readonly 'update.tooNew': "DSH 的安全策略只允许安装发布满 24 小时的版本,这一版还太新。过一阵再点一次即可。";
|
|
41
45
|
readonly 'update.network': "连不上下载源,请检查网络后点击重试。";
|
|
46
|
+
readonly 'update.otherAge': "pnpm 拒绝安装:{names} 也是发布不满 24 小时的版本,不归 TheOne 放行。等它满 24 小时后再点一次。";
|
|
47
|
+
readonly 'update.ageStill': "已为 TheOne 放行,pnpm 仍然拒绝:{detail}。完整日志在 DSH 配置目录的 .plugin-manager/logs 里。";
|
|
42
48
|
readonly 'update.failed': "更新失败";
|
|
43
49
|
readonly 'update.hint': "当前 {current},可更新到 {latest}。点击一键更新,不用重启 DSH。";
|
|
44
50
|
readonly 'update.manualHint': "当前 {current},最新 {latest}。这份插件不是从 GitHub 或 npm 安装的,请在「插件」页面重新安装。";
|
|
@@ -147,6 +153,8 @@ export declare const zh: {
|
|
|
147
153
|
readonly 'topic.source': "查看原会话";
|
|
148
154
|
readonly 'topic.state': "进展:";
|
|
149
155
|
readonly 'topic.constraints': "约束:";
|
|
156
|
+
readonly 'topic.hiddenOrphaned': "来源会话已从磁盘上消失:本话题不再参与路由,删除即可从目录移除。";
|
|
157
|
+
readonly 'topic.hiddenArchived': "来源会话已归档:本话题不再参与路由,取消归档或删除它即可。";
|
|
150
158
|
readonly 'manage.open': "管理";
|
|
151
159
|
readonly 'manage.close': "收起";
|
|
152
160
|
readonly 'manage.title': "标题";
|
package/dist/client-locales.js
CHANGED
|
@@ -7,6 +7,10 @@ export const zh = {
|
|
|
7
7
|
'retry': '重试',
|
|
8
8
|
'settings.other': "其他",
|
|
9
9
|
'settings.notices': "显示公告",
|
|
10
|
+
'settings.factLinks': "共享已确认的要点(实验)",
|
|
11
|
+
'settings.help.factLinks': "话题之间只共享用户亲自确认过的要点(数字、决定、文件位置),带版本和出处;要点改了或撤回了,用到它的话题会收到提示。默认关闭,重启 DSH 后生效。",
|
|
12
|
+
'settings.factExtraction': "自动记录要点(实验)",
|
|
13
|
+
'settings.help.factExtraction': "开启「共享已确认的要点」后,每轮结束多用一次小模型调用,补记后台会话没记下的要点;同样只有用户确认过的才会共享。默认关闭,重启 DSH 后生效。",
|
|
10
14
|
'settings.help.notices': "显示 TheOne 作者发布的公告(新版本、重要提醒等)。只从 yulid.org 读取一个公告文件,不发送任何你的数据。",
|
|
11
15
|
'notice.label': "公告",
|
|
12
16
|
'notice.more': "查看详情",
|
|
@@ -39,6 +43,8 @@ export const zh = {
|
|
|
39
43
|
'update.busy': '有回复正在进行,等它结束后再点更新。',
|
|
40
44
|
'update.tooNew': 'DSH 的安全策略只允许安装发布满 24 小时的版本,这一版还太新。过一阵再点一次即可。',
|
|
41
45
|
'update.network': '连不上下载源,请检查网络后点击重试。',
|
|
46
|
+
'update.otherAge': 'pnpm 拒绝安装:{names} 也是发布不满 24 小时的版本,不归 TheOne 放行。等它满 24 小时后再点一次。',
|
|
47
|
+
'update.ageStill': '已为 TheOne 放行,pnpm 仍然拒绝:{detail}。完整日志在 DSH 配置目录的 .plugin-manager/logs 里。',
|
|
42
48
|
'update.failed': '更新失败',
|
|
43
49
|
'update.hint': '当前 {current},可更新到 {latest}。点击一键更新,不用重启 DSH。',
|
|
44
50
|
'update.manualHint': '当前 {current},最新 {latest}。这份插件不是从 GitHub 或 npm 安装的,请在「插件」页面重新安装。',
|
|
@@ -147,6 +153,8 @@ export const zh = {
|
|
|
147
153
|
'topic.source': '查看原会话',
|
|
148
154
|
'topic.state': '进展:',
|
|
149
155
|
'topic.constraints': '约束:',
|
|
156
|
+
'topic.hiddenOrphaned': '来源会话已从磁盘上消失:本话题不再参与路由,删除即可从目录移除。',
|
|
157
|
+
'topic.hiddenArchived': '来源会话已归档:本话题不再参与路由,取消归档或删除它即可。',
|
|
150
158
|
'manage.open': '管理',
|
|
151
159
|
'manage.close': '收起',
|
|
152
160
|
'manage.title': '标题',
|
|
@@ -216,6 +224,10 @@ export const en = {
|
|
|
216
224
|
'retry': 'Retry',
|
|
217
225
|
'settings.other': "Other",
|
|
218
226
|
'settings.notices': "Show notices",
|
|
227
|
+
'settings.factLinks': "Share confirmed facts (experimental)",
|
|
228
|
+
'settings.help.factLinks': "Topics share only facts the user confirmed (figures, decisions, file locations), with version and source; when one changes or is withdrawn, topics that used it are told. Off by default; takes effect after DSH restarts.",
|
|
229
|
+
'settings.factExtraction': "Record facts automatically (experimental)",
|
|
230
|
+
'settings.help.factExtraction': "With shared facts on, one small model call after each turn records facts the topic session left out; again only facts the user confirmed are shared. Off by default; takes effect after DSH restarts.",
|
|
219
231
|
'settings.help.notices': "Show notices from TheOne's author (new versions, important reminders). TheOne only reads one notice file from yulid.org and sends none of your data.",
|
|
220
232
|
'notice.label': "Notice",
|
|
221
233
|
'notice.more': "Read more",
|
|
@@ -248,6 +260,8 @@ export const en = {
|
|
|
248
260
|
'update.busy': 'A reply is in progress. Update once it finishes.',
|
|
249
261
|
'update.tooNew': 'DSH only installs versions published at least 24 hours ago, as a safety policy, and this one is newer. Try again later.',
|
|
250
262
|
'update.network': 'Could not reach the download source. Check the network and click to retry.',
|
|
263
|
+
'update.otherAge': 'pnpm refused: {names} is also less than 24 hours old, and only TheOne is exempted. Try again once it is a day old.',
|
|
264
|
+
'update.ageStill': 'TheOne is exempted, but pnpm still refused: {detail}. The full log is in .plugin-manager/logs in the DSH profile folder.',
|
|
251
265
|
'update.failed': 'Update failed',
|
|
252
266
|
'update.hint': 'You have {current}; {latest} is available. Click to update without restarting DSH.',
|
|
253
267
|
'update.manualHint': 'You have {current}; {latest} is available. This copy was not installed from GitHub or npm, so reinstall it from the Plugins page.',
|
|
@@ -356,6 +370,8 @@ export const en = {
|
|
|
356
370
|
'topic.source': 'View original chat',
|
|
357
371
|
'topic.state': 'Progress:',
|
|
358
372
|
'topic.constraints': 'Constraints:',
|
|
373
|
+
'topic.hiddenOrphaned': 'Its conversations are gone from disk: this topic no longer takes part in routing. Delete it to remove it from the directory.',
|
|
374
|
+
'topic.hiddenArchived': 'Its conversations are archived: this topic no longer takes part in routing. Unarchive or delete it.',
|
|
359
375
|
'manage.open': 'Manage',
|
|
360
376
|
'manage.close': 'Close',
|
|
361
377
|
'manage.title': 'Title',
|
package/dist/client.js
CHANGED
|
@@ -39,7 +39,9 @@ var EDITABLE_SETTINGS_KEYS = [
|
|
|
39
39
|
"linkScope",
|
|
40
40
|
"routeNotice",
|
|
41
41
|
"contextsPath",
|
|
42
|
-
"notices"
|
|
42
|
+
"notices",
|
|
43
|
+
"factLinks",
|
|
44
|
+
"factExtraction"
|
|
43
45
|
];
|
|
44
46
|
|
|
45
47
|
// src/client-navigation.ts
|
|
@@ -91,6 +93,10 @@ var zh = {
|
|
|
91
93
|
"retry": "\u91CD\u8BD5",
|
|
92
94
|
"settings.other": "\u5176\u4ED6",
|
|
93
95
|
"settings.notices": "\u663E\u793A\u516C\u544A",
|
|
96
|
+
"settings.factLinks": "\u5171\u4EAB\u5DF2\u786E\u8BA4\u7684\u8981\u70B9\uFF08\u5B9E\u9A8C\uFF09",
|
|
97
|
+
"settings.help.factLinks": "\u8BDD\u9898\u4E4B\u95F4\u53EA\u5171\u4EAB\u7528\u6237\u4EB2\u81EA\u786E\u8BA4\u8FC7\u7684\u8981\u70B9\uFF08\u6570\u5B57\u3001\u51B3\u5B9A\u3001\u6587\u4EF6\u4F4D\u7F6E\uFF09\uFF0C\u5E26\u7248\u672C\u548C\u51FA\u5904\uFF1B\u8981\u70B9\u6539\u4E86\u6216\u64A4\u56DE\u4E86\uFF0C\u7528\u5230\u5B83\u7684\u8BDD\u9898\u4F1A\u6536\u5230\u63D0\u793A\u3002\u9ED8\u8BA4\u5173\u95ED\uFF0C\u91CD\u542F DSH \u540E\u751F\u6548\u3002",
|
|
98
|
+
"settings.factExtraction": "\u81EA\u52A8\u8BB0\u5F55\u8981\u70B9\uFF08\u5B9E\u9A8C\uFF09",
|
|
99
|
+
"settings.help.factExtraction": "\u5F00\u542F\u300C\u5171\u4EAB\u5DF2\u786E\u8BA4\u7684\u8981\u70B9\u300D\u540E\uFF0C\u6BCF\u8F6E\u7ED3\u675F\u591A\u7528\u4E00\u6B21\u5C0F\u6A21\u578B\u8C03\u7528\uFF0C\u8865\u8BB0\u540E\u53F0\u4F1A\u8BDD\u6CA1\u8BB0\u4E0B\u7684\u8981\u70B9\uFF1B\u540C\u6837\u53EA\u6709\u7528\u6237\u786E\u8BA4\u8FC7\u7684\u624D\u4F1A\u5171\u4EAB\u3002\u9ED8\u8BA4\u5173\u95ED\uFF0C\u91CD\u542F DSH \u540E\u751F\u6548\u3002",
|
|
94
100
|
"settings.help.notices": "\u663E\u793A TheOne \u4F5C\u8005\u53D1\u5E03\u7684\u516C\u544A\uFF08\u65B0\u7248\u672C\u3001\u91CD\u8981\u63D0\u9192\u7B49\uFF09\u3002\u53EA\u4ECE yulid.org \u8BFB\u53D6\u4E00\u4E2A\u516C\u544A\u6587\u4EF6\uFF0C\u4E0D\u53D1\u9001\u4EFB\u4F55\u4F60\u7684\u6570\u636E\u3002",
|
|
95
101
|
"notice.label": "\u516C\u544A",
|
|
96
102
|
"notice.more": "\u67E5\u770B\u8BE6\u60C5",
|
|
@@ -123,6 +129,8 @@ var zh = {
|
|
|
123
129
|
"update.busy": "\u6709\u56DE\u590D\u6B63\u5728\u8FDB\u884C\uFF0C\u7B49\u5B83\u7ED3\u675F\u540E\u518D\u70B9\u66F4\u65B0\u3002",
|
|
124
130
|
"update.tooNew": "DSH \u7684\u5B89\u5168\u7B56\u7565\u53EA\u5141\u8BB8\u5B89\u88C5\u53D1\u5E03\u6EE1 24 \u5C0F\u65F6\u7684\u7248\u672C\uFF0C\u8FD9\u4E00\u7248\u8FD8\u592A\u65B0\u3002\u8FC7\u4E00\u9635\u518D\u70B9\u4E00\u6B21\u5373\u53EF\u3002",
|
|
125
131
|
"update.network": "\u8FDE\u4E0D\u4E0A\u4E0B\u8F7D\u6E90\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u70B9\u51FB\u91CD\u8BD5\u3002",
|
|
132
|
+
"update.otherAge": "pnpm \u62D2\u7EDD\u5B89\u88C5\uFF1A{names} \u4E5F\u662F\u53D1\u5E03\u4E0D\u6EE1 24 \u5C0F\u65F6\u7684\u7248\u672C\uFF0C\u4E0D\u5F52 TheOne \u653E\u884C\u3002\u7B49\u5B83\u6EE1 24 \u5C0F\u65F6\u540E\u518D\u70B9\u4E00\u6B21\u3002",
|
|
133
|
+
"update.ageStill": "\u5DF2\u4E3A TheOne \u653E\u884C\uFF0Cpnpm \u4ECD\u7136\u62D2\u7EDD\uFF1A{detail}\u3002\u5B8C\u6574\u65E5\u5FD7\u5728 DSH \u914D\u7F6E\u76EE\u5F55\u7684 .plugin-manager/logs \u91CC\u3002",
|
|
126
134
|
"update.failed": "\u66F4\u65B0\u5931\u8D25",
|
|
127
135
|
"update.hint": "\u5F53\u524D {current}\uFF0C\u53EF\u66F4\u65B0\u5230 {latest}\u3002\u70B9\u51FB\u4E00\u952E\u66F4\u65B0\uFF0C\u4E0D\u7528\u91CD\u542F DSH\u3002",
|
|
128
136
|
"update.manualHint": "\u5F53\u524D {current}\uFF0C\u6700\u65B0 {latest}\u3002\u8FD9\u4EFD\u63D2\u4EF6\u4E0D\u662F\u4ECE GitHub \u6216 npm \u5B89\u88C5\u7684\uFF0C\u8BF7\u5728\u300C\u63D2\u4EF6\u300D\u9875\u9762\u91CD\u65B0\u5B89\u88C5\u3002",
|
|
@@ -231,6 +239,8 @@ var zh = {
|
|
|
231
239
|
"topic.source": "\u67E5\u770B\u539F\u4F1A\u8BDD",
|
|
232
240
|
"topic.state": "\u8FDB\u5C55\uFF1A",
|
|
233
241
|
"topic.constraints": "\u7EA6\u675F\uFF1A",
|
|
242
|
+
"topic.hiddenOrphaned": "\u6765\u6E90\u4F1A\u8BDD\u5DF2\u4ECE\u78C1\u76D8\u4E0A\u6D88\u5931\uFF1A\u672C\u8BDD\u9898\u4E0D\u518D\u53C2\u4E0E\u8DEF\u7531\uFF0C\u5220\u9664\u5373\u53EF\u4ECE\u76EE\u5F55\u79FB\u9664\u3002",
|
|
243
|
+
"topic.hiddenArchived": "\u6765\u6E90\u4F1A\u8BDD\u5DF2\u5F52\u6863\uFF1A\u672C\u8BDD\u9898\u4E0D\u518D\u53C2\u4E0E\u8DEF\u7531\uFF0C\u53D6\u6D88\u5F52\u6863\u6216\u5220\u9664\u5B83\u5373\u53EF\u3002",
|
|
234
244
|
"manage.open": "\u7BA1\u7406",
|
|
235
245
|
"manage.close": "\u6536\u8D77",
|
|
236
246
|
"manage.title": "\u6807\u9898",
|
|
@@ -300,6 +310,10 @@ var en = {
|
|
|
300
310
|
"retry": "Retry",
|
|
301
311
|
"settings.other": "Other",
|
|
302
312
|
"settings.notices": "Show notices",
|
|
313
|
+
"settings.factLinks": "Share confirmed facts (experimental)",
|
|
314
|
+
"settings.help.factLinks": "Topics share only facts the user confirmed (figures, decisions, file locations), with version and source; when one changes or is withdrawn, topics that used it are told. Off by default; takes effect after DSH restarts.",
|
|
315
|
+
"settings.factExtraction": "Record facts automatically (experimental)",
|
|
316
|
+
"settings.help.factExtraction": "With shared facts on, one small model call after each turn records facts the topic session left out; again only facts the user confirmed are shared. Off by default; takes effect after DSH restarts.",
|
|
303
317
|
"settings.help.notices": "Show notices from TheOne's author (new versions, important reminders). TheOne only reads one notice file from yulid.org and sends none of your data.",
|
|
304
318
|
"notice.label": "Notice",
|
|
305
319
|
"notice.more": "Read more",
|
|
@@ -332,6 +346,8 @@ var en = {
|
|
|
332
346
|
"update.busy": "A reply is in progress. Update once it finishes.",
|
|
333
347
|
"update.tooNew": "DSH only installs versions published at least 24 hours ago, as a safety policy, and this one is newer. Try again later.",
|
|
334
348
|
"update.network": "Could not reach the download source. Check the network and click to retry.",
|
|
349
|
+
"update.otherAge": "pnpm refused: {names} is also less than 24 hours old, and only TheOne is exempted. Try again once it is a day old.",
|
|
350
|
+
"update.ageStill": "TheOne is exempted, but pnpm still refused: {detail}. The full log is in .plugin-manager/logs in the DSH profile folder.",
|
|
335
351
|
"update.failed": "Update failed",
|
|
336
352
|
"update.hint": "You have {current}; {latest} is available. Click to update without restarting DSH.",
|
|
337
353
|
"update.manualHint": "You have {current}; {latest} is available. This copy was not installed from GitHub or npm, so reinstall it from the Plugins page.",
|
|
@@ -440,6 +456,8 @@ var en = {
|
|
|
440
456
|
"topic.source": "View original chat",
|
|
441
457
|
"topic.state": "Progress:",
|
|
442
458
|
"topic.constraints": "Constraints:",
|
|
459
|
+
"topic.hiddenOrphaned": "Its conversations are gone from disk: this topic no longer takes part in routing. Delete it to remove it from the directory.",
|
|
460
|
+
"topic.hiddenArchived": "Its conversations are archived: this topic no longer takes part in routing. Unarchive or delete it.",
|
|
443
461
|
"manage.open": "Manage",
|
|
444
462
|
"manage.close": "Close",
|
|
445
463
|
"manage.title": "Title",
|
|
@@ -598,7 +616,7 @@ function apply(ctx) {
|
|
|
598
616
|
cache: "no-store",
|
|
599
617
|
...body ? { headers: { "content-type": "application/json" }, body: JSON.stringify(body) } : {}
|
|
600
618
|
});
|
|
601
|
-
if (response.ok || response.status === 409) setUpdate(await response.json());
|
|
619
|
+
if (response.ok || response.status === 409 || response.status === 400) setUpdate(await response.json());
|
|
602
620
|
if (update?.state === "reloading") void awaitReload(update.current);
|
|
603
621
|
} catch {
|
|
604
622
|
}
|
|
@@ -715,13 +733,13 @@ function apply(ctx) {
|
|
|
715
733
|
const waiting = !!status?.waiting && !status.available && !status.state;
|
|
716
734
|
if (!status || !status.available && !status.state && !waiting) return null;
|
|
717
735
|
const label = waiting ? t2("update.waiting") : status.state === "installing" ? t2("update.installing") : status.state === "reloading" ? t2("update.reloading") : status.state === "restart" ? t2("update.restart") : status.state === "failed" ? t2("update.failed") : t2("update.available");
|
|
718
|
-
const hint = waiting ? t2("update.waitingHint", { latest: status.waiting.version }) : status.error === "GATEWAY_BUSY" ? t2("update.busy") : status.state === "reloading" ? t2("update.reloadingHint") : status.state === "restart" ? t2("update.restartHint") : status.state === "failed" ? status.error === "MINIMUM_RELEASE_AGE" ? t2("update.tooNew") : status.error === "NETWORK" ? t2("update.network") : t2("update.failedHint", { error: status.error ?? "" }) : status.installable ? t2("update.hint", { current: status.current, latest: status.latest ?? "" }) : t2("update.manualHint", { current: status.current, latest: status.latest ?? "" });
|
|
736
|
+
const hint = waiting ? t2("update.waitingHint", { latest: status.waiting.version }) : status.error === "GATEWAY_BUSY" ? t2("update.busy") : status.state === "reloading" ? t2("update.reloadingHint") : status.state === "restart" ? t2("update.restartHint") : status.state === "failed" ? status.error === "OTHER_RELEASE_AGE" ? t2("update.otherAge", { names: status.detail ?? "" }) : status.error === "MINIMUM_RELEASE_AGE" ? status.exempt ? t2("update.ageStill", { detail: status.detail ?? "" }) : t2("update.tooNew") : status.error === "NETWORK" ? t2("update.network") : t2("update.failedHint", { error: status.detail ?? status.error ?? "" }) : status.installable ? t2("update.hint", { current: status.current, latest: status.latest ?? "" }) : t2("update.manualHint", { current: status.current, latest: status.latest ?? "" });
|
|
719
737
|
const title = `${label} \xB7 ${hint}`;
|
|
720
738
|
const act = (event) => {
|
|
721
739
|
event.preventDefault();
|
|
722
740
|
event.stopPropagation();
|
|
723
741
|
if (status.state === "installing" || status.state === "reloading" || status.state === "restart") return;
|
|
724
|
-
if (waiting || status.state === "failed" && status.error === "MINIMUM_RELEASE_AGE") {
|
|
742
|
+
if (!status.exempt && (waiting || status.state === "failed" && status.error === "MINIMUM_RELEASE_AGE")) {
|
|
725
743
|
openReleaseAgeDialog(status);
|
|
726
744
|
return;
|
|
727
745
|
}
|
|
@@ -1271,7 +1289,7 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1271
1289
|
const groups = [
|
|
1272
1290
|
["models", ["workerProvider", "workerModel", "routerMode"]],
|
|
1273
1291
|
["history", ["historyCatalog", "catalogIntervalMs"]],
|
|
1274
|
-
["linkage", ["linkScope", "routeNotice"]],
|
|
1292
|
+
["linkage", ["linkScope", "routeNotice", "factLinks", "factExtraction"]],
|
|
1275
1293
|
["limits", ["maxDescriptorChars", "maxResponseChars"]],
|
|
1276
1294
|
["storage", ["contextsPath", "databasePath", "gatewayKey"]],
|
|
1277
1295
|
["other", ["notices"]]
|
|
@@ -1331,7 +1349,7 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1331
1349
|
{ ...props, value, required: field === "workerModel" && !!draft.workerProvider, onChange: (event) => selectValue(event.target.value) },
|
|
1332
1350
|
...choices.map((choice) => (0, import_react.createElement)("option", { key: choice.value, value: choice.value }, choice.label))
|
|
1333
1351
|
);
|
|
1334
|
-
if (field === "historyCatalog" || field === "notices") return select(String(draft[field]), [{ value: "true", label: t2("settings.on") }, { value: "false", label: t2("settings.off") }], (v) => change(field, v === "true"));
|
|
1352
|
+
if (field === "historyCatalog" || field === "notices" || field === "factLinks" || field === "factExtraction") return select(String(draft[field]), [{ value: "true", label: t2("settings.on") }, { value: "false", label: t2("settings.off") }], (v) => change(field, v === "true"));
|
|
1335
1353
|
if (field === "linkScope" || field === "routeNotice") {
|
|
1336
1354
|
const values = field === "linkScope" ? ["auto", "workspace", "off"] : ["switch", "hidden", "all"];
|
|
1337
1355
|
return select(draft[field], values.map((value) => ({ value, label: t2(`settings.${field === "linkScope" ? "scope" : "notice"}.${value}`) })), (v) => change(field, v));
|
|
@@ -1883,6 +1901,7 @@ ${body}` }, (0, import_react.createElement)("strong", null, title), " ", body),
|
|
|
1883
1901
|
{ key: id, className: "theone-topic-card" },
|
|
1884
1902
|
(0, import_react.createElement)("h3", null, topic.title),
|
|
1885
1903
|
(0, import_react.createElement)("p", null, topic.summary),
|
|
1904
|
+
topic.hidden ? (0, import_react.createElement)("p", { className: "theone-topic-warning" }, t2(topic.hidden === "archived" ? "topic.hiddenArchived" : "topic.hiddenOrphaned")) : null,
|
|
1886
1905
|
topic.lastState ? (0, import_react.createElement)("p", { className: "theone-topic-state" }, (0, import_react.createElement)("span", null, t2("topic.state")), topic.lastState) : null,
|
|
1887
1906
|
constraints ? (0, import_react.createElement)("p", { className: "theone-topic-state" }, (0, import_react.createElement)("span", null, t2("topic.constraints")), constraints) : null,
|
|
1888
1907
|
linkRow(id),
|
|
@@ -2009,7 +2028,7 @@ button:has(.theone-nav[data-wide=true])>span:has(.theone-nav){flex:1;min-width:0
|
|
|
2009
2028
|
var catalogCss = `
|
|
2010
2029
|
button:has(.theone-catalog-entry)>span:not(:has(.theone-catalog-entry)){display:none}
|
|
2011
2030
|
.theone-catalog{padding:32px;max-width:1180px;margin:auto;box-sizing:border-box;height:100%;overflow:auto;color:var(--dsw-alias-label-primary)}
|
|
2012
|
-
.theone-catalog-header{display:flex;justify-content:space-between;align-items:center;gap:16px}.theone-catalog h1{font-size:24px;margin:0 0 8px}.theone-catalog-header p,.theone-catalog-status,.theone-group-summary{opacity:.65;margin:0 0 18px;line-height:1.6}.theone-catalog button{border:1px solid #8883;border-radius:9px;padding:8px 13px;background:transparent;color:inherit;cursor:pointer;font:inherit;white-space:nowrap}.theone-catalog button:disabled{opacity:.5;cursor:default}.theone-catalog-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:20px}.theone-topic-group{border:1px solid #8882;border-radius:16px;padding:20px;background:#88805}.theone-topic-group h2{font-size:18px;margin:0 0 8px}.theone-topic-group h2 span{font-size:13px;opacity:.5}.theone-topic-card{border-top:1px solid #8882;padding:16px 0}.theone-topic-card:last-child{padding-bottom:0}.theone-topic-card h3{font-size:15px;line-height:1.5;margin:0 0 7px}.theone-topic-card p{font-size:13px;line-height:1.7;opacity:.75;margin:0 0 12px;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.theone-topic-actions{display:flex;gap:8px;flex-wrap:wrap}.theone-topic-actions button{font-size:12px}.theone-topic-actions .theone-source-link{border-color:transparent;opacity:.6}.theone-catalog-warning{background:#ff900011;padding:12px;border-radius:10px;font-size:13px}.theone-catalog-entry{display:flex;align-items:center;gap:10px;font-size:14px}.theone-catalog-empty{padding:40px 0;opacity:.65;line-height:1.8}.theone-catalog-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.theone-topic-links{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 12px;font-size:12px}.theone-links-label,.theone-links-empty{opacity:.6}.theone-link-chip{display:inline-flex;align-items:center;gap:2px;border:1px solid #8883;border-radius:999px;padding:2px 4px 2px 9px}.theone-catalog .theone-link-chip button{border:0;padding:0 5px;opacity:.6;font-size:13px;line-height:1}.theone-topic-links select{font:inherit;font-size:12px;color:inherit;background:transparent;border:1px solid #8883;border-radius:8px;padding:2px 6px}.theone-link-private{display:inline-flex;align-items:center;gap:4px;opacity:.75;cursor:pointer}.theone-topic-card .theone-topic-state{font-size:12px;opacity:.8;-webkit-line-clamp:3}.theone-topic-state span{opacity:.6;margin-right:4px}.theone-manage{display:flex;flex-direction:column;gap:10px;margin-top:12px;padding:14px;border:1px solid #8883;border-radius:12px;font-size:12px}.theone-create{flex-direction:row;flex-wrap:wrap;align-items:center;margin:0 0 18px}.theone-create input{flex:1;min-width:180px}.theone-manage-field{display:flex;flex-direction:column;gap:5px}.theone-manage-field>span{opacity:.65}.theone-manage input,.theone-manage textarea,.theone-manage select,.theone-routes select{font:inherit;font-size:12px;color:inherit;background:transparent;border:1px solid #8883;border-radius:8px;padding:6px 8px;box-sizing:border-box;min-width:0}.theone-manage textarea{resize:vertical;width:100%}.theone-manage-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.theone-manage-row select,.theone-manage-row input{flex:1;min-width:140px}.theone-manage-hint{opacity:.6;font-size:12px;line-height:1.6;margin:0}.theone-catalog .theone-danger{color:#c4402f;border-color:#c4402f55}.theone-routes{border:1px solid #8882;border-radius:16px;padding:14px 20px;margin:0 0 20px}.theone-routes summary{cursor:pointer;font-weight:500}.theone-routes summary span{opacity:.5;font-size:13px}.theone-routes ol{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}.theone-routes li{border-top:1px solid #8882;padding-top:10px;font-size:12px;display:flex;flex-direction:column;gap:5px}.theone-route-head{display:flex;gap:10px;min-width:0}.theone-route-head time{opacity:.55;flex:none}.theone-route-head q{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.theone-route-body{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.theone-route-body small{opacity:.6}.theone-route-fixed{opacity:.75}.theone-route-stats{margin-left:10px;font-weight:400;opacity:.6;font-size:12px}@media(max-width:640px){.theone-catalog{padding:20px}.theone-catalog-header{align-items:flex-start}.theone-catalog-header h1{font-size:21px}}
|
|
2031
|
+
.theone-catalog-header{display:flex;justify-content:space-between;align-items:center;gap:16px}.theone-catalog h1{font-size:24px;margin:0 0 8px}.theone-catalog-header p,.theone-catalog-status,.theone-group-summary{opacity:.65;margin:0 0 18px;line-height:1.6}.theone-catalog button{border:1px solid #8883;border-radius:9px;padding:8px 13px;background:transparent;color:inherit;cursor:pointer;font:inherit;white-space:nowrap}.theone-catalog button:disabled{opacity:.5;cursor:default}.theone-catalog-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:20px}.theone-topic-group{border:1px solid #8882;border-radius:16px;padding:20px;background:#88805}.theone-topic-group h2{font-size:18px;margin:0 0 8px}.theone-topic-group h2 span{font-size:13px;opacity:.5}.theone-topic-card{border-top:1px solid #8882;padding:16px 0}.theone-topic-card:last-child{padding-bottom:0}.theone-topic-card h3{font-size:15px;line-height:1.5;margin:0 0 7px}.theone-topic-card p{font-size:13px;line-height:1.7;opacity:.75;margin:0 0 12px;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.theone-topic-actions{display:flex;gap:8px;flex-wrap:wrap}.theone-topic-actions button{font-size:12px}.theone-topic-actions .theone-source-link{border-color:transparent;opacity:.6}.theone-catalog-warning{background:#ff900011;padding:12px;border-radius:10px;font-size:13px}.theone-topic-warning{font-size:12px;line-height:1.6;margin:0 0 12px;color:#d9480f}.theone-catalog-entry{display:flex;align-items:center;gap:10px;font-size:14px}.theone-catalog-empty{padding:40px 0;opacity:.65;line-height:1.8}.theone-catalog-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.theone-topic-links{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 12px;font-size:12px}.theone-links-label,.theone-links-empty{opacity:.6}.theone-link-chip{display:inline-flex;align-items:center;gap:2px;border:1px solid #8883;border-radius:999px;padding:2px 4px 2px 9px}.theone-catalog .theone-link-chip button{border:0;padding:0 5px;opacity:.6;font-size:13px;line-height:1}.theone-topic-links select{font:inherit;font-size:12px;color:inherit;background:transparent;border:1px solid #8883;border-radius:8px;padding:2px 6px}.theone-link-private{display:inline-flex;align-items:center;gap:4px;opacity:.75;cursor:pointer}.theone-topic-card .theone-topic-state{font-size:12px;opacity:.8;-webkit-line-clamp:3}.theone-topic-state span{opacity:.6;margin-right:4px}.theone-manage{display:flex;flex-direction:column;gap:10px;margin-top:12px;padding:14px;border:1px solid #8883;border-radius:12px;font-size:12px}.theone-create{flex-direction:row;flex-wrap:wrap;align-items:center;margin:0 0 18px}.theone-create input{flex:1;min-width:180px}.theone-manage-field{display:flex;flex-direction:column;gap:5px}.theone-manage-field>span{opacity:.65}.theone-manage input,.theone-manage textarea,.theone-manage select,.theone-routes select{font:inherit;font-size:12px;color:inherit;background:transparent;border:1px solid #8883;border-radius:8px;padding:6px 8px;box-sizing:border-box;min-width:0}.theone-manage textarea{resize:vertical;width:100%}.theone-manage-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.theone-manage-row select,.theone-manage-row input{flex:1;min-width:140px}.theone-manage-hint{opacity:.6;font-size:12px;line-height:1.6;margin:0}.theone-catalog .theone-danger{color:#c4402f;border-color:#c4402f55}.theone-routes{border:1px solid #8882;border-radius:16px;padding:14px 20px;margin:0 0 20px}.theone-routes summary{cursor:pointer;font-weight:500}.theone-routes summary span{opacity:.5;font-size:13px}.theone-routes ol{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column;gap:10px}.theone-routes li{border-top:1px solid #8882;padding-top:10px;font-size:12px;display:flex;flex-direction:column;gap:5px}.theone-route-head{display:flex;gap:10px;min-width:0}.theone-route-head time{opacity:.55;flex:none}.theone-route-head q{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.theone-route-body{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.theone-route-body small{opacity:.6}.theone-route-fixed{opacity:.75}.theone-route-stats{margin-left:10px;font-weight:400;opacity:.6;font-size:12px}@media(max-width:640px){.theone-catalog{padding:20px}.theone-catalog-header{align-items:flex-start}.theone-catalog-header h1{font-size:21px}}
|
|
2013
2032
|
`;
|
|
2014
2033
|
var composerCss = `
|
|
2015
2034
|
.theone-bg{display:inline-flex;align-items:center;gap:5px;height:32px;padding:0 10px;border:0;border-radius:10px;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;white-space:nowrap;cursor:pointer;max-width:220px}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ContextStore } from './store.ts';
|
|
2
|
+
import { type LinkScope } from './linkage.ts';
|
|
3
|
+
import { type EvidenceEvent, type FactCandidate, type FactView } from './facts.ts';
|
|
4
|
+
/** Confirmed facts this message might use, best first, within budget. Ranking only. */
|
|
5
|
+
export declare function factCandidates(store: ContextStore, scope: LinkScope, text: string, recent: string[], currentId?: string): FactCandidate[];
|
|
6
|
+
export interface FactDelivery {
|
|
7
|
+
notices: string[];
|
|
8
|
+
facts: string[];
|
|
9
|
+
/** Record what was sent; call only once the briefing carrying these lines is actually sent. */
|
|
10
|
+
commit(): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* What a topic is told about facts before its Worker answers: changes to facts it used before
|
|
14
|
+
* (also on a plain "go on") and the facts this request imports. Every fact is checked here, against
|
|
15
|
+
* the topic finally chosen and the settings now; nothing is recorded until `commit`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function factDelivery(store: ContextStore, scope: LinkScope, contextId: string, imports: string[], inputId?: string): FactDelivery;
|
|
18
|
+
/** The topic's own recorded facts, with ids and versions, for its Worker's descriptor. */
|
|
19
|
+
export declare function ownFactsText(store: ContextStore, contextId: string): string;
|
|
20
|
+
/** Optional extraction after a turn; every item it returns is checked like a Worker's own record. */
|
|
21
|
+
export declare const EXTRACT_PROMPT = "\u4F60\u5728\u5E2E\u4E00\u4E2A\u8BDD\u9898\u8BB0\u5F55\u5DF2\u7ECF\u786E\u5B9A\u4E0B\u6765\u7684\u8981\u70B9\uFF1A\u6570\u5B57\u3001\u65E5\u671F\u3001\u51B3\u5B9A\u3001\u6587\u4EF6\u6216\u94FE\u63A5\u7684\u4F4D\u7F6E\u3002\u8F93\u5165\u662F\u672C\u8F6E\u7684\u7528\u6237\u6D88\u606F user\u3001\u52A9\u624B\u56DE\u7B54 assistant\uFF0C\u4EE5\u53CA\u672C\u8BDD\u9898\u5DF2\u8BB0\u5F55\u7684\u8981\u70B9 facts\uFF08\u542B factId \u548C\u7248\u672C\uFF09\u3002\n\u53EA\u8BB0\u5F55\u7528\u6237\u4EB2\u53E3\u8BF4\u51FA\u7684\u503C\uFF0C\u6216\u7528\u6237\u660E\u786E\u63A5\u53D7\u4E86\u52A9\u624B\u63D0\u8BAE\u7684\u503C\uFF08\u6B64\u65F6 acceptsQuote \u586B\u52A9\u624B\u63D0\u8BAE\u7684\u539F\u8BDD\uFF09\uFF1B\u52A9\u624B\u81EA\u5DF1\u7684\u5EFA\u8BAE\u3001\u63A8\u6D4B\u3001\u672A\u5B9A\u7684\u4E8B\u4E0D\u8981\u8BB0\u5F55\u3002\n\u6BCF\u6761\u90FD\u5FC5\u987B\u7ED9\u51FA evidenceQuote\uFF1A\u672C\u8F6E\u5BF9\u8BDD\u91CC\u80FD\u8BC1\u660E\u5B83\u7684\u539F\u8BDD\uFF0C\u9010\u5B57\u590D\u5236\u3002\u5DF2\u8BB0\u5F55\u8FC7\u7684\u540C\u4E00\u4EF6\u4E8B\u7528\u5B83\u7684 factId \u66F4\u65B0\uFF1B\u7528\u6237\u8BF4\u67D0\u4E2A\u503C\u4E0D\u518D\u6210\u7ACB\u6216\u8FD8\u6CA1\u5B9A\u65F6\uFF0C\u8F93\u51FA op \u4E3A \"retract\" \u5E76\u7ED9\u51FA\u7528\u6237\u539F\u8BDD\u3002\u6CA1\u6709\u5C31\u8F93\u51FA\u7A7A\u6570\u7EC4\u3002\n\u53EA\u8F93\u51FA JSON \u6570\u7EC4\uFF0C\u4F8B\u5982 [{\"op\":\"set\",\"factId\":null,\"label\":\"\u9884\u7B97\",\"kind\":\"fact\",\"value\":\"800\",\"evidenceQuote\":\"\u9884\u7B97\u5B9A\u4E3A 800 \u5143\"}]\u3002kind \u53EA\u80FD\u662F fact\u3001decision\u3001artifact\u3002";
|
|
22
|
+
/** The extraction request for the turn that just ended: cleaned, and within its size budget. */
|
|
23
|
+
export declare function extractionPayload(events: readonly EvidenceEvent[], base: readonly FactView[]): {
|
|
24
|
+
user: string;
|
|
25
|
+
assistant: string;
|
|
26
|
+
facts: object[];
|
|
27
|
+
} | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Store what an extraction returned, by the same rules as a Worker's record: evidence is checked in
|
|
30
|
+
* the session, and every write expects the version the topic had when the turn ended, so a late
|
|
31
|
+
* extraction cannot overwrite a newer value. Returns how many items were stored.
|
|
32
|
+
*/
|
|
33
|
+
export declare function applyExtraction(store: ContextStore, input: {
|
|
34
|
+
sessionId: string;
|
|
35
|
+
contextId: string;
|
|
36
|
+
events: readonly EvidenceEvent[];
|
|
37
|
+
base: readonly FactView[];
|
|
38
|
+
items: unknown;
|
|
39
|
+
}): number;
|