@bitkyc08/opencodex 2.10.1 → 2.10.2-preview.20260806

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 (57) hide show
  1. package/bin/ocx.mjs +18 -9
  2. package/gui/dist/assets/{index-Cd6_PBKn.css → index-Ca_3269W.css} +1 -1
  3. package/gui/dist/assets/index-CkoP8YwF.js +70 -0
  4. package/gui/dist/index.html +2 -2
  5. package/gui/dist/provider-icons/commandcode-color.svg +1 -0
  6. package/gui/dist/provider-icons/openai.svg +1 -1
  7. package/package.json +1 -1
  8. package/src/adapters/command-code.ts +453 -0
  9. package/src/adapters/google.ts +3 -0
  10. package/src/cli/claude.ts +37 -22
  11. package/src/cli/index.ts +16 -3
  12. package/src/cli/launcher-context.ts +77 -0
  13. package/src/codex/admission.ts +1 -1
  14. package/src/codex/app-server-processes.ts +44 -1
  15. package/src/codex/catalog/sync.ts +22 -3
  16. package/src/codex/catalog-write-serialization.ts +1 -1
  17. package/src/codex/codex-write-lock.ts +1 -1
  18. package/src/codex/convergence-types.ts +1 -1
  19. package/src/codex/desired-state.ts +27 -7
  20. package/src/codex/history-job.ts +1 -1
  21. package/src/codex/history-lock.ts +1 -1
  22. package/src/codex/history-worker.ts +1 -1
  23. package/src/codex/internal/history-writer.ts +1 -1
  24. package/src/codex/transition-state.ts +1 -1
  25. package/src/codex/user-identity.ts +1 -1
  26. package/src/config.ts +6 -1
  27. package/src/integrations/config-io.ts +1 -1
  28. package/src/integrations/journal.ts +1 -1
  29. package/src/integrations/merge.ts +1 -1
  30. package/src/integrations/ownership.ts +1 -1
  31. package/src/integrations/registry.ts +1 -1
  32. package/src/integrations/serialize.ts +1 -1
  33. package/src/integrations/state.ts +1 -1
  34. package/src/integrations/store.ts +1 -1
  35. package/src/integrations/writer.ts +1 -1
  36. package/src/lib/bounded-body.ts +3 -1
  37. package/src/lib/bun-runtime.ts +21 -17
  38. package/src/lib/bun-stream-caps.ts +1 -1
  39. package/src/lib/local-management-attestation.ts +51 -0
  40. package/src/lib/shadow-call.ts +4 -4
  41. package/src/oauth/command-code.ts +239 -0
  42. package/src/oauth/health.ts +46 -2
  43. package/src/oauth/index.ts +38 -3
  44. package/src/providers/command-code-efforts.ts +85 -0
  45. package/src/providers/google-vertex-location.ts +14 -0
  46. package/src/providers/registry.ts +138 -26
  47. package/src/routing/capability.ts +1 -0
  48. package/src/server/adapter-resolve.ts +3 -0
  49. package/src/server/auth-cors.ts +6 -1
  50. package/src/server/index.ts +44 -2
  51. package/src/server/management/integration-routes.ts +1 -1
  52. package/src/server/management/native-integration-routes.ts +2 -2
  53. package/src/server/responses/core.ts +13 -9
  54. package/src/storage/scanner.ts +1 -1
  55. package/src/types.ts +6 -0
  56. package/src/usage/log.ts +1 -1
  57. package/gui/dist/assets/index-ChZQsmBY.js +0 -70
package/bin/ocx.mjs CHANGED
@@ -9,6 +9,7 @@
9
9
  * src/cli/index.ts — only the published npm `bin` routes through here.)
10
10
  */
11
11
  import { spawn, spawnSync } from "node:child_process";
12
+ import { randomBytes } from "node:crypto";
12
13
  import { createRequire } from "node:module";
13
14
  import { existsSync, readFileSync, readdirSync } from "node:fs";
14
15
  import { homedir } from "node:os";
@@ -22,6 +23,8 @@ const PKG = "@bitkyc08/opencodex";
22
23
  const require = createRequire(import.meta.url);
23
24
  const here = dirname(fileURLToPath(import.meta.url));
24
25
  const cliPath = join(here, "..", "src", "cli", "index.ts");
26
+ const NODE_LAUNCH_CONTEXT_ENV = "OCX_NODE_LAUNCH_CONTEXT";
27
+ const NODE_LAUNCH_PROOF_PREFIX = "--ocx-internal-launch-proof=";
25
28
 
26
29
  function isNodeModulesInstall() {
27
30
  return here.split(/[\\/]/).includes("node_modules");
@@ -449,22 +452,28 @@ const bun = bunRuntime.path;
449
452
  // Provenance seam for issue #701: THIS launcher runs under Node, which does not
450
453
  // auto-load a project `.env`/`.env.local`; the Bun child does, before any opencodex
451
454
  // code evaluates. So this is the last point that can still tell a real shell export
452
- // from a working-directory dotenv value, and we record which Anthropic credential
453
- // slots already existed. `src/cli/claude.ts` then treats anything present in the Bun
454
- // child but missing from this list as ambient project pollution rather than user auth,
455
+ // from a working-directory dotenv value, and we record which Anthropic credential or
456
+ // destination slots already existed. The context is paired with a random proof carried
457
+ // in argv, which project dotenv cannot modify during an ordinary `ocx` invocation.
458
+ // `src/cli/claude.ts` treats anything present in the Bun child but missing from this
459
+ // list as ambient project pollution rather than user auth or destination,
455
460
  // which stopped a project dotenv from silently moving a claude.ai subscriber onto API
456
- // billing. An EMPTY value is meaningful (the launcher ran and saw no slots) and is
457
- // distinct from the variable being absent (no launcher at all — change nothing), so
458
- // this must stay a plain assignment and never be collapsed to a falsy check.
461
+ // billing and prevents it from redirecting the subscriber's OAuth bearer.
459
462
  // Disabling Bun's dotenv wholesale with --no-env-file is NOT an option: config
460
463
  // interpolation and provider settings legitimately read the project environment.
461
- const preBunAnthropicSlots = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"]
464
+ const preBunAnthropicSlots = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN", "ANTHROPIC_BASE_URL"]
462
465
  .filter(name => typeof process.env[name] === "string" && process.env[name] !== "");
463
- const child = spawn(bun, [cliPath, ...process.argv.slice(2)], {
466
+ const launchProof = randomBytes(32).toString("base64url");
467
+ const launchContext = JSON.stringify({
468
+ version: 1,
469
+ proof: launchProof,
470
+ anthropicEnvSlots: preBunAnthropicSlots,
471
+ });
472
+ const child = spawn(bun, [cliPath, `${NODE_LAUNCH_PROOF_PREFIX}${launchProof}`, ...process.argv.slice(2)], {
464
473
  stdio: "inherit",
465
474
  env: {
466
475
  ...process.env,
467
- OCX_PRE_BUN_ANTHROPIC_ENV: preBunAnthropicSlots.join(","),
476
+ [NODE_LAUNCH_CONTEXT_ENV]: launchContext,
468
477
  [BUN_RUNTIME_SOURCE_ENV]: bunRuntime.source,
469
478
  [BUN_RUNTIME_PATH_ENV]: bunRuntime.path,
470
479
  },