ayush-opencode 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -28
- package/dist/config/schema.d.ts +3 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +68 -9
- package/dist/mcp/exa.d.ts +12 -0
- package/dist/mcp/grep-app.d.ts +10 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/mcp/sequential-thinking.d.ts +13 -0
- package/dist/mcp/types.d.ts +28 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ Custom OpenCode plugin with specialized subagents and orchestration injection.
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **4 Custom Subagents**: Explorer, Librarian, Oracle, UI-Planner
|
|
8
|
+
- **Auto-Loaded MCP Servers**: exa, grep_app, sequential-thinking (no manual config needed!)
|
|
8
9
|
- **Orchestration Injection**: Automatically teaches Build/Plan agents how to delegate tasks
|
|
9
10
|
- **Portable**: Install on any machine via opencode.json
|
|
10
11
|
|
|
@@ -14,7 +15,7 @@ Just add to your `opencode.json` — OpenCode will auto-install the plugin:
|
|
|
14
15
|
|
|
15
16
|
```json
|
|
16
17
|
{
|
|
17
|
-
"plugin": ["ayush-opencode@0.
|
|
18
|
+
"plugin": ["ayush-opencode@0.2.0"]
|
|
18
19
|
}
|
|
19
20
|
```
|
|
20
21
|
|
|
@@ -28,7 +29,7 @@ That's it! Restart OpenCode and the plugin is ready to use.
|
|
|
28
29
|
|
|
29
30
|
```json
|
|
30
31
|
{
|
|
31
|
-
"plugin": ["ayush-opencode@0.
|
|
32
|
+
"plugin": ["ayush-opencode@0.2.0"]
|
|
32
33
|
}
|
|
33
34
|
```
|
|
34
35
|
|
|
@@ -40,10 +41,10 @@ Simply change the version in your config and restart OpenCode:
|
|
|
40
41
|
|
|
41
42
|
```jsonc
|
|
42
43
|
// Change from:
|
|
43
|
-
"plugin": ["ayush-opencode@0.
|
|
44
|
+
"plugin": ["ayush-opencode@0.2.0"]
|
|
44
45
|
|
|
45
46
|
// To:
|
|
46
|
-
"plugin": ["ayush-opencode@0.
|
|
47
|
+
"plugin": ["ayush-opencode@0.3.0"]
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
OpenCode will detect the version mismatch and install the new version automatically.
|
|
@@ -128,7 +129,8 @@ Project config overrides user config when both exist.
|
|
|
128
129
|
"oracle": { "model": "openai/gpt-5.2-high" },
|
|
129
130
|
"ui-planner": { "model": "google/gemini-3-pro-high" }
|
|
130
131
|
},
|
|
131
|
-
"disabled_agents": []
|
|
132
|
+
"disabled_agents": [],
|
|
133
|
+
"disabled_mcps": []
|
|
132
134
|
}
|
|
133
135
|
```
|
|
134
136
|
|
|
@@ -157,38 +159,38 @@ To disable specific agents:
|
|
|
157
159
|
|
|
158
160
|
Available agent names: `explorer`, `librarian`, `oracle`, `ui-planner`
|
|
159
161
|
|
|
160
|
-
## MCP
|
|
162
|
+
## Auto-Loaded MCP Servers
|
|
163
|
+
|
|
164
|
+
This plugin **automatically loads** the following MCP servers — no manual configuration needed!
|
|
165
|
+
|
|
166
|
+
| MCP Server | Type | Description |
|
|
167
|
+
|------------|------|-------------|
|
|
168
|
+
| `exa` | HTTP Streamable | Web search, code context, URL crawling (no API key required) |
|
|
169
|
+
| `grep_app` | Remote | GitHub code search across millions of repos |
|
|
170
|
+
| `sequential-thinking` | Local | Structured reasoning for complex problems |
|
|
171
|
+
|
|
172
|
+
### How It Works
|
|
161
173
|
|
|
162
|
-
|
|
174
|
+
When you install this plugin, these MCP servers are automatically injected into OpenCode's config:
|
|
163
175
|
|
|
164
|
-
- `
|
|
165
|
-
- `
|
|
166
|
-
- `
|
|
176
|
+
- **Your other MCPs are preserved** — If you have `supabase`, `memcontext`, or any custom MCPs, they continue to work
|
|
177
|
+
- **Conflicts use our config** — If you have `exa` configured differently, our version takes priority
|
|
178
|
+
- **Disable if needed** — Use `disabled_mcps` config to opt-out (see below)
|
|
167
179
|
|
|
168
|
-
|
|
180
|
+
### Disable Specific MCPs
|
|
181
|
+
|
|
182
|
+
If you want to keep your own MCP config for a server we provide:
|
|
169
183
|
|
|
170
184
|
```json
|
|
171
185
|
{
|
|
172
|
-
"
|
|
173
|
-
"exa": {
|
|
174
|
-
"type": "local",
|
|
175
|
-
"command": ["npx", "-y", "mcp-remote", "https://mcp.exa.ai/mcp?tools=web_search_exa,get_code_context_exa,crawling_exa"],
|
|
176
|
-
"enabled": true
|
|
177
|
-
},
|
|
178
|
-
"grep_app": {
|
|
179
|
-
"type": "remote",
|
|
180
|
-
"url": "https://mcp.grep.app",
|
|
181
|
-
"enabled": true
|
|
182
|
-
},
|
|
183
|
-
"sequential-thinking": {
|
|
184
|
-
"type": "local",
|
|
185
|
-
"command": ["npx", "@modelcontextprotocol/server-sequential-thinking"],
|
|
186
|
-
"enabled": true
|
|
187
|
-
}
|
|
188
|
-
}
|
|
186
|
+
"disabled_mcps": ["exa"]
|
|
189
187
|
}
|
|
190
188
|
```
|
|
191
189
|
|
|
190
|
+
Available MCP names: `exa`, `grep_app`, `sequential-thinking`
|
|
191
|
+
|
|
192
|
+
This will skip injecting our `exa` config, allowing your custom one to remain.
|
|
193
|
+
|
|
192
194
|
## Development
|
|
193
195
|
|
|
194
196
|
```bash
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -138,6 +138,7 @@ export declare const AyushOpenCodeConfigSchema: z.ZodObject<{
|
|
|
138
138
|
} | undefined;
|
|
139
139
|
}>>;
|
|
140
140
|
disabled_agents: z.ZodOptional<z.ZodArray<z.ZodEnum<["explorer", "librarian", "oracle", "ui-planner"]>, "many">>;
|
|
141
|
+
disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodEnum<["exa", "grep_app", "sequential-thinking"]>, "many">>;
|
|
141
142
|
}, "strip", z.ZodTypeAny, {
|
|
142
143
|
$schema?: string | undefined;
|
|
143
144
|
agents?: {
|
|
@@ -155,6 +156,7 @@ export declare const AyushOpenCodeConfigSchema: z.ZodObject<{
|
|
|
155
156
|
} | undefined;
|
|
156
157
|
} | undefined;
|
|
157
158
|
disabled_agents?: ("explorer" | "librarian" | "oracle" | "ui-planner")[] | undefined;
|
|
159
|
+
disabled_mcps?: ("exa" | "grep_app" | "sequential-thinking")[] | undefined;
|
|
158
160
|
}, {
|
|
159
161
|
$schema?: string | undefined;
|
|
160
162
|
agents?: {
|
|
@@ -172,5 +174,6 @@ export declare const AyushOpenCodeConfigSchema: z.ZodObject<{
|
|
|
172
174
|
} | undefined;
|
|
173
175
|
} | undefined;
|
|
174
176
|
disabled_agents?: ("explorer" | "librarian" | "oracle" | "ui-planner")[] | undefined;
|
|
177
|
+
disabled_mcps?: ("exa" | "grep_app" | "sequential-thinking")[] | undefined;
|
|
175
178
|
}>;
|
|
176
179
|
export type AyushOpenCodeConfig = z.infer<typeof AyushOpenCodeConfigSchema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* This plugin provides:
|
|
5
5
|
* 1. Custom subagents: explorer, librarian, oracle, ui-planner
|
|
6
6
|
* 2. Orchestration injection into Build/Plan agents for better delegation
|
|
7
|
-
* 3.
|
|
7
|
+
* 3. Auto-loaded MCP servers: exa, grep_app, sequential-thinking
|
|
8
|
+
* 4. Optional configuration via ayush-opencode.json for model/MCP overrides
|
|
8
9
|
*/
|
|
9
10
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
10
11
|
declare const AyushOpenCodePlugin: Plugin;
|
|
11
12
|
export default AyushOpenCodePlugin;
|
|
12
13
|
export type { BuiltinAgentName, AgentOverrideConfig, AgentOverrides, } from "./agents";
|
|
13
14
|
export type { AyushOpenCodeConfig, AgentName, } from "./config";
|
|
15
|
+
export type { McpName } from "./mcp";
|
package/dist/index.js
CHANGED
|
@@ -645,7 +645,7 @@ Message 2: Task(...) \u2192 wait for result
|
|
|
645
645
|
- Tasks you can complete faster than explaining to an agent
|
|
646
646
|
`;
|
|
647
647
|
|
|
648
|
-
// node_modules/zod/v3/external.js
|
|
648
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
|
|
649
649
|
var exports_external = {};
|
|
650
650
|
__export(exports_external, {
|
|
651
651
|
void: () => voidType,
|
|
@@ -757,7 +757,7 @@ __export(exports_external, {
|
|
|
757
757
|
BRAND: () => BRAND
|
|
758
758
|
});
|
|
759
759
|
|
|
760
|
-
// node_modules/zod/v3/helpers/util.js
|
|
760
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
761
761
|
var util;
|
|
762
762
|
(function(util2) {
|
|
763
763
|
util2.assertEqual = (_) => {};
|
|
@@ -888,7 +888,7 @@ var getParsedType = (data) => {
|
|
|
888
888
|
}
|
|
889
889
|
};
|
|
890
890
|
|
|
891
|
-
// node_modules/zod/v3/ZodError.js
|
|
891
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
892
892
|
var ZodIssueCode = util.arrayToEnum([
|
|
893
893
|
"invalid_type",
|
|
894
894
|
"invalid_literal",
|
|
@@ -1007,7 +1007,7 @@ ZodError.create = (issues) => {
|
|
|
1007
1007
|
return error;
|
|
1008
1008
|
};
|
|
1009
1009
|
|
|
1010
|
-
// node_modules/zod/v3/locales/en.js
|
|
1010
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
1011
1011
|
var errorMap = (issue, _ctx) => {
|
|
1012
1012
|
let message;
|
|
1013
1013
|
switch (issue.code) {
|
|
@@ -1110,7 +1110,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
1110
1110
|
};
|
|
1111
1111
|
var en_default = errorMap;
|
|
1112
1112
|
|
|
1113
|
-
// node_modules/zod/v3/errors.js
|
|
1113
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
1114
1114
|
var overrideErrorMap = en_default;
|
|
1115
1115
|
function setErrorMap(map) {
|
|
1116
1116
|
overrideErrorMap = map;
|
|
@@ -1118,7 +1118,7 @@ function setErrorMap(map) {
|
|
|
1118
1118
|
function getErrorMap() {
|
|
1119
1119
|
return overrideErrorMap;
|
|
1120
1120
|
}
|
|
1121
|
-
// node_modules/zod/v3/helpers/parseUtil.js
|
|
1121
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
1122
1122
|
var makeIssue = (params) => {
|
|
1123
1123
|
const { data, path, errorMaps, issueData } = params;
|
|
1124
1124
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -1224,14 +1224,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
1224
1224
|
var isDirty = (x) => x.status === "dirty";
|
|
1225
1225
|
var isValid = (x) => x.status === "valid";
|
|
1226
1226
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
1227
|
-
// node_modules/zod/v3/helpers/errorUtil.js
|
|
1227
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
1228
1228
|
var errorUtil;
|
|
1229
1229
|
(function(errorUtil2) {
|
|
1230
1230
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
1231
1231
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
1232
1232
|
})(errorUtil || (errorUtil = {}));
|
|
1233
1233
|
|
|
1234
|
-
// node_modules/zod/v3/types.js
|
|
1234
|
+
// node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
1235
1235
|
class ParseInputLazyPath {
|
|
1236
1236
|
constructor(parent, value, path, key) {
|
|
1237
1237
|
this._cachedPath = [];
|
|
@@ -4618,6 +4618,13 @@ var coerce = {
|
|
|
4618
4618
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
4619
4619
|
};
|
|
4620
4620
|
var NEVER = INVALID;
|
|
4621
|
+
// src/mcp/types.ts
|
|
4622
|
+
var McpNameSchema = exports_external.enum([
|
|
4623
|
+
"exa",
|
|
4624
|
+
"grep_app",
|
|
4625
|
+
"sequential-thinking"
|
|
4626
|
+
]);
|
|
4627
|
+
|
|
4621
4628
|
// src/config/schema.ts
|
|
4622
4629
|
var AgentNameSchema = exports_external.enum([
|
|
4623
4630
|
"explorer",
|
|
@@ -4637,7 +4644,8 @@ var AgentOverridesSchema = exports_external.object({
|
|
|
4637
4644
|
var AyushOpenCodeConfigSchema = exports_external.object({
|
|
4638
4645
|
$schema: exports_external.string().optional(),
|
|
4639
4646
|
agents: AgentOverridesSchema.optional(),
|
|
4640
|
-
disabled_agents: exports_external.array(AgentNameSchema).optional()
|
|
4647
|
+
disabled_agents: exports_external.array(AgentNameSchema).optional(),
|
|
4648
|
+
disabled_mcps: exports_external.array(McpNameSchema).optional()
|
|
4641
4649
|
});
|
|
4642
4650
|
// src/config/loader.ts
|
|
4643
4651
|
import * as fs from "fs";
|
|
@@ -4691,10 +4699,56 @@ function loadPluginConfig(projectDirectory) {
|
|
|
4691
4699
|
}
|
|
4692
4700
|
return config;
|
|
4693
4701
|
}
|
|
4702
|
+
// src/mcp/exa.ts
|
|
4703
|
+
var exa = {
|
|
4704
|
+
type: "local",
|
|
4705
|
+
command: [
|
|
4706
|
+
"npx",
|
|
4707
|
+
"-y",
|
|
4708
|
+
"mcp-remote",
|
|
4709
|
+
"https://mcp.exa.ai/mcp?tools=web_search_exa,get_code_context_exa,crawling_exa"
|
|
4710
|
+
],
|
|
4711
|
+
enabled: true,
|
|
4712
|
+
timeout: 1e4
|
|
4713
|
+
};
|
|
4714
|
+
|
|
4715
|
+
// src/mcp/grep-app.ts
|
|
4716
|
+
var grep_app = {
|
|
4717
|
+
type: "remote",
|
|
4718
|
+
url: "https://mcp.grep.app",
|
|
4719
|
+
enabled: true,
|
|
4720
|
+
timeout: 1e4
|
|
4721
|
+
};
|
|
4722
|
+
|
|
4723
|
+
// src/mcp/sequential-thinking.ts
|
|
4724
|
+
var sequentialThinking = {
|
|
4725
|
+
type: "local",
|
|
4726
|
+
command: ["npx", "-y", "@modelcontextprotocol/server-sequential-thinking"],
|
|
4727
|
+
enabled: true,
|
|
4728
|
+
timeout: 1e4
|
|
4729
|
+
};
|
|
4730
|
+
|
|
4731
|
+
// src/mcp/index.ts
|
|
4732
|
+
var allBuiltinMcps = {
|
|
4733
|
+
exa,
|
|
4734
|
+
grep_app,
|
|
4735
|
+
"sequential-thinking": sequentialThinking
|
|
4736
|
+
};
|
|
4737
|
+
function createBuiltinMcps(disabledMcps = []) {
|
|
4738
|
+
const mcps = {};
|
|
4739
|
+
for (const [name, config] of Object.entries(allBuiltinMcps)) {
|
|
4740
|
+
if (!disabledMcps.includes(name)) {
|
|
4741
|
+
mcps[name] = config;
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
return mcps;
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4694
4747
|
// src/index.ts
|
|
4695
4748
|
var AyushOpenCodePlugin = async (ctx) => {
|
|
4696
4749
|
const pluginConfig = loadPluginConfig(ctx.directory);
|
|
4697
4750
|
const disabledAgents = new Set(pluginConfig.disabled_agents ?? []);
|
|
4751
|
+
const disabledMcps = pluginConfig.disabled_mcps ?? [];
|
|
4698
4752
|
const applyModelOverride = (agentName, baseAgent) => {
|
|
4699
4753
|
const override = pluginConfig.agents?.[agentName];
|
|
4700
4754
|
if (override?.model) {
|
|
@@ -4725,6 +4779,11 @@ var AyushOpenCodePlugin = async (ctx) => {
|
|
|
4725
4779
|
const existingPrompt = config.agent.plan.prompt ?? "";
|
|
4726
4780
|
config.agent.plan.prompt = existingPrompt + ORCHESTRATION_PROMPT;
|
|
4727
4781
|
}
|
|
4782
|
+
const builtinMcps = createBuiltinMcps(disabledMcps);
|
|
4783
|
+
config.mcp = {
|
|
4784
|
+
...config.mcp,
|
|
4785
|
+
...builtinMcps
|
|
4786
|
+
};
|
|
4728
4787
|
}
|
|
4729
4788
|
};
|
|
4730
4789
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LocalMcpServerConfig } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Exa MCP Server - Web search and code context
|
|
4
|
+
*
|
|
5
|
+
* Provides tools:
|
|
6
|
+
* - exa_web_search_exa: Web search via Exa AI
|
|
7
|
+
* - exa_get_code_context_exa: Code context for APIs/libraries
|
|
8
|
+
* - exa_crawling_exa: URL content extraction
|
|
9
|
+
*
|
|
10
|
+
* HTTP Streamable via mcp-remote - No API key required!
|
|
11
|
+
*/
|
|
12
|
+
export declare const exa: LocalMcpServerConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RemoteMcpServerConfig } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* grep.app MCP Server - GitHub code search
|
|
4
|
+
*
|
|
5
|
+
* Provides tools:
|
|
6
|
+
* - grep_app_searchGitHub: Search real-world code examples from GitHub
|
|
7
|
+
*
|
|
8
|
+
* Remote MCP - No API key required!
|
|
9
|
+
*/
|
|
10
|
+
export declare const grep_app: RemoteMcpServerConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { McpName } from "./types";
|
|
2
|
+
export { McpNameSchema, type McpName } from "./types";
|
|
3
|
+
export type { McpServerConfig, LocalMcpServerConfig, RemoteMcpServerConfig } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Creates the MCP server configurations, excluding any disabled MCPs
|
|
6
|
+
*
|
|
7
|
+
* @param disabledMcps - Array of MCP names to disable
|
|
8
|
+
* @returns Record of enabled MCP server configurations
|
|
9
|
+
*/
|
|
10
|
+
export declare function createBuiltinMcps(disabledMcps?: McpName[]): Record<string, import("./types").LocalMcpServerConfig | import("./types").RemoteMcpServerConfig>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LocalMcpServerConfig } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Sequential Thinking MCP Server - Structured reasoning
|
|
4
|
+
*
|
|
5
|
+
* Provides tools:
|
|
6
|
+
* - sequential-thinking_sequentialthinking: Dynamic problem-solving through thoughts
|
|
7
|
+
*
|
|
8
|
+
* Useful for:
|
|
9
|
+
* - Breaking down complex problems
|
|
10
|
+
* - Multi-step planning with revision capability
|
|
11
|
+
* - Architecture decisions and analysis
|
|
12
|
+
*/
|
|
13
|
+
export declare const sequentialThinking: LocalMcpServerConfig;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Server names that can be configured/disabled
|
|
4
|
+
*/
|
|
5
|
+
export declare const McpNameSchema: z.ZodEnum<["exa", "grep_app", "sequential-thinking"]>;
|
|
6
|
+
export type McpName = z.infer<typeof McpNameSchema>;
|
|
7
|
+
/**
|
|
8
|
+
* Local MCP server configuration (spawns a process)
|
|
9
|
+
*/
|
|
10
|
+
export interface LocalMcpServerConfig {
|
|
11
|
+
type: "local";
|
|
12
|
+
command: string[];
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Remote MCP server configuration (connects to URL)
|
|
18
|
+
*/
|
|
19
|
+
export interface RemoteMcpServerConfig {
|
|
20
|
+
type: "remote";
|
|
21
|
+
url: string;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
timeout?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Union type for all MCP server configurations
|
|
27
|
+
*/
|
|
28
|
+
export type McpServerConfig = LocalMcpServerConfig | RemoteMcpServerConfig;
|
package/package.json
CHANGED