@paperclipai/adapter-opencode-local 2026.901.0-canary.13 → 2026.901.0-canary.14

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/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { AdapterModelProfileDefinition } from "@paperclipai/adapter-utils";
2
1
  export declare const type = "opencode_local";
3
2
  export declare const label = "OpenCode";
4
3
  export declare const SANDBOX_INSTALL_COMMAND: string;
@@ -8,8 +7,5 @@ export declare const models: Array<{
8
7
  id: string;
9
8
  label: string;
10
9
  }>;
11
- export declare const DEFAULT_OPENCODE_CHEAP_MODEL = "openai/gpt-5.1-codex-mini";
12
- export declare function buildOpenCodeModelProfiles(env?: NodeJS.ProcessEnv): AdapterModelProfileDefinition[];
13
- export declare const modelProfiles: AdapterModelProfileDefinition[];
14
10
  export declare const agentConfigurationDoc = "# opencode_local agent configuration\n\nAdapter: opencode_local\n\nUse when:\n- You want Paperclip to run OpenCode locally as the agent runtime\n- You want provider/model routing in OpenCode format (provider/model)\n- You want OpenCode session resume across heartbeats via --session\n\nDon't use when:\n- You need webhook-style external invocation (use openclaw_gateway or http)\n- You only need one-shot shell commands (use process)\n- OpenCode CLI is not installed on the machine\n\nCore fields:\n- cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)\n- instructionsFilePath (string, optional): absolute path to a markdown instructions file prepended to the run prompt\n- model (string, required): OpenCode model id in provider/model format (for example anthropic/claude-sonnet-4-5)\n- variant (string, optional): provider-specific reasoning/profile variant passed as --variant (for example minimal|low|medium|high|xhigh|max)\n- dangerouslySkipPermissions (boolean, optional): inject a runtime OpenCode config that allows `external_directory` access without interactive prompts; defaults to true for unattended Paperclip runs\n- promptTemplate (string, optional): run prompt template\n- command (string, optional): defaults to \"opencode\"\n- extraArgs (string[], optional): additional CLI args\n- env (object, optional): KEY=VALUE environment variables\n\nOperational fields:\n- timeoutSec (number, optional): run timeout in seconds\n- graceSec (number, optional): SIGTERM grace period in seconds\n\nNotes:\n- OpenCode supports multiple providers and models. Use `opencode models` to list available options in provider/model format.\n- Paperclip requires an explicit `model` value for `opencode_local` agents.\n- Runs are executed with: opencode run --format json ...\n- Sessions are resumed with --session when stored session cwd matches current cwd.\n- The adapter sets OPENCODE_DISABLE_PROJECT_CONFIG=true to prevent OpenCode from writing an opencode.json config file into the project working directory. Model selection is passed via the --model CLI flag instead.\n- When `dangerouslySkipPermissions` is enabled, Paperclip injects a temporary runtime config with `permission.external_directory=allow` so headless runs do not stall on approval prompts.\n";
15
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAEhF,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,eAAO,MAAM,KAAK,aAAa,CAAC;AA8BhC,eAAO,MAAM,uBAAuB,QAW9B,CAAC;AAEP,eAAO,MAAM,4BAA4B,yBAAyB,CAAC;AAEnE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAKtE;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQvD,CAAC;AAEF,eAAO,MAAM,4BAA4B,8BAA8B,CAAC;AAgBxE,wBAAgB,0BAA0B,CACxC,GAAG,GAAE,MAAM,CAAC,UAA8D,GACzE,6BAA6B,EAAE,CAajC;AAED,eAAO,MAAM,aAAa,EAAE,6BAA6B,EAAiC,CAAC;AAE3F,eAAO,MAAM,qBAAqB,2yEAyCjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,eAAO,MAAM,KAAK,aAAa,CAAC;AA8BhC,eAAO,MAAM,uBAAuB,QAW9B,CAAC;AAEP,eAAO,MAAM,4BAA4B,yBAAyB,CAAC;AAEnE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAKtE;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQvD,CAAC;AAEF,eAAO,MAAM,qBAAqB,2yEAyCjC,CAAC"}
package/dist/index.js CHANGED
@@ -56,36 +56,6 @@ export const models = [
56
56
  { id: "openai/gpt-5.1-codex-max", label: "openai/gpt-5.1-codex-max" },
57
57
  { id: "openai/gpt-5.1-codex-mini", label: "openai/gpt-5.1-codex-mini" },
58
58
  ];
59
- export const DEFAULT_OPENCODE_CHEAP_MODEL = "openai/gpt-5.1-codex-mini";
60
- // The "cheap" budget profile (used for recovery retries and other low-cost lanes).
61
- // Defaults to OpenCode's known Codex mini model, but is overridable so a deployment
62
- // routing through a gateway that does not serve that model (e.g. an EU LLM gateway)
63
- // can point the budget lane at a gateway-served model instead -- otherwise recovery
64
- // retries fail with "model not found". PAPERCLIP_OPENCODE_CHEAP_MODEL takes priority;
65
- // PAPERCLIP_OPENCODE_SMALL_MODEL (the auxiliary/title model) is reused as a sensible
66
- // fallback so a single setting covers both budget lanes. The default keeps the
67
- // upstream behaviour (with the Codex `variant: "low"`).
68
- //
69
- // This module is shared client/server code (the UI imports it for
70
- // DEFAULT_OPENCODE_LOCAL_MODEL etc.), so it must not touch the global `process`
71
- // unguarded: in the browser (Vite dev middleware serves it untransformed)
72
- // a bare `process.env` throws ReferenceError at module load and takes the whole
73
- // app down. Guard with `typeof process` and fall back to an empty env.
74
- export function buildOpenCodeModelProfiles(env = typeof process === "undefined" ? {} : process.env) {
75
- const override = (env.PAPERCLIP_OPENCODE_CHEAP_MODEL ?? env.PAPERCLIP_OPENCODE_SMALL_MODEL)?.trim();
76
- return [
77
- {
78
- key: "cheap",
79
- label: "Cheap",
80
- description: "Budget lane model for recovery retries and other low-cost tasks.",
81
- adapterConfig: override
82
- ? { model: override }
83
- : { model: DEFAULT_OPENCODE_CHEAP_MODEL, variant: "low" },
84
- source: "adapter_default",
85
- },
86
- ];
87
- }
88
- export const modelProfiles = buildOpenCodeModelProfiles();
89
59
  export const agentConfigurationDoc = `# opencode_local agent configuration
90
60
 
91
61
  Adapter: opencode_local
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC;AACrC,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC;AAEhC,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,gEAAgE;AAChE,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,0EAA0E;AAC1E,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,EAAE;AACF,6EAA6E;AAC7E,8CAA8C;AAC9C,6EAA6E;AAC7E,sDAAsD;AACtD,sEAAsE;AACtE,0EAA0E;AAC1E,2EAA2E;AAC3E,wEAAwE;AACxE,gDAAgD;AAChD,2EAA2E;AAC3E,wEAAwE;AACxE,6EAA6E;AAC7E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,uBAAuB,GAClC,mDAAmD;IACnD,iDAAiD;IACjD,gCAAgC;IAChC,iEAAiE;IACjE,6EAA6E;IAC7E,sEAAsE;IACtE,OAAO;IACP,iCAAiC;IACjC,qEAAqE;IACrE,MAAM;IACN,IAAI,CAAC;AAEP,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AAEnE,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,C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AAM;IACN,IAAI,CAAC;AAEP,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AAEnE,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,UAAU,GAAG,CAAC,IAAI,UAAU,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAyC;IAC1D,EAAE,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE,4BAA4B,EAAE;IACzE,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACjD,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACjD,EAAE,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;IAC3D,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACjD,EAAE,EAAE,EAAE,0BAA0B,EAAE,KAAK,EAAE,0BAA0B,EAAE;IACrE,EAAE,EAAE,EAAE,2BAA2B,EAAE,KAAK,EAAE,2BAA2B,EAAE;CACxE,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paperclipai/adapter-opencode-local",
3
- "version": "2026.901.0-canary.13",
3
+ "version": "2026.901.0-canary.14",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/paperclipai/paperclip",
6
6
  "bugs": {
@@ -38,7 +38,7 @@
38
38
  "skills"
39
39
  ],
40
40
  "dependencies": {
41
- "@paperclipai/adapter-utils": "2026.901.0-canary.13",
41
+ "@paperclipai/adapter-utils": "2026.901.0-canary.14",
42
42
  "picocolors": "^1.1.1"
43
43
  },
44
44
  "devDependencies": {
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
@@ -1,25 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { buildOpenCodeModelProfiles, DEFAULT_OPENCODE_CHEAP_MODEL } from "./index.js";
3
- describe("buildOpenCodeModelProfiles cheap lane", () => {
4
- it("defaults to the upstream Codex mini model with variant low", () => {
5
- const [cheap] = buildOpenCodeModelProfiles({});
6
- expect(cheap.key).toBe("cheap");
7
- expect(cheap.adapterConfig).toEqual({ model: DEFAULT_OPENCODE_CHEAP_MODEL, variant: "low" });
8
- });
9
- it("uses PAPERCLIP_OPENCODE_CHEAP_MODEL when set (no variant, gateway models may not support it)", () => {
10
- const [cheap] = buildOpenCodeModelProfiles({ PAPERCLIP_OPENCODE_CHEAP_MODEL: "anthropic/gw/m" });
11
- expect(cheap.adapterConfig).toEqual({ model: "anthropic/gw/m" });
12
- });
13
- it("falls back to PAPERCLIP_OPENCODE_SMALL_MODEL so one setting covers both budget lanes", () => {
14
- const [cheap] = buildOpenCodeModelProfiles({ PAPERCLIP_OPENCODE_SMALL_MODEL: "anthropic/gw/small" });
15
- expect(cheap.adapterConfig).toEqual({ model: "anthropic/gw/small" });
16
- });
17
- it("prefers CHEAP_MODEL over SMALL_MODEL when both are set", () => {
18
- const [cheap] = buildOpenCodeModelProfiles({
19
- PAPERCLIP_OPENCODE_CHEAP_MODEL: "anthropic/gw/cheap",
20
- PAPERCLIP_OPENCODE_SMALL_MODEL: "anthropic/gw/small",
21
- });
22
- expect(cheap.adapterConfig).toEqual({ model: "anthropic/gw/cheap" });
23
- });
24
- });
25
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAEtF,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,CAAC,KAAK,CAAC,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC;QAC/C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,4BAA4B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8FAA8F,EAAE,GAAG,EAAE;QACtG,MAAM,CAAC,KAAK,CAAC,GAAG,0BAA0B,CAAC,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,CAAC,CAAC;QACjG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC9F,MAAM,CAAC,KAAK,CAAC,GAAG,0BAA0B,CAAC,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,CAAC,CAAC;QACrG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC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