@buyi1net/pi-toolkit 0.0.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/LICENSE +21 -0
- package/README.md +45 -0
- package/assembler.ts +127 -0
- package/config.ts +201 -0
- package/i18n.ts +693 -0
- package/index.ts +99 -0
- package/menu/items.ts +264 -0
- package/menu/panels.ts +91 -0
- package/menu/settings-list.ts +84 -0
- package/menu/theme.ts +31 -0
- package/menu/toolkit-menu.ts +139 -0
- package/module.ts +156 -0
- package/modules/eyes/chain.ts +173 -0
- package/modules/eyes/config.ts +319 -0
- package/modules/eyes/index.ts +161 -0
- package/modules/eyes/menu.ts +828 -0
- package/modules/eyes/pi-model-backend.ts +245 -0
- package/modules/eyes/resilience.ts +161 -0
- package/modules/eyes/vision-bridge.ts +232 -0
- package/modules/eyes/vision-cache.ts +86 -0
- package/modules/eyes/vision-json.ts +19 -0
- package/modules/eyes/vision-preprocess.ts +192 -0
- package/modules/eyes/vision-probe.ts +21 -0
- package/modules/eyes/vision-prompt.ts +90 -0
- package/modules/eyes/vision-tool.ts +59 -0
- package/modules/eyes/vision-types.ts +33 -0
- package/modules/index.ts +10 -0
- package/modules/subagents/agents/researcher.md +51 -0
- package/modules/subagents/agents/scout.md +40 -0
- package/modules/subagents/agents/worker.md +79 -0
- package/modules/subagents/config.json.example +6 -0
- package/modules/subagents/config.ts +144 -0
- package/modules/subagents/index.ts +91 -0
- package/modules/subagents/menu.ts +388 -0
- package/modules/subagents/src/activity.ts +511 -0
- package/modules/subagents/src/agents.ts +126 -0
- package/modules/subagents/src/command.ts +37 -0
- package/modules/subagents/src/dependencies.ts +246 -0
- package/modules/subagents/src/diagnostics.ts +13 -0
- package/modules/subagents/src/display.ts +94 -0
- package/modules/subagents/src/headless.ts +342 -0
- package/modules/subagents/src/herdr.ts +203 -0
- package/modules/subagents/src/index.ts +2798 -0
- package/modules/subagents/src/inspect-tool.ts +839 -0
- package/modules/subagents/src/launch-config.ts +196 -0
- package/modules/subagents/src/layout-budget.ts +26 -0
- package/modules/subagents/src/list-tool.ts +292 -0
- package/modules/subagents/src/message-tool.ts +808 -0
- package/modules/subagents/src/names.ts +17 -0
- package/modules/subagents/src/pane-layout.ts +49 -0
- package/modules/subagents/src/params.ts +145 -0
- package/modules/subagents/src/renderers.ts +181 -0
- package/modules/subagents/src/result.ts +43 -0
- package/modules/subagents/src/retention.ts +114 -0
- package/modules/subagents/src/route-error.ts +212 -0
- package/modules/subagents/src/routing.ts +235 -0
- package/modules/subagents/src/runtime-registry.ts +159 -0
- package/modules/subagents/src/session.ts +801 -0
- package/modules/subagents/src/status.ts +513 -0
- package/modules/subagents/src/stop-tool.ts +235 -0
- package/modules/subagents/src/subagent-done.ts +590 -0
- package/modules/subagents/src/subagent-tool.ts +1155 -0
- package/modules/subagents/src/surface.ts +355 -0
- package/modules/subagents/src/team-dispatch-tool.ts +219 -0
- package/modules/subagents/src/team.ts +232 -0
- package/modules/subagents/src/tmux.ts +210 -0
- package/modules/subagents/src/tools/safe-bash.ts +72 -0
- package/modules/subagents/src/types.ts +131 -0
- package/modules/tui/adapter/provider-usage.ts +143 -0
- package/modules/tui/config.ts +50 -0
- package/modules/tui/index.ts +120 -0
- package/modules/tui/kernel/pkg/shared/grok-subscription.ts +169 -0
- package/modules/tui/kernel/pkg/shared/official-subscription.ts +237 -0
- package/modules/tui/kernel/pkg/shared/provider-catalog.ts +367 -0
- package/modules/tui/kernel/pkg/shared/provider-contracts.ts +150 -0
- package/modules/tui/kernel/pkg/shared/provider-display.ts +55 -0
- package/modules/tui/kernel/pkg/shared/provider-parsers.ts +171 -0
- package/modules/tui/kernel/pkg/shared/volcengine.ts +191 -0
- package/modules/tui/kernel/pkg/shared/zhipu.ts +149 -0
- package/modules/tui/kernel/pkg/usage-core/index.ts +335 -0
- package/modules/tui/kernel/pkg/usage-core/provider-routes.ts +187 -0
- package/modules/tui/kernel/pkg/usage-node/index.ts +635 -0
- package/modules/tui/kernel/pkg/usage-node/provider-usage.ts +388 -0
- package/modules/tui/kernel/usage-core.ts +2 -0
- package/modules/tui/kernel/usage-node.ts +2 -0
- package/modules/tui/menu.ts +418 -0
- package/modules/tui/plugin/editor.ts +396 -0
- package/modules/tui/plugin/footer.ts +161 -0
- package/modules/tui/plugin/index.ts +30 -0
- package/modules/tui/plugin/lifecycle.ts +637 -0
- package/modules/tui/plugin/package-order.ts +169 -0
- package/modules/tui/plugin/screen-transition.ts +203 -0
- package/modules/tui/plugin/settings-config.ts +297 -0
- package/modules/tui/plugin/status-sources.ts +49 -0
- package/modules/tui/plugin/transition-gate.ts +261 -0
- package/modules/tui/renderer/custom-header.ts +157 -0
- package/modules/tui/renderer/editor.ts +70 -0
- package/modules/tui/renderer/header.ts +72 -0
- package/modules/tui/renderer/icons.ts +149 -0
- package/modules/tui/renderer/pi-installer-logo.ts +194 -0
- package/modules/tui/status/auto-compaction.ts +67 -0
- package/modules/tui/status/project-status.ts +655 -0
- package/modules/tui/status/provider-status.ts +120 -0
- package/modules/tui/status/runtime-status.ts +307 -0
- package/modules/tui/status/session-status.ts +325 -0
- package/modules/tui/status/status-config.ts +95 -0
- package/modules/tui/status/status-segments.ts +263 -0
- package/modules/tui/status/turn-telemetry.ts +466 -0
- package/modules/tui/themes/LICENSE.pi-themes-bundle +21 -0
- package/modules/tui/themes/UPSTREAM.md +7 -0
- package/modules/tui/themes/catppuccin-latte.json +80 -0
- package/modules/tui/themes/catppuccin-mocha.json +79 -0
- package/modules/tui/themes/crimson-noir.json +85 -0
- package/modules/tui/themes/dracula.json +79 -0
- package/modules/tui/themes/everforest-dark.json +85 -0
- package/modules/tui/themes/gruvbox-dark.json +85 -0
- package/modules/tui/themes/gruvbox-light.json +85 -0
- package/modules/tui/themes/matrix.json +85 -0
- package/modules/tui/themes/nord.json +85 -0
- package/modules/tui/themes/one-dark.json +85 -0
- package/modules/tui/themes/rose-pine-dawn.json +85 -0
- package/modules/tui/themes/rose-pine.json +85 -0
- package/modules/tui/themes/solarized-dark.json +85 -0
- package/modules/tui/themes/solarized-light.json +85 -0
- package/modules/tui/themes/tokyo-night-storm.json +79 -0
- package/modules/tui/themes/tokyo-night.json +79 -0
- package/package.json +28 -0
- package/services.ts +38 -0
- package/toolkit.ts +147 -0
package/i18n.ts
ADDED
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
// pi-toolkit 三语键表与译者。
|
|
2
|
+
// 所有面向用户的文案(菜单、通知、提示行)都必须经这里取,组件里禁止硬编码字符串。
|
|
3
|
+
// 语言设置沿用 pi-eyes 的 auto 机制并扩展出繁体中文。
|
|
4
|
+
|
|
5
|
+
/** 实际生效的语言:三语键表各一份 */
|
|
6
|
+
export type ResolvedLanguage = "en" | "zh-CN" | "zh-TW";
|
|
7
|
+
|
|
8
|
+
/** 配置里保存的语言设置:auto 跟随系统语言 */
|
|
9
|
+
export type LanguageSetting = "auto" | ResolvedLanguage;
|
|
10
|
+
|
|
11
|
+
export const LANGUAGE_SETTINGS: readonly LanguageSetting[] = ["auto", "en", "zh-CN", "zh-TW"];
|
|
12
|
+
|
|
13
|
+
export interface ToolkitMessages {
|
|
14
|
+
"command.description": string;
|
|
15
|
+
"menu.title": string;
|
|
16
|
+
"group.general": string;
|
|
17
|
+
"group.general.description": string;
|
|
18
|
+
"group.subagents": string;
|
|
19
|
+
"group.subagents.description": string;
|
|
20
|
+
/** {count}:分组内的行数 */
|
|
21
|
+
"group.itemCount": string;
|
|
22
|
+
"problem.config": string;
|
|
23
|
+
"problem.module": string;
|
|
24
|
+
/** {label}:{source} — {detail} */
|
|
25
|
+
"problem.summary": string;
|
|
26
|
+
"language.label": string;
|
|
27
|
+
"language.description": string;
|
|
28
|
+
"language.auto": string;
|
|
29
|
+
"language.en": string;
|
|
30
|
+
"language.zhCN": string;
|
|
31
|
+
"language.zhTW": string;
|
|
32
|
+
/** {language}:auto 解析后的实际语言名 */
|
|
33
|
+
"language.autoResolved": string;
|
|
34
|
+
"common.on": string;
|
|
35
|
+
"common.off": string;
|
|
36
|
+
"common.current": string;
|
|
37
|
+
"hint.change": string;
|
|
38
|
+
"hint.search": string;
|
|
39
|
+
"hint.noSettings": string;
|
|
40
|
+
"hint.noMatch": string;
|
|
41
|
+
"hint.chooseOptions": string;
|
|
42
|
+
"hint.back": string;
|
|
43
|
+
"hint.cancel": string;
|
|
44
|
+
/** {language} */
|
|
45
|
+
"notify.languageChanged": string;
|
|
46
|
+
/** {reason} */
|
|
47
|
+
"notify.saveFailed": string;
|
|
48
|
+
/** {module} */
|
|
49
|
+
"notify.moduleTogglePending": string;
|
|
50
|
+
"notify.nonInteractive": string;
|
|
51
|
+
"module.tui.label": string;
|
|
52
|
+
"module.tui.description": string;
|
|
53
|
+
"module.tui.enabled.label": string;
|
|
54
|
+
"module.tui.enabled.description": string;
|
|
55
|
+
"module.tui.menu.label": string;
|
|
56
|
+
"module.tui.menu.description": string;
|
|
57
|
+
/** {editor} {header} {footer}:三个常驻 UI 开关的显示值 */
|
|
58
|
+
"module.tui.menu.value": string;
|
|
59
|
+
"module.tui.editor.label": string;
|
|
60
|
+
"module.tui.editor.description": string;
|
|
61
|
+
"module.tui.header.label": string;
|
|
62
|
+
"module.tui.header.description": string;
|
|
63
|
+
"module.tui.footer.label": string;
|
|
64
|
+
"module.tui.footer.description": string;
|
|
65
|
+
"module.tui.spinner.label": string;
|
|
66
|
+
"module.tui.spinner.description": string;
|
|
67
|
+
"module.tui.spinner.default": string;
|
|
68
|
+
"module.tui.spinner.static": string;
|
|
69
|
+
"module.tui.spinner.hidden": string;
|
|
70
|
+
"module.tui.preset.label": string;
|
|
71
|
+
"module.tui.preset.description": string;
|
|
72
|
+
"module.tui.preset.minimal": string;
|
|
73
|
+
"module.tui.preset.default": string;
|
|
74
|
+
"module.tui.preset.full": string;
|
|
75
|
+
"module.tui.refresh.label": string;
|
|
76
|
+
"module.tui.refresh.description": string;
|
|
77
|
+
"module.tui.refresh.30": string;
|
|
78
|
+
"module.tui.refresh.60": string;
|
|
79
|
+
"module.tui.refresh.120": string;
|
|
80
|
+
"module.tui.refresh.300": string;
|
|
81
|
+
"module.tui.telemetry.label": string;
|
|
82
|
+
"module.tui.telemetry.description": string;
|
|
83
|
+
"module.tui.providerAccess.label": string;
|
|
84
|
+
"module.tui.providerAccess.description": string;
|
|
85
|
+
"module.tui.providerAccess.configured": string;
|
|
86
|
+
"module.tui.providerAccess.missing": string;
|
|
87
|
+
"module.tui.packageOrder.notice": string;
|
|
88
|
+
"module.eyes.label": string;
|
|
89
|
+
"module.eyes.description": string;
|
|
90
|
+
"module.eyes.enabled.label": string;
|
|
91
|
+
"module.eyes.enabled.description": string;
|
|
92
|
+
"module.eyes.route.label": string;
|
|
93
|
+
"module.eyes.route.description": string;
|
|
94
|
+
"module.eyes.route.auto": string;
|
|
95
|
+
"module.eyes.route.off": string;
|
|
96
|
+
/** {model} */
|
|
97
|
+
"module.eyes.route.fixed": string;
|
|
98
|
+
"module.eyes.menu.label": string;
|
|
99
|
+
"module.eyes.menu.description": string;
|
|
100
|
+
"module.eyes.model.label": string;
|
|
101
|
+
"module.eyes.model.description": string;
|
|
102
|
+
"module.eyes.model.auto": string;
|
|
103
|
+
"module.eyes.model.autoDescription": string;
|
|
104
|
+
"module.eyes.model.off": string;
|
|
105
|
+
"module.eyes.model.offDescription": string;
|
|
106
|
+
"module.eyes.model.authenticated": string;
|
|
107
|
+
"module.eyes.model.noAuthRequired": string;
|
|
108
|
+
"module.eyes.model.unavailable": string;
|
|
109
|
+
"module.eyes.model.empty": string;
|
|
110
|
+
"module.eyes.refresh.label": string;
|
|
111
|
+
"module.eyes.refresh.description": string;
|
|
112
|
+
/** {count}:候选模型数 */
|
|
113
|
+
"module.eyes.refresh.value": string;
|
|
114
|
+
"module.eyes.refresh.running": string;
|
|
115
|
+
"module.eyes.refresh.complete": string;
|
|
116
|
+
/** {reason} */
|
|
117
|
+
"module.eyes.refresh.failed": string;
|
|
118
|
+
"module.eyes.check.label": string;
|
|
119
|
+
"module.eyes.check.description": string;
|
|
120
|
+
"module.eyes.check.value": string;
|
|
121
|
+
"module.eyes.check.running": string;
|
|
122
|
+
/** {elapsed}:耗时毫秒 */
|
|
123
|
+
"module.eyes.check.passed": string;
|
|
124
|
+
/** {reason} */
|
|
125
|
+
"module.eyes.check.failed": string;
|
|
126
|
+
"module.eyes.check.noRoute": string;
|
|
127
|
+
"module.eyes.check.noModel": string;
|
|
128
|
+
/** {model} */
|
|
129
|
+
"module.eyes.probe.running": string;
|
|
130
|
+
/** {model} {matched}/{total} {response} */
|
|
131
|
+
"module.eyes.probe.passed": string;
|
|
132
|
+
/** {model} {matched}/{total} {reason} */
|
|
133
|
+
"module.eyes.probe.failed": string;
|
|
134
|
+
"module.eyes.probe.unchanged": string;
|
|
135
|
+
"module.eyes.save.running": string;
|
|
136
|
+
/** {reason} */
|
|
137
|
+
"module.eyes.save.failed": string;
|
|
138
|
+
"module.eyes.save.modelsChanged": string;
|
|
139
|
+
"module.eyes.running": string;
|
|
140
|
+
"module.eyes.cancelled": string;
|
|
141
|
+
/** {field} */
|
|
142
|
+
"module.eyes.configError.notObject": string;
|
|
143
|
+
/** {field} */
|
|
144
|
+
"module.eyes.configError.notNonEmptyString": string;
|
|
145
|
+
/** {field} */
|
|
146
|
+
"module.eyes.configError.badMode": string;
|
|
147
|
+
/** {field} */
|
|
148
|
+
"module.eyes.configError.allowedModelsNotArray": string;
|
|
149
|
+
/** {field} */
|
|
150
|
+
"module.eyes.configError.fixedRequired": string;
|
|
151
|
+
/** {command}:sharp 安装命令 */
|
|
152
|
+
"module.eyes.sharpMissing": string;
|
|
153
|
+
/** {index}:图片序号,从 1 起 */
|
|
154
|
+
"module.eyes.imageError.empty": string;
|
|
155
|
+
/** {index}:图片序号,从 1 起;{mediaType} */
|
|
156
|
+
"module.eyes.imageError.unsupportedMime": string;
|
|
157
|
+
/** {index} */
|
|
158
|
+
"module.eyes.imageError.invalidBase64": string;
|
|
159
|
+
/** {index} */
|
|
160
|
+
"module.eyes.imageError.corruptBase64": string;
|
|
161
|
+
/** {bytes} */
|
|
162
|
+
"module.eyes.imageError.tooLarge": string;
|
|
163
|
+
/** {reason} */
|
|
164
|
+
"module.eyes.imageError.decodeFailed": string;
|
|
165
|
+
/** {bytes} */
|
|
166
|
+
"module.eyes.imageError.totalTooLarge": string;
|
|
167
|
+
/** {reason} */
|
|
168
|
+
"module.eyes.injectPreprocessFailed": string;
|
|
169
|
+
"module.eyes.injectUnavailable": string;
|
|
170
|
+
"module.eyes.queryEmpty": string;
|
|
171
|
+
"module.eyes.queryNoImage": string;
|
|
172
|
+
"module.eyes.queryFailed": string;
|
|
173
|
+
"module.subagents.label": string;
|
|
174
|
+
"module.subagents.description": string;
|
|
175
|
+
"module.subagents.enabled.label": string;
|
|
176
|
+
"module.subagents.enabled.description": string;
|
|
177
|
+
"module.subagents.menu.label": string;
|
|
178
|
+
"module.subagents.menu.description": string;
|
|
179
|
+
/** {configured}/{total}:已配置的档位数与总档位数 */
|
|
180
|
+
"module.subagents.menu.value": string;
|
|
181
|
+
"module.subagents.status.label": string;
|
|
182
|
+
"module.subagents.status.description": string;
|
|
183
|
+
/** {tier}:fast / balanced / deep */
|
|
184
|
+
"module.subagents.tier.label": string;
|
|
185
|
+
/** {tier} */
|
|
186
|
+
"module.subagents.tier.description": string;
|
|
187
|
+
"module.subagents.tier.unmapped": string;
|
|
188
|
+
"module.subagents.tier.authenticated": string;
|
|
189
|
+
"module.subagents.tier.noAuthRequired": string;
|
|
190
|
+
"module.subagents.route.label": string;
|
|
191
|
+
"module.subagents.route.description": string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export type MessageKey = keyof ToolkitMessages;
|
|
195
|
+
export type MessageVars = Record<string, string | number>;
|
|
196
|
+
/** 取当前语言文案;{name} 占位符由 vars 替换 */
|
|
197
|
+
export type Translator = (key: MessageKey, vars?: MessageVars) => string;
|
|
198
|
+
|
|
199
|
+
const EN: ToolkitMessages = {
|
|
200
|
+
"command.description": "Open the pi-toolkit control panel",
|
|
201
|
+
"menu.title": "pi-toolkit",
|
|
202
|
+
"group.general": "General",
|
|
203
|
+
"group.general.description": "Language and general module settings",
|
|
204
|
+
"group.subagents": "Subagents",
|
|
205
|
+
"group.subagents.description": "Subagent tooling: tier model routing and the status widget",
|
|
206
|
+
"group.itemCount": "{count} items",
|
|
207
|
+
"problem.config": "Config file problem",
|
|
208
|
+
"problem.module": "Module failed to load",
|
|
209
|
+
/** {label}:{source} — {detail} */
|
|
210
|
+
"problem.summary": "{label}: {source} — {detail}",
|
|
211
|
+
"language.label": "Language",
|
|
212
|
+
"language.description": "Language used by the pi-toolkit menus",
|
|
213
|
+
"language.auto": "Auto",
|
|
214
|
+
"language.en": "English",
|
|
215
|
+
"language.zhCN": "简体中文",
|
|
216
|
+
"language.zhTW": "繁體中文",
|
|
217
|
+
"language.autoResolved": "Follow the system language; currently {language}",
|
|
218
|
+
"common.on": "On",
|
|
219
|
+
"common.off": "Off",
|
|
220
|
+
"common.current": "Current",
|
|
221
|
+
"hint.change": " Enter/Space to change · Esc to go back",
|
|
222
|
+
"hint.search": " Type to search · Enter/Space to change · Esc to go back",
|
|
223
|
+
"hint.noSettings": " No settings available",
|
|
224
|
+
"hint.noMatch": " No matching settings",
|
|
225
|
+
"hint.chooseOptions": " ↑↓ select · Enter confirm · Esc go back",
|
|
226
|
+
"hint.back": " Esc to go back",
|
|
227
|
+
"hint.cancel": " Esc to cancel",
|
|
228
|
+
"notify.languageChanged": "Language switched to {language}",
|
|
229
|
+
"notify.saveFailed": "{reason}",
|
|
230
|
+
"notify.moduleTogglePending": "{module} saved; reload pi to apply it",
|
|
231
|
+
"notify.nonInteractive": "/pi-toolkit needs the pi TUI; nothing was changed",
|
|
232
|
+
"module.tui.label": "Appearance & status",
|
|
233
|
+
"module.tui.description": "Editor border, header, footer, spinner, status preset and provider data",
|
|
234
|
+
"module.tui.enabled.label": "Enable appearance & status",
|
|
235
|
+
"module.tui.enabled.description": "When off, the editor, header, footer, working indicator and all 15 event hooks are not installed (reload to apply)",
|
|
236
|
+
"module.tui.menu.label": "Appearance settings",
|
|
237
|
+
"module.tui.menu.description": "Editor border, header, footer, spinner, status data and provider credentials",
|
|
238
|
+
"module.tui.menu.value": "Editor {editor} · Header {header} · Footer {footer}",
|
|
239
|
+
"module.tui.editor.label": "Editor border status",
|
|
240
|
+
"module.tui.editor.description": "Show status segments on the editor frame",
|
|
241
|
+
"module.tui.header.label": "Header",
|
|
242
|
+
"module.tui.header.description": "Show version, model and working directory above the editor",
|
|
243
|
+
"module.tui.footer.label": "Footer status bar",
|
|
244
|
+
"module.tui.footer.description": "Show session and project status below the editor; off leaves the host footer untouched",
|
|
245
|
+
"module.tui.spinner.label": "Working indicator",
|
|
246
|
+
"module.tui.spinner.description": "Animation shown while the agent is working",
|
|
247
|
+
"module.tui.spinner.default": "Default animation",
|
|
248
|
+
"module.tui.spinner.static": "Static dot",
|
|
249
|
+
"module.tui.spinner.hidden": "Hidden",
|
|
250
|
+
"module.tui.preset.label": "Status preset",
|
|
251
|
+
"module.tui.preset.description": "Which status segments are shown",
|
|
252
|
+
"module.tui.preset.minimal": "Minimal",
|
|
253
|
+
"module.tui.preset.default": "Default",
|
|
254
|
+
"module.tui.preset.full": "Full",
|
|
255
|
+
"module.tui.refresh.label": "Balance refresh interval",
|
|
256
|
+
"module.tui.refresh.description": "How often provider balance/quota data is queried",
|
|
257
|
+
"module.tui.refresh.30": "30 seconds",
|
|
258
|
+
"module.tui.refresh.60": "1 minute",
|
|
259
|
+
"module.tui.refresh.120": "2 minutes",
|
|
260
|
+
"module.tui.refresh.300": "5 minutes",
|
|
261
|
+
"module.tui.telemetry.label": "Reply telemetry",
|
|
262
|
+
"module.tui.telemetry.description": "Record per-reply timing and token usage entries",
|
|
263
|
+
"module.tui.providerAccess.label": "Provider credentials",
|
|
264
|
+
"module.tui.providerAccess.description": "Read-only: kept in the standalone file",
|
|
265
|
+
"module.tui.providerAccess.configured": "Configured",
|
|
266
|
+
"module.tui.providerAccess.missing": "Not configured",
|
|
267
|
+
"module.tui.packageOrder.notice": "pi-toolkit was moved to the front of the startup package list; restart Pi to apply",
|
|
268
|
+
"module.eyes.label": "Vision assistance",
|
|
269
|
+
"module.eyes.description": "Gives text-only models image understanding through an auxiliary vision model",
|
|
270
|
+
"module.eyes.enabled.label": "Enable vision assistance",
|
|
271
|
+
"module.eyes.enabled.description": "When off, image context injection and the vision_query tool are not registered (reload to apply)",
|
|
272
|
+
"module.eyes.route.label": "Vision model routing",
|
|
273
|
+
"module.eyes.route.description": "The active vision route (read-only)",
|
|
274
|
+
"module.eyes.route.auto": "auto — pick an available vision model",
|
|
275
|
+
"module.eyes.route.off": "off — no vision model",
|
|
276
|
+
"module.eyes.route.fixed": "fixed — {model}",
|
|
277
|
+
"module.eyes.menu.label": "Vision settings",
|
|
278
|
+
"module.eyes.menu.description": "Choose the vision model, refresh the catalogue and run a self-check",
|
|
279
|
+
"module.eyes.model.label": "Vision model",
|
|
280
|
+
"module.eyes.model.description": "A real image probe runs on the candidate before the change sticks",
|
|
281
|
+
"module.eyes.model.auto": "auto — Select automatically",
|
|
282
|
+
"module.eyes.model.autoDescription": "Pick from Pi's currently available vision models.",
|
|
283
|
+
"module.eyes.model.off": "off — Use no vision model",
|
|
284
|
+
"module.eyes.model.offDescription": "Turn vision assistance off; no vision model is called.",
|
|
285
|
+
"module.eyes.model.authenticated": "authenticated",
|
|
286
|
+
"module.eyes.model.noAuthRequired": "no authentication required",
|
|
287
|
+
"module.eyes.model.unavailable": "currently unavailable",
|
|
288
|
+
"module.eyes.model.empty": "No vision model is currently available.",
|
|
289
|
+
"module.eyes.refresh.label": "Refresh model catalogue",
|
|
290
|
+
"module.eyes.refresh.description": "Re-read Pi's model catalogue without using the network",
|
|
291
|
+
"module.eyes.refresh.value": "{count} candidates",
|
|
292
|
+
"module.eyes.refresh.running": "Refreshing Pi's model catalogue…",
|
|
293
|
+
"module.eyes.refresh.complete": "Pi's model catalogue was refreshed.",
|
|
294
|
+
"module.eyes.refresh.failed": "Could not refresh models: {reason}",
|
|
295
|
+
"module.eyes.check.label": "Run self-check",
|
|
296
|
+
"module.eyes.check.description": "Send a 6-cell colour probe to verify the active vision route",
|
|
297
|
+
"module.eyes.check.value": "Not run yet",
|
|
298
|
+
"module.eyes.check.running": "Testing the vision model…",
|
|
299
|
+
"module.eyes.check.passed": "Vision model OK · {elapsed} ms",
|
|
300
|
+
"module.eyes.check.failed": "Vision model failed: {reason}",
|
|
301
|
+
"module.eyes.check.noRoute": "No vision route is available to test.",
|
|
302
|
+
"module.eyes.check.noModel": "No vision model is available to test.",
|
|
303
|
+
"module.eyes.probe.running": "Probing {model}…",
|
|
304
|
+
"module.eyes.probe.passed": "{model} passed the probe ({matched}/{total}); response: {response}",
|
|
305
|
+
"module.eyes.probe.failed": "{model} failed the probe ({matched}/{total}): {reason}",
|
|
306
|
+
"module.eyes.probe.unchanged": "The previous setting remains active.",
|
|
307
|
+
"module.eyes.save.running": "Saving…",
|
|
308
|
+
"module.eyes.save.failed": "Save failed; the previous setting remains active: {reason}",
|
|
309
|
+
"module.eyes.save.modelsChanged": "Pi's available models changed; this selection was not saved. Choose again.",
|
|
310
|
+
"module.eyes.running": "Working…",
|
|
311
|
+
"module.eyes.cancelled": "Cancelled.",
|
|
312
|
+
"module.eyes.configError.notObject": "{field} must be an object",
|
|
313
|
+
"module.eyes.configError.notNonEmptyString": "{field} must be a non-empty string",
|
|
314
|
+
"module.eyes.configError.badMode": "{field} must be \"automatic\" or \"fixed\"",
|
|
315
|
+
"module.eyes.configError.allowedModelsNotArray": "{field} must be an array or null",
|
|
316
|
+
"module.eyes.configError.fixedRequired": "fixed routing requires {field}",
|
|
317
|
+
"module.eyes.sharpMissing": "Image preprocessing needs the optional dependency sharp, which is not installed. Run `{command}` in your pi extension install directory (or reinstall pi-toolkit with optional dependencies), then reload pi.",
|
|
318
|
+
"module.eyes.imageError.empty": "Image {index} is empty",
|
|
319
|
+
"module.eyes.imageError.unsupportedMime": "Image {index} has an unsupported MIME type: {mediaType}",
|
|
320
|
+
"module.eyes.imageError.invalidBase64": "Image {index} has invalid base64 data",
|
|
321
|
+
"module.eyes.imageError.corruptBase64": "Image {index} has empty or corrupted base64 data",
|
|
322
|
+
"module.eyes.imageError.tooLarge": "The image still exceeds the {bytes} byte limit after compression",
|
|
323
|
+
"module.eyes.imageError.decodeFailed": "The image could not be decoded or compressed: {reason}",
|
|
324
|
+
"module.eyes.imageError.totalTooLarge": "The images exceed the {bytes} byte total limit",
|
|
325
|
+
"module.eyes.injectPreprocessFailed": "Vision assistance could not process this image: {reason}",
|
|
326
|
+
"module.eyes.injectUnavailable": "Vision assistance could not read the image reliably; do not guess image content.",
|
|
327
|
+
"module.eyes.queryEmpty": "The vision question must not be empty.",
|
|
328
|
+
"module.eyes.queryNoImage": "This session has no recent screenshot to ask about; call computer_screenshot first.",
|
|
329
|
+
"module.eyes.queryFailed": "The auxiliary vision model could not answer this targeted question reliably; do not guess image content.",
|
|
330
|
+
"module.subagents.label": "Subagents",
|
|
331
|
+
"module.subagents.description": "Spawn, steer and stop sub-agents that run tasks in separate pi processes",
|
|
332
|
+
"module.subagents.enabled.label": "Enable subagents",
|
|
333
|
+
"module.subagents.enabled.description": "When off, the subagent tools, message renderers, status widget and hooks are not registered (reload to apply)",
|
|
334
|
+
"module.subagents.menu.label": "Subagent settings",
|
|
335
|
+
"module.subagents.menu.description": "Tier model routing and the status widget toggle",
|
|
336
|
+
"module.subagents.menu.value": "{configured}/{total} tiers mapped",
|
|
337
|
+
"module.subagents.status.label": "Status widget",
|
|
338
|
+
"module.subagents.status.description": "Show the status widget while sub-agents run (falls back to the bundled config when unset here)",
|
|
339
|
+
"module.subagents.tier.label": "{tier} tier model",
|
|
340
|
+
"module.subagents.tier.description": "Model used when a subagent asks for tier \"{tier}\"",
|
|
341
|
+
"module.subagents.tier.unmapped": "Not mapped",
|
|
342
|
+
"module.subagents.tier.authenticated": "authenticated",
|
|
343
|
+
"module.subagents.tier.noAuthRequired": "no authentication configured",
|
|
344
|
+
"module.subagents.route.label": "Tier routing",
|
|
345
|
+
"module.subagents.route.description": "The tier routing resolved by the six-level config chain (read-only)",
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const ZH_CN: ToolkitMessages = {
|
|
349
|
+
"command.description": "打开 pi-toolkit 控制菜单",
|
|
350
|
+
"menu.title": "pi-toolkit",
|
|
351
|
+
"group.general": "常规",
|
|
352
|
+
"group.general.description": "语言与常规模块设置",
|
|
353
|
+
"group.subagents": "子代理",
|
|
354
|
+
"group.subagents.description": "子代理能力:tier 模型路由与状态显示",
|
|
355
|
+
"group.itemCount": "{count} 项",
|
|
356
|
+
"problem.config": "配置文件异常",
|
|
357
|
+
"problem.module": "模块装载失败",
|
|
358
|
+
"problem.summary": "{label}:{source} — {detail}",
|
|
359
|
+
"language.label": "界面语言",
|
|
360
|
+
"language.description": "pi-toolkit 菜单使用的界面语言",
|
|
361
|
+
"language.auto": "自动",
|
|
362
|
+
"language.en": "English",
|
|
363
|
+
"language.zhCN": "简体中文",
|
|
364
|
+
"language.zhTW": "繁體中文",
|
|
365
|
+
"language.autoResolved": "跟随系统语言,当前为{language}",
|
|
366
|
+
"common.on": "开",
|
|
367
|
+
"common.off": "关",
|
|
368
|
+
"common.current": "当前",
|
|
369
|
+
"hint.change": " Enter/空格 修改 · Esc 返回上级",
|
|
370
|
+
"hint.search": " 输入以搜索 · Enter/空格 修改 · Esc 返回上级",
|
|
371
|
+
"hint.noSettings": " 暂无可配置项",
|
|
372
|
+
"hint.noMatch": " 没有匹配的配置项",
|
|
373
|
+
"hint.chooseOptions": " ↑↓ 选择 · Enter 确认 · Esc 返回",
|
|
374
|
+
"hint.back": " Esc 返回上级",
|
|
375
|
+
"hint.cancel": " Esc 取消",
|
|
376
|
+
"notify.languageChanged": "界面语言已切换为{language}",
|
|
377
|
+
"notify.saveFailed": "{reason}",
|
|
378
|
+
"notify.moduleTogglePending": "{module} 已保存;重载 pi 后生效",
|
|
379
|
+
"notify.nonInteractive": "/pi-toolkit 只能在 pi TUI 中使用;本次没有改动配置",
|
|
380
|
+
"module.tui.label": "外观与状态",
|
|
381
|
+
"module.tui.description": "编辑器边框、Header、底部栏、Spinner、状态预设与供应商数据",
|
|
382
|
+
"module.tui.enabled.label": "启用外观与状态",
|
|
383
|
+
"module.tui.enabled.description": "关闭后不安装编辑器、Header、底部栏、工作指示动画与全部 15 个事件钩子(重载 pi 后生效)",
|
|
384
|
+
"module.tui.menu.label": "外观配置",
|
|
385
|
+
"module.tui.menu.description": "编辑器边框、Header、底部栏、Spinner、状态数据与供应商凭据",
|
|
386
|
+
"module.tui.menu.value": "编辑器{editor} · Header{header} · 底部栏{footer}",
|
|
387
|
+
"module.tui.editor.label": "编辑器边框状态",
|
|
388
|
+
"module.tui.editor.description": "在编辑器边框上显示状态分段",
|
|
389
|
+
"module.tui.header.label": "顶部信息栏",
|
|
390
|
+
"module.tui.header.description": "在编辑器上方显示版本、模型与工作目录",
|
|
391
|
+
"module.tui.footer.label": "底部状态栏",
|
|
392
|
+
"module.tui.footer.description": "在编辑器下方显示会话与项目状态;关闭后不动宿主默认底部栏",
|
|
393
|
+
"module.tui.spinner.label": "工作指示动画",
|
|
394
|
+
"module.tui.spinner.description": "代理工作期间显示的动画",
|
|
395
|
+
"module.tui.spinner.default": "默认动画",
|
|
396
|
+
"module.tui.spinner.static": "静态圆点",
|
|
397
|
+
"module.tui.spinner.hidden": "隐藏",
|
|
398
|
+
"module.tui.preset.label": "状态预设",
|
|
399
|
+
"module.tui.preset.description": "显示哪些状态分段",
|
|
400
|
+
"module.tui.preset.minimal": "精简",
|
|
401
|
+
"module.tui.preset.default": "默认",
|
|
402
|
+
"module.tui.preset.full": "完整",
|
|
403
|
+
"module.tui.refresh.label": "余额刷新间隔",
|
|
404
|
+
"module.tui.refresh.description": "供应商余额/套餐数据的查询频率",
|
|
405
|
+
"module.tui.refresh.30": "30 秒",
|
|
406
|
+
"module.tui.refresh.60": "1 分钟",
|
|
407
|
+
"module.tui.refresh.120": "2 分钟",
|
|
408
|
+
"module.tui.refresh.300": "5 分钟",
|
|
409
|
+
"module.tui.telemetry.label": "回复遥测",
|
|
410
|
+
"module.tui.telemetry.description": "记录每次回复的耗时与 token 用量条目",
|
|
411
|
+
"module.tui.providerAccess.label": "供应商凭据",
|
|
412
|
+
"module.tui.providerAccess.description": "只读:保存在独立文件",
|
|
413
|
+
"module.tui.providerAccess.configured": "已配置",
|
|
414
|
+
"module.tui.providerAccess.missing": "未配置",
|
|
415
|
+
"module.tui.packageOrder.notice": "已将 pi-toolkit 调整到启动首位,重启 Pi 后生效",
|
|
416
|
+
"module.eyes.label": "视觉辅助",
|
|
417
|
+
"module.eyes.description": "用辅助视觉模型让纯文本模型也能理解图片",
|
|
418
|
+
"module.eyes.enabled.label": "启用视觉辅助",
|
|
419
|
+
"module.eyes.enabled.description": "关闭后不再注入图片上下文、不注册 vision_query 工具(重载 pi 后生效)",
|
|
420
|
+
"module.eyes.route.label": "视觉模型路由",
|
|
421
|
+
"module.eyes.route.description": "当前生效的视觉路由(只读)",
|
|
422
|
+
"module.eyes.route.auto": "auto — 自动选择可用视觉模型",
|
|
423
|
+
"module.eyes.route.off": "off — 不使用视觉模型",
|
|
424
|
+
"module.eyes.route.fixed": "fixed — {model}",
|
|
425
|
+
"module.eyes.menu.label": "视觉配置",
|
|
426
|
+
"module.eyes.menu.description": "选择视觉模型、刷新模型目录并运行自检",
|
|
427
|
+
"module.eyes.model.label": "视觉模型",
|
|
428
|
+
"module.eyes.model.description": "更改前会先对候选模型跑一次真实图片探测,通过才生效",
|
|
429
|
+
"module.eyes.model.auto": "auto — 自动选择",
|
|
430
|
+
"module.eyes.model.autoDescription": "从当前可用的视觉模型中自动选择。",
|
|
431
|
+
"module.eyes.model.off": "off — 不使用视觉模型",
|
|
432
|
+
"module.eyes.model.offDescription": "关闭视觉辅助,不调用任何视觉模型。",
|
|
433
|
+
"module.eyes.model.authenticated": "已认证",
|
|
434
|
+
"module.eyes.model.noAuthRequired": "无需认证",
|
|
435
|
+
"module.eyes.model.unavailable": "当前不可用",
|
|
436
|
+
"module.eyes.model.empty": "当前没有可用的视觉模型。",
|
|
437
|
+
"module.eyes.refresh.label": "刷新模型目录",
|
|
438
|
+
"module.eyes.refresh.description": "重新读取 Pi 的模型目录,不联网",
|
|
439
|
+
"module.eyes.refresh.value": "{count} 个候选模型",
|
|
440
|
+
"module.eyes.refresh.running": "正在刷新 Pi 模型目录……",
|
|
441
|
+
"module.eyes.refresh.complete": "Pi 模型目录已刷新。",
|
|
442
|
+
"module.eyes.refresh.failed": "刷新模型失败:{reason}",
|
|
443
|
+
"module.eyes.check.label": "运行自检",
|
|
444
|
+
"module.eyes.check.description": "发一张 6 格彩色图验证当前视觉路由",
|
|
445
|
+
"module.eyes.check.value": "尚未运行",
|
|
446
|
+
"module.eyes.check.running": "正在检测视觉模型……",
|
|
447
|
+
"module.eyes.check.passed": "视觉模型正常 · {elapsed} ms",
|
|
448
|
+
"module.eyes.check.failed": "视觉模型异常:{reason}",
|
|
449
|
+
"module.eyes.check.noRoute": "当前没有可检测的视觉路径。",
|
|
450
|
+
"module.eyes.check.noModel": "当前没有可检测的视觉模型。",
|
|
451
|
+
"module.eyes.probe.running": "正在探测 {model}……",
|
|
452
|
+
"module.eyes.probe.passed": "{model} 探测通过({matched}/{total});返回值:{response}",
|
|
453
|
+
"module.eyes.probe.failed": "{model} 探测未通过({matched}/{total}):{reason}",
|
|
454
|
+
"module.eyes.probe.unchanged": "原设置保持不变。",
|
|
455
|
+
"module.eyes.save.running": "正在保存……",
|
|
456
|
+
"module.eyes.save.failed": "保存失败,原设置保持不变:{reason}",
|
|
457
|
+
"module.eyes.save.modelsChanged": "Pi 可用模型已经变化,本次选择未保存,请重新选择。",
|
|
458
|
+
"module.eyes.running": "处理中……",
|
|
459
|
+
"module.eyes.cancelled": "操作已取消。",
|
|
460
|
+
"module.eyes.configError.notObject": "{field} 必须是对象",
|
|
461
|
+
"module.eyes.configError.notNonEmptyString": "{field} 必须是非空字符串",
|
|
462
|
+
"module.eyes.configError.badMode": "{field} 必须是 \"automatic\" 或 \"fixed\"",
|
|
463
|
+
"module.eyes.configError.allowedModelsNotArray": "{field} 必须是数组或 null",
|
|
464
|
+
"module.eyes.configError.fixedRequired": "fixed 路由必须指定 {field}",
|
|
465
|
+
"module.eyes.sharpMissing": "图片预处理需要可选依赖 sharp,当前未安装。请在 pi 扩展安装目录执行 `{command}`(或重装 pi-toolkit 并保留可选依赖),然后重载 pi。",
|
|
466
|
+
"module.eyes.imageError.empty": "第 {index} 张图片为空",
|
|
467
|
+
"module.eyes.imageError.unsupportedMime": "第 {index} 张图片的 MIME 类型不受支持:{mediaType}",
|
|
468
|
+
"module.eyes.imageError.invalidBase64": "第 {index} 张图片的 base64 数据格式无效",
|
|
469
|
+
"module.eyes.imageError.corruptBase64": "第 {index} 张图片的 base64 数据为空或损坏",
|
|
470
|
+
"module.eyes.imageError.tooLarge": "图片压缩后仍超过 {bytes} 字节限制",
|
|
471
|
+
"module.eyes.imageError.decodeFailed": "图片无法解码或压缩:{reason}",
|
|
472
|
+
"module.eyes.imageError.totalTooLarge": "图片总大小超过 {bytes} 字节限制",
|
|
473
|
+
"module.eyes.injectPreprocessFailed": "视觉辅助无法处理本次图片:{reason}",
|
|
474
|
+
"module.eyes.injectUnavailable": "视觉辅助未能可靠读取图片,禁止根据图片内容猜测。",
|
|
475
|
+
"module.eyes.queryEmpty": "视觉询问不能为空。",
|
|
476
|
+
"module.eyes.queryNoImage": "当前会话没有可供视觉询问的最近截图,请先调用 computer_screenshot。",
|
|
477
|
+
"module.eyes.queryFailed": "辅助视觉模型未能可靠回答本次定向问题,禁止根据图片内容猜测。",
|
|
478
|
+
"module.subagents.label": "子代理",
|
|
479
|
+
"module.subagents.description": "在独立 pi 进程中启动、干预并停止执行任务的子代理",
|
|
480
|
+
"module.subagents.enabled.label": "启用子代理",
|
|
481
|
+
"module.subagents.enabled.description": "关闭后不注册子代理工具、消息渲染器、状态 widget 与钩子(重载 pi 后生效)",
|
|
482
|
+
"module.subagents.menu.label": "子代理配置",
|
|
483
|
+
"module.subagents.menu.description": "tier 模型路由与状态显示开关",
|
|
484
|
+
"module.subagents.menu.value": "{configured}/{total} 档已配置",
|
|
485
|
+
"module.subagents.status.label": "状态显示",
|
|
486
|
+
"module.subagents.status.description": "子代理运行期间显示状态 widget(此处未设置时回落包内配置)",
|
|
487
|
+
"module.subagents.tier.label": "{tier} 档模型",
|
|
488
|
+
"module.subagents.tier.description": "子代理请求 tier \"{tier}\" 时使用的模型",
|
|
489
|
+
"module.subagents.tier.unmapped": "未配置",
|
|
490
|
+
"module.subagents.tier.authenticated": "已认证",
|
|
491
|
+
"module.subagents.tier.noAuthRequired": "未配置认证",
|
|
492
|
+
"module.subagents.route.label": "tier 路由状态",
|
|
493
|
+
"module.subagents.route.description": "六级配置链解析出的 tier 路由(只读)",
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
const ZH_TW: ToolkitMessages = {
|
|
497
|
+
"command.description": "開啟 pi-toolkit 控制選單",
|
|
498
|
+
"menu.title": "pi-toolkit",
|
|
499
|
+
"group.general": "一般",
|
|
500
|
+
"group.general.description": "語言與一般模組設定",
|
|
501
|
+
"group.subagents": "子代理",
|
|
502
|
+
"group.subagents.description": "子代理能力:tier 模型路由與狀態顯示",
|
|
503
|
+
"group.itemCount": "{count} 項",
|
|
504
|
+
"problem.config": "設定檔異常",
|
|
505
|
+
"problem.module": "模組載入失敗",
|
|
506
|
+
"problem.summary": "{label}:{source} — {detail}",
|
|
507
|
+
"language.label": "介面語言",
|
|
508
|
+
"language.description": "pi-toolkit 選單使用的介面語言",
|
|
509
|
+
"language.auto": "自動",
|
|
510
|
+
"language.en": "English",
|
|
511
|
+
"language.zhCN": "简体中文",
|
|
512
|
+
"language.zhTW": "繁體中文",
|
|
513
|
+
"language.autoResolved": "跟隨系統語言,目前為{language}",
|
|
514
|
+
"common.on": "開",
|
|
515
|
+
"common.off": "關",
|
|
516
|
+
"common.current": "目前",
|
|
517
|
+
"hint.change": " Enter/空白鍵 修改 · Esc 返回上層",
|
|
518
|
+
"hint.search": " 輸入以搜尋 · Enter/空白鍵 修改 · Esc 返回上層",
|
|
519
|
+
"hint.noSettings": " 尚無可設定項目",
|
|
520
|
+
"hint.noMatch": " 沒有符合的設定項目",
|
|
521
|
+
"hint.chooseOptions": " ↑↓ 選擇 · Enter 確認 · Esc 返回",
|
|
522
|
+
"hint.back": " Esc 返回上層",
|
|
523
|
+
"hint.cancel": " Esc 取消",
|
|
524
|
+
"notify.languageChanged": "介面語言已切換為{language}",
|
|
525
|
+
"notify.saveFailed": "{reason}",
|
|
526
|
+
"notify.moduleTogglePending": "{module} 已儲存;重新載入 pi 後生效",
|
|
527
|
+
"notify.nonInteractive": "/pi-toolkit 只能在 pi TUI 中使用;本次沒有變更設定",
|
|
528
|
+
"module.tui.label": "外觀與狀態",
|
|
529
|
+
"module.tui.description": "編輯器邊框、Header、底部列、Spinner、狀態預設與供應商資料",
|
|
530
|
+
"module.tui.enabled.label": "啟用外觀與狀態",
|
|
531
|
+
"module.tui.enabled.description": "關閉後不安裝編輯器、Header、底部列、工作指示動畫與全部 15 個事件鉤子(重新載入 pi 後生效)",
|
|
532
|
+
"module.tui.menu.label": "外觀設定",
|
|
533
|
+
"module.tui.menu.description": "編輯器邊框、Header、底部列、Spinner、狀態資料與供應商憑證",
|
|
534
|
+
"module.tui.menu.value": "編輯器{editor} · Header{header} · 底部列{footer}",
|
|
535
|
+
"module.tui.editor.label": "編輯器邊框狀態",
|
|
536
|
+
"module.tui.editor.description": "在編輯器邊框上顯示狀態分段",
|
|
537
|
+
"module.tui.header.label": "頂部資訊列",
|
|
538
|
+
"module.tui.header.description": "在編輯器上方顯示版本、模型與工作目錄",
|
|
539
|
+
"module.tui.footer.label": "底部狀態列",
|
|
540
|
+
"module.tui.footer.description": "在編輯器下方顯示工作階段與專案狀態;關閉後不動宿主預設底部列",
|
|
541
|
+
"module.tui.spinner.label": "工作指示動畫",
|
|
542
|
+
"module.tui.spinner.description": "代理工作期間顯示的動畫",
|
|
543
|
+
"module.tui.spinner.default": "預設動畫",
|
|
544
|
+
"module.tui.spinner.static": "靜態圓點",
|
|
545
|
+
"module.tui.spinner.hidden": "隱藏",
|
|
546
|
+
"module.tui.preset.label": "狀態預設",
|
|
547
|
+
"module.tui.preset.description": "顯示哪些狀態分段",
|
|
548
|
+
"module.tui.preset.minimal": "精簡",
|
|
549
|
+
"module.tui.preset.default": "預設",
|
|
550
|
+
"module.tui.preset.full": "完整",
|
|
551
|
+
"module.tui.refresh.label": "餘額重新整理間隔",
|
|
552
|
+
"module.tui.refresh.description": "供應商餘額/套餐資料的查詢頻率",
|
|
553
|
+
"module.tui.refresh.30": "30 秒",
|
|
554
|
+
"module.tui.refresh.60": "1 分鐘",
|
|
555
|
+
"module.tui.refresh.120": "2 分鐘",
|
|
556
|
+
"module.tui.refresh.300": "5 分鐘",
|
|
557
|
+
"module.tui.telemetry.label": "回覆遙測",
|
|
558
|
+
"module.tui.telemetry.description": "記錄每次回覆的耗時與 token 用量條目",
|
|
559
|
+
"module.tui.providerAccess.label": "供應商憑證",
|
|
560
|
+
"module.tui.providerAccess.description": "唯讀:保存在獨立檔案",
|
|
561
|
+
"module.tui.providerAccess.configured": "已設定",
|
|
562
|
+
"module.tui.providerAccess.missing": "未設定",
|
|
563
|
+
"module.tui.packageOrder.notice": "已將 pi-toolkit 調整到啟動首位,重新載入 Pi 後生效",
|
|
564
|
+
"module.eyes.label": "視覺輔助",
|
|
565
|
+
"module.eyes.description": "用輔助視覺模型讓純文字模型也能理解圖片",
|
|
566
|
+
"module.eyes.enabled.label": "啟用視覺輔助",
|
|
567
|
+
"module.eyes.enabled.description": "關閉後不再注入圖片脈絡、不註冊 vision_query 工具(重新載入 pi 後生效)",
|
|
568
|
+
"module.eyes.route.label": "視覺模型路由",
|
|
569
|
+
"module.eyes.route.description": "目前生效的視覺路由(僅供檢視)",
|
|
570
|
+
"module.eyes.route.auto": "auto — 自動選擇可用視覺模型",
|
|
571
|
+
"module.eyes.route.off": "off — 不使用視覺模型",
|
|
572
|
+
"module.eyes.route.fixed": "fixed — {model}",
|
|
573
|
+
"module.eyes.menu.label": "視覺設定",
|
|
574
|
+
"module.eyes.menu.description": "選擇視覺模型、重新整理模型目錄並執行自我檢查",
|
|
575
|
+
"module.eyes.model.label": "視覺模型",
|
|
576
|
+
"module.eyes.model.description": "變更前會先對候選模型執行一次真實圖片探測,通過才生效",
|
|
577
|
+
"module.eyes.model.auto": "auto — 自動選擇",
|
|
578
|
+
"module.eyes.model.autoDescription": "從目前可用的視覺模型中自動選擇。",
|
|
579
|
+
"module.eyes.model.off": "off — 不使用視覺模型",
|
|
580
|
+
"module.eyes.model.offDescription": "關閉視覺輔助,不呼叫任何視覺模型。",
|
|
581
|
+
"module.eyes.model.authenticated": "已認證",
|
|
582
|
+
"module.eyes.model.noAuthRequired": "無需認證",
|
|
583
|
+
"module.eyes.model.unavailable": "目前無法使用",
|
|
584
|
+
"module.eyes.model.empty": "目前沒有可用的視覺模型。",
|
|
585
|
+
"module.eyes.refresh.label": "重新整理模型目錄",
|
|
586
|
+
"module.eyes.refresh.description": "重新讀取 Pi 的模型目錄,不連網",
|
|
587
|
+
"module.eyes.refresh.value": "{count} 個候選模型",
|
|
588
|
+
"module.eyes.refresh.running": "正在重新整理 Pi 模型目錄……",
|
|
589
|
+
"module.eyes.refresh.complete": "Pi 模型目錄已重新整理。",
|
|
590
|
+
"module.eyes.refresh.failed": "重新整理模型失敗:{reason}",
|
|
591
|
+
"module.eyes.check.label": "執行自我檢查",
|
|
592
|
+
"module.eyes.check.description": "送出 6 格彩色圖驗證目前的視覺路由",
|
|
593
|
+
"module.eyes.check.value": "尚未執行",
|
|
594
|
+
"module.eyes.check.running": "正在檢測視覺模型……",
|
|
595
|
+
"module.eyes.check.passed": "視覺模型正常 · {elapsed} ms",
|
|
596
|
+
"module.eyes.check.failed": "視覺模型異常:{reason}",
|
|
597
|
+
"module.eyes.check.noRoute": "目前沒有可檢測的視覺路徑。",
|
|
598
|
+
"module.eyes.check.noModel": "目前沒有可檢測的視覺模型。",
|
|
599
|
+
"module.eyes.probe.running": "正在探測 {model}……",
|
|
600
|
+
"module.eyes.probe.passed": "{model} 探測通過({matched}/{total});傳回值:{response}",
|
|
601
|
+
"module.eyes.probe.failed": "{model} 探測未通過({matched}/{total}):{reason}",
|
|
602
|
+
"module.eyes.probe.unchanged": "原設定保持不變。",
|
|
603
|
+
"module.eyes.save.running": "正在儲存……",
|
|
604
|
+
"module.eyes.save.failed": "儲存失敗,原設定保持不變:{reason}",
|
|
605
|
+
"module.eyes.save.modelsChanged": "Pi 可用模型已變更,本次選擇未儲存,請重新選擇。",
|
|
606
|
+
"module.eyes.running": "處理中……",
|
|
607
|
+
"module.eyes.cancelled": "操作已取消。",
|
|
608
|
+
"module.eyes.configError.notObject": "{field} 必須是物件",
|
|
609
|
+
"module.eyes.configError.notNonEmptyString": "{field} 必須是非空字串",
|
|
610
|
+
"module.eyes.configError.badMode": "{field} 必須是 \"automatic\" 或 \"fixed\"",
|
|
611
|
+
"module.eyes.configError.allowedModelsNotArray": "{field} 必須是陣列或 null",
|
|
612
|
+
"module.eyes.configError.fixedRequired": "fixed 路由必須指定 {field}",
|
|
613
|
+
"module.eyes.sharpMissing": "圖片前置處理需要可選相依套件 sharp,目前未安裝。請在 pi 擴充套件安裝目錄執行 `{command}`(或重新安裝 pi-toolkit 並保留可選相依套件),然後重新載入 pi。",
|
|
614
|
+
"module.eyes.imageError.empty": "第 {index} 張圖片為空",
|
|
615
|
+
"module.eyes.imageError.unsupportedMime": "第 {index} 張圖片的 MIME 類型不受支援:{mediaType}",
|
|
616
|
+
"module.eyes.imageError.invalidBase64": "第 {index} 張圖片的 base64 資料格式無效",
|
|
617
|
+
"module.eyes.imageError.corruptBase64": "第 {index} 張圖片的 base64 資料為空或損毀",
|
|
618
|
+
"module.eyes.imageError.tooLarge": "圖片壓縮後仍超過 {bytes} 位元組限制",
|
|
619
|
+
"module.eyes.imageError.decodeFailed": "圖片無法解碼或壓縮:{reason}",
|
|
620
|
+
"module.eyes.imageError.totalTooLarge": "圖片總大小超過 {bytes} 位元組限制",
|
|
621
|
+
"module.eyes.injectPreprocessFailed": "視覺輔助無法處理本次圖片:{reason}",
|
|
622
|
+
"module.eyes.injectUnavailable": "視覺輔助無法可靠讀取圖片,禁止依圖片內容猜測。",
|
|
623
|
+
"module.eyes.queryEmpty": "視覺詢問不能為空。",
|
|
624
|
+
"module.eyes.queryNoImage": "目前工作階段沒有可供視覺詢問的最近截圖,請先呼叫 computer_screenshot。",
|
|
625
|
+
"module.eyes.queryFailed": "輔助視覺模型未能可靠回答本次指定問題,禁止依圖片內容猜測。",
|
|
626
|
+
"module.subagents.label": "子代理",
|
|
627
|
+
"module.subagents.description": "在獨立 pi 過程中啟動、介入並停止執行任務的子代理",
|
|
628
|
+
"module.subagents.enabled.label": "啟用子代理",
|
|
629
|
+
"module.subagents.enabled.description": "關閉後不註冊子代理工具、訊息渲染器、狀態 widget 與鉤子(重新載入 pi 後生效)",
|
|
630
|
+
"module.subagents.menu.label": "子代理設定",
|
|
631
|
+
"module.subagents.menu.description": "tier 模型路由與狀態顯示開關",
|
|
632
|
+
"module.subagents.menu.value": "{configured}/{total} 檔已設定",
|
|
633
|
+
"module.subagents.status.label": "狀態顯示",
|
|
634
|
+
"module.subagents.status.description": "子代理執行期間顯示狀態 widget(此處未設定時回退套件內設定)",
|
|
635
|
+
"module.subagents.tier.label": "{tier} 檔模型",
|
|
636
|
+
"module.subagents.tier.description": "子代理要求 tier \"{tier}\" 時使用的模型",
|
|
637
|
+
"module.subagents.tier.unmapped": "未設定",
|
|
638
|
+
"module.subagents.tier.authenticated": "已認證",
|
|
639
|
+
"module.subagents.tier.noAuthRequired": "未設定認證",
|
|
640
|
+
"module.subagents.route.label": "tier 路由狀態",
|
|
641
|
+
"module.subagents.route.description": "六級設定鏈解析出的 tier 路由(僅供檢視)",
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
const TABLES: Record<ResolvedLanguage, ToolkitMessages> = {
|
|
645
|
+
en: EN,
|
|
646
|
+
"zh-CN": ZH_CN,
|
|
647
|
+
"zh-TW": ZH_TW,
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
function format(template: string, vars?: MessageVars): string {
|
|
651
|
+
if (!vars) return template;
|
|
652
|
+
return template.replace(/\{(\w+)\}/g, (whole, name: string) =>
|
|
653
|
+
Object.prototype.hasOwnProperty.call(vars, name) ? String(vars[name]) : whole,
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/** auto 解析规则:非中文 → en;繁体地区 → zh-TW;其余中文 → zh-CN */
|
|
658
|
+
export function resolveLanguage(setting: LanguageSetting): ResolvedLanguage {
|
|
659
|
+
if (setting !== "auto") return setting;
|
|
660
|
+
const locale = Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase();
|
|
661
|
+
if (!locale.startsWith("zh")) return "en";
|
|
662
|
+
return /(hant|tw|hk|mo)/.test(locale) ? "zh-TW" : "zh-CN";
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
export function isLanguageSetting(value: unknown): value is LanguageSetting {
|
|
666
|
+
return typeof value === "string" && (LANGUAGE_SETTINGS as readonly string[]).includes(value);
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/** 键表里是否存在该键;枚举值的显示文案 `<labelKey>.<value>` 靠它做可选解析 */
|
|
670
|
+
export function hasMessage(key: string): key is MessageKey {
|
|
671
|
+
return Object.prototype.hasOwnProperty.call(EN, key);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/** 语言设置对应的显示名键,用于语言选择项 */
|
|
675
|
+
export function languageLabelKey(setting: LanguageSetting): MessageKey {
|
|
676
|
+
switch (setting) {
|
|
677
|
+
case "auto":
|
|
678
|
+
return "language.auto";
|
|
679
|
+
case "en":
|
|
680
|
+
return "language.en";
|
|
681
|
+
case "zh-CN":
|
|
682
|
+
return "language.zhCN";
|
|
683
|
+
case "zh-TW":
|
|
684
|
+
return "language.zhTW";
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* 造一个始终读当前语言的译者;语言切换后无需更换实例,菜单重建即可刷新文案。
|
|
690
|
+
*/
|
|
691
|
+
export function createTranslator(getLanguage: () => ResolvedLanguage): Translator {
|
|
692
|
+
return (key, vars) => format(TABLES[getLanguage()][key], vars);
|
|
693
|
+
}
|