@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
package/src/cli/opencode.ts
CHANGED
|
@@ -27,12 +27,17 @@ import {
|
|
|
27
27
|
OPENCODE_PROVIDER_ID,
|
|
28
28
|
buildOpencodeProviderBlockFromCatalog,
|
|
29
29
|
opencodeGlobalConfigPath,
|
|
30
|
+
opencodeProviderBlocks,
|
|
31
|
+
opencodeProxyBaseUrl,
|
|
32
|
+
opencodeV2ProviderBlock,
|
|
30
33
|
} from "../clients/config-export";
|
|
31
34
|
import type {
|
|
32
35
|
OpencodeCatalogModel,
|
|
33
36
|
OpencodeGeneratedConfig,
|
|
34
37
|
OpencodeLaunchEnv,
|
|
35
38
|
OpencodeProviderBlock,
|
|
39
|
+
OpencodeProviderBlocks,
|
|
40
|
+
OpencodeV2ProviderBlock,
|
|
36
41
|
} from "../clients/config-export";
|
|
37
42
|
import { visibleNativeSlugs } from "../codex/catalog";
|
|
38
43
|
import { commandInvocation } from "../lib/win-exec";
|
|
@@ -57,6 +62,7 @@ export {
|
|
|
57
62
|
buildOpencodeProviderBlockFromCatalog,
|
|
58
63
|
opencodeGlobalConfigPath,
|
|
59
64
|
opencodeProxyBaseUrl,
|
|
65
|
+
opencodeV2ProviderBlock,
|
|
60
66
|
} from "../clients/config-export";
|
|
61
67
|
export type {
|
|
62
68
|
OpencodeCatalogModel,
|
|
@@ -64,6 +70,8 @@ export type {
|
|
|
64
70
|
OpencodeLaunchEnv,
|
|
65
71
|
OpencodeModelEntry,
|
|
66
72
|
OpencodeProviderBlock,
|
|
73
|
+
OpencodeProviderBlocks,
|
|
74
|
+
OpencodeV2ProviderBlock,
|
|
67
75
|
} from "../clients/config-export";
|
|
68
76
|
|
|
69
77
|
/** One proxy-routed model destined for the generated provider block. */
|
|
@@ -74,6 +82,8 @@ export interface OpencodeRoutedModel {
|
|
|
74
82
|
contextWindow?: number;
|
|
75
83
|
/** Authoritative display label (CatalogModel.displayName); optional. */
|
|
76
84
|
displayName?: string;
|
|
85
|
+
/** Declared effort ladder; exported as opencode model variants when present. */
|
|
86
|
+
reasoningEfforts?: readonly string[];
|
|
77
87
|
}
|
|
78
88
|
|
|
79
89
|
/** Row shape from authenticated GET /api/models on the running proxy. */
|
|
@@ -85,6 +95,10 @@ export interface OpencodeProxyModelRow {
|
|
|
85
95
|
disabled?: boolean;
|
|
86
96
|
displayName?: string;
|
|
87
97
|
contextWindow?: number;
|
|
98
|
+
/** Declared effort ladder from `/api/models`; carried into opencode model variants. */
|
|
99
|
+
reasoningEfforts?: string[];
|
|
100
|
+
/** Declared default effort from `/api/models`. */
|
|
101
|
+
defaultReasoningEffort?: string;
|
|
88
102
|
}
|
|
89
103
|
|
|
90
104
|
const PROJECT_CONFIG_FILENAMES = ["opencode.json", "opencode.jsonc"] as const;
|
|
@@ -196,16 +210,13 @@ export function opencodeLaunchNativeSlugs(config: OcxConfig): string[] {
|
|
|
196
210
|
return [...visibleNativeSlugs(config)];
|
|
197
211
|
}
|
|
198
212
|
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
port: number,
|
|
213
|
+
/** Catalog rows for the slugs/routed models a caller assembled by hand. */
|
|
214
|
+
function opencodeLaunchCatalog(
|
|
202
215
|
nativeSlugs: readonly string[],
|
|
203
216
|
routedModels: readonly OpencodeRoutedModel[],
|
|
204
|
-
nativeContextWindow: (slug: string) => number | undefined
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
): OpencodeProviderBlock {
|
|
208
|
-
const catalog: OpencodeCatalogModel[] = [
|
|
217
|
+
nativeContextWindow: (slug: string) => number | undefined,
|
|
218
|
+
): OpencodeCatalogModel[] {
|
|
219
|
+
return [
|
|
209
220
|
...nativeSlugs.map(id => ({
|
|
210
221
|
namespaced: id,
|
|
211
222
|
native: true,
|
|
@@ -220,9 +231,71 @@ export function buildOpencodeProviderBlock(
|
|
|
220
231
|
id: model.id,
|
|
221
232
|
contextWindow: model.contextWindow,
|
|
222
233
|
displayName: model.displayName,
|
|
234
|
+
...(model.reasoningEfforts && model.reasoningEfforts.length > 0
|
|
235
|
+
? { reasoningEfforts: [...model.reasoningEfforts] }
|
|
236
|
+
: {}),
|
|
223
237
|
})),
|
|
224
238
|
];
|
|
225
|
-
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Back-compat helper for unit tests that assemble slugs/routed rows directly. */
|
|
242
|
+
export function buildOpencodeProviderBlock(
|
|
243
|
+
port: number,
|
|
244
|
+
nativeSlugs: readonly string[],
|
|
245
|
+
routedModels: readonly OpencodeRoutedModel[],
|
|
246
|
+
nativeContextWindow: (slug: string) => number | undefined = () => undefined,
|
|
247
|
+
hostname?: string,
|
|
248
|
+
config: OcxConfig = OPENCODE_PROVIDER_BLOCK_DEFAULT_CONFIG,
|
|
249
|
+
): OpencodeProviderBlock {
|
|
250
|
+
return buildOpencodeProviderBlockFromCatalog(
|
|
251
|
+
port,
|
|
252
|
+
opencodeLaunchCatalog(nativeSlugs, routedModels, nativeContextWindow),
|
|
253
|
+
hostname,
|
|
254
|
+
config,
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* V2 counterpart of `buildOpencodeProviderBlock`. The launcher injects both generations,
|
|
260
|
+
* because only the V2 block carries selectable reasoning efforts.
|
|
261
|
+
*/
|
|
262
|
+
export function buildOpencodeV2ProviderBlock(
|
|
263
|
+
port: number,
|
|
264
|
+
nativeSlugs: readonly string[],
|
|
265
|
+
routedModels: readonly OpencodeRoutedModel[],
|
|
266
|
+
nativeContextWindow: (slug: string) => number | undefined = () => undefined,
|
|
267
|
+
hostname?: string,
|
|
268
|
+
config: OcxConfig = OPENCODE_PROVIDER_BLOCK_DEFAULT_CONFIG,
|
|
269
|
+
): OpencodeV2ProviderBlock {
|
|
270
|
+
return opencodeBlocks(
|
|
271
|
+
port,
|
|
272
|
+
opencodeLaunchCatalog(nativeSlugs, routedModels, nativeContextWindow),
|
|
273
|
+
hostname,
|
|
274
|
+
config,
|
|
275
|
+
).v2;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Both generations from one catalog, in one pass. Every production path uses this: the two
|
|
280
|
+
* blocks are one document's fragments and have to agree on model set, names, connection, and
|
|
281
|
+
* variants, which building them together guarantees instead of merely expecting.
|
|
282
|
+
*/
|
|
283
|
+
export function buildOpencodeProviderBlocksFromCatalog(
|
|
284
|
+
port: number,
|
|
285
|
+
catalogModels: readonly OpencodeCatalogModel[],
|
|
286
|
+
hostname?: string,
|
|
287
|
+
config: OcxConfig = OPENCODE_PROVIDER_BLOCK_DEFAULT_CONFIG,
|
|
288
|
+
): OpencodeProviderBlocks {
|
|
289
|
+
return opencodeBlocks(port, catalogModels, hostname, config);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function opencodeBlocks(
|
|
293
|
+
port: number,
|
|
294
|
+
catalogModels: readonly OpencodeCatalogModel[],
|
|
295
|
+
hostname?: string,
|
|
296
|
+
config: OcxConfig = OPENCODE_PROVIDER_BLOCK_DEFAULT_CONFIG,
|
|
297
|
+
): OpencodeProviderBlocks {
|
|
298
|
+
return opencodeProviderBlocks(opencodeProxyBaseUrl(port, hostname), catalogModels, config);
|
|
226
299
|
}
|
|
227
300
|
|
|
228
301
|
/** Default deadline for authenticated GET /api/models during `ocx opencode` launch. */
|
|
@@ -315,6 +388,12 @@ export function opencodeCatalogFromProxyRows(
|
|
|
315
388
|
id: row.id,
|
|
316
389
|
contextWindow: row.contextWindow,
|
|
317
390
|
displayName: row.displayName,
|
|
391
|
+
...(Array.isArray(row.reasoningEfforts) && row.reasoningEfforts.length > 0
|
|
392
|
+
? { reasoningEfforts: [...row.reasoningEfforts] }
|
|
393
|
+
: {}),
|
|
394
|
+
...(typeof row.defaultReasoningEffort === "string" && row.defaultReasoningEffort.length > 0
|
|
395
|
+
? { defaultReasoningEffort: row.defaultReasoningEffort }
|
|
396
|
+
: {}),
|
|
318
397
|
});
|
|
319
398
|
}
|
|
320
399
|
return catalog;
|
|
@@ -330,17 +409,19 @@ export function isOpencodeRuntimeConfigError(
|
|
|
330
409
|
}
|
|
331
410
|
|
|
332
411
|
/**
|
|
333
|
-
* Merge inherited `OPENCODE_CONFIG_CONTENT` and override only
|
|
412
|
+
* Merge inherited `OPENCODE_CONFIG_CONTENT` and override only our own blocks:
|
|
413
|
+
* `provider.opencodex` (V1) and `providers.opencodex` (V2, the one carrying variants).
|
|
334
414
|
* When no inline layer is present, emit the minimal runtime object for this launcher.
|
|
335
415
|
*/
|
|
336
416
|
export function mergeOpencodeRuntimeConfig(
|
|
337
417
|
inheritedContent: string | undefined,
|
|
338
|
-
|
|
418
|
+
blocks: OpencodeProviderBlocks,
|
|
339
419
|
): OpencodeGeneratedConfig | OpencodeRuntimeConfigError {
|
|
340
420
|
if (!inheritedContent?.trim()) {
|
|
341
421
|
return {
|
|
342
422
|
$schema: OPENCODE_CONFIG_SCHEMA,
|
|
343
|
-
provider: { [OPENCODE_PROVIDER_ID]:
|
|
423
|
+
provider: { [OPENCODE_PROVIDER_ID]: blocks.v1 },
|
|
424
|
+
providers: { [OPENCODE_PROVIDER_ID]: blocks.v2 },
|
|
344
425
|
};
|
|
345
426
|
}
|
|
346
427
|
let parsed: unknown;
|
|
@@ -356,12 +437,20 @@ export function mergeOpencodeRuntimeConfig(
|
|
|
356
437
|
if (existingProvider !== undefined && !isRecord(existingProvider)) {
|
|
357
438
|
return { error: "OPENCODE_CONFIG_CONTENT provider must be a JSON object when present." };
|
|
358
439
|
}
|
|
440
|
+
const existingProviders = parsed.providers;
|
|
441
|
+
if (existingProviders !== undefined && !isRecord(existingProviders)) {
|
|
442
|
+
return { error: "OPENCODE_CONFIG_CONTENT providers must be a JSON object when present." };
|
|
443
|
+
}
|
|
359
444
|
return {
|
|
360
445
|
...parsed,
|
|
361
446
|
$schema: typeof parsed.$schema === "string" ? parsed.$schema : OPENCODE_CONFIG_SCHEMA,
|
|
362
447
|
provider: {
|
|
363
448
|
...(isRecord(existingProvider) ? existingProvider : {}),
|
|
364
|
-
[OPENCODE_PROVIDER_ID]:
|
|
449
|
+
[OPENCODE_PROVIDER_ID]: blocks.v1,
|
|
450
|
+
},
|
|
451
|
+
providers: {
|
|
452
|
+
...(isRecord(existingProviders) ? existingProviders : {}),
|
|
453
|
+
[OPENCODE_PROVIDER_ID]: blocks.v2,
|
|
365
454
|
},
|
|
366
455
|
} as OpencodeGeneratedConfig;
|
|
367
456
|
}
|
|
@@ -375,10 +464,10 @@ export function buildOpencodeConfig(
|
|
|
375
464
|
hostname?: string,
|
|
376
465
|
config: OcxConfig = OPENCODE_PROVIDER_BLOCK_DEFAULT_CONFIG,
|
|
377
466
|
): OpencodeGeneratedConfig {
|
|
378
|
-
const merged = mergeOpencodeRuntimeConfig(
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
);
|
|
467
|
+
const merged = mergeOpencodeRuntimeConfig(undefined, {
|
|
468
|
+
v1: buildOpencodeProviderBlock(port, nativeSlugs, routedModels, nativeContextWindow, hostname, config),
|
|
469
|
+
v2: buildOpencodeV2ProviderBlock(port, nativeSlugs, routedModels, nativeContextWindow, hostname, config),
|
|
470
|
+
});
|
|
382
471
|
if (isOpencodeRuntimeConfigError(merged)) {
|
|
383
472
|
throw new Error(merged.error);
|
|
384
473
|
}
|
|
@@ -400,11 +489,19 @@ function findGitRoot(start: string): string | null {
|
|
|
400
489
|
}
|
|
401
490
|
}
|
|
402
491
|
|
|
492
|
+
/**
|
|
493
|
+
* True when the file declares our provider in either generation. Both count: the launcher
|
|
494
|
+
* overwrites `provider.opencodex` and `providers.opencodex` alike, so a config that carries
|
|
495
|
+
* only the V2 block is overridden just as silently as one carrying only the V1 block.
|
|
496
|
+
*/
|
|
403
497
|
function configFileDefinesProvider(path: string): boolean {
|
|
404
498
|
if (!existsSync(path)) return false;
|
|
405
499
|
try {
|
|
406
500
|
const parsed = parseJsonc(readFileSync(path, "utf8"));
|
|
407
|
-
|
|
501
|
+
if (!isRecord(parsed)) return false;
|
|
502
|
+
const legacy = isRecord(parsed.provider) && OPENCODE_PROVIDER_ID in parsed.provider;
|
|
503
|
+
const v2 = isRecord(parsed.providers) && OPENCODE_PROVIDER_ID in parsed.providers;
|
|
504
|
+
return legacy || v2;
|
|
408
505
|
} catch {
|
|
409
506
|
return false;
|
|
410
507
|
}
|
|
@@ -460,16 +557,17 @@ export function opencodeProxyStartEnv(base: OpencodeLaunchEnv = process.env): Op
|
|
|
460
557
|
}
|
|
461
558
|
|
|
462
559
|
/**
|
|
463
|
-
* Env assembly (unit-tested). Inherited inline config is merged and only
|
|
464
|
-
* `provider.opencodex`
|
|
465
|
-
* key travels in the child env rather than in the inline config
|
|
560
|
+
* Env assembly (unit-tested). Inherited inline config is merged and only our own blocks are
|
|
561
|
+
* replaced — `provider.opencodex` and `providers.opencodex`; disk config layers stay
|
|
562
|
+
* untouched. The admission key travels in the child env rather than in the inline config
|
|
563
|
+
* payload.
|
|
466
564
|
*/
|
|
467
565
|
export function buildOpencodeEnv(
|
|
468
|
-
|
|
566
|
+
blocks: OpencodeProviderBlocks,
|
|
469
567
|
apiKey: string,
|
|
470
568
|
base: OpencodeLaunchEnv,
|
|
471
569
|
): OpencodeLaunchEnv | OpencodeRuntimeConfigError {
|
|
472
|
-
const runtimeConfig = mergeOpencodeRuntimeConfig(base[OPENCODE_CONFIG_CONTENT_ENV],
|
|
570
|
+
const runtimeConfig = mergeOpencodeRuntimeConfig(base[OPENCODE_CONFIG_CONTENT_ENV], blocks);
|
|
473
571
|
if (isOpencodeRuntimeConfigError(runtimeConfig)) return runtimeConfig;
|
|
474
572
|
return {
|
|
475
573
|
...base,
|
|
@@ -547,22 +645,17 @@ export async function cmdOpencode(args: string[]): Promise<number> {
|
|
|
547
645
|
return 1;
|
|
548
646
|
}
|
|
549
647
|
const catalog = opencodeCatalogFromProxyRows(proxyModels, config);
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
catalog,
|
|
553
|
-
live.hostname,
|
|
554
|
-
config,
|
|
555
|
-
);
|
|
556
|
-
const baseUrl = providerBlock.options.baseURL;
|
|
648
|
+
const blocks = buildOpencodeProviderBlocksFromCatalog(live.port, catalog, live.hostname, config);
|
|
649
|
+
const baseUrl = blocks.v1.options.baseURL;
|
|
557
650
|
const modelCount = catalog.length;
|
|
558
651
|
console.error(`✅ opencode wired to ${baseUrl} — ${modelCount} model(s) under provider \`${OPENCODE_PROVIDER_ID}\`.`);
|
|
559
|
-
console.error(" Your existing opencode config files are left untouched; only the runtime provider
|
|
652
|
+
console.error(" Your existing opencode config files are left untouched; only the runtime provider blocks are injected.");
|
|
560
653
|
const providerOverride = opencodeProviderOverridePath(process.cwd());
|
|
561
654
|
if (providerOverride) {
|
|
562
|
-
console.error(`ℹ ${providerOverride} also defines provider
|
|
655
|
+
console.error(`ℹ ${providerOverride} also defines our provider key; the runtime layer from ocx opencode overrides it for this launch.`);
|
|
563
656
|
}
|
|
564
657
|
|
|
565
|
-
const builtEnv = buildOpencodeEnv(
|
|
658
|
+
const builtEnv = buildOpencodeEnv(blocks, apiKey, process.env);
|
|
566
659
|
if ("error" in builtEnv) {
|
|
567
660
|
console.error(`❌ ${builtEnv.error}`);
|
|
568
661
|
return 1;
|
package/src/cli/registry.ts
CHANGED
|
@@ -65,7 +65,7 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
|
|
|
65
65
|
summary: "Run as a background service.",
|
|
66
66
|
details: [
|
|
67
67
|
"With no subcommand, installs when absent or repairs/restarts an existing service.",
|
|
68
|
-
"`restart`
|
|
68
|
+
"`restart` aliases `repair`; healthy Windows tasks are reused, while stale definitions may re-register and elevate.",
|
|
69
69
|
"Use `ocx service status` to see diagnostics and log paths.",
|
|
70
70
|
],
|
|
71
71
|
},
|
|
@@ -244,8 +244,8 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
|
|
|
244
244
|
{ name: "api-key", usage: "ocx api-key <list|create|remove> ...", summary: "Alias of ocx access key." },
|
|
245
245
|
{
|
|
246
246
|
name: "export",
|
|
247
|
-
usage: "ocx export --client <opencode|pi|omp|hermes|openclaw|kimi|gajae|dsh|mcode|zcode|prime> [--json] [--out <path>] [--force]",
|
|
248
|
-
summary: "Print a client config (OpenCode, Pi, OMP, Hermes, OpenClaw, Kimi Code, Gajae Code, DeepSeek Harness, MiniMax Code, ZCode, Prime Agent) wired to the running proxy.",
|
|
247
|
+
usage: "ocx export --client <opencode|pi|omp|hermes|openclaw|kimi|gajae|dsh|mcode|zcode|prime|aside> [--json] [--out <path>] [--force]",
|
|
248
|
+
summary: "Print a client config (OpenCode, Pi, OMP, Hermes, OpenClaw, Kimi Code, Gajae Code, DeepSeek Harness, MiniMax Code, ZCode, Prime Agent, Aside) wired to the running proxy.",
|
|
249
249
|
details: [
|
|
250
250
|
"--json prints the generated document as JSON on stdout; use --out for the client's native format.",
|
|
251
251
|
"--out <path> writes the native config there and refuses to replace an existing file without --force.",
|
|
@@ -268,8 +268,13 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
|
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
270
|
name: "system",
|
|
271
|
-
usage: "ocx system <status|settings|startup|diagnostics|sync|update> ...",
|
|
272
|
-
summary: "Manage headless runtime settings, startup, sync, diagnostics, and
|
|
271
|
+
usage: "ocx system <status|settings|startup|diagnostics|sync|codex-app-server|codex-restart|update|codex-cli-update> ...",
|
|
272
|
+
summary: "Manage headless runtime settings, startup, sync, diagnostics, OpenCodex updates, and read-only Codex CLI inspection.",
|
|
273
|
+
details: [
|
|
274
|
+
"system update manages OpenCodex itself.",
|
|
275
|
+
"ocx system codex-cli-update check [--json]",
|
|
276
|
+
"The Codex CLI inspection command makes no package-registry request, does not execute Codex or npm, install or repair software, control a process, or write configuration or cache state.",
|
|
277
|
+
],
|
|
273
278
|
},
|
|
274
279
|
{
|
|
275
280
|
name: "config",
|
|
@@ -309,11 +314,12 @@ export const CLI_COMMANDS: CliCommandEntry[] = [
|
|
|
309
314
|
summary: "Launch opencode wired to the proxy (runtime provider config).",
|
|
310
315
|
details: [
|
|
311
316
|
"Ensures the proxy is running, then execs `opencode` with the generated `provider.opencodex`",
|
|
312
|
-
"
|
|
313
|
-
"existing inline config in the environment is preserved
|
|
314
|
-
"overwritten for this launch.",
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
+
"and `providers.opencodex` blocks injected through OpenCode's inline runtime layer",
|
|
318
|
+
"(`OPENCODE_CONFIG_CONTENT`). Any existing inline config in the environment is preserved",
|
|
319
|
+
"and only `provider.opencodex` and `providers.opencodex` are overwritten for this launch.",
|
|
320
|
+
"Only the V2 block (`providers.opencodex`) carries the reasoning-effort variants.",
|
|
321
|
+
"Global/project opencode.json may be read to warn about an existing provider.opencodex or",
|
|
322
|
+
"providers.opencodex override; on-disk files are never modified.",
|
|
317
323
|
"Routed models appear in the model picker as opencodex/<provider>/<model>.",
|
|
318
324
|
"Stop using `ocx opencode` and plain `opencode` behaves exactly as before.",
|
|
319
325
|
],
|
|
@@ -19,6 +19,7 @@ const USAGE = `Usage:
|
|
|
19
19
|
ocx system sync [--json]
|
|
20
20
|
ocx system codex-app-server [--json]
|
|
21
21
|
ocx system codex-restart --yes [--json]
|
|
22
|
+
ocx system codex-cli-update check [--json]
|
|
22
23
|
ocx system update check [--channel <latest|preview>] [--json]
|
|
23
24
|
ocx system update run [--channel <latest|preview>] [--restart <on|off>] --yes [--json]
|
|
24
25
|
ocx system update status <job-id> [--json]`;
|
|
@@ -95,8 +96,12 @@ async function update(argv: string[], deps: RuntimeApiDeps): Promise<void> {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
export async function handleSystemCommand(argv: string[], deps: RuntimeApiDeps = {}): Promise<number> {
|
|
99
|
+
const [sub = "status", ...rest] = argv;
|
|
100
|
+
if (sub === "codex-cli-update") {
|
|
101
|
+
const { handleCodexCliUpdateCommand } = await import("./codex-cli-update");
|
|
102
|
+
return await handleCodexCliUpdateCommand(rest);
|
|
103
|
+
}
|
|
98
104
|
return runCliAction(async () => {
|
|
99
|
-
const [sub = "status", ...rest] = argv;
|
|
100
105
|
if (sub === "status") await status(rest, deps);
|
|
101
106
|
else if (sub === "settings") await settings(rest, deps);
|
|
102
107
|
else if (sub === "startup") await startup(rest, deps);
|