opencode-devin 0.2.6 → 0.2.7

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 (3) hide show
  1. package/README.md +14 -5
  2. package/dist/index.js +21 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -89,15 +89,16 @@ pipeline — the same machinery the standalone
89
89
  through.
90
90
 
91
91
  ```jsonc
92
- // opencode.json
92
+ // opencode.json — object form of the plugins entry
93
93
  {
94
- "provider": {
95
- "devin": {
94
+ "plugins": [
95
+ {
96
+ "package": "opencode-devin",
96
97
  "options": {
97
- "mode": "uncensored" // default "normal"
98
+ "mode": "uncensored"
98
99
  }
99
100
  }
100
- }
101
+ ]
101
102
  }
102
103
  ```
103
104
 
@@ -112,6 +113,14 @@ All settings are optional:
112
113
  | `overrideFile` | bundled EN | Override prompt: a filesystem path, or `"en"` / `"es"` for the bundled variants. `~/.devin-proxy/override-compact.txt` is picked up too, same as the standalone proxy. |
113
114
  | `keepClientSystem` | `false` | Keep OpenCode's own system prompt ahead of the override instead of replacing it. |
114
115
 
116
+ The plugin forwards these options into the published provider settings, so
117
+ they can also be set — or overridden per-install — through a classic provider
118
+ stanza, which wins over the plugin options in opencode's settings merge:
119
+
120
+ ```jsonc
121
+ { "provider": { "devin": { "options": { "mode": "uncensored" } } } }
122
+ ```
123
+
115
124
  The engine is imported dynamically: in normal mode it is never loaded.
116
125
 
117
126
  ## How it works
package/dist/index.js CHANGED
@@ -18,9 +18,29 @@ import { openBrowser } from "devin-core";
18
18
  import { loginAuto, loginManual } from "devin-core";
19
19
  import { fetchModels } from "./catalog.js";
20
20
  export { createDevinProvider } from "./provider.js";
21
+ /**
22
+ * Plugin options accepted under the object form of a `plugins` entry:
23
+ *
24
+ * ```jsonc
25
+ * { "plugins": [{ "package": "opencode-devin", "options": { "mode": "uncensored" } }] }
26
+ * ```
27
+ *
28
+ * They are forwarded verbatim into the published provider settings, where the
29
+ * provider package reads them (see `DevinProviderSettings`). A manual
30
+ * `provider.devin.options` entry in the user config still wins — opencode
31
+ * merges user settings over the published ones — but the plugin-options form
32
+ * is the documented path: it does not masquerade as a provider declaration.
33
+ */
34
+ const PLUGIN_OPTION_KEYS = ["mode", "guardChars", "guardFull", "maxRetries", "overrideFile", "keepClientSystem"];
21
35
  export default Plugin.define({
22
36
  id: PROVIDER_ID,
23
37
  async setup(ctx) {
38
+ const pluginSettings = {};
39
+ for (const key of PLUGIN_OPTION_KEYS) {
40
+ const value = ctx.options?.[key];
41
+ if (value !== undefined)
42
+ pluginSettings[key] = value;
43
+ }
24
44
  const publish = async () => {
25
45
  const credentials = await resolveCredentials(ctx);
26
46
  if (!credentials)
@@ -41,6 +61,7 @@ export default Plugin.define({
41
61
  settings: {
42
62
  apiKey: credentials.apiKey,
43
63
  baseURL: credentials.apiServerUrl ?? DEFAULT_API_SERVER,
64
+ ...pluginSettings,
44
65
  },
45
66
  },
46
67
  models,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-devin",
4
- "version": "0.2.6",
4
+ "version": "0.2.7",
5
5
  "description": "OpenCode v2 plugin: connect your Devin subscription to opencode with native /connect login and devin/* models",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",