paseo-tab-namer 0.0.0-bootstrap.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/LICENSE +21 -0
- package/OVERVIEW.md +11 -0
- package/OVERVIEW.zh-CN.md +9 -0
- package/README.md +166 -2
- package/README.zh-CN.md +147 -0
- package/client/rename.tsx +527 -0
- package/client/settings.tsx +331 -0
- package/client/ui.tsx +139 -0
- package/docs/images/popover.png +0 -0
- package/docs/images/settings.png +0 -0
- package/index.client.tsx +135 -0
- package/index.server.ts +146 -0
- package/package.json +45 -2
- package/paseo-plugin.json +17 -0
- package/server/context.ts +100 -0
- package/server/model.ts +121 -0
- package/server/source.ts +165 -0
- package/server/types.ts +7 -0
- package/shared/contracts.ts +93 -0
- package/shared/settings.ts +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Stephen Zhou
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/OVERVIEW.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Tab Namer
|
|
2
|
+
|
|
3
|
+
Tab Namer gives an existing workspace a new name based on what its Tabs are about. Open it from the ✨ button in the workspace header or from the command center. You can preview the input, choose which Tabs to use, and generate again. A generated name is applied right away. To apply a name you edited by hand, click "应用手动修改" (Apply manual edit).
|
|
4
|
+
|
|
5
|
+
The settings screen holds one naming prompt, model, maximum input budget, name length, and timeout for all workspaces. You pick the provider and model from the providers already enabled on this Paseo host. The plugin has no endpoint of its own and never handles API keys.
|
|
6
|
+
|
|
7
|
+
The default input budget is a conservative upper bound of 128,000 tokens (UTF-8 bytes plus a margin), usually above the real token count. When the selected text goes over budget, Tab Namer keeps the start of each Tab and its recent part, and shows that it cut the text. Tool logs, reasoning, and raw image content are never sent. The selected text goes to the provider you chose: the plugin starts a temporary session in the current workspace for the request and archives it when the reply arrives.
|
|
8
|
+
|
|
9
|
+
The plugin UI and the default naming prompt are in Simplified Chinese. Edit the prompt in settings to get names in another language.
|
|
10
|
+
|
|
11
|
+
Requires Paseo 0.11.2 or later. Paseo does not let plugins add items to the native workspace context menu or rename dialog, so Tab Namer uses the header button and the command center.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Tab Namer
|
|
2
|
+
|
|
3
|
+
根据 Tab 内容为已有 workspace 生成新名称。通过顶部 ✨ 按钮或命令中心打开。可以预览输入、选择 Tab 范围和反复生成;生成成功后立即自动应用。手动编辑时可点击“应用手动修改”。
|
|
4
|
+
|
|
5
|
+
设置页统一配置命名提示词、模型、最大输入预算、名称长度和超时。服务和模型从此主机 Paseo 已启用的服务列表中选择,不绑定特定接口,插件不接触任何密钥。
|
|
6
|
+
|
|
7
|
+
默认输入预算为 128,000 的保守 token 上界(UTF-8 字节数加余量),通常高于模型实际 tokens。超限保留任务开头和近期内容,并显示截取状态。工具日志、推理和图片原始内容不进入请求。所选文字会发送到所选服务:插件在当前 workspace 临时启动一个命名会话,完成后自动归档。
|
|
8
|
+
|
|
9
|
+
需要 Paseo 0.11.2 或更新版本。原生 workspace 右键菜单和重命名对话框不提供插件扩展位置。
|
package/README.md
CHANGED
|
@@ -1,3 +1,167 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/images/banner.png" alt="Tab Namer — rename Paseo workspaces from what their Tabs are actually about" width="100%" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/stv1024/paseo-tab-namer/releases"><img alt="Version" src="https://img.shields.io/badge/version-0.1.0-20744a?style=flat-square" /></a>
|
|
7
|
+
<img alt="Paseo" src="https://img.shields.io/badge/paseo-%E2%89%A5%200.11.2-7ccba0?style=flat-square" />
|
|
8
|
+
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178c6?style=flat-square&logo=typescript&logoColor=white" />
|
|
9
|
+
<img alt="Tests" src="https://img.shields.io/badge/tests-node%3Atest-555?style=flat-square" />
|
|
10
|
+
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" /></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<b>English</b> · <a href="README.zh-CN.md">简体中文</a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
**Tab Namer** is a [Paseo](https://github.com/getpaseo/paseo) plugin that gives your workspaces names that actually mean something. It reads the conversation in a workspace's Tabs, asks a model from one of the providers you've already enabled in Paseo, and applies a short, specific name, such as `修复 OAuth 回调重定向循环` instead of `new-workspace-7`.
|
|
20
|
+
|
|
21
|
+
- ✨ **One click**: a Sparkles button in every workspace header. The new name is applied as soon as it's generated.
|
|
22
|
+
- 🔌 **Uses your existing providers**: Claude, Codex, OMP or any custom provider enabled in Paseo. The plugin has no endpoint, API key or extra dependency of its own.
|
|
23
|
+
- 🎯 **You choose the context**: name from the most recent Tab, all Tabs, or one Tab you pick.
|
|
24
|
+
- 📏 **Fits long Tabs into a budget**: a conservative input budget keeps the beginning and the most recent part of each Tab and makes no extra summarization calls.
|
|
25
|
+
- 🔒 **Text only**: only user and assistant text is sent. Tool logs, reasoning and raw images stay out.
|
|
26
|
+
- 🧹 **Cleans up after itself**: the helper session is archived as soon as it replies. The directory and Git branch are never touched.
|
|
27
|
+
|
|
28
|
+
> [!NOTE]
|
|
29
|
+
> The plugin UI and the default naming prompt are in **Simplified Chinese**. Edit the prompt in settings to generate names in another language.
|
|
30
|
+
|
|
31
|
+
## Screenshots
|
|
32
|
+
|
|
33
|
+
<p align="center">
|
|
34
|
+
<img src="docs/images/popover.png" alt="Tab Namer popover open from the workspace header" width="100%" />
|
|
35
|
+
<br /><sub>The header popover after a generation, with <b>More</b> expanded to show budget and usage.</sub>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<img src="docs/images/settings.png" alt="Tab Namer settings screen" width="100%" />
|
|
40
|
+
<br /><sub>Settings apply to every workspace on the host: provider, model, thinking level, budget and prompt.</sub>
|
|
41
|
+
</p>
|
|
42
|
+
|
|
43
|
+
> Images are illustrative mockups built from the plugin's real UI and Paseo's dark theme. Their sources are in [`docs/media-src`](docs/media-src).
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
Requires **Paseo 0.11.2 or newer**.
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
paseo plugin install git:stv1024/paseo-tab-namer
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Pin a version with `--ref <tag-or-commit>`. Update later with `paseo plugin update tab-namer`.
|
|
54
|
+
|
|
55
|
+
On first use, open **Settings → Tab Namer**, pick a **provider** and a **model**, then click **保存设置** (Save settings).
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
1. Click the **✨ Tab Namer** button in a workspace header.
|
|
60
|
+
2. Pick the scope: **最近 Tab** (most recent), **全部 Tab** (all) or **指定 Tab** (a specific Tab).
|
|
61
|
+
3. Click **生成名称** (Generate). The name is applied right away. **再次生成** (Regenerate) gives you another one.
|
|
62
|
+
4. To fine-tune by hand, edit the field and click **应用手动修改** (Apply manual edit).
|
|
63
|
+
|
|
64
|
+
Under **更多** (More), **预览输入** (Preview input) shows exactly what will be sent and how much of the budget it uses, without calling the model.
|
|
65
|
+
|
|
66
|
+
Other entry points:
|
|
67
|
+
|
|
68
|
+
| Where | What |
|
|
69
|
+
| --------------------- | ---------------------------------------------------------------------------------------- |
|
|
70
|
+
| Command center | `Tab Namer:选择 workspace 重命名` (searchable list of every workspace), `Tab Namer:重命名当前 workspace`, `Tab Namer:根据当前 Tab`, `Tab Namer 设置` |
|
|
71
|
+
|
|
72
|
+
## How it works
|
|
73
|
+
|
|
74
|
+
<p align="center">
|
|
75
|
+
<img src="docs/images/flow.png" alt="Read Tabs → fit the budget → ask your provider → apply and clean up" width="100%" />
|
|
76
|
+
</p>
|
|
77
|
+
|
|
78
|
+
Paseo exposes models to plugins only through agents. When you click Generate, the plugin starts a temporary session titled **Tab Namer** (tagged `tab-namer`) in the current workspace and sends the prompt and the selected Tab text as one message. It reads the reply and archives the session right away. Tagged sessions are never read back as Tabs. All authentication stays in Paseo's provider configuration.
|
|
79
|
+
|
|
80
|
+
Generation runs as a background job that the UI polls, so you can close the popover. Each workspace runs one job at a time, with at most three jobs in parallel. Before writing, the plugin re-reads the current name and refuses to overwrite one that changed in the meantime.
|
|
81
|
+
|
|
82
|
+
## Settings
|
|
83
|
+
|
|
84
|
+
| Setting | Default | Notes |
|
|
85
|
+
| ------------------------- | ------------------------------- | ------------------------------------------------------- |
|
|
86
|
+
| Provider & model | _not set_ | Listed from the providers enabled on this Paseo host |
|
|
87
|
+
| Thinking level | Model default | Lower is usually faster; naming is a simple task |
|
|
88
|
+
| Max input budget | 128,000 | Range 2,048–256,000; conservative upper bound |
|
|
89
|
+
| Default scope | Most recent Tab | Or all Tabs |
|
|
90
|
+
| Content | User + assistant text | Or user text only |
|
|
91
|
+
| Max name length | 48 characters | 8–120 |
|
|
92
|
+
| Request timeout | 180 s | 15–600 |
|
|
93
|
+
| Naming prompt | Built-in Chinese prompt | Shared by all workspaces; can be reset to the default |
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary><b>About the input budget</b></summary>
|
|
97
|
+
|
|
98
|
+
Tokenizers differ between models, so the budget counts **UTF-8 bytes + 256** for the system prompt and the selected messages. This is usually well above the real token count: 128,000 typically holds a few tens of thousands of real tokens. When the provider reports usage, the UI shows the real figures. Make sure the model's context window can hold the budget you set.
|
|
99
|
+
|
|
100
|
+
Short Tabs are included in full. When the total goes over budget, each Tab keeps roughly its first 25% and its most recent 75%, and the budget is split fairly across Tabs (short Tabs give back what they don't use). Very long Tabs are read page by page, with a page limit. Up to 100 Tabs per run. The preview always says whether anything was cut.
|
|
101
|
+
|
|
102
|
+
Providers such as Claude Code and Codex add their own system prompt and tool definitions, so billed input tokens are higher than the naming content itself. The prompt tells the model not to use tools. If it asks for tool permission anyway, the job stops with an error.
|
|
103
|
+
|
|
104
|
+
</details>
|
|
105
|
+
|
|
106
|
+
## Privacy
|
|
107
|
+
|
|
108
|
+
- The text of the selected Tabs is sent to the provider **you** picked, and nowhere else.
|
|
109
|
+
- Preview never calls a model and never renames anything.
|
|
110
|
+
- The plugin stores no credentials. Settings live in Paseo host settings.
|
|
111
|
+
- Finished job results are kept in memory for about ten minutes, then dropped.
|
|
112
|
+
|
|
113
|
+
## Limitations
|
|
114
|
+
|
|
115
|
+
- Paseo doesn't let plugins add items to the native workspace context menu or rename dialog, so Tab Namer adds a header button and command-center entries instead. It does not use the sidebar, so it takes no space in the mobile workspace list.
|
|
116
|
+
- Names can only be based on history Paseo still has. Anything the host already discarded can't be recovered.
|
|
117
|
+
- Paseo has no atomic compare-and-set for names, so a change made in the instant between the check and the write can still be overwritten.
|
|
118
|
+
|
|
119
|
+
## Development
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
npm ci
|
|
123
|
+
npm run typecheck
|
|
124
|
+
npm test # node:test suite under server/
|
|
125
|
+
|
|
126
|
+
# Name the workspace for the current directory against your local Paseo,
|
|
127
|
+
# without renaming it
|
|
128
|
+
npm run test:smoke -- <provider>/<model>
|
|
129
|
+
|
|
130
|
+
paseo plugin install . # install from a local checkout
|
|
131
|
+
paseo plugin reload tab-namer # after changes
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
When Paseo installs a plugin from Git, it bundles the source with esbuild and **does not run `npm install`**. Runtime code may only import what Paseo provides: `@getpaseo/plugin`, `react`, `react-native`, `zod` and Node built-ins. Everything in `devDependencies` is for type-checking, tests and scripts only.
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
index.client.tsx UI entry: header button, screens, command center
|
|
138
|
+
index.server.ts RPC handlers and background jobs
|
|
139
|
+
client/ rename popover/screen, settings screen, shared UI
|
|
140
|
+
server/ Tab reading, budgeting, model session, naming logic (+ tests)
|
|
141
|
+
shared/ RPC contracts and settings schema
|
|
142
|
+
docs/media-src/ HTML sources for README images (node docs/media-src/render.mjs)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Release
|
|
146
|
+
|
|
147
|
+
Releases go to npm as `paseo-tab-namer` through
|
|
148
|
+
[`.github/workflows/release.yml`](.github/workflows/release.yml), with npm Trusted
|
|
149
|
+
Publishing (no npm token). Bump `version` in `package.json`, add a `CHANGELOG.md`
|
|
150
|
+
section, then commit, tag and push:
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
npm run typecheck && npm test && npm run pack:npm # check the packed file list
|
|
154
|
+
git push origin main
|
|
155
|
+
git tag -a v0.1.0 -m "Tab Namer 0.1.0" && git push origin v0.1.0
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The tag push publishes the tarball. Then create the GitHub release from the tag.
|
|
159
|
+
The official registry opens a bump PR for each new npm version.
|
|
160
|
+
|
|
161
|
+
## Contributing
|
|
162
|
+
|
|
163
|
+
Issues and pull requests are welcome. Before opening a PR, run `npm run typecheck` and `npm test`. For changes that affect naming quality, include before/after examples from `npm run test:smoke`.
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
[MIT](LICENSE) © Stephen Zhou
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/images/banner.png" alt="Tab Namer:根据 Tab 内容为 Paseo workspace 起名" width="100%" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/stv1024/paseo-tab-namer/releases"><img alt="Version" src="https://img.shields.io/badge/version-0.1.0-20744a?style=flat-square" /></a>
|
|
7
|
+
<img alt="Paseo" src="https://img.shields.io/badge/paseo-%E2%89%A5%200.11.2-7ccba0?style=flat-square" />
|
|
8
|
+
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178c6?style=flat-square&logo=typescript&logoColor=white" />
|
|
9
|
+
<img alt="Tests" src="https://img.shields.io/badge/tests-node%3Atest-555?style=flat-square" />
|
|
10
|
+
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" /></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="README.md">English</a> · <b>简体中文</b>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
**Tab Namer** 是一个 [Paseo](https://github.com/getpaseo/paseo) 插件,根据 workspace 中 Tab 的对话内容,用你在 Paseo 中已启用的模型服务生成一个简短、具体的名称并直接应用,比如把 `new-workspace-7` 改成 `修复 OAuth 回调重定向循环`。
|
|
20
|
+
|
|
21
|
+
- ✨ **一键生成**:每个 workspace 顶部都有 ✨ 按钮,生成成功后立即自动应用。
|
|
22
|
+
- 🔌 **复用已有服务**:Claude、Codex、OMP 或任何自定义服务均可。插件本身不需要地址、密钥或额外依赖。
|
|
23
|
+
- 🎯 **自选上下文**:可依据最近 Tab、全部 Tab 或指定 Tab 命名。
|
|
24
|
+
- 📏 **长 Tab 也能装下**:按保守预算截取,保留每个 Tab 的开头和近期内容,不额外调用模型做摘要。
|
|
25
|
+
- 🔒 **只发文字**:仅发送用户与助手的文字消息,工具日志、推理过程和图片原始内容不进入请求。
|
|
26
|
+
- 🧹 **用完即清**:临时命名会话回复后立即归档;不修改目录或 Git 分支。
|
|
27
|
+
|
|
28
|
+
## 截图
|
|
29
|
+
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img src="docs/images/popover.png" alt="从 workspace 顶部打开的 Tab Namer 弹窗" width="100%" />
|
|
32
|
+
<br /><sub>生成完成后的顶部弹窗,展开“更多”可查看预算与用量。</sub>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="docs/images/settings.png" alt="Tab Namer 设置页" width="100%" />
|
|
37
|
+
<br /><sub>设置对本机所有 workspace 生效:服务、模型、思考强度、预算与提示词。</sub>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
> 图片为根据插件真实界面和 Paseo 深色主题制作的示意图,源文件见 [`docs/media-src`](docs/media-src)。
|
|
41
|
+
|
|
42
|
+
## 安装
|
|
43
|
+
|
|
44
|
+
需要 **Paseo 0.11.2 或更新版本**。
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
paseo plugin install git:stv1024/paseo-tab-namer
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
可用 `--ref <tag 或 commit>` 固定版本;之后用 `paseo plugin update tab-namer` 更新。
|
|
51
|
+
|
|
52
|
+
首次使用请打开 **设置 → Tab Namer**,选择 **服务** 和 **模型**,再点 **保存设置**。
|
|
53
|
+
|
|
54
|
+
## 使用
|
|
55
|
+
|
|
56
|
+
1. 点击 workspace 顶部的 **✨ Tab Namer** 按钮。
|
|
57
|
+
2. 选择范围:**最近 Tab**、**全部 Tab** 或 **指定 Tab**。
|
|
58
|
+
3. 点击 **生成名称**,名称会立即应用;点 **再次生成** 可换一个。
|
|
59
|
+
4. 如需手动微调,修改输入框后点击 **应用手动修改**。
|
|
60
|
+
|
|
61
|
+
展开 **更多** 后点 **预览输入**,可查看将要发送的内容和预算占用,不调用模型。
|
|
62
|
+
|
|
63
|
+
其他入口:
|
|
64
|
+
|
|
65
|
+
| 位置 | 内容 |
|
|
66
|
+
| ---------- | ---------------------------------------------------------------------------- |
|
|
67
|
+
| 命令中心 | `Tab Namer:选择 workspace 重命名`(可搜索全部 workspace)、`Tab Namer:重命名当前 workspace`、`Tab Namer:根据当前 Tab`、`Tab Namer 设置` |
|
|
68
|
+
|
|
69
|
+
## 工作原理
|
|
70
|
+
|
|
71
|
+
<p align="center">
|
|
72
|
+
<img src="docs/images/flow.png" alt="读取 Tab → 适配预算 → 调用服务 → 应用并清理" width="100%" />
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
Paseo 目前只通过 agent 向插件提供模型能力。点击生成时,插件在当前 workspace 临时启动一个标题为 **Tab Namer**、带 `tab-namer` 标签的会话,把提示词和所选 Tab 文字作为一条消息发送,读取回复后立即归档。带该标签的会话不会被当作 Tab 读取。认证完全由 Paseo 的服务配置负责。
|
|
76
|
+
|
|
77
|
+
生成以后台任务运行,界面轮询状态,关闭弹窗也会完成。每个 workspace 同时只运行一项任务,全局最多并发三项。写入前会重读当前名称,若已被修改则拒绝覆盖。
|
|
78
|
+
|
|
79
|
+
## 设置
|
|
80
|
+
|
|
81
|
+
| 设置 | 默认值 | 说明 |
|
|
82
|
+
| ------------ | ------------------ | -------------------------------------- |
|
|
83
|
+
| 服务与模型 | 未选择 | 列表来自本机 Paseo 已启用的服务 |
|
|
84
|
+
| 思考强度 | 模型默认 | 命名任务简单,较低强度通常更快 |
|
|
85
|
+
| 最大输入预算 | 128,000 | 可设 2,048–256,000,保守上界 |
|
|
86
|
+
| 默认范围 | 最近 Tab | 或全部 Tab |
|
|
87
|
+
| 内容 | 用户与助手文字 | 或仅用户文字 |
|
|
88
|
+
| 名称长度 | 最多 48 个字符 | 8–120 |
|
|
89
|
+
| 请求超时 | 180 秒 | 15–600 |
|
|
90
|
+
| 命名提示词 | 内置中文提示词 | 所有 workspace 共用,可恢复默认 |
|
|
91
|
+
|
|
92
|
+
<details>
|
|
93
|
+
<summary><b>关于输入预算</b></summary>
|
|
94
|
+
|
|
95
|
+
不同模型的 tokenizer 不同,因此预算按 **UTF-8 字节数加 256** 计算,包含系统提示词和选取的消息。这个数通常显著高于实际 tokens:128,000 的预算通常容纳几万个实际 tokens。服务返回用量时界面会显示实际数值;请确保所选模型的上下文窗口足够容纳该预算。
|
|
96
|
+
|
|
97
|
+
短 Tab 的文字完整纳入。超限时每个 Tab 保留开头约 25% 和近期约 75%;多个 Tab 公平分配预算,短 Tab 退还未用空间。很长的 Tab 分页读取,有读取页数上限。一次最多处理 100 个 Tab。预览会明确显示是否截取。
|
|
98
|
+
|
|
99
|
+
Claude Code、Codex 等服务会附带自身的系统提示词与工具定义,因此实际计费的输入 tokens 会高于命名内容本身。提示词要求模型不调用工具;若模型仍请求工具权限,任务会停止并报错。
|
|
100
|
+
|
|
101
|
+
</details>
|
|
102
|
+
|
|
103
|
+
## 隐私
|
|
104
|
+
|
|
105
|
+
- 所选 Tab 的文字只发送到 **你** 选择的服务。
|
|
106
|
+
- 预览输入不会调用模型,也不会修改名称。
|
|
107
|
+
- 插件不保存任何凭据;设置保存在 Paseo 的 host settings 中。
|
|
108
|
+
- 完成任务的临时结果约十分钟后从内存移除。
|
|
109
|
+
|
|
110
|
+
## 限制
|
|
111
|
+
|
|
112
|
+
- Paseo 不支持把插件按钮放入原生 workspace 右键菜单或重命名对话框,因此改为提供顶部按钮和命令中心条目。插件不使用侧栏,不占用手机端 workspace 列表的空间。
|
|
113
|
+
- 只能依据 Paseo 当前可读取的记录命名,无法恢复宿主已丢弃的历史。
|
|
114
|
+
- 宿主没有原子 compare-and-set 接口,无法防止“检查后、写入前”这一瞬间的并发修改。
|
|
115
|
+
|
|
116
|
+
## 开发
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
npm ci
|
|
120
|
+
npm run typecheck
|
|
121
|
+
npm test # server/ 下的 node:test 测试
|
|
122
|
+
|
|
123
|
+
# 连接本机 Paseo,对当前目录对应的 workspace 跑一次真实命名,不修改名称
|
|
124
|
+
npm run test:smoke -- <provider>/<model>
|
|
125
|
+
|
|
126
|
+
paseo plugin install . # 从本地目录安装
|
|
127
|
+
paseo plugin reload tab-namer # 修改后重新加载
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Paseo 从 Git 安装插件时直接用 esbuild 打包源码,**不执行 `npm install`**。运行时代码只能导入 Paseo 自带的 `@getpaseo/plugin`、`react`、`react-native`、`zod` 和 Node 内置模块;`devDependencies` 只用于类型检查、测试和脚本。
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
index.client.tsx 界面入口:顶部按钮、页面、命令中心
|
|
134
|
+
index.server.ts RPC 处理与后台任务
|
|
135
|
+
client/ 重命名弹窗/页面、设置页、通用组件
|
|
136
|
+
server/ Tab 读取、预算、模型会话、命名逻辑(含测试)
|
|
137
|
+
shared/ RPC 契约与设置 schema
|
|
138
|
+
docs/media-src/ README 插图的 HTML 源(node docs/media-src/render.mjs)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 参与贡献
|
|
142
|
+
|
|
143
|
+
欢迎提交 Issue 和 Pull Request。提交 PR 前请运行 `npm run typecheck` 和 `npm test`;涉及命名质量的改动,请附上 `npm run test:smoke` 的前后对比。
|
|
144
|
+
|
|
145
|
+
## 许可证
|
|
146
|
+
|
|
147
|
+
[MIT](LICENSE) © Stephen Zhou
|