@kirkchinese/dsh-citeciter 0.2.1 → 0.3.0

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 (35) hide show
  1. package/README.md +65 -38
  2. package/README.zh.md +59 -51
  3. package/lib/client.js +15928 -1067
  4. package/lib/index.js +1094 -242
  5. package/lib/topic-CjNNXSWB.js +211 -0
  6. package/lib/typert-common-CPi6bVCr.js +32 -0
  7. package/lib/typert.host.js +30 -11
  8. package/lib/typert.remote-client.js +2 -2
  9. package/lib/types/client/citation.d.ts +10 -0
  10. package/lib/types/client/companion-controller.d.ts +37 -0
  11. package/lib/types/client/components/CiteCiterSettings.d.ts +7 -0
  12. package/lib/types/client/components/CitePanel.d.ts +7 -10
  13. package/lib/types/client/components/SelectionMenu.d.ts +6 -11
  14. package/lib/types/client/index.d.ts +2 -2
  15. package/lib/types/client/markdown-source-map.d.ts +16 -0
  16. package/lib/types/client/response-guard.d.ts +4 -0
  17. package/lib/types/client/types.d.ts +16 -31
  18. package/lib/types/index.d.ts +33 -22
  19. package/lib/types/observer.d.ts +44 -0
  20. package/lib/types/topic-runtime.d.ts +50 -0
  21. package/lib/types/topic.d.ts +419 -0
  22. package/lib/types/typert-common.d.ts +177 -69
  23. package/lib/types/typert.host.d.ts +445 -58
  24. package/lib/types/typert.remote-client.d.ts +3 -8
  25. package/package.json +58 -32
  26. package/lib/thread-D7ig_Lk7.js +0 -68
  27. package/lib/typert-common-CLPMRe7a.js +0 -51
  28. package/lib/types/client/explainer-controller.d.ts +0 -31
  29. package/lib/types/client/explainer.d.ts +0 -5
  30. package/lib/types/client/thread.d.ts +0 -22
  31. package/lib/types/client/transcript.d.ts +0 -14
  32. package/lib/types/projection.d.ts +0 -4
  33. package/lib/types/read-only.d.ts +0 -13
  34. package/lib/types/thread.d.ts +0 -107
  35. package/lib/types/validation.d.ts +0 -4
package/README.md CHANGED
@@ -1,65 +1,77 @@
1
1
  # `@kirkchinese/dsh-citeciter`
2
2
 
3
- **A learning companion grounded in an exact point of your DeepSeek Harness conversation.** Select text from a completed assistant reply, choose `Citer!`, ask your own question, and continue learning in a durable Citation Thread without writing to the source session.
3
+ **A private learning companion for live DeepSeek Harness conversations.** Select text from a committed assistant model call, ask beside the selection, and continue the discussion in an independent CiteCiter Topic while the source Agent keeps working.
4
4
 
5
- [中文说明](https://github.com/kirkchinese/CiteCiter/blob/main/packages/citeciter/README.zh.md) · [GitHub](https://github.com/kirkchinese/CiteCiter) · [Issues](https://github.com/kirkchinese/CiteCiter/issues)
5
+ [中文说明](README.zh.md) · [GitHub](https://github.com/kirkchinese/CiteCiter) · [Issues](https://github.com/kirkchinese/CiteCiter/issues)
6
6
 
7
- > **Early development:** v0.2.0 introduced the durable Host+Client architecture; v0.2.1 fixes later-turn preparation when DSH treats an already-effective read-only switch as an idempotent no-op. APIs, compatibility, and installation details may still change. Issues and pull requests are welcome.
7
+ > **Early development:** v0.3 replaces ordinary DSH child Threads with private Observer Topics. APIs, storage, compatibility, and installation details may still change.
8
8
 
9
9
  ## Install
10
10
 
11
- CiteCiter requires Node.js `^22.19.0 || >=24.0.0`, DSH Web, and a configured model provider.
11
+ CiteCiter requires Node.js `^22.19.0 || >=24.0.0`, DSH Web `>=0.1.0-rc.7 <0.1.0-rc.8` (tested on `0.1.0-rc.7`), and a configured model provider.
12
12
 
13
13
  ```sh
14
- dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.2.1
14
+ dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.0
15
15
  ```
16
16
 
17
- Restart the corresponding DSH Web process and refresh the page. A restart is required after installation or upgrade because the Host and Typert manifests are loaded at process startup.
18
-
19
- The package declares DSH peers from `^0.1.0-rc.6`. Focused builds use the rc.6 package set; the v0.2 browser flow was also verified on a fresh DSH `0.1.0-rc.7` process.
17
+ Restart the corresponding DSH Web process and refresh the page after installation or upgrade. The Host, Typert descriptors, and browser bundle are resolved when the process starts.
20
18
 
21
19
  ## Use
22
20
 
23
- 1. Select text wholly inside one completed assistant response.
24
- 2. Right-click and choose `Citer!`.
25
- 3. Write a custom first question or use a quick question.
26
- 4. Continue with genuine follow-up turns in the same Thread.
27
- 5. Reopen, switch, rename, or archive Threads from the persistent launcher.
21
+ 1. Select text inside a committed assistant model call. The surrounding Agent turn may still be running.
22
+ 2. Right-click, enter the first question in the selection popover, and choose `Citer!`.
23
+ 3. CiteCiter creates a new Topic for every submission and opens it in the wide learning dock.
24
+ 4. Continue with normal follow-up questions, or reopen an older Topic from CiteCiter's own Topic rail.
25
+ 5. Adjust the model, reasoning effort, title, archive state, and dock width without changing the source Session.
28
26
 
29
- Each Citation creates or reuses an isolated child session at the exact historical boundary. The main DSH session never changes and its log is not modified.
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.
30
28
 
31
- ## What v0.2 implements
29
+ ## What v0.3 implements
32
30
 
33
- - **Exact historical fork.** The browser resolves `data-chat-anchor-key` through the source-session snapshot, requires a finalized assistant node in a closed turn, and forks at its real `anchorSeq`. Key text is never interpreted as an event sequence.
34
- - **Stable Citation identity.** Source session, anchor seq, exact UTF-16 range, selected text, and bounded surrounding evidence are canonicalized and hashed with SHA-256. Different ranges in one answer remain different Citations.
35
- - **Four separate model-input layers.** A scoped system Tutor, the inherited history prefix, durable user-role Citation Context, and genuine user questions retain distinct authority and persistence.
36
- - **Persistent multi-turn Threads.** The first question and follow-ups are normal child-session user messages. The panel shows only child-owned transcript rows, not inherited history or runtime-context plumbing.
37
- - **Recovery and organization.** Host projection data powers a persistent launcher, parent-grouped picker, page-reload/process-restart recovery, rename, switch, and supported workspace archive.
38
- - **Fail-closed isolation.** CiteCiter opens the concrete child without navigating the main GUI, requires matched admission plus durable successful `/permission read-only` settlement and a current read-only sandbox, validates Host lineage and Citation evidence, and guards model tool execution with an explicit allowlist.
39
- - **Parent noninterference.** Citation context, questions, answers, stop operations, errors, and titles belong to the child. Browser smoke checks that the source log's size and nanosecond mtime do not change.
40
- - **Safe rich answers.** Markdown, code, and KaTeX stream normally. Complete safe `svg` fences become inert data-URI images. Complete `html` fences use a script-free, network-free sandboxed iframe. Rejected or incomplete fences remain Markdown code blocks.
41
- - **Fiber-owned cleanup.** Host Agent effects, Client Remote mounts, slots, listeners, subscriptions, animation frames, and in-flight state are reversible. Late async work cannot reinstall state after disposal.
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.
42
41
 
43
- ## Input model
42
+ ## Model input
44
43
 
45
44
  ```text
46
- system: Scoped CiteCiter Tutor
47
- history: exact source-session prefix through the selected assistant boundary
48
- user context: durable, quoted Citation JSON (untrusted data)
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
49
  user: the person's actual first question and follow-ups
50
50
  ```
51
51
 
52
- Citation text never receives system authority, even when it contains instruction-like prose, role-shaped JSON, HTML, or delimiters. The accepted architecture decision and real-model comparison are documented in [`docs/architecture/0001-model-input-layering.md`](https://github.com/kirkchinese/CiteCiter/blob/main/docs/architecture/0001-model-input-layering.md).
52
+ Source text, reasoning, tool arguments, tool results, and workspace files remain untrusted evidence. They never receive system authority. See [ADR 0002](https://github.com/kirkchinese/CiteCiter/blob/main/docs/architecture/0002-observer-learning-companion.zh.md) for the product and storage decisions.
53
+
54
+ ## Upgrade from v0.2
55
+
56
+ Installing v0.3 replaces the plugin code but does not rewrite the source Sessions or v0.2 forked Citation Threads. Those older child Sessions remain ordinary DSH data and are not imported into the v0.3 Topic rail. New discussions use the private v0.3 store.
57
+
58
+ Use a valid three-part version such as `0.3.0`, then verify the installed result rather than relying only on the package-manager completion line:
59
+
60
+ ```sh
61
+ dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.0
62
+ dsh plugin --profile web list --depth 0
63
+ ```
53
64
 
54
65
  ## Compatibility and limitations
55
66
 
56
- - DSH Web and completed `assistant-step` replies only; user messages, input fields, and arbitrary page text are ignored.
57
- - The selection must stay inside one assistant flow. Cross-message and cross-block Citations are not supported.
58
- - Archive hides a Thread through the DSH workspace archive set. CiteCiter has no unarchive UI; selecting the same Citation after archive may create a new active Thread.
59
- - The current read-only tool allowlist is intentionally conservative. `run_code` remains available for sandboxed analysis, but Host preparation durably verifies the read-only sandbox and every nested tool dispatch still passes the authoritative allowlist guard. A tool absent from the running DSH installation is unavailable.
60
- - Rich HTML/SVG rendering is intentionally conservative; rejected content falls back to visible source rather than executing.
61
- - No settings UI, localization framework, mobile-specific layout, or cross-platform browser CI yet.
62
- - DSH is still prerelease software; later DSH APIs may require a CiteCiter update.
67
+ - CiteCiter supports DSH Web and selections contained in one committed assistant flow. Cross-message and cross-block selections are not supported.
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.
63
75
 
64
76
  ## Development
65
77
 
@@ -72,10 +84,25 @@ pnpm --dir packages/citeciter test
72
84
  pnpm run build
73
85
  ```
74
86
 
75
- The repository tracks `packages/citeciter/lib/`. The build removes stale top-level chunks before emitting the Host entry, Client bundle, strict Typert artifacts, and declarations. Reproducible model evaluation, disposable browser smoke, HMR checks, and publish gates are in the [verification guide](https://github.com/kirkchinese/CiteCiter/blob/main/docs/implementation-milestones.md).
87
+ The repository tracks `packages/citeciter/lib/`. Rebuild after changing source or build configuration, and inspect the real npm tarball before publishing.
88
+
89
+ For browser work, use a disposable DSH home and a dynamically assigned port so an existing server on `3080` is never touched:
90
+
91
+ ```sh
92
+ CITECITER_DSH_ROOT="$(mktemp -d /tmp/citeciter-dsh.XXXXXX)"
93
+ mkdir -p "$CITECITER_DSH_ROOT/profiles/node_modules/@kirkchinese"
94
+ ln -s "$(pwd)/packages/citeciter" \
95
+ "$CITECITER_DSH_ROOT/profiles/node_modules/@kirkchinese/dsh-citeciter"
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
+ ```
101
+
102
+ Use the printed URL for browser inspection and stop only that disposable process.
76
103
 
77
104
  ## Contributing and license
78
105
 
79
- CiteCiter is published early so the community can help shape it. Please open an [issue](https://github.com/kirkchinese/CiteCiter/issues) or submit a pull request. Contributor rules are in [AGENTS.md](https://github.com/kirkchinese/CiteCiter/blob/main/AGENTS.md).
106
+ Please open an [issue](https://github.com/kirkchinese/CiteCiter/issues) or submit a pull request. Contributor rules are in [AGENTS.md](https://github.com/kirkchinese/CiteCiter/blob/main/AGENTS.md).
80
107
 
81
108
  MIT © CiteCiter contributors
package/README.zh.md CHANGED
@@ -1,65 +1,77 @@
1
1
  # `@kirkchinese/dsh-citeciter`
2
2
 
3
- **基于精确历史上下文的、隔离式学习伴侣。** 在 DeepSeek Harness(DSH)的一条已完成助手回复中选中文字,右键点击 `Citer!`,提出你真正想问的问题,并在持久 Citation Thread 中继续追问;源会话不会被写入。
3
+ **服务于进行中 DeepSeek Harness 对话的独立学习伴侣。** 在一次已经提交的助手模型调用中选中文字,就地提问;来源 Agent 可以继续工作,讨论则在独立的 CiteCiter Topic 中多轮进行。
4
4
 
5
5
  [English](README.md) · [GitHub](https://github.com/kirkchinese/CiteCiter) · [问题反馈](https://github.com/kirkchinese/CiteCiter/issues)
6
6
 
7
- > **开发状态:** v0.2.0 引入持久化 Host+Client 架构;v0.2.1 修复了 DSH 将已生效的 read-only 重复切换视为幂等 no-op 时,后续追问准备失败的问题。当前仍处于早期开发阶段,API、兼容范围和安装方式仍可能变化。
7
+ > **开发状态:** v0.3 用独立 Observer Topic 取代了普通 DSH 子 Thread。API、存储、兼容范围和安装方式仍可能变化。
8
8
 
9
9
  ## 安装
10
10
 
11
- 需要 Node.js `^22.19.0 || >=24.0.0`、DSH Web 和已配置的模型提供方。
11
+ 需要 Node.js `^22.19.0 || >=24.0.0`、DSH Web `>=0.1.0-rc.7 <0.1.0-rc.8`(当前验证线为 `0.1.0-rc.7`)和已经配置的模型提供方。
12
12
 
13
13
  ```sh
14
- dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.2.1
14
+ dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.0
15
15
  ```
16
16
 
17
- 安装或升级后,请重启对应的 DSH Web 进程并刷新页面。Host 与 Typert 清单在进程启动时加载,因此不能只替换浏览器 bundle。
18
-
19
- 包声明的 DSH peer range 从 `^0.1.0-rc.6` 开始。focused build 使用 rc.6 包集;v0.2 浏览器全链路也在一个全新启动的 DSH `0.1.0-rc.7` 进程中通过验证。
17
+ 安装或升级后,请重启对应的 DSH Web 进程并刷新页面。Host、Typert 描述和浏览器 bundle 都在进程启动时解析。
20
18
 
21
19
  ## 使用
22
20
 
23
- 1. 在一条已经完成的助手回复内部选中文字。
24
- 2. 右键点击 `Citer!`。
25
- 3. 输入自定义首问,或选择一个快捷问题。
26
- 4. 在同一 Thread 中继续真实的多轮追问。
27
- 5. 通过常驻入口恢复、切换、重命名或归档 Thread。
21
+ 1. 在一次已经提交的助手模型调用中选择文字;外层 Agent 轮次可以仍在运行。
22
+ 2. 右键,在选区旁的浮层输入第一个问题,然后点击 `Citer!`。
23
+ 3. CiteCiter 为每次提交创建一个新 Topic,并在宽学习栏中打开它。
24
+ 4. 继续普通多轮追问,或从 CiteCiter 自己的 Topic 栏恢复旧讨论。
25
+ 5. 独立调整模型、思考强度、标题、归档状态和学习栏宽度,不改变来源 Session。
28
26
 
29
- 每条 Citation 都会在所选历史边界创建或复用一个隔离子会话。插件不会切换 DSH 主界面的当前会话,也不会修改源会话日志。
27
+ 默认模式是 Observer。Exact Fork 是来源轮次已经结束时使用的高级模式;`exact-when-available` 在不存在稳定 fork 边界时使用 Observer。
30
28
 
31
- ## v0.2 已实现能力
29
+ ## v0.3 已实现能力
32
30
 
33
- - **精确历史 fork。** 浏览器用 `data-chat-anchor-key` 在源会话 snapshot 中解析真实节点,要求它是已关闭轮次中的最终助手回复,再使用节点的真实 `anchorSeq` fork;绝不从 key 文本猜事件序号。
34
- - **稳定 Citation 身份。** 源会话、anchor seq、UTF-16 精确范围、原文和有界前后文按固定格式序列化并计算 SHA-256。同一回复中的不同选区仍是不同 Citation。
35
- - **四层模型输入。** 受限作用域的 system Tutor、fork 继承的精确历史、持久的 user-role Citation Context,以及真正的用户首问/追问保持不同的权限与持久性。
36
- - **持久多轮 Thread。** 首问和每次追问都是子会话中的普通用户消息。侧栏只展示 Thread 自己拥有的问答/错误,不把继承历史和 runtime-context 内部行混进聊天记录。
37
- - **恢复与组织。** Host projection 驱动常驻入口、按父会话分组的选择器、页面刷新/进程重启恢复、切换、重命名和 DSH workspace 归档。
38
- - **失败即关闭的隔离。** 插件在不导航主界面的情况下打开具体子会话,先要求命令确实匹配,再由 Host 等待 `/permission read-only` 持久成功结算并确认当前 sandbox 仍为只读;随后校验 lineage、边界和 Citation 证据,模型工具执行受显式 allowlist 保护。
39
- - **父日志零干扰。** Citation context、提问、回答、停止、错误和标题都属于子会话。浏览器 smoke 会比较源日志的文件大小和纳秒 mtime。
40
- - **富内容安全。** Markdown、代码和 KaTeX 正常流式显示;完整且安全的 `svg` 围栏成为惰性 data-URI 图片;完整 `html` 围栏进入禁脚本、禁网络的 sandbox iframe;不安全或未闭合内容回退为 Markdown 源码。
41
- - **Fiber 生命周期。** Host Agent 作用域、Client Remote、slot、listener、订阅、动画帧和异步状态都可逆;销毁后的延迟异步结果不能重新安装状态。
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 处理会在内容不完整或不安全时显示源码。
42
41
 
43
42
  ## 模型输入结构
44
43
 
45
44
  ```text
46
- system:仅作用于该 Thread 的 CiteCiter Tutor
47
- history:截至所选助手边界的精确源会话前缀
48
- user context:持久、被引用的 Citation JSON(不可信数据)
49
- user:用户真正输入的首问与后续追问
45
+ system:Topic 作用域的 CiteCiter Tutor 与只读策略
46
+ history:该 Topic 自己的 DSH 历史;只有 Exact Fork 额外带冻结前缀
47
+ user context:持久 Citation 记录,并明确标记为不可信证据
48
+ tool result:按需读取的有界来源 Session 或来源工作区证据
49
+ user:用户真正输入的首问和后续问题
50
50
  ```
51
51
 
52
- 即使选中文本包含命令口吻、role JSON、HTML 或分隔符,它也不会获得 system 权限。架构决策与同题同模型真实对比见 [`docs/architecture/0001-model-input-layering.md`](https://github.com/kirkchinese/CiteCiter/blob/main/docs/architecture/0001-model-input-layering.md)。
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` 这样的合法三段版本号,并检查实际安装结果,不要只依赖包管理器显示的完成提示:
59
+
60
+ ```sh
61
+ dsh plugin --profile web add @kirkchinese/dsh-citeciter@0.3.0
62
+ dsh plugin --profile web list --depth 0
63
+ ```
53
64
 
54
- ## 兼容性与已知限制
65
+ ## 兼容性与限制
55
66
 
56
- - 只支持 DSH Web 中已完成的 `assistant-step`;不处理用户消息、输入框或任意页面文本。
57
- - 选区必须完整位于同一助手 flow;暂不支持跨消息或跨 block Citation。
58
- - 归档使用 DSH workspace 全局归档集合隐藏 Thread。CiteCiter 暂无取消归档 UI;归档后再次选择同一 Citation 可能创建新的活跃 Thread。
59
- - 只读工具 allowlist 有意保持保守。`run_code` 只用于 sandbox 内分析;Host 准备阶段会持久确认 read-only sandbox,每次嵌套工具分派仍经过权威 allowlist guard。当前 DSH 未安装的工具自然不可用。
60
- - HTML/SVG 安全策略有意保守,被拒绝的内容显示源码而不执行。
61
- - 暂无设置 UI、完整国际化框架、移动端专项布局和跨平台浏览器 CI。
62
- - DSH 仍处于预发布阶段,后续 API 变化可能要求同步适配。
67
+ - CiteCiter 支持 DSH Web,以及完整位于一个已提交助手 flow 内的选区;暂不支持跨消息或跨 block 引用。
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。
63
75
 
64
76
  ## 构建与验证
65
77
 
@@ -72,29 +84,25 @@ pnpm --dir packages/citeciter test
72
84
  pnpm run build
73
85
  ```
74
86
 
75
- 仓库跟踪 `packages/citeciter/lib/`。构建会先清理过期的顶层 hash chunk,再生成 Host 入口、Client bundle、严格 Typert 清单和 declaration。真实模型分层实验、临时 DSH_HOME 浏览器 smoke、HMR 检查和发布门禁见 [`docs/implementation-milestones.md`](https://github.com/kirkchinese/CiteCiter/blob/main/docs/implementation-milestones.md)。
87
+ 仓库跟踪 `packages/citeciter/lib/`。修改源码或构建配置后必须重新构建,并在发布前检查真实 npm tarball。
76
88
 
77
- ## 本地浏览器验证
89
+ 浏览器开发应使用一次性 DSH home 和动态端口,绝不触碰已经运行在 `3080` 的服务:
78
90
 
79
91
  ```sh
80
- pnpm --filter @kirkchinese/dsh-citeciter exec playwright install chromium
81
- rm -rf /tmp/citeciter-dsh-home
82
- mkdir -p /tmp/citeciter-dsh-home/profiles/node_modules/@kirkchinese
83
- ln -sfn "$(pwd)/packages/citeciter" \
84
- /tmp/citeciter-dsh-home/profiles/node_modules/@kirkchinese/dsh-citeciter
92
+ CITECITER_DSH_ROOT="$(mktemp -d /tmp/citeciter-dsh.XXXXXX)"
93
+ mkdir -p "$CITECITER_DSH_ROOT/profiles/node_modules/@kirkchinese"
94
+ ln -s "$(pwd)/packages/citeciter" \
95
+ "$CITECITER_DSH_ROOT/profiles/node_modules/@kirkchinese/dsh-citeciter"
85
96
  node packages/citeciter/dev/seed-smoke-session.mjs \
86
- /tmp/citeciter-dsh-home "$(pwd)"
87
- DSH_HOME=/tmp/citeciter-dsh-home dsh --profile web \
88
- --patch "$(pwd)/packages/citeciter/dev/patch.yml" --port 3907
89
- node packages/citeciter/dev/smoke.mjs \
90
- http://127.0.0.1:3907 CiteCiter \
91
- /tmp/citeciter-dsh-home/citeciter-smoke.json
97
+ "$CITECITER_DSH_ROOT" "$(pwd)"
98
+ DSH_HOME="$CITECITER_DSH_ROOT" dsh --profile web \
99
+ --patch "$(pwd)/packages/citeciter/dev/patch.yml" --port 0
92
100
  ```
93
101
 
94
- Smoke 使用真实渲染的 `14:assistant-step1:1` 节点和真实 `anchorSeq: 6`,验证自定义首问、持久投影、恢复、重命名、常驻入口、侧栏宽度、父日志 revision 与浏览器错误。临时 profile 没有模型凭据时,正常的 provider 错误也只会在 read-only、Remote 准备、Citation Context 和真实用户消息全部成功后出现。
102
+ 使用命令打印的 URL 进行浏览器检查,并且只停止这个一次性进程。
95
103
 
96
104
  ## 贡献与许可证
97
105
 
98
- 请到 [GitHub](https://github.com/kirkchinese/CiteCiter) 提 Issue 或 Pull Request,并先阅读仓库 [`AGENTS.md`](https://github.com/kirkchinese/CiteCiter/blob/main/AGENTS.md)。
106
+ 请到 [GitHub](https://github.com/kirkchinese/CiteCiter) 提交 Issue 或 Pull Request,并先阅读仓库 [AGENTS.md](https://github.com/kirkchinese/CiteCiter/blob/main/AGENTS.md)。
99
107
 
100
108
  MIT © CiteCiter contributors