@opensoftware/harness-opencode 0.1.0 → 0.2.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.
- package/README.md +1 -0
- package/dist/cli.js +7 -5
- package/dist/cli.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -77,6 +77,7 @@ builds the package and publishes it to npm as `@opensoftware/harness-opencode`.
|
|
|
77
77
|
| `OPENAI_BASE_URL` | string | `"https://api.openai.com/v1"` | Base URL of the OpenAI-compatible chat completions API that opencode calls, ending in /v1, for example the inference gateway. |
|
|
78
78
|
| `OPENAI_API_KEY` | string | | The key opencode sends to the model API, for example a gateway key or a placeholder that the egress proxy replaces. |
|
|
79
79
|
| `OPENAI_MODEL` | string | | The model opencode asks for, for example gpt-5.5. Required. |
|
|
80
|
+
| `OSF_EFFORT` | string | | The effort level of the session's model, set by the launcher (ADR 0078). The adapter sets it as the reasoningEffort option of the gateway's model. Default: none, the model's own default. |
|
|
80
81
|
|
|
81
82
|
## Scenarios
|
|
82
83
|
|
package/dist/cli.js
CHANGED
|
@@ -23,10 +23,11 @@ const PERMISSION = {
|
|
|
23
23
|
websearch: "deny",
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
* opencode's configuration: the one provider "osf" for the gateway, the
|
|
27
|
-
* win over a folder's `.opencode/` settings, and no
|
|
26
|
+
* opencode's configuration: the one provider "osf" for the gateway, its model at the port's effort level when one is
|
|
27
|
+
* set (ADR 0078), the permissions for every built-in agent, which win over a folder's `.opencode/` settings, and no
|
|
28
|
+
* title call, update or share.
|
|
28
29
|
*/
|
|
29
|
-
const configOf = (model, baseURL) => ({
|
|
30
|
+
const configOf = (model, baseURL, effort) => ({
|
|
30
31
|
model: `osf/${model}`,
|
|
31
32
|
small_model: `osf/${model}`,
|
|
32
33
|
autoupdate: false,
|
|
@@ -36,7 +37,8 @@ const configOf = (model, baseURL) => ({
|
|
|
36
37
|
npm: "@ai-sdk/openai-compatible",
|
|
37
38
|
name: "gateway",
|
|
38
39
|
options: { baseURL, apiKey: "{env:OPENAI_API_KEY}" },
|
|
39
|
-
|
|
40
|
+
// JSON leaves out an undefined effort, so the model keeps its own default.
|
|
41
|
+
models: { [model]: { name: model, options: { reasoningEffort: effort } } },
|
|
40
42
|
},
|
|
41
43
|
},
|
|
42
44
|
permission: PERMISSION,
|
|
@@ -67,7 +69,7 @@ const code = await runAdapter({
|
|
|
67
69
|
env: {
|
|
68
70
|
...xdg,
|
|
69
71
|
...off,
|
|
70
|
-
OPENCODE_CONFIG_CONTENT: JSON.stringify(configOf(model, base)),
|
|
72
|
+
OPENCODE_CONFIG_CONTENT: JSON.stringify(configOf(model, base, process.env.OSF_EFFORT)),
|
|
71
73
|
// opencode installs its plugin package into each config folder with npm; offline, with a cache of its own,
|
|
72
74
|
// that install finds nothing and calls no registry.
|
|
73
75
|
npm_config_offline: "true",
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,kGAAkG;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,KAAK,GAAG;;;CAGb,CAAC;AAEF,+FAA+F;AAC/F,SAAS,MAAM;IACb,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC7E,MAAM,YAAY,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC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E,MAAM,EAAE;YACjB,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;YACvB,GAAG,EAAE;gBACH,GAAG,GAAG;gBACN,GAAG,GAAG;gBACN,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBACtF,2GAA2G;gBAC3G,oDAAoD;gBACpD,kBAAkB,EAAE,MAAM;gBAC1B,gBAAgB,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;aACpC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AACH,mCAAmC;AACnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensoftware/harness-opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "harness-opencode: runs opencode behind the harness port through its own ACP server, asking before each edit and command, with a tool allowlist, cancel within 5 seconds and a run record with tokens.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@opensoftware/contracts": "
|
|
23
|
-
"@opensoftware/testkit": "0.
|
|
22
|
+
"@opensoftware/contracts": "2.0.0",
|
|
23
|
+
"@opensoftware/testkit": "0.28.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"opencode-ai": "1.19.4",
|