oh-pi 0.1.67 → 0.1.69

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.
@@ -0,0 +1,383 @@
1
+ export const messages = {
2
+ en: {
3
+ // welcome
4
+ "welcome.title": "oh-pi — one-click setup for pi agent",
5
+ "welcome.piDetected": "pi {version} detected",
6
+ "welcome.piNotFound": "pi not found — will install",
7
+ "welcome.envInfo": "{terminal} │ {os} │ Node {node}",
8
+ "welcome.existingConfig": "Existing config found",
9
+ "welcome.existingConfigDetail": "{count} files ({size}KB) at ~/.pi/agent/",
10
+ "welcome.existingProviders": "Detected providers: {providers}",
11
+ // language
12
+ "lang.select": "Language / 语言 / Langue:",
13
+ // mode
14
+ "mode.select": "How would you like to set up pi?",
15
+ "mode.quick": "🚀 Quick Setup",
16
+ "mode.quickHint": "Recommended defaults, 3 steps",
17
+ "mode.preset": "📦 Preset",
18
+ "mode.presetHint": "Choose a pre-made configuration",
19
+ "mode.custom": "🎛️ Custom",
20
+ "mode.customHint": "Pick everything yourself",
21
+ // provider
22
+ "provider.select": "Select API providers",
23
+ "provider.custom": "🔧 Custom endpoint",
24
+ "provider.customHint": "Ollama, vLLM, LiteLLM, any OpenAI-compatible",
25
+ "provider.foundEnv": "Found {env} in environment. Use it?",
26
+ "provider.customEndpoint": "Custom endpoint for {label}? (proxy, Azure, etc.)",
27
+ "provider.baseUrl": "Base URL for {label}:",
28
+ "provider.useCustomUrl": "Use a custom endpoint for {label}? (proxy, self-hosted, etc.)",
29
+ "provider.baseUrlPlaceholder": "https://your-proxy.example.com",
30
+ "provider.baseUrlValidation": "Must be a valid URL",
31
+ "provider.configured": "{label} configured",
32
+ "provider.name": "Provider name:",
33
+ "provider.namePlaceholder": "ollama",
34
+ "provider.nameRequired": "Name required",
35
+ "provider.baseUrlCustom": "Base URL:",
36
+ "provider.baseUrlCustomPlaceholder": "http://localhost:11434",
37
+ "provider.needsKey": "Requires API key?",
38
+ "provider.apiKey": "API key for {label}:",
39
+ "provider.apiKeyRequired": "API key cannot be empty",
40
+ "provider.fetchingModels": "Fetching models from {source}",
41
+ "provider.foundModels": "Found {count} models",
42
+ "provider.noModels": "No models found via API",
43
+ "provider.defaultModelList": "Using default model list",
44
+ "provider.selectModel": "Default model for {label}:",
45
+ "provider.modelName": "Model name for {label}:",
46
+ "provider.modelNamePlaceholder": "llama3.1:8b",
47
+ "provider.modelNameRequired": "Model name required",
48
+ "provider.customConfigured": "{name} configured ({url})",
49
+ "provider.configureCaps": "Configure model capabilities? (context window, multimodal, reasoning)",
50
+ "provider.contextWindow": "Context window size (tokens):",
51
+ "provider.contextWindowValidation": "Must be a number ≥ 1024",
52
+ "provider.maxTokens": "Max output tokens:",
53
+ "provider.maxTokensValidation": "Must be a number ≥ 256",
54
+ "provider.multimodal": "Supports image input (multimodal)?",
55
+ "provider.reasoning": "Supports extended thinking (reasoning)?",
56
+ "provider.detected": "Existing providers detected: {list}",
57
+ "provider.detectedSkip": "⏭ Skip — keep existing",
58
+ "provider.detectedSkipHint": "Don't change provider config",
59
+ "provider.detectedAdd": "➕ Add new providers",
60
+ "provider.detectedAddHint": "Configure additional providers",
61
+ // preset
62
+ "preset.select": "Choose a preset:",
63
+ "preset.full": "⚫ Full Power",
64
+ "preset.fullHint": "All features, extensions, and skills enabled",
65
+ "preset.clean": "✨ Clean",
66
+ "preset.cleanHint": "Minimal setup, just the essentials",
67
+ "preset.colony": "🐜 Colony",
68
+ "preset.colonyHint": "Ant swarm multi-agent system",
69
+ // theme
70
+ "theme.select": "Choose a theme:",
71
+ // keybindings
72
+ "kb.select": "Keybinding scheme:",
73
+ "kb.default": "⌨️ Default",
74
+ "kb.defaultHint": "Pi standard keybindings",
75
+ "kb.vim": "🟢 Vim",
76
+ "kb.vimHint": "Alt+hjkl navigation",
77
+ "kb.emacs": "🔵 Emacs",
78
+ "kb.emacsHint": "Ctrl+pnbf navigation",
79
+ // extensions
80
+ "ext.select": "Select extensions:",
81
+ // agents
82
+ "agent.select": "AGENTS.md template:",
83
+ "agent.general": "📋 General Developer",
84
+ "agent.generalHint": "Universal coding guidelines",
85
+ "agent.fullstack": "🏗️ Full-Stack Developer",
86
+ "agent.fullstackHint": "Frontend + Backend + DB",
87
+ "agent.security": "🔒 Security Researcher",
88
+ "agent.securityHint": "Pentesting & audit",
89
+ "agent.dataai": "🤖 Data & AI Engineer",
90
+ "agent.dataaiHint": "MLOps & pipelines",
91
+ "agent.colony": "🐜 Colony Operator",
92
+ "agent.colonyHint": "Ant swarm multi-agent",
93
+ // advanced
94
+ "advanced.configure": "Configure advanced settings? (compaction threshold, etc.)",
95
+ "advanced.compactThreshold": "Auto-compact when context reaches % of window (0-100):",
96
+ "advanced.compactValidation": "Must be a number between 10 and 100",
97
+ // confirm
98
+ "confirm.title": "Configuration",
99
+ "confirm.providers": "Providers:",
100
+ "confirm.model": "Model:",
101
+ "confirm.theme": "Theme:",
102
+ "confirm.keybindings": "Keybindings:",
103
+ "confirm.thinking": "Thinking:",
104
+ "confirm.compaction": "Compaction:",
105
+ "confirm.compactionValue": "{pct}% of context",
106
+ "confirm.extensions": "Extensions:",
107
+ "confirm.skills": "Skills:",
108
+ "confirm.prompts": "Prompts:",
109
+ "confirm.promptsValue": "{count} templates",
110
+ "confirm.agents": "AGENTS.md:",
111
+ "confirm.none": "none",
112
+ "confirm.skipped": "(kept existing)",
113
+ "confirm.changes": "⚠ Changes",
114
+ "confirm.existingDetected": "Existing config detected. How to proceed?",
115
+ "confirm.backup": "📦 Backup & apply",
116
+ "confirm.backupHint": "Safe — backup first, then overwrite",
117
+ "confirm.overwrite": "⚡ Overwrite",
118
+ "confirm.overwriteHint": "Replace without backup",
119
+ "confirm.cancel": "✖ Cancel",
120
+ "confirm.cancelHint": "Keep current config",
121
+ "confirm.noChanges": "No changes made.",
122
+ "confirm.backingUp": "Backing up ~/.pi/agent/",
123
+ "confirm.backedUp": "Backed up to {dir}",
124
+ "confirm.apply": "Apply configuration?",
125
+ "confirm.installingPi": "Installing pi-coding-agent",
126
+ "confirm.piInstalled": "pi installed",
127
+ "confirm.piFailed": "Failed: {error}",
128
+ "confirm.piManual": "Run manually: npm install -g @mariozechner/pi-coding-agent",
129
+ "confirm.writing": "Writing configuration",
130
+ "confirm.applied": "Configuration applied",
131
+ "confirm.installed": "✓ Installed",
132
+ "confirm.run": "Run {cmd} to start coding!",
133
+ // common
134
+ "cancelled": "Cancelled.",
135
+ "default": "default",
136
+ },
137
+ zh: {
138
+ "welcome.title": "oh-pi — pi agent 一键配置",
139
+ "welcome.piDetected": "检测到 pi {version}",
140
+ "welcome.piNotFound": "未找到 pi — 将自动安装",
141
+ "welcome.envInfo": "{terminal} │ {os} │ Node {node}",
142
+ "welcome.existingConfig": "发现已有配置",
143
+ "welcome.existingConfigDetail": "~/.pi/agent/ 下有 {count} 个文件 ({size}KB)",
144
+ "welcome.existingProviders": "检测到已有 Provider: {providers}",
145
+ "lang.select": "Language / 语言 / Langue:",
146
+ "mode.select": "选择配置方式:",
147
+ "mode.quick": "🚀 快速配置",
148
+ "mode.quickHint": "推荐默认值,3 步完成",
149
+ "mode.preset": "📦 预设方案",
150
+ "mode.presetHint": "选择预制配置",
151
+ "mode.custom": "🎛️ 自定义",
152
+ "mode.customHint": "逐项自选",
153
+ "provider.select": "选择 API 提供商",
154
+ "provider.custom": "🔧 自定义端点",
155
+ "provider.customHint": "Ollama、vLLM、LiteLLM 等 OpenAI 兼容接口",
156
+ "provider.foundEnv": "在环境变量中找到 {env},是否使用?",
157
+ "provider.customEndpoint": "为 {label} 设置自定义端点?(代理、Azure 等)",
158
+ "provider.baseUrl": "{label} 的 Base URL:",
159
+ "provider.useCustomUrl": "是否使用自定义端点?(代理、自托管等)",
160
+ "provider.baseUrlPlaceholder": "https://your-proxy.example.com",
161
+ "provider.baseUrlValidation": "必须是有效的 URL",
162
+ "provider.configured": "{label} 配置完成",
163
+ "provider.name": "提供商名称:",
164
+ "provider.namePlaceholder": "ollama",
165
+ "provider.nameRequired": "名称不能为空",
166
+ "provider.baseUrlCustom": "Base URL:",
167
+ "provider.baseUrlCustomPlaceholder": "http://localhost:11434",
168
+ "provider.needsKey": "需要 API 密钥?",
169
+ "provider.apiKey": "{label} 的 API 密钥:",
170
+ "provider.apiKeyRequired": "API 密钥不能为空",
171
+ "provider.fetchingModels": "正在从 {source} 获取模型列表",
172
+ "provider.foundModels": "找到 {count} 个模型",
173
+ "provider.noModels": "未通过 API 找到模型",
174
+ "provider.defaultModelList": "使用默认模型列表",
175
+ "provider.selectModel": "{label} 的默认模型:",
176
+ "provider.modelName": "{label} 的模型名称:",
177
+ "provider.modelNamePlaceholder": "llama3.1:8b",
178
+ "provider.modelNameRequired": "模型名称不能为空",
179
+ "provider.customConfigured": "{name} 配置完成 ({url})",
180
+ "provider.configureCaps": "配置模型能力?(上下文窗口、多模态、推理)",
181
+ "provider.contextWindow": "上下文窗口大小(tokens):",
182
+ "provider.contextWindowValidation": "必须是 ≥ 1024 的数字",
183
+ "provider.maxTokens": "最大输出 tokens:",
184
+ "provider.maxTokensValidation": "必须是 ≥ 256 的数字",
185
+ "provider.multimodal": "支持图片输入(多模态)?",
186
+ "provider.reasoning": "支持扩展思考(推理)?",
187
+ "provider.detected": "检测到已有 Provider: {list}",
188
+ "provider.detectedSkip": "⏭ 跳过 — 保留现有配置",
189
+ "provider.detectedSkipHint": "不修改 Provider 配置",
190
+ "provider.detectedAdd": "➕ 添加新 Provider",
191
+ "provider.detectedAddHint": "配置额外的 Provider",
192
+ "preset.select": "选择预设方案:",
193
+ "preset.full": "⚫ 全功能",
194
+ "preset.fullHint": "所有功能,包括蚁群系统",
195
+ "preset.clean": "🟢 简洁",
196
+ "preset.cleanHint": "核心功能,无蚁群",
197
+ "preset.colony": "🐜 蚁群",
198
+ "preset.colonyHint": "多 Agent 协同系统",
199
+ "theme.select": "选择主题:",
200
+ "kb.select": "快捷键方案:",
201
+ "kb.default": "⌨️ 默认",
202
+ "kb.defaultHint": "Pi 标准快捷键",
203
+ "kb.vim": "🟢 Vim",
204
+ "kb.vimHint": "Alt+hjkl 导航",
205
+ "kb.emacs": "🔵 Emacs",
206
+ "kb.emacsHint": "Ctrl+pnbf 导航",
207
+ "ext.select": "选择扩展:",
208
+ "agent.select": "AGENTS.md 模板:",
209
+ "agent.general": "📋 通用开发者",
210
+ "agent.generalHint": "通用编码指南",
211
+ "agent.fullstack": "🏗️ 全栈开发者",
212
+ "agent.fullstackHint": "前端 + 后端 + 数据库",
213
+ "agent.security": "🔒 安全研究员",
214
+ "agent.securityHint": "渗透测试与审计",
215
+ "agent.dataai": "🤖 数据与 AI 工程师",
216
+ "agent.dataaiHint": "MLOps 与数据管道",
217
+ "agent.colony": "🐜 蚁群指挥官",
218
+ "agent.colonyHint": "蚁群多 Agent 协同",
219
+ "advanced.configure": "配置高级选项?(压缩阈值等)",
220
+ "advanced.compactThreshold": "上下文达到窗口的百分之几时自动压缩 (10-100):",
221
+ "advanced.compactValidation": "必须是 10 到 100 之间的数字",
222
+ "confirm.title": "配置摘要",
223
+ "confirm.providers": "提供商:",
224
+ "confirm.model": "模型:",
225
+ "confirm.theme": "主题:",
226
+ "confirm.keybindings": "快捷键:",
227
+ "confirm.thinking": "思考:",
228
+ "confirm.compaction": "压缩:",
229
+ "confirm.compactionValue": "上下文的 {pct}%",
230
+ "confirm.extensions": "扩展:",
231
+ "confirm.skills": "技能:",
232
+ "confirm.prompts": "模板:",
233
+ "confirm.promptsValue": "{count} 个模板",
234
+ "confirm.agents": "AGENTS.md:",
235
+ "confirm.none": "无",
236
+ "confirm.skipped": "(保留现有)",
237
+ "confirm.changes": "⚠ 变更",
238
+ "confirm.existingDetected": "检测到已有配置,如何处理?",
239
+ "confirm.backup": "📦 备份后应用",
240
+ "confirm.backupHint": "安全 — 先备份再覆盖",
241
+ "confirm.overwrite": "⚡ 直接覆盖",
242
+ "confirm.overwriteHint": "不备份直接替换",
243
+ "confirm.cancel": "✖ 取消",
244
+ "confirm.cancelHint": "保留当前配置",
245
+ "confirm.noChanges": "未做任何更改。",
246
+ "confirm.backingUp": "正在备份 ~/.pi/agent/",
247
+ "confirm.backedUp": "已备份到 {dir}",
248
+ "confirm.apply": "应用配置?",
249
+ "confirm.installingPi": "正在安装 pi-coding-agent",
250
+ "confirm.piInstalled": "pi 安装完成",
251
+ "confirm.piFailed": "失败:{error}",
252
+ "confirm.piManual": "请手动运行:npm install -g @mariozechner/pi-coding-agent",
253
+ "confirm.writing": "正在写入配置",
254
+ "confirm.applied": "配置已应用",
255
+ "confirm.installed": "✓ 已安装",
256
+ "confirm.run": "运行 {cmd} 开始编码!",
257
+ "cancelled": "已取消。",
258
+ "default": "默认",
259
+ },
260
+ fr: {
261
+ "welcome.title": "oh-pi — configuration en un clic pour pi agent",
262
+ "welcome.piDetected": "pi {version} détecté",
263
+ "welcome.piNotFound": "pi non trouvé — installation en cours",
264
+ "welcome.envInfo": "{terminal} │ {os} │ Node {node}",
265
+ "welcome.existingConfig": "Configuration existante trouvée",
266
+ "welcome.existingConfigDetail": "{count} fichiers ({size}Ko) dans ~/.pi/agent/",
267
+ "welcome.existingProviders": "Fournisseurs détectés : {providers}",
268
+ "lang.select": "Language / 语言 / Langue :",
269
+ "mode.select": "Comment souhaitez-vous configurer pi ?",
270
+ "mode.quick": "🚀 Configuration rapide",
271
+ "mode.quickHint": "Valeurs par défaut recommandées, 3 étapes",
272
+ "mode.preset": "📦 Préréglage",
273
+ "mode.presetHint": "Choisir une configuration prédéfinie",
274
+ "mode.custom": "🎛️ Personnalisé",
275
+ "mode.customHint": "Tout choisir soi-même",
276
+ "provider.select": "Sélectionner les fournisseurs API",
277
+ "provider.custom": "🔧 Point d'accès personnalisé",
278
+ "provider.customHint": "Ollama, vLLM, LiteLLM, tout compatible OpenAI",
279
+ "provider.foundEnv": "{env} trouvé dans l'environnement. L'utiliser ?",
280
+ "provider.customEndpoint": "Point d'accès personnalisé pour {label} ? (proxy, Azure, etc.)",
281
+ "provider.baseUrl": "URL de base pour {label} :",
282
+ "provider.useCustomUrl": "Utiliser un endpoint personnalisé pour {label} ? (proxy, auto-hébergé, etc.)",
283
+ "provider.baseUrlPlaceholder": "https://your-proxy.example.com",
284
+ "provider.baseUrlValidation": "Doit être une URL valide",
285
+ "provider.configured": "{label} configuré",
286
+ "provider.name": "Nom du fournisseur :",
287
+ "provider.namePlaceholder": "ollama",
288
+ "provider.nameRequired": "Nom requis",
289
+ "provider.baseUrlCustom": "URL de base :",
290
+ "provider.baseUrlCustomPlaceholder": "http://localhost:11434",
291
+ "provider.needsKey": "Nécessite une clé API ?",
292
+ "provider.apiKey": "Clé API pour {label} :",
293
+ "provider.apiKeyRequired": "La clé API ne peut pas être vide",
294
+ "provider.fetchingModels": "Récupération des modèles depuis {source}",
295
+ "provider.foundModels": "{count} modèles trouvés",
296
+ "provider.noModels": "Aucun modèle trouvé via l'API",
297
+ "provider.defaultModelList": "Utilisation de la liste de modèles par défaut",
298
+ "provider.selectModel": "Modèle par défaut pour {label} :",
299
+ "provider.modelName": "Nom du modèle pour {label} :",
300
+ "provider.modelNamePlaceholder": "llama3.1:8b",
301
+ "provider.modelNameRequired": "Nom du modèle requis",
302
+ "provider.customConfigured": "{name} configuré ({url})",
303
+ "provider.configureCaps": "Configurer les capacités du modèle ? (fenêtre de contexte, multimodal, raisonnement)",
304
+ "provider.contextWindow": "Taille de la fenêtre de contexte (tokens) :",
305
+ "provider.contextWindowValidation": "Doit être un nombre ≥ 1024",
306
+ "provider.maxTokens": "Tokens de sortie maximum :",
307
+ "provider.maxTokensValidation": "Doit être un nombre ≥ 256",
308
+ "provider.multimodal": "Prend en charge l'entrée d'images (multimodal) ?",
309
+ "provider.reasoning": "Prend en charge la réflexion étendue (raisonnement) ?",
310
+ "provider.detected": "Fournisseurs existants détectés : {list}",
311
+ "provider.detectedSkip": "⏭ Passer — garder l'existant",
312
+ "provider.detectedSkipHint": "Ne pas modifier la config des fournisseurs",
313
+ "provider.detectedAdd": "➕ Ajouter de nouveaux fournisseurs",
314
+ "provider.detectedAddHint": "Configurer des fournisseurs supplémentaires",
315
+ "preset.select": "Choisir un préréglage :",
316
+ "preset.full": "⚫ Complet",
317
+ "preset.fullHint": "Toutes les extensions et compétences",
318
+ "preset.clean": "🟢 Propre",
319
+ "preset.cleanHint": "Configuration minimale, aucune extension",
320
+ "preset.colony": "🐜 Colonie",
321
+ "preset.colonyHint": "Mode essaim multi-agent de fourmis",
322
+ "theme.select": "Choisir un thème :",
323
+ "kb.select": "Schéma de raccourcis :",
324
+ "kb.default": "⌨️ Par défaut",
325
+ "kb.defaultHint": "Raccourcis standard Pi",
326
+ "kb.vim": "🟢 Vim",
327
+ "kb.vimHint": "Navigation Alt+hjkl",
328
+ "kb.emacs": "🔵 Emacs",
329
+ "kb.emacsHint": "Navigation Ctrl+pnbf",
330
+ "ext.select": "Sélectionner les extensions :",
331
+ "agent.select": "Modèle AGENTS.md :",
332
+ "agent.general": "📋 Développeur général",
333
+ "agent.generalHint": "Directives de codage universelles",
334
+ "agent.fullstack": "🏗️ Développeur Full-Stack",
335
+ "agent.fullstackHint": "Frontend + Backend + BDD",
336
+ "agent.security": "🔒 Chercheur en sécurité",
337
+ "agent.securityHint": "Pentest & audit",
338
+ "agent.dataai": "🤖 Ingénieur Data & IA",
339
+ "agent.dataaiHint": "MLOps & pipelines",
340
+ "agent.colony": "🐜 Opérateur de colonie",
341
+ "agent.colonyHint": "Essaim multi-agent",
342
+ "advanced.configure": "Configurer les paramètres avancés ? (seuil de compaction, etc.)",
343
+ "advanced.compactThreshold": "Compacter automatiquement quand le contexte atteint % de la fenêtre (10-100) :",
344
+ "advanced.compactValidation": "Doit être un nombre entre 10 et 100",
345
+ "confirm.title": "Configuration",
346
+ "confirm.providers": "Fournisseurs :",
347
+ "confirm.model": "Modèle :",
348
+ "confirm.theme": "Thème :",
349
+ "confirm.keybindings": "Raccourcis :",
350
+ "confirm.thinking": "Réflexion :",
351
+ "confirm.compaction": "Compaction :",
352
+ "confirm.compactionValue": "{pct}% du contexte",
353
+ "confirm.extensions": "Extensions :",
354
+ "confirm.skills": "Compétences :",
355
+ "confirm.prompts": "Modèles :",
356
+ "confirm.promptsValue": "{count} modèles",
357
+ "confirm.agents": "AGENTS.md :",
358
+ "confirm.none": "aucun",
359
+ "confirm.skipped": "(existant conservé)",
360
+ "confirm.changes": "⚠ Modifications",
361
+ "confirm.existingDetected": "Configuration existante détectée. Comment procéder ?",
362
+ "confirm.backup": "📦 Sauvegarder & appliquer",
363
+ "confirm.backupHint": "Sûr — sauvegarde d'abord, puis écrasement",
364
+ "confirm.overwrite": "⚡ Écraser",
365
+ "confirm.overwriteHint": "Remplacer sans sauvegarde",
366
+ "confirm.cancel": "✖ Annuler",
367
+ "confirm.cancelHint": "Garder la configuration actuelle",
368
+ "confirm.noChanges": "Aucune modification effectuée.",
369
+ "confirm.backingUp": "Sauvegarde de ~/.pi/agent/",
370
+ "confirm.backedUp": "Sauvegardé dans {dir}",
371
+ "confirm.apply": "Appliquer la configuration ?",
372
+ "confirm.installingPi": "Installation de pi-coding-agent",
373
+ "confirm.piInstalled": "pi installé",
374
+ "confirm.piFailed": "Échec : {error}",
375
+ "confirm.piManual": "Exécutez manuellement : npm install -g @mariozechner/pi-coding-agent",
376
+ "confirm.writing": "Écriture de la configuration",
377
+ "confirm.applied": "Configuration appliquée",
378
+ "confirm.installed": "✓ Installé",
379
+ "confirm.run": "Exécutez {cmd} pour commencer à coder !",
380
+ "cancelled": "Annulé.",
381
+ "default": "par défaut",
382
+ },
383
+ };
@@ -0,0 +1,23 @@
1
+ import type { ModelCapabilities } from "./types.js";
2
+ /** 各模型能力参数映射表 */
3
+ export declare const MODEL_CAPABILITIES: Record<string, ModelCapabilities>;
4
+ /** 支持的提供商注册表(名称、环境变量、可用模型) */
5
+ export declare const PROVIDERS: Record<string, {
6
+ env: string;
7
+ label: string;
8
+ models: string[];
9
+ }>;
10
+ /** 可用主题列表 */
11
+ export declare const THEMES: {
12
+ name: string;
13
+ label: string;
14
+ style: string;
15
+ }[];
16
+ /** 可用扩展列表 */
17
+ export declare const EXTENSIONS: {
18
+ name: string;
19
+ label: string;
20
+ default: boolean;
21
+ }[];
22
+ /** 快捷键绑定方案(default / vim / emacs) */
23
+ export declare const KEYBINDING_SCHEMES: Record<string, object>;
@@ -0,0 +1,71 @@
1
+ /** 各模型能力参数映射表 */
2
+ export const MODEL_CAPABILITIES = {
3
+ // Anthropic
4
+ "claude-sonnet-4-20250514": { contextWindow: 200000, maxTokens: 16384, reasoning: true, input: ["text", "image"] },
5
+ "claude-opus-4-0520": { contextWindow: 200000, maxTokens: 16384, reasoning: true, input: ["text", "image"] },
6
+ // OpenAI
7
+ "gpt-4o": { contextWindow: 128000, maxTokens: 16384, reasoning: false, input: ["text", "image"] },
8
+ "o3-mini": { contextWindow: 128000, maxTokens: 65536, reasoning: true, input: ["text"] },
9
+ // Google
10
+ "gemini-2.5-pro": { contextWindow: 1048576, maxTokens: 65536, reasoning: true, input: ["text", "image"] },
11
+ "gemini-2.5-flash": { contextWindow: 1048576, maxTokens: 65536, reasoning: true, input: ["text", "image"] },
12
+ // Groq
13
+ "llama-3.3-70b-versatile": { contextWindow: 128000, maxTokens: 32768, reasoning: false, input: ["text"] },
14
+ // OpenRouter
15
+ "anthropic/claude-sonnet-4": { contextWindow: 200000, maxTokens: 16384, reasoning: true, input: ["text", "image"] },
16
+ "openai/gpt-4o": { contextWindow: 128000, maxTokens: 16384, reasoning: false, input: ["text", "image"] },
17
+ // xAI
18
+ "grok-3": { contextWindow: 131072, maxTokens: 16384, reasoning: false, input: ["text", "image"] },
19
+ // Mistral
20
+ "mistral-large-latest": { contextWindow: 128000, maxTokens: 8192, reasoning: false, input: ["text"] },
21
+ };
22
+ /** 支持的提供商注册表(名称、环境变量、可用模型) */
23
+ export const PROVIDERS = {
24
+ anthropic: { env: "ANTHROPIC_API_KEY", label: "Anthropic (Claude)", models: ["claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "claude-opus-4-20250514", "claude-haiku-4-5-20251001"] },
25
+ openai: { env: "OPENAI_API_KEY", label: "OpenAI (GPT)", models: ["gpt-4o", "o3-mini"] },
26
+ google: { env: "GEMINI_API_KEY", label: "Google Gemini", models: ["gemini-2.5-pro", "gemini-2.5-flash"] },
27
+ groq: { env: "GROQ_API_KEY", label: "Groq (Free, Fast)", models: ["llama-3.3-70b-versatile"] },
28
+ openrouter: { env: "OPENROUTER_API_KEY", label: "OpenRouter (Multi)", models: ["anthropic/claude-sonnet-4", "openai/gpt-4o"] },
29
+ xai: { env: "XAI_API_KEY", label: "xAI (Grok)", models: ["grok-3"] },
30
+ mistral: { env: "MISTRAL_API_KEY", label: "Mistral", models: ["mistral-large-latest"] },
31
+ };
32
+ /** 可用主题列表 */
33
+ export const THEMES = [
34
+ { name: "dark", label: "Pi Default Dark", style: "dark" },
35
+ { name: "oh-p-dark", label: "oh-pi Dark (Cyan+Purple)", style: "dark" },
36
+ { name: "cyberpunk", label: "Cyberpunk (Neon)", style: "dark" },
37
+ { name: "nord", label: "Nord (Arctic)", style: "dark" },
38
+ { name: "catppuccin-mocha", label: "Catppuccin Mocha (Pastel)", style: "dark" },
39
+ { name: "tokyo-night", label: "Tokyo Night (Blue+Purple)", style: "dark" },
40
+ { name: "gruvbox-dark", label: "Gruvbox Dark (Warm)", style: "dark" },
41
+ { name: "light", label: "Pi Default Light", style: "light" },
42
+ ];
43
+ /** 可用扩展列表 */
44
+ export const EXTENSIONS = [
45
+ { name: "safe-guard", label: "🛡️ Safe Guard — Dangerous command confirm + path protection", default: true },
46
+ { name: "git-guard", label: "📦 Git Guard — Auto stash checkpoint + dirty repo warning + notify", default: true },
47
+ { name: "auto-session-name", label: "📝 Auto Session Name — Name sessions from first message", default: true },
48
+ { name: "custom-footer", label: "📊 Custom Footer — Enhanced status bar with tokens, cost, time, git, cwd", default: true },
49
+ { name: "compact-header", label: "⚡ Compact Header — Dense startup info replacing verbose output", default: true },
50
+ { name: "ant-colony", label: "🐜 Ant Colony — Autonomous multi-agent swarm with adaptive concurrency", default: false },
51
+ { name: "auto-update", label: "🔄 Auto Update — Check for oh-pi updates on startup and notify", default: true },
52
+ { name: "smart-compact", label: "🗜️ Smart Compact — Trim large tool outputs and old messages in-flight", default: true },
53
+ { name: "bg-process", label: "⏳ Bg Process — Auto-background long-running commands (dev servers, etc.)", default: false },
54
+ ];
55
+ /** 快捷键绑定方案(default / vim / emacs) */
56
+ export const KEYBINDING_SCHEMES = {
57
+ default: {},
58
+ vim: {
59
+ cursorUp: ["up", "alt+k"], cursorDown: ["down", "alt+j"],
60
+ cursorLeft: ["left", "alt+h"], cursorRight: ["right", "alt+l"],
61
+ cursorWordLeft: ["alt+left", "alt+b"], cursorWordRight: ["alt+right", "alt+w"],
62
+ },
63
+ emacs: {
64
+ cursorUp: ["up", "ctrl+p"], cursorDown: ["down", "ctrl+n"],
65
+ cursorLeft: ["left", "ctrl+b"], cursorRight: ["right", "ctrl+f"],
66
+ cursorWordLeft: ["alt+left", "alt+b"], cursorWordRight: ["alt+right", "alt+f"],
67
+ deleteCharForward: ["delete", "ctrl+d"], deleteCharBackward: ["backspace", "ctrl+h"],
68
+ cursorLineStart: ["home", "ctrl+a"], cursorLineEnd: ["end", "ctrl+e"],
69
+ newLine: ["shift+enter", "ctrl+j"],
70
+ },
71
+ };
@@ -1,6 +1,6 @@
1
1
  import * as p from "@clack/prompts";
2
2
  import { t } from "../i18n.js";
3
- import { EXTENSIONS } from "../types.js";
3
+ import { EXTENSIONS } from "../registry.js";
4
4
  /**
5
5
  * Prompts the user to select enabled extensions from the available list via a multi-select TUI prompt.
6
6
  * Exits the process if the user cancels the selection.
@@ -1,4 +1,4 @@
1
- import { type ProviderConfig } from "../types.js";
1
+ import type { ProviderConfig } from "../types.js";
2
2
  import type { EnvInfo } from "../utils/detect.js";
3
3
  /**
4
4
  * Interactively configure API providers, detecting existing keys, allowing multi-select, and supporting custom endpoints.
@@ -1,7 +1,7 @@
1
1
  import * as p from "@clack/prompts";
2
2
  import chalk from "chalk";
3
3
  import { t } from "../i18n.js";
4
- import { PROVIDERS } from "../types.js";
4
+ import { PROVIDERS } from "../registry.js";
5
5
  /** Provider API base URLs for dynamic model fetching */
6
6
  const PROVIDER_API_URLS = {
7
7
  anthropic: "https://api.anthropic.com",
@@ -1,6 +1,6 @@
1
1
  import * as p from "@clack/prompts";
2
2
  import { t } from "../i18n.js";
3
- import { THEMES } from "../types.js";
3
+ import { THEMES } from "../registry.js";
4
4
  /**
5
5
  * Prompts the user to select a theme from the available themes list.
6
6
  * Exits the process if the user cancels the selection.
package/dist/types.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /** 支持的语言区域 */
2
+ export type Locale = "en" | "zh" | "fr";
1
3
  /** 动态发现的模型信息 */
2
4
  export interface DiscoveredModel {
3
5
  id: string;
@@ -61,25 +63,3 @@ export interface ModelCapabilities {
61
63
  /** 支持的输入类型 */
62
64
  input: ("text" | "image")[];
63
65
  }
64
- /** 各模型能力参数映射表 */
65
- export declare const MODEL_CAPABILITIES: Record<string, ModelCapabilities>;
66
- /** 支持的提供商注册表(名称、环境变量、可用模型) */
67
- export declare const PROVIDERS: Record<string, {
68
- env: string;
69
- label: string;
70
- models: string[];
71
- }>;
72
- /** 可用主题列表 */
73
- export declare const THEMES: {
74
- name: string;
75
- label: string;
76
- style: string;
77
- }[];
78
- /** 可用扩展列表 */
79
- export declare const EXTENSIONS: {
80
- name: string;
81
- label: string;
82
- default: boolean;
83
- }[];
84
- /** 快捷键绑定方案(default / vim / emacs) */
85
- export declare const KEYBINDING_SCHEMES: Record<string, object>;
package/dist/types.js CHANGED
@@ -1,70 +1 @@
1
- /** 各模型能力参数映射表 */
2
- export const MODEL_CAPABILITIES = {
3
- // Anthropic
4
- "claude-sonnet-4-20250514": { contextWindow: 200000, maxTokens: 16384, reasoning: true, input: ["text", "image"] },
5
- "claude-opus-4-0520": { contextWindow: 200000, maxTokens: 16384, reasoning: true, input: ["text", "image"] },
6
- // OpenAI
7
- "gpt-4o": { contextWindow: 128000, maxTokens: 16384, reasoning: false, input: ["text", "image"] },
8
- "o3-mini": { contextWindow: 128000, maxTokens: 65536, reasoning: true, input: ["text"] },
9
- // Google
10
- "gemini-2.5-pro": { contextWindow: 1048576, maxTokens: 65536, reasoning: true, input: ["text", "image"] },
11
- "gemini-2.5-flash": { contextWindow: 1048576, maxTokens: 65536, reasoning: true, input: ["text", "image"] },
12
- // Groq
13
- "llama-3.3-70b-versatile": { contextWindow: 128000, maxTokens: 32768, reasoning: false, input: ["text"] },
14
- // OpenRouter
15
- "anthropic/claude-sonnet-4": { contextWindow: 200000, maxTokens: 16384, reasoning: true, input: ["text", "image"] },
16
- "openai/gpt-4o": { contextWindow: 128000, maxTokens: 16384, reasoning: false, input: ["text", "image"] },
17
- // xAI
18
- "grok-3": { contextWindow: 131072, maxTokens: 16384, reasoning: false, input: ["text", "image"] },
19
- // Mistral
20
- "mistral-large-latest": { contextWindow: 128000, maxTokens: 8192, reasoning: false, input: ["text"] },
21
- };
22
- /** 支持的提供商注册表(名称、环境变量、可用模型) */
23
- export const PROVIDERS = {
24
- anthropic: { env: "ANTHROPIC_API_KEY", label: "Anthropic (Claude)", models: ["claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "claude-opus-4-20250514", "claude-haiku-4-5-20251001"] },
25
- openai: { env: "OPENAI_API_KEY", label: "OpenAI (GPT)", models: ["gpt-4o", "o3-mini"] },
26
- google: { env: "GEMINI_API_KEY", label: "Google Gemini", models: ["gemini-2.5-pro", "gemini-2.5-flash"] },
27
- groq: { env: "GROQ_API_KEY", label: "Groq (Free, Fast)", models: ["llama-3.3-70b-versatile"] },
28
- openrouter: { env: "OPENROUTER_API_KEY", label: "OpenRouter (Multi)", models: ["anthropic/claude-sonnet-4", "openai/gpt-4o"] },
29
- xai: { env: "XAI_API_KEY", label: "xAI (Grok)", models: ["grok-3"] },
30
- mistral: { env: "MISTRAL_API_KEY", label: "Mistral", models: ["mistral-large-latest"] },
31
- };
32
- /** 可用主题列表 */
33
- export const THEMES = [
34
- { name: "dark", label: "Pi Default Dark", style: "dark" },
35
- { name: "oh-p-dark", label: "oh-pi Dark (Cyan+Purple)", style: "dark" },
36
- { name: "cyberpunk", label: "Cyberpunk (Neon)", style: "dark" },
37
- { name: "nord", label: "Nord (Arctic)", style: "dark" },
38
- { name: "catppuccin-mocha", label: "Catppuccin Mocha (Pastel)", style: "dark" },
39
- { name: "tokyo-night", label: "Tokyo Night (Blue+Purple)", style: "dark" },
40
- { name: "gruvbox-dark", label: "Gruvbox Dark (Warm)", style: "dark" },
41
- { name: "light", label: "Pi Default Light", style: "light" },
42
- ];
43
- /** 可用扩展列表 */
44
- export const EXTENSIONS = [
45
- { name: "safe-guard", label: "🛡️ Safe Guard — Dangerous command confirm + path protection", default: true },
46
- { name: "git-guard", label: "📦 Git Guard — Auto stash checkpoint + dirty repo warning + notify", default: true },
47
- { name: "auto-session-name", label: "📝 Auto Session Name — Name sessions from first message", default: true },
48
- { name: "custom-footer", label: "📊 Custom Footer — Enhanced status bar with tokens, cost, time, git, cwd", default: true },
49
- { name: "compact-header", label: "⚡ Compact Header — Dense startup info replacing verbose output", default: true },
50
- { name: "ant-colony", label: "🐜 Ant Colony — Autonomous multi-agent swarm with adaptive concurrency", default: false },
51
- { name: "auto-update", label: "🔄 Auto Update — Check for oh-pi updates on startup and notify", default: true },
52
- { name: "bg-process", label: "⏳ Bg Process — Auto-background long-running commands (dev servers, etc.)", default: false },
53
- ];
54
- /** 快捷键绑定方案(default / vim / emacs) */
55
- export const KEYBINDING_SCHEMES = {
56
- default: {},
57
- vim: {
58
- cursorUp: ["up", "alt+k"], cursorDown: ["down", "alt+j"],
59
- cursorLeft: ["left", "alt+h"], cursorRight: ["right", "alt+l"],
60
- cursorWordLeft: ["alt+left", "alt+b"], cursorWordRight: ["alt+right", "alt+w"],
61
- },
62
- emacs: {
63
- cursorUp: ["up", "ctrl+p"], cursorDown: ["down", "ctrl+n"],
64
- cursorLeft: ["left", "ctrl+b"], cursorRight: ["right", "ctrl+f"],
65
- cursorWordLeft: ["alt+left", "alt+b"], cursorWordRight: ["alt+right", "alt+f"],
66
- deleteCharForward: ["delete", "ctrl+d"], deleteCharBackward: ["backspace", "ctrl+h"],
67
- cursorLineStart: ["home", "ctrl+a"], cursorLineEnd: ["end", "ctrl+e"],
68
- newLine: ["shift+enter", "ctrl+j"],
69
- },
70
- };
1
+ export {};
@@ -1,7 +1,14 @@
1
1
  import type { OhPConfig } from "../types.js";
2
+ /**
3
+ * 确保目录存在,若不存在则递归创建
4
+ */
5
+ export declare function ensureDir(dir: string): void;
6
+ /**
7
+ * 增量同步目录:只复制有变化的文件,删除源中不存在的文件
8
+ */
9
+ export declare function syncDir(src: string, dest: string): void;
2
10
  /**
3
11
  * 应用 OhP 配置,生成并写入 ~/.pi/agent/ 下的所有配置文件
4
- * @param config - OhP 配置对象
5
12
  */
6
13
  export declare function applyConfig(config: OhPConfig): void;
7
14
  /**