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.
Files changed (376) hide show
  1. package/README.md +150 -37
  2. package/config/skills-hash-ledger.v1.json +1 -1
  3. package/crates/sks-core/Cargo.lock +1 -1
  4. package/crates/sks-core/Cargo.toml +1 -1
  5. package/dist/bin/fast-inline.js +55 -27
  6. package/dist/bin/install.js +6 -32
  7. package/dist/bin/sks-dispatch.js +1 -1
  8. package/dist/cli/args.js +0 -2
  9. package/dist/cli/cli-theme.js +18 -9
  10. package/dist/cli/command-manifest-lite.js +6 -6
  11. package/dist/cli/command-registry.js +6 -6
  12. package/dist/cli/feature-commands.js +9 -7
  13. package/dist/cli/install-helpers-codex-lb-chain.js +198 -7
  14. package/dist/cli/install-helpers-codex-lb-config.js +78 -10
  15. package/dist/cli/install-helpers-install-support.js +9 -6
  16. package/dist/cli/install-helpers.js +101 -49
  17. package/dist/cli/install-tool-helpers.js +2 -82
  18. package/dist/cli/output.js +6 -1
  19. package/dist/cli/router.js +101 -2
  20. package/dist/commands/codex-lb.js +119 -19
  21. package/dist/commands/doctor-profile.js +1 -1
  22. package/dist/commands/doctor.js +727 -144
  23. package/dist/commands/mad-sks.js +1 -5
  24. package/dist/config/skills-manifest.json +4 -2
  25. package/dist/core/agents/agent-codex-cockpit.js +0 -3
  26. package/dist/core/agents/agent-effort-policy.js +5 -5
  27. package/dist/core/agents/agent-janitor.js +0 -20
  28. package/dist/core/agents/agent-orchestrator.js +9 -56
  29. package/dist/core/agents/agent-output-validator.js +2 -3
  30. package/dist/core/agents/agent-patch-schema.js +2 -2
  31. package/dist/core/agents/agent-proof-evidence.js +0 -65
  32. package/dist/core/agents/agent-recursion-guard.js +1 -1
  33. package/dist/core/agents/agent-runner-codex-exec.js +5 -3
  34. package/dist/core/agents/agent-scheduler.js +327 -85
  35. package/dist/core/agents/agent-schema.js +1 -1
  36. package/dist/core/agents/agent-trust-report.js +0 -36
  37. package/dist/core/agents/agent-worker-pipeline.js +0 -1
  38. package/dist/core/agents/fast-mode-policy.js +1 -3
  39. package/dist/core/agents/native-cli-worker-runtime-proof.js +1 -1
  40. package/dist/core/agents/native-cli-worker-runtime.js +69 -647
  41. package/dist/core/agents/native-cli-worker.js +6 -7
  42. package/dist/core/agents/native-worker-backend-router.js +2 -32
  43. package/dist/core/agents/no-subagent-scaling-policy.js +1 -1
  44. package/dist/core/agents/parallel-runtime-proof.js +1 -6
  45. package/dist/core/agents/runtime-proof-summary.js +1 -35
  46. package/dist/core/architecture-hardening/contracts/contracts.js +193 -0
  47. package/dist/core/architecture-hardening/migration/migration.js +111 -0
  48. package/dist/core/architecture-hardening/state/state-service.js +155 -0
  49. package/dist/core/artifact-schemas.js +0 -3
  50. package/dist/core/codex/codex-config-guard.js +238 -52
  51. package/dist/core/codex-adapter.js +5 -3
  52. package/dist/core/codex-app/auxiliary-oauth-policy.js +36 -0
  53. package/dist/core/codex-app/catalog-compat/catalog-service.js +104 -0
  54. package/dist/core/codex-app/child-policy/child-policy.js +35 -0
  55. package/dist/core/codex-app/codex-app-handoff.js +0 -1
  56. package/dist/core/codex-app/codex-hook-lifecycle.js +1 -1
  57. package/dist/core/codex-app/codex-init-deep.js +1 -1
  58. package/dist/core/codex-app/menubar/app-bundle.js +2 -0
  59. package/dist/core/codex-app/menubar/constants.js +14 -1
  60. package/dist/core/codex-app/menubar/global-install.js +288 -0
  61. package/dist/core/codex-app/menubar/installer.js +79 -14
  62. package/dist/core/codex-app/menubar/launch-agent.js +267 -45
  63. package/dist/core/codex-app/menubar/paths.js +3 -0
  64. package/dist/core/codex-app/menubar/rollback.js +55 -7
  65. package/dist/core/codex-app/menubar/status.js +75 -4
  66. package/dist/core/codex-app/provider-child-policy.js +64 -0
  67. package/dist/core/codex-app/provider-mode.js +91 -0
  68. package/dist/core/codex-app/provider-operation-stages.js +20 -0
  69. package/dist/core/codex-app/provider-session-policy.js +85 -0
  70. package/dist/core/codex-app/session-policy/session-pinning.js +68 -0
  71. package/dist/core/codex-app.js +3 -2
  72. package/dist/core/codex-control/codex-0139-image-path-real-probe.js +3 -1
  73. package/dist/core/codex-control/codex-0139-web-search-probe.js +3 -1
  74. package/dist/core/codex-control/codex-app-server-runtime-env.js +13 -4
  75. package/dist/core/codex-control/codex-app-server-v2-client.js +3 -3
  76. package/dist/core/codex-control/codex-control-proof.js +0 -1
  77. package/dist/core/codex-control/codex-task-runner.js +1 -4
  78. package/dist/core/codex-exec-output-schema.js +4 -1
  79. package/dist/core/codex-lb/codex-lb-env.js +63 -72
  80. package/dist/core/codex-lb/codex-lb-setup.js +15 -2
  81. package/dist/core/codex-lb/desktop-bridge/header-policy.js +6 -0
  82. package/dist/core/codex-lb/desktop-bridge/http-forward.js +48 -6
  83. package/dist/core/codex-lb/desktop-bridge/security.js +134 -0
  84. package/dist/core/codex-lb/desktop-bridge/server.js +9 -3
  85. package/dist/core/codex-lb/desktop-bridge/state.js +26 -6
  86. package/dist/core/codex-lb/desktop-bridge/types.js +1 -0
  87. package/dist/core/codex-lb/desktop-center-credentials.js +517 -58
  88. package/dist/core/codex-lb/desktop-controller.js +177 -56
  89. package/dist/core/codex-lb/desktop-service.js +179 -40
  90. package/dist/core/codex-lb/legacy-migration.js +1 -3
  91. package/dist/core/codex-lb/native-openai-transport/transport.js +68 -0
  92. package/dist/core/codex-lb/probes/cli-image-tool-probe.js +1 -1
  93. package/dist/core/codex-lb/provider-routing/provider-router.js +58 -0
  94. package/dist/core/codex-lb/routing-truth.js +327 -0
  95. package/dist/core/codex-native/codex-native-feature-broker.js +4 -0
  96. package/dist/core/codex-native/codex-native-pattern-analysis.js +1 -2
  97. package/dist/core/codex-native/core-skill-manifest.js +1 -1
  98. package/dist/core/codex-plugins/codex-plugin-json.js +26 -6
  99. package/dist/core/codex-plugins/codex-plugin-repair.js +32 -6
  100. package/dist/core/commands/basic-cli.js +9 -7
  101. package/dist/core/commands/computer-use-command.js +1 -1
  102. package/dist/core/commands/image-ux-review-command.js +16 -9
  103. package/dist/core/commands/install-package-command.js +105 -0
  104. package/dist/core/commands/intent-normalization/normalizer.js +96 -0
  105. package/dist/core/commands/mad-sks-command.js +23 -274
  106. package/dist/core/commands/mad-sks-headless.js +11 -30
  107. package/dist/core/commands/naruto-command.js +0 -25
  108. package/dist/core/commands/qa-loop-command.js +104 -22
  109. package/dist/core/commands/remote-command.js +2 -2
  110. package/dist/core/commands/research-command.js +10 -5
  111. package/dist/core/commands/telegram-command.js +407 -0
  112. package/dist/core/config-adopt/config-adopt-command.js +35 -0
  113. package/dist/core/config-adopt/config-adopt.js +346 -0
  114. package/dist/core/config-adopt/index.js +3 -0
  115. package/dist/core/doctor/command-alias-cleanup.js +4 -1
  116. package/dist/core/doctor/current-project-guidance-nested.js +37 -6
  117. package/dist/core/doctor/current-project-guidance.js +15 -9
  118. package/dist/core/doctor/doctor-dirty-planner.js +1 -4
  119. package/dist/core/doctor/doctor-readiness-matrix.js +15 -18
  120. package/dist/core/doctor/retired-managed-residue-private.js +4 -3
  121. package/dist/core/doctor/retired-managed-residue-runtime.js +2 -2
  122. package/dist/core/doctor/skill-legacy-surface.js +11 -10
  123. package/dist/core/doctor/sks-menubar-doctor.js +4 -0
  124. package/dist/core/evaluation.js +0 -19
  125. package/dist/core/evidence/v2/evidence-key.js +105 -0
  126. package/dist/core/feature-fixtures.js +12 -7
  127. package/dist/core/feature-registry.js +52 -21
  128. package/dist/core/hooks-runtime/hook-context.js +9 -0
  129. package/dist/core/hooks-runtime/managed-skill-admission.js +54 -4
  130. package/dist/core/hooks-runtime/official-subagent-lifecycle.js +69 -52
  131. package/dist/core/hooks-runtime/stop-finalization.js +226 -0
  132. package/dist/core/hooks-runtime/stop-repeat-guard.js +21 -2
  133. package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +2 -2
  134. package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +3 -3
  135. package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +43 -5
  136. package/dist/core/hooks-runtime/subagent-skill-availability.js +64 -30
  137. package/dist/core/hooks-runtime/subagent-stop-hook.js +15 -2
  138. package/dist/core/hooks-runtime.js +179 -212
  139. package/dist/core/image/reference-evidence/reference-registry.js +145 -0
  140. package/dist/core/image-ux-review/imagegen-adapter.js +21 -9
  141. package/dist/core/image-ux-review/reference-policy/reference-policy.js +9 -0
  142. package/dist/core/imagegen/codex-lb-imagegen-target.js +8 -0
  143. package/dist/core/imagegen/imagegen-capability.js +59 -2
  144. package/dist/core/imagegen/require-imagegen.js +2 -2
  145. package/dist/core/init/skills.js +17 -3
  146. package/dist/core/init.js +3 -3
  147. package/dist/core/install/installed-package-smoke.js +23 -5
  148. package/dist/core/json/canonical.js +9 -0
  149. package/dist/core/locks/file-lock.js +0 -1
  150. package/dist/core/loops/loop-continuation-enforcer.js +65 -7
  151. package/dist/core/loops/loop-decomposer.js +0 -1
  152. package/dist/core/loops/loop-gate-runner.js +65 -4
  153. package/dist/core/loops/loop-gate-selector.js +0 -2
  154. package/dist/core/loops/loop-proof-validation.js +38 -0
  155. package/dist/core/loops/loop-risk-classifier.js +1 -1
  156. package/dist/core/loops/loop-runtime.js +14 -2
  157. package/dist/core/loops/loop-scheduler.js +7 -2
  158. package/dist/core/loops/loop-worker-runtime.js +0 -15
  159. package/dist/core/loops/loop-worktree-runtime.js +52 -4
  160. package/dist/core/managed-assets/managed-assets-manifest.js +14 -14
  161. package/dist/core/naruto/hardware-capacity-probe.js +9 -6
  162. package/dist/core/naruto/naruto-active-pool.js +2 -14
  163. package/dist/core/naruto/naruto-concurrency-governor.js +71 -31
  164. package/dist/core/naruto/naruto-loop-worker-router.js +0 -2
  165. package/dist/core/naruto/naruto-verification-dag.js +0 -1
  166. package/dist/core/naruto/naruto-write-e2e.js +1 -2
  167. package/dist/core/naruto/resource-pressure-monitor.js +0 -4
  168. package/dist/core/observability/architecture-hardening/safe-projection.js +65 -0
  169. package/dist/core/perf/import-graph-budget.js +0 -1
  170. package/dist/core/perf/release-latency-slo.js +3 -2
  171. package/dist/core/preflight/parallel-preflight-engine.js +2 -15
  172. package/dist/core/product-design-app-server.js +13 -1
  173. package/dist/core/proof/fake-real-proof-policy.js +2 -17
  174. package/dist/core/proof/route-proof-gate.js +2 -10
  175. package/dist/core/proof/route-proof-policy.js +1 -1
  176. package/dist/core/proof/runtime-evidence-policy.js +185 -0
  177. package/dist/core/proof/runtime-truth-matrix.js +64 -39
  178. package/dist/core/proof/validation.js +27 -11
  179. package/dist/core/provider/provider-context.js +18 -2
  180. package/dist/core/providers/openrouter/openrouter-account.js +3 -2
  181. package/dist/core/python-tools/python-tool-runner.js +1 -1
  182. package/dist/core/qa-loop/qa-execution-control.js +57 -0
  183. package/dist/core/questions.js +1 -1
  184. package/dist/core/release/extreme-parallel-scheduler.js +0 -3
  185. package/dist/core/release/gate-manifest.js +3 -7
  186. package/dist/core/release/gate-pack-manifest.js +3 -7
  187. package/dist/core/release/package-size-budget.js +2 -2
  188. package/dist/core/release/physical-release-gates.js +189 -0
  189. package/dist/core/release/publish-preflight.js +113 -0
  190. package/dist/core/release/release-gate-affected-selector.js +0 -2
  191. package/dist/core/release/release-gate-batch-runner.js +1 -1
  192. package/dist/core/release/release-gate-node.js +0 -1
  193. package/dist/core/release/release-gate-resource-governor.js +0 -1
  194. package/dist/core/release/release-pack-receipt.js +5 -8
  195. package/dist/core/release/release-real-contract.js +0 -6
  196. package/dist/core/release/resource-class-budget.js +0 -1
  197. package/dist/core/release/stage-publish.js +178 -36
  198. package/dist/core/research/research-adversarial-review.js +103 -9
  199. package/dist/core/research.js +1 -1
  200. package/dist/core/retention.js +0 -1
  201. package/dist/core/routes/constants.js +1 -1
  202. package/dist/core/routes/diagnostic-allowlist.js +0 -1
  203. package/dist/core/routes/dollar-manifest-lite.js +1 -1
  204. package/dist/core/routes.js +46 -15
  205. package/dist/core/runtime/execution-control.js +226 -0
  206. package/dist/core/runtime/progress-recovery/progress-recovery.js +89 -0
  207. package/dist/core/runtime/task-profile.js +10 -4
  208. package/dist/core/runtime/verification-budget.js +10 -1
  209. package/dist/core/safety/intent-contract/intent-contract.js +94 -0
  210. package/dist/core/safety/mutation-guard.js +0 -2
  211. package/dist/core/safety/mutation-ledger.js +0 -2
  212. package/dist/core/safety/requested-scope-contract.js +0 -0
  213. package/dist/core/search-visibility/discovery.js +1 -1
  214. package/dist/core/search-visibility/index.js +12 -0
  215. package/dist/core/search-visibility/verifier.js +112 -3
  216. package/dist/core/security/private-credential-file.js +209 -0
  217. package/dist/core/session/project-namespace.js +0 -5
  218. package/dist/core/skills/skill-agent-metadata.js +1 -3
  219. package/dist/core/strategy/adhd-orchestrating-gate.js +0 -1
  220. package/dist/core/subagents/agent-catalog.js +19 -34
  221. package/dist/core/subagents/model-policy.js +65 -24
  222. package/dist/core/subagents/naruto-help-contract.js +8 -8
  223. package/dist/core/subagents/naruto-host-credentials.js +13 -0
  224. package/dist/core/subagents/official-subagent-config.js +16 -6
  225. package/dist/core/subagents/official-subagent-preparation.js +35 -16
  226. package/dist/core/subagents/official-subagent-prompt.js +7 -7
  227. package/dist/core/subagents/official-subagent-runner.js +27 -4
  228. package/dist/core/subagents/role-model-preferences.js +1 -1
  229. package/dist/core/subagents/thread-budget.js +19 -12
  230. package/dist/core/subagents/wave-lifecycle.js +18 -6
  231. package/dist/core/telegram/access.js +58 -0
  232. package/dist/core/telegram/client.js +157 -0
  233. package/dist/core/telegram/confirmation.js +37 -0
  234. package/dist/core/telegram/doctor.js +154 -0
  235. package/dist/core/telegram/index.js +9 -0
  236. package/dist/core/telegram/keychain.js +317 -0
  237. package/dist/core/telegram/liveness.js +118 -0
  238. package/dist/core/telegram/poller.js +90 -0
  239. package/dist/core/telegram/redaction.js +15 -0
  240. package/dist/core/telegram/state-lock.js +416 -0
  241. package/dist/core/telegram/types.js +1 -0
  242. package/dist/core/text/strings.js +3 -0
  243. package/dist/core/triwiki/context-graph/store/evidence-write-lock.js +29 -0
  244. package/dist/core/triwiki/context-graph/store/fragment-cache.js +24 -0
  245. package/dist/core/triwiki/context-graph/store/snapshot-store.js +69 -21
  246. package/dist/core/triwiki/triwiki-gate-impact-map.js +2 -2
  247. package/dist/core/triwiki/triwiki-module-card.js +1 -2
  248. package/dist/core/update/installed-cli-resolution.js +170 -0
  249. package/dist/core/update/update-diagnostics.js +52 -0
  250. package/dist/core/update/update-migration-state.js +30 -12
  251. package/dist/core/update/update-operation.js +2 -1
  252. package/dist/core/update/update-stage-diagnostics.js +38 -0
  253. package/dist/core/update/update-status.js +2 -9
  254. package/dist/core/update-check.js +279 -91
  255. package/dist/core/version.js +1 -1
  256. package/dist/native/sks-menubar/Sources/AppDelegate.swift +19 -1
  257. package/dist/native/sks-menubar/Sources/AppIdentity.swift +7 -0
  258. package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +6 -2
  259. package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +159 -92
  260. package/dist/native/sks-menubar/Sources/OperationModels.swift +389 -0
  261. package/dist/native/sks-menubar/Sources/OverviewViewController.swift +57 -0
  262. package/dist/native/sks-menubar/Sources/ProcessClient.swift +3 -1
  263. package/dist/native/sks-menubar/Sources/ProvidersConnectTest.swift +115 -0
  264. package/dist/native/sks-menubar/Sources/ProvidersFastMode.swift +17 -0
  265. package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +3 -0
  266. package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +58 -17
  267. package/dist/native/sks-menubar/Sources/ProvidersReliability.swift +302 -0
  268. package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +5 -0
  269. package/dist/native/sks-menubar/Sources/ProvidersRoutingTruth.swift +190 -0
  270. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +158 -126
  271. package/dist/native/sks-menubar/Sources/RemoteCodingViewController.swift +462 -26
  272. package/dist/native/sks-menubar/Sources/SKSKeychainStore.swift +344 -0
  273. package/dist/native/sks-menubar/Sources/SecureProcessEnvelope.swift +27 -0
  274. package/dist/native/sks-menubar/Sources/SingletonInstanceGuard.swift +328 -0
  275. package/dist/native/sks-menubar/Sources/StatusItemController.swift +10 -2
  276. package/dist/native/sks-menubar/Sources/TelegramPrivateFileStore.swift +498 -0
  277. package/dist/native/sks-menubar/Sources/TelegramPrivateFileSupport.swift +236 -0
  278. package/dist/native/sks-menubar/Sources/TelegramProcessGateway.swift +454 -0
  279. package/dist/native/sks-menubar/Sources/TelegramRuntimeSupport.swift +56 -0
  280. package/dist/native/sks-menubar/Sources/TelegramStateLock.swift +448 -0
  281. package/dist/native/sks-menubar/Sources/TelegramSupport.swift +187 -0
  282. package/dist/native/sks-menubar/Sources/TelegramTransport.swift +499 -0
  283. package/dist/native/sks-menubar/Sources/main.swift +15 -1
  284. package/dist/scripts/all-feature-deep-completion-check.js +5 -1
  285. package/dist/scripts/check-publish-tag.js +56 -0
  286. package/dist/scripts/codex-lb-fast-mode-truth-check.js +10 -3
  287. package/dist/scripts/codex-lb-fast-ui-preservation-check.js +12 -3
  288. package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +4 -2
  289. package/dist/scripts/codex-native-agent-role-content-check.js +3 -3
  290. package/dist/scripts/codex-native-gate-lib.js +14 -7
  291. package/dist/scripts/current-command-surface-check.js +7 -7
  292. package/dist/scripts/current-surface-update-e2e-check.js +4 -3
  293. package/dist/scripts/current-upgrade-matrix-check.js +5 -24
  294. package/dist/scripts/docs-truthfulness-check.js +17 -13
  295. package/dist/scripts/gate-lib.js +0 -2
  296. package/dist/scripts/gate-policy-audit-check.js +3 -2
  297. package/dist/scripts/harness-benchmark-check.js +1 -1
  298. package/dist/scripts/init-deep-backup-retention-check.js +1 -1
  299. package/dist/scripts/lib/codex-sdk-gate-lib.js +1 -2
  300. package/dist/scripts/loop-directive-check-lib.js +28 -38
  301. package/dist/scripts/mad-sks-app-ui-no-mutation-check.js +14 -180
  302. package/dist/scripts/mad-sks-launch-sql-plane-boundary-check.js +2 -11
  303. package/dist/scripts/official-subagent-workflow-check.js +1 -1
  304. package/dist/scripts/packlist-performance-check.js +1 -2
  305. package/dist/scripts/prepublish-release-check-or-fast.js +32 -0
  306. package/dist/scripts/publish-preflight.js +12 -0
  307. package/dist/scripts/release-affected-selector-check.js +2 -2
  308. package/dist/scripts/release-gate-batch-runner-check.js +2 -2
  309. package/dist/scripts/release-metadata-check.js +8 -12
  310. package/dist/scripts/release-real-check.js +2 -54
  311. package/dist/scripts/runtime-domain-gate-lib.js +2 -96
  312. package/dist/scripts/runtime-proof-summary-check.js +2 -6
  313. package/dist/scripts/search-visibility-gate-lib.js +0 -1
  314. package/dist/scripts/sks-cli-gate-lib.js +1 -1
  315. package/dist/scripts/typed-routing-gate-lib.js +7 -59
  316. package/docs/demo.tape +1 -1
  317. package/infra-harness-gates.json +1 -1456
  318. package/package.json +10 -7
  319. package/release-gates.v2.json +0 -1
  320. package/schemas/agents/parallel-runtime-proof.schema.json +0 -2
  321. package/schemas/codex/agent-result.schema.json +0 -6
  322. package/schemas/naruto/naruto-concurrency-governor.schema.json +1 -3
  323. package/schemas/release/release-gate-node.schema.json +1 -1
  324. package/dist/commands/zellij-lane.js +0 -22
  325. package/dist/commands/zellij-monitor-pane.js +0 -26
  326. package/dist/commands/zellij-slot-column-anchor.js +0 -22
  327. package/dist/commands/zellij-slot-pane.js +0 -80
  328. package/dist/commands/zellij-viewport-pane.js +0 -57
  329. package/dist/commands/zellij.js +0 -422
  330. package/dist/core/agents/agent-runner-zellij.js +0 -164
  331. package/dist/core/agents/agent-slot-pane-binding-proof.js +0 -96
  332. package/dist/core/agents/parallel-write-fixture.js +0 -305
  333. package/dist/core/agents/worker-pane-communication-contract.js +0 -100
  334. package/dist/core/agents/zellij-lane-supervisor.js +0 -428
  335. package/dist/core/agents/zellij-right-lane-cockpit.js +0 -66
  336. package/dist/core/doctor/doctor-zellij-repair.js +0 -40
  337. package/dist/core/ops/upgrade-migration-fixtures.js +0 -119
  338. package/dist/core/proof/route-finalizer-fixtures.js +0 -21
  339. package/dist/core/zellij/homebrew-policy.js +0 -43
  340. package/dist/core/zellij/zellij-capability.js +0 -126
  341. package/dist/core/zellij/zellij-clipboard-config.js +0 -52
  342. package/dist/core/zellij/zellij-command.js +0 -149
  343. package/dist/core/zellij/zellij-fake-adapter.js +0 -186
  344. package/dist/core/zellij/zellij-lane-renderer.js +0 -706
  345. package/dist/core/zellij/zellij-lane-runtime.js +0 -189
  346. package/dist/core/zellij/zellij-launcher.js +0 -268
  347. package/dist/core/zellij/zellij-layout-builder.js +0 -191
  348. package/dist/core/zellij/zellij-monitor-renderer.js +0 -52
  349. package/dist/core/zellij/zellij-official-subagent-activity.js +0 -526
  350. package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -258
  351. package/dist/core/zellij/zellij-pane-proof.js +0 -226
  352. package/dist/core/zellij/zellij-right-column-manager.js +0 -308
  353. package/dist/core/zellij/zellij-screen-proof.js +0 -120
  354. package/dist/core/zellij/zellij-self-heal-types.js +0 -44
  355. package/dist/core/zellij/zellij-self-heal.js +0 -408
  356. package/dist/core/zellij/zellij-slot-column-anchor.js +0 -304
  357. package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -521
  358. package/dist/core/zellij/zellij-slot-telemetry.js +0 -384
  359. package/dist/core/zellij/zellij-theme.js +0 -66
  360. package/dist/core/zellij/zellij-ui-mode.js +0 -34
  361. package/dist/core/zellij/zellij-update.js +0 -348
  362. package/dist/core/zellij/zellij-viewport-binder.js +0 -61
  363. package/dist/core/zellij/zellij-worker-pane-manager.js +0 -881
  364. package/dist/core/zellij/zellij-worker-pane-summary.js +0 -64
  365. package/dist/native/sks-menubar/Tests/AppRuntimeTestSupport.swift +0 -26
  366. package/dist/native/sks-menubar/Tests/OperationCoordinatorTests.swift +0 -174
  367. package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +0 -20
  368. package/dist/native/sks-menubar/Tests/ProvidersViewControllerTests.swift +0 -142
  369. package/dist/scripts/zellij-pane-proof-check.js +0 -88
  370. package/dist/scripts/zellij-real-session-cleanup-check.js +0 -139
  371. package/dist/scripts/zellij-real-session-launch-check.js +0 -126
  372. package/dist/scripts/zellij-screen-proof-check.js +0 -43
  373. package/schemas/zellij/zellij-right-column-state.schema.json +0 -40
  374. package/schemas/zellij/zellij-slot-telemetry.schema.json +0 -89
  375. package/schemas/zellij/zellij-worker-pane.schema.json +0 -53
  376. package/scripts/build-clean-atomic.mjs +0 -323
@@ -1,14 +1,10 @@
1
1
  import { madHighCommand } from '../core/commands/mad-sks-command.js';
2
- import { ensureMadLaunchDependencies, formatMadLaunchDependencyAction, maybePromptCodexUpdateForLaunch, maybePromptCodexLbSetupForLaunch, maybePromptSksUpdateForLaunch } from '../cli/install-helpers.js';
3
- import { maybePromptZellijUpdateForLaunch } from '../core/zellij/zellij-update.js';
2
+ import { maybePromptCodexUpdateForLaunch, maybePromptCodexLbSetupForLaunch, maybePromptSksUpdateForLaunch } from '../cli/install-helpers.js';
4
3
  import { PACKAGE_VERSION } from '../core/fsx.js';
5
4
  export async function run(_command, args = []) {
6
5
  return madHighCommand(['--mad-sks', ...args], {
7
6
  maybePromptSksUpdateForLaunch,
8
7
  maybePromptCodexUpdateForLaunch,
9
- maybePromptZellijUpdateForLaunch,
10
- ensureMadLaunchDependencies,
11
- printDepsInstallAction: (action) => console.error(formatMadLaunchDependencyAction(action)),
12
8
  maybePromptCodexLbSetupForLaunch,
13
9
  packageVersion: PACKAGE_VERSION
14
10
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "sks.skills-manifest.v1",
3
- "package_version": "8.0.2",
3
+ "package_version": "8.0.4",
4
4
  "skills": [
5
5
  {
6
6
  "canonical_name": "sks",
@@ -326,8 +326,10 @@
326
326
  {
327
327
  "canonical_name": "sks-naruto",
328
328
  "type": "core",
329
- "content_sha256": "f8e808622e222b4ad7dcb2907e5f06a890db83139ae443ec6c8c33781dfa3e37",
329
+ "content_sha256": "d0d5968e78ac25e1d3e588735de1ddbcf149cfb3165edebca5dec1ed7c7a5c46",
330
330
  "hash_history": [
331
+ "34222c72e4e1ead3584907f4d905444b7de820283ee7348018f110d5e6b04461",
332
+ "f8e808622e222b4ad7dcb2907e5f06a890db83139ae443ec6c8c33781dfa3e37",
331
333
  "49b5e3dcc1b537b49c2cf09e5b875cb16acb05c622b22798e265e64dacd8ac90"
332
334
  ],
333
335
  "deprecated_aliases": []
@@ -28,7 +28,6 @@ export async function buildAgentCodexCockpitState(missionDir, opts = {}) {
28
28
  const namespace = await readJson(path.join(missionDir, 'project-session-namespace.json'), null);
29
29
  const sourceIntelligence = await readJson(path.join(missionDir, 'source-intelligence-evidence.json'), null);
30
30
  const goalMode = await readJson(path.join(missionDir, 'goal-mode-applied.json'), null);
31
- const zellijLayout = await readJson(path.join(root, 'agent-zellij-layout.json'), null);
32
31
  const scheduler = await readJson(path.join(root, 'agent-scheduler-state.json'), null);
33
32
  const workerSlots = await readJson(path.join(root, 'agent-worker-slots.json'), null);
34
33
  const generations = await readJson(path.join(root, 'agent-session-generations.json'), null);
@@ -68,7 +67,6 @@ export async function buildAgentCodexCockpitState(missionDir, opts = {}) {
68
67
  codex_web_search_status: sourceIntelligence?.codex_web_search?.status || sourceIntelligence?.policy?.codex_web_search?.status || null,
69
68
  goal_mode_status: goalMode?.mode || null,
70
69
  terminal_session_status: terminalClosed ? 'closed' : proof ? 'blocked_or_unverified' : null,
71
- zellij_attach_command: zellijLayout?.attach_command || null,
72
70
  target_active_slots: scheduler?.target_active_slots ?? null,
73
71
  active_slot_count: scheduler?.active_slot_count ?? null,
74
72
  pending_queue_count: scheduler?.pending_count ?? null,
@@ -122,7 +120,6 @@ function summarizeLiveState(state) {
122
120
  codex_web_search_status: state.codex_web_search_status,
123
121
  goal_mode_status: state.goal_mode_status,
124
122
  terminal_session_status: state.terminal_session_status,
125
- zellij_attach_command: state.zellij_attach_command,
126
123
  blockers: state.blockers,
127
124
  };
128
125
  }
@@ -103,7 +103,7 @@ export function decideOfficialSubagentModel(input = {}) {
103
103
  ],
104
104
  downshift_triggers: [
105
105
  'ordinary UI, logic, backend, or native implementation selects Sol High',
106
- 'long-context, Browser/Chrome, Computer Use, image-generation, or large search selects Terra Medium',
106
+ 'long-context, Browser/Chrome, Computer Use, image-generation, or large search selects Terra Max',
107
107
  'tiny short-context mechanical search/typing/rename work selects Luna Max'
108
108
  ]
109
109
  };
@@ -157,7 +157,7 @@ export function decideOfficialSubagentModel(input = {}) {
157
157
  ],
158
158
  downshift_triggers: [
159
159
  'ordinary UI, logic, backend, or native implementation selects Sol High',
160
- 'long-context, Browser/Chrome, Computer Use, or image-generation execution selects Terra Medium',
160
+ 'long-context, Browser/Chrome, Computer Use, or image-generation execution selects Terra Max',
161
161
  'tiny short-context mechanical work selects Luna Max'
162
162
  ]
163
163
  };
@@ -186,16 +186,16 @@ export function buildAgentEffortPolicy(roster = {}) {
186
186
  model_catalog_policy: narutoFamilyOnly ? 'official_subagent_four_profile_matrix' : 'codex_catalog_passthrough',
187
187
  model_constraint: narutoFamilyOnly ? ['gpt-5.6-luna', 'gpt-5.6-terra', 'gpt-5.6-sol'] : null,
188
188
  model_tiers: narutoFamilyOnly
189
- ? ['gpt-5.6-luna-max', 'gpt-5.6-sol-high', 'gpt-5.6-sol-max', 'gpt-5.6-terra-medium']
189
+ ? ['gpt-5.6-luna-max', 'gpt-5.6-sol-high', 'gpt-5.6-sol-max', 'gpt-5.6-terra-max']
190
190
  : ['codex-selected-low', 'codex-selected-medium', 'codex-selected-high', 'codex-selected-xhigh', 'glm-5.2-minimal', 'glm-5.2-low', 'glm-5.2-high', 'glm-5.2-xhigh'],
191
- allowed_efforts: narutoFamilyOnly ? ['medium', 'high', 'max'] : codexModelEffortCapability().advertised_efforts,
191
+ allowed_efforts: narutoFamilyOnly ? ['high', 'max'] : codexModelEffortCapability().advertised_efforts,
192
192
  model_effort_capability: codexModelEffortCapability(),
193
193
  max_agents: roster.max_agents || 20,
194
194
  agent_count: roster.agent_count || decisions.length,
195
195
  concurrency: roster.concurrency || decisions.length,
196
196
  decisions,
197
197
  rule: narutoFamilyOnly
198
- ? 'Official Naruto subagents use GPT-5.6 Luna Max only for tiny short-context mechanical work, GPT-5.6 Sol High for ordinary implementation, GPT-5.6 Sol Max for judgment-heavy work, and GPT-5.6 Terra Medium for long-context or Browser/Chrome, Computer Use, and image-generation execution. Judgment wins when one slice cannot be safely split.'
198
+ ? 'Official Naruto subagents use GPT-5.6 Luna Max only for tiny short-context mechanical work, GPT-5.6 Sol High for ordinary implementation, GPT-5.6 Sol Max for judgment-heavy work, and GPT-5.6 Terra Max for long-context or Browser/Chrome, Computer Use, and image-generation execution. Judgment wins when one slice cannot be safely split.'
199
199
  : 'Codex/OpenAI workers inherit the current Codex-selected model, including future catalog entries; SKS changes only advertised reasoning effort. Explicit non-Codex provider modes retain their provider model.'
200
200
  };
201
201
  }
@@ -35,10 +35,6 @@ export async function runAgentJanitor(input) {
35
35
  statusBySession.set(String(row.session_id), status);
36
36
  }
37
37
  const zombieProcesses = await detectZombieProcessSessions(agentRoot, statusByAgent, statusBySession);
38
- const rawStaleZellijSessions = await detectStaleZellijSessions(agentRoot, staleMs);
39
- const activeGenerationSet = new Set(activeGenerationSessions);
40
- const staleZellijSessions = rawStaleZellijSessions.filter((id) => !activeGenerationSet.has(id));
41
- const skippedActiveGenerations = rawStaleZellijSessions.filter((id) => activeGenerationSet.has(id));
42
38
  const orphanGenerationDirs = await detectOrphanGenerationDirs(agentRoot, new Set(generationRows.map((row) => String(row.artifact_dir || ''))));
43
39
  const orphanTempDirs = await scopedExistingPaths(Array.isArray(namespace?.orphan_temp_dirs) ? namespace.orphan_temp_dirs : [], projectHash, namespace?.temp_dir ? [namespace.temp_dir] : []);
44
40
  const staleLocks = await scopedStaleLockPaths(namespace?.lock_dir ? [namespace.lock_dir] : [], projectHash, staleMs);
@@ -56,7 +52,6 @@ export async function runAgentJanitor(input) {
56
52
  const blockers = [
57
53
  ...staleHeartbeat.map((id) => `stale_heartbeat:${id}`),
58
54
  ...zombieProcesses.map((id) => `zombie_process:${id}`),
59
- ...staleZellijSessions.map((id) => `stale_zellij:${id}`),
60
55
  ...staleLocks.map((id) => `stale_lock:${id}`),
61
56
  ];
62
57
  const report = {
@@ -67,11 +62,9 @@ export async function runAgentJanitor(input) {
67
62
  project_hash: projectHash,
68
63
  stale_heartbeat_sessions: staleHeartbeat,
69
64
  zombie_process_sessions: zombieProcesses,
70
- stale_zellij_sessions: staleZellijSessions,
71
65
  active_generation_sessions: activeGenerationSessions,
72
66
  active_generation_count: activeGenerationSessions.length,
73
67
  cleaned_generation_count: cleaned.filter((entry) => entry.includes(`${path.sep}sessions${path.sep}`)).length,
74
- skipped_active_generations: skippedActiveGenerations,
75
68
  orphan_generation_dirs: orphanGenerationDirs,
76
69
  slot_generation_cleanup: cleaned.filter((entry) => entry.includes(`${path.sep}sessions${path.sep}`)),
77
70
  orphan_temp_dirs: orphanTempDirs,
@@ -143,19 +136,6 @@ async function detectZombieProcessSessions(agentRoot, statusByAgent, statusBySes
143
136
  }
144
137
  return out;
145
138
  }
146
- async function detectStaleZellijSessions(agentRoot, staleMs) {
147
- const out = [];
148
- const now = Date.now();
149
- for (const file of await listNamedFiles(path.join(agentRoot, 'sessions'), 'agent-zellij-report.json')) {
150
- const report = await readJson(file, null);
151
- if (!report || report.launch_mode === 'optional_not_launched')
152
- continue;
153
- const stat = await fsp.stat(file).catch(() => null);
154
- if (stat && now - stat.mtimeMs > staleMs)
155
- out.push(String(report.session_id || report.agent_id || path.basename(path.dirname(file))));
156
- }
157
- return out;
158
- }
159
139
  async function listNamedFiles(dir, name) {
160
140
  return (await listFiles(dir)).filter((file) => path.basename(file) === name);
161
141
  }
@@ -29,14 +29,11 @@ import { appendAgentCodexCockpitHookEvent, writeAgentCodexCockpitArtifacts } fro
29
29
  import { runAgentJanitor } from './agent-janitor.js';
30
30
  import { startAgentTerminalSession, closeAgentTerminalSession } from './agent-terminal-session.js';
31
31
  import { writeScoutPolicyArtifact } from './scout-policy.js';
32
- import { writeZellijRightLaneCockpit } from './zellij-right-lane-cockpit.js';
33
32
  import { buildProjectNamespace, namespacedAgentSessionId, writeProjectNamespaceArtifact } from '../session/project-namespace.js';
34
33
  import { normalizeTargetActiveSlots, runAgentScheduler } from './agent-scheduler.js';
35
34
  import { runSourceIntelligence } from '../source-intelligence/source-intelligence-runner.js';
36
35
  import { detectOfficialGoalMode, writeOfficialGoalModeArtifact } from '../codex/official-goal-mode.js';
37
36
  import { writeAgentTaskGraph } from './agent-task-graph.js';
38
- import { drainZellijLaneSupervisor, initializeZellijLaneSupervisorEmpty, updateZellijLaneSupervisorFromSlots, verifyZellijLaneSurvival } from './zellij-lane-supervisor.js';
39
- import { writeZellijPaneProof } from '../zellij/zellij-pane-proof.js';
40
37
  import { writeIntelligentWorkGraphArtifacts } from './intelligent-work-graph.js';
41
38
  import { writeAdhdOrchestrationArtifacts } from '../strategy/adhd-orchestrating-gate.js';
42
39
  import { compileStrategy, writeStrategyCompilerArtifacts } from '../strategy/strategy-compiler.js';
@@ -72,8 +69,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
72
69
  const requestedBackend = String(opts.backend || (opts.mock ? 'fake' : 'codex-sdk'));
73
70
  const backend = normalizeAgentBackend(requestedBackend);
74
71
  const maxAgentCount = Number.isFinite(Number(opts.maxAgentCount)) && Number(opts.maxAgentCount) >= 1 ? Math.floor(Number(opts.maxAgentCount)) : MAX_AGENT_COUNT;
75
- const realZellij = backend === 'zellij' && opts.real === true;
76
- const realZellijProofRequired = realZellij && process.env.SKS_REQUIRE_ZELLIJ === '1';
77
72
  const created = opts.missionId
78
73
  ? { id: opts.missionId, dir: missionDir(root, opts.missionId), mission: { id: opts.missionId, mode: 'internal-worker-runtime', prompt } }
79
74
  : await createMission(root, { mode: 'internal-worker-runtime', prompt, sessionKey });
@@ -113,7 +108,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
113
108
  })
114
109
  }));
115
110
  const targetActiveSlots = normalizeTargetActiveSlots(opts.targetActiveSlots ?? opts.agents ?? roster.agent_count, maxAgentCount);
116
- const visualLaneCount = normalizeVisualLaneCount(opts.visualLaneCount ?? opts.agents ?? roster.agent_count, roster.agent_count, Math.min(maxAgentCount, DEFAULT_AGENT_CONCURRENCY));
117
111
  const desiredWorkItemCount = normalizeDesiredWorkItemCount(opts.desiredWorkItemCount, opts.minimumWorkItems, targetActiveSlots);
118
112
  const minimumWorkItems = normalizeMinimumWorkItems(opts.minimumWorkItems, targetActiveSlots);
119
113
  const sourceIntelligence = await runSourceIntelligence({ root, missionDir: dir, route, query: prompt, offline: true, context7Available: true });
@@ -241,9 +235,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
241
235
  await writeStrategyGateArtifact(ledgerRoot, strategyGate);
242
236
  await writeIntelligentWorkGraphArtifacts(ledgerRoot, partition.intelligent_work_graph);
243
237
  await writeScoutPolicyArtifact(ledgerRoot);
244
- await writeZellijRightLaneCockpit(ledgerRoot, { missionId, sessionName: `sks-${missionId}`, agents: roster.roster });
245
- await initializeZellijLaneSupervisorEmpty(ledgerRoot, { missionId, sessionName: `sks-${missionId}` });
246
- await writeZellijPaneProof(root, { missionId, require: realZellijProofRequired, phase: 'initial', ledgerRoot });
247
238
  await writeAgentCodexCockpitArtifacts(dir, { missionId, projectHash: namespace.root_hash });
248
239
  await writeJsonAtomic(path.join(ledgerRoot, 'agent-no-overlap-proof.json'), partition.no_overlap_proof || { schema: 'sks.agent-no-overlap-proof.v1', ok: false, blockers: ['missing_no_overlap_proof'] });
249
240
  await writeAgentLifecyclePolicy(ledgerRoot);
@@ -256,7 +247,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
256
247
  concurrency: roster.concurrency,
257
248
  batch_count: 0,
258
249
  target_active_slots: targetActiveSlots,
259
- visual_lane_count: visualLaneCount,
260
250
  desired_work_items: desiredWorkItemCount,
261
251
  minimum_work_items: minimumWorkItems,
262
252
  requested_work_items: desiredWorkItemCount,
@@ -347,11 +337,10 @@ export async function runNativeAgentOrchestrator(opts = {}) {
347
337
  noOllama: opts.noOllama === true,
348
338
  route,
349
339
  fastModePolicy,
350
- ...(opts.workerPlacement === undefined ? {} : { workerPlacement: String(opts.workerPlacement) }),
351
- zellijVisiblePaneCap: Number(opts.zellijVisiblePaneCap || visualLaneCount || targetActiveSlots),
352
340
  projectRoot: root
353
341
  });
354
342
  const schedulerHardTimeoutMs = normalizeMissionHardTimeoutMs(opts, route);
343
+ const schedulerAbortController = new AbortController();
355
344
  let lastTimeoutReapMs = 0;
356
345
  async function reapTimedOutAgentSessions(force = false) {
357
346
  const now = Date.now();
@@ -371,6 +360,7 @@ export async function runNativeAgentOrchestrator(opts = {}) {
371
360
  prompt,
372
361
  targetActiveSlots,
373
362
  maxActiveSlots: maxAgentCount,
363
+ maxWallMs: schedulerHardTimeoutMs,
374
364
  ...(opts.maxQueueExpansion === undefined ? {} : { maxQueueExpansion: opts.maxQueueExpansion }),
375
365
  ...(opts.refillDelayMs === undefined ? {} : { refillDelayMs: opts.refillDelayMs }),
376
366
  sourceIntelligenceRefs: sourceIntelligenceRef,
@@ -408,12 +398,12 @@ export async function runNativeAgentOrchestrator(opts = {}) {
408
398
  await appendAgentLedgerEvent(ledgerRoot, { agent_id: agent.id, session_id: agent.session_id, event_type: 'agent_started', payload: { backend, slice_id: slice.id } });
409
399
  await startAgentTerminalSession(ledgerRoot, agent, {
410
400
  backend,
411
- real: backend === 'process' || (backend === 'codex-sdk' && opts.real === true) || backend === 'zellij',
401
+ real: backend === 'process' || (backend === 'codex-sdk' && opts.real === true),
412
402
  slotId: agent.slot_id,
413
403
  generationIndex: agent.generation_index,
414
404
  requireGeneration: true
415
405
  });
416
- const backendOpts = { ...opts, missionId, agentRoot: ledgerRoot, cwd: workerWorktree?.context.path || root, projectRoot: root, projectHash: namespace.root_hash, route, prompt, fastMode: fastModePolicy.fast_mode, serviceTier: fastModePolicy.service_tier, ...(workerWorktree ? { worktree: workerWorktree.context } : {}) };
406
+ const backendOpts = { ...opts, missionId, agentRoot: ledgerRoot, cwd: workerWorktree?.context.path || root, projectRoot: root, projectHash: namespace.root_hash, route, prompt, fastMode: fastModePolicy.fast_mode, serviceTier: fastModePolicy.service_tier, signal: schedulerAbortController.signal, ...(workerWorktree ? { worktree: workerWorktree.context } : {}) };
417
407
  const result = await workerSessionRuntime.launchWorker({ agent: runtimeAgent, slice: runtimeSlice, opts: backendOpts });
418
408
  await reapTimedOutAgentSessions();
419
409
  if (route === '$Naruto')
@@ -467,26 +457,19 @@ export async function runNativeAgentOrchestrator(opts = {}) {
467
457
  await writeAgentCodexCockpitArtifacts(dir, { missionId, projectHash: namespace.root_hash });
468
458
  return result;
469
459
  },
460
+ onStop: async (reason) => {
461
+ if (!schedulerAbortController.signal.aborted)
462
+ schedulerAbortController.abort(reason);
463
+ await reapTimedOutAgentSessions(true);
464
+ },
470
465
  onSchedulerEvent: async ({ event, slots, state }) => {
471
466
  await reapTimedOutAgentSessions();
472
- const paneBySlot = await readZellijPaneIdsBySlot(ledgerRoot);
473
- const enrichedSlots = slots.map((slot) => ({ ...slot, pane_id: paneBySlot.get(slot.slot_id) || null, launch_status: paneBySlot.has(slot.slot_id) ? 'launched' : slot.status }));
474
- await writeZellijRightLaneCockpit(ledgerRoot, { missionId, sessionName: `sks-${missionId}`, slots: enrichedSlots });
475
467
  await writeAgentCodexCockpitArtifacts(dir, { missionId, projectHash: namespace.root_hash });
476
468
  if (['session_completed', 'backfill_event', 'scheduler_drained'].includes(String(event.event_type))) {
477
469
  const periodicJanitor = await runAgentJanitor({ missionDir: dir, missionId, projectHash: namespace.root_hash });
478
470
  if (!periodicJanitor.ok)
479
471
  await appendAgentLedgerEvent(ledgerRoot, { agent_id: 'orchestrator', session_id: 'orchestrator', event_type: 'periodic_janitor_blocked', payload: periodicJanitor });
480
472
  }
481
- if (String(event.event_type) === 'scheduler_draining') {
482
- await verifyZellijLaneSurvival(ledgerRoot);
483
- await writeZellijPaneProof(root, { missionId, require: realZellijProofRequired, phase: 'before_drain', ledgerRoot });
484
- }
485
- await updateZellijLaneSupervisorFromSlots(ledgerRoot, { missionId, sessionName: `sks-${missionId}`, slots, state, event });
486
- if (String(event.event_type) === 'scheduler_drained') {
487
- await drainZellijLaneSupervisor(ledgerRoot);
488
- await writeZellijPaneProof(root, { missionId, require: realZellijProofRequired, phase: 'after_drain', ledgerRoot });
489
- }
490
473
  }
491
474
  });
492
475
  await reapTimedOutAgentSessions(true);
@@ -494,7 +477,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
494
477
  const parallelRuntimeProof = await writeParallelRuntimeProof(ledgerRoot, missionId, {
495
478
  requestedWorkers: Number(opts.agents || roster.agent_count || targetActiveSlots),
496
479
  targetActiveSlots,
497
- visiblePanes: visualLaneCount,
498
480
  expectedWorkerRuntimeMs: targetActiveSlots >= 10 ? 8000 : targetActiveSlots >= 2 ? 2000 : 25,
499
481
  minActiveWorkers: Math.min(targetActiveSlots, desiredWorkItemCount),
500
482
  ...(backend === 'codex-sdk' && opts.real === true ? { minSpeedupRatio: 3 } : {}),
@@ -573,10 +555,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
573
555
  const outputValidation = await writeAgentOutputValidationReport(ledgerRoot, results);
574
556
  const outputTails = await writeAgentOutputTailReport(ledgerRoot, results);
575
557
  const backendReport = await writeAgentBackendReport(ledgerRoot, { backend, results, outputTails, fastModePolicy });
576
- const finalPaneBySlot = await readZellijPaneIdsBySlot(ledgerRoot);
577
- const finalZellijSlots = scheduler.slots.map((slot) => ({ ...slot, pane_id: finalPaneBySlot.get(slot.slot_id) || null, launch_status: finalPaneBySlot.has(slot.slot_id) ? 'launched' : slot.status }));
578
- await writeZellijRightLaneCockpit(ledgerRoot, { missionId, sessionName: `sks-${missionId}`, slots: finalZellijSlots });
579
- await writeZellijPaneProof(root, { missionId, require: realZellijProofRequired, phase: 'final', ledgerRoot });
580
558
  await compactAgentLedger(ledgerRoot);
581
559
  const cleanup = await writeAgentCleanupReport(ledgerRoot);
582
560
  const janitor = await runAgentJanitor({ missionDir: dir, missionId, projectHash: namespace.root_hash });
@@ -607,7 +585,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
607
585
  minimumWorkItems: partition.task_graph?.minimum_work_items || minimumWorkItems,
608
586
  targetActiveSlots,
609
587
  realParallel: backend === 'codex-sdk' && opts.mock !== true,
610
- visualLaneCount,
611
588
  roster,
612
589
  partition,
613
590
  consensus,
@@ -652,7 +629,6 @@ export async function runNativeAgentOrchestrator(opts = {}) {
652
629
  requested_work_items: partition.task_graph?.desired_work_items || desiredWorkItemCount,
653
630
  actual_total_work_items: partition.task_graph?.total_work_items || partition.slices.length,
654
631
  target_active_slots: targetActiveSlots,
655
- visual_lane_count: visualLaneCount,
656
632
  minimum_work_items: partition.task_graph?.minimum_work_items || minimumWorkItems,
657
633
  scheduler,
658
634
  source_intelligence: sourceIntelligenceRef,
@@ -1862,16 +1838,6 @@ function normalizeMinimumWorkItems(value, targetActiveSlots) {
1862
1838
  return Math.max(1, Math.floor(targetActiveSlots));
1863
1839
  return Math.max(1, Math.floor(parsed));
1864
1840
  }
1865
- function normalizeVisualLaneCount(value, fallback, maxAgentCount) {
1866
- const parsed = Number(value);
1867
- const fallbackCount = Number(fallback);
1868
- const raw = Number.isFinite(parsed) && parsed > 0
1869
- ? parsed
1870
- : Number.isFinite(fallbackCount) && fallbackCount > 0
1871
- ? fallbackCount
1872
- : 1;
1873
- return Math.max(1, Math.min(maxAgentCount, Math.floor(raw)));
1874
- }
1875
1841
  function isWriteCapableRun(opts) {
1876
1842
  if (opts.readonly === true)
1877
1843
  return false;
@@ -1995,19 +1961,6 @@ function buildProvidedAgentRoster(input, opts = {}) {
1995
1961
  effort_policy: input?.effort_policy || { schema: 'sks.agent-effort-policy.v1', dynamic: true, decisions: [] }
1996
1962
  };
1997
1963
  }
1998
- async function readZellijPaneIdsBySlot(root) {
1999
- const out = new Map();
2000
- const text = await readText(path.join(root, 'agent-zellij-pane-launch-ledger.jsonl'), '');
2001
- for (const line of String(text).split(/\n/).filter(Boolean)) {
2002
- try {
2003
- const entry = JSON.parse(line);
2004
- if (entry.slot_id && entry.pane_id)
2005
- out.set(String(entry.slot_id), String(entry.pane_id));
2006
- }
2007
- catch { }
2008
- }
2009
- return out;
2010
- }
2011
1964
  async function writeAgentOutputTailReport(root, results) {
2012
1965
  const records = [];
2013
1966
  for (const result of results || []) {
@@ -34,7 +34,7 @@ export const AGENT_RESULT_RUNTIME_SCHEMA = {
34
34
  task_slice_id: { type: 'string' },
35
35
  work_item_kind: { type: 'string' },
36
36
  status: { enum: ['done', 'blocked', 'failed'] },
37
- backend: { enum: ['fake', 'process', 'codex-sdk', 'python-codex-sdk', 'zellij', 'ollama', 'local-llm'] },
37
+ backend: { enum: ['fake', 'process', 'codex-sdk', 'python-codex-sdk', 'ollama', 'local-llm'] },
38
38
  summary: { type: 'string' },
39
39
  findings: { type: 'array', items: { type: 'string' } },
40
40
  proposed_changes: { type: 'array', items: { type: 'string' } },
@@ -80,7 +80,7 @@ export const AGENT_RESULT_RUNTIME_SCHEMA = {
80
80
  required: ['schema', 'agent_id', 'session_id', 'slot_id', 'generation_index', 'operations'],
81
81
  properties: {
82
82
  schema: { const: 'sks.agent-patch-envelope.v1' },
83
- source: { enum: ['fixture', 'model_authored', 'process_generated', 'zellij_generated', 'git-worktree-diff'] },
83
+ source: { enum: ['fixture', 'model_authored', 'process_generated', 'git-worktree-diff'] },
84
84
  mission_id: { type: 'string' },
85
85
  route: { type: 'string' },
86
86
  agent_id: { type: 'string', minLength: 1 },
@@ -155,7 +155,6 @@ export const AGENT_RESULT_RUNTIME_SCHEMA = {
155
155
  codex_child_report: { type: 'object', additionalProperties: true },
156
156
  codex_sdk_thread: { type: 'object', additionalProperties: true },
157
157
  process_child_report: { type: 'object', additionalProperties: true },
158
- zellij_child_report: { type: 'object', additionalProperties: true },
159
158
  model_authored_patch_envelopes: { type: 'boolean' },
160
159
  fixture_patch_envelopes: { type: 'boolean' },
161
160
  no_patch_reason: { type: 'object', additionalProperties: true },
@@ -55,7 +55,7 @@ export function validateAgentPatchEnvelope(envelope) {
55
55
  violations.push('lease_id_missing');
56
56
  if (!envelope.operations.length)
57
57
  violations.push('operations_missing');
58
- if (envelope.source && !['fixture', 'model_authored', 'process_generated', 'zellij_generated', 'git-worktree-diff'].includes(envelope.source))
58
+ if (envelope.source && !['fixture', 'model_authored', 'process_generated', 'git-worktree-diff'].includes(envelope.source))
59
59
  violations.push('source_invalid');
60
60
  if (envelope.source === 'model_authored' && !hasFiniteNumber(envelope.backend_child_process_id) && !envelope.backend_sdk_thread_id && !envelope.backend_ollama_request_id)
61
61
  violations.push('model_authored_backend_proof_missing');
@@ -84,7 +84,7 @@ export function validateAgentPatchEnvelope(envelope) {
84
84
  }
85
85
  function normalizeEnvelopeSource(value) {
86
86
  const text = String(value || '');
87
- return text === 'fixture' || text === 'model_authored' || text === 'process_generated' || text === 'zellij_generated' || text === 'git-worktree-diff' ? text : null;
87
+ return text === 'fixture' || text === 'model_authored' || text === 'process_generated' || text === 'git-worktree-diff' ? text : null;
88
88
  }
89
89
  function hasFiniteNumber(value) {
90
90
  return value !== null && value !== undefined && value !== '' && Number.isFinite(Number(value));
@@ -5,7 +5,6 @@ import { validateAgentLedgerHashChain } from './agent-central-ledger.js';
5
5
  import { assertAllAgentSessionsClosed } from './agent-lifecycle.js';
6
6
  import { assertAgentTerminalSessionsClosed } from './agent-terminal-session.js';
7
7
  import { assertAgentSessionGenerationsClosed } from './agent-session-generation.js';
8
- import { readZellijLaneSupervisor } from './zellij-lane-supervisor.js';
9
8
  import { writeFakeRealProofPolicyReport } from '../proof/fake-real-proof-policy.js';
10
9
  import { buildRuntimeTruthMatrix, writeRuntimeTruthMatrix } from '../proof/runtime-truth-matrix.js';
11
10
  import { evaluateLocalCollaborationFinalGate, localCollaborationParticipated, resolveLocalCollaborationPolicy } from '../local-llm/local-collaboration-policy.js';
@@ -14,9 +13,6 @@ export async function writeAgentProofEvidence(root, input) {
14
13
  const terminal = await assertAgentTerminalSessionsClosed(root);
15
14
  const generations = await assertAgentSessionGenerationsClosed(root);
16
15
  const ledger = await validateAgentLedgerHashChain(root);
17
- const zellijLanes = await readJson(path.join(root, 'agent-zellij-lanes.json'), null);
18
- const laneSupervisor = await readZellijLaneSupervisor(root);
19
- const zellijRuntimeManifest = await readJson(path.join(root, 'zellij-lane-runtime.json'), null);
20
16
  const workQueue = await readJson(path.join(root, 'agent-work-queue.json'), null);
21
17
  const scheduler = input.scheduler || await readJson(path.join(root, 'agent-scheduler-state.json'), null);
22
18
  const taskGraph = input.partition?.task_graph || await readJson(path.join(root, 'agent-task-graph.json'), null);
@@ -51,15 +47,12 @@ export async function writeAgentProofEvidence(root, input) {
51
47
  const noSubagentScalingPolicy = input.noSubagentScalingPolicy || await readJson(path.join(root, 'no-subagent-scaling-policy.json'), null);
52
48
  const officialSubagentHelperPolicy = input.officialSubagentHelperPolicy || await readJson(path.join(root, 'official-subagent-helper-policy.json'), null);
53
49
  const fastModePropagation = input.fastModePropagation || await readJson(path.join(root, 'fast-mode-propagation-proof.json'), null);
54
- const zellijPaneProof = await readJson(path.join(root, 'zellij-pane-proof.json'), null);
55
50
  const cleanupProof = await readJson(path.join(root, 'agent-cleanup-proof.json'), null);
56
51
  const intelligentWorkGraph = await readJson(path.join(root, 'agent-intelligent-work-graph.json'), null);
57
52
  const slots = await readJson(path.join(root, 'agent-worker-slots.json'), null);
58
53
  const generationArtifact = await readJson(path.join(root, 'agent-session-generations.json'), null);
59
54
  const strategyGate = input.strategyGate || await readJson(path.join(root, 'strategy-gate.json'), null);
60
55
  const schedulerEvents = await readTextSafe(path.join(root, 'agent-scheduler-events.jsonl'));
61
- const zellijLaunchLedger = await readTextSafe(path.join(root, 'agent-zellij-pane-launch-ledger.jsonl'));
62
- const zellijPaneLaunchCount = zellijLaunchLedger.split(/\n/).filter(Boolean).length;
63
56
  const terminalCloseReportCount = terminal.total_sessions || 0;
64
57
  const generationCount = generations.generation_count || 0;
65
58
  const finalWorkItemCount = Number(scheduler?.completed_count || 0) + Number(scheduler?.failed_count || 0) + Number(scheduler?.blocked_count || 0);
@@ -68,7 +61,6 @@ export async function writeAgentProofEvidence(root, input) {
68
61
  const workQueueTotalWorkItems = Number(workQueue?.total_work_items || 0);
69
62
  const schedulerTotalWorkItems = Number(scheduler?.total_work_items || 0);
70
63
  const targetActiveSlots = Number(input.targetActiveSlots || scheduler?.target_active_slots || taskGraph?.target_active_slots || input.roster?.agent_count || 0);
71
- const visualLaneCount = Number(input.visualLaneCount || zellijLanes?.lane_count || laneSupervisor?.lane_count || targetActiveSlots || 0);
72
64
  const minimumWorkItems = Number(input.minimumWorkItems || taskGraph?.minimum_work_items || targetActiveSlots || 0);
73
65
  const taskGraphMatchesCliOptions = Boolean(taskGraph) && requestedWorkItems === taskGraphTotalWorkItems && targetActiveSlots === Number(taskGraph.target_active_slots || 0);
74
66
  const workQueueMatchesTaskGraph = Boolean(workQueue && taskGraph) && workQueueTotalWorkItems === taskGraphTotalWorkItems;
@@ -84,24 +76,6 @@ export async function writeAgentProofEvidence(root, input) {
84
76
  const isNarutoRoute = route === '$Naruto';
85
77
  const routeCommand = String(input.routeCommand || 'internal-worker-runtime');
86
78
  const realRouteCommandUsed = routeCommand !== 'internal-worker-runtime';
87
- const laneSupervisorIntegrated = Boolean(laneSupervisor);
88
- const zellijSpawnOnDemandSupervisor = Boolean(laneSupervisor)
89
- && Number(laneSupervisor?.lane_count || 0) === 0
90
- && Array.isArray(laneSupervisor?.lanes)
91
- && laneSupervisor.lanes.length === 0
92
- && Number(zellijRuntimeManifest?.lane_count || 0) === 0
93
- && Array.isArray(zellijRuntimeManifest?.lanes)
94
- && zellijRuntimeManifest.lanes.length === 0;
95
- const zellijLaneRuntimePolicyOk = zellijSpawnOnDemandSupervisor || Boolean(laneSupervisor)
96
- && Array.isArray(laneSupervisor?.lanes)
97
- && laneSupervisor.lanes.length > 0
98
- && laneSupervisor.lanes.every((lane) => lane?.dispatch_mode === 'jsonl_nonblocking'
99
- && lane?.command_inbox
100
- && lane?.state_dir
101
- && lane?.runtime?.dispatch?.fifo_policy === 'disabled_to_avoid_writer_blocking');
102
- const zellijLanePaneIdSourceOk = Boolean(laneSupervisor)
103
- && Array.isArray(laneSupervisor?.lanes)
104
- && laneSupervisor.lanes.every((lane) => typeof lane?.pane_id_source === 'string' && lane.pane_id_source.length > 0);
105
79
  const patchEntries = Array.isArray(patchQueue?.entries) ? patchQueue.entries : [];
106
80
  const patchApplyRows = Array.isArray(patchApplyResults?.results) ? patchApplyResults.results : [];
107
81
  const patchQueuePendingCount = Number(patchQueue?.queued_count || patchEntries.filter((entry) => entry.status === 'pending').length || 0);
@@ -177,18 +151,6 @@ export async function writeAgentProofEvidence(root, input) {
177
151
  ...(generationCount < finalWorkItemCount ? ['session_generation_count_below_finished_work_items'] : []),
178
152
  ...(terminalCloseReportCount < generationCount ? ['terminal_close_report_count_below_generation_count'] : []),
179
153
  ...(slots && slots.all_slots_closed_after_drain !== true ? ['agent_worker_slots_not_closed_after_drain'] : []),
180
- ...(!laneSupervisor ? ['zellij_lane_supervisor_missing'] : []),
181
- ...(laneSupervisor && !zellijSpawnOnDemandSupervisor && visualLaneCount > 0 && Number(laneSupervisor.lane_count || 0) < visualLaneCount ? ['zellij_lane_count_below_visual_lane_count'] : []),
182
- ...(laneSupervisor && laneSupervisor.no_flicker_verified !== true ? ['zellij_lane_no_flicker_not_verified'] : []),
183
- ...(laneSupervisor && laneSupervisor.pane_survival_checked !== true ? ['zellij_lane_survival_not_checked'] : []),
184
- ...(laneSupervisor && Number(laneSupervisor.unexpected_close_count || 0) > 0 ? ['zellij_lane_unexpected_close_before_drain'] : []),
185
- ...(laneSupervisor && !zellijLaneRuntimePolicyOk ? ['zellij_lane_runtime_policy_missing'] : []),
186
- ...(laneSupervisor && !zellijLanePaneIdSourceOk ? ['zellij_lane_pane_id_source_missing'] : []),
187
- ...(laneSupervisor?.blockers || []),
188
- ...(input.backend === 'zellij' && zellijPaneProof?.ok !== true ? ['zellij_pane_proof_missing'] : []),
189
- ...(input.backend === 'zellij' && Array.isArray(zellijPaneProof?.blockers) ? zellijPaneProof.blockers : []),
190
- ...(input.backend === 'zellij' && zellijLanes?.ok !== true ? ['zellij_right_lane_manifest_missing'] : []),
191
- ...(input.backend === 'zellij' && zellijPaneLaunchCount === 0 ? ['zellij_pane_launch_evidence_missing'] : []),
192
154
  ...(ledger.blockers || []),
193
155
  ...(input.partition?.blockers || []),
194
156
  ...(input.consensus?.blockers || []),
@@ -293,8 +255,6 @@ export async function writeAgentProofEvidence(root, input) {
293
255
  naruto_implementation_like_ratio: Number(narutoRoleDistribution?.implementation_like_ratio || 0),
294
256
  naruto_concurrency_governor: narutoConcurrencyGovernor ? 'naruto-concurrency-governor.json' : null,
295
257
  naruto_safe_active_workers: Number(narutoConcurrencyGovernor?.safe_active_workers || 0),
296
- naruto_safe_zellij_visible_panes: Number(narutoConcurrencyGovernor?.safe_zellij_visible_panes || 0),
297
- naruto_headless_workers: Number(narutoConcurrencyGovernor?.headless_workers || 0),
298
258
  naruto_active_pool: narutoActivePool ? 'naruto-active-pool.json' : null,
299
259
  naruto_active_pool_refill_events: Number(narutoActivePool?.refill_events || 0),
300
260
  naruto_verification_dag: narutoVerificationDag ? 'naruto-verification-dag.json' : null,
@@ -329,7 +289,6 @@ export async function writeAgentProofEvidence(root, input) {
329
289
  all_generations_closed: generations.ok,
330
290
  scheduler_state: 'agent-scheduler-state.json',
331
291
  target_active_slots: targetActiveSlots,
332
- visual_lane_count: visualLaneCount,
333
292
  requested_work_items: requestedWorkItems,
334
293
  actual_total_work_items: taskGraphTotalWorkItems || schedulerTotalWorkItems,
335
294
  minimum_work_items: minimumWorkItems,
@@ -356,31 +315,8 @@ export async function writeAgentProofEvidence(root, input) {
356
315
  work_queue_goal_refs_ok: workQueueGoalRefsOk,
357
316
  task_graph_strategy_refs_ok: taskGraphStrategyRefsOk,
358
317
  work_queue_strategy_refs_ok: workQueueStrategyRefsOk,
359
- zellij_lane_manifest: 'agent-zellij-lanes.json',
360
- zellij_lane_manifest_ok: zellijLanes?.ok === true,
361
- zellij_lane_supervisor: 'agent-zellij-lane-supervisor.json',
362
- lane_supervisor_integrated: laneSupervisorIntegrated,
363
- zellij_lane_runtime_manifest: zellijRuntimeManifest ? 'zellij-lane-runtime.json' : null,
364
- zellij_spawn_on_demand_supervisor: zellijSpawnOnDemandSupervisor,
365
- zellij_lane_runtime_policy_ok: zellijLaneRuntimePolicyOk,
366
- zellij_lane_dispatch_mode: laneSupervisor?.dispatch_mode || zellijRuntimeManifest?.dispatch_mode || null,
367
- zellij_lane_fifo_policy: laneSupervisor?.fifo_policy || zellijRuntimeManifest?.fifo_policy || null,
368
- zellij_lane_resource_throttle_ms: laneSupervisor?.resource_throttle_ms || zellijRuntimeManifest?.resource_throttle_ms || null,
369
- zellij_lane_nice_level: laneSupervisor?.nice_level ?? zellijRuntimeManifest?.nice_level ?? null,
370
- zellij_lane_pane_id_source_ok: zellijLanePaneIdSourceOk,
371
- zellij_lane_no_flicker_verified: laneSupervisor?.no_flicker_verified === true,
372
- zellij_lane_survival_checked: laneSupervisor?.pane_survival_checked === true,
373
- zellij_lane_unexpected_close_count: laneSupervisor?.unexpected_close_count || 0,
374
- zellij_lane_auto_reopen_count: laneSupervisor?.auto_reopen_count || 0,
375
- zellij_pane_launch_ledger: 'agent-zellij-pane-launch-ledger.jsonl',
376
- zellij_pane_launch_count: zellijPaneLaunchCount,
377
- zellij_pane_verified: zellijPaneProof?.ok === true,
378
- zellij_pane_proof: 'zellij-pane-proof.json',
379
- zellij_pane_count: zellijPaneProof?.pane_count ?? null,
380
318
  real_truth_summary: {
381
319
  fake_backend: input.backend === 'fake',
382
- zellij_pane_verified: zellijPaneProof?.ok === true,
383
- real_zellij_status: zellijPaneProof ? (zellijPaneProof.ok === true ? 'passed' : 'blocked') : (input.backend === 'zellij' ? 'missing' : 'not_applicable'),
384
320
  cleanup_executor_status: cleanupProof?.ok === true ? 'passed' : cleanupProof ? 'blocked' : 'not_run',
385
321
  work_graph_quality_score: Number(intelligentWorkGraph?.work_graph_quality_score || taskGraph?.work_graph_quality_score || 0),
386
322
  fake_vs_real_policy: 'fake-real-proof-policy.json'
@@ -421,7 +357,6 @@ export async function writeAgentProofEvidence(root, input) {
421
357
  agentRoot: root,
422
358
  releaseVersion: PACKAGE_VERSION,
423
359
  reports: {
424
- 'zellij-pane-proof.json': zellijPaneProof,
425
360
  'agent-cleanup-proof.json': cleanupProof,
426
361
  'agent-intelligent-work-graph.json': intelligentWorkGraph,
427
362
  'source-intelligence-evidence.json': input.partition?.source_intelligence_refs,
@@ -373,7 +373,7 @@ function transcriptGroupForChannel(channel) {
373
373
  function isWorkerExecutionSurface(rel, channel) {
374
374
  if (channel === 'stdout' || channel === 'stderr' || channel === 'agent_result')
375
375
  return true;
376
- return /(?:^|\/)agent-worker-pipeline\.(?:ts|mjs|js)$/.test(rel) || /(?:^|\/)agent-runner-(?:process|zellij|ollama)\.(?:ts|mjs|js)$/.test(rel);
376
+ return /(?:^|\/)agent-worker-pipeline\.(?:ts|mjs|js)$/.test(rel) || /(?:^|\/)agent-runner-(?:process|ollama)\.(?:ts|mjs|js)$/.test(rel);
377
377
  }
378
378
  function classifyNonRecursivePipelinePath(file) {
379
379
  const normalized = normalizePath(file);
@@ -5,6 +5,7 @@ import { agentWorkerEnv, validateAgentWorkerResult } from './agent-worker-pipeli
5
5
  import { fastModeEnv, resolveFastModePolicy } from './fast-mode-policy.js';
6
6
  import { buildCodexExecArgs } from '../codex/codex-cli-syntax-builder.js';
7
7
  import { codexLbRecoveryBlockedProcessResult, withCodexLbCliLaunchRecovery } from '../codex-control/codex-lb-launch-recovery.js';
8
+ import { prepareCodexAppServerRuntimeEnv } from '../codex-control/codex-app-server-runtime-env.js';
8
9
  export function buildCodexExecAgentArgs(agent, prompt, opts = {}) {
9
10
  const resultFile = opts.resultFile || defaultCodexResultFile(agent, opts);
10
11
  const sandbox = opts.workspaceWrite ? 'workspace-write' : 'read-only';
@@ -74,15 +75,16 @@ export async function runCodexExecAgent(agent, slice, opts = {}) {
74
75
  const allowedCommandsFile = path.join(opts.agentRoot || opts.cwd || process.cwd(), 'agent-allowed-commands.json');
75
76
  const workerEnv = agentWorkerEnv(agent, allowedCommandsFile);
76
77
  const effectiveEnv = { ...process.env, ...(opts.env || {}) };
77
- const proxyEnv = managedProxyEnvForChild(effectiveEnv);
78
+ const runtimeEnv = await prepareCodexAppServerRuntimeEnv({ env: effectiveEnv });
79
+ const proxyEnv = managedProxyEnvForChild(runtimeEnv);
78
80
  const execute = opts.runProcessImpl || runProcess;
79
81
  const guarded = await withCodexLbCliLaunchRecovery({
80
82
  root: opts.cwd || process.cwd(),
81
- env: effectiveEnv,
83
+ env: runtimeEnv,
82
84
  cliArgs: command.args.slice(0, -1),
83
85
  ...(typeof opts.recoveryFetch === 'function' ? { fetchImpl: opts.recoveryFetch } : {}),
84
86
  ...(opts.recoveryTimeoutMs === undefined ? {} : { timeoutMs: opts.recoveryTimeoutMs })
85
- }, () => execute(opts.codexBin || 'codex', command.args, { cwd: opts.cwd || process.cwd(), env: { ...(opts.env || {}), ...proxyEnv, ...fastModeEnv(fastPolicy), ...workerEnv }, timeoutMs: opts.timeoutMs || 30 * 60 * 1000, maxOutputBytes: 256 * 1024, stdoutFile, stderrFile }));
87
+ }, () => execute(opts.codexBin || 'codex', command.args, { cwd: opts.cwd || process.cwd(), env: { ...runtimeEnv, ...proxyEnv, ...fastModeEnv(fastPolicy), ...workerEnv }, timeoutMs: opts.timeoutMs || 30 * 60 * 1000, maxOutputBytes: 256 * 1024, stdoutFile, stderrFile }));
86
88
  const result = guarded.launched
87
89
  ? guarded.value
88
90
  : codexLbRecoveryBlockedProcessResult(guarded.toolOutputRecovery);