sneakoscope 8.0.2 → 8.0.4
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 +150 -37
- package/config/skills-hash-ledger.v1.json +1 -1
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/fast-inline.js +55 -27
- package/dist/bin/install.js +6 -32
- package/dist/bin/sks-dispatch.js +1 -1
- package/dist/cli/args.js +0 -2
- package/dist/cli/cli-theme.js +18 -9
- package/dist/cli/command-manifest-lite.js +6 -6
- package/dist/cli/command-registry.js +6 -6
- package/dist/cli/feature-commands.js +9 -7
- package/dist/cli/install-helpers-codex-lb-chain.js +198 -7
- package/dist/cli/install-helpers-codex-lb-config.js +78 -10
- package/dist/cli/install-helpers-install-support.js +9 -6
- package/dist/cli/install-helpers.js +101 -49
- package/dist/cli/install-tool-helpers.js +2 -82
- package/dist/cli/output.js +6 -1
- package/dist/cli/router.js +101 -2
- package/dist/commands/codex-lb.js +119 -19
- package/dist/commands/doctor-profile.js +1 -1
- package/dist/commands/doctor.js +727 -144
- package/dist/commands/mad-sks.js +1 -5
- package/dist/config/skills-manifest.json +4 -2
- package/dist/core/agents/agent-codex-cockpit.js +0 -3
- package/dist/core/agents/agent-effort-policy.js +5 -5
- package/dist/core/agents/agent-janitor.js +0 -20
- package/dist/core/agents/agent-orchestrator.js +9 -56
- package/dist/core/agents/agent-output-validator.js +2 -3
- package/dist/core/agents/agent-patch-schema.js +2 -2
- package/dist/core/agents/agent-proof-evidence.js +0 -65
- package/dist/core/agents/agent-recursion-guard.js +1 -1
- package/dist/core/agents/agent-runner-codex-exec.js +5 -3
- package/dist/core/agents/agent-scheduler.js +327 -85
- package/dist/core/agents/agent-schema.js +1 -1
- package/dist/core/agents/agent-trust-report.js +0 -36
- package/dist/core/agents/agent-worker-pipeline.js +0 -1
- package/dist/core/agents/fast-mode-policy.js +1 -3
- package/dist/core/agents/native-cli-worker-runtime-proof.js +1 -1
- package/dist/core/agents/native-cli-worker-runtime.js +69 -647
- package/dist/core/agents/native-cli-worker.js +6 -7
- package/dist/core/agents/native-worker-backend-router.js +2 -32
- package/dist/core/agents/no-subagent-scaling-policy.js +1 -1
- package/dist/core/agents/parallel-runtime-proof.js +1 -6
- package/dist/core/agents/runtime-proof-summary.js +1 -35
- package/dist/core/architecture-hardening/contracts/contracts.js +193 -0
- package/dist/core/architecture-hardening/migration/migration.js +111 -0
- package/dist/core/architecture-hardening/state/state-service.js +155 -0
- package/dist/core/artifact-schemas.js +0 -3
- package/dist/core/codex/codex-config-guard.js +238 -52
- package/dist/core/codex-adapter.js +5 -3
- package/dist/core/codex-app/auxiliary-oauth-policy.js +36 -0
- package/dist/core/codex-app/catalog-compat/catalog-service.js +104 -0
- package/dist/core/codex-app/child-policy/child-policy.js +35 -0
- package/dist/core/codex-app/codex-app-handoff.js +0 -1
- package/dist/core/codex-app/codex-hook-lifecycle.js +1 -1
- package/dist/core/codex-app/codex-init-deep.js +1 -1
- package/dist/core/codex-app/menubar/app-bundle.js +2 -0
- package/dist/core/codex-app/menubar/constants.js +14 -1
- package/dist/core/codex-app/menubar/global-install.js +288 -0
- package/dist/core/codex-app/menubar/installer.js +79 -14
- package/dist/core/codex-app/menubar/launch-agent.js +267 -45
- package/dist/core/codex-app/menubar/paths.js +3 -0
- package/dist/core/codex-app/menubar/rollback.js +55 -7
- package/dist/core/codex-app/menubar/status.js +75 -4
- package/dist/core/codex-app/provider-child-policy.js +64 -0
- package/dist/core/codex-app/provider-mode.js +91 -0
- package/dist/core/codex-app/provider-operation-stages.js +20 -0
- package/dist/core/codex-app/provider-session-policy.js +85 -0
- package/dist/core/codex-app/session-policy/session-pinning.js +68 -0
- package/dist/core/codex-app.js +3 -2
- package/dist/core/codex-control/codex-0139-image-path-real-probe.js +3 -1
- package/dist/core/codex-control/codex-0139-web-search-probe.js +3 -1
- package/dist/core/codex-control/codex-app-server-runtime-env.js +13 -4
- package/dist/core/codex-control/codex-app-server-v2-client.js +3 -3
- package/dist/core/codex-control/codex-control-proof.js +0 -1
- package/dist/core/codex-control/codex-task-runner.js +1 -4
- package/dist/core/codex-exec-output-schema.js +4 -1
- package/dist/core/codex-lb/codex-lb-env.js +63 -72
- package/dist/core/codex-lb/codex-lb-setup.js +15 -2
- package/dist/core/codex-lb/desktop-bridge/header-policy.js +6 -0
- package/dist/core/codex-lb/desktop-bridge/http-forward.js +48 -6
- package/dist/core/codex-lb/desktop-bridge/security.js +134 -0
- package/dist/core/codex-lb/desktop-bridge/server.js +9 -3
- package/dist/core/codex-lb/desktop-bridge/state.js +26 -6
- package/dist/core/codex-lb/desktop-bridge/types.js +1 -0
- package/dist/core/codex-lb/desktop-center-credentials.js +517 -58
- package/dist/core/codex-lb/desktop-controller.js +177 -56
- package/dist/core/codex-lb/desktop-service.js +179 -40
- package/dist/core/codex-lb/legacy-migration.js +1 -3
- package/dist/core/codex-lb/native-openai-transport/transport.js +68 -0
- package/dist/core/codex-lb/probes/cli-image-tool-probe.js +1 -1
- package/dist/core/codex-lb/provider-routing/provider-router.js +58 -0
- package/dist/core/codex-lb/routing-truth.js +327 -0
- package/dist/core/codex-native/codex-native-feature-broker.js +4 -0
- package/dist/core/codex-native/codex-native-pattern-analysis.js +1 -2
- package/dist/core/codex-native/core-skill-manifest.js +1 -1
- package/dist/core/codex-plugins/codex-plugin-json.js +26 -6
- package/dist/core/codex-plugins/codex-plugin-repair.js +32 -6
- package/dist/core/commands/basic-cli.js +9 -7
- package/dist/core/commands/computer-use-command.js +1 -1
- package/dist/core/commands/image-ux-review-command.js +16 -9
- package/dist/core/commands/install-package-command.js +105 -0
- package/dist/core/commands/intent-normalization/normalizer.js +96 -0
- package/dist/core/commands/mad-sks-command.js +23 -274
- package/dist/core/commands/mad-sks-headless.js +11 -30
- package/dist/core/commands/naruto-command.js +0 -25
- package/dist/core/commands/qa-loop-command.js +104 -22
- package/dist/core/commands/remote-command.js +2 -2
- package/dist/core/commands/research-command.js +10 -5
- package/dist/core/commands/telegram-command.js +407 -0
- package/dist/core/config-adopt/config-adopt-command.js +35 -0
- package/dist/core/config-adopt/config-adopt.js +346 -0
- package/dist/core/config-adopt/index.js +3 -0
- package/dist/core/doctor/command-alias-cleanup.js +4 -1
- package/dist/core/doctor/current-project-guidance-nested.js +37 -6
- package/dist/core/doctor/current-project-guidance.js +15 -9
- package/dist/core/doctor/doctor-dirty-planner.js +1 -4
- package/dist/core/doctor/doctor-readiness-matrix.js +15 -18
- package/dist/core/doctor/retired-managed-residue-private.js +4 -3
- package/dist/core/doctor/retired-managed-residue-runtime.js +2 -2
- package/dist/core/doctor/skill-legacy-surface.js +11 -10
- package/dist/core/doctor/sks-menubar-doctor.js +4 -0
- package/dist/core/evaluation.js +0 -19
- package/dist/core/evidence/v2/evidence-key.js +105 -0
- package/dist/core/feature-fixtures.js +12 -7
- package/dist/core/feature-registry.js +52 -21
- package/dist/core/hooks-runtime/hook-context.js +9 -0
- package/dist/core/hooks-runtime/managed-skill-admission.js +54 -4
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +69 -52
- package/dist/core/hooks-runtime/stop-finalization.js +226 -0
- package/dist/core/hooks-runtime/stop-repeat-guard.js +21 -2
- package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +2 -2
- package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +3 -3
- package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +43 -5
- package/dist/core/hooks-runtime/subagent-skill-availability.js +64 -30
- package/dist/core/hooks-runtime/subagent-stop-hook.js +15 -2
- package/dist/core/hooks-runtime.js +179 -212
- package/dist/core/image/reference-evidence/reference-registry.js +145 -0
- package/dist/core/image-ux-review/imagegen-adapter.js +21 -9
- package/dist/core/image-ux-review/reference-policy/reference-policy.js +9 -0
- package/dist/core/imagegen/codex-lb-imagegen-target.js +8 -0
- package/dist/core/imagegen/imagegen-capability.js +59 -2
- package/dist/core/imagegen/require-imagegen.js +2 -2
- package/dist/core/init/skills.js +17 -3
- package/dist/core/init.js +3 -3
- package/dist/core/install/installed-package-smoke.js +23 -5
- package/dist/core/json/canonical.js +9 -0
- package/dist/core/locks/file-lock.js +0 -1
- package/dist/core/loops/loop-continuation-enforcer.js +65 -7
- package/dist/core/loops/loop-decomposer.js +0 -1
- package/dist/core/loops/loop-gate-runner.js +65 -4
- package/dist/core/loops/loop-gate-selector.js +0 -2
- package/dist/core/loops/loop-proof-validation.js +38 -0
- package/dist/core/loops/loop-risk-classifier.js +1 -1
- package/dist/core/loops/loop-runtime.js +14 -2
- package/dist/core/loops/loop-scheduler.js +7 -2
- package/dist/core/loops/loop-worker-runtime.js +0 -15
- package/dist/core/loops/loop-worktree-runtime.js +52 -4
- package/dist/core/managed-assets/managed-assets-manifest.js +14 -14
- package/dist/core/naruto/hardware-capacity-probe.js +9 -6
- package/dist/core/naruto/naruto-active-pool.js +2 -14
- package/dist/core/naruto/naruto-concurrency-governor.js +71 -31
- package/dist/core/naruto/naruto-loop-worker-router.js +0 -2
- package/dist/core/naruto/naruto-verification-dag.js +0 -1
- package/dist/core/naruto/naruto-write-e2e.js +1 -2
- package/dist/core/naruto/resource-pressure-monitor.js +0 -4
- package/dist/core/observability/architecture-hardening/safe-projection.js +65 -0
- package/dist/core/perf/import-graph-budget.js +0 -1
- package/dist/core/perf/release-latency-slo.js +3 -2
- package/dist/core/preflight/parallel-preflight-engine.js +2 -15
- package/dist/core/product-design-app-server.js +13 -1
- package/dist/core/proof/fake-real-proof-policy.js +2 -17
- package/dist/core/proof/route-proof-gate.js +2 -10
- package/dist/core/proof/route-proof-policy.js +1 -1
- package/dist/core/proof/runtime-evidence-policy.js +185 -0
- package/dist/core/proof/runtime-truth-matrix.js +64 -39
- package/dist/core/proof/validation.js +27 -11
- package/dist/core/provider/provider-context.js +18 -2
- package/dist/core/providers/openrouter/openrouter-account.js +3 -2
- package/dist/core/python-tools/python-tool-runner.js +1 -1
- package/dist/core/qa-loop/qa-execution-control.js +57 -0
- package/dist/core/questions.js +1 -1
- package/dist/core/release/extreme-parallel-scheduler.js +0 -3
- package/dist/core/release/gate-manifest.js +3 -7
- package/dist/core/release/gate-pack-manifest.js +3 -7
- package/dist/core/release/package-size-budget.js +2 -2
- package/dist/core/release/physical-release-gates.js +189 -0
- package/dist/core/release/publish-preflight.js +113 -0
- package/dist/core/release/release-gate-affected-selector.js +0 -2
- package/dist/core/release/release-gate-batch-runner.js +1 -1
- package/dist/core/release/release-gate-node.js +0 -1
- package/dist/core/release/release-gate-resource-governor.js +0 -1
- package/dist/core/release/release-pack-receipt.js +5 -8
- package/dist/core/release/release-real-contract.js +0 -6
- package/dist/core/release/resource-class-budget.js +0 -1
- package/dist/core/release/stage-publish.js +178 -36
- package/dist/core/research/research-adversarial-review.js +103 -9
- package/dist/core/research.js +1 -1
- package/dist/core/retention.js +0 -1
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes/diagnostic-allowlist.js +0 -1
- package/dist/core/routes/dollar-manifest-lite.js +1 -1
- package/dist/core/routes.js +46 -15
- package/dist/core/runtime/execution-control.js +226 -0
- package/dist/core/runtime/progress-recovery/progress-recovery.js +89 -0
- package/dist/core/runtime/task-profile.js +10 -4
- package/dist/core/runtime/verification-budget.js +10 -1
- package/dist/core/safety/intent-contract/intent-contract.js +94 -0
- package/dist/core/safety/mutation-guard.js +0 -2
- package/dist/core/safety/mutation-ledger.js +0 -2
- package/dist/core/safety/requested-scope-contract.js +0 -0
- package/dist/core/search-visibility/discovery.js +1 -1
- package/dist/core/search-visibility/index.js +12 -0
- package/dist/core/search-visibility/verifier.js +112 -3
- package/dist/core/security/private-credential-file.js +209 -0
- package/dist/core/session/project-namespace.js +0 -5
- package/dist/core/skills/skill-agent-metadata.js +1 -3
- package/dist/core/strategy/adhd-orchestrating-gate.js +0 -1
- package/dist/core/subagents/agent-catalog.js +19 -34
- package/dist/core/subagents/model-policy.js +65 -24
- package/dist/core/subagents/naruto-help-contract.js +8 -8
- package/dist/core/subagents/naruto-host-credentials.js +13 -0
- package/dist/core/subagents/official-subagent-config.js +16 -6
- package/dist/core/subagents/official-subagent-preparation.js +35 -16
- package/dist/core/subagents/official-subagent-prompt.js +7 -7
- package/dist/core/subagents/official-subagent-runner.js +27 -4
- package/dist/core/subagents/role-model-preferences.js +1 -1
- package/dist/core/subagents/thread-budget.js +19 -12
- package/dist/core/subagents/wave-lifecycle.js +18 -6
- package/dist/core/telegram/access.js +58 -0
- package/dist/core/telegram/client.js +157 -0
- package/dist/core/telegram/confirmation.js +37 -0
- package/dist/core/telegram/doctor.js +154 -0
- package/dist/core/telegram/index.js +9 -0
- package/dist/core/telegram/keychain.js +317 -0
- package/dist/core/telegram/liveness.js +118 -0
- package/dist/core/telegram/poller.js +90 -0
- package/dist/core/telegram/redaction.js +15 -0
- package/dist/core/telegram/state-lock.js +416 -0
- package/dist/core/telegram/types.js +1 -0
- package/dist/core/text/strings.js +3 -0
- package/dist/core/triwiki/context-graph/store/evidence-write-lock.js +29 -0
- package/dist/core/triwiki/context-graph/store/fragment-cache.js +24 -0
- package/dist/core/triwiki/context-graph/store/snapshot-store.js +69 -21
- package/dist/core/triwiki/triwiki-gate-impact-map.js +2 -2
- package/dist/core/triwiki/triwiki-module-card.js +1 -2
- package/dist/core/update/installed-cli-resolution.js +170 -0
- package/dist/core/update/update-diagnostics.js +52 -0
- package/dist/core/update/update-migration-state.js +30 -12
- package/dist/core/update/update-operation.js +2 -1
- package/dist/core/update/update-stage-diagnostics.js +38 -0
- package/dist/core/update/update-status.js +2 -9
- package/dist/core/update-check.js +279 -91
- package/dist/core/version.js +1 -1
- package/dist/native/sks-menubar/Sources/AppDelegate.swift +19 -1
- package/dist/native/sks-menubar/Sources/AppIdentity.swift +7 -0
- package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +6 -2
- package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +159 -92
- package/dist/native/sks-menubar/Sources/OperationModels.swift +389 -0
- package/dist/native/sks-menubar/Sources/OverviewViewController.swift +57 -0
- package/dist/native/sks-menubar/Sources/ProcessClient.swift +3 -1
- package/dist/native/sks-menubar/Sources/ProvidersConnectTest.swift +115 -0
- package/dist/native/sks-menubar/Sources/ProvidersFastMode.swift +17 -0
- package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +3 -0
- package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +58 -17
- package/dist/native/sks-menubar/Sources/ProvidersReliability.swift +302 -0
- package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +5 -0
- package/dist/native/sks-menubar/Sources/ProvidersRoutingTruth.swift +190 -0
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +158 -126
- package/dist/native/sks-menubar/Sources/RemoteCodingViewController.swift +462 -26
- package/dist/native/sks-menubar/Sources/SKSKeychainStore.swift +344 -0
- package/dist/native/sks-menubar/Sources/SecureProcessEnvelope.swift +27 -0
- package/dist/native/sks-menubar/Sources/SingletonInstanceGuard.swift +328 -0
- package/dist/native/sks-menubar/Sources/StatusItemController.swift +10 -2
- package/dist/native/sks-menubar/Sources/TelegramPrivateFileStore.swift +498 -0
- package/dist/native/sks-menubar/Sources/TelegramPrivateFileSupport.swift +236 -0
- package/dist/native/sks-menubar/Sources/TelegramProcessGateway.swift +454 -0
- package/dist/native/sks-menubar/Sources/TelegramRuntimeSupport.swift +56 -0
- package/dist/native/sks-menubar/Sources/TelegramStateLock.swift +448 -0
- package/dist/native/sks-menubar/Sources/TelegramSupport.swift +187 -0
- package/dist/native/sks-menubar/Sources/TelegramTransport.swift +499 -0
- package/dist/native/sks-menubar/Sources/main.swift +15 -1
- package/dist/scripts/all-feature-deep-completion-check.js +5 -1
- package/dist/scripts/check-publish-tag.js +56 -0
- package/dist/scripts/codex-lb-fast-mode-truth-check.js +10 -3
- package/dist/scripts/codex-lb-fast-ui-preservation-check.js +12 -3
- package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +4 -2
- package/dist/scripts/codex-native-agent-role-content-check.js +3 -3
- package/dist/scripts/codex-native-gate-lib.js +14 -7
- package/dist/scripts/current-command-surface-check.js +7 -7
- package/dist/scripts/current-surface-update-e2e-check.js +4 -3
- package/dist/scripts/current-upgrade-matrix-check.js +5 -24
- package/dist/scripts/docs-truthfulness-check.js +17 -13
- package/dist/scripts/gate-lib.js +0 -2
- package/dist/scripts/gate-policy-audit-check.js +3 -2
- package/dist/scripts/harness-benchmark-check.js +1 -1
- package/dist/scripts/init-deep-backup-retention-check.js +1 -1
- package/dist/scripts/lib/codex-sdk-gate-lib.js +1 -2
- package/dist/scripts/loop-directive-check-lib.js +28 -38
- package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +14 -180
- package/dist/scripts/mad-sks-launch-sql-plane-boundary-check.js +2 -11
- package/dist/scripts/official-subagent-workflow-check.js +1 -1
- package/dist/scripts/packlist-performance-check.js +1 -2
- package/dist/scripts/prepublish-release-check-or-fast.js +32 -0
- package/dist/scripts/publish-preflight.js +12 -0
- package/dist/scripts/release-affected-selector-check.js +2 -2
- package/dist/scripts/release-gate-batch-runner-check.js +2 -2
- package/dist/scripts/release-metadata-check.js +8 -12
- package/dist/scripts/release-real-check.js +2 -54
- package/dist/scripts/runtime-domain-gate-lib.js +2 -96
- package/dist/scripts/runtime-proof-summary-check.js +2 -6
- package/dist/scripts/search-visibility-gate-lib.js +0 -1
- package/dist/scripts/sks-cli-gate-lib.js +1 -1
- package/dist/scripts/typed-routing-gate-lib.js +7 -59
- package/docs/demo.tape +1 -1
- package/infra-harness-gates.json +1 -1456
- package/package.json +10 -7
- package/release-gates.v2.json +0 -1
- package/schemas/agents/parallel-runtime-proof.schema.json +0 -2
- package/schemas/codex/agent-result.schema.json +0 -6
- package/schemas/naruto/naruto-concurrency-governor.schema.json +1 -3
- package/schemas/release/release-gate-node.schema.json +1 -1
- package/dist/commands/zellij-lane.js +0 -22
- package/dist/commands/zellij-monitor-pane.js +0 -26
- package/dist/commands/zellij-slot-column-anchor.js +0 -22
- package/dist/commands/zellij-slot-pane.js +0 -80
- package/dist/commands/zellij-viewport-pane.js +0 -57
- package/dist/commands/zellij.js +0 -422
- package/dist/core/agents/agent-runner-zellij.js +0 -164
- package/dist/core/agents/agent-slot-pane-binding-proof.js +0 -96
- package/dist/core/agents/parallel-write-fixture.js +0 -305
- package/dist/core/agents/worker-pane-communication-contract.js +0 -100
- package/dist/core/agents/zellij-lane-supervisor.js +0 -428
- package/dist/core/agents/zellij-right-lane-cockpit.js +0 -66
- package/dist/core/doctor/doctor-zellij-repair.js +0 -40
- package/dist/core/ops/upgrade-migration-fixtures.js +0 -119
- package/dist/core/proof/route-finalizer-fixtures.js +0 -21
- package/dist/core/zellij/homebrew-policy.js +0 -43
- package/dist/core/zellij/zellij-capability.js +0 -126
- package/dist/core/zellij/zellij-clipboard-config.js +0 -52
- package/dist/core/zellij/zellij-command.js +0 -149
- package/dist/core/zellij/zellij-fake-adapter.js +0 -186
- package/dist/core/zellij/zellij-lane-renderer.js +0 -706
- package/dist/core/zellij/zellij-lane-runtime.js +0 -189
- package/dist/core/zellij/zellij-launcher.js +0 -268
- package/dist/core/zellij/zellij-layout-builder.js +0 -191
- package/dist/core/zellij/zellij-monitor-renderer.js +0 -52
- package/dist/core/zellij/zellij-official-subagent-activity.js +0 -526
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -258
- package/dist/core/zellij/zellij-pane-proof.js +0 -226
- package/dist/core/zellij/zellij-right-column-manager.js +0 -308
- package/dist/core/zellij/zellij-screen-proof.js +0 -120
- package/dist/core/zellij/zellij-self-heal-types.js +0 -44
- package/dist/core/zellij/zellij-self-heal.js +0 -408
- package/dist/core/zellij/zellij-slot-column-anchor.js +0 -304
- package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -521
- package/dist/core/zellij/zellij-slot-telemetry.js +0 -384
- package/dist/core/zellij/zellij-theme.js +0 -66
- package/dist/core/zellij/zellij-ui-mode.js +0 -34
- package/dist/core/zellij/zellij-update.js +0 -348
- package/dist/core/zellij/zellij-viewport-binder.js +0 -61
- package/dist/core/zellij/zellij-worker-pane-manager.js +0 -881
- package/dist/core/zellij/zellij-worker-pane-summary.js +0 -64
- package/dist/native/sks-menubar/Tests/AppRuntimeTestSupport.swift +0 -26
- package/dist/native/sks-menubar/Tests/OperationCoordinatorTests.swift +0 -174
- package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +0 -20
- package/dist/native/sks-menubar/Tests/ProvidersViewControllerTests.swift +0 -142
- package/dist/scripts/zellij-pane-proof-check.js +0 -88
- package/dist/scripts/zellij-real-session-cleanup-check.js +0 -139
- package/dist/scripts/zellij-real-session-launch-check.js +0 -126
- package/dist/scripts/zellij-screen-proof-check.js +0 -43
- package/schemas/zellij/zellij-right-column-state.schema.json +0 -40
- package/schemas/zellij/zellij-slot-telemetry.schema.json +0 -89
- package/schemas/zellij/zellij-worker-pane.schema.json +0 -53
- package/scripts/build-clean-atomic.mjs +0 -323
|
@@ -157,6 +157,7 @@ const COMMAND_DEFINITIONS = {
|
|
|
157
157
|
activeRoutePolicy: 'always'
|
|
158
158
|
}),
|
|
159
159
|
root: readOnly(entry('stable', 'Show active SKS root', 'dist/commands/root.js', directCommand(() => import('../commands/root.js'), 'dist/commands/root.js'))),
|
|
160
|
+
install: skipMigrationGate(entry('stable', 'Install the exact packaged SKS version globally and verify the resolved CLI', 'dist/core/commands/install-package-command.js', argsCommand(() => import('../core/commands/install-package-command.js'), 'installPackageCommand', 'dist/core/commands/install-package-command.js'))),
|
|
160
161
|
update: skipMigrationGate(entry('stable', 'Inspect, review, apply, or roll back the global SKS update', 'dist/core/commands/basic-cli.js', subcommand(() => import(basicModule), 'updateCommand', 'dist/core/commands/basic-cli.js', 'now'))),
|
|
161
162
|
uninstall: entry('stable', 'Uninstall SKS global skills, hooks, config, menu bar, and optional project residue', 'dist/core/commands/uninstall-command.js', argsCommand(() => import('../core/commands/uninstall-command.js'), 'uninstallCommand', 'dist/core/commands/uninstall-command.js'), {
|
|
162
163
|
skipMigrationGate: true,
|
|
@@ -165,6 +166,7 @@ const COMMAND_DEFINITIONS = {
|
|
|
165
166
|
activeRoutePolicy: 'always'
|
|
166
167
|
}),
|
|
167
168
|
'update-check': readOnly(entry('stable', 'Show the shared SKS, Codex CLI, and Menu Bar update status', 'dist/core/commands/basic-cli.js', basicArgs('updateCheckCommand'))),
|
|
169
|
+
config: skipMigrationGate(entry('stable', 'Adopt project Codex config into SKS management', 'dist/core/config-adopt/index.js', subcommand(() => import('../core/config-adopt/index.js'), 'configCommand', 'dist/core/config-adopt/index.js', 'adopt'))),
|
|
168
170
|
mcp: skipMigrationGate(entry('beta', 'Manage scoped Codex MCP configuration', 'dist/core/commands/mcp-config-command.js', argsCommand(() => import('../core/commands/mcp-config-command.js'), 'mcpConfigCommand', 'dist/core/commands/mcp-config-command.js'))),
|
|
169
171
|
wizard: entry('stable', 'Open setup wizard help', 'dist/core/commands/basic-cli.js', basicNoArgs('quickstartCommand')),
|
|
170
172
|
usage: readOnly(entry('stable', 'Show focused usage topic', 'dist/core/commands/basic-cli.js', basicArgs('usageCommand'))),
|
|
@@ -185,13 +187,8 @@ const COMMAND_DEFINITIONS = {
|
|
|
185
187
|
'codex-lb': skipMigrationGate(entry('beta', 'Inspect codex-lb status and circuit health', 'dist/commands/codex-lb.js', directCommand(() => import('../commands/codex-lb.js'), 'dist/commands/codex-lb.js'))),
|
|
186
188
|
menubar: activeRouteDiagnostic(entry('beta', 'Inspect/install/restart/uninstall SKS menu bar', 'dist/core/commands/menubar-command.js', subcommand(() => import('../core/commands/menubar-command.js'), 'menubarCommand', 'dist/core/commands/menubar-command.js', 'status'))),
|
|
187
189
|
remote: entry('beta', 'Inspect official Remote readiness and run the proof-aware SSH stdio worker', 'dist/core/commands/remote-command.js', argsCommand(() => import('../core/commands/remote-command.js'), 'remoteCommand', 'dist/core/commands/remote-command.js')),
|
|
190
|
+
telegram: skipMigrationGate(entry('beta', 'Pair and inspect the Telegram remote-control transport', 'dist/core/commands/telegram-command.js', argsCommand(() => import('../core/commands/telegram-command.js'), 'telegramCommand', 'dist/core/commands/telegram-command.js'))),
|
|
188
191
|
hooks: skipMigrationGate(entry('beta', 'Explain and inspect Codex hooks', 'dist/commands/hooks.js', directCommand(() => import('../commands/hooks.js'), 'dist/commands/hooks.js'))),
|
|
189
|
-
'zellij-lane': entry('beta', 'Render a Zellij lane frame for SKS sessions', 'dist/commands/zellij-lane.js', directCommand(() => import('../commands/zellij-lane.js'), 'dist/commands/zellij-lane.js')),
|
|
190
|
-
'zellij-slot-pane': entry('beta', 'Render a compact Zellij worker slot pane', 'dist/commands/zellij-slot-pane.js', directCommand(() => import('../commands/zellij-slot-pane.js'), 'dist/commands/zellij-slot-pane.js')),
|
|
191
|
-
'zellij-monitor-pane': skipMigrationGate(readOnly(entry('beta', 'Render the live Zellij MAD/Naruto monitor pane', 'dist/commands/zellij-monitor-pane.js', directCommand(() => import('../commands/zellij-monitor-pane.js'), 'dist/commands/zellij-monitor-pane.js')))),
|
|
192
|
-
'zellij-viewport-pane': skipMigrationGate(readOnly(entry('beta', 'Render a dynamically bound Zellij worker viewport pane', 'dist/commands/zellij-viewport-pane.js', directCommand(() => import('../commands/zellij-viewport-pane.js'), 'dist/commands/zellij-viewport-pane.js')))),
|
|
193
|
-
'zellij-slot-column-anchor': entry('beta', 'Render the compact SLOTS anchor pane for first-slot-down Zellij stacks', 'dist/commands/zellij-slot-column-anchor.js', directCommand(() => import('../commands/zellij-slot-column-anchor.js'), 'dist/commands/zellij-slot-column-anchor.js')),
|
|
194
|
-
zellij: activeRouteDiagnostic(entry('beta', 'Inspect Zellij runtime status and explain repair (no auto-install)', 'dist/commands/zellij.js', directCommand(() => import('../commands/zellij.js'), 'dist/commands/zellij.js'))),
|
|
195
192
|
'mad-sks': routeStateMutator(entry('beta', 'MAD-SKS scoped permission modifier + SQL-plane execution', 'dist/commands/mad-sks.js', directCommand(() => import('../commands/mad-sks.js'), 'dist/commands/mad-sks.js')), ['mad-sks-gate.json']),
|
|
196
193
|
'auto-review': entry('beta', 'Manage auto-review profile', 'dist/commands/auto-review.js', directCommand(() => import('../commands/auto-review.js'), 'dist/commands/auto-review.js')),
|
|
197
194
|
'dollar-commands': entry('stable', 'List Codex App dollar commands', 'dist/core/commands/basic-cli.js', basicArgs('dollarCommandsCommand')),
|
|
@@ -260,6 +257,7 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
|
|
|
260
257
|
check: { risk: 'R1', latency: 'long' },
|
|
261
258
|
'commit-and-push': { risk: 'R3' },
|
|
262
259
|
'computer-use': { latency: 'long' },
|
|
260
|
+
config: { risk: 'R2', supportsJson: true, remoteAllowed: false, inputProfile: 'json-only' },
|
|
263
261
|
dfix: { latency: 'long' },
|
|
264
262
|
eval: { latency: 'long' },
|
|
265
263
|
gates: {
|
|
@@ -267,6 +265,7 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
|
|
|
267
265
|
},
|
|
268
266
|
harness: { latency: 'long' },
|
|
269
267
|
'image-ux-review': { latency: 'long' },
|
|
268
|
+
install: { risk: 'R2', latency: 'long' },
|
|
270
269
|
loop: { latency: 'long' },
|
|
271
270
|
'mad-sks': { risk: 'R3', latency: 'long' },
|
|
272
271
|
mcp: { risk: 'R2', latency: 'long', supportsJson: true, inputProfile: 'json-only' },
|
|
@@ -307,6 +306,7 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
|
|
|
307
306
|
requiredCapabilities: ['proof.stop-gate']
|
|
308
307
|
},
|
|
309
308
|
task: { risk: 'R1', latency: 'long' },
|
|
309
|
+
telegram: { risk: 'R2', supportsJson: true, remoteAllowed: false, inputProfile: 'json-only' },
|
|
310
310
|
trust: {
|
|
311
311
|
risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, inputProfile: 'trust', requiredCapabilities: ['proof.trust']
|
|
312
312
|
},
|
|
@@ -55,14 +55,14 @@ export async function featuresCommand(sub = 'list', args = []) {
|
|
|
55
55
|
}
|
|
56
56
|
if (action === 'complete') {
|
|
57
57
|
const report = await writeAllFeatureCompletionReport({ root });
|
|
58
|
+
if (!report.ok)
|
|
59
|
+
process.exitCode = report.status === 'contract_covered_unverified' ? 2 : 1;
|
|
58
60
|
if (flag(args, '--json'))
|
|
59
61
|
console.log(JSON.stringify(report, null, 2));
|
|
60
62
|
else {
|
|
61
63
|
console.log(`All feature completion: ${report.status}`);
|
|
62
64
|
console.log(`Report: ${path.relative(root, report.files.json)}`);
|
|
63
65
|
}
|
|
64
|
-
if (!report.ok)
|
|
65
|
-
process.exitCode = 1;
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
console.error('Usage: sks features list|check|inventory|complete [--json] [--write-docs]');
|
|
@@ -73,12 +73,14 @@ export async function allFeaturesCommand(sub = 'selftest', args = []) {
|
|
|
73
73
|
if (action === 'complete' || action === 'completion') {
|
|
74
74
|
const root = await projectRoot();
|
|
75
75
|
const report = await writeAllFeatureCompletionReport({ root });
|
|
76
|
-
if (flag(args, '--json'))
|
|
77
|
-
return console.log(JSON.stringify(report, null, 2));
|
|
78
|
-
console.log(`All feature completion: ${report.status}`);
|
|
79
|
-
console.log(`Report: ${path.relative(root, report.files.json)}`);
|
|
80
76
|
if (!report.ok)
|
|
81
|
-
process.exitCode = 1;
|
|
77
|
+
process.exitCode = report.status === 'contract_covered_unverified' ? 2 : 1;
|
|
78
|
+
if (flag(args, '--json'))
|
|
79
|
+
console.log(JSON.stringify(report, null, 2));
|
|
80
|
+
else {
|
|
81
|
+
console.log(`All feature completion: ${report.status}`);
|
|
82
|
+
console.log(`Report: ${path.relative(root, report.files.json)}`);
|
|
83
|
+
}
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
86
|
if (action !== 'selftest') {
|
|
@@ -172,16 +172,19 @@ function codexLbServiceTierEvidence(...responses) {
|
|
|
172
172
|
fast_actual: actual === CODEX_LB_CANONICAL_FAST_SERVICE_TIER || effective === CODEX_LB_CANONICAL_FAST_SERVICE_TIER
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
function codexLbGatewayHeaders(apiKey, authTransport = 'x-codex-lb-api-key') {
|
|
176
|
+
const credentialHeader = String(authTransport).startsWith('authorization-bearer')
|
|
177
|
+
? { authorization: `Bearer ${String(apiKey)}` }
|
|
178
|
+
: { 'X-Codex-LB-API-Key': String(apiKey) };
|
|
179
|
+
return { ...credentialHeader, 'content-type': 'application/json' };
|
|
180
|
+
}
|
|
181
|
+
async function fetchCodexLbResponse(fetchImpl, endpoint, apiKey, body, timeoutMs, authTransport = 'x-codex-lb-api-key') {
|
|
176
182
|
const controller = new AbortController();
|
|
177
183
|
const timer = setTimeout(() => controller.abort(), timeoutMs).unref?.();
|
|
178
184
|
try {
|
|
179
185
|
const response = await fetchImpl(endpoint, {
|
|
180
186
|
method: 'POST',
|
|
181
|
-
headers:
|
|
182
|
-
authorization: `Bearer ${apiKey}`,
|
|
183
|
-
'content-type': 'application/json'
|
|
184
|
-
},
|
|
187
|
+
headers: codexLbGatewayHeaders(apiKey, authTransport),
|
|
185
188
|
body: JSON.stringify(body),
|
|
186
189
|
redirect: 'error',
|
|
187
190
|
signal: controller.signal
|
|
@@ -204,6 +207,193 @@ async function fetchCodexLbResponse(fetchImpl, endpoint, apiKey, body, timeoutMs
|
|
|
204
207
|
clearTimeout(timer);
|
|
205
208
|
}
|
|
206
209
|
}
|
|
210
|
+
const CODEX_LB_CONNECT_TEST_MAX_OUTPUT_TOKENS = 32;
|
|
211
|
+
const CODEX_LB_CONNECT_TEST_MAX_RESULT_CHARS = 256;
|
|
212
|
+
const CODEX_LB_CONNECT_TEST_MAX_ERROR_CHARS = 512;
|
|
213
|
+
const CODEX_LB_CONNECT_TEST_TIMEOUT_MS = 15_000;
|
|
214
|
+
function boundedText(value, maxChars) {
|
|
215
|
+
const text = String(value || '').trim();
|
|
216
|
+
return text.length <= maxChars ? text : text.slice(0, maxChars);
|
|
217
|
+
}
|
|
218
|
+
function codexLbCompletedResponse(json, events = []) {
|
|
219
|
+
if (json?.response && typeof json.response === 'object')
|
|
220
|
+
return json.response;
|
|
221
|
+
if (json?.data?.response && typeof json.data.response === 'object')
|
|
222
|
+
return json.data.response;
|
|
223
|
+
if (json?.data && typeof json.data === 'object')
|
|
224
|
+
return json.data;
|
|
225
|
+
if (json && typeof json === 'object')
|
|
226
|
+
return json;
|
|
227
|
+
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
228
|
+
const event = events[index];
|
|
229
|
+
if (event?.type === 'response.completed' && event?.response && typeof event.response === 'object') {
|
|
230
|
+
return event.response;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
function codexLbOutputText(response, events = []) {
|
|
236
|
+
const parts = [];
|
|
237
|
+
for (const output of Array.isArray(response?.output) ? response.output : []) {
|
|
238
|
+
for (const content of Array.isArray(output?.content) ? output.content : []) {
|
|
239
|
+
if (content?.type === 'output_text' && typeof content.text === 'string' && content.text.trim()) {
|
|
240
|
+
parts.push(content.text.trim());
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (parts.length === 0) {
|
|
245
|
+
for (const event of events) {
|
|
246
|
+
if (event?.type === 'response.output_text.done' && typeof event.text === 'string' && event.text.trim()) {
|
|
247
|
+
parts.push(event.text.trim());
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return parts.join('\n').trim();
|
|
252
|
+
}
|
|
253
|
+
function boundedCodexLbUsage(usage) {
|
|
254
|
+
const tokenCount = (value) => Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
255
|
+
return {
|
|
256
|
+
input_tokens: tokenCount(usage?.input_tokens),
|
|
257
|
+
output_tokens: tokenCount(usage?.output_tokens),
|
|
258
|
+
total_tokens: tokenCount(usage?.total_tokens),
|
|
259
|
+
reasoning_tokens: tokenCount(usage?.output_tokens_details?.reasoning_tokens)
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function codexLbConnectTestFailure(status, extra = {}) {
|
|
263
|
+
return {
|
|
264
|
+
schema: 'sks.codex-lb-connect-test.v1',
|
|
265
|
+
ok: false,
|
|
266
|
+
status,
|
|
267
|
+
response_id: null,
|
|
268
|
+
model: extra.model || null,
|
|
269
|
+
latency_ms: extra.latency_ms ?? null,
|
|
270
|
+
usage: extra.usage || null,
|
|
271
|
+
result: null,
|
|
272
|
+
result_truncated: false,
|
|
273
|
+
http_status: extra.http_status ?? null,
|
|
274
|
+
blockers: Array.isArray(extra.blockers) ? extra.blockers : [status],
|
|
275
|
+
...(extra.error ? { error: extra.error } : {})
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
export async function testCodexLbConnection(status = {}, opts = {}) {
|
|
279
|
+
const providerSelected = status?.selected === true || status?.provider?.selected === true;
|
|
280
|
+
if (opts.requireSelected === true && !providerSelected) {
|
|
281
|
+
return codexLbConnectTestFailure('provider_unselected', {
|
|
282
|
+
blockers: ['codex_lb_provider_not_selected']
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
const credentialBindingBlockers = Array.isArray(opts.credentialBindingBlockers)
|
|
286
|
+
? opts.credentialBindingBlockers.map((value) => boundedText(value, 128)).filter(Boolean)
|
|
287
|
+
: [];
|
|
288
|
+
if (credentialBindingBlockers.length > 0) {
|
|
289
|
+
return codexLbConnectTestFailure('credential_binding_drift', { blockers: credentialBindingBlockers });
|
|
290
|
+
}
|
|
291
|
+
if (status.provider_base_url_matches_credential !== true) {
|
|
292
|
+
return codexLbConnectTestFailure('provider_base_url_mismatch', {
|
|
293
|
+
blockers: ['codex_lb_provider_base_url_mismatch']
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
if (status.provider_contract_ok !== true) {
|
|
297
|
+
return codexLbConnectTestFailure('provider_contract_drift', {
|
|
298
|
+
blockers: ['codex_lb_provider_contract_drift']
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
const baseUrl = opts.baseUrl || status.base_url;
|
|
302
|
+
const endpoint = codexLbResponsesEndpoint(baseUrl);
|
|
303
|
+
if (!endpoint)
|
|
304
|
+
return codexLbConnectTestFailure('missing_base_url');
|
|
305
|
+
const transportBlocker = codexLbBaseUrlSecurityBlocker(baseUrl);
|
|
306
|
+
if (transportBlocker)
|
|
307
|
+
return codexLbConnectTestFailure('transport_blocked', { blockers: [transportBlocker] });
|
|
308
|
+
const env = opts.env || process.env;
|
|
309
|
+
const home = opts.home || env.HOME || os.homedir();
|
|
310
|
+
const apiKey = opts.apiKey || parseCodexLbEnvKey(await readText(opts.envPath || status.env_path || codexLbEnvPath(home), ''));
|
|
311
|
+
if (!apiKey)
|
|
312
|
+
return codexLbConnectTestFailure('missing_env_key');
|
|
313
|
+
const model = String(opts.model || env.SKS_CODEX_MODEL || env.CODEX_MODEL || '').trim();
|
|
314
|
+
if (!model)
|
|
315
|
+
return codexLbConnectTestFailure('model_unselected');
|
|
316
|
+
if (model.length > 128)
|
|
317
|
+
return codexLbConnectTestFailure('model_invalid');
|
|
318
|
+
const fetchImpl = opts.fetch || globalThis.fetch;
|
|
319
|
+
if (typeof fetchImpl !== 'function')
|
|
320
|
+
return codexLbConnectTestFailure('fetch_unavailable', { model });
|
|
321
|
+
const timeoutMs = Number(opts.timeoutMs || env.SKS_CODEX_LB_CONNECT_TEST_TIMEOUT_MS || CODEX_LB_CONNECT_TEST_TIMEOUT_MS);
|
|
322
|
+
const body = {
|
|
323
|
+
model,
|
|
324
|
+
input: 'Reply OK.',
|
|
325
|
+
store: false,
|
|
326
|
+
reasoning: { effort: 'low' },
|
|
327
|
+
max_output_tokens: CODEX_LB_CONNECT_TEST_MAX_OUTPUT_TOKENS
|
|
328
|
+
};
|
|
329
|
+
const nowMs = typeof opts.nowMs === 'function' ? opts.nowMs : Date.now;
|
|
330
|
+
const startedAt = nowMs();
|
|
331
|
+
const fetched = await fetchCodexLbResponse(fetchImpl, endpoint, apiKey, body, timeoutMs, opts.gatewayAuthTransport);
|
|
332
|
+
const latencyMs = Math.max(0, Math.round(nowMs() - startedAt));
|
|
333
|
+
if (!fetched.ok) {
|
|
334
|
+
const error = redactSecretText(fetched.error_payload?.error?.message
|
|
335
|
+
|| fetched.error_payload?.response?.error?.message
|
|
336
|
+
|| fetched.text
|
|
337
|
+
|| 'codex-lb Responses request failed', [apiKey]);
|
|
338
|
+
return codexLbConnectTestFailure('request_failed', {
|
|
339
|
+
model,
|
|
340
|
+
latency_ms: latencyMs,
|
|
341
|
+
http_status: fetched.status,
|
|
342
|
+
error: boundedText(error, CODEX_LB_CONNECT_TEST_MAX_ERROR_CHARS)
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
const response = codexLbCompletedResponse(fetched.json, fetched.events);
|
|
346
|
+
const responseId = boundedText(codexLbResponseId(response), 128);
|
|
347
|
+
const responseModel = boundedText(response?.model || model, 128);
|
|
348
|
+
const usage = boundedCodexLbUsage(response?.usage);
|
|
349
|
+
if (!responseId) {
|
|
350
|
+
return codexLbConnectTestFailure('missing_response_id', {
|
|
351
|
+
model: responseModel,
|
|
352
|
+
latency_ms: latencyMs,
|
|
353
|
+
http_status: fetched.status,
|
|
354
|
+
usage
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
if (response?.error) {
|
|
358
|
+
return codexLbConnectTestFailure('response_error', {
|
|
359
|
+
model: responseModel,
|
|
360
|
+
latency_ms: latencyMs,
|
|
361
|
+
http_status: fetched.status,
|
|
362
|
+
usage,
|
|
363
|
+
error: boundedText(redactSecretText(response.error?.message || response.error, [apiKey]), CODEX_LB_CONNECT_TEST_MAX_ERROR_CHARS)
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
if (response?.status !== 'completed') {
|
|
367
|
+
return codexLbConnectTestFailure('response_not_completed', {
|
|
368
|
+
model: responseModel,
|
|
369
|
+
latency_ms: latencyMs,
|
|
370
|
+
http_status: fetched.status,
|
|
371
|
+
usage
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
const outputText = codexLbOutputText(response, fetched.events);
|
|
375
|
+
if (!outputText) {
|
|
376
|
+
return codexLbConnectTestFailure('empty_result', {
|
|
377
|
+
model: responseModel,
|
|
378
|
+
latency_ms: latencyMs,
|
|
379
|
+
http_status: fetched.status,
|
|
380
|
+
usage
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
return {
|
|
384
|
+
schema: 'sks.codex-lb-connect-test.v1',
|
|
385
|
+
ok: true,
|
|
386
|
+
status: 'connected',
|
|
387
|
+
response_id: responseId,
|
|
388
|
+
model: responseModel,
|
|
389
|
+
latency_ms: latencyMs,
|
|
390
|
+
usage,
|
|
391
|
+
result: boundedText(outputText, CODEX_LB_CONNECT_TEST_MAX_RESULT_CHARS),
|
|
392
|
+
result_truncated: outputText.length > CODEX_LB_CONNECT_TEST_MAX_RESULT_CHARS,
|
|
393
|
+
http_status: fetched.status,
|
|
394
|
+
blockers: []
|
|
395
|
+
};
|
|
396
|
+
}
|
|
207
397
|
export async function checkCodexLbResponseChain(status = {}, opts = {}) {
|
|
208
398
|
const env = opts.env || process.env;
|
|
209
399
|
if (!codexLbChainCheckEnabled(env) && !opts.force)
|
|
@@ -246,6 +436,7 @@ export async function checkCodexLbResponseChain(status = {}, opts = {}) {
|
|
|
246
436
|
if (!model)
|
|
247
437
|
return { ok: true, status: 'skipped', skipped: true, reason: 'model_unselected_use_explicit_model_or_codex_catalog' };
|
|
248
438
|
const timeoutMs = Number(opts.timeoutMs || env.SKS_CODEX_LB_CHAIN_CHECK_TIMEOUT_MS || 8000);
|
|
439
|
+
const gatewayAuthTransport = opts.gatewayAuthTransport || 'x-codex-lb-api-key';
|
|
249
440
|
const serviceTier = opts.fastMode === true || opts.serviceTier === 'fast' || opts.serviceTier === CODEX_LB_CANONICAL_FAST_SERVICE_TIER
|
|
250
441
|
? CODEX_LB_CANONICAL_FAST_SERVICE_TIER
|
|
251
442
|
: null;
|
|
@@ -260,7 +451,7 @@ export async function checkCodexLbResponseChain(status = {}, opts = {}) {
|
|
|
260
451
|
tool_choice: 'auto',
|
|
261
452
|
reasoning: { effort: 'low' }
|
|
262
453
|
};
|
|
263
|
-
const first = await fetchCodexLbResponse(fetchImpl, endpoint, apiKey, baseBody, timeoutMs);
|
|
454
|
+
const first = await fetchCodexLbResponse(fetchImpl, endpoint, apiKey, baseBody, timeoutMs, gatewayAuthTransport);
|
|
264
455
|
if (!first.ok || !first.response_id) {
|
|
265
456
|
return recordCodexLbChainHealth(await writeCodexLbChainCache({
|
|
266
457
|
ok: false,
|
|
@@ -273,7 +464,7 @@ export async function checkCodexLbResponseChain(status = {}, opts = {}) {
|
|
|
273
464
|
error: redactSecretText(first.error_payload?.error?.message || first.error_payload?.response?.error?.message || first.text || 'codex-lb first Responses request failed', [apiKey])
|
|
274
465
|
}, { endpoint, home, opts, env }), opts);
|
|
275
466
|
}
|
|
276
|
-
const second = await fetchCodexLbResponse(fetchImpl, endpoint, apiKey, { ...baseBody, previous_response_id: first.response_id }, timeoutMs);
|
|
467
|
+
const second = await fetchCodexLbResponse(fetchImpl, endpoint, apiKey, { ...baseBody, previous_response_id: first.response_id }, timeoutMs, gatewayAuthTransport);
|
|
277
468
|
if (second.ok)
|
|
278
469
|
return recordCodexLbChainHealth(await writeCodexLbChainCache({ ok: true, status: 'chain_ok', endpoint, response_id: first.response_id, chained_response_id: second.response_id || null, http_status: second.status, requested_service_tier: serviceTier, service_tier_evidence: codexLbServiceTierEvidence(first, second) }, { endpoint, home, opts, env }), opts);
|
|
279
470
|
const previousMissing = isPreviousResponseNotFound(second.error_payload || second.json || second.text);
|
|
@@ -10,17 +10,46 @@ import { reconcileRetiredSksConfigText } from '../core/auto-review.js';
|
|
|
10
10
|
import { ensureTrailingNewline, removeTopLevelTomlKeyIfValue, safeWriteCodexConfigToml, upsertTopLevelTomlString, upsertTomlTable } from '../core/codex-runtime/codex-desktop-config-policy.js';
|
|
11
11
|
import { codexLbConfigPath, normalizeCodexLbBaseUrl } from './install-helpers-codex-lb-shared.js';
|
|
12
12
|
import { escapeRegExp } from '../core/text/regex.js';
|
|
13
|
+
import { upsertExplicitCodexProviderMode } from '../core/codex-app/provider-mode.js';
|
|
13
14
|
export const CODEX_LB_DESKTOP_BRIDGE_MARKER = '# sks-codex-lb-managed-desktop-bridge';
|
|
14
15
|
export const CODEX_LB_DESKTOP_COMPAT_MARKER = '# sks-codex-lb-managed-desktop-compat';
|
|
15
16
|
export const CODEX_LB_MODEL_CATALOG_MARKER = '# sks-codex-lb-managed-model-catalog';
|
|
16
|
-
const
|
|
17
|
+
export const CODEX_LB_PROVIDER_SELECTION_MARKER = '# sks-codex-lb-managed-provider-selection';
|
|
18
|
+
export const CODEX_LB_OAUTH_SELECTION_MARKER = '# sks-codex-lb-managed-oauth-selection';
|
|
19
|
+
export const LEGACY_CODEX_LB_OPENAI_ROUTING_MARKER = '# sks-codex-lb-managed-openai-base-url';
|
|
20
|
+
export function removeCodexLbOrphanManagedMarkers(text) {
|
|
21
|
+
const source = String(text || '');
|
|
22
|
+
const selectedProvider = topLevelTomlString(source, 'model_provider');
|
|
23
|
+
const markerTargets = [
|
|
24
|
+
[CODEX_LB_DESKTOP_BRIDGE_MARKER, Boolean(topLevelTomlString(source, 'openai_base_url'))],
|
|
25
|
+
[LEGACY_CODEX_LB_OPENAI_ROUTING_MARKER, Boolean(topLevelTomlString(source, 'openai_base_url'))],
|
|
26
|
+
[CODEX_LB_DESKTOP_COMPAT_MARKER, selectedProvider === 'codex-lb'],
|
|
27
|
+
[CODEX_LB_MODEL_CATALOG_MARKER, Boolean(topLevelTomlString(source, 'model_catalog_json'))],
|
|
28
|
+
[CODEX_LB_PROVIDER_SELECTION_MARKER, selectedProvider === 'codex-lb'],
|
|
29
|
+
[CODEX_LB_OAUTH_SELECTION_MARKER, selectedProvider === 'openai']
|
|
30
|
+
];
|
|
31
|
+
const orphanMarkers = markerTargets
|
|
32
|
+
.filter(([marker, hasManagedContent]) => topLevelHasLine(source, marker) && !hasManagedContent)
|
|
33
|
+
.map(([marker]) => marker);
|
|
34
|
+
let next = source;
|
|
35
|
+
for (const marker of orphanMarkers)
|
|
36
|
+
next = removeTopLevelLine(next, marker);
|
|
37
|
+
return {
|
|
38
|
+
schema: 'sks.codex-lb-orphan-managed-marker-cleanup.v1',
|
|
39
|
+
changed: orphanMarkers.length > 0,
|
|
40
|
+
orphan_markers: orphanMarkers,
|
|
41
|
+
text: next
|
|
42
|
+
};
|
|
43
|
+
}
|
|
17
44
|
export function upsertCodexLbNativeDesktopConfig(text, input) {
|
|
18
|
-
let next = String(text || '');
|
|
45
|
+
let next = removeCodexLbOrphanManagedMarkers(String(text || '')).text;
|
|
19
46
|
const selectedProvider = topLevelTomlString(next, 'model_provider');
|
|
20
47
|
if (selectedProvider && selectedProvider !== 'openai' && selectedProvider !== 'codex-lb') {
|
|
21
48
|
throw new Error('codex_lb_user_owned_model_provider_conflict');
|
|
22
49
|
}
|
|
23
|
-
if (selectedProvider === 'codex-lb'
|
|
50
|
+
if (selectedProvider === 'codex-lb'
|
|
51
|
+
&& !topLevelHasLine(next, CODEX_LB_DESKTOP_COMPAT_MARKER)
|
|
52
|
+
&& !topLevelHasLine(next, CODEX_LB_PROVIDER_SELECTION_MARKER)) {
|
|
24
53
|
throw new Error('codex_lb_legacy_desktop_config_requires_migration');
|
|
25
54
|
}
|
|
26
55
|
if (topLevelHasLine(next, LEGACY_CODEX_LB_OPENAI_ROUTING_MARKER)
|
|
@@ -31,12 +60,13 @@ export function upsertCodexLbNativeDesktopConfig(text, input) {
|
|
|
31
60
|
if (modelCatalog && !topLevelHasLine(next, CODEX_LB_MODEL_CATALOG_MARKER)) {
|
|
32
61
|
throw new Error('codex_lb_user_owned_model_catalog_json_conflict');
|
|
33
62
|
}
|
|
34
|
-
next =
|
|
63
|
+
next = removeManagedCodexLbSelection(next);
|
|
35
64
|
next = removeTopLevelLine(next, CODEX_LB_DESKTOP_COMPAT_MARKER);
|
|
36
65
|
next = removeManagedModelCatalogJson(next);
|
|
37
|
-
next = upsertManagedTopLevelTomlString(next, 'openai_base_url', input.bridgeBaseUrl, CODEX_LB_DESKTOP_BRIDGE_MARKER);
|
|
66
|
+
next = upsertManagedTopLevelTomlString(next, 'openai_base_url', input.bridgeBaseUrl, CODEX_LB_DESKTOP_BRIDGE_MARKER, [LEGACY_CODEX_LB_OPENAI_ROUTING_MARKER]);
|
|
67
|
+
next = upsertTopLevelTomlString(next, 'model_provider', 'openai');
|
|
38
68
|
next = upsertTomlTable(next, 'model_providers.codex-lb', cliProviderBlock(input.remoteBaseUrl));
|
|
39
|
-
return ensureTrailingNewline(next);
|
|
69
|
+
return ensureTrailingNewline(upsertExplicitCodexProviderMode(next, 'codex-lb'));
|
|
40
70
|
}
|
|
41
71
|
export function upsertCodexLbCompatDesktopConfig(text, input) {
|
|
42
72
|
let next = removeManagedDesktopBridgeRouting(String(text || ''));
|
|
@@ -55,19 +85,50 @@ export function upsertCodexLbCompatDesktopConfig(text, input) {
|
|
|
55
85
|
return ensureTrailingNewline(next);
|
|
56
86
|
}
|
|
57
87
|
export function upsertCodexLbCliProviderConfig(text, input) {
|
|
88
|
+
const cleaned = removeCodexLbOrphanManagedMarkers(String(text || '')).text;
|
|
89
|
+
if (topLevelHasLine(cleaned, LEGACY_CODEX_LB_OPENAI_ROUTING_MARKER)) {
|
|
90
|
+
throw new Error('codex_lb_legacy_desktop_config_requires_migration');
|
|
91
|
+
}
|
|
92
|
+
const cliBase = removeCodexLbManagedDesktopConfig(cleaned);
|
|
93
|
+
const claimedSelection = input.selectGlobally === true
|
|
94
|
+
&& topLevelTomlString(cliBase, 'model_provider') === 'codex-lb'
|
|
95
|
+
&& !topLevelHasLine(cliBase, CODEX_LB_PROVIDER_SELECTION_MARKER)
|
|
96
|
+
? addTopLevelMarkerBeforeKey(cliBase, 'model_provider', CODEX_LB_PROVIDER_SELECTION_MARKER)
|
|
97
|
+
: cliBase;
|
|
58
98
|
let next = input.selectGlobally === true
|
|
59
|
-
?
|
|
60
|
-
:
|
|
99
|
+
? upsertManagedTopLevelTomlString(removeTopLevelTomlKeyIfValue(removeManagedOAuthSelection(claimedSelection), 'model_provider', 'openai'), 'model_provider', 'codex-lb', CODEX_LB_PROVIDER_SELECTION_MARKER)
|
|
100
|
+
: removeManagedCodexLbSelection(cliBase);
|
|
61
101
|
next = upsertTomlTable(next, 'model_providers.codex-lb', cliProviderBlock(input.remoteBaseUrl));
|
|
62
102
|
return ensureTrailingNewline(next);
|
|
63
103
|
}
|
|
104
|
+
export function restoreCodexLbOAuthSelectionConfig(text) {
|
|
105
|
+
let next = removeManagedCodexLbSelection(String(text || ''));
|
|
106
|
+
next = upsertManagedTopLevelTomlString(next, 'model_provider', 'openai', CODEX_LB_OAUTH_SELECTION_MARKER);
|
|
107
|
+
return ensureTrailingNewline(upsertExplicitCodexProviderMode(next, 'chatgpt-oauth'));
|
|
108
|
+
}
|
|
109
|
+
export function removeManagedCodexLbSelection(text) {
|
|
110
|
+
let next = removeTopLevelTomlKeyIfValue(String(text || ''), 'model_provider', 'codex-lb');
|
|
111
|
+
next = removeTopLevelLine(next, CODEX_LB_PROVIDER_SELECTION_MARKER);
|
|
112
|
+
return next;
|
|
113
|
+
}
|
|
114
|
+
function removeManagedOAuthSelection(text) {
|
|
115
|
+
let next = String(text || '');
|
|
116
|
+
if (topLevelHasLine(next, CODEX_LB_OAUTH_SELECTION_MARKER)) {
|
|
117
|
+
next = removeTopLevelTomlKeyIfValue(next, 'model_provider', 'openai');
|
|
118
|
+
next = removeTopLevelLine(next, CODEX_LB_OAUTH_SELECTION_MARKER);
|
|
119
|
+
}
|
|
120
|
+
return next;
|
|
121
|
+
}
|
|
64
122
|
export function removeCodexLbManagedDesktopConfig(text) {
|
|
65
|
-
let next = removeManagedDesktopBridgeRouting(String(text || ''));
|
|
123
|
+
let next = removeManagedDesktopBridgeRouting(removeCodexLbOrphanManagedMarkers(String(text || '')).text);
|
|
66
124
|
if (topLevelHasLine(next, CODEX_LB_DESKTOP_COMPAT_MARKER)) {
|
|
67
125
|
next = removeTopLevelTomlKeyIfValue(next, 'model_provider', 'codex-lb');
|
|
68
126
|
next = removeTopLevelLine(next, CODEX_LB_DESKTOP_COMPAT_MARKER);
|
|
69
127
|
}
|
|
70
128
|
next = removeManagedModelCatalogJson(next);
|
|
129
|
+
if (topLevelTomlString(next, 'model_provider') === 'codex-lb') {
|
|
130
|
+
next = restoreCodexLbOAuthSelectionConfig(next);
|
|
131
|
+
}
|
|
71
132
|
return ensureTrailingNewline(next);
|
|
72
133
|
}
|
|
73
134
|
export function removeManagedModelCatalogJson(text) {
|
|
@@ -100,7 +161,7 @@ function cliProviderBlock(remoteBaseUrl) {
|
|
|
100
161
|
'name = "codex-lb"',
|
|
101
162
|
`base_url = ${JSON.stringify(remoteBaseUrl)}`,
|
|
102
163
|
'wire_api = "responses"',
|
|
103
|
-
'
|
|
164
|
+
'env_http_headers = { "X-Codex-LB-API-Key" = "CODEX_LB_API_KEY" }',
|
|
104
165
|
'supports_websockets = true',
|
|
105
166
|
'requires_openai_auth = false'
|
|
106
167
|
].join('\n');
|
|
@@ -159,6 +220,13 @@ export function upsertCodexLbSharedOpenAiRouting(text = '', baseUrl = '') {
|
|
|
159
220
|
}
|
|
160
221
|
export function removeCodexLbSharedOpenAiRouting(text = '', baseUrl = '') {
|
|
161
222
|
const state = codexLbSharedOpenAiRoutingState(text, baseUrl);
|
|
223
|
+
if (state.status === 'missing' && state.managed) {
|
|
224
|
+
return {
|
|
225
|
+
...state,
|
|
226
|
+
changed: true,
|
|
227
|
+
text: removeTopLevelLine(String(text || ''), CODEX_LB_SHARED_OPENAI_ROUTING_MARKER)
|
|
228
|
+
};
|
|
229
|
+
}
|
|
162
230
|
if (state.status !== 'matched' || !state.managed)
|
|
163
231
|
return { ...state, changed: false, text: String(text || '') };
|
|
164
232
|
const withoutValue = removeTopLevelTomlKeyIfValue(text, 'openai_base_url', state.expected_base_url);
|
|
@@ -10,7 +10,6 @@ import { EMPTY_CODEX_INFO, getCodexInfo } from '../core/codex-adapter.js';
|
|
|
10
10
|
import { formatHarnessConflictReport, llmHarnessCleanupPrompt, scanHarnessConflicts } from '../core/harness-conflicts.js';
|
|
11
11
|
import { initProject, installGlobalSkills } from '../core/init.js';
|
|
12
12
|
import { context7ConfigToml, DOLLAR_SKILL_NAMES, GETDESIGN_REFERENCE, hasContext7ConfigText, RECOMMENDED_SKILLS } from '../core/routes.js';
|
|
13
|
-
import { checkZellijCapability } from '../core/zellij/zellij-capability.js';
|
|
14
13
|
import { reconcileCodexAppUpgradeProcesses } from '../core/codex-app.js';
|
|
15
14
|
import { restartCodexApp } from '../core/codex-app/codex-app-restart.js';
|
|
16
15
|
import { cleanupMacLaunchSecretEnvironment } from '../core/codex-app/menubar/index.js';
|
|
@@ -72,12 +71,13 @@ export async function selftestSksShimRepair() {
|
|
|
72
71
|
const staleShimTmp = tmpdir();
|
|
73
72
|
const staleBin = path.join(staleShimTmp, 'old-prefix', 'bin');
|
|
74
73
|
const stalePkg = path.join(staleShimTmp, 'old-prefix', 'lib', 'node_modules', 'sneakoscope');
|
|
75
|
-
|
|
74
|
+
const staleEntrypoint = path.join(stalePkg, 'dist', 'bin', 'sks.js');
|
|
75
|
+
await ensureDir(path.dirname(staleEntrypoint));
|
|
76
76
|
await ensureDir(staleBin);
|
|
77
77
|
await writeTextAtomic(path.join(stalePkg, 'package.json'), JSON.stringify({ name: 'sneakoscope', version: '0.0.1' }, null, 2));
|
|
78
|
-
await writeTextAtomic(
|
|
79
|
-
await fsp.chmod(
|
|
80
|
-
await fsp.symlink(
|
|
78
|
+
await writeTextAtomic(staleEntrypoint, '#!/usr/bin/env node\nconsole.log("sneakoscope 0.0.1");\n');
|
|
79
|
+
await fsp.chmod(staleEntrypoint, 0o755).catch(() => { });
|
|
80
|
+
await fsp.symlink(staleEntrypoint, path.join(staleBin, 'sks'));
|
|
81
81
|
const repair = await ensureSksCommandDuringInstall({ force: true, pathEnv: staleBin, home: path.join(staleShimTmp, 'home') });
|
|
82
82
|
if (repair.status !== 'repaired')
|
|
83
83
|
throw new Error(`selftest: stale global sks shim was not repaired (${repair.status})`);
|
|
@@ -136,10 +136,13 @@ async function inspectSksPathShim(candidate, opts = {}) {
|
|
|
136
136
|
}
|
|
137
137
|
function sksPackageRootForBin(file) {
|
|
138
138
|
const normalized = String(file || '').split(path.sep).join('/');
|
|
139
|
-
const marker = '/node_modules/sneakoscope/
|
|
139
|
+
const marker = '/node_modules/sneakoscope/';
|
|
140
140
|
const idx = normalized.lastIndexOf(marker);
|
|
141
141
|
if (idx < 0)
|
|
142
142
|
return null;
|
|
143
|
+
const relative = normalized.slice(idx + marker.length);
|
|
144
|
+
if (!/^(?:dist\/)?bin\//.test(relative))
|
|
145
|
+
return null;
|
|
143
146
|
return normalized.slice(0, idx + '/node_modules/sneakoscope'.length).split('/').join(path.sep);
|
|
144
147
|
}
|
|
145
148
|
async function installedPackageVersion(root) {
|