sneakoscope 7.0.2 → 7.0.5
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/README.md +9 -7
- package/config/codex-releases/{rust-v0.144.5.json → rust-v0.145.0.json} +14 -8
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/sks-dispatch.js +0 -3
- package/dist/cli/command-manifest-lite.js +1 -2
- package/dist/cli/command-registry.js +0 -4
- package/dist/cli/global-mode-router.js +5 -12
- package/dist/cli/install-helpers-codex-lb-chain.js +24 -2
- package/dist/cli/install-helpers-codex-lb-config.js +10 -25
- package/dist/cli/install-helpers-codex-lb-selftest-chain.js +0 -3
- package/dist/cli/install-helpers-codex-lb-selftest.js +0 -17
- package/dist/cli/install-helpers-install-support.js +1 -2
- package/dist/cli/install-helpers.js +83 -99
- package/dist/cli/router.js +22 -31
- package/dist/commands/codex-app.js +20 -2
- package/dist/commands/codex-lb.js +176 -22
- package/dist/commands/codex.js +3 -8
- package/dist/commands/conflicts.js +26 -3
- package/dist/commands/doctor.js +26 -31
- package/dist/commands/perf.js +5 -1
- package/dist/commands/zellij-slot-column-anchor.js +0 -2
- package/dist/commands/zellij-slot-pane.js +0 -7
- package/dist/commands/zellij.js +0 -2
- package/dist/config/skills-manifest.json +52 -52
- package/dist/core/agent-bridge/agent-manifest.js +192 -1
- package/dist/core/agent-bridge/agent-mode.js +0 -5
- package/dist/core/agent-bridge/host-capability-policy.js +189 -0
- package/dist/core/agent-bridge/host-capability-runtime.js +1395 -0
- package/dist/core/agent-bridge/mcp-server.js +1 -11
- package/dist/core/agents/agent-effort-policy.js +7 -10
- package/dist/core/agents/agent-orchestrator.js +0 -4
- package/dist/core/agents/agent-proof-evidence.js +0 -2
- package/dist/core/agents/agent-roster.js +6 -5
- package/dist/core/agents/agent-runner-ollama.js +0 -3
- package/dist/core/agents/agent-scheduler.js +7 -10
- package/dist/core/agents/agent-schema.js +3 -1
- package/dist/core/agents/agent-task-graph.js +4 -1
- package/dist/core/agents/agent-work-partition.js +4 -2
- package/dist/core/agents/native-cli-worker-runtime.js +5 -17
- package/dist/core/agents/work-partition/repo-inventory.js +0 -2
- package/dist/core/auto-review.js +8 -14
- package/dist/core/bench.js +0 -14
- package/dist/core/code-structure.js +0 -3
- package/dist/core/codex/agent-config-file-repair.js +0 -8
- package/dist/core/codex/codex-cli-update.js +122 -20
- package/dist/core/codex/codex-config-eperm-repair.js +0 -4
- package/dist/core/codex/codex-config-guard.js +0 -3
- package/dist/core/codex/codex-config-readability.js +0 -13
- package/dist/core/codex/codex-project-config-policy.js +0 -33
- package/dist/core/codex/codex-startup-config-postcheck.js +5 -0
- package/dist/core/codex/official-goal-mode.js +0 -2
- package/dist/core/codex-app/codex-agent-type-probe.js +31 -24
- package/dist/core/codex-app/codex-app-fast-ui-repair.js +5 -7
- package/dist/core/codex-app/codex-app-ui-state-snapshot.js +44 -7
- package/dist/core/codex-app/glm-model-profile.js +1 -1
- package/dist/core/codex-app/glm-profile-installer.js +40 -41
- package/dist/core/codex-app/glm-profile-schema.js +7 -11
- package/dist/core/codex-app/menubar/constants.js +1 -0
- package/dist/core/codex-app/menubar/launch-agent.js +37 -1
- package/dist/core/codex-app/openrouter-activate.js +152 -0
- package/dist/core/codex-app/openrouter-provider.js +82 -0
- package/dist/core/codex-app/sks-menubar.js +0 -1
- package/dist/core/codex-app.js +14 -32
- package/dist/core/codex-compat/codex-capability-matrix.js +208 -0
- package/dist/core/codex-compat/codex-hook-output-builders.js +9 -1
- package/dist/core/codex-compat/codex-hook-output-normalizer.js +1 -1
- package/dist/core/codex-compat/codex-hook-semantic-validator.js +3 -2
- package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -2
- package/dist/core/codex-compat/codex-release-manifest.js +15 -8
- package/dist/core/codex-compat/codex-version-policy.js +77 -15
- package/dist/core/codex-control/codex-0144-capability.js +1 -1
- package/dist/core/codex-control/codex-lb-launch-recovery.js +0 -3
- package/dist/core/codex-control/codex-reliability-shield.js +0 -8
- package/dist/core/codex-control/codex-sdk-adapter.js +0 -3
- package/dist/core/codex-control/codex-sdk-config-policy.js +0 -2
- package/dist/core/codex-control/codex-sdk-env-policy.js +61 -16
- package/dist/core/codex-control/codex-task-runner.js +0 -7
- package/dist/core/codex-control/codex-thread-registry.js +0 -4
- package/dist/core/codex-lb/codex-lb-env.js +133 -24
- package/dist/core/codex-lb/codex-lb-tool-catalog.js +0 -4
- package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +1 -1
- package/dist/core/codex-model-guard.js +0 -14
- package/dist/core/codex-native/codex-native-feature-broker.js +67 -22
- package/dist/core/codex-native/codex-native-interop-policy.js +81 -9
- package/dist/core/codex-native/confined-report-writer.js +21 -0
- package/dist/core/codex-native/core-skill-integrity.js +169 -20
- package/dist/core/codex-native/project-skill-dedupe.js +55 -13
- package/dist/core/codex-native/skill-registry-ledger.js +137 -16
- package/dist/core/codex-native/sks-skill-paths.js +185 -0
- package/dist/core/codex-runtime/codex-desktop-config-policy.js +3 -3
- package/dist/core/commands/agent-bridge-command.js +28 -8
- package/dist/core/commands/basic-cli.js +89 -42
- package/dist/core/commands/bench-command.js +5 -1
- package/dist/core/commands/command-utils.js +0 -5
- package/dist/core/commands/image-ux-review-command.js +0 -9
- package/dist/core/commands/mad-sks-command.js +55 -208
- package/dist/core/commands/naruto-command.js +55 -21
- package/dist/core/commands/ppt-command.js +0 -9
- package/dist/core/commands/run-command.js +8 -2
- package/dist/core/commands/seo-command.js +0 -6
- package/dist/core/commands/wiki-command.js +0 -14
- package/dist/core/computer-use-live-evidence.js +0 -5
- package/dist/core/config/secret-preservation.js +0 -11
- package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +0 -2
- package/dist/core/daemon/sksd-hook-daemon.js +1 -29
- package/dist/core/daemon/sksd-hook-dispatch.js +0 -17
- package/dist/core/db-safety.js +0 -7
- package/dist/core/doctor/browser-use-repair.js +0 -2
- package/dist/core/doctor/command-alias-cleanup.js +37 -9
- package/dist/core/doctor/current-project-guidance.js +6 -3
- package/dist/core/doctor/doctor-codex-startup-repair.js +0 -3
- package/dist/core/doctor/doctor-dirty-planner.js +1 -1
- package/dist/core/doctor/doctor-readiness-matrix.js +12 -0
- package/dist/core/doctor/doctor-skill-reconcile.js +32 -0
- package/dist/core/doctor/imagegen-repair.js +0 -2
- package/dist/core/doctor/mcp-transport-collision-repair.js +0 -3
- package/dist/core/doctor/retired-auto-review-config.js +9 -1
- package/dist/core/doctor/retired-managed-residue-private.js +5 -4
- package/dist/core/doctor/retired-managed-residue-runtime.js +9 -1
- package/dist/core/doctor/skill-legacy-surface.js +351 -0
- package/dist/core/doctor/supabase-mcp-repair.js +0 -11
- package/dist/core/evaluation.js +3 -0
- package/dist/core/feature-fixture-executor.js +0 -48
- package/dist/core/feature-fixtures.js +0 -6
- package/dist/core/fsx.js +11 -12
- package/dist/core/harness-conflicts.js +177 -18
- package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +0 -5
- package/dist/core/hooks-runtime/hook-context.js +202 -0
- package/dist/core/hooks-runtime/hook-io.js +1 -12
- package/dist/core/hooks-runtime/light-turn.js +0 -2
- package/dist/core/hooks-runtime/naruto-decision-gate.js +4 -1
- package/dist/core/hooks-runtime/naruto-terminal-finalization.js +91 -0
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +369 -0
- package/dist/core/hooks-runtime/standalone-parent-host-capability.js +98 -0
- package/dist/core/hooks-runtime/subagent-context.js +59 -0
- package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +29 -0
- package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +195 -0
- package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +316 -0
- package/dist/core/hooks-runtime/subagent-skill-availability.js +217 -0
- package/dist/core/hooks-runtime.js +275 -540
- package/dist/core/image-ux-review/codex-app-generated-image-discovery.js +0 -17
- package/dist/core/image-ux-review/imagegen-adapter.js +0 -14
- package/dist/core/imagegen/imagegen-auth-readiness.js +0 -9
- package/dist/core/imagegen/imagegen-capability.js +0 -3
- package/dist/core/init/managed-skill-install.js +42 -0
- package/dist/core/init/skills.js +248 -75
- package/dist/core/init.js +19 -45
- package/dist/core/lean-engineering-policy.js +0 -2
- package/dist/core/locks/file-lock.js +0 -21
- package/dist/core/loops/loop-planner.js +0 -6
- package/dist/core/loops/loop-runtime.js +0 -1
- package/dist/core/loops/loop-worker-runtime.js +0 -19
- package/dist/core/mad-sks/executors/db-write-executor.js +0 -4
- package/dist/core/mad-sks/executors/executor-base.js +0 -10
- package/dist/core/mad-sks/immutable-harness-guard.js +0 -5
- package/dist/core/mad-sks/sql-plane/coordinator.js +0 -5
- package/dist/core/mad-sks/sql-plane/ledger.js +0 -4
- package/dist/core/mad-sks/sql-plane/lock.js +0 -4
- package/dist/core/mad-sks/sql-plane/mcp-executor.js +0 -9
- package/dist/core/mad-sks/sql-plane/policy-resolver.js +0 -2
- package/dist/core/mad-sks/sql-plane/postconditions.js +0 -4
- package/dist/core/mad-sks/sql-plane/recovery.js +0 -2
- package/dist/core/mad-sks/sql-plane/runtime-profile.js +0 -8
- package/dist/core/managed-assets/managed-assets-manifest.js +1 -7
- package/dist/core/mcp-config/health-check.js +10 -3
- package/dist/core/migration/migration-transaction-journal.js +0 -8
- package/dist/core/mission.js +0 -2
- package/dist/core/naruto/naruto-active-pool.js +0 -2
- package/dist/core/naruto/naruto-concurrency-governor.js +18 -11
- package/dist/core/naruto/naruto-real-write-proof.js +0 -4
- package/dist/core/naruto/naruto-write-e2e.js +0 -1
- package/dist/core/perf/perf-budget.js +0 -5
- package/dist/core/permission-gates.js +0 -2
- package/dist/core/pipeline-internals/runtime-core.js +15 -5
- package/dist/core/pipeline-internals/runtime-gates.js +7 -19
- package/dist/core/preflight/parallel-preflight-engine.js +1 -12
- package/dist/core/proof/evidence-collector.js +0 -2
- package/dist/core/proof/route-finalizer.js +0 -1
- package/dist/core/proof/selftest-proof-fixtures.js +0 -5
- package/dist/core/providers/openrouter/openrouter-client.js +2 -2
- package/dist/core/providers/openrouter/openrouter-provider-health.js +1 -1
- package/dist/core/providers/{glm/glm-request-cache.js → openrouter/openrouter-request-cache.js} +5 -6
- package/dist/core/providers/openrouter/openrouter-secret-store.js +0 -1
- package/dist/core/providers/openrouter/openrouter-stream.js +2 -4
- package/dist/core/questions.js +3 -3
- package/dist/core/release/gate-manifest.js +0 -5
- package/dist/core/release/package-size-budget.js +2 -2
- package/dist/core/release/release-gate-batch-runner.js +11 -2
- package/dist/core/release/release-gate-cache-v2.js +0 -4
- package/dist/core/release/release-gate-contract.js +0 -7
- package/dist/core/release/release-gate-hermetic-env.js +0 -5
- package/dist/core/release/release-pack-receipt.js +1 -0
- package/dist/core/release-parallel-full-coverage.js +0 -2
- package/dist/core/remote/ssh-worker-client.js +0 -3
- package/dist/core/research/research-adversarial-review.js +6 -2
- package/dist/core/responses-retry-policy.js +0 -10
- package/dist/core/retention.js +0 -7
- package/dist/core/routes/constants.js +0 -3
- package/dist/core/routes/model-mode-router.js +10 -19
- package/dist/core/routes.js +91 -17
- package/dist/core/safety/command-contract/contracts.js +2 -0
- package/dist/core/safety/mutation-guard.js +0 -25
- package/dist/core/safety/mutation-ledger.js +0 -9
- package/dist/core/safety/requested-scope-contract.js +0 -0
- package/dist/core/security/high-risk-contracts.js +0 -1
- package/dist/core/skills/core-skill-card.js +0 -0
- package/dist/core/skills/core-skill-deployment.js +0 -13
- package/dist/core/skills/core-skill-epoch.js +0 -11
- package/dist/core/skills/core-skill-meta-update.js +0 -6
- package/dist/core/skills/core-skill-patch-apply.js +0 -7
- package/dist/core/skills/core-skill-patch.js +0 -8
- package/dist/core/skills/core-skill-reflection.js +0 -16
- package/dist/core/skills/core-skill-runtime.js +0 -6
- package/dist/core/skills/core-skill-scorer.js +0 -7
- package/dist/core/skills/core-skill-trainer.js +0 -11
- package/dist/core/skills/core-skill-types.js +0 -9
- package/dist/core/skills/core-skill-validation.js +0 -5
- package/dist/core/skills/rejected-skill-patch-buffer.js +0 -2
- package/dist/core/stop-gate/stop-gate-check.js +0 -8
- package/dist/core/stop-gate/stop-gate-resolver.js +0 -7
- package/dist/core/stop-gate/stop-gate-writer.js +0 -5
- package/dist/core/subagents/model-policy.js +0 -7
- package/dist/core/subagents/naruto-help-contract.js +3 -2
- package/dist/core/subagents/naruto-proof-projection.js +580 -12
- package/dist/core/subagents/official-subagent-config.js +256 -40
- package/dist/core/subagents/official-subagent-preparation.js +11 -7
- package/dist/core/subagents/official-subagent-prompt.js +29 -0
- package/dist/core/subagents/official-subagent-runner.js +379 -39
- package/dist/core/subagents/subagent-evidence.js +378 -9
- package/dist/core/subagents/terminology.js +11 -6
- package/dist/core/subagents/thread-budget.js +6 -3
- package/dist/core/subagents/triwiki-attention.js +0 -4
- package/dist/core/subagents/wave-parent-guidance.js +54 -9
- package/dist/core/telegram/runtime.js +0 -1
- package/dist/core/triwiki/code-index-scanner.js +0 -3
- package/dist/core/triwiki/code-pack-head-freshness.js +0 -10
- package/dist/core/triwiki/code-pack.js +0 -2
- package/dist/core/triwiki/triwiki-cache-key.js +0 -1
- package/dist/core/triwiki/triwiki-proof-bank.js +0 -1
- package/dist/core/triwiki-attention.js +0 -10
- package/dist/core/triwiki-provenance.js +0 -5
- package/dist/core/triwiki-runtime.js +0 -12
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +0 -7
- package/dist/core/triwiki-wrongness/wrongness-schema.js +0 -3
- package/dist/core/trust-kernel/trust-report.js +0 -7
- package/dist/core/update/update-migration-state.js +113 -61
- package/dist/core/update-check.js +2 -14
- package/dist/core/version-manager.js +43 -4
- package/dist/core/version.js +1 -1
- package/dist/core/work-order-ledger.js +0 -17
- package/dist/core/zellij/zellij-clipboard-config.js +0 -18
- package/dist/core/zellij/zellij-fake-adapter.js +16 -0
- package/dist/core/zellij/zellij-lane-renderer.js +5 -46
- package/dist/core/zellij/zellij-lane-runtime.js +0 -1
- package/dist/core/zellij/zellij-launcher.js +35 -35
- package/dist/core/zellij/zellij-official-subagent-activity.js +0 -5
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -5
- package/dist/core/zellij/zellij-pane-proof.js +3 -3
- package/dist/core/zellij/zellij-screen-proof.js +0 -7
- package/dist/core/zellij/zellij-slot-column-anchor.js +0 -1
- package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -9
- package/dist/core/zellij/zellij-slot-telemetry.js +6 -16
- package/dist/core/zellij/zellij-ui-mode.js +0 -7
- package/dist/core/zellij/zellij-update.js +0 -29
- package/dist/core/zellij/zellij-worker-pane-manager.js +0 -39
- package/dist/native/sks-menubar/Sources/DiagnosticsViewController.swift +61 -2
- package/dist/native/sks-menubar/Sources/MCPServersViewController.swift +10 -3
- package/dist/native/sks-menubar/Sources/OverviewViewController.swift +55 -3
- package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +76 -0
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +273 -54
- package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +5 -1
- package/dist/native/sks-menubar/Sources/SettingsViewController.swift +2 -2
- package/dist/native/sks-menubar/Sources/StatusItemController.swift +28 -2
- package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +96 -13
- package/dist/scripts/agent-message-bus-reader-check.js +0 -1
- package/dist/scripts/all-feature-deep-completion-check.js +0 -1
- package/dist/scripts/appshots-thread-attachment-discovery-check.js +0 -1
- package/dist/scripts/architecture-guard-check.js +0 -1
- package/dist/scripts/build-dist.js +0 -1
- package/dist/scripts/build-once-runner-check.js +0 -1
- package/dist/scripts/canonical-test-runner.js +0 -2
- package/dist/scripts/certificate-sla-check.js +0 -1
- package/dist/scripts/changelog-check.js +0 -1
- package/dist/scripts/check-cli-entrypoint.js +0 -1
- package/dist/scripts/check-command-module-budget.js +0 -7
- package/dist/scripts/check-feature-quality.js +0 -1
- package/dist/scripts/check-legacy-free.js +0 -1
- package/dist/scripts/check-pipeline-runtime.js +0 -1
- package/dist/scripts/check-runtime-schemas.js +0 -1
- package/dist/scripts/codex-0-134-runner-truth-check.js +0 -1
- package/dist/scripts/codex-0-137-compat-check.js +0 -1
- package/dist/scripts/codex-0138-capability-artifact-check.js +0 -1
- package/dist/scripts/codex-0138-capability-check.js +0 -1
- package/dist/scripts/codex-0138-doctor-check.js +0 -1
- package/dist/scripts/codex-0138-feature-probes-check.js +0 -1
- package/dist/scripts/codex-0144-app-server-v2-check.js +5 -5
- package/dist/scripts/codex-0144-core-real-probes-check.js +0 -1
- package/dist/scripts/codex-app-handoff-check.js +0 -1
- package/dist/scripts/codex-app-handoff-launch-check.js +0 -1
- package/dist/scripts/codex-config-load-probe.js +0 -5
- package/dist/scripts/codex-control-all-pipelines-check.js +0 -1
- package/dist/scripts/codex-control-event-stream-ledger-check.js +0 -1
- package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +0 -1
- package/dist/scripts/codex-permission-profiles-check.js +0 -1
- package/dist/scripts/codex-plugin-app-template-policy-check.js +0 -1
- package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -1
- package/dist/scripts/codex-sdk-all-pipelines-check.js +0 -1
- package/dist/scripts/codex-sdk-backend-router-check.js +0 -1
- package/dist/scripts/codex-sdk-capability-check.js +0 -1
- package/dist/scripts/codex-sdk-event-stream-ledger-check.js +0 -1
- package/dist/scripts/codex-sdk-real-smoke-check.js +0 -1
- package/dist/scripts/concurrent-session-collision-check.js +9 -0
- package/dist/scripts/context7-evidence-dedupe-check.js +0 -1
- package/dist/scripts/core-skill-card-schema-check.js +0 -11
- package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -10
- package/dist/scripts/core-skill-heldout-validation-check.js +0 -11
- package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -11
- package/dist/scripts/core-skill-patch-check.js +0 -11
- package/dist/scripts/core-skill-route-runtime-integration-check.js +0 -11
- package/dist/scripts/current-command-surface-check.js +1 -1
- package/dist/scripts/current-surface-update-e2e-check.js +2 -4
- package/dist/scripts/current-upgrade-matrix-check.js +0 -1
- package/dist/scripts/dfix-fixture-check.js +0 -1
- package/dist/scripts/dfix-patch-handoff-check.js +0 -1
- package/dist/scripts/dfix-verification-check.js +0 -1
- package/dist/scripts/dfix-verification-recommendation-check.js +0 -1
- package/dist/scripts/docs-truthfulness-check.js +7 -7
- package/dist/scripts/doctor-fastpath-check.js +0 -1
- package/dist/scripts/doctor-fix-production-blackbox.js +1 -1
- package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -11
- package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -4
- package/dist/scripts/doctor-idempotence-check.js +0 -1
- package/dist/scripts/doctor-ops-semantics-check.js +0 -1
- package/dist/scripts/doctor-startup-config-repair-blackbox.js +1 -1
- package/dist/scripts/ensure-bin-executable.js +0 -1
- package/dist/scripts/evidence-flagship-coverage-check.js +0 -1
- package/dist/scripts/fast-codex-service-tier-proof-check.js +0 -1
- package/dist/scripts/fixtures/fake-codex-config-loader.js +0 -5
- package/dist/scripts/fsx-hotpath-check.js +0 -1
- package/dist/scripts/gate-policy-audit-check.js +1 -1
- package/dist/scripts/geo-claim-evidence-check.js +0 -1
- package/dist/scripts/geo-cli-blackbox-check.js +0 -1
- package/dist/scripts/geo-crawler-policy-check.js +0 -1
- package/dist/scripts/git-worktree-diff-envelope-check.js +0 -1
- package/dist/scripts/git-worktree-dirty-lock-check.js +0 -1
- package/dist/scripts/git-worktree-dirty-main-detection-check.js +0 -1
- package/dist/scripts/git-worktree-integration-primary-check.js +0 -1
- package/dist/scripts/git-worktree-manifest-append-check.js +0 -1
- package/dist/scripts/git-worktree-untracked-diff-check.js +0 -1
- package/dist/scripts/high-risk-contracts-check.js +0 -1
- package/dist/scripts/hook-latency-budget-check.js +0 -1
- package/dist/scripts/hook-latency-quantum-check.js +0 -1
- package/dist/scripts/image-artifact-path-contract-check.js +0 -1
- package/dist/scripts/imagegen-real-smoke-check.js +0 -1
- package/dist/scripts/import-graph-budget-check.js +0 -1
- package/dist/scripts/installed-package-smoke-check.js +0 -1
- package/dist/scripts/legacy-gate-purge-check.js +0 -1
- package/dist/scripts/lib/codex-sdk-gate-lib.js +0 -3
- package/dist/scripts/lib/ensure-dist-fresh.js +0 -1
- package/dist/scripts/lib/valid-png-fixture.js +0 -1
- package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +0 -1
- package/dist/scripts/loop-directive-check-lib.js +0 -1
- package/dist/scripts/loop-worker-fixture-child.js +0 -1
- package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -10
- package/dist/scripts/mad-sks-sql-plane-lifecycle-hook-decision-check.js +0 -1
- package/dist/scripts/mad-sks-sql-plane-result-lifecycle-check.js +0 -1
- package/dist/scripts/mcp-plugin-inventory-check.js +0 -1
- package/dist/scripts/mcp-tool-naming-parity-check.js +0 -1
- package/dist/scripts/model-call-concurrency-check.js +0 -1
- package/dist/scripts/mutation-callsite-coverage-check.js +0 -5
- package/dist/scripts/naruto-codex-e2e-check.js +0 -1
- package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -1
- package/dist/scripts/official-subagent-workflow-check.js +4 -2
- package/dist/scripts/ops-diagnostics-bundle-check.js +0 -1
- package/dist/scripts/packlist-performance-check.js +1 -3
- package/dist/scripts/perf-budget-check.js +0 -1
- package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -1
- package/dist/scripts/ppt-real-export-adapter-check.js +0 -1
- package/dist/scripts/ppt-real-imagegen-smoke-check.js +0 -1
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +0 -1
- package/dist/scripts/ppt-reexport-rereview-check.js +0 -1
- package/dist/scripts/prepublish-fast-check.js +0 -23
- package/dist/scripts/prepublish-release-check-or-fast.js +0 -7
- package/dist/scripts/probe-memoization-check.js +0 -1
- package/dist/scripts/product-design-plugin-routing-check.js +0 -1
- package/dist/scripts/project-skill-dedupe-blackbox.js +36 -9
- package/dist/scripts/prompt-placeholder-guard-check.js +0 -1
- package/dist/scripts/python-codex-sdk-all-pipelines-check.js +0 -3
- package/dist/scripts/qa-loop-app-handoff-capability-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-cli-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-confirmation-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-gate-lifecycle-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-launch-check.js +0 -1
- package/dist/scripts/qa-loop-app-handoff-status-lifecycle-check.js +0 -1
- package/dist/scripts/qa-loop-budget-policy-check.js +0 -1
- package/dist/scripts/qa-loop-effort-escalation-check.js +0 -1
- package/dist/scripts/qa-loop-image-path-exposure-check.js +0 -1
- package/dist/scripts/qa-loop-image-path-prompt-injection-check.js +0 -1
- package/dist/scripts/release-cache-glob-hashing-check.js +0 -1
- package/dist/scripts/release-cache-input-classifier-check.js +0 -1
- package/dist/scripts/release-cache-neutralization-report-check.js +0 -1
- package/dist/scripts/release-cache-version-neutral-fixture-check.js +0 -1
- package/dist/scripts/release-check-stamp.js +0 -4
- package/dist/scripts/release-dist-freshness-check.js +0 -1
- package/dist/scripts/release-full-parallelism-blackbox.js +3 -3
- package/dist/scripts/release-gate-batch-runner-check.js +22 -0
- package/dist/scripts/release-gate-budget-check.js +0 -6
- package/dist/scripts/release-gate-dag-runner-check.js +0 -1
- package/dist/scripts/release-latency-slo-check.js +0 -1
- package/dist/scripts/release-metadata-1-19-check.js +0 -2
- package/dist/scripts/release-metadata-check.js +0 -3
- package/dist/scripts/release-parallel-speed-budget-check.js +0 -5
- package/dist/scripts/release-proof-truth-check.js +0 -1
- package/dist/scripts/release-provenance-check.js +0 -1
- package/dist/scripts/release-real-check.js +0 -1
- package/dist/scripts/release-runtime-truth-matrix-check.js +0 -1
- package/dist/scripts/release-version-truth-check.js +0 -1
- package/dist/scripts/research-blueprint-densifier-check.js +0 -1
- package/dist/scripts/research-claim-builder-check.js +0 -1
- package/dist/scripts/research-complete-package-fixture-check.js +0 -1
- package/dist/scripts/research-final-reviewer-blackbox.js +0 -1
- package/dist/scripts/responses-retry-policy-centralized-check.js +0 -1
- package/dist/scripts/retention-apply-smoke-check.js +0 -1
- package/dist/scripts/retention-budget-check.js +0 -1
- package/dist/scripts/retention-dry-run-check.js +0 -1
- package/dist/scripts/rollback-recovery-smoke-check.js +0 -1
- package/dist/scripts/route-intent-regression-check.js +0 -1
- package/dist/scripts/runtime-current-terminal-check.js +0 -1
- package/dist/scripts/runtime-dist-parity-check.js +0 -1
- package/dist/scripts/runtime-no-src-mjs-check.js +0 -1
- package/dist/scripts/runtime-proof-summary-check.js +0 -1
- package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -15
- package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -1
- package/dist/scripts/scheduler-batch-dispatch-check.js +0 -1
- package/dist/scripts/scheduler-parallel-proof-consistency-check.js +0 -1
- package/dist/scripts/scheduler-utilization-integral-check.js +0 -1
- package/dist/scripts/search-visibility-gate-lib.js +0 -1
- package/dist/scripts/seo-audit-fixture-check.js +0 -1
- package/dist/scripts/seo-cli-blackbox-check.js +0 -1
- package/dist/scripts/seo-geo-geo-disambiguation-check.js +0 -1
- package/dist/scripts/seo-geo-route-identity-check.js +0 -1
- package/dist/scripts/seo-geo-skill-rich-content-check.js +0 -1
- package/dist/scripts/seo-marketing-truthfulness-check.js +0 -1
- package/dist/scripts/seo-metadata-sync-check.js +0 -1
- package/dist/scripts/seo-no-mutation-by-default-check.js +0 -1
- package/dist/scripts/shared-memory-fixture-check.js +0 -1
- package/dist/scripts/side-effect-runtime-report-check.js +0 -1
- package/dist/scripts/sizecheck.js +2 -3
- package/dist/scripts/sks-1-11-gate-lib.js +0 -1
- package/dist/scripts/sks-1-12-real-execution-check-lib.js +0 -1
- package/dist/scripts/sks-1-18-gate-lib.js +0 -1
- package/dist/scripts/sks-menubar-install-check.js +0 -3
- package/dist/scripts/sksd-daemon-check.js +0 -1
- package/dist/scripts/super-search-live-smoke-check.js +0 -1
- package/dist/scripts/super-search-local-http-smoke-check.js +0 -1
- package/dist/scripts/super-search-offline-contract-check.js +0 -1
- package/dist/scripts/super-search-provider-interface-check.js +0 -1
- package/dist/scripts/triwiki-cache-key-check.js +0 -1
- package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -1
- package/dist/scripts/triwiki-proof-bank-check.js +0 -1
- package/dist/scripts/triwiki-proof-card-check.js +0 -1
- package/dist/scripts/trust-fixture-check.js +0 -1
- package/dist/scripts/ultra-router-auto-router-check.js +0 -1
- package/dist/scripts/update-fastpath-check.js +0 -1
- package/dist/scripts/upgrade-migration-matrix-check.js +0 -1
- package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +0 -1
- package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -1
- package/dist/scripts/ux-review-patch-diff-recheck-check.js +0 -1
- package/dist/scripts/ux-review-real-imagegen-smoke-check.js +0 -1
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +0 -1
- package/dist/scripts/write-build-manifest.js +0 -1
- package/dist/scripts/wrongness-fixture-check.js +0 -1
- package/dist/scripts/zellij-capability-check.js +0 -1
- package/dist/scripts/zellij-developer-controls-check.js +0 -1
- package/dist/scripts/zellij-doctor-readiness-check.js +0 -13
- package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -1
- package/dist/scripts/zellij-fake-adapter-check.js +0 -1
- package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -1
- package/dist/scripts/zellij-lane-renderer-check.js +0 -1
- package/dist/scripts/zellij-launch-command-truth-check.js +0 -12
- package/dist/scripts/zellij-layout-valid-check.js +0 -1
- package/dist/scripts/zellij-pane-creation-lock-metrics-check.js +0 -1
- package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -1
- package/dist/scripts/zellij-pane-lock-does-not-block-worker-check.js +0 -1
- package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -1
- package/dist/scripts/zellij-pane-proof-check.js +0 -1
- package/dist/scripts/zellij-qa-app-handoff-status-check.js +0 -1
- package/dist/scripts/zellij-real-session-cleanup-check.js +0 -1
- package/dist/scripts/zellij-real-session-launch-check.js +0 -1
- package/dist/scripts/zellij-right-column-geometry-proof.js +0 -1
- package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -1
- package/dist/scripts/zellij-right-column-manager-check.js +0 -1
- package/dist/scripts/zellij-screen-proof-check.js +0 -1
- package/dist/scripts/zellij-slot-only-ui-check.js +0 -1
- package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -1
- package/dist/scripts/zellij-slot-pane-stale-detection-check.js +0 -7
- package/dist/scripts/zellij-slot-telemetry-incremental-check.js +0 -1
- package/dist/scripts/zellij-slot-telemetry-live-flush-check.js +0 -1
- package/dist/scripts/zellij-slot-telemetry-performance-check.js +0 -1
- package/dist/scripts/zellij-stacked-capability-routing-check.js +0 -1
- package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -1
- package/dist/scripts/zellij-stacked-version-matrix-check.js +0 -1
- package/dist/scripts/zellij-stacked-version-parser-check.js +0 -1
- package/dist/scripts/zellij-ui-design-check.js +0 -12
- package/dist/scripts/zellij-update-prompt-matrix-check.js +0 -1
- package/dist/scripts/zellij-update-prompt-mode-check.js +0 -1
- package/dist/scripts/zellij-update-prompt-safety-check.js +0 -1
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -2
- package/package.json +6 -7
- package/release-gates.v2.json +426 -93
- package/schemas/codex/app-server-0.145/codex_app_server_protocol.v2.schemas.json +19611 -0
- package/dist/core/commands/glm-command.js +0 -93
- package/dist/core/providers/glm/bench/glm-bench-comparison.js +0 -47
- package/dist/core/providers/glm/bench/glm-bench-fixture.js +0 -64
- package/dist/core/providers/glm/bench/glm-bench-model-lock-proof.js +0 -52
- package/dist/core/providers/glm/bench/glm-bench-report.js +0 -74
- package/dist/core/providers/glm/bench/glm-benchmark-runner.js +0 -243
- package/dist/core/providers/glm/bench/glm-benchmark-types.js +0 -1
- package/dist/core/providers/glm/bench/glm-direct-bench-runner.js +0 -72
- package/dist/core/providers/glm/glm-52-profile.js +0 -82
- package/dist/core/providers/glm/glm-52-request.js +0 -73
- package/dist/core/providers/glm/glm-52-response-guard.js +0 -32
- package/dist/core/providers/glm/glm-52-settings.js +0 -67
- package/dist/core/providers/glm/glm-context-budget.js +0 -14
- package/dist/core/providers/glm/glm-context-cache.js +0 -8
- package/dist/core/providers/glm/glm-direct-run.js +0 -140
- package/dist/core/providers/glm/glm-interactive-launch.js +0 -4
- package/dist/core/providers/glm/glm-latency-trace.js +0 -39
- package/dist/core/providers/glm/glm-loop-guard.js +0 -30
- package/dist/core/providers/glm/glm-mad-launch.js +0 -128
- package/dist/core/providers/glm/glm-mad-mode.js +0 -269
- package/dist/core/providers/glm/glm-model-meta-cache.js +0 -18
- package/dist/core/providers/glm/glm-patch-apply.js +0 -72
- package/dist/core/providers/glm/glm-patch-parser.js +0 -18
- package/dist/core/providers/glm/glm-profile-resolver.js +0 -168
- package/dist/core/providers/glm/glm-readiness.js +0 -4
- package/dist/core/providers/glm/glm-reasoning-policy.js +0 -14
- package/dist/core/providers/glm/glm-run-controller.js +0 -65
- package/dist/core/providers/glm/glm-run-state.js +0 -10
- package/dist/core/providers/glm/glm-run-timeout.js +0 -30
- package/dist/core/providers/glm/glm-speed-context.js +0 -81
- package/dist/core/providers/glm/glm-speed-gate.js +0 -39
- package/dist/core/providers/glm/glm-speed-output-parser.js +0 -39
- package/dist/core/providers/glm/glm-tool-schema-cache.js +0 -18
- package/dist/core/providers/glm/naruto/glm-naruto-apply-transaction.js +0 -135
- package/dist/core/providers/glm/naruto/glm-naruto-artifacts.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-bench.js +0 -6
- package/dist/core/providers/glm/naruto/glm-naruto-budget.js +0 -44
- package/dist/core/providers/glm/naruto/glm-naruto-combined-patch.js +0 -48
- package/dist/core/providers/glm/naruto/glm-naruto-command.js +0 -101
- package/dist/core/providers/glm/naruto/glm-naruto-concurrency-governor.js +0 -37
- package/dist/core/providers/glm/naruto/glm-naruto-conflict-graph.js +0 -79
- package/dist/core/providers/glm/naruto/glm-naruto-critical-path.js +0 -50
- package/dist/core/providers/glm/naruto/glm-naruto-decomposer.js +0 -148
- package/dist/core/providers/glm/naruto/glm-naruto-file-lease.js +0 -22
- package/dist/core/providers/glm/naruto/glm-naruto-final-seal.js +0 -81
- package/dist/core/providers/glm/naruto/glm-naruto-finalizer.js +0 -22
- package/dist/core/providers/glm/naruto/glm-naruto-hunk-conflict.js +0 -15
- package/dist/core/providers/glm/naruto/glm-naruto-hunk-parser.js +0 -35
- package/dist/core/providers/glm/naruto/glm-naruto-isolation-policy.js +0 -37
- package/dist/core/providers/glm/naruto/glm-naruto-judge.js +0 -83
- package/dist/core/providers/glm/naruto/glm-naruto-merge-planner.js +0 -61
- package/dist/core/providers/glm/naruto/glm-naruto-metrics.js +0 -33
- package/dist/core/providers/glm/naruto/glm-naruto-orchestrator.js +0 -486
- package/dist/core/providers/glm/naruto/glm-naruto-parallelism-summary.js +0 -54
- package/dist/core/providers/glm/naruto/glm-naruto-patch-candidate-gate.js +0 -41
- package/dist/core/providers/glm/naruto/glm-naruto-patch-candidate-parser.js +0 -61
- package/dist/core/providers/glm/naruto/glm-naruto-patch-envelope.js +0 -54
- package/dist/core/providers/glm/naruto/glm-naruto-quorum.js +0 -36
- package/dist/core/providers/glm/naruto/glm-naruto-rate-limiter.js +0 -17
- package/dist/core/providers/glm/naruto/glm-naruto-repair-wave.js +0 -20
- package/dist/core/providers/glm/naruto/glm-naruto-requirement-coverage.js +0 -108
- package/dist/core/providers/glm/naruto/glm-naruto-requirement-ledger.js +0 -57
- package/dist/core/providers/glm/naruto/glm-naruto-scoreboard.js +0 -74
- package/dist/core/providers/glm/naruto/glm-naruto-secret-audit.js +0 -90
- package/dist/core/providers/glm/naruto/glm-naruto-session-id.js +0 -9
- package/dist/core/providers/glm/naruto/glm-naruto-shard-planner.js +0 -31
- package/dist/core/providers/glm/naruto/glm-naruto-stage-scheduler.js +0 -84
- package/dist/core/providers/glm/naruto/glm-naruto-targeted-checks.js +0 -75
- package/dist/core/providers/glm/naruto/glm-naruto-task-size-classifier.js +0 -11
- package/dist/core/providers/glm/naruto/glm-naruto-terminal.js +0 -43
- package/dist/core/providers/glm/naruto/glm-naruto-trace.js +0 -173
- package/dist/core/providers/glm/naruto/glm-naruto-types.js +0 -36
- package/dist/core/providers/glm/naruto/glm-naruto-usage-extractor.js +0 -30
- package/dist/core/providers/glm/naruto/glm-naruto-verifier-output.js +0 -30
- package/dist/core/providers/glm/naruto/glm-naruto-work-graph.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worker-artifacts.js +0 -55
- package/dist/core/providers/glm/naruto/glm-naruto-worker-pool.js +0 -275
- package/dist/core/providers/glm/naruto/glm-naruto-worker-runtime.js +0 -421
- package/dist/core/providers/glm/naruto/glm-naruto-worker-scheduler.js +0 -177
- package/dist/core/providers/glm/naruto/glm-naruto-worker.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worktree-cleanup.js +0 -19
- package/dist/core/providers/glm/naruto/glm-naruto-worktree-manager.js +0 -71
- package/dist/core/providers/glm/naruto/glm-naruto-worktree-worker.js +0 -73
- package/dist/core/providers/glm/naruto/glm-naruto-worktree.js +0 -62
- package/schemas/codex/app-server-0.144/codex_app_server_protocol.v2.schemas.json +0 -1
|
@@ -18,8 +18,7 @@ import { recordCodexLbHealthEvent } from '../core/codex-lb-circuit.js';
|
|
|
18
18
|
import { loadCodexLbEnv, writeCodexLbKeychain, codexLbMetadataPath } from '../core/codex-lb/codex-lb-env.js';
|
|
19
19
|
import { codexLbToolCatalogPath, ensureCodexLbToolCatalog } from '../core/codex-lb/codex-lb-tool-catalog.js';
|
|
20
20
|
import { codexLbToolOutputRecoveryNotChecked, codexLbToolOutputRecoveryNotSelected, codexLbToolOutputRecoveryOverrideAcknowledged, probeCodexLbToolOutputRecovery } from '../core/codex-lb/codex-lb-tool-output-recovery.js';
|
|
21
|
-
import { GLM_CODEX_CONFIG_PROFILE_ID, GLM_CODEX_CONFIG_PROVIDER_ID, GLM_CODEX_CONFIG_REASONING_PROFILES } from '../core/
|
|
22
|
-
import { GLM_52_OPENROUTER_MODEL } from '../core/providers/glm/glm-52-settings.js';
|
|
21
|
+
import { GLM_CODEX_CONFIG_PROFILE_ID, GLM_CODEX_CONFIG_PROVIDER_ID, GLM_CODEX_CONFIG_REASONING_PROFILES, GLM_52_OPENROUTER_MODEL } from '../core/codex-app/openrouter-provider.js';
|
|
23
22
|
import { buildCodexLbSetupPlan, codexLbPersistenceSummary, installCodexLbShellProfileSnippet, selectedCodexLbPersistenceModes } from '../core/codex-lb/codex-lb-setup.js';
|
|
24
23
|
import { extractTomlTable, writeCodexConfigGuarded } from '../core/codex/codex-config-guard.js';
|
|
25
24
|
import { ensureGlobalCodexFastModeDuringInstall, ensureTrailingNewline, normalizeCodexFastModeUiConfig, removeTopLevelTomlKeyIfValue, safeWriteCodexConfigToml, upsertTopLevelTomlString, upsertTomlTable } from '../core/codex-runtime/codex-desktop-config-policy.js';
|
|
@@ -41,17 +40,8 @@ export async function postinstall({ bootstrap, args = [] }) {
|
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
42
|
const codexLbConfigSnapshot = await capturePostinstallCodexLbConfigSnapshot();
|
|
44
|
-
// A failed setup side-effect must never fail `npm i`. Wrap the whole flow; always
|
|
45
|
-
// restore the codex-lb snapshot in finally (even on the early bootstrap return / on throw).
|
|
46
43
|
try {
|
|
47
44
|
console.log('\nSKS installed.');
|
|
48
|
-
// The published tarball deliberately excludes dist/.sks-build-stamp.json
|
|
49
|
-
// (package.json files: "!dist/.sks-build-stamp.json"), but `sks update`
|
|
50
|
-
// self-verification requires a version-matching stamp inside the installed
|
|
51
|
-
// package. Regenerate it here so npm installs are verifiable; never
|
|
52
|
-
// overwrite an existing stamp (in a dev checkout the build writes the real
|
|
53
|
-
// one, and re-stamping against the current source tree would mask a stale
|
|
54
|
-
// dist).
|
|
55
45
|
try {
|
|
56
46
|
const stampLib = await import('../scripts/lib/ensure-dist-fresh.js');
|
|
57
47
|
await fsp.access(stampLib.distStampPath).catch(async () => {
|
|
@@ -124,7 +114,6 @@ export async function postinstall({ bootstrap, args = [] }) {
|
|
|
124
114
|
console.log(`SKS mission cleanup: removed ${postinstallRetention.action_count} disposable runtime artifact(s) from closed missions.`);
|
|
125
115
|
else if (postinstallRetention.status === 'failed')
|
|
126
116
|
console.log(`SKS mission cleanup: skipped (${postinstallRetention.error || 'cleanup failed'}).`);
|
|
127
|
-
// Terminating a third-party app's processes during `npm i` is unsafe by default; opt-in only.
|
|
128
117
|
const appProcessRepair = process.env.SKS_POSTINSTALL_RECONCILE_APP_PROCESSES === '1'
|
|
129
118
|
? await reconcileCodexAppUpgradeProcesses()
|
|
130
119
|
: { status: 'skipped', reason: 'opt_in_required', killed: [] };
|
|
@@ -179,7 +168,7 @@ export async function postinstall({ bootstrap, args = [] }) {
|
|
|
179
168
|
}
|
|
180
169
|
finally {
|
|
181
170
|
await restorePostinstallCodexLbConfigSnapshot(codexLbConfigSnapshot).catch(() => { });
|
|
182
|
-
await reportPostinstallCodexLbAuth().catch(() => { });
|
|
171
|
+
await reportPostinstallCodexLbAuth(codexLbConfigSnapshot).catch(() => { });
|
|
183
172
|
}
|
|
184
173
|
}
|
|
185
174
|
async function runPostinstallProjectRetentionCleanup(root) {
|
|
@@ -212,8 +201,13 @@ async function runPostinstallProjectRetentionCleanup(root) {
|
|
|
212
201
|
};
|
|
213
202
|
}
|
|
214
203
|
}
|
|
215
|
-
async function reportPostinstallCodexLbAuth() {
|
|
216
|
-
const
|
|
204
|
+
async function reportPostinstallCodexLbAuth(snapshot = null) {
|
|
205
|
+
const preserveActiveCodexLb = snapshot?.selected === true && snapshot?.codex_lb_key_in_shared_auth === true;
|
|
206
|
+
const codexLbAuth = await ensureCodexLbAuthDuringInstall({
|
|
207
|
+
forceCodexLbApiKeyAuth: preserveActiveCodexLb,
|
|
208
|
+
...(snapshot?.secret_api_key ? { apiKey: snapshot.secret_api_key } : {}),
|
|
209
|
+
...(snapshot?.base_url ? { baseUrl: snapshot.base_url } : {})
|
|
210
|
+
});
|
|
217
211
|
if (codexLbAuth.legacy_auth_migrated)
|
|
218
212
|
console.log(`codex-lb auth: restored from existing Codex login cache into ${codexLbAuth.env_path}.`);
|
|
219
213
|
else if (codexLbAuth.status === 'synced' || codexLbAuth.status === 'present' || codexLbAuth.status === 'repaired')
|
|
@@ -235,7 +229,7 @@ async function reportPostinstallCodexLbAuth() {
|
|
|
235
229
|
console.log(`codex-lb auth: ChatGPT OAuth preserved as backup; run \`sks codex-lb use-codex-lb\` to switch the App to codex-lb API-key auth (backup at ${reconcile.backup_path ?? 'unknown'}).`);
|
|
236
230
|
}
|
|
237
231
|
else if (reconcile?.status === 'oauth_restored') {
|
|
238
|
-
console.log(`codex-lb auth: restored ChatGPT OAuth from ${reconcile.backup_path ?? 'unknown'}
|
|
232
|
+
console.log(`codex-lb auth: restored ChatGPT OAuth from ${reconcile.backup_path ?? 'unknown'} and cleared codex-lb provider selection.`);
|
|
239
233
|
}
|
|
240
234
|
else if (reconcile?.status === 'apikey_forced') {
|
|
241
235
|
console.log(`codex-lb auth: forced API-key auth.json for CLI-only use (OAuth backup at ${reconcile.backup_path ?? 'unknown'}).`);
|
|
@@ -264,7 +258,7 @@ async function reportPostinstallCodexLbAuth() {
|
|
|
264
258
|
async function postinstallHarnessConflictNotice(conflictScan) {
|
|
265
259
|
console.log('\nSneakoscope Codex package installed, but SKS setup is blocked.');
|
|
266
260
|
console.log(formatHarnessConflictReport(conflictScan, { includePrompt: false }));
|
|
267
|
-
console.log('\nWhat this means: npm can finish installing the package
|
|
261
|
+
console.log('\nWhat this means: npm can finish installing the package. Conflicting OMX/DCodex markers are quarantined automatically by `sks setup`, `sks doctor --fix`, `sks update`, or `sks conflicts cleanup --yes`.');
|
|
268
262
|
console.log('No files were removed by postinstall.');
|
|
269
263
|
console.log('Cleanup requires a human-approved Codex App session. Keep the model selected in Codex and use high reasoning effort.');
|
|
270
264
|
if (shouldAskPostinstallQuestion()) {
|
|
@@ -297,9 +291,6 @@ export async function postinstallBootstrapDecision(root) {
|
|
|
297
291
|
const target = candidate ? installRoot : globalSksRoot();
|
|
298
292
|
if (process.env.SKS_POSTINSTALL_BOOTSTRAP === '1')
|
|
299
293
|
return { run: true, target, reason: 'forced by SKS_POSTINSTALL_BOOTSTRAP=1' };
|
|
300
|
-
// A global `npm i -g sneakoscope` must NOT initialize whatever project the user's shell
|
|
301
|
-
// happened to be in (that would scribble AGENTS.md/.codex/.agents into an unrelated repo).
|
|
302
|
-
// Only bootstrap the global runtime root; the user runs `sks setup` inside a project explicitly.
|
|
303
294
|
if (process.env.npm_config_global === 'true' && candidate) {
|
|
304
295
|
return { run: true, target: globalSksRoot(), reason: 'global install: bootstrapping global SKS runtime only (run `sks setup` inside a project to initialize it)' };
|
|
305
296
|
}
|
|
@@ -328,10 +319,10 @@ async function capturePostinstallCodexLbConfigSnapshot(home = process.env.HOME |
|
|
|
328
319
|
const envText = await readText(envPath, '');
|
|
329
320
|
const authExisted = await exists(authPath);
|
|
330
321
|
const authText = authExisted ? await readText(authPath, '') : '';
|
|
331
|
-
const
|
|
322
|
+
const envLoad = await loadCodexLbEnv({ home, envPath });
|
|
323
|
+
const envKey = envLoad.secret_api_key || '';
|
|
332
324
|
const providerConfigured = /\[model_providers\.codex-lb\]/.test(config);
|
|
333
|
-
const baseUrl = codexLbProviderBaseUrl(config) || parseCodexLbEnvBaseUrl(envText);
|
|
334
|
-
// Snapshot any codex-lb-related state so the upgrade-time bootstrap can't silently undo it.
|
|
325
|
+
const baseUrl = envLoad.base_url || codexLbProviderBaseUrl(config) || parseCodexLbEnvBaseUrl(envText);
|
|
335
326
|
if (!envKey && !providerConfigured && !authExisted)
|
|
336
327
|
return null;
|
|
337
328
|
return {
|
|
@@ -340,6 +331,12 @@ async function capturePostinstallCodexLbConfigSnapshot(home = process.env.HOME |
|
|
|
340
331
|
auth_path: authPath,
|
|
341
332
|
base_url: baseUrl ? normalizeCodexLbBaseUrl(baseUrl) : null,
|
|
342
333
|
selected: hasTopLevelCodexLbSelected(config),
|
|
334
|
+
auth_mode: codexAuthModeSummary(authText).mode,
|
|
335
|
+
codex_lb_key_in_shared_auth: Boolean(envKey && parseCodexAuthApiKey(authText) === envKey),
|
|
336
|
+
credential_source: envLoad.source,
|
|
337
|
+
credential_fingerprint: envLoad.api_key.fingerprint,
|
|
338
|
+
credential_binding: envLoad.credential_binding,
|
|
339
|
+
secret_api_key: envKey || null,
|
|
343
340
|
auth_existed: authExisted,
|
|
344
341
|
auth_text: authText
|
|
345
342
|
};
|
|
@@ -357,13 +354,15 @@ async function restorePostinstallCodexLbConfigSnapshot(snapshot) {
|
|
|
357
354
|
configRestored = safeWrite.ok && safeWrite.changed === true;
|
|
358
355
|
}
|
|
359
356
|
}
|
|
360
|
-
// Restore auth.json only if bootstrap accidentally wiped or emptied a pre-existing auth.json.
|
|
361
|
-
// We do NOT clobber a legitimately rewritten auth.json; we just heal the disappearing-auth regression.
|
|
362
357
|
let authRestored = false;
|
|
363
358
|
if (snapshot.auth_existed && snapshot.auth_text && snapshot.auth_text.trim()) {
|
|
364
359
|
const currentAuthExists = await exists(snapshot.auth_path);
|
|
365
360
|
const currentAuthText = currentAuthExists ? await readText(snapshot.auth_path, '') : '';
|
|
366
|
-
|
|
361
|
+
const activeCodexLbAuthChanged = snapshot.selected === true
|
|
362
|
+
&& snapshot.codex_lb_key_in_shared_auth === true
|
|
363
|
+
&& snapshot.secret_api_key
|
|
364
|
+
&& parseCodexAuthApiKey(currentAuthText) !== snapshot.secret_api_key;
|
|
365
|
+
if (!currentAuthExists || !currentAuthText.trim() || activeCodexLbAuthChanged) {
|
|
367
366
|
await ensureDir(path.dirname(snapshot.auth_path));
|
|
368
367
|
await writeTextAtomic(snapshot.auth_path, snapshot.auth_text, { mode: 0o600 });
|
|
369
368
|
await fsp.chmod(snapshot.auth_path, 0o600).catch(() => { });
|
|
@@ -383,8 +382,6 @@ async function ensureCodexLbToolCatalogSelection(input, opts = {}) {
|
|
|
383
382
|
const catalogPath = codexLbToolCatalogPath(codexHome);
|
|
384
383
|
const current = await readText(input.configPath, '');
|
|
385
384
|
const selected = hasTopLevelCodexLbSelected(current);
|
|
386
|
-
// Setup writes the catalog pointer before selecting the provider so Desktop can
|
|
387
|
-
// load GPT-5.6/tool metadata the moment model_provider becomes codex-lb.
|
|
388
385
|
const canBindCatalog = selected || opts.allowUnselectedCatalogWrite === true;
|
|
389
386
|
const existingCatalogPath = topLevelTomlString(current, 'model_catalog_json');
|
|
390
387
|
if (canBindCatalog && existingCatalogPath && path.resolve(existingCatalogPath) !== path.resolve(catalogPath)) {
|
|
@@ -514,9 +511,6 @@ export async function configureCodexLb(opts = {}) {
|
|
|
514
511
|
const beforeState = await captureCodexLbSetupWriteState({ home, configPath, envPath, shellProfile });
|
|
515
512
|
const appliedActions = [];
|
|
516
513
|
await ensureDir(path.dirname(configPath));
|
|
517
|
-
// Write the provider table first without selecting it. Desktop model/tool UI
|
|
518
|
-
// exposure depends on a validated catalog; selecting before that leaves the App
|
|
519
|
-
// on codex-lb with no GPT-5.6 picker surface.
|
|
520
514
|
const current = await readText(configPath, '');
|
|
521
515
|
const providerOnly = normalizeCodexFastModeUiConfig(upsertCodexLbConfig(current, baseUrl, false), {
|
|
522
516
|
forceFastMode: opts.forceFastMode !== false
|
|
@@ -559,7 +553,6 @@ export async function configureCodexLb(opts = {}) {
|
|
|
559
553
|
}
|
|
560
554
|
providerSelected = true;
|
|
561
555
|
appliedActions.push({ type: 'select_default_provider', target: configPath, ok: true, backup_path: selectWrite.backup_path });
|
|
562
|
-
// Re-bind after selection so model_catalog_json stays attached to the active provider.
|
|
563
556
|
toolCatalog = await ensureCodexLbToolCatalogSelection({ home, configPath, baseUrl, apiKey }, opts);
|
|
564
557
|
if (toolCatalog.config_changed) {
|
|
565
558
|
appliedActions.push({ type: 'write_model_tool_catalog', target: toolCatalog.path, ok: toolCatalog.ok === true, status: toolCatalog.status });
|
|
@@ -595,8 +588,6 @@ export async function configureCodexLb(opts = {}) {
|
|
|
595
588
|
if (shellProfile !== 'skip')
|
|
596
589
|
appliedActions.push({ type: 'install_shell_profile_snippet', target: shellProfileResult.files?.join(', ') || shellProfile, ok: shellProfileResult.ok === true, status: shellProfileResult.status });
|
|
597
590
|
const codexLb = await codexLbStatus({ ...opts, home, configPath, envPath });
|
|
598
|
-
// Never activate shared sk-clb auth while the Desktop picker is still missing a
|
|
599
|
-
// ready catalog/selection — that leaves App threads calling api.openai.com.
|
|
600
591
|
const wantForceCodexLbApiKeyAuth = opts.forceCodexLbApiKeyAuth === true || opts.authMode === 'codex-lb';
|
|
601
592
|
const forceCodexLbApiKeyAuth = wantForceCodexLbApiKeyAuth && providerSelected;
|
|
602
593
|
const authReconcile = providerSelected
|
|
@@ -688,10 +679,13 @@ export async function codexLbStatus(opts = {}) {
|
|
|
688
679
|
const authText = await readText(authPath, '');
|
|
689
680
|
const authMode = codexAuthModeSummary(authText);
|
|
690
681
|
const authApiKey = parseCodexAuthApiKey(authText);
|
|
691
|
-
const envKeyConfigured = Boolean(envLoad.
|
|
682
|
+
const envKeyConfigured = Boolean(envLoad.secret_api_key);
|
|
692
683
|
const providerConfigured = /\[model_providers\.codex-lb\]/.test(config);
|
|
693
684
|
const selected = hasTopLevelCodexLbSelected(config);
|
|
694
|
-
const
|
|
685
|
+
const providerBaseUrl = normalizeCodexLbBaseUrl(codexLbProviderBaseUrl(config));
|
|
686
|
+
const credentialBaseUrl = envLoad.base_url;
|
|
687
|
+
const baseUrl = credentialBaseUrl || providerBaseUrl || null;
|
|
688
|
+
const providerBaseUrlMatchesCredential = Boolean(providerBaseUrl && credentialBaseUrl && providerBaseUrl === credentialBaseUrl);
|
|
695
689
|
const providerName = codexLbProviderName(config);
|
|
696
690
|
const providerWireApi = codexLbProviderWireApi(config);
|
|
697
691
|
const providerSupportsWebsockets = codexLbProviderSupportsWebsockets(config);
|
|
@@ -703,13 +697,14 @@ export async function codexLbStatus(opts = {}) {
|
|
|
703
697
|
const sharedOpenAiRoutingSafe = !codexLbKeyInSharedAuth || sharedOpenAiRouting.status === 'matched';
|
|
704
698
|
const authRoutingCoherent = selected === codexLbKeyInSharedAuth && sharedOpenAiRoutingSafe;
|
|
705
699
|
const providerContractOk = providerConfigured
|
|
700
|
+
&& providerBaseUrlMatchesCredential
|
|
706
701
|
&& providerName === CODEX_LB_PROVIDER_NAME
|
|
707
702
|
&& providerWireApi === 'responses'
|
|
708
703
|
&& providerEnvKey === CODEX_LB_PROVIDER_ENV_KEY
|
|
709
704
|
&& providerSupportsWebsockets === true
|
|
710
705
|
&& providerRequiresOpenAiAuth === true;
|
|
711
706
|
const providerUsesCodexLbEnvAuth = providerConfigured && providerEnvKey === CODEX_LB_PROVIDER_ENV_KEY && providerOpenAiAuthDisabled;
|
|
712
|
-
const codexAppUsableWithCodexLb = providerContractOk &&
|
|
707
|
+
const codexAppUsableWithCodexLb = providerContractOk && envLoad.configured && Boolean(baseUrl) && authMode.codex_app_usable;
|
|
713
708
|
const fastMode = codexLbFastModeConfigStatus(config);
|
|
714
709
|
const launchEnvironment = await inspectCodexLbMacLaunchEnvironment(baseUrl, opts).catch((err) => ({
|
|
715
710
|
checked: true,
|
|
@@ -717,11 +712,11 @@ export async function codexLbStatus(opts = {}) {
|
|
|
717
712
|
status: 'inspect_failed',
|
|
718
713
|
error: err.message
|
|
719
714
|
}));
|
|
720
|
-
const providerReady = providerContractOk &&
|
|
715
|
+
const providerReady = providerContractOk && envLoad.configured && Boolean(baseUrl) && authMode.codex_app_usable && authRoutingCoherent;
|
|
721
716
|
const probeToolOutputRecovery = opts.probeToolOutputRecovery === true;
|
|
722
717
|
const toolOutputRecovery = !selected
|
|
723
718
|
? codexLbToolOutputRecoveryNotSelected()
|
|
724
|
-
: !probeToolOutputRecovery
|
|
719
|
+
: !probeToolOutputRecovery || !providerContractOk || !envLoad.configured
|
|
725
720
|
? codexLbToolOutputRecoveryNotChecked(true)
|
|
726
721
|
: await probeCodexLbToolOutputRecovery({
|
|
727
722
|
baseUrl,
|
|
@@ -736,6 +731,9 @@ export async function codexLbStatus(opts = {}) {
|
|
|
736
731
|
config_path: configPath,
|
|
737
732
|
env_path: envPath,
|
|
738
733
|
provider_configured: providerConfigured,
|
|
734
|
+
provider_base_url: providerBaseUrl || null,
|
|
735
|
+
credential_base_url: credentialBaseUrl || null,
|
|
736
|
+
provider_base_url_matches_credential: providerBaseUrlMatchesCredential,
|
|
739
737
|
provider_name: providerName || null,
|
|
740
738
|
provider_wire_api: providerWireApi || null,
|
|
741
739
|
provider_supports_websockets: providerSupportsWebsockets,
|
|
@@ -754,6 +752,7 @@ export async function codexLbStatus(opts = {}) {
|
|
|
754
752
|
source: envLoad.source,
|
|
755
753
|
source_priority: envLoad.source_priority,
|
|
756
754
|
api_key: envLoad.api_key,
|
|
755
|
+
credential_binding: envLoad.credential_binding,
|
|
757
756
|
keychain: envLoad.keychain,
|
|
758
757
|
env_paths: envLoad.env_paths
|
|
759
758
|
},
|
|
@@ -965,7 +964,12 @@ export async function repairCodexLbAuth(opts = {}) {
|
|
|
965
964
|
}
|
|
966
965
|
await migrateCodexAuthKeyFormat({ home: opts.home });
|
|
967
966
|
const codexEnvironment = await syncCodexLbProviderEnvironment(status, opts);
|
|
968
|
-
const
|
|
967
|
+
const loadedEnv = await loadCodexLbEnv({
|
|
968
|
+
...opts,
|
|
969
|
+
home: opts.home || process.env.HOME || os.homedir(),
|
|
970
|
+
envPath: status.env_path
|
|
971
|
+
});
|
|
972
|
+
const apiKey = String(opts.apiKey || loadedEnv.secret_api_key || '').trim();
|
|
969
973
|
const toolCatalog = await ensureCodexLbToolCatalogSelection({
|
|
970
974
|
home: opts.home || process.env.HOME || os.homedir(),
|
|
971
975
|
configPath: status.config_path,
|
|
@@ -978,10 +982,17 @@ export async function repairCodexLbAuth(opts = {}) {
|
|
|
978
982
|
? { ok: ['apikey_forced', 'apikey_auth_active'].includes(authReconcile.status), status: authReconcile.status, ...(authReconcile.reason ? { reason: authReconcile.reason } : {}), error: authReconcile.error || null }
|
|
979
983
|
: await maybeSyncCodexLbSharedLogin(apiKey, { ...opts, home: opts.home || process.env.HOME || os.homedir(), force: true });
|
|
980
984
|
const finalStatus = await codexLbStatus({ ...opts, probeToolOutputRecovery: true });
|
|
981
|
-
const
|
|
985
|
+
const finalReady = finalStatus.selected === true
|
|
986
|
+
&& finalStatus.provider_ready === true
|
|
987
|
+
&& finalStatus.auth_routing_coherent === true
|
|
988
|
+
&& finalStatus.shared_openai_routing?.safe === true;
|
|
989
|
+
const baseOk = Boolean(codexEnvironment.ok
|
|
990
|
+
&& codexLogin.ok
|
|
991
|
+
&& (toolCatalog.required === false || toolCatalog.ok === true));
|
|
992
|
+
const ok = baseOk && finalReady;
|
|
982
993
|
return {
|
|
983
994
|
ok,
|
|
984
|
-
status: ok ? 'repaired' : (codexEnvironment.status || codexLogin.status),
|
|
995
|
+
status: ok ? 'repaired' : baseOk ? 'final_readiness_failed' : (codexEnvironment.status || codexLogin.status),
|
|
985
996
|
config_path: status.config_path,
|
|
986
997
|
env_path: status.env_path,
|
|
987
998
|
base_url: status.base_url,
|
|
@@ -999,7 +1010,7 @@ export async function ensureCodexLbAuthDuringInstall(opts = {}) {
|
|
|
999
1010
|
if (process.env.SKS_SKIP_POSTINSTALL_CODEX_LB_AUTH === '1' && !opts.force)
|
|
1000
1011
|
return { status: 'skipped', reason: 'SKS_SKIP_POSTINSTALL_CODEX_LB_AUTH=1' };
|
|
1001
1012
|
const status = await codexLbStatus(opts);
|
|
1002
|
-
if (!status.selected && !status.provider_configured && !status.
|
|
1013
|
+
if (!status.selected && !status.provider_configured && !status.env_key_configured)
|
|
1003
1014
|
return { status: 'not_configured', codex_lb: status };
|
|
1004
1015
|
if (status.ok && !status.selected && status.auth_mode === 'chatgpt_oauth') {
|
|
1005
1016
|
return {
|
|
@@ -1021,7 +1032,12 @@ export async function ensureCodexLbAuthDuringInstall(opts = {}) {
|
|
|
1021
1032
|
return { status: status.env_key_configured ? 'missing_base_url' : 'missing_env_key', codex_lb: status, config_path: status.config_path, env_path: status.env_path };
|
|
1022
1033
|
}
|
|
1023
1034
|
const codexEnvironment = await syncCodexLbProviderEnvironment(status, opts);
|
|
1024
|
-
const
|
|
1035
|
+
const loadedEnv = await loadCodexLbEnv({
|
|
1036
|
+
...opts,
|
|
1037
|
+
home: opts.home || process.env.HOME || os.homedir(),
|
|
1038
|
+
envPath: status.env_path
|
|
1039
|
+
});
|
|
1040
|
+
const apiKey = String(opts.apiKey || loadedEnv.secret_api_key || '').trim();
|
|
1025
1041
|
const toolCatalog = await ensureCodexLbToolCatalogSelection({
|
|
1026
1042
|
home: opts.home || process.env.HOME || os.homedir(),
|
|
1027
1043
|
configPath: status.config_path,
|
|
@@ -1031,10 +1047,17 @@ export async function ensureCodexLbAuthDuringInstall(opts = {}) {
|
|
|
1031
1047
|
const codexLogin = await maybeSyncCodexLbSharedLogin(apiKey, { ...opts, home: opts.home || process.env.HOME || os.homedir(), force: true });
|
|
1032
1048
|
const authReconcile = await reconcileCodexLbAuthConflict({ ...opts, status }).catch((err) => ({ status: 'failed', reason: 'exception', error: err.message }));
|
|
1033
1049
|
const finalStatus = await codexLbStatus(opts);
|
|
1034
|
-
const
|
|
1050
|
+
const finalReady = finalStatus.selected === true
|
|
1051
|
+
&& finalStatus.provider_ready === true
|
|
1052
|
+
&& finalStatus.auth_routing_coherent === true
|
|
1053
|
+
&& finalStatus.shared_openai_routing?.safe === true;
|
|
1054
|
+
const baseOk = Boolean(codexEnvironment.ok
|
|
1055
|
+
&& codexLogin.ok
|
|
1056
|
+
&& (toolCatalog.required === false || toolCatalog.ok === true));
|
|
1057
|
+
const ok = baseOk && finalReady;
|
|
1035
1058
|
return {
|
|
1036
1059
|
ok,
|
|
1037
|
-
status: ok ? 'present' : (codexEnvironment.status || codexLogin.status),
|
|
1060
|
+
status: ok ? 'present' : baseOk ? 'final_readiness_failed' : (codexEnvironment.status || codexLogin.status),
|
|
1038
1061
|
config_path: status.config_path,
|
|
1039
1062
|
env_path: status.env_path,
|
|
1040
1063
|
base_url: status.base_url,
|
|
@@ -1060,10 +1083,17 @@ async function restoreCodexLbEnvFromSharedLogin(status = {}, opts = {}) {
|
|
|
1060
1083
|
await ensureDir(path.dirname(envPath));
|
|
1061
1084
|
await writeTextAtomic(envPath, `export CODEX_LB_BASE_URL=${shellSingleQuote(normalizeCodexLbBaseUrl(baseUrl))}\nexport CODEX_LB_API_KEY=${shellSingleQuote(apiKey)}\n`, { mode: 0o600 });
|
|
1062
1085
|
await fsp.chmod(envPath, 0o600).catch(() => { });
|
|
1086
|
+
const metadataPath = opts.metadataPath || codexLbMetadataPath(home);
|
|
1087
|
+
await writeTextAtomic(metadataPath, `${JSON.stringify({
|
|
1088
|
+
schema: 'sks.codex-lb-metadata.v1',
|
|
1089
|
+
base_url: normalizeCodexLbBaseUrl(baseUrl),
|
|
1090
|
+
updated_at: new Date().toISOString(),
|
|
1091
|
+
source: 'legacy-login-migration',
|
|
1092
|
+
api_key: { redacted: true, sha256: await sha256Text(apiKey) }
|
|
1093
|
+
}, null, 2)}\n`, { mode: 0o600 });
|
|
1094
|
+
await fsp.chmod(metadataPath, 0o600).catch(() => { });
|
|
1063
1095
|
return { ok: true, status: 'migrated_login_cache', auth_path: authPath, env_path: envPath, base_url: normalizeCodexLbBaseUrl(baseUrl) };
|
|
1064
1096
|
}
|
|
1065
|
-
// Detects a real ChatGPT OAuth token blob in auth.json.
|
|
1066
|
-
// A bare {"auth_mode":"browser"} marker is NOT considered an OAuth token blob — we preserve it.
|
|
1067
1097
|
function hasChatgptOAuthTokens(text = '') {
|
|
1068
1098
|
try {
|
|
1069
1099
|
const parsed = JSON.parse(String(text || ''));
|
|
@@ -1076,7 +1106,6 @@ function hasChatgptOAuthTokens(text = '') {
|
|
|
1076
1106
|
return true;
|
|
1077
1107
|
}
|
|
1078
1108
|
if (authMode && /chatgpt|oauth|browser/.test(authMode)) {
|
|
1079
|
-
// Only treat as an OAuth blob when real tokens or a refresh metadata trail are also present.
|
|
1080
1109
|
if (parsed.last_refresh || parsed.expires_at || parsed.refresh_token || parsed.access_token || parsed.id_token)
|
|
1081
1110
|
return true;
|
|
1082
1111
|
}
|
|
@@ -1113,8 +1142,6 @@ function codexAuthModeSummary(text = '') {
|
|
|
1113
1142
|
catch { }
|
|
1114
1143
|
return { mode: 'unknown', codex_app_usable: false, summary: 'unrecognized auth.json shape' };
|
|
1115
1144
|
}
|
|
1116
|
-
// Migrate auth.json from legacy {"auth_mode":"apikey","key":"..."} to the codex 0.130.0+
|
|
1117
|
-
// format {"auth_mode":"apikey","OPENAI_API_KEY":"..."}. Safe: preserves key value, only renames field.
|
|
1118
1145
|
async function migrateCodexAuthKeyFormat(opts = {}) {
|
|
1119
1146
|
const home = opts.home || process.env.HOME || os.homedir();
|
|
1120
1147
|
const authPath = opts.authPath || codexAuthPath(home);
|
|
@@ -1139,11 +1166,6 @@ async function migrateCodexAuthKeyFormat(opts = {}) {
|
|
|
1139
1166
|
return { status: 'skipped', reason: 'parse_error' };
|
|
1140
1167
|
}
|
|
1141
1168
|
}
|
|
1142
|
-
// Codex App uses the shared OpenAI auth store for providers with
|
|
1143
|
-
// requires_openai_auth=true. Before putting the codex-lb key in that store, SKS
|
|
1144
|
-
// must also guard the built-in `openai` provider with the same LB base URL. This
|
|
1145
|
-
// covers stale App threads and explicit CLI overrides that retain `openai`; the
|
|
1146
|
-
// config guard is written and verified before auth.json changes.
|
|
1147
1169
|
export async function reconcileCodexLbAuthConflict(opts = {}) {
|
|
1148
1170
|
const home = opts.home || process.env.HOME || os.homedir();
|
|
1149
1171
|
const status = opts.status || await codexLbStatus({ ...opts, home });
|
|
@@ -1154,9 +1176,8 @@ export async function reconcileCodexLbAuthConflict(opts = {}) {
|
|
|
1154
1176
|
}
|
|
1155
1177
|
const authExists = await exists(authPath);
|
|
1156
1178
|
const authText = authExists ? await readText(authPath, '') : '';
|
|
1157
|
-
const
|
|
1158
|
-
const apiKey =
|
|
1159
|
-
|| String(opts.apiKey || (opts.env || process.env).CODEX_LB_API_KEY || '').trim();
|
|
1179
|
+
const envLoad = await loadCodexLbEnv({ ...opts, home, envPath: status.env_path });
|
|
1180
|
+
const apiKey = String(opts.apiKey || envLoad.secret_api_key || '').trim();
|
|
1160
1181
|
if (!apiKey) {
|
|
1161
1182
|
return { status: 'skipped', reason: 'missing_env_key', auth_path: authPath };
|
|
1162
1183
|
}
|
|
@@ -1388,12 +1409,9 @@ export async function reconcileCodexLbAuthConflict(opts = {}) {
|
|
|
1388
1409
|
}
|
|
1389
1410
|
return { status: 'no_oauth_conflict', auth_path: authPath };
|
|
1390
1411
|
}
|
|
1391
|
-
// Expose the ChatGPT OAuth backup path so the CLI can surface it in status / release output.
|
|
1392
1412
|
export function codexLbChatgptBackupPath(home = process.env.HOME || os.homedir()) {
|
|
1393
1413
|
return codexAuthChatgptBackupPath(home);
|
|
1394
1414
|
}
|
|
1395
|
-
// Remove a top-level TOML key (only above the first table header). Returns the original text
|
|
1396
|
-
// unchanged when the key isn't present.
|
|
1397
1415
|
function removeTopLevelTomlString(text, key) {
|
|
1398
1416
|
const lines = String(text || '').split('\n');
|
|
1399
1417
|
const firstTable = lines.findIndex((x) => /^\s*\[.+\]\s*$/.test(x));
|
|
@@ -1412,8 +1430,6 @@ function removeTopLevelTomlString(text, key) {
|
|
|
1412
1430
|
return text;
|
|
1413
1431
|
return lines.join('\n').replace(/^\n+/, '').replace(/\n{3,}/g, '\n\n');
|
|
1414
1432
|
}
|
|
1415
|
-
// Unselect codex-lb at the top-level model_provider setting. Leaves [model_providers.codex-lb]
|
|
1416
|
-
// and the env file alone so the user can re-engage with `sks codex-lb repair`.
|
|
1417
1433
|
export async function unselectCodexLbProvider(opts = {}) {
|
|
1418
1434
|
const home = opts.home || process.env.HOME || os.homedir();
|
|
1419
1435
|
const configPath = opts.configPath || codexLbConfigPath(home);
|
|
@@ -1480,17 +1496,6 @@ function providerDeselectionOutcome(result) {
|
|
|
1480
1496
|
provider_error: ok ? null : String(result?.provider_error || result?.error || result?.reason || result?.status || 'unselect_failed')
|
|
1481
1497
|
};
|
|
1482
1498
|
}
|
|
1483
|
-
// Reverse of reconcileCodexLbAuthConflict: restore the ChatGPT OAuth blob from the backup file
|
|
1484
|
-
// so the user can return to the official ChatGPT account login. Also deselects codex-lb at the
|
|
1485
|
-
// model_provider level by default so the restored OAuth blob actually wins; pass keepProvider
|
|
1486
|
-
// to skip that.
|
|
1487
|
-
//
|
|
1488
|
-
// Options:
|
|
1489
|
-
// home - HOME override (selftest)
|
|
1490
|
-
// keepProvider - leave `model_provider = "codex-lb"` selected (default: deselect)
|
|
1491
|
-
// deleteBackup - remove ~/.codex/auth.chatgpt-backup.json after a successful restore
|
|
1492
|
-
// (default: false; keeping it makes the next reconcile cycle a no-op clobber risk)
|
|
1493
|
-
// force - restore even if the current auth.json shape isn't recognized
|
|
1494
1499
|
export async function releaseCodexLbAuthHold(opts = {}) {
|
|
1495
1500
|
const home = opts.home || process.env.HOME || os.homedir();
|
|
1496
1501
|
const authPath = opts.authPath || codexAuthPath(home);
|
|
@@ -1514,9 +1519,6 @@ export async function releaseCodexLbAuthHold(opts = {}) {
|
|
|
1514
1519
|
};
|
|
1515
1520
|
}
|
|
1516
1521
|
}
|
|
1517
|
-
// Repeated "Use ChatGPT OAuth" is idempotent. If OAuth/browser auth is
|
|
1518
|
-
// already active, a historical backup is unnecessary; only ensure that the
|
|
1519
|
-
// codex-lb provider is no longer selected.
|
|
1520
1522
|
const currentAuthMode = codexAuthModeSummary(currentAuthText);
|
|
1521
1523
|
if (!opts.force && (currentAuthMode.mode === 'chatgpt_oauth' || currentAuthMode.mode === 'browser_marker')) {
|
|
1522
1524
|
let provider = { ok: true, provider_unselected: false, provider_status: 'kept', provider_error: null };
|
|
@@ -1560,8 +1562,6 @@ export async function releaseCodexLbAuthHold(opts = {}) {
|
|
|
1560
1562
|
provider_unselected: false
|
|
1561
1563
|
};
|
|
1562
1564
|
}
|
|
1563
|
-
// If auth.json already looks like ChatGPT OAuth (user re-logged in some other way), don't
|
|
1564
|
-
// clobber it — but still honor the deselect request so the OAuth blob takes effect.
|
|
1565
1565
|
if (trimmedCurrent && hasChatgptOAuthTokens(currentAuthText) && !opts.force) {
|
|
1566
1566
|
let provider = { ok: true, provider_unselected: false, provider_status: 'kept', provider_error: null };
|
|
1567
1567
|
if (!opts.keepProvider) {
|
|
@@ -1585,8 +1585,6 @@ export async function releaseCodexLbAuthHold(opts = {}) {
|
|
|
1585
1585
|
provider_error: provider.provider_error
|
|
1586
1586
|
};
|
|
1587
1587
|
}
|
|
1588
|
-
// Refuse to clobber unfamiliar auth.json shapes unless forced. We expect either an empty file,
|
|
1589
|
-
// the apikey shape we wrote during reconcile, or a stray `{"auth_mode":"browser"}` marker.
|
|
1590
1588
|
if (!opts.force && trimmedCurrent) {
|
|
1591
1589
|
const looksApikey = /"auth_mode"\s*:\s*"apikey"/.test(currentAuthText) && Boolean(parseCodexAuthApiKey(currentAuthText));
|
|
1592
1590
|
const looksBrowserMarker = /^\{\s*"auth_mode"\s*:\s*"browser"\s*\}\s*$/.test(currentAuthText);
|
|
@@ -1618,8 +1616,6 @@ export async function releaseCodexLbAuthHold(opts = {}) {
|
|
|
1618
1616
|
}
|
|
1619
1617
|
let provider = { ok: true, provider_unselected: false, provider_status: 'kept', provider_error: null };
|
|
1620
1618
|
if (!opts.keepProvider) {
|
|
1621
|
-
// Auth was just restored to ChatGPT OAuth. Allow deselection even if a stale
|
|
1622
|
-
// shared-key read would otherwise refuse, so release cannot leave OAuth + LB pin.
|
|
1623
1619
|
const unselected = await unselectCodexLbProvider({
|
|
1624
1620
|
...opts,
|
|
1625
1621
|
home,
|
|
@@ -1653,7 +1649,6 @@ export async function releaseCodexLbAuthHold(opts = {}) {
|
|
|
1653
1649
|
backupRemoved = true;
|
|
1654
1650
|
}
|
|
1655
1651
|
catch {
|
|
1656
|
-
// Non-fatal: the restore and provider deselection already landed.
|
|
1657
1652
|
}
|
|
1658
1653
|
}
|
|
1659
1654
|
return {
|
|
@@ -1757,16 +1752,10 @@ export async function maybePromptCodexLbSetupForLaunch(args = [], opts = {}) {
|
|
|
1757
1752
|
console.log('codex-lb auth synced with Codex CLI login cache.');
|
|
1758
1753
|
const chainHealth = await checkCodexLbResponseChain(status, opts);
|
|
1759
1754
|
if (!chainHealth.ok && chainHealth.chain_unhealthy) {
|
|
1760
|
-
// `previous_response_not_found` is normal for stateless LB deployments that don't persist
|
|
1761
|
-
// Responses across requests. The codex-lb provider still works fine — only the chained
|
|
1762
|
-
// health probe fails. Keep codex-lb active and just warn.
|
|
1763
1755
|
if (chainHealth.status === 'previous_response_not_found') {
|
|
1764
1756
|
console.log('codex-lb response chain check: previous_response_id not persisted by the load balancer (this is normal for stateless deployments). Keeping codex-lb active.');
|
|
1765
1757
|
return { status: 'present', ...status, codex_environment: codexEnvironment, codex_login: codexLogin, tool_catalog: toolCatalog, chain_health: chainHealth };
|
|
1766
1758
|
}
|
|
1767
|
-
// Hard chain failure (auth rejected, timeout, missing base URL, etc.). Don't silently
|
|
1768
|
-
// demote a configured codex-lb to ChatGPT OAuth — surface the failure and let the user
|
|
1769
|
-
// decide. Default keeps codex-lb (just press Enter).
|
|
1770
1759
|
console.log(`codex-lb response chain check failed (${chainHealth.status}${chainHealth.error ? `: ${chainHealth.error}` : ''}).`);
|
|
1771
1760
|
if (process.env.SKS_CODEX_LB_AUTOBYPASS === '1') {
|
|
1772
1761
|
console.log('SKS_CODEX_LB_AUTOBYPASS=1 set; bypassing codex-lb to ChatGPT OAuth for this launch.');
|
|
@@ -1781,8 +1770,6 @@ export async function maybePromptCodexLbSetupForLaunch(args = [], opts = {}) {
|
|
|
1781
1770
|
console.log('Keeping codex-lb active. To switch back to ChatGPT OAuth: `sks codex-lb release`.');
|
|
1782
1771
|
return { status: 'present', ...status, codex_environment: codexEnvironment, codex_login: codexLogin, tool_catalog: toolCatalog, chain_health: chainHealth };
|
|
1783
1772
|
}
|
|
1784
|
-
// Non-interactive context with no opt-out env var. The user explicitly configured codex-lb,
|
|
1785
|
-
// so default to keeping it active rather than silently swapping providers.
|
|
1786
1773
|
console.log('Non-interactive launch + chain check failure. Keeping codex-lb active. Set SKS_CODEX_LB_AUTOBYPASS=1 to auto-bypass to ChatGPT OAuth.');
|
|
1787
1774
|
return { status: 'present', ...status, codex_environment: codexEnvironment, codex_login: codexLogin, tool_catalog: toolCatalog, chain_health: chainHealth };
|
|
1788
1775
|
}
|
|
@@ -1805,11 +1792,11 @@ export async function maybePromptCodexLbSetupForLaunch(args = [], opts = {}) {
|
|
|
1805
1792
|
async function syncCodexLbProviderEnvironment(status = {}, opts = {}) {
|
|
1806
1793
|
const home = opts.home || process.env.HOME || os.homedir();
|
|
1807
1794
|
const envPath = opts.envPath || status.env_path || codexLbEnvPath(home);
|
|
1808
|
-
const
|
|
1809
|
-
const apiKey = String(opts.apiKey || '').trim()
|
|
1795
|
+
const envLoad = await loadCodexLbEnv({ ...opts, home, envPath });
|
|
1796
|
+
const apiKey = String(opts.apiKey || envLoad.secret_api_key || '').trim();
|
|
1810
1797
|
if (!apiKey)
|
|
1811
1798
|
return { ok: false, status: 'missing_env_key' };
|
|
1812
|
-
const baseUrl =
|
|
1799
|
+
const baseUrl = envLoad.base_url || opts.baseUrl || status.base_url;
|
|
1813
1800
|
process.env.CODEX_LB_API_KEY = apiKey;
|
|
1814
1801
|
if (baseUrl)
|
|
1815
1802
|
process.env.CODEX_LB_BASE_URL = baseUrl;
|
|
@@ -1871,9 +1858,6 @@ async function inspectCodexLbMacLaunchEnvironment(baseUrl = '', opts = {}) {
|
|
|
1871
1858
|
const result = await runProcess(launchctl, ['getenv', key], { timeoutMs: 3000, maxOutputBytes: 8192 });
|
|
1872
1859
|
return result.code === 0 ? String(result.stdout || '').trim() : '';
|
|
1873
1860
|
};
|
|
1874
|
-
// launchctl can stall behind the same launchd/TCC boundary for every key.
|
|
1875
|
-
// These reads are independent, so keep the worst case to one timeout window
|
|
1876
|
-
// instead of three serial windows on `sks --mad` preflight.
|
|
1877
1861
|
const [currentBaseUrl, currentApiKey, currentOpenRouterKey] = await Promise.all([
|
|
1878
1862
|
readVar('CODEX_LB_BASE_URL'),
|
|
1879
1863
|
readVar('CODEX_LB_API_KEY'),
|
package/dist/cli/router.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COMMAND_ALIASES_LITE, COMMAND_MANIFEST_BY_NAME, COMMAND_NAME_SET, } from './command-manifest-lite.js';
|
|
2
|
-
import {
|
|
2
|
+
import { findRetiredGlobalExecutionArgumentErrors } from './global-mode-router.js';
|
|
3
3
|
export function isCommandName(value) {
|
|
4
4
|
return COMMAND_NAME_SET.has(value);
|
|
5
5
|
}
|
|
@@ -23,13 +23,6 @@ export async function dispatch(args) {
|
|
|
23
23
|
return await dispatchInner(argv);
|
|
24
24
|
}
|
|
25
25
|
catch (err) {
|
|
26
|
-
// Final choke point: any uncaught bug anywhere in the dispatch chain (gate
|
|
27
|
-
// checks, lazy command import, command run()) must never leak a raw stack
|
|
28
|
-
// dump to the user as their "answer" — convert it to a structured, honest
|
|
29
|
-
// failure instead. Every existing explicit error path above already sets
|
|
30
|
-
// process.exitCode and returns normally (never throws), so this only ever
|
|
31
|
-
// catches genuinely unexpected exceptions; it changes nothing about those
|
|
32
|
-
// paths' exit codes or messages.
|
|
33
26
|
const message = err instanceof Error ? err.message : String(err);
|
|
34
27
|
if (err instanceof Error && err.stack)
|
|
35
28
|
process.stderr.write(`${err.stack}\n`);
|
|
@@ -37,25 +30,27 @@ export async function dispatch(args) {
|
|
|
37
30
|
process.stderr.write(`${message}\n`);
|
|
38
31
|
process.exitCode = 1;
|
|
39
32
|
const result = { ok: false, error: message, command: normalizeCommand(argv).rawCommand };
|
|
40
|
-
// A --json caller depends on stdout always being exactly one JSON result
|
|
41
|
-
// (this is the same non-interactive contract SKS_AGENT_MODE promises) — an
|
|
42
|
-
// uncaught crash must not leave stdout empty, or a JSON.parse on the
|
|
43
|
-
// consuming end breaks with no diagnosable output at all.
|
|
44
33
|
if (argv.includes('--json'))
|
|
45
34
|
console.log(JSON.stringify(result, null, 2));
|
|
46
35
|
return result;
|
|
47
36
|
}
|
|
48
37
|
}
|
|
49
38
|
async function dispatchInner(argv) {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
if (globalMode?.kind === 'glm-without-mad') {
|
|
56
|
-
const result = glmWithoutMadResult();
|
|
57
|
-
console.error(`GLM mode requires MAD: ${result.hint}`);
|
|
39
|
+
const retiredGlm = findRetiredGlobalExecutionArgumentErrors(argv).filter((item) => item.includes('--glm'));
|
|
40
|
+
if (retiredGlm.length && argv.some((arg) => arg === '--glm' || String(arg).startsWith('--glm='))) {
|
|
41
|
+
const hint = 'GLM MAD CLI was removed. Use SKS Center Providers or: sks codex-app use-openrouter --model <id>';
|
|
42
|
+
console.error(hint);
|
|
58
43
|
process.exitCode = 1;
|
|
44
|
+
const result = {
|
|
45
|
+
ok: false,
|
|
46
|
+
status: 'blocked',
|
|
47
|
+
mode: 'glm',
|
|
48
|
+
reason: 'glm_mad_removed',
|
|
49
|
+
hint,
|
|
50
|
+
blockers: retiredGlm
|
|
51
|
+
};
|
|
52
|
+
if (argv.includes('--json'))
|
|
53
|
+
console.log(JSON.stringify(result, null, 2));
|
|
59
54
|
return result;
|
|
60
55
|
}
|
|
61
56
|
const { command, rawCommand, args: rest } = normalizeCommand(argv);
|
|
@@ -96,10 +91,6 @@ async function dispatchInner(argv) {
|
|
|
96
91
|
process.exitCode = 1;
|
|
97
92
|
return commandGate;
|
|
98
93
|
}
|
|
99
|
-
// 20차 P2-2: --help/-h/help must never wait on (or be blocked by) the
|
|
100
|
-
// migration gate's lock — a stuck/contended migration lock previously
|
|
101
|
-
// made `sks <cmd> --help` take the full MIGRATION_LOCK_WAIT_MS (20s) and
|
|
102
|
-
// then fail, for a request that only wants usage text.
|
|
103
94
|
const { ensureCurrentMigrationBeforeCommand } = await import('../core/update/update-migration-state.js');
|
|
104
95
|
const migrationGate = await ensureCurrentMigrationBeforeCommand({
|
|
105
96
|
command,
|
|
@@ -134,14 +125,7 @@ async function dispatchInner(argv) {
|
|
|
134
125
|
throw new Error(`Command ${command} must export run(command, args)`);
|
|
135
126
|
return mod.run(rawCommand || command, rest);
|
|
136
127
|
}
|
|
137
|
-
// --help/-h/help must skip the active-route and migration gates regardless
|
|
138
|
-
// of where it appears in args — a pure usage-text request should never wait
|
|
139
|
-
// on (or be blocked by) project state (20차 P2-2).
|
|
140
128
|
function isHelpRequest(args) {
|
|
141
|
-
// --help/-h are unambiguous flags wherever they appear; bare "help" is
|
|
142
|
-
// only treated as the request when it's the subcommand position (args[0])
|
|
143
|
-
// so an arbitrary value elsewhere (e.g. a commit message of "help") can't
|
|
144
|
-
// accidentally bypass the gates.
|
|
145
129
|
return args.includes('--help') || args.includes('-h') || String(args[0] || '').toLowerCase() === 'help';
|
|
146
130
|
}
|
|
147
131
|
async function ensureActiveRouteCommandGate(command, args) {
|
|
@@ -208,9 +192,16 @@ function printHandledCommandBlock(result) {
|
|
|
208
192
|
}
|
|
209
193
|
export function safeReadOnlySubcommand(command, args) {
|
|
210
194
|
const sub = String(args[0] || '').toLowerCase();
|
|
195
|
+
const nested = String(args[1] || '').toLowerCase();
|
|
211
196
|
if (command === 'naruto' && ['status', 'subagents', 'proof'].includes(sub)) {
|
|
212
197
|
return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
|
|
213
198
|
}
|
|
199
|
+
if (command === 'mcp' && sub === 'config' && ['list', 'test', 'backups', 'show'].includes(nested)) {
|
|
200
|
+
return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
|
|
201
|
+
}
|
|
202
|
+
if (command === 'remote' && ['readiness', 'status', 'show'].includes(sub)) {
|
|
203
|
+
return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
|
|
204
|
+
}
|
|
214
205
|
if (!['status', 'show', 'list', 'observe', 'watch', 'doctor', 'help'].includes(sub))
|
|
215
206
|
return false;
|
|
216
207
|
return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
|