pikiloop 0.4.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 (154) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +353 -0
  3. package/README.v2.md +287 -0
  4. package/README.zh-CN.md +352 -0
  5. package/dashboard/dist/assets/AgentTab-UZPIhlkr.js +1 -0
  6. package/dashboard/dist/assets/DirBrowser-Ckcmi-Pi.js +1 -0
  7. package/dashboard/dist/assets/ExtensionsTab-KZhEDrdu.js +1 -0
  8. package/dashboard/dist/assets/IMAccessTab-Bd_IY1GQ.js +1 -0
  9. package/dashboard/dist/assets/Modal-CTeL0y7P.js +1 -0
  10. package/dashboard/dist/assets/Modals-axftHasy.js +1 -0
  11. package/dashboard/dist/assets/Select-C8tOdPhe.js +1 -0
  12. package/dashboard/dist/assets/SessionPanel-C1geSRxw.js +1 -0
  13. package/dashboard/dist/assets/SystemTab-DBDkaPiO.js +1 -0
  14. package/dashboard/dist/assets/anthropic-BAdojD7P.ico +0 -0
  15. package/dashboard/dist/assets/codex-DYadqqp0.png +0 -0
  16. package/dashboard/dist/assets/deepseek-BeYNZEk0.ico +0 -0
  17. package/dashboard/dist/assets/doubao-DloFDuFR.png +0 -0
  18. package/dashboard/dist/assets/feishu-C4OMrjCW.ico +0 -0
  19. package/dashboard/dist/assets/gemini-BYkEpiWr.svg +1 -0
  20. package/dashboard/dist/assets/hermes-BAarh-tH.png +0 -0
  21. package/dashboard/dist/assets/index-CpM4CqZJ.js +23 -0
  22. package/dashboard/dist/assets/index-DXSohzrE.js +3 -0
  23. package/dashboard/dist/assets/index-reSbuley.css +1 -0
  24. package/dashboard/dist/assets/markdown-DxQYQFeH.js +29 -0
  25. package/dashboard/dist/assets/minimax-PuEGTfrF.ico +0 -0
  26. package/dashboard/dist/assets/mlx-DhWwjtMw.png +0 -0
  27. package/dashboard/dist/assets/ollama-Bt9O-2K_.png +0 -0
  28. package/dashboard/dist/assets/openrouter-CsJ_bD5Q.ico +0 -0
  29. package/dashboard/dist/assets/playwright-BldPFZgC.ico +0 -0
  30. package/dashboard/dist/assets/qwen-xykkX0_y.png +0 -0
  31. package/dashboard/dist/assets/react-vendor-C7Sl8SE7.js +9 -0
  32. package/dashboard/dist/assets/router-DHISdpPk.js +3 -0
  33. package/dashboard/dist/assets/shared-BIP_4k4I.js +1 -0
  34. package/dashboard/dist/favicon.svg +28 -0
  35. package/dashboard/dist/index.html +17 -0
  36. package/dist/agent/acp-client.js +261 -0
  37. package/dist/agent/auto-update.js +432 -0
  38. package/dist/agent/await-resume.js +50 -0
  39. package/dist/agent/cli/auth.js +325 -0
  40. package/dist/agent/cli/catalog.js +40 -0
  41. package/dist/agent/cli/detector.js +136 -0
  42. package/dist/agent/cli/index.js +7 -0
  43. package/dist/agent/cli/registry.js +33 -0
  44. package/dist/agent/driver.js +39 -0
  45. package/dist/agent/drivers/claude-tui.js +2297 -0
  46. package/dist/agent/drivers/claude.js +2689 -0
  47. package/dist/agent/drivers/codex.js +2210 -0
  48. package/dist/agent/drivers/gemini.js +1059 -0
  49. package/dist/agent/drivers/hermes.js +795 -0
  50. package/dist/agent/goal.js +274 -0
  51. package/dist/agent/handover.js +130 -0
  52. package/dist/agent/images.js +355 -0
  53. package/dist/agent/index.js +50 -0
  54. package/dist/agent/mcp/bridge.js +791 -0
  55. package/dist/agent/mcp/extensions.js +637 -0
  56. package/dist/agent/mcp/oauth.js +353 -0
  57. package/dist/agent/mcp/registry.js +119 -0
  58. package/dist/agent/mcp/session-server.js +229 -0
  59. package/dist/agent/mcp/tools/ask-user.js +113 -0
  60. package/dist/agent/mcp/tools/await-resume.js +77 -0
  61. package/dist/agent/mcp/tools/goal.js +144 -0
  62. package/dist/agent/mcp/tools/types.js +12 -0
  63. package/dist/agent/mcp/tools/workspace.js +212 -0
  64. package/dist/agent/npm.js +31 -0
  65. package/dist/agent/session.js +1206 -0
  66. package/dist/agent/skill-installer.js +160 -0
  67. package/dist/agent/skills.js +257 -0
  68. package/dist/agent/stream.js +743 -0
  69. package/dist/agent/types.js +13 -0
  70. package/dist/agent/utils.js +687 -0
  71. package/dist/bot/bot.js +2499 -0
  72. package/dist/bot/command-ui.js +633 -0
  73. package/dist/bot/commands.js +513 -0
  74. package/dist/bot/headless-bot.js +36 -0
  75. package/dist/bot/host.js +192 -0
  76. package/dist/bot/human-loop.js +168 -0
  77. package/dist/bot/menu.js +48 -0
  78. package/dist/bot/orchestration.js +79 -0
  79. package/dist/bot/render-shared.js +309 -0
  80. package/dist/bot/session-hub.js +361 -0
  81. package/dist/bot/session-status.js +55 -0
  82. package/dist/bot/streaming.js +309 -0
  83. package/dist/browser-profile.js +579 -0
  84. package/dist/browser-supervisor.js +249 -0
  85. package/dist/catalog/cli-tools.js +421 -0
  86. package/dist/catalog/index.js +21 -0
  87. package/dist/catalog/local-models.js +94 -0
  88. package/dist/catalog/mcp-servers.js +315 -0
  89. package/dist/catalog/skill-repos.js +173 -0
  90. package/dist/channels/base.js +55 -0
  91. package/dist/channels/dingtalk/bot.js +549 -0
  92. package/dist/channels/dingtalk/channel.js +268 -0
  93. package/dist/channels/discord/bot.js +552 -0
  94. package/dist/channels/discord/channel.js +245 -0
  95. package/dist/channels/feishu/bot.js +1275 -0
  96. package/dist/channels/feishu/channel.js +911 -0
  97. package/dist/channels/feishu/markdown.js +91 -0
  98. package/dist/channels/feishu/render.js +619 -0
  99. package/dist/channels/health.js +109 -0
  100. package/dist/channels/slack/bot.js +554 -0
  101. package/dist/channels/slack/channel.js +283 -0
  102. package/dist/channels/states.js +6 -0
  103. package/dist/channels/telegram/bot.js +1310 -0
  104. package/dist/channels/telegram/channel.js +820 -0
  105. package/dist/channels/telegram/directory.js +111 -0
  106. package/dist/channels/telegram/live-preview.js +220 -0
  107. package/dist/channels/telegram/render.js +384 -0
  108. package/dist/channels/wecom/bot.js +558 -0
  109. package/dist/channels/wecom/channel.js +479 -0
  110. package/dist/channels/weixin/api.js +520 -0
  111. package/dist/channels/weixin/bot.js +1000 -0
  112. package/dist/channels/weixin/channel.js +222 -0
  113. package/dist/cli/autostart.js +262 -0
  114. package/dist/cli/channel-supervisor.js +313 -0
  115. package/dist/cli/channels.js +54 -0
  116. package/dist/cli/main.js +726 -0
  117. package/dist/cli/onboarding.js +227 -0
  118. package/dist/cli/run.js +308 -0
  119. package/dist/cli/setup-wizard.js +235 -0
  120. package/dist/core/config/runtime-config.js +201 -0
  121. package/dist/core/config/user-config.js +510 -0
  122. package/dist/core/config/validation.js +521 -0
  123. package/dist/core/constants.js +400 -0
  124. package/dist/core/git.js +145 -0
  125. package/dist/core/legacy-compat.js +60 -0
  126. package/dist/core/logging.js +101 -0
  127. package/dist/core/platform.js +59 -0
  128. package/dist/core/process-control.js +315 -0
  129. package/dist/core/secrets/index.js +42 -0
  130. package/dist/core/secrets/inline-seal.js +60 -0
  131. package/dist/core/secrets/ref.js +33 -0
  132. package/dist/core/secrets/resolver.js +65 -0
  133. package/dist/core/secrets/store.js +63 -0
  134. package/dist/core/utils.js +233 -0
  135. package/dist/core/version.js +15 -0
  136. package/dist/dashboard/platform.js +219 -0
  137. package/dist/dashboard/routes/agents.js +450 -0
  138. package/dist/dashboard/routes/cli.js +174 -0
  139. package/dist/dashboard/routes/config.js +523 -0
  140. package/dist/dashboard/routes/extensions.js +745 -0
  141. package/dist/dashboard/routes/local-models.js +290 -0
  142. package/dist/dashboard/routes/models.js +324 -0
  143. package/dist/dashboard/routes/sessions.js +838 -0
  144. package/dist/dashboard/runtime.js +410 -0
  145. package/dist/dashboard/server.js +237 -0
  146. package/dist/dashboard/session-control.js +347 -0
  147. package/dist/model/catalog.js +104 -0
  148. package/dist/model/index.js +20 -0
  149. package/dist/model/injector.js +272 -0
  150. package/dist/model/provider-models.js +112 -0
  151. package/dist/model/store.js +212 -0
  152. package/dist/model/types.js +13 -0
  153. package/dist/model/validation.js +203 -0
  154. package/package.json +82 -0
@@ -0,0 +1,21 @@
1
+ /**
2
+ * src/catalog — data-only manifests of everything the Extensions page offers.
3
+ *
4
+ * This directory is the *single* place you edit to add/remove items from the
5
+ * Dashboard. Each file is a plain TypeScript array; no logic lives here.
6
+ *
7
+ * mcp-servers.ts — Extensions → MCP tab
8
+ * cli-tools.ts — Extensions → CLI tab
9
+ * skill-repos.ts — Extensions → Skills tab
10
+ *
11
+ * The loading / auth / install logic lives in:
12
+ * - src/agent/mcp/{registry,extensions,oauth}.ts (MCP)
13
+ * - src/agent/cli/{registry,detector,auth}.ts (CLI)
14
+ * - src/agent/{skills,skill-installer}.ts (Skills)
15
+ *
16
+ * Those modules own the types and execute the runtime flows; this directory
17
+ * exists purely so "what to show" stays editable in one spot.
18
+ */
19
+ export { MCP_SERVERS } from './mcp-servers.js';
20
+ export { CLI_TOOLS } from './cli-tools.js';
21
+ export { SKILL_REPOS } from './skill-repos.js';
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Local model catalog — curated set of coding-friendly open models that
3
+ * pikiloop recommends for self-hosted backends (Ollama / mlx-lm).
4
+ *
5
+ * Per-backend identifier rules:
6
+ * - `ollamaTag` — entry exists in Ollama's library
7
+ * - `mlxModel` — HuggingFace repo under `mlx-community/` (Apple Silicon)
8
+ * Either field is optional; the dashboard filters by backend before display.
9
+ *
10
+ * Sizing rules of thumb (Q4 quants on disk):
11
+ * weights_gb ≈ params_b × 0.6
12
+ * min_ram_gb ≈ weights_gb × 1.5 + 4 // KV cache + OS headroom
13
+ *
14
+ * `minRamGb` is conservative on purpose.
15
+ */
16
+ export const LOCAL_MODELS = [
17
+ // ── Tier A: 16 GB Macs ─────────────────────────────────────────────────────
18
+ {
19
+ id: 'qwen2.5-coder-7b',
20
+ name: 'Qwen2.5-Coder 7B',
21
+ publisher: 'Alibaba Qwen',
22
+ paramsB: 7,
23
+ sizeGb: 5,
24
+ minRamGb: 16,
25
+ description: 'Compact coding-tuned model; a strong 16 GB Mac default for agent loops.',
26
+ descriptionZh: '面向代码的小模型,16GB Mac 上跑 agent 的稳健选择。',
27
+ ollamaTag: 'qwen2.5-coder:7b',
28
+ mlxModel: 'mlx-community/Qwen2.5-Coder-7B-Instruct-4bit',
29
+ homepage: 'https://qwenlm.github.io/blog/qwen2.5-coder/',
30
+ },
31
+ {
32
+ id: 'llama-3.3-8b',
33
+ name: 'Llama 3.3 8B Instruct',
34
+ publisher: 'Meta',
35
+ paramsB: 8,
36
+ sizeGb: 5,
37
+ minRamGb: 16,
38
+ description: 'General-purpose chat; competent tool use, weaker on long-form code edits.',
39
+ descriptionZh: '通用对话模型,工具调用合格,长代码改写偏弱。',
40
+ ollamaTag: 'llama3.3:8b',
41
+ homepage: 'https://www.llama.com/',
42
+ },
43
+ {
44
+ id: 'gemma3-4b',
45
+ name: 'Gemma 3 4B',
46
+ publisher: 'Google DeepMind',
47
+ paramsB: 4,
48
+ sizeGb: 3,
49
+ minRamGb: 8,
50
+ description: 'Smallest entry — runs on 8 GB Macs but tool-use is limited.',
51
+ descriptionZh: '清单里最小的模型,8GB Mac 可跑,工具调用能力有限。',
52
+ ollamaTag: 'gemma3:4b',
53
+ homepage: 'https://ai.google.dev/gemma',
54
+ },
55
+ // ── Tier B: 24-32 GB sweet spot ────────────────────────────────────────────
56
+ {
57
+ id: 'deepseek-coder-v2-lite',
58
+ name: 'DeepSeek-Coder V2 Lite',
59
+ publisher: 'DeepSeek',
60
+ paramsB: 16,
61
+ sizeGb: 10,
62
+ minRamGb: 24,
63
+ description: '16B MoE (~2.4B active) — fast inference + strong code reasoning at mid RAM.',
64
+ descriptionZh: '16B MoE(≈2.4B 激活),中等内存下推理快、代码理解强。',
65
+ ollamaTag: 'deepseek-coder-v2:16b',
66
+ homepage: 'https://github.com/deepseek-ai/DeepSeek-Coder-V2',
67
+ },
68
+ {
69
+ id: 'phi-4',
70
+ name: 'Phi-4 14B',
71
+ publisher: 'Microsoft',
72
+ paramsB: 14,
73
+ sizeGb: 9,
74
+ minRamGb: 24,
75
+ description: 'Reasoning-tuned 14B; punches above its weight on code and tool tasks.',
76
+ descriptionZh: '14B 推理向模型,代码与工具任务上超出参数量预期。',
77
+ ollamaTag: 'phi4:14b',
78
+ homepage: 'https://huggingface.co/microsoft/phi-4',
79
+ },
80
+ // ── Tier S: 36+ GB unified memory ──────────────────────────────────────────
81
+ {
82
+ id: 'qwen2.5-coder-32b',
83
+ name: 'Qwen2.5-Coder 32B',
84
+ publisher: 'Alibaba Qwen',
85
+ paramsB: 32,
86
+ sizeGb: 20,
87
+ minRamGb: 36,
88
+ description: 'Flagship open coding model — needs an Apple Silicon Pro/Max with 36 GB+ unified memory.',
89
+ descriptionZh: '开源代码旗舰,建议 36GB+ 统一内存的 M-Pro/Max。',
90
+ ollamaTag: 'qwen2.5-coder:32b',
91
+ mlxModel: 'mlx-community/Qwen2.5-Coder-32B-Instruct-4bit',
92
+ homepage: 'https://qwenlm.github.io/blog/qwen2.5-coder/',
93
+ },
94
+ ];
@@ -0,0 +1,315 @@
1
+ /**
2
+ * MCP server catalog — single source of truth for what the Dashboard shows
3
+ * under Extensions → MCP.
4
+ *
5
+ * ─── How this plugs into the rest of the stack ───────────────────────────────
6
+ *
7
+ * Dashboard → GET /api/extensions/mcp/catalog
8
+ * → dashboard/routes/extensions.ts
9
+ * → agent/mcp/extensions.ts (merge + state computation)
10
+ * → agent/mcp/registry.ts (types + re-exports this array)
11
+ * ← src/catalog/mcp-servers.ts ← YOU ARE HERE
12
+ *
13
+ * The registry module owns types and helper functions (install / OAuth / health).
14
+ * This file owns only the *data*. To add a new MCP server, append an entry here
15
+ * and the whole pipeline picks it up. To hide an entry, remove/comment it out —
16
+ * users who already installed it keep their setup; we only stop recommending.
17
+ *
18
+ * ─── recommendedScope ────────────────────────────────────────────────────────
19
+ *
20
+ * 'global' — account-level SaaS (GitHub, Atlassian, …). Shown in the
21
+ * Extensions tab; hidden from the Workspace modal.
22
+ * 'workspace' — tools that depend on project context (Filesystem, SQLite,
23
+ * Postgres). Shown in the Workspace modal; hidden globally.
24
+ * 'both' — useful in either place (rarely needed; avoid unless obvious).
25
+ *
26
+ * Generic protocol-demo servers (time / fetch / memory from @modelcontextprotocol)
27
+ * were intentionally removed — they don't carry a product identity and added
28
+ * clutter rather than value.
29
+ */
30
+ export const MCP_SERVERS = [
31
+ // ── Built-in (pikiloop-managed) ────────────────────────────────────────────
32
+ {
33
+ id: 'pikiloop-browser',
34
+ name: 'Browser Automation',
35
+ description: 'Optimized Playwright MCP — managed Chrome with shared profile, CDP attach, and supervisor lifecycle.',
36
+ descriptionZh: '基于 Playwright MCP 的定制版浏览器自动化:受管 Chrome、共享 profile、CDP 附着、进程级 supervisor。',
37
+ category: 'utility',
38
+ recommendedScope: 'global',
39
+ transport: { type: 'stdio', command: '@playwright/mcp', args: ['(managed by pikiloop)'] },
40
+ auth: { type: 'none' },
41
+ iconSlug: 'playwright',
42
+ homepage: 'https://github.com/microsoft/playwright-mcp',
43
+ isBuiltin: true,
44
+ },
45
+ {
46
+ id: 'peekaboo',
47
+ name: 'Peekaboo',
48
+ description: 'Native macOS GUI control via Accessibility API + ScreenCaptureKit (click, type, scroll, windows, menus, Dock). Requires Screen Recording + Accessibility permissions. macOS only.',
49
+ descriptionZh: '通过 macOS Accessibility 与 ScreenCaptureKit 实现原生 GUI 控制(点击、输入、滚动、窗口、菜单、Dock)。需要"屏幕录制"与"辅助功能"两项系统权限,仅支持 macOS。',
50
+ category: 'utility',
51
+ recommendedScope: 'global',
52
+ transport: { type: 'stdio', command: 'npx', args: ['-y', '-p', '@steipete/peekaboo', 'peekaboo-mcp'] },
53
+ auth: { type: 'none' },
54
+ iconSlug: 'peekaboo',
55
+ iconUrl: 'https://peekaboo.sh/favicon.svg',
56
+ homepage: 'https://peekaboo.sh/',
57
+ isBuiltin: true,
58
+ },
59
+ // ── Local filesystems / databases (workspace scope) ────────────────────────
60
+ {
61
+ id: 'filesystem',
62
+ name: 'Filesystem',
63
+ description: 'Read, write, and search files on the local machine',
64
+ descriptionZh: '读写和搜索本机文件',
65
+ category: 'utility',
66
+ recommendedScope: 'workspace',
67
+ transport: { type: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '${WORKDIR}'] },
68
+ auth: { type: 'none' },
69
+ iconSlug: 'filesystem',
70
+ },
71
+ {
72
+ id: 'sqlite',
73
+ name: 'SQLite',
74
+ description: 'Query and manage local SQLite databases',
75
+ descriptionZh: '查询和管理本地 SQLite 数据库',
76
+ category: 'data',
77
+ recommendedScope: 'workspace',
78
+ transport: { type: 'stdio', command: 'uvx', args: ['mcp-server-sqlite', '--db-path', '${WORKDIR}/data.db'] },
79
+ auth: { type: 'none' },
80
+ iconSlug: 'sqlite',
81
+ },
82
+ {
83
+ id: 'postgres',
84
+ name: 'PostgreSQL',
85
+ description: 'Query and manage PostgreSQL databases',
86
+ descriptionZh: '查询和管理 PostgreSQL 数据库',
87
+ category: 'data',
88
+ recommendedScope: 'workspace',
89
+ transport: { type: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-postgres', '${POSTGRES_CONNECTION_STRING}'] },
90
+ auth: {
91
+ type: 'credentials',
92
+ fields: [{
93
+ key: 'POSTGRES_CONNECTION_STRING',
94
+ label: 'Connection string',
95
+ labelZh: '连接串',
96
+ required: true,
97
+ placeholder: 'postgresql://user:pass@host:5432/db',
98
+ }],
99
+ },
100
+ iconSlug: 'postgres',
101
+ },
102
+ // ── Global-scope SaaS with MCP-OAuth ───────────────────────────────────────
103
+ {
104
+ id: 'github',
105
+ name: 'GitHub',
106
+ description: 'Repositories, pull requests, issues, code search',
107
+ descriptionZh: '仓库、PR、Issue、代码搜索',
108
+ category: 'dev',
109
+ recommendedScope: 'global',
110
+ transport: { type: 'http', url: 'https://api.githubcopilot.com/mcp/' },
111
+ auth: { type: 'mcp-oauth', scopes: ['repo', 'read:org'] },
112
+ iconSlug: 'github',
113
+ homepage: 'https://github.com/github/github-mcp-server',
114
+ },
115
+ {
116
+ id: 'atlassian',
117
+ name: 'Atlassian',
118
+ description: 'Jira issues, Confluence pages, sprint planning',
119
+ descriptionZh: 'Jira 工单、Confluence 文档、Sprint 管理',
120
+ category: 'productivity',
121
+ recommendedScope: 'global',
122
+ transport: { type: 'http', url: 'https://mcp.atlassian.com/v1/sse' },
123
+ auth: { type: 'mcp-oauth' },
124
+ iconSlug: 'atlassian',
125
+ homepage: 'https://www.atlassian.com/platform/remote-mcp-server',
126
+ },
127
+ {
128
+ id: 'notion',
129
+ name: 'Notion',
130
+ description: 'Read, write, and search Notion pages and databases',
131
+ descriptionZh: '读写和搜索 Notion 页面与数据库',
132
+ category: 'productivity',
133
+ recommendedScope: 'global',
134
+ transport: { type: 'http', url: 'https://mcp.notion.com/mcp' },
135
+ auth: { type: 'mcp-oauth' },
136
+ iconSlug: 'notion',
137
+ homepage: 'https://developers.notion.com/docs/mcp',
138
+ },
139
+ {
140
+ id: 'linear',
141
+ name: 'Linear',
142
+ description: 'Issues, projects, cycles, and team workflows',
143
+ descriptionZh: 'Issue、项目、周期和团队协作',
144
+ category: 'productivity',
145
+ recommendedScope: 'global',
146
+ transport: { type: 'http', url: 'https://mcp.linear.app/sse' },
147
+ auth: { type: 'mcp-oauth' },
148
+ iconSlug: 'linear',
149
+ homepage: 'https://linear.app/docs/mcp',
150
+ },
151
+ {
152
+ id: 'sentry',
153
+ name: 'Sentry',
154
+ description: 'Error tracking — search issues, view stack traces',
155
+ descriptionZh: '错误追踪 — 查询 Issue、查看堆栈',
156
+ category: 'dev',
157
+ recommendedScope: 'global',
158
+ transport: { type: 'http', url: 'https://mcp.sentry.dev/mcp' },
159
+ auth: { type: 'mcp-oauth' },
160
+ iconSlug: 'sentry',
161
+ homepage: 'https://docs.sentry.io/product/sentry-mcp/',
162
+ },
163
+ // ── Cloudflare trio (control plane / observability / docs) ─────────────────
164
+ {
165
+ id: 'cloudflare-bindings',
166
+ name: 'Cloudflare',
167
+ description: 'Manage Workers, Pages, R2, D1, KV — the full control plane',
168
+ descriptionZh: '管理 Workers / Pages / R2 / D1 / KV — 完整控制面',
169
+ category: 'dev',
170
+ recommendedScope: 'global',
171
+ transport: { type: 'http', url: 'https://bindings.mcp.cloudflare.com/sse' },
172
+ auth: { type: 'mcp-oauth' },
173
+ iconSlug: 'cloudflare',
174
+ homepage: 'https://developers.cloudflare.com/agents/model-context-protocol/',
175
+ },
176
+ {
177
+ id: 'cloudflare-observability',
178
+ name: 'Cloudflare Observability',
179
+ description: 'Workers logs, analytics, and traces',
180
+ descriptionZh: 'Workers 日志、分析与追踪',
181
+ category: 'dev',
182
+ recommendedScope: 'global',
183
+ transport: { type: 'http', url: 'https://observability.mcp.cloudflare.com/sse' },
184
+ auth: { type: 'mcp-oauth' },
185
+ iconSlug: 'cloudflare',
186
+ homepage: 'https://developers.cloudflare.com/agents/model-context-protocol/',
187
+ },
188
+ {
189
+ id: 'cloudflare-docs',
190
+ name: 'Cloudflare Docs',
191
+ description: 'Search and query Cloudflare documentation',
192
+ descriptionZh: '搜索和查询 Cloudflare 文档',
193
+ category: 'dev',
194
+ recommendedScope: 'global',
195
+ transport: { type: 'http', url: 'https://docs.mcp.cloudflare.com/sse' },
196
+ auth: { type: 'mcp-oauth' },
197
+ iconSlug: 'cloudflare',
198
+ homepage: 'https://developers.cloudflare.com/agents/model-context-protocol/',
199
+ },
200
+ // ── More SaaS integrations ─────────────────────────────────────────────────
201
+ {
202
+ id: 'gamma',
203
+ name: 'Gamma',
204
+ description: 'Generate AI-powered presentations and documents',
205
+ descriptionZh: '生成 AI 驱动的演示文稿和文档',
206
+ category: 'productivity',
207
+ recommendedScope: 'global',
208
+ transport: { type: 'http', url: 'https://mcp.gamma.app/mcp' },
209
+ auth: { type: 'mcp-oauth' },
210
+ iconSlug: 'gamma',
211
+ homepage: 'https://gamma.app/docs/mcp',
212
+ },
213
+ {
214
+ id: 'hugging-face',
215
+ name: 'Hugging Face',
216
+ description: 'Models, datasets, spaces, and inference',
217
+ descriptionZh: '模型、数据集、Spaces 和推理',
218
+ category: 'dev',
219
+ recommendedScope: 'global',
220
+ transport: { type: 'http', url: 'https://huggingface.co/mcp' },
221
+ auth: { type: 'mcp-oauth' },
222
+ iconSlug: 'huggingface',
223
+ homepage: 'https://huggingface.co/docs/hub/mcp',
224
+ },
225
+ {
226
+ id: 'slack',
227
+ name: 'Slack',
228
+ description: 'Read channels, summarize threads, send messages',
229
+ descriptionZh: '读取频道、总结对话、发送消息',
230
+ category: 'communication',
231
+ recommendedScope: 'global',
232
+ transport: { type: 'http', url: 'https://slack.com/api/mcp' },
233
+ auth: { type: 'mcp-oauth' },
234
+ iconSlug: 'slack',
235
+ homepage: 'https://api.slack.com/apis/mcp',
236
+ },
237
+ {
238
+ id: 'lark',
239
+ name: '飞书 / Lark',
240
+ description: 'Feishu docs, messages, tasks, bitable',
241
+ descriptionZh: '飞书文档、消息、任务、多维表格',
242
+ category: 'communication',
243
+ recommendedScope: 'global',
244
+ transport: { type: 'http', url: 'https://open.feishu.cn/mcp' },
245
+ auth: { type: 'mcp-oauth' },
246
+ iconSlug: 'lark',
247
+ homepage: 'https://open.feishu.cn/document/mcp',
248
+ },
249
+ // ── Remote + API key ───────────────────────────────────────────────────────
250
+ {
251
+ id: 'stripe',
252
+ name: 'Stripe',
253
+ description: 'Payments, customers, subscriptions, invoices',
254
+ descriptionZh: '支付、客户、订阅、账单',
255
+ category: 'data',
256
+ recommendedScope: 'global',
257
+ transport: { type: 'http', url: 'https://mcp.stripe.com/v1/mcp' },
258
+ auth: {
259
+ type: 'credentials',
260
+ fields: [{
261
+ key: 'STRIPE_API_KEY',
262
+ label: 'Secret key',
263
+ labelZh: 'Secret key',
264
+ secret: true,
265
+ required: true,
266
+ placeholder: 'sk_live_... or sk_test_...',
267
+ helpUrl: 'https://dashboard.stripe.com/apikeys',
268
+ }],
269
+ },
270
+ iconSlug: 'stripe',
271
+ homepage: 'https://docs.stripe.com/mcp',
272
+ },
273
+ {
274
+ id: 'brave-search',
275
+ name: 'Brave Search',
276
+ description: 'Web and local search via Brave Search API',
277
+ descriptionZh: '通过 Brave Search API 进行网页搜索',
278
+ category: 'search',
279
+ recommendedScope: 'global',
280
+ transport: { type: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-brave-search'] },
281
+ auth: {
282
+ type: 'credentials',
283
+ fields: [{
284
+ key: 'BRAVE_API_KEY',
285
+ label: 'API key',
286
+ labelZh: 'API 密钥',
287
+ secret: true,
288
+ required: true,
289
+ helpUrl: 'https://api.search.brave.com/app/keys',
290
+ }],
291
+ },
292
+ iconSlug: 'brave',
293
+ },
294
+ {
295
+ id: 'perplexity',
296
+ name: 'Perplexity',
297
+ description: 'Answer engine with real-time web search',
298
+ descriptionZh: '带实时网页检索的问答引擎',
299
+ category: 'search',
300
+ recommendedScope: 'global',
301
+ transport: { type: 'http', url: 'https://api.perplexity.ai/mcp' },
302
+ auth: {
303
+ type: 'credentials',
304
+ fields: [{
305
+ key: 'PERPLEXITY_API_KEY',
306
+ label: 'API key',
307
+ labelZh: 'API 密钥',
308
+ secret: true,
309
+ required: true,
310
+ helpUrl: 'https://www.perplexity.ai/settings/api',
311
+ }],
312
+ },
313
+ iconSlug: 'perplexity',
314
+ },
315
+ ];
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Skill repository catalog — single source of truth for what the Dashboard
3
+ * shows under Extensions → Skills.
4
+ *
5
+ * ─── How this plugs into the rest of the stack ───────────────────────────────
6
+ *
7
+ * Dashboard → GET /api/extensions/skills/catalog
8
+ * → dashboard/routes/extensions.ts
9
+ * → agent/mcp/registry.ts (types + re-exports this array)
10
+ * → agent/skills.ts (locally-installed discovery)
11
+ * → agent/skill-installer.ts (`npx skills add …` runner)
12
+ * ← src/catalog/skill-repos.ts ← YOU ARE HERE
13
+ *
14
+ * ─── Curation policy ─────────────────────────────────────────────────────────
15
+ *
16
+ * Every entry below is a real, public GitHub repo. Authority signal is GitHub
17
+ * stars — the dashboard fetches `stars` / `pushedAt` at load time and sorts the
18
+ * cards by star count, so "more popular = appears higher". Don't add fictional
19
+ * placeholder entries; if a repo isn't real and starred, users hit a 404 the
20
+ * moment they click Install.
21
+ *
22
+ * ─── How to add a skill pack ─────────────────────────────────────────────────
23
+ *
24
+ * Append a `RecommendedSkillRepo` entry with `source` set to an `owner/repo`
25
+ * GitHub slug (or full URL). The install flow runs `npx skills add <source>`
26
+ * and drops the skill into `~/.pikiloop/skills/` for global installs, or
27
+ * `<workdir>/.pikiloop/skills/` for project installs.
28
+ */
29
+ export const SKILL_REPOS = [
30
+ // ── Official / first-party ────────────────────────────────────────────────
31
+ {
32
+ id: 'anthropics-skills',
33
+ name: 'Anthropic Skills',
34
+ description: 'Official skill collection from Anthropic',
35
+ descriptionZh: 'Anthropic 官方技能集',
36
+ source: 'anthropics/skills',
37
+ category: 'general',
38
+ recommendedScope: 'global',
39
+ homepage: 'https://github.com/anthropics/skills',
40
+ },
41
+ {
42
+ id: 'vercel-agent-skills',
43
+ name: 'Vercel Agent Skills',
44
+ description: 'Next.js, deployment, and TypeScript workflows',
45
+ descriptionZh: 'Next.js、部署、TypeScript 工作流',
46
+ source: 'vercel-labs/agent-skills',
47
+ category: 'dev',
48
+ recommendedScope: 'both',
49
+ homepage: 'https://github.com/vercel-labs/agent-skills',
50
+ },
51
+ // ── High-signal community collections (awesome-lists / megapacks) ─────────
52
+ {
53
+ id: 'obra-superpowers',
54
+ name: 'Obra Superpowers',
55
+ description: 'Opinionated productivity skills — focus, writing, research',
56
+ descriptionZh: '精选生产力技能 — 专注、写作、调研',
57
+ source: 'obra/superpowers',
58
+ category: 'productivity',
59
+ recommendedScope: 'global',
60
+ homepage: 'https://github.com/obra/superpowers',
61
+ },
62
+ {
63
+ id: 'antigravity-awesome-skills',
64
+ name: 'Antigravity Awesome Skills',
65
+ description: 'Installable library of 1,400+ agentic skills',
66
+ descriptionZh: '可安装的 1,400+ 智能体技能合集',
67
+ source: 'sickn33/antigravity-awesome-skills',
68
+ category: 'general',
69
+ recommendedScope: 'global',
70
+ homepage: 'https://github.com/sickn33/antigravity-awesome-skills',
71
+ },
72
+ {
73
+ id: 'wshobson-agents',
74
+ name: 'wshobson Agents',
75
+ description: 'Multi-agent orchestration and automation for Claude Code',
76
+ descriptionZh: 'Claude Code 的多智能体编排与自动化',
77
+ source: 'wshobson/agents',
78
+ category: 'dev',
79
+ recommendedScope: 'global',
80
+ homepage: 'https://github.com/wshobson/agents',
81
+ },
82
+ {
83
+ id: 'voltagent-awesome',
84
+ name: 'Awesome Agent Skills',
85
+ description: 'Curated 1,000+ agent skills from official teams and community',
86
+ descriptionZh: '官方与社区的 1000+ 智能体技能精选合集',
87
+ source: 'VoltAgent/awesome-agent-skills',
88
+ category: 'general',
89
+ recommendedScope: 'global',
90
+ homepage: 'https://github.com/VoltAgent/awesome-agent-skills',
91
+ },
92
+ {
93
+ id: 'alirezarezvani-claude-skills',
94
+ name: 'Claude Skills 232+',
95
+ description: '232+ Claude Code skills & plugins for Claude/Codex/Gemini',
96
+ descriptionZh: '232+ Claude Code 技能与插件,覆盖 Claude/Codex/Gemini',
97
+ source: 'alirezarezvani/claude-skills',
98
+ category: 'general',
99
+ recommendedScope: 'global',
100
+ homepage: 'https://github.com/alirezarezvani/claude-skills',
101
+ },
102
+ // ── Domain-specific high-quality skills ───────────────────────────────────
103
+ {
104
+ id: 'planning-with-files',
105
+ name: 'Planning with Files',
106
+ description: 'Manus-style persistent markdown planning workflow',
107
+ descriptionZh: 'Manus 风格的 Markdown 持久化规划工作流',
108
+ source: 'OthmanAdi/planning-with-files',
109
+ category: 'productivity',
110
+ recommendedScope: 'both',
111
+ homepage: 'https://github.com/OthmanAdi/planning-with-files',
112
+ },
113
+ {
114
+ id: 'scientific-agent-skills',
115
+ name: 'Scientific Agent Skills',
116
+ description: 'Research, science, engineering, and analysis skills',
117
+ descriptionZh: '科研、工程、分析方向的智能体技能集',
118
+ source: 'K-Dense-AI/scientific-agent-skills',
119
+ category: 'productivity',
120
+ recommendedScope: 'global',
121
+ homepage: 'https://github.com/K-Dense-AI/scientific-agent-skills',
122
+ },
123
+ {
124
+ id: 'frontend-slides',
125
+ name: 'Frontend Slides',
126
+ description: 'Generate beautiful web-based slides with frontend skills',
127
+ descriptionZh: '用前端技能生成精美的网页幻灯片',
128
+ source: 'zarazhangrui/frontend-slides',
129
+ category: 'productivity',
130
+ recommendedScope: 'both',
131
+ homepage: 'https://github.com/zarazhangrui/frontend-slides',
132
+ },
133
+ {
134
+ id: 'design-extract',
135
+ name: 'Design Extract',
136
+ description: 'Extract a website\'s complete design system in one command',
137
+ descriptionZh: '一条命令提取任意网站的完整设计系统',
138
+ source: 'Manavarya09/design-extract',
139
+ category: 'dev',
140
+ recommendedScope: 'both',
141
+ homepage: 'https://github.com/Manavarya09/design-extract',
142
+ },
143
+ {
144
+ id: 'opencli',
145
+ name: 'OpenCLI',
146
+ description: 'Universal CLI hub turning 100+ websites and local binaries into agent-callable commands (requires global `opencli` CLI + Chrome bridge extension)',
147
+ descriptionZh: '通用 CLI Hub,把 100+ 网站和本地二进制变成可调用命令(依赖全局 opencli CLI 与 Chrome 桥接扩展)',
148
+ source: 'jackwener/opencli',
149
+ category: 'dev',
150
+ recommendedScope: 'global',
151
+ homepage: 'https://github.com/jackwener/opencli',
152
+ },
153
+ {
154
+ id: 'rocketsim-skills',
155
+ name: 'RocketSim',
156
+ description: '30+ tools for Xcode iOS Simulator — testing, debugging',
157
+ descriptionZh: 'Xcode iOS 模拟器的 30+ 工具:测试、调试、网络',
158
+ source: 'AvdLee/RocketSimApp',
159
+ category: 'dev',
160
+ recommendedScope: 'both',
161
+ homepage: 'https://github.com/AvdLee/RocketSimApp',
162
+ },
163
+ {
164
+ id: 'nopua',
165
+ name: 'Nopua',
166
+ description: 'A skill that unlocks AI potential through respect and care',
167
+ descriptionZh: '用爱解放 AI 潜能的技能 — 尊重、关怀',
168
+ source: 'wuji-labs/nopua',
169
+ category: 'productivity',
170
+ recommendedScope: 'global',
171
+ homepage: 'https://github.com/wuji-labs/nopua',
172
+ },
173
+ ];
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Channel base — minimal abstract for all IM platforms.
3
+ *
4
+ * Only defines: lifecycle + outgoing primitives.
5
+ * Hooks (onCommand, onMessage, onCallback, ...) are platform-specific
6
+ * and belong in each subclass — different IMs expose different interaction models.
7
+ */
8
+ export const DEFAULT_CHANNEL_CAPABILITIES = Object.freeze({
9
+ editMessages: false,
10
+ typingIndicators: false,
11
+ commandMenu: false,
12
+ messageReactions: false,
13
+ sendImage: false,
14
+ });
15
+ export class Channel {
16
+ bot = null;
17
+ capabilities = DEFAULT_CHANNEL_CAPABILITIES;
18
+ /**
19
+ * Send an image given in-memory bytes. Default implementation throws — only
20
+ * channels whose `capabilities.sendImage` is true must override. The bot
21
+ * uses `supportsChannelCapability(ch, 'sendImage')` to gate dispatch.
22
+ *
23
+ * `mime` is the explicit MIME type (e.g. `image/png`) so subclasses can pick
24
+ * the right native upload primitive (Telegram sendPhoto vs sendDocument;
25
+ * Feishu uploadImage `image_type=message`; WeChat image message vs file).
26
+ */
27
+ async sendImage(_chatId, _bytes, _opts) {
28
+ throw new Error(`${this.constructor.name} does not implement sendImage`);
29
+ }
30
+ async setMenu(_commands) { }
31
+ async clearMenu() { }
32
+ }
33
+ // ---------------------------------------------------------------------------
34
+ // Shared helpers
35
+ // ---------------------------------------------------------------------------
36
+ export function supportsChannelCapability(channel, capability) {
37
+ return channel?.capabilities?.[capability] ?? false;
38
+ }
39
+ export function splitText(text, max) {
40
+ if (text.length <= max)
41
+ return [text];
42
+ const chunks = [];
43
+ let rest = text;
44
+ while (rest.length > max) {
45
+ let cut = rest.lastIndexOf('\n', max);
46
+ if (cut < max * 0.3)
47
+ cut = max;
48
+ chunks.push(rest.slice(0, cut));
49
+ rest = rest.slice(cut);
50
+ }
51
+ if (rest)
52
+ chunks.push(rest);
53
+ return chunks;
54
+ }
55
+ export function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }