sneakoscope 8.0.2 → 8.0.3

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 (122) hide show
  1. package/README.md +47 -23
  2. package/config/skills-hash-ledger.v1.json +1 -1
  3. package/crates/sks-core/Cargo.lock +1 -1
  4. package/crates/sks-core/Cargo.toml +1 -1
  5. package/dist/bin/fast-inline.js +55 -13
  6. package/dist/bin/sks-dispatch.js +1 -1
  7. package/dist/cli/command-manifest-lite.js +4 -0
  8. package/dist/cli/command-registry.js +4 -0
  9. package/dist/cli/install-helpers-codex-lb-chain.js +187 -0
  10. package/dist/cli/install-helpers-codex-lb-config.js +74 -8
  11. package/dist/cli/install-helpers.js +89 -44
  12. package/dist/commands/codex-lb.js +117 -19
  13. package/dist/commands/doctor.js +697 -37
  14. package/dist/config/skills-manifest.json +3 -2
  15. package/dist/core/agents/agent-runner-codex-exec.js +5 -3
  16. package/dist/core/codex/codex-config-guard.js +238 -52
  17. package/dist/core/codex-adapter.js +5 -3
  18. package/dist/core/codex-app/menubar/constants.js +10 -1
  19. package/dist/core/codex-app/menubar/global-install.js +288 -0
  20. package/dist/core/codex-app/menubar/installer.js +79 -14
  21. package/dist/core/codex-app/menubar/launch-agent.js +267 -45
  22. package/dist/core/codex-app/menubar/paths.js +3 -0
  23. package/dist/core/codex-app/menubar/rollback.js +55 -7
  24. package/dist/core/codex-app/menubar/status.js +75 -4
  25. package/dist/core/codex-control/codex-0139-image-path-real-probe.js +3 -1
  26. package/dist/core/codex-control/codex-0139-web-search-probe.js +3 -1
  27. package/dist/core/codex-control/codex-app-server-runtime-env.js +13 -4
  28. package/dist/core/codex-control/codex-app-server-v2-client.js +3 -3
  29. package/dist/core/codex-exec-output-schema.js +4 -1
  30. package/dist/core/codex-lb/codex-lb-env.js +63 -72
  31. package/dist/core/codex-lb/codex-lb-setup.js +15 -2
  32. package/dist/core/codex-lb/desktop-center-credentials.js +517 -58
  33. package/dist/core/codex-lb/desktop-controller.js +153 -24
  34. package/dist/core/codex-lb/routing-truth.js +327 -0
  35. package/dist/core/codex-native/core-skill-manifest.js +1 -1
  36. package/dist/core/commands/basic-cli.js +7 -1
  37. package/dist/core/commands/qa-loop-command.js +3 -1
  38. package/dist/core/commands/telegram-command.js +241 -0
  39. package/dist/core/config-adopt/config-adopt-command.js +35 -0
  40. package/dist/core/config-adopt/config-adopt.js +346 -0
  41. package/dist/core/config-adopt/index.js +3 -0
  42. package/dist/core/doctor/command-alias-cleanup.js +4 -1
  43. package/dist/core/doctor/current-project-guidance-nested.js +37 -6
  44. package/dist/core/doctor/current-project-guidance.js +11 -6
  45. package/dist/core/doctor/doctor-readiness-matrix.js +14 -0
  46. package/dist/core/doctor/retired-managed-residue-private.js +1 -1
  47. package/dist/core/doctor/sks-menubar-doctor.js +4 -0
  48. package/dist/core/feature-fixtures.js +8 -0
  49. package/dist/core/hooks-runtime/hook-context.js +9 -0
  50. package/dist/core/hooks-runtime/managed-skill-admission.js +54 -4
  51. package/dist/core/hooks-runtime/official-subagent-lifecycle.js +69 -1
  52. package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +2 -2
  53. package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +3 -3
  54. package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +43 -5
  55. package/dist/core/hooks-runtime/subagent-skill-availability.js +64 -30
  56. package/dist/core/hooks-runtime/subagent-stop-hook.js +15 -2
  57. package/dist/core/hooks-runtime.js +148 -4
  58. package/dist/core/imagegen/imagegen-capability.js +46 -0
  59. package/dist/core/imagegen/require-imagegen.js +2 -2
  60. package/dist/core/init/skills.js +17 -3
  61. package/dist/core/install/installed-package-smoke.js +8 -2
  62. package/dist/core/naruto/hardware-capacity-probe.js +9 -3
  63. package/dist/core/naruto/naruto-concurrency-governor.js +68 -24
  64. package/dist/core/perf/import-graph-budget.js +0 -1
  65. package/dist/core/product-design-app-server.js +13 -1
  66. package/dist/core/release/package-size-budget.js +2 -2
  67. package/dist/core/release/release-pack-receipt.js +1 -2
  68. package/dist/core/routes/dollar-manifest-lite.js +1 -1
  69. package/dist/core/routes.js +1 -1
  70. package/dist/core/security/private-credential-file.js +209 -0
  71. package/dist/core/subagents/agent-catalog.js +17 -32
  72. package/dist/core/subagents/naruto-help-contract.js +5 -5
  73. package/dist/core/subagents/official-subagent-config.js +16 -6
  74. package/dist/core/subagents/official-subagent-preparation.js +34 -15
  75. package/dist/core/subagents/official-subagent-prompt.js +4 -4
  76. package/dist/core/subagents/official-subagent-runner.js +27 -4
  77. package/dist/core/subagents/thread-budget.js +19 -12
  78. package/dist/core/subagents/wave-lifecycle.js +18 -6
  79. package/dist/core/telegram/access.js +54 -0
  80. package/dist/core/telegram/client.js +144 -0
  81. package/dist/core/telegram/confirmation.js +37 -0
  82. package/dist/core/telegram/doctor.js +151 -0
  83. package/dist/core/telegram/index.js +9 -0
  84. package/dist/core/telegram/keychain.js +265 -0
  85. package/dist/core/telegram/liveness.js +109 -0
  86. package/dist/core/telegram/poller.js +90 -0
  87. package/dist/core/telegram/redaction.js +15 -0
  88. package/dist/core/telegram/types.js +1 -0
  89. package/dist/core/update/update-diagnostics.js +52 -0
  90. package/dist/core/update/update-migration-state.js +5 -1
  91. package/dist/core/update/update-operation.js +2 -1
  92. package/dist/core/update/update-stage-diagnostics.js +38 -0
  93. package/dist/core/update/update-status.js +2 -9
  94. package/dist/core/update-check.js +147 -31
  95. package/dist/core/version.js +1 -1
  96. package/dist/core/zellij/zellij-launcher.js +23 -4
  97. package/dist/native/sks-menubar/Sources/AppDelegate.swift +13 -0
  98. package/dist/native/sks-menubar/Sources/AppIdentity.swift +7 -0
  99. package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +3 -2
  100. package/dist/native/sks-menubar/Sources/ProvidersConnectTest.swift +115 -0
  101. package/dist/native/sks-menubar/Sources/ProvidersFastMode.swift +17 -0
  102. package/dist/native/sks-menubar/Sources/ProvidersRoutingTruth.swift +190 -0
  103. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +100 -59
  104. package/dist/native/sks-menubar/Sources/SingletonInstanceGuard.swift +328 -0
  105. package/dist/native/sks-menubar/Sources/TelegramPrivateFileStore.swift +320 -0
  106. package/dist/native/sks-menubar/Sources/TelegramPrivateFileSupport.swift +303 -0
  107. package/dist/native/sks-menubar/Sources/TelegramProcessGateway.swift +238 -0
  108. package/dist/native/sks-menubar/Sources/TelegramRuntimeSupport.swift +56 -0
  109. package/dist/native/sks-menubar/Sources/TelegramSupport.swift +56 -0
  110. package/dist/native/sks-menubar/Sources/TelegramTransport.swift +474 -0
  111. package/dist/native/sks-menubar/Sources/main.swift +15 -1
  112. package/dist/native/sks-menubar/Tests/OperationCoordinatorTests.swift +4 -3
  113. package/dist/native/sks-menubar/Tests/ProvidersViewControllerTests.swift +129 -0
  114. package/dist/native/sks-menubar/Tests/SingletonInstanceGuardTests.swift +183 -0
  115. package/dist/native/sks-menubar/Tests/TelegramRuntimeSmokeTests.swift +267 -0
  116. package/dist/native/sks-menubar/Tests/TelegramRuntimeTests.swift +222 -0
  117. package/dist/scripts/codex-lb-fast-mode-truth-check.js +1 -1
  118. package/dist/scripts/codex-lb-fast-ui-preservation-check.js +1 -1
  119. package/dist/scripts/current-command-surface-check.js +2 -4
  120. package/dist/scripts/official-subagent-workflow-check.js +1 -1
  121. package/dist/scripts/packlist-performance-check.js +1 -2
  122. package/package.json +1 -1
@@ -5,6 +5,7 @@ import { projectRoot, readStdin, readText } from '../core/fsx.js';
5
5
  import { flag, readOption } from '../cli/args.js';
6
6
  import { printJson } from '../cli/output.js';
7
7
  import { printCodexLbSetupWarnings } from '../cli/codex-lb-setup-warning-output.js';
8
+ import { testCodexLbConnection } from '../cli/install-helpers-codex-lb-chain.js';
8
9
  import { codexLbMetrics, readCodexLbCircuit, recordCodexLbHealthEvent, resetCodexLbCircuit, codexLbProofEvidence } from '../core/codex-lb-circuit.js';
9
10
  import { checkCodexLbResponseChain, codexLbStatus, configureCodexLb, repairCodexLbAuth } from '../cli/install-helpers.js';
10
11
  import { buildCodexLbSetupPlan, renderCodexLbSetupPlan } from '../core/codex-lb/codex-lb-setup.js';
@@ -13,6 +14,7 @@ import { loadCodexLbEnv } from '../core/codex-lb/codex-lb-env.js';
13
14
  import { activateCodexLbDesktopMode, buildCodexLbDesktopCapabilities, codexLbDesktopStatusV2, configureCodexLbCliMode, disableCodexLbDesktopRouting, migrateLegacyCodexLbDesktopMode, readCodexLbDesktopDeepEvidence, readCodexLbDesktopDeepEvidenceTrustAnchors, rollbackCodexLbDesktopMode } from '../core/codex-lb/desktop-controller.js';
14
15
  import { serveDesktopBridge } from '../core/codex-lb/desktop-service.js';
15
16
  import { parseCodexLbGatewayAuthTransport } from '../core/codex-lb/desktop-mode.js';
17
+ import { codexLbRoutingTruthIsActive, measureAndWriteCodexLbRoutingTruth } from '../core/codex-lb/routing-truth.js';
16
18
  export async function run(command, args = []) {
17
19
  const root = await projectRoot();
18
20
  const action = args[0] || 'status';
@@ -26,7 +28,12 @@ export async function run(command, args = []) {
26
28
  return;
27
29
  }
28
30
  if (action === 'status' || action === 'check') {
29
- const result = await codexLbDesktopStatusV2(controllerOptions(args));
31
+ const options = controllerOptions(args);
32
+ options.networkProbes = action === 'check'
33
+ || flag(args, '--deep')
34
+ || flag(args, '--fix')
35
+ || flag(args, '--remeasure');
36
+ const result = await codexLbDesktopStatusV2(options);
30
37
  if (result.ok !== true)
31
38
  process.exitCode = 1;
32
39
  if (flag(args, '--json'))
@@ -45,6 +52,29 @@ export async function run(command, args = []) {
45
52
  process.exitCode = 1;
46
53
  return;
47
54
  }
55
+ if (action === 'connect-test') {
56
+ const status = await codexLbStatus();
57
+ const modelSelection = await resolveCodexLbHealthModel(status);
58
+ const loadedEnv = await loadCodexLbEnv({
59
+ home: path.dirname(path.dirname(status.env_path)),
60
+ envPath: status.env_path
61
+ });
62
+ const result = await testCodexLbConnection(status, {
63
+ requireSelected: true,
64
+ model: modelSelection.model,
65
+ baseUrl: loadedEnv.base_url,
66
+ apiKey: loadedEnv.secret_api_key,
67
+ credentialBindingBlockers: loadedEnv.credential_binding.blockers
68
+ });
69
+ if (!result.ok)
70
+ process.exitCode = 1;
71
+ if (flag(args, '--json'))
72
+ return printJson(result);
73
+ console.log(result.ok
74
+ ? `codex-lb connect test: ok (${result.model}, ${result.latency_ms}ms): ${result.result || ''}`
75
+ : `codex-lb connect test: failed (${result.status})`);
76
+ return;
77
+ }
48
78
  if (action === 'health' || action === 'verify-chain' || action === 'chain') {
49
79
  const allowUnverifiedToolOutputRecovery = codexLbToolOutputRecoveryOverrideAcknowledged({ args });
50
80
  const status = await codexLbStatus({ probeToolOutputRecovery: true, allowUnverifiedToolOutputRecovery });
@@ -73,7 +103,20 @@ export async function run(command, args = []) {
73
103
  apiKey: loadedEnv.secret_api_key
74
104
  })
75
105
  : { ok: false, status: blocker, codex_lb: status };
76
- const result = { ...chain, codex_lb: status, model_selection: modelSelection };
106
+ const routingTruth = await measureAndWriteCodexLbRoutingTruth({
107
+ selected: status.selected === true,
108
+ baseUrl: loadedEnv.base_url,
109
+ apiKey: loadedEnv.secret_api_key
110
+ }, {
111
+ home: path.dirname(path.dirname(status.env_path))
112
+ });
113
+ const result = {
114
+ ...chain,
115
+ ok: chain.ok === true && routingTruth.ok,
116
+ codex_lb: status,
117
+ model_selection: modelSelection,
118
+ routing_truth: routingTruth
119
+ };
77
120
  if (!result.ok)
78
121
  process.exitCode = 1;
79
122
  if (flag(args, '--json'))
@@ -98,9 +141,16 @@ export async function run(command, args = []) {
98
141
  const evidence = await fastEvidenceFromChain(chain, readOption(args, '--request-log', readOption(args, '--request-log-json', null)));
99
142
  const providerReady = status.provider_contract_ok === true;
100
143
  const chainVerified = isCodexLbFastChainVerified(chain);
144
+ const routingTruth = await measureAndWriteCodexLbRoutingTruth({
145
+ selected: status.selected === true,
146
+ baseUrl: loadedEnv.base_url,
147
+ apiKey: loadedEnv.secret_api_key
148
+ }, {
149
+ home: path.dirname(path.dirname(status.env_path))
150
+ });
101
151
  const result = {
102
152
  schema: 'sks.codex-lb-fast-check.v1',
103
- ok: Boolean(providerReady && chainVerified && evidence.fast_requested && evidence.fast_actual),
153
+ ok: Boolean(providerReady && chainVerified && routingTruth.ok && evidence.fast_requested && evidence.fast_actual),
104
154
  status: !providerReady
105
155
  ? 'provider_contract_drift'
106
156
  : chain.skipped === true
@@ -115,11 +165,13 @@ export async function run(command, args = []) {
115
165
  codex_lb: status,
116
166
  model_selection: modelSelection,
117
167
  chain,
168
+ routing_truth: routingTruth,
118
169
  evidence,
119
170
  degraded_models: Array.isArray(chain.degraded_models) ? chain.degraded_models : [],
120
171
  quota_low: Boolean(chain.quota_low),
121
172
  blockers: [
122
173
  ...(providerReady ? [] : ['codex_lb_provider_contract_drift']),
174
+ ...routingTruth.blockers,
123
175
  ...modelSelection.blockers,
124
176
  ...(chain.skipped === true
125
177
  ? ['codex_lb_fast_check_chain_skipped']
@@ -181,6 +233,7 @@ export async function run(command, args = []) {
181
233
  writeEnvFile: true,
182
234
  syncLaunchctl: true,
183
235
  desktopMode: 'cli-provider',
236
+ useDefaultProvider: current.mode === 'cli-provider' && current.routing_active === true,
184
237
  allowUnverifiedToolOutputRecovery: codexLbToolOutputRecoveryOverrideAcknowledged({ args })
185
238
  });
186
239
  let routing = null;
@@ -201,8 +254,8 @@ export async function run(command, args = []) {
201
254
  action: 'set-key',
202
255
  provider_ready: result.ok === true,
203
256
  routing_active: Boolean(result.ok
204
- && current.mode === 'desktop-native-bridge'
205
- && routing?.ok !== false),
257
+ && ((current.mode === 'desktop-native-bridge' && routing?.ok !== false)
258
+ || (current.mode === 'cli-provider' && result.codex_lb?.selected === true))),
206
259
  activation_required: Boolean(result.ok
207
260
  && current.mode !== 'desktop-native-bridge'
208
261
  && current.mode !== 'desktop-dual-auth-compat'),
@@ -247,7 +300,7 @@ export async function run(command, args = []) {
247
300
  if (flag(args, '--json'))
248
301
  return printJson(result);
249
302
  console.log(result.ok === true
250
- ? `codex-lb CLI provider ready. Run: ${String(result.command)}`
303
+ ? `codex-lb CLI provider active (${String(result.routing_truth?.actual_host || 'verified route')}).`
251
304
  : `codex-lb CLI provider setup failed: ${String(result.status || 'failed')}`);
252
305
  return;
253
306
  }
@@ -468,6 +521,7 @@ export async function run(command, args = []) {
468
521
  host: options.host,
469
522
  apiKey: options.apiKey,
470
523
  desktopMode: 'cli-provider',
524
+ useDefaultProvider: options.useDefaultProvider,
471
525
  gatewayAuthTransport: options.gatewayAuthTransport,
472
526
  keychain: options.keychain,
473
527
  storeKeychain: options.keychain,
@@ -502,6 +556,17 @@ export async function run(command, args = []) {
502
556
  })
503
557
  : null;
504
558
  const capabilityDiagnosticOk = codexLbSetupCapabilityDiagnosticOk(capabilities);
559
+ const setupRoutingTruth = result.ok && options.desktopMode === 'cli-provider'
560
+ ? await measureAndWriteCodexLbRoutingTruth({
561
+ selected: result.codex_lb?.selected === true,
562
+ baseUrl: result.base_url || null,
563
+ apiKey: options.apiKey,
564
+ authTransport: 'authorization-bearer'
565
+ }, {
566
+ home: path.dirname(path.dirname(result.env_path))
567
+ })
568
+ : desktopActivation?.post_activation_status?.routing_truth || null;
569
+ const cliRoutingActive = codexLbRoutingTruthIsActive(setupRoutingTruth);
505
570
  const shaped = {
506
571
  ...result,
507
572
  schema: 'sks.codex-lb-setup.v2',
@@ -516,9 +581,11 @@ export async function run(command, args = []) {
516
581
  desktop_auth_mutated: false,
517
582
  fast_mode_mutated: false,
518
583
  provider_ready: result.ok === true,
519
- routing_active: Boolean(result.ok && desktopActivation?.ok === true),
584
+ routing_active: Boolean(result.ok && (desktopActivation?.ok === true || cliRoutingActive)),
585
+ routing_truth: setupRoutingTruth,
520
586
  activation_required: Boolean(result.ok
521
587
  && options.desktopMode === 'cli-provider'
588
+ && !cliRoutingActive
522
589
  && desktopActivation === null),
523
590
  desktop_activation: desktopActivation,
524
591
  capabilities
@@ -617,12 +684,12 @@ export async function run(command, args = []) {
617
684
  console.log(`codex-lb proof evidence: ${result.status}`);
618
685
  return;
619
686
  }
620
- console.error('Usage: sks codex-lb status|setup|set-key|use-desktop-full|use-cli|disable|capabilities [--level shallow|transport|deep] [--evidence <file> --trust-anchors <file>]|migrate-legacy-desktop|rollback <receipt-id>|health|metrics|doctor|repair|circuit reset|circuit record-fixture|proof-evidence [--json]');
687
+ console.error('Usage: sks codex-lb status|setup|set-key|connect-test|use-desktop-full|use-cli|disable|capabilities [--level shallow|transport|deep] [--evidence <file> --trust-anchors <file>]|migrate-legacy-desktop|rollback <receipt-id>|health|metrics|doctor|repair|circuit reset|circuit record-fixture|proof-evidence [--json]');
621
688
  console.error(` ${CODEX_LB_TOOL_OUTPUT_RECOVERY_OVERRIDE_FLAG} explicitly acknowledge an old/unverified proxy for this command (unsafe)`);
622
689
  console.error(' set-key swap the codex-lb API key (reuses the stored host): sks codex-lb set-key --api-key-stdin');
623
690
  console.error(' --keychain fail-closed until a dedicated signed SKS Keychain helper is available; the default 0600 env file is used');
624
691
  console.error(' use-desktop-full keep ChatGPT OAuth/built-in OpenAI and route data through the local bridge');
625
- console.error(' use-cli configure an unselected CLI-only provider');
692
+ console.error(' use-cli verify, write, and atomically select the CLI codex-lb provider');
626
693
  console.error(' disable remove only SKS-managed Desktop routing; auth.json is untouched');
627
694
  process.exitCode = 1;
628
695
  }
@@ -668,25 +735,35 @@ async function resolveCodexLbModel(status = {}, env = process.env, opts = {}) {
668
735
  const configured = topLevelTomlString(config, 'model');
669
736
  if (configured)
670
737
  return { model: configured, source: 'global_config', blockers: [] };
738
+ const home = String(env.HOME || '').trim();
671
739
  const configuredCatalogPath = topLevelTomlString(config, 'model_catalog_json');
672
- if (!configuredCatalogPath)
740
+ const defaultCatalogPath = configPath
741
+ ? path.join(path.dirname(configPath), 'models_cache.json')
742
+ : home
743
+ ? path.join(home, '.codex', 'models_cache.json')
744
+ : '';
745
+ const requestedCatalogPath = configuredCatalogPath || defaultCatalogPath;
746
+ if (!requestedCatalogPath)
673
747
  return { model: null, source: null, blockers: [`${opts.blockerPrefix}_model_unselected`] };
674
- const home = String(env.HOME || '').trim();
675
- const expandedCatalogPath = configuredCatalogPath.startsWith('~/') && home
676
- ? path.join(home, configuredCatalogPath.slice(2))
677
- : configuredCatalogPath;
748
+ const expandedCatalogPath = requestedCatalogPath.startsWith('~/') && home
749
+ ? path.join(home, requestedCatalogPath.slice(2))
750
+ : requestedCatalogPath;
678
751
  const catalogPath = path.isAbsolute(expandedCatalogPath)
679
752
  ? expandedCatalogPath
680
753
  : path.resolve(path.dirname(configPath), expandedCatalogPath);
681
754
  try {
682
- const payload = JSON.parse(await readText(catalogPath, ''));
755
+ const catalogText = await readText(catalogPath, '');
756
+ if (!catalogText.trim()) {
757
+ return { model: null, source: null, blockers: [`${opts.blockerPrefix}_model_unselected`] };
758
+ }
759
+ const payload = JSON.parse(catalogText);
683
760
  const model = selectCatalogModel(payload, opts.requirePriority === true);
684
761
  return model
685
- ? { model, source: 'model_catalog_json', blockers: [] }
686
- : { model: null, source: 'model_catalog_json', blockers: [`${opts.blockerPrefix}_${opts.requirePriority === true ? 'priority_' : ''}model_unavailable`] };
762
+ ? { model, source: configuredCatalogPath ? 'model_catalog_json' : 'codex_models_cache', blockers: [] }
763
+ : { model: null, source: configuredCatalogPath ? 'model_catalog_json' : 'codex_models_cache', blockers: [`${opts.blockerPrefix}_${opts.requirePriority === true ? 'priority_' : ''}model_unavailable`] };
687
764
  }
688
765
  catch {
689
- return { model: null, source: 'model_catalog_json', blockers: [`${opts.blockerPrefix}_catalog_invalid`] };
766
+ return { model: null, source: configuredCatalogPath ? 'model_catalog_json' : 'codex_models_cache', blockers: [`${opts.blockerPrefix}_catalog_invalid`] };
690
767
  }
691
768
  }
692
769
  function topLevelTomlString(text, key) {
@@ -821,6 +898,7 @@ export function controllerOptions(args = []) {
821
898
  const envPath = readOption(args, '--env-file', readOption(args, '--env-path', null));
822
899
  const metadataPath = readOption(args, '--metadata', readOption(args, '--metadata-path', null));
823
900
  const receiptDir = readOption(args, '--receipt-dir', null);
901
+ const routingTruthReceiptPath = readOption(args, '--routing-truth-receipt', null);
824
902
  const listenHost = readOption(args, '--listen-host', null);
825
903
  const normalizedListenHost = listenHost === null
826
904
  ? null
@@ -841,6 +919,7 @@ export function controllerOptions(args = []) {
841
919
  ...(envPath ? { envPath: String(envPath) } : {}),
842
920
  ...(metadataPath ? { metadataPath: String(metadataPath) } : {}),
843
921
  ...(receiptDir ? { receiptDir: String(receiptDir) } : {}),
922
+ ...(routingTruthReceiptPath ? { routingTruthReceiptPath: String(routingTruthReceiptPath) } : {}),
844
923
  ...(capabilityTimeoutMs !== null && Number.isFinite(capabilityTimeoutMs) && capabilityTimeoutMs > 0
845
924
  ? { capabilityTimeoutMs }
846
925
  : {}),
@@ -855,11 +934,19 @@ export function controllerOptions(args = []) {
855
934
  : {})
856
935
  };
857
936
  }
858
- function formatCodexLbDesktopStatusText(status) {
937
+ export function formatCodexLbDesktopStatusText(status, opts = {}) {
859
938
  const oauth = asRecord(status.oauth);
860
939
  const provider = asRecord(status.provider);
861
940
  const bridge = asRecord(status.bridge);
862
941
  const capabilities = asRecord(status.capabilities);
942
+ const resolution = asRecord(status.secret_resolution);
943
+ const resolutionSource = String(resolution.source || 'missing');
944
+ const resolutionPath = resolution.path
945
+ ? displayHomePath(String(resolution.path), opts.home || process.env.HOME || '')
946
+ : '';
947
+ const resolutionLabel = resolutionPath
948
+ ? `${resolutionSource} (${resolutionPath})`
949
+ : resolutionSource;
863
950
  const blockers = stringArray(status.blockers);
864
951
  const guidance = stringArray(status.guidance);
865
952
  const lines = [
@@ -873,6 +960,7 @@ function formatCodexLbDesktopStatusText(status) {
873
960
  `Provider: ${String(provider.contract || 'missing')} (${provider.contract_ok === true ? 'ok' : 'blocked'})`,
874
961
  `Bridge: ${String(bridge.status || 'unknown')}${bridge.running === true ? ' (running)' : ''}`,
875
962
  `Gateway auth: ${String(status.gateway_auth_transport || 'inactive')}`,
963
+ `Key source: ${resolutionLabel} · keychain: not used · prompt risk: ${String(resolution.prompt_risk || 'none')}`,
876
964
  `Capabilities: ${String(status.overall || capabilities.state || 'unverified')}`,
877
965
  `Full capability: ${status.full_capability_verified === true ? 'verified' : 'unverified'}`
878
966
  ];
@@ -888,6 +976,13 @@ function formatCodexLbDesktopStatusText(status) {
888
976
  }
889
977
  return `${lines.join('\n')}\n`;
890
978
  }
979
+ function displayHomePath(file, home) {
980
+ const resolvedFile = path.resolve(file);
981
+ const resolvedHome = home ? path.resolve(home) : '';
982
+ return resolvedHome && (resolvedFile === resolvedHome || resolvedFile.startsWith(`${resolvedHome}${path.sep}`))
983
+ ? `~${resolvedFile.slice(resolvedHome.length)}`
984
+ : resolvedFile;
985
+ }
891
986
  function printDeprecationWarning(oldAction, replacement) {
892
987
  console.error(`warning: \`sks codex-lb ${oldAction}\` is deprecated; use \`${replacement}\`.`);
893
988
  }
@@ -1005,6 +1100,7 @@ async function codexLbSetupOptions(args = []) {
1005
1100
  syncLaunchctl = true;
1006
1101
  const shellProfile = normalizeShellProfile(readOption(args, '--shell-profile', 'skip'));
1007
1102
  const allowInsecureLocalhost = flag(args, '--allow-insecure-localhost') || flag(args, '--allow-insecure-http');
1103
+ const useDefaultProvider = !flag(args, '--no-default-provider');
1008
1104
  const interactive = (!host || !apiKey || canAskInteractive(args)) && canAskInteractive(args);
1009
1105
  if ((!host || !apiKey) && canAskInteractive(args)) {
1010
1106
  console.log('SKS codex-lb setup\n');
@@ -1039,6 +1135,7 @@ async function codexLbSetupOptions(args = []) {
1039
1135
  shellProfile: interactiveShellProfile,
1040
1136
  allowInsecureLocalhost,
1041
1137
  apiKeySource,
1138
+ useDefaultProvider,
1042
1139
  interactive: true,
1043
1140
  yes: flag(args, '--yes')
1044
1141
  };
@@ -1055,6 +1152,7 @@ async function codexLbSetupOptions(args = []) {
1055
1152
  shellProfile,
1056
1153
  allowInsecureLocalhost,
1057
1154
  apiKeySource,
1155
+ useDefaultProvider,
1058
1156
  interactive,
1059
1157
  yes: flag(args, '--yes')
1060
1158
  };