@bitkyc08/opencodex 2.99.0 → 2.100.1

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 (276) hide show
  1. package/AGENTS_INSTALL.md +19 -1
  2. package/README.md +37 -33
  3. package/SPONSORS.md +5 -1
  4. package/bin/ocx.mjs +1 -1
  5. package/gui/dist/assets/{App-C1hGwaN1.css → App-COo8Yopd.css} +1 -1
  6. package/gui/dist/assets/App-g3Cm2xhZ.js +59 -0
  7. package/gui/dist/assets/Tray-BMDkAiXy.js +1 -0
  8. package/gui/dist/assets/brand-mark-nr3ziR-T.js +1 -0
  9. package/gui/dist/assets/index-Bziu8gTy.css +2 -0
  10. package/gui/dist/assets/index-OYzhQUNP.js +94 -0
  11. package/gui/dist/assets/{segment-thumb-features-fYEMxBaW.js → segment-thumb-features-DKCVUUTi.js} +1 -1
  12. package/gui/dist/classic/assets/App-CgPBKUP-.js +58 -0
  13. package/gui/dist/classic/assets/{Tray-BqZueZOx.js → Tray-BedmOsE7.js} +1 -1
  14. package/gui/dist/classic/assets/index-BR-HhNrp.js +94 -0
  15. package/gui/dist/classic/assets/quota-summary-CXKhvSmQ.js +1 -0
  16. package/gui/dist/classic/index.html +1 -1
  17. package/gui/dist/index.html +2 -2
  18. package/native/ocx-child/Cargo.lock +215 -0
  19. package/native/ocx-child/Cargo.toml +31 -0
  20. package/native/ocx-child/src/cli.rs +1901 -0
  21. package/native/ocx-child/src/codex_home.rs +429 -0
  22. package/native/ocx-child/src/codex_settings.rs +231 -0
  23. package/native/ocx-child/src/daemon.rs +363 -0
  24. package/native/ocx-child/src/http_wire.rs +619 -0
  25. package/native/ocx-child/src/journal.rs +977 -0
  26. package/native/ocx-child/src/lib.rs +22 -0
  27. package/native/ocx-child/src/main.rs +9 -0
  28. package/native/ocx-child/src/parity.rs +102 -0
  29. package/native/ocx-child/src/platform.rs +1487 -0
  30. package/native/ocx-child/src/relay.rs +1288 -0
  31. package/native/ocx-child/src/relay_auth.rs +166 -0
  32. package/native/ocx-child/src/routes.rs +236 -0
  33. package/native/ocx-child/src/state.rs +190 -0
  34. package/native/ocx-child/src/test_hooks.rs +58 -0
  35. package/native/ocx-child/src/toml_surgeon.rs +1156 -0
  36. package/package.json +8 -2
  37. package/src/adapters/anthropic-image-normalize.ts +1 -1
  38. package/src/adapters/anthropic.ts +28 -2
  39. package/src/adapters/claude-cli/adapter.ts +5 -25
  40. package/src/adapters/claude-cli/instruction-images.ts +31 -0
  41. package/src/adapters/claude-cli/stable-replay.ts +42 -14
  42. package/src/adapters/claude-cli/usage-admission.ts +53 -64
  43. package/src/adapters/client-fingerprint.ts +1 -1
  44. package/src/adapters/coding-agent/protocol.ts +1 -1
  45. package/src/adapters/devin/live-models.ts +3 -0
  46. package/src/adapters/google-http.ts +3 -0
  47. package/src/adapters/google-vertex-key-project.ts +10 -2
  48. package/src/adapters/google.ts +40 -8
  49. package/src/adapters/kiro/usage.ts +3 -13
  50. package/src/adapters/openai-chat/mistral-image-limit.ts +28 -15
  51. package/src/adapters/openai-chat-images.ts +100 -0
  52. package/src/adapters/openai-chat.ts +6 -9
  53. package/src/adapters/openai-responses/passthrough.ts +5 -2
  54. package/src/adapters/openai-responses/request-strips.ts +32 -0
  55. package/src/adapters/openai-responses/tool-schema.ts +9 -4
  56. package/src/chat/inbound.ts +1 -1
  57. package/src/claude/auth-detect.ts +26 -8
  58. package/src/claude/inbound-content-options.ts +18 -3
  59. package/src/claude/inbound.ts +5 -2
  60. package/src/cli/bundled-bun-diagnostic.ts +91 -0
  61. package/src/cli/capabilities-agents-routing.ts +2 -2
  62. package/src/cli/capabilities-observe-system.ts +60 -0
  63. package/src/cli/combo-input.ts +6 -0
  64. package/src/cli/combo-result.ts +1 -1
  65. package/src/cli/combo.ts +4 -0
  66. package/src/cli/config-command.ts +16 -2
  67. package/src/cli/connect.ts +12 -10
  68. package/src/cli/dispatch.ts +4 -0
  69. package/src/cli/doctor.ts +11 -0
  70. package/src/cli/help.ts +1 -0
  71. package/src/cli/init.ts +4 -0
  72. package/src/cli/link-enrollment.ts +152 -25
  73. package/src/cli/link-local-control.ts +49 -0
  74. package/src/cli/link.ts +37 -10
  75. package/src/cli/provider-lifecycle-runtime.ts +4 -2
  76. package/src/cli/registry.ts +13 -0
  77. package/src/cli/star-prompt.ts +2 -0
  78. package/src/cli/status.ts +1 -1
  79. package/src/cli/telemetry-profile.ts +206 -0
  80. package/src/cli/telemetry.ts +260 -0
  81. package/src/client/hub-relay.ts +26 -0
  82. package/src/client/machine-api.ts +3 -0
  83. package/src/clients/config-export/t3code.ts +44 -5
  84. package/src/clients/omo-role-models.ts +1 -1
  85. package/src/codex/catalog/bundled.ts +44 -2
  86. package/src/codex/runtime.ts +12 -0
  87. package/src/codex/shim-restore-lock.ts +67 -30
  88. package/src/combos/types.ts +21 -1
  89. package/src/config/atomic-write.ts +24 -1
  90. package/src/config/diagnostics.ts +15 -0
  91. package/src/config/live-reconcile.ts +17 -0
  92. package/src/config/load-degrade.ts +16 -0
  93. package/src/config/provider-validation.ts +29 -0
  94. package/src/config/schema/config-schema.ts +24 -0
  95. package/src/config/schema/leaf-validators.ts +17 -0
  96. package/src/config/telemetry-carry.ts +30 -0
  97. package/src/config.ts +13 -1
  98. package/src/generated/compatibility-version.json +422 -170
  99. package/src/generated/model-metadata.ts +3 -3
  100. package/src/integrations/aside-profiles.ts +7 -1
  101. package/src/integrations/owned-refresh.ts +9 -2
  102. package/src/lab/artifacts/secure-fs.ts +12 -11
  103. package/src/lab/fabric/scratch.ts +11 -9
  104. package/src/lab/public/community.ts +2 -3
  105. package/src/lab/public/file-safety.ts +18 -20
  106. package/src/lab/public/mutation-lock.ts +109 -337
  107. package/src/lab/public/private-file.ts +4 -3
  108. package/src/lib/bun-runtime-preflight.ts +1 -1
  109. package/src/lib/codex-catalog-read-only.ts +122 -0
  110. package/src/lib/config-ownership.ts +56 -18
  111. package/src/lib/errors.ts +11 -0
  112. package/src/lib/gcp-adc.ts +167 -48
  113. package/src/lib/jsonc.ts +4 -2
  114. package/src/lib/local-control-socket.ts +88 -0
  115. package/src/lib/privacy.ts +15 -0
  116. package/src/lib/provider-client-headers.ts +3 -0
  117. package/src/lib/token-estimate.ts +13 -2
  118. package/src/link/child-binary-source.ts +228 -0
  119. package/src/link/ephemeral-child.ts +45 -0
  120. package/src/link/remote-plant.ts +306 -0
  121. package/src/link/remote-windows.ts +59 -5
  122. package/src/link/ssh-argv.ts +71 -8
  123. package/src/link/status-projection.ts +2 -0
  124. package/src/link/store.ts +5 -1
  125. package/src/oauth/anthropic-model-quota.ts +12 -0
  126. package/src/oauth/anthropic-routing.ts +11 -4
  127. package/src/oauth/claude-keychain-read.ts +165 -0
  128. package/src/oauth/kiro-iam-identity-center.ts +4 -1
  129. package/src/oauth/local-token-detect.ts +14 -17
  130. package/src/protocols/envelope.ts +20 -2
  131. package/src/providers/api-key-selection.ts +8 -2
  132. package/src/providers/claude-cli-identity.ts +9 -3
  133. package/src/providers/claude-cli-usage-state.ts +93 -0
  134. package/src/providers/claude-cli-usage.ts +3 -2
  135. package/src/providers/github-copilot-auto.ts +25 -5
  136. package/src/providers/meta-muse-plan-refusal.ts +94 -0
  137. package/src/providers/model-rename-fields.ts +3 -0
  138. package/src/providers/quota/anthropic-family-headers.ts +8 -1
  139. package/src/providers/quota/anthropic-usage-windows.ts +49 -2
  140. package/src/providers/quota/vendor-probes-key.ts +23 -4
  141. package/src/providers/quota/vendor-probes-oauth.ts +59 -0
  142. package/src/providers/quota/workbuddy.ts +2 -2
  143. package/src/providers/quota-types.ts +7 -0
  144. package/src/providers/quota.ts +25 -18
  145. package/src/providers/registry/entries-core.ts +7 -4
  146. package/src/providers/registry/entries-extended.ts +42 -8
  147. package/src/providers/registry/model-ids.ts +1 -0
  148. package/src/providers/registry/model-seeds.ts +10 -2
  149. package/src/providers/registry/types.ts +6 -0
  150. package/src/providers/resolved-model-policy.ts +4 -0
  151. package/src/providers/routed-config.ts +30 -3
  152. package/src/providers/stale-no-vision-seed-migration.ts +7 -0
  153. package/src/providers/vertex-environment-authority.ts +50 -0
  154. package/src/providers/workbuddy-credit-balance.ts +38 -6
  155. package/src/quota-pool/assemble.ts +14 -6
  156. package/src/responses/retained-compaction.ts +31 -5
  157. package/src/router.ts +1 -0
  158. package/src/server/adapter-resolve.ts +11 -6
  159. package/src/server/audio-dictation.ts +21 -7
  160. package/src/server/auth-cors.ts +19 -0
  161. package/src/server/background-lifecycle.ts +71 -0
  162. package/src/server/chat-completions.ts +2 -0
  163. package/src/server/claude-messages.ts +30 -3
  164. package/src/server/index/live-sideband.ts +15 -1
  165. package/src/server/index/local-control-listener.ts +515 -0
  166. package/src/server/index/optional-listeners.ts +21 -1
  167. package/src/server/index/serve-options.ts +4 -3
  168. package/src/server/index/websocket-handler.ts +2 -0
  169. package/src/server/index.ts +3 -0
  170. package/src/server/management/combo-routes.ts +6 -1
  171. package/src/server/management/context.ts +1 -0
  172. package/src/server/management/link-child-preflight.ts +74 -0
  173. package/src/server/management/link-enrollment.ts +190 -25
  174. package/src/server/management/link-route-state.ts +6 -1
  175. package/src/server/management/link-routes.ts +27 -9
  176. package/src/server/management/model-rows.ts +4 -0
  177. package/src/server/management/oauth-account-routes.ts +9 -4
  178. package/src/server/management/provider-overwrite-carry.ts +9 -2
  179. package/src/server/management/provider-routes.ts +14 -0
  180. package/src/server/management/provider-thinking-display-patch.ts +54 -0
  181. package/src/server/management/route-registry.ts +7 -0
  182. package/src/server/management/session-routes.ts +4 -1
  183. package/src/server/management/telemetry-routes.ts +37 -0
  184. package/src/server/management/usage-aggregate-cache.ts +290 -67
  185. package/src/server/management-api.ts +11 -2
  186. package/src/server/messages-native-preflight.ts +166 -0
  187. package/src/server/messages-native.ts +143 -43
  188. package/src/server/messages-shared.ts +14 -0
  189. package/src/server/proxy-liveness.ts +99 -6
  190. package/src/server/request-log-conversation.ts +18 -2
  191. package/src/server/request-log.ts +7 -2
  192. package/src/server/responses/adapter-continuation.ts +1 -0
  193. package/src/server/responses/adapter-dispatch.ts +11 -28
  194. package/src/server/responses/adapter-failure-message.ts +68 -0
  195. package/src/server/responses/combo-stream-preflight.ts +14 -2
  196. package/src/server/responses/compact.ts +13 -1
  197. package/src/server/responses/core-auth.ts +26 -5
  198. package/src/server/responses/core-codex-account.ts +8 -1
  199. package/src/server/responses/core-combo-failure.ts +6 -1
  200. package/src/server/responses/core-combo-native.ts +150 -37
  201. package/src/server/responses/core-combo.ts +15 -9
  202. package/src/server/responses/core-normalize.ts +1 -0
  203. package/src/server/responses/core-options.ts +7 -1
  204. package/src/server/responses/core-pipeline.ts +21 -1
  205. package/src/server/responses/fetch-helpers.ts +5 -0
  206. package/src/server/responses/opengateway-completion-guard.ts +7 -3
  207. package/src/server/responses/passthrough-delivery.ts +8 -1
  208. package/src/server/responses/passthrough-error.ts +22 -0
  209. package/src/server/responses/request-prepare.ts +7 -1
  210. package/src/server/responses/request-transport.ts +28 -5
  211. package/src/server/responses/run-turn-execution.ts +13 -0
  212. package/src/server/sse-frame-buffer.ts +5 -0
  213. package/src/server/ws-bridge.ts +10 -0
  214. package/src/service/launchd.ts +78 -4
  215. package/src/telemetry/aggregate.ts +348 -0
  216. package/src/telemetry/consent.ts +128 -0
  217. package/src/telemetry/contract.ts +403 -0
  218. package/src/telemetry/disclosure.ts +19 -0
  219. package/src/telemetry/install-id.ts +226 -0
  220. package/src/telemetry/payload.ts +129 -0
  221. package/src/telemetry/profile/client.ts +150 -0
  222. package/src/telemetry/profile/contract.ts +288 -0
  223. package/src/telemetry/profile/disclosure.ts +14 -0
  224. package/src/telemetry/profile/paths.ts +13 -0
  225. package/src/telemetry/profile/routes.ts +99 -0
  226. package/src/telemetry/profile/service.ts +234 -0
  227. package/src/telemetry/profile/state.ts +189 -0
  228. package/src/telemetry/profile/sync.ts +276 -0
  229. package/src/telemetry/routes.ts +183 -0
  230. package/src/telemetry/scheduler.ts +386 -0
  231. package/src/telemetry/sender.ts +97 -0
  232. package/src/telemetry/state.ts +334 -0
  233. package/src/types/combo-jev-effort-mode.ts +11 -0
  234. package/src/types/config.ts +3 -0
  235. package/src/types/provider.ts +11 -1
  236. package/src/types/request.ts +2 -0
  237. package/src/types/telemetry.ts +15 -0
  238. package/src/types/wire.ts +10 -0
  239. package/src/types.ts +5 -0
  240. package/src/update/index.ts +7 -1
  241. package/src/update/minisign.d.mts +17 -0
  242. package/src/update/minisign.mjs +88 -0
  243. package/src/update/signed-supply.d.mts +59 -0
  244. package/src/update/signed-supply.mjs +289 -0
  245. package/src/update/trust-root.json +38 -0
  246. package/src/update/update-bounded-json.d.mts +4 -0
  247. package/src/update/update-bounded-json.mjs +113 -0
  248. package/src/update/update-bytes.d.mts +2 -0
  249. package/src/update/update-bytes.mjs +23 -0
  250. package/src/update/update-candidate-id.d.mts +2 -0
  251. package/src/update/update-candidate-id.mjs +23 -0
  252. package/src/update/update-checkpoint-codec.d.mts +33 -0
  253. package/src/update/update-checkpoint-codec.mjs +217 -0
  254. package/src/update/update-contracts.d.mts +24 -0
  255. package/src/update/update-contracts.mjs +207 -0
  256. package/src/update/update-signature-threshold.d.mts +12 -0
  257. package/src/update/update-signature-threshold.mjs +47 -0
  258. package/src/update/update-signed-version.d.mts +5 -0
  259. package/src/update/update-signed-version.mjs +25 -0
  260. package/src/update/update-trust-anchor.d.mts +2 -0
  261. package/src/update/update-trust-anchor.mjs +2 -0
  262. package/src/usage/cache-diagnostic.ts +195 -50
  263. package/src/usage/expected-prices.ts +20 -2
  264. package/src/usage/filter-index.ts +1469 -0
  265. package/src/usage/ledger-scanner.ts +245 -4
  266. package/src/usage/source-filter.ts +10 -2
  267. package/src/usage/summary.ts +16 -0
  268. package/src/web-search/parse.ts +265 -38
  269. package/gui/dist/assets/App-BepstgEN.js +0 -59
  270. package/gui/dist/assets/Tray-BinxbEZo.js +0 -1
  271. package/gui/dist/assets/brand-mark-wzPe3R-J.js +0 -1
  272. package/gui/dist/assets/index-C-9X2yaI.js +0 -94
  273. package/gui/dist/assets/index-bnUWypyz.css +0 -2
  274. package/gui/dist/classic/assets/App-DX88_GCW.js +0 -58
  275. package/gui/dist/classic/assets/index-fSP71pLB.js +0 -94
  276. package/gui/dist/classic/assets/quota-summary-y2fl0WBv.js +0 -1
@@ -0,0 +1,91 @@
1
+ /**
2
+ * `ocx doctor` check for a package install whose bundled Bun dependency never finished
3
+ * installing (#8361).
4
+ *
5
+ * npm 12 blocks dependency lifecycle scripts by default. The `bun` npm package downloads nothing
6
+ * in its tarball: its postinstall copies the selected `@oven/bun-*` executable into `bin/`. An
7
+ * install that skipped that script succeeds and leaves a ~450-byte placeholder, so the launcher
8
+ * fails later with "the `bun` dependency is not installed". Doctor is where an operator looks
9
+ * after that failure, so it names the state and the exact command that repairs it.
10
+ *
11
+ * The check is observe-only and never fails the doctor run: a leftover PATH Bun or an explicit
12
+ * `OPENCODEX_BUN_PATH` can still be serving requests, which makes this a degraded install rather
13
+ * than an unusable surface.
14
+ */
15
+ import { dirname, resolve } from "node:path";
16
+ import { fileURLToPath } from "node:url";
17
+ import * as bunRuntime from "../lib/bun-runtime";
18
+ import * as installDetection from "../update/install-detection.mjs";
19
+
20
+ const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
21
+
22
+ export const BUNDLED_BUN_MISSING_DETAIL = "the `bun` dependency is not installed";
23
+ export const NPM_BUN_REPAIR_COMMAND = "npm install -g --allow-scripts=bun @bitkyc08/opencodex";
24
+
25
+ type PackageInstaller = "npm" | "pnpm" | "bun" | "mise";
26
+
27
+ export type BundledBunDiagnostic =
28
+ | { status: "ready"; path: string }
29
+ | { status: "not-applicable" }
30
+ | { status: "missing"; installer: PackageInstaller; lines: string[] };
31
+
32
+ export interface BundledBunDiagnosticDeps {
33
+ platform?: NodeJS.Platform;
34
+ bundledPath?: () => string | null;
35
+ detectOwnership?: () => { installer: string; owner?: { tool: string } | null };
36
+ }
37
+
38
+ /** The command that reinstalls this package while allowing bun's postinstall. */
39
+ export function bundledBunRepairCommand(installer: PackageInstaller, tool?: string | null): string | null {
40
+ if (installer === "npm") return NPM_BUN_REPAIR_COMMAND;
41
+ if (installer === "pnpm") return "pnpm add -g --allow-build=bun @bitkyc08/opencodex";
42
+ if (installer === "bun") return "bun add -g @bitkyc08/opencodex";
43
+ return tool ? `mise upgrade ${tool}` : null;
44
+ }
45
+
46
+ export function collectBundledBunDiagnostic(deps: BundledBunDiagnosticDeps = {}): BundledBunDiagnostic {
47
+ const bundled = (deps.bundledPath ?? bunRuntime.bundledBunPath)();
48
+ if (bundled) return { status: "ready", path: bundled };
49
+
50
+ const ownership = (deps.detectOwnership
51
+ ?? (() => installDetection.detectInstallOwnershipFromPath(PACKAGE_ROOT)))();
52
+ const installer = ownership.installer;
53
+ // Only the mise verdict carries an owner; the others have no tool to name.
54
+ const ownerTool = "owner" in ownership ? ownership.owner?.tool ?? null : null;
55
+ // A source checkout has no bundled dependency by design, and a standalone binary carries its
56
+ // own runtime; neither is a skipped-postinstall symptom.
57
+ if (installer !== "npm" && installer !== "pnpm" && installer !== "bun" && installer !== "mise") {
58
+ return { status: "not-applicable" };
59
+ }
60
+
61
+ const repair = bundledBunRepairCommand(installer, ownerTool);
62
+ const windows = (deps.platform ?? process.platform) === "win32";
63
+ const lines = [
64
+ ` !! ${BUNDLED_BUN_MISSING_DETAIL} (its postinstall was skipped or the dependency is incomplete)`,
65
+ " Allow bun's own install script; npm 12 blocks lifecycle scripts by default,",
66
+ " and --ignore-scripts or ignore-scripts=true in an npmrc blocks it on any npm",
67
+ ];
68
+ if (!repair) {
69
+ lines.push(" This mise-owned installation has no verified tool name; upgrade it through mise.");
70
+ return { status: "missing", installer, lines };
71
+ }
72
+ if (windows && installer === "npm") {
73
+ // A running bun.exe holds node_modules/bun/bin open, so npm fails with EBUSY. The instruction
74
+ // has to stop first; `ocx update` does this itself, but a manual reinstall does not.
75
+ lines.push(" Stop the proxy first so Windows releases node_modules/bun/bin, then run:");
76
+ lines.push(" ocx stop");
77
+ lines.push(` ${repair}`);
78
+ lines.push(" Restart afterwards: ocx service restart (or ocx start when unmanaged)");
79
+ } else {
80
+ lines.push(" Fix: reinstall with the package manager that owns this install:");
81
+ lines.push(` ${repair}`);
82
+ }
83
+ return { status: "missing", installer, lines };
84
+ }
85
+
86
+ /** Render the doctor "Bundled Bun runtime" section lines. */
87
+ export function formatBundledBunDiagnosticLines(diagnostic: BundledBunDiagnostic): string[] {
88
+ if (diagnostic.status === "ready") return [` ok ready: ${diagnostic.path}`];
89
+ if (diagnostic.status === "not-applicable") return [];
90
+ return diagnostic.lines;
91
+ }
@@ -395,10 +395,10 @@ export const AGENT_ROUTING_CAPABILITIES: readonly Capability[] = [
395
395
  },
396
396
  {
397
397
  command: ["combo","set"],
398
- usage: "ocx combo set <id> [--targets <provider/model[:weight],...> | --targets-file <FILE|->] [--strategy <failover|round-robin|random|least-used|reset-window|jev>] [--sticky <1-100|->] [--cooldown-reprobe <on|off>] [--cooldown-reprobe-interval <ms>] [--effort <low|medium|high|xhigh|max|ultra|->] [--effort-mode <fallback|force|->] [--alias <name|->] [--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->] [--description <text|->] [--decision-provider <provider|-> | --decision-model <route|->] [--decision-timeout <ms|->] [--decision-quota-signals <on|off|->] [--decision-quota-tiers <JSON|->] [--session-pin <duration|->] [--rename-from <id>] [--image-input <auto|disabled>] [--reasoning-effort-mode <strict|adaptive>] [--json]",
398
+ usage: "ocx combo set <id> [--targets <provider/model[:weight],...> | --targets-file <FILE|->] [--strategy <failover|round-robin|random|least-used|reset-window|jev>] [--sticky <1-100|->] [--cooldown-reprobe <on|off>] [--cooldown-reprobe-interval <ms>] [--effort <low|medium|high|xhigh|max|ultra|->] [--effort-mode <fallback|force|->] [--alias <name|->] [--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->] [--description <text|->] [--decision-provider <provider|-> | --decision-model <route|->] [--decision-timeout <ms|->] [--decision-quota-signals <on|off|->] [--decision-quota-tiers <JSON|->] [--session-pin <duration|->] [--rename-from <id>] [--image-input <auto|disabled>] [--reasoning-effort-mode <strict|adaptive>] [--jev-effort-mode <decide|client>] [--json]",
399
399
  summary: "Create, update or rename a combo.",
400
400
  routes: [{"method":"GET","path":"/api/combos"},{"method":"PUT","path":"/api/combos"}],
401
- flags: [{"name":"--allow-metered-targets","value":"string","summary":"on grants operator consent to metered targets only on a loopback-only proxy; off clears it."},{"name":"--targets","value":"string","summary":"Ordered provider/model[:weight] list; required for creation."},{"name":"--strategy","value":"string","summary":"Routing strategy."},{"name":"--sticky","value":"string","summary":"Round-robin limit 1-100; - resets."},{"name":"--cooldown-reprobe","value":"string","summary":"Opt into one recovery pass when all eligible targets cool; off by default."},{"name":"--cooldown-reprobe-interval","value":"string","summary":"Minimum interval between recovery passes in ms (1000..86400000); default 300000."},{"name":"--effort","value":"string","summary":"Default effort; - clears."},{"name":"--effort-mode","value":"string","summary":"fallback or force; - resets to fallback."},{"name":"--alias","value":"string","summary":"Alias; - clears."},{"name":"--display-name","value":"string","summary":"Label; - clears."},{"name":"--description","value":"string","summary":"Catalog row description; - clears."},{"name":"--decision-provider","value":"string","summary":"JEV provider; - clears."},{"name":"--decision-model","value":"string","summary":"JEV route; - clears; exclusive with provider."},{"name":"--decision-timeout","value":"string","summary":"JEV deadline 1000-120000 ms; - clears."},{"name":"--decision-quota-signals","value":"string","summary":"JEV advisory quota on/off; - clears."},{"name":"--decision-quota-tiers","value":"string","summary":"Partial JSON thresholds; - clears."},{"name":"--session-pin","value":"string","summary":"JEV session pin idle window 1m-24h (90s, 20m, 1h); - clears."},{"name":"--rename-from","value":"string","summary":"Existing combo ID to rename."},{"name":"--json","value":"boolean","summary":"Emit structured JSON."},{"name":"--native-alias","value":"string","summary":"Bare legacy flag means on; explicit on/off preserves presence, including false."},{"name":"--targets-file","value":"string","summary":"Bounded ordered target JSON array, exclusive with --targets; preserves effort/profile/last-resort metadata."},{"name":"--image-input","value":"string","summary":"auto or disabled; explicit auto clears the previous disabled choice."},{"name":"--reasoning-effort-mode","value":"string","summary":"strict or adaptive, distinct from --effort-mode fallback/force."}],
401
+ flags: [{"name":"--allow-metered-targets","value":"string","summary":"on grants operator consent to metered targets only on a loopback-only proxy; off clears it."},{"name":"--targets","value":"string","summary":"Ordered provider/model[:weight] list; required for creation."},{"name":"--strategy","value":"string","summary":"Routing strategy."},{"name":"--sticky","value":"string","summary":"Round-robin limit 1-100; - resets."},{"name":"--cooldown-reprobe","value":"string","summary":"Opt into one recovery pass when all eligible targets cool; off by default."},{"name":"--cooldown-reprobe-interval","value":"string","summary":"Minimum interval between recovery passes in ms (1000..86400000); default 300000."},{"name":"--effort","value":"string","summary":"Default effort; - clears."},{"name":"--effort-mode","value":"string","summary":"fallback or force; - resets to fallback."},{"name":"--alias","value":"string","summary":"Alias; - clears."},{"name":"--display-name","value":"string","summary":"Label; - clears."},{"name":"--description","value":"string","summary":"Catalog row description; - clears."},{"name":"--decision-provider","value":"string","summary":"JEV provider; - clears."},{"name":"--decision-model","value":"string","summary":"JEV route; - clears; exclusive with provider."},{"name":"--decision-timeout","value":"string","summary":"JEV deadline 1000-120000 ms; - clears."},{"name":"--decision-quota-signals","value":"string","summary":"JEV advisory quota on/off; - clears."},{"name":"--decision-quota-tiers","value":"string","summary":"Partial JSON thresholds; - clears."},{"name":"--session-pin","value":"string","summary":"JEV session pin idle window 1m-24h (90s, 20m, 1h); - clears."},{"name":"--rename-from","value":"string","summary":"Existing combo ID to rename."},{"name":"--json","value":"boolean","summary":"Emit structured JSON."},{"name":"--native-alias","value":"string","summary":"Bare legacy flag means on; explicit on/off preserves presence, including false."},{"name":"--targets-file","value":"string","summary":"Bounded ordered target JSON array, exclusive with --targets; preserves effort/profile/last-resort metadata."},{"name":"--image-input","value":"string","summary":"auto or disabled; explicit auto clears the previous disabled choice."},{"name":"--reasoning-effort-mode","value":"string","summary":"strict or adaptive, distinct from --effort-mode fallback/force."},{"name":"--jev-effort-mode","value":"string","summary":"JEV wire-effort owner: decide (default) applies the decision effort; client keeps its target and leaves effort to combo policy."}],
402
402
  mutates: true,
403
403
  json: "payload",
404
404
  details: ["create and update are aliases of set. Existing fields are read before writing; --targets replaces targets. Without --strategy an existing combo keeps its stored strategy and JEV policy; a new combo defaults to failover.","force overrides valid client effort and may increase cost and latency.","Only the implemented target grammar is supported; full GUI target metadata and routing-profile writes are separate tasks.","New file/flag conflicts refuse before transport. Partial edits preserve target metadata; explicit false/default values override server carry. Turning a native alias off may also require clearing its incompatible alias.","Read/merge/write uses one target and remains an upsert without revision CAS. Saved-but-incomplete catalog outcomes return nonzero with their receipt."],
@@ -729,4 +729,64 @@ export const OBSERVE_SYSTEM_CAPABILITIES: readonly Capability[] = [
729
729
  json: "payload",
730
730
  details: ["start/end are epoch seconds. The end must match the request-time bucket or its immediate successor after an observed rollover; stale windows are refused. Empty series still includes metadata; missingMeasurements and truncated remain visible instead of implying measured complete zero traffic.","Uses existing query validation and checks applied model/provider-exclusion scope. It does not change companion settings or request inference."],
731
731
  },
732
+ {
733
+ command: ["telemetry", "status"],
734
+ usage: "ocx telemetry status [--json]",
735
+ summary: "Inspect anonymous telemetry consent status and the daily payload preview.",
736
+ routes: [{"method": "GET", "path": "/api/telemetry"}],
737
+ flags: [{"name": "--json", "value": "boolean", "summary": "Emit the telemetry status and preview as JSON."}],
738
+ mutates: false,
739
+ json: "payload",
740
+ details: ["Reads live status from the running proxy and falls back to local configuration and ledger preview when the proxy is stopped.", "Previews the oldest eligible unsent day, or the latest completed day with previewEligible = false when no day is eligible. Never creates or transmits a telemetry install identifier."],
741
+ },
742
+ {
743
+ command: ["telemetry", "enable"],
744
+ usage: "ocx telemetry enable [--json]",
745
+ summary: "Opt in to anonymous daily usage telemetry.",
746
+ routes: [],
747
+ flags: [{"name": "--json", "value": "boolean", "summary": "Emit the updated telemetry status as JSON."}],
748
+ mutates: true,
749
+ json: "envelope",
750
+ details: ["Requires an interactive human terminal, prints the telemetry disclosure block, and asks for confirmation before recording telemetry.decision = accepted.", "Refuses with agent_consent_required when agent-driven and with tty_required when non-interactive or running under OCX_SERVICE."],
751
+ },
752
+ {
753
+ command: ["telemetry", "disable"],
754
+ usage: "ocx telemetry disable [--json]",
755
+ summary: "Opt out of anonymous daily usage telemetry and delete the local telemetry identifier.",
756
+ routes: [],
757
+ flags: [{"name": "--json", "value": "boolean", "summary": "Emit the updated telemetry status as JSON."}],
758
+ mutates: true,
759
+ json: "envelope",
760
+ details: ["Writes telemetry.decision = declined in local config.json and removes telemetry-id.json.", "Always permitted, including in agent-driven sessions."],
761
+ },
762
+ {
763
+ command: ["telemetry", "profile", "status"],
764
+ usage: "ocx telemetry profile status [--json]",
765
+ summary: "Inspect the opt-in public leaderboard profile, its next submission preview and its ranks.",
766
+ routes: [{"method": "GET", "path": "/api/telemetry/profile"}, {"method": "GET", "path": "/api/telemetry/profile/rank"}],
767
+ flags: [{"name": "--json", "value": "boolean", "summary": "Emit the profile status, preview and ranks as JSON."}],
768
+ mutates: false,
769
+ json: "payload",
770
+ details: ["Reads live status from the running proxy and falls back to the local profile file when the proxy is stopped.", "Never prints the profile secret."],
771
+ },
772
+ {
773
+ command: ["telemetry", "profile", "connect"],
774
+ usage: "ocx telemetry profile connect --handle <handle> [--name <display name>] [--avatar <colour>] [--json]",
775
+ summary: "Create an opt-in public leaderboard profile.",
776
+ routes: [],
777
+ flags: [{"name": "--handle", "value": "string", "summary": "Public handle: 3 to 24 lowercase letters, digits or hyphens."}, {"name": "--name", "value": "string", "summary": "Public display name; defaults to the handle."}, {"name": "--avatar", "value": "string", "summary": "Avatar colour from the fixed palette; default blue."}, {"name": "--json", "value": "boolean", "summary": "Emit the connected profile as JSON."}],
778
+ mutates: true,
779
+ json: "envelope",
780
+ details: ["Requires an interactive human terminal and anonymous telemetry turned on, prints the public-profile disclosure, and asks for confirmation (default no).", "Refuses with agent_consent_required when agent-driven and with tty_required when non-interactive or running under OCX_SERVICE."],
781
+ },
782
+ {
783
+ command: ["telemetry", "profile", "disconnect"],
784
+ usage: "ocx telemetry profile disconnect [--json]",
785
+ summary: "Delete the public leaderboard profile and all its data on the server.",
786
+ routes: [{"method": "DELETE", "path": "/api/telemetry/profile"}],
787
+ flags: [{"name": "--json", "value": "boolean", "summary": "Emit the disconnect outcome as JSON."}],
788
+ mutates: true,
789
+ json: "envelope",
790
+ details: ["Always permitted, including in agent-driven sessions and while anonymous telemetry is off.", "Uses the running proxy when available and otherwise deletes directly; an unreachable telemetry service leaves the deletion pending for the proxy to retry."],
791
+ },
732
792
  ];
@@ -7,6 +7,7 @@ type ComboInput = {
7
7
  targets?: Array<Record<string, unknown>>;
8
8
  imageInput?: "auto" | "disabled";
9
9
  reasoningEffortMode?: "strict" | "adaptive";
10
+ jevEffortMode?: "decide" | "client";
10
11
  nativeAlias?: boolean;
11
12
  allowMeteredTargets?: boolean;
12
13
  };
@@ -73,6 +74,7 @@ export async function prepareComboInput(args: string[], deps: RuntimeApiDeps = {
73
74
  const file = takeOptionWithSyntax(args, "--targets-file")?.value;
74
75
  const image = takeOptionWithSyntax(args, "--image-input")?.value;
75
76
  const reasoning = takeOptionWithSyntax(args, "--reasoning-effort-mode")?.value;
77
+ const jevEffort = takeOptionWithSyntax(args, "--jev-effort-mode")?.value;
76
78
  const nativeAlias = takeNativeAlias(args);
77
79
  const metered = takeOptionWithSyntax(args, "--allow-metered-targets")?.value;
78
80
  if (metered !== undefined && metered !== "on" && metered !== "off") {
@@ -87,10 +89,14 @@ export async function prepareComboInput(args: string[], deps: RuntimeApiDeps = {
87
89
  if (reasoning !== undefined && reasoning !== "strict" && reasoning !== "adaptive") {
88
90
  throw new CliUsageError("--reasoning-effort-mode must be strict or adaptive");
89
91
  }
92
+ if (jevEffort !== undefined && jevEffort !== "decide" && jevEffort !== "client") {
93
+ throw new CliUsageError("--jev-effort-mode must be decide or client");
94
+ }
90
95
  return {
91
96
  ...(file === undefined ? {} : { targets: parseComboTargets(await readJsonInput(file, deps)) }),
92
97
  ...(image === undefined ? {} : { imageInput: image }),
93
98
  ...(reasoning === undefined ? {} : { reasoningEffortMode: reasoning }),
99
+ ...(jevEffort === undefined ? {} : { jevEffortMode: jevEffort }),
94
100
  ...(nativeAlias === undefined ? {} : { nativeAlias }),
95
101
  ...(metered === undefined ? {} : { allowMeteredTargets: metered === "on" }),
96
102
  };
@@ -6,7 +6,7 @@ import { printCatalogResult } from "./catalog-command-result";
6
6
  const ENUMS: Readonly<Record<string, readonly (string | null)[]>> = {
7
7
  strategy: ["failover", "round-robin", "random", "least-used", "reset-window", "jev"],
8
8
  defaultEffort: [null, "low", "medium", "high", "xhigh", "max", "ultra"],
9
- defaultEffortMode: ["fallback", "force"], reasoningEffortMode: ["strict", "adaptive"],
9
+ defaultEffortMode: ["fallback", "force"], reasoningEffortMode: ["strict", "adaptive"], jevEffortMode: ["decide", "client"],
10
10
  imageInput: ["auto", "disabled"], cooldownWaitPolicy: ["before-last-resort"],
11
11
  };
12
12
  const STRINGS = new Set(["alias", "displayName", "description", "decisionProvider", "decisionModel"]);
package/src/cli/combo.ts CHANGED
@@ -30,6 +30,7 @@ const USAGE = `Usage:
30
30
  [--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->]
31
31
  [--description <text|->]
32
32
  [--image-input <auto|disabled>] [--reasoning-effort-mode <strict|adaptive>]
33
+ [--jev-effort-mode <decide|client>]
33
34
  [--decision-provider <provider|-> | --decision-model <route|->] [--decision-timeout <ms|->]
34
35
  [--decision-quota-signals <on|off|->] [--decision-quota-tiers <JSON|->]
35
36
  [--session-pin <duration|->] (e.g. 20m; keeps a session on JEV's target while active)
@@ -175,6 +176,7 @@ async function set(argv: string[], deps: RuntimeApiDeps): Promise<number> {
175
176
  if (quotaSignals !== undefined && quotaSignals !== "-" || quotaTiers !== undefined && quotaTiers !== "-") throw new CliUsageError("quota settings apply only to jev", USAGE);
176
177
  if (sessionPinMs !== undefined) throw new CliUsageError("--session-pin applies only to the jev strategy", USAGE);
177
178
  if (decisionTimeoutMs != null) throw new CliUsageError("--decision-timeout applies only to the jev strategy", USAGE);
179
+ if (additional.jevEffortMode === "client") throw new CliUsageError("--jev-effort-mode client applies only to the jev strategy", USAGE);
178
180
  };
179
181
  if (strategyRaw !== undefined) requireStrategyFlags(strategyRaw);
180
182
  deps = { ...deps, baseUrl: await runtimeBaseUrl(deps) };
@@ -210,6 +212,7 @@ async function set(argv: string[], deps: RuntimeApiDeps): Promise<number> {
210
212
  if (additional.allowMeteredTargets !== undefined) combo.allowMeteredTargets = additional.allowMeteredTargets;
211
213
  if (additional.imageInput !== undefined) combo.imageInput = additional.imageInput;
212
214
  if (additional.reasoningEffortMode !== undefined) combo.reasoningEffortMode = additional.reasoningEffortMode;
215
+ if (additional.jevEffortMode !== undefined) combo.jevEffortMode = additional.jevEffortMode;
213
216
  if (displayName !== undefined) combo.displayName = displayName === "-" ? "" : displayName;
214
217
  if (description !== undefined) combo.description = description === "-" ? "" : description;
215
218
  if (decisionProvider !== undefined) combo.decisionProvider = decisionProvider === "-" ? null : decisionProvider;
@@ -227,6 +230,7 @@ async function set(argv: string[], deps: RuntimeApiDeps): Promise<number> {
227
230
  delete combo.decisionQuotaSignals;
228
231
  delete combo.decisionQuotaTiers;
229
232
  delete combo.sessionPin;
233
+ delete combo.jevEffortMode;
230
234
  }
231
235
  if (effortMode === undefined && existing?.defaultEffortMode === "force") {
232
236
  combo.defaultEffortMode = effort === "-" ? "fallback" : "force";
@@ -258,6 +258,9 @@ export async function handleConfigCommand(argv: string[]): Promise<number> {
258
258
  const raw = action === "set" ? args.shift() : undefined;
259
259
  if (!path || (action === "set" && raw === undefined)) throw new CliUsageError(action === "unset" ? "config path is required" : "config path and value are required", USAGE);
260
260
  rejectArgs(args, USAGE);
261
+ if (pathSegments(path)[0] === "telemetry") {
262
+ throw new CliUsageError("telemetry cannot be modified via ocx config; use `ocx telemetry enable` or `ocx telemetry disable`", USAGE);
263
+ }
261
264
  // #1835/#1838: the read used to happen OUTSIDE the mutation lock, so a concurrent
262
265
  // edit landing between it and the save was reverted by this whole-snapshot write.
263
266
  // `mutatePersistedConfig` reruns this callback against the latest validated disk
@@ -331,14 +334,25 @@ export async function handleConfigCommand(argv: string[]): Promise<number> {
331
334
  if (!yes) throw new CliUsageError("import requires --yes", USAGE);
332
335
  rejectArgs(args, USAGE);
333
336
  await withConfigDirHardeningSettled(getConfigDir(), () => {
334
- readCliConfigForMutation();
335
- const imported = validate(loadInput(path));
337
+ const current = readCliConfigForMutation();
338
+ const rawInput = loadInput(path);
339
+ if (rawInput && typeof rawInput === "object" && !Array.isArray(rawInput) && Object.hasOwn(rawInput, "telemetry")) {
340
+ delete (rawInput as Record<string, unknown>).telemetry;
341
+ console.warn("Note: ignored telemetry block during config import; use `ocx telemetry` to manage telemetry consent.");
342
+ }
343
+ const imported = validate(rawInput);
336
344
  withConfigMutationLockSync(() => {
337
345
  const client = readClientConnectionState();
338
346
  if (client.kind === "connected" && (imported.runtimeRole !== "client"
339
347
  || JSON.stringify(imported.client) !== JSON.stringify(client.value))) {
340
348
  throw new Error("config import refused: disconnect the active client before replacing its connection");
341
349
  }
350
+ const persistedTelemetry = readConfigDiagnostics({ passive: true }).config.telemetry ?? current.telemetry;
351
+ if (persistedTelemetry !== undefined) {
352
+ imported.telemetry = structuredClone(persistedTelemetry);
353
+ } else {
354
+ delete imported.telemetry;
355
+ }
342
356
  saveConfig(imported);
343
357
  });
344
358
  });
@@ -1,7 +1,7 @@
1
1
  import { existsSync, lstatSync, readFileSync } from "node:fs";
2
2
  import { DEFAULT_CATALOG_PATH } from "../codex/paths";
3
3
  import { codexSupportedReasoningEfforts } from "../codex/catalog/effort";
4
- import { resolveCodexRuntime } from "../codex/runtime";
4
+ import { resolveCodexRuntime, type ResolvedCodexRuntime } from "../codex/runtime";
5
5
  import {
6
6
  inspectClientCatalogReadiness,
7
7
  type CatalogCompatibilityDeps,
@@ -61,14 +61,14 @@ export interface ClientCatalogProbeDeps extends CatalogCompatibilityDeps {
61
61
  /** Injected in tests; defaults to reading the materialized client catalog off disk. */
62
62
  readCatalogBody?: () => string | null;
63
63
  /**
64
- * A Codex command the caller already resolved, handed over so readiness skips resolving it
64
+ * The Codex runtime the caller already resolved, handed over so readiness skips resolving it
65
65
  * again. General `ocx status` resolves the full runtime for its diagnostics block; the resolver
66
66
  * memo is keyed by discovery scope and holds one entry, so a priority-only readiness resolve
67
67
  * and the full one miss each other and re-probe the same command with `--version` — up to eight
68
- * seconds apiece. Passing the command across adds no cache state, and it cannot disagree with
68
+ * seconds apiece. Passing the selection across adds no cache state, and it cannot disagree with
69
69
  * what status prints because it is the selection status is printing.
70
70
  */
71
- selectedCodexCommand?: string;
71
+ selectedCodexRuntime?: ResolvedCodexRuntime;
72
72
  }
73
73
 
74
74
  export const CONNECT_USAGE = `Usage:
@@ -139,12 +139,14 @@ function readInstalledCatalogBody(): string | null {
139
139
  * to the catalog probe: readiness does not consume alternative-runtime diagnostics. The resolver
140
140
  * keeps this priority-only cache separate from the full discovery used by `ocx status`.
141
141
  *
142
- * A caller that has already resolved passes its selection in through `selectedCodexCommand` rather
142
+ * A caller that has already resolved passes its selection in through `selectedCodexRuntime` rather
143
143
  * than paying for a second `--version` probe of the command it just resolved.
144
144
  */
145
- function observeLocalCodexEffortLadder(selected?: string): ReadonlySet<string> | null {
146
- const command = selected ?? resolveCodexRuntime({ discoverAlternatives: false }).runtime.command;
147
- return codexSupportedReasoningEfforts({ commandCandidates: () => [command] });
145
+ function observeLocalCodexEffortLadder(selected?: ResolvedCodexRuntime): ReadonlySet<string> | null {
146
+ const runtime = selected ?? resolveCodexRuntime({ discoverAlternatives: false }).runtime;
147
+ // The selection travels with its command so the probe can tell an unresolved sentinel, which may
148
+ // fall back to the ChatGPT.app CLI on macOS (#8360), from a bare command that actually ran.
149
+ return codexSupportedReasoningEfforts({ commandCandidates: () => [runtime.command], selectedRuntime: runtime });
148
150
  }
149
151
 
150
152
  /**
@@ -154,8 +156,8 @@ function observeLocalCodexEffortLadder(selected?: string): ReadonlySet<string> |
154
156
  * would run its own probe, which is how the two checks could disagree about the ladder within
155
157
  * a single `ocx connect`.
156
158
  */
157
- function catalogObserver(deps: ClientCatalogProbeDeps | undefined): CatalogCompatibilityDeps {
158
- const selected = deps?.selectedCodexCommand;
159
+ export function catalogObserver(deps: ClientCatalogProbeDeps | undefined): CatalogCompatibilityDeps {
160
+ const selected = deps?.selectedCodexRuntime;
159
161
  return { supportedEfforts: deps?.supportedEfforts ?? (() => observeLocalCodexEffortLadder(selected)) };
160
162
  }
161
163
 
@@ -913,6 +913,10 @@ const commandRunners: Record<string, CommandRunner> = {
913
913
  const { handleCommandcodeCommand } = await import("./integrations");
914
914
  return await handleCommandcodeCommand(deps.args.slice(1));
915
915
  },
916
+ telemetry: async deps => {
917
+ const { handleTelemetryCommand } = await import("./telemetry");
918
+ return await handleTelemetryCommand(deps.args.slice(1));
919
+ },
916
920
  help: async () => {
917
921
  printUsage();
918
922
  return 0;
package/src/cli/doctor.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  * networking. See devlog/_plan/260630_wsl-account-autoswitch/30_*.
9
9
  */
10
10
  import { cliCommandDoctorChecks, collectCliPathDiagnostics } from "./cli-path-diagnostics";
11
+ import { collectBundledBunDiagnostic, formatBundledBunDiagnosticLines } from "./bundled-bun-diagnostic";
11
12
  import { accessSync, constants, existsSync, readFileSync } from "node:fs";
12
13
  import { homedir } from "node:os";
13
14
  import { dirname, join } from "node:path";
@@ -1607,6 +1608,16 @@ export async function runDoctor(args: string[] = []): Promise<void> {
1607
1608
  }
1608
1609
  }
1609
1610
 
1611
+ // The bundled dependency is the install's own runtime, distinct from whatever Bun is running
1612
+ // doctor or serving the proxy. A skipped postinstall (#8361) is invisible here otherwise.
1613
+ // A source checkout or standalone binary has no bundled `bun` dependency, so the
1614
+ // section has nothing to say there and prints no heading.
1615
+ const bundledBunLines = formatBundledBunDiagnosticLines(collectBundledBunDiagnostic());
1616
+ if (bundledBunLines.length > 0) {
1617
+ console.log("\nBundled Bun runtime");
1618
+ for (const line of bundledBunLines) console.log(line);
1619
+ }
1620
+
1610
1621
  console.log("\nWHAM reachability");
1611
1622
  const probe = await probeWham();
1612
1623
  const detail = probe.status !== null ? `status=${probe.status}` : `error=${probe.classification}`;
package/src/cli/help.ts CHANGED
@@ -102,6 +102,7 @@ Usage:
102
102
  ocx config [sub] Validated configuration show/get/set/import/export
103
103
  ocx advisor <status|on|off|set|consent> Advisor sidecar settings and context-sharing consent
104
104
  ocx companion <show|set|reset> Menu-bar and widget companion usage settings
105
+ ocx telemetry <sub> Anonymous usage telemetry status, preview, enable, and disable
105
106
  ocx lab <sub> Inspect Lab evidence and control local automation
106
107
  ocx codex-provider <sub> Confirm custom Codex provider routing: status|allow|revoke
107
108
  ocx chatgpt <sub> Experimental app-server shim: launch|restore|status (macOS)
package/src/cli/init.ts CHANGED
@@ -9,6 +9,7 @@ import { redactUserPath } from "../lib/redact";
9
9
  import { enrichProviderFromCatalog } from "../oauth/key-providers";
10
10
  import { deriveInitProviders } from "../providers/derive";
11
11
  import { pinSponsorsWithinKind } from "../providers/sponsor-order";
12
+ import { maybeShowTelemetryPrompt } from "./telemetry";
12
13
  import type { OcxConfig, OcxProviderConfig } from "../types";
13
14
 
14
15
  /** Parse a setup TCP port; only an empty answer selects the default. */
@@ -293,4 +294,7 @@ export async function runInit(): Promise<void> {
293
294
  } finally {
294
295
  prompt.close();
295
296
  }
297
+ if (configCreated && !process.exitCode) {
298
+ await maybeShowTelemetryPrompt();
299
+ }
296
300
  }