@koinzhang/paseo-plugin-customize 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.
Files changed (60) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/README.md +58 -0
  4. package/client/category-visibility.test.ts +26 -0
  5. package/client/design-tokens.test.ts +39 -0
  6. package/client/design-tokens.ts +104 -0
  7. package/client/dropdown.tsx +139 -0
  8. package/client/entries.test.ts +50 -0
  9. package/client/entries.ts +47 -0
  10. package/client/entry-row.tsx +89 -0
  11. package/client/mechanism-card.tsx +75 -0
  12. package/client/preview-pane.tsx +101 -0
  13. package/client/provider-options.test.ts +31 -0
  14. package/client/provider-options.ts +37 -0
  15. package/client/query-policy.test.ts +57 -0
  16. package/client/query-policy.ts +20 -0
  17. package/client/route.ts +29 -0
  18. package/client/selection-settings.test.ts +16 -0
  19. package/client/slash-command.test.ts +94 -0
  20. package/client/slash-command.ts +36 -0
  21. package/client/surface.tsx +332 -0
  22. package/client/ui.tsx +265 -0
  23. package/client/use-app-language.ts +28 -0
  24. package/client/web.ts +111 -0
  25. package/index.client.tsx +57 -0
  26. package/index.server.ts +13 -0
  27. package/package.json +37 -0
  28. package/paseo-plugin.json +6 -0
  29. package/server/agent-plugins.ts +41 -0
  30. package/server/compatibility.test.ts +104 -0
  31. package/server/compatibility.ts +46 -0
  32. package/server/frontmatter.ts +49 -0
  33. package/server/glob.ts +46 -0
  34. package/server/handlers.ts +193 -0
  35. package/server/jsonc.ts +40 -0
  36. package/server/mcp.ts +87 -0
  37. package/server/parsers.test.ts +92 -0
  38. package/server/providers/acp.ts +186 -0
  39. package/server/providers/claude.ts +284 -0
  40. package/server/providers/codex.ts +219 -0
  41. package/server/providers/copilot.ts +116 -0
  42. package/server/providers/cursor.ts +194 -0
  43. package/server/providers/omp.ts +263 -0
  44. package/server/providers/opencode.ts +215 -0
  45. package/server/providers/pi.ts +102 -0
  46. package/server/providers.test.ts +306 -0
  47. package/server/scan-kit.ts +368 -0
  48. package/server/scan-snapshot.test.ts +56 -0
  49. package/server/scan-snapshot.ts +58 -0
  50. package/server/skill-aliases.ts +60 -0
  51. package/server/toml.ts +240 -0
  52. package/server/yaml-lite.ts +172 -0
  53. package/shared/acp-configs.ts +107 -0
  54. package/shared/category-visibility.ts +26 -0
  55. package/shared/compatibility.ts +6 -0
  56. package/shared/contracts.ts +116 -0
  57. package/shared/i18n.ts +293 -0
  58. package/shared/mechanisms.ts +380 -0
  59. package/shared/providers.ts +27 -0
  60. package/shared/selection-settings.ts +14 -0
@@ -0,0 +1,380 @@
1
+ import { ACP_CONFIGS, type AcpConfig, type AcpProviderId } from "./acp-configs.ts";
2
+ import { CATEGORIES, type Category, type Compatibility, type Scope } from "./contracts.ts";
3
+ import { PROVIDER_IDS, type ProviderId } from "./providers.ts";
4
+
5
+ /** Bilingual static copy; the client picks by app language. */
6
+ export type Localized = { en: string; zh: string };
7
+
8
+ export interface Mechanism {
9
+ supported: boolean;
10
+ locations: ReadonlyArray<{ scope: Scope | "managed"; path: string }>;
11
+ /** Discovery facts: recursion, precedence, and how auto-discovery is turned off. */
12
+ notes: readonly Localized[];
13
+ }
14
+
15
+ const L = (en: string, zh: string): Localized => ({ en, zh });
16
+
17
+ const UNSUPPORTED = (en: string, zh: string): Mechanism => ({ supported: false, locations: [], notes: [L(en, zh)] });
18
+
19
+ const UNVERIFIED = UNSUPPORTED("No verified disk discovery location yet.", "尚未核实可扫描的磁盘配置位置。");
20
+
21
+ const ACP_NOTES: Partial<Record<AcpProviderId, Partial<Record<Category, Localized>>>> = {
22
+ cline: {
23
+ mcp: L("CLI and extension documentation disagree on the user MCP path; both documented candidates are scanned.", "CLI 与扩展文档对用户 MCP 路径有分歧;扫描两个已记录的候选路径。"),
24
+ commands: L("Plugins can register commands, but no standalone command file directory was verified.", "插件可注册命令,但未核实独立命令文件目录。"),
25
+ },
26
+ "codebuddy-code": { plugins: L("Marketplace plugins are copied into a versioned cache; settings decide whether each is enabled.", "市场插件复制到带版本的缓存;是否启用由 settings 决定。") },
27
+ gemini: {
28
+ instructions: L("AGENTS.md loads only when context.fileName in settings.json includes it.", "只有 settings.json 的 context.fileName 包含 AGENTS.md 时才加载。"),
29
+ rules: L("No separate rules directory is documented; use context files.", "官方未记录独立 rules 目录;使用上下文文件。"),
30
+ plugins: L("Scans installed extensions and a root Agent Plugins manifest in the current project. The badge validates manifest fields only, not activation or bundled components.", "扫描已安装扩展及当前项目根目录的 Agent Plugins 清单。标识只校验清单字段,不代表已启用或组件全部有效。"),
31
+ },
32
+ goose: { mcp: L("MCP servers are stdio or HTTP extensions in config.yaml.", "MCP Server 是 config.yaml 中的 stdio 或 HTTP extension。"), commands: L("Custom slash commands map to recipes through config.yaml slash_commands.", "自定义斜杠命令通过 config.yaml 的 slash_commands 映射到 recipe。") },
33
+ grok: { plugins: L("grok inspect reports runtime plugin discovery; disk entries alone do not prove activation.", "grok inspect 可查看运行时插件发现结果;磁盘条目不能证明已启用。") },
34
+ kilo: { plugins: L("Marketplace components exist, but no reliable local plugin manifest location was verified.", "支持 Marketplace 组件,但尚未核实可靠的本地插件清单位置。") },
35
+ kiro: { rules: L("Steering files are rules; custom agents may need explicit resources to load them.", "Steering 文件是规则;自定义 agent 可能要在 resources 中显式引用。"), plugins: L("Powers are Kiro extension packages, not generic plugin manifests.", "Powers 是 Kiro 扩展包,并非通用插件 manifest。") },
36
+ kimi: { commands: L("Plugin manifests declare command directories; only those files are listed.", "插件 manifest 声明命令目录;只列出这些目录里的文件。") },
37
+ "qwen-code": { plugins: L("Extensions can package skills, commands, agents, and MCP servers.", "Extension 可打包 skills、commands、agents 与 MCP Server。") },
38
+ traecli: { plugins: L("The CLI supports plugins, but its local install directory was not verified.", "CLI 支持插件,但尚未核实本地安装目录。") },
39
+ };
40
+
41
+ /** Sources: specs/001-customize-board/research.md and specs/003-acp-configurations/research.md. */
42
+ const BASE_MECHANISMS: Partial<Record<ProviderId, Partial<Record<Category, Mechanism>>>> = {
43
+ claude: {
44
+ instructions: {
45
+ supported: true,
46
+ locations: [
47
+ { scope: "managed", path: "/Library/Application Support/ClaudeCode/CLAUDE.md" },
48
+ { scope: "user", path: "~/.claude/CLAUDE.md" },
49
+ { scope: "project", path: "CLAUDE.md · .claude/CLAUDE.md · CLAUDE.local.md (cwd + parents)" },
50
+ { scope: "project", path: "AGENTS.md" },
51
+ ],
52
+ notes: [
53
+ L("Files in the working directory and every parent load at launch; subdirectory CLAUDE.md files load on demand.", "工作目录及所有上级目录的文件启动时加载;子目录里的 CLAUDE.md 在读取该目录文件时按需加载。"),
54
+ L("AGENTS.md is read only when no CLAUDE.md / CLAUDE.local.md exists in the working directory or above.", "只有 cwd 及以上都没有 CLAUDE.md / CLAUDE.local.md 时才读取 AGENTS.md。"),
55
+ L("Skip files with `claudeMdExcludes` (glob) in settings.", "settings 中的 `claudeMdExcludes`(glob)可排除文件。"),
56
+ ],
57
+ },
58
+ rules: {
59
+ supported: true,
60
+ locations: [
61
+ { scope: "user", path: "~/.claude/rules/**/*.md" },
62
+ { scope: "project", path: ".claude/rules/**/*.md" },
63
+ ],
64
+ notes: [
65
+ L("Recursive: every .md under rules/ (subfolders included).", "递归:rules/ 下所有 .md(含子目录)。"),
66
+ L("`paths:` frontmatter loads a rule only for matching files; otherwise it always loads.", "frontmatter `paths:` 只在匹配文件时加载,否则每次都加载。"),
67
+ ],
68
+ },
69
+ skills: {
70
+ supported: true,
71
+ locations: [
72
+ { scope: "user", path: "~/.claude/skills/<name>/SKILL.md" },
73
+ { scope: "project", path: ".claude/skills/<name>/SKILL.md (cwd → repo root)" },
74
+ { scope: "project", path: "<subdir>/.claude/skills (on demand)" },
75
+ { scope: "project", path: ".claude/commands/*.md" },
76
+ ],
77
+ notes: [
78
+ L("One level per skills root (no recursion into category folders); symlinked skill folders are followed.", "每个 skills 根只扫一层(不递归分类目录);跟随符号链接。"),
79
+ L("`disable-model-invocation: true` → manual only; `user-invocable: false` hides it from the / menu.", "`disable-model-invocation: true` → 仅手动;`user-invocable: false` → 不出现在 / 菜单。"),
80
+ L("`skillOverrides` in settings: off / user-invocable-only / name-only.", "settings 的 `skillOverrides`:off / user-invocable-only / name-only。"),
81
+ ],
82
+ },
83
+ mcp: {
84
+ supported: true,
85
+ locations: [
86
+ { scope: "user", path: "~/.claude.json → mcpServers" },
87
+ { scope: "project", path: "~/.claude.json → projects[<path>].mcpServers (local)" },
88
+ { scope: "project", path: ".mcp.json" },
89
+ { scope: "managed", path: "managed-mcp.json" },
90
+ ],
91
+ notes: [
92
+ L("Project .mcp.json servers need approval: enableAllProjectMcpServers / enabledMcpjsonServers; disabledMcpjsonServers rejects.", "项目 .mcp.json 需批准:enableAllProjectMcpServers / enabledMcpjsonServers;disabledMcpjsonServers 拒绝。"),
93
+ L("`/mcp` toggles are stored per project in ~/.claude.json disabledMcpServers.", "`/mcp` 开关按项目存在 ~/.claude.json 的 disabledMcpServers。"),
94
+ ],
95
+ },
96
+ },
97
+ codex: {
98
+ instructions: {
99
+ supported: true,
100
+ locations: [
101
+ { scope: "user", path: "$CODEX_HOME/AGENTS.override.md | AGENTS.md" },
102
+ { scope: "project", path: "AGENTS.override.md | AGENTS.md | fallbacks (git root → cwd)" },
103
+ ],
104
+ notes: [
105
+ L("At most one file per directory: AGENTS.override.md, then AGENTS.md, then project_doc_fallback_filenames.", "每级目录至多一个:AGENTS.override.md > AGENTS.md > project_doc_fallback_filenames。"),
106
+ L("Combined size is capped by project_doc_max_bytes (32 KiB default).", "合并大小受 project_doc_max_bytes 限制(默认 32 KiB)。"),
107
+ ],
108
+ },
109
+ rules: {
110
+ supported: true,
111
+ locations: [
112
+ { scope: "user", path: "$CODEX_HOME/rules/*.rules" },
113
+ { scope: "project", path: ".codex/rules/*.rules (trusted projects)" },
114
+ ],
115
+ notes: [
116
+ L("Codex rules are command-approval policy (Starlark prefix_rule), not prompt instructions.", "Codex rules 是命令审批策略(Starlark prefix_rule),不是提示词规则。"),
117
+ ],
118
+ },
119
+ skills: {
120
+ supported: true,
121
+ locations: [
122
+ { scope: "project", path: ".agents/skills (cwd → repo root)" },
123
+ { scope: "project", path: ".codex/skills" },
124
+ { scope: "user", path: "~/.agents/skills" },
125
+ { scope: "user", path: "$CODEX_HOME/skills (deprecated) · skills/.system" },
126
+ { scope: "managed", path: "/etc/codex/skills" },
127
+ ],
128
+ notes: [
129
+ L("Recursive up to 6 levels; hidden folders are skipped; symlinks are followed.", "递归扫描,最深 6 层;跳过隐藏目录;跟随符号链接。"),
130
+ L("agents/openai.yaml `policy.allow_implicit_invocation: false` → explicit $skill only.", "agents/openai.yaml `policy.allow_implicit_invocation: false` → 只能显式 $skill。"),
131
+ L("`[[skills.config]] path = … enabled = false` in config.toml disables a skill.", "config.toml 中 `[[skills.config]] path = … enabled = false` 禁用。"),
132
+ ],
133
+ },
134
+ mcp: {
135
+ supported: true,
136
+ locations: [
137
+ { scope: "user", path: "$CODEX_HOME/config.toml → [mcp_servers.*]" },
138
+ { scope: "project", path: ".codex/config.toml (trusted projects)" },
139
+ ],
140
+ notes: [L("`enabled = false` disables a server.", "`enabled = false` 禁用 server。")],
141
+ },
142
+ plugins: {
143
+ supported: true,
144
+ locations: [{ scope: "project", path: "plugin.json · .codex-plugin/plugin.json" }, { scope: "user", path: "$CODEX_HOME/plugins/* · plugins/cache/<source>/<plugin>/<version>" }],
145
+ notes: [L("Only these local plugin locations are scanned; marketplace sources elsewhere are not enumerated. The Agent Plugins badge shows the declared schema version; unsupported versions are unverified.", "仅扫描这些本地插件位置;其他 marketplace 来源不逐一列出。Agent Plugins 标识显示清单声明的规范版本;未支持版本标为未校验。")],
146
+ },
147
+ },
148
+ cursor: {
149
+ instructions: {
150
+ supported: true,
151
+ locations: [
152
+ { scope: "project", path: "AGENTS.md (root + any subdirectory)" },
153
+ { scope: "project", path: "CLAUDE.md · CLAUDE.local.md · .cursorrules (legacy)" },
154
+ ],
155
+ notes: [
156
+ L("Nested AGENTS.md applies to files in that directory and below.", "嵌套 AGENTS.md 作用于该目录及其子目录。"),
157
+ L("User Rules live in Cursor settings (not on disk) and are not shown.", "User Rules 存在 Cursor 设置里(非文件),不在此展示。"),
158
+ ],
159
+ },
160
+ rules: {
161
+ supported: true,
162
+ locations: [{ scope: "project", path: ".cursor/rules/**/*.mdc (nested .cursor/rules too)" }],
163
+ notes: [
164
+ L("Recursive; plain .md files in rules/ are ignored.", "递归;rules/ 里的 .md 会被忽略。"),
165
+ L("alwaysApply → Always · globs → auto-attached · description only → Agent decides · none → @mention only.", "alwaysApply → 总是 · globs → 匹配时附加 · 仅 description → Agent 决定 · 都没有 → 仅 @ 手动。"),
166
+ ],
167
+ },
168
+ skills: {
169
+ supported: true,
170
+ locations: [
171
+ { scope: "project", path: ".cursor/skills · .agents/skills" },
172
+ { scope: "project", path: ".claude/skills · .codex/skills" },
173
+ { scope: "user", path: "~/.cursor/skills · ~/.agents/skills" },
174
+ { scope: "user", path: "~/.claude/skills · ~/.codex/skills" },
175
+ { scope: "user", path: "~/.cursor/skills-cursor (built-in)" },
176
+ ],
177
+ notes: [
178
+ L("Recursive: any SKILL.md below a skills root; nested project skills are scoped to their directory.", "递归:skills 根下任意层级的 SKILL.md;仓库子目录中的 skills 自动限定到该目录。"),
179
+ L("`disable-model-invocation: true` → /skill only; `paths` (legacy `globs`) → only for matching files.", "`disable-model-invocation: true` → 仅 /skill;`paths`(旧 `globs`)→ 匹配文件时。"),
180
+ ],
181
+ },
182
+ mcp: {
183
+ supported: true,
184
+ locations: [
185
+ { scope: "user", path: "~/.cursor/mcp.json" },
186
+ { scope: "project", path: ".cursor/mcp.json" },
187
+ ],
188
+ notes: [
189
+ L("`agent mcp disable` writes ~/.cursor/projects/<slug>/mcp-disabled.json; IDE toggles are not readable.", "`agent mcp disable` 写入 ~/.cursor/projects/<slug>/mcp-disabled.json;IDE 内的开关读不到。"),
190
+ ],
191
+ },
192
+ commands: { supported: true, locations: [{ scope: "project", path: ".cursor/commands/**/*.md" }, { scope: "user", path: "~/.cursor/commands/**/*.md" }], notes: [L("Markdown slash commands; nested folders inside commands/ are allowed.", "Markdown 斜杠命令;commands/ 内支持嵌套目录。") ] },
193
+ subagents: { supported: true, locations: [{ scope: "project", path: ".cursor/agents" }, { scope: "project", path: ".claude/agents · .codex/agents" }, { scope: "user", path: "~/.cursor/agents" }, { scope: "user", path: "~/.claude/agents · ~/.codex/agents" }], notes: [L("Agent definitions use Markdown with frontmatter; Claude and Codex directories are available when compatibility is on.", "子代理使用带 frontmatter 的 Markdown;开启兼容时可读取 Claude 和 Codex 目录。") ] },
194
+ plugins: { supported: true, locations: [{ scope: "project", path: "plugin.json · .cursor-plugin/plugin.json" }, { scope: "user", path: "~/.cursor/plugins/local/*/plugin.json · .cursor-plugin/plugin.json" }], notes: [L("Local test plugins are discovered from ~/.cursor/plugins/local. The badge uses the root manifest's declared schema version; unsupported versions are unverified.", "从 ~/.cursor/plugins/local 发现本地测试插件。标识使用根清单声明的规范版本;未支持版本标为未校验。") ] },
195
+ },
196
+ copilot: {
197
+ instructions: {
198
+ supported: true,
199
+ locations: [
200
+ { scope: "project", path: "AGENTS.md · CLAUDE.md · GEMINI.md · .github/copilot-instructions.md" },
201
+ { scope: "user", path: "~/.copilot/copilot-instructions.md" },
202
+ ],
203
+ notes: [L("Read from the git root and cwd; --no-custom-instructions turns them off.", "读取 git 根与 cwd;--no-custom-instructions 关闭。")],
204
+ },
205
+ rules: {
206
+ supported: true,
207
+ locations: [
208
+ { scope: "project", path: ".github/instructions/**/*.instructions.md" },
209
+ { scope: "user", path: "~/.copilot/instructions/**/*.instructions.md" },
210
+ ],
211
+ notes: [L("`applyTo` frontmatter scopes an instruction to matching files.", "frontmatter `applyTo` 限定匹配文件。")],
212
+ },
213
+ skills: {
214
+ supported: true,
215
+ locations: [
216
+ { scope: "project", path: ".github/skills · .agents/skills · .claude/skills" },
217
+ { scope: "user", path: "~/.copilot/skills · ~/.agents/skills" },
218
+ { scope: "project", path: ".claude/commands/*.md" },
219
+ ],
220
+ notes: [
221
+ L("First found wins for duplicate names.", "同名 skill 先找到的优先。"),
222
+ L("`disable-model-invocation: true` → manual only; `user-invocable: false` hides it from /.", "`disable-model-invocation: true` → 仅手动;`user-invocable: false` → 不出现在 /。"),
223
+ ],
224
+ },
225
+ mcp: {
226
+ supported: true,
227
+ locations: [
228
+ { scope: "user", path: "~/.copilot/mcp-config.json" },
229
+ { scope: "project", path: ".mcp.json · .github/mcp.json (trusted folder)" },
230
+ ],
231
+ notes: [L("/mcp disable persists in user config; the field is undocumented, so disabled state is not shown.", "/mcp disable 写入用户配置,字段未公开,暂不显示禁用状态。")],
232
+ },
233
+ },
234
+ opencode: {
235
+ instructions: {
236
+ supported: true,
237
+ locations: [
238
+ { scope: "project", path: "AGENTS.md, else CLAUDE.md (cwd → worktree)" },
239
+ { scope: "user", path: "~/.config/opencode/AGENTS.md, else ~/.claude/CLAUDE.md" },
240
+ ],
241
+ notes: [
242
+ L("First match wins in each scope.", "每个范围只取第一个匹配。"),
243
+ L("OPENCODE_DISABLE_CLAUDE_CODE(_PROMPT) turns off the Claude fallbacks.", "OPENCODE_DISABLE_CLAUDE_CODE(_PROMPT) 关闭 Claude 兼容。"),
244
+ ],
245
+ },
246
+ rules: {
247
+ supported: true,
248
+ locations: [{ scope: "project", path: "opencode.json → instructions[] (paths, globs, URLs)" }],
249
+ notes: [L("OpenCode calls AGENTS.md “rules”; extra rule files come from `instructions`.", "OpenCode 把 AGENTS.md 称作 rules;额外规则文件来自 `instructions`。")],
250
+ },
251
+ skills: {
252
+ supported: true,
253
+ locations: [
254
+ { scope: "project", path: ".opencode/skills (cwd → worktree)" },
255
+ { scope: "project", path: ".claude/skills · .agents/skills (cwd → worktree)" },
256
+ { scope: "user", path: "~/.config/opencode/skills" },
257
+ { scope: "user", path: "~/.claude/skills · ~/.agents/skills" },
258
+ ],
259
+ notes: [
260
+ L("Every discovered, permitted skill is advertised automatically; there is no per-skill manual-only switch in OpenCode 1.18. The body loads on demand through the skill tool.", "OpenCode 1.18 会自动向模型列出所有已发现且获准使用的技能;不支持单个技能设为仅手动发现。正文仍由 skill 工具按需加载。"),
261
+ L("`permission.skill` patterns: deny hides a skill, ask prompts first.", "`permission.skill` 通配:deny 隐藏,ask 先确认。"),
262
+ ],
263
+ },
264
+ mcp: {
265
+ supported: true,
266
+ locations: [
267
+ { scope: "user", path: "~/.config/opencode/opencode.json(c) → mcp" },
268
+ { scope: "project", path: "opencode.json(c) · .opencode/opencode.json(c) → mcp" },
269
+ ],
270
+ notes: [L("`enabled: false` disables a server.", "`enabled: false` 禁用 server。")],
271
+ },
272
+ },
273
+ pi: {
274
+ instructions: {
275
+ supported: true,
276
+ locations: [
277
+ { scope: "user", path: "~/.pi/agent/AGENTS.md · SYSTEM.md · APPEND_SYSTEM.md" },
278
+ { scope: "project", path: "AGENTS.md | CLAUDE.md (cwd + parents) · .pi/SYSTEM.md" },
279
+ ],
280
+ notes: [
281
+ L("AGENTS.override.md replaces AGENTS.md / CLAUDE.md in the same directory only.", "AGENTS.override.md 只替代同一目录的 AGENTS.md / CLAUDE.md。"),
282
+ L("SYSTEM.md replaces the system prompt; APPEND_SYSTEM.md appends to it.", "SYSTEM.md 替换系统提示;APPEND_SYSTEM.md 追加。"),
283
+ ],
284
+ },
285
+ rules: UNSUPPORTED("Pi has no rules files; use AGENTS.md or prompt templates.", "Pi 没有 rules 文件;使用 AGENTS.md 或 prompt templates。"),
286
+ skills: {
287
+ supported: true,
288
+ locations: [
289
+ { scope: "user", path: "~/.pi/agent/skills · ~/.agents/skills" },
290
+ { scope: "project", path: ".pi/skills · .agents/skills (cwd → repo root)" },
291
+ ],
292
+ notes: [
293
+ L("Recursive; loose .md files directly in a pi skills root are skills too.", "递归;pi skills 根目录下的独立 .md 也算 skill。"),
294
+ L("`disable-model-invocation: true` → /skill:name only.", "`disable-model-invocation: true` → 仅 /skill:name。"),
295
+ ],
296
+ },
297
+ mcp: UNSUPPORTED("Pi does not support MCP; use extensions.", "Pi 不支持 MCP;使用 extensions。"),
298
+ },
299
+ omp: {
300
+ instructions: {
301
+ supported: true,
302
+ locations: [
303
+ { scope: "user", path: "~/.omp/agent/AGENTS.md · ~/.agents/AGENTS.md · ~/.claude/CLAUDE.md · ~/.codex/AGENTS.md" },
304
+ { scope: "project", path: ".omp/AGENTS.md · AGENTS.md · CLAUDE.md (walk up)" },
305
+ ],
306
+ notes: [L("Aggregates native .omp files and other agents' conventions.", "聚合 .omp 原生文件与其他 agent 的约定。")],
307
+ },
308
+ rules: {
309
+ supported: true,
310
+ locations: [
311
+ { scope: "project", path: ".omp/rules · .agents/rules · .cursor/rules · .github/instructions · .omp/RULES.md" },
312
+ { scope: "user", path: "~/.omp/agent/rules · ~/.agents/rules · ~/.cursor/rules · ~/.omp/agent/RULES.md" },
313
+ ],
314
+ notes: [L("RULES.md is sticky (always applied); other rules follow alwaysApply / globs / description.", "RULES.md 常驻(总是应用);其他规则按 alwaysApply / globs / description。")],
315
+ },
316
+ skills: {
317
+ supported: true,
318
+ locations: [
319
+ { scope: "project", path: ".omp/skills · .agents/skills · .claude/skills · .codex/skills" },
320
+ { scope: "user", path: "~/.omp/agent/skills · managed-skills · ~/.agents/skills" },
321
+ { scope: "user", path: "~/.claude/skills · ~/.codex/skills (off by default)" },
322
+ ],
323
+ notes: [
324
+ L("One level per root; skills without a description are skipped.", "每个根只扫一层;没有 description 的 skill 不加载。"),
325
+ L("`hide: true` / `disable-model-invocation: true` → /skill only; `enabled: false` skips it.", "`hide: true` / `disable-model-invocation: true` → 仅 /skill;`enabled: false` 不加载。"),
326
+ L("config.yml: skills.enableClaudeUser / enableCodexUser, skills.ignoredSkills, disabledExtensions.", "config.yml:skills.enableClaudeUser / enableCodexUser、skills.ignoredSkills、disabledExtensions。"),
327
+ ],
328
+ },
329
+ mcp: {
330
+ supported: true,
331
+ locations: [
332
+ { scope: "user", path: "~/.omp/agent/mcp.json · ~/.cursor/mcp.json · ~/.codex/config.toml" },
333
+ { scope: "project", path: ".omp/mcp.json · mcp.json · .mcp.json · .cursor/mcp.json · .codex/config.toml" },
334
+ ],
335
+ notes: [L("`enabled: false` disables a server.", "`enabled: false` 禁用 server。")],
336
+ },
337
+ },
338
+ };
339
+
340
+ function acpMechanisms(id: AcpProviderId): Partial<Record<Category, Mechanism>> {
341
+ const config: AcpConfig = ACP_CONFIGS[id];
342
+ return Object.fromEntries(CATEGORIES.map((category) => {
343
+ const paths = config[category];
344
+ const locations: Mechanism["locations"] = [
345
+ ...(paths.project ?? []).map((p) => ({ scope: "project" as const, path: p })),
346
+ ...(paths.user ?? []).map((p) => ({ scope: "user" as const, path: `~/${p}` })),
347
+ ];
348
+ const specific = ACP_NOTES[id]?.[category];
349
+ const notes = locations.length ? [specific ?? L("Shows local configuration files; actual activation can depend on trust, settings or CLI flags.", "展示本地配置文件;实际启用还可能受信任状态、设置或 CLI 参数影响。")]
350
+ : [specific ?? L("No verified standalone file location for this category.", "此分类尚无已核实的独立文件位置。")];
351
+ return [category, { supported: locations.length > 0, locations, notes }];
352
+ })) as Partial<Record<Category, Mechanism>>;
353
+ }
354
+
355
+ for (const id of Object.keys(ACP_CONFIGS) as AcpProviderId[]) BASE_MECHANISMS[id] = acpMechanisms(id);
356
+
357
+ export const MECHANISMS = Object.fromEntries(PROVIDER_IDS.map((id) => [
358
+ id, Object.fromEntries(CATEGORIES.map((category) => [category, BASE_MECHANISMS[id]?.[category] ?? UNVERIFIED])),
359
+ ])) as Record<ProviderId, Record<Category, Mechanism>>;
360
+
361
+ /** Reflect local compatibility switches in the discovery explanation. */
362
+ export function mechanismFor(provider: ProviderId, category: Category, compatibility: Compatibility | null | undefined): Mechanism {
363
+ const base = MECHANISMS[provider][category];
364
+ if (!compatibility || !(provider === "cursor" && (category === "skills" || category === "subagents")
365
+ || provider === "opencode" && category === "skills")) return base;
366
+ const isCursor = provider === "cursor";
367
+ const state = compatibility.enabled === true
368
+ ? L(isCursor ? "Cursor third-party compatibility is on." : "OpenCode external skill discovery is on by default.",
369
+ isCursor ? "Cursor 第三方配置兼容已开启。" : "OpenCode 默认开启外部技能目录扫描。")
370
+ : compatibility.enabled === false
371
+ ? L(isCursor ? "Cursor third-party compatibility is off; Claude/Codex directories are skipped." : `OpenCode external skill discovery is off (${compatibility.source}); .claude and .agents directories are skipped.`,
372
+ isCursor ? "Cursor 第三方配置兼容已关闭;跳过 Claude/Codex 目录。" : `OpenCode 外部技能目录扫描已关闭(${compatibility.source});跳过 .claude 和 .agents 目录。`)
373
+ : L("Cursor's IDE switch could not be read; external directories may differ from the live agent.", "无法读取 Cursor IDE 开关;外部目录可能与当前 agent 的加载状态不同。");
374
+ const locations = compatibility.enabled === false
375
+ ? base.locations.filter((location) => isCursor
376
+ ? !/\.claude\/|\.codex\//.test(location.path)
377
+ : !/\.claude\/|\.agents\//.test(location.path))
378
+ : base.locations;
379
+ return { ...base, locations, notes: [state, ...base.notes] };
380
+ }
@@ -0,0 +1,27 @@
1
+ /** Phase-one providers: Paseo built-ins (provider-manifest `BUILTIN_PROVIDER_IDS`) plus Cursor. */
2
+ export const PROVIDER_IDS = ["claude", "codex", "cursor", "copilot", "opencode", "pi", "omp", "cline", "codebuddy-code", "gemini", "goose", "grok", "kilo", "kiro", "kimi", "qwen-code", "traecli"] as const;
3
+ export type ProviderId = (typeof PROVIDER_IDS)[number];
4
+
5
+ export const PROVIDER_LABELS: Record<ProviderId, string> = {
6
+ claude: "Claude",
7
+ codex: "Codex",
8
+ cursor: "Cursor",
9
+ copilot: "Copilot",
10
+ opencode: "OpenCode",
11
+ pi: "Pi",
12
+ omp: "Oh My Pi",
13
+ cline: "Cline",
14
+ "codebuddy-code": "CodeBuddy Code",
15
+ gemini: "Gemini CLI",
16
+ goose: "Goose",
17
+ grok: "Grok Build",
18
+ kilo: "Kilo Code",
19
+ kiro: "Kiro CLI",
20
+ kimi: "Kimi Code",
21
+ "qwen-code": "Qwen Code",
22
+ traecli: "TraeCode CLI",
23
+ };
24
+
25
+ export function isProviderId(value: string): value is ProviderId {
26
+ return (PROVIDER_IDS as readonly string[]).includes(value);
27
+ }
@@ -0,0 +1,14 @@
1
+ import { defineSettings } from "@getpaseo/plugin";
2
+ import { z } from "zod";
3
+ import { PROVIDER_IDS } from "./providers.ts";
4
+
5
+ /** Host-scoped board selection; null means the project has not been chosen yet. */
6
+ export const selectionSettings = defineSettings({
7
+ id: "board-selection",
8
+ scope: "host",
9
+ version: 1,
10
+ schema: z.object({
11
+ provider: z.enum(PROVIDER_IDS).default("claude"),
12
+ projectRoot: z.string().nullable().default(null),
13
+ }),
14
+ });