@bitkyc08/opencodex 2.37.0 → 2.38.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 +69 -10
- package/gui/dist/assets/{index-CowztZdo.js → index-C14iCj_Q.js} +13 -13
- package/gui/dist/assets/index-D7PIz7_g.css +1 -0
- package/gui/dist/index.html +2 -2
- package/gui/dist/provider-icons/aside.svg +3 -0
- package/gui/dist/provider-icons/deepseek-harness.svg +3 -0
- package/gui/dist/provider-icons/oh-my-pi.svg +11 -0
- package/gui/dist/provider-icons/openclaw.svg +54 -0
- package/gui/dist/provider-icons/prime-agent.svg +21 -0
- package/gui/dist/provider-icons/zcode.svg +219 -0
- package/package.json +1 -1
- package/src/adapters/cursor/protobuf-request.ts +4 -1
- package/src/adapters/cursor/tool-definitions.ts +36 -4
- package/src/cli/capabilities.ts +14 -0
- package/src/cli/codex-cli-update.ts +96 -0
- package/src/cli/codex-shim-autorestore.ts +3 -0
- package/src/cli/export-command.ts +18 -17
- package/src/cli/help.ts +2 -2
- package/src/cli/index.ts +3 -2
- package/src/cli/launcher-context.ts +53 -2
- package/src/cli/opencode.ts +126 -33
- package/src/cli/registry.ts +16 -10
- package/src/cli/system-command.ts +6 -1
- package/src/clients/config-export.ts +293 -28
- package/src/codex/account-store.ts +10 -4
- package/src/codex/autostart-health.ts +3 -3
- package/src/codex/catalog/provider-fetch.ts +20 -1
- package/src/codex/catalog/sync.ts +4 -3
- package/src/codex/cli-install-provenance.ts +795 -0
- package/src/codex/convergence.ts +4 -3
- package/src/codex/credential-mutation-epoch.ts +11 -0
- package/src/codex/main-account.ts +2 -0
- package/src/codex/model-entitlements.ts +430 -27
- package/src/codex/native-profile-manager.ts +4 -0
- package/src/codex/reset-credit-operation-ledger.ts +1411 -0
- package/src/codex/reset-credit-recovery.ts +20 -2
- package/src/codex/shim.ts +204 -18
- package/src/codex/user-identity.ts +2 -1
- package/src/config/paths.ts +18 -3
- package/src/config.ts +23 -0
- package/src/generated/compatibility-version.json +81 -45
- package/src/integrations/registry.ts +112 -0
- package/src/integrations/state.ts +67 -5
- package/src/integrations/writer.ts +25 -9
- package/src/lib/bounded-subprocess.ts +36 -0
- package/src/lib/strict-semver.ts +47 -0
- package/src/lib/windows-elevation.ts +32 -1
- package/src/lib/windows-secret-acl.ts +47 -25
- package/src/lib/windows-service-mutation-lock.ts +133 -0
- package/src/lib/windows-user-principal.ts +15 -17
- package/src/responses/spill-store.ts +334 -29
- package/src/responses/state.ts +488 -7
- package/src/server/index.ts +4 -3
- package/src/server/lifecycle.ts +5 -1
- package/src/server/management/model-rows.ts +11 -2
- package/src/server/management/provider-routes.ts +4 -0
- package/src/server/management/system-restart.ts +5 -5
- package/src/server/management-api.ts +7 -2
- package/src/server/startup-action-control.ts +3 -2
- package/src/service.ts +594 -33
- package/src/sidecar/candidates.ts +1 -1
- package/src/update/codex-cli-update-launch-policy.d.mts +18 -0
- package/src/update/codex-cli-update-launch-policy.mjs +30 -0
- package/src/update/index.ts +3 -2
- package/src/update/job.ts +10 -11
- package/gui/dist/assets/index-jqE_VOKI.css +0 -1
|
@@ -53,6 +53,7 @@ import { codexAccountNamespaceProviderCollisionError } from "../../codex/account
|
|
|
53
53
|
import { clearThreadAccountMap } from "../../codex/routing";
|
|
54
54
|
import { primeCodexPoolQuotas } from "../../codex/auth-api";
|
|
55
55
|
import { clearModelCache, getProviderDiscoveryStatus } from "../../codex/model-cache";
|
|
56
|
+
import { getCodexModelEntitlementStatus } from "../../codex/model-entitlements";
|
|
56
57
|
import { DEFAULT_PROVIDER_CONTEXT_CAP, globalContextCapValue, providerContextCap, providerContextCaps, setAllProviderContextCaps, setGlobalContextCapValue, setProviderContextCap } from "../../providers/context-cap";
|
|
57
58
|
import { modelAutoCompactTokenLimitsConfigError } from "../../providers/auto-compact-budget";
|
|
58
59
|
import { resolveCodexHomeDir } from "../../codex/home";
|
|
@@ -474,6 +475,9 @@ export async function handleProviderRoutes(ctx: ManagementContext): Promise<Resp
|
|
|
474
475
|
codexAccountMode: providerCodexAccountMode(name, p),
|
|
475
476
|
...(name === "xai" ? { xaiResponsesOptInState: xaiResponsesOptInState(p) } : {}),
|
|
476
477
|
discovery: p.liveModels === false ? undefined : getProviderDiscoveryStatus(name),
|
|
478
|
+
...(name === "openai" && isCanonicalOpenAiForwardProvider(p)
|
|
479
|
+
? { entitlement: getCodexModelEntitlementStatus(config) }
|
|
480
|
+
: {}),
|
|
477
481
|
})));
|
|
478
482
|
}
|
|
479
483
|
|
|
@@ -78,11 +78,11 @@ let restartIo: SystemRestartIo = {};
|
|
|
78
78
|
/** Prevents double-scheduling in the 200ms window before drainAndShutdown sets draining. */
|
|
79
79
|
let restartAccepted = false;
|
|
80
80
|
|
|
81
|
-
type RestartDrainOutcome = "completed" | "rejected" | "deadline";
|
|
81
|
+
type RestartDrainOutcome = "completed" | "failed" | "rejected" | "deadline";
|
|
82
82
|
type BoundedSettlementOutcome = "completed" | "rejected" | "deadline";
|
|
83
83
|
|
|
84
84
|
function waitForRestartDrain(
|
|
85
|
-
drainPromise: Promise<void>,
|
|
85
|
+
drainPromise: Promise<boolean | void>,
|
|
86
86
|
deadlineMs: number,
|
|
87
87
|
now: () => number,
|
|
88
88
|
scheduleDeadline: NonNullable<SystemRestartIo["scheduleDeadline"]>,
|
|
@@ -105,7 +105,7 @@ function waitForRestartDrain(
|
|
|
105
105
|
cancelDeadline = scheduleDeadline(() => finish("deadline"), remainingMs);
|
|
106
106
|
if (settled) cancelDeadline();
|
|
107
107
|
void drainPromise.then(
|
|
108
|
-
|
|
108
|
+
succeeded => finish(succeeded === false ? "failed" : "completed"),
|
|
109
109
|
() => finish("rejected"),
|
|
110
110
|
);
|
|
111
111
|
});
|
|
@@ -382,7 +382,7 @@ export function acceptSystemRestart(io: SystemRestartIo = restartIo): {
|
|
|
382
382
|
await completeDeadlineRestartHandoff(io, exitProcess, restartPort, scheduleDeadline);
|
|
383
383
|
return;
|
|
384
384
|
}
|
|
385
|
-
if (drainOutcome === "rejected") {
|
|
385
|
+
if (drainOutcome === "failed" || drainOutcome === "rejected") {
|
|
386
386
|
// drainAndShutdown stops the listener in finally. Even if ancillary cleanup
|
|
387
387
|
// rejects, an accepted restart must still reach replacement or terminal exit.
|
|
388
388
|
console.warn("Drain-and-restart cleanup failed; continuing terminal restart handoff");
|
|
@@ -422,7 +422,7 @@ export function acceptSystemRestart(io: SystemRestartIo = restartIo): {
|
|
|
422
422
|
return;
|
|
423
423
|
}
|
|
424
424
|
(io.markRecycling ?? markRecyclingForExit)();
|
|
425
|
-
exitProcess(0);
|
|
425
|
+
exitProcess(drainOutcome === "failed" || drainOutcome === "rejected" ? 1 : 0);
|
|
426
426
|
}, 200);
|
|
427
427
|
}
|
|
428
428
|
|
|
@@ -276,8 +276,13 @@ export async function handleManagementAPI(
|
|
|
276
276
|
const { stripGrokConfig } = await import("../grok/inject");
|
|
277
277
|
const grok = stripGrokConfig();
|
|
278
278
|
setTimeout(async () => {
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
let shutdownSucceeded = false;
|
|
280
|
+
try {
|
|
281
|
+
shutdownSucceeded = await drainAndShutdown(undefined, config.shutdownTimeoutMs ?? 5000);
|
|
282
|
+
} catch {
|
|
283
|
+
console.warn("[opencodex] shutdown drain failed");
|
|
284
|
+
}
|
|
285
|
+
process.exit(shutdownSucceeded ? 0 : 1);
|
|
281
286
|
}, 200);
|
|
282
287
|
const grokNote = grok.ok ? "" : ` Grok config cleanup failed: ${grok.message}`;
|
|
283
288
|
return jsonResponse(restore.success
|
|
@@ -233,8 +233,9 @@ function applyReconciliationOutcome(
|
|
|
233
233
|
/**
|
|
234
234
|
* Execute the existing fixed CLI installer outside the proxy event loop.
|
|
235
235
|
*
|
|
236
|
-
* Repair mode (`options.repair`) runs `ocx service repair
|
|
237
|
-
*
|
|
236
|
+
* Repair mode (`options.repair`) runs `ocx service repair`. A stale definition may be
|
|
237
|
+
* re-registered and elevate inside repair; this wrapper must not retry it through the separate
|
|
238
|
+
* fresh-install UAC path.
|
|
238
239
|
*
|
|
239
240
|
* After an elevation request timeout the lock becomes `indeterminate` until the
|
|
240
241
|
* original elevated transaction completes and is reconciled. A process restart
|