openpond 0.2.71 → 0.2.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/app-server.js +1 -1
  2. package/dist/chunks/{acp-VWPJ2EL4.js → acp-35QBGOMJ.js} +1 -1
  3. package/dist/chunks/{acp-agent-OZHZMQ6R.js → acp-agent-4PKMX52I.js} +1 -1
  4. package/dist/chunks/{app-layer-OHPIYEOJ.js → app-layer-42ZKHTPN.js} +1 -1
  5. package/dist/chunks/{app-server-evaluations-Y5UEF2Y7.js → app-server-evaluations-5JVNCET7.js} +1 -1
  6. package/dist/chunks/{app-server-harness-services-GUHAIIPS.js → app-server-harness-services-4E236TXE.js} +1 -1
  7. package/dist/chunks/{app-server-runtime-CH5STRJP.js → app-server-runtime-CI2NTKX7.js} +1 -1
  8. package/dist/chunks/{apps-DNLT6P4J.js → apps-EGFRTFAJ.js} +1 -1
  9. package/dist/chunks/chunk-2IECLXB2.js +2 -0
  10. package/dist/chunks/{chunk-XBAB3HMA.js → chunk-2IIVBBF5.js} +1 -1
  11. package/dist/chunks/{chunk-5LKEVB2P.js → chunk-3BIB6KKL.js} +1 -1
  12. package/dist/chunks/{chunk-PXQZOVSV.js → chunk-3V2XAYYA.js} +1 -1
  13. package/dist/chunks/{chunk-WAUFXZ5B.js → chunk-3XNUG4FO.js} +1 -1
  14. package/dist/chunks/{chunk-HUMNLSCV.js → chunk-4KG7GJ5O.js} +1 -1
  15. package/dist/chunks/chunk-5AV2EWFX.js +2 -0
  16. package/dist/chunks/{chunk-SNBFWBJI.js → chunk-5VQK3CCJ.js} +1 -1
  17. package/dist/chunks/{chunk-3JYPUOK4.js → chunk-645T6LH7.js} +1 -1
  18. package/dist/chunks/{chunk-QN4CFJQC.js → chunk-6IKIGVJF.js} +1 -1
  19. package/dist/chunks/{chunk-AT3ZYNX4.js → chunk-6KKWSUEW.js} +1 -1
  20. package/dist/chunks/{chunk-PHZZBXDO.js → chunk-A4HLKWQD.js} +1 -1
  21. package/dist/chunks/{chunk-6BTX66SV.js → chunk-AWUSAHXG.js} +1 -1
  22. package/dist/chunks/{chunk-33UVQ7DU.js → chunk-E5HDJCKK.js} +1 -1
  23. package/dist/chunks/{chunk-E57PUTV2.js → chunk-E7SQBMYW.js} +1 -1
  24. package/dist/chunks/{chunk-OFV26C2U.js → chunk-EAW5FHU4.js} +2 -2
  25. package/dist/chunks/{chunk-VV4K5YPD.js → chunk-EZ435RGA.js} +1 -1
  26. package/dist/chunks/{chunk-SSHE6B7Z.js → chunk-F64TR23C.js} +1 -1
  27. package/dist/chunks/{chunk-B7SCVTE6.js → chunk-FA3GXQYA.js} +1 -1
  28. package/dist/chunks/{chunk-WXG3G2O6.js → chunk-FCC24XUI.js} +1 -1
  29. package/dist/chunks/{chunk-U7D6Q744.js → chunk-FDYWGE2Y.js} +1 -1
  30. package/dist/chunks/{chunk-OTG77H7U.js → chunk-FRQYH4QD.js} +1 -1
  31. package/dist/chunks/{chunk-OEAKX5TS.js → chunk-G2P2PYEO.js} +1 -1
  32. package/dist/chunks/{chunk-KASHK2U5.js → chunk-H2YQ4AA2.js} +1 -1
  33. package/dist/chunks/{chunk-ZG3DBXQG.js → chunk-H5EHSILL.js} +1 -1
  34. package/dist/chunks/{chunk-DNNWMOMG.js → chunk-HIPKU57Y.js} +1 -1
  35. package/dist/chunks/{chunk-OQ4RWCYI.js → chunk-IXMY4EKS.js} +1 -1
  36. package/dist/chunks/{chunk-PLROXHG2.js → chunk-JAIFVT3D.js} +1 -1
  37. package/dist/chunks/{chunk-XNPTLJ5Z.js → chunk-JG6JA7YT.js} +1 -1
  38. package/dist/chunks/{chunk-PJJSQ4ZI.js → chunk-KE5PYRJ6.js} +1 -1
  39. package/dist/chunks/{chunk-RP4DPUN2.js → chunk-KH42V27F.js} +1 -1
  40. package/dist/chunks/{chunk-ASMQTMQB.js → chunk-KOLVSUOS.js} +1 -1
  41. package/dist/chunks/{chunk-D2V2Y3FB.js → chunk-KQ7RFPG5.js} +1 -1
  42. package/dist/chunks/{chunk-GUWNSMGH.js → chunk-LWF5MQJ4.js} +1 -1
  43. package/dist/chunks/{chunk-USTDWGR4.js → chunk-MHSSPMLB.js} +1 -1
  44. package/dist/chunks/{chunk-UMRQKE3W.js → chunk-MXDSB2C5.js} +1 -1
  45. package/dist/chunks/{chunk-IJJ7FYZE.js → chunk-O6L4NO3M.js} +1 -1
  46. package/dist/chunks/{chunk-SRJTQS2D.js → chunk-OBMMO5NC.js} +3 -3
  47. package/dist/chunks/{chunk-USKCFST5.js → chunk-ODH5XGE6.js} +1 -1
  48. package/dist/chunks/{chunk-OKPV6MBX.js → chunk-OFC5N6R3.js} +6 -6
  49. package/dist/chunks/{chunk-ESOIZG2G.js → chunk-ONR2AKRI.js} +4 -4
  50. package/dist/chunks/{chunk-IFMWAOBR.js → chunk-OUOOKEU3.js} +1 -1
  51. package/dist/chunks/{chunk-VJYOKU3C.js → chunk-OVEQAEKR.js} +1 -1
  52. package/dist/chunks/{chunk-7PDF2UX2.js → chunk-OXUS4QOT.js} +1 -1
  53. package/dist/chunks/{chunk-VND53FAU.js → chunk-P7RLDDPN.js} +1 -1
  54. package/dist/chunks/{chunk-TWLPZHH7.js → chunk-SUILNZQJ.js} +1 -1
  55. package/dist/chunks/{chunk-3JVZ7OCQ.js → chunk-TP222CV2.js} +1 -1
  56. package/dist/chunks/{chunk-AVEHWUML.js → chunk-TRXOE7TT.js} +1 -1
  57. package/dist/chunks/{chunk-O5ZOW474.js → chunk-U73T66FP.js} +1 -1
  58. package/dist/chunks/{chunk-ER2VONWQ.js → chunk-WAWVFSIQ.js} +1 -1
  59. package/dist/chunks/{chunk-F2EUZG2W.js → chunk-WBV6A6NS.js} +1 -1
  60. package/dist/chunks/{chunk-UKTPX2EE.js → chunk-WOYBWRRV.js} +1 -1
  61. package/dist/chunks/{chunk-7SOHV5BH.js → chunk-X4CN3FIN.js} +1 -1
  62. package/dist/chunks/{chunk-RJY4EI46.js → chunk-XN5BXPAT.js} +1 -1
  63. package/dist/chunks/{chunk-23YW5PAQ.js → chunk-XSDWRRZP.js} +1 -1
  64. package/dist/chunks/{chunk-LMLGEOKV.js → chunk-YIZE3M5S.js} +1 -1
  65. package/dist/chunks/{cli-5JARGJOD.js → cli-NHRYN2G3.js} +1 -1
  66. package/dist/chunks/{command-AI3SMEAH.js → command-54MMVWS2.js} +3 -3
  67. package/dist/chunks/{configuration-command-NPA46ZOT.js → configuration-command-XMXTU2FQ.js} +1 -1
  68. package/dist/chunks/{connected-app-executor-DLC23O43.js → connected-app-executor-WJEDXUA4.js} +1 -1
  69. package/dist/chunks/{connected-evidence-TVORI55Q.js → connected-evidence-NFQPO5E3.js} +1 -1
  70. package/dist/chunks/{connected-starting-assets-WGGBWH4K.js → connected-starting-assets-M54PSOEP.js} +1 -1
  71. package/dist/chunks/{continual-UHQI2EQD.js → continual-C2YWPEJZ.js} +1 -1
  72. package/dist/chunks/{core-commands-QNZUBKOC.js → core-commands-SY4I5FHE.js} +1 -1
  73. package/dist/chunks/{dataset-preparation-authoring-OBMJLGA4.js → dataset-preparation-authoring-CH6Z4NE6.js} +1 -1
  74. package/dist/chunks/{datasets-USJLJOEQ.js → datasets-2OQDMF7E.js} +1 -1
  75. package/dist/chunks/{desktop-test-IYHAOR47.js → desktop-test-VNMR5H4I.js} +1 -1
  76. package/dist/chunks/{evaluation-coordination-UJENK4WQ.js → evaluation-coordination-GULGPATI.js} +1 -1
  77. package/dist/chunks/{experiment-improvements-6GJMKIER.js → experiment-improvements-XNXTU6ZA.js} +1 -1
  78. package/dist/chunks/{experiments-FZHILSC6.js → experiments-DZX6ZU6F.js} +1 -1
  79. package/dist/chunks/{experiments-signal-E32CWBS4.js → experiments-signal-QDVPO3M5.js} +1 -1
  80. package/dist/chunks/{help-32DLAPJR.js → help-UCN67FN7.js} +1 -1
  81. package/dist/chunks/{host-profile-evaluation-tools-QAV2UGSB.js → host-profile-evaluation-tools-XMGGHVH3.js} +1 -1
  82. package/dist/chunks/{hosted-app-server-composition-5DVBKNV3.js → hosted-app-server-composition-U7WGMN5B.js} +1 -1
  83. package/dist/chunks/{hosted-experiment-improvement-YQ24C54D.js → hosted-experiment-improvement-VQN6PJKR.js} +1 -1
  84. package/dist/chunks/{hosted-harness-runtime-KLIORGWV.js → hosted-harness-runtime-O6E5LCGN.js} +1 -1
  85. package/dist/chunks/{hosted-profile-candidate-RCWFLOVJ.js → hosted-profile-candidate-HQ544PNP.js} +1 -1
  86. package/dist/chunks/{hosted-profile-compiler-UDG4BCEW.js → hosted-profile-compiler-K4OACT7S.js} +1 -1
  87. package/dist/chunks/{hosted-profile-evaluation-control-4R3L4FTK.js → hosted-profile-evaluation-control-TKYM73YY.js} +1 -1
  88. package/dist/chunks/{hosted-profile-evaluation-inspection-NA4SSY7N.js → hosted-profile-evaluation-inspection-HFCFUYQ4.js} +1 -1
  89. package/dist/chunks/{hosted-profile-evaluation-preparation-B4BW6JTB.js → hosted-profile-evaluation-preparation-OJ6AR5P5.js} +1 -1
  90. package/dist/chunks/{human-review-D6QCZLYN.js → human-review-DNVIVJRK.js} +1 -1
  91. package/dist/chunks/{import-UCG75PN5.js → import-QT5AKEA3.js} +1 -1
  92. package/dist/chunks/{local-harness-improvement-runtime-GZBMBZB2.js → local-harness-improvement-runtime-BWZBMOGL.js} +1 -1
  93. package/dist/chunks/{local-harness-taskset-review-YVP2ZQJG.js → local-harness-taskset-review-JL2XNXML.js} +1 -1
  94. package/dist/chunks/{opchat-APJUUTT7.js → opchat-7PWUXQSY.js} +1 -1
  95. package/dist/chunks/{opchat-bounded-chat-PBUSUAY2.js → opchat-bounded-chat-B3GOCGWY.js} +1 -1
  96. package/dist/chunks/{organizations-WK6EZ6L3.js → organizations-TWBMN7KF.js} +1 -1
  97. package/dist/chunks/{profile-BQMS7ALQ.js → profile-RVARQYG4.js} +1 -1
  98. package/dist/chunks/{project-action-payload-CGV77JSA.js → project-action-payload-65MTQMQW.js} +1 -1
  99. package/dist/chunks/{project-agent-XVFYTEUQ.js → project-agent-ZC33YRZE.js} +1 -1
  100. package/dist/chunks/{published-experiment-source-2CYFIRBL.js → published-experiment-source-L7BER6AE.js} +1 -1
  101. package/dist/chunks/{refiner-profile-service-OLJHA4DI.js → refiner-profile-service-56776J7B.js} +1 -1
  102. package/dist/chunks/{runtime-32KYSVZR.js → runtime-GN2H2R7L.js} +2 -2
  103. package/dist/chunks/{sandbox-command-OY3VZXGG.js → sandbox-command-HWIAH6JA.js} +1 -1
  104. package/dist/chunks/{sandbox-template-YOOSJ4FK.js → sandbox-template-MNZ6OXQQ.js} +1 -1
  105. package/dist/chunks/{saved-work-L4KNWLZB.js → saved-work-OMBDT3ZR.js} +1 -1
  106. package/dist/chunks/{send-turn-YLY3YNEQ.js → send-turn-VQRLIHOE.js} +1 -1
  107. package/dist/chunks/{setup-EU6CMRXQ.js → setup-C6673TJK.js} +1 -1
  108. package/dist/chunks/{src-3DJR7OAH.js → src-HHFJIPL5.js} +1 -1
  109. package/dist/chunks/{src-HYOTHMRX.js → src-UHNSXT34.js} +2 -2
  110. package/dist/chunks/{store-chat-resources-HISLEZZM.js → store-chat-resources-TYR7D2UP.js} +1 -1
  111. package/dist/chunks/{store-continual-support-reviews-ORWHS57V.js → store-continual-support-reviews-63YCKG3P.js} +1 -1
  112. package/dist/chunks/{store-conversation-serving-5UGYKEGJ.js → store-conversation-serving-PDSBGL3E.js} +1 -1
  113. package/dist/chunks/{store-create-improve-APLPTVYQ.js → store-create-improve-RYASTT56.js} +1 -1
  114. package/dist/chunks/{store-datasets-HDW6IYBL.js → store-datasets-PELTRO4A.js} +1 -1
  115. package/dist/chunks/{store-evaluation-results-KB2UDCF3.js → store-evaluation-results-OUTNEMAY.js} +1 -1
  116. package/dist/chunks/{store-human-review-IURNTX3C.js → store-human-review-GIMAXCJQ.js} +1 -1
  117. package/dist/chunks/{store-learned-preference-migration-validation-TH2LKQWV.js → store-learned-preference-migration-validation-DHOSHA6C.js} +1 -1
  118. package/dist/chunks/{store-local-experiments-M4V5RLHJ.js → store-local-experiments-AH4Z6RWX.js} +1 -1
  119. package/dist/chunks/{store-model-batch-review-DDZLWVTG.js → store-model-batch-review-UUW6ZLDH.js} +1 -1
  120. package/dist/chunks/{store-model-configuration-ATOFA5OH.js → store-model-configuration-4U5A6DU7.js} +1 -1
  121. package/dist/chunks/{store-model-project-preparation-ZRSCQEQR.js → store-model-project-preparation-MYHO43VH.js} +1 -1
  122. package/dist/chunks/{store-modification-recordings-YJIDUPVJ.js → store-modification-recordings-OZBLFYCT.js} +1 -1
  123. package/dist/chunks/{store-sidebar-file-bookmarks-WLMYDA4E.js → store-sidebar-file-bookmarks-NQ3ZLTGZ.js} +1 -1
  124. package/dist/chunks/{store-sidebar-preferences-AFMYIDWT.js → store-sidebar-preferences-L6J7J5WC.js} +1 -1
  125. package/dist/chunks/{store-subagents-KFPVSTRO.js → store-subagents-6FHGHQ6V.js} +1 -1
  126. package/dist/chunks/{store-task-inbox-L53OT6ZC.js → store-task-inbox-M7YZNCRF.js} +1 -1
  127. package/dist/chunks/{store-task-inventory-R2JJGAHW.js → store-task-inventory-TTJQAM3T.js} +1 -1
  128. package/dist/chunks/{store-taskset-drafts-FPNJPFPO.js → store-taskset-drafts-4GVHDLJJ.js} +1 -1
  129. package/dist/chunks/{store-training-DIBW7OMP.js → store-training-MGGTGTV2.js} +1 -1
  130. package/dist/chunks/{store-training-jobs-K7I4SXWW.js → store-training-jobs-XKDUX4SV.js} +1 -1
  131. package/dist/chunks/{store-training-models-LCSB37YY.js → store-training-models-4S4ZT3BL.js} +1 -1
  132. package/dist/chunks/{taskset-XI5SJBJL.js → taskset-SLQSCYJI.js} +1 -1
  133. package/dist/chunks/{teams-bot-CYC5TR64.js → teams-bot-7U6JOV6T.js} +1 -1
  134. package/dist/chunks/{tool-learning-52QZIJIR.js → tool-learning-25Z2JOBS.js} +1 -1
  135. package/dist/chunks/{training-GDLLLXSV.js → training-2LUQ2IZM.js} +1 -1
  136. package/dist/chunks/{training-RL7UUBER.js → training-JA5ZQABE.js} +1 -1
  137. package/dist/chunks/{training-UJ62NOJJ.js → training-NL5GYZKU.js} +1 -1
  138. package/dist/chunks/training-hosted-NLXMISNL.js +2 -0
  139. package/dist/chunks/{training-hosted-alphaedit-R5PVATV4.js → training-hosted-alphaedit-WGMJ3L2D.js} +1 -1
  140. package/dist/chunks/{training-hosted-decision-WNK5DE3M.js → training-hosted-decision-66EUMUIW.js} +1 -1
  141. package/dist/chunks/{training-hosted-engram-ZQDOKXAV.js → training-hosted-engram-QDXSJ77I.js} +1 -1
  142. package/dist/chunks/{training-hosted-modification-comparison-KKI5CKOH.js → training-hosted-modification-comparison-2MH5FZMZ.js} +1 -1
  143. package/dist/chunks/{training-hosted-neuron-training-CFWEDRSR.js → training-hosted-neuron-training-3QXKIEKT.js} +1 -1
  144. package/dist/chunks/{training-hosted-serving-report-N4NF5AVW.js → training-hosted-serving-report-ZG75ACZK.js} +1 -1
  145. package/dist/chunks/{training-hosted-steering-4MDUQ2YV.js → training-hosted-steering-KFMTKCTX.js} +1 -1
  146. package/dist/chunks/{training-model-start-NOA6TYQK.js → training-model-start-NMQ55UHZ.js} +1 -1
  147. package/dist/chunks/{workspaces-EK62ANTB.js → workspaces-ROFG76XK.js} +1 -1
  148. package/dist/cli.js +1 -1
  149. package/dist/skills/manifest.json +1 -1
  150. package/dist/web/assets/{App-L7RV4D0A.js → App-CV1p0_Zy.js} +4 -4
  151. package/dist/web/assets/{AppDialog-B2V84J7f.js → AppDialog-DdGt7aU1.js} +1 -1
  152. package/dist/web/assets/{AppTerminalPanel-DfYpUDKT.js → AppTerminalPanel-B2p_tYh5.js} +2 -2
  153. package/dist/web/assets/{AppToastContext-DuiPouLz.js → AppToastContext-D7z0w1PS.js} +1 -1
  154. package/dist/web/assets/{AppsView-B20RHDCy.js → AppsView-B-Ts-M_V.js} +1 -1
  155. package/dist/web/assets/{AttachmentTypeIcon-l-GRNxaz.js → AttachmentTypeIcon-BJ5i12im.js} +1 -1
  156. package/dist/web/assets/{BrowserSidebar-Ce0ToS2O.js → BrowserSidebar-BVHthjXU.js} +1 -1
  157. package/dist/web/assets/{CartesianChart-CtfMRAfp.js → CartesianChart-BuJ1wFS7.js} +1 -1
  158. package/dist/web/assets/{ChatTimelineEntry-DzcucW20.js → ChatTimelineEntry-CfiiTrK4.js} +1 -1
  159. package/dist/web/assets/{CollaborationTabs-BpmKjNAC.js → CollaborationTabs-1t9zAhDC.js} +1 -1
  160. package/dist/web/assets/{CommandMenu-JXsoxijv.js → CommandMenu-DTB6xjGG.js} +1 -1
  161. package/dist/web/assets/{CommunityView-ggdn8pcH.js → CommunityView-BjeZ56id.js} +1 -1
  162. package/dist/web/assets/{ComposerAttachments-BMmALUs_.js → ComposerAttachments-C_K_05H9.js} +1 -1
  163. package/dist/web/assets/{ComposerCreateImproveStrip-DcM1bkfu.js → ComposerCreateImproveStrip-A38jnNGd.js} +1 -1
  164. package/dist/web/assets/{ConversationImportsSettings-BKNeARHI.js → ConversationImportsSettings-jwaoKQZt.js} +1 -1
  165. package/dist/web/assets/{DatasetReviewImport-DyFOE0Q0.js → DatasetReviewImport-DZA1s3XG.js} +1 -1
  166. package/dist/web/assets/{ExperimentTrainingDataWorkspace-CfOyoMrq.js → ExperimentTrainingDataWorkspace-DowPuAXk.js} +2 -2
  167. package/dist/web/assets/{FilePagePreview-B7bWObJN.js → FilePagePreview-11ZNRtdT.js} +2 -2
  168. package/dist/web/assets/{GetStartedView-BYbFl93M.js → GetStartedView-bLVKmjqg.js} +1 -1
  169. package/dist/web/assets/{GettingStartedDialog-UgreDozV.js → GettingStartedDialog-BeimFLZh.js} +1 -1
  170. package/dist/web/assets/{HostedModelLearningReview-C_kng2U_.js → HostedModelLearningReview-DiFVb3WK.js} +1 -1
  171. package/dist/web/assets/{HostedModelLearningSettings-aesD_ifF.js → HostedModelLearningSettings-DtUF5ejq.js} +1 -1
  172. package/dist/web/assets/{HtmlVisual-nvl1x-jh.js → HtmlVisual-CgVTWr64.js} +1 -1
  173. package/dist/web/assets/{LabModelVersionDetailPage-DrdoNvI-.js → LabModelVersionDetailPage-BvinwnBN.js} +1 -1
  174. package/dist/web/assets/{LabModelWorkspace-CHlhzG3q.js → LabModelWorkspace-Q5DG2mLP.js} +1 -1
  175. package/dist/web/assets/{LabSkillSidebar-CqHeZzoj.js → LabSkillSidebar-cmhZzr4f.js} +1 -1
  176. package/dist/web/assets/{LabsRoute-DzEbPpMK.js → LabsRoute-DS_mlprv.js} +4 -4
  177. package/dist/web/assets/{LearningBatchesPage-A2dFQW2j.js → LearningBatchesPage-Cm-btgWc.js} +1 -1
  178. package/dist/web/assets/{MainChatThread-BSvKu4e5.js → MainChatThread-DbTn4Bag.js} +2 -2
  179. package/dist/web/assets/{MainPane-DiWIAxMj.js → MainPane-BtzUF6O_.js} +6 -6
  180. package/dist/web/assets/{ModelProjectPageHeader-lu6iRXHK.js → ModelProjectPageHeader-C4mgVJGx.js} +1 -1
  181. package/dist/web/assets/{NativeSetupTerminal-kZ-nFPE8.js → NativeSetupTerminal-bJpDkKk1.js} +2 -2
  182. package/dist/web/assets/{NativeSkillSidebar-DkkD1uH2.js → NativeSkillSidebar-BuToZvK-.js} +1 -1
  183. package/dist/web/assets/{NewProjectDialog-Dg8dMEpc.js → NewProjectDialog-F0BPQy0S.js} +1 -1
  184. package/dist/web/assets/{OutputsPage-Dz190U9t.js → OutputsPage-DC4g59_8.js} +1 -1
  185. package/dist/web/assets/{PageChrome-Bncv-ps0.js → PageChrome-ufq2jePD.js} +1 -1
  186. package/dist/web/assets/{ProjectsPage-DVkYvLtd.js → ProjectsPage-7mbOvMfO.js} +1 -1
  187. package/dist/web/assets/{RightChatPanelStack-CP4leenI.js → RightChatPanelStack-sR9xN3RP.js} +1 -1
  188. package/dist/web/assets/RightSidebarHomePanel-joZavyR9.js +1 -0
  189. package/dist/web/assets/{ScheduledWorkPage-DI0mgt82.js → ScheduledWorkPage-s9CN6nR_.js} +1 -1
  190. package/dist/web/assets/{SettingsView-cCtkr089.js → SettingsView-CZNWYK-D.js} +3 -3
  191. package/dist/web/assets/{TasksetDraftEditorPrimitives-DCQTuswJ.js → TasksetDraftEditorPrimitives-BnMqzE-T.js} +1 -1
  192. package/dist/web/assets/{TeamChatView-BBEomfQ7.js → TeamChatView-XthM6n4S.js} +1 -1
  193. package/dist/web/assets/{TerminalOverlay-Dj5NUDMp.js → TerminalOverlay--HCFZaQW.js} +1 -1
  194. package/dist/web/assets/{TrainingCreationPanel-Ds4PLfsd.js → TrainingCreationPanel-D2F6kPg_.js} +1 -1
  195. package/dist/web/assets/{TrainingDraftPanel-BAuh_BF3.js → TrainingDraftPanel-BurWPp9F.js} +1 -1
  196. package/dist/web/assets/{UsageSettingsSection-DbzeatcW.js → UsageSettingsSection-D7jdscDm.js} +1 -1
  197. package/dist/web/assets/WorkSidebarPanel-CmdXCmrZ.js +1 -0
  198. package/dist/web/assets/{WorkspaceDiffPanel-xk-ve1MO.js → WorkspaceDiffPanel-CPaCC1_p.js} +3 -3
  199. package/dist/web/assets/{WorkspaceEnvironmentMenu-D8GSuoYz.js → WorkspaceEnvironmentMenu-BZxu6mUS.js} +1 -1
  200. package/dist/web/assets/{WorkspaceFileLocation-Dl8M2ZKN.js → WorkspaceFileLocation-C4K_D_yh.js} +1 -1
  201. package/dist/web/assets/{WorkspaceGitDialogs-9BhLjYx4.js → WorkspaceGitDialogs-C0Yf29V0.js} +1 -1
  202. package/dist/web/assets/{WorkspaceMonacoEditor-DYPuC7pj.js → WorkspaceMonacoEditor-BRPLaFZS.js} +3 -3
  203. package/dist/web/assets/{WorkspacePdfPreview-B7BI9tLR.js → WorkspacePdfPreview-9wypyV6H.js} +2 -2
  204. package/dist/web/assets/{WorkspacePresentationPreview-sP7JUT7m.js → WorkspacePresentationPreview-C-Cn-9pj.js} +1 -1
  205. package/dist/web/assets/{bot-D7M8ZtE6.js → bot-BuaAVlz6.js} +1 -1
  206. package/dist/web/assets/{chat-resources-DhKAnljP.js → chat-resources-DMPHClhQ.js} +1 -1
  207. package/dist/web/assets/chevron-down-CkifKd_O.js +1 -0
  208. package/dist/web/assets/chevron-right-LsMXJ5SB.js +1 -0
  209. package/dist/web/assets/chevron-up-Dt5T2Sf5.js +1 -0
  210. package/dist/web/assets/{chunk-C3TS766N-DENE60SE.js → chunk-C3TS766N-BXUEjt7d.js} +1 -1
  211. package/dist/web/assets/{client-gy7zrd7a.js → client-C-ZuakZR.js} +1 -1
  212. package/dist/web/assets/{client-choice-storage-DYZsrVr9.js → client-choice-storage-DWIA0Vou.js} +1 -1
  213. package/dist/web/assets/{cloud-upload-De-XSMUr.js → cloud-upload-B5LqiNCG.js} +1 -1
  214. package/dist/web/assets/{copy-DEK20zbZ.js → copy-BYIypHbq.js} +1 -1
  215. package/dist/web/assets/{cssMode-Dau-Fhqf.js → cssMode-ByypIqUN.js} +1 -1
  216. package/dist/web/assets/{external-link-DwDry0Fb.js → external-link-Cv7TDVPT.js} +1 -1
  217. package/dist/web/assets/{folder-open-DOb4AjV6.js → folder-open-DlIP3g5o.js} +1 -1
  218. package/dist/web/assets/{folder-plus-BAouDaXv.js → folder-plus-CXwFJqcY.js} +1 -1
  219. package/dist/web/assets/{git-commit-horizontal-DZbHXcai.js → git-commit-horizontal-DMh_-WxU.js} +1 -1
  220. package/dist/web/assets/{htmlMode-DlNEe6hu.js → htmlMode-CQGeb-h5.js} +1 -1
  221. package/dist/web/assets/{icons-OQhKVrDc.js → icons-CYvTltSH.js} +1 -1
  222. package/dist/web/assets/{image-BkYJDChH.js → image-Ci1JxTQX.js} +1 -1
  223. package/dist/web/assets/{index-M_h2Ok4V.js → index-CDtTBysF.js} +2 -2
  224. package/dist/web/assets/{info-Mj5lp4Ic.js → info-EjyMkVzV.js} +1 -1
  225. package/dist/web/assets/{jsonMode-CyOEyonV.js → jsonMode-Dm6YK6Dw.js} +1 -1
  226. package/dist/web/assets/loader-circle-AjP2mDJA.js +1 -0
  227. package/dist/web/assets/{lspLanguageFeatures-DAYPzatg.js → lspLanguageFeatures-BjtOz-Ln.js} +1 -1
  228. package/dist/web/assets/{maximize-2-BwFXSX6b.js → maximize-2-CvvoALtI.js} +1 -1
  229. package/dist/web/assets/{message-square-C2nqfNLn.js → message-square-CPtIPRtf.js} +1 -1
  230. package/dist/web/assets/{monaco.contribution-KyLdVay7.js → monaco.contribution-ClH8Tmjq.js} +2 -2
  231. package/dist/web/assets/{monaco.contribution-BZcNCJER.js → monaco.contribution-VSFFgrfZ.js} +2 -2
  232. package/dist/web/assets/{monaco.contribution-D7_X8TXe.js → monaco.contribution-e5DNaEix.js} +2 -2
  233. package/dist/web/assets/{monaco.contribution-BZkfRhss.js → monaco.contribution-wpC0-Kxw.js} +2 -2
  234. package/dist/web/assets/{monitor-B0Qj5Wea.js → monitor-BroZpIvk.js} +1 -1
  235. package/dist/web/assets/{paperclip-CmrRruxi.js → paperclip-DYZEL_Gi.js} +1 -1
  236. package/dist/web/assets/{pdf-BM-9_48p.js → pdf-DkU37Bi0.js} +1 -1
  237. package/dist/web/assets/play-BrvX67t1.js +1 -0
  238. package/dist/web/assets/plus-DFjCZeRE.js +1 -0
  239. package/dist/web/assets/{presentation-BYxhoSIo.js → presentation-CddfsTzp.js} +1 -1
  240. package/dist/web/assets/{python-B3Mj03I5.js → python-CMdyfF2B.js} +1 -1
  241. package/dist/web/assets/{refresh-cw-CwEmO71D.js → refresh-cw-Cx_7Zlbl.js} +1 -1
  242. package/dist/web/assets/{save-S--FOuce.js → save-BaeHeBBw.js} +1 -1
  243. package/dist/web/assets/{settings-lists-ChqDppMP.js → settings-lists-CVg9h-5z.js} +1 -1
  244. package/dist/web/assets/square-Di5JBnVr.js +1 -0
  245. package/dist/web/assets/{square-terminal-CawpQtCi.js → square-terminal-CBlQtWQw.js} +1 -1
  246. package/dist/web/assets/{submit-issue-command-CFitxxmO.js → submit-issue-command-L5--gt9i.js} +1 -1
  247. package/dist/web/assets/{toggleHighContrast-D-cMCvXx.js → toggleHighContrast-hftC_Rxs.js} +1 -1
  248. package/dist/web/assets/training-CGYukv2L.js +1 -0
  249. package/dist/web/assets/{training-model-data-G-D64935.js → training-model-data-vvvphDlO.js} +1 -1
  250. package/dist/web/assets/{tsMode-9kzS1ijG.js → tsMode-B0sZU1HD.js} +1 -1
  251. package/dist/web/assets/{upload-CtYsSYrM.js → upload-Bzt1ooBz.js} +1 -1
  252. package/dist/web/assets/{useAccountSettings-DYYa6puz.js → useAccountSettings-BnxwetkP.js} +1 -1
  253. package/dist/web/assets/{useAgentInventory-c5B_Tszj.js → useAgentInventory-D_qS4ols.js} +1 -1
  254. package/dist/web/assets/{useChatContextSelection-DOISZpTz.js → useChatContextSelection-D8aSVtCm.js} +1 -1
  255. package/dist/web/assets/{useLocalAgentSchedules-QJ8RsMKm.js → useLocalAgentSchedules-CUQ1MW4l.js} +1 -1
  256. package/dist/web/assets/{useQuery-DuTGOe2b.js → useQuery-9SCnxwmR.js} +1 -1
  257. package/dist/web/assets/{wifi-off-BOfP4Vmg.js → wifi-off-DWtVm7W7.js} +1 -1
  258. package/dist/web/assets/{workers-BwGpyrdj.js → workers-B3jA6AOv.js} +1 -1
  259. package/dist/web/assets/x-EG07vYCF.js +1 -0
  260. package/dist/web/assets/{yaml-BU4IWV_7.js → yaml-BEUL30-5.js} +1 -1
  261. package/dist/web/index.html +1 -1
  262. package/docs/command-reference.md +3 -1
  263. package/package.json +1 -1
  264. package/dist/chunks/chunk-NK2L5HA2.js +0 -2
  265. package/dist/chunks/chunk-XJU47QS2.js +0 -2
  266. package/dist/chunks/training-hosted-V5CHG3M3.js +0 -2
  267. package/dist/web/assets/RightSidebarHomePanel-C0etQXpt.js +0 -1
  268. package/dist/web/assets/WorkSidebarPanel-BaNuXoZc.js +0 -1
  269. package/dist/web/assets/chevron-down-BAEcJitl.js +0 -1
  270. package/dist/web/assets/chevron-right-3G9s2cQ9.js +0 -1
  271. package/dist/web/assets/chevron-up-DTYF52H1.js +0 -1
  272. package/dist/web/assets/loader-circle-DXVtGvuV.js +0 -1
  273. package/dist/web/assets/play-CkACZ6Zo.js +0 -1
  274. package/dist/web/assets/plus-CB258e62.js +0 -1
  275. package/dist/web/assets/square-BmPfHjGU.js +0 -1
  276. package/dist/web/assets/training-CzbWtx75.js +0 -1
  277. package/dist/web/assets/x-5_iy6IDd.js +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n,s as r}from"./index-M_h2Ok4V.js";import{n as i}from"./api-client-DJRVOFzS.js";import"./icons-OQhKVrDc.js";import{t as a}from"./external-link-DwDry0Fb.js";import{t as o}from"./loader-circle-DXVtGvuV.js";import{t as s}from"./plus-CB258e62.js";import{t as c}from"./x-5_iy6IDd.js";import{t as l}from"./NativeSetupTerminal-kZ-nFPE8.js";import{t as u}from"./AppDialog-B2V84J7f.js";import{Gt as d,Tn as f,gn as p,t as m}from"./App-L7RV4D0A.js";/* empty css */import{t as h}from"./useAccountSettings-DYYa6puz.js";var g=e(t(),1),_=n(),v={codex:{name:`Codex`,installUrl:`https://developers.openai.com/codex/cli`},"claude-code":{name:`Claude`,installUrl:`https://code.claude.com/docs/en/setup`}};function y({providerId:e,connection:t,config:n,onProviders:r}){let c=v[e],u=m(),d=(0,g.useRef)(u.active);d.current=u.active;let[h,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(!0),[S,C]=(0,g.useState)(null),[w,T]=(0,g.useState)(null),E=(0,g.useRef)(null),D=(0,g.useRef)(!1),O=(0,g.useRef)(r);O.current=r,(0,g.useEffect)(()=>(D.current=!0,()=>{D.current=!1}),[]);let k=(0,g.useCallback)(async()=>{E.current?.abort();let n=new AbortController;E.current=n;let r=setTimeout(()=>n.abort(Error(`Connection check timed out. Try again.`)),45e3);x(!0),C(null),y(null);try{let r=await i(t,`/v1/providers/${e}/native-setup`,{method:`POST`,body:JSON.stringify({action:`check`}),signal:n.signal});if(E.current!==n||n.signal.aborted)return;y(r),C(r.error),O.current(r.settings)}catch(e){E.current===n&&C(e instanceof Error?e.message:String(e))}finally{clearTimeout(r),E.current===n&&(E.current=null,x(!1))}},[t.serverUrl,t.token,e]);(0,g.useEffect)(()=>{!w&&!(e===`claude-code`&&d.current)&&k();function t(){!E.current&&!w&&!(e===`claude-code`&&d.current)&&k()}return window.addEventListener(`focus`,t),()=>{window.removeEventListener(`focus`,t);let e=E.current;E.current=null,e?.abort()}},[k,n?.binaryPath,n?.sourceHome,w,e]);async function A(){if(!b){x(!0),C(null);try{let n=await f.saveProviderSettings(t,{providers:{[e]:{enabled:!0}}});if(!D.current)return;O.current(n),await k()}catch(e){C(e instanceof Error?e.message:String(e)),x(!1)}}}async function j(){if(b)return;let r=new AbortController;E.current=r;let a=setTimeout(()=>r.abort(),1e4);x(!0),C(null);try{let a=await i(t,`/v1/providers/${e}/native-setup`,{method:`POST`,body:JSON.stringify({action:`login`}),signal:r.signal});if(E.current!==r||r.signal.aborted)return;if(!n?.enabled){let n=await f.saveProviderSettings(t,{providers:{[e]:{enabled:!0}}});if(E.current!==r||r.signal.aborted)return;O.current(n)}E.current===r&&!r.signal.aborted&&(e===`claude-code`?u.start(a):T(a))}catch(e){E.current===r&&C(e instanceof Error?e.message:String(e))}finally{clearTimeout(a),E.current===r&&(E.current=null,x(!1))}}(0,g.useEffect)(()=>{if(e!==`claude-code`||!u.result)return;let t=u.result.settings.providers[e];(t?.binaryPath||null)===(n?.binaryPath||null)&&(t?.sourceHome||null)===(n?.sourceHome||null)&&(x(!1),y(u.result),C(u.result.status===`unavailable`?u.result.error:null))},[u.result,e,n?.binaryPath,n?.sourceHome]);let M=!S&&h?.status===`ready`;return(0,_.jsxs)(`li`,{className:`getting-started-card`,children:[(0,_.jsx)(`img`,{className:`getting-started-provider-icon`,src:`/agent-sources/${e}.svg`,alt:``}),(0,_.jsx)(`h3`,{children:c.name}),(0,_.jsx)(`div`,{className:`getting-started-card-status`,role:`status`,"aria-live":`polite`,children:e===`claude-code`&&u.active?(0,_.jsx)(`button`,{type:`button`,onClick:u.resume,children:`Continue sign-in`}):b?(0,_.jsx)(o,{className:`settings-spin`,size:20,"aria-label":`Checking ${c.name}`}):M&&n?.enabled?(0,_.jsxs)(`span`,{children:[(0,_.jsx)(p,{size:16}),` Connected`]}):M?(0,_.jsxs)(`button`,{type:`button`,"aria-label":`Connect ${c.name}`,onClick:()=>void A(),children:[(0,_.jsx)(s,{size:14}),` Connect`]}):h?.status===`missing`?(0,_.jsxs)(`a`,{href:c.installUrl,target:`_blank`,rel:`noreferrer`,children:[`Install `,c.name,` `,(0,_.jsx)(a,{size:12})]}):h?.status===`needs_login`?(0,_.jsx)(`button`,{type:`button`,className:`getting-started-login`,"aria-label":`Log in to ${c.name}`,title:S??void 0,onClick:()=>void j(),children:`Log in`}):(0,_.jsx)(`button`,{type:`button`,"aria-label":`Retry ${c.name} connection`,title:S??`Check connection again`,onClick:()=>void k(),children:`Retry`})}),w?(0,_.jsx)(l,{modal:!0,connection:t,command:w.command,displayCommand:w.displayCommand,onComplete:()=>T(null),onClose:()=>T(null)}):null]})}var b=`https://www.openpond.ai/api-keys`;function x({connection:e,payload:t,onPayload:n,onClose:i}){let[o,s]=(0,g.useState)(!1),[l,f]=(0,g.useState)(``),[m,v]=(0,g.useState)(null),x=(0,g.useRef)(t);x.current=t;let S=h({connection:e,onPayload:n,onError:v});function C(e){n({...x.current,providers:e})}let w=t.account.state===`signed_in`;async function T(e){if(e.preventDefault(),l.trim()&&!S.saving)try{await S.saveAccount({apiKey:l,baseUrl:`https://www.openpond.ai`,apiBaseUrl:`https://api.openpond.ai`,environment:`production`}),f(``),s(!1)}catch{}}async function E(){v(null);try{let e=window.openpond?.browser;if(e?.openExternal){let t=await e.openExternal({conversationId:`openpond-get-started`,url:b});if(!t.ok)throw Error(t.error??`Could not open API keys in your browser.`)}else window.open(b,`_blank`,`noopener,noreferrer`)}catch(e){v(e instanceof Error?e.message:String(e))}}return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(u,{inertExclusionSelector:`.native-login-session`,ariaLabel:`Get started with OpenPond`,backdropClassName:`git-dialog-backdrop`,className:`git-dialog getting-started-dialog`,onClose:i,children:[(0,_.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close get started`,title:`Close`,onClick:i,children:(0,_.jsx)(c,{size:16})}),(0,_.jsx)(`header`,{className:`getting-started-header`,children:(0,_.jsx)(`h2`,{children:`Get started with OpenPond`})}),(0,_.jsxs)(`ol`,{className:`getting-started-cards`,children:[(0,_.jsxs)(`li`,{className:`getting-started-card`,children:[(0,_.jsx)(`img`,{className:`getting-started-provider-icon`,src:r,alt:``}),(0,_.jsx)(`h3`,{children:`OpenPond account`}),(0,_.jsx)(`div`,{className:`getting-started-card-status`,role:`status`,children:w?(0,_.jsxs)(`span`,{children:[(0,_.jsx)(p,{size:16}),` Connected`]}):(0,_.jsx)(`a`,{href:b,onClick:e=>{e.preventDefault(),v(null),s(!0)},children:`Connect account`})})]}),(0,_.jsx)(y,{providerId:`codex`,connection:e,config:t.providers.providers.codex,onProviders:C}),(0,_.jsx)(y,{providerId:`claude-code`,connection:e,config:t.providers.providers[`claude-code`],onProviders:C})]})]}),o?(0,_.jsxs)(u,{ariaLabel:`Connect OpenPond account`,backdropClassName:`git-dialog-backdrop getting-started-account-backdrop`,className:`git-dialog getting-started-account-dialog`,onClose:()=>s(!1),dismissDisabled:S.saving,children:[(0,_.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close account connection`,disabled:S.saving,onClick:()=>s(!1),children:(0,_.jsx)(c,{size:16})}),(0,_.jsx)(`h2`,{children:`Connect OpenPond`}),(0,_.jsxs)(`a`,{href:b,target:`_blank`,rel:`noreferrer`,className:`getting-started-key-link`,onClick:e=>{e.preventDefault(),E()},children:[`Create an API key `,(0,_.jsx)(a,{size:12})]}),(0,_.jsxs)(`form`,{onSubmit:e=>void T(e),children:[(0,_.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,_.jsx)(`span`,{children:`OpenPond API key`}),(0,_.jsx)(`input`,{"data-autofocus":!0,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:`opk_…`,value:l,disabled:S.saving,onChange:e=>{f(e.target.value),v(null)}})]}),m?(0,_.jsx)(d,{error:m}):null,(0,_.jsx)(`button`,{className:`git-dialog-primary`,type:`submit`,disabled:S.saving||!l.trim(),children:S.saving?`Connecting…`:`Connect account`})]})]}):null]})}export{x as GettingStartedDialog};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n,s as r}from"./index-CDtTBysF.js";import{n as i}from"./api-client-DJRVOFzS.js";import"./icons-CYvTltSH.js";import{t as a}from"./external-link-Cv7TDVPT.js";import{t as o}from"./loader-circle-AjP2mDJA.js";import{t as s}from"./plus-DFjCZeRE.js";import{t as c}from"./x-EG07vYCF.js";import{t as l}from"./NativeSetupTerminal-bJpDkKk1.js";import{t as u}from"./AppDialog-DdGt7aU1.js";import{Gt as d,Tn as f,gn as p,t as m}from"./App-CV1p0_Zy.js";/* empty css */import{t as h}from"./useAccountSettings-BnxwetkP.js";var g=e(t(),1),_=n(),v={codex:{name:`Codex`,installUrl:`https://developers.openai.com/codex/cli`},"claude-code":{name:`Claude`,installUrl:`https://code.claude.com/docs/en/setup`}};function y({providerId:e,connection:t,config:n,onProviders:r}){let c=v[e],u=m(),d=(0,g.useRef)(u.active);d.current=u.active;let[h,y]=(0,g.useState)(null),[b,x]=(0,g.useState)(!0),[S,C]=(0,g.useState)(null),[w,T]=(0,g.useState)(null),E=(0,g.useRef)(null),D=(0,g.useRef)(!1),O=(0,g.useRef)(r);O.current=r,(0,g.useEffect)(()=>(D.current=!0,()=>{D.current=!1}),[]);let k=(0,g.useCallback)(async()=>{E.current?.abort();let n=new AbortController;E.current=n;let r=setTimeout(()=>n.abort(Error(`Connection check timed out. Try again.`)),45e3);x(!0),C(null),y(null);try{let r=await i(t,`/v1/providers/${e}/native-setup`,{method:`POST`,body:JSON.stringify({action:`check`}),signal:n.signal});if(E.current!==n||n.signal.aborted)return;y(r),C(r.error),O.current(r.settings)}catch(e){E.current===n&&C(e instanceof Error?e.message:String(e))}finally{clearTimeout(r),E.current===n&&(E.current=null,x(!1))}},[t.serverUrl,t.token,e]);(0,g.useEffect)(()=>{!w&&!(e===`claude-code`&&d.current)&&k();function t(){!E.current&&!w&&!(e===`claude-code`&&d.current)&&k()}return window.addEventListener(`focus`,t),()=>{window.removeEventListener(`focus`,t);let e=E.current;E.current=null,e?.abort()}},[k,n?.binaryPath,n?.sourceHome,w,e]);async function A(){if(!b){x(!0),C(null);try{let n=await f.saveProviderSettings(t,{providers:{[e]:{enabled:!0}}});if(!D.current)return;O.current(n),await k()}catch(e){C(e instanceof Error?e.message:String(e)),x(!1)}}}async function j(){if(b)return;let r=new AbortController;E.current=r;let a=setTimeout(()=>r.abort(),1e4);x(!0),C(null);try{let a=await i(t,`/v1/providers/${e}/native-setup`,{method:`POST`,body:JSON.stringify({action:`login`}),signal:r.signal});if(E.current!==r||r.signal.aborted)return;if(!n?.enabled){let n=await f.saveProviderSettings(t,{providers:{[e]:{enabled:!0}}});if(E.current!==r||r.signal.aborted)return;O.current(n)}E.current===r&&!r.signal.aborted&&(e===`claude-code`?u.start(a):T(a))}catch(e){E.current===r&&C(e instanceof Error?e.message:String(e))}finally{clearTimeout(a),E.current===r&&(E.current=null,x(!1))}}(0,g.useEffect)(()=>{if(e!==`claude-code`||!u.result)return;let t=u.result.settings.providers[e];(t?.binaryPath||null)===(n?.binaryPath||null)&&(t?.sourceHome||null)===(n?.sourceHome||null)&&(x(!1),y(u.result),C(u.result.status===`unavailable`?u.result.error:null))},[u.result,e,n?.binaryPath,n?.sourceHome]);let M=!S&&h?.status===`ready`;return(0,_.jsxs)(`li`,{className:`getting-started-card`,children:[(0,_.jsx)(`img`,{className:`getting-started-provider-icon`,src:`/agent-sources/${e}.svg`,alt:``}),(0,_.jsx)(`h3`,{children:c.name}),(0,_.jsx)(`div`,{className:`getting-started-card-status`,role:`status`,"aria-live":`polite`,children:e===`claude-code`&&u.active?(0,_.jsx)(`button`,{type:`button`,onClick:u.resume,children:`Continue sign-in`}):b?(0,_.jsx)(o,{className:`settings-spin`,size:20,"aria-label":`Checking ${c.name}`}):M&&n?.enabled?(0,_.jsxs)(`span`,{children:[(0,_.jsx)(p,{size:16}),` Connected`]}):M?(0,_.jsxs)(`button`,{type:`button`,"aria-label":`Connect ${c.name}`,onClick:()=>void A(),children:[(0,_.jsx)(s,{size:14}),` Connect`]}):h?.status===`missing`?(0,_.jsxs)(`a`,{href:c.installUrl,target:`_blank`,rel:`noreferrer`,children:[`Install `,c.name,` `,(0,_.jsx)(a,{size:12})]}):h?.status===`needs_login`?(0,_.jsx)(`button`,{type:`button`,className:`getting-started-login`,"aria-label":`Log in to ${c.name}`,title:S??void 0,onClick:()=>void j(),children:`Log in`}):(0,_.jsx)(`button`,{type:`button`,"aria-label":`Retry ${c.name} connection`,title:S??`Check connection again`,onClick:()=>void k(),children:`Retry`})}),w?(0,_.jsx)(l,{modal:!0,connection:t,command:w.command,displayCommand:w.displayCommand,onComplete:()=>T(null),onClose:()=>T(null)}):null]})}var b=`https://www.openpond.ai/api-keys`;function x({connection:e,payload:t,onPayload:n,onClose:i}){let[o,s]=(0,g.useState)(!1),[l,f]=(0,g.useState)(``),[m,v]=(0,g.useState)(null),x=(0,g.useRef)(t);x.current=t;let S=h({connection:e,onPayload:n,onError:v});function C(e){n({...x.current,providers:e})}let w=t.account.state===`signed_in`;async function T(e){if(e.preventDefault(),l.trim()&&!S.saving)try{await S.saveAccount({apiKey:l,baseUrl:`https://www.openpond.ai`,apiBaseUrl:`https://api.openpond.ai`,environment:`production`}),f(``),s(!1)}catch{}}async function E(){v(null);try{let e=window.openpond?.browser;if(e?.openExternal){let t=await e.openExternal({conversationId:`openpond-get-started`,url:b});if(!t.ok)throw Error(t.error??`Could not open API keys in your browser.`)}else window.open(b,`_blank`,`noopener,noreferrer`)}catch(e){v(e instanceof Error?e.message:String(e))}}return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(u,{inertExclusionSelector:`.native-login-session`,ariaLabel:`Get started with OpenPond`,backdropClassName:`git-dialog-backdrop`,className:`git-dialog getting-started-dialog`,onClose:i,children:[(0,_.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close get started`,title:`Close`,onClick:i,children:(0,_.jsx)(c,{size:16})}),(0,_.jsx)(`header`,{className:`getting-started-header`,children:(0,_.jsx)(`h2`,{children:`Get started with OpenPond`})}),(0,_.jsxs)(`ol`,{className:`getting-started-cards`,children:[(0,_.jsxs)(`li`,{className:`getting-started-card`,children:[(0,_.jsx)(`img`,{className:`getting-started-provider-icon`,src:r,alt:``}),(0,_.jsx)(`h3`,{children:`OpenPond account`}),(0,_.jsx)(`div`,{className:`getting-started-card-status`,role:`status`,children:w?(0,_.jsxs)(`span`,{children:[(0,_.jsx)(p,{size:16}),` Connected`]}):(0,_.jsx)(`a`,{href:b,onClick:e=>{e.preventDefault(),v(null),s(!0)},children:`Connect account`})})]}),(0,_.jsx)(y,{providerId:`codex`,connection:e,config:t.providers.providers.codex,onProviders:C}),(0,_.jsx)(y,{providerId:`claude-code`,connection:e,config:t.providers.providers[`claude-code`],onProviders:C})]})]}),o?(0,_.jsxs)(u,{ariaLabel:`Connect OpenPond account`,backdropClassName:`git-dialog-backdrop getting-started-account-backdrop`,className:`git-dialog getting-started-account-dialog`,onClose:()=>s(!1),dismissDisabled:S.saving,children:[(0,_.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close account connection`,disabled:S.saving,onClick:()=>s(!1),children:(0,_.jsx)(c,{size:16})}),(0,_.jsx)(`h2`,{children:`Connect OpenPond`}),(0,_.jsxs)(`a`,{href:b,target:`_blank`,rel:`noreferrer`,className:`getting-started-key-link`,onClick:e=>{e.preventDefault(),E()},children:[`Create an API key `,(0,_.jsx)(a,{size:12})]}),(0,_.jsxs)(`form`,{onSubmit:e=>void T(e),children:[(0,_.jsxs)(`label`,{className:`git-dialog-field`,children:[(0,_.jsx)(`span`,{children:`OpenPond API key`}),(0,_.jsx)(`input`,{"data-autofocus":!0,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:`opk_…`,value:l,disabled:S.saving,onChange:e=>{f(e.target.value),v(null)}})]}),m?(0,_.jsx)(d,{error:m}):null,(0,_.jsx)(`button`,{className:`git-dialog-primary`,type:`submit`,disabled:S.saving||!l.trim(),children:S.saving?`Connecting…`:`Connect account`})]})]}):null]})}export{x as GettingStartedDialog};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-M_h2Ok4V.js";import{n as r}from"./LearningBatchesPage-A2dFQW2j.js";import{It as i}from"./App-L7RV4D0A.js";var a=e(t(),1),o=n();function s({api:e,policyId:t,sourceId:n,onBack:s}){let c=(0,a.useMemo)(()=>e.reviewClient(t,n),[e,t,n]),[l,u]=(0,a.useState)(null),[d,f]=(0,a.useState)(null);return(0,o.jsxs)(`section`,{"aria-label":`Hosted example review`,children:[(0,o.jsx)(`button`,{type:`button`,className:`training-button secondary`,onClick:()=>{i(s)},children:`Back to continual learning`}),(0,o.jsx)(`p`,{children:`Reviewing hosted examples. Approved tasks become eligible for this policy's next training check.`}),(0,o.jsx)(r,{client:c,selectedId:l,after:d,sourceId:n,onSelect:e=>{i(()=>u(e))},onPage:f})]})}export{s as HostedModelLearningReview};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CDtTBysF.js";import{n as r}from"./LearningBatchesPage-Cm-btgWc.js";import{It as i}from"./App-CV1p0_Zy.js";var a=e(t(),1),o=n();function s({api:e,policyId:t,sourceId:n,onBack:s}){let c=(0,a.useMemo)(()=>e.reviewClient(t,n),[e,t,n]),[l,u]=(0,a.useState)(null),[d,f]=(0,a.useState)(null);return(0,o.jsxs)(`section`,{"aria-label":`Hosted example review`,children:[(0,o.jsx)(`button`,{type:`button`,className:`training-button secondary`,onClick:()=>{i(s)},children:`Back to continual learning`}),(0,o.jsx)(`p`,{children:`Reviewing hosted examples. Approved tasks become eligible for this policy's next training check.`}),(0,o.jsx)(r,{client:c,selectedId:l,after:d,sourceId:n,onSelect:e=>{i(()=>u(e))},onPage:f})]})}export{s as HostedModelLearningReview};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-M_h2Ok4V.js";import{M as r,N as i}from"./chunk-H3JZ3P5T-DolwEJXo.js";import{T as a,f as o,m as s,w as c}from"./LearningBatchesPage-A2dFQW2j.js";import{t as l}from"./api-client-DJRVOFzS.js";import{t as u}from"./AppDialog-B2V84J7f.js";import{Ut as d}from"./App-L7RV4D0A.js";import{W as f}from"./MainPane-DiWIAxMj.js";var p=e(t(),1),m=n();function h({client:e,project:t,policy:n,onClose:h}){let[g]=(0,p.useState)(()=>n?.id??`policy-${crypto.randomUUID()}`),[_]=(0,p.useState)(()=>a(t,n)),[v,y]=(0,p.useState)(_.enabled),[b,x]=(0,p.useState)(n?.trigger.kind??`nightly`),[S,C]=(0,p.useState)(n?.trigger.kind===`nightly`?n.trigger.localTime:`20:00`),[w,T]=(0,p.useState)(n?.trigger.kind===`nightly`?n.trigger.timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone),[E]=(0,p.useState)(()=>[...new Set([w,`UTC`,...Intl.supportedValuesOf(`timeZone`)])].sort().map(e=>({value:e,label:e}))),[D,O]=(0,p.useState)(!n),[k,ee]=(0,p.useState)(_.humanReviewRequired),[A,j]=(0,p.useState)(n?.sources??[]),[M,N]=(0,p.useState)(n?.taskDefinition??null),[P,F]=(0,p.useState)({interval:String(_.intervalSeconds/60),minimum:String(_.minimumApprovedExamples),batch:String(_.maxBatchExamples),spend:String(_.maxIterationSpendUsd),daily:String(_.maxDailySpendUsd),cooldown:String(_.cooldownSeconds/60),retries:String(_.maxRetries),backlog:String(_.maxBacklogExamples)}),[I,L]=(0,p.useState)(!1),[R,z]=(0,p.useState)(!1),[B,V]=(0,p.useState)(null),[H,U]=(0,p.useState)(),[W,G]=(0,p.useState)(null),[K,q]=(0,p.useState)(null),J=(0,p.useRef)(null),Y=(0,p.useRef)(!1);(0,p.useEffect)(()=>{let t=!1;return e.sources(H).then(e=>{t||(G({after:H,data:e}),q(null))},e=>{t||q(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e,H]);let X=W&&W.after===H?W.data:null,Z=D?t.trainingSetup.rewardBindingRef:n?.rewardBinding;function te(e){let t=A.some(t=>t.id===e.id);j(t?A.filter(t=>t.id!==e.id):[...A,r(e)]),N(t&&A.length===1?null:M??e.taskDefinition),L(!0)}async function Q(){if(Y.current)return!1;Y.current=!0,z(!0),V(null);try{if(!J.current){if(!M||!A.length||!Z)throw Error(`Select task sources and a Model Reward before saving.`);let e=c({project:t,previous:n,policyId:g,applyModelConfiguration:D,sources:A,taskDefinition:M,settings:{enabled:v,scheduled:b!==`manual`,humanReviewRequired:k,intervalSeconds:Number(P.interval)*60,trigger:b===`nightly`?{kind:`nightly`,localTime:S,timeZone:w}:b===`schedule`?{kind:`schedule`,intervalSeconds:Number(P.interval)*60}:b===`approved_count`?{kind:`approved_count`}:b===`manual`?{kind:`manual`}:void 0,minimumApprovedExamples:Number(P.minimum),maxBatchExamples:Number(P.batch),maxIterationSpendUsd:Number(P.spend),maxDailySpendUsd:Number(P.daily),cooldownSeconds:Number(P.cooldown)*60,maxRetries:Number(P.retries),maxBacklogExamples:Number(P.backlog)}});b===`upstream_accepted`&&n?.trigger.kind===`upstream_accepted`&&(e.trigger=n.trigger,e.automation.train=n.automation.train),J.current={action:`publish`,kind:`policy`,operationId:crypto.randomUUID(),expectedRevision:n?.revision??0,content:e}}return await e.command(J.current),J.current=null,L(!1),!0}catch(e){return e instanceof l&&e.status>=400&&e.status<500&&![408,429].includes(e.status)&&(J.current=null),V(e instanceof Error?e.message:`Unable to save learning settings.`),!1}finally{Y.current=!1,z(!1)}}let $=f({name:`learning settings`,dirty:I,busy:R,save:Q});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(u,{ariaLabel:`Continual learning settings`,className:`labs-rename-dialog learning-workspace hosted-learning-settings`,backdropClassName:`labs-rename-backdrop`,dismissDisabled:R,onClose:()=>{$.requestLeave(h)},children:[(0,m.jsx)(`h2`,{children:`Continual learning settings`}),(0,m.jsxs)(`p`,{children:[`Train `,t.name,` from admitted, unused evidence. Saving settings does not start an extra run.`]}),(0,m.jsx)(o,{error:B??K}),(0,m.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),await Q()&&($.allowNextNavigation(),h())},children:[(0,m.jsxs)(`fieldset`,{disabled:R||!!J.current,onChange:()=>L(!0),children:[(0,m.jsxs)(`label`,{children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:v,onChange:e=>y(e.target.checked)}),` `,`Enable learning`]}),(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Example review and admission`}),(0,m.jsx)(d,{label:`Example admission`,value:k?`human`:`qualified_automatic`,options:[{value:`human`,label:`Human approval before training`},{value:`qualified_automatic`,label:`Qualified automatic admission`,disabled:k,description:`Requires an existing qualified policy; cannot be enabled here.`}],onChange:e=>{ee(e===`human`),L(!0)}}),(0,m.jsx)(`p`,{children:`Grader scores measure quality; human admission gives ordinary evidence permission to train. Newly authored Dataset rows must first be submitted as evidence. Qualified conversation policies handle independently verified admissions and send exceptions to Inbox.`})]}),(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Candidate decision`}),(0,m.jsx)(`p`,{children:`Owner approval follows training and independent comparison. This form does not authorize automatic acceptance or serving activation. Conversation exception and activation controls belong to that conversation policy.`})]}),n?(0,m.jsxs)(`label`,{children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.target.checked)}),` `,`Use the Model’s current training configuration`]}):null,(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Task sources`}),!X&&!K?(0,m.jsx)(`p`,{children:`Loading sources…`}):null,X?(0,m.jsx)(d,{label:`Task source`,searchable:!0,floating:!0,value:`__choose__`,triggerContent:A.length?A.map(e=>X.sources.items.find(t=>t.id===e.id)?.name??e.id).join(`, `):`Choose task sources`,options:[{value:`__choose__`,label:`Choose a task source`,disabled:!0},...X.sources.items.map(e=>{let t=X.definitions.find(t=>i(r(t),e.taskDefinition)),n=A.find(t=>t.id===e.id),a=!!(Z&&t&&i(Z,t.rewardBinding)&&(!M||i(M,e.taskDefinition)));return{value:e.id,label:`${n?`Remove`:`Add`} ${e.name}`,disabled:!n&&(!e.enabled||!a),description:n&&n.revision!==e.revision?`Using saved revision ${n.revision}; remove and add again to update.`:a?void 0:`Different task format or Reward.`}})],onChange:e=>{let t=X.sources.items.find(t=>t.id===e);t&&te(t)}}):null,A.length?(0,m.jsx)(`p`,{children:A.map(e=>X?.sources.items.find(t=>t.id===e.id)?.name??e.id).join(`, `)}):null,(0,m.jsxs)(`p`,{children:[A.length,` sources selected.`,` `,(0,m.jsx)(`button`,{type:`button`,onClick:()=>{j([]),N(null),L(!0)},children:`Clear selection`})]}),K?(0,m.jsx)(`button`,{type:`button`,className:`training-button secondary`,onClick:()=>{e.sources(H).then(e=>{G({after:H,data:e}),q(null)},e=>q(e instanceof Error?e.message:`Unable to refresh sources.`))},children:`Retry sources`}):null,(0,m.jsx)(s,{after:H,next:X?.sources.nextCursor,onPage:e=>U(e??void 0)})]}),(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Training schedule`}),(0,m.jsx)(d,{label:`Training schedule`,value:b,options:[{value:`nightly`,label:`Every night`},{value:`approved_count`,label:`When enough approved tasks are ready`},{value:`schedule`,label:`Check at an interval`},{value:`manual`,label:`Manual updates`},...n?.trigger.kind===`upstream_accepted`?[{value:`upstream_accepted`,label:`After the configured upstream Model is accepted`}]:[]],onChange:e=>{x(e),L(!0)}}),b===`nightly`?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`label`,{children:[`Local check time`,(0,m.jsx)(`input`,{type:`time`,value:S,onChange:e=>C(e.target.value)})]}),(0,m.jsxs)(`label`,{children:[`Timezone`,(0,m.jsx)(d,{label:`Learning timezone`,searchable:!0,floating:!0,value:w,options:E,onChange:e=>{T(e),L(!0)}})]}),(0,m.jsxs)(`p`,{children:[`Checks daily at `,S,` · `,w,`. Training waits for at least`,` `,P.minimum,` approved, unused examples and available budget and capacity.`]})]}):b===`approved_count`?(0,m.jsxs)(`p`,{children:[`Checks when at least `,P.minimum,` admitted, unused examples are ready.`]}):b===`manual`?(0,m.jsx)(`p`,{children:`Training starts only through an explicit Run now action.`}):null]}),Object.keys(P).filter(e=>e!==`interval`||b===`schedule`).map(e=>(0,m.jsxs)(`label`,{children:[{interval:`Check interval (minutes)`,minimum:`Minimum approved examples`,batch:`Maximum examples per batch`,spend:`Maximum spend per iteration ($)`,daily:`Maximum daily spend ($)`,cooldown:`Cooldown (minutes)`,retries:`Automatic retries`,backlog:`Maximum backlog`}[e],(0,m.jsx)(`input`,{type:`number`,value:P[e],min:`0`,step:e===`spend`||e===`daily`?`0.01`:`1`,onChange:t=>F(n=>({...n,[e]:t.target.value}))})]},e))]}),(0,m.jsxs)(`div`,{className:`model-build-actions`,children:[(0,m.jsx)(`button`,{type:`submit`,className:`training-button`,disabled:R,children:R?`Saving…`:J.current?`Retry save`:`Save settings`}),(0,m.jsx)(`button`,{type:`button`,className:`training-button secondary`,disabled:R,onClick:()=>{$.requestLeave(h)},children:`Cancel`})]})]})]}),$.dialog]})}export{h as HostedModelLearningSettings};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CDtTBysF.js";import{M as r,N as i}from"./chunk-H3JZ3P5T-DolwEJXo.js";import{T as a,f as o,m as s,w as c}from"./LearningBatchesPage-Cm-btgWc.js";import{t as l}from"./api-client-DJRVOFzS.js";import{t as u}from"./AppDialog-DdGt7aU1.js";import{Ut as d}from"./App-CV1p0_Zy.js";import{W as f}from"./MainPane-BtzUF6O_.js";var p=e(t(),1),m=n();function h({client:e,project:t,policy:n,onClose:h}){let[g]=(0,p.useState)(()=>n?.id??`policy-${crypto.randomUUID()}`),[_]=(0,p.useState)(()=>a(t,n)),[v,y]=(0,p.useState)(_.enabled),[b,x]=(0,p.useState)(n?.trigger.kind??`nightly`),[S,C]=(0,p.useState)(n?.trigger.kind===`nightly`?n.trigger.localTime:`20:00`),[w,T]=(0,p.useState)(n?.trigger.kind===`nightly`?n.trigger.timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone),[E]=(0,p.useState)(()=>[...new Set([w,`UTC`,...Intl.supportedValuesOf(`timeZone`)])].sort().map(e=>({value:e,label:e}))),[D,O]=(0,p.useState)(!n),[k,ee]=(0,p.useState)(_.humanReviewRequired),[A,j]=(0,p.useState)(n?.sources??[]),[M,N]=(0,p.useState)(n?.taskDefinition??null),[P,F]=(0,p.useState)({interval:String(_.intervalSeconds/60),minimum:String(_.minimumApprovedExamples),batch:String(_.maxBatchExamples),spend:String(_.maxIterationSpendUsd),daily:String(_.maxDailySpendUsd),cooldown:String(_.cooldownSeconds/60),retries:String(_.maxRetries),backlog:String(_.maxBacklogExamples)}),[I,L]=(0,p.useState)(!1),[R,z]=(0,p.useState)(!1),[B,V]=(0,p.useState)(null),[H,U]=(0,p.useState)(),[W,G]=(0,p.useState)(null),[K,q]=(0,p.useState)(null),J=(0,p.useRef)(null),Y=(0,p.useRef)(!1);(0,p.useEffect)(()=>{let t=!1;return e.sources(H).then(e=>{t||(G({after:H,data:e}),q(null))},e=>{t||q(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e,H]);let X=W&&W.after===H?W.data:null,Z=D?t.trainingSetup.rewardBindingRef:n?.rewardBinding;function te(e){let t=A.some(t=>t.id===e.id);j(t?A.filter(t=>t.id!==e.id):[...A,r(e)]),N(t&&A.length===1?null:M??e.taskDefinition),L(!0)}async function Q(){if(Y.current)return!1;Y.current=!0,z(!0),V(null);try{if(!J.current){if(!M||!A.length||!Z)throw Error(`Select task sources and a Model Reward before saving.`);let e=c({project:t,previous:n,policyId:g,applyModelConfiguration:D,sources:A,taskDefinition:M,settings:{enabled:v,scheduled:b!==`manual`,humanReviewRequired:k,intervalSeconds:Number(P.interval)*60,trigger:b===`nightly`?{kind:`nightly`,localTime:S,timeZone:w}:b===`schedule`?{kind:`schedule`,intervalSeconds:Number(P.interval)*60}:b===`approved_count`?{kind:`approved_count`}:b===`manual`?{kind:`manual`}:void 0,minimumApprovedExamples:Number(P.minimum),maxBatchExamples:Number(P.batch),maxIterationSpendUsd:Number(P.spend),maxDailySpendUsd:Number(P.daily),cooldownSeconds:Number(P.cooldown)*60,maxRetries:Number(P.retries),maxBacklogExamples:Number(P.backlog)}});b===`upstream_accepted`&&n?.trigger.kind===`upstream_accepted`&&(e.trigger=n.trigger,e.automation.train=n.automation.train),J.current={action:`publish`,kind:`policy`,operationId:crypto.randomUUID(),expectedRevision:n?.revision??0,content:e}}return await e.command(J.current),J.current=null,L(!1),!0}catch(e){return e instanceof l&&e.status>=400&&e.status<500&&![408,429].includes(e.status)&&(J.current=null),V(e instanceof Error?e.message:`Unable to save learning settings.`),!1}finally{Y.current=!1,z(!1)}}let $=f({name:`learning settings`,dirty:I,busy:R,save:Q});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(u,{ariaLabel:`Continual learning settings`,className:`labs-rename-dialog learning-workspace hosted-learning-settings`,backdropClassName:`labs-rename-backdrop`,dismissDisabled:R,onClose:()=>{$.requestLeave(h)},children:[(0,m.jsx)(`h2`,{children:`Continual learning settings`}),(0,m.jsxs)(`p`,{children:[`Train `,t.name,` from admitted, unused evidence. Saving settings does not start an extra run.`]}),(0,m.jsx)(o,{error:B??K}),(0,m.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),await Q()&&($.allowNextNavigation(),h())},children:[(0,m.jsxs)(`fieldset`,{disabled:R||!!J.current,onChange:()=>L(!0),children:[(0,m.jsxs)(`label`,{children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:v,onChange:e=>y(e.target.checked)}),` `,`Enable learning`]}),(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Example review and admission`}),(0,m.jsx)(d,{label:`Example admission`,value:k?`human`:`qualified_automatic`,options:[{value:`human`,label:`Human approval before training`},{value:`qualified_automatic`,label:`Qualified automatic admission`,disabled:k,description:`Requires an existing qualified policy; cannot be enabled here.`}],onChange:e=>{ee(e===`human`),L(!0)}}),(0,m.jsx)(`p`,{children:`Grader scores measure quality; human admission gives ordinary evidence permission to train. Newly authored Dataset rows must first be submitted as evidence. Qualified conversation policies handle independently verified admissions and send exceptions to Inbox.`})]}),(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Candidate decision`}),(0,m.jsx)(`p`,{children:`Owner approval follows training and independent comparison. This form does not authorize automatic acceptance or serving activation. Conversation exception and activation controls belong to that conversation policy.`})]}),n?(0,m.jsxs)(`label`,{children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.target.checked)}),` `,`Use the Model’s current training configuration`]}):null,(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Task sources`}),!X&&!K?(0,m.jsx)(`p`,{children:`Loading sources…`}):null,X?(0,m.jsx)(d,{label:`Task source`,searchable:!0,floating:!0,value:`__choose__`,triggerContent:A.length?A.map(e=>X.sources.items.find(t=>t.id===e.id)?.name??e.id).join(`, `):`Choose task sources`,options:[{value:`__choose__`,label:`Choose a task source`,disabled:!0},...X.sources.items.map(e=>{let t=X.definitions.find(t=>i(r(t),e.taskDefinition)),n=A.find(t=>t.id===e.id),a=!!(Z&&t&&i(Z,t.rewardBinding)&&(!M||i(M,e.taskDefinition)));return{value:e.id,label:`${n?`Remove`:`Add`} ${e.name}`,disabled:!n&&(!e.enabled||!a),description:n&&n.revision!==e.revision?`Using saved revision ${n.revision}; remove and add again to update.`:a?void 0:`Different task format or Reward.`}})],onChange:e=>{let t=X.sources.items.find(t=>t.id===e);t&&te(t)}}):null,A.length?(0,m.jsx)(`p`,{children:A.map(e=>X?.sources.items.find(t=>t.id===e.id)?.name??e.id).join(`, `)}):null,(0,m.jsxs)(`p`,{children:[A.length,` sources selected.`,` `,(0,m.jsx)(`button`,{type:`button`,onClick:()=>{j([]),N(null),L(!0)},children:`Clear selection`})]}),K?(0,m.jsx)(`button`,{type:`button`,className:`training-button secondary`,onClick:()=>{e.sources(H).then(e=>{G({after:H,data:e}),q(null)},e=>q(e instanceof Error?e.message:`Unable to refresh sources.`))},children:`Retry sources`}):null,(0,m.jsx)(s,{after:H,next:X?.sources.nextCursor,onPage:e=>U(e??void 0)})]}),(0,m.jsxs)(`fieldset`,{children:[(0,m.jsx)(`legend`,{children:`Training schedule`}),(0,m.jsx)(d,{label:`Training schedule`,value:b,options:[{value:`nightly`,label:`Every night`},{value:`approved_count`,label:`When enough approved tasks are ready`},{value:`schedule`,label:`Check at an interval`},{value:`manual`,label:`Manual updates`},...n?.trigger.kind===`upstream_accepted`?[{value:`upstream_accepted`,label:`After the configured upstream Model is accepted`}]:[]],onChange:e=>{x(e),L(!0)}}),b===`nightly`?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`label`,{children:[`Local check time`,(0,m.jsx)(`input`,{type:`time`,value:S,onChange:e=>C(e.target.value)})]}),(0,m.jsxs)(`label`,{children:[`Timezone`,(0,m.jsx)(d,{label:`Learning timezone`,searchable:!0,floating:!0,value:w,options:E,onChange:e=>{T(e),L(!0)}})]}),(0,m.jsxs)(`p`,{children:[`Checks daily at `,S,` · `,w,`. Training waits for at least`,` `,P.minimum,` approved, unused examples and available budget and capacity.`]})]}):b===`approved_count`?(0,m.jsxs)(`p`,{children:[`Checks when at least `,P.minimum,` admitted, unused examples are ready.`]}):b===`manual`?(0,m.jsx)(`p`,{children:`Training starts only through an explicit Run now action.`}):null]}),Object.keys(P).filter(e=>e!==`interval`||b===`schedule`).map(e=>(0,m.jsxs)(`label`,{children:[{interval:`Check interval (minutes)`,minimum:`Minimum approved examples`,batch:`Maximum examples per batch`,spend:`Maximum spend per iteration ($)`,daily:`Maximum daily spend ($)`,cooldown:`Cooldown (minutes)`,retries:`Automatic retries`,backlog:`Maximum backlog`}[e],(0,m.jsx)(`input`,{type:`number`,value:P[e],min:`0`,step:e===`spend`||e===`daily`?`0.01`:`1`,onChange:t=>F(n=>({...n,[e]:t.target.value}))})]},e))]}),(0,m.jsxs)(`div`,{className:`model-build-actions`,children:[(0,m.jsx)(`button`,{type:`submit`,className:`training-button`,disabled:R,children:R?`Saving…`:J.current?`Retry save`:`Save settings`}),(0,m.jsx)(`button`,{type:`button`,className:`training-button secondary`,disabled:R,onClick:()=>{$.requestLeave(h)},children:`Cancel`})]})]})]}),$.dialog]})}export{h as HostedModelLearningSettings};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-M_h2Ok4V.js";import{m as r,p as i,r as a,v as o}from"./schemas-Brv9Vmnk.js";import{i as s,n as c}from"./api-client-DJRVOFzS.js";import"./icons-OQhKVrDc.js";import{t as l}from"./maximize-2-BwFXSX6b.js";import{F as u,Gt as d,M as f,N as p,Wt as m,dn as h,j as g}from"./App-L7RV4D0A.js";import{Ft as _,Pt as v}from"./MainPane-DiWIAxMj.js";var y=e(t(),1);a([`page`,`node`]);var b=r({x:i().finite().nonnegative(),y:i().finite().nonnegative(),width:i().finite().positive().max(16e3),height:i().finite().positive().max(16e3)}).refine(e=>e.width*e.height<=4e7,`The snapshot is too large.`),x=r({rect:b,selector:o().max(500),html:o().max(6291456).optional(),source:o().max(64e3).optional()});function S(e,t){let n=!1,r=null,i=null;function a(e){return`${e.tagName.toLowerCase()}${e.id?`#${e.id}`:``}${[...e.classList].slice(0,3).map(e=>`.${e}`).join(``)}`.slice(0,500)}function o(e,t,n){let r=e instanceof SVGElement&&e.tagName.toLowerCase()!==`svg`?e.ownerSVGElement:null;for(;r?.ownerSVGElement;)r=r.ownerSVGElement;let i=r??e,a=i.cloneNode(!0),o=[i,...i.querySelectorAll(`*`)],s=[a,...a.querySelectorAll(`*`)];for(let e=0;e<o.length;e++){let t=o[e],n=s[e];if([`SCRIPT`,`IFRAME`,`OBJECT`,`EMBED`,`LINK`,`META`].includes(n.tagName)){n.remove();continue}let r=[...n.attributes];for(let e of r)/^on/i.test(e.name)&&n.removeAttribute(e.name);if(n instanceof HTMLElement||n instanceof SVGElement){let e=getComputedStyle(t);n.style.cssText=[...e].map(t=>`${t}:${e.getPropertyValue(t).replace(/url\((["']?)(.*?)\1\)/g,(e,t,n)=>{let r=n.indexOf(`#`);return r>0&&[document.baseURI.split(`#`)[0],document.URL.split(`#`)[0]].includes(n.slice(0,r))?`url("#${n.slice(r+1)}")`:e})};`).join(``),n.style.setProperty(`animation`,`none`),n.style.setProperty(`transition`,`none`)}if(t instanceof HTMLInputElement&&(n.setAttribute(`value`,t.value),t.checked?n.setAttribute(`checked`,``):n.removeAttribute(`checked`)),t instanceof HTMLTextAreaElement&&(n.textContent=t.value),t instanceof HTMLOptionElement&&(t.selected?n.setAttribute(`selected`,``):n.removeAttribute(`selected`)),t instanceof HTMLCanvasElement){let e=document.createElement(`img`);e.src=t.toDataURL(`image/png`),e.style.cssText=n.style.cssText,t===i?a=e:n.replaceWith(e)}if(t.shadowRoot)throw Error(`This element has a shadow root. Capture it from a native browser tab.`)}a.style.setProperty(`margin`,`0`),a.style.setProperty(`position`,`relative`),a.style.setProperty(`inset`,`auto`),a.style.setProperty(`width`,`${t}px`),a.style.setProperty(`max-width`,`none`);let c=document.createElement(`div`);c.style.width=`${t}px`,c.style.height=`${n}px`;for(let t=e;t;t=t.parentElement){let e=getComputedStyle(t).backgroundColor;if(e&&e!==`rgba(0, 0, 0, 0)`&&e!==`transparent`){c.style.backgroundColor=e;break}}if(r){let n=r.getBoundingClientRect(),i=e.getBoundingClientRect();Object.assign(c.style,{position:`relative`,overflow:`hidden`,width:`${t}px`,height:`${Math.ceil(i.height)}px`}),Object.assign(a.style,{position:`absolute`,left:`${n.left-i.left}px`,top:`${n.top-i.top}px`,width:`${n.width}px`,height:`${n.height}px`})}return c.append(a),c.outerHTML}function s(n,r){try{let i=n.getBoundingClientRect(),s=r?Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth):Math.ceil(i.width),c=r?Math.max(document.documentElement.scrollHeight,document.body.scrollHeight):Math.ceil(i.height);if(!s||!c)throw Error(`The selected element has no visible area.`);e({capture:{rect:{x:r?0:Math.max(0,i.left+scrollX),y:r?0:Math.max(0,i.top+scrollY),width:s,height:c},selector:r?`Full page`:a(n),source:n.outerHTML.slice(0,64e3),...t?{html:o(n,s,c)}:{}}})}catch(t){e({error:t instanceof Error?t.message:String(t)})}}function c(){n=!1,r=null,i?.remove(),i=null,document.removeEventListener(`pointermove`,l,!0),document.removeEventListener(`click`,u,!0),document.removeEventListener(`keydown`,f,!0),window.removeEventListener(`click`,u,!0);for(let e of[`pointerdown`,`pointerup`,`mousedown`,`mouseup`])window.removeEventListener(e,d,!0)}function l(e){if(!n||(r=e.composedPath().find(e=>e instanceof Element&&e!==i)??null,!r||!i))return;let t=r.getBoundingClientRect();Object.assign(i.style,{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}),i.textContent=`${a(r)} · ${Math.ceil(t.width)} × ${Math.ceil(t.height)}`}function u(e){if(!n||!e.isTrusted)return;e.preventDefault(),e.stopImmediatePropagation();let t=e.composedPath().find(e=>e instanceof Element&&e!==i);c(),t&&s(t,!1)}function d(e){n&&(e.preventDefault(),e.stopImmediatePropagation())}function f(t){t.key===`Escape`&&t.isTrusted&&(t.preventDefault(),t.stopImmediatePropagation(),c(),e({canceled:!0}))}return{page(){c(),s(document.body,!0)},start(){c(),n=!0,i=document.createElement(`div`),i.setAttribute(`data-openpond-snapshot-overlay`,``),i.style.cssText=`position:fixed;pointer-events:none;z-index:2147483647;box-sizing:border-box;border:2px solid var(--blue,Highlight);background:transparent;color:var(--text,CanvasText);font:12px/1.3 monospace;text-shadow:0 0 3px var(--bg,Canvas);overflow:visible;`,document.documentElement.append(i),document.addEventListener(`pointermove`,l,!0),window.addEventListener(`click`,u,!0);for(let e of[`pointerdown`,`pointerup`,`mousedown`,`mouseup`])window.addEventListener(e,d,!0);document.addEventListener(`keydown`,f,!0)},cancel(){c(),e({canceled:!0})},dispose:c}}function C(){return`(${S.toString()})`}var w=`default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'; child-src 'none'; worker-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'`,T=e=>JSON.stringify(e).replace(/</g,`\\u003c`).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`),E=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);function ee(e,t,n=f){let r=`(() => {
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CDtTBysF.js";import{m as r,p as i,r as a,v as o}from"./schemas-Brv9Vmnk.js";import{i as s,n as c}from"./api-client-DJRVOFzS.js";import"./icons-CYvTltSH.js";import{t as l}from"./maximize-2-CvvoALtI.js";import{F as u,Gt as d,M as f,N as p,Wt as m,dn as h,j as g}from"./App-CV1p0_Zy.js";import{Ft as _,Pt as v}from"./MainPane-BtzUF6O_.js";var y=e(t(),1);a([`page`,`node`]);var b=r({x:i().finite().nonnegative(),y:i().finite().nonnegative(),width:i().finite().positive().max(16e3),height:i().finite().positive().max(16e3)}).refine(e=>e.width*e.height<=4e7,`The snapshot is too large.`),x=r({rect:b,selector:o().max(500),html:o().max(6291456).optional(),source:o().max(64e3).optional()});function S(e,t){let n=!1,r=null,i=null;function a(e){return`${e.tagName.toLowerCase()}${e.id?`#${e.id}`:``}${[...e.classList].slice(0,3).map(e=>`.${e}`).join(``)}`.slice(0,500)}function o(e,t,n){let r=e instanceof SVGElement&&e.tagName.toLowerCase()!==`svg`?e.ownerSVGElement:null;for(;r?.ownerSVGElement;)r=r.ownerSVGElement;let i=r??e,a=i.cloneNode(!0),o=[i,...i.querySelectorAll(`*`)],s=[a,...a.querySelectorAll(`*`)];for(let e=0;e<o.length;e++){let t=o[e],n=s[e];if([`SCRIPT`,`IFRAME`,`OBJECT`,`EMBED`,`LINK`,`META`].includes(n.tagName)){n.remove();continue}let r=[...n.attributes];for(let e of r)/^on/i.test(e.name)&&n.removeAttribute(e.name);if(n instanceof HTMLElement||n instanceof SVGElement){let e=getComputedStyle(t);n.style.cssText=[...e].map(t=>`${t}:${e.getPropertyValue(t).replace(/url\((["']?)(.*?)\1\)/g,(e,t,n)=>{let r=n.indexOf(`#`);return r>0&&[document.baseURI.split(`#`)[0],document.URL.split(`#`)[0]].includes(n.slice(0,r))?`url("#${n.slice(r+1)}")`:e})};`).join(``),n.style.setProperty(`animation`,`none`),n.style.setProperty(`transition`,`none`)}if(t instanceof HTMLInputElement&&(n.setAttribute(`value`,t.value),t.checked?n.setAttribute(`checked`,``):n.removeAttribute(`checked`)),t instanceof HTMLTextAreaElement&&(n.textContent=t.value),t instanceof HTMLOptionElement&&(t.selected?n.setAttribute(`selected`,``):n.removeAttribute(`selected`)),t instanceof HTMLCanvasElement){let e=document.createElement(`img`);e.src=t.toDataURL(`image/png`),e.style.cssText=n.style.cssText,t===i?a=e:n.replaceWith(e)}if(t.shadowRoot)throw Error(`This element has a shadow root. Capture it from a native browser tab.`)}a.style.setProperty(`margin`,`0`),a.style.setProperty(`position`,`relative`),a.style.setProperty(`inset`,`auto`),a.style.setProperty(`width`,`${t}px`),a.style.setProperty(`max-width`,`none`);let c=document.createElement(`div`);c.style.width=`${t}px`,c.style.height=`${n}px`;for(let t=e;t;t=t.parentElement){let e=getComputedStyle(t).backgroundColor;if(e&&e!==`rgba(0, 0, 0, 0)`&&e!==`transparent`){c.style.backgroundColor=e;break}}if(r){let n=r.getBoundingClientRect(),i=e.getBoundingClientRect();Object.assign(c.style,{position:`relative`,overflow:`hidden`,width:`${t}px`,height:`${Math.ceil(i.height)}px`}),Object.assign(a.style,{position:`absolute`,left:`${n.left-i.left}px`,top:`${n.top-i.top}px`,width:`${n.width}px`,height:`${n.height}px`})}return c.append(a),c.outerHTML}function s(n,r){try{let i=n.getBoundingClientRect(),s=r?Math.max(document.documentElement.clientWidth,document.documentElement.scrollWidth):Math.ceil(i.width),c=r?Math.max(document.documentElement.scrollHeight,document.body.scrollHeight):Math.ceil(i.height);if(!s||!c)throw Error(`The selected element has no visible area.`);e({capture:{rect:{x:r?0:Math.max(0,i.left+scrollX),y:r?0:Math.max(0,i.top+scrollY),width:s,height:c},selector:r?`Full page`:a(n),source:n.outerHTML.slice(0,64e3),...t?{html:o(n,s,c)}:{}}})}catch(t){e({error:t instanceof Error?t.message:String(t)})}}function c(){n=!1,r=null,i?.remove(),i=null,document.removeEventListener(`pointermove`,l,!0),document.removeEventListener(`click`,u,!0),document.removeEventListener(`keydown`,f,!0),window.removeEventListener(`click`,u,!0);for(let e of[`pointerdown`,`pointerup`,`mousedown`,`mouseup`])window.removeEventListener(e,d,!0)}function l(e){if(!n||(r=e.composedPath().find(e=>e instanceof Element&&e!==i)??null,!r||!i))return;let t=r.getBoundingClientRect();Object.assign(i.style,{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}),i.textContent=`${a(r)} · ${Math.ceil(t.width)} × ${Math.ceil(t.height)}`}function u(e){if(!n||!e.isTrusted)return;e.preventDefault(),e.stopImmediatePropagation();let t=e.composedPath().find(e=>e instanceof Element&&e!==i);c(),t&&s(t,!1)}function d(e){n&&(e.preventDefault(),e.stopImmediatePropagation())}function f(t){t.key===`Escape`&&t.isTrusted&&(t.preventDefault(),t.stopImmediatePropagation(),c(),e({canceled:!0}))}return{page(){c(),s(document.body,!0)},start(){c(),n=!0,i=document.createElement(`div`),i.setAttribute(`data-openpond-snapshot-overlay`,``),i.style.cssText=`position:fixed;pointer-events:none;z-index:2147483647;box-sizing:border-box;border:2px solid var(--blue,Highlight);background:transparent;color:var(--text,CanvasText);font:12px/1.3 monospace;text-shadow:0 0 3px var(--bg,Canvas);overflow:visible;`,document.documentElement.append(i),document.addEventListener(`pointermove`,l,!0),window.addEventListener(`click`,u,!0);for(let e of[`pointerdown`,`pointerup`,`mousedown`,`mouseup`])window.addEventListener(e,d,!0);document.addEventListener(`keydown`,f,!0)},cancel(){c(),e({canceled:!0})},dispose:c}}function C(){return`(${S.toString()})`}var w=`default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; frame-src 'none'; child-src 'none'; worker-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'`,T=e=>JSON.stringify(e).replace(/</g,`\\u003c`).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`),E=e=>e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`);function ee(e,t,n=f){let r=`(() => {
2
2
  const style = document.getElementById('openpond-theme');
3
3
  const keys = ${T(Object.keys(f))};
4
4
  function theme(values) { if (!values || typeof values !== 'object') return;
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-M_h2Ok4V.js";import{t as r}from"./useQuery-DuTGOe2b.js";import{C as i,O as a,_ as o,a as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,o as g,p as _,r as v,s as y,v as b,w as ee}from"./LabModelWorkspace-CHlhzG3q.js";import{t as x}from"./query-scope-BRpcgljO.js";import"./icons-OQhKVrDc.js";import{c as S,l as te,n as C,o as w,r as T,t as ne}from"./training-model-data-G-D64935.js";import{t as E}from"./chevron-down-BAEcJitl.js";import{t as D}from"./chevron-right-3G9s2cQ9.js";import{t as re}from"./loader-circle-DXVtGvuV.js";import{Fn as O,Gt as k,Tn as A,gn as j,rn as ie}from"./App-L7RV4D0A.js";import{t as ae}from"./ModelProjectPageHeader-lu6iRXHK.js";import{lt as oe}from"./MainPane-DiWIAxMj.js";import{t as se}from"./LabsRoute-DzEbPpMK.js";function ce(e){if(!e)return[];let t=e.recipe;return t.method===`grpo`?[{label:`LoRA rank`,value:String(t.lora.rank)},{label:`Learning rate`,value:M(t.optimizer.learningRate)},{label:`Optimizer steps`,value:String(t.optimizer.maxSteps)},{label:`Rollouts per update`,value:String(t.rollout.groupSize)},{label:`Rollout concurrency`,value:String(t.rollout.concurrency)},{label:`Max output tokens`,value:t.rollout.maxOutputTokens.toLocaleString()},{label:`Temperature`,value:String(t.rollout.temperature)},{label:`Top P`,value:String(t.rollout.topP)}]:t.method===`sft`||t.method===`dpo`?[{label:`LoRA rank`,value:String(t.lora.rank)},{label:`Learning rate`,value:M(t.optimizer.learningRate)},{label:`Optimizer steps`,value:String(t.optimizer.maxSteps)}]:[]}function le(e,t){if(!e||!t)return[];if(t.parent.kind===`base_model`)return[{label:`Starting checkpoint`,value:`Frozen base · ${t.parent.revision}`},{label:`Optimizer`,value:`Fresh`}];let n=e.modelVersions.find(e=>e.id===t.parent.id);return[{label:`Starting checkpoint`,value:[e.comparisonSeriesEntries.find(e=>e.seriesId===t.seriesId&&e.modelVersionId===t.parent.id)?.label??null,n?`Version ${n.version}`:t.parent.id].filter(e=>!!e).join(` · `)},{label:`Optimizer`,value:`Fresh`}]}function ue(e,t){if(!e||!t||t.parent.kind===`base_model`)return`Frozen base`;let n=e.comparisonSeriesEntries.find(e=>e.seriesId===t.seriesId&&e.modelVersionId===t.parent.id),r=e.modelVersions.find(e=>e.id===t.parent.id);return[n?.label??`Prior checkpoint`,r?`Version ${r.version}`:null].filter(e=>!!e).join(` · `)}function M(e){return e===0?`0`:e.toExponential(2)}var N=e(t(),1),P=n();function de({events:e}){let t=e.filter(e=>e.type===`metric`&&e.payload.metricKind===`rollout_trajectory`);return t.length?(0,P.jsx)(`div`,{className:`training-rollout-receipts`,children:t.map((e,t)=>{let n=e.payload.rewardEligible===!0,r=I(e.payload.reward),i=typeof e.payload.failureClass==`string`?e.payload.failureClass:null,a=typeof e.payload.failureCode==`string`?e.payload.failureCode:null;return(0,P.jsxs)(`details`,{children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsxs)(`span`,{children:[`Attempt `,t+1]}),(0,P.jsx)(`strong`,{children:n?`eligible`:`ineligible`}),(0,P.jsx)(`em`,{children:n&&r!=null?r.toFixed(3):a??i??`not reward eligible`})]}),(0,P.jsxs)(`dl`,{className:`training-configuration-list`,children:[(0,P.jsx)(F,{label:`Rollout`,value:L(e.payload.rolloutId)}),(0,P.jsx)(F,{label:`Group`,value:L(e.payload.rolloutGroupId)}),(0,P.jsx)(F,{label:`Policy`,value:`v${I(e.payload.policyVersion)??0}`}),(0,P.jsx)(F,{label:`Worker`,value:String((I(e.payload.workerSlot)??0)+1)}),(0,P.jsx)(F,{label:`Reward`,value:r==null?`Not eligible`:String(r)}),(0,P.jsx)(F,{label:`Failure class`,value:i??`None`}),(0,P.jsx)(F,{label:`Failure code`,value:a??`None`}),(0,P.jsx)(F,{label:`Components`,value:JSON.stringify(e.payload.rewardComponents??{})}),(0,P.jsx)(F,{label:`Tokens`,value:`${I(e.payload.inputTokens)??0} input · ${I(e.payload.outputTokens)??0} output`})]})]},e.id)})}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`No managed attempts were recorded for this run.`})}function fe({receipts:e}){let[t,n]=(0,N.useState)(!1);if(!e.length)return(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`No on-policy rollout receipts were recorded for this run.`});let r=[...e].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),i=t?r:r.slice(0,24);return(0,P.jsxs)(`div`,{className:`training-rollout-receipts`,children:[e.length>24?(0,P.jsxs)(`div`,{className:`training-rollout-receipt-controls`,children:[(0,P.jsx)(`span`,{children:t?`Showing all ${e.length} receipts`:`Showing latest ${i.length} of ${e.length} receipts`}),(0,P.jsx)(`button`,{className:`training-text-button`,type:`button`,onClick:()=>n(e=>!e),children:t?`Show latest 24`:`Show all ${e.length}`})]}):null,i.map(e=>(0,P.jsxs)(`details`,{children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsx)(`span`,{children:pe(e.providerTrace.rolloutId)}),(0,P.jsx)(`strong`,{children:e.status}),(0,P.jsx)(`em`,{children:e.reward.eligible&&e.reward.raw!=null?e.reward.raw.toFixed(3):e.failureClass??`not reward eligible`})]}),(0,P.jsxs)(`dl`,{className:`training-configuration-list`,children:[(0,P.jsx)(F,{label:`Correlation`,value:e.correlationId}),(0,P.jsx)(F,{label:`Task`,value:e.taskId}),(0,P.jsx)(F,{label:`Policy`,value:e.policy.modelId}),(0,P.jsx)(F,{label:`Checkpoint`,value:e.policy.checkpointId??`Provider initial policy`}),(0,P.jsx)(F,{label:`Environment`,value:`${e.environment.id}@${e.environment.version}`}),(0,P.jsx)(F,{label:`World`,value:`${e.environment.worldId} · ${e.environment.worldHash}`}),(0,P.jsx)(F,{label:`Raw reward`,value:e.reward.raw==null?`Not eligible`:String(e.reward.raw)}),(0,P.jsx)(F,{label:`Components`,value:JSON.stringify(e.reward.components)}),(0,P.jsx)(F,{label:`Outcome`,value:e.verifier?.outcome??e.failureClass??`Pending`}),(0,P.jsx)(F,{label:`Trace`,value:`${e.providerTrace.experimentId}/${e.providerTrace.rolloutId}`})]})]},e.id))]})}function F({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function I(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function L(e){return typeof e==`string`&&e?e:`Not recorded`}function pe(e){return e.replace(/^lineage_/,``).slice(0,18)}function me({detail:e,loading:t,pending:n=!1}){if(t&&!e)return(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`Loading evaluation results…`});let r=e?.evaluation;return r?(0,P.jsxs)(`div`,{className:`training-run-evaluation`,children:[(0,P.jsxs)(`div`,{className:`training-metric-summary`,children:[(0,P.jsx)(R,{label:`Base score`,value:ge(r.base.meanScore)}),(0,P.jsx)(R,{label:`Trained score`,value:ge(r.trained.meanScore)}),(0,P.jsx)(R,{label:`Score change`,value:_e(r.meanScoreDelta)}),(0,P.jsx)(R,{label:`Trained pass rate`,value:z(r.trained.passRate)})]}),r.base.count===0?(0,P.jsx)(`p`,{className:`training-muted`,children:`Base-model scoring was not imported for this earlier run. New runs retain both base and trained evaluations.`}):null,r.trained.count>0&&r.trained.scoredCount===0?(0,P.jsx)(`p`,{className:`training-muted`,children:`Outputs were captured, but the grader was unavailable, so this run has no evaluation score.`}):null,(0,P.jsx)(`div`,{className:`training-table-wrap`,children:(0,P.jsxs)(`table`,{className:`training-data-table training-evaluation-table`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`Test example`}),(0,P.jsx)(`th`,{children:`Base`}),(0,P.jsx)(`th`,{children:`Trained`}),(0,P.jsx)(`th`,{children:`Result`})]})}),(0,P.jsx)(`tbody`,{children:r.examples.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsxs)(`details`,{children:[(0,P.jsx)(`summary`,{children:e.taskId}),(0,P.jsx)(he,{input:e.input,baseOutput:e.baseOutput,trainedOutput:e.trainedOutput,baseGrade:e.baseGrade,trainedGrade:e.trainedGrade})]})}),(0,P.jsx)(`td`,{children:ve(e.baseGrade)}),(0,P.jsx)(`td`,{children:ve(e.trainedGrade)}),(0,P.jsx)(`td`,{children:ye(e.baseGrade,e.trainedGrade)})]},e.taskId))})]})})]}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:n?`Evaluation will appear here after the first eligible checkpoint is scored.`:`No scored evaluation results are available for this run.`})}function he({input:e,baseOutput:t,trainedOutput:n,baseGrade:r,trainedGrade:i}){let a=[...new Set([...r?.feedback??[],...i?.feedback??[]])];return(0,P.jsxs)(`div`,{className:`training-evaluation-output`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Input`}),(0,P.jsx)(`pre`,{children:JSON.stringify(e,null,2)})]}),t?(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Base output`}),(0,P.jsx)(`pre`,{children:JSON.stringify(t,null,2)})]}):null,n?(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Trained output`}),(0,P.jsx)(`pre`,{children:JSON.stringify(n,null,2)})]}):null,a.length?(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Grader feedback`}),(0,P.jsx)(`p`,{children:a.join(` `)})]}):null]})}function R({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:e}),(0,P.jsx)(`strong`,{children:t})]})}function ge(e){return e==null?`Not recorded`:e.toFixed(3)}function z(e){return e==null?`Not recorded`:`${Math.round(e*100)}%`}function _e(e){return e==null?`Not comparable`:`${e>=0?`+`:``}${e.toFixed(3)}`}function ve(e){return e?.status===`unavailable`?`Unavailable`:e?.score==null?`Not scored`:e.score.toFixed(3)}function ye(e,t){if(!t)return`Not evaluated`;if(t.status===`unavailable`)return`Unavailable`;if(!e||e.score==null||t.score==null)return t.passed?`Passed`:`Failed`;let n=t.score-e.score;return Math.abs(n)<5e-4?`No change`:n>0?`Improved ${n.toFixed(3)}`:`Regressed ${Math.abs(n).toFixed(3)}`}function be({connection:e,lineageId:t,jobId:n,onSaved:r}){let i=n??t,a=n?`jobs`:`models`,[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(0),[u,d]=(0,N.useState)(!0),[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(!1),[g,_]=(0,N.useState)(null),[v,y]=(0,N.useState)(null),[b,ee]=(0,N.useState)(``),[x,S]=(0,N.useState)(null),[te,C]=(0,N.useState)([]),[w,T]=(0,N.useState)(!1);(0,N.useEffect)(()=>{if(!e){d(!1),p(!1),_(`Connect to OpenPond to review this candidate.`);return}let t=!0;return d(!0),p(!1),_(null),C([]),(async()=>{try{if(a===`models`){let n=await A.candidateReview(e,i);t&&n&&s(n)}let n=await A.candidateReview(e,i,!0,a);t&&(s(n),p(!!n))}catch(e){t&&_(xe(e))}finally{t&&d(!1)}})(),()=>{t=!1}},[e,i,a,c]);function ne(e){y(e),ee(``),S(null)}async function E(){if(!e||!o||!v||!b.trim())return;let t=x&&x.reason===b.trim()&&x.decision===v?x:{schemaVersion:`openpond.trainingCandidateDecisionRequest.v1`,...o.target,decision:v,reason:b.trim(),idempotencyKey:crypto.randomUUID(),expectedDecision:o.decision?{id:o.decision.id,contentHash:o.decision.contentHash}:null};S(t),h(!0),_(null);try{s(await A.recordCandidateReview(e,i,t,a)),y(null),S(null),C([]),await r()}catch(e){_(xe(e))}finally{h(!1)}}let D=(te.at(-1)??o?.decision)?.request.expectedDecision;async function re(){if(e&&D){T(!0),_(null);try{let t=await A.candidateReviewHistory(e,i,D,a);C(e=>[...e,t])}catch(e){_(xe(e))}finally{T(!1)}}}let O=o?.decision;return(0,P.jsxs)(`section`,{className:`training-run-evaluation`,"aria-label":`Candidate review`,children:[(0,P.jsx)(`h3`,{children:`Candidate review`}),O?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`strong`,{children:O.request.decision===`accepted`?`Accepted`:`Rejected`}),(0,P.jsx)(`p`,{children:O.request.reason}),(0,P.jsxs)(`p`,{className:`training-muted`,children:[`Review `,O.revision,` · `,new Date(O.decidedAt).toLocaleString()]})]}):(0,P.jsx)(`p`,{className:`training-muted`,children:u?`Loading candidate review…`:o?`No candidate decision recorded.`:`Candidate review unavailable.`}),o?(0,P.jsxs)(`p`,{className:`training-muted`,children:[`Last synced `,new Date(o.syncedAt).toLocaleString(),`. Acceptance keeps this candidate for later use; serving is activated separately.`]}):null,g?(0,P.jsx)(k,{error:g}):null,(0,P.jsxs)(`div`,{className:`training-dialog-actions`,children:[(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:u||m,onClick:()=>l(e=>e+1),children:`Refresh review`}),(0,P.jsx)(`button`,{className:`training-button`,type:`button`,disabled:!f||u||m||O?.request.decision===`accepted`,onClick:()=>ne(`accepted`),children:`Accept candidate`}),(0,P.jsx)(`button`,{className:`training-button danger`,type:`button`,disabled:!f||u||m||O?.request.decision===`rejected`,onClick:()=>ne(`rejected`),children:`Reject candidate`})]}),te.map(e=>(0,P.jsxs)(`details`,{className:`training-evidence`,children:[(0,P.jsxs)(`summary`,{children:[`Review `,e.revision,` · `,e.request.decision]}),(0,P.jsx)(`p`,{children:e.request.reason}),(0,P.jsx)(`p`,{children:new Date(e.decidedAt).toLocaleString()})]},e.id)),D?(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:w||m,onClick:()=>void re(),children:w?`Loading…`:`Earlier review`}):null,v?(0,P.jsx)(`div`,{className:`training-dialog-backdrop`,role:`presentation`,onMouseDown:()=>!m&&y(null),children:(0,P.jsxs)(`section`,{className:`training-dialog training-promotion-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Review candidate`,onMouseDown:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{className:`training-dialog-header`,children:(0,P.jsx)(`h2`,{children:v===`accepted`?`Accept this candidate?`:`Reject this candidate?`})}),(0,P.jsx)(`p`,{children:`The adapter and its recorded evaluation remain in the candidate’s history.`}),(0,P.jsxs)(`label`,{className:`training-promotion-reason`,children:[(0,P.jsx)(`span`,{children:`Reason`}),(0,P.jsx)(`textarea`,{autoFocus:!0,maxLength:5e3,value:b,onChange:e=>ee(e.target.value)})]}),g?(0,P.jsx)(k,{error:g}):null,(0,P.jsxs)(`div`,{className:`training-dialog-actions`,children:[(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:m,onClick:()=>y(null),children:`Cancel`}),(0,P.jsx)(`button`,{className:`training-button ${v===`rejected`?`danger`:``}`,type:`button`,disabled:m||!b.trim(),onClick:()=>void E(),children:m?`Saving…`:x?`Retry save`:`Save decision`})]})]})}):null]})}function xe(e){return e instanceof Error?e.message:`Candidate review could not be loaded.`}function Se({connection:e,jobId:t,evaluations:n}){let[r,i]=(0,N.useState)(null),a=n.filter(e=>e.reference),o=a.find(e=>e.reference?.id===r)??a.filter(e=>e.kind===`candidate`).at(-1)??a[0];return!e||!o?.reference?null:(0,P.jsxs)(`section`,{className:`training-run-evaluation`,"aria-label":`Retained evaluation answers`,children:[(0,P.jsxs)(`label`,{className:`training-taskset-selector`,children:[(0,P.jsx)(`span`,{children:`Evaluation answers`}),(0,P.jsx)(`select`,{value:o.reference.id,onChange:e=>i(e.target.value),children:a.map(e=>(0,P.jsxs)(`option`,{value:e.reference.id,children:[e.kind===`baseline`?`Baseline`:`Candidate`,` · policy `,e.policyVersion]},e.reference.id))})]}),(0,P.jsx)(B,{connection:e,jobId:t,evaluation:o.reference},`${t}:${o.reference.id}:${o.reference.contentHash}`)]})}function B({connection:e,jobId:t,evaluation:n}){let[r,i]=(0,N.useState)(),[a,o]=(0,N.useState)([]),[s,c]=(0,N.useState)(null),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(!0),[p,m]=(0,N.useState)(0),{id:h,contentHash:g}=n;return(0,N.useEffect)(()=>{let n=!0;return f(!0),u(null),c(null),A.trainingEvaluationTasks(e,t,{id:h,contentHash:g},r).then(e=>{n&&c(e)}).catch(e=>{n&&u(e instanceof Error?e.message:String(e))}).finally(()=>{n&&f(!1)}),()=>{n=!1}},[e,t,h,g,r,p]),(0,P.jsxs)(`div`,{className:`training-run-evaluation`,"aria-busy":d,children:[d?(0,P.jsx)(`p`,{className:`training-muted`,children:`Loading recorded answers…`}):null,l?(0,P.jsx)(k,{error:l,children:(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,onClick:()=>m(e=>e+1),children:`Retry answers`})}):null,s?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{className:`training-muted`,children:[`Tasks `,s.offset+1,`–`,s.offset+s.tasks.length,` of`,` `,s.total,`. Recorded outputs and scores are retained for this run.`]}),s.tasks.map((e,t)=>(0,P.jsxs)(`details`,{className:`training-evidence`,children:[(0,P.jsxs)(`summary`,{children:[`Example `,s.offset+t+1,` · score `,e.score.toFixed(3)]}),(0,P.jsxs)(`div`,{className:`training-evaluation-output`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Instruction`}),(0,P.jsx)(`pre`,{children:e.input.instruction})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Context`}),(0,P.jsx)(`pre`,{children:JSON.stringify(e.input.context,null,2)})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Recorded output`}),(0,P.jsx)(`pre`,{children:e.output})]})]})]},e.taskId))]}):null,(0,P.jsxs)(`div`,{className:`training-dialog-actions`,children:[(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:d||!a.length,onClick:()=>{i(a.at(-1)),o(e=>e.slice(0,-1))},children:`Previous tasks`}),(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:d||!s?.nextCursor,onClick:()=>{s?.nextCursor&&(o(e=>[...e,r]),i(s.nextCursor))},children:`Next tasks`})]})]})}var V=new Set([`queued`,`starting`,`running`,`cancelling`,`reconciling`]);function Ce(e,t,n,i=!1){let a=[`training-run-detail`,x(e),t,i],o=!!(e&&t),s=r({queryKey:[...a,`retained`],queryFn:({signal:n})=>A.trainingRunDetail(e,t,{includeEvaluation:i,refresh:!1,signal:n}),enabled:o,staleTime:3e4,gcTime:6e4}),c=r({queryKey:[...a,`hosted`],queryFn:({signal:n})=>A.trainingRunDetail(e,t,{includeEvaluation:i,signal:n}),enabled:o,staleTime:3e4,gcTime:6e4,refetchInterval:n&&V.has(n)?3e3:!1,refetchIntervalInBackground:!1}),l=c.data??s.data??null;return{detail:l,loading:o&&!l&&(s.isPending||c.isPending),error:c.error?.message??s.error?.message??null,refresh:async()=>(await c.refetch()).data??null}}function we({title:e,status:t,statusValue:n,versionStatus:r,method:i,baseModel:a,taskset:o,compute:s,duration:c,output:l,reward:u,telemetry:d,evidence:f,configuration:p,children:m,failure:h,onOpenTaskset:g,showHeader:_=!0}){let v=d?.cost.providerReportedUsd??d?.cost.estimatedUsd??f?.cost.totalUsd??null;return(0,P.jsxs)(`div`,{className:`labs-model-run-summary`,children:[_?(0,P.jsx)(`section`,{className:`labs-run-outcome-card`,children:(0,P.jsx)(`header`,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`labs-run-title-row`,children:[(0,P.jsx)(`h2`,{children:e}),(0,P.jsx)(b,{label:t,value:n})]}),(0,P.jsxs)(`p`,{children:[Te(i),` on `,a]})]})})}):null,m,(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:`Run setup`})}),(0,P.jsxs)(`dl`,{className:`labs-run-detail-list`,children:[(0,P.jsx)(H,{label:`Training method`,value:i}),(0,P.jsx)(H,{label:`Base model`,value:a}),(0,P.jsx)(H,{label:`Compute`,value:s}),(0,P.jsx)(H,{label:`Output`,value:l}),r?(0,P.jsx)(H,{label:`Version status`,value:r}):null,(0,P.jsx)(H,{label:`Duration`,value:c}),(0,P.jsx)(H,{label:`Run cost`,value:v===null?`Not reported`:`$${v.toFixed(4)}`}),(0,P.jsx)(H,{label:y(n)?`Latest reward`:`Final reward`,value:u===null?`Not reported`:u.toFixed(4)}),p.map(e=>(0,P.jsx)(H,{label:e.label,value:e.value},e.label)),d||f?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(U,{label:`GPU`,value:W(d,f)}),(0,P.jsx)(U,{label:`Tokens`,value:`${G(d?.usage.promptTokens??f?.usage.inputTokens??null)} prompt · ${G(d?.usage.generatedTokens??f?.usage.outputTokens??null)} generated`}),(0,P.jsx)(U,{label:`Trajectories`,value:`${G(d?.usage.successfulTrajectories??f?.reward.eligibleTrajectoryCount??null)} succeeded · ${G(d?.usage.failedTrajectories??(f?f.reward.trajectoryCount-f.reward.eligibleTrajectoryCount:null))} failed`}),(0,P.jsx)(U,{label:`Optimizer updates`,value:G(d?.usage.optimizerSteps??f?.progress.committedOptimizerSteps??null)}),(0,P.jsx)(U,{label:`GPU time`,value:d?.usage.gpuSeconds==null?`Not reported`:`${d.usage.gpuSeconds.toFixed(1)} seconds`})]}):(0,P.jsx)(H,{label:`Resource usage`,value:`Not retained for this run`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:`Taskset`}),(0,P.jsx)(`dd`,{children:g?(0,P.jsxs)(`button`,{className:`labs-run-taskset-link`,type:`button`,onClick:g,children:[(0,P.jsx)(`span`,{children:o}),(0,P.jsx)(D,{"aria-hidden":`true`,size:14})]}):o})]})]})]}),h?(0,P.jsx)(`p`,{className:`labs-training-error`,children:h}):null]})}function H({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function U({label:e,value:t}){return(0,P.jsx)(H,{label:e,value:t})}function W(e,t){let n=e?.resource.gpuCount??t?.resource.gpuCount??null,r=e?.resource.gpuType??t?.resource.gpuType??null;return n===null&&r===null?`Not reported`:`${n??`Unknown`} × ${r?Ee(r):`Unreported`}`}function G(e){return e===null?`Not reported`:e.toLocaleString()}function Te(e){return e===`RFT`?`Reinforcement fine-tuning`:`${e} training`}function Ee(e){return e.split(` · `).map(e=>e.replaceAll(`_`,` `).replace(/\b[a-z]/g,e=>e.toUpperCase())).join(` · `)}function K({receipt:e,onOpenConversation:t}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:`Inconclusive benchmark`})}),(0,P.jsx)(`p`,{className:`training-run-placeholder`,children:e.reason}),(0,P.jsxs)(`dl`,{className:`labs-run-detail-list`,children:[(0,P.jsx)(X,{label:`Held-out baseline tokens`,value:e.usage.baseline.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Adaptation baseline tokens`,value:e.usage.adaptation.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Refiner tokens`,value:e.usage.refiner.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Grader tokens`,value:e.usage.grader.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Observed / maximum spend`,value:`$${e.budget.observedSpendUsd.toFixed(4)} / $${e.budget.maximumSpendUsd.toFixed(2)}`}),(0,P.jsx)(X,{label:`Harness candidate`,value:e.stopReason===`candidate_harness_unchanged`?`Unchanged`:`Lineage invalid`}),(0,P.jsx)(X,{label:`Completed attempts`,value:e.attempts.length.toLocaleString()}),(0,P.jsx)(X,{label:`Candidate attempts`,value:`Skipped`})]})]}),e.attempts.length?(0,P.jsx)(Y,{receipt:e,onOpenConversation:t}):null]})}function De({run:e}){let t=[`baseline`,`adaptation`,`refiner`,`candidate_adaptation`,`candidate`,`comparison`],n={baseline:`Baseline`,adaptation:`Adaptation`,refiner:`Refiner`,candidate_adaptation:`Sequential adaptation`,candidate:`Candidate`,comparison:`Comparison`},r=Math.max(0,t.indexOf(e.evaluationProgress?.stage??`baseline`)),i=e.evaluationProgress?.completedAttempts??0,a=e.evaluationProgress?.totalAttempts??1;return(0,P.jsxs)(`div`,{className:`labs-benchmark-progress`,children:[(0,P.jsxs)(`header`,{children:[(0,P.jsx)(`h3`,{children:`Benchmark progress`}),(0,P.jsxs)(`strong`,{children:[i,` of `,a,` attempts`]})]}),(0,P.jsx)(`div`,{className:`labs-benchmark-progress-track`,"aria-hidden":`true`,children:(0,P.jsx)(`span`,{style:{width:`${Math.min(100,i/a*100)}%`}})}),(0,P.jsx)(`ol`,{children:t.map((e,t)=>(0,P.jsxs)(`li`,{className:t<r?`complete`:t===r?`active`:void 0,children:[(0,P.jsx)(`span`,{}),n[e]]},e))})]})}function q({receipt:e}){let t=o(e),n=t.pairs.filter(e=>e.cohort===`held_out`),r=t.pairs.filter(e=>e.cohort===`adaptation`),i=e=>e.length?e.reduce((e,t)=>e+t,0)/e.length:0;return(0,P.jsxs)(`div`,{className:`labs-benchmark-attempt-charts`,children:[(0,P.jsx)(J,{title:`Held-out tokens by task`,baseline:n.map(e=>e.baseline.totalTokens),candidate:n.map(e=>e.refined.totalTokens),format:e=>Math.round(e).toLocaleString()}),(0,P.jsx)(J,{title:`Adaptation tokens by task`,baseline:r.map(e=>e.baseline.totalTokens),candidate:r.map(e=>e.refined.totalTokens),format:e=>Math.round(e).toLocaleString()}),(0,P.jsx)(J,{title:`Held-out quality by task`,baseline:n.map(e=>e.baseline.score),candidate:n.map(e=>e.refined.score),format:e=>e.toFixed(2),summarize:i}),(0,P.jsx)(J,{title:`Adaptation quality by task`,baseline:r.map(e=>e.baseline.score),candidate:r.map(e=>e.refined.score),format:e=>e.toFixed(2),summarize:i})]})}function Oe({receipt:e,run:t,tasksetName:n,onOpenTaskset:r}){let i=o(e),a=i.comparedTaskCount>0,s=i.passed,c=i.tokenDeltaPercent===null?`—`:`${i.tokenDeltaPercent>0?`+`:``}${i.tokenDeltaPercent.toFixed(2)}%`,l=e=>{let t=i.cohorts[e];return`${t.passedTaskCount}/${t.comparedTaskCount} passed`};return(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:`Token efficiency`})}),a?(0,P.jsxs)(`div`,{className:`labs-benchmark-efficiency-summary`,children:[(0,P.jsxs)(`strong`,{children:[i.passedTaskCount,` of `,i.comparedTaskCount,` tasks passed`]}),(0,P.jsxs)(`p`,{children:[`A task passes only when its refined token count is strictly lower than its own baseline. `,i.failedTaskCount,` failed this token-efficiency test; aggregate usage changed by `,c,`.`]})]}):(0,P.jsx)(`p`,{className:`training-run-placeholder`,children:`Paired task-level token evidence is unavailable for this run.`}),(0,P.jsxs)(`dl`,{className:`labs-run-detail-list`,children:[(0,P.jsx)(X,{label:`Execution`,value:w(t.status)}),(0,P.jsx)(X,{label:`Token-efficiency result`,value:s?`Passed`:`Failed`}),(0,P.jsx)(X,{label:`Efficiency passes`,value:`${i.passedTaskCount}/${i.comparedTaskCount}`}),(0,P.jsx)(X,{label:`Efficiency failures`,value:`${i.failedTaskCount}/${i.comparedTaskCount}`}),(0,P.jsx)(X,{label:`All-task foreground tokens`,value:`${i.baselineTokens.toLocaleString()} → ${i.refinedTokens.toLocaleString()}`}),(0,P.jsx)(X,{label:`Aggregate token change`,value:c}),(0,P.jsx)(X,{label:`Adaptation replay`,value:l(`adaptation`)}),(0,P.jsx)(X,{label:`Held-out replay`,value:l(`held_out`)}),(0,P.jsx)(X,{label:`Task quality`,value:`${i.baselinePassedCount}/${i.comparedTaskCount} → ${i.refinedPassedCount}/${i.comparedTaskCount}`}),(0,P.jsx)(X,{label:`Result lineage`,value:e.lineage.valid?`Valid`:`Invalid`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:`Taskset`}),(0,P.jsx)(`dd`,{children:r?(0,P.jsx)(`button`,{className:`labs-run-taskset-link`,type:`button`,onClick:r,children:n}):n})]})]})]})}function J({title:e,baseline:t,candidate:n,format:r,summarize:i=e=>e.reduce((e,t)=>e+t,0)}){let a=t.filter(e=>e!==null),o=n.filter(e=>e!==null),s=Math.max(1,...a,...o),c=Math.max(2,t.length,n.length),l=e=>{let t=[],n=[];return e.forEach((e,r)=>{if(e===null){n.length&&t.push(n.join(` `)),n=[];return}let i=6+r/(c-1)*88,a=44-e/s*36;n.push(`${i},${a}`)}),n.length&&t.push(n.join(` `)),t},u=e=>e.flatMap((e,t)=>e===null?[]:[{x:6+t/(c-1)*88,y:44-e/s*36}]);return(0,P.jsxs)(`section`,{className:`labs-benchmark-line-chart`,children:[(0,P.jsxs)(`header`,{children:[(0,P.jsx)(`h4`,{children:e}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`span`,{children:[`Baseline `,r(i(a))]}),(0,P.jsxs)(`span`,{children:[`Refined `,r(i(o))]})]})]}),(0,P.jsxs)(`svg`,{"aria-label":e,role:`img`,viewBox:`0 0 100 50`,preserveAspectRatio:`none`,children:[(0,P.jsx)(`line`,{x1:`6`,x2:`94`,y1:`44`,y2:`44`}),l(t).map((e,t)=>(0,P.jsx)(`polyline`,{className:`baseline`,points:e},`baseline-${t}`)),l(n).map((e,t)=>(0,P.jsx)(`polyline`,{className:`candidate`,points:e},`candidate-${t}`)),u(t).map((e,t)=>(0,P.jsx)(`circle`,{className:`baseline`,cx:e.x,cy:e.y,r:`1`},`baseline-point-${t}`)),u(n).map((e,t)=>(0,P.jsx)(`circle`,{className:`candidate`,cx:e.x,cy:e.y,r:`1`},`candidate-point-${t}`))]})]})}function Y({receipt:e,onOpenConversation:t}){let n=e.schemaVersion===`openpond.modelEvaluationReceipt.v1`?d(e.attempts??[]):e.attempts??[];return(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:e.schemaVersion===`openpond.modelEvaluationReceipt.v1`?`Selected task results`:`Completed attempts`})}),(0,P.jsx)(`div`,{className:`training-table-wrap`,children:(0,P.jsxs)(`table`,{className:`training-data-table labs-benchmark-attempt-table`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`Task`}),(0,P.jsx)(`th`,{children:`Phase`}),(0,P.jsx)(`th`,{children:`Result`}),(0,P.jsx)(`th`,{children:`Score`}),(0,P.jsx)(`th`,{children:`Tokens`}),(0,P.jsx)(`th`,{children:`Work chat`})]})}),(0,P.jsx)(`tbody`,{children:n.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:ke(e.taskId)}),(0,P.jsx)(`td`,{children:e.phase}),(0,P.jsx)(`td`,{children:(0,P.jsx)(b,{label:e.passed?`Passed`:`Failed`,value:e.passed?`succeeded`:`failed`})}),(0,P.jsx)(`td`,{children:e.score===null?`—`:e.score.toFixed(2)}),(0,P.jsx)(`td`,{children:e.totalTokens.toLocaleString()}),(0,P.jsx)(`td`,{children:e.sessionId?(0,P.jsx)(`button`,{className:`labs-run-taskset-link`,type:`button`,onClick:()=>t(e.sessionId),children:`Open chat`}):`Not retained`})]},`${e.phase}:${e.attemptId}`))})]})})]})}function ke(e){return e.replace(/^(?:adaptation|frozen)-/,``).replaceAll(`-`,` `).replace(/^./,e=>e.toUpperCase())}function X({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function Ae(e){let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(r===0?0:2)} ${t[r]}`}function je({error:e,events:t,loading:n,pending:r}){let[i,a]=(0,N.useState)(!1),[o,s]=(0,N.useState)({}),[c,l]=(0,N.useState)(!0),u=(0,N.useRef)(null),d=(0,N.useRef)(null),f=(0,N.useRef)(null),p=(0,N.useMemo)(()=>Me(t),[t]),m=(0,N.useMemo)(()=>t.filter(e=>o[Z(e)]??Ne(Z(e))),[t,o]),h=p.filter(e=>o[e.id]??Ne(e.id)).length,g=p.length>0&&h===p.length,_=h>0&&!g;return(0,N.useEffect)(()=>{f.current&&(f.current.indeterminate=_)},[_]),(0,N.useEffect)(()=>{if(!i)return;let e=e=>{d.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]),(0,N.useLayoutEffect)(()=>{let e=u.current;e&&c&&(e.scrollTop=e.scrollHeight)},[e,c,r,m]),n&&!t.length?(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`Loading run events…`}):t.length?(0,P.jsxs)(`div`,{className:`training-event-log-shell`,children:[(0,P.jsxs)(`div`,{className:`training-event-log-toolbar`,children:[(0,P.jsx)(`div`,{children:(0,P.jsx)(`strong`,{children:`Activity log`})}),(0,P.jsxs)(`div`,{className:`training-event-filter`,ref:d,children:[(0,P.jsxs)(`button`,{"aria-expanded":i,"aria-haspopup":`menu`,className:`training-event-filter-trigger`,type:`button`,onClick:()=>a(e=>!e),children:[(0,P.jsx)(ie,{"aria-hidden":`true`,size:14}),`Event types`,(0,P.jsxs)(`span`,{children:[h,`/`,p.length]}),(0,P.jsx)(E,{"aria-hidden":`true`,size:13})]}),i?(0,P.jsxs)(`div`,{"aria-label":`Filter training activity by event type`,className:`training-event-filter-menu`,role:`menu`,children:[(0,P.jsxs)(`label`,{className:`training-event-filter-option select-all`,children:[(0,P.jsx)(`input`,{checked:g,ref:f,type:`checkbox`,onChange:e=>{let t=e.currentTarget.checked;s(Object.fromEntries(p.map(e=>[e.id,t])))}}),(0,P.jsx)(`span`,{className:`training-event-filter-check`,children:(0,P.jsx)(j,{"aria-hidden":`true`,size:12})}),`Select all`]}),(0,P.jsx)(`div`,{className:`training-event-filter-options`,children:p.map(e=>{let t=o[e.id]??Ne(e.id);return(0,P.jsxs)(`label`,{className:`training-event-filter-option`,children:[(0,P.jsx)(`input`,{checked:t,type:`checkbox`,onChange:t=>s(n=>({...n,[e.id]:t.currentTarget.checked}))}),(0,P.jsx)(`span`,{className:`training-event-filter-check`,children:(0,P.jsx)(j,{"aria-hidden":`true`,size:12})}),(0,P.jsx)(`span`,{children:e.label}),(0,P.jsx)(`small`,{children:e.count.toLocaleString()})]},e.id)})})]}):null]})]}),(0,P.jsxs)(`div`,{"aria-label":`Training activity log`,"aria-live":`polite`,className:`training-event-log`,ref:u,role:`log`,onScroll:e=>{let t=e.currentTarget,n=t.scrollHeight-t.scrollTop-t.clientHeight;l(n<=6)},children:[(0,P.jsxs)(`div`,{"aria-hidden":`true`,className:`training-event-log-header`,children:[(0,P.jsx)(`span`,{children:`Time`}),(0,P.jsx)(`span`,{children:`Event type`}),(0,P.jsx)(`span`,{children:`Details`})]}),m.map(e=>(0,P.jsxs)(`div`,{className:`training-event-log-line ${e.type}`,children:[(0,P.jsx)(`time`,{dateTime:e.timestamp,children:C(e.timestamp)}),(0,P.jsx)(`span`,{children:Pe(Z(e))}),(0,P.jsx)(`code`,{children:Fe(e)})]},e.id)),r&&!e?(0,P.jsxs)(`div`,{className:`training-event-log-loading`,role:`status`,children:[(0,P.jsx)(re,{"aria-hidden":`true`,className:`spin`,size:14}),(0,P.jsx)(`span`,{className:`sr-only`,children:`Waiting for new activity`})]}):null,m.length?null:(0,P.jsx)(`div`,{className:`training-event-log-empty`,children:`No events match the selected event types.`}),e?(0,P.jsxs)(`div`,{className:`training-event-log-line failure`,children:[(0,P.jsx)(`time`,{children:`—`}),(0,P.jsx)(`span`,{children:`Failure`}),(0,P.jsx)(`code`,{children:e})]}):null]})]}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:e??`No normalized run events were recorded.`})}function Z(e){return typeof e.payload.remoteEventType==`string`&&e.payload.remoteEventType.trim()?e.payload.remoteEventType:typeof e.payload.telemetryType==`string`&&e.payload.telemetryType.trim()?e.payload.telemetryType:e.type}function Me(e){let t=new Map;for(let n of e){let e=Z(n);t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({id:e,count:t,label:Pe(e)})).sort((e,t)=>e.label.localeCompare(t.label))}function Ne(e){return e!==`metric`&&!e.endsWith(`_metric`)}function Pe(e){return e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}function Fe(e){let t=e.payload,n=ze(t.step),r=ze(t.maxSteps);if(typeof t.telemetryType==`string`){let e=typeof t.message==`string`?t.message:null,r=typeof t.errorCode==`string`?t.errorCode:null,i=typeof t.telemetrySource==`string`?` · ${t.telemetrySource}`:``;return`${e??t.telemetryType.replaceAll(`_`,` `)}${n==null?``:` · step ${n}`}${i}${r?` · ${r}`:``}`}if(typeof t.remoteEventType==`string`){let e=Ie(t.remoteEventType),r=typeof t.remotePhase==`string`?Le(t.remotePhase):null,i=typeof t.errorCode==`string`&&t.errorCode.trim()?t.errorCode.trim():null;return[e,r,n==null?null:`step ${n}`,i?`error ${i}`:null].filter(e=>!!e).join(` · `)}if(e.type===`start`)return typeof t.device==`string`?`Worker started on ${t.device}.`:`Worker started.`;if(e.type===`progress`&&n!=null)return r==null?`Step ${n}.`:`Step ${n} of ${r}.`;if(e.type===`metric`){let e=typeof t.metricKind==`string`?t.metricKind.replaceAll(`_`,` `):`metric`,r=[Q(`loss`,t.loss),Q(`reward`,t.meanReward??t.reward),Q(`policy loss`,t.policyLoss),Q(`value loss`,t.valueLoss),Q(`preference accuracy`,t.preferenceAccuracy,Be)].filter(e=>!!e),i=typeof t.failureClass==`string`?t.failureClass:null,a=typeof t.failureCode==`string`?t.failureCode:null,o=typeof t.metricId==`string`&&typeof t.value==`number`?` · ${t.metricId}: ${t.value.toPrecision(4)}`:``;return`${e}${n==null?``:` · step ${n}`}${o}${i?` · ${i}`:``}${a?` · ${a}`:``}${r.length?` · ${r.join(` · `)}`:``}`}if(e.type===`checkpoint`){let e=ze(t.policyVersion),n=ze(t.sizeBytes),r=[e==null?null:`policy ${e}`,n==null?null:Ae(n),t.final===!0?`final`:null].filter(e=>!!e);return r.length?`Checkpoint committed · ${r.join(` · `)}.`:`Checkpoint committed.`}if(e.type===`complete`){let e=ze(t.artifactCount);return e==null?`Worker completed.`:`Worker completed with ${e} artifacts.`}return e.type===`failure`&&typeof t.message==`string`?t.message:Object.keys(t).length?JSON.stringify(t):`Recorded.`}function Ie(e){return{drain:`Rollout drain`,infer:`Model inference`,materialize_checkpoint:`Checkpoint materialization`,optimizer_metric:`Optimizer metric`,provision_gpu:`GPU provisioning`,rollout_metric:`Rollout trajectory`,score_reward_model:`Reward scoring`,start_inference:`Policy server`,train_step:`Optimizer update`,upload_checkpoint:`Checkpoint upload`}[e]??Re(e)}function Le(e){return{committed:`committed`,completed:`completed`,eligible:`recorded`,failed:`failed`,running:`running`,succeeded:`succeeded`}[e]??Re(e).toLocaleLowerCase()}function Re(e){return e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}function Q(e,t,n=e=>new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(e)){let r=ze(t);return r==null?null:`${e} ${n(r)}`}function ze(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Be(e){return`${(e*100).toFixed(1)}%`}function Ve({connection:e,detailTab:t,onDetailTabChange:n,selectedEntryKey:r,workproduct:o,runs:d,training:f,onOpenDataset:b,onOpenConversation:x,detailKind:C}){let E=f.payload,[D,re]=(0,N.useState)(null),k=(0,N.useMemo)(()=>l(o,d,E),[d,E,o]),A=(0,N.useMemo)(()=>h(o,d,E),[d,E,o]),j=(0,N.useMemo)(()=>m(o,E),[E,o]),ie=(0,N.useMemo)(()=>u(o,d,E),[d,E,o]),se=(0,N.useMemo)(()=>new Map(ie.map(e=>[e.id,e])),[ie]),M=(0,N.useMemo)(()=>s(k,A),[k,A]).find(e=>e.key===r)??null,F=r.startsWith(`model-run:`)?r.slice(10):null,I=F?j.find(e=>e.id===F)??null:M?.job?j.find(e=>e.id===M.job?.metadata.modelRunId)??null:null,L=M?.job??(I?E?.jobs.find(e=>e.id===I.id||e.metadata.modelRunId===I.id)??null:null),pe=E?.comparisonSeriesEntries.find(e=>e.modelRunId===I?.id||e.modelRunId===L?.metadata.modelRunId)??null,he=a.shape.recovery.safeParse(L?.metadata.hostedRecovery),R=he.success?he.data:void 0,ge=O.shape.continuation.safeParse(L?.metadata.hostedContinuation),z=ge.success?ge.data:void 0,_e=z?A.find(e=>e.lineage.jobId===z.sourceArtifact.jobId):void 0,ve=R?`Recovered checkpoint`:_e?`Version ${_e.number}`:z?`Checkpoint ${z.sourceArtifact.checkpointId}`:typeof L?.metadata.parentHostedArtifactId==`string`?`Prior hosted run`:ue(E,pe),ye=(0,N.useMemo)(()=>{let e=v(k,A,j);return p(e,I?.kind===`evaluation`?`evals`:`training`)},[k,j,I?.kind,A]),xe=ye.findIndex(e=>e.key===r||L!==null&&e.job?.id===L.id||I!==null&&e.lifecycleRun?.id===I.id),B=xe<0?null:ye.length-xe,V=M?.version??(I?.adapterArtifactLineageId?A.find(e=>e.lineage.id===I.adapterArtifactLineageId)??null:null),H=(I?E?.modelVersions.find(e=>e.id===I.modelVersionId)?.baseModel.modelId:null)??E?.modelVersions.filter(e=>e.modelId===o.id&&e.kind===`base_reference`).sort((e,t)=>t.version-e.version)[0]?.baseModel.modelId??(typeof L?.metadata.baseModelId==`string`?L.metadata.baseModelId:null),U=V?.lineage.frozenEvaluationArtifactId??null,W=V?.plan??(L?se.get(L.planId)??null:null),G=V?.taskset??_(E).find(e=>e.id===(I?.taskset.id??W?.tasksetId??L?.metadata.tasksetId))??null,Te=G?.name??(typeof L?.metadata.tasksetId==`string`?L.metadata.tasksetId:`Unavailable`),Ee=I?.method??W?.recipe.method??Ke(L?.metadata),K=Ce(e,L?.id??null,L?.status??null,t===`evaluation`),De=L?E?.rolloutReceipts.filter(e=>e.jobId===L.id)??[]:[],q=K.detail?.managedEvidence??null,Oe=K.detail?.events.some(e=>e.type===`metric`&&e.payload.metricKind===`rollout_trajectory`)??!1,J=c({lifecycleRun:I,job:K.detail?.job??L}),Y=y(J),ke=I?.status===`failed`&&L?.metadata.phase===`artifact_collection_failed`,X=Ee===`grpo`,Z=Ue(L?.metadata),Me=(W&&(W.recipe.method===`sft`||W.recipe.method===`dpo`||W.recipe.method===`grpo`)?W.recipe.optimizer.maxSteps:null)??q?.progress.targetOptimizerSteps??null,Ne=Me!==null&&typeof L?.metadata.progress==`number`&&Number.isFinite(L.metadata.progress)?Math.floor(Math.max(0,L.metadata.progress)*Me):0,Pe=Math.max(0,Z?.optimizerUpdatesApplied??0,Ne,K.detail?.policyMetrics.reduce((e,t)=>Math.max(e,t.step),0)??0,K.detail?.stepMetrics.reduce((e,t)=>Math.max(e,t.step),0)??0,q?.progress.committedOptimizerSteps??0),Fe=He(X&&Z?Z.groupsCompleted:Pe,X&&Z?Z.groupsTarget:Me),Ie=C===`run`?{id:`details`,label:`Details`}:{id:`overview`,label:`Overview`},Le=[...C===`run`&&L?[{id:`metrics`,label:`Metrics`}]:[],Ie,...C===`version`&&L?[{id:`metrics`,label:`Metrics`}]:[],{id:`evaluation`,label:`Evaluation`},...De.length||Oe?[{id:`rollouts`,label:`Rollouts`}]:[],{id:`artifacts`,label:`Artifacts`},...L?[{id:`activity`,label:`Activity`}]:[]],Re=t,Q=Le.some(e=>e.id===Re)?Re:Le[0].id;return!M&&!I&&f.loading?(0,P.jsxs)(`div`,{className:`labs-model-version-detail`,children:[(0,P.jsx)(ae,{title:`Run details`}),(0,P.jsx)(`p`,{role:`status`,children:`Loading training run…`})]}):!M&&!I?(0,P.jsx)(`div`,{className:`labs-model-version-detail`,children:(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`This training attempt is no longer available.`})}):I?.kind===`evaluation`?(0,P.jsx)(We,{run:I,runNumber:B,tasksetName:G?.name??`Unavailable`,onOpenTaskset:G?()=>b(G.id):void 0,onOpenConversation:x}):(0,P.jsxs)(`div`,{className:`labs-model-version-detail`,children:[(0,P.jsx)(ae,{title:I||L?B?`Run ${B}`:`Run details`:V?`Version ${V.number}`:`Run details`,description:`${te(Ee)} on ${Ge(W,H)}`,status:(0,P.jsx)(g,{status:J}),actions:Y&&(I||L)?(0,P.jsx)(`button`,{type:`button`,className:`training-button secondary`,disabled:f.busyAction!==null||J===`cancelling`,onClick:async()=>{let e=I?.id??L.id,t=I?await f.actions.cancelModelRun(I.id):await f.actions.cancelJob(L.id);re({runId:e,message:t?`Cancellation requested. Waiting for the training service to confirm.`:`Cancellation could not be requested. Try again.`})},children:J===`cancelling`?`Cancelling…`:f.busyAction===`cancel-model-run`||f.busyAction===`cancel-job`?`Requesting cancellation…`:`Cancel run`}):ke&&I?(0,P.jsx)(`button`,{type:`button`,className:`training-button secondary`,disabled:f.busyAction!==null,onClick:async()=>{let e=await f.actions.retryModelRunCollection(I.id);re({runId:I.id,message:e?.state===`succeeded`?`Outputs collected from the completed training job.`:`Collection failed. The training job and its outputs are retained.`})},children:f.busyAction===`retry-model-run-collection`?`Collecting…`:`Retry collection`}):void 0,metrics:[{label:X&&Z?`Training groups`:`Training steps`,value:Fe.value},...R&&Z?[{label:`Optimizer updates`,value:`${Math.max(0,Z.optimizerUpdatesApplied-R.policyVersion)} new · ${R.policyVersion} reused`}]:[],{label:Y?`Latest reward`:`Final reward`,value:Je(I?.reward?.raw??q?.reward.finalMean??null)},{label:`Duration`,value:I?T(I.startedAt,S(I.status,I.completedAt,I.updatedAt)):L?T(L.startedAt,S(L.status,L.completedAt,L.updatedAt)):`Not recorded`},{label:`Output`,value:V?`Version ${V.number}`:`No version`},{label:`Based on`,value:ve},{label:`Taskset`,value:Te,onSelect:G?()=>b(G.id):void 0,ariaLabel:G?`Open Taskset ${G.name}`:void 0}]}),(0,P.jsx)(ee,{recovery:R}),z?(0,P.jsx)(i,{continuation:{sourceJobId:z.sourceArtifact.jobId,checkpointId:z.sourceArtifact.checkpointId}}):null,D&&D.runId===(I?.id??L?.id)?(0,P.jsx)(`p`,{role:`status`,children:D.message}):null,(0,P.jsxs)(`section`,{className:`labs-run-detail-tabs`,children:[(0,P.jsx)(`div`,{className:`training-detail-tabs`,role:`tablist`,"aria-label":`Run details`,children:Le.map(e=>(0,P.jsx)(`button`,{"aria-controls":`run-detail-panel-${e.id}`,"aria-selected":Q===e.id,className:Q===e.id?`active`:void 0,id:`run-detail-tab-${e.id}`,role:`tab`,type:`button`,onClick:()=>n(e.id),children:e.label},e.id))}),(0,P.jsxs)(`div`,{"aria-labelledby":`run-detail-tab-${Q}`,className:`labs-run-detail-tab-panel`,id:`run-detail-panel-${Q}`,role:`tabpanel`,children:[Q===Ie.id?(0,P.jsx)(we,{baseModel:Ge(W,H),compute:I?ne(I.destinationId??``):W?ne(W.destinationId):L?ne(L.destinationId):`Not recorded`,duration:I?T(I.startedAt,S(I.status,I.completedAt,I.updatedAt)):L?T(L.startedAt,S(L.status,L.completedAt,L.updatedAt)):`Not recorded`,failure:L?.error??I?.failure??null,configuration:[...z?[{label:`Starting checkpoint`,value:[_e?`Version ${_e.number}`:null,z.sourceArtifact.checkpointId].filter(Boolean).join(` · `)},{label:`Parent run`,value:z.sourceArtifact.jobId},{label:`Parent artifact`,value:z.sourceArtifact.artifactId},{label:`Optimizer`,value:z.optimizerMode===`reset`?`Reset`:`Continue`}]:le(E,pe),...ce(W)],evidence:q,method:te(Ee),output:V?`Version ${V.number}`:`No version created`,reward:I?.reward?.raw??q?.reward.finalMean??null,status:I?w(I.status):L?w(L.status):`Imported`,statusValue:I?.status??L?.status??`imported`,taskset:Te,telemetry:I?.receipt?.schemaVersion===`openpond.modelRunReceipt.v1`?I.receipt.telemetry:null,title:I||L?B?`Run ${B}`:`Run details`:V?`Version ${V.number}`:`Run details`,versionStatus:V?V.current?`Active`:`Available`:null,onOpenTaskset:G?()=>b(G.id):void 0,showHeader:!1}):null,Q===`metrics`&&L?(0,P.jsx)(oe,{detail:K.detail,error:K.error,loading:K.loading,taskset:G}):null,Q===`artifacts`?(0,P.jsxs)(`dl`,{className:`training-configuration-list`,children:[(0,P.jsx)($,{label:`Training attempt`,value:L?.id??`Provider import`}),(0,P.jsx)($,{label:`Taskset`,value:Te}),(0,P.jsx)($,{label:`Prepared data`,value:L?.bundleHash??`Provider managed`}),(0,P.jsx)($,{label:`Version ID`,value:V?.lineage.id??`No version created`}),q?.checkpoint?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)($,{label:`Checkpoint`,value:q.checkpoint.id}),(0,P.jsx)($,{label:`Checkpoint size`,value:q.checkpoint.sizeBytes==null?`Not reported`:Ae(q.checkpoint.sizeBytes)}),(0,P.jsx)($,{label:`Checkpoint hash`,value:q.checkpoint.sha256??`Not reported`})]}):null,q?.canonicalPublication.state?(0,P.jsx)($,{label:`Registry publication`,value:Ye(q.canonicalPublication.state)}):null]}):null,Q===`evaluation`?(0,P.jsxs)(`div`,{className:`training-run-evaluation`,children:[!q?.evaluations.length||K.detail?.evaluation?(0,P.jsx)(me,{detail:K.detail,loading:K.loading,pending:Y}):null,!K.detail?.evaluation&&q?.evaluations.length?(0,P.jsx)(`dl`,{className:`labs-inline-facts`,children:q.evaluations.map(e=>(0,P.jsxs)(N.Fragment,{children:[(0,P.jsx)($,{label:e.kind===`baseline`?`Baseline score`:`Candidate score`,value:e.score==null?`Not reported`:e.score.toFixed(6)}),(0,P.jsx)($,{label:e.kind===`baseline`?`Baseline coverage`:`Candidate coverage`,value:e.taskCount==null?`Not reported`:e.targetTaskCount==null?`${e.taskCount} ${e.taskCount===1?`task`:`tasks`} scored`:`${e.taskCount} of ${e.targetTaskCount} ${e.targetTaskCount===1?`task`:`tasks`} scored`})]},`${e.kind}:${e.policyVersion}`))}):null,V&&L?.destinationId===`openpond_managed`?(0,P.jsx)(be,{connection:e,lineageId:V.lineage.id,onSaved:f.refresh},V.lineage.id):null,!V&&L?.metadata.source===`hosted_model_project_import`&&L.status===`succeeded`?(0,P.jsx)(be,{connection:e,jobId:L.id,onSaved:f.refresh},`candidate:${L.id}`):null,L&&q?.evaluations.length?(0,P.jsx)(Se,{connection:e,jobId:L.id,evaluations:q.evaluations},L.id):null,U?(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,onClick:()=>void f.actions.downloadArtifact(U),children:`Download evaluation receipt`}):null]}):null,Q===`rollouts`?De.length?(0,P.jsx)(fe,{receipts:De}):(0,P.jsx)(de,{events:K.detail?.events??[]}):null,Q===`activity`&&L?(0,P.jsx)(je,{error:L.error??K.error,events:K.detail?.events??[],loading:K.loading,pending:Y}):null]})]})]})}function He(e,t){let n=Math.max(0,Math.floor(e));if(t===null||!Number.isFinite(t)||t<=0)return{value:n.toLocaleString(),hint:n===1?`completed update`:`completed updates`};let r=Math.max(1,Math.floor(t));return{value:`${n.toLocaleString()} / ${r.toLocaleString()}`,hint:`completed / planned`}}function Ue(e){let t=e?.rolloutProgress;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;return[`groupsCompleted`,`groupsTarget`,`optimizerUpdatesApplied`,`optimizerUpdatesSkipped`].some(e=>typeof n[e]!=`number`||!Number.isInteger(n[e])||n[e]<0)?null:{groupsCompleted:n.groupsCompleted,groupsTarget:n.groupsTarget,optimizerUpdatesApplied:n.optimizerUpdatesApplied,optimizerUpdatesSkipped:n.optimizerUpdatesSkipped}}function We({run:e,runNumber:t,tasksetName:n,onOpenTaskset:r,onOpenConversation:i}){let[a,s]=(0,N.useState)(`results`),c=e.receipt?.schemaVersion===`openpond.modelEvaluationReceipt.v1`?e.receipt:null,l=e.receipt?.schemaVersion===`openpond.modelEvaluationStopReceipt.v1`?e.receipt:null,u=c?f(c):null,d=c?o(c):null;return(0,P.jsxs)(`div`,{className:`labs-model-version-detail labs-model-evaluation-detail`,children:[(0,P.jsx)(ae,{title:t?`Eval ${t}`:`Evaluation run`,description:`Harness Refiner benchmark · ${n}`,status:(0,P.jsx)(b,{label:c?d?.comparedTaskCount?`${d.passedTaskCount}/${d.comparedTaskCount} passed`:`No paired result`:l?`Inconclusive`:w(e.status),value:c?d?.comparedTaskCount&&d.passed?`succeeded`:`neutral`:l?.terminalClassification??e.status}),metrics:[{label:`Baseline pass rate`,value:c?`${(c.quality.baselinePassRate*100).toFixed(1)}%`:`—`},{label:`Candidate pass rate`,value:c?`${(c.quality.candidatePassRate*100).toFixed(1)}%`:`—`},{label:`Scenarios`,value:c?.attempts?.length??0},{label:`Execution`,value:w(e.status)}]}),(0,P.jsx)(`div`,{className:`training-detail-tabs`,role:`tablist`,"aria-label":`Evaluation details`,children:[`results`,`scenarios`,`activity`].map(e=>(0,P.jsx)(`button`,{className:a===e?`active`:void 0,"aria-selected":a===e,role:`tab`,type:`button`,onClick:()=>s(e),children:e===`results`?`Results`:e===`scenarios`?`Scenarios`:`Activity`},e))}),a===`results`&&c?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(se,{series:[{id:`baseline`,label:`Held-out baseline`,inputTokens:u.baseline.inputTokens,outputTokens:u.baseline.outputTokens,tokens:u.baseline.totalTokens,passRate:c.quality.baselinePassRate,costUsd:u.baseline.costUsd},{id:`candidate`,label:`Held-out refined`,inputTokens:u.candidate.inputTokens,outputTokens:u.candidate.outputTokens,tokens:u.candidate.totalTokens,passRate:c.quality.candidatePassRate,costUsd:u.candidate.costUsd}]}),(0,P.jsx)(se,{series:[{id:`adaptation-baseline`,label:`Adaptation baseline`,inputTokens:u.adaptation.inputTokens,outputTokens:u.adaptation.outputTokens,tokens:u.adaptation.totalTokens,passRate:c.quality.adaptationBaselinePassRate,costUsd:u.adaptation.costUsd},{id:`adaptation-candidate`,label:`Adaptation replay`,inputTokens:u.candidate_adaptation.inputTokens,outputTokens:u.candidate_adaptation.outputTokens,tokens:u.candidate_adaptation.totalTokens,passRate:c.quality.adaptationCandidatePassRate,costUsd:u.candidate_adaptation.costUsd}]}),(0,P.jsx)(Oe,{receipt:c,run:e,tasksetName:n,onOpenTaskset:r})]}):a===`results`&&l?(0,P.jsx)(K,{receipt:l,onOpenConversation:i}):a===`results`?(0,P.jsx)(`section`,{className:`labs-run-summary-card`,children:e.failure?(0,P.jsx)(`p`,{className:`training-run-placeholder`,children:e.failure}):(0,P.jsx)(De,{run:e})}):null,a===`scenarios`&&c?(0,P.jsxs)(P.Fragment,{children:[(c.attempts??[]).length?(0,P.jsx)(q,{receipt:c}):null,(c.attempts??[]).length?(0,P.jsx)(Y,{receipt:c,onOpenConversation:i}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`No per-scenario attempts were retained.`})]}):null,a===`activity`?(0,P.jsxs)(`dl`,{className:`labs-inline-facts`,children:[(0,P.jsx)($,{label:`Run ID`,value:e.id}),(0,P.jsx)($,{label:`Status`,value:w(e.status)}),(0,P.jsx)($,{label:`Started`,value:e.startedAt?C(e.startedAt):`Not started`}),(0,P.jsx)($,{label:`Completed`,value:e.completedAt?C(e.completedAt):`In progress`})]}):null]})}function Ge(e,t=null){if(!e)return t?qe(t):`Not recorded`;let n=e.recipe.method===`sft`||e.recipe.method===`grpo`?e.recipe.baseModel:e.recipe.method===`dpo`?e.recipe.policyModel:e.recipe.method===`ppo`?e.recipe.policyOptimization.policyModel:null;return n?qe(n.id):`Not recorded`}function Ke(e){let t=e?.trainingMethod;return t===`sft`||t===`dpo`||t===`grpo`||t===`ppo`||t===`sdft`||t===`opd`||t===`opsd`||t===`sdpo`?t:null}function qe(e){return e.split(`/`).at(-1)??e}function Je(e){return e===null?`Not reported`:e.toFixed(4)}function $({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function Ye(e){return e?e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()):`Pending`}export{Ve as LabModelVersionDetailPage,Fe as eventSummary,He as formatTrainingProgress,Ue as managedRolloutProgress};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-CDtTBysF.js";import{t as r}from"./useQuery-9SCnxwmR.js";import{C as i,O as a,_ as o,a as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,o as g,p as _,r as v,s as y,v as b,w as ee}from"./LabModelWorkspace-Q5DG2mLP.js";import{t as x}from"./query-scope-BRpcgljO.js";import"./icons-CYvTltSH.js";import{c as S,l as te,n as C,o as w,r as T,t as ne}from"./training-model-data-vvvphDlO.js";import{t as E}from"./chevron-down-CkifKd_O.js";import{t as D}from"./chevron-right-LsMXJ5SB.js";import{t as re}from"./loader-circle-AjP2mDJA.js";import{Fn as O,Gt as k,Tn as A,gn as j,rn as ie}from"./App-CV1p0_Zy.js";import{t as ae}from"./ModelProjectPageHeader-C4mgVJGx.js";import{lt as oe}from"./MainPane-BtzUF6O_.js";import{t as se}from"./LabsRoute-DS_mlprv.js";function ce(e){if(!e)return[];let t=e.recipe;return t.method===`grpo`?[{label:`LoRA rank`,value:String(t.lora.rank)},{label:`Learning rate`,value:M(t.optimizer.learningRate)},{label:`Optimizer steps`,value:String(t.optimizer.maxSteps)},{label:`Rollouts per update`,value:String(t.rollout.groupSize)},{label:`Rollout concurrency`,value:String(t.rollout.concurrency)},{label:`Max output tokens`,value:t.rollout.maxOutputTokens.toLocaleString()},{label:`Temperature`,value:String(t.rollout.temperature)},{label:`Top P`,value:String(t.rollout.topP)}]:t.method===`sft`||t.method===`dpo`?[{label:`LoRA rank`,value:String(t.lora.rank)},{label:`Learning rate`,value:M(t.optimizer.learningRate)},{label:`Optimizer steps`,value:String(t.optimizer.maxSteps)}]:[]}function le(e,t){if(!e||!t)return[];if(t.parent.kind===`base_model`)return[{label:`Starting checkpoint`,value:`Frozen base · ${t.parent.revision}`},{label:`Optimizer`,value:`Fresh`}];let n=e.modelVersions.find(e=>e.id===t.parent.id);return[{label:`Starting checkpoint`,value:[e.comparisonSeriesEntries.find(e=>e.seriesId===t.seriesId&&e.modelVersionId===t.parent.id)?.label??null,n?`Version ${n.version}`:t.parent.id].filter(e=>!!e).join(` · `)},{label:`Optimizer`,value:`Fresh`}]}function ue(e,t){if(!e||!t||t.parent.kind===`base_model`)return`Frozen base`;let n=e.comparisonSeriesEntries.find(e=>e.seriesId===t.seriesId&&e.modelVersionId===t.parent.id),r=e.modelVersions.find(e=>e.id===t.parent.id);return[n?.label??`Prior checkpoint`,r?`Version ${r.version}`:null].filter(e=>!!e).join(` · `)}function M(e){return e===0?`0`:e.toExponential(2)}var N=e(t(),1),P=n();function de({events:e}){let t=e.filter(e=>e.type===`metric`&&e.payload.metricKind===`rollout_trajectory`);return t.length?(0,P.jsx)(`div`,{className:`training-rollout-receipts`,children:t.map((e,t)=>{let n=e.payload.rewardEligible===!0,r=I(e.payload.reward),i=typeof e.payload.failureClass==`string`?e.payload.failureClass:null,a=typeof e.payload.failureCode==`string`?e.payload.failureCode:null;return(0,P.jsxs)(`details`,{children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsxs)(`span`,{children:[`Attempt `,t+1]}),(0,P.jsx)(`strong`,{children:n?`eligible`:`ineligible`}),(0,P.jsx)(`em`,{children:n&&r!=null?r.toFixed(3):a??i??`not reward eligible`})]}),(0,P.jsxs)(`dl`,{className:`training-configuration-list`,children:[(0,P.jsx)(F,{label:`Rollout`,value:L(e.payload.rolloutId)}),(0,P.jsx)(F,{label:`Group`,value:L(e.payload.rolloutGroupId)}),(0,P.jsx)(F,{label:`Policy`,value:`v${I(e.payload.policyVersion)??0}`}),(0,P.jsx)(F,{label:`Worker`,value:String((I(e.payload.workerSlot)??0)+1)}),(0,P.jsx)(F,{label:`Reward`,value:r==null?`Not eligible`:String(r)}),(0,P.jsx)(F,{label:`Failure class`,value:i??`None`}),(0,P.jsx)(F,{label:`Failure code`,value:a??`None`}),(0,P.jsx)(F,{label:`Components`,value:JSON.stringify(e.payload.rewardComponents??{})}),(0,P.jsx)(F,{label:`Tokens`,value:`${I(e.payload.inputTokens)??0} input · ${I(e.payload.outputTokens)??0} output`})]})]},e.id)})}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`No managed attempts were recorded for this run.`})}function fe({receipts:e}){let[t,n]=(0,N.useState)(!1);if(!e.length)return(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`No on-policy rollout receipts were recorded for this run.`});let r=[...e].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),i=t?r:r.slice(0,24);return(0,P.jsxs)(`div`,{className:`training-rollout-receipts`,children:[e.length>24?(0,P.jsxs)(`div`,{className:`training-rollout-receipt-controls`,children:[(0,P.jsx)(`span`,{children:t?`Showing all ${e.length} receipts`:`Showing latest ${i.length} of ${e.length} receipts`}),(0,P.jsx)(`button`,{className:`training-text-button`,type:`button`,onClick:()=>n(e=>!e),children:t?`Show latest 24`:`Show all ${e.length}`})]}):null,i.map(e=>(0,P.jsxs)(`details`,{children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsx)(`span`,{children:pe(e.providerTrace.rolloutId)}),(0,P.jsx)(`strong`,{children:e.status}),(0,P.jsx)(`em`,{children:e.reward.eligible&&e.reward.raw!=null?e.reward.raw.toFixed(3):e.failureClass??`not reward eligible`})]}),(0,P.jsxs)(`dl`,{className:`training-configuration-list`,children:[(0,P.jsx)(F,{label:`Correlation`,value:e.correlationId}),(0,P.jsx)(F,{label:`Task`,value:e.taskId}),(0,P.jsx)(F,{label:`Policy`,value:e.policy.modelId}),(0,P.jsx)(F,{label:`Checkpoint`,value:e.policy.checkpointId??`Provider initial policy`}),(0,P.jsx)(F,{label:`Environment`,value:`${e.environment.id}@${e.environment.version}`}),(0,P.jsx)(F,{label:`World`,value:`${e.environment.worldId} · ${e.environment.worldHash}`}),(0,P.jsx)(F,{label:`Raw reward`,value:e.reward.raw==null?`Not eligible`:String(e.reward.raw)}),(0,P.jsx)(F,{label:`Components`,value:JSON.stringify(e.reward.components)}),(0,P.jsx)(F,{label:`Outcome`,value:e.verifier?.outcome??e.failureClass??`Pending`}),(0,P.jsx)(F,{label:`Trace`,value:`${e.providerTrace.experimentId}/${e.providerTrace.rolloutId}`})]})]},e.id))]})}function F({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function I(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function L(e){return typeof e==`string`&&e?e:`Not recorded`}function pe(e){return e.replace(/^lineage_/,``).slice(0,18)}function me({detail:e,loading:t,pending:n=!1}){if(t&&!e)return(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`Loading evaluation results…`});let r=e?.evaluation;return r?(0,P.jsxs)(`div`,{className:`training-run-evaluation`,children:[(0,P.jsxs)(`div`,{className:`training-metric-summary`,children:[(0,P.jsx)(R,{label:`Base score`,value:ge(r.base.meanScore)}),(0,P.jsx)(R,{label:`Trained score`,value:ge(r.trained.meanScore)}),(0,P.jsx)(R,{label:`Score change`,value:_e(r.meanScoreDelta)}),(0,P.jsx)(R,{label:`Trained pass rate`,value:z(r.trained.passRate)})]}),r.base.count===0?(0,P.jsx)(`p`,{className:`training-muted`,children:`Base-model scoring was not imported for this earlier run. New runs retain both base and trained evaluations.`}):null,r.trained.count>0&&r.trained.scoredCount===0?(0,P.jsx)(`p`,{className:`training-muted`,children:`Outputs were captured, but the grader was unavailable, so this run has no evaluation score.`}):null,(0,P.jsx)(`div`,{className:`training-table-wrap`,children:(0,P.jsxs)(`table`,{className:`training-data-table training-evaluation-table`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`Test example`}),(0,P.jsx)(`th`,{children:`Base`}),(0,P.jsx)(`th`,{children:`Trained`}),(0,P.jsx)(`th`,{children:`Result`})]})}),(0,P.jsx)(`tbody`,{children:r.examples.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsxs)(`details`,{children:[(0,P.jsx)(`summary`,{children:e.taskId}),(0,P.jsx)(he,{input:e.input,baseOutput:e.baseOutput,trainedOutput:e.trainedOutput,baseGrade:e.baseGrade,trainedGrade:e.trainedGrade})]})}),(0,P.jsx)(`td`,{children:ve(e.baseGrade)}),(0,P.jsx)(`td`,{children:ve(e.trainedGrade)}),(0,P.jsx)(`td`,{children:ye(e.baseGrade,e.trainedGrade)})]},e.taskId))})]})})]}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:n?`Evaluation will appear here after the first eligible checkpoint is scored.`:`No scored evaluation results are available for this run.`})}function he({input:e,baseOutput:t,trainedOutput:n,baseGrade:r,trainedGrade:i}){let a=[...new Set([...r?.feedback??[],...i?.feedback??[]])];return(0,P.jsxs)(`div`,{className:`training-evaluation-output`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Input`}),(0,P.jsx)(`pre`,{children:JSON.stringify(e,null,2)})]}),t?(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Base output`}),(0,P.jsx)(`pre`,{children:JSON.stringify(t,null,2)})]}):null,n?(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Trained output`}),(0,P.jsx)(`pre`,{children:JSON.stringify(n,null,2)})]}):null,a.length?(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Grader feedback`}),(0,P.jsx)(`p`,{children:a.join(` `)})]}):null]})}function R({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:e}),(0,P.jsx)(`strong`,{children:t})]})}function ge(e){return e==null?`Not recorded`:e.toFixed(3)}function z(e){return e==null?`Not recorded`:`${Math.round(e*100)}%`}function _e(e){return e==null?`Not comparable`:`${e>=0?`+`:``}${e.toFixed(3)}`}function ve(e){return e?.status===`unavailable`?`Unavailable`:e?.score==null?`Not scored`:e.score.toFixed(3)}function ye(e,t){if(!t)return`Not evaluated`;if(t.status===`unavailable`)return`Unavailable`;if(!e||e.score==null||t.score==null)return t.passed?`Passed`:`Failed`;let n=t.score-e.score;return Math.abs(n)<5e-4?`No change`:n>0?`Improved ${n.toFixed(3)}`:`Regressed ${Math.abs(n).toFixed(3)}`}function be({connection:e,lineageId:t,jobId:n,onSaved:r}){let i=n??t,a=n?`jobs`:`models`,[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(0),[u,d]=(0,N.useState)(!0),[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(!1),[g,_]=(0,N.useState)(null),[v,y]=(0,N.useState)(null),[b,ee]=(0,N.useState)(``),[x,S]=(0,N.useState)(null),[te,C]=(0,N.useState)([]),[w,T]=(0,N.useState)(!1);(0,N.useEffect)(()=>{if(!e){d(!1),p(!1),_(`Connect to OpenPond to review this candidate.`);return}let t=!0;return d(!0),p(!1),_(null),C([]),(async()=>{try{if(a===`models`){let n=await A.candidateReview(e,i);t&&n&&s(n)}let n=await A.candidateReview(e,i,!0,a);t&&(s(n),p(!!n))}catch(e){t&&_(xe(e))}finally{t&&d(!1)}})(),()=>{t=!1}},[e,i,a,c]);function ne(e){y(e),ee(``),S(null)}async function E(){if(!e||!o||!v||!b.trim())return;let t=x&&x.reason===b.trim()&&x.decision===v?x:{schemaVersion:`openpond.trainingCandidateDecisionRequest.v1`,...o.target,decision:v,reason:b.trim(),idempotencyKey:crypto.randomUUID(),expectedDecision:o.decision?{id:o.decision.id,contentHash:o.decision.contentHash}:null};S(t),h(!0),_(null);try{s(await A.recordCandidateReview(e,i,t,a)),y(null),S(null),C([]),await r()}catch(e){_(xe(e))}finally{h(!1)}}let D=(te.at(-1)??o?.decision)?.request.expectedDecision;async function re(){if(e&&D){T(!0),_(null);try{let t=await A.candidateReviewHistory(e,i,D,a);C(e=>[...e,t])}catch(e){_(xe(e))}finally{T(!1)}}}let O=o?.decision;return(0,P.jsxs)(`section`,{className:`training-run-evaluation`,"aria-label":`Candidate review`,children:[(0,P.jsx)(`h3`,{children:`Candidate review`}),O?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`strong`,{children:O.request.decision===`accepted`?`Accepted`:`Rejected`}),(0,P.jsx)(`p`,{children:O.request.reason}),(0,P.jsxs)(`p`,{className:`training-muted`,children:[`Review `,O.revision,` · `,new Date(O.decidedAt).toLocaleString()]})]}):(0,P.jsx)(`p`,{className:`training-muted`,children:u?`Loading candidate review…`:o?`No candidate decision recorded.`:`Candidate review unavailable.`}),o?(0,P.jsxs)(`p`,{className:`training-muted`,children:[`Last synced `,new Date(o.syncedAt).toLocaleString(),`. Acceptance keeps this candidate for later use; serving is activated separately.`]}):null,g?(0,P.jsx)(k,{error:g}):null,(0,P.jsxs)(`div`,{className:`training-dialog-actions`,children:[(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:u||m,onClick:()=>l(e=>e+1),children:`Refresh review`}),(0,P.jsx)(`button`,{className:`training-button`,type:`button`,disabled:!f||u||m||O?.request.decision===`accepted`,onClick:()=>ne(`accepted`),children:`Accept candidate`}),(0,P.jsx)(`button`,{className:`training-button danger`,type:`button`,disabled:!f||u||m||O?.request.decision===`rejected`,onClick:()=>ne(`rejected`),children:`Reject candidate`})]}),te.map(e=>(0,P.jsxs)(`details`,{className:`training-evidence`,children:[(0,P.jsxs)(`summary`,{children:[`Review `,e.revision,` · `,e.request.decision]}),(0,P.jsx)(`p`,{children:e.request.reason}),(0,P.jsx)(`p`,{children:new Date(e.decidedAt).toLocaleString()})]},e.id)),D?(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:w||m,onClick:()=>void re(),children:w?`Loading…`:`Earlier review`}):null,v?(0,P.jsx)(`div`,{className:`training-dialog-backdrop`,role:`presentation`,onMouseDown:()=>!m&&y(null),children:(0,P.jsxs)(`section`,{className:`training-dialog training-promotion-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Review candidate`,onMouseDown:e=>e.stopPropagation(),children:[(0,P.jsx)(`div`,{className:`training-dialog-header`,children:(0,P.jsx)(`h2`,{children:v===`accepted`?`Accept this candidate?`:`Reject this candidate?`})}),(0,P.jsx)(`p`,{children:`The adapter and its recorded evaluation remain in the candidate’s history.`}),(0,P.jsxs)(`label`,{className:`training-promotion-reason`,children:[(0,P.jsx)(`span`,{children:`Reason`}),(0,P.jsx)(`textarea`,{autoFocus:!0,maxLength:5e3,value:b,onChange:e=>ee(e.target.value)})]}),g?(0,P.jsx)(k,{error:g}):null,(0,P.jsxs)(`div`,{className:`training-dialog-actions`,children:[(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:m,onClick:()=>y(null),children:`Cancel`}),(0,P.jsx)(`button`,{className:`training-button ${v===`rejected`?`danger`:``}`,type:`button`,disabled:m||!b.trim(),onClick:()=>void E(),children:m?`Saving…`:x?`Retry save`:`Save decision`})]})]})}):null]})}function xe(e){return e instanceof Error?e.message:`Candidate review could not be loaded.`}function Se({connection:e,jobId:t,evaluations:n}){let[r,i]=(0,N.useState)(null),a=n.filter(e=>e.reference),o=a.find(e=>e.reference?.id===r)??a.filter(e=>e.kind===`candidate`).at(-1)??a[0];return!e||!o?.reference?null:(0,P.jsxs)(`section`,{className:`training-run-evaluation`,"aria-label":`Retained evaluation answers`,children:[(0,P.jsxs)(`label`,{className:`training-taskset-selector`,children:[(0,P.jsx)(`span`,{children:`Evaluation answers`}),(0,P.jsx)(`select`,{value:o.reference.id,onChange:e=>i(e.target.value),children:a.map(e=>(0,P.jsxs)(`option`,{value:e.reference.id,children:[e.kind===`baseline`?`Baseline`:`Candidate`,` · policy `,e.policyVersion]},e.reference.id))})]}),(0,P.jsx)(B,{connection:e,jobId:t,evaluation:o.reference},`${t}:${o.reference.id}:${o.reference.contentHash}`)]})}function B({connection:e,jobId:t,evaluation:n}){let[r,i]=(0,N.useState)(),[a,o]=(0,N.useState)([]),[s,c]=(0,N.useState)(null),[l,u]=(0,N.useState)(null),[d,f]=(0,N.useState)(!0),[p,m]=(0,N.useState)(0),{id:h,contentHash:g}=n;return(0,N.useEffect)(()=>{let n=!0;return f(!0),u(null),c(null),A.trainingEvaluationTasks(e,t,{id:h,contentHash:g},r).then(e=>{n&&c(e)}).catch(e=>{n&&u(e instanceof Error?e.message:String(e))}).finally(()=>{n&&f(!1)}),()=>{n=!1}},[e,t,h,g,r,p]),(0,P.jsxs)(`div`,{className:`training-run-evaluation`,"aria-busy":d,children:[d?(0,P.jsx)(`p`,{className:`training-muted`,children:`Loading recorded answers…`}):null,l?(0,P.jsx)(k,{error:l,children:(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,onClick:()=>m(e=>e+1),children:`Retry answers`})}):null,s?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{className:`training-muted`,children:[`Tasks `,s.offset+1,`–`,s.offset+s.tasks.length,` of`,` `,s.total,`. Recorded outputs and scores are retained for this run.`]}),s.tasks.map((e,t)=>(0,P.jsxs)(`details`,{className:`training-evidence`,children:[(0,P.jsxs)(`summary`,{children:[`Example `,s.offset+t+1,` · score `,e.score.toFixed(3)]}),(0,P.jsxs)(`div`,{className:`training-evaluation-output`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Instruction`}),(0,P.jsx)(`pre`,{children:e.input.instruction})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Context`}),(0,P.jsx)(`pre`,{children:JSON.stringify(e.input.context,null,2)})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`span`,{children:`Recorded output`}),(0,P.jsx)(`pre`,{children:e.output})]})]})]},e.taskId))]}):null,(0,P.jsxs)(`div`,{className:`training-dialog-actions`,children:[(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:d||!a.length,onClick:()=>{i(a.at(-1)),o(e=>e.slice(0,-1))},children:`Previous tasks`}),(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,disabled:d||!s?.nextCursor,onClick:()=>{s?.nextCursor&&(o(e=>[...e,r]),i(s.nextCursor))},children:`Next tasks`})]})]})}var V=new Set([`queued`,`starting`,`running`,`cancelling`,`reconciling`]);function Ce(e,t,n,i=!1){let a=[`training-run-detail`,x(e),t,i],o=!!(e&&t),s=r({queryKey:[...a,`retained`],queryFn:({signal:n})=>A.trainingRunDetail(e,t,{includeEvaluation:i,refresh:!1,signal:n}),enabled:o,staleTime:3e4,gcTime:6e4}),c=r({queryKey:[...a,`hosted`],queryFn:({signal:n})=>A.trainingRunDetail(e,t,{includeEvaluation:i,signal:n}),enabled:o,staleTime:3e4,gcTime:6e4,refetchInterval:n&&V.has(n)?3e3:!1,refetchIntervalInBackground:!1}),l=c.data??s.data??null;return{detail:l,loading:o&&!l&&(s.isPending||c.isPending),error:c.error?.message??s.error?.message??null,refresh:async()=>(await c.refetch()).data??null}}function we({title:e,status:t,statusValue:n,versionStatus:r,method:i,baseModel:a,taskset:o,compute:s,duration:c,output:l,reward:u,telemetry:d,evidence:f,configuration:p,children:m,failure:h,onOpenTaskset:g,showHeader:_=!0}){let v=d?.cost.providerReportedUsd??d?.cost.estimatedUsd??f?.cost.totalUsd??null;return(0,P.jsxs)(`div`,{className:`labs-model-run-summary`,children:[_?(0,P.jsx)(`section`,{className:`labs-run-outcome-card`,children:(0,P.jsx)(`header`,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`labs-run-title-row`,children:[(0,P.jsx)(`h2`,{children:e}),(0,P.jsx)(b,{label:t,value:n})]}),(0,P.jsxs)(`p`,{children:[Te(i),` on `,a]})]})})}):null,m,(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:`Run setup`})}),(0,P.jsxs)(`dl`,{className:`labs-run-detail-list`,children:[(0,P.jsx)(H,{label:`Training method`,value:i}),(0,P.jsx)(H,{label:`Base model`,value:a}),(0,P.jsx)(H,{label:`Compute`,value:s}),(0,P.jsx)(H,{label:`Output`,value:l}),r?(0,P.jsx)(H,{label:`Version status`,value:r}):null,(0,P.jsx)(H,{label:`Duration`,value:c}),(0,P.jsx)(H,{label:`Run cost`,value:v===null?`Not reported`:`$${v.toFixed(4)}`}),(0,P.jsx)(H,{label:y(n)?`Latest reward`:`Final reward`,value:u===null?`Not reported`:u.toFixed(4)}),p.map(e=>(0,P.jsx)(H,{label:e.label,value:e.value},e.label)),d||f?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(U,{label:`GPU`,value:W(d,f)}),(0,P.jsx)(U,{label:`Tokens`,value:`${G(d?.usage.promptTokens??f?.usage.inputTokens??null)} prompt · ${G(d?.usage.generatedTokens??f?.usage.outputTokens??null)} generated`}),(0,P.jsx)(U,{label:`Trajectories`,value:`${G(d?.usage.successfulTrajectories??f?.reward.eligibleTrajectoryCount??null)} succeeded · ${G(d?.usage.failedTrajectories??(f?f.reward.trajectoryCount-f.reward.eligibleTrajectoryCount:null))} failed`}),(0,P.jsx)(U,{label:`Optimizer updates`,value:G(d?.usage.optimizerSteps??f?.progress.committedOptimizerSteps??null)}),(0,P.jsx)(U,{label:`GPU time`,value:d?.usage.gpuSeconds==null?`Not reported`:`${d.usage.gpuSeconds.toFixed(1)} seconds`})]}):(0,P.jsx)(H,{label:`Resource usage`,value:`Not retained for this run`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:`Taskset`}),(0,P.jsx)(`dd`,{children:g?(0,P.jsxs)(`button`,{className:`labs-run-taskset-link`,type:`button`,onClick:g,children:[(0,P.jsx)(`span`,{children:o}),(0,P.jsx)(D,{"aria-hidden":`true`,size:14})]}):o})]})]})]}),h?(0,P.jsx)(`p`,{className:`labs-training-error`,children:h}):null]})}function H({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function U({label:e,value:t}){return(0,P.jsx)(H,{label:e,value:t})}function W(e,t){let n=e?.resource.gpuCount??t?.resource.gpuCount??null,r=e?.resource.gpuType??t?.resource.gpuType??null;return n===null&&r===null?`Not reported`:`${n??`Unknown`} × ${r?Ee(r):`Unreported`}`}function G(e){return e===null?`Not reported`:e.toLocaleString()}function Te(e){return e===`RFT`?`Reinforcement fine-tuning`:`${e} training`}function Ee(e){return e.split(` · `).map(e=>e.replaceAll(`_`,` `).replace(/\b[a-z]/g,e=>e.toUpperCase())).join(` · `)}function K({receipt:e,onOpenConversation:t}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:`Inconclusive benchmark`})}),(0,P.jsx)(`p`,{className:`training-run-placeholder`,children:e.reason}),(0,P.jsxs)(`dl`,{className:`labs-run-detail-list`,children:[(0,P.jsx)(X,{label:`Held-out baseline tokens`,value:e.usage.baseline.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Adaptation baseline tokens`,value:e.usage.adaptation.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Refiner tokens`,value:e.usage.refiner.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Grader tokens`,value:e.usage.grader.totalTokens.toLocaleString()}),(0,P.jsx)(X,{label:`Observed / maximum spend`,value:`$${e.budget.observedSpendUsd.toFixed(4)} / $${e.budget.maximumSpendUsd.toFixed(2)}`}),(0,P.jsx)(X,{label:`Harness candidate`,value:e.stopReason===`candidate_harness_unchanged`?`Unchanged`:`Lineage invalid`}),(0,P.jsx)(X,{label:`Completed attempts`,value:e.attempts.length.toLocaleString()}),(0,P.jsx)(X,{label:`Candidate attempts`,value:`Skipped`})]})]}),e.attempts.length?(0,P.jsx)(Y,{receipt:e,onOpenConversation:t}):null]})}function De({run:e}){let t=[`baseline`,`adaptation`,`refiner`,`candidate_adaptation`,`candidate`,`comparison`],n={baseline:`Baseline`,adaptation:`Adaptation`,refiner:`Refiner`,candidate_adaptation:`Sequential adaptation`,candidate:`Candidate`,comparison:`Comparison`},r=Math.max(0,t.indexOf(e.evaluationProgress?.stage??`baseline`)),i=e.evaluationProgress?.completedAttempts??0,a=e.evaluationProgress?.totalAttempts??1;return(0,P.jsxs)(`div`,{className:`labs-benchmark-progress`,children:[(0,P.jsxs)(`header`,{children:[(0,P.jsx)(`h3`,{children:`Benchmark progress`}),(0,P.jsxs)(`strong`,{children:[i,` of `,a,` attempts`]})]}),(0,P.jsx)(`div`,{className:`labs-benchmark-progress-track`,"aria-hidden":`true`,children:(0,P.jsx)(`span`,{style:{width:`${Math.min(100,i/a*100)}%`}})}),(0,P.jsx)(`ol`,{children:t.map((e,t)=>(0,P.jsxs)(`li`,{className:t<r?`complete`:t===r?`active`:void 0,children:[(0,P.jsx)(`span`,{}),n[e]]},e))})]})}function q({receipt:e}){let t=o(e),n=t.pairs.filter(e=>e.cohort===`held_out`),r=t.pairs.filter(e=>e.cohort===`adaptation`),i=e=>e.length?e.reduce((e,t)=>e+t,0)/e.length:0;return(0,P.jsxs)(`div`,{className:`labs-benchmark-attempt-charts`,children:[(0,P.jsx)(J,{title:`Held-out tokens by task`,baseline:n.map(e=>e.baseline.totalTokens),candidate:n.map(e=>e.refined.totalTokens),format:e=>Math.round(e).toLocaleString()}),(0,P.jsx)(J,{title:`Adaptation tokens by task`,baseline:r.map(e=>e.baseline.totalTokens),candidate:r.map(e=>e.refined.totalTokens),format:e=>Math.round(e).toLocaleString()}),(0,P.jsx)(J,{title:`Held-out quality by task`,baseline:n.map(e=>e.baseline.score),candidate:n.map(e=>e.refined.score),format:e=>e.toFixed(2),summarize:i}),(0,P.jsx)(J,{title:`Adaptation quality by task`,baseline:r.map(e=>e.baseline.score),candidate:r.map(e=>e.refined.score),format:e=>e.toFixed(2),summarize:i})]})}function Oe({receipt:e,run:t,tasksetName:n,onOpenTaskset:r}){let i=o(e),a=i.comparedTaskCount>0,s=i.passed,c=i.tokenDeltaPercent===null?`—`:`${i.tokenDeltaPercent>0?`+`:``}${i.tokenDeltaPercent.toFixed(2)}%`,l=e=>{let t=i.cohorts[e];return`${t.passedTaskCount}/${t.comparedTaskCount} passed`};return(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:`Token efficiency`})}),a?(0,P.jsxs)(`div`,{className:`labs-benchmark-efficiency-summary`,children:[(0,P.jsxs)(`strong`,{children:[i.passedTaskCount,` of `,i.comparedTaskCount,` tasks passed`]}),(0,P.jsxs)(`p`,{children:[`A task passes only when its refined token count is strictly lower than its own baseline. `,i.failedTaskCount,` failed this token-efficiency test; aggregate usage changed by `,c,`.`]})]}):(0,P.jsx)(`p`,{className:`training-run-placeholder`,children:`Paired task-level token evidence is unavailable for this run.`}),(0,P.jsxs)(`dl`,{className:`labs-run-detail-list`,children:[(0,P.jsx)(X,{label:`Execution`,value:w(t.status)}),(0,P.jsx)(X,{label:`Token-efficiency result`,value:s?`Passed`:`Failed`}),(0,P.jsx)(X,{label:`Efficiency passes`,value:`${i.passedTaskCount}/${i.comparedTaskCount}`}),(0,P.jsx)(X,{label:`Efficiency failures`,value:`${i.failedTaskCount}/${i.comparedTaskCount}`}),(0,P.jsx)(X,{label:`All-task foreground tokens`,value:`${i.baselineTokens.toLocaleString()} → ${i.refinedTokens.toLocaleString()}`}),(0,P.jsx)(X,{label:`Aggregate token change`,value:c}),(0,P.jsx)(X,{label:`Adaptation replay`,value:l(`adaptation`)}),(0,P.jsx)(X,{label:`Held-out replay`,value:l(`held_out`)}),(0,P.jsx)(X,{label:`Task quality`,value:`${i.baselinePassedCount}/${i.comparedTaskCount} → ${i.refinedPassedCount}/${i.comparedTaskCount}`}),(0,P.jsx)(X,{label:`Result lineage`,value:e.lineage.valid?`Valid`:`Invalid`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:`Taskset`}),(0,P.jsx)(`dd`,{children:r?(0,P.jsx)(`button`,{className:`labs-run-taskset-link`,type:`button`,onClick:r,children:n}):n})]})]})]})}function J({title:e,baseline:t,candidate:n,format:r,summarize:i=e=>e.reduce((e,t)=>e+t,0)}){let a=t.filter(e=>e!==null),o=n.filter(e=>e!==null),s=Math.max(1,...a,...o),c=Math.max(2,t.length,n.length),l=e=>{let t=[],n=[];return e.forEach((e,r)=>{if(e===null){n.length&&t.push(n.join(` `)),n=[];return}let i=6+r/(c-1)*88,a=44-e/s*36;n.push(`${i},${a}`)}),n.length&&t.push(n.join(` `)),t},u=e=>e.flatMap((e,t)=>e===null?[]:[{x:6+t/(c-1)*88,y:44-e/s*36}]);return(0,P.jsxs)(`section`,{className:`labs-benchmark-line-chart`,children:[(0,P.jsxs)(`header`,{children:[(0,P.jsx)(`h4`,{children:e}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`span`,{children:[`Baseline `,r(i(a))]}),(0,P.jsxs)(`span`,{children:[`Refined `,r(i(o))]})]})]}),(0,P.jsxs)(`svg`,{"aria-label":e,role:`img`,viewBox:`0 0 100 50`,preserveAspectRatio:`none`,children:[(0,P.jsx)(`line`,{x1:`6`,x2:`94`,y1:`44`,y2:`44`}),l(t).map((e,t)=>(0,P.jsx)(`polyline`,{className:`baseline`,points:e},`baseline-${t}`)),l(n).map((e,t)=>(0,P.jsx)(`polyline`,{className:`candidate`,points:e},`candidate-${t}`)),u(t).map((e,t)=>(0,P.jsx)(`circle`,{className:`baseline`,cx:e.x,cy:e.y,r:`1`},`baseline-point-${t}`)),u(n).map((e,t)=>(0,P.jsx)(`circle`,{className:`candidate`,cx:e.x,cy:e.y,r:`1`},`candidate-point-${t}`))]})]})}function Y({receipt:e,onOpenConversation:t}){let n=e.schemaVersion===`openpond.modelEvaluationReceipt.v1`?d(e.attempts??[]):e.attempts??[];return(0,P.jsxs)(`section`,{className:`labs-run-summary-card`,children:[(0,P.jsx)(`header`,{children:(0,P.jsx)(`h3`,{children:e.schemaVersion===`openpond.modelEvaluationReceipt.v1`?`Selected task results`:`Completed attempts`})}),(0,P.jsx)(`div`,{className:`training-table-wrap`,children:(0,P.jsxs)(`table`,{className:`training-data-table labs-benchmark-attempt-table`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`Task`}),(0,P.jsx)(`th`,{children:`Phase`}),(0,P.jsx)(`th`,{children:`Result`}),(0,P.jsx)(`th`,{children:`Score`}),(0,P.jsx)(`th`,{children:`Tokens`}),(0,P.jsx)(`th`,{children:`Work chat`})]})}),(0,P.jsx)(`tbody`,{children:n.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:ke(e.taskId)}),(0,P.jsx)(`td`,{children:e.phase}),(0,P.jsx)(`td`,{children:(0,P.jsx)(b,{label:e.passed?`Passed`:`Failed`,value:e.passed?`succeeded`:`failed`})}),(0,P.jsx)(`td`,{children:e.score===null?`—`:e.score.toFixed(2)}),(0,P.jsx)(`td`,{children:e.totalTokens.toLocaleString()}),(0,P.jsx)(`td`,{children:e.sessionId?(0,P.jsx)(`button`,{className:`labs-run-taskset-link`,type:`button`,onClick:()=>t(e.sessionId),children:`Open chat`}):`Not retained`})]},`${e.phase}:${e.attemptId}`))})]})})]})}function ke(e){return e.replace(/^(?:adaptation|frozen)-/,``).replaceAll(`-`,` `).replace(/^./,e=>e.toUpperCase())}function X({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function Ae(e){let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(r===0?0:2)} ${t[r]}`}function je({error:e,events:t,loading:n,pending:r}){let[i,a]=(0,N.useState)(!1),[o,s]=(0,N.useState)({}),[c,l]=(0,N.useState)(!0),u=(0,N.useRef)(null),d=(0,N.useRef)(null),f=(0,N.useRef)(null),p=(0,N.useMemo)(()=>Me(t),[t]),m=(0,N.useMemo)(()=>t.filter(e=>o[Z(e)]??Ne(Z(e))),[t,o]),h=p.filter(e=>o[e.id]??Ne(e.id)).length,g=p.length>0&&h===p.length,_=h>0&&!g;return(0,N.useEffect)(()=>{f.current&&(f.current.indeterminate=_)},[_]),(0,N.useEffect)(()=>{if(!i)return;let e=e=>{d.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]),(0,N.useLayoutEffect)(()=>{let e=u.current;e&&c&&(e.scrollTop=e.scrollHeight)},[e,c,r,m]),n&&!t.length?(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`Loading run events…`}):t.length?(0,P.jsxs)(`div`,{className:`training-event-log-shell`,children:[(0,P.jsxs)(`div`,{className:`training-event-log-toolbar`,children:[(0,P.jsx)(`div`,{children:(0,P.jsx)(`strong`,{children:`Activity log`})}),(0,P.jsxs)(`div`,{className:`training-event-filter`,ref:d,children:[(0,P.jsxs)(`button`,{"aria-expanded":i,"aria-haspopup":`menu`,className:`training-event-filter-trigger`,type:`button`,onClick:()=>a(e=>!e),children:[(0,P.jsx)(ie,{"aria-hidden":`true`,size:14}),`Event types`,(0,P.jsxs)(`span`,{children:[h,`/`,p.length]}),(0,P.jsx)(E,{"aria-hidden":`true`,size:13})]}),i?(0,P.jsxs)(`div`,{"aria-label":`Filter training activity by event type`,className:`training-event-filter-menu`,role:`menu`,children:[(0,P.jsxs)(`label`,{className:`training-event-filter-option select-all`,children:[(0,P.jsx)(`input`,{checked:g,ref:f,type:`checkbox`,onChange:e=>{let t=e.currentTarget.checked;s(Object.fromEntries(p.map(e=>[e.id,t])))}}),(0,P.jsx)(`span`,{className:`training-event-filter-check`,children:(0,P.jsx)(j,{"aria-hidden":`true`,size:12})}),`Select all`]}),(0,P.jsx)(`div`,{className:`training-event-filter-options`,children:p.map(e=>{let t=o[e.id]??Ne(e.id);return(0,P.jsxs)(`label`,{className:`training-event-filter-option`,children:[(0,P.jsx)(`input`,{checked:t,type:`checkbox`,onChange:t=>s(n=>({...n,[e.id]:t.currentTarget.checked}))}),(0,P.jsx)(`span`,{className:`training-event-filter-check`,children:(0,P.jsx)(j,{"aria-hidden":`true`,size:12})}),(0,P.jsx)(`span`,{children:e.label}),(0,P.jsx)(`small`,{children:e.count.toLocaleString()})]},e.id)})})]}):null]})]}),(0,P.jsxs)(`div`,{"aria-label":`Training activity log`,"aria-live":`polite`,className:`training-event-log`,ref:u,role:`log`,onScroll:e=>{let t=e.currentTarget,n=t.scrollHeight-t.scrollTop-t.clientHeight;l(n<=6)},children:[(0,P.jsxs)(`div`,{"aria-hidden":`true`,className:`training-event-log-header`,children:[(0,P.jsx)(`span`,{children:`Time`}),(0,P.jsx)(`span`,{children:`Event type`}),(0,P.jsx)(`span`,{children:`Details`})]}),m.map(e=>(0,P.jsxs)(`div`,{className:`training-event-log-line ${e.type}`,children:[(0,P.jsx)(`time`,{dateTime:e.timestamp,children:C(e.timestamp)}),(0,P.jsx)(`span`,{children:Pe(Z(e))}),(0,P.jsx)(`code`,{children:Fe(e)})]},e.id)),r&&!e?(0,P.jsxs)(`div`,{className:`training-event-log-loading`,role:`status`,children:[(0,P.jsx)(re,{"aria-hidden":`true`,className:`spin`,size:14}),(0,P.jsx)(`span`,{className:`sr-only`,children:`Waiting for new activity`})]}):null,m.length?null:(0,P.jsx)(`div`,{className:`training-event-log-empty`,children:`No events match the selected event types.`}),e?(0,P.jsxs)(`div`,{className:`training-event-log-line failure`,children:[(0,P.jsx)(`time`,{children:`—`}),(0,P.jsx)(`span`,{children:`Failure`}),(0,P.jsx)(`code`,{children:e})]}):null]})]}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:e??`No normalized run events were recorded.`})}function Z(e){return typeof e.payload.remoteEventType==`string`&&e.payload.remoteEventType.trim()?e.payload.remoteEventType:typeof e.payload.telemetryType==`string`&&e.payload.telemetryType.trim()?e.payload.telemetryType:e.type}function Me(e){let t=new Map;for(let n of e){let e=Z(n);t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({id:e,count:t,label:Pe(e)})).sort((e,t)=>e.label.localeCompare(t.label))}function Ne(e){return e!==`metric`&&!e.endsWith(`_metric`)}function Pe(e){return e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}function Fe(e){let t=e.payload,n=ze(t.step),r=ze(t.maxSteps);if(typeof t.telemetryType==`string`){let e=typeof t.message==`string`?t.message:null,r=typeof t.errorCode==`string`?t.errorCode:null,i=typeof t.telemetrySource==`string`?` · ${t.telemetrySource}`:``;return`${e??t.telemetryType.replaceAll(`_`,` `)}${n==null?``:` · step ${n}`}${i}${r?` · ${r}`:``}`}if(typeof t.remoteEventType==`string`){let e=Ie(t.remoteEventType),r=typeof t.remotePhase==`string`?Le(t.remotePhase):null,i=typeof t.errorCode==`string`&&t.errorCode.trim()?t.errorCode.trim():null;return[e,r,n==null?null:`step ${n}`,i?`error ${i}`:null].filter(e=>!!e).join(` · `)}if(e.type===`start`)return typeof t.device==`string`?`Worker started on ${t.device}.`:`Worker started.`;if(e.type===`progress`&&n!=null)return r==null?`Step ${n}.`:`Step ${n} of ${r}.`;if(e.type===`metric`){let e=typeof t.metricKind==`string`?t.metricKind.replaceAll(`_`,` `):`metric`,r=[Q(`loss`,t.loss),Q(`reward`,t.meanReward??t.reward),Q(`policy loss`,t.policyLoss),Q(`value loss`,t.valueLoss),Q(`preference accuracy`,t.preferenceAccuracy,Be)].filter(e=>!!e),i=typeof t.failureClass==`string`?t.failureClass:null,a=typeof t.failureCode==`string`?t.failureCode:null,o=typeof t.metricId==`string`&&typeof t.value==`number`?` · ${t.metricId}: ${t.value.toPrecision(4)}`:``;return`${e}${n==null?``:` · step ${n}`}${o}${i?` · ${i}`:``}${a?` · ${a}`:``}${r.length?` · ${r.join(` · `)}`:``}`}if(e.type===`checkpoint`){let e=ze(t.policyVersion),n=ze(t.sizeBytes),r=[e==null?null:`policy ${e}`,n==null?null:Ae(n),t.final===!0?`final`:null].filter(e=>!!e);return r.length?`Checkpoint committed · ${r.join(` · `)}.`:`Checkpoint committed.`}if(e.type===`complete`){let e=ze(t.artifactCount);return e==null?`Worker completed.`:`Worker completed with ${e} artifacts.`}return e.type===`failure`&&typeof t.message==`string`?t.message:Object.keys(t).length?JSON.stringify(t):`Recorded.`}function Ie(e){return{drain:`Rollout drain`,infer:`Model inference`,materialize_checkpoint:`Checkpoint materialization`,optimizer_metric:`Optimizer metric`,provision_gpu:`GPU provisioning`,rollout_metric:`Rollout trajectory`,score_reward_model:`Reward scoring`,start_inference:`Policy server`,train_step:`Optimizer update`,upload_checkpoint:`Checkpoint upload`}[e]??Re(e)}function Le(e){return{committed:`committed`,completed:`completed`,eligible:`recorded`,failed:`failed`,running:`running`,succeeded:`succeeded`}[e]??Re(e).toLocaleLowerCase()}function Re(e){return e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}function Q(e,t,n=e=>new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(e)){let r=ze(t);return r==null?null:`${e} ${n(r)}`}function ze(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Be(e){return`${(e*100).toFixed(1)}%`}function Ve({connection:e,detailTab:t,onDetailTabChange:n,selectedEntryKey:r,workproduct:o,runs:d,training:f,onOpenDataset:b,onOpenConversation:x,detailKind:C}){let E=f.payload,[D,re]=(0,N.useState)(null),k=(0,N.useMemo)(()=>l(o,d,E),[d,E,o]),A=(0,N.useMemo)(()=>h(o,d,E),[d,E,o]),j=(0,N.useMemo)(()=>m(o,E),[E,o]),ie=(0,N.useMemo)(()=>u(o,d,E),[d,E,o]),se=(0,N.useMemo)(()=>new Map(ie.map(e=>[e.id,e])),[ie]),M=(0,N.useMemo)(()=>s(k,A),[k,A]).find(e=>e.key===r)??null,F=r.startsWith(`model-run:`)?r.slice(10):null,I=F?j.find(e=>e.id===F)??null:M?.job?j.find(e=>e.id===M.job?.metadata.modelRunId)??null:null,L=M?.job??(I?E?.jobs.find(e=>e.id===I.id||e.metadata.modelRunId===I.id)??null:null),pe=E?.comparisonSeriesEntries.find(e=>e.modelRunId===I?.id||e.modelRunId===L?.metadata.modelRunId)??null,he=a.shape.recovery.safeParse(L?.metadata.hostedRecovery),R=he.success?he.data:void 0,ge=O.shape.continuation.safeParse(L?.metadata.hostedContinuation),z=ge.success?ge.data:void 0,_e=z?A.find(e=>e.lineage.jobId===z.sourceArtifact.jobId):void 0,ve=R?`Recovered checkpoint`:_e?`Version ${_e.number}`:z?`Checkpoint ${z.sourceArtifact.checkpointId}`:typeof L?.metadata.parentHostedArtifactId==`string`?`Prior hosted run`:ue(E,pe),ye=(0,N.useMemo)(()=>{let e=v(k,A,j);return p(e,I?.kind===`evaluation`?`evals`:`training`)},[k,j,I?.kind,A]),xe=ye.findIndex(e=>e.key===r||L!==null&&e.job?.id===L.id||I!==null&&e.lifecycleRun?.id===I.id),B=xe<0?null:ye.length-xe,V=M?.version??(I?.adapterArtifactLineageId?A.find(e=>e.lineage.id===I.adapterArtifactLineageId)??null:null),H=(I?E?.modelVersions.find(e=>e.id===I.modelVersionId)?.baseModel.modelId:null)??E?.modelVersions.filter(e=>e.modelId===o.id&&e.kind===`base_reference`).sort((e,t)=>t.version-e.version)[0]?.baseModel.modelId??(typeof L?.metadata.baseModelId==`string`?L.metadata.baseModelId:null),U=V?.lineage.frozenEvaluationArtifactId??null,W=V?.plan??(L?se.get(L.planId)??null:null),G=V?.taskset??_(E).find(e=>e.id===(I?.taskset.id??W?.tasksetId??L?.metadata.tasksetId))??null,Te=G?.name??(typeof L?.metadata.tasksetId==`string`?L.metadata.tasksetId:`Unavailable`),Ee=I?.method??W?.recipe.method??Ke(L?.metadata),K=Ce(e,L?.id??null,L?.status??null,t===`evaluation`),De=L?E?.rolloutReceipts.filter(e=>e.jobId===L.id)??[]:[],q=K.detail?.managedEvidence??null,Oe=K.detail?.events.some(e=>e.type===`metric`&&e.payload.metricKind===`rollout_trajectory`)??!1,J=c({lifecycleRun:I,job:K.detail?.job??L}),Y=y(J),ke=I?.status===`failed`&&L?.metadata.phase===`artifact_collection_failed`,X=Ee===`grpo`,Z=Ue(L?.metadata),Me=(W&&(W.recipe.method===`sft`||W.recipe.method===`dpo`||W.recipe.method===`grpo`)?W.recipe.optimizer.maxSteps:null)??q?.progress.targetOptimizerSteps??null,Ne=Me!==null&&typeof L?.metadata.progress==`number`&&Number.isFinite(L.metadata.progress)?Math.floor(Math.max(0,L.metadata.progress)*Me):0,Pe=Math.max(0,Z?.optimizerUpdatesApplied??0,Ne,K.detail?.policyMetrics.reduce((e,t)=>Math.max(e,t.step),0)??0,K.detail?.stepMetrics.reduce((e,t)=>Math.max(e,t.step),0)??0,q?.progress.committedOptimizerSteps??0),Fe=He(X&&Z?Z.groupsCompleted:Pe,X&&Z?Z.groupsTarget:Me),Ie=C===`run`?{id:`details`,label:`Details`}:{id:`overview`,label:`Overview`},Le=[...C===`run`&&L?[{id:`metrics`,label:`Metrics`}]:[],Ie,...C===`version`&&L?[{id:`metrics`,label:`Metrics`}]:[],{id:`evaluation`,label:`Evaluation`},...De.length||Oe?[{id:`rollouts`,label:`Rollouts`}]:[],{id:`artifacts`,label:`Artifacts`},...L?[{id:`activity`,label:`Activity`}]:[]],Re=t,Q=Le.some(e=>e.id===Re)?Re:Le[0].id;return!M&&!I&&f.loading?(0,P.jsxs)(`div`,{className:`labs-model-version-detail`,children:[(0,P.jsx)(ae,{title:`Run details`}),(0,P.jsx)(`p`,{role:`status`,children:`Loading training run…`})]}):!M&&!I?(0,P.jsx)(`div`,{className:`labs-model-version-detail`,children:(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`This training attempt is no longer available.`})}):I?.kind===`evaluation`?(0,P.jsx)(We,{run:I,runNumber:B,tasksetName:G?.name??`Unavailable`,onOpenTaskset:G?()=>b(G.id):void 0,onOpenConversation:x}):(0,P.jsxs)(`div`,{className:`labs-model-version-detail`,children:[(0,P.jsx)(ae,{title:I||L?B?`Run ${B}`:`Run details`:V?`Version ${V.number}`:`Run details`,description:`${te(Ee)} on ${Ge(W,H)}`,status:(0,P.jsx)(g,{status:J}),actions:Y&&(I||L)?(0,P.jsx)(`button`,{type:`button`,className:`training-button secondary`,disabled:f.busyAction!==null||J===`cancelling`,onClick:async()=>{let e=I?.id??L.id,t=I?await f.actions.cancelModelRun(I.id):await f.actions.cancelJob(L.id);re({runId:e,message:t?`Cancellation requested. Waiting for the training service to confirm.`:`Cancellation could not be requested. Try again.`})},children:J===`cancelling`?`Cancelling…`:f.busyAction===`cancel-model-run`||f.busyAction===`cancel-job`?`Requesting cancellation…`:`Cancel run`}):ke&&I?(0,P.jsx)(`button`,{type:`button`,className:`training-button secondary`,disabled:f.busyAction!==null,onClick:async()=>{let e=await f.actions.retryModelRunCollection(I.id);re({runId:I.id,message:e?.state===`succeeded`?`Outputs collected from the completed training job.`:`Collection failed. The training job and its outputs are retained.`})},children:f.busyAction===`retry-model-run-collection`?`Collecting…`:`Retry collection`}):void 0,metrics:[{label:X&&Z?`Training groups`:`Training steps`,value:Fe.value},...R&&Z?[{label:`Optimizer updates`,value:`${Math.max(0,Z.optimizerUpdatesApplied-R.policyVersion)} new · ${R.policyVersion} reused`}]:[],{label:Y?`Latest reward`:`Final reward`,value:Je(I?.reward?.raw??q?.reward.finalMean??null)},{label:`Duration`,value:I?T(I.startedAt,S(I.status,I.completedAt,I.updatedAt)):L?T(L.startedAt,S(L.status,L.completedAt,L.updatedAt)):`Not recorded`},{label:`Output`,value:V?`Version ${V.number}`:`No version`},{label:`Based on`,value:ve},{label:`Taskset`,value:Te,onSelect:G?()=>b(G.id):void 0,ariaLabel:G?`Open Taskset ${G.name}`:void 0}]}),(0,P.jsx)(ee,{recovery:R}),z?(0,P.jsx)(i,{continuation:{sourceJobId:z.sourceArtifact.jobId,checkpointId:z.sourceArtifact.checkpointId}}):null,D&&D.runId===(I?.id??L?.id)?(0,P.jsx)(`p`,{role:`status`,children:D.message}):null,(0,P.jsxs)(`section`,{className:`labs-run-detail-tabs`,children:[(0,P.jsx)(`div`,{className:`training-detail-tabs`,role:`tablist`,"aria-label":`Run details`,children:Le.map(e=>(0,P.jsx)(`button`,{"aria-controls":`run-detail-panel-${e.id}`,"aria-selected":Q===e.id,className:Q===e.id?`active`:void 0,id:`run-detail-tab-${e.id}`,role:`tab`,type:`button`,onClick:()=>n(e.id),children:e.label},e.id))}),(0,P.jsxs)(`div`,{"aria-labelledby":`run-detail-tab-${Q}`,className:`labs-run-detail-tab-panel`,id:`run-detail-panel-${Q}`,role:`tabpanel`,children:[Q===Ie.id?(0,P.jsx)(we,{baseModel:Ge(W,H),compute:I?ne(I.destinationId??``):W?ne(W.destinationId):L?ne(L.destinationId):`Not recorded`,duration:I?T(I.startedAt,S(I.status,I.completedAt,I.updatedAt)):L?T(L.startedAt,S(L.status,L.completedAt,L.updatedAt)):`Not recorded`,failure:L?.error??I?.failure??null,configuration:[...z?[{label:`Starting checkpoint`,value:[_e?`Version ${_e.number}`:null,z.sourceArtifact.checkpointId].filter(Boolean).join(` · `)},{label:`Parent run`,value:z.sourceArtifact.jobId},{label:`Parent artifact`,value:z.sourceArtifact.artifactId},{label:`Optimizer`,value:z.optimizerMode===`reset`?`Reset`:`Continue`}]:le(E,pe),...ce(W)],evidence:q,method:te(Ee),output:V?`Version ${V.number}`:`No version created`,reward:I?.reward?.raw??q?.reward.finalMean??null,status:I?w(I.status):L?w(L.status):`Imported`,statusValue:I?.status??L?.status??`imported`,taskset:Te,telemetry:I?.receipt?.schemaVersion===`openpond.modelRunReceipt.v1`?I.receipt.telemetry:null,title:I||L?B?`Run ${B}`:`Run details`:V?`Version ${V.number}`:`Run details`,versionStatus:V?V.current?`Active`:`Available`:null,onOpenTaskset:G?()=>b(G.id):void 0,showHeader:!1}):null,Q===`metrics`&&L?(0,P.jsx)(oe,{detail:K.detail,error:K.error,loading:K.loading,taskset:G}):null,Q===`artifacts`?(0,P.jsxs)(`dl`,{className:`training-configuration-list`,children:[(0,P.jsx)($,{label:`Training attempt`,value:L?.id??`Provider import`}),(0,P.jsx)($,{label:`Taskset`,value:Te}),(0,P.jsx)($,{label:`Prepared data`,value:L?.bundleHash??`Provider managed`}),(0,P.jsx)($,{label:`Version ID`,value:V?.lineage.id??`No version created`}),q?.checkpoint?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)($,{label:`Checkpoint`,value:q.checkpoint.id}),(0,P.jsx)($,{label:`Checkpoint size`,value:q.checkpoint.sizeBytes==null?`Not reported`:Ae(q.checkpoint.sizeBytes)}),(0,P.jsx)($,{label:`Checkpoint hash`,value:q.checkpoint.sha256??`Not reported`})]}):null,q?.canonicalPublication.state?(0,P.jsx)($,{label:`Registry publication`,value:Ye(q.canonicalPublication.state)}):null]}):null,Q===`evaluation`?(0,P.jsxs)(`div`,{className:`training-run-evaluation`,children:[!q?.evaluations.length||K.detail?.evaluation?(0,P.jsx)(me,{detail:K.detail,loading:K.loading,pending:Y}):null,!K.detail?.evaluation&&q?.evaluations.length?(0,P.jsx)(`dl`,{className:`labs-inline-facts`,children:q.evaluations.map(e=>(0,P.jsxs)(N.Fragment,{children:[(0,P.jsx)($,{label:e.kind===`baseline`?`Baseline score`:`Candidate score`,value:e.score==null?`Not reported`:e.score.toFixed(6)}),(0,P.jsx)($,{label:e.kind===`baseline`?`Baseline coverage`:`Candidate coverage`,value:e.taskCount==null?`Not reported`:e.targetTaskCount==null?`${e.taskCount} ${e.taskCount===1?`task`:`tasks`} scored`:`${e.taskCount} of ${e.targetTaskCount} ${e.targetTaskCount===1?`task`:`tasks`} scored`})]},`${e.kind}:${e.policyVersion}`))}):null,V&&L?.destinationId===`openpond_managed`?(0,P.jsx)(be,{connection:e,lineageId:V.lineage.id,onSaved:f.refresh},V.lineage.id):null,!V&&L?.metadata.source===`hosted_model_project_import`&&L.status===`succeeded`?(0,P.jsx)(be,{connection:e,jobId:L.id,onSaved:f.refresh},`candidate:${L.id}`):null,L&&q?.evaluations.length?(0,P.jsx)(Se,{connection:e,jobId:L.id,evaluations:q.evaluations},L.id):null,U?(0,P.jsx)(`button`,{className:`training-button secondary`,type:`button`,onClick:()=>void f.actions.downloadArtifact(U),children:`Download evaluation receipt`}):null]}):null,Q===`rollouts`?De.length?(0,P.jsx)(fe,{receipts:De}):(0,P.jsx)(de,{events:K.detail?.events??[]}):null,Q===`activity`&&L?(0,P.jsx)(je,{error:L.error??K.error,events:K.detail?.events??[],loading:K.loading,pending:Y}):null]})]})]})}function He(e,t){let n=Math.max(0,Math.floor(e));if(t===null||!Number.isFinite(t)||t<=0)return{value:n.toLocaleString(),hint:n===1?`completed update`:`completed updates`};let r=Math.max(1,Math.floor(t));return{value:`${n.toLocaleString()} / ${r.toLocaleString()}`,hint:`completed / planned`}}function Ue(e){let t=e?.rolloutProgress;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;return[`groupsCompleted`,`groupsTarget`,`optimizerUpdatesApplied`,`optimizerUpdatesSkipped`].some(e=>typeof n[e]!=`number`||!Number.isInteger(n[e])||n[e]<0)?null:{groupsCompleted:n.groupsCompleted,groupsTarget:n.groupsTarget,optimizerUpdatesApplied:n.optimizerUpdatesApplied,optimizerUpdatesSkipped:n.optimizerUpdatesSkipped}}function We({run:e,runNumber:t,tasksetName:n,onOpenTaskset:r,onOpenConversation:i}){let[a,s]=(0,N.useState)(`results`),c=e.receipt?.schemaVersion===`openpond.modelEvaluationReceipt.v1`?e.receipt:null,l=e.receipt?.schemaVersion===`openpond.modelEvaluationStopReceipt.v1`?e.receipt:null,u=c?f(c):null,d=c?o(c):null;return(0,P.jsxs)(`div`,{className:`labs-model-version-detail labs-model-evaluation-detail`,children:[(0,P.jsx)(ae,{title:t?`Eval ${t}`:`Evaluation run`,description:`Harness Refiner benchmark · ${n}`,status:(0,P.jsx)(b,{label:c?d?.comparedTaskCount?`${d.passedTaskCount}/${d.comparedTaskCount} passed`:`No paired result`:l?`Inconclusive`:w(e.status),value:c?d?.comparedTaskCount&&d.passed?`succeeded`:`neutral`:l?.terminalClassification??e.status}),metrics:[{label:`Baseline pass rate`,value:c?`${(c.quality.baselinePassRate*100).toFixed(1)}%`:`—`},{label:`Candidate pass rate`,value:c?`${(c.quality.candidatePassRate*100).toFixed(1)}%`:`—`},{label:`Scenarios`,value:c?.attempts?.length??0},{label:`Execution`,value:w(e.status)}]}),(0,P.jsx)(`div`,{className:`training-detail-tabs`,role:`tablist`,"aria-label":`Evaluation details`,children:[`results`,`scenarios`,`activity`].map(e=>(0,P.jsx)(`button`,{className:a===e?`active`:void 0,"aria-selected":a===e,role:`tab`,type:`button`,onClick:()=>s(e),children:e===`results`?`Results`:e===`scenarios`?`Scenarios`:`Activity`},e))}),a===`results`&&c?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(se,{series:[{id:`baseline`,label:`Held-out baseline`,inputTokens:u.baseline.inputTokens,outputTokens:u.baseline.outputTokens,tokens:u.baseline.totalTokens,passRate:c.quality.baselinePassRate,costUsd:u.baseline.costUsd},{id:`candidate`,label:`Held-out refined`,inputTokens:u.candidate.inputTokens,outputTokens:u.candidate.outputTokens,tokens:u.candidate.totalTokens,passRate:c.quality.candidatePassRate,costUsd:u.candidate.costUsd}]}),(0,P.jsx)(se,{series:[{id:`adaptation-baseline`,label:`Adaptation baseline`,inputTokens:u.adaptation.inputTokens,outputTokens:u.adaptation.outputTokens,tokens:u.adaptation.totalTokens,passRate:c.quality.adaptationBaselinePassRate,costUsd:u.adaptation.costUsd},{id:`adaptation-candidate`,label:`Adaptation replay`,inputTokens:u.candidate_adaptation.inputTokens,outputTokens:u.candidate_adaptation.outputTokens,tokens:u.candidate_adaptation.totalTokens,passRate:c.quality.adaptationCandidatePassRate,costUsd:u.candidate_adaptation.costUsd}]}),(0,P.jsx)(Oe,{receipt:c,run:e,tasksetName:n,onOpenTaskset:r})]}):a===`results`&&l?(0,P.jsx)(K,{receipt:l,onOpenConversation:i}):a===`results`?(0,P.jsx)(`section`,{className:`labs-run-summary-card`,children:e.failure?(0,P.jsx)(`p`,{className:`training-run-placeholder`,children:e.failure}):(0,P.jsx)(De,{run:e})}):null,a===`scenarios`&&c?(0,P.jsxs)(P.Fragment,{children:[(c.attempts??[]).length?(0,P.jsx)(q,{receipt:c}):null,(c.attempts??[]).length?(0,P.jsx)(Y,{receipt:c,onOpenConversation:i}):(0,P.jsx)(`div`,{className:`training-run-placeholder`,children:`No per-scenario attempts were retained.`})]}):null,a===`activity`?(0,P.jsxs)(`dl`,{className:`labs-inline-facts`,children:[(0,P.jsx)($,{label:`Run ID`,value:e.id}),(0,P.jsx)($,{label:`Status`,value:w(e.status)}),(0,P.jsx)($,{label:`Started`,value:e.startedAt?C(e.startedAt):`Not started`}),(0,P.jsx)($,{label:`Completed`,value:e.completedAt?C(e.completedAt):`In progress`})]}):null]})}function Ge(e,t=null){if(!e)return t?qe(t):`Not recorded`;let n=e.recipe.method===`sft`||e.recipe.method===`grpo`?e.recipe.baseModel:e.recipe.method===`dpo`?e.recipe.policyModel:e.recipe.method===`ppo`?e.recipe.policyOptimization.policyModel:null;return n?qe(n.id):`Not recorded`}function Ke(e){let t=e?.trainingMethod;return t===`sft`||t===`dpo`||t===`grpo`||t===`ppo`||t===`sdft`||t===`opd`||t===`opsd`||t===`sdpo`?t:null}function qe(e){return e.split(`/`).at(-1)??e}function Je(e){return e===null?`Not reported`:e.toFixed(4)}function $({label:e,value:t}){return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function Ye(e){return e?e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()):`Pending`}export{Ve as LabModelVersionDetailPage,Fe as eventSummary,He as formatTrainingProgress,Ue as managedRolloutProgress};