Skip to content

Commit f254999

Browse files
author
ZCode Marketplace Bot
committed
feat(ui-plugins): guided setup for Typst, Zotero and Jupyter
Source-Commit: e18ab58f9475df02b9dde8ce85a4890917838418
1 parent 239a420 commit f254999

80 files changed

Lines changed: 6437 additions & 376 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎marketplace.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@
11741174
"en": "Jupyter Notebook",
11751175
"zh-CN": "Jupyter Notebook"
11761176
},
1177-
"version": "0.1.0",
1177+
"version": "0.2.0",
11781178
"source": "./plugins/jupyter-notebook",
11791179
"description": "在对话侧栏打开 Jupyter Notebook:连接已有的 Jupyter Server 或为工作区启动一个,Agent 与用户一起编辑和运行 cell。",
11801180
"description_i18n": {
@@ -1197,7 +1197,7 @@
11971197
"en": "Typst Workbench",
11981198
"zh-CN": "Typst 工作台"
11991199
},
1200-
"version": "0.1.0",
1200+
"version": "0.2.0",
12011201
"source": "./plugins/typst-workbench",
12021202
"description": "用你本机的 Typst 在对话侧栏实时预览文档:Agent 改完文件预览即刻更新,查看错误与渲染页面、在预览中标出位置、导出 PDF;你可以选中预览中的文字,连同对应的源码位置发给 Agent。",
12031203
"description_i18n": {
@@ -1220,7 +1220,7 @@
12201220
"en": "Zotero",
12211221
"zh-CN": "Zotero"
12221222
},
1223-
"version": "0.1.0",
1223+
"version": "0.2.0",
12241224
"source": "./plugins/zotero",
12251225
"description": "在对话侧栏使用你的 Zotero 文库:搜索与阅读论文和你的高亮,Agent 在 PDF 中标出依据、生成引用与 .bib 文件,并可导入论文、写笔记、整理分类。",
12261226
"description_i18n": {

‎plugins/jupyter-notebook/.zcode-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyter-notebook",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "在对话侧栏打开 Jupyter Notebook:连接已有的 Jupyter Server 或为工作区启动一个,Agent 与用户一起编辑和运行 cell。",
55
"author": {
66
"name": "ZCode"

‎plugins/jupyter-notebook/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ You can also open the panel from the side pane "+" menu.
2424

2525
### Panel
2626

27+
- **Setup** when no server is running and the workspace's Python lacks `jupyter-server` or `ipykernel`: the panel checks before you click Start and lists the project Python (and whether uv manages it) and each package. **Send to agent** posts a ready-made message with the right install command (`uv add --dev …` in a uv project, `pip` otherwise) so the agent installs them and starts a server; *Install them yourself* shows the command and *Use uv for this session only*. The panel checks again every few seconds and moves on as soon as the packages are there. Connecting to a running server by URL needs no local install.
2728
- The panel follows ZCode's theme: colours, fonts and light / dark mode come from the host.
2829
- One header row: the notebook name opens a switcher for open notebooks, opening and creating notebooks; the kernel status opens the kernel menu.
2930
- Code, Markdown and raw cells with syntax highlighting; Markdown with LaTeX math.
@@ -66,4 +67,5 @@ pnpm test # unit tests
6667
pnpm test:integration # against a real Jupyter Server
6768
pnpm smoke # built MCP server over stdio
6869
pnpm test:e2e # panel in Chrome through the official AppBridge host
70+
pnpm test:setup # setup page in Chrome with a real uv environment that lacks the packages
6971
```

‎plugins/jupyter-notebook/README_CN.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Git 市场安装包已包含编译好的 MCP server 和面板,无需自行构
2424

2525
### 面板
2626

27+
- **安装引导**:没有运行中的 server、且工作区的 Python 缺少 `jupyter-server` 或 `ipykernel` 时,面板在你点“启动”之前就检查,并列出项目 Python(以及是否由 uv 管理)和每个包。**发给 Agent** 发出一条带正确安装命令的消息(uv 项目用 `uv add --dev …`,否则用 `pip`),由 Agent 安装并启动 server;*自己安装*给出命令以及“只在本次会话中使用 uv”。面板每隔几秒重新检查,包装好后自动进入下一步。通过 URL 连接已在运行的 server 不需要本机安装。
2728
- 面板跟随 ZCode 主题:颜色、字体与浅色 / 深色模式都取自宿主。
2829
- 头部只有一行:点 notebook 名称可切换已打开的 notebook、打开或新建 notebook;点 kernel 状态打开 kernel 菜单。
2930
- 代码、Markdown、Raw cell,语法高亮;Markdown 支持 LaTeX 公式。
@@ -66,4 +67,5 @@ pnpm test # 单元测试
6667
pnpm test:integration # 真实 Jupyter Server
6768
pnpm smoke # 构建后的 MCP server(stdio)
6869
pnpm test:e2e # Chrome 中经官方 AppBridge 宿主运行面板
70+
pnpm test:setup # 在 Chrome 中用缺少依赖的真实 uv 环境测试安装引导
6971
```

‎plugins/jupyter-notebook/skills/jupyter-notebook/SKILL.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Notebooks live on a Jupyter Server and are shown in the Jupyter Notebook side pa
1111

1212
1. Call `list_servers`. It shows connected servers and Jupyter servers running on this machine.
1313
2. If the user named a server or pasted a URL (with or without `?token=…`), call `connect_server` with it. A server listed as running on this machine needs no token.
14-
3. Otherwise, if a running server's root contains the notebooks you need, offer to use it; if there is none or the user wants a private one, call `start_server`. It needs a Python with `jupyter-server` and `ipykernel`. On `jupyter_not_installed`, show the user the message and ask whether to install them into the project environment (or retry with `useUv: true` if they use uv). Do not install packages without asking.
14+
3. Otherwise, if a running server's root contains the notebooks you need, offer to use it; if there is none or the user wants a private one, call `start_server`. It needs a Python with `jupyter-server` and `ipykernel`. On `jupyter_not_installed`, show the user the message and ask whether to install them into the project environment (or retry with `useUv: true` if they use uv); the panel also lists what is missing and can send you a setup request. Do not install packages without asking — a message from the panel starting *Set up Jupyter for the Jupyter Notebook panel* is such a request (see section 6).
1515

1616
Paths are relative to the server root. For a server from `start_server` that is the workspace.
1717

@@ -44,3 +44,11 @@ Keep cells focused: imports and setup first, one step per cell, markdown cells t
4444
Summarise results in a few sentences in the chat and refer to cells by their index; the outputs are visible in the panel, so do not paste whole tables or tracebacks. When the panel says the user ran into an error in a cell, read that cell, fix it with `edit_notebook`, and run it again.
4545

4646
Saving is automatic. On `save_conflict` the file changed on the server (for example in JupyterLab): ask the user whether to keep this version (`save_notebook` with `overwrite: true`) or load theirs (`open_notebook` with `reload: true`).
47+
48+
## 6. Setting up Jupyter
49+
50+
When the user asks you to set up Jupyter — usually with the panel's message, which names the project's Python, whether uv manages it and which packages are missing — follow its steps:
51+
52+
- Install `jupyter-server` and `ipykernel` into the workspace's environment with the command the message gives (`uv add --dev jupyter-server ipykernel` in a uv project, `uv pip install --python .venv …` for a uv environment without `pyproject.toml`, otherwise `<venv python> -m pip install …`). Never install into the system Python; if the workspace has no virtual environment, create one first (`uv venv`, or `python3 -m venv .venv`).
53+
- Confirm with `<python> -c "import jupyter_server, ipykernel"`.
54+
- Call `start_server`; the panel switches to the notebook list once the server is up.

‎plugins/typst-workbench/.zcode-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typst-workbench",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "用你本机的 Typst 在对话侧栏实时预览文档:Agent 改完文件预览即刻更新,查看错误与渲染页面、在预览中标出位置、导出 PDF;你可以选中预览中的文字,连同对应的源码位置发给 Agent。",
55
"author": {
66
"name": "ZCode"

‎plugins/typst-workbench/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ You can also open the panel from the side pane "+" menu.
2424

2525
### Panel
2626

27+
- **Setup** when Typst is missing, too old or broken: a checklist of what the panel found (and where it looked), your system and package managers, and a ready-made message that **Send to agent** posts to the chat so the agent installs it (**Copy** works with any other agent). *Install it yourself* shows the command for your system. The panel checks again every few seconds and opens the preview as soon as Typst runs.
2728
- **Live preview** of the main file. Each save recompiles incrementally with `typst watch` and the visible pages are redrawn in place — no flicker, and the scroll position stays where it was. Zoom (fit width, fit page, or a percentage), page box, and an **Outline** of the headings.
2829
- **Main file**: picked automatically (`main.typ`, or the only `.typ` file); switch it from the file menu in the toolbar. The choice is remembered for the workspace. With several candidates and no obvious one, the panel asks.
2930
- **Status and problems**: the toolbar shows *compiling*, the compile time, or the number of errors and warnings. When the document does not compile, the last good version stays visible (dimmed) and the **Problems** panel lists each error with its location, source line, Typst's hints and the call trace. **Fix with agent** sends them to the agent; **Add to chat** adds them to the agent's context.
@@ -68,5 +69,6 @@ Tests (from `ui-plugins/typst-workbench`):
6869
```sh
6970
pnpm test # unit tests, every tool against a simulated typst CLI, and the main flows against the installed Typst
7071
pnpm test:e2e # built server and panel in Chrome through the official AppBridge host, with the installed Typst
72+
pnpm test:setup # the setup page in Chrome: missing Typst, hand-off to the agent, Typst appearing (simulated)
7173
TYPST_TEST_BINARY=/path/to/typst pnpm test # run the real-Typst tests with another Typst version
7274
```

‎plugins/typst-workbench/README_CN.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Git 插件市场中的安装包已包含编译好的 MCP server 与面板,无
2424

2525
### 面板
2626

27+
- **安装引导**:Typst 未安装、版本过旧或无法运行时,面板列出检测结果(以及查找过的位置)、你的系统与包管理器,并准备好一条消息——**发给 Agent** 把它发到对话中,由 Agent 安装(**复制**可交给任意其他 Agent)。*自己安装*给出适合你系统的命令。面板每隔几秒重新检查,Typst 能运行后立即打开预览。
2728
- **实时预览**主文件。每次保存都由 `typst watch` 增量编译,可见的页面原地重绘——不闪烁,滚动位置保持不变。支持缩放(适应宽度、适应页面或百分比)、页码框,以及按标题生成的**大纲**。
2829
- **主文件**:自动选择(`main.typ`,或唯一的 `.typ` 文件);可在工具栏的文件菜单中切换,选择会按工作区记住。有多个候选且无法判断时,面板会请你选择。
2930
- **状态与问题**:工具栏显示“正在编译”、编译耗时,或错误与警告的数量。文档无法编译时,仍显示最后一次成功的版本(变暗),**问题**面板列出每个错误的位置、源码行、Typst 的提示与调用栈。**让 Agent 修复**把它们发给 Agent;**加入对话**把它们加入 Agent 的上下文。
@@ -68,5 +69,6 @@ pnpm build
6869
```sh
6970
pnpm test # 单元测试、用模拟的 typst 命令行测试每个工具,以及用本机 Typst 测试主要流程
7071
pnpm test:e2e # 在 Chrome 中通过官方 AppBridge 宿主测试打包后的 server 与面板(使用本机 Typst)
72+
pnpm test:setup # 在 Chrome 中测试安装引导:缺少 Typst、交给 Agent、Typst 出现(模拟)
7173
TYPST_TEST_BINARY=/path/to/typst pnpm test # 用另一个 Typst 版本运行真实 Typst 测试
7274
```

‎plugins/typst-workbench/skills/typst/SKILL.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The plugin runs the user's own `typst` (their fonts, packages and version) as a
1010
## 1. Orient
1111

1212
- Call `status` first. It opens the panel and reports the Typst version, the main file, the other `.typ` files and the latest compile result.
13-
- `typst_missing` / `typst_too_old` / `typst_error`: tell the user what the message says (install or update Typst, or set *Typst path* in the plugin settings). Do not install software yourself unless asked.
13+
- `typst_missing` / `typst_too_old` / `typst_error`: Typst is not usable. Tell the user, and point them at the Typst panel: it lists what is missing and can send you a setup request with the facts it detected. Do not install software unless the user asks — a message from the panel starting *Set up Typst*, *Update Typst* or *Fix Typst for the Typst panel* is such a request (see section 7).
1414
- `no_main`: pick the file the user would pass to `typst compile` (the one that `#include`s or `#import`s the others) and call `set_main`; ask if it is unclear. If there are no `.typ` files, create `main.typ` — the panel picks it up.
1515
- Follow the project's existing structure and conventions (templates, `#import`ed packages, file layout). Use the user's Typst version's syntax; `status` tells you the version.
1616

@@ -42,3 +42,13 @@ Do not run `typst compile` or `typst watch` in a shell for previewing; use these
4242
## 6. Citations
4343

4444
Typst reads BibTeX (`.bib`) and Hayagriva (`.yml`) files with `#bibliography("refs.bib")` and cites with `@key`. If the Zotero plugin is available, use its `export_bib` to write the `.bib` file and use the citation keys it returns; never invent keys.
45+
46+
## 7. Setting up Typst
47+
48+
When the user asks you to install, update or fix Typst — usually with the panel's message, which lists the operating system, the folders it searched and the package managers it found — follow its steps:
49+
50+
- Use the package manager the message names: `brew install typst` (Homebrew), `winget install --id Typst.Typst`, `scoop install typst`, or `cargo install --locked typst-cli`. Without one, use a release from https://github.com/typst/typst/releases. Update an old Typst with the tool that installed it.
51+
- Ask before using `sudo`, installing a package manager, or editing shell profiles.
52+
- Confirm with `typst --version` (0.12 or later).
53+
- The panel looks on PATH, in the usual install folders (Homebrew, `~/.cargo/bin`, `~/.local/bin`, …) and in the login shell. If Typst ends up somewhere else, give the user the full path for the plugin setting *Typst path*.
54+
- The panel checks again every few seconds and starts the preview by itself; then call `status`.

‎plugins/zotero/.zcode-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zotero",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "在对话侧栏使用你的 Zotero 文库:搜索与阅读论文和你的高亮,Agent 在 PDF 中标出依据、生成引用与 .bib 文件,并可导入论文、写笔记、整理分类。",
55
"author": {
66
"name": "ZCode"

0 commit comments

Comments
 (0)