@koreanhole/opencodex 2.95.7 → 2.95.9

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.
@@ -6,11 +6,11 @@
6
6
  "files": [
7
7
  {
8
8
  "path": "bun.lock",
9
- "sha256": "a4d60237892ad287400974341fdbe82e926305b24d1c7f32a0cf1952c2849323"
9
+ "sha256": "09c7bbe9dc3bf8baf2864b58623fa0b83d3d04d36b88e5d184dbbcb0ee786f98"
10
10
  },
11
11
  {
12
12
  "path": "package.json",
13
- "sha256": "8ecbf498d8a269479c9b4615c49e16304c65e0c97ead951aea8d3cb6e96c9c54"
13
+ "sha256": "a723f45df8d85b0d092b883a2dc688ea438d0328c42f2d20c10237e97efa5b3d"
14
14
  },
15
15
  {
16
16
  "path": "scripts/model-metadata.source.json",
@@ -120,17 +120,29 @@
120
120
  "path": "src/adapters/claude-cli/usage-admission.ts",
121
121
  "sha256": "3f92b6ce1be7f10c357c194d313052963b5fa4cd842595fe3267654184cd8a31"
122
122
  },
123
+ {
124
+ "path": "src/adapters/cli-agent/cline/acp.ts",
125
+ "sha256": "82e071c941aa45efc4fd61fe1b765ac9cf1167f4784b16f61457fd891ac9e41c"
126
+ },
123
127
  {
124
128
  "path": "src/adapters/cli-agent/cline/adapter.ts",
125
- "sha256": "c5aaf47ef190c43f0ac7bd6479b7ef98fdc3ede5e4be162e213bb7f13357700d"
129
+ "sha256": "3d3a1121059b7e1c4efca8fc113a9f7cc17c417b4a8946fbb94763de0aa9ddcd"
130
+ },
131
+ {
132
+ "path": "src/adapters/cli-agent/cline/binary.ts",
133
+ "sha256": "ddd73654346314cdedf2945901f56be97bbdf1f8bc6fd558ddb6885e6254debc"
134
+ },
135
+ {
136
+ "path": "src/adapters/cli-agent/cline/live-models.ts",
137
+ "sha256": "e8d48c1ab19de149dd8060b6eb3073dad625ae5c258e9e28ee03e6f1a8244b83"
126
138
  },
127
139
  {
128
140
  "path": "src/adapters/cli-agent/cline/settings.ts",
129
- "sha256": "8c0fed2a6738515f7935d851277962722be01906631267d29f355a5ecbef196f"
141
+ "sha256": "51b5298e54aee0b254fb688c9cfc619f88587f8fba769855334d2c4bf695253b"
130
142
  },
131
143
  {
132
144
  "path": "src/adapters/cli-agent/cline/stream.ts",
133
- "sha256": "b8a92b460817f3b2c8ee29e6306cec92d6bf2129d4281a6044868433a4419e30"
145
+ "sha256": "16b05de07ffdec6c315cc35e09e9b4b5eb2f5cb1c9d1d3d39e5b17f396b761c9"
134
146
  },
135
147
  {
136
148
  "path": "src/adapters/cli-agent/gemini/adapter.ts",
@@ -1650,7 +1662,7 @@
1650
1662
  },
1651
1663
  {
1652
1664
  "path": "src/cli/dispatch.ts",
1653
- "sha256": "def180199b8c16faf88c295ba36cc1a06d2a8560e1344daa64baea3633d6c2ad"
1665
+ "sha256": "071a0f20cb2c70a294e312c5739270234906c36accae811a3bc2da57c17d4d89"
1654
1666
  },
1655
1667
  {
1656
1668
  "path": "src/cli/doctor.ts",
@@ -1922,7 +1934,7 @@
1922
1934
  },
1923
1935
  {
1924
1936
  "path": "src/cli/registry.ts",
1925
- "sha256": "4e3e9f42ff1083c6489db67e1be98c1242f165034a3d51f53a5e628b0a21f059"
1937
+ "sha256": "e0bcb8e21320139d0838a81e7c1b6bd302237219fa647d8d6d811138d88b7127"
1926
1938
  },
1927
1939
  {
1928
1940
  "path": "src/cli/remote-workspace-hub.ts",
@@ -2626,7 +2638,7 @@
2626
2638
  },
2627
2639
  {
2628
2640
  "path": "src/codex/catalog/model-hints.ts",
2629
- "sha256": "9707a32e1b6544b6014c0880443e99edbe6d96103b0314998df60a617f28dc82"
2641
+ "sha256": "7c9a178a56c10b17a31f5778c062f05250e8768922038d111951f1be1cf18df1"
2630
2642
  },
2631
2643
  {
2632
2644
  "path": "src/codex/catalog/model-visibility.ts",
@@ -2666,7 +2678,7 @@
2666
2678
  },
2667
2679
  {
2668
2680
  "path": "src/codex/catalog/provider-models.ts",
2669
- "sha256": "963f29685d97408a6e3ee52b29200efe950e073d822bd08002f81c8cc7830fb3"
2681
+ "sha256": "ce46a16111e62365fd5f00840243b1c138db9efbba508320915829cac748f32b"
2670
2682
  },
2671
2683
  {
2672
2684
  "path": "src/codex/catalog/publication-observer.ts",
@@ -5758,7 +5770,7 @@
5758
5770
  },
5759
5771
  {
5760
5772
  "path": "src/oauth/login-cli.ts",
5761
- "sha256": "2e31627198667b78bec9f8c8d2bffd773539d3ff868e5e0aaa842a6320e0811f"
5773
+ "sha256": "43d7cea3433ccda4918242f93aaadcc8f022dc1c756dd701299ef18729ae8ce1"
5762
5774
  },
5763
5775
  {
5764
5776
  "path": "src/oauth/login-flow-state.ts",
@@ -6402,7 +6414,7 @@
6402
6414
  },
6403
6415
  {
6404
6416
  "path": "src/providers/registry/entries-extended.ts",
6405
- "sha256": "c0d12982dbcd6e515d00242c1e747a020078acb94e5568d3169191fec1cd8b6c"
6417
+ "sha256": "8cfaa43bedc609b3c56ff1b0f1145b7b854b1b79b31d85f4f99f96e8a920a8c1"
6406
6418
  },
6407
6419
  {
6408
6420
  "path": "src/providers/registry/model-ids.ts",
@@ -6914,7 +6926,7 @@
6914
6926
  },
6915
6927
  {
6916
6928
  "path": "src/router.ts",
6917
- "sha256": "904cd0cd300be4efc1dd26ba5b3df886534276d7b15949f6b09842913b81fdae"
6929
+ "sha256": "62ace260aadab1aaea98310c0f9ce9a9f35b0d78e39bc8ffb0e383dcda4be998"
6918
6930
  },
6919
6931
  {
6920
6932
  "path": "src/routing/analytics.ts",
@@ -121,16 +121,22 @@ export function loginUsageMessage(): string {
121
121
  + ` Codex / ChatGPT: ocx login codex (account pool, needs a running proxy; 'chatgpt' and\n`
122
122
  + ` 'openai' are the same route. An OpenAI platform key is 'openai-apikey'.)\n`
123
123
  + ` OAuth login: ${listOAuthProviders().join(", ")}\n`
124
- + ` API-key login: ${Object.keys(KEY_LOGIN_PROVIDERS).join(", ")}`;
124
+ + ` API-key login: ${Object.keys(KEY_LOGIN_PROVIDERS).join(", ")}\n`
125
+ + ` ACP login: cline-cli`;
125
126
  }
126
127
 
127
128
  export interface LoginCliOptions {
128
129
  /** `--headless`: no callback server, no browser launch — print the URL and read back the code. */
129
130
  codeMode?: boolean;
131
+ /** `--json`: one bounded machine-readable result for the Cline ACP login. */
132
+ json?: boolean;
133
+ /** `--no-wait`: return after relaying ACP instructions without claiming completion. */
134
+ noWait?: boolean;
130
135
  }
131
136
 
132
137
  export async function handleLogin(provider?: string, deps: LoginCliDeps = {}, opts: LoginCliOptions = {}): Promise<void> {
133
138
  const name = (provider ?? "").trim().toLowerCase();
139
+ if (name === "cline-cli") return handleClineAcpLogin(opts);
134
140
  try {
135
141
  // Check raw ownership before tolerant loading can print diagnostics or fall back to defaults.
136
142
  if (name === "anthropic2") assertAnthropicInstanceLoginConfig({ providers: {} }, name);
@@ -155,6 +161,50 @@ export async function handleLogin(provider?: string, deps: LoginCliDeps = {}, op
155
161
  process.exit(1);
156
162
  }
157
163
 
164
+ async function handleClineAcpLogin(opts: LoginCliOptions): Promise<void> {
165
+ const { loginClineAcp } = await import("../adapters/cli-agent/cline/acp");
166
+ let instructions = "";
167
+ try {
168
+ const result = await loginClineAcp({
169
+ noWait: opts.noWait,
170
+ onInstruction: text => {
171
+ instructions += text;
172
+ if (!opts.json && text.trim()) console.log(text.trimEnd());
173
+ },
174
+ });
175
+ if (opts.json) {
176
+ console.log(JSON.stringify({
177
+ ok: true,
178
+ provider: "cline-cli",
179
+ methods: result.methods.map(method => ({ id: method.id, name: method.name })),
180
+ selectedMethod: result.method.id,
181
+ complete: result.complete,
182
+ instructions: result.instructions,
183
+ }));
184
+ return;
185
+ }
186
+ console.log(`\n🔐 Cline ACP auth methods: ${result.methods.map(method => `${method.name} (${method.id})`).join(", ")}`);
187
+ if (!result.complete) {
188
+ console.log(`Started ${result.method.name}; completion was not awaited. Re-run \`ocx login cline-cli\` after approving the sign-in.`);
189
+ return;
190
+ }
191
+ console.log(`\n✅ Logged in to cline-cli through ACP (${result.method.id}).`);
192
+ console.log("OpenCodex stored no Cline credential. Run: ocx sync");
193
+ } catch (error) {
194
+ const code = error && typeof error === "object" && "code" in error && typeof error.code === "string"
195
+ ? error.code
196
+ : "cline_acp_login_failed";
197
+ const message = error instanceof Error ? error.message : String(error);
198
+ if (opts.json) {
199
+ console.log(JSON.stringify({ ok: false, provider: "cline-cli", code, message, instructions }));
200
+ } else {
201
+ console.error(`\n❌ cline-cli ACP login failed (${code}): ${message}`);
202
+ if (instructions.trim()) console.error(instructions.trimEnd());
203
+ }
204
+ process.exit(1);
205
+ }
206
+ }
207
+
158
208
  /** OAuth providers that accept `ocx login <provider> --headless`. */
159
209
  export function listCodeLoginProviders(): string[] {
160
210
  return listOAuthProviders().filter(supportsCodeLoginMode);
@@ -1616,9 +1616,9 @@ export const PROVIDER_REGISTRY_EXTENDED: readonly ProviderRegistryEntry[] = [
1616
1616
  dashboardUrl: "https://docs.cline.bot/cli/getting-started",
1617
1617
  defaultModel: "default",
1618
1618
  models: ["default"],
1619
- liveModels: false,
1619
+ liveModels: true,
1620
1620
  noVisionModels: ["default"],
1621
- note: "Uses the operator's existing Cline CLI session and current provider/model. OpenCodex stores no Cline credential and never sends an API key from this row. The CLI runs headless with built-in tools, plugins, hooks, user rules, and user MCP servers disabled; request tools are captured through an isolated MCP catalog and executed only by Codex. Requires the signed-in CLI (`npm install -g cline`, then `cline auth`).",
1621
+ note: "Uses the operator's existing Cline CLI session through ACP when the installed binary advertises `--acp`, otherwise the real-HOME one-shot fallback. OpenCodex stores no Cline credential and never sends an API key from this row. Live models come from ACP session setup; `default` remains the compatibility alias. ACP denies vendor permissions and advertises only a capture-only MCP catalog, so request tools are returned to Codex for approval and execution. Requires the signed-in CLI (`npm install -g cline`, then `ocx login cline-cli`).",
1622
1622
  },
1623
1623
  {
1624
1624
  // Local Gemini CLI transport. The CLI owns Google sign-in and model choice; opencodex
package/src/router.ts CHANGED
@@ -46,6 +46,7 @@ import { getRoutingProfile, resolvePolicyProfileId, POLICY_NAMESPACE } from "./r
46
46
  import { evaluatePolicyProfile, type PolicyRequestEvidence } from "./routing/evaluator";
47
47
  import { assemblePolicyCandidateEvidence } from "./routing/compatibility/assemble";
48
48
  import { resolveModelPolicy, type ResolvedModelPolicy } from "./providers/resolved-model-policy";
49
+ import { clineBinaryFingerprintSync, resolveClineBinary } from "./adapters/cli-agent/cline/binary";
49
50
 
50
51
  /** Explicit Pool 2 admission refusal; ingress must not recover it through default routing. */
51
52
  export class AnthropicSecondaryInstanceUnavailableError extends Error {
@@ -181,6 +182,10 @@ export function knownModelIdsForProvider(
181
182
  if (provName === "workbuddy-ai") return workBuddyCatalogIdentity(key, account.credential.workbuddy);
182
183
  if (routed.adapter === "devin") destination = validateDevinApiBaseUrl(account.credential.apiBaseUrl) ?? routed.baseUrl;
183
184
  }
185
+ if (routed.adapter === "cline-cli") {
186
+ const binary = resolveClineBinary(undefined, process.env);
187
+ return binary ? clineBinaryFingerprintSync(binary) : undefined;
188
+ }
184
189
  if (!key) return undefined;
185
190
  return createHash("sha256")
186
191
  .update(routed.adapter === "devin"