@bitkyc08/opencodex 2.97.0 → 2.98.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 +1 -1
- package/gui/dist/assets/App-6TFtZsUF.css +1 -0
- package/gui/dist/assets/App-FQ0OtiMJ.js +59 -0
- package/gui/dist/assets/Tray-D2d5wqLq.js +1 -0
- package/gui/dist/assets/WantedSansVariable.split.0-Dwvb1WRx.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.1-1wKD2RxI.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.10-CAKA6LIP.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.11-k5H85R4b.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.12-BHboLsUv.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.13-9GV377ix.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.14-DovDXnrj.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.15-DTdykCig.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.16-CKz2ccgK.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.17-Z2RD_KRZ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.18-BcKtfonJ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.19-DEQPOSZn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.2-DryboyuA.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.20-Bia5JMls.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.21-Cr4jFw-E.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.22-DjjB69TZ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.23-CvUzJskt.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.24-i_eMg5ox.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.25-2aKHwPX-.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.26-B6wXoCEL.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.27-D4h1WfGM.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.28-kvRPCStd.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.29-DHAiwleD.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.3-7H--eyZi.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.30-C66cfAY2.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.31-FDmtiNim.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.32-DouHt2Dd.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.33-B8HVvkJX.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.34-BtkRu1FN.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.35-DBylQbtk.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.36-Sg089Kgh.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.37-CYtvbriS.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.38-DKkSLf8Z.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.39-CecotKZD.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.4-Bv8O3ZMb.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.40-DdCvkmOU.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.41-ESn674Hc.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.42-DL9V7NNV.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.43-yipO0cyk.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.44-6rTmLZhm.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.45-BJAj8lrm.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.46-BDTzMn2c.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.47-Bxd4wGgi.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.48-DxnFBLnH.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.49-DnVD0aOD.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.5-B1wI2pp5.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.50-D9JlkZd6.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.51-D9Vw6Bu3.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.52-ClEJk4kn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.53-BSXU0vh-.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.54-EcuxkR9v.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.55-CYiFhQX8.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.56--Gk9g8BK.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.57-DnkOPZcy.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.58-9MB8504z.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.59-ByxIsN72.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.6-Bmk0dRVw.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.60-Bxwx_aWQ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.61-DA2z5sm7.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.62-C5iJPJZn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.63-DAqrmaEc.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.64-BgXFsljb.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.65-DKiWujvu.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.66-8po4vUZ4.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.67-Cy5qyI9O.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.68-BKny7Fy3.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.69-B4VU4u_b.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.7-BuqwNpgA.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.70-BCd4n346.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.71-CkQppaWn.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.72-Db7vaoFs.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.73-DI80TYWl.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.74-tMCtDAHB.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.75-Ciw0D5WG.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.76-DoLjFgp-.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.77-CpT2uvMy.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.78-CkcJ4iZ1.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.79-DsOUJjEM.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.8-DsjypPd6.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.80-C0VwHTte.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.81-DTelu57i.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.82-BiMndGN1.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.83-CVcC6eDG.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.84-DlhZVt_O.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.85-S8I2D3pA.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.86-DozXXpH5.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.87-Dsn0Vuuo.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.88-iNwxxDCr.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.89-B63u_9CZ.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.9-Bi3IzpMI.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.90-ByeH1Pqf.woff2 +0 -0
- package/gui/dist/assets/WantedSansVariable.split.91-UQLlagpm.woff2 +0 -0
- package/gui/dist/assets/brand-mark-A03mw_9y.js +1 -0
- package/gui/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/gui/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/gui/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/gui/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/gui/dist/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/gui/dist/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/gui/dist/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/gui/dist/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/gui/dist/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/gui/dist/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/gui/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/gui/dist/assets/index-5REODpG3.css +2 -0
- package/gui/dist/assets/index-BjTIN4to.js +94 -0
- package/gui/dist/assets/segment-thumb-features-Bf6vpwf8.js +1 -0
- package/gui/dist/classic/assets/App-C9Eg3nUo.js +58 -0
- package/gui/dist/{assets/Tray-CEw0y0jR.js → classic/assets/Tray-B8P8cokE.js} +1 -1
- package/gui/dist/classic/assets/index-DFAFnven.js +94 -0
- package/gui/dist/classic/assets/quota-summary-C-4HP4_5.js +1 -0
- package/gui/dist/classic/index.html +47 -0
- package/gui/dist/favicon.png +0 -0
- package/gui/dist/favicon.svg +14 -0
- package/gui/dist/index.html +15 -2
- package/package.json +1 -1
- package/src/adapters/anthropic.ts +17 -8
- package/src/adapters/google.ts +7 -7
- package/src/adapters/kiro/adapter.ts +18 -3
- package/src/adapters/kiro/conversation.ts +8 -8
- package/src/adapters/kiro/payload.ts +45 -12
- package/src/adapters/kiro/stream.ts +169 -12
- package/src/adapters/kiro/structured-output-json.ts +191 -0
- package/src/adapters/kiro/structured-output-schema.ts +542 -0
- package/src/adapters/kiro/structured-output.ts +367 -0
- package/src/adapters/kiro-constants.ts +9 -0
- package/src/adapters/kiro-tools.ts +14 -9
- package/src/adapters/kiro-wire.ts +9 -5
- package/src/adapters/openai-chat/messages.ts +58 -5
- package/src/adapters/openai-chat/mistral-image-limit.ts +50 -0
- package/src/adapters/openai-chat/passthrough.ts +5 -3
- package/src/adapters/openai-chat/tool-schema.ts +83 -13
- package/src/adapters/openai-responses/opengateway-input.ts +18 -6
- package/src/adapters/openai-responses/tool-output-recovery.ts +79 -0
- package/src/adapters/qoder/live-models.ts +115 -1
- package/src/claude/failure-verdict.ts +21 -0
- package/src/claude/inbound-content-options.ts +15 -2
- package/src/claude/inbound-model-options.ts +2 -1
- package/src/claude/inbound-records.ts +2 -0
- package/src/claude/inbound.ts +17 -11
- package/src/claude/outbound.ts +52 -23
- package/src/cli/capabilities-access-remote.ts +13 -0
- package/src/cli/capabilities-base.ts +1 -0
- package/src/cli/capabilities-provider-models.ts +3 -3
- package/src/cli/codex-shim-autorestore.ts +7 -0
- package/src/cli/config-command.ts +11 -2
- package/src/cli/connect.ts +17 -2
- package/src/cli/dispatch.ts +3 -1
- package/src/cli/doctor.ts +95 -7
- package/src/cli/index.ts +12 -7
- package/src/cli/link-apply-restart.ts +9 -2
- package/src/cli/models.ts +124 -38
- package/src/cli/registry.ts +1 -1
- package/src/cli/restart-failure.ts +17 -0
- package/src/cli/stop-approval.ts +2 -2
- package/src/cli/sync-command.ts +1 -1
- package/src/cli/sync-fanout.ts +15 -4
- package/src/cli/system-restart-client.ts +5 -0
- package/src/cli/uninstall-client-state.ts +12 -1
- package/src/cli/update-restart-child.ts +13 -3
- package/src/cli/update-restart-home.ts +6 -3
- package/src/cli/update-restart.ts +36 -19
- package/src/client/connect.ts +4 -1
- package/src/client/hub-client.ts +5 -0
- package/src/client/link-management-relay.ts +39 -2
- package/src/client/link-readiness.ts +3 -1
- package/src/client/machine-api.ts +2 -1
- package/src/client/machine-listener.ts +7 -0
- package/src/client/orphan-token-recovery.ts +322 -0
- package/src/codex/catalog/provider-models.ts +12 -4
- package/src/codex/native-profile-api.ts +27 -1
- package/src/codex/shim-diagnostics.ts +7 -0
- package/src/codex/shim-legacy-record.ts +290 -0
- package/src/codex/shim-windows-refresh.ts +9 -2
- package/src/codex/shim-wrapper-write.ts +7 -0
- package/src/codex/shim.ts +80 -21
- package/src/config/diagnostics.ts +9 -9
- package/src/config/load-degrade.ts +27 -27
- package/src/config/provider-validation.ts +9 -2
- package/src/config/removed-opencode-free-backup.ts +6 -3
- package/src/config/tracked-runtime-inspection.ts +3 -3
- package/src/generated/compatibility-version.json +219 -147
- package/src/images/loop.ts +2 -2
- package/src/lib/client-error-body.ts +37 -6
- package/src/lib/config-ownership-removal.ts +422 -0
- package/src/lib/config-ownership.ts +646 -81
- package/src/lib/context-overflow-verdict.ts +3 -3
- package/src/lib/crash-guard.ts +4 -2
- package/src/lib/desktop-cli-handoff.d.mts +3 -4
- package/src/lib/desktop-cli-handoff.mjs +7 -16
- package/src/lib/errors.ts +1 -0
- package/src/lib/local-management-capability.ts +3 -1
- package/src/lib/messages-error-body.ts +162 -0
- package/src/lib/messages-sse-error-presentation.ts +93 -0
- package/src/lib/passive-read.ts +9 -4
- package/src/lib/socks5-fetch.ts +21 -9
- package/src/lib/upstream-retry.ts +81 -1
- package/src/lib/windows-owner-acl.ts +9 -3
- package/src/lib/winsw.ts +5 -5
- package/src/lib/workflow-budget.ts +3 -1
- package/src/oauth/index.ts +7 -0
- package/src/oauth/store.ts +20 -10
- package/src/protocols/codecs/messages-ir.ts +15 -9
- package/src/protocols/encoders/adapter-events.ts +26 -7
- package/src/protocols/encoders/messages.ts +72 -28
- package/src/providers/antigravity-models.ts +45 -12
- package/src/providers/free-directory.ts +2 -2
- package/src/providers/reasoning-metadata.ts +2 -1
- package/src/providers/registry/entries-extended.ts +9 -0
- package/src/reasoning-effort.ts +7 -2
- package/src/remote/hub-usage.ts +3 -0
- package/src/server/admission-model-scope.ts +1 -1
- package/src/server/admitted-http-turn.ts +2 -1
- package/src/server/anthropic-rate-limit-headers.ts +75 -3
- package/src/server/claude-messages.ts +130 -67
- package/src/server/gui-static.ts +4 -1
- package/src/server/hub-usage.ts +7 -2
- package/src/server/index/link-management.ts +8 -0
- package/src/server/index/ollama-routes.ts +2 -0
- package/src/server/index/serve-options.ts +23 -20
- package/src/server/index/startup-warnings.ts +5 -12
- package/src/server/index/websocket-handler.ts +1 -0
- package/src/server/inference/client-encoder-delivery.ts +5 -1
- package/src/server/management/logs-usage-routes.ts +89 -4
- package/src/server/management/provider-routes.ts +2 -22
- package/src/server/management/qoder-provider-probe.ts +105 -0
- package/src/server/management/route-registry.ts +3 -0
- package/src/server/management/usage-aggregate-cache.ts +15 -5
- package/src/server/management/usage-source-facets.ts +38 -0
- package/src/server/messages-native-tool-guard.ts +11 -3
- package/src/server/messages-native.ts +111 -40
- package/src/server/messages-response-headers.ts +25 -11
- package/src/server/messages-shared.ts +94 -64
- package/src/server/messages-sse-error-filter.ts +199 -0
- package/src/server/request-log.ts +12 -0
- package/src/server/responses/adapter-continuation.ts +11 -5
- package/src/server/responses/adapter-delivery.ts +14 -8
- package/src/server/responses/adapter-dispatch.ts +8 -8
- package/src/server/responses/anthropic-thinking-recovery.ts +2 -2
- package/src/server/responses/codex-auth-error.ts +8 -4
- package/src/server/responses/codex-ws-wire.ts +19 -3
- package/src/server/responses/compact.ts +4 -1
- package/src/server/responses/core-auth.ts +1 -1
- package/src/server/responses/core-combo-failure.ts +2 -0
- package/src/server/responses/core-combo.ts +2 -0
- package/src/server/responses/core-errors.ts +5 -4
- package/src/server/responses/core-options.ts +2 -0
- package/src/server/responses/empty-completion-guard.ts +4 -1
- package/src/server/responses/pacing-overload.ts +1 -1
- package/src/server/responses/passthrough-dispatch.ts +5 -5
- package/src/server/responses/request-prepare.ts +3 -1
- package/src/server/responses/request-transport.ts +9 -8
- package/src/server/responses/response-effects.ts +3 -2
- package/src/server/responses/terminal-guard.ts +30 -0
- package/src/server/restart-replacement.ts +3 -1
- package/src/server/sse-payload-rewrite.ts +23 -11
- package/src/server/workflow-refusal.ts +1 -1
- package/src/server/ws-bridge.ts +4 -0
- package/src/service/definition.ts +36 -4
- package/src/service/launchd.ts +89 -32
- package/src/service/logging.ts +34 -7
- package/src/service/plist-xml.ts +59 -0
- package/src/service/state.ts +8 -0
- package/src/service/systemd-env.ts +2 -0
- package/src/service/systemd.ts +31 -7
- package/src/service/windows-taskxml.ts +16 -7
- package/src/service-manager-probe.ts +4 -10
- package/src/types/provider.ts +2 -0
- package/src/types/request.ts +13 -1
- package/src/update/config-preflight.ts +48 -0
- package/src/update/index.ts +15 -1
- package/src/usage/client.ts +43 -0
- package/src/usage/error-detail.ts +1 -1
- package/src/usage/log.ts +4 -0
- package/src/usage/source-facets.ts +51 -0
- package/src/usage/source-filter.ts +65 -0
- package/src/usage/summary.ts +50 -8
- package/src/web-search/anthropic-executor.ts +105 -24
- package/src/web-search/executor.ts +5 -3
- package/src/web-search/loop.ts +2 -1
- package/src/web-search/progress-stream.ts +64 -5
- package/gui/dist/assets/App-DuNhggE1.js +0 -58
- package/gui/dist/assets/index-CynE_Rue.js +0 -94
- package/gui/dist/assets/quota-summary-VHFSlUuM.js +0 -1
- /package/gui/dist/{assets → classic/assets}/App-B4j-Txmb.css +0 -0
- /package/gui/dist/{assets → classic/assets}/index-CHWwDo9L.css +0 -0
|
@@ -783,24 +783,24 @@ export function validateConfigCandidate(value: unknown): { ok: true; config: Ocx
|
|
|
783
783
|
return { ok: false, error: schemaDiagnosticsError(result.error) };
|
|
784
784
|
}
|
|
785
785
|
|
|
786
|
-
export function configDiagnosticsFromRaw(raw: string): ConfigDiagnostics {
|
|
787
|
-
return configDiagnosticsFromText(raw);
|
|
786
|
+
export function configDiagnosticsFromRaw(raw: string, options: { warn?: (message: string) => void } = {}): ConfigDiagnostics {
|
|
787
|
+
return configDiagnosticsFromText(raw, undefined, options.warn);
|
|
788
788
|
}
|
|
789
789
|
|
|
790
|
-
function configDiagnosticsFromText(raw: string, file?: { path: string; bytes: Uint8Array }): ConfigDiagnostics {
|
|
790
|
+
function configDiagnosticsFromText(raw: string, file?: { path: string; bytes: Uint8Array }, warn?: (message: string) => void): ConfigDiagnostics {
|
|
791
791
|
try {
|
|
792
792
|
const parsed = JSON.parse(raw.replace(/^\uFEFF/, ""));
|
|
793
793
|
projectRemovedOpenCodeFreeSnapshot(parsed, file);
|
|
794
794
|
sanitizeOpenCodeOverridesForLoad(parsed);
|
|
795
|
-
sanitizeReasoningPinsForLoad(parsed);
|
|
795
|
+
sanitizeReasoningPinsForLoad(parsed, warn);
|
|
796
796
|
// Same degradation as loadConfig: a hand-edited invalid retryOn429 must not trip the
|
|
797
797
|
// schema and send the caller a default-config fallback (the config command could then
|
|
798
798
|
// persist that fallback over the user's providers/keys).
|
|
799
|
-
sanitizeModelDisplayNamesForLoad(parsed);
|
|
800
|
-
sanitizeAutoReviewForLoad(parsed);
|
|
801
|
-
sanitizeRetryOn429ForLoad(parsed);
|
|
802
|
-
sanitizeModelCostsForLoad(parsed);
|
|
803
|
-
sanitizeCapabilityDeclarationsForLoad(parsed);
|
|
799
|
+
sanitizeModelDisplayNamesForLoad(parsed, warn);
|
|
800
|
+
sanitizeAutoReviewForLoad(parsed, warn);
|
|
801
|
+
sanitizeRetryOn429ForLoad(parsed, warn);
|
|
802
|
+
sanitizeModelCostsForLoad(parsed, warn);
|
|
803
|
+
sanitizeCapabilityDeclarationsForLoad(parsed, warn);
|
|
804
804
|
const result = configSchema.safeParse(parsed);
|
|
805
805
|
if (result.success) {
|
|
806
806
|
return validFileConfigDiagnostics(normalizeApiKeyIds(result.data as OcxConfig), parsed);
|
|
@@ -68,7 +68,7 @@ export function hardenExistingSecret(path: string): void {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
/** Load only: discard invalid optional pins without rewriting the file or losing providers. */
|
|
71
|
-
export function sanitizeReasoningPinsForLoad(parsed: unknown): void {
|
|
71
|
+
export function sanitizeReasoningPinsForLoad(parsed: unknown, warn: (message: string) => void = console.warn): void {
|
|
72
72
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return;
|
|
73
73
|
const root = parsed as Record<string, unknown>;
|
|
74
74
|
let degraded = false;
|
|
@@ -107,7 +107,7 @@ export function sanitizeReasoningPinsForLoad(parsed: unknown): void {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
// Never include a provider/model name or value: malformed pins can contain secrets.
|
|
110
|
-
if (degraded)
|
|
110
|
+
if (degraded) warn("config.json contains invalid optional reasoning pins — ignoring invalid fields or entries");
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -203,7 +203,7 @@ export function warnDegradedMemoryModels(rawParsed: unknown, validated: OcxConfi
|
|
|
203
203
|
* `anthropicInstance` of its own is left untouched: the conflicting key lives in the global
|
|
204
204
|
* block, which is valid on its own, and the inherited value is still a well-formed instance.
|
|
205
205
|
*/
|
|
206
|
-
export function sanitizeAnthropicSidecarInstanceForLoad(parsed: unknown): void {
|
|
206
|
+
export function sanitizeAnthropicSidecarInstanceForLoad(parsed: unknown, warn: (message: string) => void = console.warn): void {
|
|
207
207
|
const asRecord = (value: unknown): Record<string, unknown> | undefined =>
|
|
208
208
|
value && typeof value === "object" && !Array.isArray(value) ? value as Record<string, unknown> : undefined;
|
|
209
209
|
const root = asRecord(parsed);
|
|
@@ -220,7 +220,7 @@ export function sanitizeAnthropicSidecarInstanceForLoad(parsed: unknown): void {
|
|
|
220
220
|
if (!error) continue;
|
|
221
221
|
delete sidecar.anthropicInstance;
|
|
222
222
|
// The message names a static path and reason only; the hand-edited value is never echoed.
|
|
223
|
-
|
|
223
|
+
warn(`⚠️ config.json ${error} — ignoring that anthropicInstance; the helper inherits the request's Anthropic pool`);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
@@ -231,7 +231,7 @@ export function sanitizeAnthropicSidecarInstanceForLoad(parsed: unknown): void {
|
|
|
231
231
|
* provider/key behind a default config. Invalid fields are dropped with a warning; the management
|
|
232
232
|
* write boundary still rejects invalid policies explicitly.
|
|
233
233
|
*/
|
|
234
|
-
export function sanitizeRetryOn429ForLoad(parsed: unknown): void {
|
|
234
|
+
export function sanitizeRetryOn429ForLoad(parsed: unknown, warn: (message: string) => void = console.warn): void {
|
|
235
235
|
if (!parsed || typeof parsed !== "object") return;
|
|
236
236
|
const root = parsed as Record<string, unknown>;
|
|
237
237
|
const providers = root.providers;
|
|
@@ -247,7 +247,7 @@ export function sanitizeRetryOn429ForLoad(parsed: unknown): void {
|
|
|
247
247
|
if (!policy || typeof policy !== "object" || Array.isArray(policy)) {
|
|
248
248
|
delete p.retryOn429;
|
|
249
249
|
// Never serialize the value: an accidental `retryOn429: "sk-..."` would leak the secret.
|
|
250
|
-
|
|
250
|
+
warn(`⚠️ config.json providers.${safeProviderName}.retryOn429 (${typeof policy}) is invalid — ignoring the policy`);
|
|
251
251
|
continue;
|
|
252
252
|
}
|
|
253
253
|
const policyRecord = policy as Record<string, unknown>;
|
|
@@ -255,7 +255,7 @@ export function sanitizeRetryOn429ForLoad(parsed: unknown): void {
|
|
|
255
255
|
// drop the whole policy so a hand-edit that tried to disable retries stays disabled.
|
|
256
256
|
if ("enabled" in policyRecord && typeof policyRecord.enabled !== "boolean") {
|
|
257
257
|
delete p.retryOn429;
|
|
258
|
-
|
|
258
|
+
warn(`⚠️ config.json providers.${safeProviderName}.retryOn429.enabled (${typeof policyRecord.enabled}) is invalid — ignoring the whole policy`);
|
|
259
259
|
continue;
|
|
260
260
|
}
|
|
261
261
|
// Field checks derive from the shared policy schema so the bounds cannot drift
|
|
@@ -268,7 +268,7 @@ export function sanitizeRetryOn429ForLoad(parsed: unknown): void {
|
|
|
268
268
|
if (value === undefined) continue;
|
|
269
269
|
if (fieldSchema.safeParse(value).success) cleaned[key] = value;
|
|
270
270
|
// Log only the received type, never the value (provider config can hold secrets).
|
|
271
|
-
else
|
|
271
|
+
else warn(`⚠️ config.json providers.${safeProviderName}.retryOn429.${key} (${typeof value}) is invalid — ignoring the field`);
|
|
272
272
|
}
|
|
273
273
|
const knownKeys = new Set(Object.keys(policyShape));
|
|
274
274
|
for (const key of Object.keys(policyRecord)) {
|
|
@@ -277,7 +277,7 @@ export function sanitizeRetryOn429ForLoad(parsed: unknown): void {
|
|
|
277
277
|
// property name (`retryOn429: { "sk-...": true }`). Ordinary typos (e.g. `attempt`)
|
|
278
278
|
// stay readable, secret-shaped names become [REDACTED]. JSON-escape afterwards so a
|
|
279
279
|
// control-character property name (newline/ANSI) can never forge a log line.
|
|
280
|
-
|
|
280
|
+
warn(`⚠️ config.json providers.${safeProviderName}.retryOn429.${JSON.stringify(redactSecretString(key))} is not a recognized field — ignoring it`);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
if (hadPolicyEntries && Object.keys(cleaned).length === 0) {
|
|
@@ -285,7 +285,7 @@ export function sanitizeRetryOn429ForLoad(parsed: unknown): void {
|
|
|
285
285
|
// opt IN to retries with defaults, which is the opposite of what a malformed
|
|
286
286
|
// disable-oriented edit (`retryOn429: { enabled: "false" }`, `attempts: 0`) asked for.
|
|
287
287
|
delete p.retryOn429;
|
|
288
|
-
|
|
288
|
+
warn(`⚠️ config.json providers.${safeProviderName}.retryOn429 has no valid fields left — removing the policy (an empty policy would enable retries with defaults)`);
|
|
289
289
|
} else {
|
|
290
290
|
// Preserve an intentionally empty `retryOn429: {}` (presence = opt-in with defaults).
|
|
291
291
|
p.retryOn429 = cleaned;
|
|
@@ -355,7 +355,7 @@ function strictPolicyConfigError(
|
|
|
355
355
|
return `${field}.${String(first.path[first.path.length - 1])} is invalid (${first.message})`;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
export function sanitizeCapabilityDeclarationsForLoad(parsed: unknown): void {
|
|
358
|
+
export function sanitizeCapabilityDeclarationsForLoad(parsed: unknown, warn: (message: string) => void = console.warn): void {
|
|
359
359
|
if (!parsed || typeof parsed !== "object") return;
|
|
360
360
|
const providers = (parsed as Record<string, unknown>).providers;
|
|
361
361
|
if (!providers || typeof providers !== "object" || Array.isArray(providers)) return;
|
|
@@ -363,12 +363,12 @@ export function sanitizeCapabilityDeclarationsForLoad(parsed: unknown): void {
|
|
|
363
363
|
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
364
364
|
const provider = value as Record<string, unknown>;
|
|
365
365
|
if (providerInputModalitiesConfigError(provider.inputModalities) !== null) {
|
|
366
|
-
|
|
366
|
+
warn(`config.json provider ${JSON.stringify(redactSecretString(name))} has malformed inputModalities; restricting input modalities to text`);
|
|
367
367
|
provider.inputModalities = ["text"];
|
|
368
368
|
}
|
|
369
369
|
if (provider.modelCapabilities === undefined) continue;
|
|
370
370
|
if (modelCapabilitiesConfigError(provider.modelCapabilities) !== null) {
|
|
371
|
-
|
|
371
|
+
warn(`config.json provider ${JSON.stringify(redactSecretString(name))} has malformed modelCapabilities; retaining valid axes and restricting malformed input modalities to text`);
|
|
372
372
|
const repaired = sanitizeModelCapabilitiesForLoad(provider.modelCapabilities);
|
|
373
373
|
if (repaired) provider.modelCapabilities = repaired;
|
|
374
374
|
else delete provider.modelCapabilities;
|
|
@@ -385,7 +385,7 @@ export function sanitizeCapabilityDeclarationsForLoad(parsed: unknown): void {
|
|
|
385
385
|
* with a warning; strict rejection stays at the management/write boundary
|
|
386
386
|
* (providerManagementConfigError).
|
|
387
387
|
*/
|
|
388
|
-
export function sanitizeModelCostsForLoad(parsed: unknown): void {
|
|
388
|
+
export function sanitizeModelCostsForLoad(parsed: unknown, warn: (message: string) => void = console.warn): void {
|
|
389
389
|
if (!parsed || typeof parsed !== "object") return;
|
|
390
390
|
const root = parsed as Record<string, unknown>;
|
|
391
391
|
const providers = root.providers;
|
|
@@ -400,7 +400,7 @@ export function sanitizeModelCostsForLoad(parsed: unknown): void {
|
|
|
400
400
|
if (costs === undefined) continue;
|
|
401
401
|
if (!costs || typeof costs !== "object" || Array.isArray(costs)) {
|
|
402
402
|
delete p.modelCosts;
|
|
403
|
-
|
|
403
|
+
warn(`⚠️ config.json providers.${safeProviderName}.modelCosts (${typeof costs}) is invalid — ignoring the overlay`);
|
|
404
404
|
continue;
|
|
405
405
|
}
|
|
406
406
|
const costsRecord = costs as Record<string, unknown>;
|
|
@@ -415,11 +415,11 @@ export function sanitizeModelCostsForLoad(parsed: unknown): void {
|
|
|
415
415
|
}
|
|
416
416
|
delete costsRecord[modelId];
|
|
417
417
|
// Redact the model id: a hand-edit can place a secret in a key name.
|
|
418
|
-
|
|
418
|
+
warn(`⚠️ config.json providers.${safeProviderName}.modelCosts.${JSON.stringify(redactSecretString(modelId))} is invalid — ignoring the row`);
|
|
419
419
|
}
|
|
420
420
|
if (hadEntries && kept === 0) {
|
|
421
421
|
delete p.modelCosts;
|
|
422
|
-
|
|
422
|
+
warn(`⚠️ config.json providers.${safeProviderName}.modelCosts has no valid rows left — removing the overlay`);
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
}
|
|
@@ -429,12 +429,12 @@ export function sanitizeModelCostsForLoad(parsed: unknown): void {
|
|
|
429
429
|
* hand edit must not fail the whole config parse; the management boundary stays
|
|
430
430
|
* strict and rejects the same shapes before they can be written.
|
|
431
431
|
*/
|
|
432
|
-
export function sanitizeAutoReviewForLoad(parsed: unknown): void {
|
|
432
|
+
export function sanitizeAutoReviewForLoad(parsed: unknown, warn: (message: string) => void = console.warn): void {
|
|
433
433
|
if (!parsed || typeof parsed !== "object") return;
|
|
434
434
|
const root = parsed as Record<string, unknown>;
|
|
435
435
|
if (root.autoReviewOverride !== undefined
|
|
436
436
|
&& autoReviewOverrideConfigError(root.autoReviewOverride) !== null) {
|
|
437
|
-
|
|
437
|
+
warn("⚠️ config.json autoReviewOverride is invalid — ignoring the override");
|
|
438
438
|
delete root.autoReviewOverride;
|
|
439
439
|
}
|
|
440
440
|
const providers = root.providers;
|
|
@@ -450,7 +450,7 @@ export function sanitizeAutoReviewForLoad(parsed: unknown): void {
|
|
|
450
450
|
}
|
|
451
451
|
if (provider.autoReviewModel !== undefined
|
|
452
452
|
&& autoReviewModelTargetConfigError(provider.autoReviewModel, "autoReviewModel", true) !== null) {
|
|
453
|
-
|
|
453
|
+
warn(`⚠️ config.json providers.${safeProviderName}.autoReviewModel is invalid — ignoring the selector`);
|
|
454
454
|
delete provider.autoReviewModel;
|
|
455
455
|
}
|
|
456
456
|
if (provider.autoReviewModelOverrides !== undefined) {
|
|
@@ -460,7 +460,7 @@ export function sanitizeAutoReviewForLoad(parsed: unknown): void {
|
|
|
460
460
|
true,
|
|
461
461
|
);
|
|
462
462
|
if (overridesError) {
|
|
463
|
-
|
|
463
|
+
warn(`⚠️ config.json providers.${safeProviderName}.autoReviewModelOverrides is invalid — ignoring the map`);
|
|
464
464
|
delete provider.autoReviewModelOverrides;
|
|
465
465
|
}
|
|
466
466
|
}
|
|
@@ -1006,7 +1006,7 @@ export function warnInheritedFastWireConflicts(configPath: string, config: OcxCo
|
|
|
1006
1006
|
}
|
|
1007
1007
|
|
|
1008
1008
|
/** Hand-edited alias mistakes disable only the bad alias; providers and routing survive. */
|
|
1009
|
-
export function sanitizeAliasesForLoad(raw: unknown): void {
|
|
1009
|
+
export function sanitizeAliasesForLoad(raw: unknown, warn: (message: string) => void = console.warn): void {
|
|
1010
1010
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return;
|
|
1011
1011
|
const root = raw as Record<string, unknown>;
|
|
1012
1012
|
if (!root.providers || typeof root.providers !== "object" || Array.isArray(root.providers)) return;
|
|
@@ -1021,7 +1021,7 @@ export function sanitizeAliasesForLoad(raw: unknown): void {
|
|
|
1021
1021
|
if (typeof alias !== "string" || !isValidProviderName(alias)
|
|
1022
1022
|
|| providerNames.has(alias.toLowerCase()) || claimedProviders.has(alias.toLowerCase())
|
|
1023
1023
|
|| comboAliases.has(alias.toLowerCase()) || accountNamespaces.has(alias.toLowerCase())) {
|
|
1024
|
-
if (alias !== undefined)
|
|
1024
|
+
if (alias !== undefined) warn("Ignoring invalid or colliding provider alias in config.json");
|
|
1025
1025
|
delete provider.alias;
|
|
1026
1026
|
} else claimedProviders.add(alias.toLowerCase());
|
|
1027
1027
|
if (!provider.modelAliases || typeof provider.modelAliases !== "object" || Array.isArray(provider.modelAliases)) {
|
|
@@ -1035,7 +1035,7 @@ export function sanitizeAliasesForLoad(raw: unknown): void {
|
|
|
1035
1035
|
const lower = typeof value === "string" ? value.toLowerCase() : "";
|
|
1036
1036
|
if (typeof value !== "string" || !MODEL_ALIAS_PATTERN.test(value) || claimed.has(lower)
|
|
1037
1037
|
|| nativeIds.has(lower) || comboAliases.has(lower) || /^(?:gpt-|o1-|o3-|o4-|codex-)/i.test(value)) {
|
|
1038
|
-
|
|
1038
|
+
warn(`Ignoring invalid or colliding model alias for ${id} in config.json`);
|
|
1039
1039
|
delete aliases[id];
|
|
1040
1040
|
} else claimed.add(lower);
|
|
1041
1041
|
}
|
|
@@ -1043,7 +1043,7 @@ export function sanitizeAliasesForLoad(raw: unknown): void {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
1045
|
/** Hand-edited display-name mistakes disable only the bad label. */
|
|
1046
|
-
export function sanitizeModelDisplayNamesForLoad(raw: unknown): void {
|
|
1046
|
+
export function sanitizeModelDisplayNamesForLoad(raw: unknown, warn: (message: string) => void = console.warn): void {
|
|
1047
1047
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return;
|
|
1048
1048
|
const root = raw as Record<string, unknown>;
|
|
1049
1049
|
if (!root.providers || typeof root.providers !== "object" || Array.isArray(root.providers)) return;
|
|
@@ -1055,7 +1055,7 @@ export function sanitizeModelDisplayNamesForLoad(raw: unknown): void {
|
|
|
1055
1055
|
const providerLabel = JSON.stringify(redactSecretString(providerName));
|
|
1056
1056
|
if (!value || typeof value !== "object" || Array.isArray(value)
|
|
1057
1057
|
|| Object.entries(value).length > MODEL_DISCOVERY_MAX_MODELS) {
|
|
1058
|
-
|
|
1058
|
+
warn(`Ignoring invalid modelDisplayNames map for provider ${providerLabel} in config.json`);
|
|
1059
1059
|
delete provider.modelDisplayNames;
|
|
1060
1060
|
continue;
|
|
1061
1061
|
}
|
|
@@ -1064,7 +1064,7 @@ export function sanitizeModelDisplayNamesForLoad(raw: unknown): void {
|
|
|
1064
1064
|
const displayName = typeof rawDisplayName === "string" ? rawDisplayName.trim() : rawDisplayName;
|
|
1065
1065
|
if (modelDisplayNamesConfigError({ [modelId]: displayName })) {
|
|
1066
1066
|
const safeModelId = JSON.stringify(redactSecretString(modelId));
|
|
1067
|
-
|
|
1067
|
+
warn(`Ignoring invalid modelDisplayNames entry ${safeModelId} for provider ${providerLabel} in config.json`);
|
|
1068
1068
|
delete labels[modelId];
|
|
1069
1069
|
} else {
|
|
1070
1070
|
labels[modelId] = displayName;
|
|
@@ -478,7 +478,7 @@ export function modelCapabilitiesConfigError(value: unknown, allowTombstones = f
|
|
|
478
478
|
if (allowTombstones && row === null) continue;
|
|
479
479
|
if (!capabilityRecord(row)) return "modelCapabilities rows must be plain objects";
|
|
480
480
|
for (const [axis, declaration] of Object.entries(row)) {
|
|
481
|
-
if (!["inputModalities", "contextTier", "video", "deepseekImageFiles", "supportsReasoning", "supportsThinkingToggle", "supportsReasoningEffort", "defaultThinkingEnabled"].includes(axis)) return "modelCapabilities contains an unknown axis";
|
|
481
|
+
if (!["inputModalities", "contextTier", "video", "deepseekImageFiles", "mistralMaxImages", "supportsReasoning", "supportsThinkingToggle", "supportsReasoningEffort", "defaultThinkingEnabled"].includes(axis)) return "modelCapabilities contains an unknown axis";
|
|
482
482
|
if (allowTombstones && declaration === null) continue;
|
|
483
483
|
if (axis === "inputModalities") {
|
|
484
484
|
if (!Array.isArray(declaration) || declaration.length === 0
|
|
@@ -487,6 +487,10 @@ export function modelCapabilitiesConfigError(value: unknown, allowTombstones = f
|
|
|
487
487
|
}
|
|
488
488
|
} else if (axis === "contextTier") {
|
|
489
489
|
if (declaration !== "default" && declaration !== "long_context") return "modelCapabilities contextTier must be default or long_context";
|
|
490
|
+
} else if (axis === "mistralMaxImages") {
|
|
491
|
+
if (typeof declaration !== "number" || !Number.isSafeInteger(declaration) || declaration < 1 || declaration > 1000) {
|
|
492
|
+
return "modelCapabilities mistralMaxImages must be an integer from 1 to 1000";
|
|
493
|
+
}
|
|
490
494
|
} else if (["deepseekImageFiles", "supportsReasoning", "supportsThinkingToggle", "supportsReasoningEffort", "defaultThinkingEnabled"].includes(axis)) {
|
|
491
495
|
if (typeof declaration !== "boolean") return `modelCapabilities ${axis} must be a boolean`;
|
|
492
496
|
} else {
|
|
@@ -521,6 +525,9 @@ export function mergeModelCapabilities(
|
|
|
521
525
|
} else if (axis === "deepseekImageFiles") {
|
|
522
526
|
if (value === null) delete row.deepseekImageFiles;
|
|
523
527
|
else row.deepseekImageFiles = value as boolean;
|
|
528
|
+
} else if (axis === "mistralMaxImages") {
|
|
529
|
+
if (value === null) delete row.mistralMaxImages;
|
|
530
|
+
else row.mistralMaxImages = value as number;
|
|
524
531
|
} else if (axis === "supportsReasoning" || axis === "supportsThinkingToggle" || axis === "supportsReasoningEffort" || axis === "defaultThinkingEnabled") {
|
|
525
532
|
if (value === null) delete row[axis];
|
|
526
533
|
else row[axis] = value as boolean;
|
|
@@ -551,7 +558,7 @@ export function sanitizeModelCapabilitiesForLoad(value: unknown): Record<string,
|
|
|
551
558
|
for (const [id, raw] of Object.entries(value).slice(0, MODEL_DISCOVERY_MAX_MODELS)) {
|
|
552
559
|
if (!capabilityRecord(raw) || !isValidModelDiscoveryModelId(id) || ["__proto__", "prototype", "constructor"].includes(id)) continue;
|
|
553
560
|
const row: Record<string, unknown> = {};
|
|
554
|
-
for (const axis of ["inputModalities", "contextTier", "video", "deepseekImageFiles", "supportsReasoning", "supportsThinkingToggle", "supportsReasoningEffort", "defaultThinkingEnabled"] as const) {
|
|
561
|
+
for (const axis of ["inputModalities", "contextTier", "video", "deepseekImageFiles", "mistralMaxImages", "supportsReasoning", "supportsThinkingToggle", "supportsReasoningEffort", "defaultThinkingEnabled"] as const) {
|
|
555
562
|
if (!Object.hasOwn(raw, axis)) continue;
|
|
556
563
|
const declaration = raw[axis];
|
|
557
564
|
if (modelCapabilitiesConfigError({ [id]: { [axis]: declaration } }) === null) row[axis] = declaration;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { closeSync, constants, fstatSync, lstatSync, openSync, readFileSync, readdirSync } from "node:fs";
|
|
2
2
|
import { basename, dirname, join } from "node:path";
|
|
3
3
|
import { atomicWriteFileNoFollow } from "./atomic-write";
|
|
4
|
-
import { isPassiveRead } from "../lib/passive-read";
|
|
4
|
+
import { isPassiveRead, passiveReadDiagnostic } from "../lib/passive-read";
|
|
5
5
|
import { redactUserPath } from "../lib/redact";
|
|
6
6
|
import { sanitizeRemovedOpenCodeFreeForLoad } from "./removed-opencode-free";
|
|
7
7
|
import { verifySecretPathAcl, windowsSecretAclApplies } from "../lib/windows-secret-acl";
|
|
@@ -81,9 +81,12 @@ function backupOriginal(configPath: string, rawBytes: Uint8Array): string | null
|
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/** Disk-load boundary only;
|
|
84
|
+
/** Disk-load boundary only; passive reads may report a diagnostic but never publish. */
|
|
85
85
|
export function preserveRemovedOpenCodeFree(configPath: string, rawBytes: Uint8Array): void {
|
|
86
|
-
if (isPassiveRead())
|
|
86
|
+
if (isPassiveRead()) {
|
|
87
|
+
passiveReadDiagnostic("opencode-free support was removed; its entries and dependent references are disabled. The configuration file has not been changed.");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
87
90
|
const backup = backupOriginal(configPath, rawBytes);
|
|
88
91
|
if (warned) return;
|
|
89
92
|
warned = true;
|
|
@@ -59,7 +59,7 @@ export type TrackedRecordRefusal =
|
|
|
59
59
|
| "unverified";
|
|
60
60
|
|
|
61
61
|
export type TrackedRecordInspection =
|
|
62
|
-
| { status: "verified"; pid: number; port: number; hostname: string }
|
|
62
|
+
| { status: "verified"; pid: number; port: number; hostname: string | undefined }
|
|
63
63
|
| { status: "refused"; reason: TrackedRecordRefusal };
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -147,7 +147,7 @@ export function inspectTrackedRuntimeRecord(
|
|
|
147
147
|
if (parsed.pid !== pid) {
|
|
148
148
|
return { status: "refused", reason: "runtime-record-pid-mismatch" };
|
|
149
149
|
}
|
|
150
|
-
return { status: "verified", pid, port: parsed.port, hostname: parsed.hostname
|
|
150
|
+
return { status: "verified", pid, port: parsed.port, hostname: parsed.hostname };
|
|
151
151
|
} catch {
|
|
152
152
|
return { status: "refused", reason: "unverified" };
|
|
153
153
|
}
|
|
@@ -180,7 +180,7 @@ const TRACKED_REFUSAL_CAUSES: Record<TrackedRecordRefusal, string> = {
|
|
|
180
180
|
*/
|
|
181
181
|
export function describeTrackedRuntimeTarget(
|
|
182
182
|
deps: TrackedRecordProbeDeps = {},
|
|
183
|
-
): { pid: number; port: number; hostname: string } | { untracked: string } {
|
|
183
|
+
): { pid: number; port: number; hostname: string | undefined } | { untracked: string } {
|
|
184
184
|
const inspection = inspectTrackedRuntimeRecord(deps);
|
|
185
185
|
return inspection.status === "verified"
|
|
186
186
|
? { pid: inspection.pid, port: inspection.port, hostname: inspection.hostname }
|