@bitkyc08/opencodex 2.25.0 → 2.26.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 +59 -7
- package/gui/dist/assets/index-RL6b1bTV.js +102 -0
- package/gui/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/adapters/base.ts +18 -0
- package/src/adapters/client-fingerprint.ts +0 -2
- package/src/adapters/cursor/http1-bidi.ts +361 -0
- package/src/adapters/cursor/live-models.ts +117 -30
- package/src/adapters/cursor/live-transport.ts +137 -56
- package/src/adapters/cursor/native-exec-fs.ts +1 -1
- package/src/adapters/cursor/native-exec-network.ts +1 -1
- package/src/adapters/cursor/native-exec-shell.ts +0 -1
- package/src/adapters/cursor/protobuf-request.ts +89 -21
- package/src/adapters/cursor/tool-definitions.ts +18 -7
- package/src/adapters/cursor/tool-result-normalize.ts +92 -0
- package/src/adapters/cursor/transport.ts +7 -0
- package/src/adapters/cursor.ts +2 -0
- package/src/adapters/google-http.ts +38 -10
- package/src/adapters/google.ts +23 -3
- package/src/adapters/openai-chat.ts +38 -13
- package/src/adapters/openai-responses.ts +129 -9
- package/src/adapters/registry.ts +30 -1
- package/src/bridge.ts +50 -12
- package/src/chat/inbound.ts +1 -0
- package/src/claude/agents-inject.ts +3 -2
- package/src/cli/dispatch.ts +19 -6
- package/src/cli/help.ts +2 -1
- package/src/cli/integrations.ts +35 -0
- package/src/cli/minimax.ts +8 -2
- package/src/cli/registry.ts +13 -2
- package/src/clients/config-export.ts +120 -1
- package/src/codex/account-store.ts +17 -1
- package/src/codex/auth-api.ts +51 -17
- package/src/codex/catalog/effort.ts +8 -5
- package/src/codex/catalog/provider-fetch.ts +39 -27
- package/src/codex/catalog/sync.ts +30 -8
- package/src/codex/inject.ts +39 -13
- package/src/codex/main-account.ts +29 -1
- package/src/codex/plan-from-token.ts +140 -0
- package/src/codex/plan.ts +25 -0
- package/src/codex/prompt-journal.ts +6 -2
- package/src/codex/quota-rejection.ts +21 -7
- package/src/codex/refresh.ts +4 -2
- package/src/codex/sync.ts +106 -3
- package/src/codex/warmup.ts +187 -81
- package/src/config.ts +85 -46
- package/src/generated/compatibility-version.json +127 -83
- package/src/grok/inject.ts +1 -1
- package/src/images/loop.ts +1 -0
- package/src/integrations/registry.ts +7 -0
- package/src/lab/automation/config-persistence.ts +2 -2
- package/src/lab/automation/persistence.ts +2 -2
- package/src/lab/ledger/purge.ts +2 -2
- package/src/lab/subject/behavior-fingerprint.ts +2 -2
- package/src/lib/config-ownership.ts +5 -2
- package/src/lib/destination-policy.ts +18 -1
- package/src/lib/provider-outbound.ts +7 -0
- package/src/lib/redact.ts +11 -0
- package/src/lib/tool-argument-integers.ts +50 -6
- package/src/lib/upstream-http-version.ts +57 -0
- package/src/lib/upstream-retry.ts +2 -1
- package/src/lib/windows-atomic-replace.ts +155 -0
- package/src/lib/windows-service-wrappers.ts +72 -0
- package/src/oauth/google-antigravity.ts +2 -2
- package/src/oauth/index.ts +60 -8
- package/src/providers/antigravity-models.ts +58 -4
- package/src/providers/command-code-efforts.ts +36 -9
- package/src/providers/context-cap.ts +9 -0
- package/src/providers/derive.ts +4 -0
- package/src/providers/fastwire.ts +453 -0
- package/src/providers/registry.ts +21 -1
- package/src/providers/service-tier.ts +173 -89
- package/src/responses/parser.ts +25 -16
- package/src/responses/reasoning-replay-cache.ts +30 -0
- package/src/responses/thought-signature-replay.ts +74 -4
- package/src/router.ts +6 -0
- package/src/routing/compatibility/behavior.ts +27 -16
- package/src/server/index.ts +10 -1
- package/src/server/management/oauth-account-routes.ts +10 -2
- package/src/server/management/shared.ts +1 -1
- package/src/server/management/system-routes.ts +15 -0
- package/src/server/request-log.ts +57 -3
- package/src/server/responses/agent-task-recovery.ts +6 -1
- package/src/server/responses/core.ts +209 -40
- package/src/server/responses/fetch-helpers.ts +15 -36
- package/src/server/responses/responses-field-backfill.ts +173 -0
- package/src/server/responses-reasoning-summary-rewrite.ts +171 -0
- package/src/service.ts +38 -36
- package/src/storage/cleanup.ts +2 -2
- package/src/tray/windows.ts +3 -2
- package/src/types.ts +101 -14
- package/src/update/job.ts +9 -18
- package/src/update/transactional-install.d.mts +22 -0
- package/src/update/transactional-install.mjs +259 -0
- package/src/usage/cost.ts +34 -5
- package/src/usage/log.ts +74 -4
- package/src/vision/anthropic-describe.ts +10 -6
- package/src/web-search/anthropic-executor.ts +8 -6
- package/gui/dist/assets/index-DxJ7kXj9.js +0 -102
package/bin/ocx.mjs
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
runNpmCachePreflight,
|
|
23
23
|
} from "../src/update/npm-cache-preflight.mjs";
|
|
24
24
|
import { handoffWindowsTrayForUpdate, planWindowsTrayUpdate } from "../src/update/tray-update-plan.mjs";
|
|
25
|
+
import { bootRestoreProbe, transactionalNpmUpdate } from "../src/update/transactional-install.mjs";
|
|
25
26
|
|
|
26
27
|
const PKG = "@bitkyc08/opencodex";
|
|
27
28
|
const require = createRequire(import.meta.url);
|
|
@@ -267,13 +268,50 @@ function runNpmSelfUpdate() {
|
|
|
267
268
|
}
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
271
|
+
// #1942/#1849: stage -> verify -> swap -> rollback instead of installing straight
|
|
272
|
+
// into the live tree. A failure at any point leaves either the old or the new tree
|
|
273
|
+
// complete — never a file-less skeleton. Falls back to the legacy in-place install
|
|
274
|
+
// only when the transactional module cannot run at all.
|
|
275
|
+
const packageDir = resolve(here, "..");
|
|
276
|
+
console.log(`Updating${latest ? ` to v${latest}` : ""} (transactional)...`);
|
|
277
|
+
let res;
|
|
278
|
+
try {
|
|
279
|
+
const tx = transactionalNpmUpdate({
|
|
280
|
+
packageDir,
|
|
281
|
+
pkgName: PKG,
|
|
282
|
+
targetVersion: latest || undefined,
|
|
283
|
+
tag,
|
|
284
|
+
runNpm: (args) => {
|
|
285
|
+
const invocation = npmInvocation(args);
|
|
286
|
+
if (!invocation) return { status: 1 };
|
|
287
|
+
return spawnSync(invocation.file, invocation.args, {
|
|
288
|
+
stdio: "inherit",
|
|
289
|
+
timeout: 180000,
|
|
290
|
+
windowsHide: true,
|
|
291
|
+
...invocation.options,
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
log: (line) => console.log(line),
|
|
295
|
+
});
|
|
296
|
+
if (tx.ok) {
|
|
297
|
+
res = { status: 0 };
|
|
298
|
+
} else if (tx.phase === "stage" || tx.phase === "verify") {
|
|
299
|
+
// Live tree untouched: report and stop. Nothing to roll back.
|
|
300
|
+
console.error(`opencodex: update aborted before touching the live install (${tx.phase}): ${tx.error}`);
|
|
301
|
+
res = { status: 1 };
|
|
302
|
+
} else {
|
|
303
|
+
console.error(`opencodex: update failed (${tx.phase}): ${tx.error}${tx.rolledBack ? " — previous version restored." : ""}`);
|
|
304
|
+
res = { status: 1 };
|
|
305
|
+
}
|
|
306
|
+
} catch (error) {
|
|
307
|
+
// An unexpected throw means we cannot prove the live tree is untouched, so the
|
|
308
|
+
// legacy in-place install (which deletes live first) is exactly the wrong rescue —
|
|
309
|
+
// it recreates the #1849 destruction path. Report and stop; the boot probe and the
|
|
310
|
+
// recovery marker cover the swap-window states.
|
|
311
|
+
console.error(`opencodex: transactional update failed unexpectedly (${error?.message ?? error}). ` +
|
|
312
|
+
"The live install was not knowingly modified; run 'ocx update' again or reinstall with npm install -g.");
|
|
313
|
+
res = { status: 1 };
|
|
314
|
+
}
|
|
277
315
|
if (res.status === 0) {
|
|
278
316
|
console.log(`\nUpdated${latest ? ` to v${latest}` : ""}.`);
|
|
279
317
|
repairCodexShimIfNeeded();
|
|
@@ -449,6 +487,20 @@ if (process.argv[2] === "update" && isNodeModulesInstall() && !isBunGlobalInstal
|
|
|
449
487
|
runNpmSelfUpdate();
|
|
450
488
|
}
|
|
451
489
|
|
|
490
|
+
// #1849 boot probe: a prior update that lost power (or double-faulted) mid-swap leaves a
|
|
491
|
+
// backup sibling and a broken live tree. Restore before anything tries to run from the
|
|
492
|
+
// broken tree; reap stale backups once the live tree verifies healthy.
|
|
493
|
+
if (isNodeModulesInstall() && !isBunGlobalInstall()) {
|
|
494
|
+
try {
|
|
495
|
+
const probe = bootRestoreProbe(resolve(here, ".."));
|
|
496
|
+
if (probe.action === "restored") {
|
|
497
|
+
console.warn(`opencodex: previous update left a broken install — restored the backup from ${probe.from}.`);
|
|
498
|
+
} else if (probe.action === "failed") {
|
|
499
|
+
console.warn(`opencodex: a backup from a failed update exists but could not be restored automatically: ${probe.error}`);
|
|
500
|
+
}
|
|
501
|
+
} catch { /* the probe must never block launch */ }
|
|
502
|
+
}
|
|
503
|
+
|
|
452
504
|
const bunRuntime = resolveBun();
|
|
453
505
|
const bun = bunRuntime.path;
|
|
454
506
|
|