dsh-typst-plugin 0.1.0-alpha.0 → 0.1.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.
- package/README.en.md +86 -52
- package/README.md +93 -59
- package/cordis.patch.yml +1 -1
- package/docs/images/icon.png +0 -0
- package/lib/client.js +2088 -1136
- package/lib/client.js.map +4 -4
- package/lib/config.d.ts +66 -9
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +161 -25
- package/lib/config.js.map +1 -7
- package/lib/constants.d.ts +21 -2
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +83 -60
- package/lib/constants.js.map +1 -7
- package/lib/contract.d.ts +90 -6
- package/lib/contract.d.ts.map +1 -1
- package/lib/contract.js +9 -1
- package/lib/contract.js.map +1 -7
- package/lib/diagnostic-text.d.ts +13 -0
- package/lib/diagnostic-text.d.ts.map +1 -0
- package/lib/diagnostic-text.js +28 -0
- package/lib/diagnostic-text.js.map +1 -0
- package/lib/errors.d.ts +57 -15
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +154 -79
- package/lib/errors.js.map +1 -7
- package/lib/host/facts.d.ts.map +1 -1
- package/lib/host/facts.js +133 -139
- package/lib/host/facts.js.map +1 -7
- package/lib/host/which.d.ts +20 -0
- package/lib/host/which.d.ts.map +1 -0
- package/lib/host/which.js +50 -0
- package/lib/host/which.js.map +1 -0
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -7
- package/lib/remote.d.ts +5 -4
- package/lib/remote.d.ts.map +1 -1
- package/lib/remote.js +153 -143
- package/lib/remote.js.map +1 -7
- package/lib/service.d.ts +28 -4
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +202 -99
- package/lib/service.js.map +1 -7
- package/lib/skills/typst.js +74 -68
- package/lib/skills/typst.js.map +1 -7
- package/lib/status-codec.js +10 -5
- package/lib/status-codec.js.map +1 -7
- package/lib/tools/registration.d.ts +4 -3
- package/lib/tools/registration.d.ts.map +1 -1
- package/lib/tools/registration.js +726 -493
- package/lib/tools/registration.js.map +1 -7
- package/lib/tools/shared.d.ts +4 -5
- package/lib/tools/shared.d.ts.map +1 -1
- package/lib/tools/shared.js +73 -64
- package/lib/tools/shared.js.map +1 -7
- package/lib/typert.d.ts +5 -3
- package/lib/typert.d.ts.map +1 -1
- package/lib/typert.js +113 -64
- package/lib/typert.js.map +1 -7
- package/lib/typst/diagnostics.d.ts.map +1 -1
- package/lib/typst/diagnostics.js +218 -152
- package/lib/typst/diagnostics.js.map +1 -7
- package/lib/typst/flags.d.ts +8 -0
- package/lib/typst/flags.d.ts.map +1 -0
- package/lib/typst/flags.js +8 -0
- package/lib/typst/flags.js.map +1 -0
- package/lib/typst/locate.d.ts +6 -13
- package/lib/typst/locate.d.ts.map +1 -1
- package/lib/typst/locate.js +138 -180
- package/lib/typst/locate.js.map +1 -7
- package/lib/typst/mainfile.d.ts +23 -4
- package/lib/typst/mainfile.d.ts.map +1 -1
- package/lib/typst/mainfile.js +131 -59
- package/lib/typst/mainfile.js.map +1 -7
- package/lib/typst/match.d.ts +9 -1
- package/lib/typst/match.d.ts.map +1 -1
- package/lib/typst/match.js +213 -157
- package/lib/typst/match.js.map +1 -7
- package/lib/typst/oneshot.d.ts +8 -5
- package/lib/typst/oneshot.d.ts.map +1 -1
- package/lib/typst/oneshot.js +76 -66
- package/lib/typst/oneshot.js.map +1 -7
- package/lib/typst/owners.d.ts +28 -0
- package/lib/typst/owners.d.ts.map +1 -0
- package/lib/typst/owners.js +98 -0
- package/lib/typst/owners.js.map +1 -0
- package/lib/typst/pdf-extract.d.ts +1 -2
- package/lib/typst/pdf-extract.d.ts.map +1 -1
- package/lib/typst/pdf-extract.js +98 -74
- package/lib/typst/pdf-extract.js.map +1 -7
- package/lib/typst/process.d.ts +73 -0
- package/lib/typst/process.d.ts.map +1 -0
- package/lib/typst/process.js +147 -0
- package/lib/typst/process.js.map +1 -0
- package/lib/typst/text.d.ts +4 -7
- package/lib/typst/text.d.ts.map +1 -1
- package/lib/typst/text.js +258 -290
- package/lib/typst/text.js.map +1 -7
- package/lib/typst/watcher.d.ts +16 -17
- package/lib/typst/watcher.d.ts.map +1 -1
- package/lib/typst/watcher.js +199 -208
- package/lib/typst/watcher.js.map +1 -7
- package/lib/wire-schemas.d.ts +8 -153
- package/lib/wire-schemas.d.ts.map +1 -1
- package/lib/wire-schemas.js +405 -361
- package/lib/wire-schemas.js.map +1 -7
- package/lib/workspace/containment.d.ts +25 -0
- package/lib/workspace/containment.d.ts.map +1 -0
- package/lib/workspace/containment.js +54 -0
- package/lib/workspace/containment.js.map +1 -0
- package/lib/workspace/session.d.ts +73 -14
- package/lib/workspace/session.d.ts.map +1 -1
- package/lib/workspace/session.js +1516 -1172
- package/lib/workspace/session.js.map +1 -7
- package/locale/en.json +8 -2
- package/locale/zh.json +8 -2
- package/package.json +36 -179
- package/release-provenance.json +137 -0
- package/lib/typst/pdfjs-worker.d.js +0 -1
- package/lib/typst/pdfjs-worker.d.js.map +0 -7
package/README.en.md
CHANGED
|
@@ -1,55 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
English · [简体中文](README.md)
|
|
4
|
-
|
|
5
|
-
The Typst plugin for DeepSeek Harness: a live typesetting preview in a right-sidebar panel while the agent writes and fixes your document, driven by **the Typst installed on your computer** — your fonts, your downloaded packages, your Typst version — so the preview matches what `typst compile` produces in your terminal. Each save (yours or the agent's) recompiles incrementally and redraws the visible pages in place, without flicker and without losing your place. The agent reads errors with file:line, the source line, `hint:` lines and the call trace, looks at rendered pages as images, points at places in the preview, and exports PDFs; you can select text in the preview and send it to the agent together with its source location.
|
|
6
|
-
|
|
7
|
-
The package ships built; nothing needs to be compiled at install time. It needs:
|
|
8
|
-
|
|
9
|
-
- Node.js 24+ and a DeepSeek Harness Web UI with the right docking sidebar;
|
|
10
|
-
- **Typst 0.12 or later** installed locally, for example `brew install typst` (macOS), `winget install --id Typst.Typst` (Windows), `cargo install --locked typst-cli`, or a release from <https://github.com/typst/typst/releases>.
|
|
1
|
+
<div align="center">
|
|
11
2
|
|
|
12
|
-
|
|
3
|
+
# dsh-typst
|
|
13
4
|
|
|
14
|
-
|
|
5
|
+
<img
|
|
6
|
+
src="https://readme-typing-svg.demolab.com?font=JetBrains+Mono&weight=500&size=18&pause=2000&color=239DAD¢er=true&vCenter=true&width=760&lines=%3E+Write+and+fix+Typst+documents+in+place.%3B%3E+Watch+every+save+redraw+the+page.%3B%3E+Hand+the+agent+diagnostics%2C+rendered+pages+and+PDF+export."
|
|
7
|
+
alt="dsh-typst"
|
|
8
|
+
/>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white" alt="powered by dsh" style="max-width:100%;"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/dsh-typst-plugin"><img src="https://img.shields.io/npm/v/dsh-typst-plugin" alt="npm version" style="max-width:100%;"></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/dsh-typst-plugin"><img src="https://img.shields.io/npm/dm/dsh-typst-plugin" alt="npm downloads" style="max-width:100%;"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/dsh-typst-plugin"><img src="https://img.shields.io/npm/l/dsh-typst-plugin" alt="license" style="max-width:100%;"></a>
|
|
14
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness/releases"><img src="https://img.shields.io/badge/dsh-0.2.2--rc.5-blue" alt="dsh version" style="max-width:100%;"></a>
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<b>English</b> · <a href="README.md"><b>中文</b></a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
dsh-typst brings your local Typst installation into DeepSeek Harness. The agent writes and fixes `.typ` documents in conversation while the right sidebar shows the same live layout; after each save the visible page redraws in place and keeps its scroll position. The agent reads compile diagnostics with `file:line`, the source line, `hint:` lines and the call trace, looks at rendered pages, marks places in the preview, and exports PDFs. You can select text in the preview and hand it to the agent together with its source location.
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- **Document work in conversation**
|
|
27
|
+
- **Orient and compile**: `typst_status` reports the Typst version, path, main file, and latest compile. `typst_check` waits until every saved change has compiled, then returns location, source line, Typst `hint:`, and the call trace.
|
|
28
|
+
- **Repair loop**: after editing `.typ`, the agent runs `typst_check` until diagnostics clear; a failed compile keeps the last successful preview in the panel.
|
|
29
|
+
- **Inspect layout**: `typst_render_pages` renders up to 4 pages to PNG for checking overflow, image placement, and pagination.
|
|
30
|
+
- **Mark and export**: `typst_show` asks the user to view a page or highlights rendered text/source lines with a comment; `typst_clear_highlights` removes the marks; `typst_export_pdf` writes a PDF into the workspace with optional PDF standard and page selection.
|
|
31
|
+
- **Preview panel**
|
|
32
|
+
- **Live preview**: each save recompiles incrementally through `typst watch`, redraws the visible page in place, and keeps the scroll position; a sidebar resize refits the page and preserves the reading position.
|
|
33
|
+
- **Status and problems**: the toolbar shows compile phase, duration, and diagnostic counts. The Problems drawer filters by level, selects one or several diagnostics, opens the source or call-trace location, and puts a repair request into an editable draft.
|
|
34
|
+
- **Main file**: the menu groups the current main file, other Typst files, and fragments referenced by the current document; fragments come from Typst's own dependency report. The index skips hidden directories and `node_modules`, `target`, `__pycache__`, `venv`, `build`, `dist` by default, with an option to include them.
|
|
35
|
+
- **Setup guide**: when Typst is missing or too old, the guide lists detected facts, searched directories, and platform commands. Review a setup request before submitting; manual recheck and preview restart stay available.
|
|
36
|
+
- **Runtime**
|
|
37
|
+
- **Your compiler**: the plugin calls the Typst you installed, with the same fonts, packages, and version. Font directories, a `@local` package directory, and excluded directories are adjustable in settings.
|
|
38
|
+
- **Read and write boundary**: the agent edits `.typ` sources with its file tools, and the plugin reads them. Preview PDFs and rendered images live in the plugin cache `~/.dsh/cache/typst`; the export tool writes the workspace deliverable.
|
|
39
|
+
- **Network**: the plugin itself makes no network requests; Typst downloads `@preview` packages on first use as it does in a terminal.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
### Desktop (plugin manager)
|
|
44
|
+
|
|
45
|
+
In DeepSeek Harness, open **Plugins** in the sidebar, click **Add plugin**, and enter one of:
|
|
46
|
+
|
|
47
|
+
- Latest (recommended): `dsh-typst-plugin`
|
|
48
|
+
- A specific version: `dsh-typst-plugin@0.1.0`
|
|
49
|
+
- GitHub prebuilt branch: `github:Vncntvx/dsh-typst#release`
|
|
50
|
+
|
|
51
|
+
### Command line
|
|
15
52
|
|
|
16
|
-
|
|
53
|
+
```sh
|
|
54
|
+
# latest from npm (recommended)
|
|
55
|
+
dsh plugin --profile <name> add dsh-typst-plugin
|
|
17
56
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- "The table on page 3 overflows — make it fit."
|
|
21
|
-
- "Export `paper.pdf` as PDF/A-2b."
|
|
57
|
+
# a specific version
|
|
58
|
+
dsh plugin --profile <name> add dsh-typst-plugin@<version>
|
|
22
59
|
|
|
23
|
-
|
|
60
|
+
# the prebuilt GitHub branch
|
|
61
|
+
dsh plugin --profile <name> add github:Vncntvx/dsh-typst#release
|
|
62
|
+
```
|
|
24
63
|
|
|
25
|
-
|
|
64
|
+
The npm package and the `#release` branch both ship built output, so a new session can use the plugin immediately. The **dsh-typst-plugin** detail page in the plugin manager exposes Typst path, font directories, package directory, and excluded directories.
|
|
26
65
|
|
|
27
|
-
|
|
28
|
-
- **Main file**: choose it explicitly using Preview main file, search indexed files or enter a relative path. The complete index can include hidden and build directories. Switching recompiles and the choice is remembered per workspace.
|
|
29
|
-
- **Status and problems**: compile phase, duration and diagnostic counts. Failures label the retained successful preview. The bottom Problems pane supports filtering, selection, source opening and repair review.
|
|
30
|
-
- **Text and region feedback**: selected text can be appended to the existing main composer draft. Ask opens an editable request with optional source candidates and explicit submission. Region feedback supports real screenshots, multiple pages, review, removal and retry.
|
|
31
|
-
- **Agent annotations**: location requests notify before navigation, with back and forward history. Full quotes and comments remain available, including stale annotations.
|
|
32
|
-
- **Setup**: detected facts, searched directories and platform-specific commands. Review setup requests before submitting; manual recheck and restart remain available.
|
|
66
|
+
## Prerequisites
|
|
33
67
|
|
|
34
|
-
|
|
68
|
+
1. Node.js 24.9 or later, and a DeepSeek Harness interface with the right docking sidebar; the plugin requires dsh 0.2.2-rc.5 or later.
|
|
69
|
+
2. **Typst 0.12 or later** installed locally, for example `brew install typst` (macOS), `winget install --id Typst.Typst` (Windows), `cargo install --locked typst-cli`, or a release from <https://github.com/typst/typst/releases>.
|
|
70
|
+
3. A workspace containing `.typ` files.
|
|
35
71
|
|
|
36
|
-
|
|
37
|
-
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
-
| `typst_status` | Typst version and path, main file, other `.typ` files, latest compile result |
|
|
39
|
-
| `typst_set_main` | Choose the main `.typ` file (remembered per workspace) |
|
|
40
|
-
| `typst_check` | Wait until every saved change has compiled, then report errors and warnings with location, source line, hints and trace |
|
|
41
|
-
| `typst_render_pages` | Render up to 4 pages to PNG images for the agent to look at |
|
|
42
|
-
| `typst_show` | Request a page location, or highlight rendered text or source lines, with a comment |
|
|
43
|
-
| `typst_clear_highlights` | Remove agent highlights |
|
|
44
|
-
| `typst_export_pdf` | Compile a PDF into the workspace (optional PDF standard and page selection) |
|
|
72
|
+
The plugin searches for `typst` in this order: the plugin settings path → PATH → common install locations (Homebrew, Cargo, `~/.local/bin`, Nix, Snap, WinGet, Scoop) → the login shell (for version managers such as mise or asdf). If Typst lives elsewhere, set **Typst path** in the plugin settings to an absolute path or a workspace-relative path.
|
|
45
73
|
|
|
46
|
-
|
|
74
|
+
## Tools
|
|
47
75
|
|
|
48
|
-
|
|
76
|
+
| Tool | Purpose |
|
|
77
|
+
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
|
78
|
+
| `typst_status` | Typst version and path, main file, other `.typ` files, latest compile result |
|
|
79
|
+
| `typst_set_main` | Choose the main `.typ` file, remembered per workspace |
|
|
80
|
+
| `typst_check` | Wait until every saved change has compiled, then report errors and warnings: location, source line, `hint:`, trace |
|
|
81
|
+
| `typst_render_pages` | Render up to 4 pages to PNG for the agent to inspect layout |
|
|
82
|
+
| `typst_show` | Ask the user to view a page, or highlight rendered text/source lines with a comment |
|
|
83
|
+
| `typst_clear_highlights` | Remove agent highlights |
|
|
84
|
+
| `typst_export_pdf` | Compile a PDF into the workspace, with optional PDF standard and page selection |
|
|
49
85
|
|
|
50
|
-
|
|
51
|
-
- The plugin never edits `.typ` files; only `typst_export_pdf` writes into the workspace, and only inside it. The preview PDF and rendered images live in the plugin's private cache directory (`~/.dsh/cache/typst`).
|
|
52
|
-
- The plugin itself makes no network requests; Typst downloads `@preview` packages on first use, as it does in a terminal.
|
|
86
|
+
The `typst` skill ships with the plugin and guides the agent through orient, edit, check, inspect, point, and export. Parameters, return shapes, and error codes are in the [tool reference](docs/tools.en.md).
|
|
53
87
|
|
|
54
88
|
## Documentation
|
|
55
89
|
|
|
@@ -57,31 +91,31 @@ The `typst` skill (model-invocable) teaches the agent the full loop: `typst_stat
|
|
|
57
91
|
|
|
58
92
|
| Document | Content |
|
|
59
93
|
| --------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
60
|
-
| [Getting started](docs/getting-started.en.md) | Installation,
|
|
94
|
+
| [Getting started](docs/getting-started.en.md) | Installation, connection check and the first task |
|
|
61
95
|
| [Product model](docs/product-model.en.md) | How the workbench, the panel and the agent tools divide the work, and the system's boundaries |
|
|
62
|
-
| [Features](docs/features.en.md) | Live preview, the
|
|
96
|
+
| [Features](docs/features.en.md) | Live preview, the Problems drawer, selection-to-source, agent highlights and export |
|
|
63
97
|
| [Troubleshooting](docs/troubleshooting.en.md) | Common symptoms, likely causes and what to do about them |
|
|
64
98
|
|
|
65
99
|
### Maintenance
|
|
66
100
|
|
|
67
|
-
| Document | Content
|
|
68
|
-
| --------------------------------------------------- |
|
|
69
|
-
| [Architecture](docs/architecture.en.md) |
|
|
70
|
-
| [Tool reference](docs/tools.en.md) | The parameters and error codes of the 7 tools and of the panel's wire methods
|
|
71
|
-
| [Configuration reference](docs/configuration.en.md) | Settings fields, the lookup order and the hot-reload behaviour
|
|
72
|
-
| [Development guide](docs/development.en.md) | Build, debug, test and release
|
|
101
|
+
| Document | Content |
|
|
102
|
+
| --------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
103
|
+
| [Architecture](docs/architecture.en.md) | Component topology, data flow, state, concurrency, security and client contracts |
|
|
104
|
+
| [Tool reference](docs/tools.en.md) | The parameters and error codes of the 7 tools and of the panel's wire methods |
|
|
105
|
+
| [Configuration reference](docs/configuration.en.md) | Settings fields, the lookup order and the hot-reload behaviour |
|
|
106
|
+
| [Development guide](docs/development.en.md) | Build, debug, test and release |
|
|
107
|
+
| [Typst skill](docs/skills.en.md) | Four phases, budgets and evidence boundaries |
|
|
108
|
+
| [Development notes](docs/development-notes.en.md) | Upstream patches, compromises and exit conditions |
|
|
73
109
|
|
|
74
110
|
## Development
|
|
75
111
|
|
|
76
112
|
```sh
|
|
77
113
|
npm install # also builds lib/ through prepare
|
|
78
114
|
npm test # the test-lint guards + the full suite (including the session integration against a simulated typst CLI)
|
|
79
|
-
npm run typecheck # harness pin + node
|
|
115
|
+
npm run typecheck # harness pin + the node, test, client, client-test and scripts tsc
|
|
80
116
|
npm run release:check
|
|
81
117
|
```
|
|
82
118
|
|
|
83
|
-
Developed as a sibling checkout of `../deepseek-harness`: mount a local harness with `dev.cordis.yml.example`, and run `npm run link:local-harness` when the sibling is ahead of the registry. See [AGENTS.md](AGENTS.md).
|
|
84
|
-
|
|
85
119
|
## License
|
|
86
120
|
|
|
87
|
-
MIT — see [LICENSE](LICENSE).
|
|
121
|
+
MIT — see [LICENSE](./LICENSE).
|
package/README.md
CHANGED
|
@@ -1,87 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[English](README.en.md) · 简体中文
|
|
4
|
-
|
|
5
|
-
DeepSeek Harness 的 Typst 插件:Agent 撰写、修复 Typst 文档时,右侧边栏实时排版预览——由**你本机的 Typst**驱动(你的字体、你下载的包、你的 Typst 版本),预览与终端里 `typst compile` 的结果一致。文件一保存(无论你改还是 Agent 改),预览即刻增量重编译、原地重绘,不闪烁、不丢位置。Agent 能读到带 `file:line`、源码行、`hint:` 与调用链的错误,把渲染页面当图看,在预览里为你标出位置,导出 PDF;你在预览中选中文字,可以连同对应源码位置一起发给 Agent。
|
|
6
|
-
|
|
7
|
-
安装包内含编译产物,无需构建。需要:
|
|
8
|
-
|
|
9
|
-
- Node.js 24+,以及一个带右侧停靠栏的 DeepSeek Harness Web 界面;
|
|
10
|
-
- 本机安装 **Typst 0.12 或更高**,例如 `brew install typst`(macOS)、`winget install --id Typst.Typst`(Windows)、`cargo install --locked typst-cli`,或从 <https://github.com/typst/typst/releases> 下载。
|
|
1
|
+
<div align="center">
|
|
11
2
|
|
|
12
|
-
|
|
3
|
+
# dsh-typst
|
|
13
4
|
|
|
14
|
-
|
|
5
|
+
<img
|
|
6
|
+
src="https://readme-typing-svg.demolab.com?font=JetBrains+Mono&weight=500&size=18&pause=2000&color=239DAD¢er=true&vCenter=true&width=760&lines=%3E+Write+and+fix+Typst+documents+in+place.%3B%3E+Watch+every+save+redraw+the+page.%3B%3E+Hand+the+agent+diagnostics%2C+rendered+pages+and+PDF+export."
|
|
7
|
+
alt="dsh-typst"
|
|
8
|
+
/>
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white" alt="powered by dsh" style="max-width:100%;"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/dsh-typst-plugin"><img src="https://img.shields.io/npm/v/dsh-typst-plugin" alt="npm version" style="max-width:100%;"></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/dsh-typst-plugin"><img src="https://img.shields.io/npm/dm/dsh-typst-plugin" alt="npm downloads" style="max-width:100%;"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/dsh-typst-plugin"><img src="https://img.shields.io/npm/l/dsh-typst-plugin" alt="license" style="max-width:100%;"></a>
|
|
14
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness/releases"><img src="https://img.shields.io/badge/dsh-0.2.2--rc.5-blue" alt="dsh version" style="max-width:100%;"></a>
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.en.md"><b>English</b></a> · <b>中文</b>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
dsh-typst 把本机 Typst 接入 DeepSeek Harness。Agent 在对话中撰写、修复 `.typ` 文档,右侧边栏同步显示实时排版;每次保存后可见页面原地重绘并保持滚动位置。Agent 读取带 `file:line`、源码行、`hint:` 与调用链的编译诊断,查看渲染页,在预览中标出位置,导出 PDF。你在预览里选中文字,可连同对应源码位置交给 Agent。
|
|
23
|
+
|
|
24
|
+
## 主要功能
|
|
25
|
+
|
|
26
|
+
- **对话中的文档工作**
|
|
27
|
+
- **定向与编译**:`typst_status` 读取 Typst 版本、路径、主文件与最近一次编译结果;`typst_check` 等到已保存的改动编译完,返回位置、源码行、Typst `hint:` 与调用链。
|
|
28
|
+
- **修复循环**:Agent 编辑 `.typ` 后立即 `typst_check`,直到诊断清空;编译失败时面板保留上一次成功的预览。
|
|
29
|
+
- **看排版**:`typst_render_pages` 把至多 4 页渲染成 PNG,检查溢出的行、图片位置与分页。
|
|
30
|
+
- **标注与导出**:`typst_show` 请求用户查看某页,或高亮渲染文字/源码行并附备注;`typst_clear_highlights` 移除标注;`typst_export_pdf` 把 PDF 写入工作区,可选 PDF 标准与页选择。
|
|
31
|
+
- **右侧预览面板**
|
|
32
|
+
- **实时预览**:每次保存经 `typst watch` 增量重编译,可见页面原地重绘,滚动位置保持;侧栏尺寸变化后重新适配,保留页内阅读位置。
|
|
33
|
+
- **状态与问题**:工具栏显示编译阶段、耗时与诊断数量;问题辅助区可按级别筛选、选择单条或多条、打开源码或调用链,并把修复请求放进可编辑草稿。
|
|
34
|
+
- **主文件**:菜单分为当前主文件、其他 Typst 文件与被当前文档引用的片段;片段来自 Typst 自己的依赖报告。索引默认跳过隐藏目录及 `node_modules`、`target`、`__pycache__`、`venv`、`build`、`dist`,勾选后可包含。
|
|
35
|
+
- **安装引导**:Typst 缺失或过旧时,引导页列出检测事实、查找目录与平台命令;安装请求先审阅再提交,手动检查与重启预览保持可用。
|
|
36
|
+
- **运行方式**
|
|
37
|
+
- **本机编译器**:插件调用你安装的 Typst,使用同一套字体、包与版本;字体目录、`@local` 包目录与排除目录可在设置里调整。
|
|
38
|
+
- **读写边界**:`.typ` 源文件由 Agent 的文件工具编辑,插件只读;预览 PDF 与渲染图存放在插件私有缓存 `~/.dsh/cache/typst`,工作区成品由导出工具写出。
|
|
39
|
+
- **网络**:插件自身不发起网络请求;Typst 首次使用 `@preview` 包时按终端行为下载。
|
|
40
|
+
|
|
41
|
+
## 安装
|
|
42
|
+
|
|
43
|
+
### 桌面端安装(插件管理器)
|
|
44
|
+
|
|
45
|
+
在 DeepSeek Harness 桌面端打开侧栏的**插件**,点击**添加插件**,输入对应标识:
|
|
46
|
+
|
|
47
|
+
- 最新版(推荐):`dsh-typst-plugin`
|
|
48
|
+
- 指定版本:`dsh-typst-plugin@0.1.0`
|
|
49
|
+
- GitHub 预构建分支:`github:Vncntvx/dsh-typst#release`
|
|
50
|
+
|
|
51
|
+
### 命令行安装
|
|
15
52
|
|
|
16
|
-
|
|
53
|
+
```sh
|
|
54
|
+
# npm 安装最新版(推荐)
|
|
55
|
+
dsh plugin --profile <name> add dsh-typst-plugin
|
|
17
56
|
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
- "第 3 页的表格溢出了——让它排进去。"
|
|
21
|
-
- "把 `paper.pdf` 导出成 PDF/A-2b。"
|
|
57
|
+
# 安装指定版本
|
|
58
|
+
dsh plugin --profile <name> add dsh-typst-plugin@<version>
|
|
22
59
|
|
|
23
|
-
|
|
60
|
+
# 从 GitHub 预构建分支安装
|
|
61
|
+
dsh plugin --profile <name> add github:Vncntvx/dsh-typst#release
|
|
62
|
+
```
|
|
24
63
|
|
|
25
|
-
|
|
64
|
+
npm 包与 `#release` 分支都带构建产物,安装后新建会话即可使用。在插件管理器中打开 **dsh-typst-plugin** 详情页,可在配置区填写 Typst 路径、字体目录、包目录与排除目录。
|
|
26
65
|
|
|
27
|
-
|
|
28
|
-
- **主文件**:点击“预览主文件”主动选择,支持搜索、直接输入相对路径及包含隐藏目录的完整索引。切换会重新编译,选择按工作区记忆。
|
|
29
|
-
- **状态与问题**:显示编译阶段、耗时及诊断数量。失败时标记并保留上次成功预览;底部问题辅助区可筛选、选择、打开源码并审阅修复请求。
|
|
30
|
-
- **文字与区域反馈**:选中文字后可追加到主输入框现有草稿;询问先进入可编辑请求,可核对源码候选后明确提交。框选可截取真实页面图片,支持多页区域、审阅、移除和失败重试。
|
|
31
|
-
- **Agent 标注**:位置请求先通知,点击后导航,可返回原阅读位置;标注展示完整引文和备注,无法重新定位时保留过期状态。
|
|
32
|
-
- **安装引导**:显示检测事实、查找目录和对应平台的命令。安装请求先审阅再提交;手动检查和重启始终可用。
|
|
66
|
+
## 前置条件
|
|
33
67
|
|
|
34
|
-
|
|
68
|
+
1. Node.js 24.9 或更高,以及一个带右侧停靠栏的 DeepSeek Harness 界面;插件要求 dsh 0.2.2-rc.5 或更高。
|
|
69
|
+
2. 本机安装 **Typst 0.12 或更高**,例如 `brew install typst`(macOS)、`winget install --id Typst.Typst`(Windows)、`cargo install --locked typst-cli`,或从 <https://github.com/typst/typst/releases> 下载。
|
|
70
|
+
3. 一个包含 `.typ` 文件的工作区。
|
|
35
71
|
|
|
36
|
-
|
|
37
|
-
| ------------------------ | --------------------------------------------------------------------- |
|
|
38
|
-
| `typst_status` | Typst 版本与路径、主文件、其余 `.typ` 文件、最近一次编译结果 |
|
|
39
|
-
| `typst_set_main` | 选择主 `.typ` 文件(按工作区记忆) |
|
|
40
|
-
| `typst_check` | 等到已保存的改动全部编译完,再报错误与警告(位置、源码行、hint、调用链) |
|
|
41
|
-
| `typst_render_pages` | 把至多 4 页渲染成 PNG 供 Agent 看排版 |
|
|
42
|
-
| `typst_show` | 请求查看预览某页,或高亮渲染文本/源码行,带备注 |
|
|
43
|
-
| `typst_clear_highlights` | 移除 Agent 高亮 |
|
|
44
|
-
| `typst_export_pdf` | 编译 PDF 写入工作区(可选 PDF 标准、页选择) |
|
|
72
|
+
插件按顺序查找 `typst`:插件设置中的路径 → PATH → 常见安装位置(Homebrew、Cargo、`~/.local/bin`、Nix、Snap、WinGet、Scoop)→ 登录 shell(mise/asdf 等版本管理器)。装在别处时,在插件设置 **Typst 路径** 中填写可执行文件的路径,绝对路径或相对工作区的路径都可以。
|
|
45
73
|
|
|
46
|
-
|
|
74
|
+
## 工具一览
|
|
47
75
|
|
|
48
|
-
|
|
76
|
+
| 工具 | 用途 |
|
|
77
|
+
| ------------------------ | ------------------------------------------------------------------------- |
|
|
78
|
+
| `typst_status` | Typst 版本与路径、主文件、其余 `.typ` 文件、最近一次编译结果 |
|
|
79
|
+
| `typst_set_main` | 选择主 `.typ` 文件,按工作区记忆 |
|
|
80
|
+
| `typst_check` | 等到已保存的改动全部编译完,再报错误与警告:位置、源码行、`hint:`、调用链 |
|
|
81
|
+
| `typst_render_pages` | 把至多 4 页渲染成 PNG,供 Agent 检查排版 |
|
|
82
|
+
| `typst_show` | 请求查看预览某页,或高亮渲染文字/源码行,附备注 |
|
|
83
|
+
| `typst_clear_highlights` | 移除 Agent 高亮 |
|
|
84
|
+
| `typst_export_pdf` | 编译 PDF 写入工作区,可选 PDF 标准与页选择 |
|
|
49
85
|
|
|
50
|
-
|
|
51
|
-
- 插件从不编辑 `.typ` 文件;只有 `typst_export_pdf` 会写工作区,且仅限工作区内。预览 PDF 与渲染图存放在插件私有缓存目录(`~/.dsh/cache/typst`)。
|
|
52
|
-
- 插件自身不联网;Typst 首次使用 `@preview` 包时会自行下载,与终端一致。
|
|
86
|
+
技能 `typst` 随插件注册,指导 Agent 按定向、编辑、检查、看图、指向、导出的顺序工作。参数、返回值与错误码见[工具参考](docs/tools.md)。
|
|
53
87
|
|
|
54
|
-
##
|
|
88
|
+
## 说明文档
|
|
55
89
|
|
|
56
90
|
### 使用
|
|
57
91
|
|
|
58
|
-
| 文档 | 内容
|
|
59
|
-
| ----------------------------------- |
|
|
60
|
-
| [快速入门](docs/getting-started.md) |
|
|
61
|
-
| [产品模型](docs/product-model.md) | 工作台、面板与 Agent
|
|
62
|
-
| [功能概览](docs/features.md) |
|
|
63
|
-
| [故障排查](docs/troubleshooting.md) | 常见现象、可能原因与处理方式
|
|
92
|
+
| 文档 | 内容 |
|
|
93
|
+
| ----------------------------------- | ------------------------------------------------ |
|
|
94
|
+
| [快速入门](docs/getting-started.md) | 安装、连接验证与第一个任务 |
|
|
95
|
+
| [产品模型](docs/product-model.md) | 工作台、面板与 Agent 工具的分工,以及系统边界 |
|
|
96
|
+
| [功能概览](docs/features.md) | 实时预览、问题辅助区、选中定位、Agent 高亮与导出 |
|
|
97
|
+
| [故障排查](docs/troubleshooting.md) | 常见现象、可能原因与处理方式 |
|
|
64
98
|
|
|
65
99
|
### 维护
|
|
66
100
|
|
|
67
|
-
| 文档
|
|
68
|
-
|
|
|
69
|
-
| [系统架构](docs/architecture.md)
|
|
70
|
-
| [工具参考](docs/tools.md)
|
|
71
|
-
| [配置参考](docs/configuration.md)
|
|
72
|
-
| [开发指南](docs/development.md)
|
|
101
|
+
| 文档 | 内容 |
|
|
102
|
+
| ------------------------------------- | -------------------------------------------- |
|
|
103
|
+
| [系统架构](docs/architecture.md) | 组件拓扑、数据流、状态、并发、安全与端侧契约 |
|
|
104
|
+
| [工具参考](docs/tools.md) | 7 个工具与面板 wire 方法的参数与错误码 |
|
|
105
|
+
| [配置参考](docs/configuration.md) | 设置字段、查找顺序与热重载行为 |
|
|
106
|
+
| [开发指南](docs/development.md) | 构建、调试、测试与发布流程 |
|
|
107
|
+
| [Typst 技能](docs/skills.md) | 四阶段工作流、预算与证据边界 |
|
|
108
|
+
| [开发留意](docs/development-notes.md) | 上游补丁、妥协与退出条件 |
|
|
73
109
|
|
|
74
110
|
## 开发
|
|
75
111
|
|
|
76
112
|
```sh
|
|
77
113
|
npm install # 同时通过 prepare 构建 lib/
|
|
78
|
-
npm test # 测试规范守卫 +
|
|
79
|
-
npm run typecheck # harness 引脚 + node/test/client
|
|
114
|
+
npm test # 测试规范守卫 + 全部测试(含对模拟 typst CLI 的 session 集成)
|
|
115
|
+
npm run typecheck # harness 引脚 + node/test/client/client-test/scripts 五套 tsc
|
|
80
116
|
npm run release:check
|
|
81
117
|
```
|
|
82
118
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
## License
|
|
119
|
+
## 许可证
|
|
86
120
|
|
|
87
|
-
MIT
|
|
121
|
+
本项目遵循 [MIT 许可证](./LICENSE)。
|
package/cordis.patch.yml
CHANGED
package/docs/images/icon.png
CHANGED
|
Binary file
|