newtype-profile 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -59
- package/README.zh-cn.md +43 -58
- package/dist/cli/index.js +26 -3
- package/dist/config/schema.d.ts +16 -1
- package/dist/index.js +103 -6
- package/dist/mcp/filesystem.d.ts +3 -0
- package/dist/mcp/firecrawl.d.ts +3 -0
- package/dist/mcp/index.d.ts +6 -2
- package/dist/mcp/sequential-thinking.d.ts +2 -0
- package/dist/mcp/tavily.d.ts +9 -0
- package/dist/mcp/types.d.ts +31 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,22 +48,9 @@ newtype-profile is an AI Agent collaboration framework designed for **content cr
|
|
|
48
48
|
1. Install [OpenCode](https://opencode.ai/docs)
|
|
49
49
|
2. Install [Bun](https://bun.sh/) (only needed for local development)
|
|
50
50
|
|
|
51
|
-
### Installation
|
|
51
|
+
### Installation
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
#### Configuration Hierarchy
|
|
56
|
-
|
|
57
|
-
| Level | Path | Priority |
|
|
58
|
-
|-------|------|----------|
|
|
59
|
-
| **User-level** | `~/.config/opencode/opencode.json` | Lower |
|
|
60
|
-
| **Project-level** | `<project>/.opencode/opencode.json` | Higher (overrides user-level) |
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
#### Method 1: User-Level Configuration (Global)
|
|
65
|
-
|
|
66
|
-
Use this if you want newtype-profile as your default plugin for all projects.
|
|
53
|
+
#### Method 1: npm Package (Recommended)
|
|
67
54
|
|
|
68
55
|
Edit `~/.config/opencode/opencode.json`:
|
|
69
56
|
|
|
@@ -75,50 +62,7 @@ Edit `~/.config/opencode/opencode.json`:
|
|
|
75
62
|
}
|
|
76
63
|
```
|
|
77
64
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
#### Method 2: Project-Level Configuration (Recommended)
|
|
81
|
-
|
|
82
|
-
Use this to enable newtype-profile only for specific content creation projects, while keeping oh-my-opencode as the default for coding projects.
|
|
83
|
-
|
|
84
|
-
**Step 1**: Keep oh-my-opencode as user-level default
|
|
85
|
-
|
|
86
|
-
`~/.config/opencode/opencode.json`:
|
|
87
|
-
```json
|
|
88
|
-
{
|
|
89
|
-
"plugin": [
|
|
90
|
-
"oh-my-opencode"
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**Step 2**: Enable newtype-profile for content creation projects
|
|
96
|
-
|
|
97
|
-
In your content creation project root, create `.opencode/opencode.json`:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
mkdir -p .opencode
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
`<project>/.opencode/opencode.json`:
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"plugin": [
|
|
107
|
-
"newtype-profile"
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**Result**:
|
|
113
|
-
|
|
114
|
-
| Project Type | Config Source | Plugin Used |
|
|
115
|
-
|--------------|---------------|-------------|
|
|
116
|
-
| Coding projects (no `.opencode/`) | User-level config | oh-my-opencode |
|
|
117
|
-
| Content creation projects (has `.opencode/`) | Project-level config | newtype-profile |
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
#### Method 3: Clone to Local (Development)
|
|
65
|
+
#### Method 2: Clone to Local (Development)
|
|
122
66
|
|
|
123
67
|
For development or customization:
|
|
124
68
|
|
|
@@ -260,6 +204,47 @@ Override default settings in your config file:
|
|
|
260
204
|
}
|
|
261
205
|
```
|
|
262
206
|
|
|
207
|
+
### MCP Server Configuration
|
|
208
|
+
|
|
209
|
+
The plugin includes built-in MCP (Model Context Protocol) servers. Configure them in your `oh-my-opencode.json`:
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"mcp": {
|
|
214
|
+
"tavily": {
|
|
215
|
+
"api_key": "tvly-your-api-key"
|
|
216
|
+
},
|
|
217
|
+
"firecrawl": {
|
|
218
|
+
"api_key": "fc-your-api-key"
|
|
219
|
+
},
|
|
220
|
+
"filesystem": {
|
|
221
|
+
"directories": ["~/Documents", "~/Projects"]
|
|
222
|
+
},
|
|
223
|
+
"sequential-thinking": true
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
| MCP Server | Default | Required Config | Description |
|
|
229
|
+
|------------|---------|-----------------|-------------|
|
|
230
|
+
| **websearch** (Exa) | Enabled | None | Web search via Exa.ai |
|
|
231
|
+
| **sequential-thinking** | Enabled | None | Structured problem-solving |
|
|
232
|
+
| **tavily** | Disabled | `api_key` | Advanced web search, crawl, extract |
|
|
233
|
+
| **firecrawl** | Disabled | `api_key` | Web scraping and content extraction |
|
|
234
|
+
| **filesystem** | Disabled | `directories` | Local file system access |
|
|
235
|
+
|
|
236
|
+
Get API keys:
|
|
237
|
+
- Tavily: [tavily.com](https://tavily.com)
|
|
238
|
+
- Firecrawl: [firecrawl.dev](https://firecrawl.dev)
|
|
239
|
+
|
|
240
|
+
To disable a built-in MCP:
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"disabled_mcps": ["sequential-thinking"]
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
263
248
|
## Features Inherited from oh-my-opencode
|
|
264
249
|
|
|
265
250
|
This project retains core capabilities from oh-my-opencode:
|
package/README.zh-cn.md
CHANGED
|
@@ -50,20 +50,7 @@ newtype-profile 是一套专为**内容创作**设计的 AI Agent 协作框架
|
|
|
50
50
|
|
|
51
51
|
### 部署方式
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
#### 配置层级
|
|
56
|
-
|
|
57
|
-
| 层级 | 路径 | 优先级 |
|
|
58
|
-
|------|------|--------|
|
|
59
|
-
| **用户级** | `~/.config/opencode/opencode.json` | 低 |
|
|
60
|
-
| **项目级** | `<project>/.opencode/opencode.json` | 高(覆盖用户级) |
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
#### 方式一:用户级配置(全局)
|
|
65
|
-
|
|
66
|
-
如果你希望所有项目默认使用 newtype-profile,采用此方式。
|
|
53
|
+
#### 方式一:npm 包(推荐)
|
|
67
54
|
|
|
68
55
|
编辑 `~/.config/opencode/opencode.json`:
|
|
69
56
|
|
|
@@ -75,50 +62,7 @@ OpenCode 支持**用户级**和**项目级**两种配置方式。这样你可以
|
|
|
75
62
|
}
|
|
76
63
|
```
|
|
77
64
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
#### 方式二:项目级配置(推荐)
|
|
81
|
-
|
|
82
|
-
仅为特定的内容创作项目启用 newtype-profile,代码项目仍使用 oh-my-opencode。
|
|
83
|
-
|
|
84
|
-
**步骤 1**:用户级保持 oh-my-opencode 作为默认
|
|
85
|
-
|
|
86
|
-
`~/.config/opencode/opencode.json`:
|
|
87
|
-
```json
|
|
88
|
-
{
|
|
89
|
-
"plugin": [
|
|
90
|
-
"oh-my-opencode"
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
**步骤 2**:在内容创作项目中启用 newtype-profile
|
|
96
|
-
|
|
97
|
-
在内容创作项目根目录创建 `.opencode/opencode.json`:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
mkdir -p .opencode
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
`<project>/.opencode/opencode.json`:
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"plugin": [
|
|
107
|
-
"newtype-profile"
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**效果**:
|
|
113
|
-
|
|
114
|
-
| 项目类型 | 配置来源 | 使用的插件 |
|
|
115
|
-
|----------|----------|------------|
|
|
116
|
-
| 代码项目(无 `.opencode/`) | 用户级配置 | oh-my-opencode |
|
|
117
|
-
| 内容创作项目(有 `.opencode/`) | 项目级配置 | newtype-profile |
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
#### 方式三:克隆到本地(开发用)
|
|
65
|
+
#### 方式二:克隆到本地(开发用)
|
|
122
66
|
|
|
123
67
|
用于开发或自定义:
|
|
124
68
|
|
|
@@ -260,6 +204,47 @@ opencode
|
|
|
260
204
|
}
|
|
261
205
|
```
|
|
262
206
|
|
|
207
|
+
### MCP 服务器配置
|
|
208
|
+
|
|
209
|
+
插件内置了多个 MCP (Model Context Protocol) 服务器。在 `oh-my-opencode.json` 中配置:
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"mcp": {
|
|
214
|
+
"tavily": {
|
|
215
|
+
"api_key": "tvly-your-api-key"
|
|
216
|
+
},
|
|
217
|
+
"firecrawl": {
|
|
218
|
+
"api_key": "fc-your-api-key"
|
|
219
|
+
},
|
|
220
|
+
"filesystem": {
|
|
221
|
+
"directories": ["~/Documents", "~/Projects"]
|
|
222
|
+
},
|
|
223
|
+
"sequential-thinking": true
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
| MCP 服务器 | 默认状态 | 需要配置 | 说明 |
|
|
229
|
+
|------------|----------|----------|------|
|
|
230
|
+
| **websearch** (Exa) | 已启用 | 无 | 通过 Exa.ai 进行网页搜索 |
|
|
231
|
+
| **sequential-thinking** | 已启用 | 无 | 结构化问题解决 |
|
|
232
|
+
| **tavily** | 未启用 | `api_key` | 高级网页搜索、爬取、提取 |
|
|
233
|
+
| **firecrawl** | 未启用 | `api_key` | 网页抓取和内容提取 |
|
|
234
|
+
| **filesystem** | 未启用 | `directories` | 本地文件系统访问 |
|
|
235
|
+
|
|
236
|
+
获取 API Key:
|
|
237
|
+
- Tavily: [tavily.com](https://tavily.com)
|
|
238
|
+
- Firecrawl: [firecrawl.dev](https://firecrawl.dev)
|
|
239
|
+
|
|
240
|
+
禁用内置 MCP:
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"disabled_mcps": ["sequential-thinking"]
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
263
248
|
## 继承自 oh-my-opencode 的功能
|
|
264
249
|
|
|
265
250
|
本项目保留了 oh-my-opencode 的核心能力:
|
package/dist/cli/index.js
CHANGED
|
@@ -2253,7 +2253,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2253
2253
|
var require_package = __commonJS((exports, module) => {
|
|
2254
2254
|
module.exports = {
|
|
2255
2255
|
name: "newtype-profile",
|
|
2256
|
-
version: "1.0.
|
|
2256
|
+
version: "1.0.3",
|
|
2257
2257
|
description: "AI Agent Collaboration System for Content Creation - Based on oh-my-opencode",
|
|
2258
2258
|
main: "dist/index.js",
|
|
2259
2259
|
types: "dist/index.d.ts",
|
|
@@ -22130,8 +22130,30 @@ function date4(params) {
|
|
|
22130
22130
|
// node_modules/zod/v4/classic/external.js
|
|
22131
22131
|
config(en_default());
|
|
22132
22132
|
// src/mcp/types.ts
|
|
22133
|
-
var McpNameSchema = exports_external.enum([
|
|
22133
|
+
var McpNameSchema = exports_external.enum([
|
|
22134
|
+
"websearch",
|
|
22135
|
+
"tavily",
|
|
22136
|
+
"firecrawl",
|
|
22137
|
+
"filesystem",
|
|
22138
|
+
"sequential-thinking"
|
|
22139
|
+
]);
|
|
22134
22140
|
var AnyMcpNameSchema = exports_external.string().min(1);
|
|
22141
|
+
var McpTavilyConfigSchema = exports_external.object({
|
|
22142
|
+
api_key: exports_external.string().min(1)
|
|
22143
|
+
});
|
|
22144
|
+
var McpFirecrawlConfigSchema = exports_external.object({
|
|
22145
|
+
api_key: exports_external.string().min(1),
|
|
22146
|
+
api_url: exports_external.string().url().optional()
|
|
22147
|
+
});
|
|
22148
|
+
var McpFilesystemConfigSchema = exports_external.object({
|
|
22149
|
+
directories: exports_external.array(exports_external.string()).min(1)
|
|
22150
|
+
});
|
|
22151
|
+
var McpConfigSchema = exports_external.object({
|
|
22152
|
+
tavily: McpTavilyConfigSchema.optional(),
|
|
22153
|
+
firecrawl: McpFirecrawlConfigSchema.optional(),
|
|
22154
|
+
filesystem: McpFilesystemConfigSchema.optional(),
|
|
22155
|
+
"sequential-thinking": exports_external.boolean().optional()
|
|
22156
|
+
});
|
|
22135
22157
|
|
|
22136
22158
|
// src/config/schema.ts
|
|
22137
22159
|
var PermissionValue = exports_external.enum(["ask", "allow", "deny"]);
|
|
@@ -22383,7 +22405,8 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
22383
22405
|
ralph_loop: RalphLoopConfigSchema.optional(),
|
|
22384
22406
|
background_task: BackgroundTaskConfigSchema.optional(),
|
|
22385
22407
|
notification: NotificationConfigSchema.optional(),
|
|
22386
|
-
git_master: GitMasterConfigSchema.optional()
|
|
22408
|
+
git_master: GitMasterConfigSchema.optional(),
|
|
22409
|
+
mcp: McpConfigSchema.optional()
|
|
22387
22410
|
});
|
|
22388
22411
|
// src/cli/doctor/checks/config.ts
|
|
22389
22412
|
var USER_CONFIG_DIR2 = join6(homedir5(), ".config", "opencode");
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { McpConfigSchema } from "../mcp/types";
|
|
2
3
|
export declare const BuiltinAgentNameSchema: z.ZodEnum<{
|
|
3
4
|
chief: "chief";
|
|
4
5
|
researcher: "researcher";
|
|
@@ -1380,6 +1381,19 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1380
1381
|
commit_footer: z.ZodDefault<z.ZodBoolean>;
|
|
1381
1382
|
include_co_authored_by: z.ZodDefault<z.ZodBoolean>;
|
|
1382
1383
|
}, z.core.$strip>>;
|
|
1384
|
+
mcp: z.ZodOptional<z.ZodObject<{
|
|
1385
|
+
tavily: z.ZodOptional<z.ZodObject<{
|
|
1386
|
+
api_key: z.ZodString;
|
|
1387
|
+
}, z.core.$strip>>;
|
|
1388
|
+
firecrawl: z.ZodOptional<z.ZodObject<{
|
|
1389
|
+
api_key: z.ZodString;
|
|
1390
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
1391
|
+
}, z.core.$strip>>;
|
|
1392
|
+
filesystem: z.ZodOptional<z.ZodObject<{
|
|
1393
|
+
directories: z.ZodArray<z.ZodString>;
|
|
1394
|
+
}, z.core.$strip>>;
|
|
1395
|
+
"sequential-thinking": z.ZodOptional<z.ZodBoolean>;
|
|
1396
|
+
}, z.core.$strip>>;
|
|
1383
1397
|
}, z.core.$strip>;
|
|
1384
1398
|
export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>;
|
|
1385
1399
|
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
|
|
@@ -1401,4 +1415,5 @@ export type CategoryConfig = z.infer<typeof CategoryConfigSchema>;
|
|
|
1401
1415
|
export type CategoriesConfig = z.infer<typeof CategoriesConfigSchema>;
|
|
1402
1416
|
export type BuiltinCategoryName = z.infer<typeof BuiltinCategoryNameSchema>;
|
|
1403
1417
|
export type GitMasterConfig = z.infer<typeof GitMasterConfigSchema>;
|
|
1404
|
-
export
|
|
1418
|
+
export type McpConfig = z.infer<typeof McpConfigSchema>;
|
|
1419
|
+
export { AnyMcpNameSchema, type AnyMcpName, McpNameSchema, type McpName, McpConfigSchema, type McpTavilyConfig, type McpFirecrawlConfig, type McpFilesystemConfig, } from "../mcp/types";
|
package/dist/index.js
CHANGED
|
@@ -48306,8 +48306,30 @@ import * as fs18 from "fs";
|
|
|
48306
48306
|
import * as path9 from "path";
|
|
48307
48307
|
|
|
48308
48308
|
// src/mcp/types.ts
|
|
48309
|
-
var McpNameSchema = exports_external.enum([
|
|
48309
|
+
var McpNameSchema = exports_external.enum([
|
|
48310
|
+
"websearch",
|
|
48311
|
+
"tavily",
|
|
48312
|
+
"firecrawl",
|
|
48313
|
+
"filesystem",
|
|
48314
|
+
"sequential-thinking"
|
|
48315
|
+
]);
|
|
48310
48316
|
var AnyMcpNameSchema = exports_external.string().min(1);
|
|
48317
|
+
var McpTavilyConfigSchema = exports_external.object({
|
|
48318
|
+
api_key: exports_external.string().min(1)
|
|
48319
|
+
});
|
|
48320
|
+
var McpFirecrawlConfigSchema = exports_external.object({
|
|
48321
|
+
api_key: exports_external.string().min(1),
|
|
48322
|
+
api_url: exports_external.string().url().optional()
|
|
48323
|
+
});
|
|
48324
|
+
var McpFilesystemConfigSchema = exports_external.object({
|
|
48325
|
+
directories: exports_external.array(exports_external.string()).min(1)
|
|
48326
|
+
});
|
|
48327
|
+
var McpConfigSchema = exports_external.object({
|
|
48328
|
+
tavily: McpTavilyConfigSchema.optional(),
|
|
48329
|
+
firecrawl: McpFirecrawlConfigSchema.optional(),
|
|
48330
|
+
filesystem: McpFilesystemConfigSchema.optional(),
|
|
48331
|
+
"sequential-thinking": exports_external.boolean().optional()
|
|
48332
|
+
});
|
|
48311
48333
|
|
|
48312
48334
|
// src/config/schema.ts
|
|
48313
48335
|
var PermissionValue = exports_external.enum(["ask", "allow", "deny"]);
|
|
@@ -48559,7 +48581,8 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
48559
48581
|
ralph_loop: RalphLoopConfigSchema.optional(),
|
|
48560
48582
|
background_task: BackgroundTaskConfigSchema.optional(),
|
|
48561
48583
|
notification: NotificationConfigSchema.optional(),
|
|
48562
|
-
git_master: GitMasterConfigSchema.optional()
|
|
48584
|
+
git_master: GitMasterConfigSchema.optional(),
|
|
48585
|
+
mcp: McpConfigSchema.optional()
|
|
48563
48586
|
});
|
|
48564
48587
|
// src/plugin-config.ts
|
|
48565
48588
|
function loadConfigFromPath2(configPath, ctx) {
|
|
@@ -51060,17 +51083,91 @@ var websearch = {
|
|
|
51060
51083
|
headers: process.env.EXA_API_KEY ? { "x-api-key": process.env.EXA_API_KEY } : undefined
|
|
51061
51084
|
};
|
|
51062
51085
|
|
|
51086
|
+
// src/mcp/tavily.ts
|
|
51087
|
+
function createTavilyMcp(config3) {
|
|
51088
|
+
return {
|
|
51089
|
+
type: "stdio",
|
|
51090
|
+
command: "npx",
|
|
51091
|
+
args: ["-y", "tavily-mcp@latest"],
|
|
51092
|
+
env: {
|
|
51093
|
+
TAVILY_API_KEY: config3.api_key
|
|
51094
|
+
},
|
|
51095
|
+
enabled: true
|
|
51096
|
+
};
|
|
51097
|
+
}
|
|
51098
|
+
|
|
51099
|
+
// src/mcp/firecrawl.ts
|
|
51100
|
+
function createFirecrawlMcp(config3) {
|
|
51101
|
+
const env = {
|
|
51102
|
+
FIRECRAWL_API_KEY: config3.api_key
|
|
51103
|
+
};
|
|
51104
|
+
if (config3.api_url) {
|
|
51105
|
+
env.FIRECRAWL_API_URL = config3.api_url;
|
|
51106
|
+
}
|
|
51107
|
+
return {
|
|
51108
|
+
type: "stdio",
|
|
51109
|
+
command: "npx",
|
|
51110
|
+
args: ["-y", "firecrawl-mcp"],
|
|
51111
|
+
env,
|
|
51112
|
+
enabled: true
|
|
51113
|
+
};
|
|
51114
|
+
}
|
|
51115
|
+
|
|
51116
|
+
// src/mcp/filesystem.ts
|
|
51117
|
+
import * as path10 from "path";
|
|
51118
|
+
import * as os8 from "os";
|
|
51119
|
+
function expandPath(p2) {
|
|
51120
|
+
if (p2.startsWith("~/")) {
|
|
51121
|
+
return path10.join(os8.homedir(), p2.slice(2));
|
|
51122
|
+
}
|
|
51123
|
+
return p2;
|
|
51124
|
+
}
|
|
51125
|
+
function createFilesystemMcp(config3) {
|
|
51126
|
+
const expandedDirs = config3.directories.map(expandPath);
|
|
51127
|
+
return {
|
|
51128
|
+
type: "stdio",
|
|
51129
|
+
command: "npx",
|
|
51130
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", ...expandedDirs],
|
|
51131
|
+
enabled: true
|
|
51132
|
+
};
|
|
51133
|
+
}
|
|
51134
|
+
|
|
51135
|
+
// src/mcp/sequential-thinking.ts
|
|
51136
|
+
function createSequentialThinkingMcp() {
|
|
51137
|
+
return {
|
|
51138
|
+
type: "stdio",
|
|
51139
|
+
command: "npx",
|
|
51140
|
+
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"],
|
|
51141
|
+
enabled: true
|
|
51142
|
+
};
|
|
51143
|
+
}
|
|
51144
|
+
|
|
51063
51145
|
// src/mcp/index.ts
|
|
51064
|
-
var
|
|
51146
|
+
var alwaysEnabledMcps = {
|
|
51065
51147
|
websearch
|
|
51066
51148
|
};
|
|
51067
|
-
function createBuiltinMcps(disabledMcps = []) {
|
|
51149
|
+
function createBuiltinMcps(disabledMcps = [], mcpConfig) {
|
|
51068
51150
|
const mcps = {};
|
|
51069
|
-
for (const [name, config3] of Object.entries(
|
|
51151
|
+
for (const [name, config3] of Object.entries(alwaysEnabledMcps)) {
|
|
51070
51152
|
if (!disabledMcps.includes(name)) {
|
|
51071
51153
|
mcps[name] = config3;
|
|
51072
51154
|
}
|
|
51073
51155
|
}
|
|
51156
|
+
if (!disabledMcps.includes("sequential-thinking")) {
|
|
51157
|
+
const seqThinkingConfig = mcpConfig?.["sequential-thinking"];
|
|
51158
|
+
if (seqThinkingConfig !== false) {
|
|
51159
|
+
mcps["sequential-thinking"] = createSequentialThinkingMcp();
|
|
51160
|
+
}
|
|
51161
|
+
}
|
|
51162
|
+
if (mcpConfig?.tavily && !disabledMcps.includes("tavily")) {
|
|
51163
|
+
mcps.tavily = createTavilyMcp(mcpConfig.tavily);
|
|
51164
|
+
}
|
|
51165
|
+
if (mcpConfig?.firecrawl && !disabledMcps.includes("firecrawl")) {
|
|
51166
|
+
mcps.firecrawl = createFirecrawlMcp(mcpConfig.firecrawl);
|
|
51167
|
+
}
|
|
51168
|
+
if (mcpConfig?.filesystem && !disabledMcps.includes("filesystem")) {
|
|
51169
|
+
mcps.filesystem = createFilesystemMcp(mcpConfig.filesystem);
|
|
51170
|
+
}
|
|
51074
51171
|
return mcps;
|
|
51075
51172
|
}
|
|
51076
51173
|
|
|
@@ -51197,7 +51294,7 @@ function createConfigHandler(deps) {
|
|
|
51197
51294
|
const mcpResult = pluginConfig.claude_code?.mcp ?? true ? await loadMcpConfigs() : { servers: {} };
|
|
51198
51295
|
config3.mcp = {
|
|
51199
51296
|
...config3.mcp,
|
|
51200
|
-
...createBuiltinMcps(pluginConfig.disabled_mcps),
|
|
51297
|
+
...createBuiltinMcps(pluginConfig.disabled_mcps, pluginConfig.mcp),
|
|
51201
51298
|
...mcpResult.servers,
|
|
51202
51299
|
...pluginComponents.mcpServers
|
|
51203
51300
|
};
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { type StdioMcpConfig } from "./tavily";
|
|
2
|
+
import type { McpConfig } from "./types";
|
|
3
|
+
export { McpNameSchema, type McpName, McpConfigSchema, type McpConfig } from "./types";
|
|
4
|
+
export type { StdioMcpConfig } from "./tavily";
|
|
2
5
|
type RemoteMcpConfig = {
|
|
3
6
|
type: "remote";
|
|
4
7
|
url: string;
|
|
5
8
|
enabled: boolean;
|
|
6
9
|
headers?: Record<string, string>;
|
|
7
10
|
};
|
|
8
|
-
|
|
11
|
+
type AnyMcpConfig = RemoteMcpConfig | StdioMcpConfig;
|
|
12
|
+
export declare function createBuiltinMcps(disabledMcps?: string[], mcpConfig?: McpConfig): Record<string, AnyMcpConfig>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { McpTavilyConfig } from "./types";
|
|
2
|
+
export type StdioMcpConfig = {
|
|
3
|
+
type: "stdio";
|
|
4
|
+
command: string;
|
|
5
|
+
args: string[];
|
|
6
|
+
env?: Record<string, string>;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function createTavilyMcp(config: McpTavilyConfig): StdioMcpConfig;
|
package/dist/mcp/types.d.ts
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const McpNameSchema: z.ZodEnum<{
|
|
3
3
|
websearch: "websearch";
|
|
4
|
+
tavily: "tavily";
|
|
5
|
+
firecrawl: "firecrawl";
|
|
6
|
+
filesystem: "filesystem";
|
|
7
|
+
"sequential-thinking": "sequential-thinking";
|
|
4
8
|
}>;
|
|
5
9
|
export type McpName = z.infer<typeof McpNameSchema>;
|
|
6
10
|
export declare const AnyMcpNameSchema: z.ZodString;
|
|
7
11
|
export type AnyMcpName = z.infer<typeof AnyMcpNameSchema>;
|
|
12
|
+
export declare const McpTavilyConfigSchema: z.ZodObject<{
|
|
13
|
+
api_key: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const McpFirecrawlConfigSchema: z.ZodObject<{
|
|
16
|
+
api_key: z.ZodString;
|
|
17
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const McpFilesystemConfigSchema: z.ZodObject<{
|
|
20
|
+
directories: z.ZodArray<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const McpConfigSchema: z.ZodObject<{
|
|
23
|
+
tavily: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
api_key: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
firecrawl: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
api_key: z.ZodString;
|
|
28
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
filesystem: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
directories: z.ZodArray<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
"sequential-thinking": z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type McpTavilyConfig = z.infer<typeof McpTavilyConfigSchema>;
|
|
36
|
+
export type McpFirecrawlConfig = z.infer<typeof McpFirecrawlConfigSchema>;
|
|
37
|
+
export type McpFilesystemConfig = z.infer<typeof McpFilesystemConfigSchema>;
|
|
38
|
+
export type McpConfig = z.infer<typeof McpConfigSchema>;
|