@bitkyc08/opencodex 2.7.43 → 2.8.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/bin/ocx.mjs +34 -8
- package/gui/dist/assets/index-BDjpkcRN.js +67 -0
- package/gui/dist/assets/index-BHsKRFh9.css +1 -0
- package/gui/dist/index.html +2 -2
- package/package.json +1 -1
- package/src/adapters/cursor/discovery.ts +4 -1
- package/src/adapters/cursor/effort-map.ts +3 -0
- package/src/adapters/kiro.ts +15 -1
- package/src/claude/alias.ts +94 -14
- package/src/claude/outbound.ts +6 -3
- package/src/cli/catalog-prewarm.ts +24 -0
- package/src/cli/claude.ts +32 -7
- package/src/cli/doctor.ts +48 -1
- package/src/cli/index.ts +5 -0
- package/src/cli/interactive-confirm.ts +5 -1
- package/src/cli/star-prompt.ts +26 -4
- package/src/cli/v2.ts +10 -1
- package/src/codex/account-store.ts +2 -0
- package/src/codex/catalog/bundled.ts +9 -2
- package/src/codex/catalog/parsing.ts +26 -1
- package/src/codex/catalog/provider-fetch.ts +240 -82
- package/src/codex/catalog/sync.ts +27 -5
- package/src/codex/catalog.ts +1 -1
- package/src/codex/features.ts +524 -5
- package/src/codex/quota.ts +77 -2
- package/src/codex/runtime.ts +10 -1
- package/src/config.ts +8 -0
- package/src/generated/jawcode-model-metadata.ts +12 -12
- package/src/github/star-state.ts +191 -0
- package/src/lib/bun-binary-validator.d.mts +3 -0
- package/src/lib/bun-binary-validator.mjs +18 -0
- package/src/lib/bun-runtime.ts +6 -20
- package/src/lib/destination-policy.ts +10 -3
- package/src/lib/provider-outbound.ts +5 -2
- package/src/lib/shadow-call.ts +30 -0
- package/src/lib/test-home-guard.ts +90 -0
- package/src/lib/win-exec.ts +12 -2
- package/src/oauth/index.ts +29 -5
- package/src/oauth/key-providers.ts +21 -2
- package/src/oauth/kiro-credentials.ts +57 -8
- package/src/oauth/kiro.ts +2 -1
- package/src/oauth/login-cli.ts +1 -1
- package/src/oauth/store.ts +2 -0
- package/src/providers/derive.ts +2 -2
- package/src/providers/model-discovery.ts +356 -0
- package/src/providers/registry.ts +114 -0
- package/src/router.ts +5 -3
- package/src/server/auth-cors.ts +4 -2
- package/src/server/live.ts +75 -25
- package/src/server/management/agent-settings-routes.ts +78 -4
- package/src/server/management/config-routes.ts +19 -7
- package/src/server/management/context.ts +11 -1
- package/src/server/management/model-routes.ts +46 -13
- package/src/server/management/provider-routes.ts +44 -9
- package/src/server/management/shared.ts +2 -2
- package/src/server/management/sidebar-routes.ts +39 -0
- package/src/server/management-api.ts +3 -1
- package/src/server/responses/core.ts +31 -20
- package/src/server/responses/upstream-error.ts +48 -0
- package/src/server/startup-action-control.ts +30 -14
- package/src/service.ts +237 -19
- package/src/storage/policy-job.ts +26 -5
- package/src/storage/restore-job.ts +16 -5
- package/src/storage/worker-lifecycle.ts +81 -0
- package/src/tray/windows.ts +32 -4
- package/src/types.ts +11 -0
- package/src/update/badge.ts +72 -0
- package/src/update/job.ts +8 -4
- package/src/usage/expected-prices.ts +6 -5
- package/src/usage/log.ts +8 -0
- package/src/web-search/loop.ts +57 -16
- package/gui/dist/assets/index-Czw-jpTU.css +0 -1
- package/gui/dist/assets/index-cmds12BG.js +0 -67
package/bin/ocx.mjs
CHANGED
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { spawn, spawnSync } from "node:child_process";
|
|
12
12
|
import { createRequire } from "node:module";
|
|
13
|
-
import { existsSync, readFileSync, readdirSync
|
|
13
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
14
14
|
import { homedir } from "node:os";
|
|
15
15
|
import { dirname, join, resolve } from "node:path";
|
|
16
16
|
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { isRealBunBinary } from "../src/lib/bun-binary-validator.mjs";
|
|
17
18
|
import { npmInvocation } from "../src/update/npm-invocation.mjs";
|
|
18
19
|
import { handoffWindowsTrayForUpdate, planWindowsTrayUpdate } from "../src/update/tray-update-plan.mjs";
|
|
19
20
|
|
|
@@ -287,18 +288,14 @@ function bunBinDir() {
|
|
|
287
288
|
return dirname(require.resolve("bun/package.json"));
|
|
288
289
|
}
|
|
289
290
|
|
|
290
|
-
|
|
291
|
-
// postinstall downloads the real ~60MB binary. --ignore-scripts / pnpm leave
|
|
292
|
-
// the ~450-byte stub in place, which is NOT executable (ENOEXEC). A size gate
|
|
293
|
-
// cleanly distinguishes the stub from a real binary on every platform.
|
|
294
|
-
const REAL_BUN_MIN_BYTES = 1_000_000;
|
|
291
|
+
const BUN_OVERRIDE_ENV = "OPENCODEX_BUN_PATH";
|
|
295
292
|
|
|
296
293
|
function findBunBinary(bunDir) {
|
|
297
294
|
// The npm `bun` package ships the binary as bin/bun.exe on every platform;
|
|
298
295
|
// probe bin/bun too for forward compatibility.
|
|
299
296
|
for (const name of ["bun.exe", "bun"]) {
|
|
300
297
|
const p = join(bunDir, "bin", name);
|
|
301
|
-
if (
|
|
298
|
+
if (isRealBunBinary(p)) return p;
|
|
302
299
|
}
|
|
303
300
|
return null;
|
|
304
301
|
}
|
|
@@ -317,6 +314,17 @@ function fail(msg) {
|
|
|
317
314
|
}
|
|
318
315
|
|
|
319
316
|
function resolveBun() {
|
|
317
|
+
// Keep direct npm-launcher starts aligned with durable service/shim installs:
|
|
318
|
+
// a valid explicit runtime must win even when the bundled dependency exists.
|
|
319
|
+
const override = process.env[BUN_OVERRIDE_ENV]?.trim();
|
|
320
|
+
if (override) {
|
|
321
|
+
const overridePath = resolve(override);
|
|
322
|
+
if (isRealBunBinary(overridePath)) return overridePath;
|
|
323
|
+
console.error(
|
|
324
|
+
`opencodex: ${BUN_OVERRIDE_ENV} is missing, unreadable, or not a complete Bun binary; falling back to the bundled runtime.`,
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
320
328
|
let bunDir;
|
|
321
329
|
try {
|
|
322
330
|
bunDir = bunBinDir();
|
|
@@ -361,7 +369,25 @@ const bun = resolveBun();
|
|
|
361
369
|
// signal delivered only to this launcher (Codex app, IDE terminal, service wrapper,
|
|
362
370
|
// or `kill -INT <launcherPid>`) killed the launcher and ORPHANED the Bun proxy —
|
|
363
371
|
// port left bound, pid/runtime-port files left behind, Codex config not restored.
|
|
364
|
-
|
|
372
|
+
//
|
|
373
|
+
// Provenance seam for issue #701: THIS launcher runs under Node, which does not
|
|
374
|
+
// auto-load a project `.env`/`.env.local`; the Bun child does, before any opencodex
|
|
375
|
+
// code evaluates. So this is the last point that can still tell a real shell export
|
|
376
|
+
// from a working-directory dotenv value, and we record which Anthropic credential
|
|
377
|
+
// slots already existed. `src/cli/claude.ts` then treats anything present in the Bun
|
|
378
|
+
// child but missing from this list as ambient project pollution rather than user auth,
|
|
379
|
+
// which stopped a project dotenv from silently moving a claude.ai subscriber onto API
|
|
380
|
+
// billing. An EMPTY value is meaningful (the launcher ran and saw no slots) and is
|
|
381
|
+
// distinct from the variable being absent (no launcher at all — change nothing), so
|
|
382
|
+
// this must stay a plain assignment and never be collapsed to a falsy check.
|
|
383
|
+
// Disabling Bun's dotenv wholesale with --no-env-file is NOT an option: config
|
|
384
|
+
// interpolation and provider settings legitimately read the project environment.
|
|
385
|
+
const preBunAnthropicSlots = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"]
|
|
386
|
+
.filter(name => typeof process.env[name] === "string" && process.env[name] !== "");
|
|
387
|
+
const child = spawn(bun, [cliPath, ...process.argv.slice(2)], {
|
|
388
|
+
stdio: "inherit",
|
|
389
|
+
env: { ...process.env, OCX_PRE_BUN_ANTHROPIC_ENV: preBunAnthropicSlots.join(",") },
|
|
390
|
+
});
|
|
365
391
|
|
|
366
392
|
// Windows has no real POSIX signals (no SIGHUP); forwarding is best-effort there.
|
|
367
393
|
const FORWARDED = process.platform === "win32" ? ["SIGINT", "SIGTERM"] : ["SIGINT", "SIGTERM", "SIGHUP"];
|