@orcareplay/adapters 0.1.2 → 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/dist/contract.d.ts +24 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +22 -3
- package/dist/contract.js.map +1 -1
- package/dist/cursor.d.ts +40 -0
- package/dist/cursor.d.ts.map +1 -0
- package/dist/cursor.js +71 -0
- package/dist/cursor.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/kilo.d.ts +21 -0
- package/dist/kilo.d.ts.map +1 -0
- package/dist/kilo.js +35 -0
- package/dist/kilo.js.map +1 -0
- package/dist/mimo.d.ts +26 -0
- package/dist/mimo.d.ts.map +1 -0
- package/dist/mimo.js +40 -0
- package/dist/mimo.js.map +1 -0
- package/dist/opencode-config.d.ts +40 -0
- package/dist/opencode-config.d.ts.map +1 -0
- package/dist/opencode-config.js +185 -0
- package/dist/opencode-config.js.map +1 -0
- package/dist/opencode.d.ts +3 -1
- package/dist/opencode.d.ts.map +1 -1
- package/dist/opencode.js +106 -1
- package/dist/opencode.js.map +1 -1
- package/dist/qwen.d.ts +51 -0
- package/dist/qwen.d.ts.map +1 -0
- package/dist/qwen.js +105 -0
- package/dist/qwen.js.map +1 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +8 -0
- package/dist/registry.js.map +1 -1
- package/package.json +5 -3
package/dist/contract.d.ts
CHANGED
|
@@ -38,4 +38,28 @@ export declare const MODEL_BASE_URL_VARS: readonly ["ANTHROPIC_BASE_URL", "OPENA
|
|
|
38
38
|
export declare function checkAdapterContract(adapter: Adapter, opts?: ContractOptions): Promise<ContractResult>;
|
|
39
39
|
/** One line for a pass, one line per failure otherwise — the shape a CI log wants. */
|
|
40
40
|
export declare function formatContractResult(result: ContractResult): string;
|
|
41
|
+
/**
|
|
42
|
+
* Whether `path` is `base` or sits under it.
|
|
43
|
+
*
|
|
44
|
+
* Delegated to the platform's own path rules rather than compared as strings. The prefix used to be
|
|
45
|
+
* built with a forward slash only, so on Windows — where `path.join` spells the whole path with
|
|
46
|
+
* backslashes — a file genuinely inside `runDir` never matched, and `no-foreign-paths` called the
|
|
47
|
+
* run's own scratch file foreign. That failed the contract for every adapter that puts a runDir
|
|
48
|
+
* path into the environment: grok, openclaw and node. On POSIX the comparison was true either way,
|
|
49
|
+
* so CI never saw it.
|
|
50
|
+
*
|
|
51
|
+
* Normalising the separators by hand would have swapped one wrong answer for another: a backslash
|
|
52
|
+
* is a legal character in a POSIX filename, so `/tmp/run` + a file called `run\evil` would have
|
|
53
|
+
* read as contained when it is not — a leak check answering yes to the thing it exists to catch.
|
|
54
|
+
*
|
|
55
|
+
* `impl` is a parameter so both flavours are reachable from a test on either OS. The Windows
|
|
56
|
+
* behaviour is the whole reason this function was touched, and a test that can only run on Windows
|
|
57
|
+
* is how the original slipped through.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isInside(path: string, base: string, impl?: PathImpl): boolean;
|
|
60
|
+
/** The slice of `node:path` {@link isInside} needs, so `path.win32` and `path.posix` both fit. */
|
|
61
|
+
export interface PathImpl {
|
|
62
|
+
relative(from: string, to: string): string;
|
|
63
|
+
isAbsolute(p: string): boolean;
|
|
64
|
+
}
|
|
41
65
|
//# sourceMappingURL=contract.d.ts.map
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG7E;;;;;;;GAOG;AAEH,kFAAkF;AAClF,eAAO,MAAM,eAAe,uLAUlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,EAAE,EAAE,OAAO,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,uEAItB,CAAC;AAoBX;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,cAAc,CAAC,CAqCzB;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAKnE;AA2SD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,QAAmB,GAAG,OAAO,CAIvF;AAED,kGAAkG;AAClG,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC"}
|
package/dist/contract.js
CHANGED
|
@@ -2,6 +2,7 @@ import { mkdir, mkdtemp, rm } from 'node:fs/promises';
|
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { isDeepStrictEqual } from 'node:util';
|
|
5
|
+
import nodePath from 'node:path';
|
|
5
6
|
import { PLACEHOLDER_KEY, readEnv } from './env.js';
|
|
6
7
|
/**
|
|
7
8
|
* The adapter contract: the behaviour every adapter must have for capture to work at all.
|
|
@@ -364,11 +365,29 @@ function absolutePaths(value) {
|
|
|
364
365
|
}
|
|
365
366
|
return found;
|
|
366
367
|
}
|
|
367
|
-
|
|
368
|
+
/**
|
|
369
|
+
* Whether `path` is `base` or sits under it.
|
|
370
|
+
*
|
|
371
|
+
* Delegated to the platform's own path rules rather than compared as strings. The prefix used to be
|
|
372
|
+
* built with a forward slash only, so on Windows — where `path.join` spells the whole path with
|
|
373
|
+
* backslashes — a file genuinely inside `runDir` never matched, and `no-foreign-paths` called the
|
|
374
|
+
* run's own scratch file foreign. That failed the contract for every adapter that puts a runDir
|
|
375
|
+
* path into the environment: grok, openclaw and node. On POSIX the comparison was true either way,
|
|
376
|
+
* so CI never saw it.
|
|
377
|
+
*
|
|
378
|
+
* Normalising the separators by hand would have swapped one wrong answer for another: a backslash
|
|
379
|
+
* is a legal character in a POSIX filename, so `/tmp/run` + a file called `run\evil` would have
|
|
380
|
+
* read as contained when it is not — a leak check answering yes to the thing it exists to catch.
|
|
381
|
+
*
|
|
382
|
+
* `impl` is a parameter so both flavours are reachable from a test on either OS. The Windows
|
|
383
|
+
* behaviour is the whole reason this function was touched, and a test that can only run on Windows
|
|
384
|
+
* is how the original slipped through.
|
|
385
|
+
*/
|
|
386
|
+
export function isInside(path, base, impl = nodePath) {
|
|
368
387
|
if (base === '')
|
|
369
388
|
return false;
|
|
370
|
-
const
|
|
371
|
-
return
|
|
389
|
+
const rel = impl.relative(base, path);
|
|
390
|
+
return rel === '' || (!rel.startsWith('..') && !impl.isAbsolute(rel));
|
|
372
391
|
}
|
|
373
392
|
const SEMVER_COMPARATOR = /^(?:[<>]=?|=|[~^])?v?(?:\d+|[xX*])(?:\.(?:\d+|[xX*]))?(?:\.(?:\d+|[xX*]))?(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
374
393
|
/**
|
package/d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|
+
* Every other harness here reads an origin from somewhere orca can reach. Cursor reads none: the
|
|
6
|
+
* agent stream goes to hosts of Cursor's own over HTTP/2 exclusively, in Connect-over-protobuf,
|
|
7
|
+
* and the endpoint is compiled in. So this adapter sets no variables at all and the redirect
|
|
8
|
+
* happens underneath it, at the socket, when the run is given `--tls-intercept`.
|
|
9
|
+
*
|
|
10
|
+
* Two things an operator has to supply, because this adapter cannot:
|
|
11
|
+
*
|
|
12
|
+
* - **The hosts.** `DEFAULT_TLS_HOSTS` does not carry Cursor's, deliberately: a recorded run
|
|
13
|
+
* reached `api2.cursor.sh`, `repo42.cursor.sh` and `agentn.global.api5.cursor.sh`, and the
|
|
14
|
+
* shard numbers in the last two vary per account, so covering them needs a wildcard —
|
|
15
|
+
* `--tls-hosts '+*.cursor.sh'`. Putting a wildcard over a vendor's whole domain into the
|
|
16
|
+
* default list would decrypt its sign-in origins too, which is the one thing that list
|
|
17
|
+
* promises not to do. So it stays an explicit opt-in.
|
|
18
|
+
* - **`--trust`.** The agent refuses to run non-interactively in a directory it has not been
|
|
19
|
+
* trusted in. Passing it is the operator's call, not this adapter's: it is a permission grant,
|
|
20
|
+
* and an adapter that quietly granted permissions on someone's behalf would be a worse bug
|
|
21
|
+
* than the inconvenience it saved.
|
|
22
|
+
*
|
|
23
|
+
* The installer ships two shims, `cursor-agent` and `agent`, byte-identical and in the same
|
|
24
|
+
* directory: both run `versions/<build>/index.js` through the bundled node, and
|
|
25
|
+
* `CURSOR_INVOKED_AS` is how the tool learns which name it was called by. Its own usage text
|
|
26
|
+
* says `agent`, the shorter and more natural one. `cursor-agent` is launched here anyway,
|
|
27
|
+
* because a bare `agent` on PATH is generic enough to belong to something else, and since the
|
|
28
|
+
* two shims sit in one directory, whichever name resolves means both do.
|
|
29
|
+
*
|
|
30
|
+
* On Windows that directory is `%LOCALAPPDATA%\cursor-agent\` and the installer does not add
|
|
31
|
+
* it to PATH, so `orca record cursor` reports ENOENT until it is. Loud rather than silent, which
|
|
32
|
+
* is the tradeoff for a fixture that means the same thing on every machine;
|
|
33
|
+
* `orca record exec -- <full path to the shim> ...` is the way round it.
|
|
34
|
+
*
|
|
35
|
+
* `harnessVersions` is deliberately unset: Cursor ships date-stamped builds
|
|
36
|
+
* (`2026.09.02-c22c1a3`), not semver, so a range would be a claim in a vocabulary the harness
|
|
37
|
+
* does not use. The version the fixture was verified against is recorded in its `note` instead.
|
|
38
|
+
*/
|
|
39
|
+
export declare const cursorAdapter: Adapter;
|
|
40
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../src/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAyB,MAAM,wBAAwB,CAAC;AAqB7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,aAAa,EAAE,OAiB3B,CAAC"}
|
package/dist/cursor.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { detectAgent } from './detect.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where the installer puts `cursor-agent`, per platform.
|
|
4
|
+
*
|
|
5
|
+
* Detection only — the launch uses the bare name, like every other adapter, so the fixture stays
|
|
6
|
+
* the same on every machine. What these are for is answering "is this agent even installed here",
|
|
7
|
+
* which matters more than usual because on Windows the installer does *not* put the shim on PATH.
|
|
8
|
+
*/
|
|
9
|
+
const CURSOR_AGENT_PATHS = [
|
|
10
|
+
// Windows: %LOCALAPPDATA%\cursor-agent\, which holds both shims
|
|
11
|
+
'AppData/Local/cursor-agent/cursor-agent.cmd',
|
|
12
|
+
'AppData/Local/cursor-agent/agent.cmd',
|
|
13
|
+
// macOS and Linux
|
|
14
|
+
'.local/bin/cursor-agent',
|
|
15
|
+
'.local/bin/agent',
|
|
16
|
+
// The editor's own directory, present whether or not the CLI is
|
|
17
|
+
'.cursor',
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Cursor's terminal agent, which has nothing to redirect.
|
|
21
|
+
*
|
|
22
|
+
* Every other harness here reads an origin from somewhere orca can reach. Cursor reads none: the
|
|
23
|
+
* agent stream goes to hosts of Cursor's own over HTTP/2 exclusively, in Connect-over-protobuf,
|
|
24
|
+
* and the endpoint is compiled in. So this adapter sets no variables at all and the redirect
|
|
25
|
+
* happens underneath it, at the socket, when the run is given `--tls-intercept`.
|
|
26
|
+
*
|
|
27
|
+
* Two things an operator has to supply, because this adapter cannot:
|
|
28
|
+
*
|
|
29
|
+
* - **The hosts.** `DEFAULT_TLS_HOSTS` does not carry Cursor's, deliberately: a recorded run
|
|
30
|
+
* reached `api2.cursor.sh`, `repo42.cursor.sh` and `agentn.global.api5.cursor.sh`, and the
|
|
31
|
+
* shard numbers in the last two vary per account, so covering them needs a wildcard —
|
|
32
|
+
* `--tls-hosts '+*.cursor.sh'`. Putting a wildcard over a vendor's whole domain into the
|
|
33
|
+
* default list would decrypt its sign-in origins too, which is the one thing that list
|
|
34
|
+
* promises not to do. So it stays an explicit opt-in.
|
|
35
|
+
* - **`--trust`.** The agent refuses to run non-interactively in a directory it has not been
|
|
36
|
+
* trusted in. Passing it is the operator's call, not this adapter's: it is a permission grant,
|
|
37
|
+
* and an adapter that quietly granted permissions on someone's behalf would be a worse bug
|
|
38
|
+
* than the inconvenience it saved.
|
|
39
|
+
*
|
|
40
|
+
* The installer ships two shims, `cursor-agent` and `agent`, byte-identical and in the same
|
|
41
|
+
* directory: both run `versions/<build>/index.js` through the bundled node, and
|
|
42
|
+
* `CURSOR_INVOKED_AS` is how the tool learns which name it was called by. Its own usage text
|
|
43
|
+
* says `agent`, the shorter and more natural one. `cursor-agent` is launched here anyway,
|
|
44
|
+
* because a bare `agent` on PATH is generic enough to belong to something else, and since the
|
|
45
|
+
* two shims sit in one directory, whichever name resolves means both do.
|
|
46
|
+
*
|
|
47
|
+
* On Windows that directory is `%LOCALAPPDATA%\cursor-agent\` and the installer does not add
|
|
48
|
+
* it to PATH, so `orca record cursor` reports ENOENT until it is. Loud rather than silent, which
|
|
49
|
+
* is the tradeoff for a fixture that means the same thing on every machine;
|
|
50
|
+
* `orca record exec -- <full path to the shim> ...` is the way round it.
|
|
51
|
+
*
|
|
52
|
+
* `harnessVersions` is deliberately unset: Cursor ships date-stamped builds
|
|
53
|
+
* (`2026.09.02-c22c1a3`), not semver, so a range would be a claim in a vocabulary the harness
|
|
54
|
+
* does not use. The version the fixture was verified against is recorded in its `note` instead.
|
|
55
|
+
*/
|
|
56
|
+
export const cursorAdapter = {
|
|
57
|
+
id: 'cursor',
|
|
58
|
+
aliases: ['cursor-agent'],
|
|
59
|
+
// Redirecting nothing is the intent, not a defect. See the `capture` field on `Adapter`.
|
|
60
|
+
capture: 'transport',
|
|
61
|
+
async detect(cwd) {
|
|
62
|
+
void cwd;
|
|
63
|
+
return detectAgent(['cursor-agent', 'agent'], CURSOR_AGENT_PATHS);
|
|
64
|
+
},
|
|
65
|
+
async prepare(ctx) {
|
|
66
|
+
// No origin and no credential: the agent authenticates with the session its own sign-in
|
|
67
|
+
// wrote, and there is no variable to point anywhere. An empty overlay is the whole contract.
|
|
68
|
+
return { command: 'cursor-agent', args: [...ctx.userArgs], env: {} };
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../src/cursor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG;IACzB,gEAAgE;IAChE,6CAA6C;IAC7C,sCAAsC;IACtC,kBAAkB;IAClB,yBAAyB;IACzB,kBAAkB;IAClB,gEAAgE;IAChE,SAAS;CACV,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE,CAAC,cAAc,CAAC;IAEzB,yFAAyF;IACzF,OAAO,EAAE,WAAW;IAEpB,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,KAAK,GAAG,CAAC;QACT,OAAO,WAAW,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAkB;QAC9B,wFAAwF;QACxF,6FAA6F;QAC7F,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IACvE,CAAC;CACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './claude-code.js';
|
|
2
2
|
export * from './codex.js';
|
|
3
3
|
export * from './contract.js';
|
|
4
|
+
export * from './cursor.js';
|
|
4
5
|
export * from './detect.js';
|
|
5
6
|
export * from './env.js';
|
|
6
7
|
export * from './exec.js';
|
|
@@ -9,7 +10,10 @@ export * from './grok.js';
|
|
|
9
10
|
export * from './node.js';
|
|
10
11
|
export * from './openclaw.js';
|
|
11
12
|
export * from './mcp-config.js';
|
|
13
|
+
export * from './kilo.js';
|
|
14
|
+
export * from './mimo.js';
|
|
12
15
|
export * from './opencode.js';
|
|
16
|
+
export * from './qwen.js';
|
|
13
17
|
export * from './registry.js';
|
|
14
18
|
export * from './scaffold.js';
|
|
15
19
|
export * from './session.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './claude-code.js';
|
|
2
2
|
export * from './codex.js';
|
|
3
3
|
export * from './contract.js';
|
|
4
|
+
export * from './cursor.js';
|
|
4
5
|
export * from './detect.js';
|
|
5
6
|
export * from './env.js';
|
|
6
7
|
export * from './exec.js';
|
|
@@ -9,7 +10,10 @@ export * from './grok.js';
|
|
|
9
10
|
export * from './node.js';
|
|
10
11
|
export * from './openclaw.js';
|
|
11
12
|
export * from './mcp-config.js';
|
|
13
|
+
export * from './kilo.js';
|
|
14
|
+
export * from './mimo.js';
|
|
12
15
|
export * from './opencode.js';
|
|
16
|
+
export * from './qwen.js';
|
|
13
17
|
export * from './registry.js';
|
|
14
18
|
export * from './scaffold.js';
|
|
15
19
|
export * from './session.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
package/dist/kilo.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Adapter } from '@orcareplay/plugin-api';
|
|
2
|
+
/**
|
|
3
|
+
* Kilo Code's CLI — another OpenCode fork, captured the way the others are.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is redirected, for the reason the whole OpenCode family shares: the provider origin
|
|
6
|
+
* lives in the harness's own config rather than in an environment variable, so `OPENAI_BASE_URL`
|
|
7
|
+
* leaves the run talking straight past the proxy. `--tls-intercept` terminates the TLS the agent
|
|
8
|
+
* established itself, and `api.kilo.ai` is in `DEFAULT_TLS_HOSTS` so the built-in `kilo/*` models
|
|
9
|
+
* need no extra `--tls-hosts`.
|
|
10
|
+
*
|
|
11
|
+
* One thing worth knowing before recording it: Kilo checks entitlement locally, before it opens a
|
|
12
|
+
* connection. A model the account cannot use fails with "You need to sign in to use this model"
|
|
13
|
+
* and no request is ever sent, so there is nothing to capture — unlike MiMo, which sends the
|
|
14
|
+
* request and lets the server reject it. `kilo/kilo-auto/free` is reachable without a paid plan
|
|
15
|
+
* and is what the fixture below was verified against.
|
|
16
|
+
*
|
|
17
|
+
* Kilo also posts to `us.i.posthog.com`. That is not a model API and is not in the allowlist, so
|
|
18
|
+
* it stays tunnelled: orca records that the connection happened and reads none of it.
|
|
19
|
+
*/
|
|
20
|
+
export declare const kiloAdapter: Adapter;
|
|
21
|
+
//# sourceMappingURL=kilo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kilo.d.ts","sourceRoot":"","sources":["../src/kilo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAyB,MAAM,wBAAwB,CAAC;AAG7E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,EAAE,OAiBzB,CAAC"}
|
package/dist/kilo.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { detectAgent } from './detect.js';
|
|
2
|
+
/**
|
|
3
|
+
* Kilo Code's CLI — another OpenCode fork, captured the way the others are.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is redirected, for the reason the whole OpenCode family shares: the provider origin
|
|
6
|
+
* lives in the harness's own config rather than in an environment variable, so `OPENAI_BASE_URL`
|
|
7
|
+
* leaves the run talking straight past the proxy. `--tls-intercept` terminates the TLS the agent
|
|
8
|
+
* established itself, and `api.kilo.ai` is in `DEFAULT_TLS_HOSTS` so the built-in `kilo/*` models
|
|
9
|
+
* need no extra `--tls-hosts`.
|
|
10
|
+
*
|
|
11
|
+
* One thing worth knowing before recording it: Kilo checks entitlement locally, before it opens a
|
|
12
|
+
* connection. A model the account cannot use fails with "You need to sign in to use this model"
|
|
13
|
+
* and no request is ever sent, so there is nothing to capture — unlike MiMo, which sends the
|
|
14
|
+
* request and lets the server reject it. `kilo/kilo-auto/free` is reachable without a paid plan
|
|
15
|
+
* and is what the fixture below was verified against.
|
|
16
|
+
*
|
|
17
|
+
* Kilo also posts to `us.i.posthog.com`. That is not a model API and is not in the allowlist, so
|
|
18
|
+
* it stays tunnelled: orca records that the connection happened and reads none of it.
|
|
19
|
+
*/
|
|
20
|
+
export const kiloAdapter = {
|
|
21
|
+
id: 'kilo',
|
|
22
|
+
aliases: ['kilocode', 'kilo-code'],
|
|
23
|
+
harnessVersions: '>=7.5.9',
|
|
24
|
+
// Redirecting nothing is the intent, not a defect. See the `capture` field on `Adapter`.
|
|
25
|
+
capture: 'transport',
|
|
26
|
+
async detect(_cwd) {
|
|
27
|
+
return detectAgent(['kilo', 'kilocode'], ['.config/kilo', '.kilo']);
|
|
28
|
+
},
|
|
29
|
+
async prepare(ctx) {
|
|
30
|
+
// No origin and no credential: both live in the harness's own config and credential store,
|
|
31
|
+
// and an adapter that injected either would override a choice made there.
|
|
32
|
+
return { command: 'kilo', args: [...ctx.userArgs], env: {} };
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=kilo.js.map
|
package/dist/kilo.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kilo.js","sourceRoot":"","sources":["../src/kilo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,EAAE,EAAE,MAAM;IACV,OAAO,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;IAClC,eAAe,EAAE,SAAS;IAE1B,yFAAyF;IACzF,OAAO,EAAE,WAAW;IAEpB,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,OAAO,WAAW,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAkB;QAC9B,2FAA2F;QAC3F,0EAA0E;QAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IAC/D,CAAC;CACF,CAAC"}
|
package/dist/mimo.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Adapter } from '@orcareplay/plugin-api';
|
|
2
|
+
/**
|
|
3
|
+
* MiMo Code, Xiaomi's terminal agent — an OpenCode fork, captured the way OpenCode is.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is redirected, and that is inherited rather than chosen: like OpenCode, MiMo keeps its
|
|
6
|
+
* provider origin in a config file (`~/.config/mimocode/mimocode.jsonc`) rather than in an
|
|
7
|
+
* environment variable, so `OPENAI_BASE_URL` leaves the run talking straight past the proxy. The
|
|
8
|
+
* route that works is the one orca built for an origin that cannot be moved — `--tls-intercept`
|
|
9
|
+
* terminates the TLS the agent established itself, and the config is left alone.
|
|
10
|
+
*
|
|
11
|
+
* Being a fork does *not* mean it inherits an OpenCode installation. The two read parallel
|
|
12
|
+
* directories, `~/.config/mimocode/` beside `~/.config/opencode/`, so a machine with OpenCode
|
|
13
|
+
* configured still starts MiMo on Xiaomi's own provider. The config *shape* is shared, which is
|
|
14
|
+
* what makes a provider block copied from one work in the other.
|
|
15
|
+
*
|
|
16
|
+
* `api.xiaomimimo.com` is in `DEFAULT_TLS_HOSTS`, so no extra `--tls-hosts` is needed for the
|
|
17
|
+
* built-in `xiaomi/*` and `mimo/*` models. A provider of your own pointed at a plain-HTTP gateway
|
|
18
|
+
* is a different matter: orca sets `HTTPS_PROXY` and not `HTTP_PROXY`, so that traffic is neither
|
|
19
|
+
* redirected nor decrypted and the run records nothing.
|
|
20
|
+
*
|
|
21
|
+
* A credential is not required to capture the prompt. MiMo sends the request and lets the server
|
|
22
|
+
* reject it, and the system prompt is in the request — so an invalid key still yields a complete
|
|
23
|
+
* capture, which is how the fixture below was verified.
|
|
24
|
+
*/
|
|
25
|
+
export declare const mimoAdapter: Adapter;
|
|
26
|
+
//# sourceMappingURL=mimo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mimo.d.ts","sourceRoot":"","sources":["../src/mimo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAyB,MAAM,wBAAwB,CAAC;AAG7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,EAAE,OAiBzB,CAAC"}
|
package/dist/mimo.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { detectAgent } from './detect.js';
|
|
2
|
+
/**
|
|
3
|
+
* MiMo Code, Xiaomi's terminal agent — an OpenCode fork, captured the way OpenCode is.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is redirected, and that is inherited rather than chosen: like OpenCode, MiMo keeps its
|
|
6
|
+
* provider origin in a config file (`~/.config/mimocode/mimocode.jsonc`) rather than in an
|
|
7
|
+
* environment variable, so `OPENAI_BASE_URL` leaves the run talking straight past the proxy. The
|
|
8
|
+
* route that works is the one orca built for an origin that cannot be moved — `--tls-intercept`
|
|
9
|
+
* terminates the TLS the agent established itself, and the config is left alone.
|
|
10
|
+
*
|
|
11
|
+
* Being a fork does *not* mean it inherits an OpenCode installation. The two read parallel
|
|
12
|
+
* directories, `~/.config/mimocode/` beside `~/.config/opencode/`, so a machine with OpenCode
|
|
13
|
+
* configured still starts MiMo on Xiaomi's own provider. The config *shape* is shared, which is
|
|
14
|
+
* what makes a provider block copied from one work in the other.
|
|
15
|
+
*
|
|
16
|
+
* `api.xiaomimimo.com` is in `DEFAULT_TLS_HOSTS`, so no extra `--tls-hosts` is needed for the
|
|
17
|
+
* built-in `xiaomi/*` and `mimo/*` models. A provider of your own pointed at a plain-HTTP gateway
|
|
18
|
+
* is a different matter: orca sets `HTTPS_PROXY` and not `HTTP_PROXY`, so that traffic is neither
|
|
19
|
+
* redirected nor decrypted and the run records nothing.
|
|
20
|
+
*
|
|
21
|
+
* A credential is not required to capture the prompt. MiMo sends the request and lets the server
|
|
22
|
+
* reject it, and the system prompt is in the request — so an invalid key still yields a complete
|
|
23
|
+
* capture, which is how the fixture below was verified.
|
|
24
|
+
*/
|
|
25
|
+
export const mimoAdapter = {
|
|
26
|
+
id: 'mimo',
|
|
27
|
+
aliases: ['mimo-code', 'mimocode'],
|
|
28
|
+
harnessVersions: '>=0.1.14',
|
|
29
|
+
// Redirecting nothing is the intent, not a defect. See the `capture` field on `Adapter`.
|
|
30
|
+
capture: 'transport',
|
|
31
|
+
async detect(_cwd) {
|
|
32
|
+
return detectAgent(['mimo'], ['.config/mimocode', '.mimocode']);
|
|
33
|
+
},
|
|
34
|
+
async prepare(ctx) {
|
|
35
|
+
// No origin and no credential: both live in the harness's own config, and an adapter that
|
|
36
|
+
// injected either would be overriding a choice the operator already made there.
|
|
37
|
+
return { command: 'mimo', args: [...ctx.userArgs], env: {} };
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=mimo.js.map
|
package/dist/mimo.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mimo.js","sourceRoot":"","sources":["../src/mimo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,EAAE,EAAE,MAAM;IACV,OAAO,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;IAClC,eAAe,EAAE,UAAU;IAE3B,yFAAyF;IACzF,OAAO,EAAE,WAAW;IAEpB,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAkB;QAC9B,0FAA0F;QAC1F,gFAAgF;QAChF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IAC/D,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What OpenCode's own configuration says about a provider's base URL.
|
|
3
|
+
*
|
|
4
|
+
* The adapter redirects OpenCode's first-party providers through the proxy by writing a
|
|
5
|
+
* `provider.<id>.options.baseURL` override, and OpenCode merges config sources in an order that
|
|
6
|
+
* puts that override last — over a base URL the user configured for the same provider. Overriding
|
|
7
|
+
* someone's deliberate routing would make the recorded run talk to a host they never named, which
|
|
8
|
+
* is the one capture bug worse than an empty trace. So the adapter reads the same files OpenCode
|
|
9
|
+
* reads and carries the configured base URL *through* the redirect instead of replacing it.
|
|
10
|
+
*
|
|
11
|
+
* The files are JSONC — comments and trailing commas are allowed and the user's own config uses
|
|
12
|
+
* both — so a small stripper runs before `JSON.parse`. A file that still will not parse marks the
|
|
13
|
+
* whole scan untrusted: without knowing what the user intended, the adapter must not touch their
|
|
14
|
+
* routing at all, and the run degrades to the pre-override behaviour (uncaptured, with the
|
|
15
|
+
* end-of-run warning saying so) rather than to a captured run aimed at the wrong origin.
|
|
16
|
+
*/
|
|
17
|
+
export interface OpenCodeConfigScan {
|
|
18
|
+
/** Provider id → the `options.baseURL` the user configured, when they configured one. */
|
|
19
|
+
overrides: Map<string, string>;
|
|
20
|
+
/** False when a config file existed but could not be parsed, so no override can be trusted. */
|
|
21
|
+
trusted: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Strip what JSONC allows and JSON does not: comments and trailing commas.
|
|
25
|
+
*
|
|
26
|
+
* Strings are copied verbatim with their escapes, because a config comment is prose that may
|
|
27
|
+
* contain `//` — a URL, say — and stripping inside a string would corrupt the value while the
|
|
28
|
+
* file still parsed. Trailing commas are removed only when the next significant character closes
|
|
29
|
+
* a value, which a comma inside a string never is.
|
|
30
|
+
*/
|
|
31
|
+
export declare function stripJsonc(text: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Read the base URLs the user's OpenCode configuration sets per provider.
|
|
34
|
+
*
|
|
35
|
+
* A missing file is not a failure — most of these do not exist. A file that exists and will not
|
|
36
|
+
* parse is: the adapter then knows less than it must to rewrite routing safely, and reports that
|
|
37
|
+
* by clearing `trusted`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function openCodeConfiguredBaseURLs(env: Record<string, string | undefined>, cwd: string): Promise<OpenCodeConfigScan>;
|
|
40
|
+
//# sourceMappingURL=opencode-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-config.d.ts","sourceRoot":"","sources":["../src/opencode-config.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,kBAAkB;IACjC,yFAAyF;IACzF,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,+FAA+F;IAC/F,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyB/C;AAoHD;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,CAAC,CAqB7B"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
/**
|
|
5
|
+
* Strip what JSONC allows and JSON does not: comments and trailing commas.
|
|
6
|
+
*
|
|
7
|
+
* Strings are copied verbatim with their escapes, because a config comment is prose that may
|
|
8
|
+
* contain `//` — a URL, say — and stripping inside a string would corrupt the value while the
|
|
9
|
+
* file still parsed. Trailing commas are removed only when the next significant character closes
|
|
10
|
+
* a value, which a comma inside a string never is.
|
|
11
|
+
*/
|
|
12
|
+
export function stripJsonc(text) {
|
|
13
|
+
let out = '';
|
|
14
|
+
let i = 0;
|
|
15
|
+
while (i < text.length) {
|
|
16
|
+
const ch = text[i];
|
|
17
|
+
if (ch === '"') {
|
|
18
|
+
const end = stringEnd(text, i);
|
|
19
|
+
out += text.slice(i, end);
|
|
20
|
+
i = end;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (ch === '/' && text[i + 1] === '/') {
|
|
24
|
+
while (i < text.length && text[i] !== '\n')
|
|
25
|
+
i += 1;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (ch === '/' && text[i + 1] === '*') {
|
|
29
|
+
const end = text.indexOf('*/', i + 2);
|
|
30
|
+
i = end === -1 ? text.length : end + 2;
|
|
31
|
+
out += ' ';
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
out += ch;
|
|
35
|
+
i += 1;
|
|
36
|
+
}
|
|
37
|
+
return stripTrailingCommas(out);
|
|
38
|
+
}
|
|
39
|
+
/** Index just past the closing quote of the string starting at `start`, or end of input. */
|
|
40
|
+
function stringEnd(text, start) {
|
|
41
|
+
let i = start + 1;
|
|
42
|
+
while (i < text.length) {
|
|
43
|
+
const ch = text[i];
|
|
44
|
+
if (ch === '\\') {
|
|
45
|
+
i += 2;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (ch === '"')
|
|
49
|
+
return i + 1;
|
|
50
|
+
i += 1;
|
|
51
|
+
}
|
|
52
|
+
return text.length;
|
|
53
|
+
}
|
|
54
|
+
function stripTrailingCommas(text) {
|
|
55
|
+
let out = '';
|
|
56
|
+
let i = 0;
|
|
57
|
+
while (i < text.length) {
|
|
58
|
+
const ch = text[i];
|
|
59
|
+
if (ch === '"') {
|
|
60
|
+
const end = stringEnd(text, i);
|
|
61
|
+
out += text.slice(i, end);
|
|
62
|
+
i = end;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (ch === ',') {
|
|
66
|
+
let look = i + 1;
|
|
67
|
+
while (look < text.length && /\s/.test(text[look]))
|
|
68
|
+
look += 1;
|
|
69
|
+
const next = text[look];
|
|
70
|
+
if (next === '}' || next === ']') {
|
|
71
|
+
i += 1;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
out += ch;
|
|
76
|
+
i += 1;
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
/** Every `provider.<id>.options.baseURL` in one parsed config. */
|
|
81
|
+
function providerBaseURLs(config) {
|
|
82
|
+
const out = new Map();
|
|
83
|
+
if (config === null || typeof config !== 'object' || Array.isArray(config))
|
|
84
|
+
return out;
|
|
85
|
+
const provider = config['provider'];
|
|
86
|
+
if (provider === null || typeof provider !== 'object' || Array.isArray(provider))
|
|
87
|
+
return out;
|
|
88
|
+
for (const [id, entry] of Object.entries(provider)) {
|
|
89
|
+
if (entry === null || typeof entry !== 'object' || Array.isArray(entry))
|
|
90
|
+
continue;
|
|
91
|
+
const options = entry['options'];
|
|
92
|
+
if (options === null || typeof options !== 'object' || Array.isArray(options))
|
|
93
|
+
continue;
|
|
94
|
+
const baseURL = options['baseURL'];
|
|
95
|
+
if (typeof baseURL === 'string' && baseURL.trim() !== '')
|
|
96
|
+
out.set(id, baseURL.trim());
|
|
97
|
+
}
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The config files OpenCode reads that could set a provider base URL.
|
|
102
|
+
*
|
|
103
|
+
* Global, then `OPENCODE_CONFIG`, then project-level `.opencode` directories walking up the way
|
|
104
|
+
* OpenCode's own loader walks — bounded at the git root or the home directory, because above
|
|
105
|
+
* those, neither OpenCode nor anyone else looks. Order does not matter here: the scan collects
|
|
106
|
+
* every override it can see, and a later source winning the merge is the same override either way.
|
|
107
|
+
*/
|
|
108
|
+
async function openCodeConfigFiles(env, cwd) {
|
|
109
|
+
const files = [];
|
|
110
|
+
const globalDir = readEnvValue(env, 'OPENCODE_CONFIG_DIR') ??
|
|
111
|
+
(readEnvValue(env, 'XDG_CONFIG_HOME') !== undefined
|
|
112
|
+
? join(readEnvValue(env, 'XDG_CONFIG_HOME'), 'opencode')
|
|
113
|
+
: join(homeOf(env), '.config', 'opencode'));
|
|
114
|
+
for (const file of ['config.json', 'opencode.json', 'opencode.jsonc']) {
|
|
115
|
+
files.push(join(globalDir, file));
|
|
116
|
+
}
|
|
117
|
+
const custom = readEnvValue(env, 'OPENCODE_CONFIG');
|
|
118
|
+
if (custom !== undefined)
|
|
119
|
+
files.push(custom);
|
|
120
|
+
const stop = new Set([homeOf(env)]);
|
|
121
|
+
let at = cwd;
|
|
122
|
+
for (let depth = 0; depth < 64; depth += 1) {
|
|
123
|
+
for (const file of ['opencode.json', 'opencode.jsonc']) {
|
|
124
|
+
files.push(join(at, '.opencode', file));
|
|
125
|
+
}
|
|
126
|
+
if (stop.has(at))
|
|
127
|
+
break;
|
|
128
|
+
if (await isDirectory(join(at, '.git')))
|
|
129
|
+
break;
|
|
130
|
+
const parent = at.slice(0, at.lastIndexOf('/'));
|
|
131
|
+
if (parent === '' || parent === at)
|
|
132
|
+
break;
|
|
133
|
+
at = parent;
|
|
134
|
+
}
|
|
135
|
+
return files;
|
|
136
|
+
}
|
|
137
|
+
function homeOf(env) {
|
|
138
|
+
return readEnvValue(env, 'HOME') ?? homedir();
|
|
139
|
+
}
|
|
140
|
+
function readEnvValue(env, name) {
|
|
141
|
+
const value = env[name];
|
|
142
|
+
return value !== undefined && value !== '' ? value : undefined;
|
|
143
|
+
}
|
|
144
|
+
async function isDirectory(path) {
|
|
145
|
+
try {
|
|
146
|
+
return (await stat(path)).isDirectory();
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Read the base URLs the user's OpenCode configuration sets per provider.
|
|
154
|
+
*
|
|
155
|
+
* A missing file is not a failure — most of these do not exist. A file that exists and will not
|
|
156
|
+
* parse is: the adapter then knows less than it must to rewrite routing safely, and reports that
|
|
157
|
+
* by clearing `trusted`.
|
|
158
|
+
*/
|
|
159
|
+
export async function openCodeConfiguredBaseURLs(env, cwd) {
|
|
160
|
+
const overrides = new Map();
|
|
161
|
+
let trusted = true;
|
|
162
|
+
for (const file of await openCodeConfigFiles(env, cwd)) {
|
|
163
|
+
let text;
|
|
164
|
+
try {
|
|
165
|
+
text = await readFile(file, 'utf8');
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (text.trim() === '')
|
|
171
|
+
continue;
|
|
172
|
+
let parsed;
|
|
173
|
+
try {
|
|
174
|
+
parsed = JSON.parse(stripJsonc(text));
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
trusted = false;
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
for (const [id, url] of providerBaseURLs(parsed))
|
|
181
|
+
overrides.set(id, url);
|
|
182
|
+
}
|
|
183
|
+
return { overrides, trusted };
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=opencode-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-config.js","sourceRoot":"","sources":["../src/opencode-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA0BjC;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACpB,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC/B,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC1B,CAAC,GAAG,GAAG,CAAC;YACR,SAAS;QACX,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACtC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI;gBAAE,CAAC,IAAI,CAAC,CAAC;YACnD,SAAS;QACX,CAAC;QACD,IAAI,EAAE,KAAK,GAAG,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACtC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACtC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC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5C,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,KAAK,MAAM,IAAI,IAAI,MAAM,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;QACvD,IAAI,IAAY,CAAC;QACjB,IAAI,CAAC;YACH,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,SAAS;QACjC,IAAI,MAAe,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,KAAK,CAAC;YAChB,SAAS;QACX,CAAC;QACD,KAAK,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC;YAAE,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAChC,CAAC"}
|
package/dist/opencode.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import type { Adapter } from '@orcareplay/plugin-api';
|
|
|
3
3
|
export declare function opencodeHasOwnAuth(): boolean;
|
|
4
4
|
/**
|
|
5
5
|
* OpenCode picks its provider per model, so both origins are redirected: whichever protocol the
|
|
6
|
-
* chosen model speaks, the traffic lands on the proxy.
|
|
6
|
+
* chosen model speaks, the traffic lands on the proxy. Providers whose origin is neither of the
|
|
7
|
+
* two — OpenCode's own first-party ones, most visibly — are redirected by the config overlay
|
|
8
|
+
* below, because no environment variable can name their origin for them.
|
|
7
9
|
*/
|
|
8
10
|
export declare const openCodeAdapter: Adapter;
|
|
9
11
|
//# sourceMappingURL=opencode.d.ts.map
|
package/dist/opencode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../src/opencode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../src/opencode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAyB,MAAM,wBAAwB,CAAC;AAe7E,mFAAmF;AACnF,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAmGD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,OA4C7B,CAAC"}
|
package/dist/opencode.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { basename, join } from 'node:path';
|
|
2
|
+
import { forwardBasePath } from '@orcareplay/proxy';
|
|
3
|
+
import { resolveRealBinary } from '@orcareplay/shell-shim';
|
|
1
4
|
import { detectAgent, homeDirHas } from './detect.js';
|
|
5
|
+
import { openCodeConfiguredBaseURLs } from './opencode-config.js';
|
|
2
6
|
import { passKey, passThrough, proxyBase, readEnv } from './env.js';
|
|
3
7
|
/**
|
|
4
8
|
* Where OpenCode keeps the credentials `opencode auth login` writes.
|
|
@@ -11,9 +15,102 @@ const OPENCODE_AUTH_PATHS = ['.local/share/opencode/auth.json', '.config/opencod
|
|
|
11
15
|
export function opencodeHasOwnAuth() {
|
|
12
16
|
return OPENCODE_AUTH_PATHS.some(homeDirHas);
|
|
13
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* OpenCode's first-party providers, and the base URL the models.dev catalog gives each.
|
|
20
|
+
*
|
|
21
|
+
* OpenCode resolves its API origin per model, and only the OpenAI and Anthropic origins can be
|
|
22
|
+
* named with an environment variable — so a run on one of these talked straight to its provider
|
|
23
|
+
* while the proxy saw nothing, and the trace came out empty while the agent answered happily.
|
|
24
|
+
* A config overlay (see `prepare`) points each at the proxy carrying its own destination, which
|
|
25
|
+
* is one mechanism for both and for any later first-party provider, at the cost of this table
|
|
26
|
+
* going stale: a provider added after it was written keeps bypassing capture the way it did
|
|
27
|
+
* before, which the end-of-run `capture.empty` warning is what says out loud.
|
|
28
|
+
*/
|
|
29
|
+
const OPENCODE_FIRST_PARTY_BASE = {
|
|
30
|
+
opencode: 'https://opencode.ai/zen/v1',
|
|
31
|
+
'opencode-go': 'https://opencode.ai/zen/go/v1',
|
|
32
|
+
};
|
|
33
|
+
/** The environment variable the overlay rides in on, and the one it must never clobber. */
|
|
34
|
+
const CONFIG_CONTENT_VAR = 'OPENCODE_CONFIG_CONTENT';
|
|
35
|
+
/**
|
|
36
|
+
* Shells whose real binary a shim can find again, from OpenCode's own acceptable set — the
|
|
37
|
+
* POSIX shells it runs commands with, minus the ones it refuses outright.
|
|
38
|
+
*/
|
|
39
|
+
const SHIMMABLE_SHELLS = ['zsh', 'bash', 'sh', 'ksh', 'dash'];
|
|
40
|
+
/**
|
|
41
|
+
* The shell OpenCode falls back to when `SHELL` is unset or one it denies, which is what a
|
|
42
|
+
* recorded run should resolve through the shim so that it behaves like the unrecorded one.
|
|
43
|
+
*/
|
|
44
|
+
function fallbackShells() {
|
|
45
|
+
return process.platform === 'darwin' ? ['zsh', 'bash', 'sh'] : ['bash', 'sh'];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Route OpenCode's shell tool through the shim, by pointing `SHELL` at one.
|
|
49
|
+
*
|
|
50
|
+
* OpenCode resolves its shell from this variable and then execs it *by absolute path*, so the
|
|
51
|
+
* PATH shim in front of `bash` and `sh` never engaged: on macOS every command ran under
|
|
52
|
+
* `/bin/zsh` and the frames file stayed empty while the trace showed shell tool calls. The shim
|
|
53
|
+
* named after the real shell keeps every flag OpenCode passes (`-c`, and the login wrappers)
|
|
54
|
+
* byte-identical — it is argv-transparent — so the run behaves the same and the shim sees it.
|
|
55
|
+
*
|
|
56
|
+
* The name is resolved before the run starts, because a shim whose real binary cannot be found
|
|
57
|
+
* on PATH would answer every command 127 and break the run instead of under-recording it.
|
|
58
|
+
* `installShellShim` writes one shim per name in its default set; a name that is not there
|
|
59
|
+
* simply never gets picked, and the end-of-run `shell.ineffective` warning is what reports the
|
|
60
|
+
* layer as unused.
|
|
61
|
+
*/
|
|
62
|
+
async function shellThroughShim(env, runDir) {
|
|
63
|
+
if (process.platform === 'win32')
|
|
64
|
+
return undefined;
|
|
65
|
+
const shimDir = join(runDir, 'shims');
|
|
66
|
+
const current = basename(readEnv(env, 'SHELL') ?? '').toLowerCase();
|
|
67
|
+
const candidates = SHIMMABLE_SHELLS.includes(current)
|
|
68
|
+
? [current, ...fallbackShells()]
|
|
69
|
+
: fallbackShells();
|
|
70
|
+
for (const name of new Set(candidates)) {
|
|
71
|
+
if ((await resolveRealBinary(name, env['PATH'] ?? '', shimDir)) !== undefined) {
|
|
72
|
+
return join(shimDir, name);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The config overlay that rewrites OpenCode's per-provider origins through the proxy.
|
|
79
|
+
*
|
|
80
|
+
* `provider.<id>.options.baseURL` is the one lever OpenCode honours over its catalog's origin,
|
|
81
|
+
* and `OPENCODE_CONFIG_CONTENT` is the config source merged last, so the overlay decides the
|
|
82
|
+
* final URL without touching the user's files. Each base URL is rewritten to
|
|
83
|
+
* `<proxy>/forward/<encoded base>`: the request arrives at the proxy naming where it was headed,
|
|
84
|
+
* the proxy records the exchange and forwards to that base — so an OpenAI-compatible provider
|
|
85
|
+
* whose origin is neither api.openai.com nor api.anthropic.com is captured, not bypassed.
|
|
86
|
+
*
|
|
87
|
+
* The user's own `options.baseURL` for the same provider is carried through rather than replaced.
|
|
88
|
+
* A config that could not be parsed clears the whole overlay: an unreadable intent is not a
|
|
89
|
+
* licence to reroute someone's provider. And an `OPENCODE_CONFIG_CONTENT` the user already set is
|
|
90
|
+
* relayed untouched — there is no way to merge two sources of one variable, and clobbering theirs
|
|
91
|
+
* to add capture would change more than the capture.
|
|
92
|
+
*/
|
|
93
|
+
async function baseURLsThroughProxy(ctx) {
|
|
94
|
+
// There is no way to merge two sources of one variable, and clobbering theirs to add capture
|
|
95
|
+
// would change more than the capture — so it is relayed exactly as it arrived.
|
|
96
|
+
const theirs = readEnv(ctx.env, CONFIG_CONTENT_VAR);
|
|
97
|
+
if (theirs !== undefined)
|
|
98
|
+
return { [CONFIG_CONTENT_VAR]: theirs };
|
|
99
|
+
const scan = await openCodeConfiguredBaseURLs(ctx.env, ctx.cwd);
|
|
100
|
+
if (!scan.trusted)
|
|
101
|
+
return {};
|
|
102
|
+
const provider = {};
|
|
103
|
+
for (const [id, catalogBase] of Object.entries(OPENCODE_FIRST_PARTY_BASE)) {
|
|
104
|
+
const base = scan.overrides.get(id) ?? catalogBase;
|
|
105
|
+
provider[id] = { options: { baseURL: `${proxyBase(ctx.proxyUrl)}${forwardBasePath(base)}` } };
|
|
106
|
+
}
|
|
107
|
+
return { [CONFIG_CONTENT_VAR]: JSON.stringify({ provider }) };
|
|
108
|
+
}
|
|
14
109
|
/**
|
|
15
110
|
* OpenCode picks its provider per model, so both origins are redirected: whichever protocol the
|
|
16
|
-
* chosen model speaks, the traffic lands on the proxy.
|
|
111
|
+
* chosen model speaks, the traffic lands on the proxy. Providers whose origin is neither of the
|
|
112
|
+
* two — OpenCode's own first-party ones, most visibly — are redirected by the config overlay
|
|
113
|
+
* below, because no environment variable can name their origin for them.
|
|
17
114
|
*/
|
|
18
115
|
export const openCodeAdapter = {
|
|
19
116
|
id: 'opencode',
|
|
@@ -46,6 +143,14 @@ export const openCodeAdapter = {
|
|
|
46
143
|
passKey(env, ctx.env, 'OPENAI_API_KEY');
|
|
47
144
|
passKey(env, ctx.env, 'ANTHROPIC_API_KEY');
|
|
48
145
|
}
|
|
146
|
+
Object.assign(env, await baseURLsThroughProxy(ctx));
|
|
147
|
+
// `SHELL` overrides the user's own only to a shim standing in for a shell OpenCode would have
|
|
148
|
+
// picked anyway. With `--no-shell` there is no shim directory, OpenCode's own resolution
|
|
149
|
+
// finds nothing there and falls back exactly as it would unrecorded — so the wrong variable
|
|
150
|
+
// costs nothing, and the right one is what makes the frames file non-empty.
|
|
151
|
+
const shell = await shellThroughShim(ctx.env, ctx.runDir);
|
|
152
|
+
if (shell !== undefined)
|
|
153
|
+
env['SHELL'] = shell;
|
|
49
154
|
return { command: 'opencode', args: [...ctx.userArgs], env };
|
|
50
155
|
},
|
|
51
156
|
};
|
package/dist/opencode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../src/opencode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../src/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,CAAC,iCAAiC,EAAE,4BAA4B,CAAC,CAAC;AAE9F,mFAAmF;AACnF,MAAM,UAAU,kBAAkB;IAChC,OAAO,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,yBAAyB,GAA2B;IACxD,QAAQ,EAAE,4BAA4B;IACtC,aAAa,EAAE,+BAA+B;CAC/C,CAAC;AAEF,2FAA2F;AAC3F,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAErD;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE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
|
2
|
+
/** Whether Qwen Code can authenticate on its own, independent of the environment. */
|
|
3
|
+
export declare function qwenHasOwnAuth(): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Qwen Code, which reaches four different providers and reads a separate origin for each.
|
|
6
|
+
*
|
|
7
|
+
* Two of the four are redirected, and the other two deliberately are not. The line is not about
|
|
8
|
+
* the harness at all — it is about what orca can put on the other end.
|
|
9
|
+
*
|
|
10
|
+
* `OPENAI_BASE_URL` and `ANTHROPIC_BASE_URL` are moved, because the proxy can restore those
|
|
11
|
+
* origins: `resolveUpstream` produces `anthropic`, `openai` and `openai-responses` keys, and the
|
|
12
|
+
* dialects default to `api.anthropic.com` and `api.openai.com` when nothing is configured. A
|
|
13
|
+
* redirected call reaches the provider the client was already addressing.
|
|
14
|
+
*
|
|
15
|
+
* `DASHSCOPE_PROXY_BASE_URL` and `GEMINI_NEXT_GEN_API_BASE_URL` are left alone, and this is the
|
|
16
|
+
* uncomfortable part: they are the origins Qwen's *own* models and Gemini use, so leaving them is
|
|
17
|
+
* a real gap in what a run records. Redirecting them would be worse. The proxy resolves a live
|
|
18
|
+
* upstream by **wire dialect, not by provider**, and no `--upstream` form or gateway setting can
|
|
19
|
+
* name either destination — so with no gateway configured (a setup the README supports outright)
|
|
20
|
+
* a DashScope call arrives as `POST /v1/chat/completions`, is claimed by the openai dialect, and
|
|
21
|
+
* is forwarded to `api.openai.com` carrying `Authorization: Bearer <the user's DashScope key>`.
|
|
22
|
+
* A Gemini call reaches `/v1beta/models/...`, which no dialect claims, so `passthroughOrigin`
|
|
23
|
+
* guesses from headers — and it recognises only Anthropic's, treating everything else as OpenAI,
|
|
24
|
+
* which sends `x-goog-api-key` the same way. Its own comment says why that matters: "a wrong guess
|
|
25
|
+
* does not merely fail — it hands one vendor a key issued by another."
|
|
26
|
+
*
|
|
27
|
+
* So these two join `WEB_SEARCH_BASE_URL` as documented gaps. That one is the web-search tool's
|
|
28
|
+
* endpoint rather than a model origin — off unless `ENABLE_WEB_SEARCH` is set, keyed separately by
|
|
29
|
+
* `WEB_SEARCH_API_KEY` — and pointing it at the proxy without the matching key would break a tool
|
|
30
|
+
* that works today. Different reason, same conclusion: an origin orca cannot serve is one it
|
|
31
|
+
* should not take away.
|
|
32
|
+
*
|
|
33
|
+
* To record Qwen against its own models, terminate the TLS instead of moving the origin. One host
|
|
34
|
+
* is not enough, because `HostPolicy` matches a bare pattern exactly and the harness reaches a
|
|
35
|
+
* whole family — read off the same bundle: `dashscope.aliyuncs.com` is only the default, with
|
|
36
|
+
* `coding.dashscope.aliyuncs.com` and `coding-intl.dashscope.aliyuncs.com` for the coding plan,
|
|
37
|
+
* `cn-hongkong.dashscope.aliyuncs.com`, `dashscope-intl.aliyuncs.com` and
|
|
38
|
+
* `dashscope-us.aliyuncs.com` by region, and the token plan on a different domain again at
|
|
39
|
+
* `token-plan.cn-beijing.maas.aliyuncs.com` / `token-plan.ap-southeast-1.maas.aliyuncs.com`. So:
|
|
40
|
+
*
|
|
41
|
+
* orca record qwen --tls-intercept --tls-hosts \
|
|
42
|
+
* '+dashscope.aliyuncs.com,+*.dashscope.aliyuncs.com,+dashscope-intl.aliyuncs.com,+dashscope-us.aliyuncs.com'
|
|
43
|
+
*
|
|
44
|
+
* adding `+token-plan.cn-beijing.maas.aliyuncs.com` or the Singapore one if that is the plan in
|
|
45
|
+
* use, and `+api-inference.modelscope.cn` for a ModelScope endpoint. The wildcard covers the
|
|
46
|
+
* `*.dashscope` subdomains without reaching the console: DashScope's sign-in lives on
|
|
47
|
+
* `bailian.console.aliyun.com` and `modelstudio.console.alibabacloud.com`, different domains
|
|
48
|
+
* entirely, which is what makes the wildcard narrower here than one over a vendor's whole zone.
|
|
49
|
+
*/
|
|
50
|
+
export declare const qwenAdapter: Adapter;
|
|
51
|
+
//# sourceMappingURL=qwen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen.d.ts","sourceRoot":"","sources":["../src/qwen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAyB,MAAM,wBAAwB,CAAC;AAO7E,qFAAqF;AACrF,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,EAAE,OAsDzB,CAAC"}
|
package/dist/qwen.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { detectAgent, homeDirHas } from './detect.js';
|
|
2
|
+
import { passKey, passThrough, proxyBase, readEnv } from './env.js';
|
|
3
|
+
/** Where `qwen` writes the credentials its OAuth sign-in produces. */
|
|
4
|
+
const QWEN_AUTH_PATH = '.qwen/oauth_creds.json';
|
|
5
|
+
/** Whether Qwen Code can authenticate on its own, independent of the environment. */
|
|
6
|
+
export function qwenHasOwnAuth() {
|
|
7
|
+
return homeDirHas(QWEN_AUTH_PATH);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Qwen Code, which reaches four different providers and reads a separate origin for each.
|
|
11
|
+
*
|
|
12
|
+
* Two of the four are redirected, and the other two deliberately are not. The line is not about
|
|
13
|
+
* the harness at all — it is about what orca can put on the other end.
|
|
14
|
+
*
|
|
15
|
+
* `OPENAI_BASE_URL` and `ANTHROPIC_BASE_URL` are moved, because the proxy can restore those
|
|
16
|
+
* origins: `resolveUpstream` produces `anthropic`, `openai` and `openai-responses` keys, and the
|
|
17
|
+
* dialects default to `api.anthropic.com` and `api.openai.com` when nothing is configured. A
|
|
18
|
+
* redirected call reaches the provider the client was already addressing.
|
|
19
|
+
*
|
|
20
|
+
* `DASHSCOPE_PROXY_BASE_URL` and `GEMINI_NEXT_GEN_API_BASE_URL` are left alone, and this is the
|
|
21
|
+
* uncomfortable part: they are the origins Qwen's *own* models and Gemini use, so leaving them is
|
|
22
|
+
* a real gap in what a run records. Redirecting them would be worse. The proxy resolves a live
|
|
23
|
+
* upstream by **wire dialect, not by provider**, and no `--upstream` form or gateway setting can
|
|
24
|
+
* name either destination — so with no gateway configured (a setup the README supports outright)
|
|
25
|
+
* a DashScope call arrives as `POST /v1/chat/completions`, is claimed by the openai dialect, and
|
|
26
|
+
* is forwarded to `api.openai.com` carrying `Authorization: Bearer <the user's DashScope key>`.
|
|
27
|
+
* A Gemini call reaches `/v1beta/models/...`, which no dialect claims, so `passthroughOrigin`
|
|
28
|
+
* guesses from headers — and it recognises only Anthropic's, treating everything else as OpenAI,
|
|
29
|
+
* which sends `x-goog-api-key` the same way. Its own comment says why that matters: "a wrong guess
|
|
30
|
+
* does not merely fail — it hands one vendor a key issued by another."
|
|
31
|
+
*
|
|
32
|
+
* So these two join `WEB_SEARCH_BASE_URL` as documented gaps. That one is the web-search tool's
|
|
33
|
+
* endpoint rather than a model origin — off unless `ENABLE_WEB_SEARCH` is set, keyed separately by
|
|
34
|
+
* `WEB_SEARCH_API_KEY` — and pointing it at the proxy without the matching key would break a tool
|
|
35
|
+
* that works today. Different reason, same conclusion: an origin orca cannot serve is one it
|
|
36
|
+
* should not take away.
|
|
37
|
+
*
|
|
38
|
+
* To record Qwen against its own models, terminate the TLS instead of moving the origin. One host
|
|
39
|
+
* is not enough, because `HostPolicy` matches a bare pattern exactly and the harness reaches a
|
|
40
|
+
* whole family — read off the same bundle: `dashscope.aliyuncs.com` is only the default, with
|
|
41
|
+
* `coding.dashscope.aliyuncs.com` and `coding-intl.dashscope.aliyuncs.com` for the coding plan,
|
|
42
|
+
* `cn-hongkong.dashscope.aliyuncs.com`, `dashscope-intl.aliyuncs.com` and
|
|
43
|
+
* `dashscope-us.aliyuncs.com` by region, and the token plan on a different domain again at
|
|
44
|
+
* `token-plan.cn-beijing.maas.aliyuncs.com` / `token-plan.ap-southeast-1.maas.aliyuncs.com`. So:
|
|
45
|
+
*
|
|
46
|
+
* orca record qwen --tls-intercept --tls-hosts \
|
|
47
|
+
* '+dashscope.aliyuncs.com,+*.dashscope.aliyuncs.com,+dashscope-intl.aliyuncs.com,+dashscope-us.aliyuncs.com'
|
|
48
|
+
*
|
|
49
|
+
* adding `+token-plan.cn-beijing.maas.aliyuncs.com` or the Singapore one if that is the plan in
|
|
50
|
+
* use, and `+api-inference.modelscope.cn` for a ModelScope endpoint. The wildcard covers the
|
|
51
|
+
* `*.dashscope` subdomains without reaching the console: DashScope's sign-in lives on
|
|
52
|
+
* `bailian.console.aliyun.com` and `modelstudio.console.alibabacloud.com`, different domains
|
|
53
|
+
* entirely, which is what makes the wildcard narrower here than one over a vendor's whole zone.
|
|
54
|
+
*/
|
|
55
|
+
export const qwenAdapter = {
|
|
56
|
+
id: 'qwen',
|
|
57
|
+
aliases: ['qwen-code'],
|
|
58
|
+
harnessVersions: '>=0.22.3',
|
|
59
|
+
async detect(_cwd) {
|
|
60
|
+
return detectAgent(['qwen'], ['.qwen']);
|
|
61
|
+
},
|
|
62
|
+
async prepare(ctx) {
|
|
63
|
+
// Only the two origins the proxy can put a real provider behind. See the note above for why
|
|
64
|
+
// DashScope and Gemini are left pointing at their own APIs rather than at a proxy that would
|
|
65
|
+
// forward them, and their credentials, to OpenAI.
|
|
66
|
+
const env = {
|
|
67
|
+
OPENAI_BASE_URL: proxyBase(ctx.proxyUrl, 'v1'),
|
|
68
|
+
ANTHROPIC_BASE_URL: proxyBase(ctx.proxyUrl),
|
|
69
|
+
};
|
|
70
|
+
// The same credential rule as OpenCode, and for the same two reasons. Which keys the harness
|
|
71
|
+
// can see decides which provider it picks, so a placeholder for a provider the user never
|
|
72
|
+
// configured can change which model answers — and a recorded run that answers differently
|
|
73
|
+
// from the same command uninstrumented is the worst kind of capture bug. Separately, `qwen`
|
|
74
|
+
// signs in on its own: an OAuth run writes `~/.qwen/oauth_creds.json`, and inventing keys in
|
|
75
|
+
// front of that credential makes the harness prefer an environment key that is not real.
|
|
76
|
+
//
|
|
77
|
+
// So placeholders stand in only when there is nothing to disturb: no key in the environment
|
|
78
|
+
// and no sign-in of its own.
|
|
79
|
+
const hasAny = readEnv(ctx.env, 'OPENAI_API_KEY') !== undefined ||
|
|
80
|
+
readEnv(ctx.env, 'ANTHROPIC_API_KEY') !== undefined ||
|
|
81
|
+
readEnv(ctx.env, 'ANTHROPIC_AUTH_TOKEN') !== undefined ||
|
|
82
|
+
readEnv(ctx.env, 'GEMINI_API_KEY') !== undefined ||
|
|
83
|
+
readEnv(ctx.env, 'GOOGLE_API_KEY') !== undefined ||
|
|
84
|
+
readEnv(ctx.env, 'DASHSCOPE_API_KEY') !== undefined;
|
|
85
|
+
if (hasAny || qwenHasOwnAuth()) {
|
|
86
|
+
passThrough(env, ctx.env, 'OPENAI_API_KEY');
|
|
87
|
+
passThrough(env, ctx.env, 'ANTHROPIC_API_KEY');
|
|
88
|
+
passThrough(env, ctx.env, 'ANTHROPIC_AUTH_TOKEN');
|
|
89
|
+
passThrough(env, ctx.env, 'GEMINI_API_KEY');
|
|
90
|
+
passThrough(env, ctx.env, 'GOOGLE_API_KEY');
|
|
91
|
+
passThrough(env, ctx.env, 'DASHSCOPE_API_KEY');
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
passKey(env, ctx.env, 'OPENAI_API_KEY');
|
|
95
|
+
passKey(env, ctx.env, 'ANTHROPIC_API_KEY');
|
|
96
|
+
}
|
|
97
|
+
// `OPENAI_MODEL` is passed on, never invented: Qwen Code has no default for a
|
|
98
|
+
// custom endpoint, so the model id is the operator's to supply and the adapter has no way to
|
|
99
|
+
// know which one the recording is meant to exercise.
|
|
100
|
+
passThrough(env, ctx.env, 'OPENAI_MODEL');
|
|
101
|
+
passThrough(env, ctx.env, 'QWEN_CODE_MODEL');
|
|
102
|
+
return { command: 'qwen', args: [...ctx.userArgs], env };
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=qwen.js.map
|
package/dist/qwen.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen.js","sourceRoot":"","sources":["../src/qwen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EA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
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AActD,qBAAa,eAAe;;IAK1B,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAuBhC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAYxB,oEAAoE;IACpE,GAAG,IAAI,MAAM,EAAE;IAIf;;;;;OAKG;IACH,KAAK,IAAI,MAAM,EAAE;IASjB,0FAA0F;IACpF,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;CAUxD;AAED,wBAAgB,eAAe,IAAI,eAAe,CAgBjD"}
|
package/dist/registry.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { claudeCodeAdapter } from './claude-code.js';
|
|
2
2
|
import { codexAdapter } from './codex.js';
|
|
3
|
+
import { cursorAdapter } from './cursor.js';
|
|
4
|
+
import { kiloAdapter } from './kilo.js';
|
|
5
|
+
import { mimoAdapter } from './mimo.js';
|
|
3
6
|
import { execAdapter } from './exec.js';
|
|
4
7
|
import { genericOpenAiAdapter } from './generic-openai.js';
|
|
5
8
|
import { grokAdapter } from './grok.js';
|
|
6
9
|
import { openClawAdapter } from './openclaw.js';
|
|
7
10
|
import { nodeAdapter } from './node.js';
|
|
8
11
|
import { openCodeAdapter } from './opencode.js';
|
|
12
|
+
import { qwenAdapter } from './qwen.js';
|
|
9
13
|
export class AdapterRegistry {
|
|
10
14
|
#adapters = new Map();
|
|
11
15
|
/** Alias → canonical id. Kept apart from #adapters so `ids()` stays the canonical id space. */
|
|
@@ -74,6 +78,10 @@ export function defaultAdapters() {
|
|
|
74
78
|
registry.register(claudeCodeAdapter);
|
|
75
79
|
registry.register(codexAdapter);
|
|
76
80
|
registry.register(openCodeAdapter);
|
|
81
|
+
registry.register(qwenAdapter);
|
|
82
|
+
registry.register(mimoAdapter);
|
|
83
|
+
registry.register(kiloAdapter);
|
|
84
|
+
registry.register(cursorAdapter);
|
|
77
85
|
registry.register(grokAdapter);
|
|
78
86
|
registry.register(openClawAdapter);
|
|
79
87
|
registry.register(nodeAdapter);
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,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
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@orcareplay/node-instrument": "0.
|
|
21
|
-
"@orcareplay/plugin-api": "0.
|
|
20
|
+
"@orcareplay/node-instrument": "0.2.0",
|
|
21
|
+
"@orcareplay/plugin-api": "0.2.0",
|
|
22
|
+
"@orcareplay/proxy": "0.2.0",
|
|
23
|
+
"@orcareplay/shell-shim": "0.2.0"
|
|
22
24
|
}
|
|
23
25
|
}
|