cezarion 0.18.0-dev.8565 → 0.18.0-dev.8572

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 (131) hide show
  1. package/package.json +3 -3
  2. package/web/dist/assets/accounts-section-VLKEYGPj.js +1 -0
  3. package/web/dist/assets/{activity-motion-0wHCeUs7.css → activity-motion-DcKVM8fM.css} +1 -1
  4. package/web/dist/assets/activity-motion-IiyiWtXq.js +2 -0
  5. package/web/dist/assets/activity-route-QCPCR9kZ.js +1 -0
  6. package/web/dist/assets/agent-config-section-BK0gs0uc.js +7 -0
  7. package/web/dist/assets/agent-defaults-section-BoluhHkE.js +1 -0
  8. package/web/dist/assets/appearance-CEFPwlnq.js +1 -0
  9. package/web/dist/assets/archive-on-merge-field-BEt4jVZt.js +1 -0
  10. package/web/dist/assets/automations-route-CutF-cGn.css +1 -0
  11. package/web/dist/assets/automations-route-F58YdVbC.js +2 -0
  12. package/web/dist/assets/{badge-D9JrXe0o.js → badge-DQ3U69Ht.js} +1 -1
  13. package/web/dist/assets/{button-BQ2y4XRB.js → button-B7MKxYjT.js} +1 -1
  14. package/web/dist/assets/change-counts-CW7O8g5Y.js +1 -0
  15. package/web/dist/assets/check-OP-CVgZG.js +1 -0
  16. package/web/dist/assets/circle-x-7nTlobAF.js +1 -0
  17. package/web/dist/assets/{command-CDt1BsZy.js → command-KdW7aO0N.js} +1 -1
  18. package/web/dist/assets/commit-list-BZ6wfGPz.js +1 -0
  19. package/web/dist/assets/{dialog-BVF6dIeS.js → dialog-B531GGAo.js} +1 -1
  20. package/web/dist/assets/diff-BbD04q_C.js +3 -0
  21. package/web/dist/assets/diff-controls-CW1hOWET.js +1 -0
  22. package/web/dist/assets/diff-view-C3XewBZ4.js +11 -0
  23. package/web/dist/assets/dist-Czz3Y5qH.js +1 -0
  24. package/web/dist/assets/file-preview-B3r8zavn.js +2 -0
  25. package/web/dist/assets/{folder-browser-CbWAXTsX.js → folder-browser-6LK4AIPp.js} +1 -1
  26. package/web/dist/assets/format-BU7D3IfE.js +1 -0
  27. package/web/dist/assets/git-toolbar-CCZtGd6H.js +1 -0
  28. package/web/dist/assets/github-CzZZ-wwm.js +1 -0
  29. package/web/dist/assets/global-activity-route-BNyhS-a8.js +1 -0
  30. package/web/dist/assets/hourglass-CikYdGGQ.js +1 -0
  31. package/web/dist/assets/image-preview-CMk53HOX.js +1 -0
  32. package/web/dist/assets/index-CGjknHnV.css +1 -0
  33. package/web/dist/assets/index-DaJ5iats.js +21 -0
  34. package/web/dist/assets/{label-Dbp-6aiT.js → label-YDZzSz0S.js} +1 -1
  35. package/web/dist/assets/live-refetch-1_o4J83F.js +1 -0
  36. package/web/dist/assets/loader-circle-CPBhhDbB.js +1 -0
  37. package/web/dist/assets/{markdown-CzP2Mv9j.js → markdown-q0pVKAO0.js} +1 -1
  38. package/web/dist/assets/{notifications-section-BsHRSzNs.js → notifications-section-n3Xb47pL.js} +1 -1
  39. package/web/dist/assets/open-in-menu-D4ACqxcC.js +1 -0
  40. package/web/dist/assets/{preview-pane-connected-dvf7gtbB.js → preview-pane-connected-VmfC04wB.js} +3 -3
  41. package/web/dist/assets/{project-location-c1oHm2yu.js → project-location-GPzDWXuH.js} +1 -1
  42. package/web/dist/assets/projects-section-BotQxpQ6.js +1 -0
  43. package/web/dist/assets/prompt-templates-section-B8pr6Ue3.js +1 -0
  44. package/web/dist/assets/queries-DDhFFTvR.js +1 -0
  45. package/web/dist/assets/{reference-chip-1BEDWxcS.js → reference-chip-90x9Bq44.js} +1 -1
  46. package/web/dist/assets/{remote-settings-notice-BD9jRcE6.js → remote-settings-notice-F_onp6Yr.js} +1 -1
  47. package/web/dist/assets/repo-git-B5Bse6ld.js +1 -0
  48. package/web/dist/assets/{report-reader-P41jUFxW.js → report-reader-B_kyYgIY.js} +1 -1
  49. package/web/dist/assets/reports-CNFNb36Z.css +1 -0
  50. package/web/dist/assets/reports-D0E8DWXQ.js +1 -0
  51. package/web/dist/assets/resources-section-DcfHTNpN.js +1 -0
  52. package/web/dist/assets/{run-header-CC7VUTg9.css → run-header-Ccnr9k0X.css} +1 -1
  53. package/web/dist/assets/run-header-OhEYfuQX.js +2 -0
  54. package/web/dist/assets/save-cue-Cd3ZAPBS.js +1 -0
  55. package/web/dist/assets/select-r1KS5cjs.js +1 -0
  56. package/web/dist/assets/{session-context-section-BsT7MXjZ.js → session-context-section-PCOCiOTV.js} +2 -2
  57. package/web/dist/assets/settings-agent-picker-D0UKjmOj.js +1 -0
  58. package/web/dist/assets/settings-field-DP9sYv5a.js +1 -0
  59. package/web/dist/assets/settings-select-CCIMGnyA.js +1 -0
  60. package/web/dist/assets/settings-shell-BiPh5fg6.js +1 -0
  61. package/web/dist/assets/settings-shell-iSd4xMWS.css +1 -0
  62. package/web/dist/assets/{sidebar-section-ekWNCGBw.js → sidebar-section-DmOlTUs8.js} +1 -1
  63. package/web/dist/assets/skills-CSLg7E0x.js +1 -0
  64. package/web/dist/assets/{status-dot-DtAOFiIi.js → status-dot-BRzVlF2X.js} +1 -1
  65. package/web/dist/assets/switch-SP8pw5uU.js +1 -0
  66. package/web/dist/assets/task-changes-DuOb61QV.js +1 -0
  67. package/web/dist/assets/task-commits-CiGYJpqo.js +1 -0
  68. package/web/dist/assets/task-files-fJSQ4Abg.js +1 -0
  69. package/web/dist/assets/{task-github-item-aab_QTS3.js → task-github-item-CRxN82Yw.js} +1 -1
  70. package/web/dist/assets/{task-groups-Ziytm1Sm.js → task-groups-B3Z2qfE6.js} +1 -1
  71. package/web/dist/assets/task-thread-CqjKwRuV.js +9 -0
  72. package/web/dist/assets/task-thread-DzADOhZd.css +1 -0
  73. package/web/dist/assets/{tasks-table-wTQZb7nJ.js → tasks-table-Cm6YZBUB.js} +1 -1
  74. package/web/dist/assets/thread-state-DcHyKcQ-.js +4 -0
  75. package/web/dist/assets/use-hand-to-agent-state-B6h6kcQg.css +1 -0
  76. package/web/dist/assets/use-hand-to-agent-state-DuefXU2m.js +1 -0
  77. package/web/dist/assets/workflows-C6suai0L.css +1 -0
  78. package/web/dist/assets/workflows-CC3TZmBS.js +7 -0
  79. package/web/dist/assets/workspace-tools-kscvD6KC.js +1 -0
  80. package/web/dist/assets/worktrees-section-CoKimDBt.js +4 -0
  81. package/web/dist/index.html +21 -19
  82. package/web/dist/assets/accounts-section-W97a1ty2.js +0 -1
  83. package/web/dist/assets/activity-motion-zWlkG-V_.js +0 -2
  84. package/web/dist/assets/activity-route-CHfp3gWS.js +0 -1
  85. package/web/dist/assets/agent-config-section-Ulvfv3n6.js +0 -1
  86. package/web/dist/assets/agent-defaults-section-DuReu1Ob.js +0 -1
  87. package/web/dist/assets/appearance-DpMIBP4Y.js +0 -1
  88. package/web/dist/assets/archive-on-merge-field-C83q8HKD.js +0 -1
  89. package/web/dist/assets/automations-route-Kro31C3p.js +0 -1
  90. package/web/dist/assets/commit-diff-panel-CE7372Fz.js +0 -1
  91. package/web/dist/assets/diff-DUljAzi_.js +0 -3
  92. package/web/dist/assets/diff-controls-BSWICnsb.js +0 -1
  93. package/web/dist/assets/diff-view-CYusqV5H.js +0 -11
  94. package/web/dist/assets/dist-C28wFbz0.js +0 -1
  95. package/web/dist/assets/file-preview-Cj3QRSUt.js +0 -2
  96. package/web/dist/assets/format-BNCkW110.js +0 -1
  97. package/web/dist/assets/git-toolbar-B9t94bg6.js +0 -1
  98. package/web/dist/assets/github-D0U0_v8D.js +0 -1
  99. package/web/dist/assets/global-activity-route-Co9vGT5h.js +0 -1
  100. package/web/dist/assets/hourglass-B0lPAJvT.js +0 -1
  101. package/web/dist/assets/image-preview-CNBuRrK5.js +0 -1
  102. package/web/dist/assets/index-2DP8fWMQ.css +0 -1
  103. package/web/dist/assets/index-BNqZkH0S.js +0 -21
  104. package/web/dist/assets/live-refetch-CZb2VOyu.js +0 -1
  105. package/web/dist/assets/open-in-menu-mDtfa4ES.js +0 -1
  106. package/web/dist/assets/projects-section-ds7mvM9K.js +0 -1
  107. package/web/dist/assets/prompt-templates-section-DsBj0E0U.js +0 -1
  108. package/web/dist/assets/queries-dOBokhuR.js +0 -1
  109. package/web/dist/assets/repo-git-j8MdHS3x.js +0 -1
  110. package/web/dist/assets/reports-B7QAzibP.css +0 -1
  111. package/web/dist/assets/reports-C-Zop07b.js +0 -1
  112. package/web/dist/assets/resources-section-Cy0EShrb.js +0 -1
  113. package/web/dist/assets/run-header-Cd6Z_Juw.js +0 -2
  114. package/web/dist/assets/settings-agent-picker-B8jmxleN.js +0 -1
  115. package/web/dist/assets/settings-field-Bl6WuvGX.js +0 -1
  116. package/web/dist/assets/settings-shell-f9o6rKSB.js +0 -1
  117. package/web/dist/assets/settings-shell-xK8txSJo.css +0 -1
  118. package/web/dist/assets/skills-DweafQfi.js +0 -1
  119. package/web/dist/assets/switch-Bv2Zf1uU.js +0 -1
  120. package/web/dist/assets/task-changes-Db7mjsBc.js +0 -1
  121. package/web/dist/assets/task-commits-A0qKHFEp.js +0 -1
  122. package/web/dist/assets/task-files-Cf4k3GXd.js +0 -1
  123. package/web/dist/assets/task-thread-Di1O-QIZ.js +0 -9
  124. package/web/dist/assets/task-thread-DtQ6uGfQ.css +0 -1
  125. package/web/dist/assets/thread-state-BLpB8owZ.js +0 -4
  126. package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +0 -1
  127. package/web/dist/assets/use-hand-to-agent-state-Dkln0aUg.js +0 -1
  128. package/web/dist/assets/workflows-C21NystW.css +0 -1
  129. package/web/dist/assets/workflows-D0FFSZRo.js +0 -7
  130. package/web/dist/assets/workspace-tools-Bc-FDfxj.js +0 -1
  131. package/web/dist/assets/worktrees-section-KHsxVu0L.js +0 -4
@@ -1 +0,0 @@
1
- .settings-panel{border:1px solid var(--border);background:var(--card);border-radius:12px;width:100%;padding:24px}.settings-panel-title{margin-block:0 24px;margin-inline:0;font-size:20px;font-weight:400}.settings-panel>[data-slot]{width:100%;max-width:none;margin:0;padding:0}.settings-panel .settings-field{gap:12px}.settings-panel .settings-field+.settings-field{border-block-start:1px solid var(--border);padding-block-start:22px}.settings-panel .settings-field h2{font-size:14px;font-weight:400}.settings-panel .settings-field h2+p{margin-block-start:8px;line-height:1.6}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])){background:var(--background);min-width:0;max-width:100%;min-height:44px;box-shadow:none;font-size:13px}.settings-panel .settings-field>:is(input,select,textarea:not([data-slot=code-editor-input])),.settings-panel [data-slot=agents-default-runner],.settings-panel [data-slot=projects-browse-root],.settings-panel [data-slot=projects-checkout-root]{width:100%;max-width:none}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]){min-height:40px}.settings-panel [data-slot=resources-composer-defaults]{grid-template-columns:1fr;gap:24px}.settings-panel [data-slot=prompt-template-row],.settings-panel [data-slot=prompt-template-new]{border:0;border-block-end:1px solid var(--border);border-radius:0;gap:12px;padding-block:20px;padding-inline:0}.settings-panel [data-slot=agent-config-agents]{background:0 0;gap:8px;padding:0}.settings-panel [data-slot=agent-config-agent]{border:1px solid var(--border)}.settings-panel [data-slot=agent-config-agent][aria-selected=true]{background:var(--accent-strong);color:var(--accent-strong-foreground)}.settings-panel [data-slot=projects-section] table{display:block}.settings-panel [data-slot=projects-section] :is(tbody,tr){min-width:0;display:grid}.settings-panel [data-slot=projects-section] thead{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}.settings-panel [data-slot=projects-section] colgroup{display:none}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]){gap:8px;padding-block:16px;padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){text-align:start;width:100%;min-width:0;max-width:none;padding-block:0;padding-inline:12px;display:block}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) .truncate{white-space:normal;overflow-wrap:anywhere}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) td:last-child{border-block-start:1px solid var(--border);padding-block-start:12px}.settings-panel .settings-resource-controls input{flex:1;width:100%}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume]),.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])){position:relative}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume])>div:first-child,.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])>div:first-child){padding-inline-end:60px}.settings-panel [data-slot=resources-auto-resume],.settings-panel [data-slot=resources-monitoring-wake-mode]{position:absolute;inset-block-start:24px;inset-inline-end:0}.settings-panel [data-slot=agent-config-group] ul{flex-flow:wrap;gap:8px}.settings-panel [data-slot=agent-config-file]{border:1px solid var(--border);padding-block:10px;padding-inline:12px}.settings-panel [data-slot=agent-config-file][data-selected=true]{border-color:var(--accent-strong);color:var(--accent-text)}.settings-route{gap:0;padding:0}.settings-route-header{border-block-end:1px solid var(--border);padding-block:16px;padding-inline:28px}.settings-route-body{gap:24px;padding:28px}.settings-section-picker{border:1px solid var(--border);background:var(--card);border-radius:8px;width:100%;position:relative}.settings-section-picker summary{cursor:pointer;justify-content:space-between;align-items:center;min-height:48px;padding-block:12px;padding-inline:14px;font-size:14px;list-style:none;display:flex}.settings-section-picker summary::-webkit-details-marker{display:none}.settings-section-picker nav{border-block-start:1px solid var(--border);padding:4px;display:grid}.settings-section-picker nav a{border-radius:6px;padding:12px;font-size:13px}.settings-section-picker nav a[aria-current=page]{background:color-mix(in oklch, var(--accent-strong) 12%, transparent);color:var(--accent-text)}.settings-panel{border-radius:10px}.settings-panel h3,.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2{font-weight:400}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2+p{margin-block-start:8px;line-height:1.6}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) [role=switch]{margin-block-start:8px}.settings-panel [data-slot=appearance-section]{border:0;border-radius:0}.settings-panel [data-slot=appearance-section]>section{gap:12px}.settings-panel [data-slot=appearance-section]>section+section{border-block-start:1px solid var(--border);padding-block-start:24px}.settings-panel [data-slot=appearance-section] h2{font-size:14px;font-weight:400}.settings-panel [data-slot=appearance-section] h2+p{margin-block-start:8px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{background:0 0;border:0;gap:10px;padding:0}.settings-panel [data-slot=appearance-section] [role=radio]{border:1px solid var(--border);background:var(--card);border-radius:8px;padding-block:12px;padding-inline:16px;font-weight:400}.settings-panel [data-slot=appearance-section] [aria-checked=true]{background:color-mix(in oklch, var(--accent-strong) 12%, transparent);color:var(--accent-text);border-color:color-mix(in oklch, var(--accent-strong) 30%, var(--border))}.settings-panel [data-slot=notifications-permission]{margin-block:20px;margin-inline:0}.settings-panel [data-slot=notifications-permission][data-permission=denied]{color:var(--danger)}.settings-panel .settings-readout{border:1px solid var(--border);background:var(--background);overflow-wrap:anywhere;border-radius:6px;padding:12px;font-size:13px;line-height:1.6}.settings-panel .settings-disclosure{border-block-start:1px solid var(--border);color:var(--muted-foreground);padding-block-start:16px;font-size:12px}.settings-panel .settings-disclosure summary{cursor:pointer;padding-block:4px;padding-inline:0}.settings-panel .settings-disclosure>:not(summary){margin-block-start:12px}.settings-panel [data-slot=agent-defaults-section]{gap:20px}.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:20px}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}.settings-panel [data-slot=agents-task-runs]{gap:20px}.settings-panel [data-slot=agents-task-runs]>h2{font-size:14px;font-weight:400}.settings-panel .settings-option-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.settings-panel .settings-option-row>div:first-child{flex:1;min-width:0}.settings-panel .settings-option-row h3{font-size:14px;font-weight:400}.settings-panel .settings-option-row p{margin-block-start:8px;line-height:1.6}.settings-panel .settings-option-row label{flex-shrink:0}.settings-panel .settings-option-row label>span{display:none}.settings-panel .settings-option-row :is(select,output){width:auto;min-width:12rem;max-width:16rem}.settings-panel .settings-form-actions{border-block-start:1px solid var(--border);flex-wrap:wrap;gap:12px;padding-block-start:20px;display:flex}@media (width<=767px){.settings-route{gap:24px;padding-block:28px 32px;padding-inline:18px}.settings-route-header{border-block-end:0;padding:0}.settings-route-header h1{letter-spacing:0;line-height:36px}.settings-route-header>p{display:none}.settings-route-body{gap:20px;padding:0}.settings-panel{padding:16px}.settings-panel-title{margin-block-end:24px;font-size:20px;line-height:30px}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]):not([data-slot=prompt-template-skill-chip]){min-height:44px}.settings-panel [data-slot=agent-config-agents]{flex-wrap:wrap}.settings-panel [data-slot=agent-config-group] li{max-width:100%}.settings-panel [data-slot=appearance-section] [role=radiogroup]{width:100%;display:grid}.settings-panel [data-slot=appearance-section] [role=radio]{justify-content:flex-start}.settings-panel .settings-resource-controls{align-items:stretch}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}}.settings-panel .settings-retention-controls input{width:100%}.settings-panel .settings-retention-controls>span{display:none}.settings-panel .settings-appearance-preview{padding:20px}.settings-panel [data-slot=appearance-theme] svg,.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>h2{display:none}.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>p{margin-block-start:0}.settings-panel [data-slot=prompt-template-row]{gap:12px;padding-block-start:12px}.settings-panel [data-slot=prompt-template-row]>label,.settings-panel [data-slot=prompt-template-row]>p,.settings-panel [data-slot=prompt-template-new]>label:not(:first-of-type){border-block-start:1px solid var(--border);margin-block-start:8px;padding-block-start:20px}.settings-panel [data-slot=prompt-template-row] textarea{min-height:44px}.settings-panel [data-slot=prompt-template-skill-chip]{background:0 0;border:0;border-radius:4px;min-height:28px;font-family:inherit;font-size:13px}.settings-panel [data-slot=prompt-template-skills-trigger]{border-radius:6px}.settings-panel [data-slot=accounts-defaults]{margin-block-start:8px}.settings-panel [data-slot=accounts-defaults] select{max-width:none}.settings-panel [data-slot=accounts-provider]>dl{background:var(--background)}.settings-panel [data-slot=accounts-provider]>ul{border:0}.settings-panel [data-slot=account-row]{padding-block:16px;padding-inline:0}.settings-panel [data-slot=account-details]{background:var(--background)}.settings-route [data-slot=project-general]{gap:20px}.settings-route [data-slot=project-general]>section{border-radius:10px;padding:20px}.settings-route [data-slot=project-general] [data-slot=project-facts]{border-block-end:1px solid var(--border);padding-block-end:16px}:is(.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-browse-root])>div:nth-child(2),.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-checkout-root])>div:nth-child(2)){flex-wrap:wrap}:is(.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-browse-root]) button,.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-checkout-root]) button){margin-block-start:8px}.settings-panel [data-slot=projects-section] .overflow-x-auto{border:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>th{font-size:14px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>td:nth-child(2){border:1px solid var(--border);background:var(--background);border-radius:6px;padding:12px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>td:last-child{margin-block-start:8px;padding-block-start:20px}@media (width<=767px){.settings-panel [data-slot=accounts-defaults] label{flex-direction:column;align-items:stretch}.settings-panel [data-slot=accounts-defaults] label>span{width:auto}.settings-panel [data-slot=accounts-provider] dl>div{flex-wrap:wrap}.settings-route [data-slot=project-general]>section{padding:16px}}.settings-agent-picker{border:1px solid var(--border);background:var(--background);border-radius:6px;min-width:0}.settings-agent-picker summary{cursor:pointer;align-items:center;gap:10px;min-height:44px;padding-block:10px;padding-inline:12px;font-size:13px;list-style:none;display:flex}.settings-agent-picker summary::-webkit-details-marker{display:none}.settings-agent-picker [data-slot=agents-runner]{border:0;border-block-start:1px solid var(--border);flex-direction:column;width:100%;max-width:none;padding:4px;display:flex}.settings-agent-picker [role=radio]{white-space:normal;font-family:inherit}.settings-panel [data-slot=settings-config-editor]>[data-slot=code-editor]{margin-block-start:8px}.settings-route[data-route=settings] .settings-route-header>p,.settings-route[data-route=settings-global] .settings-route-header>p{display:block}.settings-route[data-route=settings] .settings-route-header h1,.settings-route[data-route=settings-global] .settings-route-header h1{font-weight:600}.settings-route[data-route=settings-global] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{font-weight:400}.settings-route[data-route=settings-global] [data-slot=settings-index] a>span:nth-child(2)>span+span{margin-block-start:8px}.settings-route[data-route=settings-global] [data-slot=settings-index]+p{display:none}@media (width<=767px){.settings-route{gap:16px}.settings-route[data-route=settings] [data-slot=settings-index]{border:1px solid var(--border);background:var(--card);border-block-start:0;border-radius:0 0 10px 10px;gap:0;margin-block-start:0;padding-block:12px;padding-inline:16px}.settings-route[data-route=settings] [data-slot=settings-index] a{border:0;border-radius:0;padding-block:16px;padding-inline:0}.settings-route[data-route=settings] [data-slot=settings-index] a>span:first-child,.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span+span{display:none}.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{color:var(--muted-foreground);font-size:13px;font-weight:400}.settings-panel .settings-resource-controls input{flex-basis:100%}.settings-panel [data-slot=resources-composer-defaults] select{width:100%}}.settings-model-control{position:relative}.settings-model-control>svg{pointer-events:none;position:absolute;inset-block-start:50%;inset-inline-start:12px;transform:translateY(-50%)}.settings-panel .settings-model-control :is(select,output){padding-inline-start:36px}.settings-route [data-slot=button]{border-radius:8px;font-weight:400}.settings-panel [data-slot=button]{padding-inline:16px}.settings-route [data-slot=button][data-variant=primary]{background:var(--accent-strong);color:var(--accent-strong-foreground)}.settings-route [data-slot=switch-thumb]{background:#fff}.settings-panel .settings-form-actions [data-variant=primary]{order:1}.settings-panel .settings-form-actions>span{order:2}.settings-panel [data-slot=settings-config-editor]{gap:12px}.settings-config-toolbar{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.settings-config-file-row{flex-wrap:wrap;gap:10px;display:flex}.settings-config-file-row button{border:1px solid var(--border);background:var(--card);border-radius:8px;padding-block:10px;padding-inline:16px;font-size:12px;font-weight:400}.settings-config-file-row button[aria-pressed=true]{background:var(--accent-strong);color:var(--accent-strong-foreground)}.settings-config-agent-choice{color:var(--muted-foreground);align-items:center;gap:8px;margin-inline-start:auto;font-size:12px;display:flex}.settings-panel .settings-config-agent-choice select{border:1px solid var(--border);border-radius:6px;min-height:36px;padding-block:6px;padding-inline:10px}.settings-config-content-heading{border-block-start:1px solid var(--border);margin-block-start:8px;padding-block-start:20px}.settings-config-content-heading h3{font-size:14px}.settings-config-content-heading p{color:var(--muted-foreground);margin-block-start:8px;font-size:12px}.settings-config-save-help{color:var(--muted-foreground);gap:8px;padding-block-start:8px;font-size:12px;display:grid}.settings-config-scopes{border-block-start:1px solid var(--border);gap:12px;padding-block-start:24px;display:grid}.settings-config-scopes h3{font-size:14px}.settings-panel [data-slot=accounts-provider]{gap:12px}.settings-account-provider-title{font-size:14px}.settings-account-installation{line-height:1.6}.settings-account-count{color:var(--muted-foreground);margin-block-start:4px;font-size:11px;display:block}.settings-panel [data-slot=account-row]{border-block-start:1px solid var(--border);margin-block-start:20px;padding-block:24px 0;padding-inline:0}.settings-account-card{flex-direction:column;gap:20px;display:flex}.settings-account-card>div:first-child>div:first-child>span:first-child{font-size:14px;font-weight:400}.settings-account-readout{flex-wrap:wrap;align-items:center;gap:8px;margin-block-start:8px;display:flex}.settings-account-readout [data-slot=account-path]{white-space:normal;overflow-wrap:anywhere;order:1;margin:0;font-family:inherit;font-size:13px}.settings-account-readout>div{margin:0;font-size:13px}.settings-account-actions{border-block-start:1px solid var(--border);flex-wrap:wrap;gap:12px;padding-block-start:20px;display:flex}.settings-account-add-row{margin-block-start:12px}.settings-panel [data-slot=accounts-defaults]{background:0 0;border:0;gap:12px;margin-block-start:12px;padding:0}.settings-panel [data-slot=accounts-defaults]>div:first-child>h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]>div:first-child>p{margin-block-start:8px;font-size:12px}.settings-account-models{background:var(--background);border:1px solid var(--border);border-radius:8px;padding:14px}.settings-panel .settings-account-model{background:var(--background);border:1px solid var(--border);border-radius:8px;padding-block:10px;padding-inline:12px;position:relative}.settings-panel .settings-account-model select{min-height:24px;box-shadow:none;background:0 0;border:0;padding:0;font-size:13px}@media (width<=767px){.settings-config-agent-choice{margin-inline-start:0}.settings-config-file-row{gap:8px}.settings-config-file-row button{padding-inline:12px}.settings-account-actions{flex-direction:column;align-items:flex-start}.settings-panel [data-slot=accounts-defaults] .settings-account-model{flex-flow:wrap;align-items:center}.settings-panel .settings-account-model select{flex:1;min-width:100px}}.settings-panel [data-slot=agent-config-scope]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.settings-account-readout{flex-wrap:nowrap}.settings-account-readout [data-slot=account-path]{white-space:nowrap;flex:1;min-width:0}.settings-account-readout>div{flex-shrink:0}.settings-account-readout:has([data-slot=account-missing],[data-slot=account-unrecognised]){flex-wrap:wrap}.settings-account-readout:has([data-slot=account-missing],[data-slot=account-unrecognised])>div{flex-shrink:1}.settings-config-scopes [data-slot=agent-config-nav]{grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:20px;display:grid}.settings-config-scopes [data-slot=agent-config-file]{padding:8px;font-size:12px}.settings-panel [data-slot=accounts-provider]>ul{border-radius:0}.settings-panel [data-slot=account-row]{margin-block-start:8px}.settings-account-management{display:contents}.settings-account-management>span{flex-basis:100%;order:2;font-size:12px}.settings-account-management [data-slot=account-rename-input]{min-width:0;max-width:100%}.settings-panel [data-slot=accounts-defaults] .settings-model-agent-choice{color:var(--muted-foreground);flex-direction:row;align-items:center;gap:8px;font-size:12px;display:flex}.settings-panel .settings-model-agent-choice select{background:0 0;border:0;width:auto;min-height:28px;font-size:12px}.settings-config-scopes [data-slot=agent-config-group]>ul>li{width:100%;min-width:0}.settings-config-scopes [data-slot=agent-config-file]{min-width:0;max-width:100%}.settings-panel [data-slot=settings-config-editor]>[data-slot=code-editor]{background:var(--background)}
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{S as i,di as a}from"./project-scope-context-C912rTJP.js";import{$t as o,Bt as s,Kt as c,Qt as l,Wt as u,_ as d}from"./queries-dOBokhuR.js";import{g as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as p}from"./toaster-Bo5vCbz-.js";import{O as m,T as h,X as g,Y as _,ct as v,ot as y,u as b}from"./design-icons-CzEoMH9c.js";import{t as x}from"./button-BQ2y4XRB.js";import{t as S}from"./project-router-DucFIl_x.js";import{f as C,l as w}from"./skills-pM_PouEs.js";import{Dn as T,Gn as E,V as D,xn as O}from"./index-BNqZkH0S.js";var k=e(t(),1),A=n(),j=e=>e.split(`@`)[0]||e,M={project:0,user:1,plugin:2,system:3,other:4},N={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function P(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:j(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:N[t],kind:t}}function F(e){let t=new Map;for(let n of e){let e=P(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>M[e.kind]-M[t.kind]||e.label.localeCompare(t.label))}function I(e){let t=e.plugin?`${j(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var L={project:h,user:v,plugin:m,system:m,other:m};function R({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,k.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,A.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,A.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,A.jsx)(z,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,A.jsx)(B,{skill:e,open:e.id===t,runner:r,account:i},C(e))):null]},e.key)})})}function z({group:e,open:t,onToggle:n}){let i=L[e.kind];return(0,A.jsx)(`h2`,{className:`m-0`,children:(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,A.jsx)(b,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,A.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,A.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function B({skill:e,open:t,runner:n,account:r}){let i=T({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,A.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,A.jsxs)(`summary`,{className:`grid min-h-11 cursor-pointer list-none grid-cols-1 items-baseline gap-x-4 gap-y-0.5 py-2.5 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)] [&::-webkit-details-marker]:hidden`,children:[(0,A.jsx)(`span`,{className:`truncate text-[13.5px] font-semibold`,title:e.name,children:I(e)}),e.description?(0,A.jsx)(`span`,{className:`truncate text-[13px] text-muted-foreground group-open/skill:hidden`,children:e.description}):null]}),(0,A.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,A.jsx)(D,{skill:e,heading:null,actions:(0,A.jsx)(x,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,A.jsx)(S,{to:i,children:`Start task`})})})})]})}function V(){let e=d(),[t,n]=(0,k.useState)(null),[i,a]=(0,k.useState)(null),[o,s]=(0,k.useState)(``),[c]=f(),p=t??e.data?.defaultRunner,{runner:m}=l(p??`claude`),h=i?.runner===m?i.id:null,v=e=>a(e===null?null:{runner:m,id:e}),y=u(p,h),b=K(m,y.account),S=y.data??[];return(0,A.jsxs)(`div`,{"data-route":`skills`,className:`mx-auto grid min-h-full w-full max-w-[1100px] grid-cols-1 content-start gap-5 px-[18px] py-6 md:p-9 max-md:[padding-block-end:5rem]`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h1`,{className:`text-[25px] font-semibold tracking-tight md:text-[30px]`,children:`Skills`}),(0,A.jsx)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:`The skills each agent loads in this project, as its runner reports them.`})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(U,{runner:m,onChange:e=>{n(e),v(null)}}),(0,A.jsx)(W,{runner:m,account:h,onChange:v}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-soft-foreground`,"data-slot":`skills-count`,children:y.list?`${S.length} ${S.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null}),(0,A.jsxs)(x,{variant:`outline`,size:`sm`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,A.jsx)(_,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})]}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(g,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(E,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:o,onChange:e=>s(e.target.value),className:`h-10 bg-card pl-9 text-[13px]`})]}),(0,A.jsx)(G,{query:y}),y.isPending?(0,A.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,A.jsx)(H,{skills:S,search:o,openId:c.get(`skill`),runner:m,account:y.account??null,unchecked:y.unchecked})]})}function H({skills:e,search:t,openId:n,runner:r,account:i,unchecked:a}){if(e.length===0)return a?null:(0,A.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`No skills reported by this runner and account.`});let o=w(e,t);return o.length===0?(0,A.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No skills match “`,t.trim(),`”.`]}):(0,A.jsx)(R,{groups:F(o),openId:n,searching:t.trim()!==``,runner:r,account:i})}function U({runner:e,onChange:t}){let n=o().data;return n?(0,A.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-0.5 overflow-x-auto rounded-[10px] border border-border bg-card p-[3px]`,children:n.runners.map(r=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":r.id===e,onClick:()=>t(r.id),className:`h-8 shrink-0 rounded-[7px] px-3 text-[13px] text-muted-foreground focus-visible:outline-2 aria-pressed:bg-muted aria-pressed:font-semibold aria-pressed:text-foreground pointer-hover:text-foreground`,children:c(n,r.id)},r.id))}):null}function W({runner:e,account:t,onChange:n}){let r=O().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,A.jsxs)(`select`,{"aria-label":`Account`,value:t??``,onChange:e=>n(e.target.value||null),className:`h-[38px] rounded-md border border-border bg-card px-2.5 text-[13px] text-foreground focus-visible:outline-2`,children:[(0,A.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.label},e.id))]})}function G({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,A.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,A.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,A.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function K(e,t){let n=a(),[r,o]=(0,k.useState)(!1),c=s.runnerSkills(e,t);return{running:r,run:async()=>{o(!0);try{n.setQueryData(c,await i(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:c.slice(0,3)})}catch(e){p(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{o(!1)}}}}export{V as SkillsRoute};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{a as i}from"./dist-BW234Kg5.js";import{a,i as o,r as s,t as c}from"./dist-C5mlVBmd.js";import{t as l}from"./dist-DXO3xwbC.js";var u=e(t(),1);function d(e){let t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var f=n(),p=`Switch`,[m,h]=o(p),[g,_]=m(p);function v(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:d,value:m=`on`,internal_do_not_use_render:h}=e,[_,v]=c({prop:n,defaultProp:i??!1,onChange:l,caller:p}),[y,b]=u.useState(null),[x,S]=u.useState(null),C={checked:_,setChecked:v,disabled:a,control:y,setControl:b,name:s,form:o,value:m,hasConsumerStoppedPropagationRef:u.useRef(!1),required:d,defaultChecked:i,isFormControl:!y||!!o||!!y.closest(`form`),bubbleInput:x,setBubbleInput:S};return(0,f.jsx)(g,{scope:t,...C,children:E(h)?h(C):r})}var y=`SwitchTrigger`,b=u.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:o,form:c,value:l,disabled:d,checked:p,required:m,setControl:h,setChecked:g,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:x}=_(y,e),S=i(r,h),C=u.useRef(p);return u.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let t=()=>g(C.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,c,g]),(0,f.jsx)(a.button,{type:`button`,role:`switch`,"aria-checked":p,"aria-required":m,"data-state":D(p),"data-disabled":d?``:void 0,disabled:d,value:l,...n,ref:S,onClick:s(t,e=>{g(e=>!e),x&&b&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})});b.displayName=y;var x=u.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,f.jsx)(v,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(b,{...d,ref:t,__scopeSwitch:n}),e&&(0,f.jsx)(T,{__scopeSwitch:n})]})})});x.displayName=p;var S=`SwitchThumb`,C=u.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=_(S,n);return(0,f.jsx)(a.span,{"data-state":D(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});C.displayName=S;var w=`SwitchBubbleInput`,T=u.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:c,required:p,disabled:m,name:h,value:g,form:v,bubbleInput:y,setBubbleInput:b}=_(w,e),x=i(n,b),S=d(s),C=l(r);u.useEffect(()=>{let e=y;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!o.current;if(S!==s&&n){let t=new Event(`click`,{bubbles:r});n.call(e,s),e.dispatchEvent(t)}},[y,S,s,o]);let T=u.useRef(s);return(0,f.jsx)(a.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??T.current,required:p,disabled:m,name:h,value:g,form:v,...t,tabIndex:-1,ref:x,style:{...t.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});T.displayName=w;function E(e){return typeof e==`function`}function D(e){return e?`checked`:`unchecked`}function O({className:e,size:t=`default`,...n}){return(0,f.jsx)(x,{"data-slot":`switch`,"data-size":t,className:r(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-none transition-[color,background-color,border-color,box-shadow] outline-hidden focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-6 data-[size=default]:w-10 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-accent-strong data-[state=unchecked]:bg-input`,e),...n,children:(0,f.jsx)(C,{"data-slot":`switch-thumb`,className:r(`pointer-events-none block rounded-full bg-background ring-0 motion-safe:transition-transform group-data-[size=default]/switch:size-[18px] group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-[state=checked]:translate-x-5 group-data-[size=default]/switch:data-[state=unchecked]:translate-x-0.5 group-data-[size=sm]/switch:data-[state=checked]:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-[state=unchecked]:translate-x-0`)})})}export{d as n,O as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Bt as r,Ct as i,Ft as a,Nn as o,Nt as s,Qn as c,Rt as l,di as u,ot as d,rt as f}from"./project-scope-context-C912rTJP.js";import{Bt as p,C as m,X as h,Y as g,sn as _,vt as v}from"./queries-dOBokhuR.js";import{h as y}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as b}from"./toaster-Bo5vCbz-.js";import{C as x,j as S}from"./design-icons-CzEoMH9c.js";import{t as C}from"./run-header-Cd6Z_Juw.js";import{i as w,n as T,r as E}from"./git-toolbar-B9t94bg6.js";import{t as D}from"./button-BQ2y4XRB.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-BVF6dIeS.js";import{b as P,f as F}from"./task-groups-Ziytm1Sm.js";import{t as I}from"./centered-state-V15AR_qo.js";import{C as L,X as R,en as z,ln as B,w as V}from"./index-BNqZkH0S.js";import{t as H}from"./markdown-BBDDg-4t.js";import{t as U}from"./textarea-vJt9undk.js";import{t as W}from"./diff-DUljAzi_.js";var G=e(t(),1),K=`no worktree — this task ran directly in the repo working tree`;function q(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.run.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${K}`)}function J(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.run.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${K}`)}function Y(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${K}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?c(e.run)?t(`Create PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):P(e.run)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function X(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:q(e),n=e.prUrl?[q(e),J(e)]:[J(e),Y(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?P(e.run)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var Z=n();function Q({run:e,open:t,onOpenChange:n}){let r=u(),[i,a]=(0,G.useState)(``),o=F(e),s=(0,G.useRef)(o);s.current=o,(0,G.useEffect)(()=>{t&&a(s.current)},[t]);let c=_({mutationFn:t=>f(e.id,t),onSuccess:t=>{b(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:p.runs.changes(e.id)}),r.invalidateQueries({queryKey:p.runs.all})},onError:e=>b(e.message,{tone:`danger`})}),l=()=>{let e=i.trim();e.length===0||c.isPending||c.mutate(e)};return(0,Z.jsx)(N,{open:t,onOpenChange:n,children:(0,Z.jsxs)(j,{"data-slot":`commit-dialog`,children:[(0,Z.jsxs)(A,{children:[(0,Z.jsx)(M,{children:`Commit changes`}),(0,Z.jsxs)(k,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,Z.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,Z.jsx)(U,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{R({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),l())}}),(0,Z.jsxs)(O,{children:[(0,Z.jsx)(D,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Z.jsx)(D,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||c.isPending,onClick:l,children:c.isPending?`Committing…`:`Commit`})]})]})})}function $(){let{id:e}=y(),t=g(e);return t.isPending?(0,Z.jsx)(V,{tab:`changes`}):t.isError?(0,Z.jsx)(L,{tab:`changes`,error:t.error}):(0,Z.jsx)(ee,{run:t.data})}function ee({run:e}){let t=v(),n=m(),r=h(e.id,P(e)),i=z(),[c,f]=(0,G.useState)(`unified`),[g,y]=(0,G.useState)(!1),[x,S]=(0,G.useState)(!1),[w,D]=(0,G.useState)(null),[O,k]=(0,G.useState)(!1),A=(0,G.useRef)(null),j=u(),M=()=>j.invalidateQueries({queryKey:p.runs.all}),N=e=>b(e.message,{tone:`danger`}),F=_({mutationFn:()=>l(e.id),onSuccess:e=>b(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:N}),I=_({mutationFn:()=>d(e.id),onSuccess:e=>{b(`Draft PR created — ${e.url}`),M()},onError:N}),L=_({mutationFn:()=>a(e.id),onError:e=>{if(e instanceof o&&e.command){navigator.clipboard.writeText(e.command).then(()=>b(`No terminal found — command copied to clipboard.`)).catch(()=>b(`Run manually: ${e.command}`));return}N(e)}}),R=_({mutationFn:t=>s(e.id,t),onError:N}),V=r.isError&&r.error instanceof o&&r.error.status===409,U=X({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!V,branch:e.branch,changedFiles:r.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:B(e)!==void 0,prUrl:e.pullRequestUrl}),W=e=>{switch(e){case`commit`:k(!0);break;case`push`:F.mutate();break;case`create-pr`:I.mutate();break;case`open-terminal`:L.mutate();break;case`view-pr`:break}},K=r.data?.files??[],q=(0,G.useMemo)(()=>E(K),[K]),J=(0,G.useMemo)(()=>K.some(H),[K]),Y=i?c:`unified`,$=!i||g;return(0,Z.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Z.jsx)(C,{run:e,tab:`changes`}),(0,Z.jsx)(T,{bar:U,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:Y,wrap:$,preview:x,onModeChange:f,onWrapChange:y,onPreviewChange:J?S:void 0,onAction:W}),r.data?.repointedHead?(0,Z.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,Z.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Z.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,Z.jsx)(te,{changes:r,changesRefused:V,fileCount:K.length,children:(0,Z.jsx)(ne,{runId:e.id,files:K,tree:q,selected:w,selectFile:e=>{D(e),A.current?.scrollToPath(e)},diffRef:A,effectiveMode:Y,effectiveWrap:$,preview:x,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:R.mutate})}),(0,Z.jsx)(Q,{run:e,open:O,onOpenChange:k})]})}function te({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,Z.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,Z.jsx)(I,{icon:t?(0,Z.jsx)(x,{size:16}):(0,Z.jsx)(S,{size:16}),tone:t?`neutral`:`danger`,heading:`h2`,title:t?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):n===0?(0,Z.jsx)(I,{icon:(0,Z.jsx)(x,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):r}function ne({runId:e,files:t,tree:n,selected:i,selectFile:a,diffRef:o,effectiveMode:s,effectiveWrap:c,preview:l,localHandoff:u,onOpenInApp:d}){return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`,children:[(0,Z.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 md:block lg:w-[250px]`,children:[(0,Z.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,Z.jsx)(w,{root:n,selected:i,onSelect:a})]}),(0,Z.jsx)(W,{files:t,viewRef:o,mode:s,wrap:c,preview:l,loadFileText:t=>re(e,t),imageSrc:t=>r(e,t),onOpenInApp:u?e=>d(e):void 0,className:`min-w-0 flex-1`})]})}async function re(e,t){try{let n=await i(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{$ as TaskChangesRoute};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Nn as i}from"./project-scope-context-C912rTJP.js";import{Q as a,X as o,Y as s,Z as c}from"./queries-dOBokhuR.js";import{h as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as u,S as d,X as f,j as p}from"./design-icons-CzEoMH9c.js";import{t as m}from"./run-header-Cd6Z_Juw.js";import{t as h}from"./project-router-DucFIl_x.js";import{b as g}from"./task-groups-Ziytm1Sm.js";import{t as _}from"./centered-state-V15AR_qo.js";import{C as v,Gn as y,s as b,w as x}from"./index-BNqZkH0S.js";import{t as S}from"./commit-diff-panel-CE7372Fz.js";var C=e(t(),1),w=n(),T=77;function E({slot:e,commits:t,className:n,heading:i}){let[a,o]=(0,C.useState)(``),s=a.trim().toLowerCase(),c=s?t.filter(e=>e.subject.toLowerCase().includes(s)):t,l=c.length>150,u=(0,C.useRef)(null),d=(0,C.useRef)(null),[p,m]=(0,C.useState)(0);(0,C.useLayoutEffect)(()=>{if(!l)return;let e=()=>{let e=u.current,t=d.current;!e||!t||m(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[l]);let h=c.map(n=>(0,w.jsx)(D,{commit:n,detailed:e===`task-commits`&&t.length===1},n.sha));return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`label`,{className:`relative mb-[22px] block`,children:[(0,w.jsx)(f,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3.5 left-3 size-4 text-muted-foreground`}),(0,w.jsx)(y,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:a,onChange:e=>o(e.target.value),className:`h-11 bg-card pl-10`})]}),(0,w.jsxs)(`div`,{ref:e=>{u.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":l,className:r(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-4 py-1 md:px-5`,n),children:[i?(0,w.jsx)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 py-4`,children:i}):null,c.length===0?(0,w.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,l?(0,w.jsx)(b,{scrollRef:d,startMargin:p,itemSize:T,children:h}):h]})]})}function D({commit:e,detailed:t}){return(0,w.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_77px] [content-visibility:auto]`,children:(0,w.jsxs)(h,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:r(`flex min-h-[76px] min-w-0 flex-col items-start gap-3 rounded-sm py-4 hover:bg-muted`,!t&&`md:flex-row md:items-center md:py-3`),children:[(0,w.jsx)(p,{size:16,"aria-hidden":`true`,className:r(`shrink-0 text-accent-text`,t?`size-[22px]`:`size-4`)}),(0,w.jsxs)(`span`,{className:r(`min-w-0 w-full`,!t&&`md:w-auto md:flex-1`),children:[(0,w.jsx)(`span`,{className:r(`block font-normal`,t?`text-[22px] leading-snug`:`text-[13px] md:truncate`),children:e.subject}),(0,w.jsxs)(`span`,{className:`mt-1 block truncate text-[11px] text-soft-foreground`,children:[e.author,` · `,e.when]})]}),(0,w.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),t?(0,w.jsxs)(`span`,{className:`inline-flex min-h-11 items-center gap-2 rounded-lg bg-action px-3 text-xs font-medium text-action-foreground`,children:[(0,w.jsx)(u,{size:16,"aria-hidden":`true`,className:`size-4`}),`View changes`]}):null]})})}function O(){let{id:e}=l(),t=s(e);return t.isPending?(0,w.jsx)(x,{tab:`changes`}):t.isError?(0,w.jsx)(v,{tab:`changes`,error:t.error}):(0,w.jsx)(k,{run:t.data})}function k({run:e}){let{sha:t}=l(),n=a(e.id,g(e));return(0,w.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,w.jsx)(m,{run:e,tab:`commits`}),t?(0,w.jsx)(A,{runId:e.id,sha:t}):n.isPending?(0,w.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,w.jsx)(_,{icon:(0,w.jsx)(p,{size:16}),tone:n.error instanceof i&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof i&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,w.jsx)(_,{icon:(0,w.jsx)(p,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,w.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,w.jsx)(E,{slot:`task-commits`,heading:(0,w.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,w.jsx)(j,{run:e})]})]})}function A({runId:e,sha:t}){return(0,w.jsx)(S,{commit:c(e,t),sha:t,backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,diffClassName:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`})}function j({run:e}){let t=o(e.id,g(e));return t.isPending?(0,w.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,w.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,w.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,w.jsxs)(`h2`,{className:`mb-4 text-[16px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,w.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,w.jsx)(`li`,{children:(0,w.jsxs)(h,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,w.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,w.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{O as TaskCommitsRoute};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Nn as i,et as a,ut as o}from"./project-scope-context-C912rTJP.js";import{B as s,F as c,N as l,Y as u,et as d}from"./queries-dOBokhuR.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as g,T as _,X as v,ot as y,u as b}from"./design-icons-CzEoMH9c.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{f as S,t as C}from"./run-header-Cd6Z_Juw.js";import{a as w,i as T,n as E,r as D}from"./file-preview-Cj3QRSUt.js";import{t as O}from"./button-BQ2y4XRB.js";import{t as k}from"./centered-state-V15AR_qo.js";import{C as A,Gn as j,w as M}from"./index-BNqZkH0S.js";import{r as N}from"./markdown-CzP2Mv9j.js";var P=x(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),F=x(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),I=e(t(),1),L=n();function R({runId:e,path:t,artifactId:n}){let r=s(e,n?null:t),i=l(e,n),c=n?i:r,u=(0,I.useContext)(N),d=f(),p=d.pathname.replace(/\/files\/?$/,`/report`)+d.search,m=c.data,h=(0,I.useMemo)(()=>m?.type===`file`&&m.source!==`artifact`?{runId:e,...u,basePath:m.path}:null,[m,u,e]);if(!t&&!n)return(0,L.jsx)(D,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,L.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:`Could not load this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,L.jsx)(O,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!m)return(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});if(m.type!==`file`)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:m.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:m.path}),(0,L.jsx)(`p`,{className:`text-sm`,children:m.reason}),(0,L.jsx)(O,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let g=m.artifact;return(0,L.jsx)(N.Provider,{value:h,children:(0,L.jsx)(E,{runId:e,entry:m,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:g?a(e,g.id,`image`):o(e,t),...g?{downloadUrl:a(e,g.id,`download`),snapshot:new Date(g.createdAt).toLocaleString()}:{}},g?.id??m.path)})}var z=new Map;function B(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var V=(0,I.createContext)(null);function H(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,I.useState)({key:e,generation:0});if(n.key===e)return n.generation;let i={key:e,generation:t?n.generation+1:n.generation};return r(i),i.generation}var U=()=>document.querySelector(`[data-slot="main"]`);function W(e,t){let n=(0,I.useRef)(null),r=f(),i=h()===`POP`?r.key:B(r.state),[a]=(0,I.useState)(()=>{let t=i?z.get(i):void 0;return t?.runId===e?t:null}),o=(0,I.useRef)(new Set(a?.folders??[])),s=(0,I.useRef)(new Set),[c,l]=(0,I.useState)(0),u=(0,I.useRef)(a===null),d=(0,I.useCallback)(()=>{u.current&&z.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:U()?.scrollTop??0})},[r.key,e]),p=(0,I.useMemo)(()=>({isOpen:e=>o.current.has(e),setOpen:(e,t)=>{t?o.current.add(e):o.current.delete(e),d()},loading:(e,t)=>{a?.folders.has(e)&&(t?s.current.add(e):s.current.delete(e),l(s.current.size))}}),[a,d]);return(0,I.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=U();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,I.useEffect)(()=>{d();let e=[n.current,U()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,d,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,d)}},[d]),{tree:n,folders:p}}function G({runId:e,selected:t,onSelect:n}){return(0,L.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function K({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=d(e,t),o=(0,I.useContext)(V);return(0,I.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,L.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,L.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,L.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,L.jsx)(L.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,L.jsx)(q,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,L.jsx)(J,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function q({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,I.useContext)(V),[c,l]=(0,I.useState)(()=>s?.isOpen(n)??!1);return(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+i*14}px`},children:[(0,L.jsx)(b,{size:16,"aria-hidden":`true`,className:r(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,L.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function J({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=w(t)?F:g;return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>o(t),className:r(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+i*14}px`},children:[(0,L.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,L.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:T(n)})]})})}function Y(){let{id:e}=m(),t=u(e),n=H();return t.isPending?(0,L.jsx)(M,{tab:`files`}):t.isError?(0,L.jsx)(A,{tab:`files`,error:t.error}):(0,L.jsx)(S,{runId:t.data.id,children:(0,L.jsx)(Z,{run:t.data},`${t.data.id}:${n}`)})}function X(e,t,n,r){let i=s(e,r||n!==null?null:t),a=l(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function Z({run:e}){let t=d(e.id,``),n=c(e.id),[r,a]=p(),o=r.get(`path`),s=r.get(`artifact`),l=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[u,f]=(0,I.useState)(o??``);(0,I.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof i&&t.error.status===409,g=X(e.id,o,s,l),_=W(e.id,!t.isPending&&g);return(0,L.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,L.jsx)(C,{run:e,tab:`files`}),(0,L.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),u.trim()&&m(`path`,u.trim())},children:[(0,L.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,L.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,L.jsx)(j,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:u,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,L.jsx)(O,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!u.trim(),children:`Open file`})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,L.jsxs)(`aside`,{ref:_.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,L.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,L.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,L.jsx)(k,{icon:h?(0,L.jsx)(P,{}):(0,L.jsx)(y,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,L.jsx)(V.Provider,{value:_.folders,children:(0,L.jsx)(G,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,L.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,L.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,L.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,L.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,L.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,"aria-current":e.id===s?`true`:void 0,className:`min-h-11 w-full rounded px-2 py-2 text-left text-xs wrap-anywhere hover:bg-muted focus-visible:ring-2`,onClick:()=>m(`artifact`,e.id),children:e.name})},e.id))}),(0,L.jsx)(O,{variant:`ghost`,className:`min-h-11`,onClick:()=>void n.refetch(),children:`Refresh published files`})]})]}),l?(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||s!==null||t.isSuccess?(0,L.jsx)(R,{runId:e.id,path:o,artifactId:s}):null]}),(0,L.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{Y as TaskFilesRoute};
@@ -1,9 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{l as i,n as a,t as o}from"./utils-DSMR_WLb.js";import{n as s}from"./live-refetch-CZb2VOyu.js";import{Nn as c,On as l,Ot as u,Qn as d,Qr as f,Yn as p,Zr as m,di as h,dt as g,it as _,lr as v,nt as y,ot as b,st as x,tr as S,tt as C}from"./project-scope-context-C912rTJP.js";import{$ as w,$t as T,Bt as E,G as D,Gt as O,J as ee,Kt as k,P as A,St as te,V as ne,Y as j,Yt as M,_ as N,an as re,bt as P,ct as F,nt as ie,on as I,ot as L,rn as ae,rt as R,sn as z,ut as oe,vt as B,z as se}from"./queries-dOBokhuR.js";import{t as ce}from"./useQuery-BOEhMTCg.js";import{f as le,h as ue,n as de,p as fe}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{d as pe,m as me,r as he,s as ge,v as _e}from"./tasks-table-wTQZb7nJ.js";import{n as V}from"./toaster-Bo5vCbz-.js";import{A as ve,B as H,F as ye,K as be,X as xe,at as Se,c as Ce,dt as we,f as Te,g as Ee,it as De,k as Oe,l as ke,m as Ae,n as je,ot as Me,s as Ne,u as U,ut as Pe,v as Fe,y as Ie,z as Le}from"./design-icons-CzEoMH9c.js";import{t as Re}from"./createLucideIcon-BHp8sXmF.js";import{_ as ze,a as Be,c as Ve,d as He,f as Ue,g as We,h as Ge,i as Ke,l as qe,m as Je,n as Ye,o as Xe,p as Ze,r as Qe,s as $e,t as et,u as tt,v as nt,y as rt}from"./run-header-Cd6Z_Juw.js";import{t as it}from"./chevron-right-BENZ-1ZN.js";import{t as at}from"./external-link-BE6y205O.js";import{t as ot}from"./eye-B8okNWXU.js";import{n as st}from"./smartphone-Lr8Ug2z_.js";import{a as ct}from"./format-BNCkW110.js";import{t as lt}from"./message-square-B-MD-8rD.js";import{a as ut,c as dt,i as ft,l as pt,n as mt,o as ht,r as gt,s as _t,t as vt}from"./thread-state-BLpB8owZ.js";import{i as yt,o as bt,t as xt,u as St}from"./reference-chip-1BEDWxcS.js";import{t as Ct}from"./square-terminal-B6RYYieR.js";import{t as W}from"./button-BQ2y4XRB.js";import{n as G,r as K,t as q}from"./collapsible-BEV4FO-1.js";import{a as wt}from"./popover-BPgUYFyu.js";import{s as Tt,t as J}from"./project-router-DucFIl_x.js";import"./attention-BFUaj1mU.js";import{D as Et,E as Dt,O as Ot,S as kt,b as At,f as Y,u as jt,w as Mt}from"./task-groups-Ziytm1Sm.js";import{t as Nt}from"./status-dot-DtAOFiIi.js";import{n as Pt,t as Ft}from"./centered-state-V15AR_qo.js";import{$n as It,F as Lt,Fn as Rt,G as zt,I as Bt,In as Vt,Jn as Ht,K as Ut,Ln as Wt,M as Gt,N as Kt,P as qt,Rn as Jt,Sn as Yt,W as Xt,X as Zt,Y as Qt,an as $t,dn as en,en as tn,fn as nn,hn as rn,i as an,j as on,l as sn,m as cn,mn as ln,n as un,nn as dn,on as fn,pn,rn as mn,s as hn,sn as gn,un as _n,vn,wn as yn,x as bn,xn,y as Sn,yn as Cn,zn as wn}from"./index-BNqZkH0S.js";import{i as Tn,r as En}from"./highlighter-DvLzHjjY.js";import{t as Dn}from"./zoomable-image-CIQl1Wpe.js";import{i as On,r as kn,s as An,t as jn}from"./markdown-CzP2Mv9j.js";import{t as Mn}from"./textarea-vJt9undk.js";import{t as Nn}from"./report-title-D4Mbu2Er.js";var Pn=Re(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),Fn=Re(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),In=Re(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Ln=Re(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Rn=Re(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),zn=Re(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Bn=Re(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),X=e(t(),1),Z=r(),Vn=12;function Hn({run:e}){let t=h(),n=z({mutationFn:()=>C(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:E.runs.detail(e.id)}),t.invalidateQueries({queryKey:E.runs.list()}),V(`This task will not resume itself`)},onError:e=>V(e.message,{tone:`danger`})});if(!d(e))return null;let r=new Date(e.autoResumeAt);if(!Number.isFinite(r.getTime()))return null;let i=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(r);return(0,Z.jsxs)(`div`,{"data-slot":`auto-resume-hint`,role:`status`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Nt,{tone:`neutral`,shape:`ring`}),e.autoResumeReason===`provider-error`?(0,Z.jsxs)(`span`,{title:e.error,children:[`Provider error — this task retries automatically at`,` `,(0,Z.jsx)(`time`,{dateTime:e.autoResumeAt,className:`font-medium text-foreground`,children:i}),` `,`(attempt `,(e.autoResumeAttempts??0)+1,` of `,Vn,`)`]}):(0,Z.jsxs)(`span`,{children:[`Usage limit reached — this task resumes automatically at`,` `,(0,Z.jsx)(`time`,{dateTime:e.autoResumeAt,className:`font-medium text-foreground`,children:i})]}),(0,Z.jsx)(`button`,{type:`button`,"data-action":`auto-resume-cancel`,disabled:n.isPending,onClick:()=>n.mutate(),className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground disabled:opacity-50`,children:`Don’t resume`}),(0,Z.jsx)(de,{to:`/settings/global/resources`,"data-slot":`auto-resume-settings-link`,className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground`,children:`Auto-resume settings`})]})}function Un(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Wn=/^[A-Za-z0-9_./:=+,@%-]+$/;function Gn(e){return e.replaceAll(`'`,`'\\''`)}function Kn(e){return e===``?`''`:Wn.test(e)?e:`\u0027${Gn(e)}\u0027`}function qn(e){if(!Un(e))return;let t=e.command;if(typeof t==`string`&&t!==``)return t;if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);if(e.length>0)return e.map(Kn).join(` `)}}function Jn(e){let t="`".repeat(3),n=`~`.repeat(3);return e.split(t).filter((e,t)=>t%2==0).join(` `).split(n).filter((e,t)=>t%2==0).join(` `).split("`").filter((e,t)=>t%2==0).join(` `)}function Yn(e){return e.replace(/!\[(?:\\.|[^\]\\])*\]\([^)\s]*(?:\s+"[^"]*")?\)/g,` `)}function Xn(e){return e.replace(/(?<!\\)(?:\*\*|\*|__|~~|`)/g,``).replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\]\\^_`{|}~])/g,`$1`)}function Zn(e){let t=e.trim();return t===``||t.startsWith(`#`)||/^(https?:|mailto:)/i.test(t)?!0:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function Qn(e){let t=Jn(Yn(e)),n=new Map;for(let e of t.matchAll(/^\s*\[([^\]]+)\]:\s*(\S+)/gm))Zn(e[2])&&n.set(e[1].toLowerCase(),e[2]);let r=t.replace(/^\s*\[[^\]]+\]:\s*\S+.*$/gm,` `),i=[];for(let e of r.matchAll(/(?<!!)\[((?:\\.|[^\]\\])+)\](?:\(((?:[^()\s]|\([^)]*\))+)(?:\s+"[^"]*")?\)|\[([^\]]*)\])|<(https?:\/\/[^>\s]+)>|(https?:\/\/[^\s<]+)/g)){if(e[2]){Zn(e[2])&&i.push({label:Xn(e[1]),href:e[2]});continue}if(e[1]!==void 0&&e[3]!==void 0){let t=(e[3].length>0?e[3]:e[1]).toLowerCase(),r=n.get(t);r&&i.push({label:Xn(e[1]),href:r});continue}let t=(e[4]??e[5])?.replace(/[.,;:!?]+$/,``);t&&Zn(t)&&i.push({label:t,href:t})}return i}var $n=(0,X.createContext)(void 0),er=(0,X.createContext)(void 0);function tr(e,t){let n=new Map;for(let r of Qn(e)){let e=On(r.href,t);if(!e)continue;let i=new URL(e,`https://cockpit.invalid`),a=/^\/p\/([^/]+)\/tasks\/([^/]+)\/report$/.exec(i.pathname),o=/^\/tasks\/([^/]+)\/report$/.exec(i.pathname),s=i.searchParams.get(`artifact`);if(!s||(a?decodeURIComponent(a[1])!==t.projectId:!o))continue;let c=decodeURIComponent(a?a[2]:o[1]),l=`${c}:${s}`;n.has(l)||n.set(l,{runId:c,artifactId:s,label:r.label,href:e})}return[...n.values()]}function nr(e,t){return`report-card-${encodeURIComponent(e)}-${t}`}function rr({text:e,messageKey:t}){let n=(0,X.useContext)(kn),r=(0,X.useContext)(er),i=t??r;if(!n||i===void 0)return null;let a=tr(e,n);return a.length===0?null:(0,Z.jsx)(`div`,{"data-slot":`report-cards`,className:`flex flex-col gap-3 [margin-block-start:1rem]`,children:a.map(e=>(0,Z.jsx)(ir,{reference:e,messageKey:i},`${e.runId}:${e.artifactId}`))})}function ir({reference:e,messageKey:t}){let{artifactId:n,runId:r,label:i,href:a}=e,o=(0,X.useContext)($n),s=(0,X.useContext)(Sn);(0,X.useLayoutEffect)(()=>s?.register(n,r),[s,n,r]);let c=A(r,n),l=le(),u=fe();if(c.isError)return(0,Z.jsx)(de,{id:nr(t,n),"data-slot":`report-card-fallback`,to:a,state:{readerFrom:l.pathname+l.search},children:i});let d=c.data?.artifact;if(d&&!An(d.name))return null;let f=new URLSearchParams(l.search);f.set(`report`,n),f.set(`card`,t);let p=new URLSearchParams(l.search).has(`report`)?l.state:null,m=new URLSearchParams(l.search);m.delete(`report`),m.delete(`card`);let h=`${l.pathname}${m.size?`?${m}`:``}`,g=window.navigation,_={reportCardEntry:!0,reportReturnTo:p?.reportReturnTo??h,reportReturnKey:p?.reportReturnKey??g?.currentEntry?.key,reportScrollTop:p?.reportScrollTop},v={pathname:l.pathname,search:`?${f}`,hash:new URL(a,`https://cockpit.invalid`).hash};return(0,Z.jsxs)(`section`,{"data-slot":`report-card`,"data-artifact-id":n,"data-report-run-id":r,"aria-busy":c.isPending,className:`flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-card p-3 text-foreground`,children:[(0,Z.jsx)(`h3`,{className:`break-words text-sm font-medium`,children:d?Nn(d):i}),(0,Z.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`HTML report`}),(0,Z.jsx)(de,{id:nr(t,n),to:v,state:_,onClick:e=>{if(e.button!==0||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault(),o?.(t);let n=_.reportScrollTop??document.querySelector(`[data-slot="main"]`)?.scrollTop;u(v,{state:{..._,reportScrollTop:n}})},className:`inline-flex min-h-11 min-w-11 items-center self-start rounded-md border border-border px-3 text-sm active:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring ${c.isPending?`text-soft-foreground`:`text-accent-text`}`,children:`Read report`})]})}var ar={message:!0,reasoning:!0,tool:!0,hook:!0};function or(e){return Object.hasOwn(ar,e)&&ar[e]}var sr=e=>e.kind===`tool`,cr=e=>e.kind===`conversation`,lr=e=>(e.toolKind===`read`||e.toolKind===`search`)&&e.status===`completed`,ur=(e,t,n)=>`${e} ${e===1?t:n}`;function dr(e,t){let n=[];return e>0&&n.push(ur(e,`file`,`files`)),t>0&&n.push(ur(t,`search`,`searches`)),`Explored ${n.join(` · `)}`}function fr(e){return`${e} earlier tool call${e===1?``:`s`}`}var pr=[`Web search`,`Ran`,`Edit`,`Write`,`Read`,`Search`,`Fetch`,`Task:`];function mr(e){for(let t of pr)if(e.startsWith(`${t} `)&&e.length>t.length+1)return{verb:t===`Task:`?`Task`:t,detail:e.slice(t.length+1)};return{verb:e}}var hr=new WeakMap;function gr(e){let t=hr.get(e);if(t)return t;let n=_r(e);return hr.set(e,n),n}function _r(e){let t=e.filter(e=>!(e.kind===`tool`&&e.toolKind===`plan`)&&!((e.kind===`reasoning`||e.kind===`message`)&&e.text.trim()===``)),n=new Set(t.filter(sr).map(e=>e.id)),r=new Map,i=[];for(let e of t){let t=or(e.kind)&&`parentItemId`in e&&e.parentItemId!==void 0&&e.parentItemId!==e.id&&n.has(e.parentItemId)?e.parentItemId:void 0;if(t===void 0)i.push(e);else{let n=r.get(t);n?n.push(e):r.set(t,[e])}}let a=[],o=[],s=()=>{if(o.length>=2){let e=o.filter(e=>e.toolKind===`read`).length;a.push({kind:`context-group`,id:`group:${o[0].id}`,tools:o,files:e,searches:o.length-e,label:dr(e,o.length-e)})}else for(let e of o)a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]});o=[]},c=[],l=()=>{if(c.length!==0){for(let e of vr(c).batches)a.push({kind:`worker-conversation`,id:`worker:${e.messages[0].id}`,batches:[e]});c=[]}};for(let e of i){if(cr(e)){s(),c.push(e);continue}l(),sr(e)&&lr(e)&&!r.has(e.id)?o.push(e):(s(),sr(e)?a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]}):a.push({kind:`entry`,id:e.id,entry:e}))}s(),l();let u=e=>e.kind===`context-group`||e.kind===`tool-card`&&e.item.status===`completed`,d=e=>e.kind===`context-group`?e.tools.length:1,f=[],p=[],m=()=>{if(p.length>3){let e=p.slice(0,p.length-3);f.push({kind:`streak`,id:`streak:${e[0].id}`,count:e.reduce((e,t)=>e+d(t),0),blocks:e}),f.push(...p.slice(p.length-3))}else f.push(...p);p=[]};for(let e of a)u(e)?p.push(e):(m(),f.push(e));return m(),f}function vr(e){let t=[];for(let n of e){let e=t.at(-1);n.messageKind===`request`&&e?.kind===`request`&&e.senderRunId===n.senderRunId&&e.text===n.text&&e.messages[0].relationship===`peer`==(n.relationship===`peer`)&&!e.messages.some(e=>e.recipientRunId===n.recipientRunId)?e.messages.push(n):t.push({id:`worker-batch:${n.messageId}`,kind:n.messageKind,text:n.text,senderRunId:n.senderRunId,messages:[n]})}return{kind:`worker-conversation`,id:`worker:${e[0].id}`,batches:t}}var yr=new Map,br=(0,X.createContext)(null);function xr(){return(0,X.useContext)(br)}function Sr({runId:e,children:t}){let n=(0,X.useMemo)(()=>({get:t=>yr.get(e)?.get(t),set:(t,n)=>{let r=yr.get(e)??new Map;r.set(t,n),yr.set(e,r)}}),[e]);return(0,Z.jsx)(br.Provider,{value:n,children:t})}function Cr(e){return e.scrollTop<Math.max(600,e.clientHeight)}function wr(e,t){let n=t.find(({bottom:t})=>t>e);return n===void 0?void 0:{key:n.key,offset:n.top-e}}function Tr(e,t,n,r,i){if(n===void 0)return i;let a=r.find(({key:e})=>e===n.key);return a===void 0?i:e+(a.top-t-n.offset)}function Er(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<t}function Dr(e,t){let n=new URLSearchParams(e).get(`thread`);return n===`flat`||n===`virtual`?n:t>300?`virtual`:`flat`}var Or=new Map;function kr(e,t){Or.set(e,t)}function Ar(e){return Or.get(e)}var jr=new Map;function Mr(e,t){jr.set(e,{...t,...t.rowKeys?{rowKeys:[...t.rowKeys]}:{}})}function Nr(e){return jr.get(e)}function Pr(e,t,n){let r=jr.get(e);if(!r||r.rows!==t)return;let i=r.rowKeys;if(!(n&&i&&(n.length!==t||i.length!==t||!n.every((e,t)=>e===i[t]))))return r.cache}var Fr=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}),Ir=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`medium`}),Lr=new Intl.DateTimeFormat(void 0,{weekday:`short`,month:`short`,day:`numeric`}),Rr=new Intl.DateTimeFormat(void 0,{weekday:`short`,year:`numeric`,month:`short`,day:`numeric`}),zr=new Intl.DateTimeFormat(void 0,{dateStyle:`full`});function Q(e){if(typeof e!=`string`||e===``)return;let t=new Date(e);return Number.isFinite(t.getTime())?t:void 0}function Br(e){let t=Q(e);return t===void 0?void 0:Fr.format(t)}function Vr(e){let t=Q(e);return t===void 0?void 0:Ir.format(t)}var Hr=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;function Ur(e){let t=Q(e);return t===void 0?void 0:Hr(t)}function Wr(e,t=new Date){let n=Q(e);if(n===void 0)return;let r=Hr(n);return r===Hr(t)?`Today`:r===Hr(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1))?`Yesterday`:(n.getFullYear()===t.getFullYear()?Lr:Rr).format(n)}function Gr(e,t){let n=Q(e),r=Q(t);if(n===void 0||r===void 0)return;let i=Math.round((r.getTime()-n.getTime())/1e3);if(i<0)return;if(i<60)return`${i}s`;let a=Math.floor(i/60);return a<60?`${a}m ${String(i%60).padStart(2,`0`)}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,`0`)}m`}function Kr({ts:e}){let t=Br(e);return t===void 0?null:(0,Z.jsx)(`time`,{"data-slot":`message-time`,dateTime:e,title:Vr(e),className:`text-[11px] leading-none text-soft-foreground`,children:t})}function qr({startedAt:e,completedAt:t}){let n=Br(t);if(n===void 0)return null;let r=Gr(e,t);return(0,Z.jsxs)(`div`,{"data-slot":`turn-time`,className:`flex items-center gap-1.5 px-0.5 text-[11px] leading-none text-soft-foreground`,children:[(0,Z.jsx)(`time`,{dateTime:t,title:Vr(t),children:n}),r===void 0?null:(0,Z.jsxs)(`span`,{title:`Replied in ${r}`,children:[`· `,r]})]})}function Jr({ts:e}){let t=Wr(e),n=Q(e);if(t===void 0||n===void 0)return null;let r=zr.format(n);return(0,Z.jsxs)(`div`,{"data-slot":`day-separator`,role:`separator`,"aria-label":t===`Today`||t===`Yesterday`?`${t}, ${r}`:r,className:`flex items-center gap-3 py-1 text-[11px] font-medium text-soft-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`}),(0,Z.jsx)(`time`,{dateTime:Ur(e),title:r,children:t}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`})]})}var Yr={assistant:`Agent message`,error:`Runner error`,"session.error":`Session error`,"step-end":`Step status`,lifecycle:`Run status`};function Xr({note:e}){return e.icon===`handoff`?(0,Z.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,"data-icon":`handoff`,className:`flex items-start gap-2 px-0.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`mt-[-1px] flex size-5 shrink-0 items-center justify-center rounded-full border border-border text-success`,children:(0,Z.jsx)(Ht,{className:`size-3`})}),(0,Z.jsx)(`span`,{className:`min-w-0 break-words`,children:e.text})]}):e.details&&e.details.length>0?(0,Z.jsxs)(q,{"data-slot":`note-line`,"data-tone":e.tone,className:`group/failure min-w-0 px-0.5 text-xs`,children:[(0,Z.jsxs)(`div`,{className:o(`flex items-start gap-2`,e.tone===`danger`?`text-danger [.light_&]:text-red-700`:`text-soft-foreground`),children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 whitespace-pre-wrap wrap-anywhere`,children:[e.tone===`danger`?`✗ `:`· `,e.text]}),(0,Z.jsxs)(K,{"data-slot":`note-details-toggle`,className:`inline-flex shrink-0 items-center gap-1 rounded-sm px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground hover:bg-muted/50 hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11 max-md:min-w-11 max-md:justify-center pointer-coarse:min-h-11 pointer-coarse:min-w-11 pointer-coarse:justify-center`,children:[(0,Z.jsx)(U,{"aria-hidden":`true`,className:`size-3 shrink-0 motion-safe:transition-transform group-data-[state=open]/failure:rotate-90`}),`Details`]})]}),(0,Z.jsx)(G,{children:(0,Z.jsx)(`ul`,{"data-slot":`note-details`,className:`mbs-1.5 flex flex-col gap-1 border-s border-border ps-3 font-mono text-[11px] text-muted-foreground`,children:e.details.map((e,t)=>(0,Z.jsxs)(`li`,{className:`min-w-0 whitespace-pre-wrap wrap-anywhere`,children:[(0,Z.jsxs)(`span`,{className:`font-sans font-medium text-foreground/80`,children:[Yr[e.source],`:`,` `]}),e.text]},`${e.source}:${t}`))})})]}):(0,Z.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,className:o(`px-0.5 text-xs`,e.tone===`danger`?`text-danger [.light_&]:text-red-700`:`text-soft-foreground`),children:[e.tone===`danger`?`✗ `:`· `,e.text]})}var Zr={user:{label:`YOUR MESSAGE`,speaker:`Your message`,classes:`border-message-user-border bg-message-user-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-user-accent`,accent:`text-message-user-accent`,body:`max-md:text-[12px]`},agent:{label:`AGENT RESPONSE`,speaker:`Agent response`,classes:`border-message-agent-border bg-message-agent-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-agent-accent`,accent:`text-message-agent-accent`,body:`text-[15px] md:text-[14px]`}};function Qr({role:e,children:t,className:n,ts:r,headerActions:i,...a}){let s=Zr[e],c=r===void 0?void 0:Br(r);return(0,Z.jsxs)(`article`,{...a,"data-role":e,"aria-label":s.speaker,className:o(`flex w-full min-w-0 flex-col gap-2 self-stretch rounded-[8px] border p-3 md:px-4 md:py-[14px]`,s.classes,n),children:[(0,Z.jsxs)(`p`,{className:o(`m-0 flex w-full min-w-0 items-start gap-2 text-[11px] leading-[1.2] font-semibold tracking-[0.6px] uppercase`,s.accent),children:[(0,Z.jsxs)(`span`,{className:`inline-flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1 normal-case tracking-normal`,children:[(0,Z.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 uppercase tracking-[0.6px]`,children:[(0,Z.jsx)(lt,{"aria-hidden":`true`,className:`size-4 shrink-0`}),s.label]}),i]}),c===void 0?null:(0,Z.jsx)(`span`,{className:`shrink-0 font-normal tracking-normal normal-case`,children:(0,Z.jsx)(Kr,{ts:r})})]}),(0,Z.jsx)(`div`,{className:o(`min-w-0 break-words text-[14px] text-foreground select-text [overflow-wrap:anywhere]`,s.body,`leading-[1.6]`),children:t})]})}var $r=[],ei=(0,X.memo)(function({text:e,imageCount:t=0,images:n=$r,ts:r,onEdit:a,onRemove:o,editLabel:s=`Edit message`,removeLabel:c=`Remove message`,children:l}){let u=t-n.length,[d,f]=(0,X.useState)(!1),[p,m]=(0,X.useState)(e),[h,g]=(0,X.useState)(!1),[_,y]=(0,X.useState)(),b=()=>{m(e),y(void 0),f(!0)},x=async()=>{let t=p.trim();if(!t||t===e){f(!1);return}g(!0),y(void 0);try{await a?.(t),f(!1)}catch(e){y(e instanceof Error?e.message:`Could not save the message`)}finally{g(!1)}},S=async()=>{g(!0),y(void 0);try{await o?.()}catch(e){y(e instanceof Error?e.message:`Could not remove the message`)}finally{g(!1)}};return d?(0,Z.jsxs)(Qr,{role:`user`,ts:r,"data-slot":`user-bubble`,"data-editing":`true`,children:[(0,Z.jsx)(`textarea`,{autoFocus:!0,"aria-label":`Edit the message`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Escape`?(e.stopPropagation(),f(!1)):e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())},className:`block max-h-[220px] min-h-[60px] w-full resize-none rounded-md bg-background px-2 py-1.5 text-[14px] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`}),(0,Z.jsxs)(`span`,{className:`mt-1.5 flex justify-end gap-1.5`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>f(!1),disabled:h,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm px-2 text-xs font-medium text-muted-foreground hover:bg-background hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:`Cancel`}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:h,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm bg-action px-2 text-xs font-semibold text-action-foreground hover:brightness-[0.96] focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:h?(0,Z.jsx)(ct,{className:`size-3.5 animate-spin`}):`Save`})]}),_?(0,Z.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-xs text-danger`,children:_}):null]}):(0,Z.jsxs)(Qr,{role:`user`,ts:r,"data-slot":`user-bubble`,className:`group`,children:[a||o?(0,Z.jsxs)(`span`,{"data-slot":`bubble-actions`,className:`mb-1 flex justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[a?(0,Z.jsx)(`button`,{type:`button`,"aria-label":s,onClick:b,disabled:h,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(Bn,{className:`size-3.5`})}):null,o?(0,Z.jsx)(`button`,{type:`button`,"aria-label":c,onClick:()=>void S(),disabled:h,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-danger focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(Se,{className:`size-3.5`})}):null]}):null,_?(0,Z.jsx)(`p`,{role:`alert`,className:`mb-1 text-xs text-danger`,children:_}):null,l??(0,Z.jsx)(jn,{breaks:!0,children:e}),n.length>0?(0,Z.jsx)(`span`,{"data-slot":`user-images`,className:`mt-2 flex flex-wrap items-center justify-end gap-1.5`,children:n.map(e=>v(e.split(`/`).pop()??``)?(0,Z.jsx)(Dn,{src:e,alt:`attached`,className:`max-h-40 max-w-[220px] rounded-md border border-border object-contain`},e):(0,Z.jsxs)(`a`,{href:i(e),download:!0,"data-slot":`user-file`,className:`inline-flex min-h-11 min-w-11 max-w-[220px] items-center gap-1.5 rounded-md border border-border bg-background/60 px-2 py-1 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(be,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.split(`/`).pop()})]},e))}):null,u>0?(0,Z.jsxs)(`span`,{className:`mt-1 block text-xs text-soft-foreground`,children:[u,` image`,u>1?`s`:``,` attached`]}):null]})}),ti=`inline-flex h-11 min-w-11 items-center justify-center gap-1 rounded-sm px-2 text-xs font-medium text-soft-foreground hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,ni=[`[data-streamdown="code-block-actions"]`,`[data-streamdown="code-copy-button"]`,`[data-streamdown="code-block-copy-button"]`,`[data-streamdown="code-block-header"]`].join(`,`);function ri(e,t){let n=e.cloneNode(!0);n.querySelectorAll(ni).forEach(e=>e.remove());let r=Qn(t);return[...n.querySelectorAll(`button[data-streamdown="link"]`)].forEach(e=>{let t=e.textContent??``,i=r.findIndex(e=>e.label===t);if(i<0)return;let a=r.splice(i,1)[0];if(!a||!Zn(a.href))return;let o=n.ownerDocument.createElement(`a`);o.setAttribute(`href`,a.href),o.setAttribute(`data-streamdown`,`link`),o.textContent=e.textContent,e.replaceWith(o)}),n.innerHTML}async function ii(e,t,n){if(e===`markdown`){if(!navigator.clipboard?.writeText)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(t);return}if(!navigator.clipboard?.write||typeof ClipboardItem>`u`||!n)throw Error(`Clipboard unavailable`);let r=ri(n,t);await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([r],{type:`text/html`}),"text/plain":new Blob([t],{type:`text/plain`})})])}var ai=(0,X.memo)(function({text:e,ts:t,messageKey:n}){let r=(0,X.useRef)(null),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(null),c=(0,X.useRef)(null);(0,X.useEffect)(()=>()=>{c.current!==null&&clearTimeout(c.current)},[]);let l=async t=>{c.current!==null&&clearTimeout(c.current),a(null),s(null);try{await ii(t,e,r.current),a(t),c.current=setTimeout(()=>a(null),2e3)}catch{s(`Couldn't copy to the clipboard`)}};return(0,Z.jsxs)(Qr,{role:`agent`,ts:t,"data-slot":`assistant-message`,headerActions:(0,Z.jsxs)(`span`,{"data-slot":`bubble-actions`,className:`flex items-center gap-0.5`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Copy reply`,onClick:()=>void l(`html`),className:ti,children:[(0,Z.jsx)(Fe,{className:`size-3.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{"aria-live":`polite`,children:i===`html`?`Copied`:`Copy`})]}),(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Copy reply as markdown`,onClick:()=>void l(`markdown`),className:ti,children:[(0,Z.jsx)(It,{className:`size-3.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{"aria-live":`polite`,children:i===`markdown`?`Copied`:`Copy markdown`})]})]}),children:[o?(0,Z.jsx)(`p`,{role:`alert`,className:`mb-1 text-xs text-danger`,children:o}):null,(0,Z.jsx)(`div`,{ref:r,children:(0,Z.jsx)(jn,{breaks:!0,children:e})}),(0,Z.jsx)(rr,{text:e,messageKey:n})]})});function oi({incident:e}){let t=T().data;if(!t)return null;let n=k(t,e.provider);return(0,Z.jsxs)(`div`,{role:`alert`,"data-slot":`provider-auth-required`,className:`rounded-md border border-danger/30 bg-danger/5 px-3.5 py-3`,children:[(0,Z.jsxs)(`p`,{className:`text-[13px] font-semibold text-foreground`,children:[`This run needed `,n,` authorization`]}),(0,Z.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Review `,n,` settings before retrying.`]}),(0,Z.jsx)(J,{to:`/settings/agent-defaults#providers`,className:`mt-2 inline-flex text-xs font-medium text-foreground underline-offset-2 hover:underline`,children:`Open provider settings`})]})}var si=(0,X.memo)(function({text:e}){let t=(0,X.useId)();if(e.trim()===``)return null;let n=e.split(`
2
- `,1)[0]??``,r=n.length<e.length;return(0,Z.jsxs)(q,{"data-slot":`reasoning`,className:`group/reasoning min-w-0`,children:[(0,Z.jsxs)(`div`,{id:t,className:`relative flex w-full items-center gap-1.5 rounded-md p-0.5 text-left text-[13px] text-soft-foreground hover:text-muted-foreground`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]/reasoning:rotate-90`}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`Thinking — `}),(0,Z.jsx)(`div`,{className:`min-w-0 truncate text-muted-foreground`,children:(0,Z.jsx)(jn,{inline:!0,children:n})}),r?(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`…`}):null,(0,Z.jsx)(K,{"aria-labelledby":t,className:`absolute inset-0 rounded-md focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`})]}),(0,Z.jsx)(G,{children:(0,Z.jsx)(`div`,{className:`px-6 py-1.5 text-[13px] leading-[1.6] text-soft-foreground`,children:(0,Z.jsx)(jn,{children:e})})})]})});function ci(){return(0,Z.jsxs)(`div`,{"data-slot":`working-indicator`,className:`flex items-center gap-2 py-1 text-[13px] text-soft-foreground`,children:[(0,Z.jsx)(ct,{role:`status`,"aria-label":`Working`,className:`size-3.5 shrink-0 animate-spin`}),(0,Z.jsx)(`span`,{className:`shimmer font-medium`,children:`Working…`})]})}var li={read:It,edit:Bn,delete:Se,move:Rn,search:xe,execute:Ct,think:Fn,fetch:st,task:Ne,plan:H,other:we},ui=e=>e.split(`
3
- `).length;function di({text:e,streaming:t}){let[n,r]=(0,X.useState)(!1),i=(0,X.useRef)(null),a=(0,X.useRef)(!0);(0,X.useEffect)(()=>{let e=i.current;t&&e&&a.current&&(e.scrollTop=e.scrollHeight)},[e,t]);let s=ui(e),c=!t&&!n&&s>12;return(0,Z.jsxs)(`div`,{"data-slot":`tool-output`,"data-clamped":c?`true`:void 0,children:[(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`div`,{ref:i,onScroll:t?e=>{a.current=Er(e.currentTarget)}:void 0,className:o(`overflow-x-auto`,t&&`max-h-[216px] overflow-y-auto`,c&&`max-h-[216px] overflow-y-hidden`),children:(0,Z.jsx)(`pre`,{className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre text-muted-foreground`,children:e})}),c?(0,Z.jsx)(`div`,{"data-slot":`tool-output-fade`,"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-b from-transparent to-card-2`}):null]}),!t&&s>12?(0,Z.jsx)(`button`,{type:`button`,"data-slot":`tool-output-toggle`,onClick:()=>r(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:n?`Show less`:`Show all ${s} lines`}):null]})}function fi({diffs:e}){return(0,Z.jsx)(Z.Fragment,{children:e.map((e,t)=>(0,Z.jsxs)(`div`,{"data-slot":`diff-preview`,className:`min-w-0`,children:[(0,Z.jsx)(`div`,{className:`border-b border-border/50 px-4 py-1.5 font-mono text-[11px] wrap-anywhere text-muted-foreground`,children:e.path}),(0,Z.jsx)(`pre`,{className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:e.unified===void 0?[...pi(e.oldText).map((e,t)=>(0,Z.jsxs)(`span`,{className:`block bg-diff-del px-4 text-muted-foreground`,children:[`- `,e]},`old-${t}`)),...pi(e.newText).map((e,t)=>(0,Z.jsxs)(`span`,{className:`block bg-diff-add px-4`,children:[`+ `,e]},`new-${t}`))]:e.unified.split(`
4
- `).map((e,t)=>(0,Z.jsx)(mi,{text:e},t))})]},`${e.path}:${t}`))})}function pi(e){return e==null||e===``?[]:e.replace(/\n$/,``).split(`
5
- `)}function mi({text:e}){return(0,Z.jsx)(`span`,{className:o(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del text-muted-foreground`,e.startsWith(`@@`)&&`text-soft-foreground`),children:e})}function hi(e){return e.toolKind===`execute`&&e.status===`running`&&e.output!==void 0}function gi(e){let t=e.status===`running`||e.status===`pending`,n=mr(e.title),{verb:r,detail:i}=e.toolKind===`execute`&&n.detail===void 0?{verb:`Ran`,detail:e.title}:n;return{busy:t,verb:r,detail:i,expandedCommand:(e.toolKind===`execute`?qn(e.input):_t(e.name).toolKind===e.toolKind?ht(e.name,e.input):void 0)??i,Icon:li[e.toolKind]??we}}function _i(e,t){return e.output!==void 0&&e.output!==``||e.error!==void 0&&e.error!==``||e.diffs!==void 0&&e.diffs.length>0||t>0}function vi({item:e,busy:t}){return(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[t?(0,Z.jsx)(ct,{role:`status`,"aria-label":`Running`,className:`size-3.5 animate-spin text-soft-foreground`}):null,e.status===`failed`?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`failed`}):null,e.status===`declined`?(0,Z.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`declined`}):null,e.toolKind===`execute`&&typeof e.exitCode==`number`?(0,Z.jsx)(`span`,{"data-slot":`tool-exit`,className:o(`rounded-full px-2 py-px font-mono text-[11px] font-semibold`,e.exitCode===0?`bg-success/10 text-success`:`bg-danger/10 text-danger`),children:e.exitCode}):null]})}function yi({item:e,command:t,busy:n,nested:r,cacheKey:i,renderNested:a}){return(0,Z.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[t===void 0?null:(0,Z.jsx)(`pre`,{"data-slot":`tool-command`,className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:t}),e.error!==void 0&&e.error!==``?(0,Z.jsx)(`div`,{"data-slot":`tool-error`,className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre-wrap wrap-anywhere text-signal-word-red`,children:e.error}):null,e.diffs!==void 0&&e.diffs.length>0?(0,Z.jsx)(fi,{diffs:e.diffs}):null,e.output!==void 0&&e.output!==``?(0,Z.jsx)(di,{text:e.output,streaming:n}):null,r.length>0?(0,Z.jsx)(`div`,{"data-slot":`tool-nested`,className:`flex flex-col gap-2 border-l-2 border-border py-2.5 pr-3 pl-3 ml-4 my-2`,children:a?.(r,i??e.id)}):null]})}function bi({item:e,nested:t=[],cacheKey:n,renderNested:r}){let i=xr(),[a,s]=(0,X.useState)(()=>n===void 0?null:i?.get(n)??null),c=e=>{n!==void 0&&i?.set(n,e),s(e)},{busy:l,verb:u,detail:d,expandedCommand:f,Icon:p}=gi(e),m=_i(e,t.length),h=f!==void 0||m,g=h&&(a??(m&&hi(e)));return(0,Z.jsxs)(q,{"data-slot":`tool-card`,"data-status":e.status,"data-kind":e.toolKind,open:g,onOpenChange:c,className:o(`min-w-0 overflow-hidden rounded-md border bg-card`,e.status===`failed`?`border-danger/25`:`border-border`),children:[(0,Z.jsxs)(K,{disabled:!h,className:`group flex min-h-[28px] w-full items-center gap-1.5 px-2.5 py-0.5 text-left text-[13px] enabled:hover:bg-muted`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:o(`size-3 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`,!h&&`invisible`)}),(0,Z.jsx)(p,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:o(`shrink-0 font-semibold`,l&&`shimmer`,e.status===`declined`&&`text-muted-foreground`),children:u}),d===void 0?null:(0,Z.jsx)(`code`,{title:d,className:`block min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground`,children:d}),(0,Z.jsx)(vi,{item:e,busy:l})]}),(0,Z.jsx)(G,{children:(0,Z.jsx)(yi,{item:e,command:f,busy:l,nested:t,cacheKey:n,renderNested:r})})]})}function xi(e){let t=e.name??e.event,n=t.indexOf(`:`);return n>0?`${t.slice(0,n)} · ${t.slice(n+1)}`:t}function Si({item:e,cacheKey:t}){let n=xr(),[r,i]=(0,X.useState)(()=>t===void 0?!1:n?.get(t)??!1),a=e=>{t!==void 0&&n?.set(t,e),i(e)},s=e.status!==`completed`,c=e.entries.some(e=>e.kind===`context`),l=(e.stdout??``)!==``||(e.stderr??``)!==``,u=xi(e);return(0,Z.jsxs)(q,{"data-slot":`hook-card`,"data-status":e.status,open:r,onOpenChange:a,className:o(`min-w-0 overflow-hidden rounded-md border bg-card`,s?`border-danger/25`:`border-border`),children:[(0,Z.jsxs)(K,{className:`group flex min-h-[28px] w-full items-center gap-1.5 px-2.5 py-0.5 text-left text-[13px] hover:bg-muted`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:`size-3 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,Z.jsx)(Pn,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Hook`}),(0,Z.jsx)(`code`,{title:u,className:`block min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground`,children:u}),(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[s?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.status}):c?(0,Z.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`context`}):null,s&&typeof e.exitCode==`number`&&e.exitCode!==0?(0,Z.jsx)(`span`,{"data-slot":`hook-exit`,className:`rounded-full bg-danger/10 px-2 py-px font-mono text-[11px] font-semibold text-danger`,children:e.exitCode}):null]})]}),(0,Z.jsx)(G,{children:(0,Z.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[e.entries.map((e,t)=>(0,Z.jsx)(`pre`,{"data-slot":`hook-entry`,"data-kind":e.kind,className:o(`px-3 py-2 font-mono text-xs leading-[1.7] whitespace-pre-wrap [overflow-wrap:anywhere]`,(e.kind===`error`||e.kind===`stop`)&&`text-signal-word-red`),children:e.text},t)),e.source===void 0?null:(0,Z.jsx)(`p`,{"data-slot":`hook-source`,className:`px-3 pb-2 font-mono text-[11px] text-muted-foreground [overflow-wrap:anywhere]`,children:e.source}),l?(0,Z.jsxs)(q,{className:`border-t border-border`,children:[(0,Z.jsxs)(K,{"data-slot":`hook-raw-toggle`,className:`group flex w-full items-center gap-1 px-3 py-1 text-left text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:`size-3 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),`Raw output${typeof e.exitCode==`number`?` · exit ${e.exitCode}`:``}`]}),(0,Z.jsxs)(G,{children:[e.stdout?(0,Z.jsx)(`pre`,{"data-slot":`hook-stdout`,className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.stdout}):null,e.stderr?(0,Z.jsx)(`pre`,{"data-slot":`hook-stderr`,className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-signal-word-red [overflow-wrap:anywhere]`,children:e.stderr}):null]})]}):null]})})]})}function Ci({group:e,scope:t}){return(0,Z.jsxs)(q,{"data-slot":`ctx-group`,className:`min-w-0`,children:[(0,Z.jsxs)(K,{className:`group flex h-[34px] tabular-nums w-full items-center gap-2 rounded-md px-2 -mx-2 text-left text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`}),e.label]}),(0,Z.jsx)(G,{children:(0,Z.jsx)(`div`,{className:`flex flex-col gap-1.5 pt-1.5 pl-4`,children:e.tools.map(e=>(0,Z.jsx)(bi,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`},e.id))})})]})}function wi({count:e,children:t}){return(0,Z.jsxs)(q,{"data-slot":`tool-streak`,className:`min-w-0`,children:[(0,Z.jsxs)(K,{className:`group flex items-center gap-1.5 rounded-md p-0.5 tabular-nums text-left text-xs text-soft-foreground hover:text-muted-foreground`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),fr(e)]}),(0,Z.jsx)(G,{children:(0,Z.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:t})})]})}function Ti({image:e}){return(0,Z.jsx)(Dn,{"data-slot":`thread-image`,src:e.url,alt:e.name??`image from the agent session`,className:`max-h-72 max-w-full self-start rounded-lg border border-border`})}function Ei(e,t,n,r){return Ot(e,t)?.runner??e.runner??(t||n?r:void 0)??`claude`}function Di(e,t,n){let r=new Set;for(let i of e.workflowDef?.steps??[]){if(i.command!==void 0||i.kind===`plugin`)continue;let a=i.runner??t,o=i.agentProfile??(a===(e.runner??t)?e.agentProfile:void 0)??n.repoAccount?.[a];n.readyOn(a,o)||r.add(a)}return[...r]}function Oi(e,t,n,r,i){if(!e)return t!==null||!n||r?i:void 0}function ki(e){return e.needsConfig&&e.configPending?`Checking task settings…`:e.needsConfig&&e.configError?`Task settings could not be loaded.`:e.providersPending?`Checking agent providers…`:e.providersError?`Provider authentication could not be verified.`:e.canContinue?void 0:e.untouched?`Connect the required workflow providers (${e.missing.join(`, `)}) to continue.`:`Connect an agent provider to continue.`}function Ai(){let e=te(),t=T();return{providers:e,registered:t,providersPending:e.isPending||t.isPending,providersError:e.isError||t.isError,providersReady:e.isSuccess&&t.isSuccess}}function ji(e,t=null){let{registered:n,providersPending:r,providersError:i,providersReady:a}=Ai(),o=N(),s=gn(e),c=e.removedRunner!==void 0,l=s&&!e.runner||c,u=Yt(),d=e.delegation?.role===`worker`,f=o.data?.defaultRunner,p=Ei(e,s,c,O(f,M(n.data))??f),m=(t,n)=>ln(e,t,u.repoAccount,{original:p,target:n},s),{runners:h,signedOut:g}=u.runnersOn(e=>m(e,e)),_=d?p:Bt(t,h,p),v=h.includes(p),y=s?S(e.workflowDef,_,M(n.data)):[_],b=s&&d&&e.workflowDef?Di(e,_,u):y.filter(e=>!u.readyOn(e,m(e,_))),x=a&&(!l||o.isSuccess)&&b.length===0,C=ki({needsConfig:l,configPending:o.isPending,configError:o.isError,providersPending:r,providersError:i,canContinue:x,untouched:s,missing:b});return{runners:h,signedOut:g,currentRunner:p,runner:_,currentRunnerConnected:v,canContinue:x,providerPending:r||l&&o.isPending,providerError:i,reason:C,runnerOverride:Oi(d,t,v,c,_)}}function Mi(e,t,n,r,i,a,o,s,c){let l=Ot(e,gn(e)),u=l?l.model:e.model,d=l?l.effort:e.effort,f=!r&&!n&&u?{...i?.defaultModels,[t]:u}:i?.defaultModels,p=r?null:s,m=Kt(t,o,a,[p,f?.[t]]),h=Lt(p,t,o,f,a),g=Gt(h,a),_=r?``:c??d??``,v=qt(_,g);return{models:m,model:h,effortOptions:g,effort:v,mustClearStoredEffort:!r&&c===null&&_!==``&&v===``}}function Ni(e,t,n,r){let i=Dt(e.steps),a=Ot(e,gn(e)),o=a?.agentProfile??e.agentProfile??i?.profileId??`default`;return{sessionStep:i,workerStep:a,account:n?r?.[t]??`default`:o}}function Pi(e,t,n,r,i,a,o,{model:s,effort:c,mustClearStoredEffort:l}){return{text:e.trim()?e:void 0,images:t.length?t:void 0,runner:n,model:!r&&(a!==null||i)?s:void 0,effort:!r&&(o!==null||i)?c:l?``:void 0}}function Fi(e,t,n,r){return!!t&&(r!==Et(t,e)||(n?.agentProfile??e.agentProfile??t.profileId??`default`)!==(t.profileId??`default`))}function Ii({models:e,model:t,effortOptions:n,effort:r}){return{modelLabel:e.find(e=>e.id===t)?.label??`auto`,effortLabel:n.find(e=>e.value===r)?.label??`auto`}}function Li(e){let t=F(),n=pn(e).continueRun,r=N(),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(null),[l,u]=(0,X.useState)(null),d=`${e.id}:${Ot(e,gn(e))?.id??``}`,[f,p]=(0,X.useState)(d);f!==d&&(p(d),a(null),s(null),u(null));let m=ji(e,i),{runners:h,canContinue:g,currentRunner:v,runner:y}=m,{sessionStep:b,workerStep:x,account:S}=Ni(e,y,y!==v,xn().repoAccount),C=B(),w=C.data?.capabilities?.localHandoff!==!1,E=T(),D=ae(y,n&&!C.isPending&&!E.isPending,w?S:null),O=r.data?.modelsLocked===!0,ee=y!==v,k=Mi(e,y,ee,O,r.data,D.data,E.data,o,l),{models:A,model:te,effortOptions:ne,effort:j}=k,{modelLabel:M,effortLabel:re}=Ii(k),P=z({mutationFn:({text:t,images:n})=>g?_(I(e.id),Pi(t,n,m.runnerOverride,O,ee,o,l,k)):Promise.reject(Error(m.reason??`Connect an agent provider to continue.`)),onMutate:()=>I(e.id),onSuccess:(e,n,r)=>t.invalidateAfter(`continue`,r),onError:(e,n,r)=>{e instanceof c&&e.status===409&&r&&t.invalidateAfter(`continue`,r)}}),ie=e.delegation?.role===`worker`;return{skillRunner:y,skillAccount:S,available:n,canContinue:g,startsNewConversation:Fi(e,b,x,y),reason:m.reason,providerPending:m.providerPending,pills:(0,Z.jsx)(`div`,{"data-slot":`follow-up-engine`,className:`session-engine-controls`,children:(0,Z.jsxs)(zt,{children:[!ie&&(h.length>1||m.signedOut.length>0)?(0,Z.jsx)(Ut,{icon:(0,Z.jsx)(De,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:h,signedOut:m.signedOut,value:y,onPick:e=>{e!==y&&(a(e),s(null))}}):(0,Z.jsx)(Xt,{icon:(0,Z.jsx)(De,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,readOnly:!0,disabledHint:ie?`Owned workers keep their runner; change model or effort instead.`:void 0,slot:`session-runner-value`,ariaLabel:`Runner`,label:y,value:y,onPick:()=>{},options:[{value:y,label:y}]}),(0,Z.jsx)(Xt,{icon:(0,Z.jsx)(Ie,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`follow-up-model-pill`,ariaLabel:`Model`,label:M,value:te,readOnly:O,disabledHint:`Model selection is locked to native coding-agent settings.`,onPick:e=>{s(e);let t=Gt(e,D.data);j!==``&&qt(j,t)===``&&u(``)},options:A.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:on(y,E.data,D)}),(0,Z.jsx)(Xt,{icon:(0,Z.jsx)(Oe,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`follow-up-effort-pill`,ariaLabel:`Effort`,label:re,value:j,readOnly:O,disabledHint:`Effort selection is locked to native coding-agent settings.`,onPick:e=>u(e),options:ne.map(e=>({value:e.value,label:e.label,desc:e.desc}))})]})}),continueWith:(e,t)=>P.mutateAsync({text:e,images:t})}}var Ri=120,zi=e=>e!==`pending`&&e!==`running`,Bi=e=>e.kind===`tool`&&e.toolKind===`task`,Vi=e=>Bi(e)&&e.parentItemId===void 0,Hi=e=>or(e.kind)&&!(e.kind===`tool`&&e.toolKind===`plan`);function Ui(e){let t=e.input;if(typeof t!=`object`||!t)return;let n=t;for(let e of[`subagent_type`,`subagentType`,`agent`]){let t=n[e];if(typeof t==`string`&&t.trim()!==``)return t.trim()}}function Wi(e){if(e.kind===`tool`)return Gi(e.title);if(e.kind===`hook`)return Gi(`${e.event} hook${e.status===`completed`?``:` ${e.status}`}`);if(e.kind===`message`||e.kind===`reasoning`){let t=e.text.split(`
6
- `);for(let e=t.length-1;e>=0;--e){let n=t[e].trim();if(n!==``)return Gi(n)}}}function Gi(e){return e.length>Ri?`${e.slice(0,Ri-1).trimEnd()}…`:e}function Ki(e,t=!1,n=e){let r=Xi(e,e=>e.items.some(Vi));if(r===-1)return[];let i=e=>!t&&!zi(e.status),a=e=>i(e)&&e.background===!0,o=[],s=!1;for(let t=r-1;t>=0;--t){let n=e[t].items.filter(Vi);n.length!==0&&(!s&&!n.some(i)&&(s=!0),(!s||n.some(a))&&o.unshift(...n))}let c=[...o,...e[r].items.filter(Vi)];return r!==e.length-1&&!c.some(i)?[]:c.map(r=>qi(r,ea(n,e,r.id),t))}function qi(e,t,n){let r={id:e.id,title:mr(e.title).detail??e.title,status:e.status,toolCalls:t.filter(e=>e.kind===`tool`).length},i=Ui(e);i!==void 0&&(r.agentType=i),n&&!zi(e.status)&&(r.stalled=!0);for(let e=t.length-1;e>=0;--e){let n=Wi(t[e]);if(n!==void 0){r.activity=n;break}}return r}function Ji(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.length}}function Yi(e){return e.activity??(e.stalled===!0?`never finished`:`starting…`)}function Xi(e,t){for(let n=e.length-1;n>=0;--n)if(t(e[n]))return n;return-1}function Zi(e,t,n=!1,r=e){for(let i=e.length-1;i>=0;--i){let a=e[i].items.find(e=>e.id===t&&Vi(e));if(a!==void 0)return qi(a,ea(r,e,t),n)}}function Qi(e,t){return Xi(e,e=>e.items.some(e=>e.id===t&&Vi(e)))}function $i(e,t,n){let r=[];for(let i=n;i<e.length;i+=1){let n=e[i];for(let e of n.items)Hi(e)&&e.parentItemId===t&&e.id!==t&&r.push({entry:e,seqs:n.itemSeqs?.get(e.id)})}return r}function ea(e,t,n){let r=Qi(t,n);if(r===-1)return[];let i=$i(t,n,r);if(e===t)return i.map(({entry:e})=>e);let a=t[r].itemSeqs?.get(n)?.first,o=e=>a===void 0||e.seqs===void 0||e.seqs.first>a,s=new Map;for(let t of $i(e,n,Math.max(Qi(e,n),0)))o(t)&&!s.has(t.entry.id)&&s.set(t.entry.id,t);for(let e of i){let t=s.get(e.entry.id);s.set(e.entry.id,t===void 0?e:ta(t,e))}return[...s.values()].sort(na).map(({entry:e})=>e)}function ta(e,t){return e.seqs===void 0||t.seqs===void 0?e:{entry:(t.seqs.last>e.seqs.last?t:e).entry,seqs:{first:Math.min(e.seqs.first,t.seqs.first),last:Math.max(e.seqs.last,t.seqs.last)}}}function na(e,t){return e.seqs===void 0||t.seqs===void 0?0:e.seqs.first-t.seqs.first}function ra(e,t){if(e.kind===`entry`){let n=e.entry;return n.kind===`message`&&n.role===`assistant`?[{messageKey:`${t}:${n.id}`,text:n.text}]:[]}return e.kind===`tool-card`?gr(e.children).flatMap(n=>ra(n,`${t}:${e.id}`)):e.kind===`streak`?e.blocks.flatMap(e=>ra(e,t)):[]}function ia(e){return e.flatMap((e,t)=>e.content.kind===`block`?ra(e.content.block,e.scope).map(n=>({...n,rowKey:e.key,rowIndex:t})):[])}function aa(e,t,n,r){let i=(0,X.useContext)(Sn),{projectId:a}=ue(),o=(0,X.useMemo)(()=>ia(t),[t]);(0,X.useLayoutEffect)(()=>{if(!i)return;let t=[],s={runId:e,...a?{projectId:a}:{}};for(let e of o){let a=tr(e.text,s);for(let e of a)t.push(i.register(e.artifactId,e.runId));r===`document`&&a.length>0&&t.push(i.registerOpener(e.messageKey,(t,r)=>{let i=nr(e.messageKey,t);n.jumpToRow(e.rowKey,e.rowIndex,e=>[...e.querySelectorAll(`[id]`)].find(e=>e.id===i)??null,r)}))}return()=>{for(let e of t)e()}},[i,o,e,a,r,n.jumpToRow])}function oa(e){let t=h();return z({mutationFn:t=>x(e,t),retry:!1,networkMode:`always`,onSettled:()=>{t.invalidateQueries({queryKey:E.runs.all})}})}var sa=e=>(window.addEventListener(`online`,e),window.addEventListener(`offline`,e),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,e)}),ca=()=>navigator.onLine;function la({permission:e,runId:t,sessionOpen:n=!1}){return e.status!==`pending`||!n?(0,Z.jsx)(da,{permission:e,state:e.status===`resolved`?`resolved`:`expired`}):(0,Z.jsx)(ua,{permission:e,runId:t},e.requestId)}function ua({permission:e,runId:t}){let n=oa(t),r=(0,X.useSyncExternalStore)(sa,ca,()=>!1),i=(0,X.useRef)(!1),[a,o]=(0,X.useState)(`pending`),[s,l]=(0,X.useState)(),[u,d]=(0,X.useState)(),f=async t=>{if(!(i.current||!r||a!==`pending`)){i.current=!0,o(`sending`),d(void 0);try{await n.mutateAsync({requestId:e.requestId,optionId:t}),l(t),o(`resolved`)}catch(e){e instanceof c&&e.status===409?o(`expired`):(d(e instanceof Error?e.message:String(e)),o(`pending`))}finally{i.current=!1}}};return(0,Z.jsx)(da,{permission:{...e,...s===void 0?{}:{optionId:s}},state:a,offline:!r,error:u,onSelect:e=>{f(e)}})}function da({permission:e,state:t,offline:n=!1,error:r,onSelect:i}){let a=(0,X.useId)(),o=e.options.find(t=>t.id===e.optionId),s=t!==`pending`||n||!i,c=t===`expired`?`Approval expired. This session can no longer accept a decision.`:t===`resolved`?`Decision sent: ${o?.label??`Recorded`}.`:t===`sending`?`Sending decision…`:n?`Offline. Reconnect to send a decision.`:`Choose an option to respond to this permission request.`;return(0,Z.jsxs)(`section`,{"data-slot":`permission-card`,"data-request-id":e.requestId,"data-state":n&&t===`pending`?`offline`:t,"aria-labelledby":a,"aria-busy":t===`sending`,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 text-sm [overflow-wrap:anywhere]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Permission request`}),(0,Z.jsx)(`h3`,{id:a,className:`font-semibold whitespace-pre-wrap`,children:e.title})]}),e.details?(0,Z.jsx)(`pre`,{className:`min-w-0 font-mono text-xs leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.details}):null,(0,Z.jsx)(`div`,{role:`group`,"aria-labelledby":a,className:`flex min-w-0 flex-col gap-2`,children:e.options.map(t=>(0,Z.jsx)(W,{type:`button`,variant:`outline`,disabled:s,"aria-pressed":e.optionId===t.id,className:`h-auto min-h-11 min-w-0 max-w-full justify-start py-2 text-start whitespace-normal [overflow-wrap:anywhere] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,onClick:()=>i?.(t.id),children:t.label},t.id))}),(0,Z.jsxs)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:[c,e.reason?` ${e.reason}`:``]}),r&&t===`pending`?(0,Z.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:r}):null]})}function fa(e,t){if(e.length===1)return[t.replace(RegExp(`^${pa(e[0].header)}: ?`),``)];let n=t,r=[];for(let[t,i]of e.entries()){let a=`${i.header}: `;if(!n.startsWith(a))return;n=n.slice(a.length);let o=e[t+1],s=o?n.indexOf(`\n${o.header}: `):n.length;if(s<0)return;r.push(n.slice(0,s)),n=n.slice(s+1)}return r}function pa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ma(e,t){if(t===void 0)return[];let n=e.options??[];if(!e.multiSelect)return n.filter(e=>e.label===t).map(e=>e.label);let r=[];function i(e,t){for(let{label:a}of n)t.includes(a)||(e===a?r.push([...t,a]):e.startsWith(`${a}, `)&&i(e.slice(a.length+2),[...t,a]))}return i(t,[]),r.length===1?r[0]:[]}function ha({ask:e}){let t=e.answer===void 0?void 0:fa(e.questions,e.answer);return(0,Z.jsxs)(`div`,{"data-slot":`ask-answers`,className:`flex flex-col gap-4 text-sm`,children:[e.questions.map((n,r)=>{let i=t?.[r],a=ma(n,i),o=i!==void 0&&a.length===0;return(0,Z.jsxs)(`section`,{className:`flex flex-col gap-2`,"aria-label":n.question,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[n.header,` · Question `,r+1,` of `,e.questions.length]}),(0,Z.jsx)(`p`,{className:`break-words font-semibold`,children:n.question}),n.options?(0,Z.jsxs)(`ul`,{className:`flex list-none flex-col gap-1.5`,children:[n.options.map(e=>(0,Z.jsxs)(`li`,{"data-selected":a.includes(e.label),className:`flex items-start gap-2 rounded-md border border-border px-3 py-2 data-[selected=true]:border-message-user-border data-[selected=true]:bg-message-user-accent/5`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-message-user-accent`,children:a.includes(e.label)?`✓`:`○`}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 break-words`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description?(0,Z.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description}):null]}),a.includes(e.label)?(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-message-user-accent`,children:`Selected`}):null]},e.label)),(0,Z.jsxs)(`li`,{"data-selected":o,className:`rounded-md border border-border px-3 py-2 data-[selected=true]:border-message-user-border`,children:[(0,Z.jsxs)(`p`,{className:`flex items-start gap-2 font-medium`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`text-message-user-accent`,children:o?`✓`:`○`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Other`}),o?(0,Z.jsx)(`span`,{className:`text-xs text-message-user-accent`,children:`Selected`}):null]}),o?(0,Z.jsx)(ga,{text:i}):null]})]}):i===void 0?null:(0,Z.jsx)(ga,{text:i})]},n.id??r)}),!t&&e.answer!==void 0?(0,Z.jsx)(ga,{text:e.answer}):null]})}function ga({text:e}){return(0,Z.jsx)(`blockquote`,{className:`[margin-block-start:0.5rem] border-s-2 border-message-user-accent ps-3 break-words whitespace-pre-wrap`,children:e})}var _a=(0,X.createContext)({targets:new Map,replies:new Map,navigate:()=>{}});function va(e,t){let n={};for(let e of t??[])n[e.id]=e.currentStepBackend??e.runner;return n[e.id]=e.steps.find(t=>t.id===e.currentStepId)?.backend??e.runner,n}function ya(e,t,n=[]){let r={};for(let e of n)r[e.id]=Y(e);for(let e of t??[])r[e.id]=Y(e);return r[e.id]=Y(e),r}function ba(e,t){return t?.[e]??`Task`}function xa(e,t,n){return t?n?.[e]??`peer task`:ba(e,n)}function Sa(e,t){return e.senderRunId===t?`outbound`:`inbound`}function Ca(e){return e?.relationship===`peer`}function wa(e){switch(e){case`request`:return`Request`;case`progress`:return`Progress`;case`follow-up`:return`Follow-up`;case`reply`:return`Reply`}}function Ta(e){switch(e){case`pending`:return`Pending`;case`replied`:return`Replied`;case`replied-late`:return`Replied late`;case`timed-out`:return`Timed out`;case`cancelled`:return`Cancelled`;case`completed-without-reply`:return`Completed without reply`;case`failed`:return`Failed`;case`destroyed`:return`Destroyed`;case`sender-closed`:return`Sender closed`;case`human-fallback`:return`Sent to a human`;case`deleted`:return`Recipient deleted`}}function Ea(e){if(e.outcome)return Ta(e.outcome.status);if(e.delivery===`not-delivered`)return Da(`not-delivered`)}function Da(e){switch(e){case`queued`:return`Queued`;case`delivered`:return`Delivered`;case`consumed`:return`Read`;case`not-delivered`:return`Not delivered`}}function Oa(e,t){return e.instruction===void 0?e.delivery===`queued`?`${t?`Queued for delivery. This agent can receive messages during its current turn.`:`Queued for delivery. Timing depends on the recipient agent.`} Pending messages are batched within the size limit; human questions and scheduler capacity can delay delivery.`:e.state===`continuation-required`?Ca(e)?`Not delivered. The recipient is not running. Only its human can continue it.`:`Not delivered. The recipient needs a new instruction to resume. A parent can resume its owned worker with ${vn()} worker resume; workers cannot resume parents.`:e.state===`destroyed`?`Not delivered. This worker was destroyed.`:void 0:e.instruction}function ka({id:e,peer:t,taskTitles:n,children:r}){return!t||n?.[e]!==void 0?r({title:ba(e,n),linkable:!0}):(0,Z.jsx)(Aa,{id:e,children:r})}function Aa({id:e,children:t}){let n=j(e);return n.data?t({title:Y(n.data),linkable:!0}):n.isPending?t({title:`Peer task`,linkable:!1}):t({title:n.error instanceof c&&n.error.status===404?`Deleted task`:`Task unavailable`,linkable:!1})}var ja={outbound:{classes:`border-message-outbound-border bg-message-outbound-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-outbound-accent`,accent:`text-message-outbound-accent`},inbound:{classes:`border-message-inbound-border bg-message-inbound-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-inbound-accent`,accent:`text-message-inbound-accent`},peer:{classes:`border-message-peer-border bg-message-peer-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-peer-accent`,accent:`text-message-peer-accent`}},Ma=`inline-flex min-h-11 max-w-full items-center break-words underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`;function Na({block:e,runId:t,taskTitles:n,recipientBackends:r}){return(0,Z.jsx)(`div`,{"data-slot":`worker-conversation`,className:`flex min-w-0 flex-col gap-2`,children:e.batches.map(e=>(0,Z.jsx)(Pa,{batch:e,runId:t,taskTitles:n,recipientBackends:r},e.id))})}function Pa({batch:e,runId:t,taskTitles:n,recipientBackends:r}){let i=Sa(e.messages[0]??{senderRunId:e.senderRunId},t),a=Ca(e.messages[0]),s=ja[a?`peer`:i],c=Ua(e.messages.map(e=>i===`outbound`?e.recipientRunId:e.senderRunId)),l=i===`outbound`?`SENT to`:`RECEIVED from`,u=`${l} ${c.map(e=>xa(e,a,n)).join(`, `)}`,d=e.messages[0],f=d?.createdAt??d?.recordedAt;return(0,Z.jsxs)(`article`,{"data-slot":`worker-conversation-card`,"data-direction":i,"data-relationship":a?`peer`:`family`,"data-kind":e.kind,className:o(`flex w-full min-w-0 flex-col gap-2 rounded-[8px] border p-3 md:px-4 md:py-[14px]`,s.classes),children:[(0,Z.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`p`,{className:o(`m-0 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] leading-[1.2] font-semibold tracking-[0.6px] uppercase`,s.accent),children:[(0,Z.jsx)(`span`,{children:l}),c.map((e,t)=>(0,Z.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-x-2 normal-case tracking-normal`,children:[t>0?(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`,`}):null,(0,Z.jsx)(ka,{id:e,peer:a,taskTitles:n,children:t=>(0,Z.jsx)(za,{view:t,to:`/tasks/${e}`,label:`${l} ${t.title}`})})]},e))]}),a?(0,Z.jsx)(`span`,{"data-slot":`conversation-relationship`,className:`rounded-full border border-message-peer-border px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-foreground uppercase`,children:`Peer`}):null,(0,Z.jsx)(`span`,{"data-slot":`conversation-kind`,className:`rounded-full bg-background/60 px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-foreground uppercase`,children:wa(e.kind)}),e.messages.length===1&&d?(0,Z.jsx)(Ia,{message:d}):null]}),(0,Z.jsx)(Fa,{at:f,className:`flex shrink-0 items-center justify-self-end gap-1 whitespace-nowrap text-[11px] text-soft-foreground`,children:e.messages.length>1?`First sent`:null})]}),(0,Z.jsx)(Ra,{batch:e},`${t}:${d?.messageId??e.id}`),[...new Set(e.messages.map(e=>Oa(e,r?.[e.recipientRunId])))].map(e=>e?(0,Z.jsx)(`p`,{"data-slot":`conversation-delivery-explanation`,className:`min-w-0 text-xs leading-relaxed text-muted-foreground [overflow-wrap:anywhere]`,children:e},e):null),e.kind===`request`&&e.messages.length>1?(0,Z.jsx)(La,{messages:e.messages,peer:a,runId:t,taskTitles:n}):null,e.messages.length===1&&d?(0,Z.jsx)(Ba,{message:d,runId:t,taskTitles:n}):null,(0,Z.jsx)(Va,{batch:e,heading:u})]})}function Fa({at:e,className:t,children:n}){return e===void 0||Br(e)===void 0?null:(0,Z.jsxs)(`span`,{className:t,children:[n,(0,Z.jsx)(Kr,{ts:e})]})}function Ia({message:e}){let t=Ea(e),n=Da(e.delivery),r=(e.messageKind===`request`||e.messageKind===`reply`)&&n!==t;return(0,Z.jsxs)(Z.Fragment,{children:[t?(0,Z.jsx)(`span`,{"data-slot":`conversation-outcome`,className:`text-xs font-medium text-muted-foreground`,children:t}):null,r?(0,Z.jsx)(`span`,{"data-slot":`conversation-delivery`,className:`text-xs text-muted-foreground`,children:n}):null]})}function La({messages:e,peer:t,runId:n,taskTitles:r}){return(0,Z.jsx)(`ul`,{className:`grid min-w-0 gap-1 text-xs text-muted-foreground`,children:e.map(e=>{let i=Ea(e),a=e.createdAt??e.recordedAt;return(0,Z.jsxs)(`li`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2`,children:[(0,Z.jsx)(ka,{id:e.recipientRunId,peer:t,taskTitles:r,children:t=>(0,Z.jsx)(za,{view:t,to:`/tasks/${e.recipientRunId}`,label:`${t.title}${i?` — ${i}`:``}`})}),i?(0,Z.jsx)(`span`,{"data-slot":`conversation-outcome`,children:i}):null,Da(e.delivery)===i?null:(0,Z.jsx)(`span`,{"data-slot":`conversation-delivery`,children:Da(e.delivery)}),(0,Z.jsx)(Ba,{message:e,runId:n,taskTitles:r}),(0,Z.jsx)(Fa,{at:a,className:`ml-auto whitespace-nowrap`})]},e.id)})})}function Ra({batch:e}){let t=xr(),n=`conversation-body:${e.messages[0]?.messageId??e.id}`,[r,i]=(0,X.useState)(()=>t?.get(n)??!1),a=(0,Z.jsx)(`div`,{className:`min-w-0 break-words text-[14px] leading-[1.6] text-foreground select-text [overflow-wrap:anywhere]`,children:(0,Z.jsx)(jn,{breaks:!0,children:e.text})});return e.kind!==`request`&&e.kind!==`reply`?a:(0,Z.jsxs)(q,{"data-slot":`conversation-body`,open:r,onOpenChange:e=>{t?.set(n,e),i(e)},className:`min-w-0`,children:[(0,Z.jsxs)(K,{type:`button`,"data-slot":`conversation-body-toggle`,className:`group/body inline-flex min-h-11 min-w-11 items-center gap-1.5 rounded-md px-2 text-start text-xs font-medium text-muted-foreground [@media(hover:hover)_and_(pointer:fine)]:hover:bg-background/40 [@media(hover:hover)_and_(pointer:fine)]:hover:text-foreground active:bg-background/60 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:`size-3.5 shrink-0 group-data-[state=open]/body:rotate-90`}),r?`Hide message`:`Show message`]}),(0,Z.jsx)(G,{children:a})]})}function za({view:e,to:t,label:n}){return e.linkable?(0,Z.jsx)(J,{className:Ma,to:t,"aria-label":n,children:e.title}):(0,Z.jsx)(`span`,{"data-slot":`conversation-counterpart`,children:e.title})}function Ba({message:e,runId:t,taskTitles:n}){let{targets:r,replies:i,navigate:a}=(0,X.useContext)(_a),s=e.requestId?r.get(e.requestId):void 0,c=e.requestId?s?[s]:[]:i.get(e.messageId)??[],l=e.requestId?`request`:`reply`;return c.length===0?e.requestId||e.outcome?.replyId?(0,Z.jsxs)(`p`,{"data-slot":`conversation-connector`,className:`text-xs text-muted-foreground`,children:[`Linked `,l,` is outside loaded history.`]}):null:c.map(e=>{let r=Sa(e.message,t)===`outbound`,i=r?e.message.recipientRunId:e.message.senderRunId;return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`conversation-connector`,className:o(Ma,`w-fit gap-1.5 text-xs text-muted-foreground`),onClick:()=>a(e),children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`↗`}),(0,Z.jsx)(ka,{id:i,peer:Ca(e.message),taskTitles:n,children:e=>(0,Z.jsxs)(Z.Fragment,{children:[`View `,l,` `,r?`to`:`from`,` `,e.title]})})]},e.message.messageId)})}function Va({batch:e,heading:t}){return(0,Z.jsxs)(q,{"data-slot":`conversation-details`,className:`group/details`,children:[(0,Z.jsxs)(K,{type:`button`,className:`inline-flex min-h-11 min-w-11 items-center gap-1.5 rounded-md px-2 text-left text-xs font-medium text-muted-foreground hover:bg-background/40 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:[(0,Z.jsx)(U,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]/details:rotate-90`}),`Details`]}),(0,Z.jsx)(G,{children:(0,Z.jsxs)(`dl`,{className:`grid min-w-0 gap-1 break-all px-2 pb-1 font-mono text-[11px] text-muted-foreground`,children:[(0,Z.jsx)(`div`,{className:`sr-only`,children:t}),e.messages.flatMap(e=>Ha(e)).map((e,t)=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`dt`,{className:`inline font-sans font-medium text-soft-foreground`,children:[e.label,`: `]}),(0,Z.jsx)(`dd`,{className:`inline`,children:e.value})]},`${e.label}:${e.value}:${t}`))]})})]})}function Ha(e){let t=[{label:`Message`,value:e.messageId},{label:`Sender`,value:e.senderRunId},{label:`Recipient`,value:e.recipientRunId},...Ca(e)?[{label:`Relationship`,value:`peer`}]:[],{label:`Delivery`,value:Da(e.delivery)}];return e.requestId&&t.push({label:`Request`,value:e.requestId}),e.outcome?.replyId&&t.push({label:`Reply`,value:e.outcome.replyId}),e.state&&t.push({label:`State`,value:e.state}),e.createdAt&&t.push({label:`Created`,value:e.createdAt}),e.deliveredAt&&t.push({label:e.resumed?`Opening turn completed`:`Delivery acknowledged`,value:e.deliveredAt}),e.recordedAt&&t.push({label:`Event recorded`,value:e.recordedAt}),e.resumed&&t.push({label:`Continuation`,value:`Requested by parent with this instruction`}),e.deadline&&t.push({label:`Deadline`,value:e.deadline}),e.requestHash&&t.push({label:`Hash`,value:e.requestHash}),t}function Ua(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var Wa=e(n(),1),Ga=`pending-ask`;function Ka(e){return e.querySelector(`[data-slot="ask-question"] :is(button, textarea):not(:disabled)`)||(e.tabIndex=-1,e)}function qa(e){let t=e.querySelector(`[data-slot="ask-card"][data-pinned="true"]`);return t?Ka(t):null}function Ja(e,t){let n=`${Ga}:${e}`;return e=>{if(!t())return!1;let r=[...e.querySelectorAll(`[data-row-key]`)].find(e=>e.dataset.rowKey===n);return r?qa(r):null}}function Ya(e){return e<=0?`Jump to latest`:`Jump to latest (${e} ${e===1?`question`:`questions`} pending)`}function Xa({onGoToQuestion:e}){return(0,Z.jsxs)(`div`,{"data-slot":`ask-origin`,className:`flex flex-wrap items-center gap-x-2 rounded-lg border border-dashed border-accent-strong/40 px-3.5 py-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-link-foreground`,children:`Question asked here`}),(0,Z.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`ask-go-to-question`,className:`min-h-11 min-w-11 px-2 text-foreground underline underline-offset-4`,onClick:e,children:`Go to the question`})]})}var Za={viewKey:void 0,generation:0},Qa=600,$a=24;function eo(e,t={}){let{surface:n=`document`,onLoadOlder:r,onJumpToLatest:i,rowKeys:a=[]}=t,o=(0,X.useRef)(e);o.current=e;let c=(0,X.useRef)(null),[l,u]=(0,X.useState)(null),[d,f]=(0,X.useState)(!1),p=(0,X.useRef)(!0),m=(0,X.useRef)(0),h=(0,X.useRef)(0),g=(0,X.useRef)(new Set),_=(0,X.useCallback)(e=>{for(let t of[...g.current])t(e)},[]),v=(0,X.useCallback)(e=>(g.current.add(e),()=>{g.current.delete(e)}),[]),y=(0,X.useRef)(null),b=(0,X.useRef)(null),x=(0,X.useRef)(null),S=(0,X.useRef)(null),C=(0,X.useCallback)(e=>{let t=c.current;if(!t)return;let n=S.current;n?n.scrollTo(e):t.scrollTop=e},[]),w=(0,X.useCallback)(()=>{let e=c.current;e&&C(e.scrollHeight-e.clientHeight)},[C]),T=(0,X.useCallback)(()=>{if(c.current){if(x.current!==e){x.current=e;let t=Ar(e);t&&!t.atBottom?(p.current=!1,y.current=t.top,b.current=Nr(e)?.rowKeys?{viewKey:e,top:t.top}:null):(p.current=!0,y.current=null,b.current=null)}y.current===null?p.current&&w():C(y.current)}},[e,C,w]),E=(0,X.useCallback)(e=>b.current?.viewKey===e,[]),D=(0,X.useCallback)(e=>{let t=b.current;return!t||!E(e)||e!==o.current?!1:(y.current=t.top,p.current=!1,b.current=null,!0)},[E]),O=(0,X.useCallback)(e=>{u(e),e&&(c.current=e.closest(n===`panel`?`[data-slot="transcript-viewport"]`:`[data-slot="main"]`),T())},[n,T]),ee=(0,X.useCallback)(()=>{p.current&&w()},[w]),k=(0,X.useRef)(!1),A=(0,X.useRef)(0),te=(0,X.useRef)(!1),ne=(0,X.useRef)(void 0),j=(0,X.useRef)(!1),M=(0,X.useRef)(!1),N=(0,X.useRef)(a);N.current=a;let re=(0,X.useCallback)(e=>[...e.querySelectorAll(`[data-slot="thread-row"][data-row-key]`)].map(e=>{let t=e.getBoundingClientRect();return{key:e.dataset.rowKey,top:t.top,bottom:t.bottom}}),[]),P=(0,X.useRef)(null),F=(0,X.useRef)(0);(0,X.useEffect)(()=>{if(!s())return;let e=e=>{y.current=null,b.current=null,F.current+=1,P.current=null,p.current=!1,C(e)};return window.__cezThreadScrollTo=e,()=>{window.__cezThreadScrollTo===e&&delete window.__cezThreadScrollTo}},[C]);let ie=(0,X.useCallback)(()=>{let e=P.current,t=c.current;if(!e||!t)return;P.current=null;let n=e.beforeTop+Math.max(0,t.scrollHeight-e.beforeHeight),r=t.getBoundingClientRect().top,i=e.anchor===void 0?-1:N.current.indexOf(e.anchor.key),a=S.current;a&&i>=0?a.scrollToIndex(i,{align:`start`,offset:-e.anchor.offset}):C(Tr(t.scrollTop,r,e.anchor,re(t),n))},[re,C]),I=(0,X.useCallback)(()=>{let e=c.current;if(!e||!r||k.current)return;y.current=null,b.current=null,p.current=!1,k.current=!0;let t=A.current+1;A.current=t;let n=e.scrollHeight,i=e.scrollTop,a=e.getBoundingClientRect().top,s=wr(a,re(e)),l=s===void 0?-1:N.current.indexOf(s.key),u=o.current,d=F.current;r().then(()=>{o.current===u&&F.current===d&&(P.current={beforeHeight:n,beforeTop:i,anchor:s,anchorIndex:l})},()=>{}).finally(()=>{A.current===t&&(k.current=!1)})},[re,r]);(0,X.useEffect)(()=>()=>clearTimeout(ne.current),[]);let L=(0,X.useRef)(null),ae=(0,X.useRef)(0),R=(0,X.useCallback)(()=>n===`document`?++Za.generation:++ae.current,[n]),z=(0,X.useCallback)((e,t)=>n===`document`?Za.viewKey===e&&Za.generation===t:o.current===e&&ae.current===t,[n]);(0,X.useEffect)(()=>()=>L.current?.disconnect(),[e,l]);let oe=(0,X.useCallback)((t,n,r,i)=>{let a=c.current;if(!a||!l)return;y.current=null,b.current=null,F.current+=1,P.current=null,p.current=!1,m.current=0,f(!0),R(),L.current?.disconnect();let o=()=>[...l.querySelectorAll(`[data-row-key]`)].find(e=>e.dataset.rowKey===t),s=()=>{let e=o();if(!e||getComputedStyle(e).visibility===`hidden`)return!1;let t=r?.(e)??e;return t===e&&(e.tabIndex=-1),t.focus({preventScroll:!0}),document.activeElement===t?(L.current?.disconnect(),!0):!1},u=a.querySelector(`[data-slot="run-header"]`),d=u&&getComputedStyle(u).position===`sticky`?u.getBoundingClientRect().height:0,h=S.current;if(i!==void 0)C(i);else if(h)h.scrollToIndex(n,{align:`start`,...d>0?{offset:-d}:{}});else{let e=o();e&&C(a.scrollTop+e.getBoundingClientRect().top-a.getBoundingClientRect().top-d)}s()||(L.current=new MutationObserver(()=>{s()}),L.current.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`,`class`]})),kr(e,{top:i??a.scrollTop,atBottom:!1})},[l,C,e,R]),B=(0,X.useCallback)(t=>{let n=R(),r=o.current;L.current?.disconnect();let a=c.current;if(!a)return;y.current=null,b.current=null,F.current+=1,P.current=null,p.current=!0,h.current=0,_({direction:`tail`}),kr(e,{top:a.scrollHeight-a.clientHeight,atBottom:!0});let s=()=>{p.current&&w()},l=()=>z(r,n),u=()=>{let e=t?.(a);return e===!1?!0:e?(e.focus({preventScroll:!0}),document.activeElement===e):!1};(i?.()??Promise.resolve()).finally(()=>{requestAnimationFrame(()=>{s(),requestAnimationFrame(()=>{if(s(),!t||!l()||u())return;L.current?.disconnect();let e=new MutationObserver(()=>{l()?u()&&e.disconnect():e.disconnect()});L.current=e,e.observe(a,{childList:!0,subtree:!0})})})})},[i,e,w,R,z,_]),se=a.at(-1),ce=a.length;return(0,X.useLayoutEffect)(()=>{F.current+=1,P.current=null,k.current=!1,n===`document`?Za.viewKey!==e&&(Za.viewKey=e,Za.generation+=1):ae.current+=1},[e,n]),(0,X.useLayoutEffect)(()=>{let e=P.current;e?(e.anchor===void 0?-1:N.current.indexOf(e.anchor.key))>e.anchorIndex?ie():P.current=null:p.current&&w()},[se,ce,ie,w]),(0,X.useLayoutEffect)(()=>{!c.current||!l||T()},[l,T]),(0,X.useEffect)(()=>{let t=c.current,n=l;if(!t||!n)return;m.current=0;let r=null,i=!1,a=t.scrollTop,o,s=0,u,d=e=>{h.current=Date.now(),u=e},g=()=>{R(),L.current?.disconnect(),y.current=null,b.current=null,F.current+=1,P.current=null,p.current=!1,m.current=0},v=()=>{y.current=null,b.current=null,F.current+=1,P.current=null,m.current=Date.now()},x=e=>{if(e.deltaY!==0)if(d(e.deltaY<0?`up`:`down`),e.deltaY<0){g();let e=!te.current;te.current=!0,clearTimeout(ne.current),ne.current=setTimeout(()=>{te.current=!1},180),e&&Cr(t)&&I()}else v()},S=e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)?(d(`up`),g(),!e.repeat&&Cr(t)&&I()):[`ArrowDown`,`PageDown`,`End`].includes(e.key)&&(d(`down`),v())},T=e=>{if(e.target!==t||e.button!==0||e.pointerType===`touch`||e.pointerType===`pen`||t.scrollHeight<=t.clientHeight)return;i=!0,M.current=!1,a=t.scrollTop;let n=t.getBoundingClientRect(),r=getComputedStyle(t),o=parseFloat(r.borderLeftWidth)||0,s=parseFloat(r.borderRightWidth)||0,c=n.left+t.clientLeft,l=c+t.clientWidth;!(e.clientX>=n.left+o&&e.clientX<c||e.clientX>=l&&e.clientX<n.right-s)||e.clientY<n.top+t.clientTop||e.clientY>=n.top+t.clientTop+t.clientHeight||(y.current=null,b.current=null,Er(t,80)||(g(),v()))},D=()=>{i=!1},O=e=>{j.current=!1,r=e.touches[0]?.clientY??null},ee=e=>{let n=e.touches[0]?.clientY;n!==void 0&&(r!==null&&n>r+1?(d(`up`),g(),!j.current&&Cr(t)&&(j.current=!0,I())):r!==null&&n<r-1&&(d(`down`),v()),r=n)},k=e=>{if(e===0||!i&&Date.now()-h.current>=Qa)return;let n=e<0?`up`:`down`;!i&&n!==u||(n!==o&&(o=n,s=0),s+=Math.abs(e),s>=$a&&(0,Wa.flushSync)(()=>_({direction:n,distanceFromBottom:t.scrollHeight-t.clientHeight-t.scrollTop})))},A=()=>{let n=p.current;k(t.scrollTop-a),i&&t.scrollTop!==a&&(t.scrollTop<a?g():v()),i&&!M.current&&t.scrollTop<a&&Cr(t)&&(M.current=!0,I()),a=t.scrollTop;let r=Er(t,80);r&&y.current===null&&(p.current||Date.now()-m.current<2e3)&&(p.current=!0),!n&&p.current&&_({direction:`tail`}),f(!r),y.current===null&&!E(e)&&kr(e,{top:t.scrollTop,atBottom:r})};t.addEventListener(`scroll`,A,{passive:!0}),t.addEventListener(`wheel`,x,{passive:!0}),t.addEventListener(`touchstart`,O,{passive:!0}),t.addEventListener(`touchmove`,ee,{passive:!0}),t.addEventListener(`pointerdown`,T,{passive:!0}),window.addEventListener(`pointerup`,D,{passive:!0}),window.addEventListener(`pointercancel`,D,{passive:!0}),t.addEventListener(`keydown`,S);let N;if(typeof ResizeObserver<`u`){N=new ResizeObserver(()=>{let e=y.current;if(e!==null){let n=t.scrollHeight-t.clientHeight;C(Math.min(e,n)),n>=e&&(y.current=null)}else p.current&&w()}),N.observe(n);let e=n.closest(`[data-route="task-thread"]`),r=e?.querySelector(`[data-slot="run-header"]`),i=e?.querySelector(`[data-slot="thread-dock"]`);r&&N.observe(r),i&&N.observe(i)}return()=>{t.removeEventListener(`scroll`,A),t.removeEventListener(`wheel`,x),t.removeEventListener(`touchstart`,O),t.removeEventListener(`touchmove`,ee),t.removeEventListener(`pointerdown`,T),window.removeEventListener(`pointerup`,D),window.removeEventListener(`pointercancel`,D),t.removeEventListener(`keydown`,S),N?.disconnect()}},[e,l,I,C,w,E,R,_]),{attachContent:O,scrollElRef:c,virtualizerRef:S,restoreMeasurements:D,ownsMeasurementRestore:E,pillVisible:d,jumpToLatest:B,jumpToRow:oe,loadOlder:I,restickIfStuck:ee,subscribeReaderScroll:v}}function to({runId:e,rows:t,mode:n,controls:r}){return n===`virtual`?(0,Z.jsx)(no,{runId:e,rows:t,controls:r}):(0,Z.jsx)(`div`,{ref:r.attachContent,"data-slot":`thread-rows`,"data-virtualized":`false`,className:`[overflow-anchor:none]`,children:t.map(e=>(0,Z.jsx)(`div`,{"data-slot":`thread-row`,"data-row-key":e.key,className:`flex w-full flex-col pb-2.5 [contain-intrinsic-block-size:auto_3rem] [content-visibility:auto]`,children:e.node},e.key))})}function no({runId:e,rows:t,controls:n}){return(0,Z.jsx)(ro,{runId:e,rows:t,controls:n},e)}function ro({runId:e,rows:t,controls:n}){let r=(0,X.useRef)(null),i=(0,X.useRef)(t),a=t[0]?.key,o=i.current[0]?.key,s=a!==o&&(t.some(e=>e.key===o)||i.current.some(e=>e.key===a));(0,X.useLayoutEffect)(()=>{i.current=t},[t]);let[c]=(0,X.useState)(()=>Nr(e)),[l,u]=(0,X.useState)(()=>({cache:Pr(e,t.length,t.map(e=>e.key)),generation:0})),d=(0,X.useRef)(l.cache===void 0&&c?.rowKeys?.length===c?.rows&&c!==void 0);(0,X.useLayoutEffect)(()=>{let r=c?.rowKeys;if(!d.current){n.restoreMeasurements(e);return}if(!(!c||!r)){if(t.length>c.rows||t.some((e,t)=>e.key!==r[t])){d.current=!1,n.restoreMeasurements(e);return}t.length===c.rows&&(d.current=!1,n.restoreMeasurements(e)&&u({cache:c.cache,generation:1}))}},[c,t,n.restoreMeasurements,e]);let f=(0,X.useRef)(t.length);f.current=t.length;let p=(0,X.useRef)(t.map(e=>e.key));p.current=t.map(e=>e.key);let m=(0,X.useRef)(null),h=(0,X.useCallback)(t=>{n.virtualizerRef.current=t,t?m.current=t:m.current&&=(d.current&&c?.rowKeys&&f.current<c.rows&&n.ownsMeasurementRestore(e)||Mr(e,{rows:f.current,cache:m.current.cache,rowKeys:p.current}),null)},[e,n.virtualizerRef,n.ownsMeasurementRestore,c]),[g,_]=(0,X.useState)(0);return(0,X.useLayoutEffect)(()=>{let e=()=>{let e=r.current,t=n.scrollElRef.current;!e||!t||_(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n.scrollElRef]),(0,Z.jsx)(`div`,{ref:e=>{r.current=e,n.attachContent(e)},"data-slot":`thread-rows`,"data-virtualized":`true`,className:`[overflow-anchor:none]`,children:(0,Z.jsx)(hn,{ref:h,scrollRef:n.scrollElRef,startMargin:g,shift:s,...l.cache===void 0?{}:{cache:l.cache},children:t.map(e=>(0,Z.jsx)(`div`,{"data-slot":`thread-row`,"data-row-key":e.key,className:`flex w-full flex-col pb-2.5`,children:e.node},e.key))},l.generation)})}function io({onJump:e,pendingQuestions:t=0}){return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`jump-to-latest`,"data-pending-questions":t>0?t:void 0,onClick:()=>e(),className:`pointer-events-auto inline-flex min-h-11 min-w-11 items-center gap-1.5 rounded-full border border-border bg-background px-3.5 text-xs font-medium text-muted-foreground shadow-modal hover:text-foreground`,children:[(0,Z.jsx)(je,{"aria-hidden":!0,className:`size-3.5`}),Ya(t)]})}function ao(e){return e.consumedAt?`consumed`:e.deliveredAt?`delivered`:`queued`}function oo(e,t){let n=new Map((e.agentInputs??[]).map(e=>[e.id,ao(e)]));if(n.size===0)return t;let r=!1,i=t.map(e=>{if(e.kind!==`note`||!e.id.startsWith(`agent-input:`))return e;let t=n.get(e.id.slice(12));return!t||e.delivery===t?e:(r=!0,{...e,delivery:t})});return r?i:t}function so(e,t,n){return e.kind===`ask`?e.id===t?n===void 0?e:{...e,placement:`origin`}:e.resolved?e:{...e,resolved:!0}:e}var co=new WeakMap;function lo(e,t){let n=co.get(e);return n?.length===t.length&&t.every((e,t)=>{let r=n[t];return e===r||Object.keys(e).length===Object.keys(r).length&&Object.entries(e).every(([e,t])=>t===r[e])})?n:(co.set(e,t),t)}function uo(e,t,n=t,r){let i=r==null?void 0:n.turns.flatMap(e=>e.items).find(e=>e.kind===`ask`&&e.id===r&&!e.resolved),a=new Map(n.turns.flatMap(e=>e.items).filter(e=>e.kind===`permission`).map(e=>[e.requestId,e])),o=new Set,s=new Set(t.turns.map(e=>e.userMessage?.ask?.id)),c=[];e.task&&c.push({id:`task`,userMessageKey:`task`,userMessage:{text:e.task,images:e.taskImages??[],ts:e.createdAt},entries:[]});for(let t of e.queuedMessages??[])c.push({id:`queued:${t.id}`,userMessageKey:`queued:${t.id}`,userMessage:{text:t.text,images:t.images??[],ts:t.createdAt},inDaySequence:!1,entries:[]});for(let n of t.turns)c.push({id:n.id,userMessageKey:`${n.id}:user`,...n.userMessage===void 0?{}:{userMessage:{text:n.userMessage.text,ask:n.userMessage.ask,imageCount:n.userMessage.imageCount,images:n.userMessage.images,...n.userMessage.ts===void 0?{}:{ts:n.userMessage.ts}}},...n.startedAt===void 0?{}:{startedAt:n.startedAt},...n.completed?.ts===void 0?{}:{completedAt:n.completed.ts},entries:lo(n.items,oo(e,n.items.filter(t=>!e.task||!dt(t,`opening`)).map(e=>e.kind===`ask`&&s.has(e.id)?{...e,placement:`origin`}:r!==void 0&&e.kind===`ask`?so(e,r,i):e.kind===`permission`?(o.add(e.requestId),a.get(e.requestId)??(e.status===`pending`?{...e,status:`expired`}:e)):e)))});let l=[...a.values()].filter(e=>e.status===`pending`&&!o.has(e.requestId));return l.length>0&&c.push({id:`pending-permissions`,entries:l,inDaySequence:!1}),i!==void 0&&c.push({id:Ga,entries:[{...i,placement:`pinned`}],inDaySequence:!1}),c}function fo(e,t,n){let r=e.findIndex(({content:e})=>e.kind===`block`&&e.block.kind===`entry`&&e.block.entry.kind===`ask`&&e.block.entry.id===t&&e.block.entry.placement===n);return r<0?void 0:{key:e[r].key,index:r}}function po(e,t){return[{id:`agent:${e}`,entries:t}]}function mo(e){if(e.inDaySequence!==!1)return e.userMessage?.ts??e.startedAt??e.completedAt}function ho(e,t){let n=[],r;for(let t of e){let e=mo(t),i=Ur(e);i!==void 0&&e!==void 0&&(r===void 0||i>r)&&(r!==void 0&&n.push({key:`${t.id}:day-separator`,scope:t.id,content:{kind:`day-separator`,ts:e}}),r=i),t.userMessage!==void 0&&n.push({key:t.userMessageKey??`${t.id}:user`,scope:t.id,content:{kind:`user-message`,message:t.userMessage}});for(let e of gr(t.entries))n.push({key:`${t.id}:${e.id}`,scope:t.id,content:{kind:`block`,block:e}});t.completedAt!==void 0&&n.push({key:`${t.id}:turn-time`,scope:t.id,content:{kind:`turn-time`,completedAt:t.completedAt,...t.startedAt===void 0?{}:{startedAt:t.startedAt}}})}return n}function go({runId:e,viewId:t,sections:n,mode:r,empty:i,renderAsk:a,renderPermission:o,messageActions:s,scrollControls:c,renderMode:l,taskTitles:u,recipientBackends:d}){let f=(0,X.useMemo)(()=>ho(n,e),[n,e]),p=eo(`${e}:${t}`,{surface:r}),m=c??p;aa(e,f,m,r);let h=(0,X.useMemo)(()=>{let e=new Map;f.forEach((t,n)=>{if(!(t.content.kind!==`block`||t.content.block.kind!==`worker-conversation`))for(let r of t.content.block.batches)for(let i of r.messages)e.set(i.messageId,{message:i,rowKey:t.key,rowIndex:n})});let t=new Map;for(let n of e.values()){let{message:e}=n;if(e.messageKind!==`reply`||!e.requestId)continue;let r=t.get(e.requestId)??[];r.push(n),t.set(e.requestId,r)}return{targets:e,replies:t,navigate:e=>m.jumpToRow(e.rowKey,e.rowIndex)}},[f,m.jumpToRow]),g=(0,X.useMemo)(()=>f.map(t=>({key:t.key,node:_o(t,s?.[t.key],a,o,e,u,d)})),[s,a,o,f,e,u,d]),_=l??Dr(``,g.length),v=g.length===0?i??null:(0,Z.jsx)(to,{runId:`${e}:${t}`,rows:g,mode:_,controls:m});return(0,Z.jsx)(Ue,{runId:e,children:(0,Z.jsx)(Sr,{runId:e,children:(0,Z.jsx)(_a.Provider,{value:h,children:r===`panel`?(0,Z.jsxs)(`div`,{"data-slot":`transcript-viewport`,"aria-label":`Agent transcript`,role:`region`,tabIndex:0,className:`relative flex min-h-0 flex-1 flex-col overflow-y-auto [scrollbar-gutter:stable]`,children:[(0,Z.jsx)(`div`,{"data-slot":`subagent-stream`,className:`flex flex-col px-5 py-4`,children:v}),m.pillVisible?(0,Z.jsx)(`div`,{className:`pointer-events-none sticky inset-x-0 bottom-4 flex justify-center`,children:(0,Z.jsx)(io,{onJump:m.jumpToLatest})}):null]}):v})})})}function _o(e,t,n,r,i,a,o){switch(e.content.kind){case`user-message`:return(0,Z.jsx)(vo,{message:e.content.message,actions:t});case`day-separator`:return(0,Z.jsx)(Jr,{ts:e.content.ts});case`turn-time`:return(0,Z.jsx)(qr,{completedAt:e.content.completedAt,...e.content.startedAt===void 0?{}:{startedAt:e.content.startedAt}});case`block`:return(0,Z.jsx)(yo,{block:e.content.block,scope:e.scope,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o});default:return Co(e.content)}}function vo({message:e,actions:t}){return(0,Z.jsx)(ei,{text:e.text,imageCount:e.imageCount,images:e.images,...e.ts===void 0?{}:{ts:e.ts},onEdit:t?.onEdit,onRemove:t?.onRemove,editLabel:t?.editLabel,removeLabel:t?.removeLabel,children:e.ask?(0,Z.jsx)(`div`,{"data-slot":`ask-card`,"data-resolved":`true`,children:(0,Z.jsx)(ha,{ask:e.ask})}):void 0})}function yo({block:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o}){switch(e.kind){case`entry`:return(0,Z.jsx)(er.Provider,{value:`${t}:${e.entry.id}`,children:(0,Z.jsx)(xo,{entry:e.entry,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o})});case`tool-card`:return(0,Z.jsx)(bi,{item:e.item,nested:e.children,cacheKey:`${t}:${e.id}`,renderNested:(e,t)=>(0,Z.jsx)(bo,{entries:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o})});case`context-group`:return(0,Z.jsx)(Ci,{group:e,scope:t});case`streak`:return(0,Z.jsx)(wi,{count:e.count,children:e.blocks.map(e=>(0,Z.jsx)(yo,{block:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o},e.id))});case`worker-conversation`:return(0,Z.jsx)(Na,{block:e,runId:i,taskTitles:a,recipientBackends:o});default:return Co(e)}}function bo({entries:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o}){return gr(e).map(e=>(0,Z.jsx)(yo,{block:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o},e.id))}function xo({entry:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o}){switch(e.kind){case`message`:return e.role===`assistant`?(0,Z.jsx)(ai,{text:e.text,ts:e.ts}):(0,Z.jsx)(ei,{text:e.text,ts:e.ts});case`reasoning`:return(0,Z.jsx)(si,{text:e.text});case`tool`:return(0,Z.jsx)(bi,{item:e,cacheKey:`${t}:${e.id}`});case`note`:return e.attribution?(0,Z.jsxs)(`div`,{className:`min-w-0 rounded-md border border-border px-4 py-3 text-sm`,children:[(0,Z.jsxs)(`p`,{className:`mb-2 break-all text-xs text-muted-foreground`,children:[e.attribution.source===`agent`?`Agent input from parent ${e.attribution.parentRunId}`:`Worker lifecycle context for parent ${e.attribution.parentRunId}`,e.delivery?` · ${Da(e.delivery)}`:``]}),(0,Z.jsx)(Xr,{note:e})]}):(0,Z.jsx)(Xr,{note:e});case`conversation`:return(0,Z.jsx)(Na,{runId:i,taskTitles:a,recipientBackends:o,block:{kind:`worker-conversation`,id:e.id,batches:[{id:e.id,kind:e.messageKind,text:e.text,senderRunId:e.senderRunId,messages:[e]}]}});case`image`:return(0,Z.jsx)(Ti,{image:e});case`ask`:return n===void 0?(0,Z.jsx)(`div`,{"data-slot":`ask-card`,className:`rounded-lg border border-border bg-card px-4 py-3 text-sm`,children:`The agent asked a question. Open the main session to answer it.`}):n(e);case`permission`:return r?r(e):(0,Z.jsx)(la,{permission:e,runId:i});case`provider-auth-required`:return(0,Z.jsx)(oi,{incident:e});case`preview-server`:return(0,Z.jsx)(So,{entry:e});case`hook`:return(0,Z.jsx)(Si,{item:e,cacheKey:`${t}:${e.id}`});default:return Co(e)}}function So({entry:e}){let t=cn(),n=B().data?.capabilities?.preview===!0;return(0,Z.jsx)(pt,{entry:t?.worktreeRemoved?{kind:`preview-server`,id:e.id,server:e.server,state:`unavailable`}:e,inPreview:t!==null&&t.open&&t.port===e.server.port,onOpen:t!==null&&n?t.openPane:void 0})}function Co(e){throw Error(`Unhandled transcript variant: ${JSON.stringify(e)}`)}function wo({runId:e,renderAsk:t,renderPermission:n,agent:r,entries:i,onClose:a,taskTitles:o,recipientBackends:s}){let c=(0,X.useContext)(Sn),l=(0,X.useRef)(void 0),u=(0,X.useRef)(!1);return(0,X.useEffect)(()=>()=>{l.current?.()},[c,e]),(0,Z.jsx)(Rt,{open:r!==void 0,onOpenChange:e=>{e||a()},children:(0,Z.jsx)(Vt,{"data-slot":`subagent-sheet`,side:`right`,onCloseAutoFocus:e=>{u.current&&=(e.preventDefault(),!1)},className:`flex min-h-0 w-full gap-0 p-0 sm:max-w-xl`,children:r===void 0?null:(0,Z.jsx)($n.Provider,{value:e=>{let t=[...document.querySelectorAll(`[data-agent-id]`)].find(e=>e.dataset.agentId===r?.id);l.current?.(),l.current=c?.registerOpener(e,()=>{t?.focus({preventScroll:!0})}),u.current=!0,a()},children:(0,Z.jsx)(To,{runId:e,renderAsk:t,renderPermission:n,agent:r,entries:i,taskTitles:o,recipientBackends:s})})})})}function To({runId:e,renderAsk:t,renderPermission:n,agent:r,entries:i,taskTitles:a,recipientBackends:o}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Jt,{className:`gap-1.5 border-b border-border px-5 py-4`,children:[(0,Z.jsxs)(wn,{className:`flex min-w-0 items-center gap-2 pr-8 text-[16px]`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:r.title}),r.agentType===void 0?null:(0,Z.jsx)(`span`,{"data-slot":`agent-type`,className:`shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:r.agentType})]}),(0,Z.jsxs)(Wt,{"data-slot":`subagent-meta`,className:`flex items-center gap-2 text-xs`,children:[(0,Z.jsx)(Eo,{status:r.status}),(0,Z.jsxs)(`span`,{className:`tabular-nums`,children:[r.toolCalls,` `,r.toolCalls===1?`tool call`:`tool calls`]})]})]}),(0,Z.jsx)(go,{runId:e,viewId:`agent:${r.id}`,sections:po(r.id,i),mode:`panel`,renderAsk:t,renderPermission:n,taskTitles:a,recipientBackends:o,empty:(0,Z.jsx)(`div`,{"data-slot":`subagent-empty`,className:`py-2 text-[13px] text-muted-foreground`,children:`No attributed output — see the thread card for this agent's result.`})})]})}function Eo({status:e}){let t=e===`completed`?`Completed`:e===`failed`?`Failed`:e===`declined`?`Declined`:e===`pending`?`Pending`:`Running`;return(0,Z.jsx)(`span`,{"data-slot":`subagent-status`,"data-status":e,className:o(`rounded-full px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] uppercase`,e===`completed`&&`bg-success/15 text-success`,(e===`failed`||e===`declined`)&&`bg-danger/15 text-danger`,(e===`running`||e===`pending`)&&`bg-muted text-muted-foreground`),children:t})}var Do=/^diff --git /;function Oo(e){let t=e.replace(Do,``),n=t.lastIndexOf(` b/`);return ko(n>=0?t.slice(n+3):t)}function ko(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function Ao(e){let t=ko(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function jo(e){return{path:Oo(e),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]}}function Mo(e,t){if(t.startsWith(`rename from `))e.status=`renamed`,e.oldPath=ko(t.slice(12));else if(t.startsWith(`rename to `))e.status=`renamed`,e.path=ko(t.slice(10));else if(t.startsWith(`new file mode`))e.status=`added`;else if(t.startsWith(`deleted file mode`))e.status=`deleted`;else if(t.startsWith(`Binary files `)||t===`GIT binary patch`)e.binary=!0;else if(t.startsWith(`+++ `)){let n=Ao(t);n!==void 0&&(e.path=n)}else if(t.startsWith(`--- `)){let n=Ao(t);n!==void 0&&e.status===`deleted`&&(e.path=n)}}function No(e,t){e.lines.push(t),t.startsWith(`+`)?e.additions+=1:t.startsWith(`-`)&&(e.deletions+=1)}function Po(e){let t=[],n=null,r=!1;for(let i of e.split(`
7
- `)){if(Do.test(i)){n=jo(i),t.push(n),r=!1;continue}if(n){if(!r){i.startsWith(`@@`)?(r=!0,n.lines.push(i)):Mo(n,i);continue}No(n,i)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function Fo(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var Io=20,Lo=300;function Ro({runId:e}){let t=h(),n=w(e);(0,X.useEffect)(()=>{t.invalidateQueries({queryKey:E.runs.diff(e)})},[t,e]);let r=(0,X.useMemo)(()=>Po(n.data??``),[n.data]),[i,a]=(0,X.useState)(!1);if(n.isPending)return(0,Z.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,Z.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(r.length===0)return(0,Z.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let o=Fo(r),s=i?r:r.slice(0,Io);return(0,Z.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{children:[o.files,` `,o.files===1?`file`:`files`,` changed`]}),(0,Z.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,o.additions]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,o.deletions]})]})]}),s.map(e=>(0,Z.jsx)(Bo,{file:e},`${e.oldPath??``}→${e.path}`)),r.length>s.length?(0,Z.jsxs)(W,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>a(!0),children:[`Show `,r.length-s.length,` more files`]}):null]})}var zo={added:`added`,deleted:`deleted`,renamed:`renamed`};function Bo({file:e}){let[t,n]=(0,X.useState)(!0),r=zo[e.status],i=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,Z.jsxs)(q,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,Z.jsxs)(K,{className:`flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,Z.jsx)(it,{className:o(`mbs-[1px] size-3.5 shrink-0 text-soft-foreground motion-safe:transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{"data-slot":`diff-file-path`,title:i,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:e.oldPath?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,Z.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:r}):null,e.binary?(0,Z.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`binary`}):null,(0,Z.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] font-semibold tabular-nums`,children:[(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,Z.jsx)(G,{children:(0,Z.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,Z.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,Z.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,Z.jsx)(Vo,{lines:e.lines})})})]})}function Vo({lines:e}){let[t,n]=(0,X.useState)(!1),r=t?e:e.slice(0,Lo),i=r.join(`
8
- `),[a,s]=(0,X.useState)(null);(0,X.useEffect)(()=>{let e=!1;return En(i,`diff`).then(t=>{e||s({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let c=a?.text===i?a.tokens:Tn(i,`diff`)?.tokens??null;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,Z.jsxs)(`span`,{"data-line":e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:void 0,className:o(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[c?.[t]===void 0?e:c[t].map((e,t)=>(0,Z.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>Lo?(0,Z.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}function Ho(e){let t=h();return z({mutationFn:()=>g(e),onSuccess:()=>t.invalidateQueries({queryKey:E.runs.all}),onError:e=>V(e.message,{tone:`danger`})})}function Uo({run:e}){return(0,Z.jsxs)(`section`,{"data-slot":`review-panel`,"aria-label":`Review the changes`,className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{"data-slot":`review-banner`,className:`flex items-center gap-2.5 rounded-md border border-accent-strong/30 bg-accent-strong/10 px-3.5 py-2.5`,children:[(0,Z.jsx)(ot,{className:`size-4 shrink-0 text-accent-icon`,"aria-hidden":`true`}),(0,Z.jsxs)(`p`,{className:`min-w-0 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:`Review the changes before anything lands.`}),` `,(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Read the diff, send notes back, draft a PR — or accept. Nothing merges on its own.`})]})]}),(0,Z.jsx)(Ro,{runId:e.id}),(0,Z.jsx)(Wo,{run:e})]})}function Wo({run:e}){let t=F(),n=h(),r=(0,X.useRef)(null),[i,o]=(0,X.useState)(``),[s,l]=(0,X.useState)(null),u=Ho(e.id),d=ji(e),f=()=>n.invalidateQueries({queryKey:E.runs.all}),p=z({mutationFn:async t=>d.canContinue?_(I(e.id),{text:`Review feedback:\n${t}`,runner:d.runnerOverride}):null,onMutate:()=>I(e.id),onSuccess:(e,n,r)=>{e!==null&&(o(``),t.invalidateAfter(`continue`,r))},onError:e=>V(e.message,{tone:`danger`})}),m=z({mutationFn:()=>b(e.id),onSuccess:e=>{V(`Draft PR created — ${e.url}`),f()},onError:e=>{e instanceof c&&e.manual!==void 0&&l(e.manual),V(e.message,{tone:`danger`})}}),g=()=>{let e=i.trim();if(e.length===0){V(`Write what to change first.`),r.current?.focus();return}p.mutate(e)};return(0,Z.jsxs)(`div`,{"data-slot":`review-actions`,className:`flex flex-col gap-2`,children:[(0,Z.jsx)(Mn,{ref:r,"data-slot":`review-notes`,"aria-label":`Notes for the agent`,placeholder:`Notes for the agent — what should change?`,rows:2,value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{Zt({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())},className:`min-h-[52px] text-[13px]`}),d.canContinue?null:(0,Z.jsxs)(`p`,{id:`review-provider-guidance`,className:`flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:d.reason}),d.providerPending?null:(0,Z.jsx)(J,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(W,{"data-slot":`review-send-back`,variant:`outline`,size:`sm`,title:d.reason??`Send the notes back into the agent's session`,"aria-describedby":d.canContinue?void 0:`review-provider-guidance`,disabled:p.isPending||!d.canContinue,onClick:g,children:[(0,Z.jsx)(Ln,{"aria-hidden":`true`}),`Send back`]}),a(e.pullRequestUrl)?(0,Z.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Z.jsxs)(`a`,{"data-slot":`pr-link`,href:e.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,title:`The PR for this task is already open`,children:[(0,Z.jsx)(at,{"aria-hidden":`true`}),`PR ↗`]})}):(0,Z.jsxs)(W,{"data-slot":`review-draft-pr`,variant:`outline`,size:`sm`,title:`Push the branch and open a draft PR`,disabled:m.isPending,onClick:()=>m.mutate(),children:[(0,Z.jsx)(ye,{"aria-hidden":`true`}),`Draft PR`]}),e.finishBlocked===null?(0,Z.jsxs)(W,{"data-slot":`review-accept`,variant:`primary`,size:`sm`,className:`ml-auto`,title:$t(`review`),disabled:u.isPending,onClick:()=>u.mutate(),children:[(0,Z.jsx)(Ce,{"aria-hidden":`true`}),`Accept`]}):null]}),s===null?null:(0,Z.jsx)(Go,{command:s})]})}function Go({command:e}){return(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`review-manual`,title:`Copy the command`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>V(`Command copied to clipboard.`)).catch(()=>V(`Run manually: ${e}`))},className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left font-mono text-[11px] text-soft-foreground hover:bg-muted hover:text-foreground`,children:[(0,Z.jsx)(Fe,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[`manual path: `,e]})]})}function Ko(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var qo=1500;function Jo({status:e}){let t=(0,X.useRef)(e),[n,r]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{let n=t.current;if(t.current=e,n!==`review`||e!==`done`||Ko())return;r(!0);let i=setTimeout(()=>r(!1),qo);return()=>clearTimeout(i)},[e]),n?(0,Z.jsxs)(`div`,{"data-slot":`accept-celebration`,"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 isolate z-40`,children:[(0,Z.jsx)(Pt,{}),(0,Z.jsx)(`div`,{className:`flex justify-center pt-24`,children:(0,Z.jsx)(`span`,{className:`rounded-full border border-accent-strong/30 bg-accent-strong/15 px-4 py-1.5 text-[13px] font-medium text-accent-text shadow-modal`,children:`✓ Changes accepted`})})]}):null}function Yo(e){let t=h(),[n,r]=(0,X.useState)(),i=At(e);(0,X.useEffect)(()=>{(!i||n&&n!==e.id)&&r(void 0)},[i,e.id,n]);let a=z({mutationFn:async()=>{r(e.id);try{if(!(await y(e.id)).cancelled)throw Error(`The task changed before Stop was accepted. Check its status and retry.`)}catch(e){throw r(void 0),e}},onSettled:()=>t.invalidateQueries({queryKey:E.runs.all})});return{stopping:!!e.stopping||a.isPending||i&&n===e.id,stop:()=>a.mutateAsync()}}function Xo({agents:e,onSelect:t}){return e.length===0?null:(0,Z.jsx)(`ul`,{"data-slot":`agents-list`,className:`flex min-w-0 flex-col gap-[7px]`,children:e.map(e=>(0,Z.jsx)(Zo,{agent:e,onSelect:t},e.id))})}function Zo({agent:e,onSelect:t}){let n=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Qo,{status:e.status,stalled:e.stalled===!0}),(0,Z.jsx)(`span`,{className:`min-w-0 shrink truncate font-medium`,children:e.title}),e.agentType===void 0?null:(0,Z.jsx)(`span`,{"data-slot":`agent-type`,className:`shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:e.agentType}),(0,Z.jsx)(`span`,{"data-slot":`agent-activity`,className:`min-w-0 flex-1 truncate text-muted-foreground`,children:Yi(e)}),(0,Z.jsxs)(`span`,{"data-slot":`agent-tools`,className:`shrink-0 text-muted-foreground tabular-nums`,children:[e.toolCalls,` `,e.toolCalls===1?`tool`:`tools`]})]});return(0,Z.jsx)(`li`,{"data-slot":`agent-item`,"data-status":e.status,className:`min-w-0 text-[13px]`,children:t?(0,Z.jsx)(`button`,{type:`button`,"data-agent-id":e.id,onClick:()=>t(e.id),"aria-haspopup":`dialog`,className:`flex min-h-5 w-full min-w-0 items-center gap-2.5 rounded-sm text-left hover:bg-muted/50`,children:n}):(0,Z.jsx)(`div`,{className:`flex min-h-5 min-w-0 items-center gap-2.5`,children:n})})}function Qo({status:e,stalled:t=!1}){return t?(0,Z.jsx)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,"data-stalled":`true`,className:`size-[15px] shrink-0 text-soft-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`3 2.5`,children:(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})}):e===`completed`?(0,Z.jsxs)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,className:`size-[15px] shrink-0 text-success`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,Z.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`failed`||e===`declined`?(0,Z.jsxs)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,className:`size-[15px] shrink-0 text-danger`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,Z.jsx)(`path`,{d:`m9 9 6 6M15 9l-6 6`})]}):(0,Z.jsxs)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,className:`size-[15px] shrink-0 animate-pulse motion-reduce:animate-none`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,Z.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,Z.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]})}function $o(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.filter(e=>e.status!==`cancelled`).length}}function es({entries:e}){return e.length===0?null:(0,Z.jsx)(`ul`,{"data-slot":`plan-list`,className:`flex min-w-0 flex-col gap-[7px]`,children:e.map((e,t)=>(0,Z.jsx)(ts,{entry:e},`${t}:${e.content}`))})}function ts({entry:e}){return(0,Z.jsxs)(`li`,{"data-slot":`plan-item`,"data-status":e.status,className:o(`flex min-h-5 min-w-0 items-center gap-2.5 text-[13px]`,e.status===`completed`&&`text-soft-foreground line-through`,e.status===`in_progress`&&`font-medium`,e.status===`pending`&&`text-muted-foreground`,e.status===`cancelled`&&`text-soft-foreground/70 line-through`),children:[(0,Z.jsx)(ns,{status:e.status}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.content}),e.status===`in_progress`?(0,Z.jsx)(`span`,{"data-slot":`plan-tag`,className:`ml-auto shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:`in progress`}):null]})}function ns({status:e}){return e===`cancelled`?(0,Z.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground/70`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`,opacity:`.5`}),(0,Z.jsx)(`path`,{d:`m8.5 15.5 7-7`})]}):e===`completed`?(0,Z.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-success`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,Z.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`in_progress`?(0,Z.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 animate-pulse motion-reduce:animate-none`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,Z.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,Z.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]}):(0,Z.jsx)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})})}function rs(e){switch(e){case`done`:return`done`;case`running`:case`waiting`:case`review`:return`active`;case`failed`:case`cancelled`:return`failed`;case`pending`:case`skipped`:return`pending`}}function is(e){if(e.length===0)return 0;let t=new Set([`done`,`failed`,`cancelled`,`skipped`]),n=new Set([`running`,`waiting`,`review`]),r=0;for(let i of e)t.has(i.status)?r+=1:n.has(i.status)&&(r+=.5);return r/e.length}function as({steps:e}){if(e.length===0)return null;let t=is(e)*100;return(0,Z.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((t,n)=>(0,Z.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":rs(t.status),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,Z.jsx)(os,{visual:rs(t.status)}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:t.name}),t.iterations>1?(0,Z.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,t.iterations]}):null,(0,Z.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-[11px] text-soft-foreground tabular-nums`,children:[t.pluginKind??t.kind,` · step `,n+1,` of `,e.length]})]},t.id)),(0,Z.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,Z.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${t}%`}})})]})}function os({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,Z.jsx)(Te,{"aria-hidden":!0,className:o(t,`text-success`)});case`active`:return(0,Z.jsx)(ct,{role:`status`,"aria-label":`Step running`,className:o(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,Z.jsx)(Ee,{"aria-hidden":!0,className:o(t,`text-danger`)});case`pending`:return(0,Z.jsx)(Ae,{"aria-hidden":!0,className:o(t,`text-soft-foreground`)})}}var ss={done:`done`,failed:`failed`,cancelled:`cancelled`};function cs(e){let t=ss[e.status];return t?e.steps.map(e=>rs(e.status)===`active`?{...e,status:t}:e.status===`pending`?{...e,status:`skipped`}:e):ls(e)}function ls(e){let t=us(e.currentStepId,e.steps);return e.steps.some((e,n)=>n!==t&&e.status===`waiting`)?e.steps.map((e,n)=>n!==t&&e.status===`waiting`?{...e,status:`done`}:e):e.steps}function us(e,t){let n=t.findIndex(t=>t.id===e);if(n>=0)return n;let r=t.reduce((e,t,n)=>rs(t.status)===`active`?n:e,-1);if(r>=0)return r;let i=t.findIndex(e=>e.status===`pending`);return i>=0?i:t.reduce((e,t,n)=>t.status===`skipped`?e:n,0)}function ds({items:e,lead:t=0}){let n=(0,X.useRef)(null),[r,i]=(0,X.useState)(-1/0);return(0,X.useLayoutEffect)(()=>{let r=n.current;if(!r)return;let a=()=>{let n=r.getBoundingClientRect().width;if(!n&&r.getClientRects().length===0)return;let a=getComputedStyle(r),o=Number.parseFloat(a.width),s=o>0?n/o:1,c=(Number.parseFloat(a.columnGap)||0)*s,l=Array.from(r.children,e=>e.getBoundingClientRect().width),u=e.map((e,t)=>({...e,width:l[t]??0})),d=-1/0,f=()=>u.reduce((e,t)=>e+t.width,0)+Math.max(0,u.length-1)*c+(u.length>0?t*s:0);for(let t of[...new Set(e.map(e=>e.priority))].sort((e,t)=>e-t)){if(f()<=n)break;d=t,u=u.filter(e=>e.priority>t)}i(e=>e===d?e:d)};if(a(),typeof ResizeObserver>`u`)return;let o=new ResizeObserver(a);o.observe(r);for(let e of r.children)o.observe(e);return()=>o.disconnect()},[e,t]),(0,Z.jsx)(`span`,{ref:n,"data-slot":`activity-summary`,className:`relative flex h-[max(1.5em,22px)] min-w-0 flex-1 items-center gap-2.5 overflow-clip whitespace-nowrap text-[13px] font-normal text-muted-foreground tabular-nums`,children:e.map(n=>{let i=n.priority<=r,a=n===e.find(e=>e.priority>r);return(0,Z.jsx)(`span`,{"data-summary-item":n.id,"data-hidden":i,"aria-hidden":i||void 0,inert:i||void 0,style:a&&t?{marginInlineStart:t}:void 0,className:`inline-flex w-max shrink-0 items-center gap-1.5 data-[hidden=true]:invisible data-[hidden=true]:absolute`,children:n.content},n.id)})})}function fs({run:e,references:t}){return(0,Z.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:t.map(t=>(0,Z.jsx)(xt,{reference:t,taskTitle:Y(e),inert:!0},ge(t)))})}function ps(e){return e.accountId===void 0||e.profilesPending?void 0:e.profilesError?e.accountId:e.accountId==="default"?Cn(e.accounts,e.accountBackend)?`default`:void 0:e.known?Cn(e.accounts,e.accountBackend)?e.known.label:void 0:`${e.accountId} (removed)`}function ms(e){let t=N(),n=oe(),{accounts:r}=xn(),i=e.runner??t.data?.defaultRunner??`claude`,a=e.model??`auto`,o=e.effort||`auto`,s=[...e.steps].reverse().find(e=>e.profileId),c=s?.profileId,l=s?.backend??i,u=n.data?.profiles.find(e=>e.id===c&&e.provider===l),d=ps({accountId:c,profilesPending:n.isPending,profilesError:n.isError,known:u,accounts:r,accountBackend:l}),f=e.modelIdentity&&e.modelIdentity!==a?e.modelIdentity:void 0;return{runner:e.removedRunner===void 0?i:m(e.removedRunner),...d?{account:d}:{},model:a,effort:o,...f?{identity:f}:{}}}var hs=[`running`,`queued`,`waiting`];function gs(e){return Array.isArray(e)?e.filter(e=>e?.kind===`pr`||e?.kind===`timer`||e?.kind===`worker`||e?.kind===`process`||e?.kind===`peer`||e?.kind===`subagent`||e?.kind===`plugin`):[]}function $(e){let t=e?new Date(e):void 0;return t&&Number.isFinite(t.getTime())?new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(t):void 0}function _s(e,t){return`${e} — ${t.status===`failed`?`not delivered; Continue delivers it, Stop discards it`:t.status===`running`?`current turn still working`:`waiting for capacity`}`}function vs(e){return e.kind!==`worker`&&e.kind!==`peer`&&e.kind!==`subagent`}function ys(e){let t=gs(e.waits),n=hs.includes(e.status),r=t.filter(t=>t.phase===`open`?n:t.phase===`resolved`&&vs(t)&&(n||e.status===`failed`)),i=r.some(e=>e.kind===`pr`),a=[...gs(e.lastWaits),...t.filter(e=>!r.includes(e)&&e.phase!==`open`)],o=i?void 0:a.filter(e=>e.kind===`pr`).at(-1),s=i?void 0:e.lastWaitsError,c=r.some(e=>e.kind===`process`)?void 0:a.filter(e=>e.kind===`process`).at(-1);return r.length||o||s||c?{open:r,lastCi:o,error:s,lastProcess:c}:void 0}function bs(e){return ys(e)!==void 0}function xs(e){return(ys(e)?.open??[]).filter(e=>e.kind===`pr`).map(e=>({kind:`PR`,number:e.prNumber,url:e.prUrl}))}function Ss({run:e}){let t=ys(e);if(!t)return null;let{open:n,lastCi:r,error:i,lastProcess:a}=t;return(0,Z.jsxs)(`div`,{"data-slot":`open-waits`,className:`flex min-w-0 flex-col gap-1`,children:[n.map(t=>t.kind===`pr`?(0,Z.jsx)(ws,{run:e,wait:t},t.id):t.kind===`worker`?(0,Z.jsx)(Ts,{wait:t},t.id):t.kind===`process`?(0,Z.jsx)(js,{run:e,wait:t},t.id):t.kind===`peer`?(0,Z.jsx)(Es,{wait:t},t.id):t.kind===`subagent`?(0,Z.jsx)(Ds,{wait:t},t.id):t.kind===`plugin`?(0,Z.jsx)(Os,{run:e,wait:t},t.id):(0,Z.jsx)(ks,{run:e,wait:t},t.id)),i?(0,Z.jsx)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:i}):r?(0,Z.jsx)(ws,{run:e,wait:r,settled:!0}):null,a?(0,Z.jsx)(js,{run:e,wait:a,settled:!0}):null]})}function Cs(e,t,n){let r=t.result,i=t.until!==`checks`,a={passed:`CI checks passed — observed checks only; not merge approval`,stuck:`CI checks stuck in queue — inspect the PR checks`,failed:`CI checks failed — inspect the PR checks`,conflicting:i?`PR has merge conflicts — inspect the PR; not merged`:`PR has merge conflicts — inspect the PR; not merge approval`,cancelled:i?`Merge wait cancelled`:`CI wait cancelled`,skipped:`CI checks skipped — inspect the PR checks`,no_checks:`No CI checks found — inspect the PR workflows`,startup_failure:`CI workflow never started — inspect the PR workflows`,deadline:i?`Merge wait timed out — merge not confirmed`:`CI wait timed out — inspect the PR checks`,error:i?`Merge wait unavailable — inspect access and the PR`:`CI wait unavailable — inspect access and the PR checks`,head_changed:`CI head changed — ${r?.headSha.slice(0,7)} → ${r?.observedHeadSha?.slice(0,7)??`unknown`}`,merged:`PR merged`,closed:`PR closed without merge — inspect the PR`,blocked:`Initiated merge blocked — inspect the PR; not merged`},o=i?`Merge`:`CI`,s=n&&t.phase===`cancelled`;return n?s?`${o} wait cancelled`:r?a[r.outcome]:`${o} wait unavailable`:t.phase===`resolved`?_s(`${o} result ready`,e):t.until===`merge_or_blocked`?`Waiting for merge or blockage`:i?`Waiting for merge`:`Waiting for CI`}function ws({run:e,wait:t,settled:n=!1}){let r=t.result,i=t.until===`checks`?`CI`:`Merge`,o=n&&t.phase===`cancelled`,s=Cs(e,t,n),c=n?o?t.cancelledAt:r?.observedAt:t.deadline,l=$(c),u=`${t.repository}#${t.prNumber}`;return(0,Z.jsx)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-[13px] text-muted-foreground [overflow-wrap:anywhere]`,children:(0,Z.jsxs)(`dl`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-baseline gap-x-3 gap-y-1`,children:[(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Status`}),(0,Z.jsx)(`dd`,{children:s}),(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Pull request`}),(0,Z.jsx)(`dd`,{className:`min-w-0`,children:a(t.prUrl)?(0,Z.jsx)(`a`,{href:t.prUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-h-11 min-w-11 max-w-full items-center rounded-sm px-1 font-medium text-foreground underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:bg-muted`,children:u}):(0,Z.jsx)(`span`,{children:u})}),l?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:n?o?`Cancelled`:`Observed`:`Deadline`}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`time`,{dateTime:c,children:l})})]}):n?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Deadline`}),(0,Z.jsxs)(`dd`,{children:[i,` deadline unavailable`]})]})]})})}function Ts({wait:e}){let t=e.workerIds!==void 0,n=new Set((t?e.outcomes:e.requestOutcomes)?.map(e=>`workerId`in e?e.workerId:e.requestId)),r=(e.workerIds??e.requestIds??[]).filter(e=>!n.has(e)).length,i=t?r===1?`worker`:`workers`:r===1?`request reply`:`request replies`,a=$(e.deadline);return(0,Z.jsxs)(`div`,{"data-slot":`worker-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,Z.jsxs)(`p`,{children:[`Waiting on `,r,` `,i]}),a?(0,Z.jsxs)(`p`,{children:[`Deadline`,` `,(0,Z.jsx)(`time`,{dateTime:e.deadline,children:a})]}):(0,Z.jsx)(`p`,{children:`Worker wait deadline unavailable`})]})}function Es({wait:e}){let t=e.peerIds.length,n=$(e.deadline);return(0,Z.jsxs)(`div`,{"data-slot":`peer-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,Z.jsxs)(`p`,{children:[`Waiting on `,t,` `,t===1?`task`:`tasks`]}),n?(0,Z.jsxs)(`p`,{children:[`Deadline`,` `,(0,Z.jsx)(`time`,{dateTime:e.deadline,children:n})]}):(0,Z.jsx)(`p`,{children:`Peer wait deadline unavailable`})]})}function Ds({wait:e}){let t=(Array.isArray(e.children)?e.children:[]).filter(e=>e?.status===`running`).length,n=$(e.deadline);return(0,Z.jsxs)(`div`,{"data-slot":`subagent-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,Z.jsxs)(`p`,{children:[`Waiting for `,t,` `,t===1?`subagent`:`subagents`]}),n?(0,Z.jsxs)(`p`,{children:[`Check by`,` `,(0,Z.jsx)(`time`,{dateTime:e.deadline,children:n})]}):(0,Z.jsx)(`p`,{children:`Subagent wait deadline unavailable`})]})}function Os({run:e,wait:t}){let n=t.phase===`open`?$(t.deadline):void 0;return(0,Z.jsxs)(`div`,{"data-slot":`plugin-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`p`,{children:t.phase===`resolved`?_s(t.summary,e):t.summary}),n?(0,Z.jsxs)(`p`,{children:[`Deadline`,` `,(0,Z.jsx)(`time`,{dateTime:t.deadline,children:n})]}):null]})}function ks({run:e,wait:t}){let n=$(t.deadline);return(0,Z.jsxs)(`div`,{"data-slot":`monitoring-schedule`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[t.phase===`resolved`?(0,Z.jsx)(`p`,{children:_s(`Automatic check due`,e)}):n?(0,Z.jsxs)(`p`,{children:[`Next automatic check`,` `,(0,Z.jsx)(`time`,{dateTime:t.deadline,className:`font-medium text-foreground`,children:n})]}):(0,Z.jsx)(`p`,{children:`Automatic check time unavailable`}),t.note?(0,Z.jsx)(`p`,{children:t.note}):null]})}function As(e){let t=e.result;return t?t.outcome===`exit_file`?t.exitCode===void 0?`PID ${e.pid} wrote an exit file that is not an exit code`:`PID ${e.pid} exited with code ${t.exitCode}`:t.outcome===`exited`?e.startToken===void 0&&t.observedAt===e.registeredAt?`PID ${e.pid} was not running when the wait was registered`:`PID ${e.pid} exited, code unknown`:t.outcome===`deadline`?`PID ${e.pid} still running at the deadline`:`PID ${e.pid} could not be checked`:`PID ${e.pid} still running at the deadline`}function js({run:e,wait:t,settled:n=!1}){let r=n&&t.phase===`cancelled`?`Process wait on PID ${t.pid} cancelled`:n?As(t):t.phase===`resolved`?_s(As(t),e):`Waiting for PID ${t.pid}${t.note?` — ${t.note}`:``}`,i=!n&&t.phase===`open`?$(t.deadline):void 0;return(0,Z.jsxs)(`div`,{"data-slot":`process-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`p`,{children:r}),i?(0,Z.jsxs)(`p`,{children:[`Until`,` `,(0,Z.jsx)(`time`,{dateTime:t.deadline,children:i})]}):null]})}var Ms=new Map,Ns=new Map;function Ps(e){let{referenceProjectId:t,repoBase:n,references:r,requests:i}=ze(e.run);return(0,Z.jsx)(yt,{projectId:t,repoBase:n,requests:i,children:(0,Z.jsx)(Fs,{...e,references:r,prNumbers:i.filter(e=>e.kind===`PR`).map(e=>e.number),hasReferences:r.length>0||!!me(e.run)||!!pe(e.run,n)})})}function Fs({run:e,thread:t,currentThread:n,currentComplete:r=!0,onOpenWorker:i,readerScroll:a,prNumbers:o,hasReferences:s,references:c}){let l=tn(),u=ms(e),[d,f]=(0,X.useState)(()=>Ms.get(e.id)??!1),p=Zs(a,d),m=p.open,[h,g]=(0,X.useState)({}),_=Is(e,t??n,n,r,o),v=We(e),y=t=>h[t]??Ns.get(`${e.id}:${t}`)??t===`workers`,b=t=>{let n=!y(t);Ns.set(`${e.id}:${t}`,n),g(e=>({...e,[t]:n}))},x=e=>({open:y(e),onToggle:()=>b(e)});return(0,Z.jsxs)(`section`,{"data-slot":`run-activity-dock`,ref:p.ref,"data-state":m?`open`:`collapsed`,className:`min-w-0 overflow-hidden rounded-xl border border-border bg-card shadow-xs`,children:[(0,Z.jsx)(Vs,{run:e,identity:u,activity:_,references:c,open:m,onToggle:()=>{Ms.set(e.id,!m),f(!m),p.chose(!m)}}),m?(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col border-t border-border`,children:[(0,Z.jsx)(Ws,{run:e,activity:_,...x(`status`)}),(0,Z.jsx)(Gs,{run:e,desktop:l,automations:_.automations,...x(`workflow`)}),(0,Z.jsx)(Ks,{activity:_,desktop:l,onOpenWorker:i,...x(`subagents`)}),(0,Z.jsx)(qs,{run:e,...x(`workers`)}),(0,Z.jsx)(Js,{activity:_,desktop:l,...x(`plan`)}),(0,Z.jsx)(Ys,{run:e,identity:u,activity:_,...x(`usage`)}),(0,Z.jsx)(Xs,{run:e,references:c,conflicts:_.conflicts,hasReferences:s,onResume:()=>v.mutate(),...x(`workspace`)})]}):null]})}function Is(e,t,n,r,i){let a=B(),o=un(a.data),s=R(),c=nt(e,{queuePosition:e.status===`queued`?jt(s.data??[]).get(e.id):void 0}),l=bt(i),u=!kt(e)&&e.status!==`queued`,d=(0,X.useMemo)(()=>r?Ki(n.turns,u,t.turns):[],[r,n.turns,u,t.turns]),f=vt(n)??[],p=qe(e),m=Ji(d),h=$o(f);return{line:c,...Ls(e,c,p,r?m:void 0,h),...Rs(e,o),conflicts:l,waitReferences:xs(e),agents:d,agentCounts:m,planEntries:f,planCounts:h,automations:yn(a.data)}}function Ls(e,t,n,r,i){let a=e.steps.every(e=>e.status===`done`||e.status===`skipped`),o=e.status===`done`&&a&&n===`complete`&&r!==void 0&&r.done===r.total&&i.done===i.total;return{allComplete:o,statusText:o?`All complete`:e.status!==`done`||r===void 0?t.label:n===`unknown`?`Workers unavailable`:n===`pending`?`In progress`:`Incomplete`,failed:t.attention.tone===`danger`||e.status===`cancelled`,glyph:o?(0,Z.jsx)(Te,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-success`}):(0,Z.jsx)(Nt,{tone:t.attention.tone,shape:t.attention.shape,pulse:t.attention.pulse})}}function Rs(e,t){return{cost:t.cost&&e.costUsd!==void 0?he(e.costUsd):void 0,tokens:t.tokens&&(e.inputTokens!==void 0||e.outputTokens!==void 0)?(0,Z.jsx)(an,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):void 0}}function zs(e){return e.allComplete?`text-success`:e.failed&&`text-danger`}function Bs(e){let t=cs(e),n=us(e.currentStepId,t);return t.length>0?{steps:t,index:n,step:t[n]}:void 0}function Vs({run:e,identity:t,activity:n,references:r,open:i,onToggle:a}){let{cost:s}=n,c=[...new Map([...r,...n.waitReferences].map(e=>[ge(e),e])).values()];return(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-label":Hs(e,t,n,c,i),onClick:a,className:o(`flex min-h-11 w-full min-w-0 items-center px-3.5 py-2 text-start text-[14px] hover:bg-muted/40 active:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,i?`gap-2.5`:`gap-2`),children:[(0,Z.jsx)(Le,{"aria-hidden":!0,className:`size-4 shrink-0 text-accent-text`}),(0,Z.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Activity`}),i?null:(0,Z.jsx)(Us,{run:e,identity:t,activity:n,summaryReferences:c}),i&&s?(0,Z.jsx)(`span`,{"data-slot":`run-activity-cost`,className:`ms-auto shrink-0 text-[13px] text-muted-foreground tabular-nums`,children:s}):null,(0,Z.jsx)(ke,{"aria-hidden":!0,className:o(`size-4 shrink-0 text-soft-foreground motion-safe:transition-transform motion-reduce:transition-none`,i&&!s&&`ms-auto`,i&&`rotate-180`)})]})}function Hs(e,t,n,r,i){let{statusText:a,conflicts:o,cost:s}=n,c=`Session activity: ${a}${o.length?`; pull request conflicts`:``}${s?`; cost ${s}`:``}`;if(i)return c;let l=Bs(e)?.step,u=l?rs(l.status):void 0,d=l?`; step ${l.name}, ${u===`active`?`running`:u}`:``,f=r.length?`; ${r.map(e=>`${e.kind} #${e.number}`).join(`; `)}`:``;return`${c}${d}; runner ${t.runner}; model ${t.model}; effort ${t.effort}${f}`}function Us({run:e,identity:t,activity:n,summaryReferences:r}){let{statusText:i,cost:a,conflicts:s}=n,c=Bs(e)?.step,l=[{id:`runner`,priority:2,content:t.runner},{id:`model`,priority:4,content:t.model},{id:`effort`,priority:3,content:t.effort},...a?[{id:`cost`,priority:1,content:(0,Z.jsx)(`span`,{"data-slot":`run-activity-cost`,children:a})}]:[],...r.length||s.length?[{id:`chips`,priority:0,content:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(fs,{run:e,references:r}),s.length>0?(0,Z.jsxs)(`span`,{"data-slot":`run-activity-conflict`,className:`inline-flex items-center gap-1 font-medium text-conflict`,children:[(0,Z.jsx)(Me,{"aria-hidden":!0,className:`size-3.5`}),`Conflicts`]}):null]})}]:[]];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`run-activity-status`,title:i,className:o(`inline-flex min-w-[calc(0.875rem+3ch)] flex-[0_1_auto] items-center gap-1.5 text-[13px] whitespace-nowrap text-muted-foreground`,zs(n)),children:[n.glyph,(0,Z.jsx)(`span`,{"data-slot":`run-activity-status-label`,className:`min-w-0 truncate`,children:i})]}),c?(0,Z.jsxs)(`span`,{"data-slot":`run-activity-step`,className:`flex max-w-max min-w-[calc(1.375rem+2ch)] flex-[1000_1_0] items-center gap-1.5 text-[13px] text-muted-foreground`,children:[(0,Z.jsx)(tc,{step:c,decorative:!0}),(0,Z.jsx)(`span`,{"data-slot":`run-activity-step-name`,title:c.name,className:`min-w-0 truncate`,children:c.name})]}):null,(0,Z.jsx)(`span`,{className:`-ms-2 flex min-w-0 flex-[1_1_0]`,children:(0,Z.jsx)(ds,{items:l,lead:8})})]})}function Ws({run:e,activity:t,open:n,onToggle:r}){let{line:i,waitReferences:a}=t,s=Xe(e);return(0,Z.jsxs)(tt,{slot:`status-row`,icon:t.glyph,title:(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{"data-slot":`run-activity-status`,className:o(`truncate`,zs(t)),children:t.statusText}),i.nextCheck?(0,Z.jsxs)(`span`,{"data-slot":`run-activity-next-check`,className:`whitespace-normal text-[13px] font-normal text-muted-foreground`,children:[`Next check `,(0,Z.jsx)(`time`,{dateTime:i.nextCheck.at,children:i.nextCheck.text})]}):null]}),summary:!n&&a.length>0?(0,Z.jsx)(ds,{items:[{id:`chips`,priority:0,content:(0,Z.jsx)(fs,{run:e,references:a})}]}):void 0,open:n,onToggle:bs(e)||s?r:void 0,children:[(0,Z.jsx)(Ss,{run:e}),s?(0,Z.jsx)(Ke,{run:e}):null]})}function Gs({run:e,desktop:t,automations:n,open:r,onToggle:i}){let a=_e(e),o=Bs(e);return!a&&!o?null:(0,Z.jsxs)(tt,{slot:`workflow`,icon:o?(0,Z.jsx)(tc,{step:o.step}):(0,Z.jsx)(Pe,{className:`size-4`}),title:(0,Z.jsxs)(Z.Fragment,{children:[`Workflow`,a?(0,Z.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` · `,a]}):null]}),meta:o?{drop:o.step.name,keep:He(o.index+1,o.steps.length,t,`step`)}:void 0,open:r,onToggle:i,children:[o?(0,Z.jsx)(as,{steps:o.steps}):null,(0,Z.jsx)(ec,{run:e,available:n})]})}function Ks({activity:e,desktop:t,onOpenWorker:n,open:r,onToggle:i}){let{agents:a,agentCounts:o}=e;return a.length===0?null:(0,Z.jsx)(tt,{slot:`subagents`,icon:(0,Z.jsx)(Ne,{className:`size-4`}),title:`Subagents`,meta:He(o.done,o.total,t),open:r,onToggle:i,children:(0,Z.jsx)(Xo,{agents:a,onSelect:n})})}function qs({run:e,open:t,onToggle:n}){return $e(e)?(0,Z.jsx)(Qe,{run:e,open:t,onToggle:n}):null}function Js({activity:e,desktop:t,open:n,onToggle:r}){let{planEntries:i,planCounts:a}=e;return i.length===0?null:(0,Z.jsx)(tt,{slot:`plan`,icon:(0,Z.jsx)(H,{className:`size-4`}),title:`Plan`,meta:He(a.done,a.total,t),open:n,onToggle:r,children:(0,Z.jsx)(es,{entries:i})})}function Ys({run:e,identity:t,activity:n,open:r,onToggle:i}){let{cost:a,tokens:o}=n,s=e.modelIdentity?.includes(`/`)?e.modelIdentity.split(`/`)[0]:void 0,c=[...s?[{id:`provider`,priority:2,content:s}]:[],{id:`model`,priority:4,content:t.model},{id:`effort`,priority:3,content:t.effort},...a?[{id:`cost`,priority:1,content:a}]:[],...o?[{id:`tokens`,priority:0,content:o}]:[]];return(0,Z.jsx)(tt,{slot:`usage`,icon:(0,Z.jsx)(In,{className:`size-4`}),title:`Usage & agent`,summary:(0,Z.jsx)(`span`,{"data-slot":`run-activity-meta`,className:`contents`,children:(0,Z.jsx)(ds,{items:c})}),open:r,onToggle:i,children:(0,Z.jsx)($s,{run:e,tokens:o,cost:a})})}function Xs({run:e,references:t,conflicts:n,hasReferences:r,onResume:i,open:a,onToggle:o}){let s=e.delegation?.role===`worker`?e.delegation.destroy:void 0;if(!(e.branch||e.worktreePath||r||nn(e)||Be(s)))return null;let c=n.length===1?`PR #${n[0]} conflicts`:`${n.length} PRs conflict`;return(0,Z.jsx)(tt,{slot:`workspace`,icon:(0,Z.jsx)(ve,{className:`size-4`}),title:`Workspace`,summary:!a&&t.length>0?(0,Z.jsx)(`span`,{"data-slot":`run-activity-meta`,className:`contents`,children:(0,Z.jsx)(ds,{items:[...e.branch?[{id:`branch`,priority:0,content:(0,Z.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.branch})}]:[],{id:`chips`,priority:1,content:(0,Z.jsx)(fs,{run:e,references:t})},...n.length>0?[{id:`conflicts`,priority:2,content:(0,Z.jsx)(`span`,{className:`font-medium text-conflict`,children:c})}]:[]]})}):void 0,meta:n.length>0?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-conflict`,children:[(0,Z.jsx)(Me,{"aria-hidden":!0,className:`size-3.5`}),c]}):e.branch?(0,Z.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.branch}):void 0,open:a,onToggle:o,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 text-[13px] text-muted-foreground`,children:[s?(0,Z.jsx)(Ye,{state:s}):null,(0,Z.jsx)(Je,{run:e}),e.branch?(0,Z.jsx)(Qs,{label:`Branch`,children:(0,Z.jsx)(Ze,{branch:e.branch})}):null,e.worktreePath?(0,Z.jsx)(Qs,{label:`Worktree`,children:(0,Z.jsx)(`span`,{className:`min-w-0 break-all font-mono text-[12px] text-foreground`,children:e.worktreePath})}):null,(0,Z.jsx)(Ge,{run:e,canResume:pn(e).terminal,onResume:i})]})})}function Zs(e,t){let n=(0,X.useRef)(null),[r,i]=(0,X.useState)(!1),a=(0,X.useRef)(t);a.current=t;let o=(0,X.useRef)({active:!1,override:!1});return(0,X.useEffect)(()=>e?.(e=>{if(e.direction===`tail`){o.current={active:!1,override:!1},i(!1);return}if(e.direction===`down`){i(!1);return}if(o.current.active=!0,o.current.override||!a.current)return;let t=n.current?.closest(`[data-slot="thread-dock"]`);!t||getComputedStyle(t).position!==`sticky`||e.distanceFromBottom<=t.getBoundingClientRect().height||i(!0)}),[e]),{ref:n,open:t&&!r,chose:e=>{i(!1),e&&o.current.active&&(o.current.override=!0)}}}function Qs({label:e,children:t}){return(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`w-20 shrink-0 font-medium text-foreground`,children:e}),t]})}function $s({run:e,tokens:t,cost:n}){let{runner:r,account:i,model:a,effort:o,identity:s}=ms(e);return(0,Z.jsxs)(`dl`,{"data-slot":`agent-details`,className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-[13px]`,children:[t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Tokens`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-[12px]`,children:t})]}):null,n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Cost`}),(0,Z.jsx)(`dd`,{className:`min-w-0 font-mono text-[12px] tabular-nums`,children:n})]}):null,(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Runner`}),(0,Z.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[12px]`,children:r}),i?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Account`}),(0,Z.jsx)(`dd`,{"data-slot":`agent-badge-account`,className:`min-w-0 break-all font-mono text-[12px]`,children:i})]}):null,(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Model`}),(0,Z.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[12px]`,children:a}),(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Effort`}),(0,Z.jsx)(`dd`,{"data-slot":`agent-badge-effort`,className:`min-w-0 break-all font-mono text-[12px]`,children:o}),s?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Identity`}),(0,Z.jsx)(`dd`,{"data-slot":`agent-badge-identity`,className:`min-w-0 break-all font-mono text-[12px]`,children:s})]}):null]})}function ec({run:e,available:t}){if(!e.automation)return null;let n=`inline-flex min-h-11 items-center rounded-sm text-[13px] font-medium md:min-h-8`;return(0,Z.jsxs)(`p`,{className:`mt-2 text-[13px] text-muted-foreground`,children:[`Launched by`,` `,t?(0,Z.jsx)(J,{to:`/automations/${encodeURIComponent(e.automation.automationId)}/log`,className:o(n,`text-foreground underline underline-offset-2`),children:`Automation`}):(0,Z.jsx)(`span`,{"data-slot":`automation-origin`,title:`Automations are off on this server (CEZ_AUTOMATIONS)`,className:n,children:`Automation`})]})}function tc({step:e,decorative:t=!1}){let n=rs(e.status),r=`size-4 shrink-0`;switch(n){case`active`:return(0,Z.jsx)(ct,{...t?{"aria-hidden":!0}:{role:`status`,"aria-label":`Step running`},"data-slot":`workflow-glyph`,"data-visual":n,className:o(r,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,Z.jsx)(Ee,{"aria-hidden":!0,"data-slot":`workflow-glyph`,"data-visual":n,className:o(r,`text-danger`)});case`pending`:return(0,Z.jsx)(Ae,{"aria-hidden":!0,"data-slot":`workflow-glyph`,"data-visual":n,className:o(r,`text-soft-foreground`)});case`done`:return(0,Z.jsx)(Te,{"aria-hidden":!0,"data-slot":`workflow-glyph`,"data-visual":n,className:o(r,`text-success`)})}}var nc={finish:`Closed when the task finished`,superseded:`Closed when the worker went on`,"parent-stopped":`Closed when the parent stopped`,"worker-stopped":`Closed when the worker stopped`,undeliverable:`Closed: not delivered`};function rc(e,t,n){return`${e.header}: ${n?.trim()||t.join(`, `)}`}function ic({ask:e,run:t,onShowOrigin:n}){let r=e.context?(0,Z.jsx)(oc,{text:e.context}):null;if(e.resolved)return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[r,(0,Z.jsxs)(Qr,{role:`user`,"data-slot":`ask-card`,"data-resolved":`true`,children:[(0,Z.jsx)(`span`,{className:`text-soft-foreground`,children:e.closed?nc[e.closed]:e.answeredBy===`parent`?`Answered by parent`:`Answered`}),(0,Z.jsx)(ha,{ask:e})]})]});let i=e.placement===`pinned`&&n?n:void 0;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[r,e.routedToParent?(0,Z.jsx)(sc,{ask:e,onShowOrigin:i}):(0,Z.jsx)(cc,{ask:e,run:t,onShowOrigin:i})]})}function ac({onShowOrigin:e}){return(0,Z.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`ask-show-origin`,className:`mbs-2 min-h-11 min-w-11 px-2 text-xs font-medium text-muted-foreground underline underline-offset-4`,onClick:e,children:`Show where it was asked`})}function oc({text:e}){return(0,Z.jsx)(Qr,{role:`agent`,children:(0,Z.jsx)(`div`,{"data-slot":`ask-context`,role:`region`,"aria-label":`Context`,className:`break-words text-sm text-foreground`,children:(0,Z.jsx)(jn,{breaks:!0,children:e})})})}function sc({ask:e,onShowOrigin:t}){return(0,Z.jsxs)(`div`,{"data-slot":`ask-card`,"data-resolved":`false`,"data-pinned":e.placement===`pinned`?`true`:void 0,"data-routed":`parent`,className:`rounded-lg border border-border bg-card px-4 pt-3.5 pb-3.5`,children:[(0,Z.jsx)(`div`,{className:`mb-2.5 flex items-center gap-2`,children:(0,Z.jsx)(`span`,{className:`text-xs font-medium text-link-foreground`,children:`The agent is asking its parent`})}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.questions.map((e,t)=>(0,Z.jsxs)(`div`,{role:`group`,"aria-label":e.question,children:[(0,Z.jsx)(`div`,{className:`mb-0.5 flex items-center gap-2`,children:(0,Z.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e.header})}),(0,Z.jsx)(`p`,{className:`mb-1.5 break-words text-sm font-semibold text-foreground`,children:e.question}),e.options?(0,Z.jsx)(`ul`,{className:`flex list-disc flex-col gap-0.5 pl-5 text-[13px] text-muted-foreground`,children:e.options.map(e=>(0,Z.jsxs)(`li`,{className:`break-words`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:e.label}),e.description?(0,Z.jsxs)(`span`,{children:[`: `,e.description]}):null]},e.label))}):(0,Z.jsx)(`p`,{"data-slot":`ask-open-routed`,className:`text-[13px] text-muted-foreground`,children:`Open question: answered in words, with no options.`})]},e.id??t))}),(0,Z.jsxs)(`p`,{"data-slot":`ask-routed-hint`,className:`mt-3 text-xs text-muted-foreground`,children:[`Routed to parent: answer it in the`,` `,e.parentRunId?(0,Z.jsx)(J,{to:`/tasks/${e.parentRunId}`,className:`font-medium text-foreground underline underline-offset-4`,children:`parent task`}):`parent task`,`.`]}),t?(0,Z.jsx)(ac,{onShowOrigin:t}):null]})}function cc({ask:e,run:t,onShowOrigin:n}){let r=dn(t),i=r.blockedBy!==void 0,a=e.questions,o=a.length===1&&a[0]?.options!==void 0&&a[0]?.multiSelect!==!0,[s,c]=(0,X.useState)({}),[l,u]=(0,X.useState)({}),d=(e,t)=>c(n=>({...n,[e]:t})),f=e=>u(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n}),p=e=>{d(e,[]),u(t=>({...t,[e]:t[e]??``}))},m=a.some((e,t)=>!e.options||l[t]!==void 0),h=a.every((e,t)=>(s[t]?.length??0)>0||!!l[t]?.trim()),g=()=>void r.send(a.map((e,t)=>rc(e,s[t]??[],l[t])).join(`
9
- `)),_=r.mode===`resume`;return(0,Z.jsxs)(`div`,{"data-slot":`ask-card`,"data-resolved":`false`,"data-pinned":e.placement===`pinned`?`true`:void 0,"data-delivery":r.mode,className:`rounded-lg border border-accent-strong/25 bg-accent-strong/[0.04] [html:not(.light)_&]:bg-card px-4 pt-3.5 pb-3.5`,children:[(0,Z.jsx)(`div`,{className:`mb-2.5 flex items-center gap-2`,children:(0,Z.jsx)(`span`,{className:`text-xs font-medium text-link-foreground`,children:`The agent is asking`})}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-4`,children:a.map((e,t)=>(0,Z.jsx)(uc,{question:e,disabled:r.isPending||i,selected:s[t]??[],isOther:l[t]!==void 0,otherAnswer:l[t]??``,onSelect:n=>{i||(f(t),o?r.send(rc(e,n)):d(t,n))},onOtherToggle:()=>{i||(l[t]===void 0?p(t):f(t))},onOtherChange:e=>u(n=>({...n,[t]:e}))},e.id??t))}),(0,Z.jsx)(lc,{oneTap:o,hasOtherAnswer:m,resuming:_,disabled:r.isPending||i||!h,questionCount:a.length,onSend:g}),r.blockedBy===`provider`?(0,Z.jsxs)(`div`,{"data-slot":`ask-provider-gate`,className:`mt-3 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:r.reason}),(0,Z.jsx)(J,{to:`/settings/agent-defaults#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null,r.blockedBy===`no-session`?(0,Z.jsx)(`p`,{"data-slot":`ask-no-session`,className:`mt-3 text-xs text-muted-foreground`,children:r.reason}):null,r.error?(0,Z.jsx)(`p`,{"data-slot":`ask-error`,role:`alert`,className:`mt-3 text-xs text-danger`,children:r.error}):null,n?(0,Z.jsx)(ac,{onShowOrigin:n}):null]})}function lc({oneTap:e,hasOtherAnswer:t,resuming:n,disabled:r,questionCount:i,onSend:a}){return e&&!t?n?(0,Z.jsx)(`p`,{"data-slot":`ask-resume-hint`,className:`mbs-3 text-[11px] text-soft-foreground`,children:`The session has ended — your answer reopens it and goes to the agent.`}):null:(0,Z.jsxs)(`div`,{className:`mbs-3 flex items-center gap-2.5`,children:[(0,Z.jsx)(W,{size:`sm`,className:`min-h-11`,disabled:r,onClick:a,children:n?`Send answer & reopen`:`Send answer`}),(0,Z.jsx)(`span`,{"data-slot":n?`ask-resume-hint`:`ask-hint`,className:`text-[11px] text-soft-foreground`,children:n?`the session has ended — sending reopens it`:t?`${i>1?`answer each question above`:`enter your answer above`} — or type a reply below`:`${i>1?`answer each question`:`pick one or more`} — or type a reply below`})]})}function uc({question:e,disabled:t,selected:n,isOther:r,otherAnswer:i,onSelect:a,onOtherToggle:s,onOtherChange:c}){let l=(0,X.useId)(),u=e.options,d=u!==void 0&&e.multiSelect===!0,f=e=>{if(!d){a([e]);return}a(n.includes(e)?n.filter(t=>t!==e):[...n,e])};return(0,Z.jsxs)(`div`,{"data-slot":`ask-question`,role:`group`,"aria-label":e.question,children:[(0,Z.jsxs)(`div`,{className:`mb-0.5 flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`rounded-md bg-accent-strong px-1.5 py-0.5 text-[12px] font-semibold uppercase tracking-wide text-accent-strong-foreground`,children:e.header}),d?(0,Z.jsx)(`span`,{className:`ml-auto text-[11px] text-soft-foreground`,children:`select all that apply`}):null]}),(0,Z.jsx)(`p`,{className:`mb-2.5 break-words text-sm font-semibold text-foreground`,children:e.question}),u?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:u.map(e=>{let r=n.includes(e.label);return(0,Z.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":r,onClick:()=>f(e.label),className:o(`flex min-h-11 w-full flex-col gap-0.5 rounded-md border px-3.5 py-2.5 text-left transition-colors`,`hover:border-accent-strong/50 hover:bg-accent-strong/[0.06] [html:not(.light)_&]:hover:bg-card disabled:pointer-events-none disabled:opacity-50`,r?`border-accent-strong/60 bg-accent-strong/[0.06] [html:not(.light)_&]:bg-card`:`border-border bg-card`),children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 text-[14px] font-semibold text-foreground`,children:[d?(0,Z.jsx)(`span`,{"aria-hidden":!0,className:o(`flex size-4 shrink-0 items-center justify-center rounded border text-[12px]`,r?`border-accent-strong bg-accent-strong text-accent-strong-foreground`:`border-soft-foreground`),children:r?`✓`:``}):null,(0,Z.jsx)(`span`,{className:`min-w-0 break-words`,children:e.label})]}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:e.description}):null]},e.label)})}),e.allowFreeText===!1?null:(0,Z.jsxs)(`div`,{className:`mt-2`,children:[(0,Z.jsx)(W,{type:`button`,variant:`outline`,"aria-pressed":r,"aria-expanded":r,"aria-controls":r?l:void 0,disabled:t,onClick:s,className:o(`w-full justify-start text-left`,r&&`border-accent-strong/60 bg-accent-strong/[0.06] [html:not(.light)_&]:bg-card`),children:`Other`}),r?(0,Z.jsxs)(`div`,{className:`mt-2.5`,children:[(0,Z.jsx)(`label`,{htmlFor:l,className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Your answer`}),(0,Z.jsx)(Mn,{id:l,rows:2,value:i,disabled:t,onChange:e=>c(e.target.value),className:`bg-card`})]}):null]})]}):(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{htmlFor:l,className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Your answer`}),(0,Z.jsx)(Mn,{id:l,rows:2,value:i,disabled:t,onChange:e=>c(e.target.value),className:`bg-card`})]})]})}var dc=2e3;function fc(e){let t=0,n=0;for(let r of e)typeof r.seq==`number`&&(r.type===`session.ended`&&r.seq>t&&(t=r.seq),(r.type===`session.started`||r.type===`step-start`&&r.kind===`agent`)&&r.seq>n&&(n=r.seq));return t>n?t:0}function pc(e){let t=0,n=0;for(let r of e)typeof r.seq==`number`&&(r.type===`turn-end`&&r.seq>t&&(t=r.seq),(r.type===`turn.started`||r.type===`session.started`||r.type===`user-message`||r.type===`step-start`&&r.kind===`agent`)&&r.seq>n&&(n=r.seq));return t>n?t:0}function mc(e,t){let n=h(),r=(0,X.useMemo)(()=>fc(t),[t]),i=(0,X.useMemo)(()=>pc(t),[t]),a=e?.id,o=e?.status;(0,X.useEffect)(()=>{if(!(r!==0&&(o===`running`||o===`waiting`))&&!(i!==0&&o===`running`)||a===void 0)return;let e=setTimeout(()=>{n.invalidateQueries({queryKey:E.runs.detail(a)}),n.invalidateQueries({queryKey:E.runs.list()})},dc);return()=>clearTimeout(e)},[r,i,a,o,n])}function hc(e){let t=e.querySelector(`[data-slot="ask-origin"]`);return t&&(t.tabIndex=-1),t}function gc({pendingAskId:e,askSeq:t,rows:n,history:r,jumpToRow:i}){let[a,o]=(0,X.useState)(void 0),s=(0,X.useCallback)(()=>o(e),[e]),c=r?.visibleEvents,l=t!==void 0&&(c?.some(({seq:e})=>e===t)??!1),u=r?.hasOlder??!1,d=r?.isFetchingOlder??!1,f=r?.olderError,p=r?.loadOlder;return(0,X.useEffect)(()=>{if(a===void 0)return;if(a!==e){o(void 0);return}let r=fo(n,a,`origin`);if(r){o(void 0),i(r.key,r.index,hc);return}if(!(p!==void 0&&u&&f===void 0&&t!==void 0&&!l)){o(void 0);return}d||p().catch(()=>{})},[a,e,n,c,l,u,d,f,p,t,i]),{reveal:s,seeking:a!==void 0&&a===e}}function _c(){let e=(0,X.useRef)(null);return(0,X.useLayoutEffect)(()=>{let t=e.current,n=t?.closest(`[data-slot="main"]`),r=t?.querySelector(`[data-slot="run-header"]`),i=t?.querySelector(`[data-slot="thread-dock"]`);if(!n||!r||!i)return;let a=()=>{n.style.setProperty(`--thread-viewport-height`,`${n.clientHeight}px`),n.style.setProperty(`--thread-header-height`,`${r.getBoundingClientRect().height}px`),n.style.setProperty(`--thread-footer-height`,`${i.getBoundingClientRect().height}px`)};a();let o=new ResizeObserver(a);return o.observe(r),o.observe(i),o.observe(n),()=>{o.disconnect(),n.style.removeProperty(`--thread-header-height`),n.style.removeProperty(`--thread-footer-height`),n.style.removeProperty(`--thread-viewport-height`)}},[]),e}function vc(){let{id:e}=ue(),t=j(e),n=sn(e),r=t.data?.status,i=(0,X.useMemo)(()=>mt(n.visibleEvents,{activeTurn:r===`running`}),[n.visibleEvents,r]),a=(0,X.useMemo)(()=>mt(n.currentEvents,{activeTurn:r===`running`}),[n.currentEvents,r]),o=(0,X.useRef)(void 0),s=(0,X.useCallback)(e=>{o.current=e},[]),{mutate:l}=ne();if((0,X.useEffect)(()=>{t.data&&o.current!==t.data.id&&Mt(t.data)&&l(t.data.id)},[l,t.data?.id,t.data?.status,t.data?.finishedAt,t.data?.seenAt,t.data?.archived]),mc(t.data,n.visibleEvents),t.isPending)return(0,Z.jsx)(bn,{});if(t.isError){let e=t.error instanceof c&&t.error.status===404;return(0,Z.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,Z.jsx)(Ft,{icon:e?(0,Z.jsx)(St,{}):(0,Z.jsx)(zn,{}),tone:e?`neutral`:`danger`,title:e?`Task not found`:`Could not load this task`,subtitle:e?`No run has this id. It may have been deleted, or the link is from another machine.`:t.error.message,actions:(0,Z.jsx)(W,{asChild:!0,variant:`outline`,children:(0,Z.jsx)(J,{to:`/`,children:`Back to tasks`})})})})}return n.isPending?(0,Z.jsx)(bn,{}):(0,Z.jsx)(bc,{run:t.data,thread:i,currentThread:a,history:n,onMarkedUnread:s})}var yc=e=>({titles:Object.fromEntries(e.map(e=>[e.id,Y(e)])),backends:Object.fromEntries(e.map(e=>[e.id,e.currentStepBackend??e.runner]))});function bc({run:e,thread:t,currentThread:n=t,history:r,onMarkedUnread:i}){Tt();let a=ce({queryKey:E.runs.list(),queryFn:({signal:e})=>u(re(),{signal:e}),select:yc}),{pendingAsk:o,transcriptAsk:s,pendingAskId:c,historyLoading:d}=xc(r,n),f=l(e),m=ft(e.status,e.error,t),h=fn(e),g=!h&&e.status!==`queued`,_=e.status===`queued`,v=Li(e),y=Yo(e),b=Ho(e.id),x=s||p(e),{hasContinuation:S,continuable:C}=Sc(h,_,v),[w,T]=(0,X.useState)(void 0),[O,k]=(0,X.useState)(e.id);O!==e.id&&(k(e.id),T(void 0));let A=(0,X.useMemo)(()=>w===void 0?void 0:Zi(n.turns,w,g,t.turns),[n.turns,w,g,t.turns]),te=(0,X.useMemo)(()=>w===void 0?[]:ea(t.turns,n.turns,w),[t.turns,n.turns,w]),ne=L(e.id),j=dn(e),{providerBlocked:M,providerReason:N}=Cc(h,rn(e),S,v),{mutateAsync:F}=D(e.id),{mutateAsync:I}=se(e.id),{mutateAsync:ae}=ee(e.id),R=(0,X.useMemo)(()=>_?{onEditTask:async e=>{await F({task:e})},onEditMessage:(e,t)=>I({msgId:e,message:{text:t}}).then(()=>void 0),onRemoveMessage:e=>ae(e).then(()=>void 0)}:void 0,[_,F,I,ae]),z=d?void 0:c??null,oe=(0,X.useMemo)(()=>uo(e,t,n,z),[e,t,n,z]),B=(0,X.useMemo)(()=>ho(oe,e.id),[oe,e.id]),ue=e.delegation?.role===`root`||e.delegation?.role===`worker`,de=ie(e.id,{enabled:ue}),fe=(0,X.useMemo)(()=>({...ya(e,void 0,de.data?.titles),...a.data?.titles,[e.id]:Y(e)}),[e,a.data,de.data]),me=(0,X.useMemo)(()=>({...a.data?.backends,...va(e,void 0)}),[e,a.data]),he=(0,X.useCallback)(t=>(0,Z.jsx)(la,{permission:t,runId:e.id,sessionOpen:h}),[e.id,h]),ge=(0,X.useMemo)(()=>{if(R===void 0)return;let t={task:{onEdit:R.onEditTask,editLabel:`Edit the prompt`}};for(let n of e.queuedMessages??[])t[`queued:${n.id}`]={onEdit:e=>R.onEditMessage(n.id,e),onRemove:()=>R.onRemoveMessage(n.id)};return t},[R,e.queuedMessages]),_e=pe(e,P()),{search:V}=le(),ve=Dr(V,B.length),H=eo(`${e.id}:main`,{onLoadOlder:r?.hasOlder?r.loadOlder:void 0,onJumpToLatest:r?.jumpToLatest,rowKeys:B.map(({key:e})=>e)}),{pinnedAsk:ye,pendingQuestions:be}=wc(oe),xe=gc({pendingAskId:c,askSeq:r?o?.seq:void 0,rows:B,history:r,jumpToRow:H.jumpToRow}),Se=(0,X.useRef)(c);d||(Se.current=c);let Ce=(0,X.useRef)({rows:B,jumpToRow:H.jumpToRow,reveal:xe.reveal});Ce.current={rows:B,jumpToRow:H.jumpToRow,reveal:xe.reveal};let we=(0,X.useCallback)(t=>t.placement===`origin`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t.resolved&&t.context?(0,Z.jsx)(oc,{text:t.context}):null,t.resolved?null:(0,Z.jsx)(Xa,{onGoToQuestion:()=>{let{rows:e,jumpToRow:n}=Ce.current,r=fo(e,t.id,`pinned`);r&&n(r.key,r.index,e=>qa(e))}})]}):(0,Z.jsx)(ic,{ask:t,run:e,onShowOrigin:()=>Ce.current.reveal()}),[e]);return wt(H.restickIfStuck),(0,Z.jsxs)(`div`,{ref:_c(),"data-route":`task-thread`,"data-run-id":e.id,className:`flex min-h-full flex-col`,children:[(0,Z.jsx)(et,{run:e,onMarkedUnread:()=>i?.(e.id)}),(0,Z.jsx)(Tc,{run:e,thread:t,history:r,footer:m,issueUrl:_e,sections:oe,renderAsk:we,renderPermission:he,messageActions:ge,scroll:H,mode:ve,taskTitles:fe,recipientBackends:me}),(0,Z.jsx)(Jo,{status:e.status}),(0,Z.jsx)(wo,{runId:e.id,renderAsk:we,renderPermission:he,agent:A,entries:te,taskTitles:fe,recipientBackends:me,onClose:()=>T(void 0)}),(0,Z.jsx)(Ec,{run:e,thread:t,currentThread:n,currentComplete:r?.currentComplete??!0,scroll:H,pendingQuestions:be,onJump:()=>{let e=be>0?ye?.id:void 0;H.jumpToLatest(e===void 0?void 0:Ja(e,()=>Se.current===e))},onOpenWorker:T,sessionOpen:h,attention:f,queued:_,continuable:C,continueAction:v,stopAction:y,finishAction:b,needsAnswer:x,sendMessage:ne,reply:j,providerBlocked:M,providerReason:N}),(0,Z.jsx)(`div`,{"data-slot":`thread-tail-anchor`,"aria-hidden":`true`,className:`h-px shrink-0 md:hidden`})]})}function xc(e,t){let n=e?ut(e.currentEvents):void 0;return{pendingAsk:n,transcriptAsk:e?n!==void 0:t.turns.some(e=>e.items.some(e=>e.kind===`ask`&&!e.resolved)),pendingAskId:e?n?.requestId:t.turns.flatMap(e=>e.items).reverse().find(e=>e.kind===`ask`&&!e.resolved)?.id,historyLoading:e!==void 0&&(e.isPending||e.contextPending)}}function Sc(e,t,n){let r=!e&&!t&&n.available;return{hasContinuation:r,continuable:r&&n.canContinue}}function Cc(e,t,n,r){let i=e&&!t.usable,a=n&&!r.canContinue;return{providerBlocked:i||a,providerReason:i?t.reason:r.reason}}function wc(e){let t=e.at(-1),n=t?.id===`pending-ask`?t.entries[0]:void 0;return{pinnedAsk:n,pendingQuestions:n?.kind===`ask`?n.questions.length:0}}function Tc({run:e,thread:t,history:n,footer:r,issueUrl:i,sections:s,renderAsk:c,renderPermission:l,messageActions:u,scroll:d,mode:f,taskTitles:p,recipientBackends:m}){return(0,Z.jsxs)(`div`,{"data-slot":`session-conversation`,className:`mx-auto flex w-full max-w-[var(--measure)] flex-1 flex-col gap-2.5 px-[18px] py-3 md:gap-3.5 md:px-16 md:py-5`,children:[n?(0,Z.jsx)(jc,{hasOlder:n.hasOlder,loading:n.isFetchingOlder,error:n.olderError,fallback:n.fallback,retainedPages:n.retainedPages,onLoad:d.loadOlder}):null,(0,Z.jsx)(go,{runId:e.id,viewId:`main`,sections:s,mode:`document`,renderAsk:c,renderPermission:l,messageActions:u,scrollControls:d,renderMode:f,taskTitles:p,recipientBackends:m}),t.turns.length===0?e.status===`queued`?(0,Z.jsx)(Mc,{run:e}):(0,Z.jsx)(`p`,{"data-slot":`thread-empty`,className:`py-6 text-center text-xs text-soft-foreground`,children:`No session events yet.`}):null,e.status===`running`?(0,Z.jsx)(ci,{}):null,r&&r.state===`closed`?(0,Z.jsxs)(`div`,{"data-slot":`thread-footer`,"data-state":r.state,className:o(`mt-auto flex items-center gap-2 border-t border-border pt-3 text-xs`,r.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[r.label,a(me(e))?(0,Z.jsx)(`a`,{"data-slot":`pr-link`,href:me(e),target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`PR ↗`}):null,a(i)?(0,Z.jsx)(`a`,{"data-slot":`issue-link`,href:i,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`Issue ↗`}):null]}):null,e.status===`review`?(0,Z.jsx)(Uo,{run:e}):null]})}function Ec({run:e,thread:t,currentThread:n,currentComplete:r,scroll:i,pendingQuestions:a,onJump:o,onOpenWorker:s,sessionOpen:c,attention:l,queued:u,continuable:d,continueAction:p,stopAction:m,finishAction:h,needsAnswer:g,sendMessage:_,reply:v,providerBlocked:y,providerReason:b}){return(0,Z.jsxs)(`div`,{"data-slot":`thread-dock`,className:`relative z-10 bg-background pt-1 pb-2 md:pt-1.5 md:pb-4`,children:[i.pillVisible?(0,Z.jsx)(`div`,{"data-slot":`thread-jump`,className:`pointer-events-none z-30 flex justify-center`,children:(0,Z.jsx)(io,{pendingQuestions:a,onJump:o})}):null,(0,Z.jsxs)(`div`,{"data-slot":`thread-footer-content`,className:`mx-auto flex w-full max-w-[var(--measure)] flex-col gap-1.5 px-[14px] md:gap-2.5 md:px-16`,children:[(0,Z.jsx)(Ps,{run:e,thread:t,currentThread:n,currentComplete:r,onOpenWorker:s,readerScroll:i.subscribeReaderScroll},e.id),(0,Z.jsx)(Hn,{run:e}),e.status===`waiting`&&c?(0,Z.jsxs)(`div`,{"data-slot":`paused-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Nt,{tone:l.tone,shape:l.shape,pulse:l.pulse}),l.bucket===`permission`?`Choose an approval option above to continue`:l.bucket===`waiting`?`The agent is paused, waiting for your reply`:`${l.label.charAt(0).toUpperCase()}${l.label.slice(1)} — you can send a message to resume`]}):null,u?(0,Z.jsxs)(`div`,{"data-slot":`queued-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Nt,{tone:`neutral`,shape:`ring`}),`Messages you add now are folded into the prompt before the run starts.`]}):null,d&&e.removedRunner!==void 0?(0,Z.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,role:`status`,children:f(e.removedRunner)}):d&&p.startsNewConversation?(0,Z.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,role:`status`,children:`Starts a new agent conversation.`}):null,(0,Z.jsx)(Oc,{run:e,thread:t,stopAction:m,finishAction:h,attention:l,needsAnswer:g,continuable:d,continueAction:p,queued:u,sendMessage:_,reply:v,providerBlocked:y,providerReason:b,sessionOpen:c})]})]})}function Dc(e,t,n){if(t)return{skillRunner:n.skillRunner,skillAccount:n.skillAccount};let r=e.steps.find(t=>t.id===e.currentStepId),i=e.workflowDef?.steps.find(t=>t.id===e.currentStepId);return{skillRunner:r?.backend??i?.runner??e.runner,skillAccount:r?.profileId??i?.agentProfile??e.agentProfile}}function Oc({run:e,thread:t,stopAction:n,finishAction:r,attention:i,needsAnswer:a,continuable:o,continueAction:s,queued:c,sendMessage:l,reply:u,providerBlocked:d,providerReason:f,sessionOpen:p}){let m=Ve(e);return(0,Z.jsx)(Qt,{...Dc(e,o,s),onStop:pn(e,m).cancel?n.stop:void 0,onFinish:_n(e)?()=>r.mutateAsync().catch(()=>void 0):void 0,finishing:r.isPending,secondaryAction:mn(e,m)?(0,Z.jsx)(rt,{run:e,compactOnMobile:!0}):void 0,stopOnEmpty:kc(e,i,a),stopping:n.stopping,retainDraftUntilSuccess:!0,compactFeedback:!0,pendingLabel:o?`Continuing…`:`Sending…`,failureHint:`Your draft is kept. Check the task status and connection, then retry.`,sessionControls:o?s.pills:void 0,onSubmit:o?(e,t)=>s.continueWith(e,t):c?(e,t)=>l.mutateAsync({text:e,images:t}):async(e,t)=>{let n=await u.send(e,t);if(n!==void 0)throw Error(n)},disabled:d||!p&&!c&&!o,disabledReason:d?f:`Session closed — no session to resume.`,footerEnd:d&&!s.providerPending?(0,Z.jsx)(J,{to:`/settings/agent-defaults#providers`,className:`text-xs font-medium text-foreground underline underline-offset-4`,children:`Configure providers`}):void 0,allowEmptySubmit:o&&!a,emptySubmitLabel:o&&!a?`Continue`:void 0,placeholder:Ac(e,c,o),autocompleteSkills:!0,quickReplies:!0,getMentionCandidates:()=>gt(t)})}function kc(e,t,n){return e.status===`queued`||e.status===`running`||e.status===`waiting`&&t.bucket===`none`&&!n}function Ac(e,t,n){return t?`Add to the prompt — sent when the run starts…`:n?`Continue — add a prompt, or send to just reopen the session…`:e.status===`waiting`?`Reply — / for skills, @ for files…`:`Message the agent — / for skills, @ for files…`}function jc({hasOlder:e,loading:t,error:n,fallback:r,retainedPages:i,onLoad:a}){return r?(0,Z.jsx)(`p`,{"data-slot":`history-fallback`,className:`text-center text-xs text-soft-foreground`,role:`status`,children:`Progressive history is unavailable; showing the complete session.`}):!e&&!n?(0,Z.jsxs)(`div`,{"data-slot":`history-start`,className:`flex items-center gap-3 text-[11px] text-soft-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`}),`Start of session`,(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`})]}):(0,Z.jsxs)(`div`,{"data-slot":`history-boundary`,"data-retained-pages":i,"aria-busy":t,className:`flex min-h-8 items-center justify-center text-xs text-muted-foreground`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:a,disabled:t,className:`rounded-md px-3 py-1.5 font-medium hover:bg-muted disabled:cursor-wait`,children:t?`Loading 100 earlier items…`:n?`Couldn’t load earlier items · Retry`:`Load 100 earlier items`}),(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:t?`Loading earlier session history`:n||``})]})}function Mc({run:e}){let t=en(R().data??[],e.id);return(0,Z.jsxs)(`div`,{"data-slot":`queued-state`,className:`flex flex-col items-center gap-1.5 py-10 text-center`,children:[(0,Z.jsx)(Nt,{tone:`neutral`,shape:`ring`}),(0,Z.jsxs)(`p`,{className:`text-[13px] font-medium`,children:[`Waiting for a free agent slot`,t===void 0?``:` — #${t} in queue`]}),(0,Z.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[e.workflow,` · starts automatically when a slot frees up`]})]})}export{vc as TaskThreadRoute};
@@ -1 +0,0 @@
1
- .session-composer [data-slot=composer-editor]{border-color:var(--ring);border-radius:12px}.session-composer [data-slot=session-controls]{padding-block:0 10px;padding-inline:12px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content;gap:8px;min-width:0;display:grid}.session-engine-controls [data-slot$=pill]{width:100%;min-width:0}.session-engine-controls [data-slot$=pill]>svg:last-child{margin-inline-start:auto}.session-engine-controls [data-slot=session-runner-value]{width:100%;min-width:0}.session-composer [data-slot=composer-toolbar]{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-block:0 12px;padding-inline:12px;display:grid}.session-composer [data-slot=composer-toolbar]>[data-slot=session-controls]{grid-area:1/1/auto/-1;min-width:0;padding:0}.session-composer [data-slot=composer-footer-start]{flex-wrap:nowrap;grid-area:2/1;gap:8px}.session-composer [aria-label=Attach\ files],.session-composer [aria-label=Start\ dictation]{border:1px solid var(--border);border-radius:9px;width:44px;height:44px}.session-composer [data-slot=follow-up-model-pill]{min-height:44px}.session-composer [data-slot=follow-up-model-pill]>svg:last-child{margin-inline-start:auto}.session-composer [data-slot=composer-submit-row]{flex:none;grid-area:2/2;margin:0}[data-slot=run-actions-menu] [role^=menuitem]{min-height:44px}[data-route=task-thread] [data-slot=thread-dock]{container:thread-dock/inline-size}[data-route=task-thread] [data-slot=thread-jump]{position:fixed;inset-block-end:calc(24px + env(safe-area-inset-bottom,0px));inset-inline-end:24px}@media (width>=768px){[data-slot=main]:has([data-route=task-thread]){scroll-padding-block:calc(var(--thread-header-height,0px) + 8px) calc(var(--thread-footer-height,0px) + 8px)}[data-route=task-thread] [data-slot=thread-dock]{position:sticky;inset-block-end:0}[data-route=task-thread] [data-slot=thread-jump]{margin-block-end:8px;position:absolute;inset-block-end:100%}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(60dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - var(--spacing) * 5.5));max-block-size:var(--thread-footer-limit)}[data-route=task-thread] [data-slot=thread-footer-content]>:not([data-slot=run-activity-dock]){flex-shrink:0}[data-route=task-thread] [data-slot=run-activity-dock]{overscroll-behavior-block:contain;min-block-size:46px;overflow-y:auto}[data-route=task-thread] [data-slot=thread-footer-content]>[data-slot=composer]{min-block-size:0;max-block-size:calc(var(--thread-footer-limit) - 46px - var(--spacing) * 2.5);flex-direction:column;display:flex}[data-route=task-thread] [data-slot=composer-editor]{flex-direction:column;min-block-size:0;display:flex;overflow-y:auto}[data-route=task-thread] [data-slot=composer-editor]>textarea{flex-shrink:1;min-block-size:44px}[data-route=task-thread] [data-slot=composer-thumbs]{flex-wrap:nowrap;flex-shrink:0;max-block-size:60px;overflow:auto}[data-route=task-thread] [data-slot=composer-toolbar]{flex-shrink:0}@container thread-dock (width<=680px){[data-slot=thread-dock]>div{padding-inline:8px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill]){gap:6px;padding-inline:8px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=follow-up-effort-pill])>svg:last-child{display:none}}@container thread-dock (width<=400px){.session-composer [data-slot=archive-action]{width:44px;min-width:44px;padding-inline:0}.session-composer [data-slot=archive-action]>span{display:none}}}@media (width<=767px){[data-slot=run-title-row]>.group{max-width:calc(100% - 52px)}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr)}.session-engine-controls [data-slot=follow-up-model-pill]{grid-area:2/1/auto/-1}.session-engine-controls [data-slot=follow-up-effort-pill]{grid-area:1/2}.task-open-targets{flex-direction:column;align-items:flex-start}}[data-route=task-thread] [data-slot=assistant-message] :is(h1,h2,h3,h4,strong,[data-streamdown=strong]){color:var(--foreground)}[data-route=task-thread] [data-slot=assistant-message] h2{font-size:20px;line-height:1.4}@media (width<=767px){[data-route=task-thread] [data-slot=assistant-message] h2{letter-spacing:-.4px;font-size:18px}}[data-route=task-thread] .session-composer [data-slot=composer-editor]{border-color:var(--composer-border)}[data-route=task-thread] [data-slot=session-conversation]{overflow-anchor:none}@media (width<=767px){[data-route=task-thread] [data-slot=thread-dock]{overflow-anchor:none}[data-route=task-thread] [data-slot=thread-tail-anchor]{overflow-anchor:auto}}[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 5.5) calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:is(p,ul,ol,table,blockquote){margin-block:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:first-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:first-child{margin-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:last-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:last-child{margin-block-end:0}@media (width<=767px){[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 3.5)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 3.5)}}[data-route=task-thread] [data-slot=thread-footer][data-state=closed]{border-block-start:0;margin-block-start:0;padding-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child){margin-block-end:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child)+p{margin-block-start:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=tool-card]{background:var(--task-brand-bg);border-radius:7px}[data-route=task-thread] [data-slot=tool-card]>button{padding-block:calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-card]>[data-slot=collapsible-content]>div{background:0 0;border-block-start:0}[data-route=task-thread] [data-slot=tool-output] pre,[data-route=task-thread] [data-slot=tool-error]{padding-block:calc(var(--spacing) * 2) calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-output-fade]{--tw-gradient-to:var(--task-brand-bg)}[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=session-conversation],[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=thread-dock]>div{padding-inline:18px}