@kirkchinese/dsh-citeciter 0.3.0 → 0.3.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 +34 -77
- package/README.zh.md +32 -75
- package/lib/client.js +484 -105
- package/lib/index.js +183 -16
- package/lib/{topic-CjNNXSWB.js → topic-BfAp9KoS.js} +68 -10
- package/lib/{typert-common-CPi6bVCr.js → typert-common-DXguoziV.js} +1 -1
- package/lib/typert.host.js +2 -2
- package/lib/typert.remote-client.js +1 -1
- package/lib/types/client/companion-controller.d.ts +3 -1
- package/lib/types/client/components/QuestionCard.d.ts +8 -0
- package/lib/types/index.d.ts +2 -2
- package/lib/types/topic-runtime.d.ts +6 -0
- package/lib/types/topic.d.ts +159 -19
- package/lib/types/typert-common.d.ts +55 -6
- package/lib/types/typert.host.d.ts +150 -18
- package/package.json +13 -1
package/README.md
CHANGED
|
@@ -1,108 +1,65 @@
|
|
|
1
1
|
# `@kirkchinese/dsh-citeciter`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A private learning companion for live DeepSeek Harness conversations. Select text from a committed assistant response, ask beside the source, and continue in an independent multi-turn Topic while the source Agent keeps working.
|
|
4
4
|
|
|
5
|
-
[
|
|
6
|
-
|
|
7
|
-
> **Early development:** v0.3 replaces ordinary DSH child Threads with private Observer Topics. APIs, storage, compatibility, and installation details may still change.
|
|
5
|
+
[简体中文](README.zh.md) · [GitHub](https://github.com/kirkchinese/CiteCiter) · [Issues](https://github.com/kirkchinese/CiteCiter/issues)
|
|
8
6
|
|
|
9
7
|
## Install
|
|
10
8
|
|
|
11
|
-
CiteCiter requires Node.js `^22.19.0 || >=24.0.0`, DSH Web `>=0.1.0-rc.7 <0.1.0-rc.8
|
|
9
|
+
CiteCiter requires Node.js `^22.19.0 || >=24.0.0`, DSH Web `>=0.1.0-rc.7 <0.1.0-rc.8`, and a configured model provider.
|
|
12
10
|
|
|
13
11
|
```sh
|
|
14
|
-
dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.
|
|
12
|
+
dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.1
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
Restart the corresponding DSH Web process and refresh the page after installation or upgrade.
|
|
15
|
+
Restart the corresponding DSH Web process and refresh the page after installation or upgrade.
|
|
18
16
|
|
|
19
17
|
## Use
|
|
20
18
|
|
|
21
19
|
1. Select text inside a committed assistant model call. The surrounding Agent turn may still be running.
|
|
22
|
-
2. Right-click, enter
|
|
23
|
-
3. CiteCiter creates a new Topic
|
|
24
|
-
4. Continue
|
|
25
|
-
5.
|
|
26
|
-
|
|
27
|
-
The default mode is Observer. Exact Fork remains an advanced mode for a source turn that has already ended; `exact-when-available` uses Observer when that stable fork boundary does not exist.
|
|
28
|
-
|
|
29
|
-
## What v0.3 implements
|
|
30
|
-
|
|
31
|
-
- **Model-call citation boundary.** A committed `assistant/message` is enough to create an Observer Topic; CiteCiter does not wait for `turn/end`.
|
|
32
|
-
- **Exact Markdown selections.** Rendered selections map through GFM source positions to the original Markdown. Emphasis, deletion, links, and code retain Host-verifiable UTF-16 ranges while the UI keeps the text the user actually saw.
|
|
33
|
-
- **One submission, one Topic.** Repeating the same selection creates another private conversation instead of silently reusing an earlier one.
|
|
34
|
-
- **Private standard DSH Sessions.** Topic logs use the DSH Session, Agent Loop, tool, title, and persistence services under CiteCiter-owned storage in `$DSH_HOME/citeciter/`; they do not appear in the ordinary Session list.
|
|
35
|
-
- **Bound Observer evidence.** The Topic-only `read_source_session` tool reads structured committed events from its fixed source Session, records the captured seq, and never exposes the physical Session file to the model.
|
|
36
|
-
- **Independent titles and model controls.** New Topics copy the source model route, generate a DSH title after the first prompt, and can later switch model and reasoning effort independently.
|
|
37
|
-
- **Source-aware settings.** The DSH settings page controls the default context mode, source reasoning, optional read-only source-file access, dock width, and reopening the last Topic.
|
|
38
|
-
- **Read-only execution.** The private Agent uses a read-only sandbox. Only `read_source_session` and, when enabled and available, the standard file `read` tool reach the model.
|
|
39
|
-
- **Independent lifecycle.** Topics can be reopened, renamed, archived, restored, stopped, and continued without navigating or writing to the source Session.
|
|
40
|
-
- **Safe rich answers.** Markdown, code, and KaTeX render normally. Conservative SVG and sandboxed HTML handling falls back to visible source when content is incomplete or unsafe.
|
|
41
|
-
|
|
42
|
-
## Model input
|
|
43
|
-
|
|
44
|
-
```text
|
|
45
|
-
system: the Topic-scoped CiteCiter Tutor and read-only policy
|
|
46
|
-
history: this Topic's own DSH history (plus a frozen prefix only in Exact Fork)
|
|
47
|
-
user context: the durable Citation record, explicitly marked as untrusted evidence
|
|
48
|
-
tool result: bounded source Session or source-workspace evidence read on demand
|
|
49
|
-
user: the person's actual first question and follow-ups
|
|
50
|
-
```
|
|
20
|
+
2. Right-click the selection, enter your first question, and choose `Citer!`.
|
|
21
|
+
3. CiteCiter creates a new Topic in the learning dock.
|
|
22
|
+
4. Continue asking questions there, or reopen an earlier Topic from CiteCiter's Topic rail.
|
|
23
|
+
5. Change the Topic model, reasoning effort, title, archive state, or dock width without changing the source Session.
|
|
51
24
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
## Upgrade from v0.2
|
|
25
|
+
## Highlights
|
|
55
26
|
|
|
56
|
-
|
|
27
|
+
- **Model-call citations.** Start as soon as an `assistant/message` is committed; there is no need to wait for the full Agent turn.
|
|
28
|
+
- **Private Topics.** Each submission creates an independent DSH Session under `$DSH_HOME/citeciter/`, outside the ordinary Session list.
|
|
29
|
+
- **Precise selections.** Visible Markdown selections map back to Host-verifiable source ranges.
|
|
30
|
+
- **Bound evidence.** `read_source_session` reads committed events from one fixed source Session without exposing its physical log path.
|
|
31
|
+
- **Open-ended investigation.** The standard read-only `glob` and `grep` tools discover project files and search their contents before `read` opens a known path.
|
|
32
|
+
- **Read-only operation.** CiteCiter cannot write to the source Session or source workspace.
|
|
33
|
+
- **Inspectable workflow.** Live reasoning, prompt injections, tool calls, results, and user questions use compact expandable rows inside the learning dock.
|
|
34
|
+
- **Native workflow.** The selection popover, resizable learning dock, active/archive Topic navigation, and settings remain inside the DSH programming interface.
|
|
57
35
|
|
|
58
|
-
|
|
36
|
+
## Context modes
|
|
59
37
|
|
|
60
|
-
|
|
61
|
-
dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.0
|
|
62
|
-
dsh plugin --profile web list --depth 0
|
|
63
|
-
```
|
|
38
|
+
Observer is the default. It creates an independent Topic and reads committed source evidence on demand, including while the source turn is still running.
|
|
64
39
|
|
|
65
|
-
|
|
40
|
+
Exact Fork is an advanced mode for a source turn that has already ended. `exact-when-available` uses Exact Fork when a stable boundary exists and otherwise falls back to Observer.
|
|
66
41
|
|
|
67
|
-
|
|
68
|
-
- KaTeX layout and footnote numbers are renderer-generated DOM without stable source-character coordinates, so selecting those elements does not open CiteCiter; ordinary text around a formula remains citable.
|
|
69
|
-
- Observer sees only committed Session events. It cannot cite an unfinished streaming fragment that has not produced `assistant/message`.
|
|
70
|
-
- Source reasoning is available only when it was recorded by the source provider and the CiteCiter setting remains enabled.
|
|
71
|
-
- Source-file access requires the running DSH composition to provide its filesystem service; it remains read-only and can be disabled.
|
|
72
|
-
- A missing source Session does not delete an existing Topic, but fresh source reads fail and the dock reports that the source is unavailable.
|
|
73
|
-
- The interface currently uses Chinese product copy and has no complete localization or cross-platform browser CI.
|
|
74
|
-
- DSH remains prerelease software; later DSH APIs may require a CiteCiter update.
|
|
75
|
-
|
|
76
|
-
## Development
|
|
77
|
-
|
|
78
|
-
From the repository root:
|
|
42
|
+
## Upgrade from v0.2
|
|
79
43
|
|
|
80
44
|
```sh
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
pnpm --dir packages/citeciter test
|
|
84
|
-
pnpm run build
|
|
45
|
+
dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.1
|
|
46
|
+
dsh plugin --profile web list --depth 0
|
|
85
47
|
```
|
|
86
48
|
|
|
87
|
-
The
|
|
49
|
+
The upgrade does not rewrite source Sessions or import v0.2 Citation Threads. Existing child Sessions remain ordinary DSH data; new discussions use private v0.3 Topics.
|
|
88
50
|
|
|
89
|
-
|
|
51
|
+
## Limitations
|
|
90
52
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
node packages/citeciter/dev/seed-smoke-session.mjs \
|
|
97
|
-
"$CITECITER_DSH_ROOT" "$(pwd)"
|
|
98
|
-
DSH_HOME="$CITECITER_DSH_ROOT" dsh --profile web \
|
|
99
|
-
--patch "$(pwd)/packages/citeciter/dev/patch.yml" --port 0
|
|
100
|
-
```
|
|
53
|
+
- A selection must stay inside one committed assistant flow. Streaming fragments and cross-message selections are not supported.
|
|
54
|
+
- Renderer-generated KaTeX layout and footnote numbers cannot be cited directly because they lack stable source coordinates.
|
|
55
|
+
- Exact Fork cannot start from an open source turn.
|
|
56
|
+
- Source-file access depends on the running DSH filesystem service and remains read-only.
|
|
57
|
+
- DSH is prerelease software; later DSH API versions may require a CiteCiter update.
|
|
101
58
|
|
|
102
|
-
|
|
59
|
+
## Contributing
|
|
103
60
|
|
|
104
|
-
|
|
61
|
+
Issues and pull requests are welcome. Before submitting code, read the [contribution guide](https://github.com/kirkchinese/CiteCiter/blob/main/CONTRIBUTING.md).
|
|
105
62
|
|
|
106
|
-
|
|
63
|
+
## License
|
|
107
64
|
|
|
108
65
|
MIT © CiteCiter contributors
|
package/README.zh.md
CHANGED
|
@@ -1,108 +1,65 @@
|
|
|
1
1
|
# `@kirkchinese/dsh-citeciter`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
服务于进行中 DeepSeek Harness 对话的独立学习伴侣。在已经提交的助手回答中选中文字,就地提问;来源 Agent 可以继续工作,讨论则在独立 Topic 中多轮进行。
|
|
4
4
|
|
|
5
5
|
[English](README.md) · [GitHub](https://github.com/kirkchinese/CiteCiter) · [问题反馈](https://github.com/kirkchinese/CiteCiter/issues)
|
|
6
6
|
|
|
7
|
-
> **开发状态:** v0.3 用独立 Observer Topic 取代了普通 DSH 子 Thread。API、存储、兼容范围和安装方式仍可能变化。
|
|
8
|
-
|
|
9
7
|
## 安装
|
|
10
8
|
|
|
11
|
-
需要 Node.js `^22.19.0 || >=24.0.0`、DSH Web `>=0.1.0-rc.7 <0.1.0-rc.8
|
|
9
|
+
CiteCiter 需要 Node.js `^22.19.0 || >=24.0.0`、DSH Web `>=0.1.0-rc.7 <0.1.0-rc.8`,以及已经配置的模型提供方。
|
|
12
10
|
|
|
13
11
|
```sh
|
|
14
|
-
dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.
|
|
12
|
+
dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.1
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
安装或升级后,请重启对应的 DSH Web 进程并刷新页面。
|
|
15
|
+
安装或升级后,请重启对应的 DSH Web 进程并刷新页面。
|
|
18
16
|
|
|
19
17
|
## 使用
|
|
20
18
|
|
|
21
19
|
1. 在一次已经提交的助手模型调用中选择文字;外层 Agent 轮次可以仍在运行。
|
|
22
|
-
2.
|
|
23
|
-
3. CiteCiter
|
|
24
|
-
4.
|
|
20
|
+
2. 右键选区,输入第一个问题,然后点击 `Citer!`。
|
|
21
|
+
3. CiteCiter 在学习栏中创建一个新 Topic。
|
|
22
|
+
4. 在 Topic 中继续追问,或从 CiteCiter 的 Topic 栏恢复旧讨论。
|
|
25
23
|
5. 独立调整模型、思考强度、标题、归档状态和学习栏宽度,不改变来源 Session。
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## v0.3 已实现能力
|
|
30
|
-
|
|
31
|
-
- **模型调用级引用。** 已提交的 `assistant/message` 足以创建 Observer Topic,不需要等待 `turn/end`。
|
|
32
|
-
- **精确 Markdown 选区。** 渲染后的可见选区会通过 GFM 源位置映射回原始 Markdown;强调、删除线、链接和代码中的引用都保留 Host 可复验的 UTF-16 范围,UI 仍显示用户看到的文字。
|
|
33
|
-
- **一次提交一个 Topic。** 即使选区相同,再次提交也会创建另一条独立对话,不会静默复用旧讨论。
|
|
34
|
-
- **独立的标准 DSH Session。** Topic 在 `$DSH_HOME/citeciter/` 下使用 DSH Session、Agent Loop、工具、标题和持久化服务,不进入普通 Session 列表。
|
|
35
|
-
- **绑定来源的 Observer 证据。** Topic 专属的 `read_source_session` 只读取固定来源 Session 的结构化已提交事件,记录实际捕获 seq,并且不向模型暴露物理 Session 文件。
|
|
36
|
-
- **独立标题和模型控制。** 新 Topic 复制来源模型路由,在首问后通过 DSH 标题流程生成标题,之后可以独立切换模型和思考强度。
|
|
37
|
-
- **来源与界面设置。** DSH 设置页可以配置默认上下文模式、来源 reasoning、可选的只读来源文件访问、学习栏宽度和是否恢复上次 Topic。
|
|
38
|
-
- **只读执行。** 独立 Agent 使用 read-only sandbox。只有 `read_source_session`,以及启用且可用时的标准文件 `read` 工具会提供给模型。
|
|
39
|
-
- **独立生命周期。** Topic 可以恢复、重命名、归档、取消归档、停止和继续,而不导航或写入来源 Session。
|
|
40
|
-
- **安全富文本。** Markdown、代码和 KaTeX 正常渲染;保守的 SVG 与沙箱 HTML 处理会在内容不完整或不安全时显示源码。
|
|
41
|
-
|
|
42
|
-
## 模型输入结构
|
|
43
|
-
|
|
44
|
-
```text
|
|
45
|
-
system:Topic 作用域的 CiteCiter Tutor 与只读策略
|
|
46
|
-
history:该 Topic 自己的 DSH 历史;只有 Exact Fork 额外带冻结前缀
|
|
47
|
-
user context:持久 Citation 记录,并明确标记为不可信证据
|
|
48
|
-
tool result:按需读取的有界来源 Session 或来源工作区证据
|
|
49
|
-
user:用户真正输入的首问和后续问题
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
来源文本、reasoning、工具参数、工具结果和工作区文件始终是不可信证据,不会获得 system 权限。产品与存储决定见 [ADR 0002](https://github.com/kirkchinese/CiteCiter/blob/main/docs/architecture/0002-observer-learning-companion.zh.md)。
|
|
53
|
-
|
|
54
|
-
## 从 v0.2 升级
|
|
55
|
-
|
|
56
|
-
安装 v0.3 会替换插件代码,但不会改写来源 Session 或 v0.2 fork 出来的 Citation Thread。旧子 Session 仍是普通 DSH 数据,不会导入 v0.3 Topic 栏;新讨论使用 v0.3 独立存储。
|
|
57
|
-
|
|
58
|
-
请使用 `0.3.0` 这样的合法三段版本号,并检查实际安装结果,不要只依赖包管理器显示的完成提示:
|
|
25
|
+
## 核心能力
|
|
59
26
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
27
|
+
- **模型调用级引用。** `assistant/message` 一经提交即可开始,无需等待整个 Agent 轮次结束。
|
|
28
|
+
- **私有 Topic。** 每次提交都会在 `$DSH_HOME/citeciter/` 下创建独立 DSH Session,不进入普通 Session 列表。
|
|
29
|
+
- **精确选区。** 可见 Markdown 选区会映射回 Host 可复验的原文范围。
|
|
30
|
+
- **绑定来源的证据。** `read_source_session` 只读取一个固定来源 Session 的已提交事件,不暴露物理日志路径。
|
|
31
|
+
- **开放式项目调查。** 标准只读 `glob` 与 `grep` 先发现项目文件并搜索内容,再由 `read` 打开已知路径。
|
|
32
|
+
- **只读运行。** CiteCiter 不能写入来源 Session 或来源工作区。
|
|
33
|
+
- **可检查的对话流程。** 实时思考、提示词注入、工具调用、结果和用户提问都在学习栏中以紧凑可展开行显示。
|
|
34
|
+
- **原生工作流。** 选区浮层、可调宽学习栏、活动/归档 Topic 导航和设置都保留在 DSH 编程界面内。
|
|
64
35
|
|
|
65
|
-
##
|
|
36
|
+
## 上下文模式
|
|
66
37
|
|
|
67
|
-
|
|
68
|
-
- KaTeX 排版和脚注编号是渲染器生成的 DOM,没有稳定的原文字符坐标,因此直接选中这些元素不会打开 CiteCiter;公式周围的普通文本仍可引用。
|
|
69
|
-
- Observer 只能看到已经提交的 Session 事件,不能引用尚未形成 `assistant/message` 的流式片段。
|
|
70
|
-
- 只有来源提供方实际记录了 reasoning 且 CiteCiter 设置保持开启时,来源 reasoning 才可读取。
|
|
71
|
-
- 来源文件访问要求当前 DSH 组合提供文件系统服务;它始终只读,并且可以关闭。
|
|
72
|
-
- 来源 Session 缺失不会删除已有 Topic,但新的来源读取会失败,学习栏会显示来源不可用。
|
|
73
|
-
- 界面目前使用中文产品文案,尚无完整国际化和跨平台浏览器 CI。
|
|
74
|
-
- DSH 仍处于预发布阶段,后续 DSH API 变化可能要求同步更新 CiteCiter。
|
|
38
|
+
Observer 是默认模式。它创建独立 Topic,并按需读取已经提交的来源证据;来源轮次仍在运行时也可以使用。
|
|
75
39
|
|
|
76
|
-
|
|
40
|
+
Exact Fork 是面向已结束来源轮次的高级模式。`exact-when-available` 在存在稳定边界时使用 Exact Fork,否则回退到 Observer。
|
|
77
41
|
|
|
78
|
-
|
|
42
|
+
## 从 v0.2 升级
|
|
79
43
|
|
|
80
44
|
```sh
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
pnpm --dir packages/citeciter test
|
|
84
|
-
pnpm run build
|
|
45
|
+
dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.1
|
|
46
|
+
dsh plugin --profile web list --depth 0
|
|
85
47
|
```
|
|
86
48
|
|
|
87
|
-
|
|
49
|
+
升级不会改写来源 Session,也不会导入 v0.2 Citation Thread。旧子 Session 仍是普通 DSH 数据;新讨论使用私有 v0.3 Topic。
|
|
88
50
|
|
|
89
|
-
|
|
51
|
+
## 已知限制
|
|
90
52
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
node packages/citeciter/dev/seed-smoke-session.mjs \
|
|
97
|
-
"$CITECITER_DSH_ROOT" "$(pwd)"
|
|
98
|
-
DSH_HOME="$CITECITER_DSH_ROOT" dsh --profile web \
|
|
99
|
-
--patch "$(pwd)/packages/citeciter/dev/patch.yml" --port 0
|
|
100
|
-
```
|
|
53
|
+
- 选区必须完整位于一个已经提交的助手 flow;暂不支持流式片段和跨消息选区。
|
|
54
|
+
- 渲染器生成的 KaTeX 排版和脚注编号没有稳定原文坐标,不能直接引用。
|
|
55
|
+
- Exact Fork 不能从仍在运行的来源轮次开始。
|
|
56
|
+
- 来源文件访问依赖当前 DSH 文件系统服务,并始终保持只读。
|
|
57
|
+
- DSH 仍处于预发布阶段,后续 API 版本可能要求同步更新 CiteCiter。
|
|
101
58
|
|
|
102
|
-
|
|
59
|
+
## 参与贡献
|
|
103
60
|
|
|
104
|
-
|
|
61
|
+
欢迎提交 Issue 和 Pull Request。提交代码前请阅读[贡献文档](https://github.com/kirkchinese/CiteCiter/blob/main/CONTRIBUTING.zh.md)。
|
|
105
62
|
|
|
106
|
-
|
|
63
|
+
## 许可证
|
|
107
64
|
|
|
108
65
|
MIT © CiteCiter contributors
|