sneakoscope 6.2.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -13
- package/config/architecture-budgets.v1.json +70 -0
- package/config/perf-budgets.v1.json +9 -1
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/fast-inline.js +4 -5
- package/dist/bin/install.js +2 -3
- package/dist/bin/sks-dispatch.js +2 -7
- package/dist/bin/sks.js +1 -1
- package/dist/cli/args.js +0 -3
- package/dist/cli/cli-theme.js +0 -1
- package/dist/cli/codex-app-command.js +0 -1
- package/dist/cli/command-manifest-lite.js +10 -16
- package/dist/cli/command-registry.js +109 -19
- package/dist/cli/commands-fast.js +0 -1
- package/dist/cli/context7-command.js +0 -1
- package/dist/cli/feature-commands.js +0 -1
- package/dist/cli/global-mode-router.js +31 -1
- package/dist/cli/help-fast.js +2 -4
- package/dist/cli/install-helpers-codex-lb-chain.js +274 -0
- package/dist/cli/install-helpers-codex-lb-config.js +191 -0
- package/dist/cli/install-helpers-codex-lb-selftest-chain.js +115 -0
- package/dist/cli/install-helpers-codex-lb-selftest.js +501 -0
- package/dist/cli/install-helpers-codex-lb-shared.js +52 -0
- package/dist/cli/install-helpers-install-support.js +343 -0
- package/dist/cli/install-helpers.js +23 -1400
- package/dist/cli/install-tool-helpers.js +0 -1
- package/dist/cli/main.js +0 -1
- package/dist/cli/output.js +0 -1
- package/dist/cli/recallpulse-command.js +0 -1
- package/dist/cli/root-fast.js +0 -1
- package/dist/cli/router.js +2 -12
- package/dist/cli/super-search-command.js +0 -1
- package/dist/commands/aliases.js +0 -1
- package/dist/commands/all-features.js +0 -1
- package/dist/commands/auto-review.js +0 -1
- package/dist/commands/autoresearch.js +0 -1
- package/dist/commands/bench.js +0 -1
- package/dist/commands/bootstrap.js +0 -1
- package/dist/commands/code-structure.js +0 -1
- package/dist/commands/codex-app.js +0 -1
- package/dist/commands/codex-lb.js +9 -10
- package/dist/commands/codex-native.js +0 -1
- package/dist/commands/codex.js +0 -1
- package/dist/commands/commands.js +0 -1
- package/dist/commands/commit-and-push.js +0 -1
- package/dist/commands/commit.js +0 -1
- package/dist/commands/computer-use.js +0 -1
- package/dist/commands/conflicts.js +0 -1
- package/dist/commands/context7.js +0 -1
- package/dist/commands/deps.js +0 -1
- package/dist/commands/dfix.js +0 -1
- package/dist/commands/doctor.js +27 -32
- package/dist/commands/dollar-commands.js +0 -1
- package/dist/commands/eval.js +0 -1
- package/dist/commands/features.js +0 -1
- package/dist/commands/fix-path.js +0 -1
- package/dist/commands/gc.js +0 -1
- package/dist/commands/git.js +0 -1
- package/dist/commands/goal.js +0 -1
- package/dist/commands/guard.js +0 -1
- package/dist/commands/gx.js +0 -1
- package/dist/commands/harness.js +0 -1
- package/dist/commands/help.js +0 -1
- package/dist/commands/hook.js +0 -1
- package/dist/commands/hooks.js +0 -1
- package/dist/commands/hproof.js +0 -1
- package/dist/commands/image-ux-review.js +0 -1
- package/dist/commands/init.js +0 -1
- package/dist/commands/mad-sks.js +0 -1
- package/dist/commands/memory.js +0 -1
- package/dist/commands/paths.js +0 -1
- package/dist/commands/perf.js +0 -1
- package/dist/commands/pipeline.js +0 -1
- package/dist/commands/postinstall.js +0 -1
- package/dist/commands/ppt.js +0 -1
- package/dist/commands/profile.js +0 -1
- package/dist/commands/proof-field.js +0 -1
- package/dist/commands/proof.js +0 -1
- package/dist/commands/qa-loop.js +0 -1
- package/dist/commands/quickstart.js +0 -1
- package/dist/commands/reasoning.js +0 -1
- package/dist/commands/recallpulse.js +0 -1
- package/dist/commands/research.js +0 -1
- package/dist/commands/rollback.js +0 -1
- package/dist/commands/root.js +0 -1
- package/dist/commands/run.js +0 -1
- package/dist/commands/rust.js +0 -1
- package/dist/commands/selftest.js +0 -1
- package/dist/commands/setup.js +0 -1
- package/dist/commands/skill-dream.js +0 -1
- package/dist/commands/stats.js +0 -1
- package/dist/commands/status.js +0 -1
- package/dist/commands/trust.js +0 -1
- package/dist/commands/update-check.js +0 -1
- package/dist/commands/usage.js +0 -1
- package/dist/commands/validate-artifacts.js +0 -1
- package/dist/commands/version.js +0 -1
- package/dist/commands/versioning.js +0 -1
- package/dist/commands/wiki.js +0 -1
- package/dist/commands/zellij-lane.js +0 -1
- package/dist/commands/zellij-monitor-pane.js +0 -1
- package/dist/commands/zellij-slot-column-anchor.js +0 -1
- package/dist/commands/zellij-slot-pane.js +0 -1
- package/dist/commands/zellij-viewport-pane.js +0 -1
- package/dist/commands/zellij.js +2 -3
- package/dist/config/skills-manifest.json +130 -183
- package/dist/core/agent-bridge/agent-manifest.js +30 -45
- package/dist/core/agent-bridge/agent-mode.js +0 -1
- package/dist/core/agent-bridge/mcp-server.js +51 -20
- package/dist/core/agents/agent-central-ledger.js +0 -1
- package/dist/core/agents/agent-cleanup.js +0 -1
- package/dist/core/agents/agent-codex-cockpit.js +6 -7
- package/dist/core/agents/agent-conflict-graph.js +0 -1
- package/dist/core/agents/agent-consensus.js +0 -1
- package/dist/core/agents/agent-effort-policy.js +1 -5
- package/dist/core/agents/agent-follow-up-work-items.js +1 -2
- package/dist/core/agents/agent-heartbeat.js +0 -1
- package/dist/core/agents/agent-janitor.js +0 -1
- package/dist/core/agents/agent-lease.js +0 -1
- package/dist/core/agents/agent-lifecycle.js +0 -1
- package/dist/core/agents/agent-merge-coordinator.js +0 -1
- package/dist/core/agents/agent-message-bus.js +0 -1
- package/dist/core/agents/agent-namespace-safety.js +0 -1
- package/dist/core/agents/agent-orchestrator.js +54 -230
- package/dist/core/agents/agent-output-validator.js +1 -2
- package/dist/core/agents/agent-patch-apply-worker.js +0 -1
- package/dist/core/agents/agent-patch-conflict-rebase.js +0 -1
- package/dist/core/agents/agent-patch-proof.js +0 -1
- package/dist/core/agents/agent-patch-queue-store.js +0 -1
- package/dist/core/agents/agent-patch-queue.js +0 -1
- package/dist/core/agents/agent-patch-schema.js +0 -1
- package/dist/core/agents/agent-patch-transaction-journal.js +0 -1
- package/dist/core/agents/agent-persona.js +1 -2
- package/dist/core/agents/agent-plan.js +38 -28
- package/dist/core/agents/agent-proof-evidence.js +34 -37
- package/dist/core/agents/agent-recursion-guard.js +5 -8
- package/dist/core/agents/agent-role-config.js +168 -35
- package/dist/core/agents/agent-roster.js +2 -154
- package/dist/core/agents/agent-runner-codex-exec.js +0 -1
- package/dist/core/agents/agent-runner-fake.js +1 -2
- package/dist/core/agents/agent-runner-ollama.js +2 -3
- package/dist/core/agents/agent-runner-process.js +0 -1
- package/dist/core/agents/agent-runner-zellij.js +1 -2
- package/dist/core/agents/agent-scheduler.js +0 -1
- package/dist/core/agents/agent-schema.js +2 -7
- package/dist/core/agents/agent-session-generation.js +0 -1
- package/dist/core/agents/agent-session-rows.js +0 -1
- package/dist/core/agents/agent-slot-pane-binding-proof.js +1 -2
- package/dist/core/agents/agent-task-graph.js +3 -4
- package/dist/core/agents/agent-task-slicer.js +0 -1
- package/dist/core/agents/agent-terminal-session.js +0 -1
- package/dist/core/agents/agent-trust-report.js +23 -17
- package/dist/core/agents/agent-work-partition.js +2 -3
- package/dist/core/agents/agent-work-queue.js +0 -1
- package/dist/core/agents/agent-worker-pipeline.js +0 -1
- package/dist/core/agents/agent-worker-slot.js +0 -1
- package/dist/core/agents/agent-wrongness.js +2 -4
- package/dist/core/agents/fast-mode-policy.js +0 -1
- package/dist/core/agents/intelligent-work-graph.js +2 -3
- package/dist/core/agents/native-cli-worker-entry.js +6 -0
- package/dist/core/agents/{native-cli-session-proof.js → native-cli-worker-runtime-proof.js} +25 -26
- package/dist/core/agents/{native-cli-session-swarm.js → native-cli-worker-runtime.js} +62 -110
- package/dist/core/agents/native-cli-worker.js +0 -2
- package/dist/core/agents/native-worker-backend-router.js +5 -9
- package/dist/core/agents/no-subagent-scaling-policy.js +8 -9
- package/dist/core/agents/official-subagent-helper-policy.js +2 -3
- package/dist/core/agents/ollama-worker-config.js +0 -1
- package/dist/core/agents/parallel-runtime-proof.js +0 -1
- package/dist/core/agents/parallel-write-fixture.js +0 -1
- package/dist/core/agents/real-codex-parallel-proof.js +11 -7
- package/dist/core/agents/route-collaboration-ledger.js +9 -17
- package/dist/core/agents/runtime-proof-summary.js +5 -6
- package/dist/core/agents/scout-policy.js +0 -1
- package/dist/core/agents/work-partition/conflict-detector.js +0 -1
- package/dist/core/agents/work-partition/dependency-graph.js +0 -1
- package/dist/core/agents/work-partition/lease-planner.js +0 -1
- package/dist/core/agents/work-partition/no-overlap-proof.js +0 -1
- package/dist/core/agents/work-partition/repo-inventory.js +0 -1
- package/dist/core/agents/work-partition/semantic-domain-graph.js +1 -2
- package/dist/core/agents/work-partition/task-slicer.js +1 -2
- package/dist/core/agents/worker-pane-communication-contract.js +1 -2
- package/dist/core/agents/zellij-lane-supervisor.js +0 -1
- package/dist/core/agents/zellij-right-lane-cockpit.js +1 -2
- package/dist/core/artifact-schemas.js +27 -36
- package/dist/core/auto-review.js +94 -5
- package/dist/core/bench.js +7 -8
- package/dist/core/build/build-once-runner.js +0 -1
- package/dist/core/code-structure.js +1 -2
- package/dist/core/codex/agent-config-file-repair.js +0 -1
- package/dist/core/codex/app-mentions.js +0 -1
- package/dist/core/codex/appshots-detector.js +0 -1
- package/dist/core/codex/appshots-operator-policy.js +0 -1
- package/dist/core/codex/codex-0-134-compat.js +0 -1
- package/dist/core/codex/codex-0-135-compat.js +0 -1
- package/dist/core/codex/codex-0-136-compat.js +0 -1
- package/dist/core/codex/codex-0-137-compat.js +0 -1
- package/dist/core/codex/codex-cli-syntax-builder.js +0 -1
- package/dist/core/codex/codex-cli-update.js +0 -1
- package/dist/core/codex/codex-config-eperm-repair.js +0 -1
- package/dist/core/codex/codex-config-guard.js +0 -1
- package/dist/core/codex/codex-config-readability.js +0 -1
- package/dist/core/codex/codex-config-toml.js +0 -1
- package/dist/core/codex/codex-permission-profiles.js +0 -1
- package/dist/core/codex/codex-project-config-policy.js +0 -1
- package/dist/core/codex/codex-resume-inventory.js +0 -1
- package/dist/core/codex/codex-startup-config-postcheck.js +0 -1
- package/dist/core/codex/codex-web-search-adapter.js +0 -1
- package/dist/core/codex/managed-proxy-env.js +0 -1
- package/dist/core/codex/official-goal-mode.js +0 -1
- package/dist/core/codex-adapter.js +0 -1
- package/dist/core/codex-app/codex-agent-role-sync.js +0 -1
- package/dist/core/codex-app/codex-agent-type-probe.js +0 -1
- package/dist/core/codex-app/codex-app-execution-profile.js +0 -1
- package/dist/core/codex-app/codex-app-fast-ui-preservation.js +0 -1
- package/dist/core/codex-app/codex-app-fast-ui-repair.js +0 -1
- package/dist/core/codex-app/codex-app-handoff.js +0 -1
- package/dist/core/codex-app/codex-app-harness-matrix.js +0 -1
- package/dist/core/codex-app/codex-app-launcher.js +0 -1
- package/dist/core/codex-app/codex-app-provider-badge.js +0 -1
- package/dist/core/codex-app/codex-app-restart.js +0 -1
- package/dist/core/codex-app/codex-app-types.js +0 -1
- package/dist/core/codex-app/codex-app-ui-clobber-guard.js +0 -1
- package/dist/core/codex-app/codex-app-ui-state-snapshot.js +0 -1
- package/dist/core/codex-app/codex-hook-approval-probe.js +0 -1
- package/dist/core/codex-app/codex-hook-lifecycle.js +1 -2
- package/dist/core/codex-app/codex-init-deep.js +0 -1
- package/dist/core/codex-app/codex-skill-sync.js +0 -1
- package/dist/core/codex-app/glm-model-profile.js +0 -1
- package/dist/core/codex-app/glm-profile-installer.js +0 -1
- package/dist/core/codex-app/glm-profile-schema.js +0 -1
- package/dist/core/codex-app/mcp-manager.js +42 -647
- package/dist/core/codex-app/menubar/action-runner.js +68 -0
- package/dist/core/codex-app/menubar/app-bundle.js +55 -0
- package/dist/core/codex-app/menubar/build-stamp.js +25 -0
- package/dist/core/codex-app/menubar/config.js +52 -0
- package/dist/core/codex-app/menubar/constants.js +39 -0
- package/dist/core/codex-app/menubar/generation-transaction-journal.js +111 -0
- package/dist/core/codex-app/menubar/generation-transaction.js +258 -0
- package/dist/core/codex-app/menubar/index.js +10 -0
- package/dist/core/codex-app/menubar/installer.js +367 -0
- package/dist/core/codex-app/menubar/launch-agent.js +226 -0
- package/dist/core/codex-app/menubar/migration.js +32 -0
- package/dist/core/codex-app/menubar/paths.js +43 -0
- package/dist/core/codex-app/menubar/resources.js +112 -0
- package/dist/core/codex-app/menubar/rollback.js +341 -0
- package/dist/core/codex-app/menubar/signature.js +21 -0
- package/dist/core/codex-app/menubar/status.js +146 -0
- package/dist/core/codex-app/menubar/types.js +1 -0
- package/dist/core/codex-app/sks-menubar.js +2 -2288
- package/dist/core/codex-app.js +0 -1
- package/dist/core/codex-compat/codex-0-132.js +0 -1
- package/dist/core/codex-compat/codex-0-133.js +0 -1
- package/dist/core/codex-compat/codex-compat-report.js +0 -1
- package/dist/core/codex-compat/codex-config-policy.js +0 -1
- package/dist/core/codex-compat/codex-hook-events.js +0 -1
- package/dist/core/codex-compat/codex-hook-issues.js +0 -1
- package/dist/core/codex-compat/codex-hook-output-builders.js +0 -1
- package/dist/core/codex-compat/codex-hook-output-normalizer.js +0 -1
- package/dist/core/codex-compat/codex-hook-schema.js +0 -1
- package/dist/core/codex-compat/codex-hook-semantic-validator.js +0 -1
- package/dist/core/codex-compat/codex-hook-warning-detector.js +0 -1
- package/dist/core/codex-compat/codex-release-manifest.js +0 -1
- package/dist/core/codex-compat/codex-schema-snapshot.js +0 -1
- package/dist/core/codex-compat/codex-version-policy.js +0 -1
- package/dist/core/codex-compat/codex-version.js +0 -1
- package/dist/core/codex-control/codex-0138-capability.js +0 -1
- package/dist/core/codex-control/codex-0139-capability.js +0 -1
- package/dist/core/codex-control/codex-0139-doctor-real-probe.js +0 -1
- package/dist/core/codex-control/codex-0139-image-path-real-probe.js +0 -1
- package/dist/core/codex-control/codex-0139-plugin-real-probes.js +0 -1
- package/dist/core/codex-control/codex-0139-probe-runner.js +0 -1
- package/dist/core/codex-control/codex-0139-real-probe-summary.js +0 -1
- package/dist/core/codex-control/codex-0139-real-probes.js +0 -1
- package/dist/core/codex-control/codex-0139-rich-schema-real-probe.js +0 -1
- package/dist/core/codex-control/codex-0139-sandbox-real-probe.js +0 -1
- package/dist/core/codex-control/codex-0139-web-search-probe.js +0 -1
- package/dist/core/codex-control/codex-0140-capability.js +0 -1
- package/dist/core/codex-control/codex-0140-feature-probes.js +0 -1
- package/dist/core/codex-control/codex-0140-probe-runner.js +0 -1
- package/dist/core/codex-control/codex-0140-real-probe-summary.js +0 -1
- package/dist/core/codex-control/codex-0140-real-probes.js +0 -1
- package/dist/core/codex-control/codex-0140-usage-parser.js +0 -1
- package/dist/core/codex-control/codex-0141-capability.js +0 -1
- package/dist/core/codex-control/codex-0144-capability.js +0 -1
- package/dist/core/codex-control/codex-0144-collab-agent-real-probe.js +0 -1
- package/dist/core/codex-control/codex-app-server-v2-client.js +0 -1
- package/dist/core/codex-control/codex-control-plane.js +0 -1
- package/dist/core/codex-control/codex-control-proof.js +0 -1
- package/dist/core/codex-control/codex-event-translator.js +0 -1
- package/dist/core/codex-control/codex-fake-sdk-adapter.js +0 -1
- package/dist/core/codex-control/codex-lb-launch-recovery.js +0 -1
- package/dist/core/codex-control/codex-model-capabilities.js +0 -1
- package/dist/core/codex-control/codex-model-metadata.js +0 -1
- package/dist/core/codex-control/codex-multi-agent-event-normalizer.js +0 -1
- package/dist/core/codex-control/codex-output-schemas.js +0 -1
- package/dist/core/codex-control/codex-reliability-shield.js +0 -1
- package/dist/core/codex-control/codex-sdk-adapter.js +0 -1
- package/dist/core/codex-control/codex-sdk-capability.js +0 -1
- package/dist/core/codex-control/codex-sdk-config-policy.js +0 -1
- package/dist/core/codex-control/codex-sdk-env-policy.js +0 -1
- package/dist/core/codex-control/codex-sdk-sandbox-policy.js +0 -1
- package/dist/core/codex-control/codex-task-runner.js +0 -1
- package/dist/core/codex-control/codex-thread-registry.js +0 -1
- package/dist/core/codex-control/codex-tool-schema-fixtures.js +0 -1
- package/dist/core/codex-control/gpt-final-arbiter.js +0 -1
- package/dist/core/codex-control/gpt-final-context-compressor.js +0 -1
- package/dist/core/codex-control/gpt-final-proof-pack.js +0 -1
- package/dist/core/codex-control/gpt-final-review-schema.js +0 -1
- package/dist/core/codex-control/model-call-concurrency.js +0 -1
- package/dist/core/codex-control/python-codex-sdk-adapter.js +0 -1
- package/dist/core/codex-control/python-codex-sdk-event-translator.js +0 -1
- package/dist/core/codex-control/schemas/agent-worker-result.schema.js +0 -1
- package/dist/core/codex-exec-output-schema.js +0 -1
- package/dist/core/codex-hooks/codex-hook-actual-discovery.js +0 -1
- package/dist/core/codex-hooks/codex-hook-config-writer.js +0 -1
- package/dist/core/codex-hooks/codex-hook-hash.js +0 -1
- package/dist/core/codex-hooks/codex-hook-managed-install.js +0 -1
- package/dist/core/codex-hooks/codex-hook-official-hash-oracle.js +0 -1
- package/dist/core/codex-hooks/codex-hook-official-parity.js +0 -1
- package/dist/core/codex-hooks/codex-hook-state-writer.js +0 -1
- package/dist/core/codex-hooks/codex-hook-trust-doctor.js +0 -1
- package/dist/core/codex-hooks/codex-hook-trust-state.js +0 -1
- package/dist/core/codex-lb/codex-lb-env.js +16 -7
- package/dist/core/codex-lb/codex-lb-setup.js +1 -2
- package/dist/core/codex-lb/codex-lb-tool-catalog.js +0 -1
- package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +0 -1
- package/dist/core/codex-lb-circuit.js +0 -1
- package/dist/core/codex-model-guard.js +0 -1
- package/dist/core/codex-native/codex-native-capability-cache.js +0 -1
- package/dist/core/codex-native/codex-native-feature-broker.js +0 -1
- package/dist/core/codex-native/codex-native-feature-matrix.js +0 -1
- package/dist/core/codex-native/codex-native-harness-compat.js +0 -1
- package/dist/core/codex-native/codex-native-interop-policy.js +0 -1
- package/dist/core/codex-native/codex-native-invocation-router.js +0 -1
- package/dist/core/codex-native/codex-native-pattern-analysis.js +0 -1
- package/dist/core/codex-native/codex-native-reference-cache.js +0 -1
- package/dist/core/codex-native/codex-native-reference-evidence.js +0 -1
- package/dist/core/codex-native/codex-native-reference-source.js +0 -1
- package/dist/core/codex-native/codex-native-rename-map.js +0 -1
- package/dist/core/codex-native/codex-native-repair-transaction.js +0 -1
- package/dist/core/codex-native/core-skill-integrity.js +2 -3
- package/dist/core/codex-native/core-skill-manifest.js +36 -9
- package/dist/core/codex-native/native-capability-postcheck.js +0 -1
- package/dist/core/codex-native/native-capability-repair-matrix.js +0 -1
- package/dist/core/codex-native/native-capability-repair.js +0 -1
- package/dist/core/codex-native/native-media-computer-repair.js +0 -1
- package/dist/core/codex-native/project-skill-dedupe.js +0 -1
- package/dist/core/codex-native/skill-name-canonicalizer.js +0 -1
- package/dist/core/codex-native/skill-registry-ledger.js +0 -1
- package/dist/core/codex-plugins/codex-plugin-cache.js +0 -1
- package/dist/core/codex-plugins/codex-plugin-diff.js +0 -1
- package/dist/core/codex-plugins/codex-plugin-json.js +0 -1
- package/dist/core/codex-plugins/codex-plugin-repair.js +0 -1
- package/dist/core/codex-runtime/codex-desktop-config-policy.js +0 -1
- package/dist/core/codex-runtime/resolve-codex-runtime.js +0 -1
- package/dist/core/commands/agent-bridge-command.js +0 -1
- package/dist/core/commands/autoresearch-command.js +0 -1
- package/dist/core/commands/basic-cli.js +105 -51
- package/dist/core/commands/bench-command.js +0 -1
- package/dist/core/commands/check-command.js +0 -1
- package/dist/core/commands/code-structure-command.js +0 -1
- package/dist/core/commands/command-suggestions.js +0 -1
- package/dist/core/commands/command-utils.js +3 -4
- package/dist/core/commands/computer-use-command.js +0 -1
- package/dist/core/commands/daemon-command.js +0 -1
- package/dist/core/commands/dfix-command.js +0 -1
- package/dist/core/commands/eval-command.js +0 -1
- package/dist/core/commands/fast-mode-command.js +0 -1
- package/dist/core/commands/gate-result-contract.js +0 -1
- package/dist/core/commands/gates-command.js +0 -1
- package/dist/core/commands/gc-command.js +0 -1
- package/dist/core/commands/git-command.js +3 -4
- package/dist/core/commands/glm-command.js +28 -4
- package/dist/core/commands/goal-command.js +0 -1
- package/dist/core/commands/gx-command.js +0 -1
- package/dist/core/commands/harness-command.js +0 -1
- package/dist/core/commands/hproof-command.js +0 -1
- package/dist/core/commands/image-ux-review-command.js +0 -1
- package/dist/core/commands/local-model-command.js +0 -1
- package/dist/core/commands/loop-command.js +0 -1
- package/dist/core/commands/mad-sks-command.js +47 -243
- package/dist/core/commands/mcp-config-command.js +212 -0
- package/dist/core/commands/mcp-server-command.js +0 -1
- package/dist/core/commands/menubar-command.js +60 -99
- package/dist/core/commands/naruto-command.js +39 -99
- package/dist/core/commands/paths-command.js +0 -1
- package/dist/core/commands/perf-command.js +0 -1
- package/dist/core/commands/pipeline-command.js +1 -2
- package/dist/core/commands/plan-command.js +0 -1
- package/dist/core/commands/ppt-command.js +0 -1
- package/dist/core/commands/profile-command.js +0 -1
- package/dist/core/commands/proof-field-command.js +0 -1
- package/dist/core/commands/qa-loop-command.js +0 -1
- package/dist/core/commands/recallpulse-command.js +0 -1
- package/dist/core/commands/release-command.js +0 -1
- package/dist/core/commands/remote-command.js +100 -0
- package/dist/core/commands/research-command.js +2 -3
- package/dist/core/commands/review-command.js +0 -1
- package/dist/core/commands/rollback-command.js +0 -1
- package/dist/core/commands/route-command.js +0 -1
- package/dist/core/commands/route-success-helpers.js +0 -1
- package/dist/core/commands/run-command.js +4 -24
- package/dist/core/commands/rust-command.js +0 -1
- package/dist/core/commands/seo-command.js +0 -1
- package/dist/core/commands/skill-dream-command.js +0 -1
- package/dist/core/commands/status-command.js +1 -2
- package/dist/core/commands/stop-gate-command.js +0 -1
- package/dist/core/commands/task-command.js +0 -1
- package/dist/core/commands/telegram-command.js +143 -0
- package/dist/core/commands/triwiki-command.js +0 -1
- package/dist/core/commands/trust-command.js +0 -1
- package/dist/core/commands/ui-command.js +1 -2
- package/dist/core/commands/uninstall-command.js +0 -1
- package/dist/core/commands/validate-artifacts-command.js +0 -1
- package/dist/core/commands/wiki-command.js +4 -5
- package/dist/core/commands/wrongness-command.js +0 -1
- package/dist/core/computer-use-live-evidence.js +0 -1
- package/dist/core/computer-use-status.js +0 -1
- package/dist/core/config/config-migration-journal.js +0 -1
- package/dist/core/config/managed-config-merge.js +0 -1
- package/dist/core/config/secret-preservation.js +0 -1
- package/dist/core/config/supabase-secret-preservation.js +0 -1
- package/dist/core/context7-client.js +0 -1
- package/dist/core/daemon/sksd-client.js +0 -1
- package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +0 -1
- package/dist/core/daemon/sksd-hook-daemon.js +0 -1
- package/dist/core/daemon/sksd-hook-dispatch.js +0 -1
- package/dist/core/daemon/sksd-ipc.js +0 -1
- package/dist/core/daemon/sksd.js +0 -1
- package/dist/core/db-safety.js +32 -32
- package/dist/core/decision-contract.js +0 -1
- package/dist/core/decision-lattice.js +5 -6
- package/dist/core/dfix/codex-handoff.js +0 -1
- package/dist/core/dfix/dfix-cache.js +0 -1
- package/dist/core/dfix/error-signature.js +0 -1
- package/dist/core/dfix/patch-runner.js +0 -1
- package/dist/core/dfix/patch-templates.js +0 -1
- package/dist/core/dfix/path-decision.js +0 -1
- package/dist/core/dfix/performance.js +0 -1
- package/dist/core/dfix/root-cause-ranking.js +0 -1
- package/dist/core/dfix/verification-runner.js +0 -1
- package/dist/core/dfix/verification-selector.js +0 -1
- package/dist/core/dfix.js +0 -1
- package/dist/core/doctor/browser-use-repair.js +0 -1
- package/dist/core/doctor/codex-0138-doctor.js +0 -1
- package/dist/core/doctor/codex-0139-doctor.js +0 -1
- package/dist/core/doctor/codex-doctor-bridge.js +0 -1
- package/dist/core/doctor/codex-startup-config-repair.js +3 -2
- package/dist/core/doctor/command-alias-cleanup.js +157 -24
- package/dist/core/doctor/computer-use-repair.js +0 -1
- package/dist/core/doctor/confirm-repair.js +0 -1
- package/dist/core/doctor/context7-mcp-repair.js +1 -2
- package/dist/core/doctor/current-project-guidance-nested.js +76 -0
- package/dist/core/doctor/current-project-guidance.js +343 -0
- package/dist/core/doctor/doctor-codex-startup-repair.js +0 -1
- package/dist/core/doctor/doctor-context7-repair.js +0 -1
- package/dist/core/doctor/doctor-dirty-planner.js +0 -1
- package/dist/core/doctor/doctor-idempotence.js +0 -1
- package/dist/core/doctor/doctor-native-capability-repair.js +0 -1
- package/dist/core/doctor/doctor-readiness-matrix.js +0 -6
- package/dist/core/doctor/doctor-repair-postcheck.js +0 -1
- package/dist/core/doctor/doctor-transaction.js +0 -1
- package/dist/core/doctor/doctor-zellij-repair.js +0 -1
- package/dist/core/doctor/global-sks-install-cleanup.js +0 -1
- package/dist/core/doctor/imagegen-repair.js +0 -1
- package/dist/core/doctor/legacy-global-hook-cleanup.js +0 -1
- package/dist/core/doctor/macos-tcc-diagnostic.js +0 -1
- package/dist/core/doctor/mcp-transport-collision-repair.js +0 -1
- package/dist/core/doctor/retired-auto-review-config.js +5 -0
- package/dist/core/doctor/retired-managed-projection-residue.js +195 -0
- package/dist/core/doctor/retired-managed-residue-artifact-helpers.js +135 -0
- package/dist/core/doctor/retired-managed-residue-artifacts.js +33 -0
- package/dist/core/doctor/retired-managed-residue-missions.js +393 -0
- package/dist/core/doctor/retired-managed-residue-private.js +73 -0
- package/dist/core/doctor/retired-managed-residue-runtime.js +133 -0
- package/dist/core/doctor/retired-managed-residue-state.js +270 -0
- package/dist/core/doctor/retired-managed-residue.js +40 -0
- package/dist/core/doctor/supabase-mcp-repair.js +2 -3
- package/dist/core/dogfood-loop.js +0 -1
- package/dist/core/effort-orchestrator.js +0 -1
- package/dist/core/errors/blocker-humanizer.js +0 -1
- package/dist/core/errors/next-action-map.js +0 -1
- package/dist/core/evaluation.js +4 -5
- package/dist/core/evidence/evidence-dedupe.js +0 -1
- package/dist/core/evidence/evidence-freshness.js +0 -1
- package/dist/core/evidence/evidence-proof-linker.js +0 -1
- package/dist/core/evidence/evidence-redaction.js +0 -1
- package/dist/core/evidence/evidence-router.js +0 -1
- package/dist/core/evidence/evidence-schema.js +0 -1
- package/dist/core/evidence/evidence-store.js +0 -1
- package/dist/core/feature-fixture-executor.js +1 -2
- package/dist/core/feature-fixture-runner.js +0 -1
- package/dist/core/feature-fixtures.js +12 -30
- package/dist/core/feature-registry.js +66 -61
- package/dist/core/features/feature-completion.js +0 -1
- package/dist/core/features/feature-fixtures.js +0 -1
- package/dist/core/features/feature-registry.js +0 -1
- package/dist/core/from-chat-img-forensics.js +0 -1
- package/dist/core/fsx.js +5 -9
- package/dist/core/git/git-integration-worktree.js +0 -1
- package/dist/core/git/git-repo-detection.js +0 -1
- package/dist/core/git/git-worktree-cache-policy.js +0 -1
- package/dist/core/git/git-worktree-capability.js +0 -1
- package/dist/core/git/git-worktree-checkpoint.js +0 -1
- package/dist/core/git/git-worktree-cleanup.js +0 -1
- package/dist/core/git/git-worktree-conflict-resolver.js +0 -1
- package/dist/core/git/git-worktree-cross-rebase.js +0 -1
- package/dist/core/git/git-worktree-diff.js +0 -1
- package/dist/core/git/git-worktree-manager.js +0 -1
- package/dist/core/git/git-worktree-merge-queue.js +0 -1
- package/dist/core/git/git-worktree-patch-envelope.js +0 -1
- package/dist/core/git/git-worktree-pool.js +0 -1
- package/dist/core/git/git-worktree-root.js +0 -1
- package/dist/core/git/git-worktree-runner.js +0 -1
- package/dist/core/git-hygiene/collaboration-trust.js +0 -1
- package/dist/core/git-hygiene/git-doctor.js +1 -2
- package/dist/core/git-hygiene/git-policy.js +6 -7
- package/dist/core/git-hygiene/git-precommit.js +1 -2
- package/dist/core/git-hygiene/git-status.js +0 -1
- package/dist/core/git-hygiene/gitattributes-writer.js +0 -1
- package/dist/core/git-hygiene/gitignore-writer.js +0 -1
- package/dist/core/git-hygiene/shared-memory-manifest.js +0 -1
- package/dist/core/git-hygiene/shared-memory-publish.js +0 -1
- package/dist/core/git-hygiene/shared-memory-security.js +0 -1
- package/dist/core/git-hygiene/validators.js +1 -2
- package/dist/core/git-simple.js +0 -1
- package/dist/core/goal-workflow.js +0 -3
- package/dist/core/gx-renderer.js +0 -1
- package/dist/core/harness-conflicts.js +0 -1
- package/dist/core/harness-guard.js +0 -1
- package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +3 -14
- package/dist/core/hooks-runtime/hook-invocation-dedupe.js +0 -1
- package/dist/core/hooks-runtime/hook-io.js +0 -3
- package/dist/core/hooks-runtime/light-turn.js +0 -1
- package/dist/core/hooks-runtime/naruto-decision-gate.js +3 -3
- package/dist/core/hooks-runtime/payload-signals.js +0 -1
- package/dist/core/hooks-runtime/skill-reconcile-preflight.js +2 -3
- package/dist/core/hooks-runtime/stop-repeat-guard.js +0 -1
- package/dist/core/hooks-runtime/tool-output-quarantine.js +0 -1
- package/dist/core/hooks-runtime.js +36 -75
- package/dist/core/hproof.js +0 -1
- package/dist/core/image/image-artifact-path-contract.js +0 -1
- package/dist/core/image/image-artifact-registry.js +0 -1
- package/dist/core/image-ux-review/callout-extraction.js +0 -1
- package/dist/core/image-ux-review/codex-app-generated-image-discovery.js +0 -1
- package/dist/core/image-ux-review/fix-loop.js +0 -1
- package/dist/core/image-ux-review/fix-task-planner.js +0 -1
- package/dist/core/image-ux-review/imagegen-adapter.js +0 -1
- package/dist/core/image-ux-review/patch-handoff.js +0 -1
- package/dist/core/image-ux-review/real-callout-extractor.js +0 -1
- package/dist/core/image-ux-review/recapture.js +0 -1
- package/dist/core/image-ux-review.js +0 -1
- package/dist/core/imagegen/gpt-image-2-request-validator.js +0 -1
- package/dist/core/imagegen/imagegen-auth-readiness.js +0 -1
- package/dist/core/imagegen/imagegen-capability.js +0 -1
- package/dist/core/imagegen/require-imagegen.js +0 -1
- package/dist/core/init/skills.js +664 -85
- package/dist/core/init.js +51 -34
- package/dist/core/install/installed-package-smoke.js +340 -34
- package/dist/core/json-schema-validator.js +0 -1
- package/dist/core/language-preference.js +0 -1
- package/dist/core/lean-engineering-policy.js +0 -1
- package/dist/core/local-llm/local-collaboration-policy.js +0 -1
- package/dist/core/local-llm/local-llm-backpressure.js +0 -1
- package/dist/core/local-llm/local-llm-capability.js +0 -1
- package/dist/core/local-llm/local-llm-client.js +0 -1
- package/dist/core/local-llm/local-llm-config.js +0 -1
- package/dist/core/local-llm/local-llm-context-cache.js +0 -1
- package/dist/core/local-llm/local-llm-control-adapter.js +0 -1
- package/dist/core/local-llm/local-llm-json-repair.js +0 -1
- package/dist/core/local-llm/local-llm-metrics.js +0 -1
- package/dist/core/local-llm/local-llm-ollama-client.js +0 -1
- package/dist/core/local-llm/local-llm-openai-compatible-client.js +0 -1
- package/dist/core/local-llm/local-llm-prompt-cache.js +0 -1
- package/dist/core/local-llm/local-llm-scheduler.js +0 -1
- package/dist/core/local-llm/local-llm-schema-enforcer.js +0 -1
- package/dist/core/local-llm/local-llm-smoke.js +0 -1
- package/dist/core/local-llm/local-llm-warmup.js +0 -1
- package/dist/core/local-llm/local-worker-eligibility.js +0 -1
- package/dist/core/locks/file-lock.js +0 -1
- package/dist/core/loop-blocker.js +0 -1
- package/dist/core/loops/goal-to-loop-compat.js +0 -1
- package/dist/core/loops/loop-artifacts.js +0 -1
- package/dist/core/loops/loop-checkpoint.js +0 -1
- package/dist/core/loops/loop-concurrency-budget.js +0 -1
- package/dist/core/loops/loop-continuation-enforcer.js +0 -1
- package/dist/core/loops/loop-decomposer.js +1 -2
- package/dist/core/loops/loop-final-arbiter-contract.js +0 -1
- package/dist/core/loops/loop-finalizer.js +0 -1
- package/dist/core/loops/loop-fixture-policy.js +0 -1
- package/dist/core/loops/loop-gate-ladder.js +0 -1
- package/dist/core/loops/loop-gate-registry.js +0 -1
- package/dist/core/loops/loop-gate-runner.js +0 -1
- package/dist/core/loops/loop-gate-selector.js +3 -4
- package/dist/core/loops/loop-gpt-final-arbiter.js +0 -1
- package/dist/core/loops/loop-integration-merge.js +0 -1
- package/dist/core/loops/loop-interrupt-registry.js +0 -1
- package/dist/core/loops/loop-iteration-runner.js +0 -1
- package/dist/core/loops/loop-lease.js +0 -1
- package/dist/core/loops/loop-merge-strategy.js +0 -1
- package/dist/core/loops/loop-mutation-ledger.js +0 -1
- package/dist/core/loops/loop-observability.js +0 -1
- package/dist/core/loops/loop-owner-inference.js +0 -1
- package/dist/core/loops/loop-owner-ledger.js +0 -1
- package/dist/core/loops/loop-planner.js +0 -1
- package/dist/core/loops/loop-proof-summary.js +0 -1
- package/dist/core/loops/loop-proof.js +0 -1
- package/dist/core/loops/loop-risk-classifier.js +2 -3
- package/dist/core/loops/loop-runtime-control.js +0 -1
- package/dist/core/loops/loop-runtime.js +0 -1
- package/dist/core/loops/loop-scheduler.js +0 -1
- package/dist/core/loops/loop-schema.js +0 -1
- package/dist/core/loops/loop-side-effect-scanner.js +0 -1
- package/dist/core/loops/loop-state.js +0 -1
- package/dist/core/loops/loop-worker-prompts.js +0 -1
- package/dist/core/loops/loop-worker-runtime.js +1 -3
- package/dist/core/loops/loop-worktree-runtime.js +0 -1
- package/dist/core/mad-sks/audit-ledger.js +0 -1
- package/dist/core/mad-sks/authorization-manifest.js +0 -1
- package/dist/core/mad-sks/executors/computer-use-executor.js +0 -1
- package/dist/core/mad-sks/executors/db-write-executor.js +1 -2
- package/dist/core/mad-sks/executors/executor-base.js +0 -1
- package/dist/core/mad-sks/executors/file-write-executor.js +0 -1
- package/dist/core/mad-sks/executors/index.js +0 -1
- package/dist/core/mad-sks/executors/package-install-executor.js +0 -1
- package/dist/core/mad-sks/executors/service-control-executor.js +0 -1
- package/dist/core/mad-sks/executors/shell-command-executor.js +0 -1
- package/dist/core/mad-sks/executors/sql-plane-executor.js +12 -13
- package/dist/core/mad-sks/guard-middleware.js +0 -1
- package/dist/core/mad-sks/immutable-harness-guard.js +0 -1
- package/dist/core/mad-sks/permission-model.js +0 -1
- package/dist/core/mad-sks/proof-evidence.js +0 -1
- package/dist/core/mad-sks/rollback-apply.js +0 -1
- package/dist/core/mad-sks/rollback-plan.js +0 -1
- package/dist/core/mad-sks/shell-argv-classifier.js +0 -1
- package/dist/core/mad-sks/sql-plane/capability.js +202 -0
- package/dist/core/{mad-db/mad-db-coordinator.js → mad-sks/sql-plane/coordinator.js} +88 -87
- package/dist/core/mad-sks/sql-plane/ledger.js +36 -0
- package/dist/core/{mad-db/mad-db-lock.js → mad-sks/sql-plane/lock.js} +5 -6
- package/dist/core/{mad-db/mad-db-executor.js → mad-sks/sql-plane/mcp-executor.js} +24 -25
- package/dist/core/{mad-db/mad-db-operation-store.js → mad-sks/sql-plane/operation-store.js} +18 -19
- package/dist/core/mad-sks/sql-plane/paths.js +16 -0
- package/dist/core/mad-sks/sql-plane/policy-resolver.js +127 -0
- package/dist/core/{mad-db/mad-db-policy.js → mad-sks/sql-plane/policy.js} +29 -32
- package/dist/core/{mad-db/mad-db-postconditions.js → mad-sks/sql-plane/postconditions.js} +4 -5
- package/dist/core/{mad-db/mad-db-recovery.js → mad-sks/sql-plane/recovery.js} +8 -8
- package/dist/core/{mad-db/mad-db-result-lifecycle.js → mad-sks/sql-plane/result-lifecycle.js} +13 -14
- package/dist/core/{mad-db/mad-db-runtime-profile.js → mad-sks/sql-plane/runtime-profile.js} +16 -16
- package/dist/core/{mad-db/mad-db-target.js → mad-sks/sql-plane/target.js} +12 -13
- package/dist/core/mad-sks/write-guard.js +0 -1
- package/dist/core/managed-assets/managed-assets-manifest.js +8 -8
- package/dist/core/managed-path-safety.js +287 -0
- package/dist/core/managed-paths.js +0 -1
- package/dist/core/mcp/mcp-0-134-policy.js +0 -1
- package/dist/core/mcp/mcp-config-preservation.js +0 -1
- package/dist/core/mcp/mcp-plugin-inventory.js +0 -1
- package/dist/core/mcp/mcp-server-policy.js +2 -3
- package/dist/core/mcp/mcp-tool-name-normalizer.js +0 -1
- package/dist/core/mcp-config/backup.js +102 -0
- package/dist/core/mcp-config/codex-cli-adapter.js +165 -0
- package/dist/core/mcp-config/config-reader.js +148 -0
- package/dist/core/mcp-config/effective-merge.js +24 -0
- package/dist/core/mcp-config/guarded-patch.js +259 -0
- package/dist/core/mcp-config/health-check.js +324 -0
- package/dist/core/mcp-config/index.js +14 -0
- package/dist/core/mcp-config/inventory.js +82 -0
- package/dist/core/mcp-config/mutation.js +366 -0
- package/dist/core/mcp-config/oauth.js +44 -0
- package/dist/core/mcp-config/redaction.js +84 -0
- package/dist/core/mcp-config/restore.js +106 -0
- package/dist/core/mcp-config/scope.js +69 -0
- package/dist/core/mcp-config/secret-policy.js +196 -0
- package/dist/core/mcp-config/types.js +8 -0
- package/dist/core/memory-governor.js +0 -1
- package/dist/core/memory-summary.js +0 -1
- package/dist/core/migration/migration-transaction-journal.js +0 -1
- package/dist/core/mission.js +0 -1
- package/dist/core/mistake-memory.js +0 -1
- package/dist/core/mistake-recall.js +0 -1
- package/dist/core/naruto/hardware-capacity-probe.js +0 -1
- package/dist/core/naruto/naruto-active-pool.js +0 -1
- package/dist/core/naruto/naruto-allocation-policy.js +0 -1
- package/dist/core/naruto/naruto-backpressure.js +0 -1
- package/dist/core/naruto/naruto-concurrency-governor.js +14 -15
- package/dist/core/naruto/naruto-finalizer.js +0 -1
- package/dist/core/naruto/naruto-generation-scheduler.js +0 -1
- package/dist/core/naruto/naruto-gpt-final-pack.js +0 -1
- package/dist/core/naruto/naruto-loop-mesh.js +0 -1
- package/dist/core/naruto/naruto-loop-worker-router.js +0 -1
- package/dist/core/naruto/naruto-parallel-patch-apply.js +0 -1
- package/dist/core/naruto/naruto-patch-transaction-batch.js +0 -1
- package/dist/core/naruto/naruto-real-worker-child.js +0 -1
- package/dist/core/naruto/naruto-real-worker-runtime.js +1 -2
- package/dist/core/naruto/naruto-real-write-proof.js +1 -2
- package/dist/core/naruto/naruto-rebalance-policy.js +0 -1
- package/dist/core/naruto/naruto-role-policy.js +0 -1
- package/dist/core/naruto/naruto-task-hints.js +0 -1
- package/dist/core/naruto/naruto-verification-dag.js +0 -1
- package/dist/core/naruto/naruto-verification-pool.js +0 -1
- package/dist/core/naruto/naruto-work-graph.js +6 -7
- package/dist/core/naruto/naruto-work-item.js +0 -1
- package/dist/core/naruto/naruto-write-e2e.js +1 -2
- package/dist/core/naruto/normalize-worker-prompt-text.js +0 -1
- package/dist/core/naruto/resource-pressure-monitor.js +0 -1
- package/dist/core/naruto/solution-tournament.js +0 -1
- package/dist/core/no-question-guard.js +0 -1
- package/dist/core/official-subagent-review-policy.js +17 -0
- package/dist/core/ops/diagnostics-bundle.js +0 -1
- package/dist/core/ops/ops-maturity-scorecard.js +0 -1
- package/dist/core/ops/reporting.js +0 -1
- package/dist/core/ops/upgrade-migration-fixtures.js +1 -2
- package/dist/core/perf/fsx-hotpath.js +0 -1
- package/dist/core/perf/import-graph-budget.js +0 -1
- package/dist/core/perf/lru-cache.js +0 -1
- package/dist/core/perf/perf-budget.js +0 -1
- package/dist/core/perf/performance-profiler.js +0 -1
- package/dist/core/perf/release-latency-slo.js +317 -0
- package/dist/core/perf-bench.js +1 -2
- package/dist/core/performance-budgets.json +6 -6
- package/dist/core/permission-gates.js +0 -1
- package/dist/core/pipeline/active-context.js +0 -1
- package/dist/core/pipeline/agent-stage-policy.js +0 -1
- package/dist/core/pipeline/final-gpt-patch-stage.js +0 -1
- package/dist/core/pipeline/final-gpt-review-stage.js +0 -1
- package/dist/core/pipeline/finalize-pipeline-result.js +0 -1
- package/dist/core/pipeline/gpt-final-required.js +0 -1
- package/dist/core/pipeline/pipeline-plan-writer.js +0 -1
- package/dist/core/pipeline/plan-schema.js +0 -1
- package/dist/core/pipeline/prompt-context-answer.js +0 -1
- package/dist/core/pipeline/prompt-context-computer-use.js +0 -1
- package/dist/core/pipeline/prompt-context-dfix.js +0 -1
- package/dist/core/pipeline/prompt-context.js +0 -1
- package/dist/core/pipeline/route-prep-db.js +0 -1
- package/dist/core/pipeline/route-prep-gx.js +0 -1
- package/dist/core/pipeline/route-prep-image-ux.js +0 -1
- package/dist/core/pipeline/route-prep-ppt.js +0 -1
- package/dist/core/pipeline/route-prep-qa.js +0 -1
- package/dist/core/pipeline/route-prep-research.js +0 -1
- package/dist/core/pipeline/route-prep.js +0 -1
- package/dist/core/pipeline/stage-policy.js +0 -1
- package/dist/core/pipeline/stop-gate-context7.js +0 -1
- package/dist/core/pipeline/stop-gate-proof.js +0 -1
- package/dist/core/pipeline/stop-gate-subagents.js +0 -1
- package/dist/core/pipeline/stop-gate.js +0 -1
- package/dist/core/pipeline/validation.js +0 -1
- package/dist/core/pipeline-internals/runtime-core.js +66 -144
- package/dist/core/pipeline-internals/runtime-gates.js +14 -139
- package/dist/core/pipeline.js +0 -1
- package/dist/core/ppt/artifacts.js +0 -1
- package/dist/core/ppt/html.js +0 -1
- package/dist/core/ppt/style-tokens.js +0 -1
- package/dist/core/ppt-imagegen-review.js +0 -1
- package/dist/core/ppt-review/deck-issue-ledger.js +0 -1
- package/dist/core/ppt-review/index.js +0 -1
- package/dist/core/ppt-review/ppt-fix-task-planner.js +0 -1
- package/dist/core/ppt-review/ppt-patch-handoff.js +0 -1
- package/dist/core/ppt-review/reexport-rereview.js +0 -1
- package/dist/core/ppt-review/slide-exporter.js +0 -1
- package/dist/core/ppt-review/slide-imagegen-review.js +0 -1
- package/dist/core/ppt-review/slide-issue-extraction.js +0 -1
- package/dist/core/ppt.js +2 -3
- package/dist/core/preflight/parallel-preflight-engine.js +0 -1
- package/dist/core/probes/probe-memoization.js +0 -1
- package/dist/core/product-design-app-server.js +0 -1
- package/dist/core/product-design-plugin.js +9 -10
- package/dist/core/prompt/prompt-placeholder-guard.js +0 -1
- package/dist/core/prompt-context-builder.js +0 -1
- package/dist/core/proof/auto-finalize.js +3 -74
- package/dist/core/proof/claim-ledger.js +0 -1
- package/dist/core/proof/command-ledger.js +0 -1
- package/dist/core/proof/evidence-collector.js +0 -1
- package/dist/core/proof/fake-real-proof-policy.js +208 -60
- package/dist/core/proof/file-change-ledger.js +0 -1
- package/dist/core/proof/proof-reader.js +0 -1
- package/dist/core/proof/proof-redaction.test-helper.js +0 -1
- package/dist/core/proof/proof-schema.js +0 -1
- package/dist/core/proof/proof-writer.js +0 -1
- package/dist/core/proof/root-cause-policy.js +0 -1
- package/dist/core/proof/route-adapter.js +8 -5
- package/dist/core/proof/route-finalizer-fixtures.js +1 -2
- package/dist/core/proof/route-finalizer-policy.js +0 -1
- package/dist/core/proof/route-finalizer.js +0 -1
- package/dist/core/proof/route-proof-gate.js +14 -31
- package/dist/core/proof/route-proof-policy.js +8 -10
- package/dist/core/proof/runtime-truth-matrix.js +44 -66
- package/dist/core/proof/selftest-proof-fixtures.js +9 -10
- package/dist/core/proof/validation.js +0 -1
- package/dist/core/proof-field.js +17 -18
- package/dist/core/provider/model-router.js +0 -1
- package/dist/core/provider/provider-badge.js +0 -1
- package/dist/core/provider/provider-context.js +1 -2
- package/dist/core/provider/provider-self-heal.js +0 -1
- package/dist/core/providers/glm/bench/glm-bench-comparison.js +0 -1
- package/dist/core/providers/glm/bench/glm-bench-fixture.js +0 -1
- package/dist/core/providers/glm/bench/glm-bench-model-lock-proof.js +0 -1
- package/dist/core/providers/glm/bench/glm-bench-report.js +0 -1
- package/dist/core/providers/glm/bench/glm-benchmark-runner.js +0 -1
- package/dist/core/providers/glm/bench/glm-benchmark-types.js +0 -1
- package/dist/core/providers/glm/bench/glm-direct-bench-runner.js +0 -1
- package/dist/core/providers/glm/glm-52-profile.js +0 -1
- package/dist/core/providers/glm/glm-52-request.js +0 -1
- package/dist/core/providers/glm/glm-52-response-guard.js +0 -1
- package/dist/core/providers/glm/glm-52-settings.js +0 -1
- package/dist/core/providers/glm/glm-context-budget.js +0 -1
- package/dist/core/providers/glm/glm-context-cache.js +0 -1
- package/dist/core/providers/glm/glm-direct-run.js +0 -1
- package/dist/core/providers/glm/glm-interactive-launch.js +1 -2
- package/dist/core/providers/glm/glm-latency-trace.js +0 -1
- package/dist/core/providers/glm/glm-loop-guard.js +0 -1
- package/dist/core/providers/glm/glm-mad-launch.js +0 -1
- package/dist/core/providers/glm/glm-mad-mode.js +0 -1
- package/dist/core/providers/glm/glm-model-meta-cache.js +0 -1
- package/dist/core/providers/glm/glm-patch-apply.js +16 -2
- package/dist/core/providers/glm/glm-patch-parser.js +0 -1
- package/dist/core/providers/glm/glm-profile-resolver.js +0 -1
- package/dist/core/providers/glm/glm-readiness.js +0 -1
- package/dist/core/providers/glm/glm-reasoning-policy.js +0 -1
- package/dist/core/providers/glm/glm-request-cache.js +0 -1
- package/dist/core/providers/glm/glm-run-controller.js +0 -1
- package/dist/core/providers/glm/glm-run-state.js +0 -1
- package/dist/core/providers/glm/glm-run-timeout.js +0 -1
- package/dist/core/providers/glm/glm-speed-context.js +0 -1
- package/dist/core/providers/glm/glm-speed-gate.js +0 -1
- package/dist/core/providers/glm/glm-speed-output-parser.js +0 -1
- package/dist/core/providers/glm/glm-tool-schema-cache.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-apply-transaction.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-artifacts.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-bench.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-budget.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-combined-patch.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-command.js +2 -3
- package/dist/core/providers/glm/naruto/glm-naruto-concurrency-governor.js +2 -3
- package/dist/core/providers/glm/naruto/glm-naruto-conflict-graph.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-critical-path.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-decomposer.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-file-lease.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-final-seal.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-finalizer.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-hunk-conflict.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-hunk-parser.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-isolation-policy.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-judge.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-merge-planner.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-metrics.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-orchestrator.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-parallelism-summary.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-patch-candidate-gate.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-patch-candidate-parser.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-patch-envelope.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-quorum.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-rate-limiter.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-repair-wave.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-requirement-coverage.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-requirement-ledger.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-scoreboard.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-secret-audit.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-session-id.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-shard-planner.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-stage-scheduler.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-targeted-checks.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-task-size-classifier.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-terminal.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-trace.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-types.js +2 -3
- package/dist/core/providers/glm/naruto/glm-naruto-usage-extractor.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-verifier-output.js +0 -1
- 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 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worker-pool.js +1 -2
- package/dist/core/providers/glm/naruto/glm-naruto-worker-runtime.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worker-scheduler.js +1 -2
- package/dist/core/providers/glm/naruto/glm-naruto-worker.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worktree-cleanup.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worktree-manager.js +16 -2
- package/dist/core/providers/glm/naruto/glm-naruto-worktree-worker.js +0 -1
- package/dist/core/providers/glm/naruto/glm-naruto-worktree.js +16 -2
- package/dist/core/providers/openrouter/openrouter-client.js +0 -1
- package/dist/core/providers/openrouter/openrouter-error.js +0 -1
- package/dist/core/providers/openrouter/openrouter-provider-health.js +0 -1
- package/dist/core/providers/openrouter/openrouter-secret-store.js +0 -1
- package/dist/core/providers/openrouter/openrouter-stream.js +0 -1
- package/dist/core/providers/openrouter/openrouter-types.js +0 -1
- package/dist/core/python-tools/python-tool-runner.js +0 -1
- package/dist/core/qa-loop/qa-app-server-driver.js +0 -1
- package/dist/core/qa-loop/qa-contract.js +0 -1
- package/dist/core/qa-loop/qa-gate.js +0 -1
- package/dist/core/qa-loop/qa-loop-app-handoff-confirmation.js +0 -1
- package/dist/core/qa-loop/qa-loop-budget-policy.js +0 -1
- package/dist/core/qa-loop/qa-runtime-artifacts.js +0 -1
- package/dist/core/qa-loop/qa-surface-router.js +0 -1
- package/dist/core/qa-loop/qa-types.js +0 -1
- package/dist/core/qa-loop.js +2 -3
- package/dist/core/quality/competitor-scorecard.js +0 -1
- package/dist/core/questions.js +3 -4
- package/dist/core/recallpulse/policy.js +1 -2
- package/dist/core/recallpulse.js +6 -7
- package/dist/core/release/critical-path-ledger.js +0 -1
- package/dist/core/release/extreme-parallel-scheduler.js +0 -1
- package/dist/core/release/file-ownership.js +153 -0
- package/dist/core/release/gate-cache.js +0 -1
- package/dist/core/release/gate-manifest.js +8 -8
- package/dist/core/release/gate-pack-assertion.js +0 -1
- package/dist/core/release/gate-pack-fixture-cache.js +0 -1
- package/dist/core/release/gate-pack-manifest.js +0 -1
- package/dist/core/release/gate-pack-runner.js +0 -1
- package/dist/core/release/gate-timing.js +0 -1
- package/dist/core/release/macos-menubar-proof.js +167 -0
- package/dist/core/release/main-push-guard.js +135 -0
- package/dist/core/release/main-push-receipt.js +147 -0
- package/dist/core/release/npm-pack-proof.js +41 -16
- package/dist/core/release/package-dist-snapshot.js +0 -1
- package/dist/core/release/package-size-budget.js +1 -4
- package/dist/core/release/release-authorization-snapshot.js +0 -1
- package/dist/core/release/release-cache-key.js +0 -1
- package/dist/core/release/release-closure-contract.js +29 -0
- package/dist/core/release/release-closure-helpers.js +293 -0
- package/dist/core/release/release-closure-validation.js +271 -0
- package/dist/core/release/release-closure.js +134 -0
- package/dist/core/release/release-gate-affected-selector.js +2 -3
- package/dist/core/release/release-gate-batch-runner.js +0 -1
- package/dist/core/release/release-gate-cache-v2.js +2 -12
- package/dist/core/release/release-gate-contract.js +9 -8
- package/dist/core/release/release-gate-dag.js +34 -10
- package/dist/core/release/release-gate-hermetic-env.js +1 -2
- package/dist/core/release/release-gate-node.js +0 -1
- package/dist/core/release/release-gate-report.js +0 -1
- package/dist/core/release/release-gate-resource-governor.js +0 -1
- package/dist/core/release/release-gate-scheduler.js +0 -1
- package/dist/core/release/release-origin.js +29 -0
- package/dist/core/release/release-pack-content-scanner.js +98 -0
- package/dist/core/release/release-pack-contract.js +2 -0
- package/dist/core/release/release-pack-receipt.js +330 -0
- package/dist/core/release/release-pack-tarball.js +64 -0
- package/dist/core/release/release-proof-truth.js +0 -1
- package/dist/core/release/release-real-contract.js +1 -3
- package/dist/core/release/release-stamp-proof.js +127 -0
- package/dist/core/release/resource-class-budget.js +0 -1
- package/dist/core/release/runtime-script-pack-closure.js +344 -0
- package/dist/core/release/sla-scheduler.js +0 -1
- package/dist/core/release-parallel-full-coverage.js +0 -1
- package/dist/core/remote/audit-idempotency.js +209 -0
- package/dist/core/remote/index.js +10 -0
- package/dist/core/remote/machine-registry.js +162 -0
- package/dist/core/remote/owner-proof.js +224 -0
- package/dist/core/remote/protocol.js +263 -0
- package/dist/core/remote/readiness.js +158 -0
- package/dist/core/remote/session-index.js +76 -0
- package/dist/core/remote/session-snapshot.js +197 -0
- package/dist/core/remote/ssh-worker-client.js +377 -0
- package/dist/core/remote/types.js +10 -0
- package/dist/core/remote/worker.js +343 -0
- package/dist/core/reporting/markdown-table.js +0 -1
- package/dist/core/research/claim-evidence-matrix.js +0 -1
- package/dist/core/research/experiment-plan.js +0 -1
- package/dist/core/research/falsification.js +0 -1
- package/dist/core/research/implementation-blueprint-densifier.js +0 -1
- package/dist/core/research/implementation-blueprint-markdown.js +0 -1
- package/dist/core/research/implementation-blueprint.js +0 -1
- package/dist/core/research/mock-result.js +0 -1
- package/dist/core/research/replication-pack.js +0 -1
- package/dist/core/research/research-adversarial-review.js +1 -3
- package/dist/core/research/research-claim-builder.js +0 -1
- package/dist/core/research/research-claim-synthesizer.js +0 -1
- package/dist/core/research/research-cycle-runner.js +0 -1
- package/dist/core/research/research-falsification-runner.js +0 -1
- package/dist/core/research/research-final-reviewer.js +0 -1
- package/dist/core/research/research-handoff.js +3 -4
- package/dist/core/research/research-plan-markdown.js +0 -1
- package/dist/core/research/research-prompt-contract.js +0 -1
- package/dist/core/research/research-quality-contract.js +0 -1
- package/dist/core/research/research-realistic-report.js +2 -3
- package/dist/core/research/research-repetition-detector.js +0 -1
- package/dist/core/research/research-report-quality.js +0 -1
- package/dist/core/research/research-review-artifact-digest.js +0 -1
- package/dist/core/research/research-source-evidence.js +0 -1
- package/dist/core/research/research-source-layer-catalog.js +0 -1
- package/dist/core/research/research-source-ledger-merge.js +0 -1
- package/dist/core/research/research-source-shards.js +0 -1
- package/dist/core/research/research-stage-runner.js +1 -2
- package/dist/core/research/research-super-search.js +0 -1
- package/dist/core/research/research-synthesis-prompt.js +0 -1
- package/dist/core/research/research-synthesis-writer.js +0 -1
- package/dist/core/research/research-work-graph.js +3 -5
- package/dist/core/research/source-quality-report.js +0 -1
- package/dist/core/research.js +1 -2
- package/dist/core/responses-retry-policy.js +0 -1
- package/dist/core/results.js +0 -1
- package/dist/core/retention/retention-budget.js +0 -1
- package/dist/core/retention.js +0 -1
- package/dist/core/router/capability-card.js +0 -1
- package/dist/core/router/route-cache.js +0 -1
- package/dist/core/router/router-proof.js +0 -1
- package/dist/core/router/task-classifier.js +0 -1
- package/dist/core/router/ultra-router.js +0 -1
- package/dist/core/routes/constants.js +18 -19
- package/dist/core/routes/design-policy.js +0 -1
- package/dist/core/routes/diagnostic-allowlist.js +0 -1
- package/dist/core/routes/dollar-manifest-lite.js +19 -13
- package/dist/core/routes/dollar-prefix.js +25 -0
- package/dist/core/routes/evidence.js +0 -1
- package/dist/core/routes/model-mode-router.js +1 -2
- package/dist/core/routes/ppt-policy.js +6 -8
- package/dist/core/routes.js +81 -101
- package/dist/core/runtime/task-profile.js +20 -3
- package/dist/core/runtime/verification-budget.js +0 -1
- package/dist/core/rust-accelerator.js +1 -2
- package/dist/core/safety/command-contract/contracts.js +210 -0
- package/dist/core/safety/command-contract/index.js +3 -0
- package/dist/core/safety/command-contract/json-schema.js +91 -0
- package/dist/core/safety/command-contract/types.js +1 -0
- package/dist/core/safety/mutation-guard.js +0 -1
- package/dist/core/safety/mutation-ledger.js +0 -1
- package/dist/core/safety/requested-scope-contract.js +0 -0
- package/dist/core/safety/side-effect-runtime-report.js +0 -1
- package/dist/core/safety/ssot-guard.js +7 -8
- package/dist/core/search-visibility/adapter-registry.js +0 -1
- package/dist/core/search-visibility/adapters/next-app.js +0 -1
- package/dist/core/search-visibility/adapters/next-pages.js +0 -1
- package/dist/core/search-visibility/adapters/static-site.js +0 -1
- package/dist/core/search-visibility/analyzers.js +0 -1
- package/dist/core/search-visibility/artifacts.js +0 -1
- package/dist/core/search-visibility/discovery.js +0 -1
- package/dist/core/search-visibility/index.js +0 -1
- package/dist/core/search-visibility/marketing-truthfulness.js +2 -3
- package/dist/core/search-visibility/marketing.js +1 -2
- package/dist/core/search-visibility/mission.js +0 -1
- package/dist/core/search-visibility/mutation.js +0 -1
- package/dist/core/search-visibility/types.js +0 -1
- package/dist/core/search-visibility/verifier.js +0 -1
- package/dist/core/secret-redaction.js +0 -1
- package/dist/core/security/high-risk-contracts.js +0 -1
- package/dist/core/security/redact-secrets.js +0 -1
- package/dist/core/session/project-namespace.js +1 -2
- package/dist/core/skill-forge.js +5 -6
- package/dist/core/skills/core-rollout-trace.js +0 -1
- package/dist/core/skills/core-skill-card.js +0 -0
- package/dist/core/skills/core-skill-deployment.js +0 -1
- package/dist/core/skills/core-skill-epoch.js +0 -1
- package/dist/core/skills/core-skill-meta-update.js +0 -1
- package/dist/core/skills/core-skill-patch-apply.js +0 -1
- package/dist/core/skills/core-skill-patch.js +0 -1
- package/dist/core/skills/core-skill-reflection.js +0 -1
- package/dist/core/skills/core-skill-runtime.js +0 -1
- package/dist/core/skills/core-skill-scorer.js +0 -1
- package/dist/core/skills/core-skill-trainer.js +0 -1
- package/dist/core/skills/core-skill-types.js +0 -1
- package/dist/core/skills/core-skill-validation.js +0 -1
- package/dist/core/skills/rejected-skill-patch-buffer.js +0 -1
- package/dist/core/source-intelligence/appshots-evidence.js +0 -1
- package/dist/core/source-intelligence/codex-history-search.js +0 -1
- package/dist/core/source-intelligence/source-intelligence-policy.js +0 -1
- package/dist/core/source-intelligence/source-intelligence-proof.js +0 -1
- package/dist/core/source-intelligence/source-intelligence-runner.js +0 -1
- package/dist/core/stop-gate/gate-evaluator.js +0 -1
- package/dist/core/stop-gate/stop-gate-check.js +0 -1
- package/dist/core/stop-gate/stop-gate-diagnostics.js +0 -1
- package/dist/core/stop-gate/stop-gate-resolver.js +0 -1
- package/dist/core/stop-gate/stop-gate-types.js +0 -1
- package/dist/core/stop-gate/stop-gate-writer.js +0 -1
- package/dist/core/strategy/adhd-orchestrating-gate.js +0 -1
- package/dist/core/strategy/strategy-compiler.js +1 -2
- package/dist/core/strategy/strategy-gate.js +0 -1
- package/dist/core/structured-output-adapter.js +0 -1
- package/dist/core/subagents/agent-catalog.js +62 -13
- package/dist/core/subagents/model-policy.js +0 -1
- package/dist/core/subagents/naruto-help-contract.js +5 -10
- package/dist/core/subagents/official-subagent-config.js +43 -28
- package/dist/core/subagents/official-subagent-preparation.js +77 -24
- package/dist/core/subagents/official-subagent-prompt.js +138 -9
- package/dist/core/subagents/official-subagent-runner.js +1 -3
- package/dist/core/subagents/subagent-evidence.js +0 -1
- package/dist/core/subagents/terminology.js +0 -1
- package/dist/core/subagents/thread-budget.js +51 -4
- package/dist/core/subagents/triwiki-attention.js +0 -1
- package/dist/core/super-search/doctor.js +1 -2
- package/dist/core/super-search/index.js +0 -1
- package/dist/core/super-search/local-http-smoke.js +0 -1
- package/dist/core/super-search/runtime-helpers.js +0 -1
- package/dist/core/super-search/runtime.js +0 -1
- package/dist/core/super-search/source-records.js +0 -1
- package/dist/core/super-search/types.js +0 -1
- package/dist/core/telegram/bot-api.js +99 -0
- package/dist/core/telegram/config.js +88 -0
- package/dist/core/telegram/hub.js +241 -0
- package/dist/core/telegram/index.js +8 -0
- package/dist/core/telegram/ledgers.js +207 -0
- package/dist/core/telegram/messages.js +292 -0
- package/dist/core/telegram/owner-lock.js +134 -0
- package/dist/core/telegram/runtime-projection.js +88 -0
- package/dist/core/telegram/runtime.js +369 -0
- package/dist/core/telegram/types.js +1 -0
- package/dist/core/triwiki/agents-md-projector.js +0 -1
- package/dist/core/triwiki/code-index-scanner.js +0 -1
- package/dist/core/triwiki/code-pack-head-freshness.js +0 -1
- package/dist/core/triwiki/code-pack.js +0 -1
- package/dist/core/triwiki/triwiki-affected-graph.js +0 -1
- package/dist/core/triwiki/triwiki-cache-key.js +0 -1
- package/dist/core/triwiki/triwiki-gate-impact-map.js +0 -1
- package/dist/core/triwiki/triwiki-invalidation.js +0 -1
- package/dist/core/triwiki/triwiki-module-card.js +1 -2
- package/dist/core/triwiki/triwiki-proof-bank.js +0 -1
- package/dist/core/triwiki/triwiki-proof-card.js +0 -1
- package/dist/core/triwiki/triwiki-sla-certificate.js +0 -1
- package/dist/core/triwiki-attention.js +20 -6
- package/dist/core/triwiki-provenance.js +0 -1
- package/dist/core/triwiki-runtime.js +0 -1
- package/dist/core/triwiki-wrongness/avoidance-rules.js +0 -1
- package/dist/core/triwiki-wrongness/image-wrongness.js +0 -1
- package/dist/core/triwiki-wrongness/validators.js +0 -1
- package/dist/core/triwiki-wrongness/wrongness-cli.js +0 -1
- package/dist/core/triwiki-wrongness/wrongness-ledger.js +2 -3
- package/dist/core/triwiki-wrongness/wrongness-proof-linker.js +0 -1
- package/dist/core/triwiki-wrongness/wrongness-retrieval.js +0 -1
- package/dist/core/triwiki-wrongness/wrongness-schema.js +0 -1
- package/dist/core/triwiki-wrongness/wrongness-trust-policy.js +0 -1
- package/dist/core/trust-kernel/completion-contract.js +1 -2
- package/dist/core/trust-kernel/evidence-router.js +0 -1
- package/dist/core/trust-kernel/route-contract.js +0 -1
- package/dist/core/trust-kernel/route-state-machine.js +0 -1
- package/dist/core/trust-kernel/trust-kernel-schema.js +0 -1
- package/dist/core/trust-kernel/trust-report.js +0 -1
- package/dist/core/trust-kernel/trust-status.js +0 -1
- package/dist/core/ui/dashboard-html.js +0 -1
- package/dist/core/update/semver.js +66 -0
- package/dist/core/update/temporary-install-smoke.js +95 -0
- package/dist/core/update/update-migration-state.js +136 -56
- package/dist/core/update/update-notice.js +49 -132
- package/dist/core/update/update-operation.js +220 -0
- package/dist/core/update/update-status.js +299 -0
- package/dist/core/update-check.js +569 -107
- package/dist/core/usage/codex-account-usage.js +0 -1
- package/dist/core/validators/completion-proof-validator.js +0 -1
- package/dist/core/validators/evidence-validator.js +0 -1
- package/dist/core/validators/feature-fixture-validator.js +0 -1
- package/dist/core/validators/image-voxel-validator.js +0 -1
- package/dist/core/validators/route-contract-validator.js +0 -1
- package/dist/core/validators/trust-report-validator.js +0 -1
- package/dist/core/validators/validation-error.js +0 -1
- package/dist/core/verification/diff-quality.js +0 -1
- package/dist/core/verification/impact-scan.js +0 -1
- package/dist/core/verification/machine-feedback.js +0 -1
- package/dist/core/verification/mistake-rule-compiler.js +0 -1
- package/dist/core/verification/real-evidence-policy.js +0 -1
- package/dist/core/verification/verification-artifact-lock.js +0 -1
- package/dist/core/verification/verification-dag.js +0 -1
- package/dist/core/verification/verification-proof.js +0 -1
- package/dist/core/verification/verification-result.js +0 -1
- package/dist/core/verification/verification-worker-pool.js +0 -1
- package/dist/core/version-manager.js +0 -1
- package/dist/core/version.js +1 -2
- package/dist/core/wiki-coordinate.js +1 -2
- package/dist/core/wiki-image/bbox.js +0 -1
- package/dist/core/wiki-image/before-after-relation.js +0 -1
- package/dist/core/wiki-image/callout-parser.js +0 -1
- package/dist/core/wiki-image/computer-use-evidence.js +0 -1
- package/dist/core/wiki-image/computer-use-ledger.js +0 -1
- package/dist/core/wiki-image/generated-review-parser.js +0 -1
- package/dist/core/wiki-image/image-hash.js +0 -1
- package/dist/core/wiki-image/image-relation.js +0 -1
- package/dist/core/wiki-image/image-ux-evidence.js +0 -1
- package/dist/core/wiki-image/image-voxel-ledger.js +0 -1
- package/dist/core/wiki-image/image-voxel-schema.js +0 -1
- package/dist/core/wiki-image/ppt-image-evidence.js +0 -1
- package/dist/core/wiki-image/proof-linker.js +0 -1
- package/dist/core/wiki-image/route-image-evidence.js +0 -1
- package/dist/core/wiki-image/validation.js +0 -1
- package/dist/core/wiki-image/visual-anchor.js +0 -1
- package/dist/core/work-order-ledger.js +32 -9
- package/dist/core/zellij/homebrew-policy.js +0 -1
- package/dist/core/zellij/zellij-capability.js +0 -1
- package/dist/core/zellij/zellij-clipboard-config.js +0 -1
- package/dist/core/zellij/zellij-command.js +0 -1
- package/dist/core/zellij/zellij-dashboard-pane.js +0 -1
- package/dist/core/zellij/zellij-dashboard-renderer.js +0 -1
- package/dist/core/zellij/zellij-fake-adapter.js +0 -1
- package/dist/core/zellij/zellij-lane-renderer.js +23 -24
- package/dist/core/zellij/zellij-lane-runtime.js +0 -1
- package/dist/core/zellij/zellij-launcher.js +3 -11
- package/dist/core/zellij/zellij-layout-builder.js +3 -4
- package/dist/core/zellij/zellij-monitor-renderer.js +0 -1
- package/dist/core/zellij/zellij-naruto-dashboard.js +0 -1
- package/dist/core/zellij/zellij-official-subagent-activity.js +0 -1
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -1
- package/dist/core/zellij/zellij-pane-proof.js +0 -1
- package/dist/core/zellij/zellij-right-column-manager.js +0 -1
- package/dist/core/zellij/zellij-screen-proof.js +0 -1
- package/dist/core/zellij/zellij-self-heal-types.js +0 -1
- package/dist/core/zellij/zellij-self-heal.js +0 -1
- package/dist/core/zellij/zellij-slot-column-anchor.js +19 -20
- package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -1
- package/dist/core/zellij/zellij-slot-telemetry.js +0 -1
- package/dist/core/zellij/zellij-theme.js +0 -1
- package/dist/core/zellij/zellij-ui-mode.js +0 -1
- package/dist/core/zellij/zellij-update.js +0 -1
- package/dist/core/zellij/zellij-viewport-binder.js +0 -1
- package/dist/core/zellij/zellij-worker-pane-manager.js +3 -4
- package/dist/core/zellij/zellij-worker-pane-summary.js +0 -1
- package/dist/native/sks-menubar/Info.plist.template +24 -0
- package/dist/native/sks-menubar/Resources/AppIcon.icns +0 -0
- package/dist/native/sks-menubar/Resources/Localizable.strings +4 -0
- package/dist/native/sks-menubar/Resources/SKSStatusAttentionTemplate.pdf +0 -0
- package/dist/native/sks-menubar/Resources/SKSStatusTemplate.pdf +0 -0
- package/dist/native/sks-menubar/Resources/SKSStatusUpdateTemplate.pdf +0 -0
- package/dist/native/sks-menubar/Resources/SKSStatusWarningTemplate.pdf +0 -0
- package/dist/native/sks-menubar/Sources/AlertFactory.swift +61 -0
- package/dist/native/sks-menubar/Sources/AppDelegate.swift +47 -0
- package/dist/native/sks-menubar/Sources/AppIdentity.swift +20 -0
- package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +108 -0
- package/dist/native/sks-menubar/Sources/DiagnosticsViewController.swift +29 -0
- package/dist/native/sks-menubar/Sources/MCPServersViewController.swift +418 -0
- package/dist/native/sks-menubar/Sources/NotificationCoordinator.swift +119 -0
- package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +230 -0
- package/dist/native/sks-menubar/Sources/OverviewViewController.swift +135 -0
- package/dist/native/sks-menubar/Sources/ProcessClient.swift +110 -0
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +64 -0
- package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +66 -0
- package/dist/native/sks-menubar/Sources/SettingsViewController.swift +39 -0
- package/dist/native/sks-menubar/Sources/SidebarItem.swift +11 -0
- package/dist/native/sks-menubar/Sources/StatusItemController.swift +233 -0
- package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +237 -0
- package/dist/native/sks-menubar/Sources/main.swift +18 -0
- 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 +31 -3
- package/dist/scripts/build-dist.js +9 -2
- package/dist/scripts/build-once-runner-check.js +0 -1
- package/dist/scripts/canonical-test-runner.js +0 -1
- package/dist/scripts/certificate-sla-check.js +0 -1
- package/dist/scripts/changelog-check.js +0 -1
- package/dist/scripts/check-architecture.js +209 -91
- package/dist/scripts/check-cli-entrypoint.js +0 -1
- package/dist/scripts/check-command-module-budget.js +0 -1
- package/dist/scripts/check-feature-quality.js +0 -1
- package/dist/scripts/check-legacy-free.js +0 -1
- package/dist/scripts/check-pipeline-budget.js +0 -1
- package/dist/scripts/check-pipeline-runtime.js +0 -1
- package/dist/scripts/check-publish-tag.js +0 -1
- package/dist/scripts/check-route-modularity.js +3 -4
- package/dist/scripts/check-runtime-schemas.js +19 -2
- package/dist/scripts/cli-output-consistency-check.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-0140-capability-check.js +0 -1
- package/dist/scripts/codex-0140-feature-probes-check.js +0 -1
- package/dist/scripts/codex-0144-app-server-v2-check.js +0 -1
- package/dist/scripts/codex-0144-binary-identity-check.js +0 -1
- package/dist/scripts/codex-0144-capability-check.js +0 -1
- package/dist/scripts/codex-0144-core-real-probes-check.js +0 -1
- package/dist/scripts/codex-0144-manifest-check.js +0 -1
- package/dist/scripts/codex-0144-policy-check.js +0 -1
- package/dist/scripts/codex-0144-thread-store-check.js +0 -1
- package/dist/scripts/codex-agent-role-rich-content-check.js +0 -1
- package/dist/scripts/codex-agent-role-sync-check.js +0 -1
- package/dist/scripts/codex-agent-type-routing-check.js +0 -1
- package/dist/scripts/codex-app-execution-profile-check.js +0 -1
- package/dist/scripts/codex-app-fast-ui-preservation-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 -1
- package/dist/scripts/codex-control-all-pipelines-check.js +0 -4
- 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-lb-fast-mode-truth-check.js +0 -1
- package/dist/scripts/codex-lb-fast-ui-preservation-check.js +0 -1
- package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +1 -2
- package/dist/scripts/codex-native-agent-role-content-check.js +0 -1
- package/dist/scripts/codex-native-feature-broker-blackbox.js +3 -0
- package/dist/scripts/codex-native-feature-broker-check.js +0 -1
- package/dist/scripts/codex-native-harness-compat-check.js +0 -1
- package/dist/scripts/codex-native-hook-lifecycle-proof-check.js +0 -1
- package/dist/scripts/codex-native-runtime-e2e-fixture.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 -4
- package/dist/scripts/codex-sdk-backend-router-check.js +11 -2
- 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 +1 -2
- package/dist/scripts/competitor-scorecard-check.js +0 -1
- package/dist/scripts/concurrent-session-collision-check.js +0 -1
- package/dist/scripts/context7-evidence-dedupe-check.js +0 -1
- package/dist/scripts/core-skill-card-schema-check.js +0 -1
- package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -1
- package/dist/scripts/core-skill-heldout-validation-check.js +0 -1
- package/dist/scripts/core-skill-no-drift-check.js +2 -3
- package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -1
- package/dist/scripts/core-skill-patch-check.js +0 -1
- package/dist/scripts/core-skill-route-runtime-integration-check.js +1 -2
- package/dist/scripts/current-command-surface-check.js +76 -0
- package/dist/scripts/current-surface-update-e2e-check.js +488 -0
- package/dist/scripts/{legacy-upgrade-matrix-check.js → current-upgrade-matrix-check.js} +18 -69
- package/dist/scripts/db-route-materialization-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 +52 -2
- package/dist/scripts/doctor-codex-app-harness-check.js +0 -1
- package/dist/scripts/doctor-context7-mcp-repair-blackbox.js +0 -1
- package/dist/scripts/doctor-fastpath-check.js +0 -1
- package/dist/scripts/doctor-fix-production-blackbox.js +0 -1
- package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -1
- package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -1
- 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 +0 -1
- package/dist/scripts/doctor-supabase-mcp-repair-blackbox.js +0 -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 -1
- package/dist/scripts/fsx-hotpath-check.js +0 -1
- package/dist/scripts/gate-policy-audit-check.js +35 -8
- package/dist/scripts/geo-claim-evidence-check.js +0 -1
- package/dist/scripts/geo-cli-blackbox-check.js +17 -0
- package/dist/scripts/geo-crawler-policy-check.js +0 -1
- package/dist/scripts/git-worktree-checkpoint-check.js +0 -1
- package/dist/scripts/git-worktree-cross-rebase-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/goal-artifact-compat-check.js +0 -1
- package/dist/scripts/harness-benchmark-check.js +4 -5
- 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 +1 -2
- 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/init-deep-backup-retention-check.js +0 -1
- package/dist/scripts/installed-package-smoke-check.js +14 -3
- package/dist/scripts/legacy-gate-inventory-check.js +0 -1
- package/dist/scripts/legacy-gate-purge-check.js +36 -5
- package/dist/scripts/legacy-strong-inventory-check.js +0 -1
- package/dist/scripts/lib/codex-sdk-gate-lib.js +2 -3
- package/dist/scripts/lib/ensure-dist-fresh.js +0 -1
- package/dist/scripts/lib/git-worktree-fixture.js +0 -1
- package/dist/scripts/lib/valid-png-fixture.js +0 -1
- package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +1 -2
- package/dist/scripts/loop-directive-check-lib.js +0 -1
- package/dist/scripts/loop-integration-finalizer-check.js +2 -0
- package/dist/scripts/loop-worker-fixture-child.js +0 -1
- package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -1
- package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +1 -5
- package/dist/scripts/{mad-db-mad-command-check.js → mad-sks-launch-sql-plane-boundary-check.js} +13 -25
- package/dist/scripts/mad-sks-sql-plane-capability-check.js +25 -0
- package/dist/scripts/mad-sks-sql-plane-lifecycle-hook-decision-check.js +17 -0
- package/dist/scripts/{mad-db-mcp-result-lifecycle-check.js → mad-sks-sql-plane-result-lifecycle-check.js} +11 -12
- package/dist/scripts/managed-config-merge-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 -1
- package/dist/scripts/naruto-codex-e2e-check.js +0 -1
- package/dist/scripts/naruto-worktree-coding-blackbox.js +28 -0
- package/dist/scripts/naruto-write-e2e-check.js +0 -1
- package/dist/scripts/native-capability-postcheck-check.js +0 -1
- package/dist/scripts/native-capability-repair-matrix-check.js +0 -1
- package/dist/scripts/native-image-generation-repair-check.js +0 -1
- package/dist/scripts/official-subagent-workflow-check.js +3 -3
- package/dist/scripts/ops-diagnostics-bundle-check.js +0 -1
- package/dist/scripts/package-published-contract-check.js +0 -1
- package/dist/scripts/packlist-performance-check.js +33 -11
- package/dist/scripts/parallel-production-smoke-check.js +0 -1
- package/dist/scripts/perf-budget-check.js +0 -1
- package/dist/scripts/pipeline-codex-native-doctor-mad-routing-check.js +0 -1
- package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +76 -0
- package/dist/scripts/pipeline-codex-native-image-routing-check.js +0 -1
- package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +49 -0
- package/dist/scripts/pipeline-codex-native-loop-routing-check.js +0 -1
- package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +73 -0
- package/dist/scripts/pipeline-codex-native-qa-routing-check.js +0 -1
- package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +50 -0
- package/dist/scripts/pipeline-codex-native-research-routing-check.js +0 -1
- package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +44 -0
- package/dist/scripts/ppt-full-e2e-blackbox-check.js +147 -0
- 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 -1
- package/dist/scripts/prepublish-release-check-or-fast.js +25 -16
- 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 +0 -1
- package/dist/scripts/prompt-placeholder-guard-check.js +0 -1
- package/dist/scripts/proof-root-cause-policy-check.js +0 -1
- package/dist/scripts/provider-badge-context-check.js +2 -3
- package/dist/scripts/python-codex-sdk-all-pipelines-check.js +1 -2
- 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-execution-profile-routing-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-affected-selector-check.js +1 -2
- package/dist/scripts/release-aggressive-resource-governor-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 +1 -2
- package/dist/scripts/release-dag-full-coverage-check.js +0 -1
- package/dist/scripts/release-dist-freshness-check.js +0 -1
- package/dist/scripts/release-dynamic-presets-check.js +0 -1
- package/dist/scripts/release-file-ownership-check.js +35 -0
- package/dist/scripts/release-full-parallelism-blackbox.js +41 -0
- package/dist/scripts/release-gate-batch-runner-check.js +0 -1
- package/dist/scripts/release-gate-budget-check.js +0 -1
- package/dist/scripts/release-gate-dag-runner-check.js +3 -2
- package/dist/scripts/release-gate-dag-runner.js +0 -1
- package/dist/scripts/release-gate-script-parity-check.js +8 -5
- package/dist/scripts/release-latency-slo-check.js +23 -0
- package/dist/scripts/release-macos-menubar-proof.js +167 -0
- package/dist/scripts/release-main-push-guard.js +37 -0
- package/dist/scripts/release-main-push-receipt.js +43 -0
- package/dist/scripts/release-metadata-1-19-check.js +255 -0
- package/dist/scripts/release-metadata-check.js +0 -1
- package/dist/scripts/release-pack-receipt.js +144 -0
- package/dist/scripts/release-parallel-speed-budget-check.js +0 -1
- 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 +1 -3
- package/dist/scripts/release-runtime-truth-matrix-check.js +0 -1
- package/dist/scripts/release-speed-summary.js +0 -1
- package/dist/scripts/release-version-truth-check.js +0 -1
- package/dist/scripts/research-blueprint-densifier-check.js +1 -2
- 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-execution-profile-routing-check.js +0 -1
- package/dist/scripts/research-final-reviewer-blackbox.js +69 -0
- 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-no-tmux-check.js → runtime-current-terminal-check.js} +6 -11
- 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 +1 -2
- package/dist/scripts/runtime-script-pack-closure-check.js +89 -0
- package/dist/scripts/runtime-ts-rust-boundary-check.js +1 -2
- 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/secret-preservation-check.js +0 -1
- package/dist/scripts/secret-preservation-guard-check.js +0 -1
- package/dist/scripts/seo-audit-fixture-check.js +1 -2
- package/dist/scripts/seo-cli-blackbox-check.js +17 -0
- 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 +2 -3
- package/dist/scripts/seo-marketing-truthfulness-check.js +0 -1
- package/dist/scripts/seo-metadata-sync-check.js +1 -2
- 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 +0 -5
- package/dist/scripts/skill-name-canonicalizer-check.js +0 -1
- package/dist/scripts/skills-manifest-continuity-check.js +5 -5
- 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-3-1-4-directive-check-lib.js +0 -1
- package/dist/scripts/sks-3-1-5-directive-check-lib.js +1 -2
- package/dist/scripts/sks-3-1-6-directive-check-lib.js +1 -2
- package/dist/scripts/sks-3-1-8-check-lib.js +0 -1
- package/dist/scripts/sks-menubar-install-check.js +306 -306
- package/dist/scripts/sks-uninstall-regression-check.js +0 -1
- package/dist/scripts/sksd-daemon-check.js +0 -1
- package/dist/scripts/supabase-secret-preservation-blackbox.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 +29 -0
- 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/type-surface-codex-app-check.js +0 -1
- package/dist/scripts/ultra-router-auto-router-check.js +1 -2
- package/dist/scripts/uninstall-inventory-check.js +2 -0
- package/dist/scripts/update-fastpath-check.js +0 -1
- package/dist/scripts/update-preserves-supabase-keys-blackbox.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 +71 -0
- 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 +1 -2
- package/dist/scripts/zellij-capability-check.js +0 -1
- package/dist/scripts/zellij-dashboard-pane-check.js +0 -1
- package/dist/scripts/zellij-dashboard-watch.js +0 -1
- package/dist/scripts/zellij-developer-controls-check.js +2 -3
- package/dist/scripts/zellij-doctor-readiness-check.js +3 -4
- package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +2 -3
- package/dist/scripts/zellij-fake-adapter-check.js +0 -1
- package/dist/scripts/zellij-first-slot-down-stack-check.js +0 -1
- package/dist/scripts/zellij-first-slot-down-stack-real-check.js +0 -1
- package/dist/scripts/zellij-homebrew-policy-check.js +0 -1
- package/dist/scripts/zellij-initial-main-only-blackbox.js +27 -0
- package/dist/scripts/zellij-lane-renderer-check.js +2 -3
- package/dist/scripts/zellij-launch-command-truth-check.js +0 -1
- package/dist/scripts/zellij-layout-valid-check.js +1 -2
- package/dist/scripts/zellij-pane-creation-lock-metrics-check.js +0 -1
- package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +79 -0
- package/dist/scripts/zellij-pane-lock-does-not-block-worker-check.js +4 -5
- package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +136 -0
- 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 +3 -4
- 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-self-heal-check.js +0 -1
- package/dist/scripts/zellij-self-heal-dry-run-check.js +0 -1
- package/dist/scripts/zellij-self-heal-status-contract-check.js +0 -1
- package/dist/scripts/zellij-self-heal-typed-blackbox.js +3 -0
- package/dist/scripts/zellij-slot-column-anchor-check.js +0 -1
- package/dist/scripts/zellij-slot-column-anchor-telemetry-check.js +1 -2
- package/dist/scripts/zellij-slot-only-ui-check.js +4 -5
- package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -1
- package/dist/scripts/zellij-slot-pane-stale-detection-check.js +0 -1
- package/dist/scripts/zellij-slot-pane-telemetry-renderer-check.js +0 -1
- package/dist/scripts/zellij-slot-renderer-proof-semantics-check.js +5 -6
- package/dist/scripts/zellij-slot-telemetry-check.js +0 -1
- 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-slot-telemetry-real-blackbox.js +19 -0
- package/dist/scripts/zellij-slot-telemetry-renderer-check.js +1 -2
- package/dist/scripts/zellij-slot-telemetry-runtime-check.js +3 -4
- package/dist/scripts/zellij-spawn-on-demand-layout-check.js +1 -2
- package/dist/scripts/zellij-stacked-capability-routing-check.js +0 -1
- package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +80 -0
- 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 +2 -3
- package/dist/scripts/zellij-update-missing-self-heal-check.js +0 -1
- 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-manager-check.js +1 -2
- package/dist/scripts/zellij-worker-pane-manager-single-owner-check.js +5 -5
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +201 -0
- package/infra-harness-gates.json +6 -6
- package/package.json +25 -45
- package/release-gates.v2.json +146 -60
- package/runtime-required-scripts.json +38 -0
- package/schemas/codex/agent-result.schema.json +473 -191
- package/schemas/{mad-db/mad-db-capability.schema.json → mad-sks/sql-plane/capability.schema.json} +3 -3
- package/schemas/{mad-db/mad-db-ledger.schema.json → mad-sks/sql-plane/ledger.schema.json} +2 -2
- package/schemas/naruto/naruto-concurrency-governor.schema.json +2 -2
- package/schemas/naruto/naruto-work-graph.schema.json +2 -2
- package/dist/cli/xai-command.js +0 -35
- package/dist/commands/mad-db.js +0 -5
- package/dist/commands/team.js +0 -3
- package/dist/commands/tmux.js +0 -25
- package/dist/core/agents/agent-cleanup-executor.js +0 -733
- package/dist/core/agents/agent-command-surface.js +0 -108
- package/dist/core/agents/agent-gate.js +0 -70
- package/dist/core/agents/agent-ledger-schemas.js +0 -194
- package/dist/core/agents/codex-exec-worker-adapter.js +0 -147
- package/dist/core/commands/agent-command.js +0 -250
- package/dist/core/commands/mad-db-command.js +0 -110
- package/dist/core/commands/team-command.js +0 -94
- package/dist/core/commands/team-legacy-observe-command.js +0 -135
- package/dist/core/evidence/flagship-proof-graph-validator.js +0 -320
- package/dist/core/hooks-runtime/team-digest.js +0 -85
- package/dist/core/mad-db/mad-db-capability.js +0 -253
- package/dist/core/mad-db/mad-db-ledger.js +0 -37
- package/dist/core/mad-db/mad-db-policy-resolver.js +0 -128
- package/dist/core/pipeline/route-prep-team.js +0 -2
- package/dist/core/team-dag.js +0 -58
- package/dist/core/team-dashboard-renderer.js +0 -23
- package/dist/core/team-live.js +0 -167
- package/dist/core/team-review-policy.js +0 -62
- package/dist/scripts/agent-ast-aware-work-graph-check.js +0 -25
- package/dist/scripts/agent-backfill-replenishment-check.js +0 -13
- package/dist/scripts/agent-background-terminals-check.js +0 -16
- package/dist/scripts/agent-cleanup-command-ux-check.js +0 -12
- package/dist/scripts/agent-cleanup-executor-check.js +0 -53
- package/dist/scripts/agent-cleanup-executor-v2-check.js +0 -39
- package/dist/scripts/agent-cli-options-to-task-graph-check.js +0 -5
- package/dist/scripts/agent-codex-app-cockpit-check.js +0 -91
- package/dist/scripts/agent-dynamic-cockpit-check.js +0 -10
- package/dist/scripts/agent-dynamic-pool-check.js +0 -13
- package/dist/scripts/agent-dynamic-pool-fixture.js +0 -80
- package/dist/scripts/agent-fast-mode-default-check.js +0 -107
- package/dist/scripts/agent-fast-mode-worker-propagation-check.js +0 -7
- package/dist/scripts/agent-follow-up-work-schema-check.js +0 -80
- package/dist/scripts/agent-goal-mode-propagation-check.js +0 -9
- package/dist/scripts/agent-intelligent-work-graph-check.js +0 -29
- package/dist/scripts/agent-janitor-check.js +0 -79
- package/dist/scripts/agent-main-no-scout-check.js +0 -11
- package/dist/scripts/agent-multi-project-isolation-check.js +0 -86
- package/dist/scripts/agent-native-cli-session-swarm-10-check.js +0 -7
- package/dist/scripts/agent-native-cli-session-swarm-20-check.js +0 -7
- package/dist/scripts/agent-native-cli-session-swarm-check.js +0 -7
- package/dist/scripts/agent-official-subagent-helper-policy-check.js +0 -71
- package/dist/scripts/agent-parallel-write-kernel-check.js +0 -103
- package/dist/scripts/agent-patch-conflict-rebase-check.js +0 -198
- package/dist/scripts/agent-patch-envelope-extraction-check.js +0 -17
- package/dist/scripts/agent-patch-proof-check.js +0 -41
- package/dist/scripts/agent-patch-proof-runtime-check.js +0 -63
- package/dist/scripts/agent-patch-queue-runtime-check.js +0 -36
- package/dist/scripts/agent-patch-rollback-check.js +0 -38
- package/dist/scripts/agent-patch-rollback-dag-check.js +0 -14
- package/dist/scripts/agent-patch-swarm-gate-lib.js +0 -113
- package/dist/scripts/agent-patch-swarm-runtime-check.js +0 -10
- package/dist/scripts/agent-patch-swarm-runtime-truth-check.js +0 -76
- package/dist/scripts/agent-patch-transaction-journal-check.js +0 -57
- package/dist/scripts/agent-patch-verification-dag-check.js +0 -14
- package/dist/scripts/agent-proof-contract-reconciled-check.js +0 -5
- package/dist/scripts/agent-real-codex-dynamic-smoke-check.js +0 -166
- package/dist/scripts/agent-real-codex-dynamic-smoke-v2-check.js +0 -14
- package/dist/scripts/agent-real-codex-in-zellij-worker-pane-check.js +0 -227
- package/dist/scripts/agent-real-codex-parallel-workers-10-check.js +0 -5
- package/dist/scripts/agent-real-codex-parallel-workers-20-check.js +0 -5
- package/dist/scripts/agent-real-codex-parallel-workers-5-check.js +0 -5
- package/dist/scripts/agent-real-codex-parallel-workers-check.js +0 -5
- package/dist/scripts/agent-real-codex-patch-envelope-smoke.js +0 -126
- package/dist/scripts/agent-role-config-repair-check.js +0 -60
- package/dist/scripts/agent-rollback-command-check.js +0 -86
- package/dist/scripts/agent-route-truth-backfill-check.js +0 -5
- package/dist/scripts/agent-scheduler-proof-check.js +0 -13
- package/dist/scripts/agent-scheduler-proof-hardening-check.js +0 -22
- package/dist/scripts/agent-session-generation-check.js +0 -21
- package/dist/scripts/agent-slot-pane-binding-proof-check.js +0 -64
- package/dist/scripts/agent-slot-telemetry-wiring-check.js +0 -11
- package/dist/scripts/agent-source-intelligence-propagation-check.js +0 -9
- package/dist/scripts/agent-strategy-to-lease-wiring-check.js +0 -32
- package/dist/scripts/agent-strategy-to-patch-strict-check.js +0 -54
- package/dist/scripts/agent-task-graph-expansion-check.js +0 -14
- package/dist/scripts/agent-terminal-generations-check.js +0 -23
- package/dist/scripts/agent-visual-consistency-check.js +0 -9
- package/dist/scripts/agent-wiki-context-proof-check.js +0 -76
- package/dist/scripts/agent-worker-backend-router-check.js +0 -63
- package/dist/scripts/agent-worker-scout-limited-check.js +0 -17
- package/dist/scripts/agent-zellij-dynamic-backfill-panes-check.js +0 -34
- package/dist/scripts/agent-zellij-runtime-check.js +0 -85
- package/dist/scripts/appshots-capability-check.js +0 -18
- package/dist/scripts/appshots-evidence-check.js +0 -48
- package/dist/scripts/appshots-operator-policy-check.js +0 -25
- package/dist/scripts/appshots-privacy-safety-check.js +0 -48
- package/dist/scripts/appshots-source-intelligence-check.js +0 -53
- package/dist/scripts/appshots-triwiki-voxel-check.js +0 -46
- package/dist/scripts/brand-neutrality-generated-artifacts-check.js +0 -161
- package/dist/scripts/brand-neutrality-zero-leakage-check.js +0 -4
- package/dist/scripts/check-dist-runtime.js +0 -101
- package/dist/scripts/check-package-boundary.js +0 -108
- package/dist/scripts/check-ts-contracts.js +0 -69
- package/dist/scripts/check-ts-suppressions.js +0 -58
- package/dist/scripts/clean-dist.js +0 -8
- package/dist/scripts/cli-five-minute-task-check.js +0 -6
- package/dist/scripts/codex-0-133-official-compat-report.js +0 -53
- package/dist/scripts/codex-0-135-compat-check.js +0 -57
- package/dist/scripts/codex-0-136-compat-check.js +0 -30
- package/dist/scripts/codex-0139-capability-check.js +0 -26
- package/dist/scripts/codex-0139-code-mode-web-search-real-check.js +0 -10
- package/dist/scripts/codex-0139-doctor-env-real-check.js +0 -10
- package/dist/scripts/codex-0139-doctor-env-redaction-check.js +0 -18
- package/dist/scripts/codex-0139-image-path-real-check.js +0 -10
- package/dist/scripts/codex-0139-interrupt-agent-check.js +0 -18
- package/dist/scripts/codex-0139-interrupt-agent-real-check.js +0 -8
- package/dist/scripts/codex-0139-plugin-cache-real-check.js +0 -10
- package/dist/scripts/codex-0139-plugin-marketplace-real-check.js +0 -10
- package/dist/scripts/codex-0139-real-probe-summary-check.js +0 -14
- package/dist/scripts/codex-0139-rich-tool-schema-check.js +0 -12
- package/dist/scripts/codex-0139-rich-tool-schema-real-check.js +0 -10
- package/dist/scripts/codex-0139-sandbox-profile-alias-check.js +0 -13
- package/dist/scripts/codex-0139-sandbox-profile-alias-real-check.js +0 -10
- package/dist/scripts/codex-0139-sandbox-proxy-real-check.js +0 -10
- package/dist/scripts/codex-0140-bedrock-managed-auth-check.js +0 -4
- package/dist/scripts/codex-0140-deep-probes-check.js +0 -40
- package/dist/scripts/codex-0140-feature-gate-lib.js +0 -14
- package/dist/scripts/codex-0140-goal-attachment-preservation-check.js +0 -8
- package/dist/scripts/codex-0140-goal-attachment-roundtrip-check.js +0 -9
- package/dist/scripts/codex-0140-import-check.js +0 -4
- package/dist/scripts/codex-0140-large-repo-performance-check.js +0 -4
- package/dist/scripts/codex-0140-mcp-reliability-check.js +0 -4
- package/dist/scripts/codex-0140-non-tty-interrupt-check.js +0 -4
- package/dist/scripts/codex-0140-real-probes-check.js +0 -9
- package/dist/scripts/codex-0140-session-delete-check.js +0 -4
- package/dist/scripts/codex-0140-sqlite-recovery-check.js +0 -4
- package/dist/scripts/codex-0140-unified-mentions-check.js +0 -4
- package/dist/scripts/codex-0140-usage-check.js +0 -4
- package/dist/scripts/codex-0140-usage-real-parser-check.js +0 -17
- package/dist/scripts/codex-0141-capability-check.js +0 -17
- package/dist/scripts/codex-0144-doctor-wiring-check.js +0 -21
- package/dist/scripts/codex-account-usage-autodiscovery-check.js +0 -22
- package/dist/scripts/codex-account-usage-check.js +0 -9
- package/dist/scripts/codex-app-harness-matrix-check.js +0 -4
- package/dist/scripts/codex-app-launcher-check.js +0 -17
- package/dist/scripts/codex-app-provider-badge-check.js +0 -37
- package/dist/scripts/codex-app-provider-model-ui-check.js +0 -163
- package/dist/scripts/codex-app-type-safety-check.js +0 -4
- package/dist/scripts/codex-app-ui-clobber-guard-check.js +0 -22
- package/dist/scripts/codex-app-ui-preservation-check.js +0 -137
- package/dist/scripts/codex-config-eperm-fixture.js +0 -32
- package/dist/scripts/codex-control-capability-check.js +0 -10
- package/dist/scripts/codex-control-empty-result-retry-check.js +0 -43
- package/dist/scripts/codex-control-keepalive-no-cot-leak-check.js +0 -14
- package/dist/scripts/codex-control-model-capacity-fallback-check.js +0 -53
- package/dist/scripts/codex-control-no-legacy-fallback-check.js +0 -31
- package/dist/scripts/codex-control-side-effect-scope-check.js +0 -26
- package/dist/scripts/codex-control-stream-idle-watchdog-check.js +0 -34
- package/dist/scripts/codex-control-structured-output-check.js +0 -11
- package/dist/scripts/codex-control-thread-registry-check.js +0 -11
- package/dist/scripts/codex-effort-auto-discovery-check.js +0 -17
- package/dist/scripts/codex-effort-order-check.js +0 -9
- package/dist/scripts/codex-environment-scoped-approvals-check.js +0 -10
- package/dist/scripts/codex-exec-output-schema-actual-syntax-check.js +0 -33
- package/dist/scripts/codex-fast-mode-profile-propagation-check.js +0 -14
- package/dist/scripts/codex-history-search-check.js +0 -19
- package/dist/scripts/codex-hook-approval-matrix-check.js +0 -4
- package/dist/scripts/codex-hook-approval-probe-check.js +0 -4
- package/dist/scripts/codex-hook-lifecycle-check.js +0 -4
- package/dist/scripts/codex-hook-semantic-check.js +0 -15
- package/dist/scripts/codex-hook-strict-subset-check.js +0 -61
- package/dist/scripts/codex-init-deep-check.js +0 -4
- package/dist/scripts/codex-init-deep-managed-agents-check.js +0 -4
- package/dist/scripts/codex-lb-config-toml-safety-check.js +0 -85
- package/dist/scripts/codex-lb-missing-env-regression.js +0 -39
- package/dist/scripts/codex-lb-persistence-truth-check.js +0 -96
- package/dist/scripts/codex-lb-setup-fixture-check.js +0 -91
- package/dist/scripts/codex-lb-setup-truthfulness-check.js +0 -89
- package/dist/scripts/codex-legacy-profile-consumers-removed-check.js +0 -24
- package/dist/scripts/codex-managed-proxy-env-check.js +0 -17
- package/dist/scripts/codex-model-metadata-check.js +0 -10
- package/dist/scripts/codex-native-broker-read-only-check.js +0 -44
- package/dist/scripts/codex-native-invocation-defaults-check.js +0 -4
- package/dist/scripts/codex-native-invocation-router-check.js +0 -4
- package/dist/scripts/codex-native-pattern-analysis-check.js +0 -4
- package/dist/scripts/codex-native-reference-cache-check.js +0 -30
- package/dist/scripts/codex-native-reference-evidence-check.js +0 -4
- package/dist/scripts/codex-native-repair-transaction-check.js +0 -47
- package/dist/scripts/codex-native-route-map-check.js +0 -4
- package/dist/scripts/codex-native-skill-content-check.js +0 -24
- package/dist/scripts/codex-output-schema-fixture-check.js +0 -25
- package/dist/scripts/codex-plugin-cache-check.js +0 -15
- package/dist/scripts/codex-plugin-diff-check.js +0 -16
- package/dist/scripts/codex-plugin-inventory-check.js +0 -15
- package/dist/scripts/codex-plugin-json-check.js +0 -10
- package/dist/scripts/codex-plugin-list-json-check.js +0 -8
- package/dist/scripts/codex-plugin-parallel-detail-fetch-check.js +0 -12
- package/dist/scripts/codex-profile-primary-check.js +0 -13
- package/dist/scripts/codex-project-config-policy-merge-regression.js +0 -92
- package/dist/scripts/codex-resume-cwd-truth-check.js +0 -17
- package/dist/scripts/codex-sdk-no-legacy-fallback-check.js +0 -33
- package/dist/scripts/codex-sdk-qa-pipeline-check.js +0 -8
- package/dist/scripts/codex-sdk-release-review-pipeline-check.js +0 -13
- package/dist/scripts/codex-sdk-research-pipeline-check.js +0 -69
- package/dist/scripts/codex-sdk-sandbox-policy-check.js +0 -25
- package/dist/scripts/codex-sdk-structured-output-check.js +0 -10
- package/dist/scripts/codex-sdk-team-naruto-agent-pipeline-check.js +0 -12
- package/dist/scripts/codex-sdk-thread-registry-check.js +0 -11
- package/dist/scripts/codex-sdk-ux-ppt-review-pipeline-check.js +0 -9
- package/dist/scripts/codex-sdk-version-compat-check.js +0 -11
- package/dist/scripts/codex-sdk-zellij-pane-binding-check.js +0 -13
- package/dist/scripts/codex-skill-rich-content-check.js +0 -4
- package/dist/scripts/codex-skill-sync-check.js +0 -4
- package/dist/scripts/codex-thread-runtime-choice-check.js +0 -10
- package/dist/scripts/codex-web-adapter-check.js +0 -12
- package/dist/scripts/coding-bench-check.js +0 -142
- package/dist/scripts/computer-use-live-evidence-check.js +0 -55
- package/dist/scripts/computer-use-live-optional-check.js +0 -32
- package/dist/scripts/computer-use-policy-check.js +0 -69
- package/dist/scripts/computer-use-visual-route-fixture-check.js +0 -37
- package/dist/scripts/core-skill-immutable-sync-check.js +0 -19
- package/dist/scripts/core-skill-manifest-check.js +0 -20
- package/dist/scripts/core-skill-promotion-side-effect-ledger-check.js +0 -64
- package/dist/scripts/core-skill-rollout-scoring-check.js +0 -72
- package/dist/scripts/core-skill-trainer-check.js +0 -116
- package/dist/scripts/dfix-fast-kernel-check.js +0 -26
- package/dist/scripts/dfix-performance-check.js +0 -15
- package/dist/scripts/docs-codex-0139-wording-check.js +0 -21
- package/dist/scripts/docs-loop-productionization-check.js +0 -3
- package/dist/scripts/docs-loop-runtime-check.js +0 -3
- package/dist/scripts/doctor-codex-startup-repair-check.js +0 -146
- package/dist/scripts/doctor-context7-mcp-repair-check.js +0 -11
- package/dist/scripts/doctor-context7-repair-check.js +0 -48
- package/dist/scripts/doctor-dirty-plan-check.js +0 -9
- package/dist/scripts/doctor-dirty-repair-check.js +0 -8
- package/dist/scripts/doctor-dirty-semantic-check.js +0 -7
- package/dist/scripts/doctor-fix-recovers-corrupted-config-check.js +0 -122
- package/dist/scripts/doctor-imagegen-repair-check.js +0 -77
- package/dist/scripts/doctor-native-capability-repair-check.js +0 -10
- package/dist/scripts/doctor-native-repair-output-check.js +0 -18
- package/dist/scripts/doctor-plain-fix-native-assets-check.js +0 -12
- package/dist/scripts/doctor-post-repair-authoritative-check.js +0 -39
- package/dist/scripts/doctor-startup-config-repair-check.js +0 -20
- package/dist/scripts/doctor-supabase-mcp-repair-check.js +0 -12
- package/dist/scripts/doctor-transaction-engine-check.js +0 -32
- package/dist/scripts/doctor-transaction-owns-mutations-check.js +0 -14
- package/dist/scripts/doctor-warning-only-not-blocker-check.js +0 -56
- package/dist/scripts/doctor-zellij-fix-output-check.js +0 -4
- package/dist/scripts/doctor-zellij-repair-check.js +0 -4
- package/dist/scripts/evidence-fixture-check.js +0 -26
- package/dist/scripts/fake-real-proof-policy-v2-check.js +0 -27
- package/dist/scripts/fake-vs-real-proof-policy-check.js +0 -14
- package/dist/scripts/flagship-proof-graph-v2-check.js +0 -48
- package/dist/scripts/flagship-proof-graph-v3-check.js +0 -67
- package/dist/scripts/flagship-proof-graph-v4-check.js +0 -61
- package/dist/scripts/gate-pack-fixture-cache-check.js +0 -9
- package/dist/scripts/gate-pack-runner-check.js +0 -6
- package/dist/scripts/geo-llms-txt-optional-check.js +0 -19
- package/dist/scripts/git-precommit-fixture-check.js +0 -41
- package/dist/scripts/git-worktree-cache-performance-check.js +0 -25
- package/dist/scripts/git-worktree-capability-check.js +0 -27
- package/dist/scripts/git-worktree-cleanup-check.js +0 -27
- package/dist/scripts/git-worktree-diff-export-check.js +0 -43
- package/dist/scripts/git-worktree-integration-primary-runtime-check.js +0 -20
- package/dist/scripts/git-worktree-manager-check.js +0 -37
- package/dist/scripts/git-worktree-merge-queue-check.js +0 -31
- package/dist/scripts/git-worktree-pool-performance-check.js +0 -20
- package/dist/scripts/git-worktree-prewarm-runtime-check.js +0 -7
- package/dist/scripts/goal-legacy-runtime-escape-check.js +0 -3
- package/dist/scripts/goal-loop-compat-check.js +0 -3
- package/dist/scripts/goal-loop-runtime-default-check.js +0 -3
- package/dist/scripts/goal-mode-official-default-check.js +0 -12
- package/dist/scripts/gpt-final-arbiter-check.js +0 -66
- package/dist/scripts/gpt-final-arbiter-performance-check.js +0 -36
- package/dist/scripts/gpt-image-2-request-validator-check.js +0 -35
- package/dist/scripts/hooks-0.134-context-parity-check.js +0 -20
- package/dist/scripts/hooks-actual-parity-check.js +0 -17
- package/dist/scripts/hooks-actual-parity-v2-check.js +0 -21
- package/dist/scripts/hooks-latest-schema-check.js +0 -20
- package/dist/scripts/hooks-managed-install-fixture-check.js +0 -21
- package/dist/scripts/hooks-no-unsupported-handlers.js +0 -15
- package/dist/scripts/hooks-official-hash-oracle-check.js +0 -35
- package/dist/scripts/hooks-official-hash-parity-check.js +0 -17
- package/dist/scripts/hooks-runtime-replay-warning-zero-v2.js +0 -26
- package/dist/scripts/hooks-runtime-replay-warning-zero.js +0 -10
- package/dist/scripts/hooks-subagent-events-check.js +0 -17
- package/dist/scripts/hooks-trust-state-check.js +0 -14
- package/dist/scripts/hooks-trust-warning-zero.js +0 -14
- package/dist/scripts/image-artifact-registry-check.js +0 -14
- package/dist/scripts/image-fidelity-fixture-check.js +0 -24
- package/dist/scripts/image-followup-edit-path-check.js +0 -14
- package/dist/scripts/image-generation-path-handoff-check.js +0 -8
- package/dist/scripts/image-global-path-contract-check.js +0 -38
- package/dist/scripts/imagegen-capability-check.js +0 -30
- package/dist/scripts/init-deep-memory-scope-safety-check.js +0 -23
- package/dist/scripts/install-update-preserves-config-check.js +0 -182
- package/dist/scripts/json-schema-recursive-check.js +0 -78
- package/dist/scripts/legacy-multiagent-removal-check.js +0 -85
- package/dist/scripts/legacy-purge-final-check.js +0 -5
- package/dist/scripts/legacy-update-e2e-check.js +0 -228
- package/dist/scripts/lib/mad-sks-actual-executor-check-lib.js +0 -255
- package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +0 -242
- package/dist/scripts/lib/real-codex-parallel-gate.js +0 -94
- package/dist/scripts/lib/real-codex-parallel-proof-fixture.js +0 -55
- package/dist/scripts/local-collab-gpt-final-availability-check.js +0 -58
- package/dist/scripts/local-collab-no-local-only-final-check.js +0 -27
- package/dist/scripts/local-collab-policy-check.js +0 -17
- package/dist/scripts/local-collab-worktree-gpt-final-apply-policy-check.js +0 -63
- package/dist/scripts/local-llm-cache-performance-check.js +0 -10
- package/dist/scripts/local-llm-capability-check.js +0 -14
- package/dist/scripts/local-llm-smoke-check.js +0 -32
- package/dist/scripts/local-llm-structured-output-check.js +0 -11
- package/dist/scripts/local-llm-throughput-check.js +0 -10
- package/dist/scripts/local-llm-tool-call-repair-check.js +0 -10
- package/dist/scripts/local-llm-warmup-check.js +0 -11
- package/dist/scripts/loop-hardening-check-lib.js +0 -289
- package/dist/scripts/machine-local-evidence-zero-check.js +0 -22
- package/dist/scripts/mad-db-capability-check.js +0 -26
- package/dist/scripts/mad-db-command-check.js +0 -18
- package/dist/scripts/mad-db-direct-apply-migration-hook-check.js +0 -73
- package/dist/scripts/mad-db-hook-idempotency-check.js +0 -21
- package/dist/scripts/mad-db-lifecycle-hook-decision-check.js +0 -18
- package/dist/scripts/mad-db-one-cycle-bounded-check.js +0 -24
- package/dist/scripts/mad-db-one-cycle-consumption-check.js +0 -16
- package/dist/scripts/mad-db-operation-lifecycle-ledger-check.js +0 -17
- package/dist/scripts/mad-db-parallel-lifecycle-check.js +0 -24
- package/dist/scripts/mad-db-policy-v2-check.js +0 -20
- package/dist/scripts/mad-db-priority-resolver-check.js +0 -20
- package/dist/scripts/mad-db-real-supabase-e2e.js +0 -166
- package/dist/scripts/mad-db-route-identity-check.js +0 -30
- package/dist/scripts/mad-db-runtime-profile-lifecycle-check.js +0 -24
- package/dist/scripts/mad-db-safety-conflict-matrix-check.js +0 -45
- package/dist/scripts/mad-db-skill-policy-snapshot-check.js +0 -18
- package/dist/scripts/mad-db-supabase-transport-diagnostics-check.js +0 -47
- package/dist/scripts/mad-sks-audit-proof-check.js +0 -34
- package/dist/scripts/mad-sks-db-executor-check.js +0 -5
- package/dist/scripts/mad-sks-executor-proof-graph-check.js +0 -5
- package/dist/scripts/mad-sks-fast-mode-propagation-check.js +0 -24
- package/dist/scripts/mad-sks-file-write-executor-check.js +0 -5
- package/dist/scripts/mad-sks-immutable-harness-check.js +0 -36
- package/dist/scripts/mad-sks-live-protected-core-smoke.js +0 -5
- package/dist/scripts/mad-sks-no-harness-modification-check.js +0 -25
- package/dist/scripts/mad-sks-package-executor-check.js +0 -5
- package/dist/scripts/mad-sks-permission-model-check.js +0 -22
- package/dist/scripts/mad-sks-rollback-apply-check.js +0 -5
- package/dist/scripts/mad-sks-service-executor-check.js +0 -5
- package/dist/scripts/mad-sks-shell-executor-check.js +0 -5
- package/dist/scripts/mad-sks-write-guard-check.js +0 -28
- package/dist/scripts/mad-sks-zellij-default-pane-worker-check.js +0 -38
- package/dist/scripts/mad-sks-zellij-launch-check.js +0 -108
- package/dist/scripts/mad-zellij-no-contradictory-output-check.js +0 -4
- package/dist/scripts/mad-zellij-self-heal-check.js +0 -4
- package/dist/scripts/managed-role-manifest-parity-check.js +0 -24
- package/dist/scripts/mcp-0-134-modernization-check.js +0 -55
- package/dist/scripts/mcp-readonly-concurrency-check.js +0 -17
- package/dist/scripts/mcp-readonly-runtime-scheduler-check.js +0 -20
- package/dist/scripts/memory-summary-rebuild-check.js +0 -22
- package/dist/scripts/naruto-active-pool-check.js +0 -39
- package/dist/scripts/naruto-actual-worker-control-plane-check.js +0 -56
- package/dist/scripts/naruto-allocation-policy-check.js +0 -33
- package/dist/scripts/naruto-allocation-runtime-wiring-check.js +0 -92
- package/dist/scripts/naruto-concurrency-governor-check.js +0 -53
- package/dist/scripts/naruto-extreme-parallelism-check.js +0 -22
- package/dist/scripts/naruto-extreme-parallelism-real-check.js +0 -45
- package/dist/scripts/naruto-gpt-final-pack-check.js +0 -34
- package/dist/scripts/naruto-loop-maker-checker-check.js +0 -3
- package/dist/scripts/naruto-loop-mesh-check.js +0 -3
- package/dist/scripts/naruto-loop-worker-router-check.js +0 -3
- package/dist/scripts/naruto-orchestrator-runtime-source-check.js +0 -70
- package/dist/scripts/naruto-parallel-gate-consistency-check.js +0 -8
- package/dist/scripts/naruto-parallel-patch-apply-check.js +0 -41
- package/dist/scripts/naruto-parallel-runtime-proof-check.js +0 -9
- package/dist/scripts/naruto-parallelism-mode-check.js +0 -13
- package/dist/scripts/naruto-parallelism-ux-check.js +0 -8
- package/dist/scripts/naruto-proof-message-summary-check.js +0 -9
- package/dist/scripts/naruto-proof-zellij-stacked-summary-check.js +0 -47
- package/dist/scripts/naruto-readonly-routing-check.js +0 -119
- package/dist/scripts/naruto-real-active-pool-check.js +0 -39
- package/dist/scripts/naruto-real-active-pool-runtime-check.js +0 -85
- package/dist/scripts/naruto-real-local-gpt-final-smoke.js +0 -25
- package/dist/scripts/naruto-rebalance-policy-check.js +0 -41
- package/dist/scripts/naruto-role-distribution-check.js +0 -23
- package/dist/scripts/naruto-shadow-clone-swarm-check.js +0 -6
- package/dist/scripts/naruto-ssot-default-check.js +0 -9
- package/dist/scripts/naruto-ssot-gate-aliases-check.js +0 -10
- package/dist/scripts/naruto-ssot-pipeline-default-check.js +0 -11
- package/dist/scripts/naruto-ssot-route-normalization-check.js +0 -9
- package/dist/scripts/naruto-ssot-routing-check.js +0 -13
- package/dist/scripts/naruto-verification-pool-check.js +0 -36
- package/dist/scripts/naruto-visible-vs-active-workers-check.js +0 -10
- package/dist/scripts/naruto-work-graph-check.js +0 -24
- package/dist/scripts/naruto-worktree-coding-check.js +0 -44
- package/dist/scripts/naruto-worktree-gpt-final-check.js +0 -45
- package/dist/scripts/naruto-worktree-zellij-ui-check.js +0 -28
- package/dist/scripts/naruto-zellij-dynamic-right-column-check.js +0 -48
- package/dist/scripts/naruto-zellij-massive-ui-check.js +0 -23
- package/dist/scripts/native-app-screenshot-repair-check.js +0 -11
- package/dist/scripts/native-capability-repair-check.js +0 -15
- package/dist/scripts/native-chrome-web-review-repair-check.js +0 -11
- package/dist/scripts/native-computer-use-repair-check.js +0 -11
- package/dist/scripts/native-swarm-process-spawn-proof-check.js +0 -7
- package/dist/scripts/native-swarm-zellij-does-not-block-workers-check.js +0 -11
- package/dist/scripts/no-ts-nocheck-release-scripts-check.js +0 -4
- package/dist/scripts/non-recursive-pipeline-check.js +0 -68
- package/dist/scripts/npm-publish-performance-check.js +0 -74
- package/dist/scripts/orphan-strong-detection-check.js +0 -12
- package/dist/scripts/parallel-missing-pid-rejection-check.js +0 -55
- package/dist/scripts/parallel-runtime-proof-check.js +0 -23
- package/dist/scripts/parallel-runtime-proof-events-check.js +0 -13
- package/dist/scripts/parallel-strict-pid-proof-check.js +0 -54
- package/dist/scripts/parallel-verification-engine-check.js +0 -85
- package/dist/scripts/perf-gate.js +0 -39
- package/dist/scripts/pipeline-codex-0140-integration-check.js +0 -30
- package/dist/scripts/pipeline-five-minute-sla-check.js +0 -7
- package/dist/scripts/postinstall-safe-side-effects-check.js +0 -71
- package/dist/scripts/ppt-full-e2e-artifact-graph-check.js +0 -40
- package/dist/scripts/ppt-image-voxel-relations-check.js +0 -9
- package/dist/scripts/ppt-imagegen-review-fixture-check.js +0 -6
- package/dist/scripts/ppt-issue-extraction-fixture-check.js +0 -7
- package/dist/scripts/ppt-no-mock-as-real-check.js +0 -10
- package/dist/scripts/ppt-no-text-fallback-check.js +0 -7
- package/dist/scripts/ppt-proof-trust-fixture-check.js +0 -10
- package/dist/scripts/ppt-slide-export-fixture-check.js +0 -7
- package/dist/scripts/priority-full-closure-check.js +0 -12
- package/dist/scripts/product-design-auto-install-check.js +0 -119
- package/dist/scripts/project-skill-dedupe-check.js +0 -34
- package/dist/scripts/provider-context-config-toml-check.js +0 -63
- package/dist/scripts/python-codex-sdk-capability-check.js +0 -75
- package/dist/scripts/python-codex-sdk-sandbox-policy-check.js +0 -10
- package/dist/scripts/python-codex-sdk-stream-bridge-check.js +0 -12
- package/dist/scripts/python-tools-smoke-check.js +0 -71
- package/dist/scripts/qa-actual-route-backfill-check.js +0 -5
- package/dist/scripts/qa-loop-app-server-driver-check.js +0 -74
- package/dist/scripts/qa-loop-surface-router-check.js +0 -49
- package/dist/scripts/quantum-baseline-report.js +0 -38
- package/dist/scripts/release-3112-required-gates.js +0 -30
- package/dist/scripts/release-3113-required-gates.js +0 -25
- package/dist/scripts/release-4000-required-gates.js +0 -36
- package/dist/scripts/release-4001-required-gates.js +0 -13
- package/dist/scripts/release-4002-required-gates.js +0 -14
- package/dist/scripts/release-cache-bridge-check.js +0 -23
- package/dist/scripts/release-check-dynamic-execute.js +0 -256
- package/dist/scripts/release-check-dynamic.js +0 -98
- package/dist/scripts/release-dynamic-performance-check.js +0 -109
- package/dist/scripts/release-gate-existence-audit.js +0 -78
- package/dist/scripts/release-gate-worker.js +0 -10
- package/dist/scripts/release-metadata-1-11-check.js +0 -37
- package/dist/scripts/release-metadata-1-12-check.js +0 -48
- package/dist/scripts/release-metadata-1-13-check.js +0 -53
- package/dist/scripts/release-metadata-1-14-check.js +0 -63
- package/dist/scripts/release-native-agent-fixture-check.js +0 -41
- package/dist/scripts/release-parallel-full-coverage-check.js +0 -19
- package/dist/scripts/release-registry-check.js +0 -417
- package/dist/scripts/release-script-type-safety-check.js +0 -4
- package/dist/scripts/release-speed-summary-check.js +0 -20
- package/dist/scripts/release-stability-report-check.js +0 -103
- package/dist/scripts/release-triwiki-first-runner-check.js +0 -9
- package/dist/scripts/repo-audit.js +0 -83
- package/dist/scripts/research-actual-route-backfill-check.js +0 -5
- package/dist/scripts/research-handoff-consumability-check.js +0 -23
- package/dist/scripts/research-parallel-source-shards-check.js +0 -22
- package/dist/scripts/research-real-cycle-no-legacy-final-md-check.js +0 -18
- package/dist/scripts/research-real-synthesis-no-deterministic-renderer-check.js +0 -14
- package/dist/scripts/research-repetition-detector-check.js +0 -19
- package/dist/scripts/research-short-report-rejection-check.js +0 -46
- package/dist/scripts/research-source-ledger-merge-check.js +0 -26
- package/dist/scripts/research-synthesis-prompt-contract-check.js +0 -36
- package/dist/scripts/research-synthesis-writer-check.js +0 -26
- package/dist/scripts/research-template-report-rejection-check.js +0 -56
- package/dist/scripts/research-ultra-stability-report.js +0 -45
- package/dist/scripts/retention-cleanup-safety-check.js +0 -174
- package/dist/scripts/route-proof-artifact-structure-check.js +0 -146
- package/dist/scripts/runtime-proof-summary-cli-check.js +0 -51
- package/dist/scripts/runtime-proof-summary-messages-check.js +0 -37
- package/dist/scripts/runtime-proof-zellij-stacked-summary-check.js +0 -58
- package/dist/scripts/runtime-ts-python-boundary-check.js +0 -59
- package/dist/scripts/rust-smoke.js +0 -5
- package/dist/scripts/safety-check.js +0 -23
- package/dist/scripts/scheduler-critical-path-check.js +0 -9
- package/dist/scripts/scheduler-extreme-parallel-check.js +0 -7
- package/dist/scripts/scheduler-resource-budget-check.js +0 -7
- package/dist/scripts/scheduler-utilization-proof-check.js +0 -8
- package/dist/scripts/secret-line-rollback-check.js +0 -35
- package/dist/scripts/seo-canonical-locale-check.js +0 -19
- package/dist/scripts/seo-geo-feature-fixture-quality-check.js +0 -18
- package/dist/scripts/seo-geo-no-unsupported-ranking-claims-check.js +0 -18
- package/dist/scripts/seo-mutation-rollback-check.js +0 -23
- package/dist/scripts/seo-structured-data-visible-content-check.js +0 -19
- package/dist/scripts/side-effect-zero-gate-check.js +0 -226
- package/dist/scripts/skill-registry-ledger-check.js +0 -14
- package/dist/scripts/skill-sync-atomic-check.js +0 -35
- package/dist/scripts/sks-1-11-fixture-check.js +0 -130
- package/dist/scripts/sks-3-1-7-directive-check-lib.js +0 -58
- package/dist/scripts/source-intelligence-all-modes-check.js +0 -22
- package/dist/scripts/source-intelligence-policy-check.js +0 -13
- package/dist/scripts/strategy-adhd-orchestrating-gate-check.js +0 -22
- package/dist/scripts/strategy-file-ownership-plan-check.js +0 -18
- package/dist/scripts/strategy-parallel-modification-plan-check.js +0 -19
- package/dist/scripts/strategy-verification-rollback-dag-check.js +0 -19
- package/dist/scripts/super-search-name-guard-check.js +0 -98
- package/dist/scripts/team-actual-route-backfill-check.js +0 -5
- package/dist/scripts/team-legacy-create-removed-check.js +0 -12
- package/dist/scripts/terminal-tui-output-stability-check.js +0 -35
- package/dist/scripts/tmux-removal-inventory.js +0 -36
- package/dist/scripts/triwiki-affected-graph-check.js +0 -10
- package/dist/scripts/triwiki-gate-impact-map-check.js +0 -8
- package/dist/scripts/triwiki-module-card-check.js +0 -7
- package/dist/scripts/triwiki-stale-proof-rejection-check.js +0 -25
- package/dist/scripts/typescript-migration-report.js +0 -78
- package/dist/scripts/ultra-router-classification-check.js +0 -28
- package/dist/scripts/update-concurrent-lock-check.js +0 -11
- package/dist/scripts/update-default-command-check.js +0 -30
- package/dist/scripts/update-doctor-lifecycle-check.js +0 -13
- package/dist/scripts/update-first-command-migration-check.js +0 -15
- package/dist/scripts/update-mad-zellij-notice-check.js +0 -9
- package/dist/scripts/update-new-binary-reexec-check.js +0 -12
- package/dist/scripts/update-notice-check.js +0 -10
- package/dist/scripts/update-secret-migration-journal-check.js +0 -8
- package/dist/scripts/update-secret-preservation-guard-check.js +0 -10
- package/dist/scripts/ux-ppt-structured-extraction-check.js +0 -21
- package/dist/scripts/ux-review-extract-real-callouts-fixture-check.js +0 -8
- package/dist/scripts/ux-review-generate-callouts-fixture-check.js +0 -9
- package/dist/scripts/ux-review-image-voxel-relations-check.js +0 -31
- package/dist/scripts/ux-review-no-fake-callouts-check.js +0 -8
- package/dist/scripts/ux-review-no-text-fallback-check.js +0 -25
- package/dist/scripts/ux-review-patch-handoff-fixture-check.js +0 -8
- package/dist/scripts/ux-review-real-loop-fixture-check.js +0 -29
- package/dist/scripts/ux-review-recapture-recheck-fixture-check.js +0 -8
- package/dist/scripts/worker-pane-communication-contract-check.js +0 -53
- package/dist/scripts/zellij-real-session-heartbeat-check.js +0 -49
- package/dist/scripts/zellij-viewport-binder-check.js +0 -9
- package/dist/scripts/zellij-worker-pane-spawn-order-check.js +0 -35
|
@@ -1,2288 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { ensureDir, exists, PACKAGE_VERSION, readJson, readText, runProcess, sha256, which, writeJsonAtomic, writeTextAtomic } from '../fsx.js';
|
|
6
|
-
import { findCodexApp } from '../codex-app.js';
|
|
7
|
-
import { withHeartbeat } from '../../cli/cli-theme.js';
|
|
8
|
-
export const SKS_MENUBAR_LABEL = 'com.sneakoscope.sks-menubar';
|
|
9
|
-
const LABEL = SKS_MENUBAR_LABEL;
|
|
10
|
-
const CONTROL_CENTER_DOMAIN = 'com.apple.controlcenter';
|
|
11
|
-
const CONTROL_CENTER_PREFERRED_POSITION = 360;
|
|
12
|
-
const SECRET_LAUNCH_ENV_KEYS = ['CODEX_LB_API_KEY', 'OPENROUTER_API_KEY'];
|
|
13
|
-
const MENU_ITEMS = [
|
|
14
|
-
'Use codex-lb',
|
|
15
|
-
'Use ChatGPT OAuth',
|
|
16
|
-
'Set codex-lb Domain and Key',
|
|
17
|
-
'Set OpenRouter Key and GLM Profiles',
|
|
18
|
-
'Fast Mode On',
|
|
19
|
-
'Fast Mode Off',
|
|
20
|
-
'Fast Check',
|
|
21
|
-
'SKS Version Check',
|
|
22
|
-
'Update SKS Now',
|
|
23
|
-
'Codex CLI Version',
|
|
24
|
-
'Update Codex CLI Now',
|
|
25
|
-
'Manage MCP Servers',
|
|
26
|
-
'Run sks doctor --fix',
|
|
27
|
-
'Open Dashboard',
|
|
28
|
-
'Open Codex Settings',
|
|
29
|
-
'Restart Codex',
|
|
30
|
-
'View Last Log',
|
|
31
|
-
'Quit SKS Menu'
|
|
32
|
-
];
|
|
33
|
-
export function sksMenuBarPaths(homeInput, rootInput) {
|
|
34
|
-
const home = path.resolve(homeInput || process.env.HOME || os.homedir());
|
|
35
|
-
const root = path.resolve(rootInput || process.cwd());
|
|
36
|
-
const installDir = path.join(home, '.codex', 'sks-menubar');
|
|
37
|
-
const appPath = path.join(installDir, 'SKSMenuBar.app');
|
|
38
|
-
const contentsPath = path.join(appPath, 'Contents');
|
|
39
|
-
const macosPath = path.join(contentsPath, 'MacOS');
|
|
40
|
-
return {
|
|
41
|
-
home,
|
|
42
|
-
root,
|
|
43
|
-
install_dir: installDir,
|
|
44
|
-
app_path: appPath,
|
|
45
|
-
staging_app_path: `${appPath}.staging`,
|
|
46
|
-
backup_app_path: `${appPath}.previous`,
|
|
47
|
-
contents_path: contentsPath,
|
|
48
|
-
macos_path: macosPath,
|
|
49
|
-
executable_path: path.join(macosPath, 'SKSMenuBar'),
|
|
50
|
-
source_path: path.join(installDir, 'SKSMenuBar.swift'),
|
|
51
|
-
info_plist_path: path.join(contentsPath, 'Info.plist'),
|
|
52
|
-
action_script_path: path.join(installDir, 'sks-menubar-action.sh'),
|
|
53
|
-
build_stamp_path: path.join(installDir, 'build-stamp.json'),
|
|
54
|
-
config_path: path.join(installDir, 'config.json'),
|
|
55
|
-
launch_agent_path: path.join(home, 'Library', 'LaunchAgents', `${LABEL}.plist`),
|
|
56
|
-
report_path: path.join(root, '.sneakoscope', 'reports', 'sks-menubar.json'),
|
|
57
|
-
stdout_log_path: path.join(installDir, 'menubar.out.log'),
|
|
58
|
-
stderr_log_path: path.join(installDir, 'menubar.err.log'),
|
|
59
|
-
logs_dir: path.join(installDir, 'logs'),
|
|
60
|
-
last_action_log_path: path.join(installDir, 'logs', 'last-action.log')
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export async function installSksMenuBar(opts = {}) {
|
|
64
|
-
const apply = opts.apply === true;
|
|
65
|
-
const env = opts.env || process.env;
|
|
66
|
-
const paths = sksMenuBarPaths(opts.home || env.HOME, opts.root);
|
|
67
|
-
const actions = [];
|
|
68
|
-
const warnings = [];
|
|
69
|
-
const nextActions = defaultNextActions();
|
|
70
|
-
let secretEnvCleanup;
|
|
71
|
-
let codexBundleId = null;
|
|
72
|
-
let lastTargetCheck;
|
|
73
|
-
if (process.platform !== 'darwin') {
|
|
74
|
-
const result = {
|
|
75
|
-
schema: 'sks.codex-app-sks-menubar.v1',
|
|
76
|
-
ok: true,
|
|
77
|
-
apply,
|
|
78
|
-
status: 'unsupported_platform',
|
|
79
|
-
platform: process.platform,
|
|
80
|
-
app_path: null,
|
|
81
|
-
executable_path: null,
|
|
82
|
-
launch_agent_path: null,
|
|
83
|
-
action_script_path: null,
|
|
84
|
-
build_stamp_path: null,
|
|
85
|
-
config_path: null,
|
|
86
|
-
report_path: apply ? paths.report_path : null,
|
|
87
|
-
codex_bundle_id: null,
|
|
88
|
-
menu_items: MENU_ITEMS,
|
|
89
|
-
actions: [],
|
|
90
|
-
launch: { requested: false, method: 'none', ok: true },
|
|
91
|
-
tcc_automation_status: 'unknown',
|
|
92
|
-
next_actions: [],
|
|
93
|
-
blockers: [],
|
|
94
|
-
warnings: ['sks_menubar_requires_macos']
|
|
95
|
-
};
|
|
96
|
-
if (apply)
|
|
97
|
-
await writeReport(paths.report_path, result);
|
|
98
|
-
return result;
|
|
99
|
-
}
|
|
100
|
-
if (!apply) {
|
|
101
|
-
const installed = await exists(paths.executable_path);
|
|
102
|
-
const launchAgent = await exists(paths.launch_agent_path);
|
|
103
|
-
const status = await inspectSksMenuBarStatus({ home: paths.home, root: paths.root }).catch(() => null);
|
|
104
|
-
const statusWarnings = [...(status?.warnings || []), ...(launchAgent ? [] : ['launch_agent_not_installed_yet'])];
|
|
105
|
-
return {
|
|
106
|
-
schema: 'sks.codex-app-sks-menubar.v1',
|
|
107
|
-
ok: status ? status.ok === true : true,
|
|
108
|
-
apply,
|
|
109
|
-
status: 'planned',
|
|
110
|
-
platform: process.platform,
|
|
111
|
-
app_path: paths.app_path,
|
|
112
|
-
executable_path: paths.executable_path,
|
|
113
|
-
launch_agent_path: paths.launch_agent_path,
|
|
114
|
-
action_script_path: paths.action_script_path,
|
|
115
|
-
build_stamp_path: paths.build_stamp_path,
|
|
116
|
-
config_path: paths.config_path,
|
|
117
|
-
report_path: paths.report_path,
|
|
118
|
-
codex_bundle_id: status?.codex_sync.bundle_id || null,
|
|
119
|
-
menu_items: MENU_ITEMS,
|
|
120
|
-
actions: installed ? ['menubar_app_present'] : ['menubar_app_install_available'],
|
|
121
|
-
launch: {
|
|
122
|
-
requested: false,
|
|
123
|
-
method: 'skipped',
|
|
124
|
-
ok: true
|
|
125
|
-
},
|
|
126
|
-
target_check: status ? {
|
|
127
|
-
requested: null,
|
|
128
|
-
resolved: status.action_target.sks_entry,
|
|
129
|
-
packaged: packagedSksEntry(),
|
|
130
|
-
exists: status.action_target.sks_entry_exists,
|
|
131
|
-
project_local: status.action_target.sks_entry ? isSubpath(status.action_target.sks_entry, paths.root) : false,
|
|
132
|
-
used_previous_script: false
|
|
133
|
-
} : undefined,
|
|
134
|
-
build_stamp: status?.build_stamp || null,
|
|
135
|
-
tcc_automation_status: 'unknown',
|
|
136
|
-
next_actions: launchAgent ? defaultNextActions() : ['Run: sks menubar install'],
|
|
137
|
-
blockers: status?.blockers || [],
|
|
138
|
-
warnings: statusWarnings
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
await ensureDir(paths.install_dir);
|
|
142
|
-
await ensureDir(paths.logs_dir);
|
|
143
|
-
await ensureDir(path.dirname(paths.launch_agent_path));
|
|
144
|
-
secretEnvCleanup = await cleanupMacLaunchSecretEnvironment({ env }).catch((err) => ({
|
|
145
|
-
ok: false,
|
|
146
|
-
status: 'partial',
|
|
147
|
-
variables: SECRET_LAUNCH_ENV_KEYS,
|
|
148
|
-
cleaned: [],
|
|
149
|
-
failed: SECRET_LAUNCH_ENV_KEYS.map((key) => ({ key, error: err?.message || String(err) })),
|
|
150
|
-
next_actions: ['Rotate CODEX_LB_API_KEY and OPENROUTER_API_KEY if they were previously exposed in launchd.']
|
|
151
|
-
}));
|
|
152
|
-
if (secretEnvCleanup.status === 'cleaned')
|
|
153
|
-
actions.push('removed secret API keys from launchd user environment');
|
|
154
|
-
if (!secretEnvCleanup.ok && !secretEnvCleanup.failed.every((row) => row.error === 'empty'))
|
|
155
|
-
warnings.push('launch_secret_env_cleanup_incomplete');
|
|
156
|
-
const swiftc = env.SKS_MENUBAR_SWIFTC || await which('swiftc').catch(() => null) || await fallbackTool('/usr/bin/swiftc');
|
|
157
|
-
const launchctl = env.SKS_MENUBAR_LAUNCHCTL || await which('launchctl').catch(() => null) || await fallbackTool('/bin/launchctl');
|
|
158
|
-
const open = env.SKS_MENUBAR_OPEN || await which('open').catch(() => null) || await fallbackTool('/usr/bin/open');
|
|
159
|
-
const codesign = env.SKS_MENUBAR_CODESIGN || await which('codesign').catch(() => null) || await fallbackTool('/usr/bin/codesign');
|
|
160
|
-
const xcodeSelect = env.SKS_MENUBAR_XCODE_SELECT || await which('xcode-select').catch(() => null) || await fallbackTool('/usr/bin/xcode-select');
|
|
161
|
-
const clt = await xcodeCltStatus(xcodeSelect);
|
|
162
|
-
if (!clt.ok)
|
|
163
|
-
return await blockedResult('xcode_clt_missing', clt.error || 'Xcode Command Line Tools missing');
|
|
164
|
-
if (!swiftc)
|
|
165
|
-
return await blockedResult('swiftc_missing', 'swiftc not found');
|
|
166
|
-
const swiftcVersion = await toolVersion(swiftc, ['--version']);
|
|
167
|
-
codexBundleId = await resolveCodexBundleId({ home: paths.home, env, warnings });
|
|
168
|
-
if (!codexBundleId)
|
|
169
|
-
warnings.push('codex_app_bundle_id_unresolved');
|
|
170
|
-
const config = await writeDefaultMenuBarConfig(paths.config_path, codexBundleId);
|
|
171
|
-
actions.push(`wrote ${paths.config_path}`);
|
|
172
|
-
const target = await resolveSksEntryForInstall({
|
|
173
|
-
...(opts.sksEntry ? { explicit: opts.sksEntry } : {}),
|
|
174
|
-
root: paths.root,
|
|
175
|
-
home: paths.home,
|
|
176
|
-
env,
|
|
177
|
-
actionScriptPath: paths.action_script_path,
|
|
178
|
-
warnings
|
|
179
|
-
});
|
|
180
|
-
lastTargetCheck = target;
|
|
181
|
-
if (!target.exists) {
|
|
182
|
-
return await blockedResult('sks_entry_unresolved', `Resolved SKS entry does not exist: ${target.requested || target.resolved || target.packaged}`);
|
|
183
|
-
}
|
|
184
|
-
const actionScript = actionScriptSource({ nodeBin: process.execPath, sksEntry: target.resolved || target.packaged });
|
|
185
|
-
const swiftSource = swiftMenuSource({
|
|
186
|
-
actionScriptPath: paths.action_script_path,
|
|
187
|
-
buildStampPath: paths.build_stamp_path,
|
|
188
|
-
configPath: paths.config_path,
|
|
189
|
-
lastActionLogPath: paths.last_action_log_path,
|
|
190
|
-
codexBundleId: config.codex_bundle_id,
|
|
191
|
-
packageVersion: PACKAGE_VERSION
|
|
192
|
-
});
|
|
193
|
-
const infoPlist = infoPlistSource(PACKAGE_VERSION);
|
|
194
|
-
const launchAgent = launchAgentSource(paths.executable_path, paths.install_dir);
|
|
195
|
-
const stamp = {
|
|
196
|
-
schema: 'sks.sks-menubar-build-stamp.v1',
|
|
197
|
-
package_version: PACKAGE_VERSION,
|
|
198
|
-
source_sha256: sha256(swiftSource),
|
|
199
|
-
action_script_sha256: sha256(actionScript),
|
|
200
|
-
info_plist_sha256: sha256(infoPlist),
|
|
201
|
-
launch_agent_sha256: sha256(launchAgent),
|
|
202
|
-
swiftc_version: swiftcVersion,
|
|
203
|
-
codesign_identifier: LABEL
|
|
204
|
-
};
|
|
205
|
-
const previousStamp = await readJson(paths.build_stamp_path, null);
|
|
206
|
-
const appInstalled = await exists(paths.executable_path);
|
|
207
|
-
const currentActionScript = await readText(paths.action_script_path, '');
|
|
208
|
-
const actionScriptCurrent = currentActionScript === actionScript;
|
|
209
|
-
const stampMatches = appInstalled && buildStampEquals(previousStamp, stamp) && actionScriptCurrent;
|
|
210
|
-
const binaryStable = appInstalled
|
|
211
|
-
&& previousStamp?.schema === stamp.schema
|
|
212
|
-
&& previousStamp.package_version === stamp.package_version
|
|
213
|
-
&& previousStamp.source_sha256 === stamp.source_sha256
|
|
214
|
-
&& previousStamp.info_plist_sha256 === stamp.info_plist_sha256
|
|
215
|
-
&& previousStamp.swiftc_version === stamp.swiftc_version
|
|
216
|
-
&& previousStamp.codesign_identifier === stamp.codesign_identifier;
|
|
217
|
-
if (stampMatches) {
|
|
218
|
-
actions.push('menubar_up_to_date');
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
if (currentActionScript !== actionScript) {
|
|
222
|
-
await writeTextAtomic(paths.action_script_path, actionScript);
|
|
223
|
-
actions.push(`wrote ${paths.action_script_path}`);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
// The Swift app executes the action script DIRECTLY (Process.executableURL points at the
|
|
227
|
-
// script itself), so a lost executable bit breaks every menu action even when the script
|
|
228
|
-
// content is current. Re-assert the bit on every install run — including the up-to-date
|
|
229
|
-
// fast path, which previously never touched permissions and therefore could never repair
|
|
230
|
-
// a 0644 script — and surface chmod failures instead of swallowing them.
|
|
231
|
-
if (await exists(paths.action_script_path)) {
|
|
232
|
-
const previouslyExecutable = await fs.access(paths.action_script_path, fs.constants.X_OK).then(() => true).catch(() => false);
|
|
233
|
-
const chmodError = await fs.chmod(paths.action_script_path, 0o755).then(() => null).catch((err) => (err?.message ? String(err.message) : String(err)));
|
|
234
|
-
if (chmodError) {
|
|
235
|
-
warnings.push(`action_script_chmod_failed:${chmodError}`);
|
|
236
|
-
}
|
|
237
|
-
else if (!previouslyExecutable) {
|
|
238
|
-
actions.push('restored action script executable bit');
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
if (!stampMatches && !binaryStable) {
|
|
242
|
-
try {
|
|
243
|
-
await buildMenuBarAppAtomically({
|
|
244
|
-
paths,
|
|
245
|
-
swiftc,
|
|
246
|
-
codesign,
|
|
247
|
-
swiftSource,
|
|
248
|
-
infoPlist,
|
|
249
|
-
actions,
|
|
250
|
-
quiet: opts.quiet === true
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
catch (err) {
|
|
254
|
-
return await blockedResult(err?.blocker || 'swift_compile_failed', err?.message || String(err));
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
else if (!stampMatches) {
|
|
258
|
-
actions.push('kept existing signed menu bar binary');
|
|
259
|
-
}
|
|
260
|
-
if (!stampMatches || previousStamp?.launch_agent_sha256 !== stamp.launch_agent_sha256 || !(await exists(paths.launch_agent_path))) {
|
|
261
|
-
await writeTextAtomic(paths.launch_agent_path, launchAgent);
|
|
262
|
-
actions.push(`wrote ${paths.launch_agent_path}`);
|
|
263
|
-
}
|
|
264
|
-
await writeJsonAtomic(paths.build_stamp_path, stamp);
|
|
265
|
-
actions.push(`wrote ${paths.build_stamp_path}`);
|
|
266
|
-
const launchWanted = opts.launch !== false && env.SKS_SKIP_SKS_MENUBAR_LAUNCH !== '1';
|
|
267
|
-
const launchAllowedForHome = path.resolve(paths.home) === realUserHome();
|
|
268
|
-
const installUnderTempDir = isMenuBarInstallPathUnderTempDir(paths.executable_path, env);
|
|
269
|
-
if (launchWanted && !launchAllowedForHome)
|
|
270
|
-
warnings.push('launch_skipped_non_user_home');
|
|
271
|
-
if (launchWanted && installUnderTempDir)
|
|
272
|
-
warnings.push('launch_skipped_temp_install');
|
|
273
|
-
const launchRequested = launchWanted && launchAllowedForHome && !installUnderTempDir;
|
|
274
|
-
let runningBeforeLaunch = false;
|
|
275
|
-
if (launchRequested)
|
|
276
|
-
runningBeforeLaunch = await isMenuBarProcessRunning(paths.executable_path);
|
|
277
|
-
if (launchRequested && stampMatches && runningBeforeLaunch)
|
|
278
|
-
actions.push('launch_skipped_menubar_up_to_date_and_running');
|
|
279
|
-
if (launchRequested && !stampMatches) {
|
|
280
|
-
const preferredPosition = await seedMenuBarPreferredPosition(env);
|
|
281
|
-
if (preferredPosition.ok)
|
|
282
|
-
actions.push('seeded SKS menu bar preferred position');
|
|
283
|
-
else
|
|
284
|
-
warnings.push(preferredPosition.warning);
|
|
285
|
-
}
|
|
286
|
-
const launch = launchRequested && launchctl && !(stampMatches && runningBeforeLaunch)
|
|
287
|
-
? await launchWithLaunchctl({ launchctl, open, paths, skipIfRunning: stampMatches, quiet: opts.quiet === true })
|
|
288
|
-
: {
|
|
289
|
-
requested: launchRequested && !(stampMatches && runningBeforeLaunch),
|
|
290
|
-
method: 'skipped',
|
|
291
|
-
ok: !launchRequested || (stampMatches && runningBeforeLaunch),
|
|
292
|
-
error: launchRequested && !launchctl ? 'launchctl_missing' : null
|
|
293
|
-
};
|
|
294
|
-
if (launchRequested && !launchctl)
|
|
295
|
-
warnings.push('launchctl_missing');
|
|
296
|
-
if (launch.method === 'open-fallback')
|
|
297
|
-
warnings.push('launchctl_bootstrap_failed_open_fallback_used');
|
|
298
|
-
const ok = launch.ok === true;
|
|
299
|
-
const result = {
|
|
300
|
-
schema: 'sks.codex-app-sks-menubar.v1',
|
|
301
|
-
ok,
|
|
302
|
-
apply,
|
|
303
|
-
status: ok
|
|
304
|
-
? launch.requested === false || launch.method === 'skipped'
|
|
305
|
-
? 'installed_launch_skipped'
|
|
306
|
-
: launch.method === 'open-fallback'
|
|
307
|
-
? 'installed_open_fallback'
|
|
308
|
-
: 'installed'
|
|
309
|
-
: 'blocked',
|
|
310
|
-
platform: process.platform,
|
|
311
|
-
app_path: paths.app_path,
|
|
312
|
-
executable_path: paths.executable_path,
|
|
313
|
-
launch_agent_path: paths.launch_agent_path,
|
|
314
|
-
action_script_path: paths.action_script_path,
|
|
315
|
-
build_stamp_path: paths.build_stamp_path,
|
|
316
|
-
config_path: paths.config_path,
|
|
317
|
-
report_path: paths.report_path,
|
|
318
|
-
codex_bundle_id: codexBundleId,
|
|
319
|
-
menu_items: MENU_ITEMS,
|
|
320
|
-
actions,
|
|
321
|
-
launch,
|
|
322
|
-
target_check: target,
|
|
323
|
-
build_stamp: stamp,
|
|
324
|
-
tcc_automation_status: 'unknown',
|
|
325
|
-
secret_env_cleanup: secretEnvCleanup,
|
|
326
|
-
next_actions: nextActions,
|
|
327
|
-
blockers: ok ? [] : [launch.error || 'sks_menubar_launch_failed'],
|
|
328
|
-
warnings
|
|
329
|
-
};
|
|
330
|
-
await writeReport(paths.report_path, result);
|
|
331
|
-
return result;
|
|
332
|
-
async function blockedResult(reason, detail) {
|
|
333
|
-
const result = {
|
|
334
|
-
schema: 'sks.codex-app-sks-menubar.v1',
|
|
335
|
-
ok: false,
|
|
336
|
-
apply,
|
|
337
|
-
status: 'blocked',
|
|
338
|
-
platform: process.platform,
|
|
339
|
-
app_path: paths.app_path,
|
|
340
|
-
executable_path: paths.executable_path,
|
|
341
|
-
launch_agent_path: paths.launch_agent_path,
|
|
342
|
-
action_script_path: paths.action_script_path,
|
|
343
|
-
build_stamp_path: paths.build_stamp_path,
|
|
344
|
-
config_path: paths.config_path,
|
|
345
|
-
report_path: paths.report_path,
|
|
346
|
-
codex_bundle_id: typeof codexBundleId === 'string' ? codexBundleId : null,
|
|
347
|
-
menu_items: MENU_ITEMS,
|
|
348
|
-
actions,
|
|
349
|
-
launch: { requested: false, method: 'none', ok: false, error: detail || reason },
|
|
350
|
-
target_check: lastTargetCheck,
|
|
351
|
-
build_stamp: null,
|
|
352
|
-
tcc_automation_status: 'unknown',
|
|
353
|
-
secret_env_cleanup: secretEnvCleanup,
|
|
354
|
-
next_actions: reason === 'xcode_clt_missing'
|
|
355
|
-
? ['Run: xcode-select --install', ...defaultNextActions()]
|
|
356
|
-
: defaultNextActions(),
|
|
357
|
-
blockers: [reason],
|
|
358
|
-
warnings: detail ? [...warnings, detail] : warnings
|
|
359
|
-
};
|
|
360
|
-
await writeReport(paths.report_path, result);
|
|
361
|
-
return result;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
export async function cleanupMacLaunchSecretEnvironment(opts = {}) {
|
|
365
|
-
if (process.platform !== 'darwin' && !opts.force) {
|
|
366
|
-
return { ok: true, status: 'not_macos', variables: SECRET_LAUNCH_ENV_KEYS, cleaned: [], failed: [], next_actions: [] };
|
|
367
|
-
}
|
|
368
|
-
const env = opts.env || process.env;
|
|
369
|
-
const launchctl = env.SKS_MENUBAR_LAUNCHCTL || await which('launchctl').catch(() => null) || await fallbackTool('/bin/launchctl');
|
|
370
|
-
if (!launchctl) {
|
|
371
|
-
return {
|
|
372
|
-
ok: false,
|
|
373
|
-
status: 'launchctl_missing',
|
|
374
|
-
variables: SECRET_LAUNCH_ENV_KEYS,
|
|
375
|
-
cleaned: [],
|
|
376
|
-
failed: SECRET_LAUNCH_ENV_KEYS.map((key) => ({ key, error: 'launchctl_missing' })),
|
|
377
|
-
next_actions: ['Run: launchctl unsetenv CODEX_LB_API_KEY', 'Run: launchctl unsetenv OPENROUTER_API_KEY']
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
const cleaned = [];
|
|
381
|
-
const failed = [];
|
|
382
|
-
for (const key of SECRET_LAUNCH_ENV_KEYS) {
|
|
383
|
-
const result = await runProcess(launchctl, ['unsetenv', key], { timeoutMs: 3_000, maxOutputBytes: 8 * 1024 })
|
|
384
|
-
.catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
385
|
-
if (result.code === 0)
|
|
386
|
-
cleaned.push(key);
|
|
387
|
-
else
|
|
388
|
-
failed.push({ key, error: String(result.stderr || result.stdout || 'launchctl unsetenv failed').trim() });
|
|
389
|
-
}
|
|
390
|
-
return {
|
|
391
|
-
ok: failed.length === 0,
|
|
392
|
-
status: failed.length === 0 ? 'cleaned' : cleaned.length ? 'partial' : 'partial',
|
|
393
|
-
variables: SECRET_LAUNCH_ENV_KEYS,
|
|
394
|
-
cleaned,
|
|
395
|
-
failed,
|
|
396
|
-
next_actions: ['Rotate CODEX_LB_API_KEY and OPENROUTER_API_KEY if they were previously exposed in launchd.']
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
async function writeDefaultMenuBarConfig(configPath, codexBundleId) {
|
|
400
|
-
const previous = await readMenuBarConfig(configPath);
|
|
401
|
-
const config = {
|
|
402
|
-
schema: 'sks.sks-menubar-config.v1',
|
|
403
|
-
codex_bundle_id: codexBundleId || previous.codex_bundle_id,
|
|
404
|
-
quit_with_codex: previous.quit_with_codex === true
|
|
405
|
-
};
|
|
406
|
-
await writeJsonAtomic(configPath, config);
|
|
407
|
-
return config;
|
|
408
|
-
}
|
|
409
|
-
async function readMenuBarConfig(configPath) {
|
|
410
|
-
const config = await readJson(configPath, null);
|
|
411
|
-
return {
|
|
412
|
-
schema: 'sks.sks-menubar-config.v1',
|
|
413
|
-
codex_bundle_id: typeof config?.codex_bundle_id === 'string' && config.codex_bundle_id.trim()
|
|
414
|
-
? config.codex_bundle_id.trim()
|
|
415
|
-
: null,
|
|
416
|
-
quit_with_codex: config?.quit_with_codex === true
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
async function resolveCodexBundleId(input) {
|
|
420
|
-
if (process.platform !== 'darwin')
|
|
421
|
-
return null;
|
|
422
|
-
const appPath = await findCodexApp({ home: input.home, env: input.env }).catch(() => null);
|
|
423
|
-
if (!appPath) {
|
|
424
|
-
input.warnings.push('codex_app_not_found_for_bundle_sync');
|
|
425
|
-
return null;
|
|
426
|
-
}
|
|
427
|
-
const mdls = input.env.SKS_MENUBAR_MDLS || await which('mdls').catch(() => null) || await fallbackTool('/usr/bin/mdls');
|
|
428
|
-
if (mdls) {
|
|
429
|
-
const result = await runProcess(mdls, ['-name', 'kMDItemCFBundleIdentifier', '-raw', appPath], {
|
|
430
|
-
timeoutMs: 3_000,
|
|
431
|
-
maxOutputBytes: 8 * 1024
|
|
432
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
433
|
-
const value = String(result.stdout || '').trim();
|
|
434
|
-
if (result.code === 0 && value && value !== '(null)' && value !== 'null')
|
|
435
|
-
return value;
|
|
436
|
-
}
|
|
437
|
-
const defaults = input.env.SKS_MENUBAR_DEFAULTS || await which('defaults').catch(() => null) || await fallbackTool('/usr/bin/defaults');
|
|
438
|
-
if (defaults) {
|
|
439
|
-
const result = await runProcess(defaults, ['read', path.join(appPath, 'Contents', 'Info'), 'CFBundleIdentifier'], {
|
|
440
|
-
timeoutMs: 3_000,
|
|
441
|
-
maxOutputBytes: 8 * 1024
|
|
442
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
443
|
-
const value = String(result.stdout || '').trim();
|
|
444
|
-
if (result.code === 0 && value)
|
|
445
|
-
return value;
|
|
446
|
-
}
|
|
447
|
-
return null;
|
|
448
|
-
}
|
|
449
|
-
export async function smokeSksMenuBarAction(actionScriptPath) {
|
|
450
|
-
if (!(await exists(actionScriptPath)))
|
|
451
|
-
return { ok: false, code: null, output: null, versionDetected: false, detectedVersion: null, executable: false };
|
|
452
|
-
// The Swift app runs the script directly (which requires the executable bit), so the smoke
|
|
453
|
-
// check must invoke it the same way. Running it via `/bin/zsh <script>` — as this check used
|
|
454
|
-
// to — succeeds even when +x is missing, which let doctor/status report a healthy action
|
|
455
|
-
// target while the menu bar itself was showing "action script broken".
|
|
456
|
-
const executable = await fs.access(actionScriptPath, fs.constants.X_OK).then(() => true).catch(() => false);
|
|
457
|
-
if (!executable) {
|
|
458
|
-
return {
|
|
459
|
-
ok: false,
|
|
460
|
-
code: null,
|
|
461
|
-
output: 'action script is not executable (missing +x); the menu bar app cannot run it',
|
|
462
|
-
versionDetected: false,
|
|
463
|
-
detectedVersion: null,
|
|
464
|
-
executable: false
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
const result = await runProcess(actionScriptPath, ['version'], {
|
|
468
|
-
timeoutMs: 5_000,
|
|
469
|
-
maxOutputBytes: 16 * 1024
|
|
470
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
471
|
-
const output = String(`${result.stdout || ''}\n${result.stderr || ''}`).trim();
|
|
472
|
-
const detectedVersion = output.match(/\b(?:sks|sneakoscope)?\s*v?(\d+\.\d+\.\d+)\b/i)?.[1] || null;
|
|
473
|
-
const versionDetected = Boolean(detectedVersion);
|
|
474
|
-
return {
|
|
475
|
-
ok: result.code === 0 && versionDetected,
|
|
476
|
-
code: result.code,
|
|
477
|
-
output: output ? output.slice(0, 700) : null,
|
|
478
|
-
versionDetected,
|
|
479
|
-
detectedVersion,
|
|
480
|
-
executable: true
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
async function isCodexAppRunningByBundleId(bundleId, env = process.env) {
|
|
484
|
-
if (process.platform !== 'darwin' || !bundleId)
|
|
485
|
-
return false;
|
|
486
|
-
const osascript = env.SKS_MENUBAR_OSASCRIPT || await which('osascript').catch(() => null) || await fallbackTool('/usr/bin/osascript');
|
|
487
|
-
if (!osascript)
|
|
488
|
-
return false;
|
|
489
|
-
const result = await runProcess(osascript, ['-e', `application id "${bundleId.replace(/"/g, '\\"')}" is running`], {
|
|
490
|
-
timeoutMs: 2_000,
|
|
491
|
-
maxOutputBytes: 8 * 1024
|
|
492
|
-
}).catch(() => ({ code: 1, stdout: '', stderr: '' }));
|
|
493
|
-
return result.code === 0 && String(result.stdout || '').trim().toLowerCase() === 'true';
|
|
494
|
-
}
|
|
495
|
-
export async function inspectSksMenuBarStatus(opts = {}) {
|
|
496
|
-
const paths = sksMenuBarPaths(opts.home || opts.env?.HOME, opts.root);
|
|
497
|
-
const installed = await exists(paths.executable_path);
|
|
498
|
-
const running = installed ? await isMenuBarProcessRunning(paths.executable_path) : false;
|
|
499
|
-
const actionText = await readText(paths.action_script_path, '');
|
|
500
|
-
const nodeBin = shellAssignment(actionText, 'NODE_BIN');
|
|
501
|
-
const sksEntry = shellAssignment(actionText, 'SKS_ENTRY');
|
|
502
|
-
const nodeExists = nodeBin ? await isExecutable(nodeBin) : false;
|
|
503
|
-
const sksEntryExists = sksEntry ? await exists(sksEntry) : false;
|
|
504
|
-
const actionSmoke = await smokeSksMenuBarAction(paths.action_script_path);
|
|
505
|
-
const config = await readMenuBarConfig(paths.config_path);
|
|
506
|
-
const codexRunning = config.codex_bundle_id ? await isCodexAppRunningByBundleId(config.codex_bundle_id, opts.env) : null;
|
|
507
|
-
const codexSync = {
|
|
508
|
-
ok: Boolean(config.codex_bundle_id),
|
|
509
|
-
bundle_id: config.codex_bundle_id,
|
|
510
|
-
codex_running: codexRunning,
|
|
511
|
-
icon_visible_expected: config.codex_bundle_id ? codexRunning === true : true,
|
|
512
|
-
warning: config.codex_bundle_id ? null : 'codex_sync_disabled'
|
|
513
|
-
};
|
|
514
|
-
const buildStamp = await readJson(paths.build_stamp_path, null);
|
|
515
|
-
const actionIntegrity = evaluateActionScriptIntegrity(actionText, buildStamp);
|
|
516
|
-
const expectedActionVersion = buildStamp?.package_version || PACKAGE_VERSION;
|
|
517
|
-
const actionVersionMatchesExpected = actionSmoke.detectedVersion === expectedActionVersion
|
|
518
|
-
&& actionSmoke.detectedVersion === PACKAGE_VERSION;
|
|
519
|
-
const launchd = await inspectLaunchdService(opts.env);
|
|
520
|
-
const signature = await inspectSignature(paths.app_path, opts.env);
|
|
521
|
-
const blockers = [];
|
|
522
|
-
const warnings = [];
|
|
523
|
-
if (!installed)
|
|
524
|
-
blockers.push('menubar_app_missing');
|
|
525
|
-
if (installed && launchd.checked && !launchd.ok)
|
|
526
|
-
blockers.push('launchd_not_running');
|
|
527
|
-
if (installed && !actionSmoke.executable)
|
|
528
|
-
blockers.push('action_script_not_executable');
|
|
529
|
-
if (installed && !actionSmoke.ok)
|
|
530
|
-
blockers.push('action_script_smoke_failed');
|
|
531
|
-
if (installed && actionSmoke.ok && !actionVersionMatchesExpected)
|
|
532
|
-
blockers.push('action_target_version_mismatch');
|
|
533
|
-
if (installed && !buildStamp)
|
|
534
|
-
blockers.push('build_stamp_missing');
|
|
535
|
-
if (installed && buildStamp && !actionIntegrity.script_hash_matches_stamp)
|
|
536
|
-
blockers.push('action_script_hash_mismatch');
|
|
537
|
-
if (installed && signature.checked && !signature.ok)
|
|
538
|
-
warnings.push('codesign_identifier_unexpected');
|
|
539
|
-
if (!codexSync.ok)
|
|
540
|
-
warnings.push('codex_sync_disabled');
|
|
541
|
-
if (buildStamp?.package_version && buildStamp.package_version !== PACKAGE_VERSION)
|
|
542
|
-
warnings.push('build_stamp_package_version_mismatch');
|
|
543
|
-
return {
|
|
544
|
-
schema: 'sks.menubar-status.v1',
|
|
545
|
-
ok: blockers.length === 0,
|
|
546
|
-
platform: process.platform,
|
|
547
|
-
installed,
|
|
548
|
-
running,
|
|
549
|
-
paths,
|
|
550
|
-
launchd,
|
|
551
|
-
action_target: {
|
|
552
|
-
node_bin: nodeBin,
|
|
553
|
-
node_exists: nodeExists,
|
|
554
|
-
sks_entry: sksEntry,
|
|
555
|
-
sks_entry_exists: sksEntryExists,
|
|
556
|
-
smoke_code: actionSmoke.code,
|
|
557
|
-
smoke_output: actionSmoke.output,
|
|
558
|
-
version_detected: actionSmoke.versionDetected,
|
|
559
|
-
detected_version: actionSmoke.detectedVersion,
|
|
560
|
-
expected_version: expectedActionVersion,
|
|
561
|
-
version_matches_expected: actionVersionMatchesExpected,
|
|
562
|
-
...actionIntegrity,
|
|
563
|
-
executable: actionSmoke.executable,
|
|
564
|
-
ok: actionSmoke.ok && actionVersionMatchesExpected && actionIntegrity.script_hash_matches_stamp
|
|
565
|
-
},
|
|
566
|
-
codex_sync: codexSync,
|
|
567
|
-
build_stamp: buildStamp,
|
|
568
|
-
package_version: PACKAGE_VERSION,
|
|
569
|
-
signature,
|
|
570
|
-
blockers,
|
|
571
|
-
warnings,
|
|
572
|
-
next_actions: blockers.length || warnings.length ? defaultNextActions() : ['sks menubar status --json']
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
export function evaluateActionScriptIntegrity(actionText, buildStamp) {
|
|
576
|
-
const scriptSha256 = actionText ? sha256(actionText) : null;
|
|
577
|
-
const expectedScriptSha256 = buildStamp?.action_script_sha256 || null;
|
|
578
|
-
return {
|
|
579
|
-
script_sha256: scriptSha256,
|
|
580
|
-
expected_script_sha256: expectedScriptSha256,
|
|
581
|
-
script_hash_matches_stamp: Boolean(scriptSha256 && expectedScriptSha256 && scriptSha256 === expectedScriptSha256)
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
export async function restartSksMenuBar(opts = {}) {
|
|
585
|
-
const env = opts.env || process.env;
|
|
586
|
-
const paths = sksMenuBarPaths(opts.home || env.HOME, opts.root);
|
|
587
|
-
if (process.platform !== 'darwin')
|
|
588
|
-
return { schema: 'sks.menubar-restart.v1', ok: true, platform: process.platform, skipped: true, reason: 'not_macos' };
|
|
589
|
-
const launchctl = env.SKS_MENUBAR_LAUNCHCTL || await which('launchctl').catch(() => null) || await fallbackTool('/bin/launchctl');
|
|
590
|
-
if (!launchctl)
|
|
591
|
-
return { schema: 'sks.menubar-restart.v1', ok: false, platform: process.platform, paths, blockers: ['launchctl_missing'] };
|
|
592
|
-
const service = launchServiceName();
|
|
593
|
-
const result = await runProcess(launchctl, ['kickstart', '-k', service], {
|
|
594
|
-
timeoutMs: 3_000,
|
|
595
|
-
maxOutputBytes: 16 * 1024,
|
|
596
|
-
stdoutFile: path.join(paths.install_dir, 'launchctl.out.log'),
|
|
597
|
-
stderrFile: path.join(paths.install_dir, 'launchctl.err.log')
|
|
598
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
599
|
-
return {
|
|
600
|
-
schema: 'sks.menubar-restart.v1',
|
|
601
|
-
ok: result.code === 0,
|
|
602
|
-
platform: process.platform,
|
|
603
|
-
service,
|
|
604
|
-
paths,
|
|
605
|
-
code: result.code,
|
|
606
|
-
error: result.code === 0 ? null : String(result.stderr || result.stdout || '').trim()
|
|
607
|
-
};
|
|
608
|
-
}
|
|
609
|
-
export async function uninstallSksMenuBar(opts = {}) {
|
|
610
|
-
const env = opts.env || process.env;
|
|
611
|
-
const paths = sksMenuBarPaths(opts.home || env.HOME, opts.root);
|
|
612
|
-
const actions = [];
|
|
613
|
-
const warnings = [];
|
|
614
|
-
const blockers = [];
|
|
615
|
-
if (process.platform !== 'darwin') {
|
|
616
|
-
return { schema: 'sks.menubar-uninstall.v1', ok: true, platform: process.platform, paths, actions: [], warnings: ['not_macos'], blockers: [] };
|
|
617
|
-
}
|
|
618
|
-
const launchctl = env.SKS_MENUBAR_LAUNCHCTL || await which('launchctl').catch(() => null) || await fallbackTool('/bin/launchctl');
|
|
619
|
-
if (launchctl) {
|
|
620
|
-
const service = launchServiceName();
|
|
621
|
-
await runProcess(launchctl, ['bootout', service], { timeoutMs: 3_000, maxOutputBytes: 8 * 1024 }).catch(() => undefined);
|
|
622
|
-
await runProcess(launchctl, ['bootout', launchDomain(), paths.launch_agent_path], { timeoutMs: 3_000, maxOutputBytes: 8 * 1024 }).catch(() => undefined);
|
|
623
|
-
actions.push(`bootout ${LABEL}`);
|
|
624
|
-
}
|
|
625
|
-
else {
|
|
626
|
-
warnings.push('launchctl_missing');
|
|
627
|
-
}
|
|
628
|
-
await terminateExistingMenuBarProcess(paths.executable_path);
|
|
629
|
-
await fs.rm(paths.launch_agent_path, { force: true }).catch((err) => blockers.push(`remove_launch_agent_failed:${err?.message || err}`));
|
|
630
|
-
await fs.rm(paths.install_dir, { recursive: true, force: true }).catch((err) => blockers.push(`remove_install_dir_failed:${err?.message || err}`));
|
|
631
|
-
actions.push(`removed ${paths.launch_agent_path}`);
|
|
632
|
-
actions.push(`removed ${paths.install_dir}`);
|
|
633
|
-
const defaults = env.SKS_MENUBAR_DEFAULTS || await which('defaults').catch(() => null) || await fallbackTool('/usr/bin/defaults');
|
|
634
|
-
if (defaults) {
|
|
635
|
-
for (const key of [
|
|
636
|
-
`NSStatusItem Preferred Position ${LABEL}`,
|
|
637
|
-
`NSStatusItem Visible ${LABEL}`,
|
|
638
|
-
`NSStatusItem VisibleCC ${LABEL}`
|
|
639
|
-
]) {
|
|
640
|
-
await runProcess(defaults, ['delete', CONTROL_CENTER_DOMAIN, key], { timeoutMs: 3_000, maxOutputBytes: 8 * 1024 }).catch(() => undefined);
|
|
641
|
-
}
|
|
642
|
-
actions.push('removed Control Center status item defaults');
|
|
643
|
-
}
|
|
644
|
-
else {
|
|
645
|
-
warnings.push('defaults_missing');
|
|
646
|
-
}
|
|
647
|
-
return { schema: 'sks.menubar-uninstall.v1', ok: blockers.length === 0, platform: process.platform, paths, actions, warnings, blockers };
|
|
648
|
-
}
|
|
649
|
-
async function fallbackTool(candidate) {
|
|
650
|
-
return await exists(candidate).then((ok) => ok ? candidate : null).catch(() => null);
|
|
651
|
-
}
|
|
652
|
-
async function seedMenuBarPreferredPosition(env) {
|
|
653
|
-
const defaults = env.SKS_MENUBAR_DEFAULTS || await which('defaults').catch(() => null) || await fallbackTool('/usr/bin/defaults');
|
|
654
|
-
if (!defaults)
|
|
655
|
-
return { ok: false, warning: 'defaults_missing_for_menubar_position_seed' };
|
|
656
|
-
const writes = [
|
|
657
|
-
['write', CONTROL_CENTER_DOMAIN, `NSStatusItem Preferred Position ${LABEL}`, '-int', String(CONTROL_CENTER_PREFERRED_POSITION)],
|
|
658
|
-
['write', CONTROL_CENTER_DOMAIN, `NSStatusItem Visible ${LABEL}`, '-bool', 'true'],
|
|
659
|
-
['write', CONTROL_CENTER_DOMAIN, `NSStatusItem VisibleCC ${LABEL}`, '-bool', 'true']
|
|
660
|
-
];
|
|
661
|
-
for (const args of writes) {
|
|
662
|
-
const result = await runProcess(defaults, args, {
|
|
663
|
-
timeoutMs: 10_000,
|
|
664
|
-
maxOutputBytes: 16 * 1024
|
|
665
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
666
|
-
if (result.code !== 0)
|
|
667
|
-
return { ok: false, warning: 'menubar_position_seed_failed' };
|
|
668
|
-
}
|
|
669
|
-
return { ok: true };
|
|
670
|
-
}
|
|
671
|
-
/**
|
|
672
|
-
* Refuse to auto-launch a menu bar app whose executable lives under a temp dir.
|
|
673
|
-
* Release gates run in hermetic envs rooted at os.tmpdir()/SKS_TMP_DIR; without
|
|
674
|
-
* this guard a gate could spawn a real GUI status item that leaks into the
|
|
675
|
-
* user's live menu bar. This is defense-in-depth behind SKS_SKIP_SKS_MENUBAR_LAUNCH
|
|
676
|
-
* and the home check.
|
|
677
|
-
*/
|
|
678
|
-
export function isMenuBarInstallPathUnderTempDir(target, env = process.env) {
|
|
679
|
-
const resolved = path.resolve(target);
|
|
680
|
-
const roots = new Set();
|
|
681
|
-
const addRoot = (value) => {
|
|
682
|
-
if (!value)
|
|
683
|
-
return;
|
|
684
|
-
const abs = path.resolve(value);
|
|
685
|
-
roots.add(abs);
|
|
686
|
-
if (abs.startsWith('/var/'))
|
|
687
|
-
roots.add(path.resolve('/private', abs.slice(1)));
|
|
688
|
-
else if (abs.startsWith('/private/var/'))
|
|
689
|
-
roots.add(abs.replace('/private', ''));
|
|
690
|
-
};
|
|
691
|
-
addRoot(os.tmpdir());
|
|
692
|
-
addRoot(env.TMPDIR);
|
|
693
|
-
addRoot(env.SKS_TMP_DIR);
|
|
694
|
-
for (const root of roots) {
|
|
695
|
-
if (resolved === root)
|
|
696
|
-
return true;
|
|
697
|
-
const prefix = root.endsWith(path.sep) ? root : root + path.sep;
|
|
698
|
-
if (resolved.startsWith(prefix))
|
|
699
|
-
return true;
|
|
700
|
-
}
|
|
701
|
-
return false;
|
|
702
|
-
}
|
|
703
|
-
function realUserHome() {
|
|
704
|
-
try {
|
|
705
|
-
const userHome = os.userInfo().homedir;
|
|
706
|
-
if (userHome)
|
|
707
|
-
return path.resolve(userHome);
|
|
708
|
-
}
|
|
709
|
-
catch {
|
|
710
|
-
// Fall back below for platforms where userInfo is unavailable.
|
|
711
|
-
}
|
|
712
|
-
return path.resolve(os.homedir());
|
|
713
|
-
}
|
|
714
|
-
function packagedSksEntry() {
|
|
715
|
-
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
716
|
-
return path.resolve(here, '..', '..', 'bin', 'sks.js');
|
|
717
|
-
}
|
|
718
|
-
async function resolveSksEntryForInstall(input) {
|
|
719
|
-
const packaged = packagedSksEntry();
|
|
720
|
-
let resolved = input.explicit ? path.resolve(input.explicit) : packaged;
|
|
721
|
-
let existsResolved = await exists(resolved);
|
|
722
|
-
let projectLocal = isSubpath(resolved, input.root);
|
|
723
|
-
if (projectLocal) {
|
|
724
|
-
input.warnings.push('sks_entry_project_local');
|
|
725
|
-
}
|
|
726
|
-
if (!existsResolved && await exists(input.actionScriptPath))
|
|
727
|
-
input.warnings.push('sks_entry_unresolved_stale_action_script_not_reused');
|
|
728
|
-
return {
|
|
729
|
-
requested: input.explicit ? path.resolve(input.explicit) : null,
|
|
730
|
-
resolved: existsResolved ? resolved : null,
|
|
731
|
-
packaged,
|
|
732
|
-
exists: existsResolved,
|
|
733
|
-
project_local: projectLocal,
|
|
734
|
-
used_previous_script: false
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
export function actionScriptSource(input) {
|
|
738
|
-
return `#!/bin/zsh
|
|
739
|
-
set -e
|
|
740
|
-
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
|
|
741
|
-
# launchd starts this app with cwd=/. sks treats an unmarked cwd as the project
|
|
742
|
-
# root fallback, and / is neither writable nor a workspace, so give every
|
|
743
|
-
# menu-bar-spawned command a sane home-directory cwd instead.
|
|
744
|
-
cd "$HOME" 2>/dev/null || true
|
|
745
|
-
# Menu-bar actions operate on global state (~/.codex, keychain, launchd), never
|
|
746
|
-
# on a project, so the per-project update-migration gate must not fire here —
|
|
747
|
-
# it would otherwise treat $HOME as a project and run a migration doctor in it.
|
|
748
|
-
export SKS_UPDATE_MIGRATION_GATE_DISABLED=1
|
|
749
|
-
NODE_BIN=${shellQuote(input.nodeBin)}
|
|
750
|
-
SKS_ENTRY=${shellQuote(input.sksEntry)}
|
|
751
|
-
|
|
752
|
-
notify_sks_missing() {
|
|
753
|
-
/usr/bin/osascript -e 'display notification "sks CLI를 찾을 수 없습니다. sks doctor --fix 또는 npm install -g sneakoscope 실행 후 다시 시도하세요." with title "SKS Menu Bar"' >/dev/null 2>&1 || true
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
resolve_node_bin() {
|
|
757
|
-
if [ -x "$NODE_BIN" ]; then
|
|
758
|
-
printf '%s\\n' "$NODE_BIN"
|
|
759
|
-
return 0
|
|
760
|
-
fi
|
|
761
|
-
# launchd does not initialize NVM, and a login shell can resolve a different
|
|
762
|
-
# global Node before the menu owner's current NVM install. Prefer the
|
|
763
|
-
# HOME-scoped runtime; run_node_entry prepends its bin directory to PATH.
|
|
764
|
-
for cand in "$HOME"/.nvm/versions/node/*/bin/node(Nn[-1]); do
|
|
765
|
-
if [ -x "$cand" ]; then
|
|
766
|
-
printf '%s\\n' "$cand"
|
|
767
|
-
return 0
|
|
768
|
-
fi
|
|
769
|
-
done
|
|
770
|
-
local login_node
|
|
771
|
-
login_node="$(/bin/zsh -lc 'command -v node' 2>/dev/null | /usr/bin/head -n 1 || true)"
|
|
772
|
-
if [ -n "$login_node" ] && [ -x "$login_node" ]; then
|
|
773
|
-
printf '%s\\n' "$login_node"
|
|
774
|
-
return 0
|
|
775
|
-
fi
|
|
776
|
-
for cand in /opt/homebrew/bin/node /usr/local/bin/node /usr/bin/node; do
|
|
777
|
-
if [ -x "$cand" ]; then
|
|
778
|
-
printf '%s\\n' "$cand"
|
|
779
|
-
return 0
|
|
780
|
-
fi
|
|
781
|
-
done
|
|
782
|
-
return 1
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
run_node_entry() {
|
|
786
|
-
local entry="$1"
|
|
787
|
-
shift
|
|
788
|
-
if [ ! -f "$entry" ]; then
|
|
789
|
-
return 1
|
|
790
|
-
fi
|
|
791
|
-
local node_bin
|
|
792
|
-
node_bin="$(resolve_node_bin || true)"
|
|
793
|
-
if [ -z "$node_bin" ]; then
|
|
794
|
-
return 1
|
|
795
|
-
fi
|
|
796
|
-
local node_bin_dir
|
|
797
|
-
node_bin_dir="$(/usr/bin/dirname "$node_bin")"
|
|
798
|
-
if [ -d "$node_bin_dir" ]; then
|
|
799
|
-
export PATH="$node_bin_dir:$PATH"
|
|
800
|
-
fi
|
|
801
|
-
exec "$node_bin" "$entry" "$@"
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
# The installer pins the entry that produced this menu build. Prefer it over
|
|
805
|
-
# PATH/global copies so a newly updated 6.0.3 companion cannot execute stale
|
|
806
|
-
# 6.0.2 auth/restart logic. Fall back only when the pinned file or Node runtime
|
|
807
|
-
# is unavailable.
|
|
808
|
-
if [ -f "$SKS_ENTRY" ]; then
|
|
809
|
-
run_node_entry "$SKS_ENTRY" "$@" || true
|
|
810
|
-
fi
|
|
811
|
-
|
|
812
|
-
SKS_BIN="$(/bin/zsh -lc 'command -v sks' 2>/dev/null | /usr/bin/head -n 1 || true)"
|
|
813
|
-
if [ -n "$SKS_BIN" ] && [ -x "$SKS_BIN" ]; then
|
|
814
|
-
exec "$SKS_BIN" "$@"
|
|
815
|
-
fi
|
|
816
|
-
|
|
817
|
-
NPM_ROOT="$(/bin/zsh -lc 'npm root -g' 2>/dev/null | /usr/bin/head -n 1 || true)"
|
|
818
|
-
if [ -n "$NPM_ROOT" ]; then
|
|
819
|
-
run_node_entry "$NPM_ROOT/sneakoscope/dist/bin/sks.js" "$@" || true
|
|
820
|
-
fi
|
|
821
|
-
|
|
822
|
-
for entry in "$HOME"/.nvm/versions/node/*/lib/node_modules/sneakoscope/dist/bin/sks.js(Nn[-1]) /opt/homebrew/lib/node_modules/sneakoscope/dist/bin/sks.js /usr/local/lib/node_modules/sneakoscope/dist/bin/sks.js; do
|
|
823
|
-
if [ -f "$entry" ]; then
|
|
824
|
-
run_node_entry "$entry" "$@" || true
|
|
825
|
-
fi
|
|
826
|
-
done
|
|
827
|
-
notify_sks_missing
|
|
828
|
-
echo "SKS command not found. Run npm install -g sneakoscope or sks doctor --fix, then try again." >&2
|
|
829
|
-
exit 127
|
|
830
|
-
`;
|
|
831
|
-
}
|
|
832
|
-
export function swiftMenuSource(input) {
|
|
833
|
-
const codexLifecycleSource = input.codexBundleId ? `
|
|
834
|
-
func configureCodexLifecycleSync() {
|
|
835
|
-
setIconVisible(isCodexRunning())
|
|
836
|
-
let center = NSWorkspace.shared.notificationCenter
|
|
837
|
-
center.addObserver(self, selector: #selector(workspaceAppLaunched(_:)), name: NSWorkspace.didLaunchApplicationNotification, object: nil)
|
|
838
|
-
center.addObserver(self, selector: #selector(workspaceAppTerminated(_:)), name: NSWorkspace.didTerminateApplicationNotification, object: nil)
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
@objc func workspaceAppLaunched(_ notification: Notification) {
|
|
842
|
-
guard let app = notification.userInfo?[NSWorkspace.applicationUserInfoKey] as? NSRunningApplication else { return }
|
|
843
|
-
if app.bundleIdentifier == codexBundleId {
|
|
844
|
-
setIconVisible(true)
|
|
845
|
-
updateState()
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
@objc func workspaceAppTerminated(_ notification: Notification) {
|
|
850
|
-
guard let app = notification.userInfo?[NSWorkspace.applicationUserInfoKey] as? NSRunningApplication else { return }
|
|
851
|
-
if app.bundleIdentifier == codexBundleId {
|
|
852
|
-
if quitWithCodex {
|
|
853
|
-
NSApplication.shared.terminate(nil)
|
|
854
|
-
} else {
|
|
855
|
-
setIconVisible(false)
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
func setIconVisible(_ visible: Bool) {
|
|
861
|
-
statusItem.isVisible = visible
|
|
862
|
-
if visible {
|
|
863
|
-
reassertControlCenterVisibility()
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
func isCodexRunning() -> Bool {
|
|
868
|
-
guard let bundle = codexBundleId else { return true }
|
|
869
|
-
return NSWorkspace.shared.runningApplications.contains { $0.bundleIdentifier == bundle }
|
|
870
|
-
}
|
|
871
|
-
` : `
|
|
872
|
-
func configureCodexLifecycleSync() {
|
|
873
|
-
setIconVisible(true)
|
|
874
|
-
statusLineItem.title = "Codex app not detected — sync disabled"
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
func setIconVisible(_ visible: Bool) {
|
|
878
|
-
statusItem.isVisible = visible
|
|
879
|
-
if visible {
|
|
880
|
-
reassertControlCenterVisibility()
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
func isCodexRunning() -> Bool {
|
|
885
|
-
return true
|
|
886
|
-
}
|
|
887
|
-
`;
|
|
888
|
-
return `import Cocoa
|
|
889
|
-
import Foundation
|
|
890
|
-
|
|
891
|
-
let actionScript = ${swiftString(input.actionScriptPath)}
|
|
892
|
-
let buildStampPath = ${swiftString(input.buildStampPath)}
|
|
893
|
-
let menubarConfigPath = ${swiftString(input.configPath)}
|
|
894
|
-
let lastActionLogPath = ${swiftString(input.lastActionLogPath)}
|
|
895
|
-
let codexBundleId: String? = ${input.codexBundleId ? swiftString(input.codexBundleId) : 'nil'}
|
|
896
|
-
let packageVersion = ${swiftString(input.packageVersion)}
|
|
897
|
-
let menuBarLabel = ${swiftString(SKS_MENUBAR_LABEL)}
|
|
898
|
-
let controlCenterDomain = ${swiftString(CONTROL_CENTER_DOMAIN)}
|
|
899
|
-
|
|
900
|
-
/// macOS persists status-item visibility hints per-label in Control Center's
|
|
901
|
-
/// defaults domain (see installSksMenuBar's seedMenuBarPreferredPosition).
|
|
902
|
-
/// Toggling NSStatusItem.isVisible back to true inside a resident process is
|
|
903
|
-
/// not always sufficient to make Control Center re-render a previously
|
|
904
|
-
/// hidden item, so re-show must reassert the same Control Center defaults
|
|
905
|
-
/// the installer seeds, or the icon can stay invisible after a Codex
|
|
906
|
-
/// quit/relaunch cycle even though isVisible is technically true again.
|
|
907
|
-
func reassertControlCenterVisibility() {
|
|
908
|
-
let defaultsBin = "/usr/bin/defaults"
|
|
909
|
-
guard FileManager.default.isExecutableFile(atPath: defaultsBin) else { return }
|
|
910
|
-
let writes: [[String]] = [
|
|
911
|
-
["write", controlCenterDomain, "NSStatusItem Visible \\(menuBarLabel)", "-bool", "true"],
|
|
912
|
-
["write", controlCenterDomain, "NSStatusItem VisibleCC \\(menuBarLabel)", "-bool", "true"]
|
|
913
|
-
]
|
|
914
|
-
for args in writes {
|
|
915
|
-
let process = Process()
|
|
916
|
-
process.executableURL = URL(fileURLWithPath: defaultsBin)
|
|
917
|
-
process.arguments = args
|
|
918
|
-
process.standardOutput = FileHandle.nullDevice
|
|
919
|
-
process.standardError = FileHandle.nullDevice
|
|
920
|
-
try? process.run()
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
func clipped(_ value: String, limit: Int = 700) -> String {
|
|
925
|
-
return String(value.prefix(limit))
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
// sks commands report failures as JSON ({reason|status|error|blockers[]|guidance[]}
|
|
929
|
-
// as short snake_case codes), which read as opaque "error codes" if dumped raw into
|
|
930
|
-
// an alert. Extract the readable parts and translate known codes into plain English;
|
|
931
|
-
// unknown codes fall back to "snake_case -> Words" rather than staying cryptic, and
|
|
932
|
-
// genuinely non-JSON output (already plain text) passes through unchanged.
|
|
933
|
-
func humanizeSksFailure(_ text: String) -> String {
|
|
934
|
-
let trimmed = text.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
935
|
-
guard let data = trimmed.data(using: .utf8),
|
|
936
|
-
let obj = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] else {
|
|
937
|
-
return text
|
|
938
|
-
}
|
|
939
|
-
var lines: [String] = []
|
|
940
|
-
if let reason = obj["reason"] as? String {
|
|
941
|
-
lines.append(humanizeSksCode(reason))
|
|
942
|
-
} else if let status = obj["status"] as? String, !["ok", "pass", "verified", "verified_partial"].contains(status) {
|
|
943
|
-
lines.append(humanizeSksCode(status))
|
|
944
|
-
}
|
|
945
|
-
if let errorMessage = obj["error"] as? String, !errorMessage.isEmpty {
|
|
946
|
-
lines.append(errorMessage)
|
|
947
|
-
}
|
|
948
|
-
if let blockers = obj["blockers"] as? [String], !blockers.isEmpty {
|
|
949
|
-
lines.append(contentsOf: blockers.map { "- " + humanizeSksCode($0) })
|
|
950
|
-
}
|
|
951
|
-
if let guidance = obj["guidance"] as? [String], !guidance.isEmpty {
|
|
952
|
-
lines.append("")
|
|
953
|
-
lines.append(contentsOf: guidance)
|
|
954
|
-
}
|
|
955
|
-
return lines.isEmpty ? text : lines.joined(separator: "\\n")
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
func humanizeSksCode(_ code: String) -> String {
|
|
959
|
-
let known: [String: String] = [
|
|
960
|
-
"missing_host_or_base_url": "No domain or base URL was entered.",
|
|
961
|
-
"missing_api_key": "No API key was entered.",
|
|
962
|
-
"setup_needed": "codex-lb is not configured yet.",
|
|
963
|
-
"cancelled": "Setup was cancelled.",
|
|
964
|
-
"process_only_cancelled": "Setup was cancelled (process-only mode was not confirmed).",
|
|
965
|
-
"process_only_requires_yes": "This setup would only be kept for the current session — nothing durable was saved.",
|
|
966
|
-
"codex_mcp_config_read_failed": "Could not read ~/.codex/config.toml. Check its ownership and permissions; no MCP change was made.",
|
|
967
|
-
"codex_mcp_config_symlink_unsupported": "~/.codex/config.toml is a symbolic link. The MCP manager left it unchanged to avoid replacing the link.",
|
|
968
|
-
"codex_mcp_config_not_regular_file": "~/.codex/config.toml is not a regular file. The MCP manager left it unchanged.",
|
|
969
|
-
"codex_mcp_config_toml_parse_failed": "~/.codex/config.toml contains invalid TOML. Fix it before managing MCP servers.",
|
|
970
|
-
"codex_mcp_config_busy": "Another MCP configuration change is in progress. Try again shortly."
|
|
971
|
-
]
|
|
972
|
-
if let mapped = known[code] { return mapped }
|
|
973
|
-
let words = code.split(separator: "_").joined(separator: " ")
|
|
974
|
-
guard let first = words.first else { return code }
|
|
975
|
-
return String(first).uppercased() + words.dropFirst()
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
func showAlert(_ message: String, informative: String = "") {
|
|
979
|
-
DispatchQueue.main.async {
|
|
980
|
-
NSApp.activate(ignoringOtherApps: true)
|
|
981
|
-
let alert = NSAlert()
|
|
982
|
-
alert.messageText = message
|
|
983
|
-
alert.informativeText = clipped(informative)
|
|
984
|
-
alert.alertStyle = .warning
|
|
985
|
-
alert.runModal()
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
func promptText(title: String, message: String, placeholder: String = "", secure: Bool = false) -> String? {
|
|
990
|
-
NSApp.activate(ignoringOtherApps: true)
|
|
991
|
-
let alert = NSAlert()
|
|
992
|
-
alert.messageText = title
|
|
993
|
-
alert.informativeText = message
|
|
994
|
-
alert.addButton(withTitle: "OK")
|
|
995
|
-
alert.addButton(withTitle: "Cancel")
|
|
996
|
-
let field: NSTextField = secure ? NSSecureTextField(frame: NSRect(x: 0, y: 0, width: 320, height: 24)) : NSTextField(frame: NSRect(x: 0, y: 0, width: 320, height: 24))
|
|
997
|
-
field.placeholderString = placeholder
|
|
998
|
-
alert.accessoryView = field
|
|
999
|
-
let response = alert.runModal()
|
|
1000
|
-
if response != .alertFirstButtonReturn { return nil }
|
|
1001
|
-
let value = field.stringValue.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
1002
|
-
return value.isEmpty ? nil : value
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
func promptChoice(title: String, message: String, options: [String]) -> String? {
|
|
1006
|
-
NSApp.activate(ignoringOtherApps: true)
|
|
1007
|
-
let alert = NSAlert()
|
|
1008
|
-
alert.messageText = title
|
|
1009
|
-
alert.informativeText = message
|
|
1010
|
-
alert.addButton(withTitle: "OK")
|
|
1011
|
-
alert.addButton(withTitle: "Cancel")
|
|
1012
|
-
let popup = NSPopUpButton(frame: NSRect(x: 0, y: 0, width: 320, height: 26), pullsDown: false)
|
|
1013
|
-
popup.addItems(withTitles: options)
|
|
1014
|
-
alert.accessoryView = popup
|
|
1015
|
-
let response = alert.runModal()
|
|
1016
|
-
if response != .alertFirstButtonReturn { return nil }
|
|
1017
|
-
return popup.titleOfSelectedItem
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
func promptTextAllowEmpty(title: String, message: String, placeholder: String = "", secure: Bool = false) -> String? {
|
|
1021
|
-
NSApp.activate(ignoringOtherApps: true)
|
|
1022
|
-
let alert = NSAlert()
|
|
1023
|
-
alert.messageText = title
|
|
1024
|
-
alert.informativeText = message
|
|
1025
|
-
alert.addButton(withTitle: "OK")
|
|
1026
|
-
alert.addButton(withTitle: "Cancel")
|
|
1027
|
-
let field: NSTextField = secure ? NSSecureTextField(frame: NSRect(x: 0, y: 0, width: 360, height: 24)) : NSTextField(frame: NSRect(x: 0, y: 0, width: 360, height: 24))
|
|
1028
|
-
field.placeholderString = placeholder
|
|
1029
|
-
alert.accessoryView = field
|
|
1030
|
-
let response = alert.runModal()
|
|
1031
|
-
if response != .alertFirstButtonReturn { return nil }
|
|
1032
|
-
return field.stringValue.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
func promptMultiline(title: String, message: String, placeholder: String = "") -> String? {
|
|
1036
|
-
NSApp.activate(ignoringOtherApps: true)
|
|
1037
|
-
let alert = NSAlert()
|
|
1038
|
-
alert.messageText = title
|
|
1039
|
-
alert.informativeText = message
|
|
1040
|
-
alert.addButton(withTitle: "OK")
|
|
1041
|
-
alert.addButton(withTitle: "Cancel")
|
|
1042
|
-
let scroll = NSScrollView(frame: NSRect(x: 0, y: 0, width: 420, height: 120))
|
|
1043
|
-
scroll.hasVerticalScroller = true
|
|
1044
|
-
scroll.borderType = .bezelBorder
|
|
1045
|
-
let textView = NSTextView(frame: scroll.bounds)
|
|
1046
|
-
textView.isRichText = false
|
|
1047
|
-
textView.font = NSFont.monospacedSystemFont(ofSize: 12, weight: .regular)
|
|
1048
|
-
textView.string = ""
|
|
1049
|
-
textView.setAccessibilityLabel(title)
|
|
1050
|
-
textView.setAccessibilityHelp(placeholder)
|
|
1051
|
-
scroll.documentView = textView
|
|
1052
|
-
alert.accessoryView = scroll
|
|
1053
|
-
let response = alert.runModal()
|
|
1054
|
-
if response != .alertFirstButtonReturn { return nil }
|
|
1055
|
-
return textView.string.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
func confirmAction(title: String, message: String, destructive: Bool = false) -> Bool {
|
|
1059
|
-
NSApp.activate(ignoringOtherApps: true)
|
|
1060
|
-
let alert = NSAlert()
|
|
1061
|
-
alert.messageText = title
|
|
1062
|
-
alert.informativeText = message
|
|
1063
|
-
alert.alertStyle = destructive ? .warning : .informational
|
|
1064
|
-
alert.addButton(withTitle: destructive ? "Remove" : "OK")
|
|
1065
|
-
alert.addButton(withTitle: "Cancel")
|
|
1066
|
-
return alert.runModal() == .alertFirstButtonReturn
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
func parseJsonObject(_ text: String) -> [String: Any]? {
|
|
1070
|
-
guard let data = text.data(using: .utf8) else { return nil }
|
|
1071
|
-
return (try? JSONSerialization.jsonObject(with: data, options: [])) as? [String: Any]
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
func runProcess(_ executable: String, _ args: [String] = [], stdinText: String? = nil, completion: ((Int32, String) -> Void)? = nil) {
|
|
1075
|
-
let process = Process()
|
|
1076
|
-
let output = Pipe()
|
|
1077
|
-
process.executableURL = URL(fileURLWithPath: executable)
|
|
1078
|
-
process.arguments = args
|
|
1079
|
-
process.standardOutput = output
|
|
1080
|
-
process.standardError = output
|
|
1081
|
-
var inputPipe: Pipe?
|
|
1082
|
-
if stdinText != nil {
|
|
1083
|
-
let pipe = Pipe()
|
|
1084
|
-
process.standardInput = pipe
|
|
1085
|
-
inputPipe = pipe
|
|
1086
|
-
}
|
|
1087
|
-
do {
|
|
1088
|
-
try process.run()
|
|
1089
|
-
output.fileHandleForWriting.closeFile()
|
|
1090
|
-
DispatchQueue.global(qos: .utility).async {
|
|
1091
|
-
let data = output.fileHandleForReading.readDataToEndOfFile()
|
|
1092
|
-
process.waitUntilExit()
|
|
1093
|
-
let text = String(data: data, encoding: .utf8) ?? ""
|
|
1094
|
-
DispatchQueue.main.async {
|
|
1095
|
-
completion?(process.terminationStatus, text)
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
if let stdinText = stdinText, let inputPipe = inputPipe {
|
|
1099
|
-
inputPipe.fileHandleForWriting.write(Data(stdinText.utf8))
|
|
1100
|
-
inputPipe.fileHandleForWriting.closeFile()
|
|
1101
|
-
}
|
|
1102
|
-
} catch {
|
|
1103
|
-
completion?(-1, String(describing: error))
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
func showNotification(_ title: String, _ body: String) {
|
|
1108
|
-
// AppleScript string literals require double quotes and cannot contain raw
|
|
1109
|
-
// newlines, so inlining arbitrary command output into the script text throws
|
|
1110
|
-
// a -2741 syntax error. Keep the script a fixed literal and pass body/title
|
|
1111
|
-
// as osascript argv instead — no escaping, no syntax error, any text is safe.
|
|
1112
|
-
let script = "on run argv\\ndisplay notification (item 1 of argv) with title (item 2 of argv)\\nend run"
|
|
1113
|
-
runProcess("/usr/bin/osascript", ["-e", script, clipped(body), title]) { code, output in
|
|
1114
|
-
if code != 0 {
|
|
1115
|
-
showAlert(title, informative: output)
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
func redactSecrets(_ value: String, secrets: [String] = []) -> String {
|
|
1121
|
-
var text = value
|
|
1122
|
-
for secret in secrets where secret.count >= 4 {
|
|
1123
|
-
text = text.replacingOccurrences(of: secret, with: "[redacted]")
|
|
1124
|
-
}
|
|
1125
|
-
let patterns = [
|
|
1126
|
-
#"sk-proj-[A-Za-z0-9_-]{12,}"#,
|
|
1127
|
-
#"sk-or-v1-[A-Za-z0-9_-]{12,}"#,
|
|
1128
|
-
#"sk-or-[A-Za-z0-9_-]{12,}"#,
|
|
1129
|
-
#"sk-clb-[A-Za-z0-9_-]{8,}"#,
|
|
1130
|
-
#"sk-[A-Za-z0-9_-]{20,}"#,
|
|
1131
|
-
#"(?i)(api[_-]?key|secret|token)\\s*[:=]\\s*[^\\s"',}]+"#
|
|
1132
|
-
]
|
|
1133
|
-
for pattern in patterns {
|
|
1134
|
-
if let regex = try? NSRegularExpression(pattern: pattern) {
|
|
1135
|
-
let range = NSRange(text.startIndex..<text.endIndex, in: text)
|
|
1136
|
-
text = regex.stringByReplacingMatches(in: text, range: range, withTemplate: "[redacted]")
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
return text
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
func writeActionLog(_ text: String) {
|
|
1143
|
-
let url = URL(fileURLWithPath: lastActionLogPath)
|
|
1144
|
-
try? FileManager.default.createDirectory(at: url.deletingLastPathComponent(), withIntermediateDirectories: true)
|
|
1145
|
-
if !FileManager.default.fileExists(atPath: lastActionLogPath) {
|
|
1146
|
-
FileManager.default.createFile(atPath: lastActionLogPath, contents: Data(), attributes: [.posixPermissions: 0o600])
|
|
1147
|
-
}
|
|
1148
|
-
try? FileManager.default.setAttributes([.posixPermissions: 0o600], ofItemAtPath: lastActionLogPath)
|
|
1149
|
-
if let handle = try? FileHandle(forWritingTo: url) {
|
|
1150
|
-
try? handle.truncate(atOffset: 0)
|
|
1151
|
-
handle.write(Data(text.utf8))
|
|
1152
|
-
try? handle.close()
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
struct MenuState {
|
|
1157
|
-
let title: String
|
|
1158
|
-
let line: String
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
struct MenuBarConfig {
|
|
1162
|
-
let quitWithCodex: Bool
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
struct McpServerRow {
|
|
1166
|
-
let name: String
|
|
1167
|
-
let enabled: Bool
|
|
1168
|
-
let transport: String
|
|
1169
|
-
let summary: String
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
final class McpManagerController: NSObject, NSWindowDelegate, NSTableViewDataSource, NSTableViewDelegate {
|
|
1173
|
-
weak var owner: AppDelegate?
|
|
1174
|
-
var panel: NSPanel!
|
|
1175
|
-
var tableView: NSTableView!
|
|
1176
|
-
var statusLabel: NSTextField!
|
|
1177
|
-
var removeButton: NSButton!
|
|
1178
|
-
var toggleButton: NSButton!
|
|
1179
|
-
var refreshButton: NSButton!
|
|
1180
|
-
var addButton: NSButton!
|
|
1181
|
-
var rows: [McpServerRow] = []
|
|
1182
|
-
var working = false
|
|
1183
|
-
|
|
1184
|
-
init(owner: AppDelegate) {
|
|
1185
|
-
self.owner = owner
|
|
1186
|
-
super.init()
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
func show() {
|
|
1190
|
-
if panel == nil { buildPanel() }
|
|
1191
|
-
if panel.isVisible {
|
|
1192
|
-
panel.makeKeyAndOrderFront(nil)
|
|
1193
|
-
return
|
|
1194
|
-
}
|
|
1195
|
-
NSApp.activate(ignoringOtherApps: true)
|
|
1196
|
-
panel.center()
|
|
1197
|
-
panel.makeKeyAndOrderFront(nil)
|
|
1198
|
-
refresh()
|
|
1199
|
-
NSApp.runModal(for: panel)
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
func buildPanel() {
|
|
1203
|
-
panel = NSPanel(
|
|
1204
|
-
contentRect: NSRect(x: 0, y: 0, width: 760, height: 440),
|
|
1205
|
-
styleMask: [.titled, .closable, .resizable, .utilityWindow],
|
|
1206
|
-
backing: .buffered,
|
|
1207
|
-
defer: false
|
|
1208
|
-
)
|
|
1209
|
-
panel.title = "MCP Servers"
|
|
1210
|
-
panel.minSize = NSSize(width: 640, height: 360)
|
|
1211
|
-
panel.isFloatingPanel = true
|
|
1212
|
-
panel.delegate = self
|
|
1213
|
-
|
|
1214
|
-
let content = NSView(frame: panel.contentView?.bounds ?? .zero)
|
|
1215
|
-
panel.contentView = content
|
|
1216
|
-
|
|
1217
|
-
let heading = NSTextField(labelWithString: "Global Codex MCP servers")
|
|
1218
|
-
heading.font = NSFont.systemFont(ofSize: 15, weight: .semibold)
|
|
1219
|
-
heading.translatesAutoresizingMaskIntoConstraints = false
|
|
1220
|
-
|
|
1221
|
-
let scope = NSTextField(labelWithString: "Changes are written safely to ~/.codex/config.toml and apply to new Codex sessions.")
|
|
1222
|
-
scope.textColor = .secondaryLabelColor
|
|
1223
|
-
scope.font = NSFont.systemFont(ofSize: 11)
|
|
1224
|
-
scope.translatesAutoresizingMaskIntoConstraints = false
|
|
1225
|
-
|
|
1226
|
-
tableView = NSTableView()
|
|
1227
|
-
tableView.delegate = self
|
|
1228
|
-
tableView.dataSource = self
|
|
1229
|
-
tableView.usesAlternatingRowBackgroundColors = true
|
|
1230
|
-
tableView.allowsMultipleSelection = false
|
|
1231
|
-
tableView.rowSizeStyle = .medium
|
|
1232
|
-
tableView.setAccessibilityLabel("Configured MCP servers")
|
|
1233
|
-
let statusColumn = NSTableColumn(identifier: NSUserInterfaceItemIdentifier("status"))
|
|
1234
|
-
statusColumn.title = "State"
|
|
1235
|
-
statusColumn.width = 70
|
|
1236
|
-
statusColumn.minWidth = 64
|
|
1237
|
-
statusColumn.maxWidth = 88
|
|
1238
|
-
let nameColumn = NSTableColumn(identifier: NSUserInterfaceItemIdentifier("name"))
|
|
1239
|
-
nameColumn.title = "Name"
|
|
1240
|
-
nameColumn.width = 180
|
|
1241
|
-
nameColumn.minWidth = 120
|
|
1242
|
-
let transportColumn = NSTableColumn(identifier: NSUserInterfaceItemIdentifier("transport"))
|
|
1243
|
-
transportColumn.title = "Transport"
|
|
1244
|
-
transportColumn.width = 90
|
|
1245
|
-
transportColumn.minWidth = 80
|
|
1246
|
-
let detailColumn = NSTableColumn(identifier: NSUserInterfaceItemIdentifier("summary"))
|
|
1247
|
-
detailColumn.title = "Configuration"
|
|
1248
|
-
detailColumn.width = 360
|
|
1249
|
-
detailColumn.minWidth = 220
|
|
1250
|
-
tableView.addTableColumn(statusColumn)
|
|
1251
|
-
tableView.addTableColumn(nameColumn)
|
|
1252
|
-
tableView.addTableColumn(transportColumn)
|
|
1253
|
-
tableView.addTableColumn(detailColumn)
|
|
1254
|
-
|
|
1255
|
-
let scroll = NSScrollView()
|
|
1256
|
-
scroll.documentView = tableView
|
|
1257
|
-
scroll.hasVerticalScroller = true
|
|
1258
|
-
scroll.hasHorizontalScroller = false
|
|
1259
|
-
scroll.borderType = .bezelBorder
|
|
1260
|
-
scroll.translatesAutoresizingMaskIntoConstraints = false
|
|
1261
|
-
|
|
1262
|
-
statusLabel = NSTextField(labelWithString: "Loading MCP configuration…")
|
|
1263
|
-
statusLabel.textColor = .secondaryLabelColor
|
|
1264
|
-
statusLabel.font = NSFont.systemFont(ofSize: 11)
|
|
1265
|
-
statusLabel.lineBreakMode = .byTruncatingMiddle
|
|
1266
|
-
statusLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
1267
|
-
|
|
1268
|
-
addButton = makeButton("Add…", #selector(addServer))
|
|
1269
|
-
removeButton = makeButton("Remove", #selector(removeServer))
|
|
1270
|
-
toggleButton = makeButton("Disable", #selector(toggleServer))
|
|
1271
|
-
refreshButton = makeButton("Refresh", #selector(refresh))
|
|
1272
|
-
let closeButton = makeButton("Close", #selector(closePanel))
|
|
1273
|
-
closeButton.keyEquivalent = "\\u{1b}"
|
|
1274
|
-
|
|
1275
|
-
let buttonStack = NSStackView(views: [addButton, removeButton, toggleButton, refreshButton, NSView(), closeButton])
|
|
1276
|
-
buttonStack.orientation = .horizontal
|
|
1277
|
-
buttonStack.spacing = 8
|
|
1278
|
-
buttonStack.distribution = .fill
|
|
1279
|
-
buttonStack.translatesAutoresizingMaskIntoConstraints = false
|
|
1280
|
-
|
|
1281
|
-
content.addSubview(heading)
|
|
1282
|
-
content.addSubview(scope)
|
|
1283
|
-
content.addSubview(scroll)
|
|
1284
|
-
content.addSubview(statusLabel)
|
|
1285
|
-
content.addSubview(buttonStack)
|
|
1286
|
-
NSLayoutConstraint.activate([
|
|
1287
|
-
heading.topAnchor.constraint(equalTo: content.topAnchor, constant: 18),
|
|
1288
|
-
heading.leadingAnchor.constraint(equalTo: content.leadingAnchor, constant: 18),
|
|
1289
|
-
heading.trailingAnchor.constraint(equalTo: content.trailingAnchor, constant: -18),
|
|
1290
|
-
scope.topAnchor.constraint(equalTo: heading.bottomAnchor, constant: 4),
|
|
1291
|
-
scope.leadingAnchor.constraint(equalTo: heading.leadingAnchor),
|
|
1292
|
-
scope.trailingAnchor.constraint(equalTo: heading.trailingAnchor),
|
|
1293
|
-
scroll.topAnchor.constraint(equalTo: scope.bottomAnchor, constant: 12),
|
|
1294
|
-
scroll.leadingAnchor.constraint(equalTo: content.leadingAnchor, constant: 18),
|
|
1295
|
-
scroll.trailingAnchor.constraint(equalTo: content.trailingAnchor, constant: -18),
|
|
1296
|
-
scroll.bottomAnchor.constraint(equalTo: statusLabel.topAnchor, constant: -10),
|
|
1297
|
-
statusLabel.leadingAnchor.constraint(equalTo: scroll.leadingAnchor),
|
|
1298
|
-
statusLabel.centerYAnchor.constraint(equalTo: buttonStack.centerYAnchor),
|
|
1299
|
-
statusLabel.trailingAnchor.constraint(lessThanOrEqualTo: buttonStack.leadingAnchor, constant: -12),
|
|
1300
|
-
buttonStack.trailingAnchor.constraint(equalTo: scroll.trailingAnchor),
|
|
1301
|
-
buttonStack.bottomAnchor.constraint(equalTo: content.bottomAnchor, constant: -16),
|
|
1302
|
-
buttonStack.heightAnchor.constraint(equalToConstant: 30)
|
|
1303
|
-
])
|
|
1304
|
-
updateControls()
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
func makeButton(_ title: String, _ selector: Selector) -> NSButton {
|
|
1308
|
-
let button = NSButton(title: title, target: self, action: selector)
|
|
1309
|
-
button.bezelStyle = .rounded
|
|
1310
|
-
button.setAccessibilityLabel(title)
|
|
1311
|
-
return button
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
func numberOfRows(in tableView: NSTableView) -> Int {
|
|
1315
|
-
return rows.count
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
|
|
1319
|
-
guard row >= 0, row < rows.count, let tableColumn = tableColumn else { return nil }
|
|
1320
|
-
let identifier = tableColumn.identifier
|
|
1321
|
-
let cell = tableView.makeView(withIdentifier: identifier, owner: self) as? NSTableCellView ?? NSTableCellView()
|
|
1322
|
-
cell.identifier = identifier
|
|
1323
|
-
let field: NSTextField
|
|
1324
|
-
if let existing = cell.textField {
|
|
1325
|
-
field = existing
|
|
1326
|
-
} else {
|
|
1327
|
-
field = NSTextField(labelWithString: "")
|
|
1328
|
-
field.translatesAutoresizingMaskIntoConstraints = false
|
|
1329
|
-
field.lineBreakMode = .byTruncatingTail
|
|
1330
|
-
cell.textField = field
|
|
1331
|
-
cell.addSubview(field)
|
|
1332
|
-
NSLayoutConstraint.activate([
|
|
1333
|
-
field.leadingAnchor.constraint(equalTo: cell.leadingAnchor, constant: 4),
|
|
1334
|
-
field.trailingAnchor.constraint(equalTo: cell.trailingAnchor, constant: -4),
|
|
1335
|
-
field.centerYAnchor.constraint(equalTo: cell.centerYAnchor)
|
|
1336
|
-
])
|
|
1337
|
-
}
|
|
1338
|
-
let server = rows[row]
|
|
1339
|
-
switch identifier.rawValue {
|
|
1340
|
-
case "status":
|
|
1341
|
-
field.stringValue = server.enabled ? "Enabled" : "Disabled"
|
|
1342
|
-
field.textColor = server.enabled ? .systemGreen : .secondaryLabelColor
|
|
1343
|
-
field.font = NSFont.systemFont(ofSize: 11, weight: .medium)
|
|
1344
|
-
case "name":
|
|
1345
|
-
field.stringValue = server.name
|
|
1346
|
-
field.textColor = .labelColor
|
|
1347
|
-
field.font = NSFont.systemFont(ofSize: 12, weight: .medium)
|
|
1348
|
-
case "transport":
|
|
1349
|
-
field.stringValue = server.transport == "url" ? "Remote" : server.transport == "stdio" ? "Local" : "Unknown"
|
|
1350
|
-
field.textColor = .labelColor
|
|
1351
|
-
field.font = NSFont.systemFont(ofSize: 12)
|
|
1352
|
-
default:
|
|
1353
|
-
field.stringValue = server.summary
|
|
1354
|
-
field.textColor = .secondaryLabelColor
|
|
1355
|
-
field.font = NSFont.systemFont(ofSize: 11)
|
|
1356
|
-
}
|
|
1357
|
-
return cell
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
func tableViewSelectionDidChange(_ notification: Notification) {
|
|
1361
|
-
updateControls()
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
func selectedServer() -> McpServerRow? {
|
|
1365
|
-
let selected = tableView.selectedRow
|
|
1366
|
-
return selected >= 0 && selected < rows.count ? rows[selected] : nil
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
func setWorking(_ value: Bool, status: String? = nil) {
|
|
1370
|
-
working = value
|
|
1371
|
-
if let status = status { statusLabel.stringValue = status }
|
|
1372
|
-
updateControls()
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
func updateControls() {
|
|
1376
|
-
let selected = selectedServer()
|
|
1377
|
-
addButton?.isEnabled = !working
|
|
1378
|
-
refreshButton?.isEnabled = !working
|
|
1379
|
-
removeButton?.isEnabled = !working && selected != nil
|
|
1380
|
-
toggleButton?.isEnabled = !working && selected != nil
|
|
1381
|
-
toggleButton?.title = selected?.enabled == true ? "Disable" : "Enable"
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
@objc func refresh() {
|
|
1385
|
-
guard !working else { return }
|
|
1386
|
-
guard let owner = owner else { return }
|
|
1387
|
-
setWorking(true, status: "Loading MCP configuration…")
|
|
1388
|
-
owner.runSksSilent(["menubar", "mcp", "list", "--json"]) { [weak self] code, output in
|
|
1389
|
-
guard let self = self else { return }
|
|
1390
|
-
guard code == 0,
|
|
1391
|
-
let json = parseJsonObject(output),
|
|
1392
|
-
json["schema"] as? String == "sks.menubar-mcp-list.v1",
|
|
1393
|
-
json["ok"] as? Bool == true,
|
|
1394
|
-
let servers = json["servers"] as? [[String: Any]] else {
|
|
1395
|
-
self.rows = []
|
|
1396
|
-
self.tableView.reloadData()
|
|
1397
|
-
self.setWorking(false, status: "Could not read MCP configuration")
|
|
1398
|
-
showAlert("MCP Manager", informative: humanizeSksFailure(output))
|
|
1399
|
-
return
|
|
1400
|
-
}
|
|
1401
|
-
self.rows = servers.compactMap { server in
|
|
1402
|
-
guard let name = server["name"] as? String else { return nil }
|
|
1403
|
-
return McpServerRow(
|
|
1404
|
-
name: name,
|
|
1405
|
-
enabled: server["enabled"] as? Bool != false,
|
|
1406
|
-
transport: server["transport"] as? String ?? "unknown",
|
|
1407
|
-
summary: server["summary"] as? String ?? "Configured"
|
|
1408
|
-
)
|
|
1409
|
-
}
|
|
1410
|
-
self.tableView.reloadData()
|
|
1411
|
-
if !self.rows.isEmpty { self.tableView.selectRowIndexes(IndexSet(integer: 0), byExtendingSelection: false) }
|
|
1412
|
-
let enabled = self.rows.filter { $0.enabled }.count
|
|
1413
|
-
self.setWorking(false, status: "\(self.rows.count) configured · \(enabled) enabled · Global")
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
@objc func addServer() {
|
|
1418
|
-
guard !working else { return }
|
|
1419
|
-
guard let transport = promptChoice(title: "Add MCP Server", message: "Choose how Codex connects to this server.", options: ["Remote URL", "Local command"]) else { return }
|
|
1420
|
-
guard let name = promptText(title: "MCP Server Name", message: "Use a unique name (letters, numbers, dots, dashes, or underscores).", placeholder: "context7") else { return }
|
|
1421
|
-
var payload: [String: Any] = ["name": name]
|
|
1422
|
-
if transport == "Remote URL" {
|
|
1423
|
-
guard let url = promptText(title: "Remote MCP URL", message: "Enter the full HTTP or HTTPS MCP endpoint.", placeholder: "https://mcp.example.com/mcp") else { return }
|
|
1424
|
-
guard let bearer = promptTextAllowEmpty(title: "Bearer Token Environment Variable", message: "Optional. Enter the environment variable name that contains the bearer token, or leave blank.", placeholder: "MCP_ACCESS_TOKEN") else { return }
|
|
1425
|
-
payload["transport"] = "url"
|
|
1426
|
-
payload["url"] = url
|
|
1427
|
-
if !bearer.isEmpty { payload["bearer_token_env_var"] = bearer }
|
|
1428
|
-
} else {
|
|
1429
|
-
guard let command = promptText(title: "Local MCP Command", message: "Enter the executable used to start the MCP server.", placeholder: "npx") else { return }
|
|
1430
|
-
guard let arguments = promptMultiline(title: "Command Arguments", message: "Optional. Enter one argument per line.", placeholder: "-y\\n@upstash/context7-mcp") else { return }
|
|
1431
|
-
guard let environment = promptMultiline(title: "Environment Variables", message: "Optional. Enter KEY=VALUE pairs, one per line. Values are written only to Codex config and never shown in the MCP list.", placeholder: "API_TOKEN=...") else { return }
|
|
1432
|
-
payload["transport"] = "stdio"
|
|
1433
|
-
payload["command"] = command
|
|
1434
|
-
payload["args"] = arguments.split(separator: "\\n").map { String($0).trimmingCharacters(in: .whitespacesAndNewlines) }.filter { !$0.isEmpty }
|
|
1435
|
-
var env: [String: String] = [:]
|
|
1436
|
-
for line in environment.split(separator: "\\n") {
|
|
1437
|
-
let text = String(line)
|
|
1438
|
-
guard let separator = text.firstIndex(of: "=") else {
|
|
1439
|
-
showAlert("Invalid environment variable", informative: "Use KEY=VALUE, one entry per line.")
|
|
1440
|
-
return
|
|
1441
|
-
}
|
|
1442
|
-
let key = String(text[..<separator]).trimmingCharacters(in: .whitespacesAndNewlines)
|
|
1443
|
-
let value = String(text[text.index(after: separator)...]).trimmingCharacters(in: .whitespacesAndNewlines)
|
|
1444
|
-
env[key] = value
|
|
1445
|
-
}
|
|
1446
|
-
if !env.isEmpty { payload["env"] = env }
|
|
1447
|
-
}
|
|
1448
|
-
guard JSONSerialization.isValidJSONObject(payload),
|
|
1449
|
-
let data = try? JSONSerialization.data(withJSONObject: payload),
|
|
1450
|
-
let json = String(data: data, encoding: .utf8) else {
|
|
1451
|
-
showAlert("Add MCP Server", informative: "Could not prepare the MCP configuration payload.")
|
|
1452
|
-
return
|
|
1453
|
-
}
|
|
1454
|
-
runMutation(["menubar", "mcp", "add", "--stdin-json", "--json"], title: "Add MCP Server", stdinText: json + "\\n")
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
@objc func removeServer() {
|
|
1458
|
-
guard !working, let server = selectedServer() else { return }
|
|
1459
|
-
guard confirmAction(title: "Remove \(server.name)?", message: "This removes the global MCP configuration and creates a protected backup first.", destructive: true) else { return }
|
|
1460
|
-
runMutation(["menubar", "mcp", "remove", server.name, "--json"], title: "Remove MCP Server")
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
@objc func toggleServer() {
|
|
1464
|
-
guard !working, let server = selectedServer() else { return }
|
|
1465
|
-
let action = server.enabled ? "disable" : "enable"
|
|
1466
|
-
runMutation(["menubar", "mcp", action, server.name, "--json"], title: server.enabled ? "Disable MCP Server" : "Enable MCP Server")
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
func runMutation(_ args: [String], title: String, stdinText: String? = nil) {
|
|
1470
|
-
guard let owner = owner else { return }
|
|
1471
|
-
setWorking(true, status: title + "…")
|
|
1472
|
-
owner.runSksCapture(args, title: title, stdinText: stdinText, notify: false) { [weak self] code, output in
|
|
1473
|
-
guard let self = self else { return }
|
|
1474
|
-
guard code == 0,
|
|
1475
|
-
let json = parseJsonObject(output),
|
|
1476
|
-
json["schema"] as? String == "sks.menubar-mcp-mutation.v1",
|
|
1477
|
-
json["ok"] as? Bool == true else {
|
|
1478
|
-
self.setWorking(false, status: title + " failed")
|
|
1479
|
-
showAlert(title + " failed", informative: humanizeSksFailure(output))
|
|
1480
|
-
return
|
|
1481
|
-
}
|
|
1482
|
-
self.setWorking(false, status: title + " complete · restart or open a new Codex session to apply")
|
|
1483
|
-
self.refresh()
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
@objc func closePanel() {
|
|
1488
|
-
if NSApp.modalWindow === panel { NSApp.stopModal() }
|
|
1489
|
-
panel.orderOut(nil)
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
func windowShouldClose(_ sender: NSWindow) -> Bool {
|
|
1493
|
-
closePanel()
|
|
1494
|
-
return false
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
|
|
1499
|
-
var statusItem: NSStatusItem!
|
|
1500
|
-
var statusLineItem: NSMenuItem!
|
|
1501
|
-
var codexLbItem: NSMenuItem!
|
|
1502
|
-
var oauthItem: NSMenuItem!
|
|
1503
|
-
var fastModeOnItem: NSMenuItem!
|
|
1504
|
-
var fastModeOffItem: NSMenuItem!
|
|
1505
|
-
var codexCliVersionItem: NSMenuItem!
|
|
1506
|
-
var codexCliUpdateItem: NSMenuItem!
|
|
1507
|
-
var mcpManager: McpManagerController?
|
|
1508
|
-
var timer: Timer?
|
|
1509
|
-
var busy = false
|
|
1510
|
-
var lastFailure = false
|
|
1511
|
-
var quitWithCodex = false
|
|
1512
|
-
var codexCliCurrentVersion: String?
|
|
1513
|
-
var codexCliLatestVersion: String?
|
|
1514
|
-
var codexCliUpdateAvailable = false
|
|
1515
|
-
var codexCliMissing = false
|
|
1516
|
-
var codexCliStatusUnavailable = false
|
|
1517
|
-
var codexCliStatusRequestGeneration = 0
|
|
1518
|
-
|
|
1519
|
-
func applicationDidFinishLaunching(_ notification: Notification) {
|
|
1520
|
-
NSApp.setActivationPolicy(.accessory)
|
|
1521
|
-
quitWithCodex = readConfig().quitWithCodex
|
|
1522
|
-
statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
|
1523
|
-
statusItem.autosaveName = "com.sneakoscope.sks-menubar"
|
|
1524
|
-
if let button = statusItem.button {
|
|
1525
|
-
configureStatusButton(button, title: "SKS")
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
|
-
let menu = NSMenu()
|
|
1529
|
-
menu.delegate = self
|
|
1530
|
-
statusLineItem = NSMenuItem(title: "SKS v\\(packageVersion) - starting", action: nil, keyEquivalent: "")
|
|
1531
|
-
statusLineItem.isEnabled = false
|
|
1532
|
-
menu.addItem(statusLineItem)
|
|
1533
|
-
menu.addItem(NSMenuItem.separator())
|
|
1534
|
-
codexLbItem = add(menu, "Use codex-lb", #selector(useCodexLb))
|
|
1535
|
-
oauthItem = add(menu, "Use ChatGPT OAuth", #selector(useChatGptOAuth))
|
|
1536
|
-
add(menu, "Set codex-lb Domain and Key", #selector(setCodexLbDomainAndKey))
|
|
1537
|
-
menu.addItem(NSMenuItem.separator())
|
|
1538
|
-
add(menu, "Set OpenRouter Key and GLM Profiles", #selector(setOpenRouterKey))
|
|
1539
|
-
fastModeOnItem = add(menu, "Fast Mode On", #selector(fastModeOn))
|
|
1540
|
-
fastModeOffItem = add(menu, "Fast Mode Off", #selector(fastModeOff))
|
|
1541
|
-
add(menu, "Fast Check", #selector(fastCheck))
|
|
1542
|
-
add(menu, "SKS Version Check", #selector(sksVersionCheck))
|
|
1543
|
-
add(menu, "Update SKS Now", #selector(updateSksNow))
|
|
1544
|
-
menu.addItem(NSMenuItem.separator())
|
|
1545
|
-
codexCliVersionItem = NSMenuItem(title: "Codex CLI: checking…", action: nil, keyEquivalent: "")
|
|
1546
|
-
codexCliVersionItem.isEnabled = false
|
|
1547
|
-
menu.addItem(codexCliVersionItem)
|
|
1548
|
-
codexCliUpdateItem = add(menu, "Update Codex CLI Now", #selector(updateCodexCliNow))
|
|
1549
|
-
add(menu, "Manage MCP Servers…", #selector(manageMcpServers))
|
|
1550
|
-
add(menu, "Run sks doctor --fix", #selector(runDoctorFix))
|
|
1551
|
-
menu.addItem(NSMenuItem.separator())
|
|
1552
|
-
add(menu, "Open Dashboard", #selector(openDashboard))
|
|
1553
|
-
add(menu, "Open Codex Settings", #selector(openCodexSettings))
|
|
1554
|
-
add(menu, "Restart Codex", #selector(restartCodex))
|
|
1555
|
-
menu.addItem(NSMenuItem.separator())
|
|
1556
|
-
add(menu, "View Last Log", #selector(viewLastLog))
|
|
1557
|
-
add(menu, "Quit SKS Menu", #selector(quit))
|
|
1558
|
-
statusItem.menu = menu
|
|
1559
|
-
configureCodexLifecycleSync()
|
|
1560
|
-
updateState()
|
|
1561
|
-
updateCodexCliStatus()
|
|
1562
|
-
timer = Timer.scheduledTimer(withTimeInterval: 30.0, repeats: true) { [weak self] _ in self?.updateState() }
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
func menuWillOpen(_ menu: NSMenu) {
|
|
1566
|
-
updateState()
|
|
1567
|
-
updateAuthModeChecks()
|
|
1568
|
-
updateFastModeChecks()
|
|
1569
|
-
updateCodexCliStatus()
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
func configureStatusButton(_ button: NSStatusBarButton, title: String) {
|
|
1573
|
-
button.image = nil
|
|
1574
|
-
button.title = title
|
|
1575
|
-
let titleFont = NSFont.systemFont(ofSize: NSFont.systemFontSize, weight: .semibold)
|
|
1576
|
-
let titleAttributes: [NSAttributedString.Key: Any] = [
|
|
1577
|
-
.font: titleFont,
|
|
1578
|
-
.foregroundColor: NSColor.labelColor
|
|
1579
|
-
]
|
|
1580
|
-
button.font = titleFont
|
|
1581
|
-
button.attributedTitle = NSAttributedString(string: title, attributes: titleAttributes)
|
|
1582
|
-
button.toolTip = "SKS - Sneakoscope Codex settings"
|
|
1583
|
-
button.setAccessibilityLabel(title)
|
|
1584
|
-
button.setAccessibilityHelp("Open SKS menu")
|
|
1585
|
-
}
|
|
1586
|
-
|
|
1587
|
-
func add(_ menu: NSMenu, _ title: String, _ selector: Selector) -> NSMenuItem {
|
|
1588
|
-
let item = NSMenuItem(title: title, action: selector, keyEquivalent: "")
|
|
1589
|
-
item.target = self
|
|
1590
|
-
menu.addItem(item)
|
|
1591
|
-
return item
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
${codexLifecycleSource}
|
|
1595
|
-
|
|
1596
|
-
func readConfig() -> MenuBarConfig {
|
|
1597
|
-
guard let data = FileManager.default.contents(atPath: menubarConfigPath),
|
|
1598
|
-
let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else {
|
|
1599
|
-
return MenuBarConfig(quitWithCodex: false)
|
|
1600
|
-
}
|
|
1601
|
-
return MenuBarConfig(quitWithCodex: json["quit_with_codex"] as? Bool == true)
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
func updateState() {
|
|
1605
|
-
let state = readMenuState()
|
|
1606
|
-
if let button = statusItem.button {
|
|
1607
|
-
configureStatusButton(button, title: state.title)
|
|
1608
|
-
}
|
|
1609
|
-
statusLineItem.title = state.line
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
func readMenuState() -> MenuState {
|
|
1613
|
-
if codexBundleId == nil {
|
|
1614
|
-
return MenuState(title: "SKS", line: "Codex app not detected — sync disabled")
|
|
1615
|
-
}
|
|
1616
|
-
if busy {
|
|
1617
|
-
return MenuState(title: "SKS ⋯", line: "SKS v\\(packageVersion) - working")
|
|
1618
|
-
}
|
|
1619
|
-
if !actionScriptUsable() {
|
|
1620
|
-
return MenuState(title: "SKS ⚠", line: "SKS v\\(packageVersion) - action script broken (run sks doctor --fix)")
|
|
1621
|
-
}
|
|
1622
|
-
if lastFailure {
|
|
1623
|
-
return MenuState(title: "SKS ⚠", line: "SKS v\\(packageVersion) - last action failed")
|
|
1624
|
-
}
|
|
1625
|
-
if codexCliMissing {
|
|
1626
|
-
return MenuState(title: "SKS ⚠", line: "SKS v\\(packageVersion) · Codex CLI not installed")
|
|
1627
|
-
}
|
|
1628
|
-
if codexCliStatusUnavailable {
|
|
1629
|
-
let current = codexCliCurrentVersion.map { " " + $0 } ?? ""
|
|
1630
|
-
return MenuState(title: "SKS ⚠", line: "SKS v\\(packageVersion) · Codex CLI\\(current) status unavailable")
|
|
1631
|
-
}
|
|
1632
|
-
if codexCliUpdateAvailable {
|
|
1633
|
-
let current = codexCliCurrentVersion ?? "unknown"
|
|
1634
|
-
let latest = codexCliLatestVersion ?? "latest"
|
|
1635
|
-
return MenuState(title: "SKS ⬆", line: "SKS v\\(packageVersion) · Codex CLI \\(current) → \\(latest) update available")
|
|
1636
|
-
}
|
|
1637
|
-
if updateAvailable() {
|
|
1638
|
-
return MenuState(title: "SKS ↑", line: "SKS v\\(packageVersion) - update available")
|
|
1639
|
-
}
|
|
1640
|
-
let codexVersion = codexCliCurrentVersion.map { " · Codex CLI " + $0 } ?? ""
|
|
1641
|
-
return MenuState(title: "SKS", line: "SKS v\\(packageVersion)\\(codexVersion) · OK")
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
func actionScriptUsable() -> Bool {
|
|
1645
|
-
return FileManager.default.isExecutableFile(atPath: actionScript)
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
func updateAvailable() -> Bool {
|
|
1649
|
-
let cachePath = NSString(string: "~/.sneakoscope/cache/update-notice.json").expandingTildeInPath
|
|
1650
|
-
guard let data = FileManager.default.contents(atPath: cachePath) else { return false }
|
|
1651
|
-
guard let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else { return false }
|
|
1652
|
-
if let latest = json["latest_version"] as? String, !latest.isEmpty {
|
|
1653
|
-
return latest.compare(packageVersion, options: .numeric) == .orderedDescending
|
|
1654
|
-
}
|
|
1655
|
-
return json["update_available"] as? Bool == true
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
func runSksCapture(_ args: [String], title: String, stdinText: String? = nil, notify: Bool = true, completion: ((Int32, String) -> Void)? = nil) {
|
|
1659
|
-
busy = true
|
|
1660
|
-
lastFailure = false
|
|
1661
|
-
updateState()
|
|
1662
|
-
runProcess(actionScript, args, stdinText: stdinText) { [weak self] code, output in
|
|
1663
|
-
let redacted = redactSecrets(output, secrets: stdinText == nil ? [] : [stdinText ?? ""])
|
|
1664
|
-
writeActionLog("$ sks \\(args.joined(separator: " "))\\n\\(redacted)\\n")
|
|
1665
|
-
DispatchQueue.main.async {
|
|
1666
|
-
self?.busy = false
|
|
1667
|
-
self?.lastFailure = code != 0
|
|
1668
|
-
self?.updateState()
|
|
1669
|
-
if notify {
|
|
1670
|
-
if code == 0 {
|
|
1671
|
-
showNotification(title, "OK\\n" + redacted)
|
|
1672
|
-
} else {
|
|
1673
|
-
showAlert(title + " failed", informative: humanizeSksFailure(redacted))
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
completion?(code, redacted)
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
func runSksBackground(_ args: [String], title: String, stdinText: String? = nil, completion: ((Int32, String) -> Void)? = nil) {
|
|
1682
|
-
runSksCapture(args, title: title, stdinText: stdinText, notify: true, completion: completion)
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
func runSksSilent(_ args: [String], completion: ((Int32, String) -> Void)? = nil) {
|
|
1686
|
-
runProcess(actionScript, args) { code, output in
|
|
1687
|
-
let redacted = redactSecrets(output)
|
|
1688
|
-
DispatchQueue.main.async {
|
|
1689
|
-
completion?(code, redacted)
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
func startSksDetached(_ args: [String], title: String) {
|
|
1695
|
-
let process = Process()
|
|
1696
|
-
process.executableURL = URL(fileURLWithPath: actionScript)
|
|
1697
|
-
process.arguments = args
|
|
1698
|
-
writeActionLog("$ sks \\(args.joined(separator: " "))\\nstarted\\n")
|
|
1699
|
-
if let handle = try? FileHandle(forWritingTo: URL(fileURLWithPath: lastActionLogPath)) {
|
|
1700
|
-
process.standardOutput = handle
|
|
1701
|
-
process.standardError = handle
|
|
1702
|
-
}
|
|
1703
|
-
do {
|
|
1704
|
-
try process.run()
|
|
1705
|
-
showNotification(title, "started")
|
|
1706
|
-
} catch {
|
|
1707
|
-
showAlert(title + " failed", informative: String(describing: error))
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
func updateAuthModeChecks() {
|
|
1712
|
-
runSksSilent(["codex-lb", "status", "--json"]) { [weak self] code, output in
|
|
1713
|
-
guard let self = self else { return }
|
|
1714
|
-
let json = parseJsonObject(output)
|
|
1715
|
-
guard code == 0, let json = json else {
|
|
1716
|
-
self.codexLbItem.state = .off
|
|
1717
|
-
self.oauthItem.state = .off
|
|
1718
|
-
return
|
|
1719
|
-
}
|
|
1720
|
-
let selected = json["selected"] as? Bool == true
|
|
1721
|
-
let providerContract = json["provider_contract_ok"] as? Bool == true
|
|
1722
|
-
let authMode = (json["auth_mode"] as? String)?.lowercased() ?? ""
|
|
1723
|
-
let codexLbActive = selected && providerContract && authMode == "apikey"
|
|
1724
|
-
let oauthActive = !selected && (authMode.contains("chatgpt") || authMode.contains("oauth") || authMode.contains("browser"))
|
|
1725
|
-
self.codexLbItem.state = codexLbActive ? .on : .off
|
|
1726
|
-
self.oauthItem.state = oauthActive ? .on : .off
|
|
1727
|
-
}
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
func updateFastModeChecks() {
|
|
1731
|
-
runSksSilent(["fast-mode", "status", "--json"]) { [weak self] code, output in
|
|
1732
|
-
guard let self = self else { return }
|
|
1733
|
-
let json = parseJsonObject(output)
|
|
1734
|
-
guard code == 0, let json = json else {
|
|
1735
|
-
self.fastModeOnItem.state = .off
|
|
1736
|
-
self.fastModeOffItem.state = .off
|
|
1737
|
-
return
|
|
1738
|
-
}
|
|
1739
|
-
guard let global = json["global"] as? [String: Any], let desktopFast = global["on"] as? Bool else {
|
|
1740
|
-
self.fastModeOnItem.state = .off
|
|
1741
|
-
self.fastModeOffItem.state = .off
|
|
1742
|
-
return
|
|
1743
|
-
}
|
|
1744
|
-
let fastMode = json["fast_mode"] as? Bool == true
|
|
1745
|
-
let serviceTier = (json["service_tier"] as? String)?.lowercased()
|
|
1746
|
-
let projectFast = fastMode || serviceTier == "fast" || serviceTier == "priority"
|
|
1747
|
-
self.fastModeOnItem.state = projectFast && desktopFast ? .on : .off
|
|
1748
|
-
self.fastModeOffItem.state = !projectFast && !desktopFast ? .on : .off
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
func updateCodexCliStatus(refresh: Bool = false) {
|
|
1753
|
-
codexCliStatusRequestGeneration += 1
|
|
1754
|
-
let requestGeneration = codexCliStatusRequestGeneration
|
|
1755
|
-
var args = ["codex", "update-status", "--json"]
|
|
1756
|
-
if refresh { args.append("--refresh") }
|
|
1757
|
-
runSksSilent(args) { [weak self] code, output in
|
|
1758
|
-
guard let self = self else { return }
|
|
1759
|
-
guard self.codexCliStatusRequestGeneration == requestGeneration else { return }
|
|
1760
|
-
guard let json = parseJsonObject(output),
|
|
1761
|
-
json["schema"] as? String == "sks.codex-cli-update-status.v1",
|
|
1762
|
-
let ok = json["ok"] as? Bool,
|
|
1763
|
-
let installed = json["installed"] as? Bool,
|
|
1764
|
-
let status = json["status"] as? String,
|
|
1765
|
-
["current", "update_available", "missing", "update_check_unavailable"].contains(status),
|
|
1766
|
-
code == 0 || (!ok && !installed && status == "missing") else {
|
|
1767
|
-
self.markCodexCliStatusUnavailable()
|
|
1768
|
-
return
|
|
1769
|
-
}
|
|
1770
|
-
let current = json["current_version"] as? String
|
|
1771
|
-
let latest = json["latest_version"] as? String
|
|
1772
|
-
let reportedUpdateAvailable = json["update_available"] as? Bool
|
|
1773
|
-
let trusted = status == "missing"
|
|
1774
|
-
? !ok && !installed && current == nil
|
|
1775
|
-
: ok && installed && current != nil
|
|
1776
|
-
&& (status == "update_check_unavailable"
|
|
1777
|
-
|| (status == "update_available" && reportedUpdateAvailable == true)
|
|
1778
|
-
|| (status == "current" && reportedUpdateAvailable == false))
|
|
1779
|
-
guard trusted else {
|
|
1780
|
-
self.markCodexCliStatusUnavailable()
|
|
1781
|
-
return
|
|
1782
|
-
}
|
|
1783
|
-
let updateAvailable = reportedUpdateAvailable == true
|
|
1784
|
-
self.codexCliCurrentVersion = current
|
|
1785
|
-
self.codexCliLatestVersion = latest
|
|
1786
|
-
self.codexCliUpdateAvailable = updateAvailable
|
|
1787
|
-
self.codexCliMissing = !installed
|
|
1788
|
-
self.codexCliStatusUnavailable = status == "update_check_unavailable"
|
|
1789
|
-
if !installed {
|
|
1790
|
-
self.codexCliVersionItem.title = "Codex CLI: not installed"
|
|
1791
|
-
} else if status == "update_check_unavailable" {
|
|
1792
|
-
self.codexCliVersionItem.title = "Codex CLI: \\(current ?? "unknown") (update check unavailable)"
|
|
1793
|
-
} else if updateAvailable {
|
|
1794
|
-
self.codexCliVersionItem.title = "Codex CLI: \\(current ?? "unknown") → \\(latest ?? "latest") ⬆"
|
|
1795
|
-
} else if let current = current, let latest = latest {
|
|
1796
|
-
self.codexCliVersionItem.title = current == latest ? "Codex CLI: \\(current) (current)" : "Codex CLI: \\(current) · latest \\(latest)"
|
|
1797
|
-
} else {
|
|
1798
|
-
self.codexCliVersionItem.title = "Codex CLI: \\(current ?? "unknown") (latest check unavailable)"
|
|
1799
|
-
}
|
|
1800
|
-
self.codexCliUpdateItem.title = updateAvailable ? "Update Codex CLI Now ⬆" : "Update Codex CLI Now"
|
|
1801
|
-
self.updateState()
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
func markCodexCliStatusUnavailable() {
|
|
1806
|
-
codexCliVersionItem.title = "Codex CLI: status unavailable"
|
|
1807
|
-
codexCliUpdateItem.title = "Update Codex CLI Now"
|
|
1808
|
-
codexCliCurrentVersion = nil
|
|
1809
|
-
codexCliLatestVersion = nil
|
|
1810
|
-
codexCliUpdateAvailable = false
|
|
1811
|
-
codexCliMissing = false
|
|
1812
|
-
codexCliStatusUnavailable = true
|
|
1813
|
-
updateState()
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
@objc func useCodexLb() {
|
|
1817
|
-
runSksBackground(["codex-lb", "use-codex-lb", "--restart-app", "--json"], title: "Use codex-lb") { [weak self] code, _ in
|
|
1818
|
-
if code == 0 { self?.updateAuthModeChecks() }
|
|
1819
|
-
}
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
@objc func useChatGptOAuth() {
|
|
1823
|
-
runSksBackground(["codex-lb", "use-oauth", "--restart-app", "--json"], title: "Use ChatGPT OAuth") { [weak self] code, _ in
|
|
1824
|
-
if code == 0 { self?.updateAuthModeChecks() }
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
@objc func setCodexLbDomainAndKey() {
|
|
1829
|
-
guard let domain = promptText(title: "Set codex-lb Domain", message: "Enter just your codex-lb domain or base URL — the /backend-api/codex path is added automatically.", placeholder: "lb.example.com") else { return }
|
|
1830
|
-
guard let key = promptText(title: "Set codex-lb Key", message: "Enter your codex-lb API key.", placeholder: "sk-clb-...", secure: true) else { return }
|
|
1831
|
-
runSksBackground(["codex-lb", "setup", "--host", domain, "--api-key-stdin", "--yes", "--restart-app", "--json"], title: "Set codex-lb", stdinText: key + "\\n") { [weak self] code, _ in
|
|
1832
|
-
if code == 0 { self?.updateAuthModeChecks() }
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
@objc func setOpenRouterKey() {
|
|
1837
|
-
guard let key = promptText(title: "Set OpenRouter Key", message: "Enter your OpenRouter API key.", placeholder: "sk-or-v1-...", secure: true) else { return }
|
|
1838
|
-
runSksBackground(["codex-app", "set-openrouter-key", "--api-key-stdin", "--restart-app", "--json"], title: "Set OpenRouter Key", stdinText: key + "\\n")
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
@objc func fastModeOn() {
|
|
1842
|
-
runSksBackground(["fast-mode", "on", "--json"], title: "Fast Mode On") { [weak self] code, _ in
|
|
1843
|
-
if code == 0 { self?.updateFastModeChecks() }
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
@objc func fastModeOff() {
|
|
1848
|
-
runSksBackground(["fast-mode", "off", "--json"], title: "Fast Mode Off") { [weak self] code, _ in
|
|
1849
|
-
if code == 0 { self?.updateFastModeChecks() }
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
@objc func fastCheck() {
|
|
1854
|
-
runSksBackground(["codex-lb", "fast-check"], title: "SKS Fast Check")
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
@objc func sksVersionCheck() {
|
|
1858
|
-
runSksBackground(["update", "check"], title: "SKS Version Check")
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
@objc func updateSksNow() {
|
|
1862
|
-
runSksBackground(["update"], title: "Update SKS Now")
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
@objc func updateCodexCliNow() {
|
|
1866
|
-
runSksBackground(["codex", "update", "--json"], title: "Update Codex CLI Now") { [weak self] _, _ in
|
|
1867
|
-
self?.updateCodexCliStatus(refresh: true)
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
@objc func manageMcpServers() {
|
|
1872
|
-
if mcpManager == nil { mcpManager = McpManagerController(owner: self) }
|
|
1873
|
-
mcpManager?.show()
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
@objc func runDoctorFix() {
|
|
1877
|
-
runSksBackground(["doctor", "--fix", "--global-only", "--json"], title: "Run sks doctor --fix") { [weak self] code, _ in
|
|
1878
|
-
if code == 0 {
|
|
1879
|
-
self?.updateAuthModeChecks()
|
|
1880
|
-
self?.updateFastModeChecks()
|
|
1881
|
-
self?.updateCodexCliStatus(refresh: true)
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
|
|
1886
|
-
@objc func openDashboard() {
|
|
1887
|
-
let urlString = "http://127.0.0.1:4477"
|
|
1888
|
-
runProcess("/usr/bin/curl", ["-fsS", "--max-time", "1", urlString]) { [weak self] code, _ in
|
|
1889
|
-
DispatchQueue.main.async {
|
|
1890
|
-
if code == 0 {
|
|
1891
|
-
if let url = URL(string: urlString) { NSWorkspace.shared.open(url) }
|
|
1892
|
-
} else {
|
|
1893
|
-
self?.startSksDetached(["ui"], title: "SKS Dashboard")
|
|
1894
|
-
self?.waitForDashboard(urlString, attempts: 20)
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
func waitForDashboard(_ urlString: String, attempts: Int) {
|
|
1901
|
-
runProcess("/usr/bin/curl", ["-fsS", "--max-time", "1", urlString]) { [weak self] code, _ in
|
|
1902
|
-
if code == 0 {
|
|
1903
|
-
DispatchQueue.main.async {
|
|
1904
|
-
if let url = URL(string: urlString) { NSWorkspace.shared.open(url) }
|
|
1905
|
-
}
|
|
1906
|
-
} else if attempts > 1 {
|
|
1907
|
-
DispatchQueue.global().asyncAfter(deadline: .now() + 0.25) {
|
|
1908
|
-
self?.waitForDashboard(urlString, attempts: attempts - 1)
|
|
1909
|
-
}
|
|
1910
|
-
} else {
|
|
1911
|
-
DispatchQueue.main.async {
|
|
1912
|
-
showAlert("SKS Dashboard failed", informative: "Dashboard did not become ready at \(urlString). See View Last Log.")
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
|
|
1918
|
-
@objc func openCodexSettings() {
|
|
1919
|
-
runProcess("/usr/bin/open", ["codex://settings"]) { code, output in
|
|
1920
|
-
if code != 0 {
|
|
1921
|
-
DispatchQueue.main.async {
|
|
1922
|
-
showAlert("Open Codex Settings failed", informative: humanizeSksFailure(redactSecrets(output)))
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
|
|
1928
|
-
@objc func restartCodex() {
|
|
1929
|
-
runSksBackground(["codex-app", "restart", "--json"], title: "Restart Codex")
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
@objc func viewLastLog() {
|
|
1933
|
-
if FileManager.default.fileExists(atPath: lastActionLogPath) {
|
|
1934
|
-
NSWorkspace.shared.open(URL(fileURLWithPath: lastActionLogPath))
|
|
1935
|
-
} else {
|
|
1936
|
-
showAlert("No SKS menu log yet", informative: lastActionLogPath)
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
@objc func quit() {
|
|
1941
|
-
NSApplication.shared.terminate(nil)
|
|
1942
|
-
}
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
let app = NSApplication.shared
|
|
1946
|
-
let delegate = AppDelegate()
|
|
1947
|
-
app.delegate = delegate
|
|
1948
|
-
app.run()
|
|
1949
|
-
`;
|
|
1950
|
-
}
|
|
1951
|
-
function infoPlistSource(version) {
|
|
1952
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
1953
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
1954
|
-
<plist version="1.0">
|
|
1955
|
-
<dict>
|
|
1956
|
-
<key>CFBundleExecutable</key>
|
|
1957
|
-
<string>SKSMenuBar</string>
|
|
1958
|
-
<key>CFBundleIdentifier</key>
|
|
1959
|
-
<string>${LABEL}</string>
|
|
1960
|
-
<key>CFBundleName</key>
|
|
1961
|
-
<string>SKS Menu Bar</string>
|
|
1962
|
-
<key>CFBundlePackageType</key>
|
|
1963
|
-
<string>APPL</string>
|
|
1964
|
-
<key>CFBundleShortVersionString</key>
|
|
1965
|
-
<string>${escapeXml(version)}</string>
|
|
1966
|
-
<key>CFBundleVersion</key>
|
|
1967
|
-
<string>${escapeXml(version)}</string>
|
|
1968
|
-
<key>LSUIElement</key>
|
|
1969
|
-
<true/>
|
|
1970
|
-
</dict>
|
|
1971
|
-
</plist>
|
|
1972
|
-
`;
|
|
1973
|
-
}
|
|
1974
|
-
function launchAgentSource(executablePath, installDir) {
|
|
1975
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
1976
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
1977
|
-
<plist version="1.0">
|
|
1978
|
-
<dict>
|
|
1979
|
-
<key>Label</key>
|
|
1980
|
-
<string>${LABEL}</string>
|
|
1981
|
-
<key>ProgramArguments</key>
|
|
1982
|
-
<array>
|
|
1983
|
-
<string>${escapeXml(executablePath)}</string>
|
|
1984
|
-
</array>
|
|
1985
|
-
<key>RunAtLoad</key>
|
|
1986
|
-
<true/>
|
|
1987
|
-
<key>ProcessType</key>
|
|
1988
|
-
<string>Interactive</string>
|
|
1989
|
-
<key>StandardOutPath</key>
|
|
1990
|
-
<string>${escapeXml(path.join(installDir, 'menubar.out.log'))}</string>
|
|
1991
|
-
<key>StandardErrorPath</key>
|
|
1992
|
-
<string>${escapeXml(path.join(installDir, 'menubar.err.log'))}</string>
|
|
1993
|
-
</dict>
|
|
1994
|
-
</plist>
|
|
1995
|
-
`;
|
|
1996
|
-
}
|
|
1997
|
-
async function buildMenuBarAppAtomically(input) {
|
|
1998
|
-
await fs.rm(input.paths.staging_app_path, { recursive: true, force: true });
|
|
1999
|
-
await ensureDir(path.join(input.paths.staging_app_path, 'Contents', 'MacOS'));
|
|
2000
|
-
await writeTextAtomic(input.paths.source_path, input.swiftSource);
|
|
2001
|
-
input.actions.push(`wrote ${input.paths.source_path}`);
|
|
2002
|
-
await writeTextAtomic(path.join(input.paths.staging_app_path, 'Contents', 'Info.plist'), input.infoPlist);
|
|
2003
|
-
const stagingExecutable = path.join(input.paths.staging_app_path, 'Contents', 'MacOS', 'SKSMenuBar');
|
|
2004
|
-
const compileWork = runProcess(input.swiftc, ['-framework', 'Cocoa', input.paths.source_path, '-o', stagingExecutable], {
|
|
2005
|
-
timeoutMs: 60_000,
|
|
2006
|
-
maxOutputBytes: 64 * 1024
|
|
2007
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2008
|
-
const compile = input.quiet === true ? await compileWork : await withHeartbeat('swiftc SKS menu bar', compileWork, { warnAfterMs: 30_000 });
|
|
2009
|
-
if (compile.code !== 0) {
|
|
2010
|
-
throw new MenuBarBuildError('swift_compile_failed', String(compile.stderr || compile.stdout || '').trim());
|
|
2011
|
-
}
|
|
2012
|
-
await fs.chmod(stagingExecutable, 0o755).catch(() => undefined);
|
|
2013
|
-
input.actions.push(`compiled ${stagingExecutable}`);
|
|
2014
|
-
if (input.codesign) {
|
|
2015
|
-
const signed = await runProcess(input.codesign, ['--force', '--sign', '-', '--identifier', LABEL, input.paths.staging_app_path], {
|
|
2016
|
-
timeoutMs: 20_000,
|
|
2017
|
-
maxOutputBytes: 32 * 1024
|
|
2018
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2019
|
-
if (signed.code !== 0) {
|
|
2020
|
-
throw new MenuBarBuildError('codesign_failed', String(signed.stderr || signed.stdout || '').trim());
|
|
2021
|
-
}
|
|
2022
|
-
input.actions.push(`codesigned ${input.paths.staging_app_path}`);
|
|
2023
|
-
}
|
|
2024
|
-
await fs.rm(input.paths.backup_app_path, { recursive: true, force: true }).catch(() => undefined);
|
|
2025
|
-
if (await exists(input.paths.app_path))
|
|
2026
|
-
await fs.rename(input.paths.app_path, input.paths.backup_app_path);
|
|
2027
|
-
try {
|
|
2028
|
-
await fs.rename(input.paths.staging_app_path, input.paths.app_path);
|
|
2029
|
-
}
|
|
2030
|
-
catch (err) {
|
|
2031
|
-
if (await exists(input.paths.backup_app_path))
|
|
2032
|
-
await fs.rename(input.paths.backup_app_path, input.paths.app_path).catch(() => undefined);
|
|
2033
|
-
throw err;
|
|
2034
|
-
}
|
|
2035
|
-
await fs.rm(input.paths.backup_app_path, { recursive: true, force: true }).catch(() => undefined);
|
|
2036
|
-
input.actions.push(`installed ${input.paths.app_path}`);
|
|
2037
|
-
}
|
|
2038
|
-
async function launchWithLaunchctl(input) {
|
|
2039
|
-
const service = launchServiceName();
|
|
2040
|
-
const domain = launchDomain();
|
|
2041
|
-
const stdio = {
|
|
2042
|
-
stdoutFile: path.join(input.paths.install_dir, 'launchctl.out.log'),
|
|
2043
|
-
stderrFile: path.join(input.paths.install_dir, 'launchctl.err.log')
|
|
2044
|
-
};
|
|
2045
|
-
const alreadyWork = waitForLaunchctlRunning(input.launchctl, service);
|
|
2046
|
-
const already = input.quiet === true ? await alreadyWork : await withHeartbeat('launchctl SKS menu bar wait', alreadyWork, { warnAfterMs: 10_000 });
|
|
2047
|
-
if (input.skipIfRunning && already.running) {
|
|
2048
|
-
return { requested: true, method: 'launchctl', ok: true, print_code: already.code, error: null };
|
|
2049
|
-
}
|
|
2050
|
-
await runProcess(input.launchctl, ['bootout', service], { timeoutMs: 3_000, maxOutputBytes: 8 * 1024, ...stdio }).catch(() => undefined);
|
|
2051
|
-
await runProcess(input.launchctl, ['bootout', domain, input.paths.launch_agent_path], { timeoutMs: 3_000, maxOutputBytes: 8 * 1024, ...stdio }).catch(() => undefined);
|
|
2052
|
-
await terminateExistingMenuBarProcess(input.paths.executable_path);
|
|
2053
|
-
const bootstrap = await runProcess(input.launchctl, ['bootstrap', domain, input.paths.launch_agent_path], {
|
|
2054
|
-
timeoutMs: 5_000,
|
|
2055
|
-
maxOutputBytes: 16 * 1024,
|
|
2056
|
-
...stdio
|
|
2057
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2058
|
-
if (bootstrap.code === 0) {
|
|
2059
|
-
const kickstart = await runProcess(input.launchctl, ['kickstart', '-k', service], {
|
|
2060
|
-
timeoutMs: 3_000,
|
|
2061
|
-
maxOutputBytes: 16 * 1024,
|
|
2062
|
-
...stdio
|
|
2063
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2064
|
-
if (kickstart.code !== 0) {
|
|
2065
|
-
// A kickstart timeout does not mean the relaunch failed — under heavy
|
|
2066
|
-
// system load (e.g. mid `npm install -g`) the app can take well past the
|
|
2067
|
-
// kickstart timeout to reach running state, so give the recheck a much
|
|
2068
|
-
// longer window before declaring the whole install blocked.
|
|
2069
|
-
const printedWork = waitForLaunchctlRunning(input.launchctl, service, 20);
|
|
2070
|
-
const printed = input.quiet === true ? await printedWork : await withHeartbeat('launchctl SKS menu bar wait', printedWork, { warnAfterMs: 10_000 });
|
|
2071
|
-
if (printed.running) {
|
|
2072
|
-
return {
|
|
2073
|
-
requested: true,
|
|
2074
|
-
method: 'launchctl',
|
|
2075
|
-
ok: true,
|
|
2076
|
-
bootstrap_code: bootstrap.code,
|
|
2077
|
-
kickstart_code: kickstart.code,
|
|
2078
|
-
print_code: printed.code,
|
|
2079
|
-
error: null
|
|
2080
|
-
};
|
|
2081
|
-
}
|
|
2082
|
-
}
|
|
2083
|
-
return {
|
|
2084
|
-
requested: true,
|
|
2085
|
-
method: 'launchctl',
|
|
2086
|
-
ok: kickstart.code === 0,
|
|
2087
|
-
bootstrap_code: bootstrap.code,
|
|
2088
|
-
kickstart_code: kickstart.code,
|
|
2089
|
-
error: kickstart.code === 0 ? null : String(kickstart.stderr || kickstart.stdout || '').trim() || 'launchctl_kickstart_failed'
|
|
2090
|
-
};
|
|
2091
|
-
}
|
|
2092
|
-
if (input.open) {
|
|
2093
|
-
const opened = await runProcess(input.open, [input.paths.app_path], {
|
|
2094
|
-
timeoutMs: 5_000,
|
|
2095
|
-
maxOutputBytes: 16 * 1024,
|
|
2096
|
-
...stdio
|
|
2097
|
-
}).catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2098
|
-
return {
|
|
2099
|
-
requested: true,
|
|
2100
|
-
method: 'open-fallback',
|
|
2101
|
-
ok: opened.code === 0,
|
|
2102
|
-
bootstrap_code: bootstrap.code,
|
|
2103
|
-
open_code: opened.code,
|
|
2104
|
-
error: opened.code === 0
|
|
2105
|
-
? null
|
|
2106
|
-
: String(opened.stderr || opened.stdout || bootstrap.stderr || bootstrap.stdout || '').trim() || 'sks_menubar_launch_failed'
|
|
2107
|
-
};
|
|
2108
|
-
}
|
|
2109
|
-
return {
|
|
2110
|
-
requested: true,
|
|
2111
|
-
method: 'launchctl',
|
|
2112
|
-
ok: false,
|
|
2113
|
-
bootstrap_code: bootstrap.code,
|
|
2114
|
-
error: String(bootstrap.stderr || bootstrap.stdout || '').trim() || 'launchctl_bootstrap_failed'
|
|
2115
|
-
};
|
|
2116
|
-
}
|
|
2117
|
-
async function waitForLaunchctlRunning(launchctl, service, attempts = 6) {
|
|
2118
|
-
let lastCode = null;
|
|
2119
|
-
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
2120
|
-
const printed = await runProcess(launchctl, ['print', service], {
|
|
2121
|
-
timeoutMs: 1_000,
|
|
2122
|
-
maxOutputBytes: 32 * 1024
|
|
2123
|
-
}).catch(() => ({ code: 1, stdout: '', stderr: '' }));
|
|
2124
|
-
lastCode = printed.code;
|
|
2125
|
-
if (printed.code === 0 && /\bstate = running\b|\bpid = \d+\b/.test(`${printed.stdout || ''}\n${printed.stderr || ''}`)) {
|
|
2126
|
-
return { code: printed.code, running: true };
|
|
2127
|
-
}
|
|
2128
|
-
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
2129
|
-
}
|
|
2130
|
-
return { code: lastCode, running: false };
|
|
2131
|
-
}
|
|
2132
|
-
async function terminateExistingMenuBarProcess(executablePath) {
|
|
2133
|
-
const pkill = await which('pkill').catch(() => null) || await fallbackTool('/usr/bin/pkill');
|
|
2134
|
-
if (!pkill)
|
|
2135
|
-
return;
|
|
2136
|
-
await runProcess(pkill, ['-f', executablePath], { timeoutMs: 3_000, maxOutputBytes: 8 * 1024 }).catch(() => undefined);
|
|
2137
|
-
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
2138
|
-
}
|
|
2139
|
-
async function isMenuBarProcessRunning(executablePath) {
|
|
2140
|
-
const pgrep = await which('pgrep').catch(() => null) || await fallbackTool('/usr/bin/pgrep');
|
|
2141
|
-
if (!pgrep)
|
|
2142
|
-
return false;
|
|
2143
|
-
const result = await runProcess(pgrep, ['-f', executablePath], { timeoutMs: 2_000, maxOutputBytes: 8 * 1024 })
|
|
2144
|
-
.catch(() => ({ code: 1, stdout: '', stderr: '' }));
|
|
2145
|
-
return result.code === 0;
|
|
2146
|
-
}
|
|
2147
|
-
async function inspectLaunchdService(env = process.env) {
|
|
2148
|
-
if (process.platform !== 'darwin')
|
|
2149
|
-
return { checked: false, ok: true, service: null, state: null, pid: null, error: null };
|
|
2150
|
-
const launchctl = env.SKS_MENUBAR_LAUNCHCTL || await which('launchctl').catch(() => null) || await fallbackTool('/bin/launchctl');
|
|
2151
|
-
if (!launchctl)
|
|
2152
|
-
return { checked: true, ok: false, service: launchServiceName(), state: null, pid: null, error: 'launchctl_missing' };
|
|
2153
|
-
const service = launchServiceName();
|
|
2154
|
-
const result = await runProcess(launchctl, ['print', service], { timeoutMs: 2_000, maxOutputBytes: 32 * 1024 })
|
|
2155
|
-
.catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2156
|
-
const text = `${result.stdout || ''}\n${result.stderr || ''}`;
|
|
2157
|
-
const state = text.match(/\bstate = ([^\n]+)/)?.[1]?.trim() || null;
|
|
2158
|
-
const pidText = text.match(/\bpid = (\d+)/)?.[1] || null;
|
|
2159
|
-
const running = result.code === 0 && (state === 'running' || Boolean(pidText));
|
|
2160
|
-
return {
|
|
2161
|
-
checked: true,
|
|
2162
|
-
ok: running,
|
|
2163
|
-
service,
|
|
2164
|
-
state,
|
|
2165
|
-
pid: pidText ? Number(pidText) : null,
|
|
2166
|
-
error: running ? null : String(result.stderr || result.stdout || state || 'launchd_not_running').trim()
|
|
2167
|
-
};
|
|
2168
|
-
}
|
|
2169
|
-
async function inspectSignature(appPath, env = process.env) {
|
|
2170
|
-
if (process.platform !== 'darwin')
|
|
2171
|
-
return { checked: false, identifier: null, ok: true, error: null };
|
|
2172
|
-
const codesign = env.SKS_MENUBAR_CODESIGN || await which('codesign').catch(() => null) || await fallbackTool('/usr/bin/codesign');
|
|
2173
|
-
if (!codesign)
|
|
2174
|
-
return { checked: true, identifier: null, ok: false, error: 'codesign_missing' };
|
|
2175
|
-
if (!(await exists(appPath)))
|
|
2176
|
-
return { checked: true, identifier: null, ok: false, error: 'app_missing' };
|
|
2177
|
-
const result = await runProcess(codesign, ['-dv', '--verbose=4', appPath], { timeoutMs: 5_000, maxOutputBytes: 32 * 1024 })
|
|
2178
|
-
.catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2179
|
-
const text = `${result.stdout || ''}\n${result.stderr || ''}`;
|
|
2180
|
-
const identifier = text.match(/\bIdentifier=([^\n]+)/)?.[1]?.trim() || null;
|
|
2181
|
-
return {
|
|
2182
|
-
checked: true,
|
|
2183
|
-
identifier,
|
|
2184
|
-
ok: result.code === 0 && identifier === LABEL,
|
|
2185
|
-
error: result.code === 0 ? null : String(result.stderr || result.stdout || '').trim()
|
|
2186
|
-
};
|
|
2187
|
-
}
|
|
2188
|
-
async function xcodeCltStatus(xcodeSelect) {
|
|
2189
|
-
if (!xcodeSelect)
|
|
2190
|
-
return { ok: false, error: 'xcode-select not found; run xcode-select --install' };
|
|
2191
|
-
const result = await runProcess(xcodeSelect, ['-p'], { timeoutMs: 5_000, maxOutputBytes: 8 * 1024 })
|
|
2192
|
-
.catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2193
|
-
return result.code === 0
|
|
2194
|
-
? { ok: true }
|
|
2195
|
-
: { ok: false, error: String(result.stderr || result.stdout || 'Run: xcode-select --install').trim() };
|
|
2196
|
-
}
|
|
2197
|
-
async function toolVersion(tool, args) {
|
|
2198
|
-
const result = await runProcess(tool, args, { timeoutMs: 5_000, maxOutputBytes: 16 * 1024 })
|
|
2199
|
-
.catch((err) => ({ code: 1, stdout: '', stderr: err?.message || String(err) }));
|
|
2200
|
-
return result.code === 0 ? String(result.stdout || result.stderr || '').trim().split(/\r?\n/)[0] || 'unknown' : 'unknown';
|
|
2201
|
-
}
|
|
2202
|
-
function buildStampEquals(left, right) {
|
|
2203
|
-
return Boolean(left
|
|
2204
|
-
&& left.schema === right.schema
|
|
2205
|
-
&& left.package_version === right.package_version
|
|
2206
|
-
&& left.source_sha256 === right.source_sha256
|
|
2207
|
-
&& left.action_script_sha256 === right.action_script_sha256
|
|
2208
|
-
&& left.info_plist_sha256 === right.info_plist_sha256
|
|
2209
|
-
&& left.launch_agent_sha256 === right.launch_agent_sha256
|
|
2210
|
-
&& left.swiftc_version === right.swiftc_version
|
|
2211
|
-
&& left.codesign_identifier === right.codesign_identifier);
|
|
2212
|
-
}
|
|
2213
|
-
async function isExecutable(file) {
|
|
2214
|
-
try {
|
|
2215
|
-
await fs.access(file, 1);
|
|
2216
|
-
return true;
|
|
2217
|
-
}
|
|
2218
|
-
catch {
|
|
2219
|
-
return false;
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
function shellAssignment(text, key) {
|
|
2223
|
-
const line = String(text || '').split(/\r?\n/).find((row) => row.startsWith(`${key}=`));
|
|
2224
|
-
if (!line)
|
|
2225
|
-
return null;
|
|
2226
|
-
return shellUnquote(line.slice(key.length + 1));
|
|
2227
|
-
}
|
|
2228
|
-
function shellUnquote(value) {
|
|
2229
|
-
const text = String(value || '').trim();
|
|
2230
|
-
if (text.startsWith("'") && text.endsWith("'"))
|
|
2231
|
-
return text.slice(1, -1).replace(/'\\''/g, "'");
|
|
2232
|
-
if (text.startsWith('"') && text.endsWith('"'))
|
|
2233
|
-
return text.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
|
2234
|
-
return text;
|
|
2235
|
-
}
|
|
2236
|
-
function launchDomain() {
|
|
2237
|
-
const uid = typeof process.getuid === 'function' ? process.getuid() : null;
|
|
2238
|
-
return uid === null ? 'gui' : `gui/${uid}`;
|
|
2239
|
-
}
|
|
2240
|
-
function launchServiceName() {
|
|
2241
|
-
return `${launchDomain()}/${LABEL}`;
|
|
2242
|
-
}
|
|
2243
|
-
function defaultNextActions() {
|
|
2244
|
-
return [
|
|
2245
|
-
'Run: sks menubar status',
|
|
2246
|
-
'Run: sks menubar install',
|
|
2247
|
-
'Run: sks menubar restart',
|
|
2248
|
-
'Run: sks menubar uninstall',
|
|
2249
|
-
'Rotate CODEX_LB_API_KEY and OPENROUTER_API_KEY if they were previously exposed in launchd.'
|
|
2250
|
-
];
|
|
2251
|
-
}
|
|
2252
|
-
async function writeReport(reportPath, result) {
|
|
2253
|
-
try {
|
|
2254
|
-
await writeJsonAtomic(reportPath, result);
|
|
2255
|
-
}
|
|
2256
|
-
catch (err) {
|
|
2257
|
-
result.report_write_failed = true;
|
|
2258
|
-
if (!result.warnings.includes('menubar_report_write_failed'))
|
|
2259
|
-
result.warnings.push('menubar_report_write_failed');
|
|
2260
|
-
console.error(`warning: failed to write SKS menubar report ${reportPath}: ${err?.message || err}`);
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
function isSubpath(candidate, root) {
|
|
2264
|
-
const rel = path.relative(path.resolve(root), path.resolve(candidate));
|
|
2265
|
-
return rel === '' || (Boolean(rel) && !rel.startsWith('..') && !path.isAbsolute(rel));
|
|
2266
|
-
}
|
|
2267
|
-
function swiftString(value) {
|
|
2268
|
-
return `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
2269
|
-
}
|
|
2270
|
-
function shellQuote(value) {
|
|
2271
|
-
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
2272
|
-
}
|
|
2273
|
-
function escapeXml(value) {
|
|
2274
|
-
return value
|
|
2275
|
-
.replace(/&/g, '&')
|
|
2276
|
-
.replace(/</g, '<')
|
|
2277
|
-
.replace(/>/g, '>')
|
|
2278
|
-
.replace(/"/g, '"')
|
|
2279
|
-
.replace(/'/g, ''');
|
|
2280
|
-
}
|
|
2281
|
-
class MenuBarBuildError extends Error {
|
|
2282
|
-
blocker;
|
|
2283
|
-
constructor(blocker, message) {
|
|
2284
|
-
super(message);
|
|
2285
|
-
this.blocker = blocker;
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
//# sourceMappingURL=sks-menubar.js.map
|
|
1
|
+
/** Compatibility facade retained for the 6.3 release. */
|
|
2
|
+
export * from './menubar/index.js';
|