toolroll 0.9.134 → 0.9.136

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 (277) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/acp-check-repo-schema.js +52 -0
  3. package/dist/acp-check.js +1 -1
  4. package/dist/acp-client.js +3 -3
  5. package/dist/acp-inspect.js +2 -1
  6. package/dist/agent-detect.js +1 -1
  7. package/dist/agent-fence.js +4 -4
  8. package/dist/agent-thread/chat-turn.js +2 -2
  9. package/dist/agent-thread/direct-host.js +2 -2
  10. package/dist/agent-thread/fence.js +2 -2
  11. package/dist/agent-thread/git-workspace.js +2 -2
  12. package/dist/agent-thread/guards.js +1 -1
  13. package/dist/agent-thread/providers.js +1 -1
  14. package/dist/agent-thread/ship.js +2 -2
  15. package/dist/approval-decision.js +1 -0
  16. package/dist/approval-password.js +1 -1
  17. package/dist/approval-summary.js +1 -1
  18. package/dist/attest.js +1 -1
  19. package/dist/batch-checks.js +2 -2
  20. package/dist/boot-identity.js +1 -1
  21. package/dist/bounded-spawn.js +2 -2
  22. package/dist/browser/{chunk-agents-live-view.e97fbf607cb8075aad7a48664556d11ea41469785f82384b5171b76c524f71e2.js → chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js} +4 -4
  23. package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.br +0 -0
  24. package/dist/browser/chunk-agents-live-view.9f4367c89c6366769a567e729ac9181ccaa898bf3a168d3dc618f3cface887c7.js.gz +0 -0
  25. package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js +2 -0
  26. package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.br +0 -0
  27. package/dist/browser/chunk-bundle.ac5952c82c76e2efcdcf5a097c4fa235d6f1045dcc36d02ee921ff4be976a46a.js.gz +0 -0
  28. package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js +4 -0
  29. package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.br +0 -0
  30. package/dist/browser/chunk-chat-parts.2a0b0b723508c5c48379f6a3d441f07a18c8b91ed64fd018962931c5ae43331e.js.gz +0 -0
  31. package/dist/browser/{chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js → chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js} +12 -12
  32. package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.br +0 -0
  33. package/dist/browser/chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js.gz +0 -0
  34. package/dist/browser/{chunk-flow-view.264e801af330461985aadcab42bc4ac4e036ba124394a7b5a100f2cd1edf89f0.js → chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js} +7 -7
  35. package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.br +0 -0
  36. package/dist/browser/chunk-flow-view.f5d74c7f072b739a7a0ed86ff35cafa7b8a041233372d1eeaab9eb941ddfc11e.js.gz +0 -0
  37. package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js +4 -0
  38. package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.br +0 -0
  39. package/dist/browser/chunk-flows-extra-view.01ebf93780b729363eda11ba21c764fe593bcd3e684aa833c9b86147f780fd41.js.gz +0 -0
  40. package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js +6 -0
  41. package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.br +0 -0
  42. package/dist/browser/chunk-pages-bundle.e18059f0cb4fbb63e3698971d4c1830ad0945c3645235babc93010cd0b725c1d.js.gz +0 -0
  43. package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js +2 -0
  44. package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.br +0 -0
  45. package/dist/browser/chunk-result-view.fc6a6494b316aa786807b7d17035c59defae1bfb0c03bf9c3795679b3a35dd77.js.gz +0 -0
  46. package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js +20 -0
  47. package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.br +0 -0
  48. package/dist/browser/chunk-settings-view.6dd3a64ded7bd8c047650270918dfb455c9a514a5a40b84c7eb5f443f76fe66f.js.gz +0 -0
  49. package/dist/browser/{chunk-shared.85e1b9e0838ccc819e7b8368f80dd5240dda90f53ea2974a256a8fa4122ba2fb.js → chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js} +2 -2
  50. package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.br +0 -0
  51. package/dist/browser/chunk-shared.02c0b692de21a9bb80d1761aa887d8532431171945c02e663884c9f45b796753.js.gz +0 -0
  52. package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js +2 -0
  53. package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.br +0 -0
  54. package/dist/browser/chunk-shared.0874336833f8101a63b169d8c2e55ca0f281e43e65d4bd6604555c791ea9dd87.js.gz +0 -0
  55. package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js +2 -0
  56. package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.br +0 -0
  57. package/dist/browser/chunk-shared.2413dd78f32995fbca67f51ac8c21baf4727cd64f185ea739aa2a058e569b0ed.js.gz +0 -0
  58. package/dist/browser/{chunk-shared.26f6cbfdeb9bcd63231f23dbf96cacb39b78324aeed2503e86109efa89fa27db.js → chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js} +3 -3
  59. package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.br +0 -0
  60. package/dist/browser/chunk-shared.26bb0114998968cccb7bae5f6ffa8979ddecfafd8bc18bb6985760f6bcc030e6.js.gz +0 -0
  61. package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js +2 -0
  62. package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.br +0 -0
  63. package/dist/browser/chunk-shared.6d0b8728b3e309886cfb6eaf596d3f20592939e521bb60bb090824f34da6b086.js.gz +0 -0
  64. package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js +2 -0
  65. package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.br +0 -0
  66. package/dist/browser/chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js.gz +0 -0
  67. package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js +2 -0
  68. package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.br +0 -0
  69. package/dist/browser/chunk-shared.d1f25785c8c168cc75aa99c4be8ca56abfc5eafa3490f8817ff15e61cb901915.js.gz +0 -0
  70. package/dist/browser/{chunk-shared.5b47ca221b8b77b26ce8006f0569c981df2b905005cebe9fc54444d4906d436e.js → chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js} +3 -3
  71. package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.br +0 -0
  72. package/dist/browser/chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js.gz +0 -0
  73. package/dist/browser/{chunk-sonner.160372eb4f9455847ca83e8ff5d983c6b3010ef0dc2eaf541e2eaceaac3b994c.js → chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js} +1 -1
  74. package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.br +0 -0
  75. package/dist/browser/chunk-sonner.2472e1da55de10b11dc002c80a840966061e817c47793f5e216f1af6c6dbedff.js.gz +0 -0
  76. package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js +2 -0
  77. package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.br +0 -0
  78. package/dist/browser/chunk-task-view.bbeddc793a5e8a6d1f66b6cc5f0ce1da18414137e85c49ccd07be0e20f61ac12.js.gz +0 -0
  79. package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js +2 -0
  80. package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.br +0 -0
  81. package/dist/browser/chunk-team-chat.c3255a5a1d94e39d559c07438c4690543602b1552b2c2bf57b8791d7f989141d.js.gz +0 -0
  82. package/dist/browser/manifest.json +194 -194
  83. package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css +4 -0
  84. package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css.br +0 -0
  85. package/dist/browser/workspace.3043c4a6df23ed1c0c8be3fb816fa9410a2ab99053eb54476f22a1735c03ca97.css.gz +0 -0
  86. package/dist/browser/{workspace.efd01c3aaf8e07c4a64194e2bfbd7aee4f7fa515f2acebdfdd90af1badba8ce7.js → workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js} +4 -4
  87. package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.br +0 -0
  88. package/dist/browser/workspace.aebb60d4e5ef4509a80cfaccf0af5f7246867ec7531a1734dd8e28c59594950e.js.gz +0 -0
  89. package/dist/browser-open.js +1 -1
  90. package/dist/build-review.js +2 -2
  91. package/dist/builder.js +21 -14
  92. package/dist/canvas-capture.js +2 -2
  93. package/dist/canvas-freshness.js +1 -1
  94. package/dist/central-recovery-stage.js +1 -1
  95. package/dist/chat-actions.js +3 -3
  96. package/dist/chat-decide.js +8 -4
  97. package/dist/cli-help.js +8 -7
  98. package/dist/cli.js +2 -2
  99. package/dist/companion/bonjour.js +1 -1
  100. package/dist/companion/daemon.js +1 -1
  101. package/dist/companion/passkey-gate.js +1 -1
  102. package/dist/companion/reads.js +1 -1
  103. package/dist/companion/store.js +1 -1
  104. package/dist/companion/webauthn.js +1 -1
  105. package/dist/companion/work.js +1 -1
  106. package/dist/container-state.js +2 -2
  107. package/dist/containment.js +2 -2
  108. package/dist/contracts/chat-actions.js +1 -1
  109. package/dist/contracts/console-api.js +1 -1
  110. package/dist/contracts/engine-api.js +1 -1
  111. package/dist/controller-supervisor.js +2 -2
  112. package/dist/credential-broker.js +1 -1
  113. package/dist/demo.js +2 -2
  114. package/dist/easy-start.js +1 -1
  115. package/dist/egress.js +1 -1
  116. package/dist/engine-handoff.js +1 -1
  117. package/dist/engine-reads.js +1 -1
  118. package/dist/evals.js +2 -2
  119. package/dist/exec.js +4 -4
  120. package/dist/fast-owner-schema.js +33 -0
  121. package/dist/fast-start.js +1 -1
  122. package/dist/flow-unattended.js +2 -2
  123. package/dist/github-import.js +1 -1
  124. package/dist/github-read.js +1 -1
  125. package/dist/install-mode.js +2 -3
  126. package/dist/invoke.js +9 -7
  127. package/dist/laptop-background.js +1 -1
  128. package/dist/lead-capabilities.js +1 -1
  129. package/dist/live-backup-change.js +2 -2
  130. package/dist/live-backup.js +2 -2
  131. package/dist/live-terminal.js +3 -3
  132. package/dist/local-checks.js +1 -1
  133. package/dist/local-landing.js +22 -3
  134. package/dist/local-owner.js +1 -1
  135. package/dist/machine-identity.js +1 -1
  136. package/dist/model-catalog.js +8 -5
  137. package/dist/model-choices.js +3 -3
  138. package/dist/model-routing.js +1 -1
  139. package/dist/models-cli.js +2 -2
  140. package/dist/names.js +1 -1
  141. package/dist/onboard.js +1 -1
  142. package/dist/operate-remote-arguments.js +1 -1
  143. package/dist/operate.js +33 -16
  144. package/dist/orphan-sweep.js +1 -1
  145. package/dist/owner-mode.js +4 -0
  146. package/dist/peek-cli.js +2 -2
  147. package/dist/phase-routing.js +1 -1
  148. package/dist/pi-build.js +1 -1
  149. package/dist/plane-review.js +1 -1
  150. package/dist/planner-source.js +2 -2
  151. package/dist/planner.js +1 -1
  152. package/dist/pre-run-phase.js +1 -1
  153. package/dist/presence-hold.js +1 -1
  154. package/dist/process-liveness.js +1 -1
  155. package/dist/process-tree.js +1 -1
  156. package/dist/project-tools.js +2 -2
  157. package/dist/prompt.js +1 -1
  158. package/dist/proposal.js +1 -1
  159. package/dist/protected-storage.js +2 -2
  160. package/dist/provider-home.js +1 -1
  161. package/dist/provider-limits.js +1 -1
  162. package/dist/provider.js +2 -2
  163. package/dist/public-access.js +1 -1
  164. package/dist/pull-request-flow.js +2 -2
  165. package/dist/read-executor.js +1 -1
  166. package/dist/release-adapters.js +2 -2
  167. package/dist/release-carry.js +3 -3
  168. package/dist/release-resume.js +2 -2
  169. package/dist/release-start.js +1 -0
  170. package/dist/result-follow-ups.js +2 -2
  171. package/dist/review-switch.js +1 -1
  172. package/dist/route-change.js +25 -3
  173. package/dist/run-closeout.js +2 -2
  174. package/dist/runner.js +1 -1
  175. package/dist/sandbox-launch.js +2 -2
  176. package/dist/sandbox-runtime.js +1 -1
  177. package/dist/scope.js +1 -1
  178. package/dist/scout-browser.js +1 -1
  179. package/dist/serve.js +3 -3
  180. package/dist/server/chat.js +1 -1
  181. package/dist/server/direct-chat.js +1 -1
  182. package/dist/server/engine-api.js +1 -1
  183. package/dist/server/http.js +1 -1
  184. package/dist/server/one-time-secret.js +1 -1
  185. package/dist/server/route-table.js +1 -1
  186. package/dist/server/runtime.js +1 -1
  187. package/dist/server/settings-phone.js +1 -1
  188. package/dist/server/settings-section-table.js +1 -1
  189. package/dist/server/settings-sections.js +1 -1
  190. package/dist/server/settings.js +2 -1
  191. package/dist/server/task-view-data.js +3 -3
  192. package/dist/server/task-views.js +1 -1
  193. package/dist/server/tasks.js +5 -5
  194. package/dist/server/terminals.js +1 -1
  195. package/dist/settings-data.js +1 -1
  196. package/dist/settings-proofs.js +1 -1
  197. package/dist/shared-deps.js +4 -4
  198. package/dist/sign-in-page.js +2 -2
  199. package/dist/ssr-workspace.js +88 -88
  200. package/dist/staged-runtimes.js +1 -1
  201. package/dist/status-probe.js +2 -2
  202. package/dist/stop-proof.js +2 -2
  203. package/dist/storage-sweep-child.js +2 -2
  204. package/dist/storage-sweep-process.js +1 -1
  205. package/dist/storage.js +2 -2
  206. package/dist/store-baseline.js +5 -33
  207. package/dist/store.js +19 -14
  208. package/dist/subscription-usage.js +3 -3
  209. package/dist/surface.js +1 -1
  210. package/dist/test-temp.js +1 -1
  211. package/dist/tool-broker.js +1 -1
  212. package/dist/toolroll-update.js +3 -3
  213. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  214. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  215. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  216. package/dist/tui/linux-x64/toolroll-tui +0 -0
  217. package/dist/tui-launch.js +1 -1
  218. package/dist/welcome-facts.js +1 -1
  219. package/package.json +1 -1
  220. package/dist/browser/chunk-agents-live-view.e97fbf607cb8075aad7a48664556d11ea41469785f82384b5171b76c524f71e2.js.br +0 -0
  221. package/dist/browser/chunk-agents-live-view.e97fbf607cb8075aad7a48664556d11ea41469785f82384b5171b76c524f71e2.js.gz +0 -0
  222. package/dist/browser/chunk-bundle.48f442a2868e9b77e9f54c5b77f1bba629ccd1615de8a2f62619b811783314f6.js +0 -2
  223. package/dist/browser/chunk-bundle.48f442a2868e9b77e9f54c5b77f1bba629ccd1615de8a2f62619b811783314f6.js.br +0 -0
  224. package/dist/browser/chunk-bundle.48f442a2868e9b77e9f54c5b77f1bba629ccd1615de8a2f62619b811783314f6.js.gz +0 -0
  225. package/dist/browser/chunk-chat-parts.1669e6985c5c0c11eea6792ea177ea4c9f7e7ebf27bd3b31742feb6a26d5b2a5.js +0 -4
  226. package/dist/browser/chunk-chat-parts.1669e6985c5c0c11eea6792ea177ea4c9f7e7ebf27bd3b31742feb6a26d5b2a5.js.br +0 -0
  227. package/dist/browser/chunk-chat-parts.1669e6985c5c0c11eea6792ea177ea4c9f7e7ebf27bd3b31742feb6a26d5b2a5.js.gz +0 -0
  228. package/dist/browser/chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js.br +0 -0
  229. package/dist/browser/chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js.gz +0 -0
  230. package/dist/browser/chunk-flow-view.264e801af330461985aadcab42bc4ac4e036ba124394a7b5a100f2cd1edf89f0.js.br +0 -0
  231. package/dist/browser/chunk-flow-view.264e801af330461985aadcab42bc4ac4e036ba124394a7b5a100f2cd1edf89f0.js.gz +0 -0
  232. package/dist/browser/chunk-flows-extra-view.6761503a97e1f17b474703ff5687a8682c54f9db1715e0a9762a979030a1b036.js +0 -4
  233. package/dist/browser/chunk-flows-extra-view.6761503a97e1f17b474703ff5687a8682c54f9db1715e0a9762a979030a1b036.js.br +0 -0
  234. package/dist/browser/chunk-flows-extra-view.6761503a97e1f17b474703ff5687a8682c54f9db1715e0a9762a979030a1b036.js.gz +0 -0
  235. package/dist/browser/chunk-pages-bundle.365da73d009e3ced30b55bca7107f548dc832f7a9f52926d3dcd68aa5596da11.js +0 -6
  236. package/dist/browser/chunk-pages-bundle.365da73d009e3ced30b55bca7107f548dc832f7a9f52926d3dcd68aa5596da11.js.br +0 -0
  237. package/dist/browser/chunk-pages-bundle.365da73d009e3ced30b55bca7107f548dc832f7a9f52926d3dcd68aa5596da11.js.gz +0 -0
  238. package/dist/browser/chunk-result-view.d4dc562a1a6a52a1497e25300d5f80c220952ceb5bb719ca32ef8dc1e74a4124.js +0 -2
  239. package/dist/browser/chunk-result-view.d4dc562a1a6a52a1497e25300d5f80c220952ceb5bb719ca32ef8dc1e74a4124.js.br +0 -0
  240. package/dist/browser/chunk-result-view.d4dc562a1a6a52a1497e25300d5f80c220952ceb5bb719ca32ef8dc1e74a4124.js.gz +0 -0
  241. package/dist/browser/chunk-settings-view.ff302e1c5faf5486c96e5fc96fa32492da4153e6e19997ce7b718adab21bf3b7.js +0 -20
  242. package/dist/browser/chunk-settings-view.ff302e1c5faf5486c96e5fc96fa32492da4153e6e19997ce7b718adab21bf3b7.js.br +0 -0
  243. package/dist/browser/chunk-settings-view.ff302e1c5faf5486c96e5fc96fa32492da4153e6e19997ce7b718adab21bf3b7.js.gz +0 -0
  244. package/dist/browser/chunk-shared.152678a803cfb6dee935162fbbbdb38d031d80f1d32ce48610f37bc1c8621e49.js +0 -2
  245. package/dist/browser/chunk-shared.152678a803cfb6dee935162fbbbdb38d031d80f1d32ce48610f37bc1c8621e49.js.br +0 -0
  246. package/dist/browser/chunk-shared.152678a803cfb6dee935162fbbbdb38d031d80f1d32ce48610f37bc1c8621e49.js.gz +0 -0
  247. package/dist/browser/chunk-shared.26f6cbfdeb9bcd63231f23dbf96cacb39b78324aeed2503e86109efa89fa27db.js.br +0 -0
  248. package/dist/browser/chunk-shared.26f6cbfdeb9bcd63231f23dbf96cacb39b78324aeed2503e86109efa89fa27db.js.gz +0 -0
  249. package/dist/browser/chunk-shared.4e21c6b33b9a525e63c360d20a1830f1a26c5021f5d218f2300f21ff840af27e.js +0 -2
  250. package/dist/browser/chunk-shared.4e21c6b33b9a525e63c360d20a1830f1a26c5021f5d218f2300f21ff840af27e.js.br +0 -0
  251. package/dist/browser/chunk-shared.4e21c6b33b9a525e63c360d20a1830f1a26c5021f5d218f2300f21ff840af27e.js.gz +0 -0
  252. package/dist/browser/chunk-shared.5b47ca221b8b77b26ce8006f0569c981df2b905005cebe9fc54444d4906d436e.js.br +0 -0
  253. package/dist/browser/chunk-shared.5b47ca221b8b77b26ce8006f0569c981df2b905005cebe9fc54444d4906d436e.js.gz +0 -0
  254. package/dist/browser/chunk-shared.85e1b9e0838ccc819e7b8368f80dd5240dda90f53ea2974a256a8fa4122ba2fb.js.br +0 -0
  255. package/dist/browser/chunk-shared.85e1b9e0838ccc819e7b8368f80dd5240dda90f53ea2974a256a8fa4122ba2fb.js.gz +0 -0
  256. package/dist/browser/chunk-shared.a326d625dea5cda744678a73b38c0cb2688721c9228e26d262279ecd5c2d7d11.js +0 -2
  257. package/dist/browser/chunk-shared.a326d625dea5cda744678a73b38c0cb2688721c9228e26d262279ecd5c2d7d11.js.br +0 -0
  258. package/dist/browser/chunk-shared.a326d625dea5cda744678a73b38c0cb2688721c9228e26d262279ecd5c2d7d11.js.gz +0 -0
  259. package/dist/browser/chunk-shared.e906e9c8c0859e000616dbc382f88597447f30205c92b7cb9a8e2351f3ef2722.js +0 -2
  260. package/dist/browser/chunk-shared.e906e9c8c0859e000616dbc382f88597447f30205c92b7cb9a8e2351f3ef2722.js.br +0 -0
  261. package/dist/browser/chunk-shared.e906e9c8c0859e000616dbc382f88597447f30205c92b7cb9a8e2351f3ef2722.js.gz +0 -0
  262. package/dist/browser/chunk-shared.f6354151d62439f2d78f5d17cf9bc44f35b4da37685beb77467d98dd9cc6f1e4.js +0 -2
  263. package/dist/browser/chunk-shared.f6354151d62439f2d78f5d17cf9bc44f35b4da37685beb77467d98dd9cc6f1e4.js.br +0 -0
  264. package/dist/browser/chunk-shared.f6354151d62439f2d78f5d17cf9bc44f35b4da37685beb77467d98dd9cc6f1e4.js.gz +0 -0
  265. package/dist/browser/chunk-sonner.160372eb4f9455847ca83e8ff5d983c6b3010ef0dc2eaf541e2eaceaac3b994c.js.br +0 -0
  266. package/dist/browser/chunk-sonner.160372eb4f9455847ca83e8ff5d983c6b3010ef0dc2eaf541e2eaceaac3b994c.js.gz +0 -0
  267. package/dist/browser/chunk-task-view.325b506afc26b25147b2e90cec5ad1392d50e6150a7fb33c81a996daa99bb05a.js +0 -2
  268. package/dist/browser/chunk-task-view.325b506afc26b25147b2e90cec5ad1392d50e6150a7fb33c81a996daa99bb05a.js.br +0 -0
  269. package/dist/browser/chunk-task-view.325b506afc26b25147b2e90cec5ad1392d50e6150a7fb33c81a996daa99bb05a.js.gz +0 -0
  270. package/dist/browser/chunk-team-chat.d560bcc5d819e63133d377b8a6f10f901356e680771f19d4fe1af044adfffb22.js +0 -2
  271. package/dist/browser/chunk-team-chat.d560bcc5d819e63133d377b8a6f10f901356e680771f19d4fe1af044adfffb22.js.br +0 -0
  272. package/dist/browser/chunk-team-chat.d560bcc5d819e63133d377b8a6f10f901356e680771f19d4fe1af044adfffb22.js.gz +0 -0
  273. package/dist/browser/workspace.ac1270b58f672fa920535348cc582f5fc68247b341d6fc8ec733b25336f2b9cc.css +0 -4
  274. package/dist/browser/workspace.ac1270b58f672fa920535348cc582f5fc68247b341d6fc8ec733b25336f2b9cc.css.br +0 -0
  275. package/dist/browser/workspace.ac1270b58f672fa920535348cc582f5fc68247b341d6fc8ec733b25336f2b9cc.css.gz +0 -0
  276. package/dist/browser/workspace.efd01c3aaf8e07c4a64194e2bfbd7aee4f7fa515f2acebdfdd90af1badba8ce7.js.br +0 -0
  277. package/dist/browser/workspace.efd01c3aaf8e07c4a64194e2bfbd7aee4f7fa515f2acebdfdd90af1badba8ce7.js.gz +0 -0
@@ -1,5 +1,5 @@
1
1
  /*! Third-party notices: /assets/THIRD_PARTY_NOTICES.txt */
2
- import{p6$a as Ns,p6$b as ue}from"./chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js";import{a as Ve}from"./chunk-shared.4e21c6b33b9a525e63c360d20a1830f1a26c5021f5d218f2300f21ff840af27e.js";import{a as Ke,f as Ge,g as _e}from"./chunk-shared.5b47ca221b8b77b26ce8006f0569c981df2b905005cebe9fc54444d4906d436e.js";import{p9$a as me,p9$b as X,p9$c as Z,p9$d as ks,p9$e as $s,p9$f as Cs,p9$g as pe,p9$h as xe,p9$i as Ss}from"./chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js";import{p10$A as Ts,p10$B as Rs,p10$C as Ls,p10$D as q,p10$E as Is,p10$F as As,p10$G as Ps,p10$H as Hs,p10$I as Us,p10$J as Ms,p10$a as zs,p10$b as Ws,p10$c as Ds,p10$d as Os,p10$e as fe,p10$f as je,p10$g as ge,p10$h as Es,p10$i as Bs,p10$j as Vs,p10$k as Ks,p10$l as Gs,p10$m as _s,p10$n as Js,p10$o as Ys,p10$p as Qs,p10$q as Xs,p10$r as Zs,p10$s as ea,p10$t as sa,p10$u as aa,p10$v as na,p10$w as la,p10$x as ta,p10$y as ra,p10$z as ia}from"./chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js";import{p11$a as B,p11$b as ee}from"./chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js";import{p1$$ as ua,p1$$a as ma,p1$$b as pa,p1$A as xa,p1$Aa as fa,p1$Ab as ja,p1$B as ga,p1$Ba as ba,p1$Bb as va,p1$C as Na,p1$Ca as wa,p1$Cb as ya,p1$D as ka,p1$Da as $a,p1$Db as Ca,p1$E as Sa,p1$Ea as Fa,p1$Eb as qa,p1$F as Ta,p1$Fa as Ra,p1$Fb as La,p1$G as N,p1$Ga as Ia,p1$Gb as Aa,p1$H as Pa,p1$Ha as Ha,p1$Hb as Ua,p1$I as Ma,p1$Ia as za,p1$Ib as Wa,p1$J as Da,p1$Ja as Oa,p1$Jb as Ea,p1$K as Ba,p1$Ka as Va,p1$Kb as Ka,p1$L as Ga,p1$La as _a,p1$Lb as Ja,p1$M as se,p1$Ma as Ya,p1$Mb as Qa,p1$N as ae,p1$Na as Xa,p1$Nb as Za,p1$O as D,p1$Oa as en,p1$Ob as sn,p1$P as be,p1$Pa as an,p1$Pb as nn,p1$Q as ve,p1$Qa as ln,p1$Qb as tn,p1$R as Ne,p1$Ra as rn,p1$Rb as cn,p1$S as we,p1$Sa as on,p1$Sb as dn,p1$T as hn,p1$Ta as un,p1$Tb as mn,p1$U as pn,p1$Ua as xn,p1$Ub as fn,p1$V as jn,p1$Va as gn,p1$Vb as bn,p1$W as vn,p1$Wa as Nn,p1$Wb as wn,p1$X as yn,p1$Xa as kn,p1$Xb as $n,p1$Y as Cn,p1$Ya as ye,p1$Yb as Sn,p1$Z as Fn,p1$Za as qn,p1$Zb as Tn,p1$_ as Rn,p1$_a as Ln,p1$_b as In,p1$a as b,p1$aa as An,p1$ab as C,p1$ac as Pn,p1$b as Hn,p1$ba as Un,p1$bb as V,p1$bc as Mn,p1$c as zn,p1$ca as Wn,p1$cb as Dn,p1$cc as On,p1$d as En,p1$da as Bn,p1$db as Vn,p1$dc as Kn,p1$e as T,p1$ea as Gn,p1$eb as _n,p1$ec as Jn,p1$f as ke,p1$fa as Yn,p1$fb as Qn,p1$fc as Xn,p1$g as Zn,p1$ga as el,p1$gb as sl,p1$gc as al,p1$h as nl,p1$ha as ll,p1$hb as tl,p1$hc as rl,p1$i as il,p1$ia as cl,p1$ib as ol,p1$ic as dl,p1$j as hl,p1$ja as ul,p1$jb as ml,p1$jc as pl,p1$k as ne,p1$ka as xl,p1$kb as fl,p1$kc as jl,p1$l as gl,p1$la as bl,p1$lb as vl,p1$lc as Nl,p1$m as wl,p1$ma as yl,p1$mb as kl,p1$n as $l,p1$na as Cl,p1$nb as Sl,p1$o as Fl,p1$oa as ql,p1$ob as Tl,p1$p as Rl,p1$pa as Ll,p1$pb as Il,p1$q as O,p1$qa as Al,p1$qb as Pl,p1$r as Hl,p1$ra as Ul,p1$rb as Ml,p1$s as zl,p1$sa as Wl,p1$sb as Dl,p1$t as Ol,p1$ta as El,p1$tb as Bl,p1$u as Vl,p1$ua as Kl,p1$ub as Gl,p1$v as _l,p1$va as Jl,p1$vb as Yl,p1$w as Ql,p1$wa as Xl,p1$wb as Zl,p1$x as et,p1$xa as st,p1$xb as at,p1$y as nt,p1$ya as lt,p1$yb as tt,p1$z as rt,p1$za as $e,p1$zb as it}from"./chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js";import{p2$a as dt,p2$b as P,p2$c as le,p2$d as Ce,p2$e as te}from"./chunk-core.64343d638685133eb96578bfb35bf560f329d0743ac5deda720ae27f5699c9d9.js";var E=P(le(),1),Le=P(Ce(),1);function ie(s){switch(s){case"attention":return"attention";case"problem":return"danger";case"live":return"info";case"ready":case"done":return"success";default:return"neutral"}}var $=P(le(),1),e=P(te(),1);function G({iso:s}){return(0,e.jsx)("time",{dateTime:s,title:ee(s),children:B(s)})}function Je(){return(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,e.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),(0,e.jsx)("path",{d:"M8 10h8"})]})}function Ye({runId:s,shot:n}){return(0,e.jsxs)("figure",{className:"result-image",children:[(0,e.jsxs)("a",{className:"receipt-shot",href:`/r/${s}/evidence/${n.artifactId}`,children:[(0,e.jsx)("img",{src:`/r/${s}/evidence/${n.artifactId}`,alt:n.caption}),(0,e.jsx)("span",{children:n.caption})]}),n.commentable&&n.sha256!==void 0&&(0,e.jsx)("button",{type:"button",className:"quiet","data-comment-image":JSON.stringify({run:s,artifact:n.artifactId,sha256:n.sha256}),"data-image-caption":n.caption,children:"Comment"})]})}function y({fields:s}){return(0,e.jsx)(e.Fragment,{children:Object.entries(s).map(([n,l])=>l==null?null:(0,e.jsx)("input",{type:"hidden",name:n,value:String(l)},n))})}function Qe({control:s,className:n}){return s.kind==="link"?(0,e.jsx)(V,{href:s.href,label:s.label,className:n}):(0,e.jsxs)(N,{action:s.action,className:n,children:[(0,e.jsx)(y,{fields:{...s.fields,...s.returnTo===void 0?{}:{return:s.returnTo}}}),(0,e.jsx)(C,{type:"submit",label:s.label})]})}function Xe({intent:s,className:n}){return(0,e.jsxs)("div",{className:n,children:[(0,e.jsxs)("p",{className:"recap mt-1",children:[(0,e.jsx)("strong",{children:"Goal"})," ",s.goal]}),s.outOfScope===null?(0,e.jsx)("p",{className:"meta",children:"No boundary was stated"}):(0,e.jsxs)("p",{className:"recap",children:[(0,e.jsx)("strong",{children:"Not this"})," ",s.outOfScope]}),s.touches.length===0?(0,e.jsx)("p",{className:"meta",children:"No files were named in the plan, so every changed file is in bounds"}):(0,e.jsxs)("p",{className:"row",children:[(0,e.jsx)("span",{className:"meta",children:"Expected to touch"})," ",s.touches.map((l,i)=>(0,e.jsxs)($.Fragment,{children:[i>0&&" ",(0,e.jsx)("span",{className:"mono",children:l})]},l))]}),s.plan!==null&&(0,e.jsxs)("p",{className:"meta",children:["Plan revision ",s.plan.revision," · ",(0,e.jsx)("span",{className:"mono",children:s.plan.shaShort}),s.plan.approach===null?"":` — ${s.plan.approach}`]})]})}var Ie=({history:s})=>(0,e.jsx)($e,{history:s,tight:!0});function Ae({runId:s,shots:n,className:l}){let{pairs:i,rest:t}=ae(n.map(d=>({...d,src:`/r/${s}/evidence/${d.artifactId}`,href:`/r/${s}/evidence/${d.artifactId}`,...d.commentable&&d.sha256!==void 0?{commentPayload:JSON.stringify({run:s,artifact:d.artifactId,sha256:d.sha256})}:{}})));return(0,e.jsxs)(e.Fragment,{children:[i.map(d=>(0,e.jsx)(se,{label:d.label,before:{src:d.before.src,href:d.before.href,caption:d.before.caption,...d.before.commentPayload===void 0?{}:{commentPayload:d.before.commentPayload}},after:{src:d.after.src,href:d.after.href,caption:d.after.caption,...d.after.commentPayload===void 0?{}:{commentPayload:d.after.commentPayload}}},d.key)),t.length>0&&(0,e.jsx)("div",{className:l??"receipt-visuals","aria-label":"validated screenshots",children:t.map(d=>(0,e.jsx)(Ye,{runId:s,shot:d},d.artifactId))})]})}function Pe({summary:s}){let{report:n,screenshots:l,unavailableShots:i,filesLead:t,noChangeNote:d,agentAccount:r,followUps:o,details:c}=s,h=c.runId;return(0,e.jsxs)("div",{className:"so-result-view",children:[n!==null&&(n.state==="missing"?(0,e.jsx)("p",{className:"problem","data-result-report":"missing",children:"This investigation stored no report."}):n.state==="problem"?(0,e.jsxs)("p",{className:"problem","data-result-report":"problem",children:["The report cannot be shown: ",n.problem,"."]}):(0,e.jsxs)("article",{className:"result-report","data-result-report":"ok",children:[(0,e.jsx)("h3",{children:n.title}),(n.items.length>0||n.shots.length>0)&&(()=>{let u=new Set(n.items.map(p=>p.image).filter(p=>p!==null)),x=n.shots.filter(p=>!u.has(p.file)),f=(p,j)=>p.artifactId===null?(0,e.jsxs)("p",{className:"meta",children:["Screenshot unavailable: ",p.problem??"it can't be shown"]},j):(0,e.jsxs)("a",{className:"receipt-shot",href:`/r/${h}/evidence/${p.artifactId}`,children:[(0,e.jsx)("img",{src:`/r/${h}/evidence/${p.artifactId}`,alt:p.caption,loading:"lazy"}),(0,e.jsx)("span",{children:p.caption})]},j);return(0,e.jsxs)("div",{className:"report-items","data-report-items":n.items.length,children:[n.items.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:"What it found"})}),(0,e.jsx)("ol",{children:n.items.map((p,j)=>{let m=p.image===null?void 0:n.shots.find(v=>v.file===p.image);return(0,e.jsxs)("li",{"data-report-item":"",children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:p.title})}),(0,e.jsx)("p",{className:"meta",children:p.why}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:p.url,rel:"noopener noreferrer nofollow",target:"_blank",className:"report-link",children:p.url})}),m!==void 0&&(0,e.jsx)("div",{className:"receipt-visuals",children:f(m)})]},j)})})]}),x.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:"Screenshots"})}),(0,e.jsx)("div",{className:"receipt-visuals","aria-label":"the scout's screenshots",children:x.map((p,j)=>f(p,j))})]})]})})(),(0,e.jsx)("pre",{className:"recap plan-doc",children:n.document}),(0,e.jsxs)("p",{className:"meta",children:[(0,e.jsx)("a",{href:`/r/${h}/evidence/${n.artifactId}`,children:n.truncated?"Download the stored part of the report (shortened at storage — not the full report)":"Download the report"}),n.followUps>0&&(0,e.jsxs)(e.Fragment,{children:[" · ",n.followUps," proposed follow-up",n.followUps===1?"":"s"," on ",(0,e.jsx)("a",{href:n.taskHref,children:"the task"})]})]})]})),s.lead==="screenshots"&&(0,e.jsx)(Ae,{runId:h,shots:l,className:"receipt-visuals result-visuals"}),t!==null&&(0,e.jsxs)("p",{className:"result-files-lead",children:[t.paths.length>0&&(0,e.jsxs)(e.Fragment,{children:[t.paths.map((u,x)=>(0,e.jsxs)($.Fragment,{children:[x>0&&", ",(0,e.jsx)("span",{className:"mono",children:u})]},u)),t.more>0&&` and ${t.more} more`," — "]}),(0,e.jsx)("a",{href:t.changesHref,"data-result-goto":"changes",children:"see the diff"})]}),d!==null&&(0,e.jsx)("p",{className:"meta",children:d}),r!==null&&(0,e.jsxs)("details",{className:"result-notes","data-result-notes-agent":"",children:[(0,e.jsx)("summary",{children:"What the agent reported"}),r.conclusion!==null&&(0,e.jsx)("p",{className:"recap",children:r.conclusion}),r.changes.length>0&&(0,e.jsx)("ul",{className:"result-changes",children:r.changes.map((u,x)=>(0,e.jsx)("li",{children:u},x))}),r.verification.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:"Checked by the agent:"}),(0,e.jsx)("ul",{className:"result-changes","data-cockpit-source":"agent-words",children:r.verification.map((u,x)=>(0,e.jsx)("li",{children:u},x))})]}),r.reportNotes.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:"Its notes:"}),(0,e.jsx)("ol",{className:"result-changes","data-report-notes":"",children:r.reportNotes.map((u,x)=>(0,e.jsx)("li",{id:`report-note-${x+1}`,children:u},x))})]})]}),o.length>0&&(0,e.jsxs)("details",{className:"result-notes","data-review-followups":o.length,children:[(0,e.jsxs)("summary",{children:["Suggested follow-ups · ",o.length]}),(0,e.jsx)("ul",{className:"result-changes",children:o.map((u,x)=>(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:"badge",children:u.severity})," ",(0,e.jsx)("span",{className:"mono",children:`${u.file}:${u.line}`})," ",u.scenario,u.sendAction!==null&&(0,e.jsxs)(N,{action:u.sendAction,children:[(0,e.jsx)(y,{fields:{act:"send",pointer:u.pointer}}),(0,e.jsx)("button",{type:"submit",className:"secondary",children:"Send to the agent"})]})]},x))})]}),(0,e.jsxs)("details",{className:"result-details","data-result-details":"",children:[(0,e.jsx)("summary",{children:"Build details"}),i.length>0&&(0,e.jsx)("ul",{className:"result-unavailable meta","data-result-unavailable":i.length,children:i.map((u,x)=>(0,e.jsxs)("li",{children:["Screenshot unavailable — ",(0,e.jsx)("span",{className:"mono",children:u.path}),": ",u.problem]},x))}),(0,e.jsxs)("dl",{className:"result-facts",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Build"}),(0,e.jsxs)("dd",{children:["#",h," · ",c.runner,c.agent===null?` · ${c.provider}`:"",c.finishedAt!==null&&(0,e.jsxs)(e.Fragment,{children:[" · ",(0,e.jsx)(G,{iso:c.finishedAt})]})]})]}),c.agent!==null&&(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Agent"}),(0,e.jsx)("dd",{children:c.agent})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Commits"}),(0,e.jsx)("dd",{children:c.head===null?c.base===null?"no commit recorded":(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"mono",children:c.base.slice(0,7)})," ",(0,e.jsx)("span",{className:"meta",children:"base · no head recorded"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("span",{className:"mono",children:[c.base===null?"":`${c.base.slice(0,7)} → `,c.head.slice(0,7)]})," ",(0,e.jsxs)("span",{className:"meta",children:["from the ",c.headSource??"record"]})]})})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Saved files"}),(0,e.jsx)("dd",{children:c.evidenceSources.length===0?"nothing was captured":c.evidenceSources.join(" · ")})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Publication"}),(0,e.jsx)("dd",{children:(0,e.jsxs)("p",{className:"result-publication","data-receipt-publication":c.publication.state,children:[c.publication.words,c.publication.prNumber!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",c.publication.prUrl===null?(0,e.jsxs)("span",{className:"mono",children:["PR #",c.publication.prNumber]}):(0,e.jsxs)("a",{href:c.publication.prUrl,children:["PR #",c.publication.prNumber]}),(0,e.jsxs)("span",{className:"meta","data-ci-observed":c.publication.ciState,children:[" · ",c.publication.ciFailing?"CI failing at the last check":c.publication.ciState==="passing"&&c.publication.lastCheckAt!==null?(0,e.jsxs)(e.Fragment,{children:["CI passing, observed ",(0,e.jsx)(G,{iso:c.publication.lastCheckAt})]}):c.publication.ciState==="running"?"CI still running at the last check":"no CI checks found — verify on GitHub"]})]})]})})]})]}),(0,e.jsx)("p",{className:"result-links meta",children:c.links.map(u=>(0,e.jsx)("a",{href:u.href,children:u.label},u.href))})]})]})}function Se({path:s,oldPath:n,hunks:l,anchor:i,commentable:t}){return(0,e.jsxs)(e.Fragment,{children:[n!==null&&n!=="/dev/null"&&n!==s&&(0,e.jsxs)("p",{className:"diff-rename meta",children:["from ",n]}),l.map((d,r)=>{let o=d.lines.find(h=>h.newLine!==null&&h.kind!=="meta")?.newLine??null,c=i!==null&&o!==null?`${i}-L${o}`:void 0;return(0,e.jsxs)("section",{className:"diff-hunk",id:c,children:[(0,e.jsx)("div",{className:"diff-hunk-head",children:d.header}),(0,e.jsx)("div",{className:"diff-lines",children:d.lines.map((h,u)=>{let x=h.newLine??h.oldLine,f=h.newLine===null&&h.oldLine!==null?"old":"new",p=t&&x!==null&&h.kind!=="meta",j=h.kind==="addition"?"+":h.kind==="deletion"?"−":h.kind==="context"?" ":"·",m=x!==null&&h.kind!=="meta";return(0,e.jsxs)("div",{className:`diff-line diff-${h.kind}`,...m?{"data-diff-file":s,"data-diff-line":x}:{},children:[p?(0,e.jsx)("button",{type:"button",className:"diff-annotate pick-line","data-path":s,"data-line":x,"data-side":f,"aria-label":`Annotate ${s}, ${f} line ${x}`,title:"Annotate this line",children:(0,e.jsx)(Je,{})}):(0,e.jsx)("span",{className:"diff-annotate-space"}),(0,e.jsx)("span",{className:"diff-gutter",children:h.oldLine??""}),(0,e.jsx)("span",{className:"diff-gutter",children:h.newLine??""}),(0,e.jsxs)("code",{children:[(0,e.jsx)("b",{"aria-hidden":"true",children:j}),h.text]})]},u)})})]},r)})]})}function Ze({file:s,defaultOpen:n,commentable:l}){let[i,t]=(0,$.useState)(null),[d,r]=(0,$.useState)("idle"),[o,c]=(0,$.useState)(n),h=async()=>{if(!(s.lazyHref===null||i!==null||d==="loading")){r("loading");try{let x=s.lazyHref.includes("?")?"&":"?",f=await fetch(`${s.lazyHref}${x}format=json`,{credentials:"same-origin",headers:{accept:"application/json"}});if(!f.ok){r("error");return}let p=await f.json();t(p),r("idle")}catch{r("error")}}};(0,$.useEffect)(()=>{if(s.lazyHref===null||s.anchor===null)return;let x=()=>{let p=window.location.hash.slice(1);return p===s.anchor||p.startsWith(`${s.anchor}-L`)},f=()=>{x()&&(c(!0),h())};return f(),window.addEventListener("hashchange",f),()=>window.removeEventListener("hashchange",f)},[s.lazyHref,s.anchor]);let u=s.additions===null||s.deletions===null?s.additions===null&&s.deletions===null?null:(0,e.jsx)("span",{className:"diff-file-counts",children:"binary"}):(0,e.jsxs)("span",{className:"diff-file-counts",children:[(0,e.jsxs)("b",{children:["+",s.additions]}),(0,e.jsxs)("i",{children:["−",s.deletions]})]});return(0,e.jsxs)("details",{className:"diff-file",id:s.anchor??void 0,open:o,...s.lazyHref!==null?{"data-diff-lazy":s.lazyHref}:{},...s.lazyHref!==null&&i!==null?{"data-diff-loaded":""}:{},onToggle:x=>{let f=x.currentTarget.open;c(f),f&&s.lazyHref!==null&&i===null&&h()},children:[(0,e.jsxs)("summary",{children:[(0,e.jsx)("span",{className:"diff-file-name",children:s.path}),u]}),s.lazyHref===null?(0,e.jsx)(Se,{path:s.path,oldPath:s.oldPath,hunks:s.hunks,anchor:s.anchor,commentable:l}):i!==null?(0,e.jsx)(Se,{path:s.path,oldPath:i.oldPath,hunks:i.hunks,anchor:i.anchor,commentable:i.commentable}):(0,e.jsx)("div",{children:(0,e.jsx)("p",{className:"meta diff-lazy",children:d==="loading"?"Loading this file's changes…":d==="error"?(0,e.jsx)("a",{href:s.lazyHref,"data-full-load":"",children:"Could not load changes. Open directly"}):(0,e.jsx)("a",{href:s.lazyHref,"data-full-load":"",onClick:x=>{x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||x.button!==0||(x.preventDefault(),c(!0),h())},children:"Show this file's changes"})})})]})}function He({changes:s}){let[n,l]=(0,$.useState)("view"),{stat:i,outsideTouches:t,files:d,canAnnotate:r,hasEditorLinks:o,diff:c}=s;return(0,e.jsx)("div",{className:"so-result-view",children:s.noTerminal?(0,e.jsxs)("p",{className:"meta",children:["No final diff or change summary was captured for this build",s.scout?" — an investigation changes nothing in the repository":"","."]}):(0,e.jsxs)(e.Fragment,{children:[i===null?(0,e.jsx)("p",{className:"meta",children:"No change summary was captured."}):"problem"in i?(0,e.jsxs)("p",{className:"problem",children:["Change summary unavailable: ",i.problem,"."]}):(0,e.jsxs)("p",{className:"row result-stat",children:[(0,e.jsxs)("span",{className:"mono",children:[i.baseShort," → ",i.headShort]})," — ",i.fileCount===0?"no changes, verified":`${i.fileCount} file${i.fileCount===1?"":"s"} · +${i.additions} −${i.deletions}${i.binaryCount>0?` · ${i.binaryCount} binary`:""}${i.filesTruncated?" · file list cut, counts complete":""}`]}),t.length>0&&(0,e.jsxs)("p",{className:"problem cockpit-drift","data-cockpit-drift":t.length,children:[(0,e.jsxs)("strong",{children:[t.length," changed file",t.length===1?"":"s"," outside the approved paths"]})," — ",t.map((h,u)=>(0,e.jsxs)($.Fragment,{children:[u>0&&", ",(0,e.jsx)("span",{className:"mono",children:h})]},h)),". Review these files before accepting the result."]}),d.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("ol",{className:"cockpit-files result-files",children:d.map(h=>{let u=h.additions===null||h.deletions===null?"binary":`+${h.additions} −${h.deletions}`;return(0,e.jsxs)("li",{"data-file-priority":h.priorityBand,children:[h.editorHref!==null?(0,e.jsx)("a",{className:"mono",href:h.editorHref,children:h.path}):h.anchor===null?(0,e.jsx)("span",{className:"mono",children:h.path}):(0,e.jsx)("a",{className:"mono",href:`#${h.anchor}`,children:h.path}),h.renamedFrom!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsxs)("span",{className:"meta",children:["(was ",h.renamedFrom,")"]})]})," ",(0,e.jsx)("span",{className:"meta",children:u}),h.outsideTouches&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("span",{className:"badge badge-failed","data-outside-touches":"1",children:"Outside touches"})]}),h.cited&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("span",{className:"badge badge-done",children:"Cited"})]}),r&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("button",{type:"button",className:"pick-file","data-path":h.path,children:"Comment"})]}),h.priorityReasons.length>0&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsxs)("span",{className:"meta",children:["— ",h.priorityReasons.join("; ")]})]})]},h.path)})}),o&&(0,e.jsx)("p",{className:"meta",children:"File links open in VS Code on THIS device — if the build's worktree is gone, a link opens nothing."})]}),c.kind==="none"?(0,e.jsx)("p",{className:"meta",children:"The final diff was not captured for this build."}):c.kind==="problem"?(0,e.jsxs)("p",{className:"problem",children:["Diff unavailable: ",c.problem,"."]}):c.kind==="empty"?(0,e.jsx)("p",{className:"meta",children:"Empty diff — captured successfully, nothing changed."}):c.kind==="raw"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("details",{children:[(0,e.jsxs)("summary",{children:["The patch",c.truncated?" (TRUNCATED — the raw record says how much was cut)":""]}),(0,e.jsx)("pre",{className:"mono overflow-x-auto",children:c.text})]}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:c.downloadHref,children:c.downloadLabel})})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"diff-review","data-review-diff":"","data-mode":c.commentable?n:void 0,children:[c.commentable&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"diff-review-bar",children:[(0,e.jsxs)("span",{className:"meta",children:[c.files.length," changed file",c.files.length===1?"":"s"]}),(0,e.jsxs)("div",{className:"diff-modes",role:"group","aria-label":"diff mode",children:[(0,e.jsx)("button",{type:"button","data-diff-mode":"view","aria-pressed":n==="view"?"true":"false",onClick:()=>l("view"),children:"View"}),(0,e.jsx)("button",{type:"button","data-diff-mode":"annotate","aria-pressed":n==="annotate"?"true":"false",onClick:()=>l("annotate"),children:"Annotate"})]})]}),(0,e.jsx)("p",{className:"diff-review-help",children:"Select a line, then describe what should change. Nothing is revised until you create the revision below."})]}),c.files.map((h,u)=>(0,e.jsx)(Ze,{file:h,defaultOpen:u===0,commentable:c.commentable},h.path)),c.patchTruncated?(0,e.jsx)("p",{className:"diff-cut",children:"The saved diff was shortened when it was stored: the rest of the change was never captured, here or in the download."}):c.linesTruncated?(0,e.jsx)("p",{className:"diff-cut",children:"This visual diff is shortened. Review the saved patch before approving."}):null]}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:c.downloadHref,children:c.downloadLabel})})]})]})})}function Fe({items:s}){return(0,e.jsx)("ul",{children:s.map((n,l)=>(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:`badge${n.isProblem?" badge-failed":""}`,children:n.severity})," ",n.path!==null&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("span",{className:"mono",children:[n.path,n.line===null?"":`:${n.line}`]})," "]}),n.note," ",(0,e.jsxs)("span",{className:"meta",children:["— ",n.author]}),n.canRequestChange&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("button",{type:"button",className:"pick-file","data-path":n.path??"","data-line":n.line===null?"":String(n.line),"data-review-note":n.note,children:"Request change"})]})]},l))})}function Ue({checks:s,runId:n}){let{repairChain:l}=s,i=l===null?null:l.outcome==="drafted"?l.draftTask===null?"No fix could be prepared":`Targeted fix ${l.basis==="mode"?"approved automatically":"ready for your approval"}`:l.outcome==="resolved"?`Completed on attempt ${l.attempt}`:l.outcome==="attempts-spent"?`Stopped after ${l.attempt} attempt${l.attempt===1?"":"s"}`:l.outcome==="no-progress"?"Stopped because two attempts made no progress":"Stopped because what the build reported may not match the approved work";return(0,e.jsxs)("div",{className:"so-result-view",children:[!s.hasProof&&s.previousAssessment.length>0&&(0,e.jsxs)("div",{className:"result-section","data-cockpit-source":"reviewer",children:[(0,e.jsx)("strong",{children:"Previous assessment"}),(0,e.jsx)(Fe,{items:s.previousAssessment})]}),s.noChangeNoDirect&&(0,e.jsx)("p",{className:"meta",children:"The build concluded that no repository change was needed. With no change, its handoff and the saved diff are the record."}),s.hasProof?(0,e.jsxs)(e.Fragment,{children:[s.verdictLine!==null&&(0,e.jsx)("p",{className:"row result-verdict","data-proof-verdict":s.verdictLine.token,...s.verdictLine.checkNow!==null?{"data-check-now":s.verdictLine.checkNow}:{},children:(0,e.jsx)("span",{className:"meta",children:s.verdictLine.words})}),s.acceptedLine!==null&&(0,e.jsxs)("p",{className:"meta",children:[s.acceptedLine.humanReview?"Accepted after human review":"Accepted with an exception"," by ",(0,e.jsx)("span",{className:"mono",children:s.acceptedLine.by})," · ",(0,e.jsx)(G,{iso:s.acceptedLine.at}),s.acceptedLine.note!==null&&` — ${s.acceptedLine.note}`]}),s.matrix.length===0?(0,e.jsx)("p",{className:"meta",children:s.signedCriteriaCount>0?`The approved plan has ${s.signedCriteriaCount} requirement${s.signedCriteriaCount===1?"":"s"}, but this build wasn't checked requirement by requirement.`:"This plan names no requirements to check."}):(0,e.jsxs)("div",{className:"result-section criterion-matrix",children:[(0,e.jsxs)("strong",{children:["Requirements · ",s.matrix.length]}),(0,e.jsx)("ol",{className:"requirement-list",children:s.matrix.map((t,d)=>(0,e.jsxs)("li",{className:"requirement","data-criterion-id":t.id,children:[(0,e.jsxs)("div",{className:"requirement-heading",children:[(0,e.jsxs)("span",{children:["Requirement ",d+1]}),(0,e.jsx)("span",{className:`badge ${t.badgeClass}`,"data-matrix-state":t.state,children:t.label})]}),(0,e.jsx)("p",{className:"requirement-statement",children:t.statement}),t.upheldOnly&&(0,e.jsx)("p",{className:"requirement-review","data-review-judgement":"upholds",children:"Reviewer confirmed"}),!t.awaitingAssessment&&t.state!=="pass"&&t.label!=="Met"&&t.label!=="Checked at release"&&t.detail.length>0&&(0,e.jsx)("ul",{className:"requirement-issues",children:t.detail.map((r,o)=>(0,e.jsx)("li",{children:r},o))}),t.review!==null&&t.review.judgement!=="upholds"&&(0,e.jsxs)("div",{className:"requirement-warning","data-review-judgement":t.review.judgement,children:[(0,e.jsx)("strong",{children:t.review.judgement==="contradicts"?"Reviewer found a problem":"Reviewer could not confirm this"}),(0,e.jsx)("p",{children:t.review.note})]}),t.coverage!==null&&(t.coverage.state==="gap"||t.coverage.gaps.length>0)&&(0,e.jsxs)("div",{className:"requirement-warning","data-context-coverage":t.coverage.state,children:[(0,e.jsx)("strong",{children:"Review context is missing"}),t.coverage.gaps.length===0?(0,e.jsx)("p",{children:"The saved context cannot support this requirement."}):(0,e.jsx)("ul",{children:t.coverage.gaps.map((r,o)=>(0,e.jsx)("li",{children:r},o))}),t.coverage.priorSupport==="invalid"&&(0,e.jsx)("p",{children:"The earlier review no longer supports this requirement."})]}),(0,e.jsxs)("details",{className:"requirement-evidence",children:[(0,e.jsx)("summary",{children:"How it was shown"}),(0,e.jsxs)("div",{className:"requirement-evidence-body",children:[(0,e.jsxs)("p",{className:"meta",children:["Required: ",t.requiredLabels]}),t.answered.length===0?(0,e.jsx)("p",{className:"meta",children:"Nothing was saved to show this requirement."}):t.answered.map(r=>(0,e.jsxs)("div",{className:"requirement-evidence-group",children:[(0,e.jsxs)("strong",{children:[r.kindLabel," · ",r.refs.length]}),(0,e.jsx)("ul",{children:r.refs.map((o,c)=>(0,e.jsx)("li",{children:o.anchor!==null?(0,e.jsx)("a",{href:`#${o.anchor}`,children:(0,e.jsx)("code",{children:o.ref})}):o.artifactId!==null?(0,e.jsx)("a",{href:`/r/${n}/evidence/${o.artifactId}`,children:(0,e.jsx)("code",{children:o.ref})}):(0,e.jsx)("code",{children:o.ref})},c))})]},r.kindLabel)),t.state==="pass"&&t.detail.length>0&&(0,e.jsxs)("div",{className:"requirement-evidence-group",children:[(0,e.jsx)("strong",{children:"Verification notes"}),(0,e.jsx)("ul",{children:t.detail.map((r,o)=>(0,e.jsx)("li",{children:r},o))})]}),t.review!==null&&(0,e.jsxs)("div",{className:"requirement-evidence-group",children:[(0,e.jsx)("strong",{children:"Previous assessment"}),(0,e.jsxs)("p",{children:[t.review.judgement==="upholds"?`${t.review.note} `:"",(0,e.jsx)("span",{className:"meta",children:t.review.author})]})]}),t.coverage!==null&&(0,e.jsxs)("p",{className:"meta",...t.coverage.state==="gap"?{}:{"data-context-coverage":t.coverage.state},children:["Review context: ",t.coverage.words]}),t.coverage?.assets!==void 0&&(0,e.jsx)("p",{className:"meta","data-context-assets":"",children:t.coverage.assets}),(0,e.jsxs)("p",{className:"meta",children:["Requirement ID: ",(0,e.jsx)("code",{children:t.id})]})]})]})]},t.id))})]}),s.semanticCoverage!==null&&(0,e.jsxs)("details",{className:"result-section semantic-coverage","data-semantic-coverage":s.semanticCoverage.satisfied,"data-coverage-policy":s.semanticCoverage.policy,children:[(0,e.jsx)("summary",{children:"Previous assessment"}),(0,e.jsxs)("p",{className:"meta",children:["The saved assessment confirmed ",s.semanticCoverage.upheldCount," of ",s.semanticCoverage.total," requirements."]})]}),s.reviewConflict&&(0,e.jsx)("p",{className:"meta",children:"An independent review found the report doesn't match the changes."}),l!==null&&i!==null&&(0,e.jsxs)("div",{className:"card repair-chain","data-repair-outcome":l.outcome,children:[(0,e.jsxs)("p",{className:"row",children:[(0,e.jsx)("strong",{children:"Automatic recovery"})," — ",i,l.draftTask!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("a",{href:`/t/${encodeURIComponent(l.draftTask)}`,children:l.draftTask})]})]}),l.unresolved.length>0&&(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"What it is fixing"}),(0,e.jsx)("p",{className:"meta",children:l.unresolved.join(", ")})]})]}),s.reviewerFindings.length>0&&(0,e.jsxs)("div",{className:"result-section","data-cockpit-source":"reviewer",children:[(0,e.jsx)("strong",{children:"Independent review"}),(0,e.jsx)(Fe,{items:s.reviewerFindings})]}),s.proofProblem!==null&&(0,e.jsxs)("p",{className:"problem",children:["Verification details are unavailable: ",s.proofProblem]}),s.checkLog!==null&&(s.checkLog.state==="none"?(0,e.jsx)("p",{className:"meta","data-cockpit-source":"machine",children:s.checkLog.off?"Checks were off for this build.":"No automated check was configured for this build."}):s.checkLog.state==="damaged"?(0,e.jsxs)("p",{className:"problem","data-check-log":"damaged","data-cockpit-source":"machine",children:["The check log no longer verifies (",s.checkLog.problem,"). Its output is not shown, and there is nothing to download."]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("details",{"data-check-log":s.checkLog.truncated?"shortened":"ok","data-cockpit-source":"machine",children:[(0,e.jsxs)("summary",{children:["Check output",s.checkLog.truncated?` (shortened — ${s.checkLog.bytesStored} of ${s.checkLog.bytesOriginal} bytes stored)`:""]}),(0,e.jsx)("pre",{className:"mono overflow-x-auto max-h-72",children:s.checkLog.lines.map((t,d)=>(0,e.jsxs)($.Fragment,{children:[d>0&&`
3
- `,(0,e.jsx)("span",{id:`check-log-L${d+1}`,children:t})]},d))})]}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:s.checkLog.downloadHref,children:s.checkLog.downloadLabel})})]})),s.agentChecks!==null&&(s.agentChecks.items.length===0?!s.agentChecks.hideWhenEmpty&&(0,e.jsx)("p",{className:"meta","data-cockpit-source":"agent",children:"The agent reported no checks."}):(0,e.jsxs)("details",{className:"cockpit-proof-group","data-cockpit-source":"agent",children:[(0,e.jsxs)("summary",{children:["Agent checks · ",s.agentChecks.items.length]}),(0,e.jsx)("div",{className:"result-section",children:(0,e.jsx)("ul",{children:s.agentChecks.items.map((t,d)=>(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:"mono",children:t.command})," ",(0,e.jsxs)("span",{className:"meta",children:["(exit ",t.exitCode,") — ",t.summary]})]},d))})})]})),s.screenshots!==null&&(s.screenshots.totalCount===0?!s.screenshots.hideWhenEmpty&&(0,e.jsxs)("p",{className:"meta","data-cockpit-source":"screenshots",children:["No screenshots",s.screenshots.required?" were captured, although one was required":" were needed","."]}):s.screenshots.leadIsScreenshots?(0,e.jsxs)("p",{className:"meta","data-cockpit-source":"screenshots",children:[s.screenshots.shownCount," validated screenshot",s.screenshots.shownCount===1?"":"s"," shown in Summary",s.screenshots.unavailableCount>0?`; ${s.screenshots.unavailableCount} unavailable`:"","."]}):(0,e.jsxs)("details",{className:"cockpit-proof-group","data-cockpit-source":"screenshots",children:[(0,e.jsxs)("summary",{children:["Screenshots · ",s.screenshots.shownCount,s.screenshots.unavailableCount>0?` (${s.screenshots.unavailableCount} unavailable)`:""]}),(0,e.jsx)(Ae,{runId:n,shots:s.screenshots.shown})]})),s.caveats!==null&&(s.caveats.items.length===0?!s.caveats.hideWhenEmpty&&(0,e.jsx)("p",{className:"meta","data-cockpit-source":"caveats",children:"The agent noted no limitations."}):(0,e.jsxs)("details",{className:"cockpit-proof-group","data-cockpit-source":"caveats",children:[(0,e.jsxs)("summary",{children:["Limitations the agent noted · ",s.caveats.items.length]}),(0,e.jsx)("ul",{children:s.caveats.items.map((t,d)=>(0,e.jsx)("li",{children:t},d))})]}))]}):!s.noChangeNoDirect&&(0,e.jsx)("p",{className:"meta","data-proof-verdict":"none",children:"This build has no check result or saved files. Review its changes yourself."}),s.followUps!==null&&(0,e.jsxs)("section",{className:"result-section follow-ups",id:"follow-ups","data-follow-ups":"",children:[(0,e.jsx)("strong",{children:"Follow-ups"}),s.followUps.checks.length>0&&(0,e.jsx)("ul",{className:"follow-up-list",children:s.followUps.checks.map((t,d)=>(0,e.jsxs)("li",{"data-follow-up-check":t.state,...t.batchMode!==null?{"data-batch":t.batchMode}:{},children:[t.text," on ",(0,e.jsx)("span",{className:"mono",children:t.commitShort}),(0,e.jsxs)("span",{className:"meta",children:[" · ",t.meta]}),t.logHref!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("a",{href:t.logHref,children:"Log"})]})]},d))}),!(s.followUps.quick||s.followUps.full)&&s.followUps.setupHref!==null&&(0,e.jsxs)("p",{className:"meta",children:["No approved check to run. ",(0,e.jsx)("a",{href:s.followUps.setupHref,children:"Set one up"}),"."]}),(s.followUps.canAct||s.followUps.testsTask!==null||s.followUps.addTestsAction!==null)&&(0,e.jsxs)("div",{className:"follow-up-acts",children:[s.followUps.canAct&&(0,e.jsxs)(N,{action:s.followUps.action,className:"follow-up-act",children:[(0,e.jsx)(y,{fields:{return:s.followUps.returnTo}}),s.followUps.quick&&s.followUps.full?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{type:"submit",name:"level",value:"quick",children:"Run quick checks"}),(0,e.jsx)("button",{type:"submit",name:"level",value:"full",className:"secondary",children:"Run full checks"})]}):(0,e.jsx)("button",{type:"submit",name:"level",value:s.followUps.quick?"quick":"full",children:"Run checks"})]}),s.followUps.testsTask!==null?(0,e.jsxs)("p",{className:"meta",children:["Tests task: ",(0,e.jsx)("a",{href:`/t/${encodeURIComponent(s.followUps.testsTask)}`,children:s.followUps.testsTask})]}):s.followUps.addTestsAction!==null&&(0,e.jsxs)(N,{action:s.followUps.addTestsAction,className:"follow-up-act",children:[(0,e.jsx)(y,{fields:{return:s.followUps.returnTo}}),(0,e.jsx)("button",{type:"submit",className:"secondary",children:"Add tests"})]})]})]}),s.agentOwnAccount.length>0&&(0,e.jsxs)("div",{className:"result-section","data-cockpit-source":"agent-words",children:[(0,e.jsx)("strong",{children:"The agent's own account"}),(0,e.jsx)("ul",{children:s.agentOwnAccount.map((t,d)=>(0,e.jsx)("li",{children:t},d))})]}),s.reviewRetry!==null&&(0,e.jsxs)("details",{className:"review-history","data-review-state":s.reviewRetry.state,children:[(0,e.jsx)("summary",{children:"Previous assessments"}),(0,e.jsx)("p",{className:"meta",children:"Saved history; no separate review will be started."}),s.reviewRetry.attempts.length>0&&(0,e.jsx)("ol",{"aria-label":"previous assessments",children:s.reviewRetry.attempts.map(t=>(0,e.jsxs)("li",{"data-review-attempt":t.attempt,"data-review-outcome":t.outcome??"open",children:[(0,e.jsxs)("a",{href:`/r/${t.runId}`,children:["Build #",t.runId]})," · ",t.outcome??"unfinished",t.reason!==null&&` · ${t.reason}`]},t.runId))})]})]})}function qe({comment:s}){return(0,e.jsxs)("div",{className:"diff-comment",children:[s.image!==null&&(0,e.jsxs)("figure",{className:"feedback-image",children:[s.image.caption===null?(0,e.jsxs)("figcaption",{children:["Screenshot ",s.image.artifact," is unavailable."]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("a",{href:`/r/${s.image.run}/evidence/${s.image.artifact}`,children:(0,e.jsx)("img",{src:`/r/${s.image.run}/evidence/${s.image.artifact}`,alt:s.image.caption})}),(0,e.jsxs)("figcaption",{children:[s.image.caption," · Screenshot ",s.image.artifact]})]}),s.image.dropAction!==null&&(0,e.jsxs)(N,{action:s.image.dropAction,className:"feedback-image-drop",children:[(0,e.jsx)(y,{fields:{return:s.image.returnTo,tab:s.image.dropTab,intent:"drop-image",comment:String(s.id)}}),(0,e.jsx)("button",{type:"submit",className:"quiet",children:"Keep note without screenshot"})]})]}),(0,e.jsx)("span",{className:"diff-comment-pin","aria-hidden":"true"}),(0,e.jsxs)("p",{children:[s.path!==null&&(0,e.jsxs)(e.Fragment,{children:[s.editorHref!==null?(0,e.jsx)("a",{className:"mono",href:s.editorHref,children:`${s.path}${s.line===null?"":`:${s.line}`}`}):(0,e.jsx)("span",{className:"mono",children:`${s.path}${s.line===null?"":`:${s.line}`}`})," "]}),s.note]}),(0,e.jsxs)("span",{className:"meta",children:[s.author," · ",(0,e.jsx)(G,{iso:s.createdAt})]})]})}function Me({request:s,className:n}){return(0,e.jsxs)("div",{className:n,children:[(0,e.jsx)("h3",{className:"so-sr-only",children:"What should change?"}),s.comments.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{className:"meta",children:["Saved for later · ",s.comments.length]}),(0,e.jsx)("div",{className:"diff-comments","data-result-notes":s.comments.length,children:s.comments.map(l=>(0,e.jsx)(qe,{comment:l},l.id))}),s.reviseFromComments!==null&&(0,e.jsxs)(N,{action:s.reviseFromComments.action,className:"card revision-from-comments",children:[(0,e.jsx)(y,{fields:{return:s.reviseFromComments.returnTo,batch:s.reviseFromComments.batch,source:s.reviseFromComments.source,approve:s.reviseFromComments.buildNow?"1":"0"}}),(0,e.jsx)("div",{children:(0,e.jsxs)("strong",{children:[ye(s.comments.length,"note","notes")," ready"]})}),(0,e.jsx)(C,{type:"submit",label:s.reviseFromComments.buildNow?"Send back and build":"Send back"})]})]}),s.pastComments.length>0&&(0,e.jsxs)("details",{className:"result-feedback-history",children:[(0,e.jsx)("summary",{children:"Earlier feedback"}),(0,e.jsx)("div",{className:"diff-comments","data-past-feedback":"",children:s.pastComments.map(l=>(0,e.jsx)(qe,{comment:l},l.id))})]}),s.revisions.map(l=>(0,e.jsxs)("p",{className:"result-revision","data-result-revision":l.id,"data-result-revision-approved":l.approved?"1":"0","data-tone":l.tone,children:[(0,e.jsx)("strong",{children:"Revision"})," ",(0,e.jsx)("a",{href:`/t/${encodeURIComponent(l.id)}`,children:l.title})," ",(0,e.jsxs)("span",{className:"meta",children:["· ",l.standing]})]},l.id)),s.availability==="signed-out"?(0,e.jsx)("p",{className:"meta",children:"Sign in with a browser session to send it back."}):s.availability!=="ok"?(0,e.jsxs)("p",{className:"meta","data-result-feedback":"unavailable",children:[s.availability==="no-diff"?"This result has no saved diff to attach notes to.":"The saved diff no longer checks out, so notes can't attach to it."," ",(0,e.jsx)("a",{href:s.chatHref,children:"Discuss in chat →"})]}):s.form!==null&&(0,e.jsxs)("details",{className:"result-request-open result-request-form",open:s.comments.length>0?!0:void 0,children:[(0,e.jsx)("summary",{children:"What should change?"}),(0,e.jsxs)(N,{action:s.form.action,className:"diff-comment-form",id:"comment-form",children:[(0,e.jsx)(y,{fields:{return:s.form.returnTo,batch:s.form.batch,source:s.form.source,tab:s.form.tab,request:s.form.requestToken}}),(0,e.jsx)("input",{type:"hidden","data-recorded-requests":"",defaultValue:s.form.recordedKeys}),(0,e.jsx)("input",{type:"hidden",name:"image"}),(0,e.jsxs)("figure",{className:"feedback-image","data-feedback-image":"",hidden:!0,children:[(0,e.jsx)("img",{alt:"Selected screenshot",hidden:!0}),(0,e.jsx)("figcaption",{}),(0,e.jsx)("button",{type:"button",className:"quiet","data-remove-image":"",children:"Remove image"})]}),(0,e.jsx)("input",{type:"hidden",name:"context"}),(0,e.jsx)("div",{className:"meta","data-request-context-line":"",hidden:!0}),(0,e.jsx)("textarea",{name:"note",rows:2,maxLength:s.form.noteMaxLength,placeholder:"Describe the change…","aria-label":"review comment","aria-describedby":"comment-note-limit",autoFocus:s.form.noted}),(0,e.jsxs)("span",{className:"meta diff-comment-limit",id:"comment-note-limit",children:["up to ",s.form.noteMaxLength," characters"]}),(0,e.jsxs)("details",{className:"result-pin",children:[(0,e.jsx)("summary",{children:"Attach to a file or line"}),(0,e.jsxs)("div",{className:"diff-comment-target",children:[(0,e.jsxs)("label",{children:["File",(0,e.jsx)("input",{type:"text",name:"path",placeholder:"src/…","aria-label":"file",className:"mono"})]}),(0,e.jsxs)("label",{children:["Line",(0,e.jsx)("input",{type:"text",name:"line",placeholder:"—","aria-label":"line",inputMode:"numeric"})]})]})]}),s.form.buildNowOnSendBack&&(0,e.jsxs)("label",{className:"meta result-build-now",children:[(0,e.jsx)("input",{type:"checkbox",name:"approve",value:"1","data-build-now":"",defaultChecked:!0})," Build again right away, on the same terms with these notes"]}),(0,e.jsxs)("div",{className:"result-feedback-actions",children:[(0,e.jsx)("button",{type:"submit",name:"intent",value:"revise","data-request-changes":"",children:"Send back"}),(0,e.jsx)("button",{type:"submit",name:"intent",value:"note",className:"quiet","data-save-feedback":"",children:"Save for later"})]})]})]})]})}function ze({learning:s,className:n}){let{skillsSnapshot:l,knowledgeSnapshot:i,skillTest:t,learning:d}=s;return(0,e.jsxs)("div",{className:n,children:[s.contextProblem!==null&&(0,e.jsx)("p",{className:"problem",role:"alert",children:s.contextProblem}),l!==null&&l.packages.length>0&&(0,e.jsxs)("details",{className:"skills",children:[(0,e.jsxs)("summary",{children:["Skills supplied (",l.packages.length,")"]}),(0,e.jsx)("p",{className:"meta",children:"Exact versions supplied to this run. This does not confirm the agent read or applied them."}),l.packages.map(r=>(0,e.jsxs)("details",{children:[(0,e.jsxs)("summary",{children:[r.name," · ",r.shaShort]}),(0,e.jsxs)("p",{className:"skill-source",children:[r.source," · ",r.shaShort]}),(0,e.jsxs)("p",{children:[r.fileCountLabel," · ",r.kb," KB"]}),(0,e.jsx)("pre",{children:r.skillMd}),(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Package files"}),(0,e.jsx)("ul",{className:"skill-files",children:r.files.map(o=>(0,e.jsx)("li",{children:o},o))})]})]},`${r.name}:${r.shaShort}`))]}),i!==null&&(0,e.jsxs)("details",{className:"knowledge result-knowledge",children:[(0,e.jsx)("summary",{children:"Context used"}),(0,e.jsxs)("p",{className:"meta",children:["Project knowledge · version ",i.revision,i.inheritedFrom===null?"":` · from run #${i.inheritedFrom}`]}),i.instructions?(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Instructions"}),(0,e.jsx)("pre",{children:i.instructions})]}):(0,e.jsx)("p",{children:"No project instructions were supplied."}),i.references.map(r=>(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:r.title}),r.path!==null&&(0,e.jsxs)("p",{className:"meta",children:[r.path," · ",r.sourceRevision]}),(0,e.jsx)("pre",{children:r.content})]},`${r.title}:${r.path??""}`)),i.omitted.length>0&&(0,e.jsxs)("details",{children:[(0,e.jsxs)("summary",{children:["Not included (",i.omitted.length,")"]}),(0,e.jsx)("ul",{children:i.omitted.map(r=>(0,e.jsxs)("li",{children:[r.title," — ",r.reason]},r.title))})]})]}),s.skillTestProblem!==null&&(0,e.jsx)("p",{role:"alert",children:s.skillTestProblem}),t!==null&&(0,e.jsxs)("section",{className:"skills",id:"skill-test-feedback",children:[(0,e.jsx)("h2",{children:"Improve this test"}),t.sourceRun!==null&&(0,e.jsxs)("p",{children:["Revises test run #",t.sourceRun,"."]}),t.feedback!==null&&(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Feedback for this test"}),(0,e.jsx)("p",{children:t.feedback})]}),t.revisions.length>0&&(0,e.jsx)("p",{children:t.revisions.map((r,o)=>(0,e.jsxs)($.Fragment,{children:[o>0&&" · ",(0,e.jsxs)("a",{href:`/t/${encodeURIComponent(r)}`,children:["Test revision ",o+1]})]},r))}),t.canRevise&&t.nonce!==null&&(0,e.jsxs)(N,{action:"/settings/skills/revise",children:[(0,e.jsx)(y,{fields:{repo:t.repo,run:String(t.run),nonce:t.nonce}}),(0,e.jsxs)("label",{children:["What should change?",(0,e.jsx)("textarea",{name:"feedback",required:!0,maxLength:500,rows:3,placeholder:"Try a clearer action label and explain why it fits the user’s goal."})]}),(0,e.jsx)("p",{className:"meta",children:"Creates another report task with this skill version and your feedback. Review its scope before it runs."}),(0,e.jsx)("button",{children:"Create revision"})]})]}),d!==null&&d.lessons.length>0&&(0,e.jsxs)("details",{className:"learning result-learning",children:[(0,e.jsx)("summary",{children:"Learned from this task"}),d.lessons.map(r=>(0,e.jsxs)("article",{className:"card","data-lesson":r.id,children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:r.observation})}),(0,e.jsx)("p",{children:r.action}),(0,e.jsx)("p",{className:"meta",children:r.lastIncluded}),(0,e.jsx)("p",{className:"meta",children:r.kindLabel}),(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Source and use"}),(0,e.jsxs)("p",{children:[(0,e.jsxs)("a",{href:`/r/${r.source}`,children:["Result #",r.source]})," · ",(0,e.jsxs)("a",{href:`/r/${r.reviewer}`,children:["Review #",r.reviewer]})]}),(0,e.jsx)("p",{children:r.metaSummary}),(0,e.jsx)("ul",{children:r.evidence.map((o,c)=>(0,e.jsxs)("li",{children:[(0,e.jsxs)("a",{href:`/r/${String(o.runId??r.source)}/evidence/${o.artifactId}`,children:["Source #",o.artifactId]}),(0,e.jsx)("blockquote",{children:o.excerpt}),(0,e.jsx)("code",{children:o.sha256})]},c))}),r.isProject&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:r.status==="proposed"?"Save permits advisory reuse when enabled and applicable. It does not prove a remedy works.":"Disabling affects future runs. Active snapshots, code and approvals stay unchanged."}),r.status==="proposed"&&d.canManage&&(0,e.jsxs)(N,{action:"/settings/learning/change",children:[(0,e.jsx)(y,{fields:{repo:d.repo,identity:d.identity,revision:String(d.revision),action:"adopt",lesson:r.id,version:String(r.version),sha:r.sha}}),(0,e.jsx)("button",{type:"submit",children:"Save lesson"})]})]})]}),r.isProject&&r.status==="adopted"&&d.canManage&&(0,e.jsxs)(N,{action:"/settings/learning/change",children:[(0,e.jsx)(y,{fields:{repo:d.repo,identity:d.identity,revision:String(d.revision),action:"disable",lesson:r.id,version:String(r.version),sha:r.sha}}),(0,e.jsx)("button",{type:"submit",children:"Disable lesson"})]})]},r.id)),(0,e.jsx)("a",{href:`/settings/learning?repo=${encodeURIComponent(d.repo)}`,children:"Learning settings"})]})]})}function es({completion:s}){let n={receipt:s.receipt,run:s.run,accept:s.accept===null?null:"1"};return(0,e.jsxs)(N,{action:s.action,className:"card result-complete",children:[(0,e.jsx)(y,{fields:n}),s.accept?.note!=null&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("label",{className:"meta",htmlFor:`complete-reason-${s.run}`,children:D}),(0,e.jsx)("input",{type:"text",id:`complete-reason-${s.run}`,name:"note",maxLength:500,required:!0,placeholder:s.accept.note})]}),s.pullRequestTo!==null?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{className:"meta",children:["Finishes the task. A pull request opens on ",s.pullRequestTo," from this exact commit when you ask for one."]}),(0,e.jsxs)("div",{className:"result-complete-actions",children:[(0,e.jsx)("button",{type:"submit",name:"publish",value:"1",className:"min-h-11",children:"Accept and open a pull request"}),(0,e.jsx)("button",{type:"submit",className:"secondary min-h-11",children:"Accept"})]})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:"Finishes the task. Checks stay unchanged; nothing is published or deployed."}),(0,e.jsx)("button",{type:"submit",className:"min-h-11",children:"Accept"})]})]})}function bt({result:s}){let{panel:n,completion:l}=s,i=n.tabs.find(p=>p.active)?.key??"summary",[t,d]=(0,$.useState)(i),r=n.canRequest,o=n.need,c=n.failed??null,h=n.status,u=n.reviewHistory,x=()=>o===null?null:o.accept!=null?(0,e.jsxs)(N,{action:o.accept.action,className:"accept-result",children:[(0,e.jsx)(y,{fields:{return:o.accept.returnTo,run:o.accept.run}}),o.accept.note!==null&&(0,e.jsx)("input",{type:"text",name:"note",maxLength:500,required:!0,placeholder:o.accept.note,"aria-label":o.accept.note}),(0,e.jsx)("button",{type:"submit","data-primary-action":"","data-accept-result":"",className:"min-h-11",children:o.label})]}):o.rebuild!=null?(0,e.jsx)(N,{action:o.rebuild.action,className:"rebuild",children:(0,e.jsx)("button",{type:"submit","data-primary-action":"","data-rebuild":"",className:"min-h-11",children:o.label})}):o.confirm!==null?(0,e.jsxs)(N,{action:o.confirm.action,id:"recheck-stopped",className:"recheck-stopped",children:[(0,e.jsx)(y,{fields:{return:o.confirm.returnTo,run:o.confirm.run}}),(0,e.jsx)("button",{type:"submit","data-primary-action":"",className:"min-h-11",children:o.label})]}):(0,e.jsx)("a",{className:"button-link",href:o.href??"#","data-primary-action":"",children:o.label}),f=n.headVerdict?.statusToken??"";return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"card result-panel",id:"result",...n.attributes,children:[n.back!=null&&(0,e.jsx)("p",{className:"result-back",children:(0,e.jsxs)("a",{href:n.back.href,"data-result-back":"",children:["← ",n.back.label]})}),(0,e.jsx)(Ie,{history:n.history}),c!==null?(0,e.jsx)("header",{className:"result-head","data-result-failed":"",children:(0,e.jsxs)("div",{"data-headline-tone":"danger",children:[(0,e.jsxs)("h2",{className:"status-headline","data-work-status":"failed",children:[(0,e.jsx)("i",{"aria-hidden":"true"}),"Failed"]}),(0,e.jsx)("p",{className:"status-sentence","data-failure-reason":"",children:c.line}),(c.evidence!==null||c.link!==null)&&(0,e.jsxs)("p",{className:"meta","data-failure-evidence":"",children:[c.evidence??"",c.evidence!==null&&c.link!==null?" ":"",c.link!==null&&(0,e.jsx)("a",{href:c.link.href,"data-failure-log":"",children:c.link.label})]})]})}):h!==null&&n.showHeadStatus!==!1?(0,e.jsx)("header",{className:"result-head",children:(0,e.jsxs)("div",{"data-headline-tone":h.tone,children:[(0,e.jsxs)("h2",{className:"status-headline","data-work-status":f,children:[(0,e.jsx)("i",{"aria-hidden":"true"}),h.headline]}),(0,e.jsx)("p",{className:"status-sentence",children:h.sentence})]})}):(0,e.jsx)("header",{className:"result-head",children:(0,e.jsx)("div",{children:(0,e.jsx)("h2",{children:n.heading})})}),c===null&&(0,e.jsx)("p",{className:"result-summary",children:n.outcome}),n.headVerdict?.hasCurrentOutcome&&n.headVerdict.status!==null&&(0,e.jsxs)("div",{className:"verdict","data-current-outcome":"","data-headline":n.headVerdict.status.headline,children:[(0,e.jsx)(X,{status:n.headVerdict.status}),Z(n.headVerdict.status).map((p,j)=>(0,e.jsx)("p",{className:"status-why meta",children:p},j))]}),n.attention.length>0&&(0,e.jsx)("div",{className:"result-attention","data-result-attention":n.attention.length,children:(0,e.jsx)("ul",{children:n.attention.map((p,j)=>(0,e.jsx)("li",{children:p},j))})}),n.youCheck!==null&&(0,e.jsxs)("div",{className:"result-you-check","data-result-you-check":n.youCheck.lines.length,children:[(0,e.jsx)("ul",{children:n.youCheck.lines.map((p,j)=>(0,e.jsx)("li",{children:p},j))}),n.youCheck.accept!==null&&l===null&&(0,e.jsxs)(N,{action:n.youCheck.accept.action,children:[(0,e.jsx)(y,{fields:{return:n.youCheck.accept.returnTo,run:n.youCheck.accept.run}}),(0,e.jsx)("button",{type:"submit","data-accept-result":"",children:"Accept"})]})]}),n.showPanelAction!==!1&&o!==null&&(0,e.jsxs)("div",{className:"result-action","data-result-action":"need",children:[x(),r&&(0,e.jsx)("a",{className:"result-feedback-link",href:"#request-changes",children:"Send back"})]}),n.showPanelAction!==!1&&n.summary.details.publication.ciFailing&&(0,e.jsx)("div",{className:"result-action","data-result-action":"draft-repair",children:(0,e.jsxs)(N,{action:`/r/${s.runId}/draft-repair`,children:[(0,e.jsx)("p",{className:"meta",children:be}),(0,e.jsx)("button",{type:"submit",children:"Send back"})]})}),u!==null&&(0,e.jsxs)("details",{className:"receipt-history",children:[(0,e.jsx)("summary",{children:"Review history"}),(0,e.jsx)("p",{className:"receipt-review meta","data-receipt-review":f,children:u})]}),(0,e.jsx)("nav",{className:"result-tabs",role:"tablist","aria-label":"result views",children:n.tabs.map(p=>{let j=p.key===t;return(0,e.jsxs)("a",{role:"tab",href:p.href,"data-result-tab":p.key,"aria-selected":j?"true":"false",tabIndex:j?0:-1,onClick:m=>{m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||m.button!==0||(m.preventDefault(),d(p.key))},children:[p.label,p.count!==""&&(0,e.jsx)("span",{className:"count",children:p.count})]},p.key)})}),(0,e.jsx)("div",{className:"result-view",role:"tabpanel","data-result-view":"summary",hidden:t!=="summary",children:(0,e.jsx)(Pe,{summary:n.summary})}),(0,e.jsx)("div",{className:"result-view",role:"tabpanel","data-result-view":"changes",hidden:t!=="changes",children:(0,e.jsx)(He,{changes:n.changes})}),(0,e.jsx)("div",{className:"result-view",role:"tabpanel","data-result-view":"checks",hidden:t!=="checks",children:(0,e.jsx)(Ue,{checks:n.checks,runId:s.runId})}),n.learning!==null&&(0,e.jsx)(ze,{learning:n.learning}),n.request!==null&&(0,e.jsx)("section",{className:"result-request",id:"request-changes",children:(0,e.jsx)(Me,{request:n.request})})]}),l!==null&&(0,e.jsx)(es,{completion:l})]})}var a=P(te(),1),ce={attention:"bg-attention",danger:"bg-destructive",info:"bg-info",success:"bg-success",neutral:"bg-muted-foreground",warning:"bg-muted-foreground"};function M({className:s,...n}){return(0,a.jsx)("section",{className:b("bg-card text-card-foreground flex flex-col gap-6 rounded-card border border-border p-6 shadow-xs phone:gap-4 phone:p-4",s),...n})}var oe=s=>B(s);function ss({view:s}){let[n,l]=(0,E.useState)(!1);return s.results.length===0?null:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)(T,{type:"button",variant:"outline",size:"sm","aria-expanded":n,"aria-haspopup":"menu",onClick:()=>l(i=>!i),children:["Results ",(0,a.jsx)("span",{className:"rounded-full bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:s.results.length}),s.attention>0&&(0,a.jsx)("span",{className:"rounded-full bg-attention px-1.5 text-xs tabular-nums text-on-attention",title:`${s.attention} need your attention`,children:s.attention}),(0,a.jsx)(je,{})]}),n&&(0,a.jsxs)("div",{role:"menu",className:"absolute right-0 z-30 mt-1 max-h-[70vh] w-80 overflow-y-auto rounded-md border border-border bg-card p-1 shadow-md",children:[s.attention>0&&(0,a.jsxs)("p",{className:"px-2 py-1.5 text-xs font-medium text-attention",children:[s.attention," need",s.attention===1?"s":""," your attention"]}),s.results.map(i=>(0,a.jsxs)("a",{role:"menuitem",href:i.href,onClick:()=>l(!1),"aria-current":i.current?"page":void 0,className:b("flex items-start gap-2.5 rounded-sm px-2 py-1.5 text-sm hover:bg-accent",i.current&&"bg-accent"),children:[(0,a.jsx)("span",{"aria-hidden":"true",className:b("mt-1.5 size-2 shrink-0 rounded-full",i.status===null?"bg-muted-foreground":ce[ie(i.status.tone)])}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:b("block truncate",i.needsYou?"font-semibold":"font-medium"),children:i.title}),(0,a.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:[i.status?.label,...i.notes,oe(i.at)].filter(Boolean).join(" · ")})]})]},i.href)),s.capped!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("hr",{className:"my-1 border-border"}),(0,a.jsxs)("p",{className:"px-2 py-1.5 text-xs font-normal text-muted-foreground",children:["Showing the newest ",s.capped,"; older results open from their task."]})]})]})]})}function Te({headline:s}){return(0,a.jsxs)("h2",{className:"flex items-center gap-2.5 text-lg font-semibold leading-snug","data-mismatch-headline":!0,children:[(0,a.jsx)(q,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),s]})}function as({selected:s,acts:n,answers:l,bare:i=!1}){let{panel:t,checks:d}=s,r=m=>{if(m===null)return!1;let v=new URL(m,"http://console.invalid");return v.pathname==="/review"&&v.searchParams.get("result")===s.taskId&&!v.searchParams.has("tab")&&v.hash===""},o=t?.requirements==null||t.youCheck==null?null:we(t.requirements,[...l.values()].filter(m=>m==="right").length,[...l.values()].filter(m=>m==="not-right").length),c=t?.status==null?null:{...t.status,details:t.status.details.map(m=>{let v=o!==null&&m.key==="requirements"&&m.text!=="Unverified"?{...m,text:o.text,mark:o.done?"ok":o.short?m.mark==="ok"?"note":m.mark:"none"}:m;return v.action!==null&&r(v.action.href)?{...v,action:null}:v})},h=ie(s.status.tone),u=n.primary==="rebuild"||n.primary==="recheck-stopped",x=s.noRun??(t!==null&&!u?t.outcome:c?.sentence??t?.outcome??""),f=s.mismatch,p=[...new Set([...c===null&&d?.problem===!0?[d.detail]:[],...s.problem===null?[]:[s.problem],...t?.attention??[]])].filter(m=>f===null||!f.said.includes(m)),j=c?.headline==="Failed";return i?f===null&&p.length===0?null:(0,a.jsxs)(M,{"data-result-warnings":!0,"aria-label":"What to know about this result",children:[f?.headline!=null&&(0,a.jsx)(Te,{headline:f.headline}),f!==null&&f.rows.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{"aria-label":"What doesn't match",className:"flex flex-col gap-1.5","data-mismatches":f.rows.length,children:f.rows.map((m,v)=>(0,a.jsx)("li",{"data-mismatch":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:(0,a.jsxs)("span",{children:[m.text,m.path!==null&&m.absent&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("code",{className:"font-mono text-xs",children:m.path})," ",(0,a.jsx)("span",{className:"text-muted-foreground","data-mismatch-absent":!0,children:"— not in the saved changes"})]}),m.href!==null&&(m.path!==null||m.noteLabel!==null)&&(0,a.jsxs)(a.Fragment,{children:[" · ",(0,a.jsx)("a",{href:m.href,"data-mismatch-lines":!0,className:b("font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground",m.path!==null&&"font-mono text-xs"),children:m.path!==null?`${m.path}${m.lines===null?"":`, ${m.lines}`}`:m.noteLabel})]})]})},v))})]}),p.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{className:"flex flex-col gap-1","aria-label":"Caveats","data-result-attention":p.length,children:p.map(m=>(0,a.jsx)("li",{"data-caveat":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:m},m))})]})]}):(0,a.jsxs)(M,{"data-result-status":s.status.token,"data-work-status":t?.headVerdict?.statusToken,"data-headline":c?.headline??s.status.label,"aria-label":"Result status",className:b(c?.headline==="Needs you"&&"border-wait"),children:[(0,a.jsxs)("div",{className:"min-w-0",children:[f?.headline!=null?(0,a.jsx)(Te,{headline:f.headline}):c!==null?(0,a.jsx)(me,{status:c}):(0,a.jsxs)("h2",{className:"flex items-center gap-2.5 text-lg font-semibold leading-snug",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:b("size-2.5 shrink-0 rounded-full",ce[h])}),s.status.label]}),x!==""&&(0,a.jsx)("p",{className:b("mt-1.5 max-w-[75ch] text-sm",s.failure!=null?"text-foreground":"text-muted-foreground"),"data-result-sentence":!0,...s.failure!=null?{"data-failure-reason":""}:{},children:x}),s.failure!=null&&(s.failure.evidence!==null||s.failure.link!==null)&&(0,a.jsxs)("p",{className:"mt-1 max-w-[75ch] text-body text-muted-foreground","data-failure-evidence":!0,children:[s.failure.evidence!==null&&(0,a.jsx)("span",{className:"[overflow-wrap:anywhere]",children:s.failure.evidence}),s.failure.link!==null&&(0,a.jsxs)(a.Fragment,{children:[s.failure.evidence!==null&&" ",(0,a.jsx)("a",{href:s.failure.link.href,"data-failure-log":!0,className:U,children:s.failure.link.label})]})]})]}),f!==null&&f.rows.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{"aria-label":"What doesn't match",className:"flex flex-col gap-1.5","data-mismatches":f.rows.length,children:f.rows.map((m,v)=>(0,a.jsx)("li",{"data-mismatch":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:(0,a.jsxs)("span",{children:[m.text,m.path!==null&&m.absent&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("code",{className:"font-mono text-xs",children:m.path})," ",(0,a.jsx)("span",{className:"text-muted-foreground","data-mismatch-absent":!0,children:"— not in the saved changes"})]}),m.href!==null&&(m.path!==null||m.noteLabel!==null)&&(0,a.jsxs)(a.Fragment,{children:[" · ",(0,a.jsx)("a",{href:m.href,"data-mismatch-lines":!0,className:b("font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:-my-3 phone:inline-block phone:py-3",m.path!==null&&"font-mono text-xs"),children:m.path!==null?`${m.path}${m.lines===null?"":`, ${m.lines}`}`:m.noteLabel})]})]})},v))})]}),c!==null&&(0,a.jsx)(X,{status:c}),p.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{className:"flex flex-col gap-1","aria-label":"Caveats","data-result-attention":p.length,children:p.map(m=>(0,a.jsx)("li",{"data-caveat":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:m},m))})]})]})}function ns(s){let n=document.getElementById("comment-form"),l=n?.querySelector("textarea[name=note]")??null,i=n?.querySelector("input[name=context]")??null,t=n?.closest("details")??null;if(t!==null&&!t.open&&(t.open=!0),l===null||i===null){window.location.hash="request-changes";return}let d=`Not right: “${s.replace(/\s+/g," ")}”`,r=i.value.split(`
2
+ import{p6$a as Ns,p6$b as ue}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{a as Ve}from"./chunk-shared.c3e5be1c5f441e94905a4bc2005d816d2a0b0e4108bae43e37ec274a911c6847.js";import{a as Ke,f as _e,g as Ge}from"./chunk-shared.fd5f2699d3b0017797e5b5e1e1d92eb98818740ebf20a95364bbb7deea0c8242.js";import{p9$a as me,p9$b as X,p9$c as Z,p9$d as $s,p9$e as ks,p9$f as Cs,p9$g as pe,p9$h as xe,p9$i as Ss}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p10$A as Ts,p10$B as Rs,p10$C as Ls,p10$D as q,p10$E as Is,p10$F as As,p10$G as Ps,p10$H as Hs,p10$I as Us,p10$J as Ms,p10$a as zs,p10$b as Ws,p10$c as Ds,p10$d as Os,p10$e as fe,p10$f as je,p10$g as ge,p10$h as Es,p10$i as Bs,p10$j as Vs,p10$k as Ks,p10$l as _s,p10$m as Gs,p10$n as Js,p10$o as Ys,p10$p as Qs,p10$q as Xs,p10$r as Zs,p10$s as ea,p10$t as sa,p10$u as aa,p10$v as na,p10$w as la,p10$x as ta,p10$y as ra,p10$z as ia}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p11$a as B,p11$b as ee}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p1$$ as ua,p1$$a as ma,p1$$b as pa,p1$A as xa,p1$Aa as fa,p1$Ab as ja,p1$B as ga,p1$Ba as be,p1$Bb as ba,p1$C as va,p1$Ca as Na,p1$Cb as wa,p1$D as ya,p1$Da as $a,p1$Db as ka,p1$E as Ca,p1$Ea as Sa,p1$Eb as Fa,p1$F as qa,p1$Fa as Ta,p1$Fb as Ra,p1$G as La,p1$Ga as Ia,p1$Gb as Aa,p1$H as Pa,p1$Ha as Ha,p1$Hb as Ua,p1$I as N,p1$Ia as Ma,p1$Ib as za,p1$J as Wa,p1$Ja as Da,p1$Jb as Oa,p1$K as Ea,p1$Ka as Ba,p1$Kb as Va,p1$L as Ka,p1$La as _a,p1$Lb as Ga,p1$M as Ja,p1$Ma as Ya,p1$Mb as Qa,p1$N as Xa,p1$Na as Za,p1$Nb as en,p1$O as se,p1$Oa as sn,p1$Ob as an,p1$P as ae,p1$Pa as nn,p1$Pb as ln,p1$Q as D,p1$Qa as tn,p1$Qb as rn,p1$R as ve,p1$Ra as cn,p1$Rb as on,p1$S as Ne,p1$Sa as dn,p1$Sb as hn,p1$T as we,p1$Ta as un,p1$Tb as mn,p1$U as ye,p1$Ua as pn,p1$Ub as xn,p1$V as fn,p1$Va as jn,p1$Vb as gn,p1$W as bn,p1$Wa as vn,p1$Wb as Nn,p1$X as wn,p1$Xa as yn,p1$Xb as $n,p1$Y as kn,p1$Ya as Cn,p1$Yb as Sn,p1$Z as Fn,p1$Za as qn,p1$Zb as Tn,p1$_ as Rn,p1$_a as $e,p1$_b as Ln,p1$a as b,p1$aa as In,p1$ab as An,p1$ac as Pn,p1$b as Hn,p1$ba as Un,p1$bb as Mn,p1$bc as zn,p1$c as Wn,p1$ca as Dn,p1$cb as C,p1$cc as On,p1$d as En,p1$da as Bn,p1$db as V,p1$dc as Vn,p1$e as T,p1$ea as Kn,p1$eb as _n,p1$ec as Gn,p1$f as ke,p1$fa as Jn,p1$fb as Yn,p1$fc as Qn,p1$g as Xn,p1$ga as Zn,p1$gb as el,p1$gc as sl,p1$h as al,p1$ha as nl,p1$hb as ll,p1$hc as tl,p1$i as rl,p1$ia as il,p1$ib as cl,p1$ic as ol,p1$j as dl,p1$ja as hl,p1$jb as ul,p1$jc as ml,p1$k as ne,p1$ka as pl,p1$kb as xl,p1$kc as fl,p1$l as jl,p1$la as gl,p1$lb as bl,p1$lc as vl,p1$m as Nl,p1$ma as wl,p1$mb as yl,p1$mc as $l,p1$n as kl,p1$na as Cl,p1$nb as Sl,p1$nc as Fl,p1$o as ql,p1$oa as Tl,p1$ob as Rl,p1$p as Ll,p1$pa as Il,p1$pb as Al,p1$q as O,p1$qa as Pl,p1$qb as Hl,p1$r as Ul,p1$ra as Ml,p1$rb as zl,p1$s as Wl,p1$sa as Dl,p1$sb as Ol,p1$t as El,p1$ta as Bl,p1$tb as Vl,p1$u as Kl,p1$ua as _l,p1$ub as Gl,p1$v as Jl,p1$va as Yl,p1$vb as Ql,p1$w as Xl,p1$wa as Zl,p1$wb as et,p1$x as st,p1$xa as at,p1$xb as nt,p1$y as lt,p1$ya as tt,p1$yb as rt,p1$z as it,p1$za as ct,p1$zb as ot}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p2$a as ut,p2$b as P,p2$c as le,p2$d as Ce,p2$e as te}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";var E=P(le(),1),Le=P(Ce(),1);function ie(s){switch(s){case"attention":return"attention";case"problem":return"danger";case"live":return"info";case"ready":case"done":return"success";default:return"neutral"}}var k=P(le(),1),e=P(te(),1);function _({iso:s}){return(0,e.jsx)("time",{dateTime:s,title:ee(s),children:B(s)})}function Je(){return(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,e.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),(0,e.jsx)("path",{d:"M8 10h8"})]})}function Ye({runId:s,shot:n}){return(0,e.jsxs)("figure",{className:"result-image",children:[(0,e.jsxs)("a",{className:"receipt-shot",href:`/r/${s}/evidence/${n.artifactId}`,children:[(0,e.jsx)("img",{src:`/r/${s}/evidence/${n.artifactId}`,alt:n.caption}),(0,e.jsx)("span",{children:n.caption})]}),n.commentable&&n.sha256!==void 0&&(0,e.jsx)("button",{type:"button",className:"quiet","data-comment-image":JSON.stringify({run:s,artifact:n.artifactId,sha256:n.sha256}),"data-image-caption":n.caption,children:"Comment"})]})}function y({fields:s}){return(0,e.jsx)(e.Fragment,{children:Object.entries(s).map(([n,l])=>l==null?null:(0,e.jsx)("input",{type:"hidden",name:n,value:String(l)},n))})}function Qe({control:s,className:n}){return s.kind==="link"?(0,e.jsx)(V,{href:s.href,label:s.label,className:n}):(0,e.jsxs)(N,{action:s.action,className:n,children:[(0,e.jsx)(y,{fields:{...s.fields,...s.returnTo===void 0?{}:{return:s.returnTo}}}),(0,e.jsx)(C,{type:"submit",label:s.label})]})}function Xe({intent:s,className:n}){return(0,e.jsxs)("div",{className:n,children:[(0,e.jsxs)("p",{className:"recap mt-1",children:[(0,e.jsx)("strong",{children:"Goal"})," ",s.goal]}),s.outOfScope===null?(0,e.jsx)("p",{className:"meta",children:"No boundary was stated"}):(0,e.jsxs)("p",{className:"recap",children:[(0,e.jsx)("strong",{children:"Not this"})," ",s.outOfScope]}),s.touches.length===0?(0,e.jsx)("p",{className:"meta",children:"No files were named in the plan, so every changed file is in bounds"}):(0,e.jsxs)("p",{className:"row",children:[(0,e.jsx)("span",{className:"meta",children:"Expected to touch"})," ",s.touches.map((l,i)=>(0,e.jsxs)(k.Fragment,{children:[i>0&&" ",(0,e.jsx)("span",{className:"mono",children:l})]},l))]}),s.plan!==null&&(0,e.jsxs)("p",{className:"meta",children:["Plan revision ",s.plan.revision," · ",(0,e.jsx)("span",{className:"mono",children:s.plan.shaShort}),s.plan.approach===null?"":` — ${s.plan.approach}`]})]})}var Ie=({history:s})=>(0,e.jsx)(be,{history:s,tight:!0});function Ae({runId:s,shots:n,className:l}){let{pairs:i,rest:t}=ae(n.map(d=>({...d,src:`/r/${s}/evidence/${d.artifactId}`,href:`/r/${s}/evidence/${d.artifactId}`,...d.commentable&&d.sha256!==void 0?{commentPayload:JSON.stringify({run:s,artifact:d.artifactId,sha256:d.sha256})}:{}})));return(0,e.jsxs)(e.Fragment,{children:[i.map(d=>(0,e.jsx)(se,{label:d.label,before:{src:d.before.src,href:d.before.href,caption:d.before.caption,...d.before.commentPayload===void 0?{}:{commentPayload:d.before.commentPayload}},after:{src:d.after.src,href:d.after.href,caption:d.after.caption,...d.after.commentPayload===void 0?{}:{commentPayload:d.after.commentPayload}}},d.key)),t.length>0&&(0,e.jsx)("div",{className:l??"receipt-visuals","aria-label":"validated screenshots",children:t.map(d=>(0,e.jsx)(Ye,{runId:s,shot:d},d.artifactId))})]})}function Pe({summary:s}){let{report:n,screenshots:l,unavailableShots:i,filesLead:t,noChangeNote:d,agentAccount:r,followUps:o,details:c}=s,h=c.runId;return(0,e.jsxs)("div",{className:"so-result-view",children:[n!==null&&(n.state==="missing"?(0,e.jsx)("p",{className:"problem","data-result-report":"missing",children:"This investigation stored no report."}):n.state==="problem"?(0,e.jsxs)("p",{className:"problem","data-result-report":"problem",children:["The report cannot be shown: ",n.problem,"."]}):(0,e.jsxs)("article",{className:"result-report","data-result-report":"ok",children:[(0,e.jsx)("h3",{children:n.title}),(n.items.length>0||n.shots.length>0)&&(()=>{let u=new Set(n.items.map(p=>p.image).filter(p=>p!==null)),x=n.shots.filter(p=>!u.has(p.file)),f=(p,j)=>p.artifactId===null?(0,e.jsxs)("p",{className:"meta",children:["Screenshot unavailable: ",p.problem??"it can't be shown"]},j):(0,e.jsxs)("a",{className:"receipt-shot",href:`/r/${h}/evidence/${p.artifactId}`,children:[(0,e.jsx)("img",{src:`/r/${h}/evidence/${p.artifactId}`,alt:p.caption,loading:"lazy"}),(0,e.jsx)("span",{children:p.caption})]},j);return(0,e.jsxs)("div",{className:"report-items","data-report-items":n.items.length,children:[n.items.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:"What it found"})}),(0,e.jsx)("ol",{children:n.items.map((p,j)=>{let m=p.image===null?void 0:n.shots.find(v=>v.file===p.image);return(0,e.jsxs)("li",{"data-report-item":"",children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:p.title})}),(0,e.jsx)("p",{className:"meta",children:p.why}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:p.url,rel:"noopener noreferrer nofollow",target:"_blank",className:"report-link",children:p.url})}),m!==void 0&&(0,e.jsx)("div",{className:"receipt-visuals",children:f(m)})]},j)})})]}),x.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:"Screenshots"})}),(0,e.jsx)("div",{className:"receipt-visuals","aria-label":"the scout's screenshots",children:x.map((p,j)=>f(p,j))})]})]})})(),(0,e.jsx)("pre",{className:"recap plan-doc",children:n.document}),(0,e.jsxs)("p",{className:"meta",children:[(0,e.jsx)("a",{href:`/r/${h}/evidence/${n.artifactId}`,children:n.truncated?"Download the stored part of the report (shortened at storage — not the full report)":"Download the report"}),n.followUps>0&&(0,e.jsxs)(e.Fragment,{children:[" · ",n.followUps," proposed follow-up",n.followUps===1?"":"s"," on ",(0,e.jsx)("a",{href:n.taskHref,children:"the task"})]})]})]})),s.lead==="screenshots"&&(0,e.jsx)(Ae,{runId:h,shots:l,className:"receipt-visuals result-visuals"}),t!==null&&(0,e.jsxs)("p",{className:"result-files-lead",children:[t.paths.length>0&&(0,e.jsxs)(e.Fragment,{children:[t.paths.map((u,x)=>(0,e.jsxs)(k.Fragment,{children:[x>0&&", ",(0,e.jsx)("span",{className:"mono",children:u})]},u)),t.more>0&&` and ${t.more} more`," — "]}),(0,e.jsx)("a",{href:t.changesHref,"data-result-goto":"changes",children:"see the diff"})]}),d!==null&&(0,e.jsx)("p",{className:"meta",children:d}),r!==null&&(0,e.jsxs)("details",{className:"result-notes","data-result-notes-agent":"",children:[(0,e.jsx)("summary",{children:"What the agent reported"}),r.conclusion!==null&&(0,e.jsx)("p",{className:"recap",children:r.conclusion}),r.changes.length>0&&(0,e.jsx)("ul",{className:"result-changes",children:r.changes.map((u,x)=>(0,e.jsx)("li",{children:u},x))}),r.verification.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:"Checked by the agent:"}),(0,e.jsx)("ul",{className:"result-changes","data-cockpit-source":"agent-words",children:r.verification.map((u,x)=>(0,e.jsx)("li",{children:u},x))})]}),r.reportNotes.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:"Its notes:"}),(0,e.jsx)("ol",{className:"result-changes","data-report-notes":"",children:r.reportNotes.map((u,x)=>(0,e.jsx)("li",{id:`report-note-${x+1}`,children:u},x))})]})]}),o.length>0&&(0,e.jsxs)("details",{className:"result-notes","data-review-followups":o.length,children:[(0,e.jsxs)("summary",{children:["Suggested follow-ups · ",o.length]}),(0,e.jsx)("ul",{className:"result-changes",children:o.map((u,x)=>(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:"badge",children:u.severity})," ",(0,e.jsx)("span",{className:"mono",children:`${u.file}:${u.line}`})," ",u.scenario,u.sendAction!==null&&(0,e.jsxs)(N,{action:u.sendAction,children:[(0,e.jsx)(y,{fields:{act:"send",pointer:u.pointer}}),(0,e.jsx)("button",{type:"submit",className:"secondary",children:"Send to the agent"})]})]},x))})]}),(0,e.jsxs)("details",{className:"result-details","data-result-details":"",children:[(0,e.jsx)("summary",{children:"Build details"}),i.length>0&&(0,e.jsx)("ul",{className:"result-unavailable meta","data-result-unavailable":i.length,children:i.map((u,x)=>(0,e.jsxs)("li",{children:["Screenshot unavailable — ",(0,e.jsx)("span",{className:"mono",children:u.path}),": ",u.problem]},x))}),(0,e.jsxs)("dl",{className:"result-facts",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Build"}),(0,e.jsxs)("dd",{children:["#",h," · ",c.runner,c.agent===null?` · ${c.provider}`:"",c.finishedAt!==null&&(0,e.jsxs)(e.Fragment,{children:[" · ",(0,e.jsx)(_,{iso:c.finishedAt})]})]})]}),c.agent!==null&&(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Agent"}),(0,e.jsx)("dd",{children:c.agent})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Commits"}),(0,e.jsx)("dd",{children:c.head===null?c.base===null?"no commit recorded":(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"mono",children:c.base.slice(0,7)})," ",(0,e.jsx)("span",{className:"meta",children:"base · no head recorded"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("span",{className:"mono",children:[c.base===null?"":`${c.base.slice(0,7)} → `,c.head.slice(0,7)]})," ",(0,e.jsxs)("span",{className:"meta",children:["from the ",c.headSource??"record"]})]})})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Saved files"}),(0,e.jsx)("dd",{children:c.evidenceSources.length===0?"nothing was captured":c.evidenceSources.join(" · ")})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{children:"Publication"}),(0,e.jsx)("dd",{children:(0,e.jsxs)("p",{className:"result-publication","data-receipt-publication":c.publication.state,children:[c.publication.words,c.publication.prNumber!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",c.publication.prUrl===null?(0,e.jsxs)("span",{className:"mono",children:["PR #",c.publication.prNumber]}):(0,e.jsxs)("a",{href:c.publication.prUrl,children:["PR #",c.publication.prNumber]}),(0,e.jsxs)("span",{className:"meta","data-ci-observed":c.publication.ciState,children:[" · ",c.publication.ciFailing?"CI failing at the last check":c.publication.ciState==="passing"&&c.publication.lastCheckAt!==null?(0,e.jsxs)(e.Fragment,{children:["CI passing, observed ",(0,e.jsx)(_,{iso:c.publication.lastCheckAt})]}):c.publication.ciState==="running"?"CI still running at the last check":"no CI checks found — verify on GitHub"]})]})]})})]})]}),(0,e.jsx)("p",{className:"result-links meta",children:c.links.map(u=>(0,e.jsx)("a",{href:u.href,children:u.label},u.href))})]})]})}function Se({path:s,oldPath:n,hunks:l,anchor:i,commentable:t}){return(0,e.jsxs)(e.Fragment,{children:[n!==null&&n!=="/dev/null"&&n!==s&&(0,e.jsxs)("p",{className:"diff-rename meta",children:["from ",n]}),l.map((d,r)=>{let o=d.lines.find(h=>h.newLine!==null&&h.kind!=="meta")?.newLine??null,c=i!==null&&o!==null?`${i}-L${o}`:void 0;return(0,e.jsxs)("section",{className:"diff-hunk",id:c,children:[(0,e.jsx)("div",{className:"diff-hunk-head",children:d.header}),(0,e.jsx)("div",{className:"diff-lines",children:d.lines.map((h,u)=>{let x=h.newLine??h.oldLine,f=h.newLine===null&&h.oldLine!==null?"old":"new",p=t&&x!==null&&h.kind!=="meta",j=h.kind==="addition"?"+":h.kind==="deletion"?"−":h.kind==="context"?" ":"·",m=x!==null&&h.kind!=="meta";return(0,e.jsxs)("div",{className:`diff-line diff-${h.kind}`,...m?{"data-diff-file":s,"data-diff-line":x}:{},children:[p?(0,e.jsx)("button",{type:"button",className:"diff-annotate pick-line","data-path":s,"data-line":x,"data-side":f,"aria-label":`Annotate ${s}, ${f} line ${x}`,title:"Annotate this line",children:(0,e.jsx)(Je,{})}):(0,e.jsx)("span",{className:"diff-annotate-space"}),(0,e.jsx)("span",{className:"diff-gutter",children:h.oldLine??""}),(0,e.jsx)("span",{className:"diff-gutter",children:h.newLine??""}),(0,e.jsxs)("code",{children:[(0,e.jsx)("b",{"aria-hidden":"true",children:j}),h.text]})]},u)})})]},r)})]})}function Ze({file:s,defaultOpen:n,commentable:l}){let[i,t]=(0,k.useState)(null),[d,r]=(0,k.useState)("idle"),[o,c]=(0,k.useState)(n),h=async()=>{if(!(s.lazyHref===null||i!==null||d==="loading")){r("loading");try{let x=s.lazyHref.includes("?")?"&":"?",f=await fetch(`${s.lazyHref}${x}format=json`,{credentials:"same-origin",headers:{accept:"application/json"}});if(!f.ok){r("error");return}let p=await f.json();t(p),r("idle")}catch{r("error")}}};(0,k.useEffect)(()=>{if(s.lazyHref===null||s.anchor===null)return;let x=()=>{let p=window.location.hash.slice(1);return p===s.anchor||p.startsWith(`${s.anchor}-L`)},f=()=>{x()&&(c(!0),h())};return f(),window.addEventListener("hashchange",f),()=>window.removeEventListener("hashchange",f)},[s.lazyHref,s.anchor]);let u=s.additions===null||s.deletions===null?s.additions===null&&s.deletions===null?null:(0,e.jsx)("span",{className:"diff-file-counts",children:"binary"}):(0,e.jsxs)("span",{className:"diff-file-counts",children:[(0,e.jsxs)("b",{children:["+",s.additions]}),(0,e.jsxs)("i",{children:["−",s.deletions]})]});return(0,e.jsxs)("details",{className:"diff-file",id:s.anchor??void 0,open:o,...s.lazyHref!==null?{"data-diff-lazy":s.lazyHref}:{},...s.lazyHref!==null&&i!==null?{"data-diff-loaded":""}:{},onToggle:x=>{let f=x.currentTarget.open;c(f),f&&s.lazyHref!==null&&i===null&&h()},children:[(0,e.jsxs)("summary",{children:[(0,e.jsx)("span",{className:"diff-file-name",children:s.path}),u]}),s.lazyHref===null?(0,e.jsx)(Se,{path:s.path,oldPath:s.oldPath,hunks:s.hunks,anchor:s.anchor,commentable:l}):i!==null?(0,e.jsx)(Se,{path:s.path,oldPath:i.oldPath,hunks:i.hunks,anchor:i.anchor,commentable:i.commentable}):(0,e.jsx)("div",{children:(0,e.jsx)("p",{className:"meta diff-lazy",children:d==="loading"?"Loading this file's changes…":d==="error"?(0,e.jsx)("a",{href:s.lazyHref,"data-full-load":"",children:"Could not load changes. Open directly"}):(0,e.jsx)("a",{href:s.lazyHref,"data-full-load":"",onClick:x=>{x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||x.button!==0||(x.preventDefault(),c(!0),h())},children:"Show this file's changes"})})})]})}function He({changes:s}){let[n,l]=(0,k.useState)("view"),{stat:i,outsideTouches:t,files:d,canAnnotate:r,hasEditorLinks:o,diff:c}=s;return(0,e.jsx)("div",{className:"so-result-view",children:s.noTerminal?(0,e.jsxs)("p",{className:"meta",children:["No final diff or change summary was captured for this build",s.scout?" — an investigation changes nothing in the repository":"","."]}):(0,e.jsxs)(e.Fragment,{children:[i===null?(0,e.jsx)("p",{className:"meta",children:"No change summary was captured."}):"problem"in i?(0,e.jsxs)("p",{className:"problem",children:["Change summary unavailable: ",i.problem,"."]}):(0,e.jsxs)("p",{className:"row result-stat",children:[(0,e.jsxs)("span",{className:"mono",children:[i.baseShort," → ",i.headShort]})," — ",i.fileCount===0?"no changes, verified":`${i.fileCount} file${i.fileCount===1?"":"s"} · +${i.additions} −${i.deletions}${i.binaryCount>0?` · ${i.binaryCount} binary`:""}${i.filesTruncated?" · file list cut, counts complete":""}`]}),t.length>0&&(0,e.jsxs)("p",{className:"problem cockpit-drift","data-cockpit-drift":t.length,children:[(0,e.jsxs)("strong",{children:[t.length," changed file",t.length===1?"":"s"," outside the approved paths"]})," — ",t.map((h,u)=>(0,e.jsxs)(k.Fragment,{children:[u>0&&", ",(0,e.jsx)("span",{className:"mono",children:h})]},h)),". Review these files before accepting the result."]}),d.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("ol",{className:"cockpit-files result-files",children:d.map(h=>{let u=h.additions===null||h.deletions===null?"binary":`+${h.additions} −${h.deletions}`;return(0,e.jsxs)("li",{"data-file-priority":h.priorityBand,children:[h.editorHref!==null?(0,e.jsx)("a",{className:"mono",href:h.editorHref,children:h.path}):h.anchor===null?(0,e.jsx)("span",{className:"mono",children:h.path}):(0,e.jsx)("a",{className:"mono",href:`#${h.anchor}`,children:h.path}),h.renamedFrom!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsxs)("span",{className:"meta",children:["(was ",h.renamedFrom,")"]})]})," ",(0,e.jsx)("span",{className:"meta",children:u}),h.outsideTouches&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("span",{className:"badge badge-failed","data-outside-touches":"1",children:"Outside touches"})]}),h.cited&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("span",{className:"badge badge-done",children:"Cited"})]}),r&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("button",{type:"button",className:"pick-file","data-path":h.path,children:"Comment"})]}),h.priorityReasons.length>0&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsxs)("span",{className:"meta",children:["— ",h.priorityReasons.join("; ")]})]})]},h.path)})}),o&&(0,e.jsx)("p",{className:"meta",children:"File links open in VS Code on THIS device — if the build's worktree is gone, a link opens nothing."})]}),c.kind==="none"?(0,e.jsx)("p",{className:"meta",children:"The final diff was not captured for this build."}):c.kind==="problem"?(0,e.jsxs)("p",{className:"problem",children:["Diff unavailable: ",c.problem,"."]}):c.kind==="empty"?(0,e.jsx)("p",{className:"meta",children:"Empty diff — captured successfully, nothing changed."}):c.kind==="raw"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("details",{children:[(0,e.jsxs)("summary",{children:["The patch",c.truncated?" (TRUNCATED — the raw record says how much was cut)":""]}),(0,e.jsx)("pre",{className:"mono overflow-x-auto",children:c.text})]}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:c.downloadHref,children:c.downloadLabel})})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"diff-review","data-review-diff":"","data-mode":c.commentable?n:void 0,children:[c.commentable&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"diff-review-bar",children:[(0,e.jsxs)("span",{className:"meta",children:[c.files.length," changed file",c.files.length===1?"":"s"]}),(0,e.jsxs)("div",{className:"diff-modes",role:"group","aria-label":"diff mode",children:[(0,e.jsx)("button",{type:"button","data-diff-mode":"view","aria-pressed":n==="view"?"true":"false",onClick:()=>l("view"),children:"View"}),(0,e.jsx)("button",{type:"button","data-diff-mode":"annotate","aria-pressed":n==="annotate"?"true":"false",onClick:()=>l("annotate"),children:"Annotate"})]})]}),(0,e.jsx)("p",{className:"diff-review-help",children:"Select a line, then describe what should change. Nothing is revised until you create the revision below."})]}),c.files.map((h,u)=>(0,e.jsx)(Ze,{file:h,defaultOpen:u===0,commentable:c.commentable},h.path)),c.patchTruncated?(0,e.jsx)("p",{className:"diff-cut",children:"The saved diff was shortened when it was stored: the rest of the change was never captured, here or in the download."}):c.linesTruncated?(0,e.jsx)("p",{className:"diff-cut",children:"This visual diff is shortened. Review the saved patch before approving."}):null]}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:c.downloadHref,children:c.downloadLabel})})]})]})})}function Fe({items:s}){return(0,e.jsx)("ul",{children:s.map((n,l)=>(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:`badge${n.isProblem?" badge-failed":""}`,children:n.severity})," ",n.path!==null&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("span",{className:"mono",children:[n.path,n.line===null?"":`:${n.line}`]})," "]}),n.note," ",(0,e.jsxs)("span",{className:"meta",children:["— ",n.author]}),n.canRequestChange&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("button",{type:"button",className:"pick-file","data-path":n.path??"","data-line":n.line===null?"":String(n.line),"data-review-note":n.note,children:"Request change"})]})]},l))})}function Ue({checks:s,runId:n}){let{repairChain:l}=s,i=l===null?null:l.outcome==="drafted"?l.draftTask===null?"No fix could be prepared":`Targeted fix ${l.basis==="mode"?"approved automatically":"ready for your approval"}`:l.outcome==="resolved"?`Completed on attempt ${l.attempt}`:l.outcome==="attempts-spent"?`Stopped after ${l.attempt} attempt${l.attempt===1?"":"s"}`:l.outcome==="no-progress"?"Stopped because two attempts made no progress":"Stopped because what the build reported may not match the approved work";return(0,e.jsxs)("div",{className:"so-result-view",children:[!s.hasProof&&s.previousAssessment.length>0&&(0,e.jsxs)("div",{className:"result-section","data-cockpit-source":"reviewer",children:[(0,e.jsx)("strong",{children:"Previous assessment"}),(0,e.jsx)(Fe,{items:s.previousAssessment})]}),s.noChangeNoDirect&&(0,e.jsx)("p",{className:"meta",children:"The build concluded that no repository change was needed. With no change, its handoff and the saved diff are the record."}),s.hasProof?(0,e.jsxs)(e.Fragment,{children:[s.verdictLine!==null&&(0,e.jsx)("p",{className:"row result-verdict","data-proof-verdict":s.verdictLine.token,...s.verdictLine.checkNow!==null?{"data-check-now":s.verdictLine.checkNow}:{},children:(0,e.jsx)("span",{className:"meta",children:s.verdictLine.words})}),s.acceptedLine!==null&&(0,e.jsxs)("p",{className:"meta",children:[s.acceptedLine.humanReview?"Accepted after human review":"Accepted with an exception"," by ",(0,e.jsx)("span",{className:"mono",children:s.acceptedLine.by})," · ",(0,e.jsx)(_,{iso:s.acceptedLine.at}),s.acceptedLine.note!==null&&` — ${s.acceptedLine.note}`]}),s.matrix.length===0?(0,e.jsx)("p",{className:"meta",children:s.signedCriteriaCount>0?`The approved plan has ${s.signedCriteriaCount} requirement${s.signedCriteriaCount===1?"":"s"}, but this build wasn't checked requirement by requirement.`:"This plan names no requirements to check."}):(0,e.jsxs)("div",{className:"result-section criterion-matrix",children:[(0,e.jsxs)("strong",{children:["Requirements · ",s.matrix.length]}),(0,e.jsx)("ol",{className:"requirement-list",children:s.matrix.map((t,d)=>(0,e.jsxs)("li",{className:"requirement","data-criterion-id":t.id,children:[(0,e.jsxs)("div",{className:"requirement-heading",children:[(0,e.jsxs)("span",{children:["Requirement ",d+1]}),(0,e.jsx)("span",{className:`badge ${t.badgeClass}`,"data-matrix-state":t.state,children:t.label})]}),(0,e.jsx)("p",{className:"requirement-statement",children:t.statement}),t.upheldOnly&&(0,e.jsx)("p",{className:"requirement-review","data-review-judgement":"upholds",children:"Reviewer confirmed"}),!t.awaitingAssessment&&t.state!=="pass"&&t.label!=="Met"&&t.label!=="Checked at release"&&t.detail.length>0&&(0,e.jsx)("ul",{className:"requirement-issues",children:t.detail.map((r,o)=>(0,e.jsx)("li",{children:r},o))}),t.review!==null&&t.review.judgement!=="upholds"&&(0,e.jsxs)("div",{className:"requirement-warning","data-review-judgement":t.review.judgement,children:[(0,e.jsx)("strong",{children:t.review.judgement==="contradicts"?"Reviewer found a problem":"Reviewer could not confirm this"}),(0,e.jsx)("p",{children:t.review.note})]}),t.coverage!==null&&(t.coverage.state==="gap"||t.coverage.gaps.length>0)&&(0,e.jsxs)("div",{className:"requirement-warning","data-context-coverage":t.coverage.state,children:[(0,e.jsx)("strong",{children:"Review context is missing"}),t.coverage.gaps.length===0?(0,e.jsx)("p",{children:"The saved context cannot support this requirement."}):(0,e.jsx)("ul",{children:t.coverage.gaps.map((r,o)=>(0,e.jsx)("li",{children:r},o))}),t.coverage.priorSupport==="invalid"&&(0,e.jsx)("p",{children:"The earlier review no longer supports this requirement."})]}),(0,e.jsxs)("details",{className:"requirement-evidence",children:[(0,e.jsx)("summary",{children:"How it was shown"}),(0,e.jsxs)("div",{className:"requirement-evidence-body",children:[(0,e.jsxs)("p",{className:"meta",children:["Required: ",t.requiredLabels]}),t.answered.length===0?(0,e.jsx)("p",{className:"meta",children:"Nothing was saved to show this requirement."}):t.answered.map(r=>(0,e.jsxs)("div",{className:"requirement-evidence-group",children:[(0,e.jsxs)("strong",{children:[r.kindLabel," · ",r.refs.length]}),(0,e.jsx)("ul",{children:r.refs.map((o,c)=>(0,e.jsx)("li",{children:o.anchor!==null?(0,e.jsx)("a",{href:`#${o.anchor}`,children:(0,e.jsx)("code",{children:o.ref})}):o.artifactId!==null?(0,e.jsx)("a",{href:`/r/${n}/evidence/${o.artifactId}`,children:(0,e.jsx)("code",{children:o.ref})}):(0,e.jsx)("code",{children:o.ref})},c))})]},r.kindLabel)),t.state==="pass"&&t.detail.length>0&&(0,e.jsxs)("div",{className:"requirement-evidence-group",children:[(0,e.jsx)("strong",{children:"Verification notes"}),(0,e.jsx)("ul",{children:t.detail.map((r,o)=>(0,e.jsx)("li",{children:r},o))})]}),t.review!==null&&(0,e.jsxs)("div",{className:"requirement-evidence-group",children:[(0,e.jsx)("strong",{children:"Previous assessment"}),(0,e.jsxs)("p",{children:[t.review.judgement==="upholds"?`${t.review.note} `:"",(0,e.jsx)("span",{className:"meta",children:t.review.author})]})]}),t.coverage!==null&&(0,e.jsxs)("p",{className:"meta",...t.coverage.state==="gap"?{}:{"data-context-coverage":t.coverage.state},children:["Review context: ",t.coverage.words]}),t.coverage?.assets!==void 0&&(0,e.jsx)("p",{className:"meta","data-context-assets":"",children:t.coverage.assets}),(0,e.jsxs)("p",{className:"meta",children:["Requirement ID: ",(0,e.jsx)("code",{children:t.id})]})]})]})]},t.id))})]}),s.semanticCoverage!==null&&(0,e.jsxs)("details",{className:"result-section semantic-coverage","data-semantic-coverage":s.semanticCoverage.satisfied,"data-coverage-policy":s.semanticCoverage.policy,children:[(0,e.jsx)("summary",{children:"Previous assessment"}),(0,e.jsxs)("p",{className:"meta",children:["The saved assessment confirmed ",s.semanticCoverage.upheldCount," of ",s.semanticCoverage.total," requirements."]})]}),s.reviewConflict&&(0,e.jsx)("p",{className:"meta",children:"An independent review found the report doesn't match the changes."}),l!==null&&i!==null&&(0,e.jsxs)("div",{className:"card repair-chain","data-repair-outcome":l.outcome,children:[(0,e.jsxs)("p",{className:"row",children:[(0,e.jsx)("strong",{children:"Automatic recovery"})," — ",i,l.draftTask!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("a",{href:`/t/${encodeURIComponent(l.draftTask)}`,children:l.draftTask})]})]}),l.unresolved.length>0&&(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"What it is fixing"}),(0,e.jsx)("p",{className:"meta",children:l.unresolved.join(", ")})]})]}),s.reviewerFindings.length>0&&(0,e.jsxs)("div",{className:"result-section","data-cockpit-source":"reviewer",children:[(0,e.jsx)("strong",{children:"Independent review"}),(0,e.jsx)(Fe,{items:s.reviewerFindings})]}),s.proofProblem!==null&&(0,e.jsxs)("p",{className:"problem",children:["Verification details are unavailable: ",s.proofProblem]}),s.checkLog!==null&&(s.checkLog.state==="none"?(0,e.jsx)("p",{className:"meta","data-cockpit-source":"machine",children:s.checkLog.off?"Checks were off for this build.":"No automated check was configured for this build."}):s.checkLog.state==="damaged"?(0,e.jsxs)("p",{className:"problem","data-check-log":"damaged","data-cockpit-source":"machine",children:["The check log no longer verifies (",s.checkLog.problem,"). Its output is not shown, and there is nothing to download."]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("details",{"data-check-log":s.checkLog.truncated?"shortened":"ok","data-cockpit-source":"machine",children:[(0,e.jsxs)("summary",{children:["Check output",s.checkLog.truncated?` (shortened — ${s.checkLog.bytesStored} of ${s.checkLog.bytesOriginal} bytes stored)`:""]}),(0,e.jsx)("pre",{className:"mono overflow-x-auto max-h-72",children:s.checkLog.lines.map((t,d)=>(0,e.jsxs)(k.Fragment,{children:[d>0&&`
3
+ `,(0,e.jsx)("span",{id:`check-log-L${d+1}`,children:t})]},d))})]}),(0,e.jsx)("p",{className:"meta",children:(0,e.jsx)("a",{href:s.checkLog.downloadHref,children:s.checkLog.downloadLabel})})]})),s.agentChecks!==null&&(s.agentChecks.items.length===0?!s.agentChecks.hideWhenEmpty&&(0,e.jsx)("p",{className:"meta","data-cockpit-source":"agent",children:"The agent reported no checks."}):(0,e.jsxs)("details",{className:"cockpit-proof-group","data-cockpit-source":"agent",children:[(0,e.jsxs)("summary",{children:["Agent checks · ",s.agentChecks.items.length]}),(0,e.jsx)("div",{className:"result-section",children:(0,e.jsx)("ul",{children:s.agentChecks.items.map((t,d)=>(0,e.jsxs)("li",{children:[(0,e.jsx)("span",{className:"mono",children:t.command})," ",(0,e.jsxs)("span",{className:"meta",children:["(exit ",t.exitCode,") — ",t.summary]})]},d))})})]})),s.screenshots!==null&&(s.screenshots.totalCount===0?!s.screenshots.hideWhenEmpty&&(0,e.jsxs)("p",{className:"meta","data-cockpit-source":"screenshots",children:["No screenshots",s.screenshots.required?" were captured, although one was required":" were needed","."]}):s.screenshots.leadIsScreenshots?(0,e.jsxs)("p",{className:"meta","data-cockpit-source":"screenshots",children:[s.screenshots.shownCount," validated screenshot",s.screenshots.shownCount===1?"":"s"," shown in Summary",s.screenshots.unavailableCount>0?`; ${s.screenshots.unavailableCount} unavailable`:"","."]}):(0,e.jsxs)("details",{className:"cockpit-proof-group","data-cockpit-source":"screenshots",children:[(0,e.jsxs)("summary",{children:["Screenshots · ",s.screenshots.shownCount,s.screenshots.unavailableCount>0?` (${s.screenshots.unavailableCount} unavailable)`:""]}),(0,e.jsx)(Ae,{runId:n,shots:s.screenshots.shown})]})),s.caveats!==null&&(s.caveats.items.length===0?!s.caveats.hideWhenEmpty&&(0,e.jsx)("p",{className:"meta","data-cockpit-source":"caveats",children:"The agent noted no limitations."}):(0,e.jsxs)("details",{className:"cockpit-proof-group","data-cockpit-source":"caveats",children:[(0,e.jsxs)("summary",{children:["Limitations the agent noted · ",s.caveats.items.length]}),(0,e.jsx)("ul",{children:s.caveats.items.map((t,d)=>(0,e.jsx)("li",{children:t},d))})]}))]}):!s.noChangeNoDirect&&(0,e.jsx)("p",{className:"meta","data-proof-verdict":"none",children:"This build has no check result or saved files. Review its changes yourself."}),s.followUps!==null&&(0,e.jsxs)("section",{className:"result-section follow-ups",id:"follow-ups","data-follow-ups":"",children:[(0,e.jsx)("strong",{children:"Follow-ups"}),s.followUps.checks.length>0&&(0,e.jsx)("ul",{className:"follow-up-list",children:s.followUps.checks.map((t,d)=>(0,e.jsxs)("li",{"data-follow-up-check":t.state,...t.batchMode!==null?{"data-batch":t.batchMode}:{},children:[t.text," on ",(0,e.jsx)("span",{className:"mono",children:t.commitShort}),(0,e.jsxs)("span",{className:"meta",children:[" · ",t.meta]}),t.logHref!==null&&(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("a",{href:t.logHref,children:"Log"})]})]},d))}),!(s.followUps.quick||s.followUps.full)&&s.followUps.setupHref!==null&&(0,e.jsxs)("p",{className:"meta",children:["No approved check to run. ",(0,e.jsx)("a",{href:s.followUps.setupHref,children:"Set one up"}),"."]}),(s.followUps.canAct||s.followUps.testsTask!==null||s.followUps.addTestsAction!==null)&&(0,e.jsxs)("div",{className:"follow-up-acts",children:[s.followUps.canAct&&(0,e.jsxs)(N,{action:s.followUps.action,className:"follow-up-act",children:[(0,e.jsx)(y,{fields:{return:s.followUps.returnTo}}),s.followUps.quick&&s.followUps.full?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{type:"submit",name:"level",value:"quick",children:"Run quick checks"}),(0,e.jsx)("button",{type:"submit",name:"level",value:"full",className:"secondary",children:"Run full checks"})]}):(0,e.jsx)("button",{type:"submit",name:"level",value:s.followUps.quick?"quick":"full",children:"Run checks"})]}),s.followUps.testsTask!==null?(0,e.jsxs)("p",{className:"meta",children:["Tests task: ",(0,e.jsx)("a",{href:`/t/${encodeURIComponent(s.followUps.testsTask)}`,children:s.followUps.testsTask})]}):s.followUps.addTestsAction!==null&&(0,e.jsxs)(N,{action:s.followUps.addTestsAction,className:"follow-up-act",children:[(0,e.jsx)(y,{fields:{return:s.followUps.returnTo}}),(0,e.jsx)("button",{type:"submit",className:"secondary",children:"Add tests"})]})]})]}),s.agentOwnAccount.length>0&&(0,e.jsxs)("div",{className:"result-section","data-cockpit-source":"agent-words",children:[(0,e.jsx)("strong",{children:"The agent's own account"}),(0,e.jsx)("ul",{children:s.agentOwnAccount.map((t,d)=>(0,e.jsx)("li",{children:t},d))})]}),s.reviewRetry!==null&&(0,e.jsxs)("details",{className:"review-history","data-review-state":s.reviewRetry.state,children:[(0,e.jsx)("summary",{children:"Previous assessments"}),(0,e.jsx)("p",{className:"meta",children:"Saved history; no separate review will be started."}),s.reviewRetry.attempts.length>0&&(0,e.jsx)("ol",{"aria-label":"previous assessments",children:s.reviewRetry.attempts.map(t=>(0,e.jsxs)("li",{"data-review-attempt":t.attempt,"data-review-outcome":t.outcome??"open",children:[(0,e.jsxs)("a",{href:`/r/${t.runId}`,children:["Build #",t.runId]})," · ",t.outcome??"unfinished",t.reason!==null&&` · ${t.reason}`]},t.runId))})]})]})}function qe({comment:s}){return(0,e.jsxs)("div",{className:"diff-comment",children:[s.image!==null&&(0,e.jsxs)("figure",{className:"feedback-image",children:[s.image.caption===null?(0,e.jsxs)("figcaption",{children:["Screenshot ",s.image.artifact," is unavailable."]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("a",{href:`/r/${s.image.run}/evidence/${s.image.artifact}`,children:(0,e.jsx)("img",{src:`/r/${s.image.run}/evidence/${s.image.artifact}`,alt:s.image.caption})}),(0,e.jsxs)("figcaption",{children:[s.image.caption," · Screenshot ",s.image.artifact]})]}),s.image.dropAction!==null&&(0,e.jsxs)(N,{action:s.image.dropAction,className:"feedback-image-drop",children:[(0,e.jsx)(y,{fields:{return:s.image.returnTo,tab:s.image.dropTab,intent:"drop-image",comment:String(s.id)}}),(0,e.jsx)("button",{type:"submit",className:"quiet",children:"Keep note without screenshot"})]})]}),(0,e.jsx)("span",{className:"diff-comment-pin","aria-hidden":"true"}),(0,e.jsxs)("p",{children:[s.path!==null&&(0,e.jsxs)(e.Fragment,{children:[s.editorHref!==null?(0,e.jsx)("a",{className:"mono",href:s.editorHref,children:`${s.path}${s.line===null?"":`:${s.line}`}`}):(0,e.jsx)("span",{className:"mono",children:`${s.path}${s.line===null?"":`:${s.line}`}`})," "]}),s.note]}),(0,e.jsxs)("span",{className:"meta",children:[s.author," · ",(0,e.jsx)(_,{iso:s.createdAt})]})]})}function Me({request:s,className:n}){return(0,e.jsxs)("div",{className:n,children:[(0,e.jsx)("h3",{className:"so-sr-only",children:"What should change?"}),s.comments.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{className:"meta",children:["Saved for later · ",s.comments.length]}),(0,e.jsx)("div",{className:"diff-comments","data-result-notes":s.comments.length,children:s.comments.map(l=>(0,e.jsx)(qe,{comment:l},l.id))}),s.reviseFromComments!==null&&(0,e.jsxs)(N,{action:s.reviseFromComments.action,className:"card revision-from-comments",children:[(0,e.jsx)(y,{fields:{return:s.reviseFromComments.returnTo,batch:s.reviseFromComments.batch,source:s.reviseFromComments.source,approve:s.reviseFromComments.buildNow?"1":"0"}}),(0,e.jsx)("div",{children:(0,e.jsxs)("strong",{children:[$e(s.comments.length,"note","notes")," ready"]})}),(0,e.jsx)(C,{type:"submit",label:s.reviseFromComments.buildNow?"Send back and build":"Send back"})]})]}),s.pastComments.length>0&&(0,e.jsxs)("details",{className:"result-feedback-history",children:[(0,e.jsx)("summary",{children:"Earlier feedback"}),(0,e.jsx)("div",{className:"diff-comments","data-past-feedback":"",children:s.pastComments.map(l=>(0,e.jsx)(qe,{comment:l},l.id))})]}),s.revisions.map(l=>(0,e.jsxs)("p",{className:"result-revision","data-result-revision":l.id,"data-result-revision-approved":l.approved?"1":"0","data-tone":l.tone,children:[(0,e.jsx)("strong",{children:"Revision"})," ",(0,e.jsx)("a",{href:`/t/${encodeURIComponent(l.id)}`,children:l.title})," ",(0,e.jsxs)("span",{className:"meta",children:["· ",l.standing]})]},l.id)),s.availability==="signed-out"?(0,e.jsx)("p",{className:"meta",children:"Sign in with a browser session to send it back."}):s.availability!=="ok"?(0,e.jsxs)("p",{className:"meta","data-result-feedback":"unavailable",children:[s.availability==="no-diff"?"This result has no saved diff to attach notes to.":"The saved diff no longer checks out, so notes can't attach to it."," ",(0,e.jsx)("a",{href:s.chatHref,children:"Discuss in chat →"})]}):s.form!==null&&(0,e.jsxs)("details",{className:"result-request-open result-request-form",open:s.comments.length>0?!0:void 0,children:[(0,e.jsx)("summary",{children:"What should change?"}),(0,e.jsxs)(N,{action:s.form.action,className:"diff-comment-form",id:"comment-form",children:[(0,e.jsx)(y,{fields:{return:s.form.returnTo,batch:s.form.batch,source:s.form.source,tab:s.form.tab,request:s.form.requestToken}}),(0,e.jsx)("input",{type:"hidden","data-recorded-requests":"",defaultValue:s.form.recordedKeys}),(0,e.jsx)("input",{type:"hidden",name:"image"}),(0,e.jsxs)("figure",{className:"feedback-image","data-feedback-image":"",hidden:!0,children:[(0,e.jsx)("img",{alt:"Selected screenshot",hidden:!0}),(0,e.jsx)("figcaption",{}),(0,e.jsx)("button",{type:"button",className:"quiet","data-remove-image":"",children:"Remove image"})]}),(0,e.jsx)("input",{type:"hidden",name:"context"}),(0,e.jsx)("div",{className:"meta","data-request-context-line":"",hidden:!0}),(0,e.jsx)("textarea",{name:"note",rows:2,maxLength:s.form.noteMaxLength,placeholder:"Describe the change…","aria-label":"review comment","aria-describedby":"comment-note-limit",autoFocus:s.form.noted}),(0,e.jsxs)("span",{className:"meta diff-comment-limit",id:"comment-note-limit",children:["up to ",s.form.noteMaxLength," characters"]}),(0,e.jsxs)("details",{className:"result-pin",children:[(0,e.jsx)("summary",{children:"Attach to a file or line"}),(0,e.jsxs)("div",{className:"diff-comment-target",children:[(0,e.jsxs)("label",{children:["File",(0,e.jsx)("input",{type:"text",name:"path",placeholder:"src/…","aria-label":"file",className:"mono"})]}),(0,e.jsxs)("label",{children:["Line",(0,e.jsx)("input",{type:"text",name:"line",placeholder:"—","aria-label":"line",inputMode:"numeric"})]})]})]}),s.form.buildNowOnSendBack&&(0,e.jsxs)("label",{className:"meta result-build-now",children:[(0,e.jsx)("input",{type:"checkbox",name:"approve",value:"1","data-build-now":"",defaultChecked:!0})," Build again right away, on the same terms with these notes"]}),(0,e.jsxs)("div",{className:"result-feedback-actions",children:[(0,e.jsx)("button",{type:"submit",name:"intent",value:"revise","data-request-changes":"",children:"Send back"}),(0,e.jsx)("button",{type:"submit",name:"intent",value:"note",className:"quiet","data-save-feedback":"",children:"Save for later"})]})]})]})]})}function ze({learning:s,className:n}){let{skillsSnapshot:l,knowledgeSnapshot:i,skillTest:t,learning:d}=s;return(0,e.jsxs)("div",{className:n,children:[s.contextProblem!==null&&(0,e.jsx)("p",{className:"problem",role:"alert",children:s.contextProblem}),l!==null&&l.packages.length>0&&(0,e.jsxs)("details",{className:"skills",children:[(0,e.jsxs)("summary",{children:["Skills supplied (",l.packages.length,")"]}),(0,e.jsx)("p",{className:"meta",children:"Exact versions supplied to this run. This does not confirm the agent read or applied them."}),l.packages.map(r=>(0,e.jsxs)("details",{children:[(0,e.jsxs)("summary",{children:[r.name," · ",r.shaShort]}),(0,e.jsxs)("p",{className:"skill-source",children:[r.source," · ",r.shaShort]}),(0,e.jsxs)("p",{children:[r.fileCountLabel," · ",r.kb," KB"]}),(0,e.jsx)("pre",{children:r.skillMd}),(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Package files"}),(0,e.jsx)("ul",{className:"skill-files",children:r.files.map(o=>(0,e.jsx)("li",{children:o},o))})]})]},`${r.name}:${r.shaShort}`))]}),i!==null&&(0,e.jsxs)("details",{className:"knowledge result-knowledge",children:[(0,e.jsx)("summary",{children:"Context used"}),(0,e.jsxs)("p",{className:"meta",children:["Project knowledge · version ",i.revision,i.inheritedFrom===null?"":` · from run #${i.inheritedFrom}`]}),i.instructions?(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Instructions"}),(0,e.jsx)("pre",{children:i.instructions})]}):(0,e.jsx)("p",{children:"No project instructions were supplied."}),i.references.map(r=>(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:r.title}),r.path!==null&&(0,e.jsxs)("p",{className:"meta",children:[r.path," · ",r.sourceRevision]}),(0,e.jsx)("pre",{children:r.content})]},`${r.title}:${r.path??""}`)),i.omitted.length>0&&(0,e.jsxs)("details",{children:[(0,e.jsxs)("summary",{children:["Not included (",i.omitted.length,")"]}),(0,e.jsx)("ul",{children:i.omitted.map(r=>(0,e.jsxs)("li",{children:[r.title," — ",r.reason]},r.title))})]})]}),s.skillTestProblem!==null&&(0,e.jsx)("p",{role:"alert",children:s.skillTestProblem}),t!==null&&(0,e.jsxs)("section",{className:"skills",id:"skill-test-feedback",children:[(0,e.jsx)("h2",{children:"Improve this test"}),t.sourceRun!==null&&(0,e.jsxs)("p",{children:["Revises test run #",t.sourceRun,"."]}),t.feedback!==null&&(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Feedback for this test"}),(0,e.jsx)("p",{children:t.feedback})]}),t.revisions.length>0&&(0,e.jsx)("p",{children:t.revisions.map((r,o)=>(0,e.jsxs)(k.Fragment,{children:[o>0&&" · ",(0,e.jsxs)("a",{href:`/t/${encodeURIComponent(r)}`,children:["Test revision ",o+1]})]},r))}),t.canRevise&&t.nonce!==null&&(0,e.jsxs)(N,{action:"/settings/skills/revise",children:[(0,e.jsx)(y,{fields:{repo:t.repo,run:String(t.run),nonce:t.nonce}}),(0,e.jsxs)("label",{children:["What should change?",(0,e.jsx)("textarea",{name:"feedback",required:!0,maxLength:500,rows:3,placeholder:"Try a clearer action label and explain why it fits the user’s goal."})]}),(0,e.jsx)("p",{className:"meta",children:"Creates another report task with this skill version and your feedback. Review its scope before it runs."}),(0,e.jsx)("button",{children:"Create revision"})]})]}),d!==null&&d.lessons.length>0&&(0,e.jsxs)("details",{className:"learning result-learning",children:[(0,e.jsx)("summary",{children:"Learned from this task"}),d.lessons.map(r=>(0,e.jsxs)("article",{className:"card","data-lesson":r.id,children:[(0,e.jsx)("p",{children:(0,e.jsx)("strong",{children:r.observation})}),(0,e.jsx)("p",{children:r.action}),(0,e.jsx)("p",{className:"meta",children:r.lastIncluded}),(0,e.jsx)("p",{className:"meta",children:r.kindLabel}),(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Source and use"}),(0,e.jsxs)("p",{children:[(0,e.jsxs)("a",{href:`/r/${r.source}`,children:["Result #",r.source]})," · ",(0,e.jsxs)("a",{href:`/r/${r.reviewer}`,children:["Review #",r.reviewer]})]}),(0,e.jsx)("p",{children:r.metaSummary}),(0,e.jsx)("ul",{children:r.evidence.map((o,c)=>(0,e.jsxs)("li",{children:[(0,e.jsxs)("a",{href:`/r/${String(o.runId??r.source)}/evidence/${o.artifactId}`,children:["Source #",o.artifactId]}),(0,e.jsx)("blockquote",{children:o.excerpt}),(0,e.jsx)("code",{children:o.sha256})]},c))}),r.isProject&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:r.status==="proposed"?"Save permits advisory reuse when enabled and applicable. It does not prove a remedy works.":"Disabling affects future runs. Active snapshots, code and approvals stay unchanged."}),r.status==="proposed"&&d.canManage&&(0,e.jsxs)(N,{action:"/settings/learning/change",children:[(0,e.jsx)(y,{fields:{repo:d.repo,identity:d.identity,revision:String(d.revision),action:"adopt",lesson:r.id,version:String(r.version),sha:r.sha}}),(0,e.jsx)("button",{type:"submit",children:"Save lesson"})]})]})]}),r.isProject&&r.status==="adopted"&&d.canManage&&(0,e.jsxs)(N,{action:"/settings/learning/change",children:[(0,e.jsx)(y,{fields:{repo:d.repo,identity:d.identity,revision:String(d.revision),action:"disable",lesson:r.id,version:String(r.version),sha:r.sha}}),(0,e.jsx)("button",{type:"submit",children:"Disable lesson"})]})]},r.id)),(0,e.jsx)("a",{href:`/settings/learning?repo=${encodeURIComponent(d.repo)}`,children:"Learning settings"})]})]})}function es({completion:s}){let n={receipt:s.receipt,run:s.run,accept:s.accept===null?null:"1"};return(0,e.jsxs)(N,{action:s.action,className:"card result-complete",children:[(0,e.jsx)(y,{fields:n}),s.accept?.note!=null&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("label",{className:"meta",htmlFor:`complete-reason-${s.run}`,children:D}),(0,e.jsx)("input",{type:"text",id:`complete-reason-${s.run}`,name:"note",maxLength:500,required:!0,placeholder:s.accept.note})]}),s.pullRequestTo!==null?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{className:"meta",children:["Finishes the task. A pull request opens on ",s.pullRequestTo," from this exact commit when you ask for one."]}),(0,e.jsxs)("div",{className:"result-complete-actions",children:[(0,e.jsx)("button",{type:"submit",name:"publish",value:"1",className:"min-h-11",children:"Accept and open a pull request"}),(0,e.jsx)("button",{type:"submit",className:"secondary min-h-11",children:"Accept"})]})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"meta",children:"Finishes the task. Checks stay unchanged; nothing is published or deployed."}),(0,e.jsx)("button",{type:"submit",className:"min-h-11",children:"Accept"})]})]})}function Nt({result:s}){let{panel:n,completion:l}=s,i=n.tabs.find(p=>p.active)?.key??"summary",[t,d]=(0,k.useState)(i),r=n.canRequest,o=n.need,c=n.failed??null,h=n.status,u=n.reviewHistory,x=()=>o===null?null:o.accept!=null?(0,e.jsxs)(N,{action:o.accept.action,className:"accept-result",children:[(0,e.jsx)(y,{fields:{return:o.accept.returnTo,run:o.accept.run}}),o.accept.note!==null&&(0,e.jsx)("input",{type:"text",name:"note",maxLength:500,required:!0,placeholder:o.accept.note,"aria-label":o.accept.note}),(0,e.jsx)("button",{type:"submit","data-primary-action":"","data-accept-result":"",className:"min-h-11",children:o.label})]}):o.rebuild!=null?(0,e.jsx)(N,{action:o.rebuild.action,className:"rebuild",children:(0,e.jsx)("button",{type:"submit","data-primary-action":"","data-rebuild":"",className:"min-h-11",children:o.label})}):o.confirm!==null?(0,e.jsxs)(N,{action:o.confirm.action,id:"recheck-stopped",className:"recheck-stopped",children:[(0,e.jsx)(y,{fields:{return:o.confirm.returnTo,run:o.confirm.run}}),(0,e.jsx)("button",{type:"submit","data-primary-action":"",className:"min-h-11",children:o.label})]}):(0,e.jsx)("a",{className:"button-link",href:o.href??"#","data-primary-action":"",children:o.label}),f=n.headVerdict?.statusToken??"";return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"card result-panel",id:"result",...n.attributes,children:[n.back!=null&&(0,e.jsx)("p",{className:"result-back",children:(0,e.jsxs)("a",{href:n.back.href,"data-result-back":"",children:["← ",n.back.label]})}),(0,e.jsx)(Ie,{history:n.history}),c!==null?(0,e.jsx)("header",{className:"result-head","data-result-failed":"",children:(0,e.jsxs)("div",{"data-headline-tone":"danger",children:[(0,e.jsxs)("h2",{className:"status-headline","data-work-status":"failed",children:[(0,e.jsx)("i",{"aria-hidden":"true"}),"Failed"]}),(0,e.jsx)("p",{className:"status-sentence","data-failure-reason":"",children:c.line}),(c.evidence!==null||c.link!==null)&&(0,e.jsxs)("p",{className:"meta","data-failure-evidence":"",children:[c.evidence??"",c.evidence!==null&&c.link!==null?" ":"",c.link!==null&&(0,e.jsx)("a",{href:c.link.href,"data-failure-log":"",children:c.link.label})]})]})}):h!==null&&n.showHeadStatus!==!1?(0,e.jsx)("header",{className:"result-head",children:(0,e.jsxs)("div",{"data-headline-tone":h.tone,children:[(0,e.jsxs)("h2",{className:"status-headline","data-work-status":f,children:[(0,e.jsx)("i",{"aria-hidden":"true"}),h.headline]}),(0,e.jsx)("p",{className:"status-sentence",children:h.sentence})]})}):(0,e.jsx)("header",{className:"result-head",children:(0,e.jsx)("div",{children:(0,e.jsx)("h2",{children:n.heading})})}),c===null&&(0,e.jsx)("p",{className:"result-summary",children:n.outcome}),n.headVerdict?.hasCurrentOutcome&&n.headVerdict.status!==null&&(0,e.jsxs)("div",{className:"verdict","data-current-outcome":"","data-headline":n.headVerdict.status.headline,children:[(0,e.jsx)(X,{status:n.headVerdict.status}),Z(n.headVerdict.status).map((p,j)=>(0,e.jsx)("p",{className:"status-why meta",children:p},j))]}),n.attention.length>0&&(0,e.jsx)("div",{className:"result-attention","data-result-attention":n.attention.length,children:(0,e.jsx)("ul",{children:n.attention.map((p,j)=>(0,e.jsx)("li",{children:p},j))})}),n.youCheck!==null&&(0,e.jsxs)("div",{className:"result-you-check","data-result-you-check":n.youCheck.lines.length,children:[(0,e.jsx)("ul",{children:n.youCheck.lines.map((p,j)=>(0,e.jsx)("li",{children:p},j))}),n.youCheck.accept!==null&&l===null&&(0,e.jsxs)(N,{action:n.youCheck.accept.action,children:[(0,e.jsx)(y,{fields:{return:n.youCheck.accept.returnTo,run:n.youCheck.accept.run}}),(0,e.jsx)("button",{type:"submit","data-accept-result":"",children:"Accept"})]})]}),n.showPanelAction!==!1&&o!==null&&(0,e.jsxs)("div",{className:"result-action","data-result-action":"need",children:[x(),r&&(0,e.jsx)("a",{className:"result-feedback-link",href:"#request-changes",children:"Send back"})]}),n.showPanelAction!==!1&&n.summary.details.publication.ciFailing&&(0,e.jsx)("div",{className:"result-action","data-result-action":"draft-repair",children:(0,e.jsxs)(N,{action:`/r/${s.runId}/draft-repair`,children:[(0,e.jsx)("p",{className:"meta",children:ve}),(0,e.jsx)("button",{type:"submit",children:"Send back"})]})}),u!==null&&(0,e.jsxs)("details",{className:"receipt-history",children:[(0,e.jsx)("summary",{children:"Review history"}),(0,e.jsx)("p",{className:"receipt-review meta","data-receipt-review":f,children:u})]}),(0,e.jsx)("nav",{className:"result-tabs",role:"tablist","aria-label":"result views",children:n.tabs.map(p=>{let j=p.key===t;return(0,e.jsxs)("a",{role:"tab",href:p.href,"data-result-tab":p.key,"aria-selected":j?"true":"false",tabIndex:j?0:-1,onClick:m=>{m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||m.button!==0||(m.preventDefault(),d(p.key))},children:[p.label,p.count!==""&&(0,e.jsx)("span",{className:"count",children:p.count})]},p.key)})}),(0,e.jsx)("div",{className:"result-view",role:"tabpanel","data-result-view":"summary",hidden:t!=="summary",children:(0,e.jsx)(Pe,{summary:n.summary})}),(0,e.jsx)("div",{className:"result-view",role:"tabpanel","data-result-view":"changes",hidden:t!=="changes",children:(0,e.jsx)(He,{changes:n.changes})}),(0,e.jsx)("div",{className:"result-view",role:"tabpanel","data-result-view":"checks",hidden:t!=="checks",children:(0,e.jsx)(Ue,{checks:n.checks,runId:s.runId})}),n.learning!==null&&(0,e.jsx)(ze,{learning:n.learning}),n.request!==null&&(0,e.jsx)("section",{className:"result-request",id:"request-changes",children:(0,e.jsx)(Me,{request:n.request})})]}),l!==null&&(0,e.jsx)(es,{completion:l})]})}var a=P(te(),1),ce={attention:"bg-attention",danger:"bg-destructive",info:"bg-info",success:"bg-success",neutral:"bg-muted-foreground",warning:"bg-muted-foreground"};function M({className:s,...n}){return(0,a.jsx)("section",{className:b("bg-card text-card-foreground flex flex-col gap-6 rounded-card border border-border p-6 shadow-xs phone:gap-4 phone:p-4",s),...n})}var oe=s=>B(s);function ss({view:s}){let[n,l]=(0,E.useState)(!1);return s.results.length===0?null:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)(T,{type:"button",variant:"outline",size:"sm","aria-expanded":n,"aria-haspopup":"menu",onClick:()=>l(i=>!i),children:["Results ",(0,a.jsx)("span",{className:"rounded-full bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:s.results.length}),s.attention>0&&(0,a.jsx)("span",{className:"rounded-full bg-attention px-1.5 text-xs tabular-nums text-on-attention",title:`${s.attention} need your attention`,children:s.attention}),(0,a.jsx)(je,{})]}),n&&(0,a.jsxs)("div",{role:"menu",className:"absolute right-0 z-30 mt-1 max-h-[70vh] w-80 overflow-y-auto rounded-md border border-border bg-card p-1 shadow-md",children:[s.attention>0&&(0,a.jsxs)("p",{className:"px-2 py-1.5 text-xs font-medium text-attention",children:[s.attention," need",s.attention===1?"s":""," your attention"]}),s.results.map(i=>(0,a.jsxs)("a",{role:"menuitem",href:i.href,onClick:()=>l(!1),"aria-current":i.current?"page":void 0,className:b("flex items-start gap-2.5 rounded-sm px-2 py-1.5 text-sm hover:bg-accent",i.current&&"bg-accent"),children:[(0,a.jsx)("span",{"aria-hidden":"true",className:b("mt-1.5 size-2 shrink-0 rounded-full",i.status===null?"bg-muted-foreground":ce[ie(i.status.tone)])}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:b("block truncate",i.needsYou?"font-semibold":"font-medium"),children:i.title}),(0,a.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:[i.status?.label,...i.notes,oe(i.at)].filter(Boolean).join(" · ")})]})]},i.href)),s.capped!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("hr",{className:"my-1 border-border"}),(0,a.jsxs)("p",{className:"px-2 py-1.5 text-xs font-normal text-muted-foreground",children:["Showing the newest ",s.capped,"; older results open from their task."]})]})]})]})}function Te({headline:s}){return(0,a.jsxs)("h2",{className:"flex items-center gap-2.5 text-lg font-semibold leading-snug","data-mismatch-headline":!0,children:[(0,a.jsx)(q,{"aria-hidden":"true",className:"size-4 shrink-0 text-foreground"}),s]})}function as({selected:s,acts:n,answers:l,bare:i=!1}){let{panel:t,checks:d}=s,r=m=>{if(m===null)return!1;let v=new URL(m,"http://console.invalid");return v.pathname==="/review"&&v.searchParams.get("result")===s.taskId&&!v.searchParams.has("tab")&&v.hash===""},o=t?.requirements==null||t.youCheck==null?null:ye(t.requirements,[...l.values()].filter(m=>m==="right").length,[...l.values()].filter(m=>m==="not-right").length),c=t?.status==null?null:{...t.status,details:t.status.details.map(m=>{let v=o!==null&&m.key==="requirements"&&m.text!=="Unverified"?{...m,text:o.text,mark:o.done?"ok":o.short?m.mark==="ok"?"note":m.mark:"none"}:m;return v.action!==null&&r(v.action.href)?{...v,action:null}:v})},h=ie(s.status.tone),u=n.primary==="rebuild"||n.primary==="recheck-stopped",x=s.noRun??(t!==null&&!u?t.outcome:c?.sentence??t?.outcome??""),f=s.mismatch,p=[...new Set([...c===null&&d?.problem===!0?[d.detail]:[],...s.problem===null?[]:[s.problem],...t?.attention??[]])].filter(m=>f===null||!f.said.includes(m)),j=c?.headline==="Failed";return i?f===null&&p.length===0?null:(0,a.jsxs)(M,{"data-result-warnings":!0,"aria-label":"What to know about this result",children:[f?.headline!=null&&(0,a.jsx)(Te,{headline:f.headline}),f!==null&&f.rows.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{"aria-label":"What doesn't match",className:"flex flex-col gap-1.5","data-mismatches":f.rows.length,children:f.rows.map((m,v)=>(0,a.jsx)("li",{"data-mismatch":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:(0,a.jsxs)("span",{children:[m.text,m.path!==null&&m.absent&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("code",{className:"font-mono text-xs",children:m.path})," ",(0,a.jsx)("span",{className:"text-muted-foreground","data-mismatch-absent":!0,children:"— not in the saved changes"})]}),m.href!==null&&(m.path!==null||m.noteLabel!==null)&&(0,a.jsxs)(a.Fragment,{children:[" · ",(0,a.jsx)("a",{href:m.href,"data-mismatch-lines":!0,className:b("font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground",m.path!==null&&"font-mono text-xs"),children:m.path!==null?`${m.path}${m.lines===null?"":`, ${m.lines}`}`:m.noteLabel})]})]})},v))})]}),p.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{className:"flex flex-col gap-1","aria-label":"Caveats","data-result-attention":p.length,children:p.map(m=>(0,a.jsx)("li",{"data-caveat":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:m},m))})]})]}):(0,a.jsxs)(M,{"data-result-status":s.status.token,"data-work-status":t?.headVerdict?.statusToken,"data-headline":c?.headline??s.status.label,"aria-label":"Result status",className:b(c?.headline==="Needs you"&&"border-wait"),children:[(0,a.jsxs)("div",{className:"min-w-0",children:[f?.headline!=null?(0,a.jsx)(Te,{headline:f.headline}):c!==null?(0,a.jsx)(me,{status:c}):(0,a.jsxs)("h2",{className:"flex items-center gap-2.5 text-lg font-semibold leading-snug",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:b("size-2.5 shrink-0 rounded-full",ce[h])}),s.status.label]}),x!==""&&(0,a.jsx)("p",{className:b("mt-1.5 max-w-[75ch] text-sm",s.failure!=null?"text-foreground":"text-muted-foreground"),"data-result-sentence":!0,...s.failure!=null?{"data-failure-reason":""}:{},children:x}),s.failure!=null&&(s.failure.evidence!==null||s.failure.link!==null)&&(0,a.jsxs)("p",{className:"mt-1 max-w-[75ch] text-body text-muted-foreground","data-failure-evidence":!0,children:[s.failure.evidence!==null&&(0,a.jsx)("span",{className:"[overflow-wrap:anywhere]",children:s.failure.evidence}),s.failure.link!==null&&(0,a.jsxs)(a.Fragment,{children:[s.failure.evidence!==null&&" ",(0,a.jsx)("a",{href:s.failure.link.href,"data-failure-log":!0,className:U,children:s.failure.link.label})]})]})]}),f!==null&&f.rows.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{"aria-label":"What doesn't match",className:"flex flex-col gap-1.5","data-mismatches":f.rows.length,children:f.rows.map((m,v)=>(0,a.jsx)("li",{"data-mismatch":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:(0,a.jsxs)("span",{children:[m.text,m.path!==null&&m.absent&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("code",{className:"font-mono text-xs",children:m.path})," ",(0,a.jsx)("span",{className:"text-muted-foreground","data-mismatch-absent":!0,children:"— not in the saved changes"})]}),m.href!==null&&(m.path!==null||m.noteLabel!==null)&&(0,a.jsxs)(a.Fragment,{children:[" · ",(0,a.jsx)("a",{href:m.href,"data-mismatch-lines":!0,className:b("font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:-my-3 phone:inline-block phone:py-3",m.path!==null&&"font-mono text-xs"),children:m.path!==null?`${m.path}${m.lines===null?"":`, ${m.lines}`}`:m.noteLabel})]})]})},v))})]}),c!==null&&(0,a.jsx)(X,{status:c}),p.length>0&&(0,a.jsxs)(O,{tone:j?"error":"info",children:[(0,a.jsx)(q,{"aria-hidden":"true"}),(0,a.jsx)("ul",{className:"flex flex-col gap-1","aria-label":"Caveats","data-result-attention":p.length,children:p.map(m=>(0,a.jsx)("li",{"data-caveat":!0,className:"min-w-0 [overflow-wrap:anywhere]",children:m},m))})]})]})}function ns(s){let n=document.getElementById("comment-form"),l=n?.querySelector("textarea[name=note]")??null,i=n?.querySelector("input[name=context]")??null,t=n?.closest("details")??null;if(t!==null&&!t.open&&(t.open=!0),l===null||i===null){window.location.hash="request-changes";return}let d=`Not right: “${s.replace(/\s+/g," ")}”`,r=i.value.split(`
4
4
  `).filter(c=>c.trim()!=="");r.includes(d)||r.push(d),i.value=r.join(`
5
- `);let o=n?.querySelector("[data-request-context-line]")??null;o!==null&&ue(o,i.value),l.dispatchEvent(new Event("input",{bubbles:!0})),l.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),l.focus(),l.setSelectionRange(l.value.length,l.value.length)}function ls({excerpt:s,changesHref:n}){return(0,a.jsxs)("figure",{className:"overflow-hidden rounded-md border border-border","data-check-excerpt":s.path,children:[(0,a.jsxs)("figcaption",{className:"flex flex-wrap items-baseline gap-x-2 border-b border-border bg-muted px-3 py-1.5 text-xs text-muted-foreground",children:[(0,a.jsx)("span",{className:"font-mono text-foreground [overflow-wrap:anywhere]",children:s.path}),!s.cited&&(0,a.jsx)("span",{children:"first changed file"})]}),(0,a.jsx)("ol",{className:"font-mono text-xs leading-relaxed",children:s.lines.map((l,i)=>(0,a.jsxs)("li",{"data-kind":l.kind,className:b("grid grid-cols-[2.5rem_1rem_minmax(0,1fr)] px-1 py-0.5",l.kind==="addition"?"bg-success-soft":l.kind==="deletion"?"bg-destructive-soft":""),children:[(0,a.jsx)("span",{className:"select-none pr-2 text-right text-muted-foreground tabular-nums",children:l.line??""}),(0,a.jsx)("span",{"aria-hidden":"true",className:"select-none text-muted-foreground",children:l.kind==="addition"?"+":l.kind==="deletion"?"−":" "}),(0,a.jsxs)("code",{className:"whitespace-pre-wrap rounded-none bg-transparent p-0 font-mono text-xs text-foreground [overflow-wrap:anywhere]",children:[(0,a.jsx)("span",{className:"sr-only",children:l.kind==="addition"?"Added: ":l.kind==="deletion"?"Removed: ":""}),l.text]})]},i))}),s.more>0&&(0,a.jsxs)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground",children:[s.more," more changed line",s.more===1?"":"s",n===null?"":(0,a.jsxs)(a.Fragment,{children:[" in ",(0,a.jsx)("a",{href:n,"data-result-goto":"changes",className:"underline underline-offset-4",children:"Changes"})]})]})]})}function We(s){let n=s?.youCheck??null;return n==null?[]:n.items.length>0?n.items:n.lines.map((l,i)=>({id:`line-${i}`,statement:"",words:l,note:null,excerpts:[],shots:[]}))}var _=s=>s.statement===""?s.words:s.statement;function ts(){let s=document.getElementById("result-decision");s!==null&&(s.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),s.querySelector("[data-result-acts] :is(button, a)")?.focus({preventScroll:!0}))}function Re(s){let n=document.querySelector(`[data-check-item="${CSS.escape(s)}"]`);n!==null&&(n.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),n.querySelector("[data-looks-right]")?.focus({preventScroll:!0}))}function rs({panel:s,chatHref:n,answers:l,answer:i}){let t=We(s),d=s.tabs.find(r=>r.key==="changes")?.href??null;return(0,a.jsxs)(M,{"aria-labelledby":"you-check-title","data-result-you-check":t.length,className:"gap-0 p-0 phone:gap-0 phone:p-0",children:[(0,a.jsx)("h2",{id:"you-check-title",className:"px-5 pb-1 pt-4 text-title phone:px-4",children:t.length===1?"You check this one":`You check these ${t.length}`}),(0,a.jsx)("ul",{className:"divide-y divide-border",children:t.map(r=>{let o=l.get(r.id)??null;return(0,a.jsxs)("li",{"data-check-item":r.id,"data-looks-right":o==="right"?"1":void 0,"data-not-right":o==="not-right"?"1":void 0,className:"flex scroll-mt-4 flex-col gap-3 px-5 py-4 phone:px-4",children:[(0,a.jsx)("p",{className:"max-w-[75ch] text-sm font-medium",children:_(r)}),r.note!==null&&(0,a.jsxs)("p",{className:"max-w-[75ch] text-body text-muted-foreground",children:["The agent says: ",r.note]}),r.excerpts.map(c=>(0,a.jsx)(ls,{excerpt:c,changesHref:d},c.path)),r.shots.length>0&&(()=>{let{pairs:c,rest:h}=ae(r.shots.map(u=>({...u,...s.canRequest&&u.image!==void 0?{commentPayload:JSON.stringify(u.image)}:{}})));return(0,a.jsxs)(a.Fragment,{children:[c.map(u=>(0,a.jsx)(se,{label:u.label,before:{src:u.before.src,href:u.before.href,caption:u.before.caption,...u.before.commentPayload===void 0?{}:{commentPayload:u.before.commentPayload}},after:{src:u.after.src,href:u.after.href,caption:u.after.caption,...u.after.commentPayload===void 0?{}:{commentPayload:u.after.commentPayload}}},u.key)),h.length>0&&(0,a.jsx)("ul",{className:"flex flex-wrap gap-2","aria-label":"Screenshots",children:h.map(u=>(0,a.jsxs)("li",{children:[(0,a.jsx)("a",{href:u.href,className:"block overflow-hidden rounded-md border border-border hover:border-muted-foreground",title:u.caption,children:(0,a.jsx)("img",{src:u.src,alt:u.caption,loading:"lazy",className:"h-24 w-auto max-w-[12rem] object-cover phone:h-20"})}),s.canRequest&&u.image!==void 0&&(0,a.jsx)(T,{variant:"ghost",className:"min-h-11","data-comment-image":JSON.stringify(u.image),"data-image-caption":u.caption,children:"Comment"})]},u.src))})]})})(),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(T,{variant:"outline","aria-pressed":o==="right",className:"min-h-11 aria-pressed:bg-success-soft aria-pressed:text-success phone:flex-1","data-looks-right":!0,onClick:()=>i(r.id,o==="right"?null:"right"),children:[(0,a.jsx)(fe,{}),"Looks right"]}),s.canRequest?(0,a.jsx)(T,{variant:"ghost","aria-pressed":o==="not-right",className:"min-h-11 aria-pressed:bg-attention-soft aria-pressed:text-foreground phone:flex-1","data-not-right":!0,onClick:()=>{let c=o==="not-right";i(r.id,c?null:"not-right"),c||ns(_(r))},children:"Not right"}):(0,a.jsx)(T,{asChild:!0,variant:"ghost",className:"min-h-11 phone:flex-1",children:(0,a.jsx)("a",{href:n,"data-not-right":!0,children:"Not right"})})]})]},r.id)})})]})}function is({selected:s,csrf:n,acts:l,decision:i,firstUnanswered:t,statusSlot:d=null}){let{next:r}=s,[o,c]=(0,E.useState)(!1),h=s.complete,u=s.panel?.need??null,x=s.panel?.youCheck??null,f=h===null?u?.accept??(x?.accept==null?null:{...x.accept,note:null}):null,p=[l.primary,l.secondary].filter(g=>g!==null),j=p.includes("accept")?i?.why??null:null,m=p.includes("accept")?h!==null?h.accept?.note??null:f?.note??null:null,v=m!==null||p.includes("accept-anyway"),L=l.line===D&&v?null:l.line??j,z=d!==null&&l.primary==="accept"&&m===null&&i?.ready===!0&&h!==null&&h.accept==null,k=d!==null&&l.primary===null&&l.secondary==="accept",W=z?S("accept",!0,"Mark complete"):k?(0,a.jsx)(V,{variant:"primary",label:"Review and accept",href:t!==null?"#you-check-title":"#result-decision","data-review-and-accept":"",onClick:g=>{g.preventDefault(),t!==null?Re(t):ts()}}):null,w=z?{...l,primary:null}:l;function S(g,I,Ee){let Be=I?"attention":"outline",A={"data-act":g,...I?{"data-ink-act":g,"data-primary-action":""}:{}};switch(g){case"retry":return s.failure?.retry==null?null:(0,a.jsx)(Ke,{action:s.failure.retry.action,csrf:n,note:s.failure.retry.note,pins:s.failure.retry.pins,variant:Be==="attention"?"attention":"default"},g);case"accept":{if(i===null)return null;let F=h??f;return F===null?null:(0,a.jsxs)(N,{action:F.action,className:b(m===null?"flex flex-wrap items-center gap-2 phone:w-full":"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none"),...m===null?{}:{"data-accept-with-reason":""},children:[(0,a.jsx)("input",{type:"hidden",name:"run",value:String(F.run)}),h!==null?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"hidden",name:"receipt",value:h.receipt}),h.accept!=null&&(0,a.jsx)("input",{type:"hidden",name:"accept",value:"1"}),h.returnTo!==void 0&&(0,a.jsx)("input",{type:"hidden",name:"return",value:h.returnTo})]}):f!==null&&(0,a.jsx)("input",{type:"hidden",name:"return",value:f.returnTo}),m!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"accept-reason",className:"k-label","data-accept-needs-reason":!0,children:D}),(0,a.jsx)(ne,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:m})]}),(0,a.jsx)(C,{type:"submit",variant:I?"primary":"outline",label:Ee??i.label,...A,"data-accept-result":""})]},g)}case"accept-anyway":{let F=s.failure?.acceptAnyway??null;return F==null?null:(0,a.jsxs)(N,{action:F.action,className:"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none","data-accept-with-reason":!0,"data-accept-anyway":!0,children:[(0,a.jsx)("input",{type:"hidden",name:"run",value:String(F.run)}),(0,a.jsx)("input",{type:"hidden",name:"return",value:F.returnTo}),(0,a.jsx)("label",{htmlFor:"accept-reason",className:"k-label","data-accept-needs-reason":!0,children:D}),(0,a.jsx)(ne,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:"Why is this safe to accept?"}),(0,a.jsx)(C,{type:"submit",variant:"outline",label:"Accept anyway",...A,"data-accept-result":""})]},g)}case"next-check":return t===null?null:(0,a.jsx)(C,{variant:I?"primary":"outline",label:"Go to your check",...A,onClick:()=>Re(t)},g);case"checks-running":return(0,a.jsx)(C,{variant:"outline",label:"Checks running",disabled:!0,"aria-disabled":"true",...A},g);case"run-checks":return s.runChecks===null?null:(0,a.jsxs)(N,{action:s.runChecks.action,className:"phone:w-full",children:[(0,a.jsx)("input",{type:"hidden",name:"level",value:s.runChecks.level}),(0,a.jsx)("input",{type:"hidden",name:"return",value:s.runChecks.returnTo}),(0,a.jsx)(C,{type:"submit",variant:I?"primary":"outline",label:"Run checks",...A})]},g);case"request-changes":return(0,a.jsx)(V,{variant:I?"primary":"outline",label:"Send back",href:"#request-changes",...A},g);case"rebuild":return u?.rebuild==null?null:(0,a.jsx)(xe,{action:u.rebuild.action,label:u.label,className:"min-h-11"},g);case"recheck-stopped":return u?.confirm==null?null:(0,a.jsx)(pe,{form:u.confirm,label:u.label},g);case"revise":case"draft-repair":return r===null?null:(0,a.jsx)(Qe,{control:r.control,className:"so-result-next phone:w-full"},g)}}let de=d!==null&&W!==null?(0,Le.createPortal)(W,d):null;if(w.primary===null&&w.secondary===null&&r===null&&s.failure==null)return de;let he=[w.primary,w.secondary].filter(g=>g!==null),J=i!==null&&he.includes("accept")?i.effect:null,Y=w.primary!==null?w.secondary:null,Oe=Y!==null||L!==null||r!==null||J!==null,Q=o?"":"phone:hidden";return(0,a.jsxs)(a.Fragment,{children:[de,(0,a.jsxs)("section",{id:"result-decision","data-result-decision":w.primary??"none","aria-label":"Decision","data-dock":o?"open":"compact",className:b("k-slots so-result-decision",w.primary==="accept"&&"wait"),children:[L!==null&&(0,a.jsxs)("p",{className:b("flex max-w-[75ch] gap-2 text-body",Q),"data-decision-why":!0,...w.line===null?{}:{"data-cant-accept":""},children:[(0,a.jsx)(q,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),L]}),s.failure!=null&&s.failure.retry===null&&(0,a.jsxs)("p",{className:"max-w-[75ch] text-body","data-failure-suggestion":!0,children:[(0,a.jsx)("span",{className:"font-semibold",children:"What to change."})," ",(0,a.jsx)("span",{className:"text-muted-foreground",children:s.failure.suggestion})]}),r!==null&&(0,a.jsxs)("p",{className:b("max-w-[75ch] text-body",Q),"data-next-action":r.kind,children:[(0,a.jsxs)("span",{className:"font-semibold",children:[r.title,"."]})," ",(0,a.jsx)("span",{className:"text-muted-foreground",children:r.detail})]}),he.length>0&&(0,a.jsxs)("div",{className:b("flex flex-wrap items-center gap-2 phone:flex-nowrap phone:items-stretch",m!==null&&"flex-col items-start gap-3 phone:flex-row phone:items-stretch phone:gap-2",o&&"phone:flex-wrap"),"data-result-acts":!0,children:[(0,a.jsx)("div",{className:"contents phone:flex phone:min-w-0 phone:flex-1 phone:flex-col",children:w.primary!==null?S(w.primary,!0):w.secondary!==null&&S(w.secondary,!1)}),Y!==null&&(0,a.jsx)("div",{className:b("contents phone:order-last phone:basis-full phone:flex-col",o?"phone:flex":"phone:hidden"),children:S(Y,!1)}),Oe&&(0,a.jsx)(C,{variant:"ghost",className:"k-phone-only","aria-expanded":o,label:o?"Less":"More","data-dock-more":"",onClick:()=>c(g=>!g)})]}),J!==null&&(0,a.jsx)("p",{className:b("k-slot-terms",Q),"data-decision-effect":!0,children:J})]})]})}function cs({panel:s,runId:n,children:l}){return(0,a.jsxs)("div",{id:"result",...s.attributes,className:"flex scroll-mt-4 flex-col gap-4",children:[(0,a.jsx)(Ie,{history:s.history}),(0,a.jsxs)("div",{className:"so-result-panel",children:[(0,a.jsx)("nav",{role:"tablist","aria-label":"Result views",className:"k-tabs",children:s.tabs.map(i=>(0,a.jsxs)("a",{role:"tab",href:i.href,"data-result-tab":i.key,"aria-selected":i.active?"true":"false",...i.active?{}:{tabIndex:-1},children:[i.label,i.count!==""&&(0,a.jsx)("span",{className:"k-count",children:i.count})]},i.key))}),s.tabs.map(i=>(0,a.jsx)("div",{role:"tabpanel","data-result-view":i.key,hidden:!i.active,className:"so-result-body",children:i.key==="summary"?(0,a.jsx)(Pe,{summary:s.summary}):i.key==="changes"?(0,a.jsx)(He,{changes:s.changes}):(0,a.jsx)(Ue,{checks:s.checks,runId:n})},i.key))]}),l,s.request!==null&&(0,a.jsx)("section",{id:"request-changes","aria-label":"Send back",className:b("result-request so-result-request-box",s.requestQuiet&&"is-quiet"),children:(0,a.jsx)(Me,{request:s.request,className:"so-result-request"})})]})}var re={edit:"edits",command:"commands",read:"reads",search:"searches",lookup:"web lookups",plan:"plans",delegate:"delegations",tool:"other tools"};function K(s){let n=Math.round(s/1e3);if(n<60)return`${n} s`;let l=Math.round(n/60);return l<60?`${l} min`:`${Math.floor(l/60)} h${l%60===0?"":` ${l%60} min`}`}function H(s){return s>=1e6?`${(s/1e6).toFixed(s>=1e7?0:1)}M`:s>=1e3?`${Math.round(s/1e3)}k`:String(s)}var R="—";function os(s){if(s.mode==="open")return"Open: it could reach any host";if(s.via===!0)return"Through its own research proxy only";let n=s.counts;if(n===void 0)return`Approved hosts only (${s.hosts??0})`;let l=n.hosts.filter(i=>i.refused>0).map(i=>i.host);return`${n.connections} connection${n.connections===1?"":"s"} to approved hosts`+(n.refused===0?"; nothing refused":`; refused ${l.slice(0,3).join(", ")}${l.length>3?` and ${l.length-3} more`:""}`)}function ds({one:s}){let n=s.counts;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-body",children:[n!==void 0&&n.hosts.length>0&&(0,a.jsx)("dl",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-1",children:n.hosts.map(l=>(0,a.jsxs)("div",{className:"contents",children:[(0,a.jsx)("dt",{className:"min-w-0 font-mono text-caption [overflow-wrap:anywhere]",children:l.host}),(0,a.jsx)("dd",{className:"text-right tabular-nums text-muted-foreground",children:l.refused>0?`refused ×${l.refused}`:`${l.connections}`})]},l.host))}),n!==void 0&&n.otherHosts>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["And ",n.otherHosts," more connection",n.otherHosts===1?"":"s"," to other hosts."]}),n!==void 0&&n.refused>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["An approver adds a host in the project's network settings (",(0,a.jsx)("span",{className:"font-mono",children:"toolroll project network --allow"}),"); new scopes get it."]}),(0,a.jsxs)("p",{className:"text-caption text-muted-foreground",children:["Counted by the build's own proxy: a connection its sandbox refused outright isn't counted.",s.loopback==="proxy-only"?" Local services on this machine were out of reach.":""]})]})}function hs(s){let n=s.time.agentMs===null?R:K(s.time.agentMs),l=s.usage.in===null?`${R} tokens in`:`${H(s.usage.in)} tokens in${s.usage.cacheShare===null?"":`, ${Math.round(s.usage.cacheShare*100)}% from cache`}`;return[n,s.turns===null?null:`${s.turns} turn${s.turns===1?"":"s"}`,l,`${s.usage.out===null?R:H(s.usage.out)} out`,s.steps.total===null?null:`${s.steps.total} step${s.steps.total===1?"":"s"}`].filter(i=>i!==null).join(" · ")}var De=s=>[s.time.waitMs,s.time.agentMs,s.turns,s.usage.in,s.usage.out,s.usage.cacheRead,s.usage.cacheWrite,s.steps.total].some(n=>n!==null);function us(s){return De(s)||s.steps.state!=="absent"}function ms({one:s}){let n=Object.entries(s.steps.byKind).filter(([,l])=>(l??0)>0).sort((l,i)=>(i[1]??0)-(l[1]??0));return(0,a.jsxs)("div",{className:"flex flex-col gap-3 text-body","data-run-efficiency":s.steps.state,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Time"}),(0,a.jsxs)("p",{children:["Waiting to start ",s.time.waitMs===null?R:K(s.time.waitMs)," · The agent ",s.time.agentMs===null?R:K(s.time.agentMs)]}),(0,a.jsx)("p",{className:"text-caption text-muted-foreground",children:"Checks aren't timed separately; they're inside the agent's time."})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Tokens"}),(0,a.jsxs)("p",{children:[s.usage.in===null?R:H(s.usage.in)," in",s.usage.cacheRead===null?"":` · ${H(s.usage.cacheRead)} read from cache`,s.usage.cacheWrite===null?"":` · ${H(s.usage.cacheWrite)} written to it`," · ",s.usage.out===null?R:H(s.usage.out)," out"]}),(0,a.jsxs)("p",{className:"text-caption text-muted-foreground",children:["As ",s.usage.provider,s.usage.model===null?"":` · ${s.usage.model}`," reported them",s.usage.cacheShare===null?"; it didn't report its cache":"","."]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Steps"}),s.steps.total===null?(0,a.jsx)("p",{className:"text-muted-foreground","data-run-efficiency-steps":s.steps.state,children:s.steps.reason}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:[s.steps.total," step",s.steps.total===1?"":"s",n.length===0?"":`: ${n.map(([l,i])=>`${i} ${re[l]??l}`).join(", ")}`,(s.steps.failed??0)>0?` · ${s.steps.failed} failed`:""]}),s.steps.longest.length>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Longest: ",s.steps.longest.map(l=>`${re[l.kind]?.replace(/s$/,"")??l.kind} ${K(l.ms)}`).join(" · "),(s.steps.unknownDuration??0)>0?` · ${s.steps.unknownDuration} without a measured time`:""]}),s.steps.reason!==null&&(0,a.jsx)("p",{className:"text-caption text-muted-foreground",children:s.steps.reason})]})]}),s.steps.total!==null&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Repeated activity"}),s.steps.repeats===null?(0,a.jsx)("p",{className:"text-muted-foreground",children:s.steps.repeatsReason}):s.steps.repeats.length===0?(0,a.jsx)("p",{className:"text-muted-foreground",children:"No step ran three times or more with the same input."}):(0,a.jsx)("ul",{className:"flex flex-col gap-0.5","data-run-repeats":s.steps.repeats.length,children:s.steps.repeats.map((l,i)=>(0,a.jsxs)("li",{children:["The same ",re[l.kind]?.replace(/s$/,"")??l.kind," step ",l.count," times"]},i))}),s.steps.repeats!==null&&s.steps.repeatsReason!==null&&(0,a.jsx)("p",{className:"text-caption text-muted-foreground",children:s.steps.repeatsReason})]})]})}function ps({selected:s}){let n=s.panel?.learning??null,l=s.panel,i=l?.status==null?[]:Z(l.status),t=s.record,d=[{id:"intent",title:"Approved plan",hint:s.intent===null?null:(0,a.jsxs)(a.Fragment,{children:[s.intent.approval,s.intent.approvedAt!=null&&(0,a.jsxs)(a.Fragment,{children:[" · ",(0,a.jsx)("time",{dateTime:s.intent.approvedAt,title:ee(s.intent.approvedAt),children:B(s.intent.approvedAt)})]})]}),body:s.intent===null?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No plan was filed for this task, so there is no approved goal or boundary to review."}):(0,a.jsx)(Xe,{intent:s.intent,className:"so-result-intent"})},...s.notes.length===0?[]:[{id:"notes",title:"Notes",hint:null,count:s.notes.length,body:(0,a.jsx)("ul",{className:"flex flex-col gap-2 text-sm",children:s.notes.map((r,o)=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("span",{className:"text-muted-foreground",children:[r.author," · ",oe(r.at)]})," ",r.note]},o))})}],...i.length===0?[]:[{id:"why",title:"Recorded reasons",hint:null,count:i.length,body:(0,a.jsx)("div",{className:"flex flex-col gap-1 text-body text-muted-foreground","data-status-why":!0,children:i.map(r=>(0,a.jsx)("p",{className:"[overflow-wrap:anywhere]",children:r},r))})}],...l===null||l.limits.length===0?[]:[{id:"limits",title:"What was shortened",hint:null,count:l.limits.length,body:(0,a.jsx)("ul",{className:"flex flex-col gap-1 text-body text-muted-foreground",children:l.limits.map(r=>(0,a.jsx)("li",{children:r},r))})}],...l?.reviewHistory==null?[]:[{id:"review-history",title:"Review history",hint:null,body:(0,a.jsx)("p",{className:"text-body text-muted-foreground",children:l.reviewHistory})}],...s.efficiency==null||!us(s.efficiency)?[]:[{id:"how-it-ran",title:"How it ran",hint:De(s.efficiency)?hs(s.efficiency):s.efficiency.steps.reason,body:(0,a.jsx)(ms,{one:s.efficiency})}],...s.network==null?[]:[{id:"network",title:"Network",hint:os(s.network),body:(0,a.jsx)(ds,{one:s.network})}],...s.timing==null||s.timing.length===0?[]:[{id:"timing",title:"Where the time went",hint:s.timing.map(r=>`${r.title} ${r.total}`).join(" · "),body:(0,a.jsx)(gs,{groups:s.timing})}],...t===null?[]:[{id:"run-record",title:"Run record",hint:`Build #${t.build}`,body:(0,a.jsxs)("div",{className:"flex flex-col gap-3 text-body",children:[(0,a.jsx)("dl",{className:"grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-1.5",children:t.facts.map(r=>(0,a.jsxs)("div",{className:"contents",children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:r.label}),(0,a.jsx)("dd",{className:"min-w-0 [overflow-wrap:anywhere]",children:r.value})]},r.label))}),(0,a.jsxs)("p",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[s.checks?.logHref!=null&&(0,a.jsx)("a",{href:s.checks.logHref,className:U,children:"Check output"}),(0,a.jsx)("a",{href:t.href,className:U,children:"Full run record"})]})]})}]];return(0,a.jsxs)(M,{"aria-label":"Result record",className:"gap-0 divide-y divide-border overflow-hidden p-0 phone:p-0",children:[n!==null&&(0,a.jsx)("div",{"data-cockpit-section":"learning",children:(0,a.jsx)(ze,{learning:n,className:"so-result-learning"})}),d.map(r=>(0,a.jsxs)("details",{id:r.id,className:"group scroll-mt-4","data-cockpit-section":r.id,children:[(0,a.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-5 py-3.5 hover:bg-accent/50 phone:min-h-12 phone:px-4 [&::-webkit-details-marker]:hidden",children:[(0,a.jsx)(ge,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-90","aria-hidden":"true"}),(0,a.jsx)("h2",{className:"shrink-0 text-title leading-normal",children:r.title}),r.count!==void 0&&(0,a.jsx)(ke,{children:r.count}),r.hint!=null&&(0,a.jsx)("span",{className:"min-w-0 truncate text-body text-muted-foreground",children:r.hint})]}),(0,a.jsx)("div",{className:"px-5 pb-5 pt-1 phone:px-4",children:r.body})]},r.id))]})}var U="font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:inline-flex phone:min-h-11 phone:items-center";function xs(s){let n=document.getElementById("run-record");n instanceof HTMLDetailsElement&&(s.preventDefault(),n.open=!0,n.scrollIntoView({block:"start",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),history.replaceState(history.state,"","#run-record"))}var fs=new Set(["retry","rebuild","recheck-stopped"]);function js({selected:s,csrf:n,inTask:l}){let[i,t]=(0,E.useState)(new Map),d=(k,W)=>t(w=>{let S=new Map(w);return W===null?S.delete(k):S.set(k,W),S}),r=We(s.panel),o=r.filter(k=>!i.has(k.id)),c=r.filter(k=>i.get(k.id)==="not-right"),h={unanswered:o.map(_),notRight:c.map(_)},u=s.decision===null?null:{...s.decision,...Ne(s.decision.base??s.decision,h)},x=s.actFacts===void 0?s.acts:ve({...s.actFacts,...s.actFacts.accept===null?{}:{accept:{ready:u?.ready??!1}},unanswered:o.length,notRight:c.length}),f=k=>l?.current===!0&&k!==null&&fs.has(k)?null:k,p=l?.current===!0?{...x,primary:f(x.primary),secondary:f(x.secondary)}:x,j=s.panel?.youCheck!=null?(0,a.jsx)(rs,{panel:s.panel,chatHref:s.chatHref,answers:i,answer:d}):null,m=(0,E.useContext)(Ge),v=(0,a.jsx)(is,{selected:s,csrf:n,acts:p,decision:u,firstUnanswered:o[0]?.id??null,statusSlot:l?.current===!0?m:null}),L=(0,E.useContext)(_e),z=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(as,{selected:s,acts:p,answers:i,bare:l?.current===!0}),(0,a.jsx)(Ve,{report:s.agentReport,said:s.youSaid})]});return(0,a.jsxs)(a.Fragment,{children:[l?.current===!0&&L!==null?(0,Le.createPortal)(z,L):z,s.panel!==null?(0,a.jsx)(cs,{panel:s.panel,runId:s.build??0,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[j,v]})}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[j,v]}),(0,a.jsx)(ps,{selected:s})]})}function vt({view:s,csrf:n}){let l=s.selected;return(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-4",children:[(0,a.jsxs)("header",{className:"flex flex-col gap-3 pb-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1 basis-72",children:[(0,a.jsx)("h1",{className:"text-display tracking-tight phone:text-[22px]",children:l?.title??"Results"}),l!==null&&(0,a.jsxs)("p",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-body text-muted-foreground phone:gap-y-0","data-result-meta":!0,children:[l.project!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium text-foreground/80",children:l.project}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"})]}),l.record!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("a",{href:"#run-record",onClick:xs,className:U,children:["Build #",l.record.build]}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,a.jsx)("a",{href:l.taskHref,className:U,children:"Open task"}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,a.jsx)("a",{href:l.chatHref,className:U,children:"Discuss"})]})]}),l!==null&&(0,a.jsx)(ss,{view:s})]}),s.missing!==null&&(0,a.jsxs)("p",{role:"status",className:"rounded-md bg-muted px-3 py-2 text-body text-foreground",children:[s.missing,l!==null?" Showing the newest result instead.":""]}),s.beyond&&(0,a.jsx)("p",{className:"text-body text-muted-foreground",children:"This result is older than the list in Results."})]}),l===null?s.results.length===0?(0,a.jsxs)(M,{className:"items-start py-10",children:[(0,a.jsx)("p",{className:"text-base text-muted-foreground",children:"Nothing to review yet."}),(0,a.jsx)(T,{asChild:!0,variant:"outline",children:(0,a.jsx)("a",{href:"/",children:"Open Work"})})]}):(0,a.jsx)(M,{"aria-label":"Results",className:"gap-0 overflow-hidden p-0 phone:p-0",children:(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.results.map(i=>(0,a.jsxs)("li",{className:"flex items-start gap-3 px-5 py-3 phone:px-4",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:b("mt-2 size-2 shrink-0 rounded-full",i.status===null?"bg-muted-foreground":ce[ie(i.status.tone)])}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("a",{href:i.href,className:b("block truncate hover:underline hover:underline-offset-4",i.needsYou?"font-semibold":"font-medium"),children:i.title}),(0,a.jsx)("p",{className:"truncate text-body text-muted-foreground",children:[i.status?.label,...i.notes,oe(i.at)].filter(Boolean).join(" · ")})]})]},i.href))})}):(0,a.jsx)(js,{selected:l,csrf:n},`${l.taskId}:${l.build??""}`)]})}function gs({groups:s}){return(0,a.jsx)("div",{className:"flex flex-col gap-4 text-body","data-timing":!0,children:s.map((n,l)=>(0,a.jsxs)("section",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium",children:[n.title," ",(0,a.jsxs)("span",{className:"text-muted-foreground",children:["· ",n.total]})]}),(0,a.jsx)("dl",{className:"grid grid-cols-[4.5rem_minmax(0,1fr)] gap-x-3 gap-y-1",children:n.rows.map((i,t)=>(0,a.jsxs)("div",{className:"contents",children:[(0,a.jsx)("dt",{className:"font-mono text-muted-foreground tabular-nums",children:i.at}),(0,a.jsxs)("dd",{className:"min-w-0 [overflow-wrap:anywhere]",children:[i.label,i.detail!==null&&(0,a.jsxs)("span",{className:"text-muted-foreground",children:[" · ",i.detail]})]})]},t))})]},l))})}export{bt as a,Te as b,ls as c,K as d,H as e,os as f,hs as g,us as h,js as i,vt as j};
5
+ `);let o=n?.querySelector("[data-request-context-line]")??null;o!==null&&ue(o,i.value),l.dispatchEvent(new Event("input",{bubbles:!0})),l.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),l.focus(),l.setSelectionRange(l.value.length,l.value.length)}function ls({excerpt:s,changesHref:n}){return(0,a.jsxs)("figure",{className:"overflow-hidden rounded-md border border-border","data-check-excerpt":s.path,children:[(0,a.jsxs)("figcaption",{className:"flex flex-wrap items-baseline gap-x-2 border-b border-border bg-muted px-3 py-1.5 text-xs text-muted-foreground",children:[(0,a.jsx)("span",{className:"font-mono text-foreground [overflow-wrap:anywhere]",children:s.path}),!s.cited&&(0,a.jsx)("span",{children:"first changed file"})]}),(0,a.jsx)("ol",{className:"font-mono text-xs leading-relaxed",children:s.lines.map((l,i)=>(0,a.jsxs)("li",{"data-kind":l.kind,className:b("grid grid-cols-[2.5rem_1rem_minmax(0,1fr)] px-1 py-0.5",l.kind==="addition"?"bg-success-soft":l.kind==="deletion"?"bg-destructive-soft":""),children:[(0,a.jsx)("span",{className:"select-none pr-2 text-right text-muted-foreground tabular-nums",children:l.line??""}),(0,a.jsx)("span",{"aria-hidden":"true",className:"select-none text-muted-foreground",children:l.kind==="addition"?"+":l.kind==="deletion"?"−":" "}),(0,a.jsxs)("code",{className:"whitespace-pre-wrap rounded-none bg-transparent p-0 font-mono text-xs text-foreground [overflow-wrap:anywhere]",children:[(0,a.jsx)("span",{className:"sr-only",children:l.kind==="addition"?"Added: ":l.kind==="deletion"?"Removed: ":""}),l.text]})]},i))}),s.more>0&&(0,a.jsxs)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground",children:[s.more," more changed line",s.more===1?"":"s",n===null?"":(0,a.jsxs)(a.Fragment,{children:[" in ",(0,a.jsx)("a",{href:n,"data-result-goto":"changes",className:"underline underline-offset-4",children:"Changes"})]})]})]})}function We(s){let n=s?.youCheck??null;return n==null?[]:n.items.length>0?n.items:n.lines.map((l,i)=>({id:`line-${i}`,statement:"",words:l,note:null,excerpts:[],shots:[]}))}var G=s=>s.statement===""?s.words:s.statement;function ts(){let s=document.getElementById("result-decision");s!==null&&(s.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),s.querySelector("[data-result-acts] :is(button, a)")?.focus({preventScroll:!0}))}function Re(s){let n=document.querySelector(`[data-check-item="${CSS.escape(s)}"]`);n!==null&&(n.scrollIntoView({block:"center",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),n.querySelector("[data-looks-right]")?.focus({preventScroll:!0}))}function rs({panel:s,chatHref:n,answers:l,answer:i}){let t=We(s),d=s.tabs.find(r=>r.key==="changes")?.href??null;return(0,a.jsxs)(M,{"aria-labelledby":"you-check-title","data-result-you-check":t.length,className:"gap-0 p-0 phone:gap-0 phone:p-0",children:[(0,a.jsx)("h2",{id:"you-check-title",className:"px-5 pb-1 pt-4 text-title phone:px-4",children:t.length===1?"You check this one":`You check these ${t.length}`}),(0,a.jsx)("ul",{className:"divide-y divide-border",children:t.map(r=>{let o=l.get(r.id)??null;return(0,a.jsxs)("li",{"data-check-item":r.id,"data-looks-right":o==="right"?"1":void 0,"data-not-right":o==="not-right"?"1":void 0,className:"flex scroll-mt-4 flex-col gap-3 px-5 py-4 phone:px-4",children:[(0,a.jsx)("p",{className:"max-w-[75ch] text-sm font-medium",children:G(r)}),r.note!==null&&(0,a.jsxs)("p",{className:"max-w-[75ch] text-body text-muted-foreground",children:["The agent says: ",r.note]}),r.excerpts.map(c=>(0,a.jsx)(ls,{excerpt:c,changesHref:d},c.path)),r.shots.length>0&&(()=>{let{pairs:c,rest:h}=ae(r.shots.map(u=>({...u,...s.canRequest&&u.image!==void 0?{commentPayload:JSON.stringify(u.image)}:{}})));return(0,a.jsxs)(a.Fragment,{children:[c.map(u=>(0,a.jsx)(se,{label:u.label,before:{src:u.before.src,href:u.before.href,caption:u.before.caption,...u.before.commentPayload===void 0?{}:{commentPayload:u.before.commentPayload}},after:{src:u.after.src,href:u.after.href,caption:u.after.caption,...u.after.commentPayload===void 0?{}:{commentPayload:u.after.commentPayload}}},u.key)),h.length>0&&(0,a.jsx)("ul",{className:"flex flex-wrap gap-2","aria-label":"Screenshots",children:h.map(u=>(0,a.jsxs)("li",{children:[(0,a.jsx)("a",{href:u.href,className:"block overflow-hidden rounded-md border border-border hover:border-muted-foreground",title:u.caption,children:(0,a.jsx)("img",{src:u.src,alt:u.caption,loading:"lazy",className:"h-24 w-auto max-w-[12rem] object-cover phone:h-20"})}),s.canRequest&&u.image!==void 0&&(0,a.jsx)(T,{variant:"ghost",className:"min-h-11","data-comment-image":JSON.stringify(u.image),"data-image-caption":u.caption,children:"Comment"})]},u.src))})]})})(),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(T,{variant:"outline","aria-pressed":o==="right",className:"min-h-11 aria-pressed:bg-success-soft aria-pressed:text-success phone:flex-1","data-looks-right":!0,onClick:()=>i(r.id,o==="right"?null:"right"),children:[(0,a.jsx)(fe,{}),"Looks right"]}),s.canRequest?(0,a.jsx)(T,{variant:"ghost","aria-pressed":o==="not-right",className:"min-h-11 aria-pressed:bg-attention-soft aria-pressed:text-foreground phone:flex-1","data-not-right":!0,onClick:()=>{let c=o==="not-right";i(r.id,c?null:"not-right"),c||ns(G(r))},children:"Not right"}):(0,a.jsx)(T,{asChild:!0,variant:"ghost",className:"min-h-11 phone:flex-1",children:(0,a.jsx)("a",{href:n,"data-not-right":!0,children:"Not right"})})]})]},r.id)})})]})}function is({selected:s,csrf:n,acts:l,decision:i,firstUnanswered:t,statusSlot:d=null}){let{next:r}=s,[o,c]=(0,E.useState)(!1),h=s.complete,u=s.panel?.need??null,x=s.panel?.youCheck??null,f=h===null?u?.accept??(x?.accept==null?null:{...x.accept,note:null}):null,p=[l.primary,l.secondary].filter(g=>g!==null),j=p.includes("accept")?i?.why??null:null,m=p.includes("accept")?h!==null?h.accept?.note??null:f?.note??null:null,v=m!==null||p.includes("accept-anyway"),L=l.line===D&&v?null:l.line??j,z=d!==null&&l.primary==="accept"&&m===null&&i?.ready===!0&&h!==null&&h.accept==null,$=d!==null&&l.primary===null&&l.secondary==="accept",W=z?S("accept",!0,"Mark complete"):$?(0,a.jsx)(V,{variant:"primary",label:"Review and accept",href:t!==null?"#you-check-title":"#result-decision","data-review-and-accept":"",onClick:g=>{g.preventDefault(),t!==null?Re(t):ts()}}):null,w=z?{...l,primary:null}:l;function S(g,I,Ee){let Be=I?"attention":"outline",A={"data-act":g,...I?{"data-ink-act":g,"data-primary-action":""}:{}};switch(g){case"retry":return s.failure?.retry==null?null:(0,a.jsx)(Ke,{action:s.failure.retry.action,csrf:n,note:s.failure.retry.note,pins:s.failure.retry.pins,variant:Be==="attention"?"attention":"default"},g);case"accept":{if(i===null)return null;let F=h??f;return F===null?null:(0,a.jsxs)(N,{action:F.action,className:b(m===null?"flex flex-wrap items-center gap-2 phone:w-full":"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none"),...m===null?{}:{"data-accept-with-reason":""},children:[(0,a.jsx)("input",{type:"hidden",name:"run",value:String(F.run)}),h!==null?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"hidden",name:"receipt",value:h.receipt}),h.accept!=null&&(0,a.jsx)("input",{type:"hidden",name:"accept",value:"1"}),h.returnTo!==void 0&&(0,a.jsx)("input",{type:"hidden",name:"return",value:h.returnTo})]}):f!==null&&(0,a.jsx)("input",{type:"hidden",name:"return",value:f.returnTo}),m!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"accept-reason",className:"k-label","data-accept-needs-reason":!0,children:D}),(0,a.jsx)(ne,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:m})]}),(0,a.jsx)(C,{type:"submit",variant:I?"primary":"outline",label:Ee??i.label,...A,"data-accept-result":""})]},g)}case"accept-anyway":{let F=s.failure?.acceptAnyway??null;return F==null?null:(0,a.jsxs)(N,{action:F.action,className:"flex w-full max-w-sm flex-col items-start gap-2 phone:max-w-none","data-accept-with-reason":!0,"data-accept-anyway":!0,children:[(0,a.jsx)("input",{type:"hidden",name:"run",value:String(F.run)}),(0,a.jsx)("input",{type:"hidden",name:"return",value:F.returnTo}),(0,a.jsx)("label",{htmlFor:"accept-reason",className:"k-label","data-accept-needs-reason":!0,children:D}),(0,a.jsx)(ne,{id:"accept-reason",type:"text",name:"note",maxLength:500,required:!0,placeholder:"Why is this safe to accept?"}),(0,a.jsx)(C,{type:"submit",variant:"outline",label:"Accept anyway",...A,"data-accept-result":""})]},g)}case"next-check":return t===null?null:(0,a.jsx)(C,{variant:I?"primary":"outline",label:"Go to your check",...A,onClick:()=>Re(t)},g);case"checks-running":return(0,a.jsx)(C,{variant:"outline",label:"Checks running",disabled:!0,"aria-disabled":"true",...A},g);case"run-checks":return s.runChecks===null?null:(0,a.jsxs)(N,{action:s.runChecks.action,className:"phone:w-full",children:[(0,a.jsx)("input",{type:"hidden",name:"level",value:s.runChecks.level}),(0,a.jsx)("input",{type:"hidden",name:"return",value:s.runChecks.returnTo}),(0,a.jsx)(C,{type:"submit",variant:I?"primary":"outline",label:"Run checks",...A})]},g);case"request-changes":return(0,a.jsx)(V,{variant:I?"primary":"outline",label:"Send back",href:"#request-changes",...A},g);case"rebuild":return u?.rebuild==null?null:(0,a.jsx)(xe,{action:u.rebuild.action,label:u.label,className:"min-h-11"},g);case"recheck-stopped":return u?.confirm==null?null:(0,a.jsx)(pe,{form:u.confirm,label:u.label},g);case"revise":case"draft-repair":return r===null?null:(0,a.jsx)(Qe,{control:r.control,className:"so-result-next phone:w-full"},g)}}let de=d!==null&&W!==null?(0,Le.createPortal)(W,d):null;if(w.primary===null&&w.secondary===null&&r===null&&s.failure==null)return de;let he=[w.primary,w.secondary].filter(g=>g!==null),J=i!==null&&he.includes("accept")?i.effect:null,Y=w.primary!==null?w.secondary:null,Oe=Y!==null||L!==null||r!==null||J!==null,Q=o?"":"phone:hidden";return(0,a.jsxs)(a.Fragment,{children:[de,(0,a.jsxs)("section",{id:"result-decision","data-result-decision":w.primary??"none","aria-label":"Decision","data-dock":o?"open":"compact",className:b("k-slots so-result-decision",w.primary==="accept"&&"wait"),children:[L!==null&&(0,a.jsxs)("p",{className:b("flex max-w-[75ch] gap-2 text-body",Q),"data-decision-why":!0,...w.line===null?{}:{"data-cant-accept":""},children:[(0,a.jsx)(q,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),L]}),s.failure!=null&&s.failure.retry===null&&(0,a.jsxs)("p",{className:"max-w-[75ch] text-body","data-failure-suggestion":!0,children:[(0,a.jsx)("span",{className:"font-semibold",children:"What to change."})," ",(0,a.jsx)("span",{className:"text-muted-foreground",children:s.failure.suggestion})]}),r!==null&&(0,a.jsxs)("p",{className:b("max-w-[75ch] text-body",Q),"data-next-action":r.kind,children:[(0,a.jsxs)("span",{className:"font-semibold",children:[r.title,"."]})," ",(0,a.jsx)("span",{className:"text-muted-foreground",children:r.detail})]}),he.length>0&&(0,a.jsxs)("div",{className:b("flex flex-wrap items-center gap-2 phone:flex-nowrap phone:items-stretch",m!==null&&"flex-col items-start gap-3 phone:flex-row phone:items-stretch phone:gap-2",o&&"phone:flex-wrap"),"data-result-acts":!0,children:[(0,a.jsx)("div",{className:"contents phone:flex phone:min-w-0 phone:flex-1 phone:flex-col",children:w.primary!==null?S(w.primary,!0):w.secondary!==null&&S(w.secondary,!1)}),Y!==null&&(0,a.jsx)("div",{className:b("contents phone:order-last phone:basis-full phone:flex-col",o?"phone:flex":"phone:hidden"),children:S(Y,!1)}),Oe&&(0,a.jsx)(C,{variant:"ghost",className:"k-phone-only","aria-expanded":o,label:o?"Less":"More","data-dock-more":"",onClick:()=>c(g=>!g)})]}),J!==null&&(0,a.jsx)("p",{className:b("k-slot-terms",Q),"data-decision-effect":!0,children:J})]})]})}function cs({panel:s,runId:n,children:l}){return(0,a.jsxs)("div",{id:"result",...s.attributes,className:"flex scroll-mt-4 flex-col gap-4",children:[(0,a.jsx)(Ie,{history:s.history}),(0,a.jsxs)("div",{className:"so-result-panel",children:[(0,a.jsx)("nav",{role:"tablist","aria-label":"Result views",className:"k-tabs",children:s.tabs.map(i=>(0,a.jsxs)("a",{role:"tab",href:i.href,"data-result-tab":i.key,"aria-selected":i.active?"true":"false",...i.active?{}:{tabIndex:-1},children:[i.label,i.count!==""&&(0,a.jsx)("span",{className:"k-count",children:i.count})]},i.key))}),s.tabs.map(i=>(0,a.jsx)("div",{role:"tabpanel","data-result-view":i.key,hidden:!i.active,className:"so-result-body",children:i.key==="summary"?(0,a.jsx)(Pe,{summary:s.summary}):i.key==="changes"?(0,a.jsx)(He,{changes:s.changes}):(0,a.jsx)(Ue,{checks:s.checks,runId:n})},i.key))]}),l,s.request!==null&&(0,a.jsx)("section",{id:"request-changes","aria-label":"Send back",className:b("result-request so-result-request-box",s.requestQuiet&&"is-quiet"),children:(0,a.jsx)(Me,{request:s.request,className:"so-result-request"})})]})}var re={edit:"edits",command:"commands",read:"reads",search:"searches",lookup:"web lookups",plan:"plans",delegate:"delegations",tool:"other tools"};function K(s){let n=Math.round(s/1e3);if(n<60)return`${n} s`;let l=Math.round(n/60);return l<60?`${l} min`:`${Math.floor(l/60)} h${l%60===0?"":` ${l%60} min`}`}function H(s){return s>=1e6?`${(s/1e6).toFixed(s>=1e7?0:1)}M`:s>=1e3?`${Math.round(s/1e3)}k`:String(s)}var R="—";function os(s){if(s.mode==="open")return"Open: it could reach any host";if(s.via===!0)return"Through its own research proxy only";let n=s.counts;if(n===void 0)return`Approved hosts only (${s.hosts??0})`;let l=n.hosts.filter(i=>i.refused>0).map(i=>i.host);return`${n.connections} connection${n.connections===1?"":"s"} to approved hosts`+(n.refused===0?"; nothing refused":`; refused ${l.slice(0,3).join(", ")}${l.length>3?` and ${l.length-3} more`:""}`)}function ds({one:s}){let n=s.counts;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-body",children:[n!==void 0&&n.hosts.length>0&&(0,a.jsx)("dl",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-1",children:n.hosts.map(l=>(0,a.jsxs)("div",{className:"contents",children:[(0,a.jsx)("dt",{className:"min-w-0 font-mono text-caption [overflow-wrap:anywhere]",children:l.host}),(0,a.jsx)("dd",{className:"text-right tabular-nums text-muted-foreground",children:l.refused>0?`refused ×${l.refused}`:`${l.connections}`})]},l.host))}),n!==void 0&&n.otherHosts>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["And ",n.otherHosts," more connection",n.otherHosts===1?"":"s"," to other hosts."]}),n!==void 0&&n.refused>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["An approver adds a host in the project's network settings (",(0,a.jsx)("span",{className:"font-mono",children:"toolroll project network --allow"}),"); new scopes get it."]}),(0,a.jsxs)("p",{className:"text-caption text-muted-foreground",children:["Counted by the build's own proxy: a connection its sandbox refused outright isn't counted.",s.loopback==="proxy-only"?" Local services on this machine were out of reach.":""]})]})}function hs(s){let n=s.time.agentMs===null?R:K(s.time.agentMs),l=s.usage.in===null?`${R} tokens in`:`${H(s.usage.in)} tokens in${s.usage.cacheShare===null?"":`, ${Math.round(s.usage.cacheShare*100)}% from cache`}`;return[n,s.turns===null?null:`${s.turns} turn${s.turns===1?"":"s"}`,l,`${s.usage.out===null?R:H(s.usage.out)} out`,s.steps.total===null?null:`${s.steps.total} step${s.steps.total===1?"":"s"}`].filter(i=>i!==null).join(" · ")}var De=s=>[s.time.waitMs,s.time.agentMs,s.turns,s.usage.in,s.usage.out,s.usage.cacheRead,s.usage.cacheWrite,s.steps.total].some(n=>n!==null);function us(s){return De(s)||s.steps.state!=="absent"}function ms({one:s}){let n=Object.entries(s.steps.byKind).filter(([,l])=>(l??0)>0).sort((l,i)=>(i[1]??0)-(l[1]??0));return(0,a.jsxs)("div",{className:"flex flex-col gap-3 text-body","data-run-efficiency":s.steps.state,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Time"}),(0,a.jsxs)("p",{children:["Waiting to start ",s.time.waitMs===null?R:K(s.time.waitMs)," · The agent ",s.time.agentMs===null?R:K(s.time.agentMs)]}),(0,a.jsx)("p",{className:"text-caption text-muted-foreground",children:"Checks aren't timed separately; they're inside the agent's time."})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Tokens"}),(0,a.jsxs)("p",{children:[s.usage.in===null?R:H(s.usage.in)," in",s.usage.cacheRead===null?"":` · ${H(s.usage.cacheRead)} read from cache`,s.usage.cacheWrite===null?"":` · ${H(s.usage.cacheWrite)} written to it`," · ",s.usage.out===null?R:H(s.usage.out)," out"]}),(0,a.jsxs)("p",{className:"text-caption text-muted-foreground",children:["As ",s.usage.provider,s.usage.model===null?"":` · ${s.usage.model}`," reported them",s.usage.cacheShare===null?"; it didn't report its cache":"","."]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Steps"}),s.steps.total===null?(0,a.jsx)("p",{className:"text-muted-foreground","data-run-efficiency-steps":s.steps.state,children:s.steps.reason}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{children:[s.steps.total," step",s.steps.total===1?"":"s",n.length===0?"":`: ${n.map(([l,i])=>`${i} ${re[l]??l}`).join(", ")}`,(s.steps.failed??0)>0?` · ${s.steps.failed} failed`:""]}),s.steps.longest.length>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Longest: ",s.steps.longest.map(l=>`${re[l.kind]?.replace(/s$/,"")??l.kind} ${K(l.ms)}`).join(" · "),(s.steps.unknownDuration??0)>0?` · ${s.steps.unknownDuration} without a measured time`:""]}),s.steps.reason!==null&&(0,a.jsx)("p",{className:"text-caption text-muted-foreground",children:s.steps.reason})]})]}),s.steps.total!==null&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-caption font-medium text-muted-foreground",children:"Repeated activity"}),s.steps.repeats===null?(0,a.jsx)("p",{className:"text-muted-foreground",children:s.steps.repeatsReason}):s.steps.repeats.length===0?(0,a.jsx)("p",{className:"text-muted-foreground",children:"No step ran three times or more with the same input."}):(0,a.jsx)("ul",{className:"flex flex-col gap-0.5","data-run-repeats":s.steps.repeats.length,children:s.steps.repeats.map((l,i)=>(0,a.jsxs)("li",{children:["The same ",re[l.kind]?.replace(/s$/,"")??l.kind," step ",l.count," times"]},i))}),s.steps.repeats!==null&&s.steps.repeatsReason!==null&&(0,a.jsx)("p",{className:"text-caption text-muted-foreground",children:s.steps.repeatsReason})]})]})}function ps({selected:s}){let n=s.panel?.learning??null,l=s.panel,i=l?.status==null?[]:Z(l.status),t=s.record,d=[{id:"intent",title:"Approved plan",hint:s.intent===null?null:(0,a.jsxs)(a.Fragment,{children:[s.intent.approval,s.intent.approvedAt!=null&&(0,a.jsxs)(a.Fragment,{children:[" · ",(0,a.jsx)("time",{dateTime:s.intent.approvedAt,title:ee(s.intent.approvedAt),children:B(s.intent.approvedAt)})]})]}),body:s.intent===null?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No plan was filed for this task, so there is no approved goal or boundary to review."}):(0,a.jsx)(Xe,{intent:s.intent,className:"so-result-intent"})},...s.notes.length===0?[]:[{id:"notes",title:"Notes",hint:null,count:s.notes.length,body:(0,a.jsx)("ul",{className:"flex flex-col gap-2 text-sm",children:s.notes.map((r,o)=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("span",{className:"text-muted-foreground",children:[r.author," · ",oe(r.at)]})," ",r.note]},o))})}],...i.length===0?[]:[{id:"why",title:"Recorded reasons",hint:null,count:i.length,body:(0,a.jsx)("div",{className:"flex flex-col gap-1 text-body text-muted-foreground","data-status-why":!0,children:i.map(r=>(0,a.jsx)("p",{className:"[overflow-wrap:anywhere]",children:r},r))})}],...l===null||l.limits.length===0?[]:[{id:"limits",title:"What was shortened",hint:null,count:l.limits.length,body:(0,a.jsx)("ul",{className:"flex flex-col gap-1 text-body text-muted-foreground",children:l.limits.map(r=>(0,a.jsx)("li",{children:r},r))})}],...l?.reviewHistory==null?[]:[{id:"review-history",title:"Review history",hint:null,body:(0,a.jsx)("p",{className:"text-body text-muted-foreground",children:l.reviewHistory})}],...s.efficiency==null||!us(s.efficiency)?[]:[{id:"how-it-ran",title:"How it ran",hint:De(s.efficiency)?hs(s.efficiency):s.efficiency.steps.reason,body:(0,a.jsx)(ms,{one:s.efficiency})}],...s.network==null?[]:[{id:"network",title:"Network",hint:os(s.network),body:(0,a.jsx)(ds,{one:s.network})}],...s.timing==null||s.timing.length===0?[]:[{id:"timing",title:"Where the time went",hint:s.timing.map(r=>`${r.title} ${r.total}`).join(" · "),body:(0,a.jsx)(gs,{groups:s.timing})}],...t===null?[]:[{id:"run-record",title:"Run record",hint:`Build #${t.build}`,body:(0,a.jsxs)("div",{className:"flex flex-col gap-3 text-body",children:[(0,a.jsx)("dl",{className:"grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-1.5",children:t.facts.map(r=>(0,a.jsxs)("div",{className:"contents",children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:r.label}),(0,a.jsx)("dd",{className:"min-w-0 [overflow-wrap:anywhere]",children:r.value})]},r.label))}),(0,a.jsxs)("p",{className:"flex flex-wrap gap-x-4 gap-y-1",children:[s.checks?.logHref!=null&&(0,a.jsx)("a",{href:s.checks.logHref,className:U,children:"Check output"}),(0,a.jsx)("a",{href:t.href,className:U,children:"Full run record"})]})]})}]];return(0,a.jsxs)(M,{"aria-label":"Result record",className:"gap-0 divide-y divide-border overflow-hidden p-0 phone:p-0",children:[n!==null&&(0,a.jsx)("div",{"data-cockpit-section":"learning",children:(0,a.jsx)(ze,{learning:n,className:"so-result-learning"})}),d.map(r=>(0,a.jsxs)("details",{id:r.id,className:"group scroll-mt-4","data-cockpit-section":r.id,children:[(0,a.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-5 py-3.5 hover:bg-accent/50 phone:min-h-12 phone:px-4 [&::-webkit-details-marker]:hidden",children:[(0,a.jsx)(ge,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-90","aria-hidden":"true"}),(0,a.jsx)("h2",{className:"shrink-0 text-title leading-normal",children:r.title}),r.count!==void 0&&(0,a.jsx)(ke,{children:r.count}),r.hint!=null&&(0,a.jsx)("span",{className:"min-w-0 truncate text-body text-muted-foreground",children:r.hint})]}),(0,a.jsx)("div",{className:"px-5 pb-5 pt-1 phone:px-4",children:r.body})]},r.id))]})}var U="font-medium text-foreground/80 underline decoration-border underline-offset-4 hover:decoration-muted-foreground phone:inline-flex phone:min-h-11 phone:items-center";function xs(s){let n=document.getElementById("run-record");n instanceof HTMLDetailsElement&&(s.preventDefault(),n.open=!0,n.scrollIntoView({block:"start",behavior:window.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}),history.replaceState(history.state,"","#run-record"))}var fs=new Set(["retry","rebuild","recheck-stopped"]);function js({selected:s,csrf:n,inTask:l}){let[i,t]=(0,E.useState)(new Map),d=($,W)=>t(w=>{let S=new Map(w);return W===null?S.delete($):S.set($,W),S}),r=We(s.panel),o=r.filter($=>!i.has($.id)),c=r.filter($=>i.get($.id)==="not-right"),h={unanswered:o.map(G),notRight:c.map(G)},u=s.decision===null?null:{...s.decision,...we(s.decision.base??s.decision,h)},x=s.actFacts===void 0?s.acts:Ne({...s.actFacts,...s.actFacts.accept===null?{}:{accept:{ready:u?.ready??!1}},unanswered:o.length,notRight:c.length}),f=$=>l?.current===!0&&$!==null&&fs.has($)?null:$,p=l?.current===!0?{...x,primary:f(x.primary),secondary:f(x.secondary)}:x,j=s.panel?.youCheck!=null?(0,a.jsx)(rs,{panel:s.panel,chatHref:s.chatHref,answers:i,answer:d}):null,m=(0,E.useContext)(_e),v=(0,a.jsx)(is,{selected:s,csrf:n,acts:p,decision:u,firstUnanswered:o[0]?.id??null,statusSlot:l?.current===!0?m:null}),L=(0,E.useContext)(Ge),z=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(as,{selected:s,acts:p,answers:i,bare:l?.current===!0}),(0,a.jsx)(Ve,{report:s.agentReport,said:s.youSaid})]});return(0,a.jsxs)(a.Fragment,{children:[l?.current===!0&&L!==null?(0,Le.createPortal)(z,L):z,s.panel!==null?(0,a.jsx)(cs,{panel:s.panel,runId:s.build??0,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[j,v]})}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[j,v]}),(0,a.jsx)(ps,{selected:s})]})}function wt({view:s,csrf:n}){let l=s.selected;return(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-4",children:[(0,a.jsxs)("header",{className:"flex flex-col gap-3 pb-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1 basis-72",children:[(0,a.jsx)("h1",{className:"text-display tracking-tight phone:text-[22px]",children:l?.title??"Results"}),l!==null&&(0,a.jsxs)("p",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-body text-muted-foreground phone:gap-y-0","data-result-meta":!0,children:[l.project!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium text-foreground/80",children:l.project}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"})]}),l.record!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("a",{href:"#run-record",onClick:xs,className:U,children:["Build #",l.record.build]}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,a.jsx)("a",{href:l.taskHref,className:U,children:"Open task"}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,a.jsx)("a",{href:l.chatHref,className:U,children:"Discuss"})]})]}),l!==null&&(0,a.jsx)(ss,{view:s})]}),s.missing!==null&&(0,a.jsxs)("p",{role:"status",className:"rounded-md bg-muted px-3 py-2 text-body text-foreground",children:[s.missing,l!==null?" Showing the newest result instead.":""]}),s.beyond&&(0,a.jsx)("p",{className:"text-body text-muted-foreground",children:"This result is older than the list in Results."})]}),l===null?s.results.length===0?(0,a.jsxs)(M,{className:"items-start py-10",children:[(0,a.jsx)("p",{className:"text-base text-muted-foreground",children:"Nothing to review yet."}),(0,a.jsx)(T,{asChild:!0,variant:"outline",children:(0,a.jsx)("a",{href:"/",children:"Open Work"})})]}):(0,a.jsx)(M,{"aria-label":"Results",className:"gap-0 overflow-hidden p-0 phone:p-0",children:(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.results.map(i=>(0,a.jsxs)("li",{className:"flex items-start gap-3 px-5 py-3 phone:px-4",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:b("mt-2 size-2 shrink-0 rounded-full",i.status===null?"bg-muted-foreground":ce[ie(i.status.tone)])}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("a",{href:i.href,className:b("block truncate hover:underline hover:underline-offset-4",i.needsYou?"font-semibold":"font-medium"),children:i.title}),(0,a.jsx)("p",{className:"truncate text-body text-muted-foreground",children:[i.status?.label,...i.notes,oe(i.at)].filter(Boolean).join(" · ")})]})]},i.href))})}):(0,a.jsx)(js,{selected:l,csrf:n},`${l.taskId}:${l.build??""}`)]})}function gs({groups:s}){return(0,a.jsx)("div",{className:"flex flex-col gap-4 text-body","data-timing":!0,children:s.map((n,l)=>(0,a.jsxs)("section",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("h3",{className:"text-sm font-medium",children:[n.title," ",(0,a.jsxs)("span",{className:"text-muted-foreground",children:["· ",n.total]})]}),(0,a.jsx)("dl",{className:"grid grid-cols-[4.5rem_minmax(0,1fr)] gap-x-3 gap-y-1",children:n.rows.map((i,t)=>(0,a.jsxs)("div",{className:"contents",children:[(0,a.jsx)("dt",{className:"font-mono text-muted-foreground tabular-nums",children:i.at}),(0,a.jsxs)("dd",{className:"min-w-0 [overflow-wrap:anywhere]",children:[i.label,i.detail!==null&&(0,a.jsxs)("span",{className:"text-muted-foreground",children:[" · ",i.detail]})]})]},t))})]},l))})}export{Nt as a,Te as b,ls as c,K as d,H as e,os as f,hs as g,us as h,js as i,wt as j};
@@ -0,0 +1,2 @@
1
+ /*! Third-party notices: /assets/THIRD_PARTY_NOTICES.txt */
2
+ import{p8$a as F,p8$b as I,p8$c as T,p8$d as O,p8$e as X,p8$f as Y,p8$g as D,p8$h as E,p8$i as G,p8$j as M,p8$k as Q,p8$l as o,p8$m as d,p8$n as Z,p8$o as _,p8$p as z,p8$q as H,p8$r as J,p8$s as K,p8$t as u}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p11$a as f,p11$b as h}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p1$$ as ta,p1$$a as pa,p1$$b as la,p1$A as $a,p1$Aa as na,p1$Ab as ra,p1$B as ia,p1$Ba as ca,p1$Bb as ba,p1$C as oa,p1$Ca as da,p1$Cb as ua,p1$D as fa,p1$Da as ha,p1$Db as ma,p1$E as ga,p1$Ea as ka,p1$Eb as ja,p1$F as xa,p1$Fa as va,p1$Fb as wa,p1$G as ya,p1$Ga as Ua,p1$Gb as Na,p1$H as qa,p1$Ha as Aa,p1$Hb as La,p1$I as Pa,p1$Ia as Ba,p1$Ib as Sa,p1$J as Wa,p1$Ja as Ca,p1$Jb as Ra,p1$K as Fa,p1$Ka as Ia,p1$Kb as Ta,p1$L as Oa,p1$La as Xa,p1$Lb as Ya,p1$M as Da,p1$Ma as Ea,p1$Mb as Ga,p1$N as Ma,p1$Na as Qa,p1$Nb as Za,p1$O as _a,p1$Oa as za,p1$Ob as Ha,p1$P as Ja,p1$Pa as Ka,p1$Pb as Va,p1$Q as as,p1$Qa as ss,p1$Qb as es,p1$R as ts,p1$Ra as ps,p1$Rb as ls,p1$S as $s,p1$Sa as ns,p1$Sb as rs,p1$T as is,p1$Ta as cs,p1$Tb as bs,p1$U as os,p1$Ua as ds,p1$Ub as us,p1$V as fs,p1$Va as hs,p1$Vb as ms,p1$W as gs,p1$Wa as ks,p1$Wb as js,p1$X as xs,p1$Xa as vs,p1$Xb as m,p1$Y as ws,p1$Ya as g,p1$Yb as ys,p1$Z as Us,p1$Za as k,p1$Zb as Ns,p1$_ as qs,p1$_a as As,p1$_b as Ls,p1$a as Ps,p1$aa as Bs,p1$ab as Ss,p1$ac as Ws,p1$b as Cs,p1$ba as Rs,p1$bb as Fs,p1$bc as Is,p1$c as Ts,p1$ca as Os,p1$cb as Xs,p1$cc as Ys,p1$d as Ds,p1$da as Es,p1$db as Gs,p1$dc as Ms,p1$e as Qs,p1$ea as Zs,p1$eb as _s,p1$ec as zs,p1$f as Hs,p1$fa as Js,p1$fb as Ks,p1$fc as Vs,p1$g as ae,p1$ga as se,p1$gb as ee,p1$gc as te,p1$h as pe,p1$ha as le,p1$hb as $e,p1$hc as ne,p1$i as j,p1$ia as re,p1$ib as ie,p1$ic as ce,p1$j as be,p1$ja as oe,p1$jb as de,p1$jc as ue,p1$k as fe,p1$ka as he,p1$kb as me,p1$kc as ge,p1$l as ke,p1$la as je,p1$lb as xe,p1$lc as ve,p1$m as we,p1$ma as ye,p1$mb as Ue,p1$mc as Ne,p1$n as qe,p1$na as Ae,p1$nb as Le,p1$nc as Pe,p1$o as Be,p1$oa as Se,p1$ob as We,p1$p as Ce,p1$pa as x,p1$pb as Re,p1$q as Fe,p1$qa as Ie,p1$qb as v,p1$r as Te,p1$ra as Oe,p1$rb as Xe,p1$s as Ye,p1$sa as De,p1$sb as Ee,p1$t as Ge,p1$ta as Me,p1$tb as Qe,p1$u as Ze,p1$ua as _e,p1$ub as ze,p1$v as He,p1$va as Je,p1$vb as Ke,p1$w as Ve,p1$wa as at,p1$wb as st,p1$x as et,p1$xa as tt,p1$xb as pt,p1$y as lt,p1$ya as $t,p1$yb as nt,p1$z as rt,p1$za as it,p1$zb as ct}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p2$a as dt,p2$b as w,p2$c as ut,p2$d as ft,p2$e as y}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";var U=15e3,jt=600,L=/^[0-9a-f]{32,64}$/,P=/^[0-9a-f]{32}$/,B=/^[0-9]{1,15}$/;function N(e){let s=e?.view;return s!=null&&s.kind==="task"&&typeof s.id=="string"?s:null}function xt(e){let s=N(e),a=s?.approve??null;if(s===null||a===null)return null;let t=a.fields.digest??"",$=a.fields.rebuild??null;if(!L.test(t)||$!==null&&!B.test($)||a.action!==`/t/${encodeURIComponent(s.id)}/approve`)return null;let n=a.rememberedUntil===null?null:x(new Date(a.rememberedUntil)),l={...a.facts,rememberedUntil:n},r=a.sheet!=null&&typeof a.sheet=="object"&&typeof a.sheet.digest=="string"?a.sheet:null;return{taskId:s.id,action:a.action,digest:t,rebuild:$,heading:a.heading,text:a.text,termsWords:a.termsWords??k(a.kind,l),sheet:r,kind:a.kind,facts:l}}function vt(e,s){if(e===null||s||e.sheet===null)return!1;let a=g(e.kind,e.facts);return a==="click"||a==="automatic"}function wt(e,s=fetch,a){return u(e,"prefetch",s,a)}async function yt(e,s=fetch){let a;try{a=new URL(o(e),window.location.origin)}catch{return null}if(a.origin!==window.location.origin)return null;a.hash="",a.searchParams.set("format","workspace"),a.searchParams.delete("request");try{let t=await s(a.pathname+a.search,{credentials:"same-origin",cache:"no-store",redirect:"manual",headers:{accept:"application/json"},signal:AbortSignal.timeout(U)});if(t.status!==200||t.redirected||t.type==="opaqueredirect"||!(t.headers.get("content-type")??"").includes("application/json"))return null;let $=await t.json();return d($)?$:null}catch{return null}}function Ut(e){let s=N(e)?.approve?.fields.nonce??"";return P.test(s)?s:null}var S=["approved","vote","approved-not-rebuilt","refused"];async function Nt(e,s,a,t=fetch){let $=new URLSearchParams({csrf:s,nonce:a,digest:e.digest});e.rebuild!==null&&$.set("rebuild",e.rebuild),$.set("return","next");let n;try{n=await t(e.action,{method:"POST",credentials:"same-origin",redirect:"manual",body:$,headers:m({"x-toolroll-act":"in-place",accept:"application/json"}),signal:AbortSignal.timeout(U)})}catch{return{kind:"lost"}}if(n.type==="opaqueredirect"||n.redirected||!(n.headers.get("content-type")??"").includes("application/json"))return{kind:"elsewhere"};let l;try{l=await n.json()}catch{return{kind:"lost"}}if(l===null||typeof l!="object")return{kind:"elsewhere"};let{outcome:r,words:i}=l;return typeof r!="string"||!S.includes(r)||typeof i!="string"?{kind:"elsewhere"}:r!=="refused"&&n.status!==200?{kind:"elsewhere"}:{kind:"answer",outcome:r,words:i}}function qt(e){let s=e.trim();if(s==="")return"";let a=s.charAt(0).toUpperCase()+s.slice(1);return/[.!?]$/.test(a)?a:`${a}.`}var p=w(y(),1);function q({fact:e}){return(0,p.jsx)(p.Fragment,{children:e.parts.map((s,a)=>typeof s=="string"?(0,p.jsx)("span",{children:s},a):"at"in s?(0,p.jsx)("time",{dateTime:s.at,title:h(s.at),className:"k-num",children:f(s.at)},a):"seal"in s?(0,p.jsx)("code",{className:"k-mono",children:s.seal},a):(0,p.jsx)("a",{href:s.href,children:s.label},a))})}function W(e){if(!e||e.length===0)return[];let s=c=>e.find(b=>b.title===c)?.facts??[],a=(c,b)=>s(c).find(A=>A.label===b),t=[],$=a("Work","Agent");$!==void 0&&t.push({label:"Agent",fact:$});let n=a("Work","Base");n!==void 0&&t.push({label:"Base",fact:n});let l=a("Links","Pull request");l!==void 0&&t.push({label:"Pull request",fact:l});let r=a("Links","Blocked by");r!==void 0&&t.push({label:"Blocked by",fact:r});let i=a("About","Usage, this attempt")??a("About","Usage, all attempts");return i!==void 0&&t.push({label:"Usage",fact:i}),t}function At({details:e,extra:s,className:a,dataAttr:t="data-task-vitals"}){let $=W(e),n=s??[];return $.length===0&&n.length===0?null:(0,p.jsxs)("dl",{className:j("so-task-vitals",a),...t==="data-task-vitals"?{"data-task-vitals":""}:{"data-work-vitals":""},children:[$.map(l=>(0,p.jsxs)("div",{className:"so-task-vital","data-vital":l.label.toLowerCase().replace(/\s+/g,"-"),children:[(0,p.jsx)("dt",{children:l.label}),(0,p.jsx)("dd",{children:(0,p.jsx)(q,{fact:l.fact})})]},l.label)),n.map(l=>(0,p.jsxs)("div",{className:"so-task-vital","data-vital":l.label.toLowerCase().replace(/\s+/g,"-"),children:[(0,p.jsx)("dt",{children:l.label}),(0,p.jsx)("dd",{children:l.value})]},l.label))]})}function Lt({view:e}){let s=(e.details??[]).filter(a=>a.facts.length>0);return(0,p.jsx)("div",{className:"k-sec","data-task-details":!0,children:s.map(a=>(0,p.jsxs)("section",{className:"k-sec","aria-label":a.title,"data-detail-group":a.title,children:[(0,p.jsx)("h3",{children:a.title}),(0,p.jsx)(v,{rows:a.facts.map(t=>[t.label,(0,p.jsx)("span",{"data-detail-fact":t.label,children:(0,p.jsx)(q,{fact:t})},t.label)])})]},a.title))})}function Pt({text:e}){let s=e.split(/`([^`\n]+)`/);return(0,p.jsx)(p.Fragment,{children:s.map((a,t)=>t%2===1?(0,p.jsx)("code",{className:"k-mono",children:a},t):a===""?null:(0,p.jsx)("span",{children:a},t))})}export{U as a,jt as b,N as c,xt as d,vt as e,wt as f,yt as g,Ut as h,Nt as i,qt as j,At as k,Lt as l,Pt as m};
@@ -0,0 +1,2 @@
1
+ /*! Third-party notices: /assets/THIRD_PARTY_NOTICES.txt */
2
+ import{p11$a as m,p11$b as h}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p1$$ as Y,p1$$a as A,p1$$b as F,p1$A as P,p1$Aa as S,p1$Ab as z,p1$B as B,p1$Ba as C,p1$Bb as E,p1$C as G,p1$Ca as H,p1$Cb as I,p1$D as J,p1$Da as K,p1$Db as L,p1$E as M,p1$Ea as O,p1$Eb as Q,p1$F as U,p1$Fa as V,p1$Fb as W,p1$G as X,p1$Ga as Z,p1$Gb as _,p1$H as aa,p1$Ha as sa,p1$Hb as pa,p1$I as $a,p1$Ia as ea,p1$Ib as ba,p1$J as na,p1$Ja as ta,p1$Jb as ra,p1$K as oa,p1$Ka as ia,p1$Kb as la,p1$L as ca,p1$La as da,p1$Lb as ma,p1$M as ha,p1$Ma as ua,p1$Mb as xa,p1$N as ga,p1$Na as ja,p1$Nb as ka,p1$O as fa,p1$Oa as ya,p1$Ob as Na,p1$P as Ta,p1$Pa as qa,p1$Pb as Da,p1$Q as wa,p1$Qa as va,p1$Qb as Ra,p1$R as Ya,p1$Ra as Aa,p1$Rb as Fa,p1$S as Pa,p1$Sa as Sa,p1$Sb as za,p1$T as Ba,p1$Ta as Ca,p1$Tb as Ea,p1$U as Ga,p1$Ua as Ha,p1$Ub as Ia,p1$V as Ja,p1$Va as Ka,p1$Vb as La,p1$W as Ma,p1$Wa as Oa,p1$Wb as Qa,p1$X as Ua,p1$Xa as Va,p1$Xb as Wa,p1$Y as Xa,p1$Ya as Za,p1$Yb as _a,p1$Z as as,p1$Za as ss,p1$Zb as ps,p1$_ as $s,p1$_a as es,p1$_b as bs,p1$a as ns,p1$aa as ts,p1$ab as rs,p1$ac as os,p1$b as is,p1$ba as ls,p1$bb as cs,p1$bc as ds,p1$c as ms,p1$ca as hs,p1$cb as us,p1$cc as xs,p1$d as gs,p1$da as js,p1$db as ks,p1$dc as fs,p1$e as ys,p1$ea as Ns,p1$eb as u,p1$ec as Ts,p1$f as qs,p1$fa as Ds,p1$fb as ws,p1$fc as vs,p1$g as Rs,p1$ga as Ys,p1$gb as As,p1$gc as Fs,p1$h as Ps,p1$ha as Ss,p1$hb as zs,p1$hc as Bs,p1$i as Cs,p1$ia as Es,p1$ib as Gs,p1$ic as Hs,p1$j as Is,p1$ja as Js,p1$jb as Ks,p1$jc as Ls,p1$k as Ms,p1$ka as Os,p1$kb as Qs,p1$kc as Us,p1$l as Vs,p1$la as Ws,p1$lb as Xs,p1$lc as Zs,p1$m as _s,p1$ma as ap,p1$mb as sp,p1$mc as pp,p1$n as $p,p1$na as ep,p1$nb as bp,p1$nc as np,p1$o as tp,p1$oa as rp,p1$ob as op,p1$p as ip,p1$pa as lp,p1$pb as cp,p1$q as dp,p1$qa as mp,p1$qb as hp,p1$r as up,p1$ra as xp,p1$rb as gp,p1$s as jp,p1$sa as kp,p1$sb as fp,p1$t as yp,p1$ta as Np,p1$tb as x,p1$u as Tp,p1$ua as qp,p1$ub as Dp,p1$v as wp,p1$va as vp,p1$vb as i,p1$w as Rp,p1$wa as Yp,p1$wb as Ap,p1$x as Fp,p1$xa as Pp,p1$xb as Sp,p1$y as zp,p1$ya as Bp,p1$yb as Cp,p1$z as Ep,p1$za as Gp,p1$zb as Hp}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";import{p2$a as Kp,p2$b as g,p2$c as Lp,p2$d as Mp,p2$e as j}from"./chunk-core.5490609e81c3a5f78da3e06b9795d71c287016ebc7fd02794b1122b474ebb07f.js";var s=g(j(),1),k=3,n=2;function T(a){return{always:[...a.notDone.map($=>({tag:"Not done",text:$})),...a.risks.map($=>({tag:"Risk",text:$}))],more:[...a.decisions.map($=>({tag:"Decided",text:$})),...a.assumptions.map($=>({tag:"Assumed",text:$}))]}}function q(a){let $=a.decisions.length+a.assumptions.length>0,e=a.notDone.length+a.risks.length>0;return!$&&!e?"The agent didn't report decisions or risks.":e?null:"The agent didn't report risks."}function l({line:a}){return(0,s.jsxs)("li",{className:"so-report-line","data-agent-says":a.tag,children:[(0,s.jsx)(u,{word:a.tag,dot:!1}),(0,s.jsx)("span",{className:"so-report-text",children:a.text})]})}function f({one:a}){return(0,s.jsxs)("li",{className:"so-report-line","data-you-said":a.you?"you":"other",children:[(0,s.jsx)("span",{className:"so-report-quote",children:(0,s.jsxs)("bdi",{children:["“",a.note,"”"]})}),(0,s.jsxs)("span",{className:"k-note",children:[a.you?"You":(0,s.jsx)("bdi",{children:a.author})," · ",(0,s.jsx)("time",{dateTime:a.at,title:h(a.at),children:m(a.at)})," · ",a.question!=null?"reply to the agent":a.kind==="sent-back"?"sent back":"note to the agent"]}),a.question!=null&&(0,s.jsxs)("span",{className:"k-note","data-agent-question":"",children:["The agent asked: ",(0,s.jsx)("bdi",{children:a.question})]})]})}function Vp({report:a,said:$}){if(a==null)return null;let e=$??[],{always:c,more:t}=T(a),y=t.slice(0,k),r=t.slice(k),d=q(a),o=c.length+t.length>0,N=e.every(p=>p.you);return(0,s.jsxs)("section",{className:"k-sec so-report","aria-label":"Decisions, risks and notes","data-agent-report":o?"reported":"none",children:[o&&(0,s.jsx)("h3",{children:"The agent says"}),o&&(0,s.jsxs)("ul",{className:"so-report-lines",children:[c.map((p,b)=>(0,s.jsx)(l,{line:p},`a${b}`)),y.map((p,b)=>(0,s.jsx)(l,{line:p},`m${b}`))]}),r.length>0&&(0,s.jsx)(i,{summary:`${r.length} more`,children:(0,s.jsx)("ul",{className:"so-report-lines",children:r.map((p,b)=>(0,s.jsx)(l,{line:p},b))})}),d!==null&&(0,s.jsx)(x,{children:d}),e.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{children:N?"You said":"People said"}),(0,s.jsx)("ul",{className:"so-report-lines","data-you-said-count":e.length,children:e.slice(0,n).map(p=>(0,s.jsx)(f,{one:p},`${p.kind}${p.at}${p.note}`))}),e.length>n&&(0,s.jsx)(i,{summary:`${e.length-n} more`,children:(0,s.jsx)("ul",{className:"so-report-lines",children:e.slice(n).map(p=>(0,s.jsx)(f,{one:p},`${p.kind}${p.at}${p.note}`))})})]})]})}export{Vp as a};