@bitkyc08/opencodex 2.36.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.
Files changed (70) hide show
  1. package/bin/ocx.mjs +69 -10
  2. package/gui/dist/assets/index-C14iCj_Q.js +112 -0
  3. package/gui/dist/assets/index-D7PIz7_g.css +1 -0
  4. package/gui/dist/index.html +2 -2
  5. package/gui/dist/provider-icons/aside.svg +3 -0
  6. package/gui/dist/provider-icons/deepseek-harness.svg +3 -0
  7. package/gui/dist/provider-icons/oh-my-pi.svg +11 -0
  8. package/gui/dist/provider-icons/openclaw.svg +54 -0
  9. package/gui/dist/provider-icons/prime-agent.svg +21 -0
  10. package/gui/dist/provider-icons/zcode.svg +219 -0
  11. package/package.json +1 -1
  12. package/src/adapters/cursor/protobuf-request.ts +4 -1
  13. package/src/adapters/cursor/tool-definitions.ts +36 -4
  14. package/src/adapters/kiro-constants.ts +36 -2
  15. package/src/adapters/kiro.ts +13 -2
  16. package/src/cli/capabilities.ts +14 -0
  17. package/src/cli/claude.ts +12 -0
  18. package/src/cli/codex-cli-update.ts +96 -0
  19. package/src/cli/codex-shim-autorestore.ts +3 -0
  20. package/src/cli/export-command.ts +18 -17
  21. package/src/cli/help.ts +2 -2
  22. package/src/cli/index.ts +3 -2
  23. package/src/cli/launcher-context.ts +53 -2
  24. package/src/cli/opencode.ts +126 -33
  25. package/src/cli/registry.ts +16 -10
  26. package/src/cli/system-command.ts +6 -1
  27. package/src/clients/config-export.ts +293 -28
  28. package/src/codex/account-store.ts +10 -4
  29. package/src/codex/autostart-health.ts +3 -3
  30. package/src/codex/catalog/provider-fetch.ts +20 -1
  31. package/src/codex/catalog/sync.ts +4 -3
  32. package/src/codex/cli-install-provenance.ts +795 -0
  33. package/src/codex/convergence.ts +4 -3
  34. package/src/codex/credential-mutation-epoch.ts +11 -0
  35. package/src/codex/main-account.ts +2 -0
  36. package/src/codex/model-entitlements.ts +489 -30
  37. package/src/codex/native-profile-manager.ts +4 -0
  38. package/src/codex/reset-credit-operation-ledger.ts +1411 -0
  39. package/src/codex/reset-credit-recovery.ts +20 -2
  40. package/src/codex/shim.ts +204 -18
  41. package/src/codex/user-identity.ts +2 -1
  42. package/src/config/paths.ts +18 -3
  43. package/src/config.ts +23 -0
  44. package/src/generated/compatibility-version.json +84 -48
  45. package/src/integrations/registry.ts +112 -0
  46. package/src/integrations/state.ts +67 -5
  47. package/src/integrations/writer.ts +25 -9
  48. package/src/lib/bounded-subprocess.ts +36 -0
  49. package/src/lib/strict-semver.ts +47 -0
  50. package/src/lib/windows-elevation.ts +32 -1
  51. package/src/lib/windows-secret-acl.ts +47 -25
  52. package/src/lib/windows-service-mutation-lock.ts +133 -0
  53. package/src/lib/windows-user-principal.ts +15 -17
  54. package/src/responses/spill-store.ts +334 -29
  55. package/src/responses/state.ts +488 -7
  56. package/src/server/index.ts +4 -3
  57. package/src/server/lifecycle.ts +5 -1
  58. package/src/server/management/model-rows.ts +11 -2
  59. package/src/server/management/provider-routes.ts +4 -0
  60. package/src/server/management/system-restart.ts +5 -5
  61. package/src/server/management-api.ts +7 -2
  62. package/src/server/startup-action-control.ts +3 -2
  63. package/src/service.ts +594 -33
  64. package/src/sidecar/candidates.ts +1 -1
  65. package/src/update/codex-cli-update-launch-policy.d.mts +18 -0
  66. package/src/update/codex-cli-update-launch-policy.mjs +30 -0
  67. package/src/update/index.ts +3 -2
  68. package/src/update/job.ts +10 -11
  69. package/gui/dist/assets/index-Cy7Z_pl0.css +0 -1
  70. package/gui/dist/assets/index-DO8liQVL.js +0 -112
@@ -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
- () => finish("completed"),
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
- await drainAndShutdown(undefined, config.shutdownTimeoutMs ?? 5000);
280
- process.exit(0);
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` asset rewrite + restart
237
- * without Task Scheduler re-registration, so it must not enter the UAC elevation path.
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