@kortix/ui 0.15.11 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/dist/_vendor/kortix-shared.js +478 -179
  2. package/dist/_vendor/shared/my-kortix-agent.d.ts +5 -3
  3. package/dist/_vendor/shared/session/attachment-tile.d.ts +8 -0
  4. package/dist/_vendor/shared/workspace-settings.d.ts +3 -0
  5. package/dist/access/access/copy-row.d.ts +7 -1
  6. package/dist/access/access/copy-row.js +2 -2
  7. package/dist/animated-copy-icon.js +2 -1
  8. package/dist/browser/sandbox-browser-chrome.d.ts +2 -1
  9. package/dist/browser/sandbox-browser-chrome.js +1 -1
  10. package/dist/customize/agents/agent-cover-card.d.ts +1 -1
  11. package/dist/customize/agents/agent-cover-card.js +10 -2
  12. package/dist/customize/agents/agent-filter.js +3 -1
  13. package/dist/customize/agents/agent-overview.d.ts +10 -0
  14. package/dist/customize/agents/agent-overview.js +5 -4
  15. package/dist/customize/agents/agent-page-chrome.d.ts +5 -6
  16. package/dist/customize/agents/agent-page-chrome.js +16 -13
  17. package/dist/customize/agents/agent-page.js +6 -28
  18. package/dist/customize/agents/agent-tabs.d.ts +1 -0
  19. package/dist/customize/agents/agent-tabs.js +1 -0
  20. package/dist/customize/agents/agents-page.js +3 -3
  21. package/dist/customize/agents/create-agent-modal.d.ts +9 -0
  22. package/dist/customize/agents/create-agent-modal.js +21 -3
  23. package/dist/customize/agents/use-default-agent.js +2 -2
  24. package/dist/customize/connectors/connector-identity.d.ts +11 -2
  25. package/dist/customize/connectors/connector-identity.js +16 -4
  26. package/dist/customize/connectors/connectors-page.js +10 -6
  27. package/dist/customize/connectors/detail/app-page.js +2 -2
  28. package/dist/customize/connectors/install/install-dialog.d.ts +2 -0
  29. package/dist/customize/connectors/install/install-dialog.js +6 -1
  30. package/dist/customize/connectors/use-agent-access.d.ts +1 -0
  31. package/dist/customize/evals/eval-compare-view.d.ts +10 -0
  32. package/dist/customize/evals/eval-compare-view.js +68 -0
  33. package/dist/customize/evals/eval-dataset-view.d.ts +20 -0
  34. package/dist/customize/evals/eval-dataset-view.js +81 -0
  35. package/dist/customize/evals/eval-datasets-page.d.ts +25 -0
  36. package/dist/customize/evals/eval-datasets-page.js +91 -0
  37. package/dist/customize/evals/eval-job-view.d.ts +12 -0
  38. package/dist/customize/evals/eval-job-view.js +360 -0
  39. package/dist/customize/evals/eval-jobs-page.d.ts +4 -0
  40. package/dist/customize/evals/eval-jobs-page.js +69 -0
  41. package/dist/customize/evals/eval-meta.d.ts +97 -0
  42. package/dist/customize/evals/eval-meta.js +228 -0
  43. package/dist/customize/evals/eval-task-view.d.ts +13 -0
  44. package/dist/customize/evals/eval-task-view.js +123 -0
  45. package/dist/customize/evals/eval-tasks-page.d.ts +8 -0
  46. package/dist/customize/evals/eval-tasks-page.js +56 -0
  47. package/dist/customize/evals/eval-ui.d.ts +97 -0
  48. package/dist/customize/evals/eval-ui.js +153 -0
  49. package/dist/customize/evals/evals-page.d.ts +10 -0
  50. package/dist/customize/evals/evals-page.js +56 -0
  51. package/dist/customize/evals/run-eval-modal.d.ts +28 -0
  52. package/dist/customize/evals/run-eval-modal.js +167 -0
  53. package/dist/customize/project-settings/project-admin-sections.d.ts +3 -2
  54. package/dist/customize/project-settings/project-admin-sections.js +6 -1
  55. package/dist/customize/providers/provider-connect.d.ts +13 -0
  56. package/dist/customize/providers/provider-connect.js +29 -5
  57. package/dist/customize/providers/provider-sheet.js +5 -4
  58. package/dist/customize/sections/view/gateway/gateway-overview.d.ts +5 -0
  59. package/dist/customize/sections/view/gateway/gateway-overview.js +32 -6
  60. package/dist/customize/sections/view/gateway/routing-parts.d.ts +6 -0
  61. package/dist/customize/sections/view/gateway/routing-parts.js +21 -13
  62. package/dist/customize/sections/view/git-view.d.ts +19 -1
  63. package/dist/customize/sections/view/git-view.js +7 -3
  64. package/dist/customize/sections/view/manifest-issue-list.d.ts +16 -0
  65. package/dist/customize/sections/view/manifest-issue-list.js +41 -0
  66. package/dist/customize/sections/view/manifest-issues-row.d.ts +24 -0
  67. package/dist/customize/sections/view/manifest-issues-row.js +39 -0
  68. package/dist/customize/sections/view/sandbox-provider-coverage.d.ts +7 -1
  69. package/dist/customize/sections/view/sandbox-provider-coverage.js +7 -5
  70. package/dist/customize/sections/view/secrets-view.d.ts +13 -0
  71. package/dist/customize/sections/view/secrets-view.js +10 -6
  72. package/dist/customize/sections/view/subscription-usage.d.ts +2 -7
  73. package/dist/customize/sections/view/subscription-usage.js +4 -8
  74. package/dist/customize/settings/settings-tab-header.js +12 -3
  75. package/dist/customize/settings/tabs/experimental-tab.d.ts +16 -5
  76. package/dist/customize/settings/tabs/experimental-tab.js +36 -11
  77. package/dist/customize/settings/tabs/general-tab.js +1 -1
  78. package/dist/customize/settings/tabs/sandbox-tab.d.ts +10 -0
  79. package/dist/customize/settings/tabs/sandbox-tab.js +27 -4
  80. package/dist/customize/settings/tabs/snapshots-tab.d.ts +31 -0
  81. package/dist/customize/settings/tabs/snapshots-tab.js +61 -5
  82. package/dist/customize/settings/tabs/workspace-keys.js +6 -3
  83. package/dist/customize/shared/capability-page-shell.js +9 -1
  84. package/dist/customize/shared/catalog/catalog-card.d.ts +1 -1
  85. package/dist/customize/shared/catalog/catalog-card.js +15 -5
  86. package/dist/customize/shared/customize-tab-bar.js +1 -1
  87. package/dist/customize/shared/new-entity-menu.d.ts +1 -1
  88. package/dist/customize/shared/new-entity-menu.js +38 -1
  89. package/dist/customize/triggers/runtime-triggers.d.ts +4 -0
  90. package/dist/customize/triggers/runtime-triggers.js +21 -2
  91. package/dist/customize/triggers/schedule/post-to-field.js +2 -2
  92. package/dist/customize/triggers/schedule-view.js +2 -1
  93. package/dist/files/project/components/drive-explorer.js +33 -70
  94. package/dist/files/project/components/drive-grid-view.d.ts +2 -31
  95. package/dist/files/project/components/drive-grid-view.js +12 -22
  96. package/dist/files/project/components/drive-list-view.d.ts +3 -30
  97. package/dist/files/project/components/drive-list-view.js +8 -18
  98. package/dist/files/project/components/drive-selection-bar.d.ts +4 -5
  99. package/dist/files/project/components/drive-selection-bar.js +13 -20
  100. package/dist/files/project/components/explorer-listing.d.ts +48 -0
  101. package/dist/files/project/components/explorer-listing.js +64 -0
  102. package/dist/files/project/components/file-explorer-page.js +7 -204
  103. package/dist/files/project/components/file-thumbnail.js +3 -1
  104. package/dist/files/project/components/manifest-issue-mark.d.ts +9 -0
  105. package/dist/files/project/components/manifest-issue-mark.js +26 -0
  106. package/dist/files/project/hooks/use-change-requests.d.ts +10 -0
  107. package/dist/files/project/hooks/use-change-requests.js +17 -0
  108. package/dist/files/project/manifest-annotations.d.ts +16 -0
  109. package/dist/files/project/manifest-annotations.js +19 -0
  110. package/dist/files/project/store/version-store.d.ts +1 -1
  111. package/dist/files/project/upload-batch.d.ts +20 -0
  112. package/dist/files/project/upload-batch.js +20 -0
  113. package/dist/files/runtime/hooks/use-binary-blob.js +3 -2
  114. package/dist/files/runtime/hooks/use-file-content.js +3 -2
  115. package/dist/files/runtime/hooks/use-file-list.js +1 -2
  116. package/dist/files/runtime/hooks/use-file-mutations.js +69 -6
  117. package/dist/files/runtime/hooks/use-file-refresh.d.ts +4 -0
  118. package/dist/files/runtime/hooks/use-file-refresh.js +6 -0
  119. package/dist/files/tree/components/file-tree-item.js +1 -4
  120. package/dist/files/viewer/file-annotations.d.ts +18 -0
  121. package/dist/files/viewer/file-annotations.js +21 -0
  122. package/dist/files/viewer/file-content-renderer.js +1 -1
  123. package/dist/files/viewer/file-viewer.js +2 -1
  124. package/dist/files/viewer/index.d.ts +1 -0
  125. package/dist/files/viewer/index.js +1 -0
  126. package/dist/files/viewer/use-file-content-state.js +8 -1
  127. package/dist/i18n/en.d.ts +495 -46
  128. package/dist/i18n/en.js +536 -87
  129. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -4
  130. package/dist/icons/caret-right-solid.d.ts +11 -0
  131. package/dist/icons/caret-right-solid.js +15 -0
  132. package/dist/internal/auth/auth-art.d.ts +12 -0
  133. package/dist/internal/auth/auth-art.js +118 -0
  134. package/dist/internal/auth/auth-card-shell.d.ts +14 -10
  135. package/dist/internal/auth/auth-card-shell.js +20 -31
  136. package/dist/internal/auth/auth-consent.d.ts +3 -1
  137. package/dist/internal/auth/auth-consent.js +2 -2
  138. package/dist/internal/auth/auth-primitives.d.ts +26 -1
  139. package/dist/internal/auth/auth-primitives.js +37 -8
  140. package/dist/internal/connector-logo/connector-logo.d.ts +2 -1
  141. package/dist/internal/connector-logo/connector-logo.js +11 -2
  142. package/dist/internal/files/file-read-retry.d.ts +18 -2
  143. package/dist/internal/files/file-read-retry.js +42 -4
  144. package/dist/internal/hooks/projects/use-new-project-session.js +5 -10
  145. package/dist/internal/hooks/use-auto-scroll-physics.d.ts +1 -1
  146. package/dist/internal/hooks/use-auto-scroll-physics.js +2 -10
  147. package/dist/internal/hooks/use-reduced-motion.d.ts +4 -0
  148. package/dist/internal/hooks/use-reduced-motion.js +12 -0
  149. package/dist/internal/hooks/use-save-shortcut.d.ts +8 -0
  150. package/dist/internal/hooks/use-save-shortcut.js +28 -0
  151. package/dist/internal/layout/connect-mcp-modal.d.ts +1 -1
  152. package/dist/internal/layout/connect-mcp-modal.js +9 -4
  153. package/dist/internal/layout/panel-chrome.d.ts +28 -0
  154. package/dist/internal/layout/panel-chrome.js +27 -0
  155. package/dist/internal/layout/project-page-header.js +5 -1
  156. package/dist/internal/lib/browser-noise/rules/webview.js +16 -0
  157. package/dist/internal/lib/manifest-health.d.ts +25 -1
  158. package/dist/internal/lib/manifest-health.js +56 -0
  159. package/dist/internal/lib/project-preamble.js +1 -1
  160. package/dist/internal/lib/web-notifications.d.ts +1 -1
  161. package/dist/internal/lib/web-notifications.js +3 -0
  162. package/dist/internal/notifications/notification-inbox.js +2 -1
  163. package/dist/internal/notifications/notification-rows.d.ts +1 -1
  164. package/dist/internal/notifications/notification-rows.js +15 -1
  165. package/dist/internal/selection/selection-bar.d.ts +2 -8
  166. package/dist/internal/selection/selection-bar.js +15 -38
  167. package/dist/internal/stores/active-space-store.d.ts +1 -1
  168. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  169. package/dist/internal/stores/current-account-store.d.ts +1 -1
  170. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  171. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  172. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  173. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  174. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  175. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  176. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  177. package/dist/internal/stores/sound-store.d.ts +1 -1
  178. package/dist/internal/stores/tab-store.d.ts +1 -1
  179. package/dist/internal/stores/user-preferences-store.d.ts +9 -1
  180. package/dist/internal/stores/user-preferences-store.js +2 -0
  181. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  182. package/dist/lib/base-ui-compat.js +28 -1
  183. package/dist/lib/dotmatrix-hooks.d.ts +1 -0
  184. package/dist/lib/dotmatrix-hooks.js +3 -13
  185. package/dist/lib/reduced-motion.d.ts +10 -0
  186. package/dist/lib/reduced-motion.js +104 -0
  187. package/dist/lib/routes.d.ts +9 -0
  188. package/dist/lib/routes.js +7 -4
  189. package/dist/markdown/artifact-link.d.ts +11 -0
  190. package/dist/markdown/artifact-link.js +62 -0
  191. package/dist/markdown/code/index.d.ts +1 -1
  192. package/dist/markdown/code/index.js +1 -1
  193. package/dist/markdown/code/inline-code.d.ts +1 -1
  194. package/dist/markdown/code/inline-code.js +1 -1
  195. package/dist/markdown/genui/components/map-canvas.js +2 -1
  196. package/dist/markdown/index.d.ts +3 -1
  197. package/dist/markdown/index.js +2 -1
  198. package/dist/markdown/{code/inline-chip.js → inline-chip.js} +2 -2
  199. package/dist/markdown/inline-code-text.d.ts +34 -0
  200. package/dist/markdown/inline-code-text.js +68 -0
  201. package/dist/markdown/setup-links/approval-decision.js +3 -3
  202. package/dist/markdown/soft-breaks.d.ts +21 -0
  203. package/dist/markdown/soft-breaks.js +33 -0
  204. package/dist/markdown/unified-markdown.d.ts +9 -1
  205. package/dist/markdown/unified-markdown.js +31 -9
  206. package/dist/primitives/action-bar.d.ts +50 -0
  207. package/dist/primitives/action-bar.js +87 -0
  208. package/dist/primitives/calendar.js +4 -2
  209. package/dist/primitives/inline-meta.js +2 -2
  210. package/dist/primitives/kortix-loader.js +2 -1
  211. package/dist/primitives/modal.d.ts +1 -1
  212. package/dist/primitives/paper-wallpaper-shaders.d.ts +1 -0
  213. package/dist/primitives/paper-wallpaper-shaders.js +6 -0
  214. package/dist/primitives/resizable.d.ts +1 -1
  215. package/dist/primitives/resize-seam.d.ts +3 -2
  216. package/dist/primitives/resize-seam.js +4 -3
  217. package/dist/primitives/settings-section-header.d.ts +30 -1
  218. package/dist/primitives/settings-section-header.js +37 -0
  219. package/dist/primitives/sliding-tab-indicator.js +2 -1
  220. package/dist/primitives/switch.js +15 -8
  221. package/dist/primitives/text-shimmer.js +6 -0
  222. package/dist/primitives/toast-clearance.d.ts +52 -0
  223. package/dist/primitives/toast-clearance.js +116 -0
  224. package/dist/primitives/toast.d.ts +3 -1
  225. package/dist/primitives/toast.js +2 -0
  226. package/dist/primitives/typed-title.js +1 -1
  227. package/dist/primitives/wallpaper-shaders.js +1 -1
  228. package/dist/session/actions/project-session-list-helpers.d.ts +16 -0
  229. package/dist/session/actions/project-session-list-helpers.js +18 -0
  230. package/dist/session/agents/agent-model.d.ts +1 -0
  231. package/dist/session/agents/agent-model.js +2 -1
  232. package/dist/session/agents/agent-strip.js +10 -4
  233. package/dist/session/agents/workflow-run-controls.d.ts +27 -4
  234. package/dist/session/agents/workflow-run-controls.js +63 -10
  235. package/dist/session/composer/ComposerCard.js +3 -0
  236. package/dist/session/composer/agent-selector.js +6 -4
  237. package/dist/session/composer/animated-placeholder.js +2 -1
  238. package/dist/session/composer/attachment-tile.d.ts +2 -2
  239. package/dist/session/composer/attachment-tile.js +25 -3
  240. package/dist/session/composer/composer-agent-access.d.ts +10 -1
  241. package/dist/session/composer/composer-agent-access.js +18 -4
  242. package/dist/session/composer/composer-chat-input.js +7 -2
  243. package/dist/session/composer/composer.d.ts +2 -2
  244. package/dist/session/composer/composer.js +7 -6
  245. package/dist/session/composer/hooks/use-file-search.d.ts +12 -2
  246. package/dist/session/composer/hooks/use-file-search.js +71 -7
  247. package/dist/session/composer/menus/menu-items.js +6 -2
  248. package/dist/session/composer/menus/menu-shell.d.ts +3 -1
  249. package/dist/session/composer/menus/menu-shell.js +2 -2
  250. package/dist/session/composer/menus/slash-menu.d.ts +7 -0
  251. package/dist/session/composer/menus/slash-menu.js +48 -1
  252. package/dist/session/composer/use-instant-session-send.js +7 -1
  253. package/dist/session/header/session-reminders-indicator.js +3 -2
  254. package/dist/session/header/session-site-header.js +24 -6
  255. package/dist/session/media/sandbox-url-detector.js +1 -1
  256. package/dist/session/models/model-connection-gate.js +2 -1
  257. package/dist/session/models/model-selector.js +1 -1
  258. package/dist/session/models/subscription-switcher.d.ts +7 -0
  259. package/dist/session/models/subscription-switcher.js +52 -10
  260. package/dist/session/models/subscription-windows.d.ts +2 -0
  261. package/dist/session/models/subscription-windows.js +2 -0
  262. package/dist/session/outcomes/session-outcomes-provider.js +14 -7
  263. package/dist/session/panel/action-panel.js +8 -19
  264. package/dist/session/panel/easy/app-preview.d.ts +4 -1
  265. package/dist/session/panel/easy/app-preview.js +95 -33
  266. package/dist/session/panel/easy/apps-card.js +6 -11
  267. package/dist/session/panel/easy/change-requests-card.js +1 -1
  268. package/dist/session/panel/easy/changes-card.d.ts +14 -0
  269. package/dist/session/panel/easy/changes-card.js +60 -0
  270. package/dist/session/panel/easy/context-card.d.ts +5 -1
  271. package/dist/session/panel/easy/context-card.js +13 -28
  272. package/dist/session/panel/easy/context-meter.d.ts +18 -0
  273. package/dist/session/panel/easy/context-meter.js +73 -0
  274. package/dist/session/panel/easy/detail-view.d.ts +1 -1
  275. package/dist/session/panel/easy/detail-view.js +24 -21
  276. package/dist/session/panel/easy/easy-panel.js +7 -5
  277. package/dist/session/panel/easy/file-preview.js +3 -1
  278. package/dist/session/panel/easy/frame-history.d.ts +91 -0
  279. package/dist/session/panel/easy/frame-history.js +198 -0
  280. package/dist/session/panel/easy/outputs-card.d.ts +10 -0
  281. package/dist/session/panel/easy/outputs-card.js +28 -31
  282. package/dist/session/panel/easy/panel-card.d.ts +1 -3
  283. package/dist/session/panel/easy/panel-card.js +24 -8
  284. package/dist/session/panel/easy/plan-card.js +2 -2
  285. package/dist/session/panel/easy/step-icon.d.ts +4 -1
  286. package/dist/session/panel/easy/step-icon.js +2 -2
  287. package/dist/session/panel/session-action-panel-column.d.ts +5 -0
  288. package/dist/session/panel/session-action-panel-column.js +198 -101
  289. package/dist/session/panel/session-desktop.js +5 -1
  290. package/dist/session/panel/session-diff-viewer.d.ts +3 -1
  291. package/dist/session/panel/session-diff-viewer.js +7 -4
  292. package/dist/session/panel/session-panel-provider.js +29 -5
  293. package/dist/session/panel/shared/derive-panels.js +64 -4
  294. package/dist/session/status/session-busy-indicator.js +2 -1
  295. package/dist/session/status/session-error-banner.js +1 -1
  296. package/dist/session/thread/chat-minimap.js +2 -1
  297. package/dist/session/thread/session-body.js +4 -1
  298. package/dist/session/thread/session-chat.js +18 -3
  299. package/dist/session/thread/session-turn-meta-rows.d.ts +13 -5
  300. package/dist/session/thread/session-turn-meta-rows.js +33 -5
  301. package/dist/session/thread/transcript.d.ts +1 -2
  302. package/dist/session/thread/transcript.js +26 -24
  303. package/dist/session/thread/typing-indicator.d.ts +2 -2
  304. package/dist/session/thread/typing-indicator.js +10 -3
  305. package/dist/session/tool/tools/session-spawn-tool.js +3 -3
  306. package/dist/session/tool/tools/workflow-run-card.d.ts +11 -1
  307. package/dist/session/tool/tools/workflow-run-card.js +31 -7
  308. package/dist/session/tool/tools/workflow-run-cost.d.ts +29 -0
  309. package/dist/session/tool/tools/workflow-run-cost.js +75 -0
  310. package/dist/session/tool/tools/workflow-tool.d.ts +1 -1
  311. package/dist/session/tool/tools/workflow-tool.js +40 -15
  312. package/dist/session/turn/peer-message-row.js +1 -1
  313. package/dist/session/turn/queued-prompt-bubbles.d.ts +3 -2
  314. package/dist/session/turn/queued-prompt-bubbles.js +1 -1
  315. package/dist/session/turn/throttled-markdown.js +1 -1
  316. package/dist/styles/theme.css +68 -0
  317. package/dist/styles.css +1 -1
  318. package/dist/terminal/pty-terminal.js +1 -1
  319. package/dist/terminal/session-terminal-connect-bar.js +2 -1
  320. package/dist/test-utils/intl.d.ts +495 -46
  321. package/dist/workspace/admin/project-admin-dashboard.js +21 -7
  322. package/dist/workspace/admin/settings-search-landing.js +2 -1
  323. package/dist/workspace/calendar/calendar-dates.d.ts +31 -0
  324. package/dist/workspace/calendar/calendar-dates.js +64 -0
  325. package/dist/workspace/calendar/calendar-new-item.d.ts +11 -0
  326. package/dist/workspace/calendar/calendar-new-item.js +47 -0
  327. package/dist/workspace/calendar/calendar-page.d.ts +3 -0
  328. package/dist/workspace/calendar/calendar-page.js +177 -0
  329. package/dist/workspace/calendar/calendar-panel.d.ts +13 -0
  330. package/dist/workspace/calendar/calendar-panel.js +103 -0
  331. package/dist/workspace/calendar/calendar-people.d.ts +52 -0
  332. package/dist/workspace/calendar/calendar-people.js +117 -0
  333. package/dist/workspace/calendar/calendar-scheduled.d.ts +29 -0
  334. package/dist/workspace/calendar/calendar-scheduled.js +118 -0
  335. package/dist/workspace/calendar/calendar-views.d.ts +32 -0
  336. package/dist/workspace/calendar/calendar-views.js +124 -0
  337. package/dist/workspace/calendar/calendar-when.d.ts +14 -0
  338. package/dist/workspace/calendar/calendar-when.js +81 -0
  339. package/dist/workspace/calendar/mention-textarea.d.ts +19 -0
  340. package/dist/workspace/calendar/mention-textarea.js +84 -0
  341. package/dist/workspace/home/access-requests-bell.js +2 -1
  342. package/dist/workspace/inbox/workspace-inbox.d.ts +1 -1
  343. package/dist/workspace/inbox/workspace-inbox.js +1 -1
  344. package/dist/workspace/layout/project-files-view.js +2 -1
  345. package/dist/workspace/memory/memory-page-list.js +1 -1
  346. package/dist/workspace/new/workspace-handoff.js +2 -1
  347. package/dist/workspace/projects/modal/project-icon-field.js +2 -1
  348. package/dist/workspace/session-workspace.js +13 -12
  349. package/dist/workspace/setup/setup-steps.d.ts +43 -0
  350. package/dist/workspace/setup/setup-steps.js +38 -0
  351. package/dist/workspace/setup/workspace-setup-page.d.ts +10 -0
  352. package/dist/workspace/setup/workspace-setup-page.js +124 -0
  353. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +5 -1
  354. package/dist/workspace/sidebar/footer/project-calendar-nav.d.ts +8 -0
  355. package/dist/workspace/sidebar/footer/project-calendar-nav.js +31 -0
  356. package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +14 -6
  357. package/dist/workspace/sidebar/footer/project-chrome-nav.js +37 -25
  358. package/dist/workspace/sidebar/footer/project-computer-nav.d.ts +17 -9
  359. package/dist/workspace/sidebar/footer/project-computer-nav.js +36 -26
  360. package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +7 -7
  361. package/dist/workspace/sidebar/footer/project-download-app-nav.js +25 -13
  362. package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +8 -0
  363. package/dist/workspace/sidebar/footer/project-inbox-nav.js +29 -0
  364. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +3 -13
  365. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +6 -48
  366. package/dist/workspace/sidebar/footer/project-mcp-nav.d.ts +7 -7
  367. package/dist/workspace/sidebar/footer/project-mcp-nav.js +31 -13
  368. package/dist/workspace/sidebar/footer/project-phone-app-nav.d.ts +10 -0
  369. package/dist/workspace/sidebar/footer/project-phone-app-nav.js +61 -0
  370. package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +21 -0
  371. package/dist/workspace/sidebar/footer/project-promo-cards.js +33 -0
  372. package/dist/workspace/sidebar/footer/promo-card.d.ts +41 -0
  373. package/dist/workspace/sidebar/footer/promo-card.js +47 -0
  374. package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
  375. package/dist/workspace/sidebar/project-nav-items.js +12 -4
  376. package/dist/workspace/sidebar/project-session-list.js +58 -26
  377. package/dist/workspace/sidebar/project-sidebar.js +2 -5
  378. package/dist/workspace/sidebar/project-spaces-nav.js +2 -1
  379. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +24 -0
  380. package/dist/workspace/sidebar/session-brief-hover-card.js +4 -3
  381. package/dist/workspace/sidebar/session-group-sections.d.ts +26 -7
  382. package/dist/workspace/sidebar/session-group-sections.js +121 -41
  383. package/dist/workspace/sidebar/sidebar-drill.js +6 -0
  384. package/dist/workspace/sidebar/sidebar-more-group.js +3 -2
  385. package/dist/workspace/sidebar/use-workspace-list.d.ts +7 -0
  386. package/dist/workspace/sidebar/use-workspace-list.js +11 -1
  387. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +14 -0
  388. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +46 -2
  389. package/dist/workspace/space/space-tab-panels.js +1 -1
  390. package/dist/workspace/spaces/space-timeline.js +2 -2
  391. package/package.json +67 -10
  392. package/skills/kortix-ui/SKILL.md +2 -2
  393. package/skills/kortix-ui/references/modules.md +5 -3
  394. package/dist/session/thread/turn-share.d.ts +0 -16
  395. package/dist/session/thread/turn-share.js +0 -161
  396. package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +0 -11
  397. package/dist/workspace/sidebar/footer/promo-nav-row.js +0 -7
  398. /package/dist/markdown/{code/inline-chip.d.ts → inline-chip.d.ts} +0 -0
@@ -0,0 +1,360 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useWorkspaceEvalActions, useWorkspaceEvalJob, useWorkspaceEvalJobs, useWorkspaceEvalTrial, useWorkspaceEvalTrialFile, } from '@kortix/sdk/react';
4
+ import { ArrowCounterClockwiseIcon, ArrowsLeftRightIcon, CheckIcon, MinusIcon, StopIcon, TrashIcon, WarningIcon, XIcon, } from '@phosphor-icons/react';
5
+ import { useLayoutEffect, useRef, useState } from 'react';
6
+ import { useTranslations } from '../../i18n/index.js';
7
+ import { cn } from '../../internal/lib/utils.js';
8
+ import { UnifiedMarkdown } from '../../markdown/index.js';
9
+ import { HighlightedCode } from '../../markdown/code/index.js';
10
+ import { CopyButton } from '../../markdown/copy-button.js';
11
+ import { Button } from '../../primitives/button.js';
12
+ import { ConfirmDialog } from '../../primitives/confirm-dialog.js';
13
+ import { EmptyState } from '../../primitives/empty-state.js';
14
+ import { ErrorState } from '../../primitives/error-state.js';
15
+ import { Hint } from '../../primitives/hint.js';
16
+ import { LocalTime } from '../../primitives/local-time.js';
17
+ import { Skeleton } from '../../primitives/skeleton.js';
18
+ import { SplitSheet, SplitSheetBody, SplitSheetContent, SplitSheetDescription, SplitSheetHeader, SplitSheetMain, SplitSheetTitle, } from '../../primitives/split-sheet.js';
19
+ import { StatusBadge } from '../../primitives/status.js';
20
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '../../primitives/table.js';
21
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../primitives/tabs.js';
22
+ import { errorToast, successToast } from '../../primitives/toast.js';
23
+ import { UiLink as Link, useUiRouter, useUiSearchParams, useUiShallowNavigate, } from '../../providers/ui-provider.js';
24
+ import { agentLabel, datasetLabel, duration, evalCompareHref, evalDatasetHref, evalJobHref, evalJobScore, evalJobsHref, evalTaskHref, evalTrialScore, isOpenJob, jobDataset, jobSource, latestRuns, percent, shortCount, trialTone, usd, } from './eval-meta.js';
25
+ import { EVAL_FRAME, EVAL_TIME, EvalDetailPage, InfoHint, jobTone, ScoreValue, SectionTitle, useUrlTab, } from './eval-ui.js';
26
+ /** A status tint per cell, the solid color on its glyph (color.md → Accents and status). The glyph also reads without color. */
27
+ const CELL = {
28
+ pass: {
29
+ tint: 'bg-kortix-green/15',
30
+ glyph: _jsx(CheckIcon, { weight: "bold", className: "text-kortix-green size-3.5", "aria-hidden": true }),
31
+ },
32
+ fail: {
33
+ tint: 'bg-kortix-red/15',
34
+ glyph: _jsx(XIcon, { weight: "bold", className: "text-kortix-red size-3.5", "aria-hidden": true }),
35
+ },
36
+ error: {
37
+ tint: 'bg-kortix-orange/15',
38
+ glyph: _jsx(WarningIcon, { weight: "bold", className: "text-kortix-orange size-3.5", "aria-hidden": true }),
39
+ },
40
+ running: {
41
+ tint: 'bg-kortix-blue/15',
42
+ glyph: _jsx("span", { className: "bg-kortix-blue size-1.5 rounded-full", "aria-hidden": true }),
43
+ },
44
+ queued: { tint: 'bg-muted', glyph: null },
45
+ cancelled: {
46
+ tint: 'bg-muted',
47
+ glyph: _jsx(MinusIcon, { className: "text-muted-foreground size-3.5", "aria-hidden": true }),
48
+ },
49
+ };
50
+ const LEGEND = ['pass', 'fail', 'error', 'running', 'queued'];
51
+ const seconds = (timing) => timing.started_at && timing.finished_at
52
+ ? `${Math.round((Date.parse(timing.finished_at) - Date.parse(timing.started_at)) / 100) / 10} s`
53
+ : '—';
54
+ const TABS = ['overview', 'health', 'trials', 'config'];
55
+ /**
56
+ * Customize → Evals → Jobs → one job (`/admin/eval-jobs/<id>`), the Harbor
57
+ * Hub's job page: the progress bar (each bucket filters the trials), then
58
+ * Overview (cost, tokens, the score of each agent × model), Run health (the
59
+ * task × attempt matrix and where errors concentrate), Trials and Config. A
60
+ * trial opens beside the page (`?trial=<id>`). Re-reads every 5 seconds until
61
+ * the job ends.
62
+ */
63
+ export function EvalJobView({ projectId, jobId }) {
64
+ const t = useTranslations('evals');
65
+ const router = useUiRouter();
66
+ const params = useUiSearchParams();
67
+ const navigate = useUiShallowNavigate();
68
+ const query = useWorkspaceEvalJob(projectId, jobId);
69
+ const actions = useWorkspaceEvalActions(projectId);
70
+ const [deleting, setDeleting] = useState(false);
71
+ const [filter, setFilter] = useState('all');
72
+ const [tab, setTab] = useUrlTab(TABS);
73
+ const job = query.data?.job;
74
+ const trials = query.data?.trials ?? [];
75
+ const dataset = job ? jobDataset(job) : null;
76
+ // The job before this one on the same dataset: what "Compare with previous" opens.
77
+ const siblings = useWorkspaceEvalJobs(job && dataset ? projectId : null, dataset?.kind === 'suite' ? { suite: dataset.name } : dataset ? { dataset: dataset.name } : undefined);
78
+ const previous = job
79
+ ? (siblings.data ?? []).find((other) => other.job_id !== job.job_id &&
80
+ other.status === 'completed' &&
81
+ Date.parse(other.created_at) < Date.parse(job.created_at))
82
+ : undefined;
83
+ const trialId = params.get('trial');
84
+ const openTrial = (id) => {
85
+ const next = new URLSearchParams(params.toString());
86
+ if (id)
87
+ next.set('trial', id);
88
+ else
89
+ next.delete('trial');
90
+ const q = next.toString();
91
+ navigate(`${window.location.pathname}${q ? `?${q}` : ''}`, { replace: !!id === !!trialId });
92
+ };
93
+ const notFound = query.isError && query.error?.status === 404;
94
+ const rerun = (scope) => actions.rerun.mutate({ jobId, scope }, {
95
+ onSuccess: (next) => {
96
+ successToast(t('rerunStarted', { job: next.job_name }));
97
+ router.push(evalJobHref(projectId, next.job_id));
98
+ },
99
+ onError: (err) => errorToast(err instanceof Error ? err.message : String(err)),
100
+ });
101
+ const hasFailed = trials.some((trial) => !evalTrialScore(trial).passed && trial.status !== 'cancelled');
102
+ const showTrials = (tone) => {
103
+ setFilter(tone);
104
+ setTab('trials');
105
+ };
106
+ return (_jsxs(SplitSheet, { open: !!trialId, onOpenChange: (next) => !next && openTrial(null), size: "lg", className: "min-h-0 flex-1 [--split-sheet-max:55%] [--split-sheet-width:45%]", children: [_jsx(SplitSheetMain, { className: "flex min-h-0 flex-col", children: _jsx(EvalDetailPage, { crumbs: [
107
+ { label: t('jobsTitle'), href: evalJobsHref(projectId) },
108
+ { label: job?.job_name ?? '…' },
109
+ ], children: notFound ? (_jsx(EmptyState, { size: "sm", title: t('jobNotFound'), action: _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: evalJobsHref(projectId), children: t('jobsTitle') }) }) })) : query.isError ? (_jsx(ErrorState, { size: "sm", title: t('loadError'), action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => query.refetch(), children: t('retry') }) })) : !job ? (_jsxs("div", { className: "flex flex-col gap-3", "aria-busy": true, children: [_jsx(Skeleton, { className: "h-7 w-72" }), _jsx(Skeleton, { className: "h-4 w-96" }), _jsx(Skeleton, { className: "h-16 w-full rounded-lg" }), _jsx(Skeleton, { className: "h-40 w-full rounded-lg" })] })) : (_jsxs(_Fragment, { children: [_jsxs("header", { className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-3", children: [_jsxs("div", { className: "flex min-w-64 flex-1 flex-col gap-1.5", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsx("h1", { className: "text-foreground min-w-0 text-xl font-medium wrap-break-word", children: job.job_name }), _jsx(StatusBadge, { tone: jobTone(job), children: t(`status.${job.status}`) })] }), _jsx(Summary, { projectId: projectId, job: job })] }), _jsx("div", { className: "flex flex-wrap items-center gap-2", children: isOpenJob(job) ? (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5", disabled: actions.cancel.isPending, "aria-busy": actions.cancel.isPending, onClick: () => actions.cancel.mutate(jobId, {
110
+ onSuccess: () => successToast(t('cancelled')),
111
+ }), "data-testid": "evals-cancel", children: [_jsx(StopIcon, { className: "size-3.5", "aria-hidden": true }), t('cancel')] })) : (_jsxs(_Fragment, { children: [previous ? (_jsx(Button, { asChild: true, size: "sm", variant: "outline", className: "gap-1.5", children: _jsxs(Link, { href: evalCompareHref(projectId, [previous.job_id, job.job_id]), "data-testid": "evals-compare-previous", children: [_jsx(ArrowsLeftRightIcon, { className: "size-3.5", "aria-hidden": true }), t('compareWithPrevious')] }) })) : null, hasFailed ? (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5", disabled: actions.rerun.isPending, onClick: () => rerun('failed'), "data-testid": "evals-rerun-failed", children: [_jsx(ArrowCounterClockwiseIcon, { className: "size-3.5", "aria-hidden": true }), t('rerunFailed')] })) : null, _jsx(Button, { size: "sm", variant: hasFailed || previous ? 'ghost' : 'outline', disabled: actions.rerun.isPending, onClick: () => rerun('all'), "data-testid": "evals-rerun-all", children: t('rerunAll') }), _jsx(Hint, { label: t('delete'), children: _jsx(Button, { size: "icon-sm", variant: "ghost", "aria-label": t('delete'), onClick: () => setDeleting(true), children: _jsx(TrashIcon, { className: "size-4" }) }) })] })) })] }), _jsx(Progress, { job: job, trials: trials, onShow: showTrials }), _jsxs(Tabs, { value: tab, onValueChange: (value) => setTab(value), children: [_jsx(TabsList, { className: "w-fit", children: TABS.map((value) => (_jsx(TabsTrigger, { value: value, "data-testid": `evals-tab-${value}`, children: t(`jobTab.${value}`) }, value))) }), _jsxs(TabsContent, { value: "overview", className: "flex flex-col gap-6 pt-4", children: [_jsx(StatCards, { job: job, trials: trials }), _jsx(Scores, { job: job, trials: trials, compact: !!trialId })] }), _jsxs(TabsContent, { value: "health", className: "flex flex-col gap-6 pt-4", children: [_jsx(Matrix, { trials: trials, selected: trialId, onOpen: openTrial }), _jsx(Failures, { trials: trials, onShow: () => showTrials('error') })] }), _jsx(TabsContent, { value: "trials", className: "pt-4", children: _jsx(TrialTable, { trials: trials, filter: filter, onFilter: setFilter, selected: trialId, onOpen: openTrial }) }), _jsx(TabsContent, { value: "config", className: "pt-4", children: _jsx(ConfigView, { job: job }) })] })] })) }) }), trialId ? _jsx(TrialPanel, { projectId: projectId, jobId: jobId, trialId: trialId }) : null, _jsx(ConfirmDialog, { open: deleting, onOpenChange: setDeleting, title: t('deleteTitle'), description: t('deleteDescription'), confirmLabel: t('delete'), confirmVariant: "destructive", isPending: actions.remove.isPending, onConfirm: () => actions.remove.mutate(jobId, {
112
+ onSuccess: () => {
113
+ successToast(t('deleted'));
114
+ router.push(evalJobsHref(projectId));
115
+ },
116
+ onError: (err) => errorToast(err instanceof Error ? err.message : String(err)),
117
+ }) })] }));
118
+ }
119
+ function Summary({ projectId, job }) {
120
+ const t = useTranslations('evals');
121
+ const dataset = jobDataset(job);
122
+ return (_jsxs("div", { className: "text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-xs", "data-testid": "evals-job-summary", children: [dataset ? (_jsx(Link, { href: evalDatasetHref(projectId, dataset), className: "hover:text-foreground font-mono", children: datasetLabel(dataset) })) : (_jsx("span", { className: "font-mono", children: jobSource(job) })), job.commit ? _jsx("span", { className: "font-mono", children: job.commit.slice(0, 7) }) : null, _jsx(LocalTime, { value: job.created_at, options: EVAL_TIME }), job.rerun_of ? (_jsx(Link, { href: evalJobHref(projectId, job.rerun_of), className: "hover:text-foreground underline underline-offset-2", children: t('rerunOf', { job: job.rerun_of.slice(0, 8) }) })) : null] }));
123
+ }
124
+ /** The bar's buckets, in the order they fill. */
125
+ const BUCKETS = [
126
+ { tone: 'pass', bar: 'bg-kortix-green' },
127
+ { tone: 'fail', bar: 'bg-kortix-red' },
128
+ { tone: 'error', bar: 'bg-kortix-orange' },
129
+ { tone: 'running', bar: 'bg-kortix-blue' },
130
+ { tone: 'queued', bar: 'bg-muted-foreground/30' },
131
+ { tone: 'cancelled', bar: 'bg-muted-foreground/60' },
132
+ ];
133
+ /** "18 / 40 finished": one stacked bar over the last run of each attempt; each legend item shows its trials. */
134
+ function Progress({ job, trials, onShow, }) {
135
+ const t = useTranslations('evals');
136
+ // Counted from the trials: the job's stats are recomputed once per runner tick and lag by up to one.
137
+ const runs = latestRuns(trials);
138
+ const counts = new Map();
139
+ for (const trial of runs)
140
+ counts.set(trialTone(trial), (counts.get(trialTone(trial)) ?? 0) + 1);
141
+ const total = runs.length || job.stats.n_total_trials;
142
+ const done = runs.filter((trial) => !isOpenTrial(trial)).length;
143
+ return (_jsxs("section", { className: `${EVAL_FRAME} flex flex-col gap-3 px-4 py-3`, "aria-label": t('progressLabel'), "data-testid": "evals-progress", children: [_jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-2 text-xs", children: [_jsx("span", { className: "text-foreground text-sm font-medium tabular-nums", children: t('finishedOf', { count: `${done} / ${total}` }) }), _jsx("span", { className: "text-muted-foreground", children: job.started_at
144
+ ? t(isOpenJob(job) ? 'runningFor' : 'ranFor', {
145
+ time: duration(job.started_at, job.finished_at),
146
+ })
147
+ : t('waitingToStart') })] }), _jsx("div", { className: "bg-muted flex h-2 w-full overflow-hidden rounded-full", "aria-hidden": true, children: BUCKETS.map(({ tone, bar }) => counts.get(tone) ? (_jsx("span", { className: cn('h-full', bar), style: { width: `${((counts.get(tone) ?? 0) / Math.max(1, total)) * 100}%` } }, tone)) : null) }), _jsx("ul", { className: "flex flex-wrap items-center gap-x-1 gap-y-1 text-xs", "aria-label": t('legend'), children: BUCKETS.filter(({ tone }) => counts.get(tone) || tone === 'pass' || tone === 'fail').map(({ tone, bar }) => (_jsx("li", { children: _jsxs("button", { type: "button", onClick: () => onShow(tone), className: "text-muted-foreground hover:text-foreground hover:bg-hover flex items-center gap-1.5 rounded-sm px-1.5 py-0.5 transition-colors", "aria-label": t('showTrials', { count: counts.get(tone) ?? 0, tone: t(`tone.${tone}`) }), "data-testid": `evals-bucket-${tone}`, children: [_jsx("span", { className: cn('size-2 rounded-full', bar), "aria-hidden": true }), _jsx("span", { className: "text-foreground tabular-nums", children: counts.get(tone) ?? 0 }), t(`tone.${tone}`)] }) }, tone))) })] }));
148
+ }
149
+ const isOpenTrial = (trial) => trial.status === 'queued' ||
150
+ trial.status === 'starting' ||
151
+ trial.status === 'agent_running' ||
152
+ trial.status === 'verifying';
153
+ /** Score, tokens, cost and time, one card each. */
154
+ function StatCards({ job, trials }) {
155
+ const t = useTranslations('evals');
156
+ const score = evalJobScore(job);
157
+ const usage = job.stats.usage;
158
+ const ended = latestRuns(trials).filter((trial) => !isOpenTrial(trial)).length;
159
+ const tokens = usage ? usage.n_input_tokens + usage.n_output_tokens + usage.n_cache_tokens : null;
160
+ const cards = [
161
+ {
162
+ label: score?.passAt1 !== null && score?.passAt1 !== undefined ? t('passAt1') : t('meanScore'),
163
+ value: _jsx(ScoreValue, { rate: score?.passAt1 ?? score?.mean, n: score?.validTrials ?? 0 }),
164
+ hint: score ? t('acrossScored', { n: score.validTrials }) : undefined,
165
+ },
166
+ {
167
+ label: t('tokensLabel'),
168
+ value: shortCount(tokens),
169
+ hint: usage && tokens
170
+ ? t('cacheShare', { pct: Math.round((usage.n_cache_tokens / tokens) * 100) })
171
+ : undefined,
172
+ },
173
+ {
174
+ label: t('cost'),
175
+ value: usd(usage?.cost_usd),
176
+ hint: usage?.cost_usd && ended ? t('perTrial', { cost: usd(usage.cost_usd / ended) }) : undefined,
177
+ },
178
+ {
179
+ label: t('colDuration'),
180
+ value: duration(job.started_at, job.finished_at),
181
+ hint: t('concurrencyHint', { n: job.config.n_concurrent_trials }),
182
+ },
183
+ ];
184
+ return (_jsx("div", { className: "grid grid-cols-2 gap-3 lg:grid-cols-4", "data-testid": "evals-stat-cards", children: cards.map((card) => (_jsxs("div", { className: `${EVAL_FRAME} flex flex-col gap-1 px-4 py-3`, children: [_jsx("span", { className: "text-muted-foreground text-xs", children: card.label }), _jsx("span", { className: "text-foreground text-lg font-medium tabular-nums", children: card.value }), card.hint ? _jsx("span", { className: "text-muted-foreground text-xs", children: card.hint }) : null] }, card.label))) }));
185
+ }
186
+ /** Where errors concentrate: the top exception types and the tasks with errors. */
187
+ function Failures({ trials, onShow }) {
188
+ const t = useTranslations('evals');
189
+ const errored = latestRuns(trials).filter((trial) => trial.exception);
190
+ if (errored.length === 0)
191
+ return null;
192
+ const tally = (key) => {
193
+ const counts = new Map();
194
+ for (const trial of errored)
195
+ counts.set(key(trial), (counts.get(key(trial)) ?? 0) + 1);
196
+ return [...counts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 6);
197
+ };
198
+ const types = tally((trial) => trial.exception.exception_type);
199
+ const tasks = tally((trial) => trial.task_name);
200
+ const max = Math.max(...types.map(([, n]) => n), ...tasks.map(([, n]) => n));
201
+ const list = (title, rows, mono) => (_jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [_jsx("h3", { className: "text-muted-foreground text-xs font-medium", children: title }), _jsx("ul", { className: "flex flex-col gap-1.5", children: rows.map(([name, n]) => (_jsxs("li", { className: "flex items-center gap-2 text-xs", children: [_jsx("span", { className: cn('text-foreground w-40 shrink-0 truncate', mono && 'font-mono'), title: name, children: name }), _jsx("span", { className: "bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full", children: _jsx("span", { className: "bg-kortix-orange block h-full", style: { width: `${(n / max) * 100}%` } }) }), _jsx("span", { className: "text-muted-foreground w-6 text-right tabular-nums", children: n })] }, name))) })] }));
202
+ return (_jsxs("section", { className: "flex flex-col gap-3", "aria-label": t('failures'), "data-testid": "evals-failures", children: [_jsx(SectionTitle, { title: t('failures'), info: t('failuresInfo'), action: _jsx(Button, { size: "xs", variant: "ghost", onClick: onShow, children: t('reviewErrors', { count: errored.length }) }) }), _jsxs("div", { className: `${EVAL_FRAME} grid gap-6 px-4 py-4 md:grid-cols-2`, children: [list(t('topExceptions'), types, true), list(t('tasksWithErrors'), tasks, true)] })] }));
203
+ }
204
+ const FILTERS = ['all', 'pass', 'fail', 'error', 'running', 'queued', 'cancelled'];
205
+ /** Every trial (the last run of each attempt), filtered by bucket; a row opens the trial. */
206
+ function TrialTable({ trials, filter, onFilter, selected, onOpen, }) {
207
+ const t = useTranslations('evals');
208
+ const runs = latestRuns(trials).sort((a, b) => a.task_name.localeCompare(b.task_name) || a.agent.localeCompare(b.agent) || a.attempt - b.attempt);
209
+ const count = (tone) => (tone === 'all' ? runs.length : runs.filter((trial) => trialTone(trial) === tone).length);
210
+ const shown = filter === 'all' ? runs : runs.filter((trial) => trialTone(trial) === filter);
211
+ return (_jsxs("div", { className: "flex flex-col gap-3", "data-testid": "evals-trials", children: [_jsx(Tabs, { value: filter, onValueChange: (value) => onFilter(value), children: _jsx(TabsList, { variant: "segmented", className: "w-fit max-w-full overflow-x-auto", "aria-label": t('trialFilter'), children: FILTERS.filter((tone) => tone === 'all' || count(tone) > 0 || tone === filter).map((tone) => (_jsxs(TabsTrigger, { value: tone, "data-testid": `evals-trials-filter-${tone}`, children: [tone === 'all' ? t('allTrials') : t(`tone.${tone}`), _jsx("span", { className: "text-muted-foreground ml-1 tabular-nums", children: count(tone) })] }, tone))) }) }), shown.length === 0 ? (_jsx("div", { className: `${EVAL_FRAME} text-muted-foreground px-4 py-6 text-center text-sm`, children: t('noTrialMatch') })) : (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t('colTask') }), _jsx(TableHead, { className: "hidden md:table-cell", children: t('colAgent') }), _jsx(TableHead, { children: t('colResult') }), _jsx(TableHead, { className: "hidden text-right sm:table-cell", children: t('colReward') }), _jsx(TableHead, { className: "hidden text-right lg:table-cell", children: t('colDuration') }), _jsx(TableHead, { className: "hidden text-right lg:table-cell", children: t('tokensLabel') }), _jsx(TableHead, { className: "hidden text-right xl:table-cell", children: t('cost') })] }) }), _jsx(TableBody, { children: shown.map((trial) => {
212
+ const tone = trialTone(trial);
213
+ const usage = trial.usage;
214
+ return (_jsxs(TableRow, { className: "hover:bg-hover cursor-pointer", "data-state": selected === trial.trial_id ? 'selected' : undefined, onClick: () => onOpen(trial.trial_id), "data-testid": "evals-trial-row", children: [_jsxs(TableCell, { className: "max-w-64", children: [_jsx("button", { type: "button", className: "text-foreground block max-w-full truncate text-left font-mono text-sm", onClick: (e) => {
215
+ e.stopPropagation();
216
+ onOpen(trial.trial_id);
217
+ }, children: trial.task_name }), trial.attempt > 1 || trial.retry > 0 ? (_jsx("span", { className: "text-muted-foreground text-xs", children: [trial.attempt > 1 ? t('attempt', { n: trial.attempt }) : null, trial.retry ? t('retryN', { n: trial.retry }) : null]
218
+ .filter(Boolean)
219
+ .join(' · ') })) : null] }), _jsx(TableCell, { className: "text-muted-foreground hidden max-w-48 truncate md:table-cell", children: agentLabel(trial.agent, trial.model) }), _jsx(TableCell, { children: _jsxs("span", { className: "flex flex-col gap-0.5", children: [_jsx(StatusBadge, { tone: TONE_BADGE[tone], children: t(`tone.${tone}`) }), trial.exception ? (_jsx("span", { className: "text-muted-foreground max-w-40 truncate font-mono text-xs", title: trial.exception.exception_message, children: trial.exception.exception_type })) : null] }) }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right font-mono text-xs tabular-nums sm:table-cell", children: trial.rewards
220
+ ? Object.values(trial.rewards)
221
+ .map((value) => value.toFixed(2))
222
+ .join(' · ')
223
+ : '—' }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right tabular-nums lg:table-cell", children: isOpenTrial(trial) && trial.started_at ? '…' : duration(trial.started_at, trial.finished_at) }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right tabular-nums lg:table-cell", children: usage ? shortCount(usage.n_input_tokens + usage.n_output_tokens + usage.n_cache_tokens) : '—' }), _jsx(TableCell, { className: "text-muted-foreground hidden text-right tabular-nums xl:table-cell", children: usd(usage?.cost_usd) })] }, trial.trial_id));
224
+ }) })] }))] }));
225
+ }
226
+ /** The job config as JSON (secret values come back redacted from the API). */
227
+ function ConfigView({ job }) {
228
+ const t = useTranslations('evals');
229
+ const text = JSON.stringify(job.config, null, 2);
230
+ return (_jsxs("div", { className: EVAL_FRAME, "data-testid": "evals-config", children: [_jsxs("div", { className: "border-border flex items-center gap-2 border-b px-3 py-1.5", children: [_jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate font-mono text-xs", children: `${job.folder}/config.json` }), _jsx(CopyButton, { code: text, label: t('copyConfig'), size: "sm" })] }), _jsx("pre", { className: "text-foreground max-h-[36rem] overflow-auto p-4 font-mono text-xs [&_.shiki]:!bg-transparent [&_code]:bg-transparent [&_span]:!bg-transparent", children: _jsx(HighlightedCode, { code: text, language: "json" }) })] }));
231
+ }
232
+ const TONE_BADGE = {
233
+ pass: 'success',
234
+ fail: 'destructive',
235
+ error: 'warning',
236
+ running: 'info',
237
+ queued: 'neutral',
238
+ cancelled: 'neutral',
239
+ };
240
+ function Scores({ job, trials, compact, }) {
241
+ const t = useTranslations('evals');
242
+ if (!job.stats.agents.length)
243
+ return null;
244
+ // The mean of each valid trial's own score (the mean of its rewards): one number per agent that reads
245
+ // the same whatever reward keys each task writes. Harbor's per-key metrics stay one hover away.
246
+ const runs = latestRuns(trials);
247
+ const meanScore = (agent, model) => {
248
+ const scores = runs
249
+ .filter((trial) => trial.agent === agent && (trial.model ?? null) === (model ?? null))
250
+ .map((trial) => evalTrialScore(trial).score)
251
+ .filter((score) => score !== null);
252
+ return scores.length ? scores.reduce((a, b) => a + b, 0) / scores.length : null;
253
+ };
254
+ return (_jsxs("section", { className: "flex flex-col gap-3", "aria-label": t('scores'), children: [_jsxs("h2", { className: "text-foreground flex items-center gap-1.5 text-sm font-medium", children: [t('scores'), _jsx(InfoHint, { text: t('scoresInfo') })] }), _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t('colAgent') }), _jsx(TableHead, { className: "text-right", children: t('colScore') }), compact ? null : (_jsx(TableHead, { className: "hidden sm:table-cell", children: t('colPassK') })), _jsx(TableHead, { className: "hidden text-right sm:table-cell", children: t('colMeanScore') }), compact ? null : _jsx(TableHead, { className: "text-right", children: t('colValid') }), _jsx(TableHead, { className: "text-right", children: t('colErrors') })] }) }), _jsx(TableBody, { children: job.stats.agents.map((agent) => (_jsxs(TableRow, { "data-testid": "evals-score-row", children: [_jsxs(TableCell, { className: "max-w-64", children: [_jsx("span", { className: "block truncate font-medium", children: agentLabel(agent.agent, agent.model) }), agent.source ? (_jsx("span", { className: "text-muted-foreground block truncate font-mono text-xs", children: agent.source })) : null] }), _jsx(TableCell, { className: "text-right text-base", children: _jsx(ScoreValue, { rate: agent.pass_at_k['1'], n: agent.n_trials }) }), compact ? null : (_jsx(TableCell, { className: "text-muted-foreground hidden text-xs tabular-nums sm:table-cell", children: Object.entries(agent.pass_at_k)
255
+ .map(([k, v]) => `@${k} ${percent(v)}`)
256
+ .join(' ') })), _jsx(TableCell, { className: "hidden text-right tabular-nums sm:table-cell", children: _jsxs("span", { className: "inline-flex items-center justify-end gap-1.5", children: [percent(meanScore(agent.agent, agent.model)), _jsx(InfoHint, { text: t('metricsHint', {
257
+ metrics: agent.metrics
258
+ .map((m) => Object.entries(m)
259
+ .map(([k, v]) => `${k} ${v.toFixed(2)}`)
260
+ .join(', '))
261
+ .join(' · '),
262
+ }) })] }) }), compact ? null : (_jsx(TableCell, { className: "text-muted-foreground text-right tabular-nums", children: agent.n_trials })), _jsx(TableCell, { className: "text-right tabular-nums", children: agent.n_errors ? (_jsxs("span", { className: "text-foreground inline-flex items-center gap-1", children: [_jsx(WarningIcon, { weight: "bold", className: "text-kortix-orange size-3", "aria-hidden": true }), agent.n_errors] })) : (_jsx("span", { className: "text-muted-foreground", children: "0" })) })] }, `${agent.agent}-${agent.model}-${agent.source}`))) })] })] }));
263
+ }
264
+ function Matrix({ trials, selected, onOpen, }) {
265
+ const t = useTranslations('evals');
266
+ const runs = latestRuns(trials);
267
+ const tasks = [...new Set(runs.map((trial) => trial.task_name))].sort();
268
+ const columns = [
269
+ ...new Map(runs.map((trial) => [
270
+ `${agentLabel(trial.agent, trial.model)}\u0000${trial.attempt}`,
271
+ { agent: agentLabel(trial.agent, trial.model), attempt: trial.attempt },
272
+ ])).values(),
273
+ ].sort((a, b) => a.agent.localeCompare(b.agent) || a.attempt - b.attempt);
274
+ const cell = new Map(runs.map((trial) => [
275
+ `${trial.task_name}\u0000${agentLabel(trial.agent, trial.model)}\u0000${trial.attempt}`,
276
+ trial,
277
+ ]));
278
+ const agents = [...new Set(columns.map((c) => c.agent))];
279
+ // With one attempt per agent the attempt row says nothing.
280
+ const multiAttempt = columns.length > agents.length;
281
+ return (_jsxs("section", { className: "flex flex-col gap-3", "aria-label": t('matrix'), "data-testid": "evals-matrix", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [_jsxs("h2", { className: "text-foreground flex items-center gap-1.5 text-sm font-medium", children: [t('matrix'), _jsx(InfoHint, { text: t('matrixInfo') })] }), _jsx("ul", { className: "text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-xs", "aria-label": t('legend'), children: LEGEND.map((tone) => (_jsxs("li", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: cn('flex size-4 items-center justify-center rounded-sm [&_svg]:size-2.5', CELL[tone].tint), children: CELL[tone].glyph }), t(`tone.${tone}`)] }, tone))) })] }), _jsx("div", { className: `${EVAL_FRAME} overflow-x-auto p-4`, children: _jsxs("table", { className: "text-xs", children: [_jsxs("thead", { children: [_jsxs("tr", { children: [_jsx("th", { className: "text-muted-foreground pr-4 pb-1 text-left font-medium", children: multiAttempt ? null : t('colTasks') }), agents.map((agent) => (_jsx("th", { colSpan: columns.filter((c) => c.agent === agent).length, className: "text-muted-foreground max-w-48 truncate px-1 pb-1 text-left font-medium whitespace-nowrap", title: agent, children: agent }, agent)))] }), multiAttempt ? (_jsxs("tr", { children: [_jsx("th", { className: "text-muted-foreground pr-4 pb-1 text-left font-medium", children: t('colTasks') }), columns.map((c) => (_jsx("th", { className: "text-muted-foreground px-1 pb-1 text-left font-normal tabular-nums", children: t('attempt', { n: c.attempt }) }, `${c.agent}-${c.attempt}`)))] })) : null] }), _jsx("tbody", { children: tasks.map((task) => (_jsxs("tr", { children: [_jsx("td", { className: "text-foreground max-w-64 truncate py-0.5 pr-4 font-mono", children: task }), columns.map((c) => {
282
+ const trial = cell.get(`${task}\u0000${c.agent}\u0000${c.attempt}`);
283
+ if (!trial)
284
+ return _jsx("td", {}, `${c.agent}-${c.attempt}`);
285
+ const tone = trialTone(trial);
286
+ return (_jsx("td", { className: "px-1 py-0.5", children: _jsx("button", { type: "button", onClick: () => onOpen(trial.trial_id), "aria-pressed": selected === trial.trial_id, "aria-label": `${task} · ${c.agent} · ${t('attempt', { n: c.attempt })}: ${t(`tone.${tone}`)}`, className: cn('hover:ring-ring focus-visible:ring-ring flex size-7 items-center justify-center rounded-sm outline-none hover:ring-1 focus-visible:ring-2', CELL[tone].tint, selected === trial.trial_id && 'ring-foreground ring-2'), "data-testid": "evals-cell", "data-tone": tone, children: CELL[tone].glyph }) }, `${c.agent}-${c.attempt}`));
287
+ })] }, task))) })] }) })] }));
288
+ }
289
+ /** The phases of a trial on one bar: sandbox, agent, verifier. */
290
+ function TimingBar({ trial }) {
291
+ const t = useTranslations('evals');
292
+ const ms = (timing) => timing.started_at && timing.finished_at ? Math.max(0, Date.parse(timing.finished_at) - Date.parse(timing.started_at)) : 0;
293
+ const phases = [
294
+ { label: t('sandbox'), ms: ms(trial.environment_setup), bar: 'bg-muted-foreground/50' },
295
+ { label: t('agentTime'), ms: ms(trial.agent_execution), bar: 'bg-foreground/70' },
296
+ { label: t('verifierTime'), ms: ms(trial.verifier), bar: 'bg-kortix-blue' },
297
+ ];
298
+ const total = phases.reduce((sum, phase) => sum + phase.ms, 0);
299
+ if (total === 0)
300
+ return null;
301
+ return (_jsxs("div", { className: "flex flex-col gap-2", "data-testid": "evals-trial-timing", children: [_jsx("div", { className: "bg-muted flex h-2 w-full overflow-hidden rounded-full", "aria-hidden": true, children: phases.map((phase) => phase.ms ? _jsx("span", { className: cn('h-full', phase.bar), style: { width: `${(phase.ms / total) * 100}%` } }, phase.label) : null) }), _jsx("ul", { className: "text-muted-foreground flex flex-wrap gap-x-4 gap-y-1 text-xs tabular-nums", children: phases.map((phase) => (_jsxs("li", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: cn('size-2 rounded-full', phase.bar), "aria-hidden": true }), phase.label, _jsx("span", { className: "text-foreground", children: phase.ms ? `${Math.round(phase.ms / 100) / 10} s` : '—' })] }, phase.label))) })] }));
302
+ }
303
+ /** One trial, beside the page: result and error, timing and tokens, retry, the instruction, and its files. */
304
+ function TrialPanel({ projectId, jobId, trialId, }) {
305
+ const t = useTranslations('evals');
306
+ const detail = useWorkspaceEvalTrial(projectId, jobId, trialId);
307
+ const actions = useWorkspaceEvalActions(projectId);
308
+ const [picked, setPicked] = useState(null);
309
+ const files = detail.data?.files ?? [];
310
+ // The verifier's own output first: it says why the score is what it is.
311
+ const path = picked && files.some((f) => f.path === picked)
312
+ ? picked
313
+ : ((files.find((f) => f.path === 'verifier/test-stdout.txt') ?? files[0])?.path ?? null);
314
+ const file = useWorkspaceEvalTrialFile(projectId, jobId, trialId, path);
315
+ const trial = detail.data?.trial;
316
+ const score = trial ? evalTrialScore(trial) : null;
317
+ const tone = trial ? trialTone(trial) : null;
318
+ const ended = !!trial && (trial.status === 'completed' || trial.status === 'errored' || trial.status === 'cancelled');
319
+ const usage = trial?.usage;
320
+ return (_jsx(SplitSheetContent, { "data-testid": "evals-trial-sheet", children: _jsxs(PanelFocus, { children: [_jsxs(SplitSheetHeader, { closeLabel: t('close'), children: [_jsx(SplitSheetTitle, { className: "font-mono", children: trial?.task_name ?? t('trial') }), _jsx(SplitSheetDescription, { children: trial
321
+ ? [agentLabel(trial.agent, trial.model), t('attempt', { n: trial.attempt }), trial.retry ? t('retryN', { n: trial.retry }) : null]
322
+ .filter(Boolean)
323
+ .join(' · ')
324
+ : ' ' })] }), _jsx(SplitSheetBody, { className: "flex flex-col gap-6", children: !trial ? (_jsxs("div", { className: "flex flex-col gap-2", "aria-busy": true, children: [_jsx(Skeleton, { className: "h-6 w-1/2" }), _jsx(Skeleton, { className: "h-24 w-full" })] })) : (_jsxs(_Fragment, { children: [_jsxs("section", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(StatusBadge, { tone: TONE_BADGE[tone], "data-testid": "evals-trial-result", children: t(`tone.${tone}`) }), trial.rewards
325
+ ? Object.entries(trial.rewards).map(([name, value]) => (_jsx("span", { className: "text-muted-foreground font-mono text-xs tabular-nums", children: `${name} ${value}` }, name)))
326
+ : null] }), score && trial.rewards && !trial.reward_valid ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('rewardInvalid') })) : null, trial.exception ? (_jsxs("div", { className: "bg-kortix-orange/15 flex flex-col gap-1 rounded-md p-3 text-xs", "data-testid": "evals-trial-error", children: [_jsx("span", { className: "text-foreground font-medium wrap-break-word", children: `${trial.exception.exception_type}: ${trial.exception.exception_message}` }), _jsx("span", { className: "text-muted-foreground", children: t('policy', {
327
+ retry: trial.exception.policy.should_retry ? t('yes') : t('no'),
328
+ grade: trial.exception.policy.should_grade ? t('yes') : t('no'),
329
+ valid: trial.exception.policy.has_valid_reward ? t('yes') : t('no'),
330
+ }) })] })) : null, _jsxs("div", { className: "flex flex-wrap gap-2 pt-1", children: [ended ? (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5", disabled: actions.retryTrial.isPending, "aria-busy": actions.retryTrial.isPending, onClick: () => actions.retryTrial.mutate({ jobId, trialId }, {
331
+ onSuccess: () => successToast(t('trialRetried')),
332
+ onError: (err) => errorToast(err instanceof Error ? err.message : String(err)),
333
+ }), "data-testid": "evals-trial-retry", children: [_jsx(ArrowCounterClockwiseIcon, { className: "size-3.5", "aria-hidden": true }), t('retryTrial')] })) : (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5", disabled: actions.cancelTrial.isPending, onClick: () => actions.cancelTrial.mutate({ jobId, trialId }, {
334
+ onSuccess: () => successToast(t('trialCancelled')),
335
+ onError: (err) => errorToast(err instanceof Error ? err.message : String(err)),
336
+ }), "data-testid": "evals-trial-cancel", children: [_jsx(StopIcon, { className: "size-3.5", "aria-hidden": true }), t('cancelTrial')] })), trial.session_id ? (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: `/workspaces/${projectId}/sessions/${trial.session_id}`, children: t('openSession') }) })) : null, trial.task_id ? (_jsx(Button, { asChild: true, size: "sm", variant: "ghost", children: _jsx(Link, { href: evalTaskHref(projectId, trial.task_id), children: t('openTask') }) })) : null] })] }), _jsxs("section", { className: "flex flex-col gap-3", children: [_jsx("h3", { className: "text-muted-foreground text-xs font-medium", children: t('timings') }), _jsx(TimingBar, { trial: trial }), usage ? (_jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs tabular-nums", children: [_jsx("dt", { className: "text-muted-foreground", children: t('tokensLabel') }), _jsx("dd", { className: "text-foreground", children: t('tokensDetail', {
337
+ input: usage.n_input_tokens.toLocaleString(),
338
+ output: usage.n_output_tokens.toLocaleString(),
339
+ cache: usage.n_cache_tokens.toLocaleString(),
340
+ }) }), _jsx("dt", { className: "text-muted-foreground", children: t('cost') }), _jsx("dd", { className: "text-foreground", children: usd(usage.cost_usd) })] })) : null] }), detail.data?.instruction ? (_jsxs("section", { className: "flex flex-col gap-2", children: [_jsx("h3", { className: "text-muted-foreground text-xs font-medium", children: t('instruction') }), _jsx("div", { className: "text-foreground text-sm", "data-testid": "evals-trial-instruction", children: _jsx(UnifiedMarkdown, { content: detail.data.instruction, trust: "untrusted", variant: "document" }) })] })) : null, _jsxs("section", { className: "flex flex-col gap-2", children: [_jsx("h3", { className: "text-muted-foreground text-xs font-medium", children: t('files') }), files.length === 0 ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('noFiles') })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex flex-wrap gap-1", role: "tablist", "aria-label": t('files'), children: files.map((f) => (_jsx(Button, { role: "tab", "aria-selected": f.path === path, size: "xs", variant: f.path === path ? 'secondary' : 'ghost', className: "font-mono", onClick: () => setPicked(f.path), children: f.path }, f.path))) }), _jsxs("div", { className: "relative", children: [file.data ? (_jsx(CopyButton, { code: file.data, label: t('copyFile'), size: "sm", className: "absolute top-1.5 right-1.5" })) : null, _jsx("pre", { className: "bg-muted text-foreground max-h-[28rem] overflow-auto rounded-md p-3 pr-10 font-mono text-xs wrap-break-word whitespace-pre-wrap", "data-testid": "evals-trial-file", children: file.isLoading ? '…' : (file.data ?? '') })] })] }))] })] })) })] }, trialId) }));
341
+ }
342
+ /**
343
+ * A cell opens the panel, not a `SplitSheetTrigger`, so focus moves in here on
344
+ * open (Escape inside the sheet closes it) and goes back to the cell on close,
345
+ * as the Triggers panel does.
346
+ */
347
+ function PanelFocus({ children }) {
348
+ const ref = useRef(null);
349
+ useLayoutEffect(() => {
350
+ const panel = ref.current;
351
+ const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
352
+ panel?.focus({ preventScroll: true });
353
+ return () => {
354
+ // Layout cleanup runs before the panel detaches, so focus is still readable.
355
+ if (panel?.contains(document.activeElement) && opener?.isConnected)
356
+ opener.focus({ preventScroll: true });
357
+ };
358
+ }, []);
359
+ return (_jsx("div", { ref: ref, tabIndex: -1, className: "flex min-h-0 flex-1 flex-col outline-none", children: children }));
360
+ }
@@ -0,0 +1,4 @@
1
+ /** The newest jobs, searched by name, kept by status, dataset and agent; two or more selected compare. */
2
+ export declare function EvalJobsPage({ projectId }: {
3
+ projectId: string;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,69 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useWorkspaceEvalJobs, useWorkspaceEvalSuites } from '@kortix/sdk/react';
4
+ import { ArrowsLeftRightIcon, PlayCircleIcon, PlayIcon } from '@phosphor-icons/react';
5
+ import { useEffect, useState } from 'react';
6
+ import { useTranslations } from '../../i18n/index.js';
7
+ import { Button } from '../../primitives/button.js';
8
+ import { EmptyState } from '../../primitives/empty-state.js';
9
+ import { ErrorState } from '../../primitives/error-state.js';
10
+ import { PageSearchBar } from '../../primitives/page-search-bar.js';
11
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../../primitives/select.js';
12
+ import { Skeleton } from '../../primitives/skeleton.js';
13
+ import { useUiRouter } from '../../providers/ui-provider.js';
14
+ import { CapabilityPageShell } from '../shared/capability-page-shell.js';
15
+ import { datasetKey, datasetLabel, evalCompareHref, jobDataset, parseDatasetKey } from './eval-meta.js';
16
+ import { InfoHint, JobsTable, ListFooter } from './eval-ui.js';
17
+ import { RunEvalModal } from './run-eval-modal.js';
18
+ const ANY = '__any__';
19
+ const STATUSES = ['running', 'queued', 'completed', 'cancelled'];
20
+ /** The newest jobs, searched by name, kept by status, dataset and agent; two or more selected compare. */
21
+ export function EvalJobsPage({ projectId }) {
22
+ const t = useTranslations('evals');
23
+ const router = useUiRouter();
24
+ const suites = useWorkspaceEvalSuites(projectId);
25
+ const [search, setSearch] = useState('');
26
+ const [q, setQ] = useState('');
27
+ const [status, setStatus] = useState(ANY);
28
+ const [dataset, setDataset] = useState(ANY);
29
+ const [agent, setAgent] = useState(ANY);
30
+ const [selected, setSelected] = useState([]);
31
+ const [running, setRunning] = useState(false);
32
+ // The search reaches the API 300 ms after typing stops.
33
+ useEffect(() => {
34
+ const timer = setTimeout(() => setQ(search.trim()), 300);
35
+ return () => clearTimeout(timer);
36
+ }, [search]);
37
+ const ref = dataset === ANY ? null : parseDatasetKey(dataset);
38
+ const filters = {
39
+ ...(status !== ANY ? { status: status } : {}),
40
+ ...(ref?.kind === 'suite' ? { suite: ref.name } : ref ? { dataset: ref.name } : {}),
41
+ ...(agent !== ANY ? { agent } : {}),
42
+ ...(q ? { q } : {}),
43
+ };
44
+ const jobs = useWorkspaceEvalJobs(projectId, filters);
45
+ // Every job of the project, unfiltered, names the choices of the dataset and agent filters.
46
+ const everything = useWorkspaceEvalJobs(projectId);
47
+ const all = everything.data ?? [];
48
+ const datasets = [
49
+ ...new Map([
50
+ ...(suites.data ?? []).map((s) => ({ kind: 'suite', name: s.name })),
51
+ ...all.map(jobDataset).filter((r) => r !== null),
52
+ ].map((r) => [datasetKey(r), r])).values(),
53
+ ];
54
+ const agents = [...new Set(all.flatMap((job) => job.config.agents.map((a) => a.name)))].sort();
55
+ const list = jobs.data ?? [];
56
+ const filtered = Object.keys(filters).length > 0;
57
+ const toggle = (jobId, on) => setSelected((current) => (on ? [...current.filter((id) => id !== jobId), jobId] : current.filter((id) => id !== jobId)));
58
+ return (_jsxs(CapabilityPageShell, { title: t('jobsTitle'), description: t('jobsDescription'), titleAddon: _jsx(InfoHint, { text: t('jobsInfo') }), search: _jsx(PageSearchBar, { value: search, onChange: setSearch, placeholder: t('searchJobs') }), action: selected.length >= 2 ? (_jsxs(Button, { size: "sm", className: "gap-1.5", onClick: () => router.push(evalCompareHref(projectId, oldestFirst(selected, list))), "data-testid": "evals-compare", children: [_jsx(ArrowsLeftRightIcon, { className: "size-3.5", "aria-hidden": true }), t('compareN', { count: selected.length })] })) : (_jsxs(Button, { size: "sm", className: "gap-1.5", onClick: () => setRunning(true), "data-testid": "evals-run", children: [_jsx(PlayIcon, { weight: "fill", className: "size-3.5 shrink-0", "aria-hidden": true }), t('newJob')] })), children: [_jsx(RunEvalModal, { projectId: projectId, suites: suites.data ?? [], target: null, open: running, onOpenChange: setRunning }), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", "data-testid": "evals-job-filters", children: [_jsxs(Select, { value: status, onValueChange: setStatus, children: [_jsx(SelectTrigger, { size: "sm", className: "w-36", "aria-label": t('colStatus'), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ANY, children: t('anyStatus') }), STATUSES.map((value) => (_jsx(SelectItem, { value: value, children: t(`status.${value}`) }, value)))] })] }), _jsxs(Select, { value: dataset, onValueChange: setDataset, children: [_jsx(SelectTrigger, { size: "sm", className: "w-48", "aria-label": t('colDataset'), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ANY, children: t('allDatasets') }), datasets.map((r) => (_jsx(SelectItem, { value: datasetKey(r), children: datasetLabel(r) }, datasetKey(r))))] })] }), _jsxs(Select, { value: agent, onValueChange: setAgent, children: [_jsx(SelectTrigger, { size: "sm", className: "w-40", "aria-label": t('colAgent'), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: ANY, children: t('anyAgent') }), agents.map((name) => (_jsx(SelectItem, { value: name, children: name }, name)))] })] }), filtered || search ? (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => {
59
+ setSearch('');
60
+ setStatus(ANY);
61
+ setDataset(ANY);
62
+ setAgent(ANY);
63
+ }, children: t('clearFilters') })) : null, selected.length ? (_jsxs("span", { className: "text-muted-foreground ml-auto text-xs", children: [selected.length === 1 ? t('selectOneMore') : t('selectedN', { count: selected.length }), _jsx(Button, { size: "xs", variant: "ghost", className: "ml-1", onClick: () => setSelected([]), children: t('clearSelection') })] })) : null] }), jobs.isError ? (_jsx(ErrorState, { size: "sm", title: t('loadError'), action: _jsx(Button, { size: "sm", variant: "outline", onClick: () => jobs.refetch(), children: t('retry') }) })) : jobs.isLoading ? (_jsx("div", { className: "flex flex-col gap-2", "aria-busy": true, children: [0, 1, 2, 3, 4].map((i) => (_jsx(Skeleton, { className: "h-12 w-full rounded-md" }, i))) })) : list.length === 0 ? (_jsx(EmptyState, { size: "sm", media: _jsx(PlayCircleIcon, { className: "text-muted-foreground size-6" }), title: filtered ? t('noJobMatch') : t('noJobs'), action: filtered ? undefined : (_jsx(Button, { size: "sm", onClick: () => setRunning(true), children: t('newJob') })) })) : (_jsxs(_Fragment, { children: [_jsx(JobsTable, { projectId: projectId, jobs: list, selected: new Set(selected), onSelect: toggle }), _jsx(ListFooter, { children: t('displayingJobs', { shown: list.length, total: jobs.total }) })] }))] })] }));
64
+ }
65
+ /** Compare reads the first job as the baseline: the oldest of the picked ones. */
66
+ function oldestFirst(ids, jobs) {
67
+ const at = new Map(jobs.map((job) => [job.job_id, Date.parse(job.created_at)]));
68
+ return [...ids].sort((a, b) => (at.get(a) ?? 0) - (at.get(b) ?? 0));
69
+ }
@@ -0,0 +1,97 @@
1
+ import { evalJobScore, evalTrialScore, type WorkspaceEvalJob, type WorkspaceEvalTrial } from '@kortix/sdk';
2
+ /**
3
+ * The Evals group of Customize: Overview, Datasets, Tasks, Jobs. A dataset is
4
+ * a suite of kortix.yaml or a dataset by name (built-in or Harbor registry);
5
+ * its URL is `/admin/eval-datasets/suite/<name>` or
6
+ * `/admin/eval-datasets/dataset/<org>/<name>?version=`.
7
+ */
8
+ export declare const evalsHref: (projectId: string) => string;
9
+ export declare const evalDatasetsHref: (projectId: string) => string;
10
+ export declare const evalTasksHref: (projectId: string) => string;
11
+ export declare const evalJobsHref: (projectId: string) => string;
12
+ export declare const evalJobHref: (projectId: string, jobId: string, trialId?: string | null) => string;
13
+ /** Jobs side by side; the first is the baseline. */
14
+ export declare const evalCompareHref: (projectId: string, jobIds: string[]) => string;
15
+ /** A suite of kortix.yaml, or a dataset by name and version. */
16
+ export type EvalDatasetRef = {
17
+ kind: 'suite';
18
+ name: string;
19
+ } | {
20
+ kind: 'dataset';
21
+ name: string;
22
+ version?: string | null;
23
+ };
24
+ export declare const datasetKey: (ref: EvalDatasetRef) => string;
25
+ /** `smoke`, or `kortix/my-kortix@1.0`: how a dataset is named in text. */
26
+ export declare const datasetLabel: (ref: EvalDatasetRef) => string;
27
+ export declare const evalDatasetHref: (projectId: string, ref: EvalDatasetRef, tab?: string) => string;
28
+ /** The route's catch-all segments (`suite/<name>`, `dataset/<org>/<name>`) back to a ref. */
29
+ export declare function parseDatasetSegments(segments: readonly string[], version: string | null): EvalDatasetRef | null;
30
+ /** A task opens with the dataset it was reached from, for the breadcrumb and New job. */
31
+ export declare const evalTaskHref: (projectId: string, taskId: string, from?: EvalDatasetRef | null) => string;
32
+ /** `suite:smoke` or `dataset:kortix/my-kortix@1.0` (the `from` of a task link) back to a ref. */
33
+ export declare function parseDatasetKey(value: string | null | undefined): EvalDatasetRef | null;
34
+ /** The dataset a job ran: its suite, else its first named dataset. Null for a job on a repository path. */
35
+ export declare function jobDataset(job: Pick<WorkspaceEvalJob, 'suite' | 'config'>): EvalDatasetRef | null;
36
+ /**
37
+ * The `kortix evals run` command for a dataset (and a task of it). A suite
38
+ * names its own agents; a dataset needs one, so the command names the first
39
+ * agent the caller has, else a placeholder.
40
+ */
41
+ export declare function runCommand(ref: EvalDatasetRef, options?: {
42
+ agent?: string | null;
43
+ task?: string | null;
44
+ }): string;
45
+ /** `1.2k`, `3.4M`: a token count in short units. */
46
+ export declare function shortCount(value: number | null | undefined): string;
47
+ /** `$0.42`, `$12.30`, or an em dash with no cost. Under a cent shows `<$0.01`. */
48
+ export declare function usd(value: number | null | undefined): string;
49
+ /** `42 s`, `3 m 05 s`, `1 h 02 m`: the time between two instants, or an em dash. */
50
+ export declare function duration(from: string | null | undefined, to: string | null | undefined, now?: number): string;
51
+ /**
52
+ * The 95% interval half-width of a pass rate over `n` valid trials (normal
53
+ * approximation): two runs whose intervals overlap are not a clear change.
54
+ */
55
+ export declare function passInterval(rate: number | null | undefined, n: number): number | null;
56
+ /** `82.5%`, or an em dash with no value. */
57
+ export declare const percent: (value: number | null | undefined) => string;
58
+ export declare const isOpenJob: (job: Pick<WorkspaceEvalJob, "status">) => boolean;
59
+ /** `agent` or `agent @ model`: the one label an agent × model goes by on every surface. */
60
+ export declare const agentLabel: (agent: string, model: string | null | undefined) => string;
61
+ export type CellTone = 'pass' | 'fail' | 'error' | 'running' | 'queued' | 'cancelled';
62
+ /** What one trial's cell shows. */
63
+ export declare function trialTone(trial: WorkspaceEvalTrial): CellTone;
64
+ /** The last run of each attempt stands for it: a retry replaces the run before it. */
65
+ export declare function latestRuns(trials: WorkspaceEvalTrial[]): WorkspaceEvalTrial[];
66
+ /**
67
+ * What a job measured: its suite, else (a job started without one) its first
68
+ * source: a registry dataset `terminal-bench@2.0`, or a repository path.
69
+ */
70
+ export declare function jobSource(job: Pick<WorkspaceEvalJob, 'suite' | 'config'>): string;
71
+ export interface LeaderboardRow {
72
+ suite: string;
73
+ /** The dataset the row's jobs ran, when they ran one (a suite or a named dataset). */
74
+ dataset: EvalDatasetRef | null;
75
+ agent: string;
76
+ model: string | null;
77
+ /** Pass@1, else the first metric for graded rewards. */
78
+ passAt1: number | null;
79
+ /** Valid trials of the latest job. */
80
+ n: number;
81
+ /** Pass@1 change against the job before the latest one; null with one job. */
82
+ change: number | null;
83
+ jobs: number;
84
+ lastJob: WorkspaceEvalJob;
85
+ }
86
+ /**
87
+ * One row per suite × agent × model: the score of its latest completed job,
88
+ * and the change against the completed job before it. `jobs` is newest first.
89
+ */
90
+ export declare function leaderboard(jobs: WorkspaceEvalJob[]): LeaderboardRow[];
91
+ /** Rank by score within one board, tied rows sharing a rank (`1, 2, 2, 4`). */
92
+ export declare function ranked<T extends {
93
+ passAt1: number | null;
94
+ }>(rows: T[]): Array<T & {
95
+ rank: number;
96
+ }>;
97
+ export { evalJobScore, evalTrialScore };