@bitkyc08/opencodex 2.10.1 → 2.10.2
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 +18 -9
- package/gui/dist/assets/index-BKVqyYqT.js +70 -0
- package/gui/dist/assets/{index-Cd6_PBKn.css → index-Ca_3269W.css} +1 -1
- package/gui/dist/index.html +2 -2
- package/gui/dist/provider-icons/commandcode-color.svg +1 -0
- package/gui/dist/provider-icons/openai.svg +1 -1
- package/package.json +1 -1
- package/src/adapters/command-code.ts +453 -0
- package/src/adapters/google.ts +3 -0
- package/src/cli/claude.ts +37 -22
- package/src/cli/index.ts +16 -3
- package/src/cli/launcher-context.ts +77 -0
- package/src/codex/admission.ts +1 -1
- package/src/codex/app-server-processes.ts +44 -1
- package/src/codex/catalog/sync.ts +22 -3
- package/src/codex/catalog-write-serialization.ts +1 -1
- package/src/codex/codex-write-lock.ts +1 -1
- package/src/codex/convergence-types.ts +1 -1
- package/src/codex/desired-state.ts +27 -7
- package/src/codex/history-job.ts +1 -1
- package/src/codex/history-lock.ts +1 -1
- package/src/codex/history-worker.ts +1 -1
- package/src/codex/internal/history-writer.ts +1 -1
- package/src/codex/transition-state.ts +1 -1
- package/src/codex/user-identity.ts +1 -1
- package/src/config.ts +6 -1
- package/src/integrations/config-io.ts +1 -1
- package/src/integrations/journal.ts +1 -1
- package/src/integrations/merge.ts +1 -1
- package/src/integrations/ownership.ts +1 -1
- package/src/integrations/registry.ts +1 -1
- package/src/integrations/serialize.ts +1 -1
- package/src/integrations/state.ts +1 -1
- package/src/integrations/store.ts +1 -1
- package/src/integrations/writer.ts +1 -1
- package/src/lib/bounded-body.ts +3 -1
- package/src/lib/bun-runtime.ts +21 -17
- package/src/lib/bun-stream-caps.ts +1 -1
- package/src/lib/local-management-attestation.ts +51 -0
- package/src/lib/shadow-call.ts +4 -4
- package/src/oauth/command-code.ts +239 -0
- package/src/oauth/health.ts +46 -2
- package/src/oauth/index.ts +38 -3
- package/src/providers/command-code-efforts.ts +85 -0
- package/src/providers/google-vertex-location.ts +14 -0
- package/src/providers/registry.ts +138 -26
- package/src/routing/capability.ts +1 -0
- package/src/server/adapter-resolve.ts +3 -0
- package/src/server/auth-cors.ts +6 -1
- package/src/server/index.ts +44 -2
- package/src/server/management/integration-routes.ts +1 -1
- package/src/server/management/native-integration-routes.ts +2 -2
- package/src/server/responses/core.ts +13 -9
- package/src/storage/scanner.ts +1 -1
- package/src/types.ts +6 -0
- package/src/usage/log.ts +1 -1
- 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.
|
|
454
|
-
//
|
|
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
|
|
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
|
|
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
|
-
|
|
476
|
+
[NODE_LAUNCH_CONTEXT_ENV]: launchContext,
|
|
468
477
|
[BUN_RUNTIME_SOURCE_ENV]: bunRuntime.source,
|
|
469
478
|
[BUN_RUNTIME_PATH_ENV]: bunRuntime.path,
|
|
470
479
|
},
|