sneakoscope 8.0.2 → 8.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -37
- package/config/skills-hash-ledger.v1.json +1 -1
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/fast-inline.js +55 -27
- package/dist/bin/install.js +6 -32
- package/dist/bin/sks-dispatch.js +1 -1
- package/dist/cli/args.js +0 -2
- package/dist/cli/cli-theme.js +18 -9
- package/dist/cli/command-manifest-lite.js +6 -6
- package/dist/cli/command-registry.js +6 -6
- package/dist/cli/feature-commands.js +9 -7
- package/dist/cli/install-helpers-codex-lb-chain.js +198 -7
- package/dist/cli/install-helpers-codex-lb-config.js +78 -10
- package/dist/cli/install-helpers-install-support.js +9 -6
- package/dist/cli/install-helpers.js +101 -49
- package/dist/cli/install-tool-helpers.js +2 -82
- package/dist/cli/output.js +6 -1
- package/dist/cli/router.js +101 -2
- package/dist/commands/codex-lb.js +119 -19
- package/dist/commands/doctor-profile.js +1 -1
- package/dist/commands/doctor.js +727 -144
- package/dist/commands/mad-sks.js +1 -5
- package/dist/config/skills-manifest.json +4 -2
- package/dist/core/agents/agent-codex-cockpit.js +0 -3
- package/dist/core/agents/agent-effort-policy.js +5 -5
- package/dist/core/agents/agent-janitor.js +0 -20
- package/dist/core/agents/agent-orchestrator.js +9 -56
- package/dist/core/agents/agent-output-validator.js +2 -3
- package/dist/core/agents/agent-patch-schema.js +2 -2
- package/dist/core/agents/agent-proof-evidence.js +0 -65
- package/dist/core/agents/agent-recursion-guard.js +1 -1
- package/dist/core/agents/agent-runner-codex-exec.js +5 -3
- package/dist/core/agents/agent-scheduler.js +327 -85
- package/dist/core/agents/agent-schema.js +1 -1
- package/dist/core/agents/agent-trust-report.js +0 -36
- package/dist/core/agents/agent-worker-pipeline.js +0 -1
- package/dist/core/agents/fast-mode-policy.js +1 -3
- package/dist/core/agents/native-cli-worker-runtime-proof.js +1 -1
- package/dist/core/agents/native-cli-worker-runtime.js +69 -647
- package/dist/core/agents/native-cli-worker.js +6 -7
- package/dist/core/agents/native-worker-backend-router.js +2 -32
- package/dist/core/agents/no-subagent-scaling-policy.js +1 -1
- package/dist/core/agents/parallel-runtime-proof.js +1 -6
- package/dist/core/agents/runtime-proof-summary.js +1 -35
- package/dist/core/architecture-hardening/contracts/contracts.js +193 -0
- package/dist/core/architecture-hardening/migration/migration.js +111 -0
- package/dist/core/architecture-hardening/state/state-service.js +155 -0
- package/dist/core/artifact-schemas.js +0 -3
- package/dist/core/codex/codex-config-guard.js +238 -52
- package/dist/core/codex-adapter.js +5 -3
- package/dist/core/codex-app/auxiliary-oauth-policy.js +36 -0
- package/dist/core/codex-app/catalog-compat/catalog-service.js +104 -0
- package/dist/core/codex-app/child-policy/child-policy.js +35 -0
- package/dist/core/codex-app/codex-app-handoff.js +0 -1
- package/dist/core/codex-app/codex-hook-lifecycle.js +1 -1
- package/dist/core/codex-app/codex-init-deep.js +1 -1
- package/dist/core/codex-app/menubar/app-bundle.js +2 -0
- package/dist/core/codex-app/menubar/constants.js +14 -1
- package/dist/core/codex-app/menubar/global-install.js +288 -0
- package/dist/core/codex-app/menubar/installer.js +79 -14
- package/dist/core/codex-app/menubar/launch-agent.js +267 -45
- package/dist/core/codex-app/menubar/paths.js +3 -0
- package/dist/core/codex-app/menubar/rollback.js +55 -7
- package/dist/core/codex-app/menubar/status.js +75 -4
- package/dist/core/codex-app/provider-child-policy.js +64 -0
- package/dist/core/codex-app/provider-mode.js +91 -0
- package/dist/core/codex-app/provider-operation-stages.js +20 -0
- package/dist/core/codex-app/provider-session-policy.js +85 -0
- package/dist/core/codex-app/session-policy/session-pinning.js +68 -0
- package/dist/core/codex-app.js +3 -2
- package/dist/core/codex-control/codex-0139-image-path-real-probe.js +3 -1
- package/dist/core/codex-control/codex-0139-web-search-probe.js +3 -1
- package/dist/core/codex-control/codex-app-server-runtime-env.js +13 -4
- package/dist/core/codex-control/codex-app-server-v2-client.js +3 -3
- package/dist/core/codex-control/codex-control-proof.js +0 -1
- package/dist/core/codex-control/codex-task-runner.js +1 -4
- package/dist/core/codex-exec-output-schema.js +4 -1
- package/dist/core/codex-lb/codex-lb-env.js +63 -72
- package/dist/core/codex-lb/codex-lb-setup.js +15 -2
- package/dist/core/codex-lb/desktop-bridge/header-policy.js +6 -0
- package/dist/core/codex-lb/desktop-bridge/http-forward.js +48 -6
- package/dist/core/codex-lb/desktop-bridge/security.js +134 -0
- package/dist/core/codex-lb/desktop-bridge/server.js +9 -3
- package/dist/core/codex-lb/desktop-bridge/state.js +26 -6
- package/dist/core/codex-lb/desktop-bridge/types.js +1 -0
- package/dist/core/codex-lb/desktop-center-credentials.js +517 -58
- package/dist/core/codex-lb/desktop-controller.js +177 -56
- package/dist/core/codex-lb/desktop-service.js +179 -40
- package/dist/core/codex-lb/legacy-migration.js +1 -3
- package/dist/core/codex-lb/native-openai-transport/transport.js +68 -0
- package/dist/core/codex-lb/probes/cli-image-tool-probe.js +1 -1
- package/dist/core/codex-lb/provider-routing/provider-router.js +58 -0
- package/dist/core/codex-lb/routing-truth.js +327 -0
- package/dist/core/codex-native/codex-native-feature-broker.js +4 -0
- package/dist/core/codex-native/codex-native-pattern-analysis.js +1 -2
- package/dist/core/codex-native/core-skill-manifest.js +1 -1
- package/dist/core/codex-plugins/codex-plugin-json.js +26 -6
- package/dist/core/codex-plugins/codex-plugin-repair.js +32 -6
- package/dist/core/commands/basic-cli.js +9 -7
- package/dist/core/commands/computer-use-command.js +1 -1
- package/dist/core/commands/image-ux-review-command.js +16 -9
- package/dist/core/commands/install-package-command.js +105 -0
- package/dist/core/commands/intent-normalization/normalizer.js +96 -0
- package/dist/core/commands/mad-sks-command.js +23 -274
- package/dist/core/commands/mad-sks-headless.js +11 -30
- package/dist/core/commands/naruto-command.js +0 -25
- package/dist/core/commands/qa-loop-command.js +104 -22
- package/dist/core/commands/remote-command.js +2 -2
- package/dist/core/commands/research-command.js +10 -5
- package/dist/core/commands/telegram-command.js +407 -0
- package/dist/core/config-adopt/config-adopt-command.js +35 -0
- package/dist/core/config-adopt/config-adopt.js +346 -0
- package/dist/core/config-adopt/index.js +3 -0
- package/dist/core/doctor/command-alias-cleanup.js +4 -1
- package/dist/core/doctor/current-project-guidance-nested.js +37 -6
- package/dist/core/doctor/current-project-guidance.js +15 -9
- package/dist/core/doctor/doctor-dirty-planner.js +1 -4
- package/dist/core/doctor/doctor-readiness-matrix.js +15 -18
- package/dist/core/doctor/retired-managed-residue-private.js +4 -3
- package/dist/core/doctor/retired-managed-residue-runtime.js +2 -2
- package/dist/core/doctor/skill-legacy-surface.js +11 -10
- package/dist/core/doctor/sks-menubar-doctor.js +4 -0
- package/dist/core/evaluation.js +0 -19
- package/dist/core/evidence/v2/evidence-key.js +105 -0
- package/dist/core/feature-fixtures.js +12 -7
- package/dist/core/feature-registry.js +52 -21
- package/dist/core/hooks-runtime/hook-context.js +9 -0
- package/dist/core/hooks-runtime/managed-skill-admission.js +54 -4
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +69 -52
- package/dist/core/hooks-runtime/stop-finalization.js +226 -0
- package/dist/core/hooks-runtime/stop-repeat-guard.js +21 -2
- package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +2 -2
- package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +3 -3
- package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +43 -5
- package/dist/core/hooks-runtime/subagent-skill-availability.js +64 -30
- package/dist/core/hooks-runtime/subagent-stop-hook.js +15 -2
- package/dist/core/hooks-runtime.js +179 -212
- package/dist/core/image/reference-evidence/reference-registry.js +145 -0
- package/dist/core/image-ux-review/imagegen-adapter.js +21 -9
- package/dist/core/image-ux-review/reference-policy/reference-policy.js +9 -0
- package/dist/core/imagegen/codex-lb-imagegen-target.js +8 -0
- package/dist/core/imagegen/imagegen-capability.js +59 -2
- package/dist/core/imagegen/require-imagegen.js +2 -2
- package/dist/core/init/skills.js +17 -3
- package/dist/core/init.js +3 -3
- package/dist/core/install/installed-package-smoke.js +23 -5
- package/dist/core/json/canonical.js +9 -0
- package/dist/core/locks/file-lock.js +0 -1
- package/dist/core/loops/loop-continuation-enforcer.js +65 -7
- package/dist/core/loops/loop-decomposer.js +0 -1
- package/dist/core/loops/loop-gate-runner.js +65 -4
- package/dist/core/loops/loop-gate-selector.js +0 -2
- package/dist/core/loops/loop-proof-validation.js +38 -0
- package/dist/core/loops/loop-risk-classifier.js +1 -1
- package/dist/core/loops/loop-runtime.js +14 -2
- package/dist/core/loops/loop-scheduler.js +7 -2
- package/dist/core/loops/loop-worker-runtime.js +0 -15
- package/dist/core/loops/loop-worktree-runtime.js +52 -4
- package/dist/core/managed-assets/managed-assets-manifest.js +14 -14
- package/dist/core/naruto/hardware-capacity-probe.js +9 -6
- package/dist/core/naruto/naruto-active-pool.js +2 -14
- package/dist/core/naruto/naruto-concurrency-governor.js +71 -31
- package/dist/core/naruto/naruto-loop-worker-router.js +0 -2
- package/dist/core/naruto/naruto-verification-dag.js +0 -1
- package/dist/core/naruto/naruto-write-e2e.js +1 -2
- package/dist/core/naruto/resource-pressure-monitor.js +0 -4
- package/dist/core/observability/architecture-hardening/safe-projection.js +65 -0
- package/dist/core/perf/import-graph-budget.js +0 -1
- package/dist/core/perf/release-latency-slo.js +3 -2
- package/dist/core/preflight/parallel-preflight-engine.js +2 -15
- package/dist/core/product-design-app-server.js +13 -1
- package/dist/core/proof/fake-real-proof-policy.js +2 -17
- package/dist/core/proof/route-proof-gate.js +2 -10
- package/dist/core/proof/route-proof-policy.js +1 -1
- package/dist/core/proof/runtime-evidence-policy.js +185 -0
- package/dist/core/proof/runtime-truth-matrix.js +64 -39
- package/dist/core/proof/validation.js +27 -11
- package/dist/core/provider/provider-context.js +18 -2
- package/dist/core/providers/openrouter/openrouter-account.js +3 -2
- package/dist/core/python-tools/python-tool-runner.js +1 -1
- package/dist/core/qa-loop/qa-execution-control.js +57 -0
- package/dist/core/questions.js +1 -1
- package/dist/core/release/extreme-parallel-scheduler.js +0 -3
- package/dist/core/release/gate-manifest.js +3 -7
- package/dist/core/release/gate-pack-manifest.js +3 -7
- package/dist/core/release/package-size-budget.js +2 -2
- package/dist/core/release/physical-release-gates.js +189 -0
- package/dist/core/release/publish-preflight.js +113 -0
- package/dist/core/release/release-gate-affected-selector.js +0 -2
- package/dist/core/release/release-gate-batch-runner.js +1 -1
- package/dist/core/release/release-gate-node.js +0 -1
- package/dist/core/release/release-gate-resource-governor.js +0 -1
- package/dist/core/release/release-pack-receipt.js +5 -8
- package/dist/core/release/release-real-contract.js +0 -6
- package/dist/core/release/resource-class-budget.js +0 -1
- package/dist/core/release/stage-publish.js +178 -36
- package/dist/core/research/research-adversarial-review.js +103 -9
- package/dist/core/research.js +1 -1
- package/dist/core/retention.js +0 -1
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes/diagnostic-allowlist.js +0 -1
- package/dist/core/routes/dollar-manifest-lite.js +1 -1
- package/dist/core/routes.js +46 -15
- package/dist/core/runtime/execution-control.js +226 -0
- package/dist/core/runtime/progress-recovery/progress-recovery.js +89 -0
- package/dist/core/runtime/task-profile.js +10 -4
- package/dist/core/runtime/verification-budget.js +10 -1
- package/dist/core/safety/intent-contract/intent-contract.js +94 -0
- package/dist/core/safety/mutation-guard.js +0 -2
- package/dist/core/safety/mutation-ledger.js +0 -2
- package/dist/core/safety/requested-scope-contract.js +0 -0
- package/dist/core/search-visibility/discovery.js +1 -1
- package/dist/core/search-visibility/index.js +12 -0
- package/dist/core/search-visibility/verifier.js +112 -3
- package/dist/core/security/private-credential-file.js +209 -0
- package/dist/core/session/project-namespace.js +0 -5
- package/dist/core/skills/skill-agent-metadata.js +1 -3
- package/dist/core/strategy/adhd-orchestrating-gate.js +0 -1
- package/dist/core/subagents/agent-catalog.js +19 -34
- package/dist/core/subagents/model-policy.js +65 -24
- package/dist/core/subagents/naruto-help-contract.js +8 -8
- package/dist/core/subagents/naruto-host-credentials.js +13 -0
- package/dist/core/subagents/official-subagent-config.js +16 -6
- package/dist/core/subagents/official-subagent-preparation.js +35 -16
- package/dist/core/subagents/official-subagent-prompt.js +7 -7
- package/dist/core/subagents/official-subagent-runner.js +27 -4
- package/dist/core/subagents/role-model-preferences.js +1 -1
- package/dist/core/subagents/thread-budget.js +19 -12
- package/dist/core/subagents/wave-lifecycle.js +18 -6
- package/dist/core/telegram/access.js +58 -0
- package/dist/core/telegram/client.js +157 -0
- package/dist/core/telegram/confirmation.js +37 -0
- package/dist/core/telegram/doctor.js +154 -0
- package/dist/core/telegram/index.js +9 -0
- package/dist/core/telegram/keychain.js +317 -0
- package/dist/core/telegram/liveness.js +118 -0
- package/dist/core/telegram/poller.js +90 -0
- package/dist/core/telegram/redaction.js +15 -0
- package/dist/core/telegram/state-lock.js +416 -0
- package/dist/core/telegram/types.js +1 -0
- package/dist/core/text/strings.js +3 -0
- package/dist/core/triwiki/context-graph/store/evidence-write-lock.js +29 -0
- package/dist/core/triwiki/context-graph/store/fragment-cache.js +24 -0
- package/dist/core/triwiki/context-graph/store/snapshot-store.js +69 -21
- package/dist/core/triwiki/triwiki-gate-impact-map.js +2 -2
- package/dist/core/triwiki/triwiki-module-card.js +1 -2
- package/dist/core/update/installed-cli-resolution.js +170 -0
- package/dist/core/update/update-diagnostics.js +52 -0
- package/dist/core/update/update-migration-state.js +30 -12
- package/dist/core/update/update-operation.js +2 -1
- package/dist/core/update/update-stage-diagnostics.js +38 -0
- package/dist/core/update/update-status.js +2 -9
- package/dist/core/update-check.js +279 -91
- package/dist/core/version.js +1 -1
- package/dist/native/sks-menubar/Sources/AppDelegate.swift +19 -1
- package/dist/native/sks-menubar/Sources/AppIdentity.swift +7 -0
- package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +6 -2
- package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +159 -92
- package/dist/native/sks-menubar/Sources/OperationModels.swift +389 -0
- package/dist/native/sks-menubar/Sources/OverviewViewController.swift +57 -0
- package/dist/native/sks-menubar/Sources/ProcessClient.swift +3 -1
- package/dist/native/sks-menubar/Sources/ProvidersConnectTest.swift +115 -0
- package/dist/native/sks-menubar/Sources/ProvidersFastMode.swift +17 -0
- package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +3 -0
- package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +58 -17
- package/dist/native/sks-menubar/Sources/ProvidersReliability.swift +302 -0
- package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +5 -0
- package/dist/native/sks-menubar/Sources/ProvidersRoutingTruth.swift +190 -0
- package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +158 -126
- package/dist/native/sks-menubar/Sources/RemoteCodingViewController.swift +462 -26
- package/dist/native/sks-menubar/Sources/SKSKeychainStore.swift +344 -0
- package/dist/native/sks-menubar/Sources/SecureProcessEnvelope.swift +27 -0
- package/dist/native/sks-menubar/Sources/SingletonInstanceGuard.swift +328 -0
- package/dist/native/sks-menubar/Sources/StatusItemController.swift +10 -2
- package/dist/native/sks-menubar/Sources/TelegramPrivateFileStore.swift +498 -0
- package/dist/native/sks-menubar/Sources/TelegramPrivateFileSupport.swift +236 -0
- package/dist/native/sks-menubar/Sources/TelegramProcessGateway.swift +454 -0
- package/dist/native/sks-menubar/Sources/TelegramRuntimeSupport.swift +56 -0
- package/dist/native/sks-menubar/Sources/TelegramStateLock.swift +448 -0
- package/dist/native/sks-menubar/Sources/TelegramSupport.swift +187 -0
- package/dist/native/sks-menubar/Sources/TelegramTransport.swift +499 -0
- package/dist/native/sks-menubar/Sources/main.swift +15 -1
- package/dist/scripts/all-feature-deep-completion-check.js +5 -1
- package/dist/scripts/check-publish-tag.js +56 -0
- package/dist/scripts/codex-lb-fast-mode-truth-check.js +10 -3
- package/dist/scripts/codex-lb-fast-ui-preservation-check.js +12 -3
- package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +4 -2
- package/dist/scripts/codex-native-agent-role-content-check.js +3 -3
- package/dist/scripts/codex-native-gate-lib.js +14 -7
- package/dist/scripts/current-command-surface-check.js +7 -7
- package/dist/scripts/current-surface-update-e2e-check.js +4 -3
- package/dist/scripts/current-upgrade-matrix-check.js +5 -24
- package/dist/scripts/docs-truthfulness-check.js +17 -13
- package/dist/scripts/gate-lib.js +0 -2
- package/dist/scripts/gate-policy-audit-check.js +3 -2
- package/dist/scripts/harness-benchmark-check.js +1 -1
- package/dist/scripts/init-deep-backup-retention-check.js +1 -1
- package/dist/scripts/lib/codex-sdk-gate-lib.js +1 -2
- package/dist/scripts/loop-directive-check-lib.js +28 -38
- package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +14 -180
- package/dist/scripts/mad-sks-launch-sql-plane-boundary-check.js +2 -11
- package/dist/scripts/official-subagent-workflow-check.js +1 -1
- package/dist/scripts/packlist-performance-check.js +1 -2
- package/dist/scripts/prepublish-release-check-or-fast.js +32 -0
- package/dist/scripts/publish-preflight.js +12 -0
- package/dist/scripts/release-affected-selector-check.js +2 -2
- package/dist/scripts/release-gate-batch-runner-check.js +2 -2
- package/dist/scripts/release-metadata-check.js +8 -12
- package/dist/scripts/release-real-check.js +2 -54
- package/dist/scripts/runtime-domain-gate-lib.js +2 -96
- package/dist/scripts/runtime-proof-summary-check.js +2 -6
- package/dist/scripts/search-visibility-gate-lib.js +0 -1
- package/dist/scripts/sks-cli-gate-lib.js +1 -1
- package/dist/scripts/typed-routing-gate-lib.js +7 -59
- package/docs/demo.tape +1 -1
- package/infra-harness-gates.json +1 -1456
- package/package.json +10 -7
- package/release-gates.v2.json +0 -1
- package/schemas/agents/parallel-runtime-proof.schema.json +0 -2
- package/schemas/codex/agent-result.schema.json +0 -6
- package/schemas/naruto/naruto-concurrency-governor.schema.json +1 -3
- package/schemas/release/release-gate-node.schema.json +1 -1
- package/dist/commands/zellij-lane.js +0 -22
- package/dist/commands/zellij-monitor-pane.js +0 -26
- package/dist/commands/zellij-slot-column-anchor.js +0 -22
- package/dist/commands/zellij-slot-pane.js +0 -80
- package/dist/commands/zellij-viewport-pane.js +0 -57
- package/dist/commands/zellij.js +0 -422
- package/dist/core/agents/agent-runner-zellij.js +0 -164
- package/dist/core/agents/agent-slot-pane-binding-proof.js +0 -96
- package/dist/core/agents/parallel-write-fixture.js +0 -305
- package/dist/core/agents/worker-pane-communication-contract.js +0 -100
- package/dist/core/agents/zellij-lane-supervisor.js +0 -428
- package/dist/core/agents/zellij-right-lane-cockpit.js +0 -66
- package/dist/core/doctor/doctor-zellij-repair.js +0 -40
- package/dist/core/ops/upgrade-migration-fixtures.js +0 -119
- package/dist/core/proof/route-finalizer-fixtures.js +0 -21
- package/dist/core/zellij/homebrew-policy.js +0 -43
- package/dist/core/zellij/zellij-capability.js +0 -126
- package/dist/core/zellij/zellij-clipboard-config.js +0 -52
- package/dist/core/zellij/zellij-command.js +0 -149
- package/dist/core/zellij/zellij-fake-adapter.js +0 -186
- package/dist/core/zellij/zellij-lane-renderer.js +0 -706
- package/dist/core/zellij/zellij-lane-runtime.js +0 -189
- package/dist/core/zellij/zellij-launcher.js +0 -268
- package/dist/core/zellij/zellij-layout-builder.js +0 -191
- package/dist/core/zellij/zellij-monitor-renderer.js +0 -52
- package/dist/core/zellij/zellij-official-subagent-activity.js +0 -526
- package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -258
- package/dist/core/zellij/zellij-pane-proof.js +0 -226
- package/dist/core/zellij/zellij-right-column-manager.js +0 -308
- package/dist/core/zellij/zellij-screen-proof.js +0 -120
- package/dist/core/zellij/zellij-self-heal-types.js +0 -44
- package/dist/core/zellij/zellij-self-heal.js +0 -408
- package/dist/core/zellij/zellij-slot-column-anchor.js +0 -304
- package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -521
- package/dist/core/zellij/zellij-slot-telemetry.js +0 -384
- package/dist/core/zellij/zellij-theme.js +0 -66
- package/dist/core/zellij/zellij-ui-mode.js +0 -34
- package/dist/core/zellij/zellij-update.js +0 -348
- package/dist/core/zellij/zellij-viewport-binder.js +0 -61
- package/dist/core/zellij/zellij-worker-pane-manager.js +0 -881
- package/dist/core/zellij/zellij-worker-pane-summary.js +0 -64
- package/dist/native/sks-menubar/Tests/AppRuntimeTestSupport.swift +0 -26
- package/dist/native/sks-menubar/Tests/OperationCoordinatorTests.swift +0 -174
- package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +0 -20
- package/dist/native/sks-menubar/Tests/ProvidersViewControllerTests.swift +0 -142
- package/dist/scripts/zellij-pane-proof-check.js +0 -88
- package/dist/scripts/zellij-real-session-cleanup-check.js +0 -139
- package/dist/scripts/zellij-real-session-launch-check.js +0 -126
- package/dist/scripts/zellij-screen-proof-check.js +0 -43
- package/schemas/zellij/zellij-right-column-state.schema.json +0 -40
- package/schemas/zellij/zellij-slot-telemetry.schema.json +0 -89
- package/schemas/zellij/zellij-worker-pane.schema.json +0 -53
- package/scripts/build-clean-atomic.mjs +0 -323
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import LocalAuthentication
|
|
3
|
+
import Security
|
|
4
|
+
|
|
5
|
+
enum SKSKeychainEnvironment: String {
|
|
6
|
+
case production
|
|
7
|
+
case development
|
|
8
|
+
|
|
9
|
+
var serviceSuffix: String {
|
|
10
|
+
switch self {
|
|
11
|
+
case .production: return ""
|
|
12
|
+
case .development: return ".development"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/// Credentials owned by SKS Center. The official ChatGPT OAuth refresh token is
|
|
18
|
+
/// intentionally not copied: Codex remains its native owner and SKS only reports
|
|
19
|
+
/// the auth state returned by Codex.
|
|
20
|
+
enum SKSKeychainCredential: String, CaseIterable {
|
|
21
|
+
case codexLbApiKey
|
|
22
|
+
case openRouterApiKey
|
|
23
|
+
|
|
24
|
+
var service: String {
|
|
25
|
+
service(in: .production)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
func service(in environment: SKSKeychainEnvironment) -> String {
|
|
29
|
+
let base: String
|
|
30
|
+
switch self {
|
|
31
|
+
case .codexLbApiKey: base = "com.sneakoscope.codex-lb.api-key.v3"
|
|
32
|
+
case .openRouterApiKey: base = "com.sneakoscope.openrouter.api-key.v1"
|
|
33
|
+
}
|
|
34
|
+
return base + environment.serviceSuffix
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// Accounts never depend on the login name, machine name, install path, or
|
|
38
|
+
/// process id. This prevents a reinstall on another Mac from silently looking
|
|
39
|
+
/// under a different identity.
|
|
40
|
+
var account: String { "api-key" }
|
|
41
|
+
|
|
42
|
+
/// A stable logical access-scope marker stored with the item. The actual
|
|
43
|
+
/// Keychain access group remains the app's signing-default group because an
|
|
44
|
+
/// explicit shared group is invalid without a provisioned entitlement.
|
|
45
|
+
var accessScopeMarker: String { "com.sneakoscope.sks-menubar.credentials.v1" }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
enum SKSKeychainCredentialState: Equatable {
|
|
49
|
+
case available
|
|
50
|
+
case authenticationRequired(reason: String)
|
|
51
|
+
case unavailable(reason: String)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
enum SKSKeychainReadiness: String, Equatable {
|
|
55
|
+
case ready
|
|
56
|
+
case notFound = "not_found"
|
|
57
|
+
case locked
|
|
58
|
+
case accessDenied = "access_denied"
|
|
59
|
+
case signingMismatch = "signing_mismatch"
|
|
60
|
+
case damaged
|
|
61
|
+
case duplicate
|
|
62
|
+
case unavailable
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
extension SKSKeychainCredentialState {
|
|
66
|
+
var readiness: SKSKeychainReadiness {
|
|
67
|
+
switch self {
|
|
68
|
+
case .available:
|
|
69
|
+
return .ready
|
|
70
|
+
case .authenticationRequired(let reason):
|
|
71
|
+
if reason.contains("deleted") || reason.contains("not been registered") { return .notFound }
|
|
72
|
+
if reason.contains("locked") { return .locked }
|
|
73
|
+
if reason.contains("signing") || reason.contains("access group") { return .signingMismatch }
|
|
74
|
+
if reason.contains("damaged") { return .damaged }
|
|
75
|
+
if reason.contains("duplicate") { return .duplicate }
|
|
76
|
+
return .accessDenied
|
|
77
|
+
case .unavailable:
|
|
78
|
+
return .unavailable
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
struct SKSKeychainReadResult {
|
|
84
|
+
let state: SKSKeychainCredentialState
|
|
85
|
+
let secret: Data?
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
struct SKSKeychainWriteResult {
|
|
89
|
+
let state: SKSKeychainCredentialState
|
|
90
|
+
let stored: Bool
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
struct SKSKeychainMigrationResult {
|
|
94
|
+
let state: SKSKeychainCredentialState
|
|
95
|
+
let migrated: Bool
|
|
96
|
+
let legacyItemsFound: Int
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/// Small injectable boundary so tests can prove that restarts and background
|
|
100
|
+
/// refreshes use non-interactive reads without touching the user's Keychain.
|
|
101
|
+
protocol SKSKeychainClient {
|
|
102
|
+
func copyMatching(_ query: [String: Any]) -> (status: OSStatus, value: Any?)
|
|
103
|
+
func add(_ attributes: [String: Any]) -> OSStatus
|
|
104
|
+
func update(_ query: [String: Any], attributes: [String: Any]) -> OSStatus
|
|
105
|
+
func delete(_ query: [String: Any]) -> OSStatus
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
final class SKSSecurityKeychainClient: SKSKeychainClient {
|
|
109
|
+
func copyMatching(_ query: [String: Any]) -> (status: OSStatus, value: Any?) {
|
|
110
|
+
var result: CFTypeRef?
|
|
111
|
+
let status = SecItemCopyMatching(query as CFDictionary, &result)
|
|
112
|
+
return (status, result)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
func add(_ attributes: [String: Any]) -> OSStatus {
|
|
116
|
+
SecItemAdd(attributes as CFDictionary, nil)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
func update(_ query: [String: Any], attributes: [String: Any]) -> OSStatus {
|
|
120
|
+
SecItemUpdate(query as CFDictionary, attributes as CFDictionary)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
func delete(_ query: [String: Any]) -> OSStatus {
|
|
124
|
+
SecItemDelete(query as CFDictionary)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
final class SKSKeychainStore {
|
|
129
|
+
private let client: SKSKeychainClient
|
|
130
|
+
private let environment: SKSKeychainEnvironment
|
|
131
|
+
|
|
132
|
+
init(
|
|
133
|
+
client: SKSKeychainClient = SKSSecurityKeychainClient(),
|
|
134
|
+
environment: SKSKeychainEnvironment = .production
|
|
135
|
+
) {
|
|
136
|
+
self.client = client
|
|
137
|
+
self.environment = environment
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// Background state checks and normal runtime reads always fail closed when
|
|
141
|
+
/// Keychain would need UI. They never display an authentication dialog.
|
|
142
|
+
func readNonInteractive(_ credential: SKSKeychainCredential) -> SKSKeychainReadResult {
|
|
143
|
+
let result = client.copyMatching(readQuery(for: credential))
|
|
144
|
+
guard result.status == errSecSuccess else {
|
|
145
|
+
return SKSKeychainReadResult(state: state(for: result.status), secret: nil)
|
|
146
|
+
}
|
|
147
|
+
guard let data = result.value as? Data, !data.isEmpty else {
|
|
148
|
+
return SKSKeychainReadResult(
|
|
149
|
+
state: .authenticationRequired(reason: "credential data is damaged"),
|
|
150
|
+
secret: nil
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
return SKSKeychainReadResult(state: .available, secret: data)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
func statusNonInteractive(_ credential: SKSKeychainCredential) -> SKSKeychainCredentialState {
|
|
157
|
+
readNonInteractive(credential).state
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/// Writing is permitted only after an explicit Center action. Callers cannot
|
|
161
|
+
/// accidentally turn startup, restart, network recovery, or catalog refresh
|
|
162
|
+
/// into an authentication prompt.
|
|
163
|
+
func store(
|
|
164
|
+
_ secret: String,
|
|
165
|
+
credential: SKSKeychainCredential,
|
|
166
|
+
explicitUserAction: Bool
|
|
167
|
+
) -> SKSKeychainWriteResult {
|
|
168
|
+
guard explicitUserAction else {
|
|
169
|
+
return SKSKeychainWriteResult(
|
|
170
|
+
state: .authenticationRequired(reason: "explicit reconnect action required"),
|
|
171
|
+
stored: false
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
let trimmed = secret.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
175
|
+
guard !trimmed.isEmpty, let data = trimmed.data(using: .utf8) else {
|
|
176
|
+
return SKSKeychainWriteResult(
|
|
177
|
+
state: .authenticationRequired(reason: "credential is empty"),
|
|
178
|
+
stored: false
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
let query = identityQuery(for: credential)
|
|
183
|
+
let updateStatus = client.update(query, attributes: [
|
|
184
|
+
kSecValueData as String: data,
|
|
185
|
+
kSecAttrGeneric as String: Data(credential.accessScopeMarker.utf8),
|
|
186
|
+
kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
|
|
187
|
+
])
|
|
188
|
+
if updateStatus == errSecSuccess {
|
|
189
|
+
return SKSKeychainWriteResult(state: .available, stored: true)
|
|
190
|
+
}
|
|
191
|
+
guard updateStatus == errSecItemNotFound else {
|
|
192
|
+
return SKSKeychainWriteResult(state: state(for: updateStatus), stored: false)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
var attributes = query
|
|
196
|
+
attributes[kSecValueData as String] = data
|
|
197
|
+
attributes[kSecAttrGeneric as String] = Data(credential.accessScopeMarker.utf8)
|
|
198
|
+
attributes[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
|
|
199
|
+
let addStatus = client.add(attributes)
|
|
200
|
+
return SKSKeychainWriteResult(
|
|
201
|
+
state: addStatus == errSecSuccess ? .available : state(for: addStatus),
|
|
202
|
+
stored: addStatus == errSecSuccess
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/// Deletion is also explicit-only. Missing items are idempotently considered
|
|
207
|
+
/// removed; no user interface is invoked.
|
|
208
|
+
func delete(
|
|
209
|
+
_ credential: SKSKeychainCredential,
|
|
210
|
+
explicitUserAction: Bool
|
|
211
|
+
) -> SKSKeychainWriteResult {
|
|
212
|
+
guard explicitUserAction else {
|
|
213
|
+
return SKSKeychainWriteResult(
|
|
214
|
+
state: .authenticationRequired(reason: "explicit disconnect action required"),
|
|
215
|
+
stored: false
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
let status = client.delete(identityQuery(for: credential))
|
|
219
|
+
if status == errSecSuccess || status == errSecItemNotFound {
|
|
220
|
+
return SKSKeychainWriteResult(
|
|
221
|
+
state: .authenticationRequired(reason: "credential not stored"),
|
|
222
|
+
stored: false
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
return SKSKeychainWriteResult(state: state(for: status), stored: false)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/// Legacy items are inspected without interaction. Moving or deleting one is
|
|
229
|
+
/// permitted only from the explicit reconnect action. Ambiguous duplicates
|
|
230
|
+
/// are never guessed or removed.
|
|
231
|
+
func migrateLegacyIfNeeded(
|
|
232
|
+
_ credential: SKSKeychainCredential,
|
|
233
|
+
legacyServices: [String],
|
|
234
|
+
explicitUserAction: Bool
|
|
235
|
+
) -> SKSKeychainMigrationResult {
|
|
236
|
+
let uniqueServices = Array(Set(legacyServices.map {
|
|
237
|
+
$0.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
238
|
+
}.filter { !$0.isEmpty && $0 != credential.service(in: environment) })).sorted()
|
|
239
|
+
var candidates: [(service: String, data: Data)] = []
|
|
240
|
+
for service in uniqueServices {
|
|
241
|
+
let result = client.copyMatching(readQuery(service: service, account: credential.account))
|
|
242
|
+
if result.status == errSecItemNotFound { continue }
|
|
243
|
+
guard result.status == errSecSuccess, let data = result.value as? Data, !data.isEmpty else {
|
|
244
|
+
return SKSKeychainMigrationResult(
|
|
245
|
+
state: state(for: result.status == errSecSuccess ? errSecDecode : result.status),
|
|
246
|
+
migrated: false,
|
|
247
|
+
legacyItemsFound: candidates.count
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
candidates.append((service, data))
|
|
251
|
+
}
|
|
252
|
+
if candidates.count > 1 {
|
|
253
|
+
return SKSKeychainMigrationResult(
|
|
254
|
+
state: .authenticationRequired(reason: "duplicate legacy credentials require explicit conflict resolution"),
|
|
255
|
+
migrated: false,
|
|
256
|
+
legacyItemsFound: candidates.count
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
guard let candidate = candidates.first else {
|
|
260
|
+
return SKSKeychainMigrationResult(
|
|
261
|
+
state: .authenticationRequired(reason: "credential was deleted or has not been registered"),
|
|
262
|
+
migrated: false,
|
|
263
|
+
legacyItemsFound: 0
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
guard explicitUserAction else {
|
|
267
|
+
return SKSKeychainMigrationResult(
|
|
268
|
+
state: .authenticationRequired(reason: "explicit reconnect action required for legacy migration"),
|
|
269
|
+
migrated: false,
|
|
270
|
+
legacyItemsFound: 1
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
guard let secret = String(data: candidate.data, encoding: .utf8) else {
|
|
274
|
+
return SKSKeychainMigrationResult(
|
|
275
|
+
state: .authenticationRequired(reason: "credential data is damaged"),
|
|
276
|
+
migrated: false,
|
|
277
|
+
legacyItemsFound: 1
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
let stored = store(secret, credential: credential, explicitUserAction: true)
|
|
281
|
+
guard stored.stored else {
|
|
282
|
+
return SKSKeychainMigrationResult(state: stored.state, migrated: false, legacyItemsFound: 1)
|
|
283
|
+
}
|
|
284
|
+
let deleted = client.delete(identityQuery(service: candidate.service, account: credential.account))
|
|
285
|
+
guard deleted == errSecSuccess || deleted == errSecItemNotFound else {
|
|
286
|
+
return SKSKeychainMigrationResult(state: state(for: deleted), migrated: false, legacyItemsFound: 1)
|
|
287
|
+
}
|
|
288
|
+
return SKSKeychainMigrationResult(state: .available, migrated: true, legacyItemsFound: 1)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
private func identityQuery(for credential: SKSKeychainCredential) -> [String: Any] {
|
|
292
|
+
identityQuery(service: credential.service(in: environment), account: credential.account)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
private func identityQuery(service: String, account: String) -> [String: Any] {
|
|
296
|
+
[
|
|
297
|
+
kSecClass as String: kSecClassGenericPassword,
|
|
298
|
+
kSecAttrService as String: service,
|
|
299
|
+
kSecAttrAccount as String: account,
|
|
300
|
+
kSecAttrSynchronizable as String: false
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
private func readQuery(for credential: SKSKeychainCredential) -> [String: Any] {
|
|
305
|
+
var query = identityQuery(for: credential)
|
|
306
|
+
let authenticationContext = LAContext()
|
|
307
|
+
authenticationContext.interactionNotAllowed = true
|
|
308
|
+
query[kSecReturnData as String] = true
|
|
309
|
+
query[kSecMatchLimit as String] = kSecMatchLimitOne
|
|
310
|
+
query[kSecUseAuthenticationContext as String] = authenticationContext
|
|
311
|
+
return query
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
private func readQuery(service: String, account: String) -> [String: Any] {
|
|
315
|
+
var query = identityQuery(service: service, account: account)
|
|
316
|
+
let authenticationContext = LAContext()
|
|
317
|
+
authenticationContext.interactionNotAllowed = true
|
|
318
|
+
query[kSecReturnData as String] = true
|
|
319
|
+
query[kSecMatchLimit as String] = kSecMatchLimitOne
|
|
320
|
+
query[kSecUseAuthenticationContext as String] = authenticationContext
|
|
321
|
+
return query
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
private func state(for status: OSStatus) -> SKSKeychainCredentialState {
|
|
325
|
+
switch status {
|
|
326
|
+
case errSecItemNotFound:
|
|
327
|
+
return .authenticationRequired(reason: "credential was deleted or has not been registered")
|
|
328
|
+
case errSecInteractionNotAllowed:
|
|
329
|
+
return .authenticationRequired(reason: "Keychain is locked or access requires explicit reconnection")
|
|
330
|
+
case errSecAuthFailed:
|
|
331
|
+
return .authenticationRequired(reason: "Keychain access control rejected this app identity")
|
|
332
|
+
case errSecMissingEntitlement:
|
|
333
|
+
return .authenticationRequired(reason: "app signing or Keychain access group does not match")
|
|
334
|
+
case errSecDecode:
|
|
335
|
+
return .authenticationRequired(reason: "credential data is damaged")
|
|
336
|
+
case errSecDuplicateItem:
|
|
337
|
+
return .authenticationRequired(reason: "duplicate credentials require explicit conflict resolution")
|
|
338
|
+
case errSecNotAvailable:
|
|
339
|
+
return .unavailable(reason: "Keychain service is unavailable")
|
|
340
|
+
default:
|
|
341
|
+
return .unavailable(reason: "Keychain error \(status)")
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
@@ -30,6 +30,31 @@ enum SecureProcessEnvelope {
|
|
|
30
30
|
for (key, recoveryValue) in recoveryFields(from: object) {
|
|
31
31
|
envelope[key] = recoveryValue
|
|
32
32
|
}
|
|
33
|
+
if sourceSchema == "sks.telegram-setup-command.v1" {
|
|
34
|
+
for key in [
|
|
35
|
+
"getme_verified", "token_stored", "partial_success",
|
|
36
|
+
"storage_attempted", "webhook_removed", "pending_updates_dropped",
|
|
37
|
+
"bot_rotated", "bot_state_reset", "restart_required"
|
|
38
|
+
] {
|
|
39
|
+
if let value = object[key] as? Bool { envelope[key] = value }
|
|
40
|
+
}
|
|
41
|
+
if let source = object["token_source"] as? String,
|
|
42
|
+
["env", "user_secret_file", "none", "unchanged"].contains(source) {
|
|
43
|
+
envelope["token_source"] = source
|
|
44
|
+
}
|
|
45
|
+
if let action = boundedString(object["operator_action"], limit: 480) {
|
|
46
|
+
envelope["operator_action"] = action
|
|
47
|
+
}
|
|
48
|
+
if let recovery = object["recovery"] as? [String: Any] {
|
|
49
|
+
var publicRecovery: [String: String] = [:]
|
|
50
|
+
for key in ["action", "command", "note"] {
|
|
51
|
+
if let value = boundedString(recovery[key], limit: 480) {
|
|
52
|
+
publicRecovery[key] = value
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if !publicRecovery.isEmpty { envelope["recovery"] = publicRecovery }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
60
|
if !secureOk, envelope["error"] == nil {
|
|
@@ -64,6 +89,8 @@ enum SecureProcessEnvelope {
|
|
|
64
89
|
case ("codex-app", "set-openrouter-key"),
|
|
65
90
|
("codex-app", "openrouter-key"):
|
|
66
91
|
return ["sks.codex-app-openrouter-key.v1"]
|
|
92
|
+
case ("telegram", "setup"):
|
|
93
|
+
return ["sks.telegram-setup-command.v1"]
|
|
67
94
|
default:
|
|
68
95
|
return []
|
|
69
96
|
}
|