openpond 0.2.73 → 0.2.75
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.
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-35QBGOMJ.js → acp-HGJMC75K.js} +1 -1
- package/dist/chunks/{acp-agent-4PKMX52I.js → acp-agent-CWV5NF6V.js} +1 -1
- package/dist/chunks/{app-layer-42ZKHTPN.js → app-layer-76YRQY7S.js} +1 -1
- package/dist/chunks/{app-server-evaluations-5JVNCET7.js → app-server-evaluations-PQDIMJJ7.js} +1 -1
- package/dist/chunks/{app-server-harness-services-4E236TXE.js → app-server-harness-services-5MB7CCCT.js} +1 -1
- package/dist/chunks/{app-server-runtime-CI2NTKX7.js → app-server-runtime-N3XZV35H.js} +1 -1
- package/dist/chunks/{apps-EGFRTFAJ.js → apps-DJQ2ZJKC.js} +1 -1
- package/dist/chunks/{chunk-QKGNAYSC.js → chunk-2HWSF4FS.js} +1 -1
- package/dist/chunks/{chunk-KQ7RFPG5.js → chunk-3SIZBCEO.js} +1 -1
- package/dist/chunks/{chunk-TP222CV2.js → chunk-5SBKDKGI.js} +1 -1
- package/dist/chunks/{chunk-U73T66FP.js → chunk-5VHHQZMT.js} +1 -1
- package/dist/chunks/{chunk-NDNSLCPE.js → chunk-5W2OJKJW.js} +1 -1
- package/dist/chunks/{chunk-XSDWRRZP.js → chunk-6EZHEVXS.js} +1 -1
- package/dist/chunks/{chunk-YIZE3M5S.js → chunk-7NLKMY7L.js} +1 -1
- package/dist/chunks/{chunk-MHSSPMLB.js → chunk-B7ELZHQN.js} +1 -1
- package/dist/chunks/{chunk-KE5PYRJ6.js → chunk-BZPNCSUY.js} +1 -1
- package/dist/chunks/{chunk-IXMY4EKS.js → chunk-CABXOJ3I.js} +1 -1
- package/dist/chunks/{chunk-E7SQBMYW.js → chunk-CBJ33EIB.js} +1 -1
- package/dist/chunks/{chunk-2IIVBBF5.js → chunk-CILYQK2G.js} +1 -1
- package/dist/chunks/{chunk-OBMMO5NC.js → chunk-CNVPZKJG.js} +3 -3
- package/dist/chunks/{chunk-4KG7GJ5O.js → chunk-CZ2JSEUK.js} +1 -1
- package/dist/chunks/{chunk-H5EHSILL.js → chunk-D2PEB6AJ.js} +1 -1
- package/dist/chunks/{chunk-FRQYH4QD.js → chunk-DAWHZU7L.js} +1 -1
- package/dist/chunks/{chunk-WOYBWRRV.js → chunk-DVBZBJSK.js} +1 -1
- package/dist/chunks/{chunk-MXDSB2C5.js → chunk-EOQTBH4U.js} +1 -1
- package/dist/chunks/{chunk-P7RLDDPN.js → chunk-FPW3RFZR.js} +1 -1
- package/dist/chunks/{chunk-WAWVFSIQ.js → chunk-FWYJ3MIN.js} +1 -1
- package/dist/chunks/{chunk-5VQK3CCJ.js → chunk-FXLLAAGI.js} +1 -1
- package/dist/chunks/{chunk-ODH5XGE6.js → chunk-HCQTAFTX.js} +1 -1
- package/dist/chunks/{chunk-FCC24XUI.js → chunk-HHLQG7PN.js} +1 -1
- package/dist/chunks/{chunk-TRXOE7TT.js → chunk-HRJ4EPR3.js} +1 -1
- package/dist/chunks/{chunk-O6L4NO3M.js → chunk-HYYQCBX5.js} +1 -1
- package/dist/chunks/{chunk-OFC5N6R3.js → chunk-IPH4LGK2.js} +6 -6
- package/dist/chunks/{chunk-3XNUG4FO.js → chunk-JBIAEQHI.js} +1 -1
- package/dist/chunks/{chunk-XN5BXPAT.js → chunk-JQDZYC72.js} +1 -1
- package/dist/chunks/{chunk-3BIB6KKL.js → chunk-JRW6MFV6.js} +1 -1
- package/dist/chunks/{chunk-EAW5FHU4.js → chunk-JSJB3PR2.js} +2 -2
- package/dist/chunks/{chunk-O4YHISU2.js → chunk-KAW26NGC.js} +1 -1
- package/dist/chunks/{chunk-HIPKU57Y.js → chunk-LK7TJYEP.js} +1 -1
- package/dist/chunks/{chunk-2IECLXB2.js → chunk-LRGMGXL2.js} +1 -1
- package/dist/chunks/{chunk-G2P2PYEO.js → chunk-NACSY3HS.js} +1 -1
- package/dist/chunks/{chunk-E5HDJCKK.js → chunk-NGTNI3YX.js} +1 -1
- package/dist/chunks/{chunk-ONR2AKRI.js → chunk-O5FYAVDK.js} +4 -4
- package/dist/chunks/{chunk-LWF5MQJ4.js → chunk-OJEIYU7D.js} +1 -1
- package/dist/chunks/{chunk-AWUSAHXG.js → chunk-OOSF2SPF.js} +1 -1
- package/dist/chunks/{chunk-JG6JA7YT.js → chunk-P4SXDU55.js} +1 -1
- package/dist/chunks/{chunk-DUR32LJG.js → chunk-PQGR2MTX.js} +1 -1
- package/dist/chunks/{chunk-6IKIGVJF.js → chunk-QSITPC3X.js} +1 -1
- package/dist/chunks/chunk-RGSMU6N4.js +2 -0
- package/dist/chunks/{chunk-CBD554GZ.js → chunk-RORT6K3Y.js} +1 -1
- package/dist/chunks/{chunk-OXUS4QOT.js → chunk-SFLL3TKE.js} +1 -1
- package/dist/chunks/chunk-SYFJVLEL.js +2 -0
- package/dist/chunks/{chunk-6KKWSUEW.js → chunk-THLBUON5.js} +1 -1
- package/dist/chunks/{chunk-X4CN3FIN.js → chunk-VU6S2S3O.js} +1 -1
- package/dist/chunks/{chunk-H2YQ4AA2.js → chunk-W5FL7EH2.js} +1 -1
- package/dist/chunks/{chunk-WBV6A6NS.js → chunk-WHI4XNBI.js} +1 -1
- package/dist/chunks/{chunk-FA3GXQYA.js → chunk-WOA6XFQU.js} +1 -1
- package/dist/chunks/{chunk-SUILNZQJ.js → chunk-WOER246B.js} +1 -1
- package/dist/chunks/{chunk-645T6LH7.js → chunk-XJP7RIHL.js} +1 -1
- package/dist/chunks/{chunk-KOLVSUOS.js → chunk-Z3OW37CO.js} +1 -1
- package/dist/chunks/{chunk-OUOOKEU3.js → chunk-ZACCHQWK.js} +1 -1
- package/dist/chunks/{chunk-3V2XAYYA.js → chunk-ZKH4Z3EQ.js} +1 -1
- package/dist/chunks/{chunk-OXRN2257.js → chunk-ZLYQR44C.js} +1 -1
- package/dist/chunks/chunk-ZQOJLPWD.js +2 -0
- package/dist/chunks/{chunk-EZ435RGA.js → chunk-ZYJHMX4T.js} +1 -1
- package/dist/chunks/{cli-NHRYN2G3.js → cli-B6JFFXMI.js} +1 -1
- package/dist/chunks/{command-54MMVWS2.js → command-GZ3Z37WJ.js} +3 -3
- package/dist/chunks/{configuration-command-XMXTU2FQ.js → configuration-command-OHW7RPSC.js} +1 -1
- package/dist/chunks/{connected-app-executor-WJEDXUA4.js → connected-app-executor-P35Y6B5Y.js} +1 -1
- package/dist/chunks/{connected-evidence-NFQPO5E3.js → connected-evidence-I4I7DQRX.js} +1 -1
- package/dist/chunks/{connected-starting-assets-M54PSOEP.js → connected-starting-assets-Q7CYZT25.js} +1 -1
- package/dist/chunks/{continual-C2YWPEJZ.js → continual-3OIKJ3PG.js} +1 -1
- package/dist/chunks/{core-commands-SY4I5FHE.js → core-commands-BWDKP6AI.js} +1 -1
- package/dist/chunks/{dataset-preparation-authoring-CH6Z4NE6.js → dataset-preparation-authoring-RPYFOFBV.js} +1 -1
- package/dist/chunks/{datasets-2OQDMF7E.js → datasets-2W4JPKSP.js} +1 -1
- package/dist/chunks/{desktop-test-VNMR5H4I.js → desktop-test-EUBEZJDU.js} +1 -1
- package/dist/chunks/{evaluation-coordination-GULGPATI.js → evaluation-coordination-IYNDZB6X.js} +1 -1
- package/dist/chunks/{experiment-improvements-XNXTU6ZA.js → experiment-improvements-D3DHZ7QI.js} +1 -1
- package/dist/chunks/{experiments-DZX6ZU6F.js → experiments-7OXSDLJG.js} +1 -1
- package/dist/chunks/{experiments-signal-QDVPO3M5.js → experiments-signal-6SWD3TSR.js} +1 -1
- package/dist/chunks/{help-UCN67FN7.js → help-XVZ4RRAB.js} +1 -1
- package/dist/chunks/{host-profile-evaluation-tools-XMGGHVH3.js → host-profile-evaluation-tools-I7ESCZH7.js} +1 -1
- package/dist/chunks/{host-profile-external-dataset-C6ZPMTX6.js → host-profile-external-dataset-MD4X7BCL.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-U7WGMN5B.js → hosted-app-server-composition-PYKNSE3O.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-VQN6PJKR.js → hosted-experiment-improvement-5L3Z7IV6.js} +1 -1
- package/dist/chunks/{hosted-harness-runtime-O6E5LCGN.js → hosted-harness-runtime-XDCLEP3C.js} +1 -1
- package/dist/chunks/{hosted-profile-candidate-HQ544PNP.js → hosted-profile-candidate-6Q3GOLII.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-K4OACT7S.js → hosted-profile-compiler-FYBOGHZF.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-control-TKYM73YY.js → hosted-profile-evaluation-control-MXXZR6XA.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-HFCFUYQ4.js → hosted-profile-evaluation-inspection-4J7LAVY2.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-OJ6AR5P5.js → hosted-profile-evaluation-preparation-EF43QUMG.js} +1 -1
- package/dist/chunks/{human-review-DNVIVJRK.js → human-review-6WAUW3BG.js} +1 -1
- package/dist/chunks/{import-QT5AKEA3.js → import-333V3CGC.js} +1 -1
- package/dist/chunks/{local-harness-improvement-runtime-BWZBMOGL.js → local-harness-improvement-runtime-HC42DG74.js} +1 -1
- package/dist/chunks/{local-harness-taskset-review-JL2XNXML.js → local-harness-taskset-review-CUL73U4A.js} +1 -1
- package/dist/chunks/{opchat-7PWUXQSY.js → opchat-R7FBOSCD.js} +1 -1
- package/dist/chunks/{opchat-bounded-chat-B3GOCGWY.js → opchat-bounded-chat-IOV6FYBH.js} +1 -1
- package/dist/chunks/{organizations-TWBMN7KF.js → organizations-EG5BSG26.js} +1 -1
- package/dist/chunks/{profile-RVARQYG4.js → profile-VLGYQXEP.js} +1 -1
- package/dist/chunks/{project-action-payload-65MTQMQW.js → project-action-payload-5PL65D3W.js} +1 -1
- package/dist/chunks/{project-agent-ZC33YRZE.js → project-agent-XT47W7MT.js} +1 -1
- package/dist/chunks/{published-experiment-source-L7BER6AE.js → published-experiment-source-7TDPGSOJ.js} +1 -1
- package/dist/chunks/{refiner-profile-service-56776J7B.js → refiner-profile-service-4RRRB33P.js} +1 -1
- package/dist/chunks/{runtime-GN2H2R7L.js → runtime-K3BUZ3ZQ.js} +1 -1
- package/dist/chunks/{sandbox-command-HWIAH6JA.js → sandbox-command-D7T2GKQA.js} +1 -1
- package/dist/chunks/{sandbox-template-MNZ6OXQQ.js → sandbox-template-WTIQRKE6.js} +1 -1
- package/dist/chunks/{saved-work-OMBDT3ZR.js → saved-work-GQEYG77G.js} +1 -1
- package/dist/chunks/{setup-C6673TJK.js → setup-5MZKOZY2.js} +1 -1
- package/dist/chunks/{src-UHNSXT34.js → src-PEOADF2P.js} +2 -2
- package/dist/chunks/{src-HHFJIPL5.js → src-ZUOZOCQ2.js} +1 -1
- package/dist/chunks/{standalone-experiment-turn-owner-UYPA6XHW.js → standalone-experiment-turn-owner-N7PEBGW3.js} +1 -1
- package/dist/chunks/{store-chat-resources-TYR7D2UP.js → store-chat-resources-7JEZFCC2.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-63YCKG3P.js → store-continual-support-reviews-RJ5OQZTC.js} +1 -1
- package/dist/chunks/{store-conversation-serving-PDSBGL3E.js → store-conversation-serving-D3HJ5OZK.js} +1 -1
- package/dist/chunks/{store-create-improve-RYASTT56.js → store-create-improve-ERPWR2LH.js} +1 -1
- package/dist/chunks/{store-datasets-PELTRO4A.js → store-datasets-R6P5KBAH.js} +1 -1
- package/dist/chunks/{store-evaluation-results-OUTNEMAY.js → store-evaluation-results-ZCABU3X5.js} +1 -1
- package/dist/chunks/{store-human-review-GIMAXCJQ.js → store-human-review-2PHLILEI.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-DHOSHA6C.js → store-learned-preference-migration-validation-OGFFAM3Q.js} +1 -1
- package/dist/chunks/{store-local-experiments-AH4Z6RWX.js → store-local-experiments-ZG4NWB63.js} +1 -1
- package/dist/chunks/{store-model-batch-review-UUW6ZLDH.js → store-model-batch-review-LQAM7FQJ.js} +1 -1
- package/dist/chunks/{store-model-configuration-4U5A6DU7.js → store-model-configuration-3S74O2IQ.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-MYHO43VH.js → store-model-project-preparation-ARDV4U77.js} +1 -1
- package/dist/chunks/{store-modification-recordings-OZBLFYCT.js → store-modification-recordings-BHJTHW3A.js} +1 -1
- package/dist/chunks/{store-task-inbox-M7YZNCRF.js → store-task-inbox-YRN2UDW3.js} +1 -1
- package/dist/chunks/{store-task-inventory-TTJQAM3T.js → store-task-inventory-6V4UX5BY.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-4GVHDLJJ.js → store-taskset-drafts-H2O4CRIF.js} +1 -1
- package/dist/chunks/{store-training-MGGTGTV2.js → store-training-MQGXXKTX.js} +1 -1
- package/dist/chunks/{store-training-jobs-XKDUX4SV.js → store-training-jobs-YASPKBB3.js} +1 -1
- package/dist/chunks/{store-training-models-4S4ZT3BL.js → store-training-models-HAJCN3IS.js} +1 -1
- package/dist/chunks/{taskset-SLQSCYJI.js → taskset-65BR2KOE.js} +1 -1
- package/dist/chunks/{teams-bot-7U6JOV6T.js → teams-bot-VMG23AFI.js} +1 -1
- package/dist/chunks/{tool-learning-25Z2JOBS.js → tool-learning-YSYQEASN.js} +1 -1
- package/dist/chunks/training-5V53RWI7.js +2 -0
- package/dist/chunks/training-U6OPNRP4.js +2 -0
- package/dist/chunks/{training-2LUQ2IZM.js → training-YUWQXGJX.js} +1 -1
- package/dist/chunks/{training-hosted-NLXMISNL.js → training-hosted-KO4SCSLZ.js} +1 -1
- package/dist/chunks/{training-hosted-alphaedit-WGMJ3L2D.js → training-hosted-alphaedit-HQTKGEZU.js} +1 -1
- package/dist/chunks/{training-hosted-decision-66EUMUIW.js → training-hosted-decision-LN7MQGBF.js} +1 -1
- package/dist/chunks/{training-hosted-engram-QDXSJ77I.js → training-hosted-engram-7UAVQFBA.js} +1 -1
- package/dist/chunks/{training-hosted-modification-comparison-2MH5FZMZ.js → training-hosted-modification-comparison-ZOYOSVHI.js} +1 -1
- package/dist/chunks/{training-hosted-neuron-training-3QXKIEKT.js → training-hosted-neuron-training-37Y6WJH5.js} +1 -1
- package/dist/chunks/{training-hosted-serving-report-ZG75ACZK.js → training-hosted-serving-report-EXJ5X7GB.js} +1 -1
- package/dist/chunks/{training-hosted-steering-KFMTKCTX.js → training-hosted-steering-EAFICV6I.js} +1 -1
- package/dist/chunks/{training-model-start-NMQ55UHZ.js → training-model-start-5QB7A5TD.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/skills/manifest.json +1 -1
- package/dist/web/assets/{App-CV1p0_Zy.js → App-CqqK4NLa.js} +4 -4
- package/dist/web/assets/{AppDialog-DdGt7aU1.js → AppDialog-wmL4BlOJ.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-BHFgtq4f.js +2 -0
- package/dist/web/assets/{AppToastContext-D7z0w1PS.js → AppToastContext-DyaZYQXu.js} +1 -1
- package/dist/web/assets/{AppsView-B-Ts-M_V.js → AppsView-C6u5q5ro.js} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-BJ5i12im.js → AttachmentTypeIcon-AqiS2gzg.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BVHthjXU.js → BrowserSidebar-nNTQ1E4K.js} +1 -1
- package/dist/web/assets/{CartesianChart-BuJ1wFS7.js → CartesianChart-C5ptcXRG.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-CfiiTrK4.js → ChatTimelineEntry-DH0-itET.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-1t9zAhDC.js → CollaborationTabs-C22BMWJ4.js} +1 -1
- package/dist/web/assets/{CommandMenu-DTB6xjGG.js → CommandMenu-CKtBVjuO.js} +1 -1
- package/dist/web/assets/{CommunityView-BjeZ56id.js → CommunityView-Baq8HqVm.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-C_K_05H9.js → ComposerAttachments-BOyEXVhV.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-A38jnNGd.js → ComposerCreateImproveStrip-EbNwu1gE.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-jwaoKQZt.js → ConversationImportsSettings-Cqg66Lcb.js} +1 -1
- package/dist/web/assets/{DatasetReviewImport-DZA1s3XG.js → DatasetReviewImport--FgZ3Zk-.js} +1 -1
- package/dist/web/assets/{ExperimentTrainingDataWorkspace-DowPuAXk.js → ExperimentTrainingDataWorkspace-B04Cg7Hc.js} +2 -2
- package/dist/web/assets/{FilePagePreview-11ZNRtdT.js → FilePagePreview-CeZF-oOW.js} +2 -2
- package/dist/web/assets/{GetStartedView-bLVKmjqg.js → GetStartedView-DOpCgmrC.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-BeimFLZh.js → GettingStartedDialog-tB38Q6JA.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DiFVb3WK.js → HostedModelLearningReview-CQ0bI6Np.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-DtUF5ejq.js → HostedModelLearningSettings-DEdV2dXx.js} +1 -1
- package/dist/web/assets/{HtmlVisual-CgVTWr64.js → HtmlVisual-krrlNGFX.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-BvinwnBN.js → LabModelVersionDetailPage-DeVfdS7p.js} +1 -1
- package/dist/web/assets/{LabModelWorkspace-Q5DG2mLP.js → LabModelWorkspace-Di_yTjzH.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-cmhZzr4f.js → LabSkillSidebar-CNjUmnfC.js} +1 -1
- package/dist/web/assets/{LabsRoute-DS_mlprv.js → LabsRoute-Gznx60Cp.js} +4 -4
- package/dist/web/assets/{LearningBatchesPage-Cm-btgWc.js → LearningBatchesPage-CpZ0UTX3.js} +1 -1
- package/dist/web/assets/{MainChatThread-DbTn4Bag.js → MainChatThread-Dr2DipCD.js} +2 -2
- package/dist/web/assets/{MainPane-BtzUF6O_.js → MainPane-aEELnEKb.js} +7 -7
- package/dist/web/assets/{ModelProjectPageHeader-C4mgVJGx.js → ModelProjectPageHeader-BVwW-R0w.js} +1 -1
- package/dist/web/assets/{NativeSetupTerminal-bJpDkKk1.js → NativeSetupTerminal-BXvrxj-m.js} +2 -2
- package/dist/web/assets/{NativeSkillSidebar-BuToZvK-.js → NativeSkillSidebar-CYsBopsX.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-F0BPQy0S.js → NewProjectDialog-BR5DChE9.js} +1 -1
- package/dist/web/assets/{OutputsPage-DC4g59_8.js → OutputsPage-CR8pWUj0.js} +1 -1
- package/dist/web/assets/{PageChrome-ufq2jePD.js → PageChrome-BXMG877B.js} +1 -1
- package/dist/web/assets/{ProjectsPage-7mbOvMfO.js → ProjectsPage-CwCes2kZ.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-sR9xN3RP.js → RightChatPanelStack-BvApbQCc.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-Dm6hhkKw.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-s9CN6nR_.js → ScheduledWorkPage-nJJH1fwV.js} +1 -1
- package/dist/web/assets/{SettingsView-CZNWYK-D.js → SettingsView-CBZ6rqak.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-BnMqzE-T.js → TasksetDraftEditorPrimitives-Bcw6T4Lf.js} +1 -1
- package/dist/web/assets/{TeamChatView-XthM6n4S.js → TeamChatView-CIwlZFqB.js} +1 -1
- package/dist/web/assets/{TerminalOverlay--HCFZaQW.js → TerminalOverlay-Dhgy0NC3.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-D2F6kPg_.js → TrainingCreationPanel-yLiEL2tM.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-BurWPp9F.js → TrainingDraftPanel-Dng3C-zU.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-D7jdscDm.js → UsageSettingsSection-CTa7T7tS.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-BEIDC3vx.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-CPaCC1_p.js → WorkspaceDiffPanel-DnZlUEbx.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-BZxu6mUS.js → WorkspaceEnvironmentMenu-D-w36AYB.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-C4K_D_yh.js → WorkspaceFileLocation-D2kiU_FJ.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-C0Yf29V0.js → WorkspaceGitDialogs-CylEGfzD.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BRPLaFZS.js → WorkspaceMonacoEditor-ChBjvgxE.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-9wypyV6H.js → WorkspacePdfPreview-CBS6GjeP.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-C-Cn-9pj.js → WorkspacePresentationPreview-DhltPUL4.js} +1 -1
- package/dist/web/assets/{bot-BuaAVlz6.js → bot-C0e4zzW4.js} +1 -1
- package/dist/web/assets/{chat-resources-DMPHClhQ.js → chat-resources-BFT0vtdv.js} +1 -1
- package/dist/web/assets/chevron-down-C4LIbeSz.js +1 -0
- package/dist/web/assets/chevron-right-BKelERU6.js +1 -0
- package/dist/web/assets/chevron-up-Dj1vY1ME.js +1 -0
- package/dist/web/assets/{chunk-C3TS766N-BXUEjt7d.js → chunk-C3TS766N-bHAuW3qR.js} +1 -1
- package/dist/web/assets/chunk-GS5HEE4M-DTj6NX5d.js +1 -0
- package/dist/web/assets/{client-C-ZuakZR.js → client-BO8YuI8Z.js} +1 -1
- package/dist/web/assets/{client-choice-storage-DWIA0Vou.js → client-choice-storage-D_6dVX8O.js} +1 -1
- package/dist/web/assets/{cloud-upload-B5LqiNCG.js → cloud-upload-U0f9MSd8.js} +1 -1
- package/dist/web/assets/{copy-BYIypHbq.js → copy-B0gWkglr.js} +1 -1
- package/dist/web/assets/{cssMode-ByypIqUN.js → cssMode-BkR1YcfF.js} +1 -1
- package/dist/web/assets/{dataset-workspaces-BTPi71mz.js → dataset-workspaces-DM2zGcAK.js} +1 -1
- package/dist/web/assets/{external-link-Cv7TDVPT.js → external-link-DymjzX8a.js} +1 -1
- package/dist/web/assets/{folder-open-DlIP3g5o.js → folder-open-BPA5YifJ.js} +1 -1
- package/dist/web/assets/{folder-plus-CXwFJqcY.js → folder-plus-BCcE8Q4i.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DMh_-WxU.js → git-commit-horizontal-DbTJXbet.js} +1 -1
- package/dist/web/assets/{htmlMode-CQGeb-h5.js → htmlMode-z1rCf6pX.js} +1 -1
- package/dist/web/assets/{icons-CYvTltSH.js → icons-nr5d1kC-.js} +1 -1
- package/dist/web/assets/{image-Ci1JxTQX.js → image-Us0M7Xxi.js} +1 -1
- package/dist/web/assets/{index-CDtTBysF.js → index-DG0kf1wK.js} +2 -2
- package/dist/web/assets/{info-EjyMkVzV.js → info-M5kOSB9T.js} +1 -1
- package/dist/web/assets/{jsonMode-Dm6YK6Dw.js → jsonMode-AMfP-lcX.js} +1 -1
- package/dist/web/assets/loader-circle-C1-u7BUs.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-BjtOz-Ln.js → lspLanguageFeatures-C6uY6TKM.js} +1 -1
- package/dist/web/assets/{maximize-2-CvvoALtI.js → maximize-2-B2pi1o5S.js} +1 -1
- package/dist/web/assets/{message-square-CPtIPRtf.js → message-square-CPvsC3Wv.js} +1 -1
- package/dist/web/assets/{monaco.contribution-ClH8Tmjq.js → monaco.contribution-5F6IVWCS.js} +2 -2
- package/dist/web/assets/{monaco.contribution-wpC0-Kxw.js → monaco.contribution-BUi28toA.js} +2 -2
- package/dist/web/assets/{monaco.contribution-VSFFgrfZ.js → monaco.contribution-CfQvs13S.js} +2 -2
- package/dist/web/assets/{monaco.contribution-e5DNaEix.js → monaco.contribution-DySvt1jU.js} +2 -2
- package/dist/web/assets/{monitor-BroZpIvk.js → monitor-1YJYctCB.js} +1 -1
- package/dist/web/assets/{paperclip-DYZEL_Gi.js → paperclip-CNTReC0m.js} +1 -1
- package/dist/web/assets/{pdf-DkU37Bi0.js → pdf-DaNAfjLW.js} +1 -1
- package/dist/web/assets/play-DF5h_-8T.js +1 -0
- package/dist/web/assets/plus-D6oFNFQ0.js +1 -0
- package/dist/web/assets/{presentation-CddfsTzp.js → presentation-DbkiE2BE.js} +1 -1
- package/dist/web/assets/{python-CMdyfF2B.js → python-CDlD-992.js} +1 -1
- package/dist/web/assets/{refresh-cw-Cx_7Zlbl.js → refresh-cw-avBifyns.js} +1 -1
- package/dist/web/assets/{save-BaeHeBBw.js → save-DBayPmp_.js} +1 -1
- package/dist/web/assets/{settings-lists-CVg9h-5z.js → settings-lists-Cca729es.js} +1 -1
- package/dist/web/assets/square-CJccmW-i.js +1 -0
- package/dist/web/assets/{square-terminal-CBlQtWQw.js → square-terminal-D7snuW2g.js} +1 -1
- package/dist/web/assets/{submit-issue-command-L5--gt9i.js → submit-issue-command-wDL6xK3b.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-hftC_Rxs.js → toggleHighContrast-CP0qM8JR.js} +1 -1
- package/dist/web/assets/training-KYW8yE6p.js +1 -0
- package/dist/web/assets/{training-model-data-vvvphDlO.js → training-model-data-CilS0W2N.js} +1 -1
- package/dist/web/assets/{tsMode-B0sZU1HD.js → tsMode-DxR6CkQb.js} +1 -1
- package/dist/web/assets/{upload-Bzt1ooBz.js → upload-DEtkeTGw.js} +1 -1
- package/dist/web/assets/{useAccountSettings-BnxwetkP.js → useAccountSettings-BTy8zF0n.js} +1 -1
- package/dist/web/assets/{useAgentInventory-D_qS4ols.js → useAgentInventory-8MWE3pbH.js} +1 -1
- package/dist/web/assets/{useChatContextSelection-D8aSVtCm.js → useChatContextSelection-CBVI5IYj.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-CUQ1MW4l.js → useLocalAgentSchedules-B09iSkPy.js} +1 -1
- package/dist/web/assets/{useQuery-9SCnxwmR.js → useQuery-CKHqHSr0.js} +1 -1
- package/dist/web/assets/{wifi-off-DWtVm7W7.js → wifi-off-C-GF_rPd.js} +1 -1
- package/dist/web/assets/{workers-B3jA6AOv.js → workers-CmqH-dTr.js} +1 -1
- package/dist/web/assets/x-CQ0pGF6Q.js +1 -0
- package/dist/web/assets/{yaml-BEUL30-5.js → yaml-J_HdACeF.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +1 -0
- package/package.json +1 -1
- package/dist/chunks/chunk-5AV2EWFX.js +0 -2
- package/dist/chunks/chunk-64EDQ7UV.js +0 -2
- package/dist/chunks/chunk-DLOJG7LP.js +0 -2
- package/dist/chunks/training-JA5ZQABE.js +0 -2
- package/dist/chunks/training-NL5GYZKU.js +0 -2
- package/dist/web/assets/AppTerminalPanel-B2p_tYh5.js +0 -2
- package/dist/web/assets/RightSidebarHomePanel-joZavyR9.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CmdXCmrZ.js +0 -1
- package/dist/web/assets/chevron-down-CkifKd_O.js +0 -1
- package/dist/web/assets/chevron-right-LsMXJ5SB.js +0 -1
- package/dist/web/assets/chevron-up-Dt5T2Sf5.js +0 -1
- package/dist/web/assets/chunk-GS5HEE4M-C0RLeIsy.js +0 -1
- package/dist/web/assets/loader-circle-AjP2mDJA.js +0 -1
- package/dist/web/assets/play-BrvX67t1.js +0 -1
- package/dist/web/assets/plus-DFjCZeRE.js +0 -1
- package/dist/web/assets/square-Di5JBnVr.js +0 -1
- package/dist/web/assets/training-CGYukv2L.js +0 -1
- package/dist/web/assets/x-EG07vYCF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DG0kf1wK.js";import{n as r}from"./PageChrome-BXMG877B.js";var i=e(t(),1),a=n(),o=[],s=new WeakMap,c=[`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`summary`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable='true']`].join(`,`);function l({ariaLabel:e,backdropClassName:t=`training-dialog-backdrop`,children:n,className:s,contained:c=!1,dismissDisabled:l=!1,initialFocusKey:u,inertExclusionSelector:p,onClose:m}){let h=(0,i.useRef)(null),g=(0,i.useRef)(Symbol(`app-dialog`)),_=(0,i.useRef)(null),v=(0,i.useRef)(l),y=(0,i.useRef)(m);v.current=l,y.current=m,(0,i.useEffect)(()=>{let e=g.current;_.current=document.activeElement instanceof HTMLElement?document.activeElement:null,o.push(e);let t=c?h.current?.closest(`.main-pane`)??null:null,n=f(h.current,t,p);function r(t){o.at(-1)===e&&(p&&t.target instanceof Element&&t.target.closest(p)||(t.key===`Escape`?(t.preventDefault(),t.stopPropagation(),v.current||y.current()):t.key!==`Tab`||c||d(t,h.current)))}return document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`keydown`,r,!0);let t=o.lastIndexOf(e);t>=0&&o.splice(t,1),n();let i=_.current;i?.isConnected&&i.focus()}},[c,p]),(0,i.useEffect)(()=>{let e=window.requestAnimationFrame(()=>{let e=h.current;(e?.querySelector(`[data-autofocus]`)??e)?.focus()});return()=>window.cancelAnimationFrame(e)},[u]);function b(e){e.target===e.currentTarget&&!l&&m()}function x(e){e.key===`Escape`&&e.stopPropagation()}return(0,a.jsx)(`div`,{className:t,role:`presentation`,onMouseDown:b,children:(0,a.jsx)(`section`,{ref:h,"aria-busy":l||void 0,"aria-label":e,"aria-modal":c?void 0:`true`,className:s,role:`dialog`,tabIndex:-1,onKeyDown:x,onMouseDown:e=>e.stopPropagation(),children:(0,a.jsx)(r,{children:n})})})}function u(e){return e?Array.from(e.querySelectorAll(c)).filter(e=>!e.hidden&&e.getAttribute(`aria-hidden`)!==`true`&&e.getClientRects().length>0):[]}function d(e,t){if(!t)return;let n=u(t);if(n.length===0){e.preventDefault(),t.focus();return}let r=n.indexOf(document.activeElement),i=e.shiftKey?r<=0?n.length-1:r-1:r<0||r===n.length-1?0:r+1;e.preventDefault(),n[i]?.focus()}function f(e,t=null,n){if(!e)return()=>void 0;let r=[],i=e.parentElement??e;for(;i.parentElement&&i!==document.body;){let e=i.parentElement;for(let t of Array.from(e.children)){if(t===i||!(t instanceof HTMLElement)||n&&t.matches(n))continue;let e=s.get(t)??{count:0,ariaHidden:t.getAttribute(`aria-hidden`),inert:t.inert};e.count+=1,s.set(t,e),r.push(t),t.inert=!0,t.setAttribute(`aria-hidden`,`true`)}if(i=e,t&&i===t)break}return()=>{for(let e of r.reverse()){let t=s.get(e);!t||--t.count>0||(s.delete(e),e.inert=t.inert,t.ariaHidden===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,t.ariaHidden))}}}export{l as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalOverlay-Dhgy0NC3.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/index-DG0kf1wK.js","assets/index-g7UqJhnX.css","assets/api-client-DJRVOFzS.js","assets/icons-nr5d1kC-.js","assets/chevron-down-C4LIbeSz.js","assets/plus-D6oFNFQ0.js","assets/x-CQ0pGF6Q.js","assets/AppToastContext-DyaZYQXu.js","assets/ui-theme.generated-D-mc26qt.js","assets/App-CqqK4NLa.js","assets/useQuery-CKHqHSr0.js","assets/schemas-Brv9Vmnk.js","assets/common-BWVSBnpX.js","assets/settings-BC-bzgk6.js","assets/client-choice-storage-D_6dVX8O.js","assets/requests-DmeUYik4.js","assets/create-pipeline-DsZzNkt9.js","assets/profile-ref-D8lxL7dW.js","assets/chunk-H3JZ3P5T-DolwEJXo.js","assets/work-outputs-D_8TovAK.js","assets/chunk-GS5HEE4M-DTj6NX5d.js","assets/chunk-GCUWJUUM-Dy6oUNJ6.js","assets/reward-checks-DJJZYgf8.js","assets/intake-contracts-B8JZKYwb.js","assets/training-KYW8yE6p.js","assets/chunk-Q4RGCEOI-Cr-dg4Nk.js","assets/ponder-desktop-Ca-9KggQ.js","assets/chat-resources-BFT0vtdv.js","assets/app-models-BUdzQbXo.js","assets/model-display-zPvC4L2B.js","assets/submit-issue-command-wDL6xK3b.js","assets/connected-app-mentions-D3wRZLwI.js","assets/profile-agent-labels-Duh96b8x.js","assets/browser-sidebar-links-PVPCrsDJ.js","assets/browser-url-LACq2Ngu.js","assets/query-scope-BRpcgljO.js","assets/bot-C0e4zzW4.js","assets/chevron-right-BKelERU6.js","assets/copy-B0gWkglr.js","assets/external-link-DymjzX8a.js","assets/loader-circle-C1-u7BUs.js","assets/maximize-2-B2pi1o5S.js","assets/message-square-CPvsC3Wv.js","assets/refresh-cw-avBifyns.js","assets/square-terminal-D7snuW2g.js","assets/NativeSetupTerminal-BXvrxj-m.js","assets/AppDialog-wmL4BlOJ.js","assets/PageChrome-BXMG877B.js","assets/NativeSetupTerminal-3eR9D_R3.css","assets/organization-types-PP-yuR2J.js","assets/App-DpFKLxuA.css","assets/TerminalOverlay-DoUFGstN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n,t as r}from"./index-DG0kf1wK.js";var i=e(t(),1),a=n(),o=(0,i.lazy)(()=>r(()=>import(`./TerminalOverlay-Dhgy0NC3.js`).then(e=>({default:e.TerminalOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53])));function s({open:e,connection:t,scope:n,tabs:r,onTabsChange:s,cwd:c,appId:l,workspaceName:u,queuedCommand:d,onClose:f}){let[p,m]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{e&&m(!0)},[e]),p?(0,a.jsx)(i.Suspense,{fallback:null,children:(0,a.jsx)(o,{open:e,connection:t,scope:n,tabs:r,onTabsChange:s,cwd:c,appId:l,workspaceName:u,queuedCommand:d,onClose:f})}):null}export{s as AppTerminalPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DG0kf1wK.js";var r=e(t(),1),i=[/^(?:(?:type)?error:\s*)?failed to fetch\.?$/i,/^networkerror when attempting to fetch resource\.?$/i,/^load failed\.?$/i,/^(?:ConnectionRequestError:\s*)?Couldn[’']t connect to OpenPond\.?$/i,/^Event stream disconnected$/i];function a(e,t=`Something went wrong.`){let n=(e instanceof Error?e.message:String(e??``)).trim();return n?o(n)?`Couldn’t connect to OpenPond.`:n:t}function o(e){let t=e.trim();return i.some(e=>e.test(t))||/(?:^|:\s*)(?:ConnectionRequestError:\s*)?Couldn[’']t connect to OpenPond\.?$/i.test(t)}var s=n(),c=(0,r.createContext)(null);function l({children:e,showToast:t}){return(0,s.jsx)(c.Provider,{value:t,children:e})}function u(){return(0,r.useContext)(c)}function d(e,t={}){let n=u(),i=(0,r.useRef)(null),s=t.enabled??!0,c=t.fallback??`Something went wrong.`,l=t.prefix?.trim()??``,d=e instanceof Error?e.message:String(e??``),f=e==null||e===``||o(d)?null:`${l}${l?`: `:``}${a(e,c)}`;(0,r.useEffect)(()=>{!s||!f?i.current=null:i.current!==f&&(i.current=f,n?.(f,`error`,{dedupeKey:`error:${f}`}))},[s,f,n])}export{o as a,a as i,u as n,d as r,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,l as n,m as r,s as i}from"./index-CDtTBysF.js";import{P as a,t as o}from"./useQuery-9SCnxwmR.js";import{a as s,c,d as l,m as u,o as d,p as f,r as p,v as m}from"./schemas-Brv9Vmnk.js";import{U as h,d as g,i as _,it as v}from"./chunk-H3JZ3P5T-DolwEJXo.js";import{C as y}from"./app-models-BUdzQbXo.js";import{n as b}from"./api-client-DJRVOFzS.js";import"./icons-CYvTltSH.js";import{t as x}from"./chevron-right-LsMXJ5SB.js";import{t as S}from"./external-link-Cv7TDVPT.js";import{a as C,i as w,n as T,t as E}from"./settings-lists-CVg9h-5z.js";import{t as D}from"./plus-DFjCZeRE.js";import{t as O}from"./refresh-cw-Cx_7Zlbl.js";import{t as k}from"./x-EG07vYCF.js";import{r as A}from"./AppToastContext-D7z0w1PS.js";import{t as j}from"./NativeSetupTerminal-bJpDkKk1.js";import{At as M,Gt as N,Nt as P,Tn as F,Ut as I,Xt as L,hn as R,kt as z,mr as B,pr as V,zt as ee}from"./App-CV1p0_Zy.js";import{Ct as H,St as te}from"./MainPane-BtzUF6O_.js";import{i as U,n as W,r as G,t as ne}from"./client-C-ZuakZR.js";import{n as K,r as re,t as ie}from"./useAgentInventory-D_qS4ols.js";/* empty css */var q=e(t(),1),J=r();function ae({context:e,baseUrl:t,onClose:n}){let[r,i]=(0,q.useState)(`claude_code`),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(null),l=C(n);A(s);async function u(){try{await navigator.clipboard.writeText(`Read ${new URL(`/agent-setup.md`,t).href} and connect ${ne(r)} tool capture to my private saved Fix-it dataset. Reuse my existing OpenPond home and account and select workspace ${e.teamId}. Inspect openpond tool-learning --help and the Model commands. Reuse an owner-controlled private capture Model, or create one if needed, without activating training. All my connected agents should contribute to the same Fix-it dataset. I consent to bounded, sanitized tool arguments, error excerpts and follow-up actions from the workspace I select being saved as dataset records until I remove them; raw capture buffers retain their separate bounded retention. Confirm the actual client version and exact permitted tool names, then use tool-learning setup --client ${r} --team-id ${e.teamId} --project-id <private-capture-model> --workspace <chosen-workspace> --environment-file <bounded-context-file> --tools <exact-tool-names> --allow-upload with my existing home/account. Preserve unrelated hooks and permissions. ${r===`codex`?`Use the installed openpond-fix-it skill and tool-learning run for captured Codex CLI tasks; ordinary Codex desktop chats are outside this connection.`:``} Use doctor to verify observed capture and inspect the uploaded records through the normal dataset commands. Do not import conversation history, start OpenPond inference or training, provision compute, or activate a specialist.`),c(null),o(!0)}catch{c(`The setup prompt could not be copied. Please retry.`)}}return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:n,children:(0,J.jsxs)(`section`,{ref:l,className:`git-dialog provider-details-dialog agent-setup-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Connect Fix-it`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{className:`git-dialog-close`,"aria-label":`Close`,onClick:n,children:(0,J.jsx)(k,{size:16})}),(0,J.jsx)(`div`,{className:`provider-dialog-header`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Connect Fix-it`}),(0,J.jsx)(`span`,{children:`Tool capture to your saved dataset`})]})}),(0,J.jsxs)(`div`,{className:`provider-dialog-body`,children:[(0,J.jsx)(`div`,{className:`agent-sync-form`,children:(0,J.jsxs)(`label`,{children:[`Coding agent`,(0,J.jsx)(I,{label:`Fix-it coding agent`,value:r,onChange:e=>{i(e),o(!1)},options:[{value:`claude_code`,label:`Claude Code`},{value:`opencode`,label:`OpenCode`},{value:`codex`,label:`Codex CLI`},{value:`openpond`,label:`OpenPond`}]})]})}),r===`codex`?(0,J.jsx)(`p`,{className:`provider-dialog-note`,children:`Captures tasks launched through the installed Codex CLI skill. Existing desktop chats are outside this connection.`}):null,(0,J.jsx)(`div`,{className:`settings-button-row`,children:(0,J.jsx)(`button`,{className:`agent-connect-button`,onClick:()=>void u(),children:a?`Setup prompt copied`:`Copy capture setup prompt`})}),(0,J.jsx)(`p`,{className:`provider-dialog-note`,children:`Paste this into your agent in the workspace you want to connect. Captures stay in your saved dataset until removed. Training stays off.`})]})]})})}function oe({context:e,baseUrl:t}){let n=W(e),r=G(e),[i,a]=(0,q.useState)(!1);A(n.error);let o=n.data,s=r.data?.installations.filter(e=>e.state!==`revoked`)??[];function c(){n.refetch(),r.refetch()}return(0,J.jsxs)(`section`,{className:`connected-agents-view`,"aria-label":`Fix-it connections`,children:[(0,J.jsxs)(`header`,{className:`agent-connections-heading`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Fix-it`}),(0,J.jsx)(`p`,{children:`Tool errors from all your connected agents go to one private saved dataset.`})]}),(0,J.jsxs)(`div`,{className:`agent-connections-actions`,children:[(0,J.jsx)(`button`,{onClick:c,disabled:n.isFetching||r.isFetching,children:`Refresh`}),(0,J.jsx)(`button`,{className:`agent-connect-button`,onClick:()=>a(!0),children:`Connect agent`})]})]}),(0,J.jsxs)(`div`,{className:`evaluation-card`,children:[(0,J.jsxs)(`h3`,{children:[`Destination: `,o?.name??`Fix-it`]}),(0,J.jsx)(`p`,{role:`status`,"aria-live":`polite`,children:o?`${o.taskCount??0} saved ${o.taskCount===1?`record`:`records`}`:n.isPending?`Loading dataset…`:n.error?null:`No capture dataset available`}),(0,J.jsx)(`button`,{className:`training-text-button`,disabled:!o,onClick:()=>o&&void P({kind:`models`,route:ee(`datasets`,null,{area:`console`,resourceId:o.id,detailTab:`tasks`,projectId:null,executionLocation:`hosted`})}),children:`Open dataset`}),n.error?(0,J.jsx)(`button`,{className:`training-text-button`,onClick:()=>void n.refetch(),children:`Retry`}):null]}),(0,J.jsx)(`div`,{className:`evaluation-table-scroll evaluation-table-frame`,children:(0,J.jsxs)(`table`,{className:`training-data-table evaluation-workspace-table`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:`Agent`}),(0,J.jsx)(`th`,{children:`Capture`}),(0,J.jsx)(`th`,{children:`Tools`}),(0,J.jsx)(`th`,{children:`Dataset`})]})}),(0,J.jsxs)(`tbody`,{children:[s.map(e=>(0,J.jsxs)(`tr`,{children:[(0,J.jsxs)(`td`,{children:[(0,J.jsx)(`div`,{children:ne(e.client)}),(0,J.jsx)(`small`,{children:e.clientVersion})]}),(0,J.jsx)(`td`,{children:e.state===`enabled`?`Enabled`:`Paused`}),(0,J.jsx)(`td`,{children:e.collectionPolicy.permittedTools.join(`, `)}),(0,J.jsx)(`td`,{children:o?.name??`Fix-it`})]},e.id)),(0,J.jsx)(U,{columns:4,loading:r.isPending,error:r.error?.message,retry:()=>void r.refetch(),empty:!s.length,children:`Connect a coding agent to start capturing tool errors.`})]})]})}),(0,J.jsx)(`p`,{className:`evaluation-meta-line`,children:`Captures are saved as dataset records. Recovery candidates need separate review before training.`}),i?(0,J.jsx)(ae,{context:e,baseUrl:t,onClose:()=>a(!1)}):null]})}function se({agent:e,account:t,native:n,inventory:r,projects:i,teamId:a,learningControl:o,connected:s,onHide:c,onManage:l}){let u=r?.collector.connections.filter(t=>t.source===e.id)??[],d=r?.sources.some(t=>t.source===e.id&&t.available&&t.capabilities.history);return(0,J.jsxs)(`article`,{className:`agent-connection-card`,"aria-label":e.name,children:[(0,J.jsxs)(`div`,{className:`agent-card-title`,children:[(0,J.jsx)(`img`,{src:e.icon,alt:``}),(0,J.jsx)(`span`,{children:e.name}),(0,J.jsx)(`button`,{type:`button`,className:`agent-hide`,"aria-label":`Hide ${e.name}`,onClick:c,children:(0,J.jsx)(k,{size:14})})]}),e.id===`openpond_chat`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`small`,{children:t?.state===`signed_in`?`Connected to OpenPond`:`Sign in to OpenPond`}),(0,J.jsx)(`p`,{children:`Use Pal from the sidebar.`}),(0,J.jsx)(`button`,{type:`button`,className:`agent-account-link`,onClick:()=>void P({kind:`settings`,section:`account`}),children:`Account setup`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`small`,{children:n?n.available?n.enabled?`Ready to chat`:`Installed · chat disabled`:n.lastError??`Check installation`:`Conversation import`}),(0,J.jsx)(`button`,{type:`button`,className:`agent-connect-button`,disabled:!s,onClick:l,children:n?.available||u.length?`Manage`:`Connect`}),(0,J.jsx)(`div`,{className:`agent-card-sync`,children:u.length?u.map(e=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:re(e,r.collector)}),(0,J.jsxs)(`small`,{children:[i.find(t=>t.id===e.projectId&&e.teamId===a)?.content.name??e.projectId,` `,`· `,e.admitted,` tasks`]}),e.teamId===a?null:(0,J.jsxs)(`small`,{children:[`Team: `,e.teamId]}),e.queued?(0,J.jsxs)(`small`,{children:[e.queued,` updates queued`]}):null,e.lastAdmissionAt?(0,J.jsxs)(`small`,{children:[`Last sync: `,new Date(e.lastAdmissionAt).toLocaleString()]}):null,e.error?(0,J.jsx)(N,{error:e.error}):null]},e.id)):(0,J.jsx)(`small`,{children:r?d?`History available · sync not connected`:`No local history found`:`Reading local setup…`})})]}),o]})}function ce(e,t,n,r){let i=(0,q.useRef)({providers:t,onProvider:n});i.current={providers:t,onProvider:n};let a=JSON.stringify([`claude-code`,`opencode`,`grok-build`].map(e=>{let n=t?.providers[e];return[e,n?.binaryPath,n?.sourceHome,n?.enabled]}));(0,q.useEffect)(()=>{if(!e||!i.current.providers)return;let t=!1,n=[`claude-code`,`opencode`,`grok-build`].map(n=>{let a=i.current.providers?.providers[n],o=new AbortController,s=r>0?{promise:b(e,`/v1/providers/${n}/native-setup`,{method:`POST`,body:JSON.stringify({action:`check`}),signal:o.signal}),release:()=>o.abort()}:te(e,n,i.current.providers?.providers[n]);return s.promise.then(o=>{t||(r>0&&o.session&&!o.error&&H(e,n,o,a),i.current.onProvider(n,o.settings))},()=>{}),s});return()=>{t=!0,n.forEach(e=>e.release())}},[e,a,r])}var Y=m().trim().min(1).max(240),le=f().int().positive(),ue=p([`dataset`,`evaluator`,`model`,`training_configuration`,`training_run`,`harness`,`environment`,`experiment`,`learning_policy`,`deployment`]),de=u({kind:ue,resourceId:Y,release:_.nullable(),role:p([`training`,`validation`,`holdout`,`target`,`reward`,`evaluation`,`serving`,`source`])}).strict(),fe=c(`kind`,[u({kind:l(`model`),providerId:Y,modelId:Y,artifact:_.nullable(),messages:s(u({role:p([`system`,`user`,`assistant`]),content:m().max(1e5)}).strict()).max(100)}).strict(),u({kind:l(`harness`),profileRepositoryId:Y,source:v}).strict(),u({kind:l(`agent`),source:h}).strict(),u({kind:l(`suite`),profileRepositoryId:Y,suiteId:Y,sources:s(v).min(1).max(1e3)}).strict().superRefine((e,t)=>{let n=e.sources[0],r=new Set;for(let[i,a]of e.sources.entries())r.has(a.definitionId)&&t.addIssue({code:`custom`,path:[`sources`,i],message:`Suite definitions must be unique.`}),r.add(a.definitionId),(a.profileId!==n.profileId||a.sourceRevision!==n.sourceRevision||a.catalogHash!==n.catalogHash||g(a.harnessRelease)!==g(n.harnessRelease))&&t.addIssue({code:`custom`,path:[`sources`,i],message:`Suite checks must belong to the same pinned Profile source and Harness release.`})})]),pe=u({name:m().trim().min(1).max(200),description:m().max(1e4),targets:s(u({id:Y,name:m().trim().min(1).max(200),target:fe}).strict()).max(100),defaultTargetId:Y.nullable(),resources:s(de).max(1e3)}).strict().superRefine((e,t)=>{new Set(e.targets.map(e=>e.id)).size!==e.targets.length&&t.addIssue({code:`custom`,path:[`targets`],message:`Target identities must be unique.`}),e.defaultTargetId&&!e.targets.some(t=>t.id===e.defaultTargetId)&&t.addIssue({code:`custom`,path:[`defaultTargetId`],message:`Default target must belong to this Project.`}),new Set(e.resources.map(e=>g(e))).size!==e.resources.length&&t.addIssue({code:`custom`,path:[`resources`],message:`Resource links must be unique.`})}),me=u({schemaVersion:l(`openpond.trainingProject.v1`),id:Y,teamId:Y,creatorUserId:Y,ownerScope:p([`workspace`,`personal`]).optional(),revision:le,content:pe,archived:d(),createdAt:m().datetime(),updatedAt:m().datetime()}).strict();u({operationId:Y,id:Y,expectedRevision:f().int().nonnegative(),content:pe,ownerScope:p([`workspace`,`personal`]).optional()}).strict(),u({operationId:Y,expectedRevision:le,archived:d()}).strict();var he=u({teamId:Y,projects:s(me).max(100),nextCursor:Y.nullable()}).strict();u({operation:p([`evaluate`,`train`,`enable_learning`,`accept_candidate`,`serve`]),support:p([`supported`,`unsupported`]),state:p([`ready`,`needs_setup`,`blocked`]),reasons:s(u({code:Y,message:m().min(1).max(2e3),field:m().nullable(),action:p([`choose_target`,`choose_data`,`choose_evaluator`,`configure_runtime`,`request_access`,`configure_budget`,`wait`,`review_evidence`]).nullable()}).strict()).max(100)}).strict().superRefine((e,t)=>{e.state===`ready`&&(e.support!==`supported`||e.reasons.length)&&t.addIssue({code:`custom`,message:`Ready operations must be supported with no blockers.`}),e.state!==`ready`&&!e.reasons.length&&t.addIssue({code:`custom`,message:`Unavailable operations must explain the next step.`})});var X=new WeakMap;function ge(e,t,n){let r=JSON.stringify([t?.activeProfile,t?.profile?.id,n]),i=e?X.get(e)?.get(r):void 0,[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(0),p=t?.state===`signed_in`?a?.key===r&&a.connection===e?a.value:i:void 0;(0,q.useEffect)(()=>{if(!e||!n||t?.state!==`signed_in`)return;let i=new AbortController;u(!0),c(null);async function a(){let t=[],a=new Set,s;do{let r=he.parse(await b(e,`/v1/training/evaluation-workspace`,{method:`POST`,body:JSON.stringify({teamId:n,operation:`projects`,value:{cursor:s}}),signal:i.signal}));if(r.teamId!==n)throw Error(`The hosted project workspace changed. Refresh connections.`);if(t.push(...r.projects.filter(e=>!e.archived)),s=r.nextCursor??void 0,s&&a.has(s))throw Error(`Project pagination stalled. Refresh connections.`);s&&a.add(s)}while(s&&!i.signal.aborted);if(i.signal.aborted)return;let c=X.get(e);c||(c=new Map,X.set(e,c));let l=c.get(r)?.selected,u={projects:t,selected:l&&t.some(e=>e.id===l)?l:t.length===1?t[0].id:``};c.set(r,u),o({key:r,connection:e,value:u})}return a().catch(e=>{i.signal.aborted||c(e instanceof Error?e.message:`Unable to list hosted projects.`)}).finally(()=>{i.signal.aborted||u(!1)}),()=>i.abort()},[e,r,n,t?.state,d]);let m=(0,q.useCallback)(t=>{if(!e)return;let n=X.get(e)?.get(r);if(!n||!n.projects.some(e=>e.id===t))return;let i={...n,selected:t};X.get(e).set(r,i),o({key:r,connection:e,value:i})},[e,r]);return{projects:p?.projects??[],projectId:p?.selected??``,select:m,error:s,loading:l,refresh:()=>f(e=>e+1)}}var _e=e(M(),1),ve=e(z(),1);function ye({connection:e,connectionId:t,disabled:n,projectName:r,onUpload:i,onClose:a}){let[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(`all`),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(()=>new Map),[m,h]=(0,q.useState)(!0),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(0);w(e,g,()=>y(e=>e+1));let x=(0,q.useRef)(null),S=(0,q.useRef)(0);(0,q.useEffect)(()=>{let n=new AbortController;x.current?.abort(),x.current=n,h(!0),d(null),_(null);let r=window.setTimeout(()=>{let r=v!==S.current;S.current=v,b(e,`/v1/native-history/collector`,{method:`POST`,signal:n.signal,body:JSON.stringify({command:`conversations`,connectionId:t,query:o,range:c,refresh:r})}).then(e=>{n.signal.aborted||d(e)}).catch(e=>{n.signal.aborted||_(e instanceof Error?e.message:`Unable to list conversations.`)}).finally(()=>{n.signal.aborted||h(!1)})},200);return()=>{window.clearTimeout(r),n.abort(),x.current?.abort()}},[e,t,o,c,v]);async function C(){if(m||u?.nextOffset==null)return;let n=new AbortController;x.current=n,h(!0),_(null);try{let r=await b(e,`/v1/native-history/collector`,{method:`POST`,signal:n.signal,body:JSON.stringify({command:`conversations`,connectionId:t,query:o,range:c,offset:u.nextOffset})});n.signal.aborted||d(e=>({...r,items:[...new Map([...e?.items??[],...r.items].map(e=>[e.key,e])).values()]}))}catch(e){n.signal.aborted||_(e instanceof Error?e.message:`Unable to load more conversations.`)}finally{n.signal.aborted||h(!1)}}function T(e,t){p(n=>{let r=new Map(n);return t?r.set(e.key,e):r.delete(e.key),r})}let E=u?.items??[],D=E.filter(e=>!e.issue),O=D.length>0&&D.every(e=>f.has(e.key)),k=new Set(E.map(e=>e.key)),A=[...f.keys()].filter(e=>!k.has(e)).length;return(0,J.jsxs)(`section`,{className:`conversation-upload-picker`,"aria-label":`Choose conversations to upload`,children:[(0,J.jsx)(`h3`,{children:`Choose conversations`}),(0,J.jsxs)(`p`,{children:[`Upload to `,(0,J.jsx)(`strong`,{children:r}),`. This selection also sets which conversations later syncs update. Previously uploaded data stays in the project.`]}),(0,J.jsxs)(`div`,{className:`conversation-upload-toolbar`,children:[(0,J.jsx)(`input`,{autoFocus:!0,type:`search`,"aria-label":`Search conversations`,placeholder:`Search title, folder, or session ID`,value:o,disabled:n,onChange:e=>s(e.target.value)}),(0,J.jsx)(I,{label:`Conversation activity`,value:c,disabled:n,onChange:l,options:[{value:`all`,label:`All dates`},{value:`week`,label:`Active last week`},{value:`day`,label:`Active last day`}]})]}),(0,J.jsxs)(`div`,{className:`conversation-upload-selection`,role:`status`,children:[(0,J.jsxs)(`span`,{children:[f.size,` selected`,A?` · ${A} outside this view`:``,u?` · ${u.total} matching`:``]}),(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||m,onClick:()=>y(e=>e+1),children:`Refresh`}),(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||!f.size,onClick:()=>p(new Map),children:`Clear selection`})]}),(0,J.jsx)(`div`,{className:`evaluation-table-scroll evaluation-table-frame conversation-upload-table`,children:(0,J.jsxs)(`table`,{className:`training-data-table evaluation-workspace-table`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:(0,J.jsx)(`input`,{type:`checkbox`,className:`training-chat-checkbox`,"aria-label":`Select visible conversations`,checked:O,disabled:n||m||!D.length,onChange:e=>{let t=e.target.checked;p(e=>{let n=new Map(e);return D.forEach(e=>{t?n.set(e.key,e):n.delete(e.key)}),n})}})}),(0,J.jsx)(`th`,{children:`Conversation`}),(0,J.jsx)(`th`,{children:`Last activity`})]})}),(0,J.jsxs)(`tbody`,{children:[E.map(e=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsx)(`input`,{type:`checkbox`,className:`training-chat-checkbox`,"aria-label":`Select ${e.title}`,checked:f.has(e.key),disabled:n||!!e.issue,onChange:t=>T(e,t.target.checked)})}),(0,J.jsxs)(`td`,{children:[(0,J.jsx)(`span`,{className:`conversation-upload-title`,title:e.title,children:e.title}),(0,J.jsx)(`small`,{title:e.cwd??e.nativeSessionId,children:e.cwd??e.nativeSessionId}),e.issue?(0,J.jsx)(`small`,{role:`status`,children:e.issue}):e.approved?(0,J.jsx)(`small`,{children:`Already approved for sync`}):null]}),(0,J.jsx)(`td`,{children:(0,J.jsx)(`time`,{dateTime:e.updatedAt,children:new Date(e.updatedAt).toLocaleDateString()})})]},e.key)),m?(0,J.jsx)(`tr`,{children:(0,J.jsx)(`td`,{colSpan:3,role:`status`,children:`Loading conversations…`})}):!E.length&&!g?(0,J.jsx)(`tr`,{children:(0,J.jsx)(`td`,{colSpan:3,children:o.trim()||c!==`all`?`No conversations match these filters.`:`No saved conversations found in this installation.`})}):null]})]})}),g?(0,J.jsx)(N,{error:g,children:(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||m,onClick:()=>y(e=>e+1),children:`Retry`})}):null,u?.nextOffset==null?null:(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||m,onClick:()=>void C(),children:`Load more conversations`}),(0,J.jsx)(`p`,{children:`The complete selected conversations are uploaded, including their prompts, responses, and tool history. Date filters help you find conversations; they do not trim their contents.`}),(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,className:`agent-connect-button`,disabled:n||!f.size,onClick:()=>void i([...f.keys()]),children:`Upload ${f.size} conversation${f.size===1?``:`s`}`}),(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n,onClick:a,children:`Cancel`})]})]})}_e.default.extend(ve.default);function be({agent:e,inventory:t,connection:n,account:r,teamId:i,projects:a,projectId:o,onRefresh:s,learningUrl:c}){let l=t?.sources.filter(t=>t.source===e.id)??[],[u,d]=(0,q.useState)(l.length===1?l[0].instanceId:``),[f,p]=(0,q.useState)(o),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(!1),[x,S]=(0,q.useState)(null),C=l.find(e=>e.instanceId===u)??(!u&&l.length===1?l[0]:void 0),w=t?.collector.connections.filter(t=>t.source===e.id)??[],T=r?.baseUrl??r?.activeProfile?.baseUrl,E=r?.apiBaseUrl;async function D(e,t,r){if(!(!n||v||g)){y(!0),S(null);try{let a=await b(n,`/v1/native-history/collector`,{method:`POST`,body:JSON.stringify({command:e,...t?{connectionId:t}:{},...r?{sessionKeys:r}:{},...e===`connect`?{setup:{sourceInstanceId:C?.instanceId,teamId:i,projectId:f,accountBaseUrl:T,apiBaseUrl:E,range:`all`}}:{}})});a.command?_(a.command):await s()}catch(e){S(e instanceof Error?e.message:`Unable to update this connection.`)}finally{y(!1)}}}let O=v||g!==null,k=w.find(e=>e.id===m),A=g&&n?(0,J.jsx)(j,{connection:n,command:g,onComplete:()=>{_(null),h(null),s()},onClose:()=>{_(null),s()}}):null;return k&&n?(0,J.jsxs)(`div`,{className:`agent-conversation-setup provider-dialog-body`,children:[(0,J.jsx)(ye,{connection:n,connectionId:k.id,projectName:a.find(e=>e.id===k.projectId&&k.teamId===i)?.content.name??k.projectId,disabled:O||!!t?.collector.running,onClose:()=>h(null),onUpload:e=>D(`upload`,k.id,e)},k.id),x?(0,J.jsx)(N,{error:x}):null,A]}):(0,J.jsxs)(`div`,{className:`agent-conversation-setup provider-dialog-body`,children:[(0,J.jsxs)(`p`,{children:[`Sync saved `,e.name,` conversations to an existing OpenPond project. Connecting authorizes the destination. Choose conversations and confirm an upload when ready.`]}),w.map(n=>(0,J.jsxs)(`section`,{className:`agent-retained-connection`,"aria-label":`${e.name} sync connection`,children:[(0,J.jsx)(`strong`,{children:re(n,t.collector)}),(0,J.jsxs)(`span`,{children:[`Project:`,` `,n.teamId===i?a.find(e=>e.id===n.projectId)?.content.name??n.projectId:n.projectId,` `,`· Team: `,n.teamId]}),(0,J.jsx)(`small`,{children:n.accountBaseUrl??`Hosted destination`}),(0,J.jsx)(`small`,{className:`agent-source-path`,children:n.sourceRoot}),(0,J.jsxs)(`span`,{children:[n.admitted,` tasks imported · `,n.queued,` updates queued`]}),(0,J.jsx)(`small`,{children:n.selectedConversations===null?`All history approved for sync`:`${n.selectedConversations} conversations approved for sync`}),n.backfill.total>0&&n.backfill.stage!==`complete`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`progress`,{"aria-label":`History import progress`,value:n.backfill.admitted+n.backfill.skipped,max:n.backfill.total}),(0,J.jsxs)(`small`,{children:[n.backfill.admitted+n.backfill.skipped,` of`,` `,n.backfill.total,` conversations processed`]})]}):null,(0,J.jsx)(`small`,{children:n.lastAdmissionAt?`Last synced ${(0,_e.default)(n.lastAdmissionAt).fromNow()}`:`No uploads acknowledged yet`}),n.error?(0,J.jsx)(N,{error:n.error}):null,(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,className:`agent-connect-button`,disabled:O||n.state!==`active`||t?.collector.running,onClick:()=>h(n.id),children:`Choose conversations…`}),n.state===`disconnected`?(0,J.jsx)(`button`,{type:`button`,disabled:O,onClick:()=>void D(`reconnect`,n.id),children:`Reconnect`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`button`,{type:`button`,disabled:O,onClick:()=>void D(n.state===`paused`?`resume`:`pause`,n.id),children:n.state===`paused`?`Resume`:`Pause`}),(0,J.jsx)(`button`,{type:`button`,disabled:O,onClick:()=>{window.confirm(`Disconnect this conversation source? Imported data stays in its project.`)&&D(`disconnect`,n.id)},children:`Disconnect`})]}),n.destinationLinks.tasks?(0,J.jsx)(`a`,{href:n.destinationLinks.tasks,target:`_blank`,rel:`noreferrer`,children:`View tasks`}):null,n.destinationLinks.conversations?(0,J.jsx)(`a`,{href:n.destinationLinks.conversations,target:`_blank`,rel:`noreferrer`,children:`View conversations`}):null]})]},n.id)),(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),D(`connect`)},className:`agent-sync-form`,children:[(0,J.jsx)(`h3`,{children:w.length?`Add another connection`:`Connect conversations`}),(0,J.jsxs)(`label`,{className:`agent-source-field`,children:[`Source installation`,(0,J.jsx)(I,{label:`Source installation`,value:C?.instanceId??``,disabled:O,onChange:d,options:[{value:``,label:`Select installation`},...l.map(e=>({value:e.instanceId,label:e.root,disabled:!e.available||!e.capabilities.history}))]})]}),C?.reason?(0,J.jsx)(`small`,{children:C.reason}):null,l.some(e=>e.available&&e.capabilities.history)?null:(0,J.jsxs)(`small`,{children:[`No readable conversation history found.`,` `,e.provider?`Use Agent setup to check the installation, or create a conversation in this agent first.`:`Open this agent and create a conversation, then refresh connections.`]}),(0,J.jsxs)(`label`,{children:[`Project`,(0,J.jsx)(I,{label:`Upload destination project`,value:f,disabled:O||!i,onChange:p,searchable:!0,options:[{value:``,label:`Select project`},...a.map(e=>({value:e.id,label:e.content.name}))]})]}),(0,J.jsx)(`p`,{children:`No conversations are uploaded during setup. Continual imports are off by default and can be scheduled after choosing conversations.`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>P({kind:`settings`,section:`conversation-imports`}),children:`Manage continual imports in Settings`}),r?.state!==`signed_in`||!i?(0,J.jsx)(`small`,{children:`Sign in and select a default team in Account settings to choose a hosted project.`}):null,(0,J.jsx)(`button`,{type:`submit`,className:`agent-connect-button`,disabled:O||!C?.available||!C.capabilities.history||!a.some(e=>e.id===f)||!i||!T||!E||r?.state!==`signed_in`,children:v?`Opening setup…`:`Connect conversations`})]}),c?(0,J.jsx)(`a`,{className:`agent-learning-link`,href:c,target:`_blank`,rel:`noreferrer`,children:`Configure continual learning in Console`}):null,t?(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`CLI setup`}),(0,J.jsxs)(`small`,{className:`agent-source-path`,children:[`Importer directory: `,t.directory]}),(0,J.jsx)(`code`,{children:t.statusCommand})]}):null,x?(0,J.jsx)(N,{error:x}):null,A]})}var Z=e=>JSON.stringify([e.origin,e.sourceInstanceId]),xe=e=>({id:e.id,revision:e.revision,contentHash:e.contentHash});function Q(e,t,n,r,i){return b(e,`/v1/conversation-learning/${n}?${new URLSearchParams({teamId:t})}`,{method:r===void 0?`GET`:`POST`,...r===void 0?{}:{body:JSON.stringify(r)},signal:i})}function Se(e,t,n,r){let i=a(),s=[`native-conversation-learning`,e?.serverUrl,n,t];return{...o({queryKey:s,enabled:!!(e&&t&&r),queryFn:({signal:n})=>Q(e,t,`options`,void 0,n),staleTime:15e3,refetchInterval:3e4}),refresh:()=>i.invalidateQueries({queryKey:s})}}function Ce(e,t,n,r,i){return Q(e,t,`policies`,{...n?{id:n.id}:{},expectedRevision:n?.revision??0,configuration:r,enabled:i})}function $(e,t,n=[]){let r=t?.configuration;return{projectId:e,name:r?.name??`Continuous learning`,mode:r?.mode??`activate`,definition:r?.definition??null,configurationId:r?.configuration?.id??``,trainingPolicyId:r?.learningPolicy?.id??``,graderIds:[],sourceKeys:[...new Set([...r?.sources.filter(e=>e.enabled).map(Z)??[],...n.map(Z)])],adapter:r?.adapter??{kind:`complete_text`,qualitativeOnly:!0},generator:r?.generator??null,graderSelection:r?.graderSelection??(t?{mode:`manual`}:{mode:`auto`,modelId:`gpt-6-luna`,sampleSize:8,maximumOutputTokens:2048,maximumSpendUsd:1}),schedule:r?.schedule??{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,hour:2,minute:0,endHour:6,endMinute:0},limits:r?.limits??{perCycleUsd:5,dailyUsd:5,monthlyUsd:25,gradeUsd:.2,maximumTasks:10,minimumExamples:5,maxGpuSeconds:10800,maximumAttempts:2,lookbackDays:30},exceptions:r?.exceptions??`block`,minimumScore:r?.minimumScore??.8,selection:r?.selection??{maximumSourceShare:1,maximumFailureShare:1,maximumLengthShare:1,replayFraction:.2,auditFraction:.1},acceptance:r?.acceptance??{minimumCasesPerCheck:20,minimumImprovement:.05,windowCasesPerCheck:20},failurePolicy:r?.failurePolicy??{pauseAfterConsecutiveFailures:3},...r?.serving?{serving:r.serving}:{serving:{targetId:``,canarySeconds:120,rollbackOnRuntimeFailure:!0}}}}function we(e,t){let n=e?.configurations.find(e=>e.id===t);return e?.trainingPolicies.filter(e=>e.modelProjectId===n?.portableProjectId&&e.training.recipe.id===`model-recipe-${n?.etag}`&&!e.id.startsWith(`conversation-training-`))??[]}async function Te(e,t,n,r,i,a){let o=r.configurations.find(e=>e.id===n.configurationId),s=we(r,n.configurationId).find(e=>e.id===n.trainingPolicyId);if(!n.name.trim())throw Error(`Enter a policy name.`);if(!r.projects.some(e=>e.id===n.projectId))throw Error(`This owned Project is unavailable for continuous learning.`);if(n.configurationId&&(!o||!r.projects.find(e=>e.id===n.projectId)?.configurationIds.includes(o.id)))throw Error(`Choose a model configuration attached to this Project.`);if(n.mode!==`evaluate`&&(!o||!s))throw Error(`Choose an owned model and its reviewed training setup.`);if(n.limits.perCycleUsd>n.limits.dailyUsd||n.limits.dailyUsd>n.limits.monthlyUsd)throw Error(`Daily and monthly spending limits must cover the run limit.`);if(n.limits.minimumExamples>n.limits.maximumTasks-Math.floor(n.limits.maximumTasks*(n.selection?.replayFraction??0)))throw Error(`Leave capacity for the minimum new examples after replay.`);let c=r.sources.filter(e=>e.projectId===n.projectId&&n.sourceKeys.includes(Z(e)));if(!c.length)throw Error(`Select a source agent for this Project.`);let l=[...(i?.configuration.sources??[]).filter(e=>!c.some(t=>Z(t)===Z(e))).map(e=>({...e,enabled:!1})),...c.map(e=>({origin:e.origin,sourceInstanceId:e.sourceInstanceId,enabled:!0}))],u=n.definition;if(o&&(i?.configuration.configuration?.id!==o.id||i.configuration.configuration.expectedEtag!==o.etag))u=await Q(e,t,`definitions`,{projectId:n.projectId,configuration:{id:o.id,expectedRevision:o.revision,expectedEtag:o.etag}});else if(n.graderIds.length){let i=r.graders.flatMap(e=>e&&n.graderIds.includes(e.id)?[xe(e)]:[]);u=await Q(e,t,`definitions`,{projectId:n.projectId,graders:i})}if(!u)throw Error(`Select evaluation rubrics or an existing task definition.`);let d=n.serving,f=r.servingTargets.find(e=>e.id===d?.targetId);if(n.mode===`activate`&&d?.targetId&&(!f||!f.enabled||f.projectId!==n.projectId))throw Error(`Select an available serving target in this Project.`);if(n.mode===`activate`&&(!d?.targetId||f?.hostedPonder)&&(d={targetId:(await Q(e,t,`serving-targets`,{action:`ensure_hosted_ponder`,projectId:n.projectId,bindingId:r.ponderBindingId})).id,canarySeconds:d?.canarySeconds??120,rollbackOnRuntimeFailure:!0}),n.mode===`activate`&&!d?.targetId)throw Error(`Choose a serving target, or enable the policy to register hosted Pal.`);let{sourceKeys:p,configurationId:m,trainingPolicyId:h,graderIds:g,..._}=n,v={..._,name:n.name.trim(),definition:u,sources:l,configuration:o?{id:o.id,expectedRevision:o.revision,expectedEtag:o.etag}:null,learningPolicy:s?xe(s):null,...n.mode===`activate`?{serving:d}:{}};return n.mode!==`activate`&&delete v.serving,n.mode===`evaluate`&&delete v.acceptance,Ce(e,t,i,v,a)}function Ee({draft:e,options:t,loading:n,onChange:r}){let i=t?.sources.filter(t=>t.projectId===e.projectId)??[],a=i.filter(e=>[`active`,`paused`].includes(e.state)),o=a.length>0&&a.every(t=>e.sourceKeys.includes(Z(t))),s=t=>r({...e,sourceKeys:t}),c=t?.graders.flatMap(e=>e?[e]:[])??[];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Source agents`}),(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:o,disabled:!a.length,ref:t=>{t&&(t.indeterminate=!o&&a.some(t=>e.sourceKeys.includes(Z(t))))},onChange:t=>s(t.target.checked?[...new Set([...e.sourceKeys,...a.map(Z)])]:e.sourceKeys.filter(e=>!a.some(t=>Z(t)===e)))}),`Select all`,` `,(0,J.jsxs)(`small`,{children:[`(`,i.filter(t=>e.sourceKeys.includes(Z(t))).length,` selected)`]})]}),(0,J.jsxs)(`div`,{className:`agent-learning-options`,"aria-label":`Source agents`,children:[i.map(t=>{let n=Z(t),r=e.sourceKeys.includes(n),i=K.find(e=>e.id===(t.origin.startsWith(`native_`)?`openpond_chat`:t.origin)),a=t.origin===`native_chat`?`Pal Chat`:t.origin===`native_work`?`Pal Work`:i?.name??t.name;return(0,J.jsxs)(`label`,{className:`agent-learning-option`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:r,disabled:!r&&![`active`,`paused`].includes(t.state),onChange:t=>s(t.target.checked?[...new Set([...e.sourceKeys,n])]:e.sourceKeys.filter(e=>e!==n))}),i?(0,J.jsx)(`img`,{src:i.icon,alt:``}):null,(0,J.jsxs)(`span`,{children:[a,(0,J.jsx)(`small`,{children:t.sourceInstanceId?t.name===t.origin?`Local connection`:t.name:t.origin.startsWith(`native_`)?`Hosted conversations`:`Uploaded history`})]}),(0,J.jsx)(`small`,{children:t.state})]},n)}),i.length?null:(0,J.jsx)(`p`,{role:`status`,children:n?`Fetching source agents…`:`Connect or import an agent into this Project first.`})]}),(0,J.jsx)(`p`,{children:`Paused agents can use uploaded conversations. Selecting them leaves collection paused.`})]}),(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Evaluation rubrics`}),e.configurationId?(0,J.jsx)(`p`,{children:`The training configuration pins the task definition and its rubrics. Choose grader selection in Preparation.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,disabled:!c.length,checked:c.length>0&&c.every(t=>e.graderIds.includes(t.id)),onChange:t=>r({...e,graderIds:t.target.checked?c.map(e=>e.id):[]})}),`Select all `,(0,J.jsxs)(`small`,{children:[`(`,e.graderIds.length,` selected)`]})]}),(0,J.jsxs)(`div`,{className:`agent-learning-options`,"aria-label":`Evaluation rubrics`,children:[c.map(t=>(0,J.jsxs)(`label`,{className:`agent-learning-option`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.graderIds.includes(t.id),onChange:n=>r({...e,graderIds:n.target.checked?[...e.graderIds,t.id]:e.graderIds.filter(e=>e!==t.id)})}),(0,J.jsxs)(`span`,{children:[t.name,(0,J.jsxs)(`small`,{children:[`Version `,t.revision]})]})]},`${t.id}:${t.revision}`)),c.length?null:(0,J.jsx)(`p`,{role:`status`,children:n?`Fetching evaluation rubrics…`:`No owned evaluation rubrics are available.`})]}),e.definition&&!e.graderIds.length?(0,J.jsx)(`p`,{children:`The saved task definition and rubrics remain unchanged.`}):null,(0,J.jsxs)(`label`,{children:[`Existing task definition`,(0,J.jsxs)(`select`,{value:e.definition?.id??``,onChange:n=>{let i=t?.definitions.find(e=>e.id===n.target.value);r({...e,definition:i?{id:i.id,revision:i.revision,contentHash:i.contentHash}:null,graderIds:[]})},children:[(0,J.jsx)(`option`,{value:``,children:`Select a definition or choose rubrics above`}),e.definition&&!t?.definitions.some(t=>t.id===e.definition?.id)?(0,J.jsx)(`option`,{value:e.definition.id,children:`Saved task definition`}):null,t?.definitions.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[e.name,` (version `,e.revision,`)`]},e.id))]})]})]}),(0,J.jsxs)(`label`,{children:[`Minimum verified score`,(0,J.jsx)(`input`,{type:`number`,min:0,max:1,step:.01,value:e.minimumScore,onChange:t=>r({...e,minimumScore:Number(t.target.value)})})]})]})]})}function De({draft:e,options:t,loading:n,onChange:r}){let i=t?.projects.find(t=>t.id===e.projectId)?.configurationIds??[],a=we(t,e.configurationId),o=e.graderSelection??{mode:`manual`};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[`Mode`,(0,J.jsxs)(`select`,{value:e.mode,onChange:t=>r({...e,mode:t.target.value}),children:[(0,J.jsx)(`option`,{value:`evaluate`,children:`Evaluate only`}),(0,J.jsx)(`option`,{value:`train`,children:`Train automatically, approve candidate`}),(0,J.jsx)(`option`,{value:`activate`,children:`Train and activate automatically`})]})]}),(0,J.jsxs)(`label`,{children:[`Model to train`,(0,J.jsxs)(`select`,{value:e.configurationId,onChange:n=>{let i=n.target.value,a=we(t,i);r({...e,configurationId:i,trainingPolicyId:a.length===1?a[0].id:``,adapter:i?{kind:`reference_text`,inputPointer:`/prompt`,match:`contained`}:{kind:`complete_text`,qualitativeOnly:!0}})},children:[(0,J.jsx)(`option`,{value:``,children:n?`Fetching configurations…`:`Select configuration`}),t?.configurations.filter(e=>i.includes(e.id)).map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),e.mode===`evaluate`?null:(0,J.jsxs)(`label`,{children:[`Reviewed training setup`,(0,J.jsxs)(`select`,{value:e.trainingPolicyId,onChange:t=>r({...e,trainingPolicyId:t.target.value}),children:[(0,J.jsx)(`option`,{value:``,children:`Select reviewed setup`}),a.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[`Reviewed setup (version `,e.revision,`)`]},e.id))]})]}),e.configurationId?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[`Task construction`,(0,J.jsxs)(`select`,{value:e.adapter.kind,onChange:t=>r({...e,adapter:t.target.value===`reference_text`?{kind:`reference_text`,inputPointer:`/prompt`,match:`contained`}:{kind:`complete_text`,qualitativeOnly:!0}}),children:[(0,J.jsx)(`option`,{value:`reference_text`,children:`Match a published executable task`}),(0,J.jsx)(`option`,{value:`complete_text`,children:`Complete text context and calibrated judges`})]})]}),e.adapter.kind===`reference_text`?(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[(0,J.jsxs)(`label`,{children:[`Public task input field`,(0,J.jsx)(`input`,{value:e.adapter.inputPointer,onChange:t=>r({...e,adapter:{kind:`reference_text`,inputPointer:t.target.value,match:e.adapter.kind===`reference_text`?e.adapter.match:`contained`}})})]}),(0,J.jsxs)(`label`,{children:[`Reference matching`,(0,J.jsxs)(`select`,{value:e.adapter.match,onChange:t=>r({...e,adapter:{kind:`reference_text`,inputPointer:e.adapter.kind===`reference_text`?e.adapter.inputPointer:`/prompt`,match:t.target.value}}),children:[(0,J.jsx)(`option`,{value:`contained`,children:`Contained`}),(0,J.jsx)(`option`,{value:`exact`,children:`Exact`})]})]})]}):null,(0,J.jsxs)(`label`,{children:[`Grader selection`,(0,J.jsxs)(`select`,{value:o.mode,onChange:t=>r({...e,graderSelection:t.target.value===`auto`?{mode:`auto`,modelId:`gpt-6-luna`,sampleSize:8,maximumOutputTokens:2048,maximumSpendUsd:1}:{mode:`manual`}}),children:[(0,J.jsx)(`option`,{value:`auto`,children:`Choose compatible rubrics automatically`}),(0,J.jsx)(`option`,{value:`manual`,children:`Use the pinned rubrics`})]})]}),o.mode===`auto`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[`Selection model`,(0,J.jsxs)(`select`,{value:o.modelId,onChange:t=>r({...e,graderSelection:{...o,modelId:t.target.value}}),children:[t?.generators.some(e=>e.id===o.modelId)?null:(0,J.jsx)(`option`,{value:o.modelId,children:o.modelId}),t?.generators.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`sampleSize`,`Sample examples`,1,30],[`maximumOutputTokens`,`Output token limit`,256,4096],[`maximumSpendUsd`,`Selection spending limit ($)`,.01,1e5]].map(([t,n,i,a])=>(0,J.jsxs)(`label`,{children:[n,(0,J.jsx)(`input`,{type:`number`,min:i,max:a,step:t===`maximumSpendUsd`?.01:1,value:o[t],onChange:n=>r({...e,graderSelection:{...o,[t]:Number(n.target.value)}})})]},t))})]}):null]}):null,(0,J.jsxs)(`label`,{children:[`Answer improvement model`,(0,J.jsxs)(`select`,{value:e.generator?.modelId??``,onChange:t=>r({...e,generator:t.target.value?{modelId:t.target.value,maximumOutputTokens:e.generator?.maximumOutputTokens??2048,maximumSpendUsd:e.generator?.maximumSpendUsd??.1}:null}),children:[(0,J.jsx)(`option`,{value:``,children:`Use recorded answers only`}),t?.generators.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),e.generator?(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[(0,J.jsxs)(`label`,{children:[`Per improved answer limit ($)`,(0,J.jsx)(`input`,{type:`number`,min:.01,step:.01,value:e.generator.maximumSpendUsd,onChange:t=>r({...e,generator:{...e.generator,maximumSpendUsd:Number(t.target.value)}})})]}),(0,J.jsxs)(`label`,{children:[`Output token limit`,(0,J.jsx)(`input`,{type:`number`,min:256,max:16384,value:e.generator.maximumOutputTokens,onChange:t=>r({...e,generator:{...e.generator,maximumOutputTokens:Number(t.target.value)}})})]})]}):null,e.mode===`activate`?(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Serving authorization`}),(0,J.jsxs)(`label`,{children:[`Serving target`,(0,J.jsxs)(`select`,{value:e.serving?.targetId??``,onChange:t=>r({...e,serving:{targetId:t.target.value,canarySeconds:e.serving?.canarySeconds??120,rollbackOnRuntimeFailure:!0}}),children:[(0,J.jsx)(`option`,{value:``,children:`Pal in this Project`}),t?.servingTargets.filter(t=>t.projectId===e.projectId&&t.enabled).map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.hostedPonder?`Hosted Pal`:`${e.role} / ${e.roleTargetId}`},e.id))]})]}),(0,J.jsxs)(`label`,{children:[`Runtime canary (seconds)`,(0,J.jsx)(`input`,{type:`number`,min:30,max:600,value:e.serving?.canarySeconds??120,onChange:t=>r({...e,serving:{targetId:e.serving?.targetId??``,canarySeconds:Number(t.target.value),rollbackOnRuntimeFailure:!0}})})]}),(0,J.jsx)(`p`,{children:`Saving authorizes the selected target. Failed runtime checks restore its prior model. Training runs only within the saved policy's schedule and limits.`})]}):null]})}var Oe=(e,t)=>e===void 0||t===void 0?``:`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`;function ke({draft:e,onChange:t}){let n=(n,r)=>t({...e,limits:{...e.limits,[n]:r}});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Run window`}),(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[(0,J.jsxs)(`label`,{children:[`From`,(0,J.jsx)(`input`,{type:`time`,required:!0,value:Oe(e.schedule.hour,e.schedule.minute),onChange:n=>{let[r,i]=n.target.value.split(`:`).map(Number);t({...e,schedule:{...e.schedule,hour:r,minute:i}})}})]}),(0,J.jsxs)(`label`,{children:[`Until`,(0,J.jsx)(`input`,{type:`time`,value:Oe(e.schedule.endHour,e.schedule.endMinute),onChange:n=>{let[r,i]=n.target.value.split(`:`).map(Number),{endHour:a,endMinute:o,...s}=e.schedule;t({...e,schedule:n.target.value?{...s,endHour:r,endMinute:i}:s})}})]})]}),(0,J.jsxs)(`label`,{children:[`Timezone`,(0,J.jsx)(`input`,{required:!0,value:e.schedule.timezone,onChange:n=>t({...e,schedule:{...e.schedule,timezone:n.target.value}})})]}),(0,J.jsx)(`p`,{children:`Queued learning starts within this window. A run already started may finish afterward.`})]}),(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Maximum spending`}),(0,J.jsx)(`p`,{children:`These are limits, not prices. Evaluation, answer improvements and training count toward them.`}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`perCycleUsd`,`Per run ($)`],[`dailyUsd`,`Per day ($)`],[`monthlyUsd`,`Per month ($)`]].map(([t,r])=>(0,J.jsxs)(`label`,{children:[r,(0,J.jsx)(`input`,{type:`number`,required:!0,min:.01,max:1e5,step:.01,value:e.limits[t],onChange:e=>n(t,Number(e.target.value))})]},t))})]}),(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`Advanced limits`}),(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[[[`gradeUsd`,`Per evaluation ceiling ($)`,0,1e3,.01],[`maximumTasks`,`Maximum tasks`,1,200,1],[`minimumExamples`,`Minimum training examples`,1,200,1],[`maximumAttempts`,`Maximum correction attempts`,1,5,1],[`lookbackDays`,`Uploaded history window (days)`,1,30,1]].map(([t,r,i,a,o])=>(0,J.jsxs)(`label`,{children:[r,(0,J.jsx)(`input`,{type:`number`,required:!0,min:i,max:a,step:o,value:e.limits[t],onChange:e=>n(t,Number(e.target.value))})]},t)),(0,J.jsxs)(`label`,{children:[`Maximum GPU session (hours)`,(0,J.jsx)(`input`,{type:`number`,required:!0,min:.01,max:3,step:.01,value:e.limits.maxGpuSeconds/3600,onChange:e=>n(`maxGpuSeconds`,Math.round(Number(e.target.value)*3600))})]}),(0,J.jsxs)(`label`,{children:[`Pause after failed cycles`,(0,J.jsx)(`input`,{type:`number`,required:!0,min:1,max:20,value:e.failurePolicy?.pauseAfterConsecutiveFailures??3,onChange:n=>t({...e,failurePolicy:{pauseAfterConsecutiveFailures:Number(n.target.value)}})})]})]}),(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.exceptions===`eligible_remainder`,onChange:n=>t({...e,exceptions:n.target.checked?`eligible_remainder`:`block`})}),`Use the independently verified remainder when exceptions occur`]})]}),(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`Training data balance`}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`maximumSourceShare`,`Maximum from one agent`,100],[`maximumFailureShare`,`Maximum from one error type`,100],[`maximumLengthShare`,`Maximum from one conversation length`,100],[`replayFraction`,`Previously learned examples`,50],[`auditFraction`,`Examples checked for quality`,100]].map(([n,r,i])=>(0,J.jsxs)(`label`,{children:[r,` (%)`,(0,J.jsx)(`input`,{type:`number`,min:+!!n.startsWith(`maximum`),max:i,value:Math.round((e.selection?.[n]??0)*100),onChange:r=>t({...e,selection:{maximumSourceShare:1,maximumFailureShare:1,maximumLengthShare:1,replayFraction:.2,auditFraction:.1,...e.selection,[n]:Number(r.target.value)/100}})})]},n))})]}),e.mode===`evaluate`?null:(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`Checks before using the trained model`}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`windowCasesPerCheck`,`New examples per quality check`,2,1e4],[`minimumCasesPerCheck`,`Minimum paired examples`,2,1e4],[`minimumImprovement`,`Required improvement`,1e-4,1]].map(([n,r,i,a])=>(0,J.jsxs)(`label`,{children:[r,(0,J.jsx)(`input`,{type:`number`,min:i,max:a,step:n===`minimumImprovement`?.01:1,value:e.acceptance?.[n]??i,onChange:r=>t({...e,acceptance:{minimumCasesPerCheck:20,windowCasesPerCheck:20,minimumImprovement:.05,...e.acceptance,[n]:Number(r.target.value)}})})]},n))}),(0,J.jsx)(`p`,{children:`Current and trained models use the same unseen examples. Insufficient evidence keeps the current model active.`})]})]})}function Ae({connection:e,teamId:t,projectId:n,projectName:r,initialPolicy:i,bindings:a,query:o,onClose:s}){let[c,l]=(0,q.useState)(i),[u,d]=(0,q.useState)(()=>$(n,i,i?[]:a)),[f,p]=(0,q.useState)(!!o.data),[m,h]=(0,q.useState)(!1),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(i?.status===`enabled`||!i),[S,w]=(0,q.useState)(`sources`),[T,E]=(0,q.useState)(!1),[D,O]=(0,q.useState)(null),A=(0,q.useRef)(f);A.current=f;let j=o.data?.policies.filter(e=>e.configuration.projectId===n)??[];(0,q.useEffect)(()=>{if(!o.data||A.current)return;let e=o.data.policies.find(e=>e.configuration.projectId===n&&e.status===`enabled`)??o.data.policies.find(e=>e.configuration.projectId===n);l(e),d($(n,e,e?[]:a)),x(e?.status===`enabled`||!e),p(!0)},[o.data,n,a]);let M=()=>{g||(m?E(!0):s())},P=C(M);function F(e){let t=j.find(t=>t.id===e);t&&(l(t),d($(n,t)),x(t.status===`enabled`),h(!1),O(null),E(!1),y(null))}function I(e){d(e),h(!0)}async function L(){if(o.data&&f&&!g&&!o.isError){_(!0),y(null);try{await Te(e,t,u,o.data,c,b),await o.refresh(),h(!1),s()}catch(e){y(e instanceof Error?e.message:`Unable to save continuous learning.`)}finally{_(!1)}}}let R={draft:u,options:o.data,loading:o.isPending,onChange:I};return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:M,children:(0,J.jsxs)(`section`,{ref:P,className:`git-dialog provider-details-dialog agent-learning-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Continuous learning`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close continuous learning`,disabled:g,onClick:M,children:(0,J.jsx)(k,{size:16})}),(0,J.jsx)(`div`,{className:`provider-dialog-header`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Continuous learning`}),(0,J.jsx)(`span`,{children:r})]})}),T?(0,J.jsxs)(`div`,{className:`agent-learning-discard`,role:`alert`,children:[(0,J.jsx)(`p`,{children:`Discard unsaved policy changes?`}),(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>{E(!1),O(null)},children:`Keep editing`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>D?F(D):s(),children:`Discard changes`})]})]}):null,j.length>1?(0,J.jsxs)(`label`,{className:`agent-learning-policy-picker`,children:[`Learning policy`,(0,J.jsx)(`select`,{disabled:g,value:c?.id??``,onChange:e=>{m?(O(e.target.value),E(!0)):F(e.target.value)},children:j.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[e.configuration.name,` (`,e.status,`)`]},e.id))})]}):null,(0,J.jsx)(`div`,{className:`surface-tabs provider-agent-tabs`,role:`tablist`,"aria-label":`Continuous learning settings`,children:[[`sources`,`Sources & rubrics`],[`preparation`,`Preparation`],[`schedule`,`Run window & budget`]].map(([e,t])=>(0,J.jsx)(`button`,{type:`button`,id:`learning-tab-${e}`,role:`tab`,"aria-selected":S===e,"aria-controls":`learning-panel-${e}`,tabIndex:S===e?0:-1,onClick:()=>w(e),onKeyDown:t=>{let n=[`sources`,`preparation`,`schedule`],r=n.indexOf(e);if([`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(t.key)){t.preventDefault();let e=n[t.key===`Home`?0:t.key===`End`?2:(r+(t.key===`ArrowRight`?1:2))%3];w(e),document.getElementById(`learning-tab-${e}`)?.focus()}},children:t},e))}),(0,J.jsxs)(`form`,{className:`agent-learning-form`,onSubmit:e=>{e.preventDefault(),L()},children:[(0,J.jsx)(`fieldset`,{disabled:!f||g,children:(0,J.jsxs)(`label`,{children:[`Policy name`,(0,J.jsx)(`input`,{required:!0,maxLength:200,value:u.name,onChange:e=>I({...u,name:e.target.value})})]})}),(0,J.jsx)(`div`,{id:`learning-panel-${S}`,role:`tabpanel`,"aria-labelledby":`learning-tab-${S}`,children:(0,J.jsx)(`fieldset`,{disabled:!f||g,children:S===`sources`?(0,J.jsx)(Ee,{...R}):S===`preparation`?(0,J.jsx)(De,{...R}):(0,J.jsx)(ke,{...R})})}),o.isPending?(0,J.jsx)(`p`,{role:`status`,children:`Fetching available sources, rubrics and models…`}):null,o.isError?(0,J.jsx)(N,{error:o.error.message,children:(0,J.jsx)(`button`,{type:`button`,onClick:()=>void o.refetch(),children:`Retry settings`})}):null,v?(0,J.jsx)(N,{error:v}):null,(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:b,disabled:!f||g,onChange:e=>{x(e.target.checked),h(!0)}}),`Enable this policy after saving`]}),(0,J.jsx)(`p`,{children:`Saving enables only the reviewed sources, schedule and limits. No training is dispatched by opening this dialog.`}),(0,J.jsxs)(`div`,{className:`settings-button-row agent-learning-footer`,children:[(0,J.jsx)(`button`,{type:`button`,disabled:g,onClick:M,children:`Cancel`}),(0,J.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!f||!o.data||o.isError||g||!u.sourceKeys.length,children:g?`Saving…`:b?`Save and enable`:`Save paused`})]})]})]})})}function je({agent:e,inventory:t,connection:n,teamId:r,projectId:i,projectName:a,query:o,signedIn:s}){let[c,l]=(0,q.useState)(!1),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(``),v=(0,q.useMemo)(()=>new Set(t?.collector.connections.filter(t=>t.source===e.id&&t.teamId===r&&t.projectId===i&&t.state!==`disconnected`).map(e=>e.sourceInstanceId)??[]),[t,e.id,r,i]),y=o.data?.sources.filter(t=>t.projectId===i&&(e.id===`openpond_chat`?[`native_chat`,`native_work`].includes(t.origin)&&t.sourceInstanceId===null:t.origin===e.id&&t.sourceInstanceId!==null&&v.has(t.sourceInstanceId)))??[],b=[...new Set(y.flatMap(e=>e.sourceInstanceId?[e.sourceInstanceId]:[]))],x=b.includes(g)?g:b[0],S=y.filter(e=>e.sourceInstanceId===null||e.sourceInstanceId===x).map(e=>({origin:e.origin,sourceInstanceId:e.sourceInstanceId,enabled:!0})),C=o.data?.policies.filter(e=>e.configuration.projectId===i)??[],w=C.filter(e=>e.status===`enabled`&&e.configuration.sources.some(e=>e.enabled&&S.some(t=>Z(t)===Z(e)))),T=w[0]??C.find(e=>e.status===`enabled`)??C[0],E=!!(n&&r&&i&&s&&o.data?.projects.some(e=>e.id===i));async function D(e,t){if(!n||!r||!o.data)return;let a={...e.configuration,sources:e.configuration.sources.map(e=>S.some(t=>Z(t)===Z(e))?{...e,enabled:t}:e)};if(t)for(let e of S)a.sources.some(t=>Z(t)===Z(e))||a.sources.push(e);let s=o.data.servingTargets.find(e=>e.id===a.serving?.targetId);if(t&&a.mode===`activate`&&a.serving?.targetId&&(!s||!s.enabled||s.projectId!==i))throw Error(`Review the policy's serving target before adding a source.`);if(t&&a.mode===`activate`&&(!a.serving?.targetId||s?.hostedPonder)){let e=await Q(n,r,`serving-targets`,{action:`ensure_hosted_ponder`,projectId:i,bindingId:o.data.ponderBindingId});a={...a,serving:{targetId:e.id,canarySeconds:a.serving?.canarySeconds??120,rollbackOnRuntimeFailure:!0}}}return Ce(n,r,e,a,a.sources.some(e=>e.enabled))}async function O(e){if(!f){p(!0),h(null);try{if(e){let e=C.find(e=>e.id===u);if(!e)throw Error(`Refresh the learning policy before joining.`);await D(e,!0),d(null)}else for(let e of w)await D(e,!1);await o.refresh()}catch(e){h(e instanceof Error?e.message:`Unable to update this learning source.`),await o.refresh()}finally{p(!1)}}}return(0,J.jsxs)(`div`,{className:`agent-learning-control`,children:[b.length>1?(0,J.jsxs)(`label`,{children:[`Learning connection`,(0,J.jsx)(`select`,{"aria-label":`${e.name} learning connection`,value:x,disabled:f,onChange:e=>_(e.target.value),children:b.map(e=>(0,J.jsx)(`option`,{value:e,children:y.find(t=>t.sourceInstanceId===e)?.name??`Local connection`},e))})]}):null,(0,J.jsxs)(`div`,{className:`agent-learning-control-row`,children:[(0,J.jsxs)(`label`,{className:`provider-toggle`,children:[(0,J.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.name} continuous learning`,checked:w.length>0,disabled:!E||!S.length||o.isPending||o.isError||f,onChange:e=>{if(e.target.checked){let e=C.find(e=>e.status===`enabled`);e?d(e.id):l(!0)}else O(!1)}}),(0,J.jsx)(`span`,{"aria-hidden":`true`})]}),(0,J.jsx)(`button`,{type:`button`,className:`agent-learning-settings`,disabled:!n||!r||!i||!s||f,onClick:()=>l(!0),children:`Continuous learning`}),(0,J.jsx)(`small`,{children:o.isError?`Needs attention`:o.isPending?`Loading…`:w.length?`On schedule`:C.length?`Paused`:`Off`})]}),i&&!S.length&&o.data?(0,J.jsx)(`small`,{children:`Sync this agent to the selected Project to use its local connection.`}):null,m?(0,J.jsx)(N,{error:m}):null,c&&n&&r?(0,J.jsx)(Ae,{connection:n,teamId:r,projectId:i,projectName:a,initialPolicy:T,bindings:S,query:o,onClose:()=>l(!1)},i):null,u?(0,J.jsx)(Me,{policies:C.filter(e=>e.status===`enabled`),policyId:u,agentName:e.name,busy:f,error:m,onChoose:d,onClose:()=>{f||d(null)},onJoin:()=>void O(!0)}):null]})}function Me({policies:e,policyId:t,agentName:n,busy:r,error:i,onChoose:a,onClose:o,onJoin:s}){let c=C(o),l=e.find(e=>e.id===t);return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:o,children:(0,J.jsxs)(`section`,{ref:c,className:`git-dialog agent-learning-join`,role:`dialog`,"aria-modal":`true`,"aria-label":`Add learning source`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{type:`button`,className:`git-dialog-close`,disabled:r,"aria-label":`Cancel`,onClick:o,children:(0,J.jsx)(k,{size:16})}),(0,J.jsxs)(`h2`,{children:[`Add `,n,` to `,l?.configuration.name??`continuous learning`,`?`]}),(0,J.jsx)(`p`,{children:`This agent will contribute conversations to the existing model, schedule and spending limits. Collection settings stay unchanged.`}),e.length>1?(0,J.jsxs)(`label`,{children:[`Existing policy`,(0,J.jsx)(`select`,{value:t,disabled:r,onChange:e=>a(e.target.value),children:e.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.configuration.name},e.id))})]}):null,i?(0,J.jsx)(N,{error:i}):null,(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,disabled:r,onClick:o,children:`Cancel`}),(0,J.jsx)(`button`,{type:`button`,className:`primary`,disabled:r||!l,onClick:s,children:r?`Adding…`:`Add agent`})]})]})})}function Ne(e){let[t,n]=(0,q.useState)(!1),r=e.payload?.account,i=e.payload?.preferences.defaultTeamId??r?.accounts.find(e=>e.isActive)?.apiKeyAccess?.teamId,a=r?.baseUrl??r?.activeProfile?.baseUrl;return(0,J.jsxs)(J.Fragment,{children:[e.connection&&i&&a&&r?.state===`signed_in`?(0,J.jsx)(oe,{context:{connection:e.connection,teamId:i,accountKey:JSON.stringify(r.activeProfile)},baseUrl:a}):(0,J.jsxs)(`section`,{className:`connected-agents-view`,children:[(0,J.jsx)(`h2`,{children:`Fix-it`}),(0,J.jsx)(`p`,{children:`Sign in and select a workspace to connect an agent.`})]}),(0,J.jsx)(`div`,{className:`connected-agents-view`,children:(0,J.jsx)(`button`,{className:`training-text-button`,"aria-expanded":t,onClick:()=>n(e=>!e),children:t?`Hide history imports`:`History import tools`})}),t?(0,J.jsx)(Pe,{...e}):null]})}function Pe({connection:e,payload:t,onPayload:n,onToast:r}){let{inventory:i,error:a,loading:o,refresh:s}=ie(e),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(0),m=`openpond-agent-cards:${JSON.stringify(t?.account.activeProfile??null)}`,[h,g]=(0,q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(m)??`null`);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&K.some(t=>t.id===e)):[`oh_my_pi`]}catch{return[`oh_my_pi`]}});(0,q.useEffect)(()=>{try{localStorage.setItem(m,JSON.stringify(h))}catch{}},[m,h]);let[_,v]=(0,q.useState)(!1),b=(0,q.useRef)(null);(0,q.useEffect)(()=>{if(!_)return;let e=e=>{b.current?.contains(e.target)||v(!1)},t=e=>{e.key===`Escape`&&(v(!1),b.current?.querySelector(`button`)?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[_]);let x=(0,q.useRef)({payload:t,onPayload:n});x.current={payload:t,onPayload:n};let S=(0,q.useRef)(!0);(0,q.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]);let C=t?.account??null,w=t?.preferences.defaultTeamId??C?.accounts.find(e=>e.isActive)?.apiKeyAccess?.teamId??null,k=(0,q.useCallback)(e=>{l(e),e&&r?.(e,`error`)},[r]),A=(0,q.useCallback)(e=>{let t=x.current;S.current&&t.payload&&t.onPayload({...t.payload,providers:e})},[]),j=(0,q.useCallback)((e,t)=>{let n=x.current;if(!S.current||!n.payload)return;let r=n.payload.providers,i={...n.payload,providers:{...r,statuses:{...r.statuses,[e]:t.statuses[e]},modelCaches:{...r.modelCaches,[e]:t.modelCaches[e]}}};x.current={...n,payload:i},n.onPayload(i)},[]);ce(e,t?.providers,j,f);let M=(0,q.useCallback)(e=>{let t=x.current;t.payload&&t.onPayload({...t.payload,preferences:e.preferences})},[]),F=E({connection:e,onError:k,onPayload:n,onPreferences:M,onProviders:A,preferences:y(t?.preferences),providers:t?.providers}),L=ge(e,C,w),{projects:R,projectId:z,loading:B,error:V}=L,ee=Se(e,w,JSON.stringify([C?.activeProfile??null,C?.profile?.id??null]),C?.state===`signed_in`),H=C?.baseUrl??C?.activeProfile?.baseUrl,te=H&&w?`${H.replace(/\/$/u,``)}/console/connections?${new URLSearchParams({teamId:w,...z?{project:z}:{}})}`:null,U=u?.provider,W=U?t?.providers.statuses[U]:null,G=u?(0,J.jsx)(be,{agent:u,inventory:i,connection:e,account:C,teamId:w,projects:R,projectId:z,onRefresh:s,learningUrl:te},u.id):null;return(0,J.jsxs)(`section`,{className:`connected-agents-view`,"aria-label":`Continuous learning`,children:[(0,J.jsxs)(`div`,{className:`agent-connections-heading`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Conversation history imports`}),(0,J.jsx)(`p`,{children:`Import existing conversations and manage their original learning setup.`})]}),(0,J.jsxs)(`div`,{className:`agent-connections-actions`,children:[(0,J.jsx)(`button`,{type:`button`,disabled:o||!e,"aria-label":`Refresh agent connections`,onClick:()=>{s(),L.refresh(),p(e=>e+1)},children:(0,J.jsx)(O,{size:15})}),(0,J.jsxs)(`div`,{className:`agent-more`,ref:b,children:[(0,J.jsx)(`button`,{type:`button`,"aria-expanded":_,onClick:()=>v(e=>!e),children:`More agents`}),_?(0,J.jsxs)(`div`,{className:`agent-more-menu`,children:[K.filter(e=>h.includes(e.id)).map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{g(t=>t.filter(t=>t!==e.id)),v(!1)},children:[(0,J.jsx)(D,{size:14}),(0,J.jsx)(`span`,{children:e.name})]},e.id)),h.length===0?(0,J.jsx)(`span`,{children:`All agents shown`}):null]}):null]})]})]}),(0,J.jsxs)(`label`,{className:`agent-project-scope`,children:[`Project`,(0,J.jsx)(I,{label:`Connections project`,value:z,disabled:!R.length,onChange:L.select,searchable:!0,options:[{value:``,label:B&&!R.length?`Fetching projects…`:`Select project`},...R.map(e=>({value:e.id,label:e.content.name}))]})]}),V?(0,J.jsx)(N,{error:V}):null,a?(0,J.jsx)(N,{error:a}):null,c?(0,J.jsx)(N,{error:c}):null,(0,J.jsx)(`div`,{className:`agent-connections-grid`,children:K.filter(e=>!h.includes(e.id)).map(n=>(0,J.jsx)(se,{agent:n,account:C,native:n.provider?t?.providers.statuses[n.provider]:null,inventory:i,projects:R,teamId:w,learningControl:(0,J.jsx)(je,{agent:n,inventory:i,connection:e,teamId:w,projectId:z,projectName:R.find(e=>e.id===z)?.content.name??`Selected Project`,query:ee,signedIn:C?.state===`signed_in`}),connected:!!e,onHide:()=>g(e=>[...e,n.id]),onManage:()=>d(n)},`${JSON.stringify([C?.activeProfile,C?.profile?.id])}:${w}:${z}:${n.id}`))}),i?(0,J.jsxs)(`div`,{className:`agent-importer-footer`,children:[(0,J.jsx)(`span`,{children:i.collector.running?`Import in progress`:`No import running`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>P({kind:`settings`,section:`conversation-imports`}),children:`Conversation import settings`})]}):null,u&&U&&W&&t?(0,J.jsx)(T,{checkNativeProvider:F.checkNativeProvider,connection:e,account:C,codex:t.codex,providerId:U,providerBusy:F.providerBusy,settings:t.providers,status:W,onClose:()=>d(null),onDeleteCredential:F.deleteProviderCredential,onRefreshModels:F.refreshProviderModels,onSaveConfig:F.saveProviderConfig,onSaveCredential:F.saveProviderCredential,onStartOpenAiSubscriptionAuth:F.startOpenAiSubscriptionAuth,onValidate:F.validateProvider,conversationPanel:G}):u?(0,J.jsx)(Fe,{agent:u,onClose:()=>d(null),children:G}):null]})}function Fe({agent:e,onClose:t,children:n}){let r=C(t);return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:t,children:(0,J.jsxs)(`section`,{ref:r,className:`git-dialog provider-details-dialog agent-setup-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`${e.name} connection`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close`,onClick:t,children:(0,J.jsx)(k,{size:16})}),(0,J.jsx)(`div`,{className:`provider-dialog-header`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:e.name}),(0,J.jsx)(`span`,{children:`Conversation syncing`})]})}),n]})})}var Ie=[`For agents`,`Featured`,`Productivity`,`Developer tools`],Le=new Set([`slack`,`google`,`github`,`mcp`]);function Re({account:e,connection:t,defaultTeamId:n,onToast:r,payload:i,onPayload:a}){let[o,s]=(0,q.useState)(`apps`),c=(0,q.useId)(),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(`For agents`),[h,g]=(0,q.useState)(()=>B()),[_,v]=(0,q.useState)(null),y=e?.baseUrl??e?.activeProfile?.baseUrl??null,b=ze(n,_),x=(0,q.useMemo)(()=>h.filter(e=>Ue(e,p)).filter(e=>We(e,d)),[p,d,h]);(0,q.useEffect)(()=>{let e=!0;return!t||o!==`apps`?(g(B()),v(null),()=>{e=!1}):(F.connectedAppStatus(t,{status:`all`}).then(t=>{e&&(g(t.apps),v(t.teamId?.trim()||null))}).catch(t=>{e&&(console.warn(`Unable to load connected app status.`,t),g(B()),v(null))}),()=>{e=!1})},[t,o]);function S(e){Ke(V({appId:e.id,baseUrl:y,teamId:b})).catch(e=>{r?.(e instanceof Error?e.message:String(e),`error`)})}return(0,J.jsxs)(`div`,{className:`apps-workspace-view`,children:[(0,J.jsx)(`div`,{className:`apps-page-tabs`,role:`tablist`,"aria-label":`Apps pages`,onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=e.key===`Home`?`apps`:e.key===`End`?`agents`:o===`agents`?`apps`:`agents`;s(t),e.currentTarget.querySelector(`#${CSS.escape(`${c}-${t}`)}`)?.focus()},children:[{value:`apps`,label:`Apps`},{value:`agents`,label:`Fix-it`}].map(e=>(0,J.jsx)(`button`,{type:`button`,role:`tab`,id:`${c}-${e.value}`,"aria-controls":`${c}-${e.value}-panel`,tabIndex:o===e.value?0:-1,"aria-selected":o===e.value,onClick:()=>s(e.value),children:e.label},e.value))}),(0,J.jsx)(`div`,{role:`tabpanel`,id:`${c}-${o}-panel`,"aria-labelledby":`${c}-${o}`,children:o===`agents`?(0,J.jsx)(Ne,{connection:t,payload:i,onPayload:a,onToast:r},JSON.stringify([e?.activeProfile,n])):(0,J.jsxs)(`section`,{className:`connected-apps-view`,"aria-label":`Apps`,children:[(0,J.jsxs)(`div`,{className:`connected-apps-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{children:`Apps`}),(0,J.jsx)(`p`,{children:`Connect apps that agents can use for chat, knowledge, files, and workflow actions.`})]}),(0,J.jsxs)(`label`,{className:`connected-apps-search`,children:[(0,J.jsx)(L,{size:15}),(0,J.jsx)(`input`,{"aria-label":`Search apps`,onChange:e=>f(e.target.value),placeholder:`Search apps`,type:`search`,value:d})]})]}),(0,J.jsxs)(`section`,{className:`connected-apps-hero`,"aria-label":`App context`,children:[(0,J.jsxs)(`div`,{className:`connected-apps-hero-copy`,children:[(0,J.jsx)(`span`,{className:`connected-apps-hero-icon`,children:(0,J.jsx)(He,{appId:`github`})}),(0,J.jsx)(`h2`,{children:`Work with your apps`}),(0,J.jsx)(`p`,{children:`Bring repositories, documents, chat, calendars, and custom MCP tools into OpenPond.`})]}),(0,J.jsxs)(`div`,{className:`connected-apps-context-card`,"aria-hidden":`true`,children:[(0,J.jsx)(`strong`,{children:`Agent context`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`files`,children:`Files`}),(0,J.jsx)(`span`,{className:`chat`,children:`Chat`}),(0,J.jsx)(`span`,{className:`oauth`,children:`OAuth`}),(0,J.jsx)(`span`,{className:`mcp`,children:`MCP`})]})]})]}),(0,J.jsx)(`div`,{className:`connected-apps-filters`,role:`tablist`,"aria-label":`App categories`,children:Ie.map(e=>(0,J.jsx)(`button`,{"aria-selected":p===e,className:p===e?`active`:``,onClick:()=>m(e),role:`tab`,type:`button`,children:e},e))}),(0,J.jsxs)(`div`,{className:`connected-apps-list`,children:[x.map(e=>(0,J.jsx)(Be,{app:e,onSelect:()=>u(e)},e.id)),x.length===0?(0,J.jsx)(`div`,{className:`connected-apps-empty`,children:`No apps match the current search.`}):null]}),l?(0,J.jsx)(Ve,{app:l,onClose:()=>u(null),onInstall:()=>S(l)}):null]})})]})}function ze(e,t){return e?.trim()||t?.trim()||null}function Be({app:e,onSelect:t}){return(0,J.jsxs)(`button`,{className:`connected-app-row`,onClick:t,type:`button`,children:[(0,J.jsxs)(`span`,{className:`connected-app-row-main`,children:[(0,J.jsx)(He,{appId:e.id}),(0,J.jsxs)(`span`,{className:`connected-app-copy`,children:[(0,J.jsxs)(`span`,{className:`connected-app-title`,children:[(0,J.jsx)(`strong`,{children:e.label}),(0,J.jsxs)(`span`,{children:[e.shortLabel===e.label?e.category:e.shortLabel,` / `,e.setupSurfaceLabel]})]}),(0,J.jsx)(`span`,{children:e.description}),(0,J.jsxs)(`span`,{className:`connected-app-capability-row`,children:[e.capabilityLabels.slice(0,2).map(e=>(0,J.jsx)(`span`,{children:e},e)),e.capabilityLabels.length>2?(0,J.jsxs)(`span`,{children:[`+`,e.capabilityLabels.length-2]}):null]})]})]}),(0,J.jsx)(`span`,{className:`connected-app-status-pill ${e.status}`,children:e.statusLabel}),(0,J.jsx)(x,{size:16})]})}function Ve({app:e,onClose:t,onInstall:n}){let r=e.connections.filter(e=>e.status===`active`);return(0,J.jsx)(`div`,{className:`connected-app-dialog-backdrop`,role:`presentation`,onMouseDown:e=>{e.target===e.currentTarget&&t()},children:(0,J.jsxs)(`section`,{className:`connected-app-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`connected-app-dialog-title`,children:[(0,J.jsx)(`button`,{className:`connected-app-dialog-close`,type:`button`,"aria-label":`Close app details`,onClick:t,children:(0,J.jsx)(k,{size:17})}),(0,J.jsxs)(`div`,{className:`connected-app-dialog-identity`,children:[(0,J.jsx)(`span`,{className:`openpond-mark`,children:(0,J.jsx)(`img`,{alt:``,src:i})}),(0,J.jsxs)(`span`,{className:`connection-dots`,"aria-hidden":`true`,children:[(0,J.jsx)(`span`,{}),(0,J.jsx)(`span`,{}),(0,J.jsx)(`span`,{})]}),(0,J.jsx)(He,{appId:e.id})]}),(0,J.jsxs)(`h2`,{id:`connected-app-dialog-title`,children:[`Connect `,e.label]}),(0,J.jsxs)(`div`,{className:`connected-app-approval`,children:[(0,J.jsx)(R,{size:16}),(0,J.jsx)(`span`,{children:e.statusLabel})]}),(0,J.jsxs)(`div`,{className:`connected-app-dialog-body`,children:[(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:e.setupSurfaceLabel}),(0,J.jsx)(`p`,{children:`The web flow shows the provider account, workspace, and requested access before anything is connected.`})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:`Connected account`}),(0,J.jsx)(`p`,{children:qe(r)})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:`Available capabilities`}),(0,J.jsx)(`div`,{className:`connected-app-dialog-capabilities`,children:e.capabilities.map(e=>(0,J.jsx)(`span`,{children:e.label},e.id))})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:`Sandbox lease policy`}),(0,J.jsx)(`p`,{children:e.leasePolicy.leaseable?`Leaseable for ${e.leasePolicy.defaultTtlSeconds??0} seconds with scoped proxy access.`:`Managed as setup or tool discovery; no OAuth lease is required.`})]})]}),(0,J.jsxs)(`button`,{className:`connected-app-dialog-primary`,type:`button`,onClick:n,children:[(0,J.jsx)(`span`,{children:e.installLabel}),(0,J.jsx)(S,{size:15})]})]})})}function He({appId:e}){return(0,J.jsx)(`span`,{className:`connected-app-icon app-${e}`,children:(0,J.jsx)(`img`,{alt:``,src:Ge(e)})})}function Ue(e,t){return t===`For agents`?!0:t===`Featured`?Le.has(e.id):t===`Productivity`?e.category===`Productivity`||e.category===`Chat`:e.category===`Developer tools`||e.id===`mcp`}function We(e,t){let n=t.trim().toLowerCase();return!n||[e.id,e.label,e.shortLabel,e.category,e.description,e.providerFamily,e.setupSurface].some(e=>e.toLowerCase().includes(n))}function Ge(e){return n(e)}async function Ke(e){let t=window.openpond?.browser;if(t){let n=await t.openExternal({conversationId:`connected-apps`,url:e});if(!n.ok)throw Error(n.error??`Unable to open app setup.`)}else window.open(e,`_blank`,`noopener,noreferrer`)}function qe(e){return e.length===0?`No active OAuth connection for this setup surface.`:e.map(e=>{let t=e.accountLabel??`Connected account`;return e.workspaceLabel?`${t} / ${e.workspaceLabel}`:t}).join(`, `)}export{Re as AppsView};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,l as n,m as r,s as i}from"./index-DG0kf1wK.js";import{P as a,t as o}from"./useQuery-CKHqHSr0.js";import{a as s,c,d as l,m as u,o as d,p as f,r as p,v as m}from"./schemas-Brv9Vmnk.js";import{U as h,d as g,i as _,it as v}from"./chunk-H3JZ3P5T-DolwEJXo.js";import{C as y}from"./app-models-BUdzQbXo.js";import{n as b}from"./api-client-DJRVOFzS.js";import"./icons-nr5d1kC-.js";import{t as x}from"./chevron-right-BKelERU6.js";import{t as S}from"./external-link-DymjzX8a.js";import{a as C,i as w,n as T,t as E}from"./settings-lists-Cca729es.js";import{t as D}from"./plus-D6oFNFQ0.js";import{t as O}from"./refresh-cw-avBifyns.js";import{t as k}from"./x-CQ0pGF6Q.js";import{r as A}from"./AppToastContext-DyaZYQXu.js";import{t as j}from"./NativeSetupTerminal-BXvrxj-m.js";import{At as M,Gt as N,Nt as P,Tn as F,Ut as I,Xt as L,hn as R,kt as z,mr as B,pr as V,zt as ee}from"./App-CqqK4NLa.js";import{Ct as H,St as te}from"./MainPane-aEELnEKb.js";import{i as U,n as W,r as G,t as ne}from"./client-BO8YuI8Z.js";import{n as K,r as re,t as ie}from"./useAgentInventory-8MWE3pbH.js";/* empty css */var q=e(t(),1),J=r();function ae({context:e,baseUrl:t,onClose:n}){let[r,i]=(0,q.useState)(`claude_code`),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(null),l=C(n);A(s);async function u(){try{await navigator.clipboard.writeText(`Read ${new URL(`/agent-setup.md`,t).href} and connect ${ne(r)} tool capture to my private saved Fix-it dataset. Reuse my existing OpenPond home and account and select workspace ${e.teamId}. Inspect openpond tool-learning --help and the Model commands. Reuse an owner-controlled private capture Model, or create one if needed, without activating training. All my connected agents should contribute to the same Fix-it dataset. I consent to bounded, sanitized tool arguments, error excerpts and follow-up actions from the workspace I select being saved as dataset records until I remove them; raw capture buffers retain their separate bounded retention. Confirm the actual client version and exact permitted tool names, then use tool-learning setup --client ${r} --team-id ${e.teamId} --project-id <private-capture-model> --workspace <chosen-workspace> --environment-file <bounded-context-file> --tools <exact-tool-names> --allow-upload with my existing home/account. Preserve unrelated hooks and permissions. ${r===`codex`?`Use the installed openpond-fix-it skill and tool-learning run for captured Codex CLI tasks; ordinary Codex desktop chats are outside this connection.`:``} Use doctor to verify observed capture and inspect the uploaded records through the normal dataset commands. Do not import conversation history, start OpenPond inference or training, provision compute, or activate a specialist.`),c(null),o(!0)}catch{c(`The setup prompt could not be copied. Please retry.`)}}return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:n,children:(0,J.jsxs)(`section`,{ref:l,className:`git-dialog provider-details-dialog agent-setup-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Connect Fix-it`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{className:`git-dialog-close`,"aria-label":`Close`,onClick:n,children:(0,J.jsx)(k,{size:16})}),(0,J.jsx)(`div`,{className:`provider-dialog-header`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Connect Fix-it`}),(0,J.jsx)(`span`,{children:`Tool capture to your saved dataset`})]})}),(0,J.jsxs)(`div`,{className:`provider-dialog-body`,children:[(0,J.jsx)(`div`,{className:`agent-sync-form`,children:(0,J.jsxs)(`label`,{children:[`Coding agent`,(0,J.jsx)(I,{label:`Fix-it coding agent`,value:r,onChange:e=>{i(e),o(!1)},options:[{value:`claude_code`,label:`Claude Code`},{value:`opencode`,label:`OpenCode`},{value:`codex`,label:`Codex CLI`},{value:`openpond`,label:`OpenPond`}]})]})}),r===`codex`?(0,J.jsx)(`p`,{className:`provider-dialog-note`,children:`Captures tasks launched through the installed Codex CLI skill. Existing desktop chats are outside this connection.`}):null,(0,J.jsx)(`div`,{className:`settings-button-row`,children:(0,J.jsx)(`button`,{className:`agent-connect-button`,onClick:()=>void u(),children:a?`Setup prompt copied`:`Copy capture setup prompt`})}),(0,J.jsx)(`p`,{className:`provider-dialog-note`,children:`Paste this into your agent in the workspace you want to connect. Captures stay in your saved dataset until removed. Training stays off.`})]})]})})}function oe({context:e,baseUrl:t}){let n=W(e),r=G(e),[i,a]=(0,q.useState)(!1);A(n.error);let o=n.data,s=r.data?.installations.filter(e=>e.state!==`revoked`)??[];function c(){n.refetch(),r.refetch()}return(0,J.jsxs)(`section`,{className:`connected-agents-view`,"aria-label":`Fix-it connections`,children:[(0,J.jsxs)(`header`,{className:`agent-connections-heading`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Fix-it`}),(0,J.jsx)(`p`,{children:`Tool errors from all your connected agents go to one private saved dataset.`})]}),(0,J.jsxs)(`div`,{className:`agent-connections-actions`,children:[(0,J.jsx)(`button`,{onClick:c,disabled:n.isFetching||r.isFetching,children:`Refresh`}),(0,J.jsx)(`button`,{className:`agent-connect-button`,onClick:()=>a(!0),children:`Connect agent`})]})]}),(0,J.jsxs)(`div`,{className:`evaluation-card`,children:[(0,J.jsxs)(`h3`,{children:[`Destination: `,o?.name??`Fix-it`]}),(0,J.jsx)(`p`,{role:`status`,"aria-live":`polite`,children:o?`${o.taskCount??0} saved ${o.taskCount===1?`record`:`records`}`:n.isPending?`Loading dataset…`:n.error?null:`No capture dataset available`}),(0,J.jsx)(`button`,{className:`training-text-button`,disabled:!o,onClick:()=>o&&void P({kind:`models`,route:ee(`datasets`,null,{area:`console`,resourceId:o.id,detailTab:`tasks`,projectId:null,executionLocation:`hosted`})}),children:`Open dataset`}),n.error?(0,J.jsx)(`button`,{className:`training-text-button`,onClick:()=>void n.refetch(),children:`Retry`}):null]}),(0,J.jsx)(`div`,{className:`evaluation-table-scroll evaluation-table-frame`,children:(0,J.jsxs)(`table`,{className:`training-data-table evaluation-workspace-table`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:`Agent`}),(0,J.jsx)(`th`,{children:`Capture`}),(0,J.jsx)(`th`,{children:`Tools`}),(0,J.jsx)(`th`,{children:`Dataset`})]})}),(0,J.jsxs)(`tbody`,{children:[s.map(e=>(0,J.jsxs)(`tr`,{children:[(0,J.jsxs)(`td`,{children:[(0,J.jsx)(`div`,{children:ne(e.client)}),(0,J.jsx)(`small`,{children:e.clientVersion})]}),(0,J.jsx)(`td`,{children:e.state===`enabled`?`Enabled`:`Paused`}),(0,J.jsx)(`td`,{children:e.collectionPolicy.permittedTools.join(`, `)}),(0,J.jsx)(`td`,{children:o?.name??`Fix-it`})]},e.id)),(0,J.jsx)(U,{columns:4,loading:r.isPending,error:r.error?.message,retry:()=>void r.refetch(),empty:!s.length,children:`Connect a coding agent to start capturing tool errors.`})]})]})}),(0,J.jsx)(`p`,{className:`evaluation-meta-line`,children:`Captures are saved as dataset records. Recovery candidates need separate review before training.`}),i?(0,J.jsx)(ae,{context:e,baseUrl:t,onClose:()=>a(!1)}):null]})}function se({agent:e,account:t,native:n,inventory:r,projects:i,teamId:a,learningControl:o,connected:s,onHide:c,onManage:l}){let u=r?.collector.connections.filter(t=>t.source===e.id)??[],d=r?.sources.some(t=>t.source===e.id&&t.available&&t.capabilities.history);return(0,J.jsxs)(`article`,{className:`agent-connection-card`,"aria-label":e.name,children:[(0,J.jsxs)(`div`,{className:`agent-card-title`,children:[(0,J.jsx)(`img`,{src:e.icon,alt:``}),(0,J.jsx)(`span`,{children:e.name}),(0,J.jsx)(`button`,{type:`button`,className:`agent-hide`,"aria-label":`Hide ${e.name}`,onClick:c,children:(0,J.jsx)(k,{size:14})})]}),e.id===`openpond_chat`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`small`,{children:t?.state===`signed_in`?`Connected to OpenPond`:`Sign in to OpenPond`}),(0,J.jsx)(`p`,{children:`Use Pal from the sidebar.`}),(0,J.jsx)(`button`,{type:`button`,className:`agent-account-link`,onClick:()=>void P({kind:`settings`,section:`account`}),children:`Account setup`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`small`,{children:n?n.available?n.enabled?`Ready to chat`:`Installed · chat disabled`:n.lastError??`Check installation`:`Conversation import`}),(0,J.jsx)(`button`,{type:`button`,className:`agent-connect-button`,disabled:!s,onClick:l,children:n?.available||u.length?`Manage`:`Connect`}),(0,J.jsx)(`div`,{className:`agent-card-sync`,children:u.length?u.map(e=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{children:re(e,r.collector)}),(0,J.jsxs)(`small`,{children:[i.find(t=>t.id===e.projectId&&e.teamId===a)?.content.name??e.projectId,` `,`· `,e.admitted,` tasks`]}),e.teamId===a?null:(0,J.jsxs)(`small`,{children:[`Team: `,e.teamId]}),e.queued?(0,J.jsxs)(`small`,{children:[e.queued,` updates queued`]}):null,e.lastAdmissionAt?(0,J.jsxs)(`small`,{children:[`Last sync: `,new Date(e.lastAdmissionAt).toLocaleString()]}):null,e.error?(0,J.jsx)(N,{error:e.error}):null]},e.id)):(0,J.jsx)(`small`,{children:r?d?`History available · sync not connected`:`No local history found`:`Reading local setup…`})})]}),o]})}function ce(e,t,n,r){let i=(0,q.useRef)({providers:t,onProvider:n});i.current={providers:t,onProvider:n};let a=JSON.stringify([`claude-code`,`opencode`,`grok-build`].map(e=>{let n=t?.providers[e];return[e,n?.binaryPath,n?.sourceHome,n?.enabled]}));(0,q.useEffect)(()=>{if(!e||!i.current.providers)return;let t=!1,n=[`claude-code`,`opencode`,`grok-build`].map(n=>{let a=i.current.providers?.providers[n],o=new AbortController,s=r>0?{promise:b(e,`/v1/providers/${n}/native-setup`,{method:`POST`,body:JSON.stringify({action:`check`}),signal:o.signal}),release:()=>o.abort()}:te(e,n,i.current.providers?.providers[n]);return s.promise.then(o=>{t||(r>0&&o.session&&!o.error&&H(e,n,o,a),i.current.onProvider(n,o.settings))},()=>{}),s});return()=>{t=!0,n.forEach(e=>e.release())}},[e,a,r])}var Y=m().trim().min(1).max(240),le=f().int().positive(),ue=p([`dataset`,`evaluator`,`model`,`training_configuration`,`training_run`,`harness`,`environment`,`experiment`,`learning_policy`,`deployment`]),de=u({kind:ue,resourceId:Y,release:_.nullable(),role:p([`training`,`validation`,`holdout`,`target`,`reward`,`evaluation`,`serving`,`source`])}).strict(),fe=c(`kind`,[u({kind:l(`model`),providerId:Y,modelId:Y,artifact:_.nullable(),messages:s(u({role:p([`system`,`user`,`assistant`]),content:m().max(1e5)}).strict()).max(100)}).strict(),u({kind:l(`harness`),profileRepositoryId:Y,source:v}).strict(),u({kind:l(`agent`),source:h}).strict(),u({kind:l(`suite`),profileRepositoryId:Y,suiteId:Y,sources:s(v).min(1).max(1e3)}).strict().superRefine((e,t)=>{let n=e.sources[0],r=new Set;for(let[i,a]of e.sources.entries())r.has(a.definitionId)&&t.addIssue({code:`custom`,path:[`sources`,i],message:`Suite definitions must be unique.`}),r.add(a.definitionId),(a.profileId!==n.profileId||a.sourceRevision!==n.sourceRevision||a.catalogHash!==n.catalogHash||g(a.harnessRelease)!==g(n.harnessRelease))&&t.addIssue({code:`custom`,path:[`sources`,i],message:`Suite checks must belong to the same pinned Profile source and Harness release.`})})]),pe=u({name:m().trim().min(1).max(200),description:m().max(1e4),targets:s(u({id:Y,name:m().trim().min(1).max(200),target:fe}).strict()).max(100),defaultTargetId:Y.nullable(),resources:s(de).max(1e3)}).strict().superRefine((e,t)=>{new Set(e.targets.map(e=>e.id)).size!==e.targets.length&&t.addIssue({code:`custom`,path:[`targets`],message:`Target identities must be unique.`}),e.defaultTargetId&&!e.targets.some(t=>t.id===e.defaultTargetId)&&t.addIssue({code:`custom`,path:[`defaultTargetId`],message:`Default target must belong to this Project.`}),new Set(e.resources.map(e=>g(e))).size!==e.resources.length&&t.addIssue({code:`custom`,path:[`resources`],message:`Resource links must be unique.`})}),me=u({schemaVersion:l(`openpond.trainingProject.v1`),id:Y,teamId:Y,creatorUserId:Y,ownerScope:p([`workspace`,`personal`]).optional(),revision:le,content:pe,archived:d(),createdAt:m().datetime(),updatedAt:m().datetime()}).strict();u({operationId:Y,id:Y,expectedRevision:f().int().nonnegative(),content:pe,ownerScope:p([`workspace`,`personal`]).optional()}).strict(),u({operationId:Y,expectedRevision:le,archived:d()}).strict();var he=u({teamId:Y,projects:s(me).max(100),nextCursor:Y.nullable()}).strict();u({operation:p([`evaluate`,`train`,`enable_learning`,`accept_candidate`,`serve`]),support:p([`supported`,`unsupported`]),state:p([`ready`,`needs_setup`,`blocked`]),reasons:s(u({code:Y,message:m().min(1).max(2e3),field:m().nullable(),action:p([`choose_target`,`choose_data`,`choose_evaluator`,`configure_runtime`,`request_access`,`configure_budget`,`wait`,`review_evidence`]).nullable()}).strict()).max(100)}).strict().superRefine((e,t)=>{e.state===`ready`&&(e.support!==`supported`||e.reasons.length)&&t.addIssue({code:`custom`,message:`Ready operations must be supported with no blockers.`}),e.state!==`ready`&&!e.reasons.length&&t.addIssue({code:`custom`,message:`Unavailable operations must explain the next step.`})});var X=new WeakMap;function ge(e,t,n){let r=JSON.stringify([t?.activeProfile,t?.profile?.id,n]),i=e?X.get(e)?.get(r):void 0,[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(null),[l,u]=(0,q.useState)(!1),[d,f]=(0,q.useState)(0),p=t?.state===`signed_in`?a?.key===r&&a.connection===e?a.value:i:void 0;(0,q.useEffect)(()=>{if(!e||!n||t?.state!==`signed_in`)return;let i=new AbortController;u(!0),c(null);async function a(){let t=[],a=new Set,s;do{let r=he.parse(await b(e,`/v1/training/evaluation-workspace`,{method:`POST`,body:JSON.stringify({teamId:n,operation:`projects`,value:{cursor:s}}),signal:i.signal}));if(r.teamId!==n)throw Error(`The hosted project workspace changed. Refresh connections.`);if(t.push(...r.projects.filter(e=>!e.archived)),s=r.nextCursor??void 0,s&&a.has(s))throw Error(`Project pagination stalled. Refresh connections.`);s&&a.add(s)}while(s&&!i.signal.aborted);if(i.signal.aborted)return;let c=X.get(e);c||(c=new Map,X.set(e,c));let l=c.get(r)?.selected,u={projects:t,selected:l&&t.some(e=>e.id===l)?l:t.length===1?t[0].id:``};c.set(r,u),o({key:r,connection:e,value:u})}return a().catch(e=>{i.signal.aborted||c(e instanceof Error?e.message:`Unable to list hosted projects.`)}).finally(()=>{i.signal.aborted||u(!1)}),()=>i.abort()},[e,r,n,t?.state,d]);let m=(0,q.useCallback)(t=>{if(!e)return;let n=X.get(e)?.get(r);if(!n||!n.projects.some(e=>e.id===t))return;let i={...n,selected:t};X.get(e).set(r,i),o({key:r,connection:e,value:i})},[e,r]);return{projects:p?.projects??[],projectId:p?.selected??``,select:m,error:s,loading:l,refresh:()=>f(e=>e+1)}}var _e=e(M(),1),ve=e(z(),1);function ye({connection:e,connectionId:t,disabled:n,projectName:r,onUpload:i,onClose:a}){let[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(`all`),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(()=>new Map),[m,h]=(0,q.useState)(!0),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(0);w(e,g,()=>y(e=>e+1));let x=(0,q.useRef)(null),S=(0,q.useRef)(0);(0,q.useEffect)(()=>{let n=new AbortController;x.current?.abort(),x.current=n,h(!0),d(null),_(null);let r=window.setTimeout(()=>{let r=v!==S.current;S.current=v,b(e,`/v1/native-history/collector`,{method:`POST`,signal:n.signal,body:JSON.stringify({command:`conversations`,connectionId:t,query:o,range:c,refresh:r})}).then(e=>{n.signal.aborted||d(e)}).catch(e=>{n.signal.aborted||_(e instanceof Error?e.message:`Unable to list conversations.`)}).finally(()=>{n.signal.aborted||h(!1)})},200);return()=>{window.clearTimeout(r),n.abort(),x.current?.abort()}},[e,t,o,c,v]);async function C(){if(m||u?.nextOffset==null)return;let n=new AbortController;x.current=n,h(!0),_(null);try{let r=await b(e,`/v1/native-history/collector`,{method:`POST`,signal:n.signal,body:JSON.stringify({command:`conversations`,connectionId:t,query:o,range:c,offset:u.nextOffset})});n.signal.aborted||d(e=>({...r,items:[...new Map([...e?.items??[],...r.items].map(e=>[e.key,e])).values()]}))}catch(e){n.signal.aborted||_(e instanceof Error?e.message:`Unable to load more conversations.`)}finally{n.signal.aborted||h(!1)}}function T(e,t){p(n=>{let r=new Map(n);return t?r.set(e.key,e):r.delete(e.key),r})}let E=u?.items??[],D=E.filter(e=>!e.issue),O=D.length>0&&D.every(e=>f.has(e.key)),k=new Set(E.map(e=>e.key)),A=[...f.keys()].filter(e=>!k.has(e)).length;return(0,J.jsxs)(`section`,{className:`conversation-upload-picker`,"aria-label":`Choose conversations to upload`,children:[(0,J.jsx)(`h3`,{children:`Choose conversations`}),(0,J.jsxs)(`p`,{children:[`Upload to `,(0,J.jsx)(`strong`,{children:r}),`. This selection also sets which conversations later syncs update. Previously uploaded data stays in the project.`]}),(0,J.jsxs)(`div`,{className:`conversation-upload-toolbar`,children:[(0,J.jsx)(`input`,{autoFocus:!0,type:`search`,"aria-label":`Search conversations`,placeholder:`Search title, folder, or session ID`,value:o,disabled:n,onChange:e=>s(e.target.value)}),(0,J.jsx)(I,{label:`Conversation activity`,value:c,disabled:n,onChange:l,options:[{value:`all`,label:`All dates`},{value:`week`,label:`Active last week`},{value:`day`,label:`Active last day`}]})]}),(0,J.jsxs)(`div`,{className:`conversation-upload-selection`,role:`status`,children:[(0,J.jsxs)(`span`,{children:[f.size,` selected`,A?` · ${A} outside this view`:``,u?` · ${u.total} matching`:``]}),(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||m,onClick:()=>y(e=>e+1),children:`Refresh`}),(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||!f.size,onClick:()=>p(new Map),children:`Clear selection`})]}),(0,J.jsx)(`div`,{className:`evaluation-table-scroll evaluation-table-frame conversation-upload-table`,children:(0,J.jsxs)(`table`,{className:`training-data-table evaluation-workspace-table`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:(0,J.jsx)(`input`,{type:`checkbox`,className:`training-chat-checkbox`,"aria-label":`Select visible conversations`,checked:O,disabled:n||m||!D.length,onChange:e=>{let t=e.target.checked;p(e=>{let n=new Map(e);return D.forEach(e=>{t?n.set(e.key,e):n.delete(e.key)}),n})}})}),(0,J.jsx)(`th`,{children:`Conversation`}),(0,J.jsx)(`th`,{children:`Last activity`})]})}),(0,J.jsxs)(`tbody`,{children:[E.map(e=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsx)(`input`,{type:`checkbox`,className:`training-chat-checkbox`,"aria-label":`Select ${e.title}`,checked:f.has(e.key),disabled:n||!!e.issue,onChange:t=>T(e,t.target.checked)})}),(0,J.jsxs)(`td`,{children:[(0,J.jsx)(`span`,{className:`conversation-upload-title`,title:e.title,children:e.title}),(0,J.jsx)(`small`,{title:e.cwd??e.nativeSessionId,children:e.cwd??e.nativeSessionId}),e.issue?(0,J.jsx)(`small`,{role:`status`,children:e.issue}):e.approved?(0,J.jsx)(`small`,{children:`Already approved for sync`}):null]}),(0,J.jsx)(`td`,{children:(0,J.jsx)(`time`,{dateTime:e.updatedAt,children:new Date(e.updatedAt).toLocaleDateString()})})]},e.key)),m?(0,J.jsx)(`tr`,{children:(0,J.jsx)(`td`,{colSpan:3,role:`status`,children:`Loading conversations…`})}):!E.length&&!g?(0,J.jsx)(`tr`,{children:(0,J.jsx)(`td`,{colSpan:3,children:o.trim()||c!==`all`?`No conversations match these filters.`:`No saved conversations found in this installation.`})}):null]})]})}),g?(0,J.jsx)(N,{error:g,children:(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||m,onClick:()=>y(e=>e+1),children:`Retry`})}):null,u?.nextOffset==null?null:(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n||m,onClick:()=>void C(),children:`Load more conversations`}),(0,J.jsx)(`p`,{children:`The complete selected conversations are uploaded, including their prompts, responses, and tool history. Date filters help you find conversations; they do not trim their contents.`}),(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,className:`agent-connect-button`,disabled:n||!f.size,onClick:()=>void i([...f.keys()]),children:`Upload ${f.size} conversation${f.size===1?``:`s`}`}),(0,J.jsx)(`button`,{type:`button`,className:`settings-secondary`,disabled:n,onClick:a,children:`Cancel`})]})]})}_e.default.extend(ve.default);function be({agent:e,inventory:t,connection:n,account:r,teamId:i,projects:a,projectId:o,onRefresh:s,learningUrl:c}){let l=t?.sources.filter(t=>t.source===e.id)??[],[u,d]=(0,q.useState)(l.length===1?l[0].instanceId:``),[f,p]=(0,q.useState)(o),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(!1),[x,S]=(0,q.useState)(null),C=l.find(e=>e.instanceId===u)??(!u&&l.length===1?l[0]:void 0),w=t?.collector.connections.filter(t=>t.source===e.id)??[],T=r?.baseUrl??r?.activeProfile?.baseUrl,E=r?.apiBaseUrl;async function D(e,t,r){if(!(!n||v||g)){y(!0),S(null);try{let a=await b(n,`/v1/native-history/collector`,{method:`POST`,body:JSON.stringify({command:e,...t?{connectionId:t}:{},...r?{sessionKeys:r}:{},...e===`connect`?{setup:{sourceInstanceId:C?.instanceId,teamId:i,projectId:f,accountBaseUrl:T,apiBaseUrl:E,range:`all`}}:{}})});a.command?_(a.command):await s()}catch(e){S(e instanceof Error?e.message:`Unable to update this connection.`)}finally{y(!1)}}}let O=v||g!==null,k=w.find(e=>e.id===m),A=g&&n?(0,J.jsx)(j,{connection:n,command:g,onComplete:()=>{_(null),h(null),s()},onClose:()=>{_(null),s()}}):null;return k&&n?(0,J.jsxs)(`div`,{className:`agent-conversation-setup provider-dialog-body`,children:[(0,J.jsx)(ye,{connection:n,connectionId:k.id,projectName:a.find(e=>e.id===k.projectId&&k.teamId===i)?.content.name??k.projectId,disabled:O||!!t?.collector.running,onClose:()=>h(null),onUpload:e=>D(`upload`,k.id,e)},k.id),x?(0,J.jsx)(N,{error:x}):null,A]}):(0,J.jsxs)(`div`,{className:`agent-conversation-setup provider-dialog-body`,children:[(0,J.jsxs)(`p`,{children:[`Sync saved `,e.name,` conversations to an existing OpenPond project. Connecting authorizes the destination. Choose conversations and confirm an upload when ready.`]}),w.map(n=>(0,J.jsxs)(`section`,{className:`agent-retained-connection`,"aria-label":`${e.name} sync connection`,children:[(0,J.jsx)(`strong`,{children:re(n,t.collector)}),(0,J.jsxs)(`span`,{children:[`Project:`,` `,n.teamId===i?a.find(e=>e.id===n.projectId)?.content.name??n.projectId:n.projectId,` `,`· Team: `,n.teamId]}),(0,J.jsx)(`small`,{children:n.accountBaseUrl??`Hosted destination`}),(0,J.jsx)(`small`,{className:`agent-source-path`,children:n.sourceRoot}),(0,J.jsxs)(`span`,{children:[n.admitted,` tasks imported · `,n.queued,` updates queued`]}),(0,J.jsx)(`small`,{children:n.selectedConversations===null?`All history approved for sync`:`${n.selectedConversations} conversations approved for sync`}),n.backfill.total>0&&n.backfill.stage!==`complete`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`progress`,{"aria-label":`History import progress`,value:n.backfill.admitted+n.backfill.skipped,max:n.backfill.total}),(0,J.jsxs)(`small`,{children:[n.backfill.admitted+n.backfill.skipped,` of`,` `,n.backfill.total,` conversations processed`]})]}):null,(0,J.jsx)(`small`,{children:n.lastAdmissionAt?`Last synced ${(0,_e.default)(n.lastAdmissionAt).fromNow()}`:`No uploads acknowledged yet`}),n.error?(0,J.jsx)(N,{error:n.error}):null,(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,className:`agent-connect-button`,disabled:O||n.state!==`active`||t?.collector.running,onClick:()=>h(n.id),children:`Choose conversations…`}),n.state===`disconnected`?(0,J.jsx)(`button`,{type:`button`,disabled:O,onClick:()=>void D(`reconnect`,n.id),children:`Reconnect`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`button`,{type:`button`,disabled:O,onClick:()=>void D(n.state===`paused`?`resume`:`pause`,n.id),children:n.state===`paused`?`Resume`:`Pause`}),(0,J.jsx)(`button`,{type:`button`,disabled:O,onClick:()=>{window.confirm(`Disconnect this conversation source? Imported data stays in its project.`)&&D(`disconnect`,n.id)},children:`Disconnect`})]}),n.destinationLinks.tasks?(0,J.jsx)(`a`,{href:n.destinationLinks.tasks,target:`_blank`,rel:`noreferrer`,children:`View tasks`}):null,n.destinationLinks.conversations?(0,J.jsx)(`a`,{href:n.destinationLinks.conversations,target:`_blank`,rel:`noreferrer`,children:`View conversations`}):null]})]},n.id)),(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),D(`connect`)},className:`agent-sync-form`,children:[(0,J.jsx)(`h3`,{children:w.length?`Add another connection`:`Connect conversations`}),(0,J.jsxs)(`label`,{className:`agent-source-field`,children:[`Source installation`,(0,J.jsx)(I,{label:`Source installation`,value:C?.instanceId??``,disabled:O,onChange:d,options:[{value:``,label:`Select installation`},...l.map(e=>({value:e.instanceId,label:e.root,disabled:!e.available||!e.capabilities.history}))]})]}),C?.reason?(0,J.jsx)(`small`,{children:C.reason}):null,l.some(e=>e.available&&e.capabilities.history)?null:(0,J.jsxs)(`small`,{children:[`No readable conversation history found.`,` `,e.provider?`Use Agent setup to check the installation, or create a conversation in this agent first.`:`Open this agent and create a conversation, then refresh connections.`]}),(0,J.jsxs)(`label`,{children:[`Project`,(0,J.jsx)(I,{label:`Upload destination project`,value:f,disabled:O||!i,onChange:p,searchable:!0,options:[{value:``,label:`Select project`},...a.map(e=>({value:e.id,label:e.content.name}))]})]}),(0,J.jsx)(`p`,{children:`No conversations are uploaded during setup. Continual imports are off by default and can be scheduled after choosing conversations.`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>P({kind:`settings`,section:`conversation-imports`}),children:`Manage continual imports in Settings`}),r?.state!==`signed_in`||!i?(0,J.jsx)(`small`,{children:`Sign in and select a default team in Account settings to choose a hosted project.`}):null,(0,J.jsx)(`button`,{type:`submit`,className:`agent-connect-button`,disabled:O||!C?.available||!C.capabilities.history||!a.some(e=>e.id===f)||!i||!T||!E||r?.state!==`signed_in`,children:v?`Opening setup…`:`Connect conversations`})]}),c?(0,J.jsx)(`a`,{className:`agent-learning-link`,href:c,target:`_blank`,rel:`noreferrer`,children:`Configure continual learning in Console`}):null,t?(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`CLI setup`}),(0,J.jsxs)(`small`,{className:`agent-source-path`,children:[`Importer directory: `,t.directory]}),(0,J.jsx)(`code`,{children:t.statusCommand})]}):null,x?(0,J.jsx)(N,{error:x}):null,A]})}var Z=e=>JSON.stringify([e.origin,e.sourceInstanceId]),xe=e=>({id:e.id,revision:e.revision,contentHash:e.contentHash});function Q(e,t,n,r,i){return b(e,`/v1/conversation-learning/${n}?${new URLSearchParams({teamId:t})}`,{method:r===void 0?`GET`:`POST`,...r===void 0?{}:{body:JSON.stringify(r)},signal:i})}function Se(e,t,n,r){let i=a(),s=[`native-conversation-learning`,e?.serverUrl,n,t];return{...o({queryKey:s,enabled:!!(e&&t&&r),queryFn:({signal:n})=>Q(e,t,`options`,void 0,n),staleTime:15e3,refetchInterval:3e4}),refresh:()=>i.invalidateQueries({queryKey:s})}}function Ce(e,t,n,r,i){return Q(e,t,`policies`,{...n?{id:n.id}:{},expectedRevision:n?.revision??0,configuration:r,enabled:i})}function $(e,t,n=[]){let r=t?.configuration;return{projectId:e,name:r?.name??`Continuous learning`,mode:r?.mode??`activate`,definition:r?.definition??null,configurationId:r?.configuration?.id??``,trainingPolicyId:r?.learningPolicy?.id??``,graderIds:[],sourceKeys:[...new Set([...r?.sources.filter(e=>e.enabled).map(Z)??[],...n.map(Z)])],adapter:r?.adapter??{kind:`complete_text`,qualitativeOnly:!0},generator:r?.generator??null,graderSelection:r?.graderSelection??(t?{mode:`manual`}:{mode:`auto`,modelId:`gpt-6-luna`,sampleSize:8,maximumOutputTokens:2048,maximumSpendUsd:1}),schedule:r?.schedule??{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,hour:2,minute:0,endHour:6,endMinute:0},limits:r?.limits??{perCycleUsd:5,dailyUsd:5,monthlyUsd:25,gradeUsd:.2,maximumTasks:10,minimumExamples:5,maxGpuSeconds:10800,maximumAttempts:2,lookbackDays:30},exceptions:r?.exceptions??`block`,minimumScore:r?.minimumScore??.8,selection:r?.selection??{maximumSourceShare:1,maximumFailureShare:1,maximumLengthShare:1,replayFraction:.2,auditFraction:.1},acceptance:r?.acceptance??{minimumCasesPerCheck:20,minimumImprovement:.05,windowCasesPerCheck:20},failurePolicy:r?.failurePolicy??{pauseAfterConsecutiveFailures:3},...r?.serving?{serving:r.serving}:{serving:{targetId:``,canarySeconds:120,rollbackOnRuntimeFailure:!0}}}}function we(e,t){let n=e?.configurations.find(e=>e.id===t);return e?.trainingPolicies.filter(e=>e.modelProjectId===n?.portableProjectId&&e.training.recipe.id===`model-recipe-${n?.etag}`&&!e.id.startsWith(`conversation-training-`))??[]}async function Te(e,t,n,r,i,a){let o=r.configurations.find(e=>e.id===n.configurationId),s=we(r,n.configurationId).find(e=>e.id===n.trainingPolicyId);if(!n.name.trim())throw Error(`Enter a policy name.`);if(!r.projects.some(e=>e.id===n.projectId))throw Error(`This owned Project is unavailable for continuous learning.`);if(n.configurationId&&(!o||!r.projects.find(e=>e.id===n.projectId)?.configurationIds.includes(o.id)))throw Error(`Choose a model configuration attached to this Project.`);if(n.mode!==`evaluate`&&(!o||!s))throw Error(`Choose an owned model and its reviewed training setup.`);if(n.limits.perCycleUsd>n.limits.dailyUsd||n.limits.dailyUsd>n.limits.monthlyUsd)throw Error(`Daily and monthly spending limits must cover the run limit.`);if(n.limits.minimumExamples>n.limits.maximumTasks-Math.floor(n.limits.maximumTasks*(n.selection?.replayFraction??0)))throw Error(`Leave capacity for the minimum new examples after replay.`);let c=r.sources.filter(e=>e.projectId===n.projectId&&n.sourceKeys.includes(Z(e)));if(!c.length)throw Error(`Select a source agent for this Project.`);let l=[...(i?.configuration.sources??[]).filter(e=>!c.some(t=>Z(t)===Z(e))).map(e=>({...e,enabled:!1})),...c.map(e=>({origin:e.origin,sourceInstanceId:e.sourceInstanceId,enabled:!0}))],u=n.definition;if(o&&(i?.configuration.configuration?.id!==o.id||i.configuration.configuration.expectedEtag!==o.etag))u=await Q(e,t,`definitions`,{projectId:n.projectId,configuration:{id:o.id,expectedRevision:o.revision,expectedEtag:o.etag}});else if(n.graderIds.length){let i=r.graders.flatMap(e=>e&&n.graderIds.includes(e.id)?[xe(e)]:[]);u=await Q(e,t,`definitions`,{projectId:n.projectId,graders:i})}if(!u)throw Error(`Select evaluation rubrics or an existing task definition.`);let d=n.serving,f=r.servingTargets.find(e=>e.id===d?.targetId);if(n.mode===`activate`&&d?.targetId&&(!f||!f.enabled||f.projectId!==n.projectId))throw Error(`Select an available serving target in this Project.`);if(n.mode===`activate`&&(!d?.targetId||f?.hostedPonder)&&(d={targetId:(await Q(e,t,`serving-targets`,{action:`ensure_hosted_ponder`,projectId:n.projectId,bindingId:r.ponderBindingId})).id,canarySeconds:d?.canarySeconds??120,rollbackOnRuntimeFailure:!0}),n.mode===`activate`&&!d?.targetId)throw Error(`Choose a serving target, or enable the policy to register hosted Pal.`);let{sourceKeys:p,configurationId:m,trainingPolicyId:h,graderIds:g,..._}=n,v={..._,name:n.name.trim(),definition:u,sources:l,configuration:o?{id:o.id,expectedRevision:o.revision,expectedEtag:o.etag}:null,learningPolicy:s?xe(s):null,...n.mode===`activate`?{serving:d}:{}};return n.mode!==`activate`&&delete v.serving,n.mode===`evaluate`&&delete v.acceptance,Ce(e,t,i,v,a)}function Ee({draft:e,options:t,loading:n,onChange:r}){let i=t?.sources.filter(t=>t.projectId===e.projectId)??[],a=i.filter(e=>[`active`,`paused`].includes(e.state)),o=a.length>0&&a.every(t=>e.sourceKeys.includes(Z(t))),s=t=>r({...e,sourceKeys:t}),c=t?.graders.flatMap(e=>e?[e]:[])??[];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Source agents`}),(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:o,disabled:!a.length,ref:t=>{t&&(t.indeterminate=!o&&a.some(t=>e.sourceKeys.includes(Z(t))))},onChange:t=>s(t.target.checked?[...new Set([...e.sourceKeys,...a.map(Z)])]:e.sourceKeys.filter(e=>!a.some(t=>Z(t)===e)))}),`Select all`,` `,(0,J.jsxs)(`small`,{children:[`(`,i.filter(t=>e.sourceKeys.includes(Z(t))).length,` selected)`]})]}),(0,J.jsxs)(`div`,{className:`agent-learning-options`,"aria-label":`Source agents`,children:[i.map(t=>{let n=Z(t),r=e.sourceKeys.includes(n),i=K.find(e=>e.id===(t.origin.startsWith(`native_`)?`openpond_chat`:t.origin)),a=t.origin===`native_chat`?`Pal Chat`:t.origin===`native_work`?`Pal Work`:i?.name??t.name;return(0,J.jsxs)(`label`,{className:`agent-learning-option`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:r,disabled:!r&&![`active`,`paused`].includes(t.state),onChange:t=>s(t.target.checked?[...new Set([...e.sourceKeys,n])]:e.sourceKeys.filter(e=>e!==n))}),i?(0,J.jsx)(`img`,{src:i.icon,alt:``}):null,(0,J.jsxs)(`span`,{children:[a,(0,J.jsx)(`small`,{children:t.sourceInstanceId?t.name===t.origin?`Local connection`:t.name:t.origin.startsWith(`native_`)?`Hosted conversations`:`Uploaded history`})]}),(0,J.jsx)(`small`,{children:t.state})]},n)}),i.length?null:(0,J.jsx)(`p`,{role:`status`,children:n?`Fetching source agents…`:`Connect or import an agent into this Project first.`})]}),(0,J.jsx)(`p`,{children:`Paused agents can use uploaded conversations. Selecting them leaves collection paused.`})]}),(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Evaluation rubrics`}),e.configurationId?(0,J.jsx)(`p`,{children:`The training configuration pins the task definition and its rubrics. Choose grader selection in Preparation.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,disabled:!c.length,checked:c.length>0&&c.every(t=>e.graderIds.includes(t.id)),onChange:t=>r({...e,graderIds:t.target.checked?c.map(e=>e.id):[]})}),`Select all `,(0,J.jsxs)(`small`,{children:[`(`,e.graderIds.length,` selected)`]})]}),(0,J.jsxs)(`div`,{className:`agent-learning-options`,"aria-label":`Evaluation rubrics`,children:[c.map(t=>(0,J.jsxs)(`label`,{className:`agent-learning-option`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.graderIds.includes(t.id),onChange:n=>r({...e,graderIds:n.target.checked?[...e.graderIds,t.id]:e.graderIds.filter(e=>e!==t.id)})}),(0,J.jsxs)(`span`,{children:[t.name,(0,J.jsxs)(`small`,{children:[`Version `,t.revision]})]})]},`${t.id}:${t.revision}`)),c.length?null:(0,J.jsx)(`p`,{role:`status`,children:n?`Fetching evaluation rubrics…`:`No owned evaluation rubrics are available.`})]}),e.definition&&!e.graderIds.length?(0,J.jsx)(`p`,{children:`The saved task definition and rubrics remain unchanged.`}):null,(0,J.jsxs)(`label`,{children:[`Existing task definition`,(0,J.jsxs)(`select`,{value:e.definition?.id??``,onChange:n=>{let i=t?.definitions.find(e=>e.id===n.target.value);r({...e,definition:i?{id:i.id,revision:i.revision,contentHash:i.contentHash}:null,graderIds:[]})},children:[(0,J.jsx)(`option`,{value:``,children:`Select a definition or choose rubrics above`}),e.definition&&!t?.definitions.some(t=>t.id===e.definition?.id)?(0,J.jsx)(`option`,{value:e.definition.id,children:`Saved task definition`}):null,t?.definitions.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[e.name,` (version `,e.revision,`)`]},e.id))]})]})]}),(0,J.jsxs)(`label`,{children:[`Minimum verified score`,(0,J.jsx)(`input`,{type:`number`,min:0,max:1,step:.01,value:e.minimumScore,onChange:t=>r({...e,minimumScore:Number(t.target.value)})})]})]})]})}function De({draft:e,options:t,loading:n,onChange:r}){let i=t?.projects.find(t=>t.id===e.projectId)?.configurationIds??[],a=we(t,e.configurationId),o=e.graderSelection??{mode:`manual`};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[`Mode`,(0,J.jsxs)(`select`,{value:e.mode,onChange:t=>r({...e,mode:t.target.value}),children:[(0,J.jsx)(`option`,{value:`evaluate`,children:`Evaluate only`}),(0,J.jsx)(`option`,{value:`train`,children:`Train automatically, approve candidate`}),(0,J.jsx)(`option`,{value:`activate`,children:`Train and activate automatically`})]})]}),(0,J.jsxs)(`label`,{children:[`Model to train`,(0,J.jsxs)(`select`,{value:e.configurationId,onChange:n=>{let i=n.target.value,a=we(t,i);r({...e,configurationId:i,trainingPolicyId:a.length===1?a[0].id:``,adapter:i?{kind:`reference_text`,inputPointer:`/prompt`,match:`contained`}:{kind:`complete_text`,qualitativeOnly:!0}})},children:[(0,J.jsx)(`option`,{value:``,children:n?`Fetching configurations…`:`Select configuration`}),t?.configurations.filter(e=>i.includes(e.id)).map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),e.mode===`evaluate`?null:(0,J.jsxs)(`label`,{children:[`Reviewed training setup`,(0,J.jsxs)(`select`,{value:e.trainingPolicyId,onChange:t=>r({...e,trainingPolicyId:t.target.value}),children:[(0,J.jsx)(`option`,{value:``,children:`Select reviewed setup`}),a.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[`Reviewed setup (version `,e.revision,`)`]},e.id))]})]}),e.configurationId?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[`Task construction`,(0,J.jsxs)(`select`,{value:e.adapter.kind,onChange:t=>r({...e,adapter:t.target.value===`reference_text`?{kind:`reference_text`,inputPointer:`/prompt`,match:`contained`}:{kind:`complete_text`,qualitativeOnly:!0}}),children:[(0,J.jsx)(`option`,{value:`reference_text`,children:`Match a published executable task`}),(0,J.jsx)(`option`,{value:`complete_text`,children:`Complete text context and calibrated judges`})]})]}),e.adapter.kind===`reference_text`?(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[(0,J.jsxs)(`label`,{children:[`Public task input field`,(0,J.jsx)(`input`,{value:e.adapter.inputPointer,onChange:t=>r({...e,adapter:{kind:`reference_text`,inputPointer:t.target.value,match:e.adapter.kind===`reference_text`?e.adapter.match:`contained`}})})]}),(0,J.jsxs)(`label`,{children:[`Reference matching`,(0,J.jsxs)(`select`,{value:e.adapter.match,onChange:t=>r({...e,adapter:{kind:`reference_text`,inputPointer:e.adapter.kind===`reference_text`?e.adapter.inputPointer:`/prompt`,match:t.target.value}}),children:[(0,J.jsx)(`option`,{value:`contained`,children:`Contained`}),(0,J.jsx)(`option`,{value:`exact`,children:`Exact`})]})]})]}):null,(0,J.jsxs)(`label`,{children:[`Grader selection`,(0,J.jsxs)(`select`,{value:o.mode,onChange:t=>r({...e,graderSelection:t.target.value===`auto`?{mode:`auto`,modelId:`gpt-6-luna`,sampleSize:8,maximumOutputTokens:2048,maximumSpendUsd:1}:{mode:`manual`}}),children:[(0,J.jsx)(`option`,{value:`auto`,children:`Choose compatible rubrics automatically`}),(0,J.jsx)(`option`,{value:`manual`,children:`Use the pinned rubrics`})]})]}),o.mode===`auto`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`label`,{children:[`Selection model`,(0,J.jsxs)(`select`,{value:o.modelId,onChange:t=>r({...e,graderSelection:{...o,modelId:t.target.value}}),children:[t?.generators.some(e=>e.id===o.modelId)?null:(0,J.jsx)(`option`,{value:o.modelId,children:o.modelId}),t?.generators.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`sampleSize`,`Sample examples`,1,30],[`maximumOutputTokens`,`Output token limit`,256,4096],[`maximumSpendUsd`,`Selection spending limit ($)`,.01,1e5]].map(([t,n,i,a])=>(0,J.jsxs)(`label`,{children:[n,(0,J.jsx)(`input`,{type:`number`,min:i,max:a,step:t===`maximumSpendUsd`?.01:1,value:o[t],onChange:n=>r({...e,graderSelection:{...o,[t]:Number(n.target.value)}})})]},t))})]}):null]}):null,(0,J.jsxs)(`label`,{children:[`Answer improvement model`,(0,J.jsxs)(`select`,{value:e.generator?.modelId??``,onChange:t=>r({...e,generator:t.target.value?{modelId:t.target.value,maximumOutputTokens:e.generator?.maximumOutputTokens??2048,maximumSpendUsd:e.generator?.maximumSpendUsd??.1}:null}),children:[(0,J.jsx)(`option`,{value:``,children:`Use recorded answers only`}),t?.generators.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),e.generator?(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[(0,J.jsxs)(`label`,{children:[`Per improved answer limit ($)`,(0,J.jsx)(`input`,{type:`number`,min:.01,step:.01,value:e.generator.maximumSpendUsd,onChange:t=>r({...e,generator:{...e.generator,maximumSpendUsd:Number(t.target.value)}})})]}),(0,J.jsxs)(`label`,{children:[`Output token limit`,(0,J.jsx)(`input`,{type:`number`,min:256,max:16384,value:e.generator.maximumOutputTokens,onChange:t=>r({...e,generator:{...e.generator,maximumOutputTokens:Number(t.target.value)}})})]})]}):null,e.mode===`activate`?(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Serving authorization`}),(0,J.jsxs)(`label`,{children:[`Serving target`,(0,J.jsxs)(`select`,{value:e.serving?.targetId??``,onChange:t=>r({...e,serving:{targetId:t.target.value,canarySeconds:e.serving?.canarySeconds??120,rollbackOnRuntimeFailure:!0}}),children:[(0,J.jsx)(`option`,{value:``,children:`Pal in this Project`}),t?.servingTargets.filter(t=>t.projectId===e.projectId&&t.enabled).map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.hostedPonder?`Hosted Pal`:`${e.role} / ${e.roleTargetId}`},e.id))]})]}),(0,J.jsxs)(`label`,{children:[`Runtime canary (seconds)`,(0,J.jsx)(`input`,{type:`number`,min:30,max:600,value:e.serving?.canarySeconds??120,onChange:t=>r({...e,serving:{targetId:e.serving?.targetId??``,canarySeconds:Number(t.target.value),rollbackOnRuntimeFailure:!0}})})]}),(0,J.jsx)(`p`,{children:`Saving authorizes the selected target. Failed runtime checks restore its prior model. Training runs only within the saved policy's schedule and limits.`})]}):null]})}var Oe=(e,t)=>e===void 0||t===void 0?``:`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`;function ke({draft:e,onChange:t}){let n=(n,r)=>t({...e,limits:{...e.limits,[n]:r}});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Run window`}),(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[(0,J.jsxs)(`label`,{children:[`From`,(0,J.jsx)(`input`,{type:`time`,required:!0,value:Oe(e.schedule.hour,e.schedule.minute),onChange:n=>{let[r,i]=n.target.value.split(`:`).map(Number);t({...e,schedule:{...e.schedule,hour:r,minute:i}})}})]}),(0,J.jsxs)(`label`,{children:[`Until`,(0,J.jsx)(`input`,{type:`time`,value:Oe(e.schedule.endHour,e.schedule.endMinute),onChange:n=>{let[r,i]=n.target.value.split(`:`).map(Number),{endHour:a,endMinute:o,...s}=e.schedule;t({...e,schedule:n.target.value?{...s,endHour:r,endMinute:i}:s})}})]})]}),(0,J.jsxs)(`label`,{children:[`Timezone`,(0,J.jsx)(`input`,{required:!0,value:e.schedule.timezone,onChange:n=>t({...e,schedule:{...e.schedule,timezone:n.target.value}})})]}),(0,J.jsx)(`p`,{children:`Queued learning starts within this window. A run already started may finish afterward.`})]}),(0,J.jsxs)(`fieldset`,{children:[(0,J.jsx)(`legend`,{children:`Maximum spending`}),(0,J.jsx)(`p`,{children:`These are limits, not prices. Evaluation, answer improvements and training count toward them.`}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`perCycleUsd`,`Per run ($)`],[`dailyUsd`,`Per day ($)`],[`monthlyUsd`,`Per month ($)`]].map(([t,r])=>(0,J.jsxs)(`label`,{children:[r,(0,J.jsx)(`input`,{type:`number`,required:!0,min:.01,max:1e5,step:.01,value:e.limits[t],onChange:e=>n(t,Number(e.target.value))})]},t))})]}),(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`Advanced limits`}),(0,J.jsxs)(`div`,{className:`agent-learning-columns`,children:[[[`gradeUsd`,`Per evaluation ceiling ($)`,0,1e3,.01],[`maximumTasks`,`Maximum tasks`,1,200,1],[`minimumExamples`,`Minimum training examples`,1,200,1],[`maximumAttempts`,`Maximum correction attempts`,1,5,1],[`lookbackDays`,`Uploaded history window (days)`,1,30,1]].map(([t,r,i,a,o])=>(0,J.jsxs)(`label`,{children:[r,(0,J.jsx)(`input`,{type:`number`,required:!0,min:i,max:a,step:o,value:e.limits[t],onChange:e=>n(t,Number(e.target.value))})]},t)),(0,J.jsxs)(`label`,{children:[`Maximum GPU session (hours)`,(0,J.jsx)(`input`,{type:`number`,required:!0,min:.01,max:3,step:.01,value:e.limits.maxGpuSeconds/3600,onChange:e=>n(`maxGpuSeconds`,Math.round(Number(e.target.value)*3600))})]}),(0,J.jsxs)(`label`,{children:[`Pause after failed cycles`,(0,J.jsx)(`input`,{type:`number`,required:!0,min:1,max:20,value:e.failurePolicy?.pauseAfterConsecutiveFailures??3,onChange:n=>t({...e,failurePolicy:{pauseAfterConsecutiveFailures:Number(n.target.value)}})})]})]}),(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.exceptions===`eligible_remainder`,onChange:n=>t({...e,exceptions:n.target.checked?`eligible_remainder`:`block`})}),`Use the independently verified remainder when exceptions occur`]})]}),(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`Training data balance`}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`maximumSourceShare`,`Maximum from one agent`,100],[`maximumFailureShare`,`Maximum from one error type`,100],[`maximumLengthShare`,`Maximum from one conversation length`,100],[`replayFraction`,`Previously learned examples`,50],[`auditFraction`,`Examples checked for quality`,100]].map(([n,r,i])=>(0,J.jsxs)(`label`,{children:[r,` (%)`,(0,J.jsx)(`input`,{type:`number`,min:+!!n.startsWith(`maximum`),max:i,value:Math.round((e.selection?.[n]??0)*100),onChange:r=>t({...e,selection:{maximumSourceShare:1,maximumFailureShare:1,maximumLengthShare:1,replayFraction:.2,auditFraction:.1,...e.selection,[n]:Number(r.target.value)/100}})})]},n))})]}),e.mode===`evaluate`?null:(0,J.jsxs)(`details`,{children:[(0,J.jsx)(`summary`,{children:`Checks before using the trained model`}),(0,J.jsx)(`div`,{className:`agent-learning-columns`,children:[[`windowCasesPerCheck`,`New examples per quality check`,2,1e4],[`minimumCasesPerCheck`,`Minimum paired examples`,2,1e4],[`minimumImprovement`,`Required improvement`,1e-4,1]].map(([n,r,i,a])=>(0,J.jsxs)(`label`,{children:[r,(0,J.jsx)(`input`,{type:`number`,min:i,max:a,step:n===`minimumImprovement`?.01:1,value:e.acceptance?.[n]??i,onChange:r=>t({...e,acceptance:{minimumCasesPerCheck:20,windowCasesPerCheck:20,minimumImprovement:.05,...e.acceptance,[n]:Number(r.target.value)}})})]},n))}),(0,J.jsx)(`p`,{children:`Current and trained models use the same unseen examples. Insufficient evidence keeps the current model active.`})]})]})}function Ae({connection:e,teamId:t,projectId:n,projectName:r,initialPolicy:i,bindings:a,query:o,onClose:s}){let[c,l]=(0,q.useState)(i),[u,d]=(0,q.useState)(()=>$(n,i,i?[]:a)),[f,p]=(0,q.useState)(!!o.data),[m,h]=(0,q.useState)(!1),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(i?.status===`enabled`||!i),[S,w]=(0,q.useState)(`sources`),[T,E]=(0,q.useState)(!1),[D,O]=(0,q.useState)(null),A=(0,q.useRef)(f);A.current=f;let j=o.data?.policies.filter(e=>e.configuration.projectId===n)??[];(0,q.useEffect)(()=>{if(!o.data||A.current)return;let e=o.data.policies.find(e=>e.configuration.projectId===n&&e.status===`enabled`)??o.data.policies.find(e=>e.configuration.projectId===n);l(e),d($(n,e,e?[]:a)),x(e?.status===`enabled`||!e),p(!0)},[o.data,n,a]);let M=()=>{g||(m?E(!0):s())},P=C(M);function F(e){let t=j.find(t=>t.id===e);t&&(l(t),d($(n,t)),x(t.status===`enabled`),h(!1),O(null),E(!1),y(null))}function I(e){d(e),h(!0)}async function L(){if(o.data&&f&&!g&&!o.isError){_(!0),y(null);try{await Te(e,t,u,o.data,c,b),await o.refresh(),h(!1),s()}catch(e){y(e instanceof Error?e.message:`Unable to save continuous learning.`)}finally{_(!1)}}}let R={draft:u,options:o.data,loading:o.isPending,onChange:I};return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:M,children:(0,J.jsxs)(`section`,{ref:P,className:`git-dialog provider-details-dialog agent-learning-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Continuous learning`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close continuous learning`,disabled:g,onClick:M,children:(0,J.jsx)(k,{size:16})}),(0,J.jsx)(`div`,{className:`provider-dialog-header`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Continuous learning`}),(0,J.jsx)(`span`,{children:r})]})}),T?(0,J.jsxs)(`div`,{className:`agent-learning-discard`,role:`alert`,children:[(0,J.jsx)(`p`,{children:`Discard unsaved policy changes?`}),(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>{E(!1),O(null)},children:`Keep editing`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>D?F(D):s(),children:`Discard changes`})]})]}):null,j.length>1?(0,J.jsxs)(`label`,{className:`agent-learning-policy-picker`,children:[`Learning policy`,(0,J.jsx)(`select`,{disabled:g,value:c?.id??``,onChange:e=>{m?(O(e.target.value),E(!0)):F(e.target.value)},children:j.map(e=>(0,J.jsxs)(`option`,{value:e.id,children:[e.configuration.name,` (`,e.status,`)`]},e.id))})]}):null,(0,J.jsx)(`div`,{className:`surface-tabs provider-agent-tabs`,role:`tablist`,"aria-label":`Continuous learning settings`,children:[[`sources`,`Sources & rubrics`],[`preparation`,`Preparation`],[`schedule`,`Run window & budget`]].map(([e,t])=>(0,J.jsx)(`button`,{type:`button`,id:`learning-tab-${e}`,role:`tab`,"aria-selected":S===e,"aria-controls":`learning-panel-${e}`,tabIndex:S===e?0:-1,onClick:()=>w(e),onKeyDown:t=>{let n=[`sources`,`preparation`,`schedule`],r=n.indexOf(e);if([`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(t.key)){t.preventDefault();let e=n[t.key===`Home`?0:t.key===`End`?2:(r+(t.key===`ArrowRight`?1:2))%3];w(e),document.getElementById(`learning-tab-${e}`)?.focus()}},children:t},e))}),(0,J.jsxs)(`form`,{className:`agent-learning-form`,onSubmit:e=>{e.preventDefault(),L()},children:[(0,J.jsx)(`fieldset`,{disabled:!f||g,children:(0,J.jsxs)(`label`,{children:[`Policy name`,(0,J.jsx)(`input`,{required:!0,maxLength:200,value:u.name,onChange:e=>I({...u,name:e.target.value})})]})}),(0,J.jsx)(`div`,{id:`learning-panel-${S}`,role:`tabpanel`,"aria-labelledby":`learning-tab-${S}`,children:(0,J.jsx)(`fieldset`,{disabled:!f||g,children:S===`sources`?(0,J.jsx)(Ee,{...R}):S===`preparation`?(0,J.jsx)(De,{...R}):(0,J.jsx)(ke,{...R})})}),o.isPending?(0,J.jsx)(`p`,{role:`status`,children:`Fetching available sources, rubrics and models…`}):null,o.isError?(0,J.jsx)(N,{error:o.error.message,children:(0,J.jsx)(`button`,{type:`button`,onClick:()=>void o.refetch(),children:`Retry settings`})}):null,v?(0,J.jsx)(N,{error:v}):null,(0,J.jsxs)(`label`,{className:`agent-learning-check`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:b,disabled:!f||g,onChange:e=>{x(e.target.checked),h(!0)}}),`Enable this policy after saving`]}),(0,J.jsx)(`p`,{children:`Saving enables only the reviewed sources, schedule and limits. No training is dispatched by opening this dialog.`}),(0,J.jsxs)(`div`,{className:`settings-button-row agent-learning-footer`,children:[(0,J.jsx)(`button`,{type:`button`,disabled:g,onClick:M,children:`Cancel`}),(0,J.jsx)(`button`,{type:`submit`,className:`primary`,disabled:!f||!o.data||o.isError||g||!u.sourceKeys.length,children:g?`Saving…`:b?`Save and enable`:`Save paused`})]})]})]})})}function je({agent:e,inventory:t,connection:n,teamId:r,projectId:i,projectName:a,query:o,signedIn:s}){let[c,l]=(0,q.useState)(!1),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(``),v=(0,q.useMemo)(()=>new Set(t?.collector.connections.filter(t=>t.source===e.id&&t.teamId===r&&t.projectId===i&&t.state!==`disconnected`).map(e=>e.sourceInstanceId)??[]),[t,e.id,r,i]),y=o.data?.sources.filter(t=>t.projectId===i&&(e.id===`openpond_chat`?[`native_chat`,`native_work`].includes(t.origin)&&t.sourceInstanceId===null:t.origin===e.id&&t.sourceInstanceId!==null&&v.has(t.sourceInstanceId)))??[],b=[...new Set(y.flatMap(e=>e.sourceInstanceId?[e.sourceInstanceId]:[]))],x=b.includes(g)?g:b[0],S=y.filter(e=>e.sourceInstanceId===null||e.sourceInstanceId===x).map(e=>({origin:e.origin,sourceInstanceId:e.sourceInstanceId,enabled:!0})),C=o.data?.policies.filter(e=>e.configuration.projectId===i)??[],w=C.filter(e=>e.status===`enabled`&&e.configuration.sources.some(e=>e.enabled&&S.some(t=>Z(t)===Z(e)))),T=w[0]??C.find(e=>e.status===`enabled`)??C[0],E=!!(n&&r&&i&&s&&o.data?.projects.some(e=>e.id===i));async function D(e,t){if(!n||!r||!o.data)return;let a={...e.configuration,sources:e.configuration.sources.map(e=>S.some(t=>Z(t)===Z(e))?{...e,enabled:t}:e)};if(t)for(let e of S)a.sources.some(t=>Z(t)===Z(e))||a.sources.push(e);let s=o.data.servingTargets.find(e=>e.id===a.serving?.targetId);if(t&&a.mode===`activate`&&a.serving?.targetId&&(!s||!s.enabled||s.projectId!==i))throw Error(`Review the policy's serving target before adding a source.`);if(t&&a.mode===`activate`&&(!a.serving?.targetId||s?.hostedPonder)){let e=await Q(n,r,`serving-targets`,{action:`ensure_hosted_ponder`,projectId:i,bindingId:o.data.ponderBindingId});a={...a,serving:{targetId:e.id,canarySeconds:a.serving?.canarySeconds??120,rollbackOnRuntimeFailure:!0}}}return Ce(n,r,e,a,a.sources.some(e=>e.enabled))}async function O(e){if(!f){p(!0),h(null);try{if(e){let e=C.find(e=>e.id===u);if(!e)throw Error(`Refresh the learning policy before joining.`);await D(e,!0),d(null)}else for(let e of w)await D(e,!1);await o.refresh()}catch(e){h(e instanceof Error?e.message:`Unable to update this learning source.`),await o.refresh()}finally{p(!1)}}}return(0,J.jsxs)(`div`,{className:`agent-learning-control`,children:[b.length>1?(0,J.jsxs)(`label`,{children:[`Learning connection`,(0,J.jsx)(`select`,{"aria-label":`${e.name} learning connection`,value:x,disabled:f,onChange:e=>_(e.target.value),children:b.map(e=>(0,J.jsx)(`option`,{value:e,children:y.find(t=>t.sourceInstanceId===e)?.name??`Local connection`},e))})]}):null,(0,J.jsxs)(`div`,{className:`agent-learning-control-row`,children:[(0,J.jsxs)(`label`,{className:`provider-toggle`,children:[(0,J.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.name} continuous learning`,checked:w.length>0,disabled:!E||!S.length||o.isPending||o.isError||f,onChange:e=>{if(e.target.checked){let e=C.find(e=>e.status===`enabled`);e?d(e.id):l(!0)}else O(!1)}}),(0,J.jsx)(`span`,{"aria-hidden":`true`})]}),(0,J.jsx)(`button`,{type:`button`,className:`agent-learning-settings`,disabled:!n||!r||!i||!s||f,onClick:()=>l(!0),children:`Continuous learning`}),(0,J.jsx)(`small`,{children:o.isError?`Needs attention`:o.isPending?`Loading…`:w.length?`On schedule`:C.length?`Paused`:`Off`})]}),i&&!S.length&&o.data?(0,J.jsx)(`small`,{children:`Sync this agent to the selected Project to use its local connection.`}):null,m?(0,J.jsx)(N,{error:m}):null,c&&n&&r?(0,J.jsx)(Ae,{connection:n,teamId:r,projectId:i,projectName:a,initialPolicy:T,bindings:S,query:o,onClose:()=>l(!1)},i):null,u?(0,J.jsx)(Me,{policies:C.filter(e=>e.status===`enabled`),policyId:u,agentName:e.name,busy:f,error:m,onChoose:d,onClose:()=>{f||d(null)},onJoin:()=>void O(!0)}):null]})}function Me({policies:e,policyId:t,agentName:n,busy:r,error:i,onChoose:a,onClose:o,onJoin:s}){let c=C(o),l=e.find(e=>e.id===t);return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:o,children:(0,J.jsxs)(`section`,{ref:c,className:`git-dialog agent-learning-join`,role:`dialog`,"aria-modal":`true`,"aria-label":`Add learning source`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{type:`button`,className:`git-dialog-close`,disabled:r,"aria-label":`Cancel`,onClick:o,children:(0,J.jsx)(k,{size:16})}),(0,J.jsxs)(`h2`,{children:[`Add `,n,` to `,l?.configuration.name??`continuous learning`,`?`]}),(0,J.jsx)(`p`,{children:`This agent will contribute conversations to the existing model, schedule and spending limits. Collection settings stay unchanged.`}),e.length>1?(0,J.jsxs)(`label`,{children:[`Existing policy`,(0,J.jsx)(`select`,{value:t,disabled:r,onChange:e=>a(e.target.value),children:e.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.configuration.name},e.id))})]}):null,i?(0,J.jsx)(N,{error:i}):null,(0,J.jsxs)(`div`,{className:`settings-button-row`,children:[(0,J.jsx)(`button`,{type:`button`,disabled:r,onClick:o,children:`Cancel`}),(0,J.jsx)(`button`,{type:`button`,className:`primary`,disabled:r||!l,onClick:s,children:r?`Adding…`:`Add agent`})]})]})})}function Ne(e){let[t,n]=(0,q.useState)(!1),r=e.payload?.account,i=e.payload?.preferences.defaultTeamId??r?.accounts.find(e=>e.isActive)?.apiKeyAccess?.teamId,a=r?.baseUrl??r?.activeProfile?.baseUrl;return(0,J.jsxs)(J.Fragment,{children:[e.connection&&i&&a&&r?.state===`signed_in`?(0,J.jsx)(oe,{context:{connection:e.connection,teamId:i,accountKey:JSON.stringify(r.activeProfile)},baseUrl:a}):(0,J.jsxs)(`section`,{className:`connected-agents-view`,children:[(0,J.jsx)(`h2`,{children:`Fix-it`}),(0,J.jsx)(`p`,{children:`Sign in and select a workspace to connect an agent.`})]}),(0,J.jsx)(`div`,{className:`connected-agents-view`,children:(0,J.jsx)(`button`,{className:`training-text-button`,"aria-expanded":t,onClick:()=>n(e=>!e),children:t?`Hide history imports`:`History import tools`})}),t?(0,J.jsx)(Pe,{...e}):null]})}function Pe({connection:e,payload:t,onPayload:n,onToast:r}){let{inventory:i,error:a,loading:o,refresh:s}=ie(e),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(0),m=`openpond-agent-cards:${JSON.stringify(t?.account.activeProfile??null)}`,[h,g]=(0,q.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(m)??`null`);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&K.some(t=>t.id===e)):[`oh_my_pi`]}catch{return[`oh_my_pi`]}});(0,q.useEffect)(()=>{try{localStorage.setItem(m,JSON.stringify(h))}catch{}},[m,h]);let[_,v]=(0,q.useState)(!1),b=(0,q.useRef)(null);(0,q.useEffect)(()=>{if(!_)return;let e=e=>{b.current?.contains(e.target)||v(!1)},t=e=>{e.key===`Escape`&&(v(!1),b.current?.querySelector(`button`)?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[_]);let x=(0,q.useRef)({payload:t,onPayload:n});x.current={payload:t,onPayload:n};let S=(0,q.useRef)(!0);(0,q.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]);let C=t?.account??null,w=t?.preferences.defaultTeamId??C?.accounts.find(e=>e.isActive)?.apiKeyAccess?.teamId??null,k=(0,q.useCallback)(e=>{l(e),e&&r?.(e,`error`)},[r]),A=(0,q.useCallback)(e=>{let t=x.current;S.current&&t.payload&&t.onPayload({...t.payload,providers:e})},[]),j=(0,q.useCallback)((e,t)=>{let n=x.current;if(!S.current||!n.payload)return;let r=n.payload.providers,i={...n.payload,providers:{...r,statuses:{...r.statuses,[e]:t.statuses[e]},modelCaches:{...r.modelCaches,[e]:t.modelCaches[e]}}};x.current={...n,payload:i},n.onPayload(i)},[]);ce(e,t?.providers,j,f);let M=(0,q.useCallback)(e=>{let t=x.current;t.payload&&t.onPayload({...t.payload,preferences:e.preferences})},[]),F=E({connection:e,onError:k,onPayload:n,onPreferences:M,onProviders:A,preferences:y(t?.preferences),providers:t?.providers}),L=ge(e,C,w),{projects:R,projectId:z,loading:B,error:V}=L,ee=Se(e,w,JSON.stringify([C?.activeProfile??null,C?.profile?.id??null]),C?.state===`signed_in`),H=C?.baseUrl??C?.activeProfile?.baseUrl,te=H&&w?`${H.replace(/\/$/u,``)}/console/connections?${new URLSearchParams({teamId:w,...z?{project:z}:{}})}`:null,U=u?.provider,W=U?t?.providers.statuses[U]:null,G=u?(0,J.jsx)(be,{agent:u,inventory:i,connection:e,account:C,teamId:w,projects:R,projectId:z,onRefresh:s,learningUrl:te},u.id):null;return(0,J.jsxs)(`section`,{className:`connected-agents-view`,"aria-label":`Continuous learning`,children:[(0,J.jsxs)(`div`,{className:`agent-connections-heading`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:`Conversation history imports`}),(0,J.jsx)(`p`,{children:`Import existing conversations and manage their original learning setup.`})]}),(0,J.jsxs)(`div`,{className:`agent-connections-actions`,children:[(0,J.jsx)(`button`,{type:`button`,disabled:o||!e,"aria-label":`Refresh agent connections`,onClick:()=>{s(),L.refresh(),p(e=>e+1)},children:(0,J.jsx)(O,{size:15})}),(0,J.jsxs)(`div`,{className:`agent-more`,ref:b,children:[(0,J.jsx)(`button`,{type:`button`,"aria-expanded":_,onClick:()=>v(e=>!e),children:`More agents`}),_?(0,J.jsxs)(`div`,{className:`agent-more-menu`,children:[K.filter(e=>h.includes(e.id)).map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{g(t=>t.filter(t=>t!==e.id)),v(!1)},children:[(0,J.jsx)(D,{size:14}),(0,J.jsx)(`span`,{children:e.name})]},e.id)),h.length===0?(0,J.jsx)(`span`,{children:`All agents shown`}):null]}):null]})]})]}),(0,J.jsxs)(`label`,{className:`agent-project-scope`,children:[`Project`,(0,J.jsx)(I,{label:`Connections project`,value:z,disabled:!R.length,onChange:L.select,searchable:!0,options:[{value:``,label:B&&!R.length?`Fetching projects…`:`Select project`},...R.map(e=>({value:e.id,label:e.content.name}))]})]}),V?(0,J.jsx)(N,{error:V}):null,a?(0,J.jsx)(N,{error:a}):null,c?(0,J.jsx)(N,{error:c}):null,(0,J.jsx)(`div`,{className:`agent-connections-grid`,children:K.filter(e=>!h.includes(e.id)).map(n=>(0,J.jsx)(se,{agent:n,account:C,native:n.provider?t?.providers.statuses[n.provider]:null,inventory:i,projects:R,teamId:w,learningControl:(0,J.jsx)(je,{agent:n,inventory:i,connection:e,teamId:w,projectId:z,projectName:R.find(e=>e.id===z)?.content.name??`Selected Project`,query:ee,signedIn:C?.state===`signed_in`}),connected:!!e,onHide:()=>g(e=>[...e,n.id]),onManage:()=>d(n)},`${JSON.stringify([C?.activeProfile,C?.profile?.id])}:${w}:${z}:${n.id}`))}),i?(0,J.jsxs)(`div`,{className:`agent-importer-footer`,children:[(0,J.jsx)(`span`,{children:i.collector.running?`Import in progress`:`No import running`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>P({kind:`settings`,section:`conversation-imports`}),children:`Conversation import settings`})]}):null,u&&U&&W&&t?(0,J.jsx)(T,{checkNativeProvider:F.checkNativeProvider,connection:e,account:C,codex:t.codex,providerId:U,providerBusy:F.providerBusy,settings:t.providers,status:W,onClose:()=>d(null),onDeleteCredential:F.deleteProviderCredential,onRefreshModels:F.refreshProviderModels,onSaveConfig:F.saveProviderConfig,onSaveCredential:F.saveProviderCredential,onStartOpenAiSubscriptionAuth:F.startOpenAiSubscriptionAuth,onValidate:F.validateProvider,conversationPanel:G}):u?(0,J.jsx)(Fe,{agent:u,onClose:()=>d(null),children:G}):null]})}function Fe({agent:e,onClose:t,children:n}){let r=C(t);return(0,J.jsx)(`div`,{className:`git-dialog-backdrop provider-dialog-backdrop`,onMouseDown:t,children:(0,J.jsxs)(`section`,{ref:r,className:`git-dialog provider-details-dialog agent-setup-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`${e.name} connection`,onMouseDown:e=>e.stopPropagation(),children:[(0,J.jsx)(`button`,{type:`button`,className:`git-dialog-close`,"aria-label":`Close`,onClick:t,children:(0,J.jsx)(k,{size:16})}),(0,J.jsx)(`div`,{className:`provider-dialog-header`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{children:e.name}),(0,J.jsx)(`span`,{children:`Conversation syncing`})]})}),n]})})}var Ie=[`For agents`,`Featured`,`Productivity`,`Developer tools`],Le=new Set([`slack`,`google`,`github`,`mcp`]);function Re({account:e,connection:t,defaultTeamId:n,onToast:r,payload:i,onPayload:a}){let[o,s]=(0,q.useState)(`apps`),c=(0,q.useId)(),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(``),[p,m]=(0,q.useState)(`For agents`),[h,g]=(0,q.useState)(()=>B()),[_,v]=(0,q.useState)(null),y=e?.baseUrl??e?.activeProfile?.baseUrl??null,b=ze(n,_),x=(0,q.useMemo)(()=>h.filter(e=>Ue(e,p)).filter(e=>We(e,d)),[p,d,h]);(0,q.useEffect)(()=>{let e=!0;return!t||o!==`apps`?(g(B()),v(null),()=>{e=!1}):(F.connectedAppStatus(t,{status:`all`}).then(t=>{e&&(g(t.apps),v(t.teamId?.trim()||null))}).catch(t=>{e&&(console.warn(`Unable to load connected app status.`,t),g(B()),v(null))}),()=>{e=!1})},[t,o]);function S(e){Ke(V({appId:e.id,baseUrl:y,teamId:b})).catch(e=>{r?.(e instanceof Error?e.message:String(e),`error`)})}return(0,J.jsxs)(`div`,{className:`apps-workspace-view`,children:[(0,J.jsx)(`div`,{className:`apps-page-tabs`,role:`tablist`,"aria-label":`Apps pages`,onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=e.key===`Home`?`apps`:e.key===`End`?`agents`:o===`agents`?`apps`:`agents`;s(t),e.currentTarget.querySelector(`#${CSS.escape(`${c}-${t}`)}`)?.focus()},children:[{value:`apps`,label:`Apps`},{value:`agents`,label:`Fix-it`}].map(e=>(0,J.jsx)(`button`,{type:`button`,role:`tab`,id:`${c}-${e.value}`,"aria-controls":`${c}-${e.value}-panel`,tabIndex:o===e.value?0:-1,"aria-selected":o===e.value,onClick:()=>s(e.value),children:e.label},e.value))}),(0,J.jsx)(`div`,{role:`tabpanel`,id:`${c}-${o}-panel`,"aria-labelledby":`${c}-${o}`,children:o===`agents`?(0,J.jsx)(Ne,{connection:t,payload:i,onPayload:a,onToast:r},JSON.stringify([e?.activeProfile,n])):(0,J.jsxs)(`section`,{className:`connected-apps-view`,"aria-label":`Apps`,children:[(0,J.jsxs)(`div`,{className:`connected-apps-header`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{children:`Apps`}),(0,J.jsx)(`p`,{children:`Connect apps that agents can use for chat, knowledge, files, and workflow actions.`})]}),(0,J.jsxs)(`label`,{className:`connected-apps-search`,children:[(0,J.jsx)(L,{size:15}),(0,J.jsx)(`input`,{"aria-label":`Search apps`,onChange:e=>f(e.target.value),placeholder:`Search apps`,type:`search`,value:d})]})]}),(0,J.jsxs)(`section`,{className:`connected-apps-hero`,"aria-label":`App context`,children:[(0,J.jsxs)(`div`,{className:`connected-apps-hero-copy`,children:[(0,J.jsx)(`span`,{className:`connected-apps-hero-icon`,children:(0,J.jsx)(He,{appId:`github`})}),(0,J.jsx)(`h2`,{children:`Work with your apps`}),(0,J.jsx)(`p`,{children:`Bring repositories, documents, chat, calendars, and custom MCP tools into OpenPond.`})]}),(0,J.jsxs)(`div`,{className:`connected-apps-context-card`,"aria-hidden":`true`,children:[(0,J.jsx)(`strong`,{children:`Agent context`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`files`,children:`Files`}),(0,J.jsx)(`span`,{className:`chat`,children:`Chat`}),(0,J.jsx)(`span`,{className:`oauth`,children:`OAuth`}),(0,J.jsx)(`span`,{className:`mcp`,children:`MCP`})]})]})]}),(0,J.jsx)(`div`,{className:`connected-apps-filters`,role:`tablist`,"aria-label":`App categories`,children:Ie.map(e=>(0,J.jsx)(`button`,{"aria-selected":p===e,className:p===e?`active`:``,onClick:()=>m(e),role:`tab`,type:`button`,children:e},e))}),(0,J.jsxs)(`div`,{className:`connected-apps-list`,children:[x.map(e=>(0,J.jsx)(Be,{app:e,onSelect:()=>u(e)},e.id)),x.length===0?(0,J.jsx)(`div`,{className:`connected-apps-empty`,children:`No apps match the current search.`}):null]}),l?(0,J.jsx)(Ve,{app:l,onClose:()=>u(null),onInstall:()=>S(l)}):null]})})]})}function ze(e,t){return e?.trim()||t?.trim()||null}function Be({app:e,onSelect:t}){return(0,J.jsxs)(`button`,{className:`connected-app-row`,onClick:t,type:`button`,children:[(0,J.jsxs)(`span`,{className:`connected-app-row-main`,children:[(0,J.jsx)(He,{appId:e.id}),(0,J.jsxs)(`span`,{className:`connected-app-copy`,children:[(0,J.jsxs)(`span`,{className:`connected-app-title`,children:[(0,J.jsx)(`strong`,{children:e.label}),(0,J.jsxs)(`span`,{children:[e.shortLabel===e.label?e.category:e.shortLabel,` / `,e.setupSurfaceLabel]})]}),(0,J.jsx)(`span`,{children:e.description}),(0,J.jsxs)(`span`,{className:`connected-app-capability-row`,children:[e.capabilityLabels.slice(0,2).map(e=>(0,J.jsx)(`span`,{children:e},e)),e.capabilityLabels.length>2?(0,J.jsxs)(`span`,{children:[`+`,e.capabilityLabels.length-2]}):null]})]})]}),(0,J.jsx)(`span`,{className:`connected-app-status-pill ${e.status}`,children:e.statusLabel}),(0,J.jsx)(x,{size:16})]})}function Ve({app:e,onClose:t,onInstall:n}){let r=e.connections.filter(e=>e.status===`active`);return(0,J.jsx)(`div`,{className:`connected-app-dialog-backdrop`,role:`presentation`,onMouseDown:e=>{e.target===e.currentTarget&&t()},children:(0,J.jsxs)(`section`,{className:`connected-app-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`connected-app-dialog-title`,children:[(0,J.jsx)(`button`,{className:`connected-app-dialog-close`,type:`button`,"aria-label":`Close app details`,onClick:t,children:(0,J.jsx)(k,{size:17})}),(0,J.jsxs)(`div`,{className:`connected-app-dialog-identity`,children:[(0,J.jsx)(`span`,{className:`openpond-mark`,children:(0,J.jsx)(`img`,{alt:``,src:i})}),(0,J.jsxs)(`span`,{className:`connection-dots`,"aria-hidden":`true`,children:[(0,J.jsx)(`span`,{}),(0,J.jsx)(`span`,{}),(0,J.jsx)(`span`,{})]}),(0,J.jsx)(He,{appId:e.id})]}),(0,J.jsxs)(`h2`,{id:`connected-app-dialog-title`,children:[`Connect `,e.label]}),(0,J.jsxs)(`div`,{className:`connected-app-approval`,children:[(0,J.jsx)(R,{size:16}),(0,J.jsx)(`span`,{children:e.statusLabel})]}),(0,J.jsxs)(`div`,{className:`connected-app-dialog-body`,children:[(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:e.setupSurfaceLabel}),(0,J.jsx)(`p`,{children:`The web flow shows the provider account, workspace, and requested access before anything is connected.`})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:`Connected account`}),(0,J.jsx)(`p`,{children:qe(r)})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:`Available capabilities`}),(0,J.jsx)(`div`,{className:`connected-app-dialog-capabilities`,children:e.capabilities.map(e=>(0,J.jsx)(`span`,{children:e.label},e.id))})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h3`,{children:`Sandbox lease policy`}),(0,J.jsx)(`p`,{children:e.leasePolicy.leaseable?`Leaseable for ${e.leasePolicy.defaultTtlSeconds??0} seconds with scoped proxy access.`:`Managed as setup or tool discovery; no OAuth lease is required.`})]})]}),(0,J.jsxs)(`button`,{className:`connected-app-dialog-primary`,type:`button`,onClick:n,children:[(0,J.jsx)(`span`,{children:e.installLabel}),(0,J.jsx)(S,{size:15})]})]})})}function He({appId:e}){return(0,J.jsx)(`span`,{className:`connected-app-icon app-${e}`,children:(0,J.jsx)(`img`,{alt:``,src:Ge(e)})})}function Ue(e,t){return t===`For agents`?!0:t===`Featured`?Le.has(e.id):t===`Productivity`?e.category===`Productivity`||e.category===`Chat`:e.category===`Developer tools`||e.id===`mcp`}function We(e,t){let n=t.trim().toLowerCase();return!n||[e.id,e.label,e.shortLabel,e.category,e.description,e.providerFamily,e.setupSurface].some(e=>e.toLowerCase().includes(n))}function Ge(e){return n(e)}async function Ke(e){let t=window.openpond?.browser;if(t){let n=await t.openExternal({conversationId:`connected-apps`,url:e});if(!n.ok)throw Error(n.error??`Unable to open app setup.`)}else window.open(e,`_blank`,`noopener,noreferrer`)}function qe(e){return e.length===0?`No active OAuth connection for this setup surface.`:e.map(e=>{let t=e.accountLabel??`Connected account`;return e.workspaceLabel?`${t} / ${e.workspaceLabel}`:t}).join(`, `)}export{Re as AppsView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./index-
|
|
1
|
+
import{m as e}from"./index-DG0kf1wK.js";import"./icons-nr5d1kC-.js";import{H as t,R as n,z as r}from"./training-model-data-CilS0W2N.js";import{i,n as a,r as o,t as s}from"./presentation-DbkiE2BE.js";import{t as c}from"./image-Us0M7Xxi.js";import{un as l}from"./App-CqqK4NLa.js";var u=e(),d=new Set([`c`,`cc`,`cpp`,`css`,`go`,`h`,`html`,`java`,`js`,`json`,`jsx`,`mdx`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`toml`,`ts`,`tsx`,`xml`,`yaml`,`yml`]),f=new Set([`csv`,`ods`,`tsv`,`xls`,`xlsm`,`xlsx`]),p=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`xz`,`zip`]),m=new Set([`doc`,`docx`,`epub`,`md`,`odt`,`pdf`,`rtf`,`txt`]),h=new Set([`key`,`odp`,`ppt`,`pptx`]);function g(e){let t=e.mediaType.toLowerCase(),n=e.name.split(`.`).pop()?.toLowerCase()??``;return e.kind===`image`||t.startsWith(`image/`)?`image`:t.startsWith(`audio/`)?`audio`:t.startsWith(`video/`)?`video`:f.has(n)||t.includes(`spreadsheet`)||t.includes(`excel`)?`spreadsheet`:p.has(n)||t.includes(`zip`)||t.includes(`compressed`)?`archive`:h.has(n)||t.includes(`presentation`)||t.includes(`powerpoint`)?`presentation`:d.has(n)?`code`:e.kind===`text`||m.has(n)||t.startsWith(`text/`)||t===`application/pdf`||t.includes(`document`)||t.includes(`msword`)?`document`:`file`}function _(e){if(e.mediaType.toLowerCase()===`application/pdf`)return`PDF`;let t=g(e);return t===`spreadsheet`?`Spreadsheet`:t.charAt(0).toUpperCase()+t.slice(1)}function v(e){return`${e.toLocaleString()} ${e===1?`line`:`lines`}`}var y={archive:t,audio:i,code:r,document:l,file:n,image:c,presentation:s,spreadsheet:o,video:a};function b({attachment:e,...t}){let n=y[g(e)];return(0,u.jsx)(n,{...t})}export{_ as n,v as r,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{g as t,m as n}from"./index-DG0kf1wK.js";import{t as r}from"./icons-nr5d1kC-.js";import{N as i}from"./training-model-data-CilS0W2N.js";import{t as a}from"./copy-B0gWkglr.js";import{t as o}from"./x-CQ0pGF6Q.js";import{n as s}from"./AppToastContext-DyaZYQXu.js";import{Gt as c,an as l,dn as u}from"./App-CqqK4NLa.js";import{t as d}from"./HtmlVisual-krrlNGFX.js";import{_t as f,gt as p,t as m}from"./MainPane-aEELnEKb.js";var h=r(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),g=e(t(),1),_=n();function v({active:e,onBounds:t}){let n=(0,g.useRef)(null),r=(0,g.useRef)(null),i=(0,g.useRef)(null),a=(0,g.useCallback)(e=>{let n=e?`${e.x}:${e.y}:${e.width}:${e.height}`:`null`;r.current!==n&&(r.current=n,t(e))},[t]),o=(0,g.useCallback)(()=>{let t=n.current;if(!e||!t){a(null);return}let r=t.getBoundingClientRect(),i=Math.max(0,Math.round(r.width)),o=Math.max(0,Math.round(r.height));a(i===0||o===0?null:{x:Math.round(r.left),y:Math.round(r.top),width:i,height:o})},[e,a]),s=(0,g.useCallback)(()=>{i.current===null&&(i.current=window.requestAnimationFrame(()=>{i.current=null,o()}))},[o]);return(0,g.useLayoutEffect)(()=>{r.current=null,o();let t=n.current;if(!e||!t)return a(null),()=>a(null);let c=new ResizeObserver(s);return c.observe(t),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{i.current!==null&&(window.cancelAnimationFrame(i.current),i.current=null),c.disconnect(),window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0),a(null)}},[e,a,o,s]),(0,_.jsx)(`div`,{className:`browser-viewport`,ref:n,hidden:!e})}function y({available:e,busy:t,onCapture:n,onCancel:r}){let[i,a]=(0,g.useState)(!1),s=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!i)return;let e=e=>{s.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t)}},[i]),(0,_.jsxs)(`div`,{className:`browser-menu-anchor`,ref:s,children:[(0,_.jsx)(`button`,{type:`button`,title:t?`Cancel snapshot`:`Take snapshot`,"aria-label":t?`Cancel snapshot`:`Take snapshot`,disabled:!e&&!t,"aria-haspopup":t?void 0:`menu`,"aria-expanded":i,onClick:()=>t?r():a(e=>!e),children:t?(0,_.jsx)(o,{size:15}):(0,_.jsx)(h,{size:15})}),i?(0,_.jsxs)(`div`,{className:`browser-options-menu browser-snapshot-menu`,role:`menu`,"aria-label":`Snapshot options`,children:[(0,_.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(!1),n(`page`)},children:`Full page snapshot`}),(0,_.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(!1),n(`node`)},children:`Select an element…`})]}):null]})}function b({image:e,onClose:t}){let n=s(),r=e.source?.length===64e3?`HTML excerpt`:`HTML`;async function c(){let t=`${e.selector.replace(/[^a-z0-9._-]+/gi,`-`).slice(0,80)||`snapshot`}.png`;if(window.openpond?.files?.saveImage){let r=await window.openpond.files.saveImage({url:e.dataUrl,suggestedName:t});!r.ok&&!r.canceled&&n?.(r.error??`Snapshot could not be saved.`,`error`)}else{let n=document.createElement(`a`);n.href=e.dataUrl,n.download=t,n.click()}}return(0,_.jsxs)(`section`,{className:`browser-snapshot-preview`,"aria-label":`Snapshot preview`,children:[(0,_.jsxs)(`div`,{className:`html-visual-toolbar`,children:[(0,_.jsxs)(`span`,{children:[e.selector,` · `,e.width,` × `,e.height]}),e.source?(0,_.jsx)(`button`,{type:`button`,"aria-label":`Copy ${r}`,title:`Copy ${r}`,onClick:()=>void i(e.source),children:(0,_.jsx)(a,{size:15})}):null,(0,_.jsx)(`button`,{type:`button`,"aria-label":`Save snapshot PNG`,title:`Save snapshot PNG`,onClick:()=>void c(),children:(0,_.jsx)(u,{size:15})}),(0,_.jsx)(`button`,{type:`button`,"aria-label":`Close snapshot`,title:`Close snapshot`,onClick:t,children:(0,_.jsx)(o,{size:15})})]}),(0,_.jsx)(`div`,{className:`browser-snapshot-image`,children:(0,_.jsx)(`img`,{src:e.dataUrl,alt:`Snapshot of ${e.selector}`})}),e.source?(0,_.jsxs)(`details`,{children:[(0,_.jsx)(`summary`,{children:r}),(0,_.jsx)(`pre`,{children:e.source})]}):null]})}function x(e,t,n,r){let[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(null),u=(0,g.useRef)(0),d=(0,g.useRef)(null),f=(0,g.useCallback)(()=>{u.current++,d.current?.(),d.current=null,a(null)},[]);return(0,g.useEffect)(()=>(s(null),l(null),f),[e,t,n,f]),(0,g.useEffect)(()=>{if(i!==`node`)return;let e=e=>{e.key===`Escape`&&f()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,f]),{busy:i,image:o,error:c,capture:(0,g.useCallback)(async i=>{f();let o=u.current;s(null),l(null),a(i);try{let a=window.openpond?.browser;if(!a)throw Error(`Snapshots are available in the desktop app.`);let c;if(n){let e=r.current;if(!e)throw Error(`Wait for the HTML page to finish loading.`);d.current=()=>e.cancel();let t=await e.capture(i);if(o!==u.current)return;c=await a.captureHtml(t)}else{if(!t)throw Error(`Open a browser page before taking a snapshot.`);let n={conversationId:e,tabId:t};d.current=()=>{a.cancelCapture(n)},c=await a.capturePage({...n,mode:i})}if(o!==u.current)return;c.ok?s(c.image):c.canceled||l(c.error)}catch(e){o===u.current&&!(e instanceof DOMException&&e.name===`AbortError`)&&l(e instanceof Error?e.message:`Snapshot failed.`)}finally{o===u.current&&(a(null),d.current=null)}},[f,e,t,n,r]),cancel:f,close:()=>s(null)}}function S({conversationId:e,expanded:t,onResizeStart:n,connection:r=null,visualTabs:i}){let a=f(e),o=s(),[u,h]=(0,g.useState)({}),S=i?.tabs.find(e=>e.publicationId===i.activeId),C=(0,g.useRef)(null),w=x(e,a.activeTab?.id??null,S?.publicationId??null,C),T=(i?.tabs??[]).map(e=>({id:e.publicationId,url:`${e.output.title}.html`,title:e.output.title,faviconUrl:null,loading:!1,canGoBack:!1,canGoForward:!1,error:null})),E=T.find(e=>e.id===S?.publicationId),D=(0,g.useCallback)(t=>{window.openpond?.browser?.setBounds({conversationId:e,bounds:t})},[e]),O=(0,g.useCallback)(e=>{i?.showBrowser(),a.open(e,{explicitFile:!0}).catch(e=>o?.(e instanceof Error?e.message:`Could not open browser.`,`error`))},[a,i,o]),k=(0,g.useCallback)(()=>{window.confirm(`Clear shared browser data? Cookies, logins, cache, and site storage will be removed for all chats. This chat's browser tabs will also close.`)&&a.clearData()},[a]);return(0,_.jsxs)(`aside`,{className:`workspace-diff-panel browser-sidebar-panel ${t?`expanded`:``} ${w.busy===`node`||w.error?`has-capture-status`:``}`,"aria-label":`Browser`,children:[!t&&(0,_.jsx)(`div`,{className:`workspace-diff-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize browser panel`,onPointerDown:n}),(0,_.jsx)(m,{activeTabId:S?.publicationId??a.state.activeTabId,tabs:[...a.state.tabs,...T],onCloseTab:e=>{T.some(t=>t.id===e)?i?.close(e):a.closeTab(e)},onNewTab:()=>{i?.showBrowser(),a.newTab()},onSelectTab:e=>{T.some(t=>t.id===e)?i?.select(e):(i?.showBrowser(),a.selectTab(e))}}),(0,_.jsx)(p,{activeTab:E??a.activeTab,documentName:E?.url,available:a.available,snapshotActions:(0,_.jsx)(y,{available:!w.image&&!!(S?window.openpond?.browser?.captureHtml:a.activeTab&&!a.activeTab.loading&&window.openpond?.browser?.capturePage),busy:!!w.busy,onCapture:e=>void w.capture(e),onCancel:w.cancel}),onBack:()=>void a.back(),onClearData:k,onForward:()=>void a.forward(),onNavigate:O,onOpenExternal:()=>void a.openExternal(),onReload:()=>{S?h(e=>({...e,[S.publicationId]:(e[S.publicationId]??0)+1})):a.reload()},onStop:()=>void a.stop()}),w.busy===`node`?(0,_.jsx)(`p`,{className:`browser-snapshot-status`,role:`status`,children:`Hover to highlight an element, then click to capture it. Press Esc to cancel.`}):null,w.error?(0,_.jsx)(c,{error:w.error}):null,(0,_.jsxs)(`div`,{className:`browser-content`,children:[w.image?(0,_.jsx)(b,{image:w.image,onClose:w.close}):null,i?.tabs.map(e=>(0,_.jsx)(`div`,{className:`browser-visual-document`,role:`tabpanel`,"aria-label":e.output.title,hidden:!!w.image||e.publicationId!==S?.publicationId,children:(0,_.jsx)(d,{visual:e,connection:r,expanded:!0,snapshotRef:e.publicationId===S?.publicationId?C:void 0},u[e.publicationId]??0)},e.publicationId)),!S&&!a.available?(0,_.jsxs)(`div`,{className:`browser-empty-state`,children:[(0,_.jsx)(l,{size:18}),(0,_.jsx)(`span`,{children:`Desktop browser bridge unavailable.`})]}):!S&&a.state.tabs.length===0?(0,_.jsxs)(`div`,{className:`browser-empty-state`,children:[(0,_.jsx)(l,{size:18}),(0,_.jsx)(`span`,{children:`Enter a URL to open a browser tab for this conversation.`})]}):null,(0,_.jsx)(v,{active:!w.image&&!S&&a.available&&a.state.tabs.length>0,onBounds:D})]})]})}export{S as BrowserSidebar};
|