@yee94/opencode-profile 0.2.0 → 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 +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ V2,在 `opencode.jsonc` 中加入:
|
|
|
12
12
|
|
|
13
13
|
```jsonc
|
|
14
14
|
{
|
|
15
|
-
"plugins": ["@yee94/opencode-profile@0.2.
|
|
15
|
+
"plugins": ["@yee94/opencode-profile@0.2.1"]
|
|
16
16
|
}
|
|
17
17
|
```
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ V1 使用同一个包,配置键是单数 `plugin`:
|
|
|
20
20
|
|
|
21
21
|
```jsonc
|
|
22
22
|
{
|
|
23
|
-
"plugin": ["@yee94/opencode-profile@0.2.
|
|
23
|
+
"plugin": ["@yee94/opencode-profile@0.2.1"]
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -61,7 +61,7 @@ V1 将 `agents` 改为 `agent`。V2 的 variant 写在模型后,如 `provider/
|
|
|
61
61
|
```jsonc
|
|
62
62
|
{
|
|
63
63
|
"plugins": [{
|
|
64
|
-
"package": "@yee94/opencode-profile@0.2.
|
|
64
|
+
"package": "@yee94/opencode-profile@0.2.1",
|
|
65
65
|
"options": { "agents": { "oracle": false } }
|
|
66
66
|
}]
|
|
67
67
|
}
|
|
@@ -72,7 +72,7 @@ V1 的插件选项使用元组:
|
|
|
72
72
|
```jsonc
|
|
73
73
|
{
|
|
74
74
|
"plugin": [[
|
|
75
|
-
"@yee94/opencode-profile@0.2.
|
|
75
|
+
"@yee94/opencode-profile@0.2.1",
|
|
76
76
|
{ "agents": { "oracle": false } }
|
|
77
77
|
]]
|
|
78
78
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ function parseOptions(input) {
|
|
|
20
20
|
const result = optionsSchema.safeParse(input ?? {});
|
|
21
21
|
if (!result.success) {
|
|
22
22
|
const problems = result.error.issues.map((issue) => `${issue.path.join(".") || "options"}: ${issue.message}`);
|
|
23
|
-
throw new Error(`Invalid opencode-
|
|
23
|
+
throw new Error(`Invalid @yee94/opencode-profile options:\n${problems.join("\n")}`);
|
|
24
24
|
}
|
|
25
25
|
return result.data;
|
|
26
26
|
}
|
|
@@ -108,7 +108,7 @@ function readOnlyPermissions() {
|
|
|
108
108
|
//#region src/register.ts
|
|
109
109
|
function registerAgents(editor, options) {
|
|
110
110
|
const build = editor.get("build");
|
|
111
|
-
if (!build || build.hidden || build.mode === "subagent") throw new Error("opencode-
|
|
111
|
+
if (!build || build.hidden || build.mode === "subagent") throw new Error("@yee94/opencode-profile requires the native, visible Build primary agent. Enable Build before loading this plugin.");
|
|
112
112
|
editor.default("build");
|
|
113
113
|
for (const name of agentNames) {
|
|
114
114
|
const settings = options.agents[name];
|
|
@@ -157,7 +157,7 @@ function permissions(agent, readonly) {
|
|
|
157
157
|
}
|
|
158
158
|
function registerV1Agents(config, options) {
|
|
159
159
|
const build = config.agent?.build;
|
|
160
|
-
if (build?.disable || build?.hidden || build?.mode === "subagent") throw new Error("opencode-
|
|
160
|
+
if (build?.disable || build?.hidden || build?.mode === "subagent") throw new Error("@yee94/opencode-profile requires the native, visible Build primary agent. Enable Build before loading this plugin.");
|
|
161
161
|
config.default_agent = "build";
|
|
162
162
|
config.agent ??= {};
|
|
163
163
|
for (const name of agentNames) {
|
|
@@ -198,7 +198,7 @@ const v1Server = async (_context, input) => {
|
|
|
198
198
|
//#region src/index.ts
|
|
199
199
|
var src_default = {
|
|
200
200
|
...Plugin.define({
|
|
201
|
-
id: "opencode-
|
|
201
|
+
id: "@yee94/opencode-profile",
|
|
202
202
|
async setup(context) {
|
|
203
203
|
const options = parseOptions(context.options);
|
|
204
204
|
await context.agent.transform((editor) => registerAgents(editor, options));
|