@orcareplay/adapters 0.1.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.
Files changed (61) hide show
  1. package/dist/claude-code.d.ts +37 -0
  2. package/dist/claude-code.d.ts.map +1 -0
  3. package/dist/claude-code.js +103 -0
  4. package/dist/claude-code.js.map +1 -0
  5. package/dist/codex.d.ts +36 -0
  6. package/dist/codex.d.ts.map +1 -0
  7. package/dist/codex.js +128 -0
  8. package/dist/codex.js.map +1 -0
  9. package/dist/contract.d.ts +41 -0
  10. package/dist/contract.d.ts.map +1 -0
  11. package/dist/contract.js +373 -0
  12. package/dist/contract.js.map +1 -0
  13. package/dist/detect.d.ts +47 -0
  14. package/dist/detect.d.ts.map +1 -0
  15. package/dist/detect.js +123 -0
  16. package/dist/detect.js.map +1 -0
  17. package/dist/env.d.ts +31 -0
  18. package/dist/env.d.ts.map +1 -0
  19. package/dist/env.js +54 -0
  20. package/dist/env.js.map +1 -0
  21. package/dist/generic-openai.d.ts +8 -0
  22. package/dist/generic-openai.d.ts.map +1 -0
  23. package/dist/generic-openai.js +31 -0
  24. package/dist/generic-openai.js.map +1 -0
  25. package/dist/grok.d.ts +23 -0
  26. package/dist/grok.d.ts.map +1 -0
  27. package/dist/grok.js +50 -0
  28. package/dist/grok.js.map +1 -0
  29. package/dist/index.d.ts +15 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +15 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/mcp-config.d.ts +17 -0
  34. package/dist/mcp-config.d.ts.map +1 -0
  35. package/dist/mcp-config.js +62 -0
  36. package/dist/mcp-config.js.map +1 -0
  37. package/dist/node.d.ts +20 -0
  38. package/dist/node.d.ts.map +1 -0
  39. package/dist/node.js +60 -0
  40. package/dist/node.js.map +1 -0
  41. package/dist/openclaw.d.ts +19 -0
  42. package/dist/openclaw.d.ts.map +1 -0
  43. package/dist/openclaw.js +43 -0
  44. package/dist/openclaw.js.map +1 -0
  45. package/dist/opencode.d.ts +9 -0
  46. package/dist/opencode.d.ts.map +1 -0
  47. package/dist/opencode.js +52 -0
  48. package/dist/opencode.js.map +1 -0
  49. package/dist/registry.d.ts +19 -0
  50. package/dist/registry.d.ts.map +1 -0
  51. package/dist/registry.js +82 -0
  52. package/dist/registry.js.map +1 -0
  53. package/dist/scaffold.d.ts +26 -0
  54. package/dist/scaffold.d.ts.map +1 -0
  55. package/dist/scaffold.js +125 -0
  56. package/dist/scaffold.js.map +1 -0
  57. package/dist/session.d.ts +47 -0
  58. package/dist/session.d.ts.map +1 -0
  59. package/dist/session.js +112 -0
  60. package/dist/session.js.map +1 -0
  61. package/package.json +18 -0
@@ -0,0 +1,373 @@
1
+ import { mkdir, mkdtemp, rm } from 'node:fs/promises';
2
+ import { tmpdir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ import { isDeepStrictEqual } from 'node:util';
5
+ import { PLACEHOLDER_KEY, readEnv } from './env.js';
6
+ /**
7
+ * The adapter contract: the behaviour every adapter must have for capture to work at all.
8
+ *
9
+ * Adapters break silently. A harness renames the variable it reads for its API origin, the adapter
10
+ * keeps setting the old one, and every run still *looks* fine — the agent answers, the exit code is
11
+ * zero, and the trace is empty. Each check below exists because breaking it produces exactly that
12
+ * shape of failure: nothing to see until a user files a confusing bug.
13
+ */
14
+ /** Every check, in the order they run. A failing check never stops the others. */
15
+ export const CONTRACT_CHECKS = [
16
+ 'id-format',
17
+ 'detect-resolves',
18
+ 'prepare-shape',
19
+ 'redirects-model-traffic',
20
+ 'no-invented-keys',
21
+ 'no-ctx-mutation',
22
+ 'deterministic',
23
+ 'no-foreign-paths',
24
+ 'harness-versions',
25
+ ];
26
+ /** At least one of these must be redirected, or the proxy sees nothing at all. */
27
+ export const MODEL_BASE_URL_VARS = [
28
+ 'ANTHROPIC_BASE_URL',
29
+ 'OPENAI_BASE_URL',
30
+ 'OPENAI_API_BASE',
31
+ ];
32
+ /** Anything shaped like an API origin, including variables no harness reads yet. */
33
+ const BASE_URL_LIKE = /(?:_BASE_URL|_API_BASE)$/;
34
+ /** Anything shaped like a credential. Over-matching here only ever costs a clearer error. */
35
+ const CREDENTIAL_LIKE = /(?:KEY|TOKEN|SECRET|PASSWORD)$/;
36
+ const ID_FORMAT = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
37
+ /** A port no adapter would plausibly hardcode: the checks must follow `ctx.proxyUrl`. */
38
+ const CONTRACT_PROXY = 'http://127.0.0.1:49831';
39
+ const PROBE_KEY = 'orca-contract-probe';
40
+ /** Returned by a check that does not apply to this adapter, so it is neither passed nor failed. */
41
+ const SKIP = Symbol('skip');
42
+ /**
43
+ * Runs one adapter through the contract. Never throws: a runner that dies on a broken adapter is
44
+ * the same class of bug it is trying to catch, and callers batch this over a whole registry.
45
+ */
46
+ export async function checkAdapterContract(adapter, opts = {}) {
47
+ const root = await mkdtemp(join(tmpdir(), 'orca-contract-'));
48
+ const passed = [];
49
+ const failed = [];
50
+ try {
51
+ const base = await baseContext(root, opts.ctx ?? {});
52
+ const primary = await attempt(adapter, base);
53
+ const runners = [
54
+ ['id-format', async () => idFormat(adapter)],
55
+ ['detect-resolves', () => detectResolves(adapter, base, join(root, 'missing-workspace'))],
56
+ ['prepare-shape', async () => prepareShape(primary)],
57
+ ['redirects-model-traffic', async () => redirectsModelTraffic(primary, base)],
58
+ ['no-invented-keys', () => noInventedKeys(adapter, base)],
59
+ ['no-ctx-mutation', () => noCtxMutation(adapter, base)],
60
+ ['deterministic', () => deterministic(adapter, base)],
61
+ ['no-foreign-paths', async () => noForeignPaths(primary, base)],
62
+ ['harness-versions', async () => harnessVersions(adapter)],
63
+ ];
64
+ for (const [check, run] of runners) {
65
+ let outcome;
66
+ try {
67
+ outcome = await run();
68
+ }
69
+ catch (err) {
70
+ outcome = `the check itself threw: ${describeError(err)}`;
71
+ }
72
+ if (outcome === SKIP)
73
+ continue;
74
+ if (outcome === undefined)
75
+ passed.push(check);
76
+ else
77
+ failed.push({ check, detail: outcome });
78
+ }
79
+ }
80
+ finally {
81
+ await rm(root, { recursive: true, force: true });
82
+ }
83
+ return { adapter: adapter.id, passed, failed, ok: failed.length === 0 };
84
+ }
85
+ /** One line for a pass, one line per failure otherwise — the shape a CI log wants. */
86
+ export function formatContractResult(result) {
87
+ if (result.ok)
88
+ return `${result.adapter}: ok (${result.passed.length} checks)`;
89
+ const total = result.passed.length + result.failed.length;
90
+ const lines = result.failed.map((f) => ` - ${f.check}: ${f.detail}`);
91
+ return [`${result.adapter}: ${result.failed.length}/${total} checks failed`, ...lines].join('\n');
92
+ }
93
+ async function attempt(adapter, base) {
94
+ try {
95
+ return { launch: await adapter.prepare(clone(base)) };
96
+ }
97
+ catch (err) {
98
+ return { error: describeError(err) };
99
+ }
100
+ }
101
+ async function baseContext(root, over) {
102
+ const cwd = over.cwd ?? join(root, 'work');
103
+ const runDir = over.runDir ?? join(root, 'run');
104
+ // Only create the directories we invented: a caller-supplied path is theirs to manage.
105
+ if (over.cwd === undefined)
106
+ await mkdir(cwd, { recursive: true });
107
+ if (over.runDir === undefined)
108
+ await mkdir(runDir, { recursive: true });
109
+ return {
110
+ runId: 'run_contract',
111
+ proxyUrl: CONTRACT_PROXY,
112
+ // An adapter that takes its command from argv (generic-openai) gets one without special-casing.
113
+ userArgs: ['orca-contract-agent', '--task', 'contract check'],
114
+ env: {},
115
+ ...over,
116
+ cwd,
117
+ runDir,
118
+ };
119
+ }
120
+ function clone(ctx) {
121
+ return structuredClone(ctx);
122
+ }
123
+ function describeError(err) {
124
+ return err instanceof Error ? err.message : String(err);
125
+ }
126
+ function notVerified(check) {
127
+ return `not verified: prepare() rejected (see ${check})`;
128
+ }
129
+ function idFormat(adapter) {
130
+ const { id } = adapter;
131
+ if (typeof id !== 'string' || id.trim() === '') {
132
+ return ('id is empty; it is how a user names the adapter on the command line and how a trace ' +
133
+ 'records which adapter produced it');
134
+ }
135
+ if (!ID_FORMAT.test(id)) {
136
+ return `id '${id}' is not lowercase kebab-case; ids appear in 'orca record <id>', in run manifests and in URLs, so mixed case and underscores turn into support questions`;
137
+ }
138
+ return undefined;
139
+ }
140
+ async function detectResolves(adapter, base, missing) {
141
+ const probes = [
142
+ ['a directory that exists', base.cwd],
143
+ ['a path that does not exist', missing],
144
+ ];
145
+ for (const [label, dir] of probes) {
146
+ let value;
147
+ try {
148
+ value = await adapter.detect(dir);
149
+ }
150
+ catch (err) {
151
+ return `detect() rejected for ${label}: ${describeError(err)}. AdapterRegistry treats a throwing detector as "no", so this adapter would silently never be auto-selected — and any caller that does not guard loses detection for every other adapter too. Answer false instead`;
152
+ }
153
+ if (typeof value !== 'boolean') {
154
+ return `detect() resolved ${JSON.stringify(value)} for ${label}; callers write 'if (await adapter.detect(cwd))', so any truthy value silently claims the workspace`;
155
+ }
156
+ }
157
+ return undefined;
158
+ }
159
+ function prepareShape(primary) {
160
+ if ('error' in primary)
161
+ return `prepare() rejected: ${primary.error}`;
162
+ const { launch } = primary;
163
+ const problems = [];
164
+ if (typeof launch?.command !== 'string' || launch.command === '') {
165
+ problems.push('command must be a non-empty string — it is what gets spawned');
166
+ }
167
+ if (!Array.isArray(launch?.args) || !launch.args.every((a) => typeof a === 'string')) {
168
+ problems.push('args must be an array of strings, never a pre-joined command line');
169
+ }
170
+ if (!isStringRecord(launch?.env)) {
171
+ problems.push('env must be an object of string values, which is all a child process can carry');
172
+ }
173
+ return problems.length > 0 ? problems.join('; ') : undefined;
174
+ }
175
+ /**
176
+ * The check that catches adapter rot. If the harness moves to a new variable and nobody updates
177
+ * the adapter, capture returns nothing while every other signal — exit code, output, the agent's
178
+ * own answers — still says the run worked.
179
+ */
180
+ function redirectsModelTraffic(primary, base) {
181
+ if ('error' in primary)
182
+ return notVerified('prepare-shape');
183
+ const env = primary.launch.env;
184
+ if (!isStringRecord(env))
185
+ return notVerified('prepare-shape');
186
+ // Any base-URL-shaped variable counts, not only the three orca happens to know: a harness with
187
+ // its own spelling — grok-cli reads `GROK_BASE_URL` — is redirected just as effectively. So is
188
+ // an adapter that installs the fetch hook instead, for a harness that reads no variable at all.
189
+ // Narrowing this to three names would have failed both of those for setting the wrong thing,
190
+ // when what they set is the only thing that works.
191
+ //
192
+ // This never detected adapter *rot* on its own — an adapter still setting a variable the harness
193
+ // renamed sets a base-URL variable too. The harness fixtures are what catch that, by recording
194
+ // the exact names. What this catches is an adapter that redirects nothing whatsoever.
195
+ const redirected = Object.entries(env).filter(([name, value]) => BASE_URL_LIKE.test(name) && value !== '');
196
+ const hooked = readEnv(env, 'ORCA_PROXY_URL') !== undefined;
197
+ if (redirected.length === 0 && !hooked) {
198
+ return `prepare() set no base-url variable (none of ${MODEL_BASE_URL_VARS.join(', ')}, nor anything else ending _BASE_URL or _API_BASE) and installed no fetch hook, so nothing points the harness at the proxy and the run records no model traffic at all`;
199
+ }
200
+ const host = hostOf(base.proxyUrl) ?? base.proxyUrl;
201
+ const wrong = Object.entries(env)
202
+ .filter(([name]) => BASE_URL_LIKE.test(name))
203
+ .filter(([, value]) => !pointsAtHost(value, host));
204
+ if (wrong.length > 0) {
205
+ const names = wrong.map(([name, value]) => `${name}=${value}`).join(', ');
206
+ return `${names} does not point at the proxy (${base.proxyUrl}); traffic on that origin goes straight to the provider and never reaches the trace`;
207
+ }
208
+ return undefined;
209
+ }
210
+ /**
211
+ * An invented credential is not a convenience: harnesses pick a provider from which credentials
212
+ * are present, so fabricating one can change which model the run calls. `passKey` substitutes an
213
+ * obviously-fake placeholder for the provider the harness actually speaks; anything beyond that
214
+ * has to come from the user's own environment.
215
+ */
216
+ async function noInventedKeys(adapter, base) {
217
+ const bare = await attempt(adapter, { ...base, env: {} });
218
+ if ('error' in bare)
219
+ return notVerified('prepare-shape');
220
+ if (!isStringRecord(bare.launch.env))
221
+ return notVerified('prepare-shape');
222
+ const invented = Object.entries(bare.launch.env).filter(([name]) => CREDENTIAL_LIKE.test(name));
223
+ const fabricated = invented
224
+ .filter(([, value]) => value !== PLACEHOLDER_KEY)
225
+ .map(([name]) => name);
226
+ if (fabricated.length > 0) {
227
+ // Never echo the value: it may be a real credential read from somewhere unexpected.
228
+ return `prepare() set ${fabricated.join(', ')} to a value ctx.env did not contain. If the harness refuses to start without a credential use passKey(), which substitutes the recognisable placeholder '${PLACEHOLDER_KEY}'`;
229
+ }
230
+ const families = [...new Set(invented.map(([name]) => providerFamily(name)))];
231
+ if (families.length < 2)
232
+ return undefined;
233
+ // With one provider's credential already in hand, inventing the other's is what flips the
234
+ // harness's provider auto-selection — and a recorded run then answers from a different model
235
+ // than the same command would without recording.
236
+ for (const family of families) {
237
+ const donor = invented.find(([name]) => providerFamily(name) === family)?.[0];
238
+ if (donor === undefined)
239
+ continue;
240
+ const probeEnv = { [donor]: PROBE_KEY };
241
+ const probe = await attempt(adapter, { ...base, env: probeEnv });
242
+ if ('error' in probe)
243
+ return notVerified('prepare-shape');
244
+ const stillInvented = Object.keys(probe.launch.env).filter((name) => CREDENTIAL_LIKE.test(name) &&
245
+ providerFamily(name) !== family &&
246
+ readEnv(probeEnv, name) === undefined);
247
+ if (stillInvented.length > 0) {
248
+ return `with only ${donor} in ctx.env, prepare() still invents ${stillInvented.join(', ')}; a harness that picks its provider from the credentials it can see will pick a different one under recording. Use passThrough() for a second provider`;
249
+ }
250
+ }
251
+ return undefined;
252
+ }
253
+ /**
254
+ * `orca record` hands the adapter `process.env` itself as `ctx.env` and the parsed argv as
255
+ * `ctx.userArgs`, so a mutation edits the recorder's own environment and the argv it writes into
256
+ * the manifest — which is then replayed.
257
+ */
258
+ async function noCtxMutation(adapter, base) {
259
+ const ctx = clone(base);
260
+ const before = structuredClone(ctx);
261
+ try {
262
+ await adapter.prepare(ctx);
263
+ }
264
+ catch {
265
+ return notVerified('prepare-shape');
266
+ }
267
+ if (isDeepStrictEqual(ctx, before))
268
+ return undefined;
269
+ const fields = Object.keys(before).filter((key) => !isDeepStrictEqual(ctx[key], before[key]));
270
+ return `prepare() mutated ctx.${fields.join(', ctx.')}; the caller owns that object and reuses it — copy instead, e.g. args: [...ctx.userArgs]`;
271
+ }
272
+ /** Replay prepares the same context again. Anything that drifts turns into a false divergence. */
273
+ async function deterministic(adapter, base) {
274
+ const first = await attempt(adapter, base);
275
+ const second = await attempt(adapter, base);
276
+ if ('error' in first || 'error' in second)
277
+ return notVerified('prepare-shape');
278
+ const drifted = ['command', 'args', 'env'].filter((key) => !isDeepStrictEqual(first.launch[key], second.launch[key]));
279
+ if (drifted.length === 0)
280
+ return undefined;
281
+ return `two prepare() calls on the same ctx disagreed on ${drifted.join(', ')}; replay prepares the same context again, so anything random or time-based here reads as a divergence`;
282
+ }
283
+ /**
284
+ * Cheap leak check. Launch env is written into the run manifest and shared with bug reports, so an
285
+ * absolute path from outside the run is both a privacy leak and a value nobody else can reproduce.
286
+ */
287
+ function noForeignPaths(primary, base) {
288
+ if ('error' in primary)
289
+ return notVerified('prepare-shape');
290
+ const env = primary.launch.env;
291
+ if (!isStringRecord(env))
292
+ return notVerified('prepare-shape');
293
+ for (const [name, value] of Object.entries(env)) {
294
+ for (const candidate of absolutePaths(value)) {
295
+ if (isInside(candidate, base.runDir) || isInside(candidate, base.cwd))
296
+ continue;
297
+ return `env ${name} contains ${candidate}, which is outside ctx.runDir and ctx.cwd; write scratch config under ctx.runDir so the launch is reproducible on a machine that is not yours`;
298
+ }
299
+ }
300
+ return undefined;
301
+ }
302
+ function harnessVersions(adapter) {
303
+ const range = adapter.harnessVersions;
304
+ if (range === undefined)
305
+ return SKIP;
306
+ if (typeof range !== 'string' || range.trim() === '') {
307
+ return 'harnessVersions is set but empty; leave it off entirely rather than declaring a range that matches nothing';
308
+ }
309
+ return isSemverRange(range)
310
+ ? undefined
311
+ : `harnessVersions '${range}' is not a semver range; it is the field that says which harness versions this adapter was actually verified against, so 'latest' or a date says nothing`;
312
+ }
313
+ function isStringRecord(value) {
314
+ return (typeof value === 'object' &&
315
+ value !== null &&
316
+ !Array.isArray(value) &&
317
+ Object.values(value).every((v) => typeof v === 'string'));
318
+ }
319
+ function hostOf(url) {
320
+ try {
321
+ return new URL(url).host;
322
+ }
323
+ catch {
324
+ return undefined;
325
+ }
326
+ }
327
+ function pointsAtHost(value, host) {
328
+ const valueHost = hostOf(value);
329
+ return valueHost !== undefined ? valueHost === host : value.includes(host);
330
+ }
331
+ /** `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` are one provider; `OPENAI_API_KEY` is another. */
332
+ function providerFamily(name) {
333
+ return name.split('_')[0] ?? name;
334
+ }
335
+ const URL_LIKE = /\b[a-z][a-z0-9+.-]*:\/\/\S+/gi;
336
+ const ABSOLUTE_PATH = /(?:^|[\s:;,"'=])((?:[A-Za-z]:[\\/]|\/)[^\s:;,"'=]*)/g;
337
+ /** Absolute-looking paths in a value, ignoring the path component of any URL inside it. */
338
+ function absolutePaths(value) {
339
+ const withoutUrls = value.replace(URL_LIKE, ' ');
340
+ const found = [];
341
+ for (const match of withoutUrls.matchAll(ABSOLUTE_PATH)) {
342
+ const path = match[1];
343
+ // One segment (`/v1`, `/tmp`) is not a leak; a leak has a directory in it.
344
+ if (path !== undefined && path.split(/[\\/]/).filter(Boolean).length > 1)
345
+ found.push(path);
346
+ }
347
+ return found;
348
+ }
349
+ function isInside(path, base) {
350
+ if (base === '')
351
+ return false;
352
+ const prefix = base.endsWith('/') ? base : `${base}/`;
353
+ return path === base || path.startsWith(prefix);
354
+ }
355
+ const SEMVER_COMPARATOR = /^(?:[<>]=?|=|[~^])?v?(?:\d+|[xX*])(?:\.(?:\d+|[xX*]))?(?:\.(?:\d+|[xX*]))?(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
356
+ /**
357
+ * Shape check only — no semver dependency, and a range that parses is not a range anyone verified.
358
+ * It exists to catch `latest`, `1.0` typoed as `v1,0`, and dates.
359
+ */
360
+ function isSemverRange(range) {
361
+ const parts = range.split('||');
362
+ return parts.every((part) => {
363
+ const tokens = part
364
+ .replace(/([<>=~^]+)\s+/g, '$1')
365
+ .trim()
366
+ .split(/\s+/)
367
+ .filter((t) => t !== '');
368
+ if (tokens.length === 0)
369
+ return false;
370
+ return tokens.every((token) => token === '*' || token === '-' || SEMVER_COMPARATOR.test(token));
371
+ });
372
+ }
373
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEpD;;;;;;;GAOG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,yBAAyB;IACzB,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;CACV,CAAC;AA0BX,kFAAkF;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,oBAAoB;IACpB,iBAAiB;IACjB,iBAAiB;CACT,CAAC;AAEX,oFAAoF;AACpF,MAAM,aAAa,GAAG,0BAA0B,CAAC;AAEjD,6FAA6F;AAC7F,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEzD,MAAM,SAAS,GAAG,4BAA4B,CAAC;AAE/C,yFAAyF;AACzF,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAExC,mGAAmG;AACnG,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAI5B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAgB,EAChB,OAAwB,EAAE;IAE1B,MAAM,IAAI,GAAG,MAAM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C,IAAY,EAAE,IAAY;IAC1C,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;IACtD,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,iBAAiB,GACrB,sHAAsH,CAAC;AAEzH;;;GAGG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;QAC1B,MAAM,MAAM,GAAG,IAAI;aAChB,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC;aAC/B,IAAI,EAAE;aACN,KAAK,CAAC,KAAK,CAAC;aACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QACtC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Detection runs before every recording, and a detector that throws would take the whole run with
3
+ * it. Every helper here answers false instead of failing.
4
+ */
5
+ export declare function hasBinary(name: string): Promise<boolean>;
6
+ /**
7
+ * The path a launcher must actually spawn, or undefined when the name is not on PATH.
8
+ *
9
+ * Detection and launching have to agree. On Windows an npm-installed agent is three shims —
10
+ * `claude`, `claude.cmd`, `claude.ps1` — and only the `.cmd` is something `CreateProcess` will
11
+ * run. `spawn` does no PATHEXT resolution of its own, so a launcher handed the bare name finds
12
+ * the extensionless shell script, cannot execute it, and reports ENOENT for an agent that
13
+ * `orca doctor` had just called present. Resolving here, against the same PATHEXT walk detection
14
+ * uses, is what keeps the two answers the same.
15
+ *
16
+ * Not `shell: true`: that would hand the agent's own arguments to a command interpreter.
17
+ */
18
+ export declare function resolveBinary(name: string): Promise<string | undefined>;
19
+ /** What `spawn` must actually be given to launch `command` with `args`. */
20
+ export interface LaunchTarget {
21
+ file: string;
22
+ args: string[];
23
+ /** True only for a Windows batch shim, which `spawn` refuses to run any other way. */
24
+ shell: boolean;
25
+ }
26
+ /**
27
+ * Resolve a command to something `spawn` can launch on this platform.
28
+ *
29
+ * Windows makes this three cases rather than one. An npm-installed agent is a set of shims —
30
+ * `claude`, `claude.cmd`, `claude.ps1` — and `spawn` does no PATHEXT resolution, so the bare name
31
+ * finds the extensionless shell script and fails ENOENT. Resolving to the `.cmd` then hits the
32
+ * second wall: since the batch-injection fix, Node refuses to spawn `.cmd` or `.bat` without a
33
+ * shell and answers EINVAL. Only a batch shim needs that shell, and only then do the arguments
34
+ * have to survive cmd.exe, which is what the quoting is for. A real `.exe` still spawns directly.
35
+ */
36
+ export declare function resolveLaunch(command: string, args: string[]): Promise<LaunchTarget>;
37
+ /**
38
+ * The home directory as the *child process* will see it. A host that hands us a rebuilt env object
39
+ * detaches `process.env` from the OS environment, and `os.homedir()` then answers for a home the
40
+ * agent will never be launched with — so the JS-visible value wins where it is set.
41
+ */
42
+ export declare function homeDir(): string;
43
+ /** True when `~/<relative>` exists — the cheap "this agent has been run here before" signal. */
44
+ export declare function homeDirHas(relative: string): boolean;
45
+ /** True when any of the given binaries or home-relative config paths is present. */
46
+ export declare function detectAgent(binaries: string[], homePaths: string[]): Promise<boolean>;
47
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAY9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK7E;AAED,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,sFAAsF;IACtF,KAAK,EAAE,OAAO,CAAC;CAChB;AAkBD;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAK1F;AAwBD;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED,oFAAoF;AACpF,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAM3F"}
package/dist/detect.js ADDED
@@ -0,0 +1,123 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { existsSync } from 'node:fs';
3
+ import { access, stat } from 'node:fs/promises';
4
+ import { homedir } from 'node:os';
5
+ import { delimiter, extname, join } from 'node:path';
6
+ /**
7
+ * Detection runs before every recording, and a detector that throws would take the whole run with
8
+ * it. Every helper here answers false instead of failing.
9
+ */
10
+ export async function hasBinary(name) {
11
+ if (process.platform === 'win32') {
12
+ return (await resolveWindowsBinary(name, process.env.PATH ?? '')) !== undefined;
13
+ }
14
+ return new Promise((resolve) => {
15
+ // execFile, never a shell: `name` reaches the lookup as one argv element, so an agent id
16
+ // carrying shell metacharacters cannot become a command.
17
+ execFile('which', [name], { timeout: 5_000 }, (err, stdout) => {
18
+ resolve(!err && stdout.trim().length > 0);
19
+ });
20
+ });
21
+ }
22
+ /**
23
+ * The path a launcher must actually spawn, or undefined when the name is not on PATH.
24
+ *
25
+ * Detection and launching have to agree. On Windows an npm-installed agent is three shims —
26
+ * `claude`, `claude.cmd`, `claude.ps1` — and only the `.cmd` is something `CreateProcess` will
27
+ * run. `spawn` does no PATHEXT resolution of its own, so a launcher handed the bare name finds
28
+ * the extensionless shell script, cannot execute it, and reports ENOENT for an agent that
29
+ * `orca doctor` had just called present. Resolving here, against the same PATHEXT walk detection
30
+ * uses, is what keeps the two answers the same.
31
+ *
32
+ * Not `shell: true`: that would hand the agent's own arguments to a command interpreter.
33
+ */
34
+ export async function resolveBinary(name) {
35
+ if (process.platform !== 'win32')
36
+ return name;
37
+ // An explicit path is already the answer; PATH does not enter into it.
38
+ if (name.includes('/') || name.includes('\\'))
39
+ return name;
40
+ return resolveWindowsBinary(name, process.env.PATH ?? '');
41
+ }
42
+ /** cmd.exe reads these before the program does, so they have to be escaped for it first. */
43
+ const CMD_META = /([()\][%!^"`<>&|;, *?])/g;
44
+ /**
45
+ * Quote one argument so that cmd.exe hands the program back exactly the string we started with.
46
+ *
47
+ * Two parsers run in sequence: cmd.exe strips `^` escapes, then the program's own CommandLineToArgv
48
+ * splits what is left. So the backslash-before-quote doubling has to happen first, and the `^`
49
+ * escaping of everything — the quotes we just added included — second.
50
+ */
51
+ function quoteForCmd(arg) {
52
+ let quoted = arg.replace(/(\\*)"/g, '$1$1\\"');
53
+ quoted = quoted.replace(/(\\*)$/, '$1$1');
54
+ return `"${quoted}"`.replace(CMD_META, '^$&');
55
+ }
56
+ /**
57
+ * Resolve a command to something `spawn` can launch on this platform.
58
+ *
59
+ * Windows makes this three cases rather than one. An npm-installed agent is a set of shims —
60
+ * `claude`, `claude.cmd`, `claude.ps1` — and `spawn` does no PATHEXT resolution, so the bare name
61
+ * finds the extensionless shell script and fails ENOENT. Resolving to the `.cmd` then hits the
62
+ * second wall: since the batch-injection fix, Node refuses to spawn `.cmd` or `.bat` without a
63
+ * shell and answers EINVAL. Only a batch shim needs that shell, and only then do the arguments
64
+ * have to survive cmd.exe, which is what the quoting is for. A real `.exe` still spawns directly.
65
+ */
66
+ export async function resolveLaunch(command, args) {
67
+ if (process.platform !== 'win32')
68
+ return { file: command, args, shell: false };
69
+ const file = (await resolveBinary(command)) ?? command;
70
+ if (!/\.(cmd|bat)$/i.test(file))
71
+ return { file, args, shell: false };
72
+ return { file: quoteForCmd(file), args: args.map(quoteForCmd), shell: true };
73
+ }
74
+ async function resolveWindowsBinary(name, pathVar) {
75
+ const extensions = extname(name) !== ''
76
+ ? ['']
77
+ : (process.env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';').filter(Boolean);
78
+ for (const entry of pathVar.split(delimiter)) {
79
+ if (entry === '')
80
+ continue;
81
+ for (const extension of extensions) {
82
+ const candidate = join(entry, `${name}${extension.toLowerCase()}`);
83
+ try {
84
+ if ((await stat(candidate)).isFile()) {
85
+ await access(candidate);
86
+ return candidate;
87
+ }
88
+ }
89
+ catch {
90
+ // Keep searching the rest of PATH. Detection must never take the CLI down.
91
+ }
92
+ }
93
+ }
94
+ return undefined;
95
+ }
96
+ /**
97
+ * The home directory as the *child process* will see it. A host that hands us a rebuilt env object
98
+ * detaches `process.env` from the OS environment, and `os.homedir()` then answers for a home the
99
+ * agent will never be launched with — so the JS-visible value wins where it is set.
100
+ */
101
+ export function homeDir() {
102
+ return process.env['HOME'] || process.env['USERPROFILE'] || homedir();
103
+ }
104
+ /** True when `~/<relative>` exists — the cheap "this agent has been run here before" signal. */
105
+ export function homeDirHas(relative) {
106
+ try {
107
+ return existsSync(join(homeDir(), relative));
108
+ }
109
+ catch {
110
+ return false;
111
+ }
112
+ }
113
+ /** True when any of the given binaries or home-relative config paths is present. */
114
+ export async function detectAgent(binaries, homePaths) {
115
+ if (homePaths.some(homeDirHas))
116
+ return true;
117
+ for (const bin of binaries) {
118
+ if (await hasBinary(bin))
119
+ return true;
120
+ }
121
+ return false;
122
+ }
123
+ //# sourceMappingURL=detect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,CAAC,MAAM,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;IAClF,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,yFAAyF;QACzF,yDAAyD;QACzD,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAC5D,OAAO,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IAC9C,uEAAuE;IACvE,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B;IACvE,IAAI,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,MAAM,SAAS,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
package/dist/env.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Placeholder key for runs where the user has no credential in the environment. The proxy is
3
+ * holding the real one (or serving from a trace), but SDK clients refuse to start without
4
+ * *something* — so an obviously-fake value beats an empty string that looks like a real key.
5
+ */
6
+ export declare const PLACEHOLDER_KEY = "orca-recorded";
7
+ /** An env var set to the empty string is unset for our purposes: an empty key breaks clients. */
8
+ export declare function readEnv(env: Record<string, string | undefined>, name: string): string | undefined;
9
+ /** Joins a path onto the proxy url without producing `//`, whether or not the base ends in `/`. */
10
+ export declare function proxyBase(proxyUrl: string, path?: string): string;
11
+ /** Copies `name` from the run environment into the launch overlay, or a placeholder if unset. */
12
+ export declare function passKey(target: Record<string, string>, env: Record<string, string | undefined>, name: string): void;
13
+ /** Copies `name` only if it is actually set — used for optional tokens we must not invent. */
14
+ export declare function passThrough(target: Record<string, string>, env: Record<string, string | undefined>, name: string): void;
15
+ /**
16
+ * Point base-URL variables orca does not know about at the proxy.
17
+ *
18
+ * Read from `ORCA_BASE_URL_VARS`: a comma-separated list of variable names, each optionally with
19
+ * `=<path>` when the origin is not OpenAI-shaped. `/v1` is the default suffix because that is what
20
+ * an OpenAI-compatible override wants, and it is what every example in the wild ends in.
21
+ *
22
+ * This exists because enumerating them is hopeless. Hermes alone overrides per provider —
23
+ * `NOVITA_BASE_URL`, `GLM_BASE_URL`, `KIMI_BASE_URL`, `MINIMAX_BASE_URL`, `HF_BASE_URL`,
24
+ * `NEBIUS_BASE_URL` and a dozen more in one `.env.example` — and a list of names baked in here
25
+ * would be stale the week after it was written. A harness the author has never heard of is the
26
+ * normal case, so it gets a mechanism rather than a pull request.
27
+ *
28
+ * The variable is consumed, never forwarded: it names other variables and means nothing downstream.
29
+ */
30
+ export declare function applyNamedBaseUrls(target: Record<string, string>, env: Record<string, string | undefined>, proxyUrl: string): void;
31
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,iGAAiG;AACjG,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGjG;AAED,mGAAmG;AACnG,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAG7D;AAED,iGAAiG;AACjG,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,IAAI,EAAE,MAAM,GACX,IAAI,CAEN;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,IAAI,EAAE,MAAM,GACX,IAAI,CAGN;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,QAAQ,EAAE,MAAM,GACf,IAAI,CAUN"}