openpond 0.2.66 → 0.2.68
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.d.ts +691 -1
- package/dist/app-server.js +1 -1
- package/dist/chunks/{account-context-TIJOM22A.js → account-context-MWB6HN6I.js} +1 -1
- package/dist/chunks/{acp-YYZ3ZO3Q.js → acp-2OIXATRY.js} +1 -1
- package/dist/chunks/{acp-agent-T26S7TU2.js → acp-agent-PAGX2B47.js} +1 -1
- package/dist/chunks/actions-command-2VE6YI4W.js +2 -0
- package/dist/chunks/{app-layer-5XUMNHDO.js → app-layer-YNEUEOEP.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-IB6M35NS.js → app-server-connected-apps-TZOAUOYR.js} +1 -1
- package/dist/chunks/app-server-evaluations-RRLYWLPK.js +2 -0
- package/dist/chunks/app-server-harness-services-XXM336NU.js +2 -0
- package/dist/chunks/app-server-runtime-GBX65JJ7.js +2 -0
- package/dist/chunks/apps-RSFEJOQN.js +2 -0
- package/dist/chunks/chunk-2PXKSAG6.js +2 -0
- package/dist/chunks/{chunk-GRLQHYAU.js → chunk-2TGHZXJE.js} +2 -2
- package/dist/chunks/{chunk-YU4JYWCA.js → chunk-3A2Y7UK3.js} +1 -1
- package/dist/chunks/chunk-3Z4VM2LF.js +4 -0
- package/dist/chunks/chunk-4BUM6JEC.js +33 -0
- package/dist/chunks/chunk-4G3GTEVS.js +23 -0
- package/dist/chunks/{chunk-FUFI4THX.js → chunk-4KNPCJR4.js} +1 -1
- package/dist/chunks/chunk-4KTGYHCE.js +2 -0
- package/dist/chunks/chunk-4PUOWSDE.js +13 -0
- package/dist/chunks/chunk-55YD4UTW.js +2 -0
- package/dist/chunks/chunk-5G7BQAUA.js +2 -0
- package/dist/chunks/chunk-65FJWWXG.js +2 -0
- package/dist/chunks/{chunk-2GJD23CM.js → chunk-65WRWLUD.js} +1 -1
- package/dist/chunks/chunk-6D3FI2XT.js +2 -0
- package/dist/chunks/chunk-73TW6BKK.js +6 -0
- package/dist/chunks/{chunk-6S2MWJVD.js → chunk-7NCM6GBN.js} +1 -1
- package/dist/chunks/chunk-7OFD6TFD.js +2 -0
- package/dist/chunks/chunk-7OKZCJHS.js +3 -0
- package/dist/chunks/{chunk-NTM3KQ25.js → chunk-7PKDJHT6.js} +1 -1
- package/dist/chunks/chunk-7RJOCGQ6.js +2 -0
- package/dist/chunks/{chunk-SAZTOGX6.js → chunk-7RSQOC5M.js} +3 -3
- package/dist/chunks/{chunk-6TRVEA3T.js → chunk-AFH462DO.js} +1 -1
- package/dist/chunks/{chunk-GUG2SWRZ.js → chunk-AFKFN25T.js} +1 -1
- package/dist/chunks/chunk-AFYYIJ6K.js +2 -0
- package/dist/chunks/chunk-APKXXAUF.js +2 -0
- package/dist/chunks/chunk-AQUZCWM3.js +2 -0
- package/dist/chunks/chunk-AUO5DCEU.js +2 -0
- package/dist/chunks/chunk-AYOMVI7J.js +2 -0
- package/dist/chunks/{chunk-EVQISX7M.js → chunk-B66QCXH2.js} +1 -1
- package/dist/chunks/{chunk-S6UCVXBC.js → chunk-BHKXPWFB.js} +1 -1
- package/dist/chunks/chunk-BU6MW65V.js +10 -0
- package/dist/chunks/{chunk-C5B3FMV3.js → chunk-CCZ276IA.js} +1 -1
- package/dist/chunks/{chunk-LYVHYT3L.js → chunk-CIZI6Z7D.js} +1 -1
- package/dist/chunks/{chunk-4D3CICBG.js → chunk-CO23RRN7.js} +1 -1
- package/dist/chunks/{chunk-QAFXQHHG.js → chunk-D6L6UNUQ.js} +2 -2
- package/dist/chunks/chunk-DDOIPTOM.js +2 -0
- package/dist/chunks/{chunk-ZU3YBRXS.js → chunk-DKOVZ6R2.js} +3 -3
- package/dist/chunks/chunk-DRLP7GIU.js +2 -0
- package/dist/chunks/{chunk-DAEUVT2I.js → chunk-DRTHKWHK.js} +1 -1
- package/dist/chunks/{chunk-W22KWKF6.js → chunk-DWF3FCY4.js} +1 -1
- package/dist/chunks/{chunk-NABPZ7AK.js → chunk-DWM5G7BU.js} +1 -1
- package/dist/chunks/chunk-DXJC3QW7.js +2 -0
- package/dist/chunks/{chunk-V3S2B6WU.js → chunk-E2JB5OCO.js} +1 -1
- package/dist/chunks/{chunk-GI7LTJV3.js → chunk-EDYCSW22.js} +1 -1
- package/dist/chunks/{chunk-4JYTFEND.js → chunk-EFP75UEX.js} +1 -1
- package/dist/chunks/{chunk-WKHGXLJD.js → chunk-EGP6DF34.js} +2 -2
- package/dist/chunks/{chunk-M5QPL5NO.js → chunk-ESYPMD7Q.js} +1 -1
- package/dist/chunks/{chunk-PWKJ5KLZ.js → chunk-EXYSD45J.js} +1 -1
- package/dist/chunks/{chunk-XHBMK6LC.js → chunk-EYTTZ5H4.js} +1 -1
- package/dist/chunks/chunk-FKUWCJ73.js +161 -0
- package/dist/chunks/{chunk-U2BD545L.js → chunk-FNGZ4UDZ.js} +1 -1
- package/dist/chunks/{chunk-JFZ6USNQ.js → chunk-G7X73SBG.js} +1 -1
- package/dist/chunks/{chunk-36FNNR5N.js → chunk-GEYZVOGD.js} +1 -1
- package/dist/chunks/{chunk-ULJZ7NUF.js → chunk-GY7YSD6J.js} +1 -1
- package/dist/chunks/{chunk-JLW5BQVO.js → chunk-GYYJ47GX.js} +1 -1
- package/dist/chunks/chunk-HG2YFMVU.js +4 -0
- package/dist/chunks/{chunk-BTJACFU3.js → chunk-HKVFU3B3.js} +1 -1
- package/dist/chunks/chunk-IHAEZ73V.js +2 -0
- package/dist/chunks/{chunk-LI3FTPAH.js → chunk-IIT66347.js} +4 -4
- package/dist/chunks/{chunk-Q4AXZY2P.js → chunk-IO5DZUKL.js} +1 -1
- package/dist/chunks/chunk-J256AEEE.js +2 -0
- package/dist/chunks/{chunk-CRDKBFRN.js → chunk-JEMECEQH.js} +1 -1
- package/dist/chunks/{chunk-7P5SH3CI.js → chunk-JPUSTFZC.js} +1 -1
- package/dist/chunks/{chunk-5AU5Y6KS.js → chunk-JQOVC35K.js} +1 -1
- package/dist/chunks/{chunk-VS3AMJEK.js → chunk-JT5YQ52I.js} +1 -1
- package/dist/chunks/chunk-JVMSN7LH.js +2 -0
- package/dist/chunks/{chunk-HORMGT2Q.js → chunk-JXYJQT5Q.js} +1 -1
- package/dist/chunks/{chunk-OTUS7NTQ.js → chunk-K7KBFM2T.js} +1 -1
- package/dist/chunks/{chunk-FS2VKOT7.js → chunk-KCLMA2IH.js} +1 -1
- package/dist/chunks/chunk-KDER7R45.js +2 -0
- package/dist/chunks/{chunk-WBO6FQHR.js → chunk-KOC3YJEU.js} +2 -2
- package/dist/chunks/{chunk-6ZTP6CUJ.js → chunk-KP2MYTP5.js} +1 -1
- package/dist/chunks/{chunk-YRDPVTEI.js → chunk-KU4TPDPH.js} +2 -2
- package/dist/chunks/{chunk-WJSJXK2N.js → chunk-KUE46HTH.js} +1 -1
- package/dist/chunks/chunk-LVXL7T5O.js +2 -0
- package/dist/chunks/{chunk-5KWKSR4P.js → chunk-M4A7G4S5.js} +2 -2
- package/dist/chunks/{chunk-KAWXVMHI.js → chunk-M4ZHFDRJ.js} +1 -1
- package/dist/chunks/{chunk-HX6GXMDK.js → chunk-MEJLWNRS.js} +1 -1
- package/dist/chunks/{chunk-B666Z2NS.js → chunk-MIFVX5PK.js} +1 -1
- package/dist/chunks/{chunk-66HFW4OU.js → chunk-MOXIGLN2.js} +1 -1
- package/dist/chunks/{chunk-7XOUM6RK.js → chunk-N5EAVX4G.js} +1 -1
- package/dist/chunks/{chunk-Z2TOBS3P.js → chunk-NMMHXYDJ.js} +1 -1
- package/dist/chunks/{chunk-EBOTNBUS.js → chunk-NRYC4NH6.js} +1 -1
- package/dist/chunks/chunk-NSSZ2ZIU.js +2 -0
- package/dist/chunks/{chunk-4TTXNVCE.js → chunk-OFJPOTES.js} +1 -1
- package/dist/chunks/chunk-OIH2LPIT.js +2 -0
- package/dist/chunks/chunk-OUJ63LMU.js +2 -0
- package/dist/chunks/{chunk-DXA2UHBE.js → chunk-P4QM63L3.js} +1 -1
- package/dist/chunks/chunk-PACLKDTN.js +2 -0
- package/dist/chunks/{chunk-AF3AVDPP.js → chunk-PAYFJHPO.js} +1 -1
- package/dist/chunks/{chunk-OPTJYDZN.js → chunk-PHZZBXDO.js} +1 -1
- package/dist/chunks/{chunk-HPTEJBP4.js → chunk-PKJHN666.js} +1 -1
- package/dist/chunks/{chunk-HNDAGZCF.js → chunk-PLROXHG2.js} +1 -1
- package/dist/chunks/{chunk-W7NXFRHN.js → chunk-PNPV2LDE.js} +1 -1
- package/dist/chunks/{chunk-DSJZS77R.js → chunk-PSY6IRJE.js} +8 -8
- package/dist/chunks/{chunk-UK5LGSGT.js → chunk-Q73RKX7I.js} +1 -1
- package/dist/chunks/{chunk-PLVWARB7.js → chunk-Q7FBVLLB.js} +1 -1
- package/dist/chunks/{chunk-QAEZNFAM.js → chunk-Q7P34B2O.js} +1 -1
- package/dist/chunks/{chunk-QYQZQVVN.js → chunk-QLGP2OAQ.js} +1 -1
- package/dist/chunks/{chunk-GIU3Z45P.js → chunk-QUNQM2E3.js} +1 -1
- package/dist/chunks/chunk-R2FYCJL6.js +2 -0
- package/dist/chunks/{chunk-KOKBDIGR.js → chunk-R4EEGWXB.js} +1 -1
- package/dist/chunks/chunk-RBTDSI4L.js +11 -0
- package/dist/chunks/chunk-RCQYEHHD.js +2 -0
- package/dist/chunks/{chunk-TGULVWPV.js → chunk-RFQD6B44.js} +1 -1
- package/dist/chunks/{chunk-3WJQ4IGK.js → chunk-RPM4FDRX.js} +1 -1
- package/dist/chunks/{chunk-MCBRB5D6.js → chunk-RY46UPBO.js} +4 -4
- package/dist/chunks/{chunk-67HXM6AL.js → chunk-SDHG6CKU.js} +1 -1
- package/dist/chunks/{chunk-DIDQHTAX.js → chunk-SO4GMSNP.js} +1 -1
- package/dist/chunks/{chunk-O6ZYDHEJ.js → chunk-SSHE6B7Z.js} +1 -1
- package/dist/chunks/{chunk-SH7POUVX.js → chunk-SV7ZBEK2.js} +6 -6
- package/dist/chunks/{chunk-BJXPQIVD.js → chunk-U7D6Q744.js} +1 -1
- package/dist/chunks/chunk-U7X5ZLAL.js +2 -0
- package/dist/chunks/{chunk-LARJARMS.js → chunk-UANH7U3Y.js} +1 -1
- package/dist/chunks/{chunk-CYQLXS2U.js → chunk-UGFSAG4U.js} +1 -1
- package/dist/chunks/chunk-ULTV6INR.js +2 -0
- package/dist/chunks/{chunk-FHLSLOKH.js → chunk-UMAVVMXL.js} +7 -7
- package/dist/chunks/chunk-V24VHT76.js +2 -0
- package/dist/chunks/chunk-VEBW7NKD.js +2 -0
- package/dist/chunks/chunk-VJR2GNRY.js +2 -0
- package/dist/chunks/{chunk-JD76ANPN.js → chunk-VJYOKU3C.js} +1 -1
- package/dist/chunks/{chunk-5Z3AU5CL.js → chunk-VWWKWYSQ.js} +1 -1
- package/dist/chunks/chunk-WCNPGKST.js +2 -0
- package/dist/chunks/chunk-WD4KAKEX.js +2 -0
- package/dist/chunks/chunk-WGQ3FMRF.js +2 -0
- package/dist/chunks/{chunk-6C3CXME7.js → chunk-WNXUSELC.js} +1 -1
- package/dist/chunks/{chunk-GFAI2MCJ.js → chunk-WZ35ICTE.js} +3 -3
- package/dist/chunks/chunk-XHACK2KR.js +2 -0
- package/dist/chunks/chunk-XOPHFUUY.js +2 -0
- package/dist/chunks/{chunk-UXPO3ZV7.js → chunk-XQAUHXL4.js} +4 -4
- package/dist/chunks/{chunk-OXRVILDW.js → chunk-XT4CSKHM.js} +1 -1
- package/dist/chunks/{chunk-QJJNHKLT.js → chunk-XY7HFXLH.js} +1 -1
- package/dist/chunks/{chunk-ZUT4EM64.js → chunk-XYZV3FKD.js} +1 -1
- package/dist/chunks/{chunk-7FBWUVX7.js → chunk-Y2WNZWT2.js} +1 -1
- package/dist/chunks/chunk-Y4I6CFZJ.js +2 -0
- package/dist/chunks/chunk-YDZBX4XQ.js +2 -0
- package/dist/chunks/chunk-YI6ME6PU.js +22 -0
- package/dist/chunks/{chunk-H42UW6IF.js → chunk-YXMYK5P7.js} +1 -1
- package/dist/chunks/{chunk-D7R2AAX2.js → chunk-Z33RVGP6.js} +1 -1
- package/dist/chunks/{chunk-B32CW3NT.js → chunk-ZDEIVUUI.js} +1 -1
- package/dist/chunks/{chunk-IEVJLG3V.js → chunk-ZIQJDTQB.js} +1 -1
- package/dist/chunks/{chunk-GDJ4X2ZN.js → chunk-ZYLLPRPU.js} +1 -1
- package/dist/chunks/cli-R7TAP6Z2.js +2 -0
- package/dist/chunks/command-LNOVZQSK.js +58 -0
- package/dist/chunks/{configuration-command-4WTS2MZS.js → configuration-command-CNITTZRP.js} +1 -1
- package/dist/chunks/connected-app-executor-FGWCLOJO.js +2 -0
- package/dist/chunks/connected-evidence-5VZBYNWN.js +2 -0
- package/dist/chunks/{connected-starting-assets-4LDXQVLN.js → connected-starting-assets-KWOFEIE4.js} +1 -1
- package/dist/chunks/{connection-GDWPMHPC.js → connection-VMBXW5PD.js} +1 -1
- package/dist/chunks/{continual-HQCFY7GN.js → continual-FVOLGGOE.js} +1 -1
- package/dist/chunks/core-commands-BPYXVT7O.js +2 -0
- package/dist/chunks/dataset-preparation-authoring-UUYFWWCT.js +4 -0
- package/dist/chunks/datasets-E5TXSVIY.js +2 -0
- package/dist/chunks/desktop-test-FX7DTY4N.js +3 -0
- package/dist/chunks/dist-2MKJC6HN.js +2 -0
- package/dist/chunks/{dist-GR56E3QK.js → dist-DKE7RJZN.js} +1 -1
- package/dist/chunks/evaluation-coordination-KUTZEEPB.js +2 -0
- package/dist/chunks/experiment-improvements-PQNR5YHN.js +2 -0
- package/dist/chunks/experiments-Z4BJWT3Y.js +2 -0
- package/dist/chunks/experiments-signal-3GCLKUWZ.js +2 -0
- package/dist/chunks/{extension-UH34ZF7N.js → extension-3EKIT6BB.js} +1 -1
- package/dist/chunks/{help-JQA3YMCX.js → help-K6YLZ3KL.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-UF4ATIUF.js +2 -0
- package/dist/chunks/host-profile-external-dataset-KSEPXY2S.js +2 -0
- package/dist/chunks/hosted-app-server-composition-LA3BZ4SE.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-VG2WE7XZ.js +3 -0
- package/dist/chunks/hosted-harness-runtime-MMTLCL23.js +2 -0
- package/dist/chunks/hosted-profile-candidate-PTGQLPZO.js +3 -0
- package/dist/chunks/hosted-profile-compiler-FS5R6CHJ.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-UUEZEMXU.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-4F7OEF4T.js +3 -0
- package/dist/chunks/hosted-profile-evaluation-preparation-LIJJZDHQ.js +3 -0
- package/dist/chunks/hosted-tasksets-NXVF4AQA.js +2 -0
- package/dist/chunks/human-review-2ZOB7CJZ.js +2 -0
- package/dist/chunks/{import-CLWTKDG6.js → import-YHYKZ6JN.js} +2 -2
- package/dist/chunks/javascript-isolate-process-source-YAT3GPW4.js +2 -0
- package/dist/chunks/javascript-verifier-worker-source-LGRP74W4.js +2 -0
- package/dist/chunks/{learning-XTY5VOTK.js → learning-LAXMGWSQ.js} +1 -1
- package/dist/chunks/learning-Y3UKNUGE.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-3YJQRYXC.js +2 -0
- package/dist/chunks/local-harness-taskset-review-XQHQ6JCR.js +2 -0
- package/dist/chunks/{model-projects-GHWCKDON.js → model-projects-6YWVD2TS.js} +1 -1
- package/dist/chunks/opchat-XXI2ZM53.js +3 -0
- package/dist/chunks/opchat-bounded-chat-3MZGCRLY.js +2 -0
- package/dist/chunks/organizations-W7HI2JA4.js +2 -0
- package/dist/chunks/{profile-RIDNU2I5.js → profile-P2SJPBOJ.js} +1 -1
- package/dist/chunks/project-action-payload-LTIQBX77.js +2 -0
- package/dist/chunks/project-agent-XRIXMXQK.js +2 -0
- package/dist/chunks/published-experiment-source-SDXUVPE7.js +2 -0
- package/dist/chunks/refiner-profile-service-56VYLZQJ.js +2 -0
- package/dist/chunks/{runtime-VSOOPNYN.js → runtime-Q7JUJO4D.js} +2 -2
- package/dist/chunks/sandbox-command-HVA5FJU4.js +2 -0
- package/dist/chunks/{sandbox-template-NN3XQI7M.js → sandbox-template-U536EEWY.js} +1 -1
- package/dist/chunks/saved-work-KSIQPXC2.js +2 -0
- package/dist/chunks/{send-turn-D3GTSSHI.js → send-turn-YLY3YNEQ.js} +1 -1
- package/dist/chunks/setup-RMZ2BHLM.js +2 -0
- package/dist/chunks/{src-662QOKNP.js → src-C3ZUESMK.js} +1 -1
- package/dist/chunks/src-SGQYVBNQ.js +424 -0
- package/dist/chunks/standalone-experiment-turn-owner-TW5MTWIO.js +2 -0
- package/dist/chunks/store-chat-resources-IRHBW2EC.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-7PDLGRWF.js → store-continual-support-reviews-3KK42L4I.js} +1 -1
- package/dist/chunks/store-conversation-serving-IVURK52V.js +2 -0
- package/dist/chunks/{store-create-improve-G46KIUVT.js → store-create-improve-UTCLBXF2.js} +1 -1
- package/dist/chunks/{store-datasets-O67F75BL.js → store-datasets-4AQOVAQY.js} +1 -1
- package/dist/chunks/store-evaluation-results-PK2P3IMH.js +7 -0
- package/dist/chunks/{store-harness-workspaces-PJJQ74G6.js → store-harness-workspaces-YEXB4IRV.js} +1 -1
- package/dist/chunks/store-human-review-O4BVHP25.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-44SVX6YB.js +2 -0
- package/dist/chunks/{store-learning-6P6IS7GH.js → store-learning-SIUQIY5C.js} +1 -1
- package/dist/chunks/{store-learning-credentials-EGJ2WTZI.js → store-learning-credentials-BUHR7SN6.js} +1 -1
- package/dist/chunks/store-local-experiments-BHVTKPPE.js +97 -0
- package/dist/chunks/store-model-batch-review-RVAYUVK2.js +2 -0
- package/dist/chunks/{store-model-configuration-T6XJJDAB.js → store-model-configuration-6L3OYXF4.js} +1 -1
- package/dist/chunks/store-model-project-preparation-AAEKCF6V.js +2 -0
- package/dist/chunks/store-modification-recordings-LCPK6K2T.js +9 -0
- package/dist/chunks/{store-preference-comparison-XQFTLMGH.js → store-preference-comparison-5YVIQNVB.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-J3JEVAYR.js → store-sidebar-file-bookmarks-WLMYDA4E.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-2JHTFXJK.js → store-sidebar-preferences-AFMYIDWT.js} +1 -1
- package/dist/chunks/{store-subagents-PUBQVWSU.js → store-subagents-KFPVSTRO.js} +1 -1
- package/dist/chunks/{store-task-inbox-VVXZUJIO.js → store-task-inbox-L6IQTY26.js} +1 -1
- package/dist/chunks/{store-task-inventory-MQX44AI6.js → store-task-inventory-QWS2C656.js} +1 -1
- package/dist/chunks/store-taskset-drafts-FRFL6ITK.js +9 -0
- package/dist/chunks/{store-training-DUVIDYK5.js → store-training-FYXZU2FE.js} +1 -1
- package/dist/chunks/{store-training-jobs-HHFH3V5O.js → store-training-jobs-3N3VKPIY.js} +1 -1
- package/dist/chunks/{store-training-models-C7UUZDTO.js → store-training-models-VOFVGPZR.js} +1 -1
- package/dist/chunks/{taskset-7FQCJ55X.js → taskset-UDDLFYKV.js} +1 -1
- package/dist/chunks/taskset-catalog-RZYEBCRQ.js +2 -0
- package/dist/chunks/taskset-packages-T6B6HYKZ.js +2 -0
- package/dist/chunks/taskset-packages-WMG5DUBN.js +2 -0
- package/dist/chunks/{teams-bot-FXMCOCPP.js → teams-bot-MPWL2PP4.js} +1 -1
- package/dist/chunks/tool-learning-ZQ6NSJ5K.js +2 -0
- package/dist/chunks/training-5NT2YB2L.js +2 -0
- package/dist/chunks/training-5UMT45UL.js +2 -0
- package/dist/chunks/training-UY6KRG4M.js +2 -0
- package/dist/chunks/{training-error-LQKCOQDJ.js → training-error-WF463UNZ.js} +1 -1
- package/dist/chunks/{training-hardware-ESXRWUIK.js → training-hardware-UWQCRDMV.js} +1 -1
- package/dist/chunks/training-hosted-CKSDRVL6.js +2 -0
- package/dist/chunks/training-hosted-alphaedit-HSMRDJTD.js +2 -0
- package/dist/chunks/training-hosted-checkpoint-evaluation-2X7RSOLC.js +2 -0
- package/dist/chunks/training-hosted-decision-7JALOU6O.js +2 -0
- package/dist/chunks/training-hosted-engram-SXO75MFG.js +2 -0
- package/dist/chunks/{training-hosted-learning-YN5VD3PW.js → training-hosted-learning-E2N32YU5.js} +1 -1
- package/dist/chunks/training-hosted-modification-comparison-TXFDJFTG.js +2 -0
- package/dist/chunks/training-hosted-neuron-training-J42WK4EH.js +2 -0
- package/dist/chunks/training-hosted-report-T633TNJG.js +2 -0
- package/dist/chunks/training-hosted-serving-report-BAEABGJH.js +2 -0
- package/dist/chunks/training-hosted-steering-T556BUBG.js +2 -0
- package/dist/chunks/training-hosted-workers-Y2PO5IOA.js +2 -0
- package/dist/chunks/training-model-start-P3PXDWNT.js +2 -0
- package/dist/chunks/web-search-ZEKJHZW4.js +2 -0
- package/dist/chunks/{workspaces-MCS2AQX6.js → workspaces-EK62ANTB.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox/types/billing.d.ts +87 -6
- package/dist/sandbox/types/io.d.ts +3 -0
- package/dist/sandbox-template/manifest.js +1 -1
- package/dist/skills/manifest.json +3 -3
- package/dist/skills/openpond-cli/references/experiments-and-training.md +461 -1
- package/dist/web/assets/App-CCuh99JW.js +54 -0
- package/dist/web/assets/{AppDialog-DuSd0wk6.js → AppDialog-CxjDHVk9.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-CKJIVpKa.js +2 -0
- package/dist/web/assets/{AppToastContext-Dklk6CaG.js → AppToastContext-EpiT1dHs.js} +1 -1
- package/dist/web/assets/AppsView-BsMyPX_3.js +1 -0
- package/dist/web/assets/{AppsView-DNHWzJb2.css → AppsView-D3vVesNd.css} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-DipNT6Tj.js → AttachmentTypeIcon-BXvZy5gB.js} +1 -1
- package/dist/web/assets/BrowserSidebar-BIIV4aq4.js +1 -0
- package/dist/web/assets/{CartesianChart-UU1sdoUO.js → CartesianChart-brqLBqnF.js} +1 -1
- package/dist/web/assets/ChatTimelineEntry-CwZbn16X.js +8 -0
- package/dist/web/assets/{CollaborationTabs-BWYRQ1PE.js → CollaborationTabs-BU4uc4tZ.js} +1 -1
- package/dist/web/assets/{CommandMenu-B08F9x5g.js → CommandMenu-DkWpXR55.js} +1 -1
- package/dist/web/assets/CommunityView-CsSxJZGn.js +1 -0
- package/dist/web/assets/{ComposerAttachments-srWBKvCv.js → ComposerAttachments-BdJGCYzI.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DqTpU5cO.js → ComposerCreateImproveStrip-CWy0j1vv.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-2KC-KQvu.js → ConversationImportsSettings-DCmiakbZ.js} +1 -1
- package/dist/web/assets/DatasetReviewImport-DEnF_pGu.js +1 -0
- package/dist/web/assets/ExperimentTrainingDataWorkspace-WhwQ0QBi.js +2 -0
- package/dist/web/assets/{FilePagePreview-B-iUVPhh.js → FilePagePreview-BRhhz99q.js} +2 -2
- package/dist/web/assets/{GetStartedView-5v0vBWXy.js → GetStartedView-CLVD-qEi.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-Bn4072K-.js → GettingStartedDialog-CMxaAMg-.js} +1 -1
- package/dist/web/assets/HostedModelLearningReview-Cn-j-rDo.js +1 -0
- package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +1 -0
- package/dist/web/assets/{HtmlVisual-C2WsMj90.js → HtmlVisual-D5y2WG9L.js} +10 -10
- package/dist/web/assets/LabModelVersionDetailPage-BxRmYD6h.js +1 -0
- package/dist/web/assets/{TrainingRunLineage-PXzWR65d.css → LabModelWorkspace-DOrgCk9Z.css} +1 -1
- package/dist/web/assets/LabModelWorkspace-u2Ulm_z4.js +1 -0
- package/dist/web/assets/{LabSkillSidebar-C50P74LI.js → LabSkillSidebar-C7IceJTJ.js} +1 -1
- package/dist/web/assets/LabsRoute-C9Y0GU34.css +1 -0
- package/dist/web/assets/LabsRoute-CbztQaEf.js +74 -0
- package/dist/web/assets/LearningBatchesPage-B1NZTBSv.css +1 -0
- package/dist/web/assets/LearningBatchesPage-CJqgZNvM.js +26 -0
- package/dist/web/assets/MainChatThread-DNMfrrRq.js +2 -0
- package/dist/web/assets/{MainPane-Dje-hfUM.css → MainPane-BZlNLfTM.css} +1 -1
- package/dist/web/assets/MainPane-CQQxSDPS.js +13 -0
- package/dist/web/assets/ModelProjectPageHeader-Dge19aE1.js +1 -0
- package/dist/web/assets/NativeSetupTerminal-D4JnbpyD.js +2 -0
- package/dist/web/assets/{NativeSkillSidebar-Clv0IWyn.js → NativeSkillSidebar-Jzx1BeKV.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-Cw_F5Eaa.js → NewProjectDialog-DcnGzEd9.js} +1 -1
- package/dist/web/assets/{OutputsPage-Btyiie4B.js → OutputsPage-Cmk15Vt_.js} +1 -1
- package/dist/web/assets/{PageChrome-BLLw_cEA.js → PageChrome-Cz_fCqtn.js} +1 -1
- package/dist/web/assets/{ProjectsPage-BpSHWQgj.js → ProjectsPage-BZ3Eo3Mz.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-C6H2vU9N.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-WytWGQgw.js → ScheduledWorkPage-CAkSwM0T.js} +1 -1
- package/dist/web/assets/{SettingsView-BJq5zNkv.js → SettingsView-DvQXGw3_.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-BxFEWI9W.js → TasksetDraftEditorPrimitives-JuU1k8vr.js} +1 -1
- package/dist/web/assets/TeamChatView-DmHjr8W9.js +1 -0
- package/dist/web/assets/{TerminalOverlay-C7OM2F0-.js → TerminalOverlay-DlaM9d8F.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-KH5GFacT.js → TrainingCreationPanel-ClpylNsr.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-DzOw13Md.js → TrainingDraftPanel-6tH2xSDj.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-nZHno_4P.js → UsageSettingsSection-CzDqxOYM.js} +2 -2
- package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-B4e0lyF7.js +11 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-D01ZkZZF.js +35 -0
- package/dist/web/assets/{WorkspaceFileLocation-1U8DDj1J.js → WorkspaceFileLocation-C5s_njZb.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-BO1EUA3G.js → WorkspaceGitDialogs-DjPZ6KIh.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-Rqq_sKW_.js → WorkspaceMonacoEditor-CC4sfOiU.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-zmmMp09R.js → WorkspacePdfPreview-vszQqFa4.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DNbhGjkE.js → WorkspacePresentationPreview-DQTvhaRD.js} +1 -1
- package/dist/web/assets/api-client-DJRVOFzS.js +1 -0
- package/dist/web/assets/{app-models-Cz3yxq4x.js → app-models-BUdzQbXo.js} +1 -1
- package/dist/web/assets/bot-Doyx3T4j.js +1 -0
- package/dist/web/assets/{browser-sidebar-links-ZyYiYBBd.js → browser-sidebar-links-PVPCrsDJ.js} +1 -1
- package/dist/web/assets/chat-resources-Beh5lB36.js +1 -0
- package/dist/web/assets/chevron-down-DX1hzujj.js +1 -0
- package/dist/web/assets/chevron-right-DHN0y3KC.js +1 -0
- package/dist/web/assets/chevron-up-_QrW88NF.js +1 -0
- package/dist/web/assets/chunk-3BYFS4RO-ztZjcMmt.js +1 -0
- package/dist/web/assets/chunk-AG6UJ3DI-D9KZjTYP.js +1 -0
- package/dist/web/assets/chunk-C3TS766N-ppRhs95p.js +1 -0
- package/dist/web/assets/chunk-GCUWJUUM-Dy6oUNJ6.js +9 -0
- package/dist/web/assets/chunk-GS5HEE4M-C0RLeIsy.js +1 -0
- package/dist/web/assets/chunk-H3JZ3P5T-DolwEJXo.js +2 -0
- package/dist/web/assets/chunk-Q4RGCEOI-Cr-dg4Nk.js +1 -0
- package/dist/web/assets/client-DwZ92xtu.js +1 -0
- package/dist/web/assets/{client-choice-storage-CXlWJW5g.js → client-choice-storage-DitqKiIT.js} +1 -1
- package/dist/web/assets/cloud-upload-HdzNTgr2.js +1 -0
- package/dist/web/assets/common-BWVSBnpX.js +1 -0
- package/dist/web/assets/copy-DTQhoBNg.js +1 -0
- package/dist/web/assets/create-pipeline-DsZzNkt9.js +1 -0
- package/dist/web/assets/{cssMode-Cps-05f3.js → cssMode-BRTtfXxU.js} +1 -1
- package/dist/web/assets/dataset-workspaces-BTPi71mz.js +1 -0
- package/dist/web/assets/external-link-H1629UU6.js +1 -0
- package/dist/web/assets/folder-open-CAGdWOrr.js +1 -0
- package/dist/web/assets/folder-plus-C14cs2mE.js +1 -0
- package/dist/web/assets/git-commit-horizontal-DFUfuVvF.js +1 -0
- package/dist/web/assets/{htmlMode-Do72TyNy.js → htmlMode-BVaCcL76.js} +1 -1
- package/dist/web/assets/icons-Bk2b68aC.js +1 -0
- package/dist/web/assets/image-0DPVY6Ev.js +1 -0
- package/dist/web/assets/{index-D7igQSAg.js → index-B6XX_0h3.js} +2 -2
- package/dist/web/assets/info-C8b_tafZ.js +1 -0
- package/dist/web/assets/intake-contracts-B8JZKYwb.js +1 -0
- package/dist/web/assets/{jsonMode-B2N7W15Y.js → jsonMode-BCKKQmmV.js} +1 -1
- package/dist/web/assets/loader-circle-y-SSPwpk.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DPmyOFVA.js → lspLanguageFeatures-DozmNUOx.js} +1 -1
- package/dist/web/assets/maximize-2-CByk9-zN.js +1 -0
- package/dist/web/assets/message-square-C889vRqm.js +1 -0
- package/dist/web/assets/{monaco.contribution-DqqJBDzF.js → monaco.contribution-B9q6qbbo.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BfOxF9PJ.js → monaco.contribution-BITdsRbn.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DNONXznc.js → monaco.contribution-BqA-XZ44.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CRdTg0FH.js → monaco.contribution-DxAV1oS5.js} +2 -2
- package/dist/web/assets/monitor-BtxlcLuI.js +1 -0
- package/dist/web/assets/paperclip-BeIdaspf.js +1 -0
- package/dist/web/assets/{pdf-BCq2Oosd.js → pdf-perlzwEB.js} +1 -1
- package/dist/web/assets/play-CHXXdkuO.js +1 -0
- package/dist/web/assets/plus-DFFWjhPw.js +1 -0
- package/dist/web/assets/{ponder-desktop-Dm7tOkKo.js → ponder-desktop-Ca-9KggQ.js} +1 -1
- package/dist/web/assets/presentation-0bzvu6_u.js +1 -0
- package/dist/web/assets/{profile-ref-DSNkG6Ol.js → profile-ref-D8lxL7dW.js} +1 -1
- package/dist/web/assets/{python-DuGMr666.js → python-B9hOnkOI.js} +1 -1
- package/dist/web/assets/refresh-cw-D61-Ozk3.js +1 -0
- package/dist/web/assets/{requests-BCbaFiqV.js → requests-DmeUYik4.js} +1 -1
- package/dist/web/assets/reward-checks-DJJZYgf8.js +7 -0
- package/dist/web/assets/save-iEMNZoPe.js +1 -0
- package/dist/web/assets/schemas-Brv9Vmnk.js +64 -0
- package/dist/web/assets/settings-BC-bzgk6.js +21 -0
- package/dist/web/assets/settings-lists-C84qxFmP.js +5 -0
- package/dist/web/assets/square-BE_4JMR3.js +1 -0
- package/dist/web/assets/square-terminal-Djpzo2Qs.js +1 -0
- package/dist/web/assets/{submit-issue-command-wfngGS6Y.js → submit-issue-command-HfKzyxg5.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-cl0cw2QK.js → toggleHighContrast-ClsXu39R.js} +1 -1
- package/dist/web/assets/training-DWfghwfZ.js +1 -0
- package/dist/web/assets/{training-model-data-CWnu1bz9.js → training-model-data-CIysl8wH.js} +4 -4
- package/dist/web/assets/{tsMode-DLEc0PYL.js → tsMode-nbmaMc-D.js} +1 -1
- package/dist/web/assets/upload-C6ug8RD-.js +1 -0
- package/dist/web/assets/{useAccountSettings-ByxjI9BG.js → useAccountSettings-Dr9h4Qz_.js} +1 -1
- package/dist/web/assets/{useAgentInventory-Df64T07n.js → useAgentInventory-ByCk2JAv.js} +1 -1
- package/dist/web/assets/useChatContextSelection-C0eMm2g6.js +1 -0
- package/dist/web/assets/{useLocalAgentSchedules-DNh_x9gQ.js → useLocalAgentSchedules-Do0y_leJ.js} +1 -1
- package/dist/web/assets/useQuery-D2MQ7e5U.js +1 -0
- package/dist/web/assets/wifi-off-Dr-CapyW.js +1 -0
- package/dist/web/assets/work-outputs-D_8TovAK.js +1 -0
- package/dist/web/assets/{workers-CnqrOtic.js → workers-DKvM2NdM.js} +1 -1
- package/dist/web/assets/x-Jx2jlP9u.js +1 -0
- package/dist/web/assets/{yaml-C9vtYV4w.js → yaml-C02vq4ar.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +100 -4
- package/package.json +1 -1
- package/dist/chunks/actions-command-VLKMHCMI.js +0 -2
- package/dist/chunks/app-server-evaluations-V6LRWDUF.js +0 -2
- package/dist/chunks/app-server-harness-services-6ZRLA3YD.js +0 -2
- package/dist/chunks/app-server-runtime-TH56EG2Z.js +0 -2
- package/dist/chunks/apps-MNT3KXIY.js +0 -2
- package/dist/chunks/chunk-2W22IXHB.js +0 -2
- package/dist/chunks/chunk-2ZNW6GUU.js +0 -2
- package/dist/chunks/chunk-3BJ7LPE3.js +0 -2
- package/dist/chunks/chunk-3MVKXAH7.js +0 -2
- package/dist/chunks/chunk-4MQHIFZL.js +0 -2
- package/dist/chunks/chunk-55Q64WWF.js +0 -2
- package/dist/chunks/chunk-5KJMFK65.js +0 -2
- package/dist/chunks/chunk-5WPMI6QX.js +0 -2
- package/dist/chunks/chunk-7PKTCMZ6.js +0 -2
- package/dist/chunks/chunk-ANG2YMMD.js +0 -2
- package/dist/chunks/chunk-BQVB2SPF.js +0 -10
- package/dist/chunks/chunk-DMO3UIS7.js +0 -6
- package/dist/chunks/chunk-FEQ7HNJR.js +0 -2
- package/dist/chunks/chunk-G4E3WGLM.js +0 -13
- package/dist/chunks/chunk-H5ML7735.js +0 -2
- package/dist/chunks/chunk-I3NYYOSS.js +0 -2
- package/dist/chunks/chunk-IOSBGCRT.js +0 -2
- package/dist/chunks/chunk-JBFPTEVE.js +0 -2
- package/dist/chunks/chunk-JKI53ED7.js +0 -161
- package/dist/chunks/chunk-JRGECNP3.js +0 -2
- package/dist/chunks/chunk-L4EJ5R3B.js +0 -23
- package/dist/chunks/chunk-LXZLLTYQ.js +0 -2
- package/dist/chunks/chunk-MHPCVQOE.js +0 -2
- package/dist/chunks/chunk-MVPKU72J.js +0 -4
- package/dist/chunks/chunk-OKEC2EIE.js +0 -2
- package/dist/chunks/chunk-OW3EOC5Q.js +0 -4
- package/dist/chunks/chunk-QCJY6FTC.js +0 -3
- package/dist/chunks/chunk-SBQ6KLXB.js +0 -33
- package/dist/chunks/chunk-TVDZXDQW.js +0 -2
- package/dist/chunks/chunk-V3KEG6MI.js +0 -2
- package/dist/chunks/chunk-VD2TQCMH.js +0 -2
- package/dist/chunks/chunk-WLZJOCLA.js +0 -10
- package/dist/chunks/chunk-Y3B6ZUE6.js +0 -22
- package/dist/chunks/chunk-YBKDEEEH.js +0 -2
- package/dist/chunks/chunk-ZWW227M3.js +0 -2
- package/dist/chunks/cli-TE7RP5H7.js +0 -2
- package/dist/chunks/command-NW6BGKOM.js +0 -13
- package/dist/chunks/connected-app-executor-7DYMZCD7.js +0 -2
- package/dist/chunks/connected-evidence-D7C45HYD.js +0 -2
- package/dist/chunks/core-commands-RXPXOYOP.js +0 -2
- package/dist/chunks/dataset-preparation-authoring-KWRTMKN6.js +0 -4
- package/dist/chunks/datasets-LBLEKLCS.js +0 -2
- package/dist/chunks/desktop-test-INJPZ5VP.js +0 -3
- package/dist/chunks/dist-J4KHAVO3.js +0 -2
- package/dist/chunks/evaluation-coordination-3ARLJAFH.js +0 -2
- package/dist/chunks/experiment-improvements-UB4C5CSP.js +0 -2
- package/dist/chunks/experiments-AHHKFJD6.js +0 -2
- package/dist/chunks/experiments-signal-MTR475QV.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +0 -2
- package/dist/chunks/host-profile-external-dataset-YRKG2GL5.js +0 -2
- package/dist/chunks/hosted-app-server-composition-GPXH3BOG.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-NZTPZTDH.js +0 -3
- package/dist/chunks/hosted-harness-runtime-3AJGEIFD.js +0 -2
- package/dist/chunks/hosted-profile-candidate-3CAT3XBI.js +0 -3
- package/dist/chunks/hosted-profile-compiler-RXU626Q6.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-CBDRKJ5J.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-CHYKDYUQ.js +0 -3
- package/dist/chunks/hosted-profile-evaluation-preparation-H5S7JZMD.js +0 -3
- package/dist/chunks/hosted-tasksets-AMGDDB2R.js +0 -2
- package/dist/chunks/human-review-DVHVJXBA.js +0 -2
- package/dist/chunks/javascript-isolate-process-source-ZPQKKLR4.js +0 -2
- package/dist/chunks/javascript-verifier-worker-source-F3LSGPOY.js +0 -2
- package/dist/chunks/learning-NJLTGZFQ.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-XEA73RGS.js +0 -2
- package/dist/chunks/local-harness-taskset-review-SW35G4DM.js +0 -2
- package/dist/chunks/opchat-LMKH3OWR.js +0 -3
- package/dist/chunks/opchat-bounded-chat-PPOWO7H4.js +0 -2
- package/dist/chunks/organizations-T6ZUSHNJ.js +0 -2
- package/dist/chunks/project-action-payload-2G57RL74.js +0 -2
- package/dist/chunks/project-agent-GBMVDJY3.js +0 -2
- package/dist/chunks/published-experiment-source-D3C2AWQD.js +0 -2
- package/dist/chunks/refiner-profile-service-PPGGNVOV.js +0 -2
- package/dist/chunks/sandbox-command-L5VQ2T6C.js +0 -2
- package/dist/chunks/saved-work-LAVTNKPT.js +0 -2
- package/dist/chunks/setup-TXEM2QSG.js +0 -2
- package/dist/chunks/src-HJHIBDFX.js +0 -424
- package/dist/chunks/standalone-experiment-turn-owner-KKYIGGPF.js +0 -2
- package/dist/chunks/store-chat-resources-ZWDYMDJF.js +0 -2
- package/dist/chunks/store-conversation-serving-WRT4N7N2.js +0 -2
- package/dist/chunks/store-evaluation-results-BEPR4LVD.js +0 -7
- package/dist/chunks/store-human-review-HJ3D7ZFA.js +0 -7
- package/dist/chunks/store-learned-preference-migration-validation-EXNRDHCO.js +0 -2
- package/dist/chunks/store-local-experiments-CBJA56X2.js +0 -97
- package/dist/chunks/store-model-batch-review-YIVD7T2T.js +0 -2
- package/dist/chunks/store-model-project-preparation-WWU5CJTV.js +0 -2
- package/dist/chunks/store-taskset-drafts-G3WFVN4M.js +0 -9
- package/dist/chunks/taskset-packages-NRRPON7B.js +0 -2
- package/dist/chunks/taskset-packages-RW4SFGDU.js +0 -2
- package/dist/chunks/tool-learning-O7QTTEDB.js +0 -2
- package/dist/chunks/training-XFM3OOPN.js +0 -2
- package/dist/chunks/training-XILDD5RG.js +0 -2
- package/dist/chunks/training-hosted-6BX2IASC.js +0 -2
- package/dist/chunks/training-hosted-checkpoint-evaluation-UXFW33QL.js +0 -2
- package/dist/chunks/training-hosted-report-UVGTPDOK.js +0 -2
- package/dist/chunks/training-hosted-serving-report-J4YOZLRP.js +0 -2
- package/dist/chunks/training-hosted-workers-6JTDCCWA.js +0 -2
- package/dist/chunks/training-model-start-E5MP3URL.js +0 -2
- package/dist/chunks/web-search-56QRZGPR.js +0 -2
- package/dist/web/assets/App-CNQi3RlI.js +0 -53
- package/dist/web/assets/AppTerminalPanel-DLz34eSs.js +0 -2
- package/dist/web/assets/AppsView-DkCMr67-.js +0 -1
- package/dist/web/assets/BrowserSidebar-BBaaanMS.js +0 -1
- package/dist/web/assets/ChatTimelineEntry-Ct59FKw1.js +0 -8
- package/dist/web/assets/CommunityView-BLTlSxyb.js +0 -1
- package/dist/web/assets/HostedModelLearningReview-DWF6WPao.js +0 -1
- package/dist/web/assets/HostedModelLearningSettings-BYl-2j7B.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-CQz29DwD.js +0 -1
- package/dist/web/assets/LabsRoute-CE45yAXJ.css +0 -1
- package/dist/web/assets/LabsRoute-DJRgF1kQ.js +0 -101
- package/dist/web/assets/MainChatThread-gwmhe1Nw.js +0 -2
- package/dist/web/assets/MainPane-CqtgV9rU.js +0 -10
- package/dist/web/assets/NativeSetupTerminal-DrQldDsG.js +0 -2
- package/dist/web/assets/RightChatPanelStack-xW5rKbp0.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-BDmIxvIm.js +0 -1
- package/dist/web/assets/TeamChatView-BisSMAXy.js +0 -1
- package/dist/web/assets/TrainingRunLineage-B2WBOchk.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-D3Ub_jVj.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-CyTa8Cjs.js +0 -11
- package/dist/web/assets/WorkspaceEnvironmentMenu-CtZzxQ1e.js +0 -35
- package/dist/web/assets/api-client-Dgz-fOMl.js +0 -1
- package/dist/web/assets/bot-D-eTQib6.js +0 -1
- package/dist/web/assets/chat-resources-CTN4f6KC.js +0 -1
- package/dist/web/assets/chevron-down-75im8nFF.js +0 -1
- package/dist/web/assets/chevron-right-CpbCIUFo.js +0 -1
- package/dist/web/assets/chevron-up-BD8jg0bQ.js +0 -1
- package/dist/web/assets/chunk-GJRXJL6G-pJp1DyJd.js +0 -9
- package/dist/web/assets/chunk-H3JZ3P5T-B0SCoPw4.js +0 -2
- package/dist/web/assets/chunk-TLSP5JKG-DZmxtX-4.js +0 -1
- package/dist/web/assets/cloud-upload-4lP-5zmp.js +0 -1
- package/dist/web/assets/common-BMjyKlX-.js +0 -1
- package/dist/web/assets/contracts-BLiqJxBv.js +0 -1
- package/dist/web/assets/copy-DRnATDDY.js +0 -1
- package/dist/web/assets/create-pipeline-CyUZrbbO.js +0 -1
- package/dist/web/assets/createLucideIcon-CmkSm39S.js +0 -1
- package/dist/web/assets/external-link-D_nBEDFO.js +0 -1
- package/dist/web/assets/folder-open-tD5Lle1M.js +0 -1
- package/dist/web/assets/folder-plus-DlZ4hM48.js +0 -1
- package/dist/web/assets/git-commit-horizontal-g8KBhvfr.js +0 -1
- package/dist/web/assets/icons-B8_Rkg-l.js +0 -1
- package/dist/web/assets/image-CUZMnZYi.js +0 -1
- package/dist/web/assets/info-SmuBZiE5.js +0 -1
- package/dist/web/assets/intake-contracts-BW0Y0C2R.js +0 -1
- package/dist/web/assets/loader-circle-D_KVxLLz.js +0 -1
- package/dist/web/assets/maximize-2-B8HN3jsA.js +0 -1
- package/dist/web/assets/message-square-CrDvzn66.js +0 -1
- package/dist/web/assets/models-route-CWcJuOd0.js +0 -1
- package/dist/web/assets/monitor-CW-M_aaj.js +0 -1
- package/dist/web/assets/paperclip-DL449Io5.js +0 -1
- package/dist/web/assets/play-DYLqBrwg.js +0 -1
- package/dist/web/assets/plus-DXZIpQuY.js +0 -1
- package/dist/web/assets/presentation-CupIXaYv.js +0 -1
- package/dist/web/assets/refresh-cw-CzVf5_oo.js +0 -1
- package/dist/web/assets/reward-checks-Bcq9ETCA.js +0 -7
- package/dist/web/assets/save-DatjrYPV.js +0 -1
- package/dist/web/assets/schemas-lO3MoWQr.js +0 -64
- package/dist/web/assets/settings-D7C-Auyi.js +0 -21
- package/dist/web/assets/settings-lists-D2ol3uNK.js +0 -5
- package/dist/web/assets/square-BWB1nbZF.js +0 -1
- package/dist/web/assets/square-terminal-Buj-s-fz.js +0 -1
- package/dist/web/assets/training-DCdoHJ0Y.js +0 -2
- package/dist/web/assets/upload-DaFVH6R1.js +0 -1
- package/dist/web/assets/useQuery-yUz7Ui8g.js +0 -1
- package/dist/web/assets/wifi-off-CtNwnIJc.js +0 -1
- package/dist/web/assets/work-outputs-CK0nHe4g.js +0 -1
- package/dist/web/assets/x-Bhl-4Zlt.js +0 -1
- /package/dist/chunks/{chunk-SFR32TMJ.js → chunk-JXLDEYRW.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as D,b as J,c as q}from"./chunk-Q3WXB465.js";import{a as Y}from"./chunk-
|
|
2
|
+
import{a as D,b as J,c as q}from"./chunk-Q3WXB465.js";import{a as Y}from"./chunk-JQOVC35K.js";import{a as L}from"./chunk-FEAKTSRS.js";import{na as F}from"./chunk-HG2YFMVU.js";import{b as W}from"./chunk-L3KS6MOV.js";import{X as z,x as C}from"./chunk-ZY32SZ2P.js";import{m as N,n as j}from"./chunk-RCT3O3HQ.js";import{A as x}from"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createHash as se}from"node:crypto";function U(a){let d=a.replace(/^\/workspace\/outputs\//,"").replace(/^\/workspace\/work\/outputs\//,"").replace(/^outputs\//,"");if(!d||d.startsWith("/")||d.includes("\0")||d.split(/[\\/]/).some(g=>!g||g==="."||g===".."))throw new Error("Select one file inside this case's writable outputs.");return d}i(U,"confinedProfileOutputPath");var K=i(a=>`'${a.replaceAll("'","'\\''")}'`,"quote");async function V(a){let d=U(a.path),g="const f=require('fs'),p=require('path'),c=require('crypto'),a=JSON.parse(process.argv[1]),r=f.realpathSync('/workspace/work/outputs'),q=f.realpathSync(p.join(r,a.path));if(!q.startsWith(r+'/'))throw Error('Output path escapes the case');const s=f.statSync(q);if(!s.isFile()||s.size>10000000)throw Error('Output exceeds its bound');if(a.offset===undefined){const b=f.readFileSync(q);process.stdout.write(JSON.stringify({size:b.length,hash:c.createHash('sha256').update(b).digest('hex')}))}else{const h=f.openSync(q,'r'),b=Buffer.alloc(Math.min(524288,s.size-a.offset));try{const n=f.readSync(h,b,0,b.length,a.offset);process.stdout.write(b.subarray(0,n).toString('base64'))}finally{f.closeSync(h)}}";async function w(E){let y=await a.command(`/runtime/node -e ${K(g)} ${K(JSON.stringify({path:d,...E!==void 0?{offset:E}:{}}))}`);if(y.code!==0)throw new Error("The confined output could not be read.");return y.stdout}i(w,"read");let b=x.object({size:x.number().int().min(1).max(F),hash:x.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(JSON.parse(await w())),P=[];for(let E=0;E<b.size;E+=524288){let y=await w(E);if(!/^[A-Za-z0-9+/]*={0,2}$/.test(y)||y.length>7e5)throw new Error("Output chunk exceeded its boundary.");let O=Buffer.from(y,"base64");if(O.length!==Math.min(524288,b.size-E))throw new Error("The output changed during readback.");P.push(O)}let R=Buffer.concat(P),k=se("sha256").update(R).digest("hex"),T=x.object({size:x.number(),hash:x.string()}).strict().parse(JSON.parse(await w()));if(k!==b.hash||T.hash!==k||T.size!==R.length)throw new Error("The output changed before immutable readback.");return{bytes:R,title:d.split("/").at(-1)}}i(V,"readConfinedProfileOutput");import l from"node:path";import{promises as m}from"node:fs";import M from"node:path";function X(a,d,g,w){let b=i(()=>new Error("This source file is outside the public policy closure."),"denied"),P;if(a==="context_read"){if(typeof d.path!="string")throw b();P=d.path}else{let R=typeof d.name=="string"?w.get(d.name.trim()):void 0;if(!R||!Object.hasOwn(g,R))throw b();if(d.path===void 0)return R;let k=d.path;if(typeof k!="string"||!k||k.includes("\\")||k.includes("\0")||M.posix.isAbsolute(k)||M.win32.isAbsolute(k)||k.split("/").includes(".."))throw b();P=M.posix.join(M.posix.dirname(R),k)}if(!Object.hasOwn(g,P))throw b();return P}i(X,"resolveProfilePolicySourcePath");var Z=String.raw`
|
|
3
3
|
const fs=require('node:fs'),p=require('node:path');
|
|
4
4
|
const a=JSON.parse(fs.readFileSync(0,'utf8'));
|
|
5
5
|
const roots={work:'outputs',inputs:'inputs',harness:'harness'};
|
|
@@ -18,4 +18,4 @@ try {
|
|
|
18
18
|
process.stdout.write(JSON.stringify({root:a.root,path:a.path,text:bytes.subarray(0,n).toString('utf8'),sizeBytes:stat.size,offset,nextOffset,truncated:nextOffset<stat.size}));
|
|
19
19
|
} finally{fs.closeSync(leaf);}
|
|
20
20
|
}finally{fs.closeSync(fd);}
|
|
21
|
-
`;var $=i(a=>`'${a.replaceAll("'","'\\''")}'`,"quote");function xe(a){let d=new Map,g=new AbortController,w=a.release,b=a.runtimeNode??"/runtime/node",P=a.runtimeAgentRoot??"/runtime/agent",R=new Set(w.harnessRelease.files.filter(e=>e.visibility!=="policy").map(e=>e.contentHash)),k=new Map(w.agentSnapshot.skills.map(e=>[e.path,e.contentHash])),T,E=J({storeDir:a.storeDir,loadArchive:q({storeDir:a.storeDir})});async function y(e){g.signal.throwIfAborted(),await a.authorize({bindingHash:e.manifest.profileEvaluation.externalDatasetBinding?.contentHash??j(e.manifest.profileEvaluation),manifestHash:e.manifest.contentHash,taskId:e.taskId,seed:e.seed}),g.signal.throwIfAborted()}i(y,"fence");async function O(e,s){let c=d.get(e.id),f=c?.manifest.profileEvaluation;if(!c||!f||s.sessionId!==e.id||s.status!=="in_progress"||j(e.metadata?.profileEvaluationRun)!==j({id:c.manifest.id,contentHash:c.manifest.contentHash})||e.currentProfile?.profileId!==f.profileId||s.profileSnapshot?.sourceHash!==f.harnessRelease.contentHash||s.profileSnapshot.revision!==f.sourceRevision)throw new Error("The target tool has no actual admitted source/case/turn authority.");if(c.turnId&&c.turnId!==s.id)throw new Error("The target case already belongs to another turn.");c.turnId=s.id;let h=await a.getTurn(s.id);if(!h||h.sessionId!==e.id||h.status!=="in_progress"||j(h.profileSnapshot)!==j(s.profileSnapshot))throw new Error("The actual target turn is no longer admitted.");return await y(c),c}i(O,"authority");let G=L({authorize:i(async e=>{let s=d.get(e.sessionId);if(!s||s.turnId!==e.turnId||e.candidateId!==s.manifest.id||e.expectedRevision!==1)throw new Error("Target command changed its original admitted source.");return await O(await a.getSession(e.sessionId),await a.getTurn(e.turnId)),{candidateId:s.manifest.id,candidateRevision:1,ownerId:"host-profile-evaluation",sessionId:e.sessionId,turnId:e.turnId,sourceRoot:s.root,layout:"profile_case",writablePaths:["outputs"],...T?{runtimeMounts:[{source:T.source,destination:"/runtime/agent"},{source:l.join(T.source,"node_modules"),destination:"/workspace/node_modules"}]}:{}}},"authorize")});async function H(e,s,c,f,h,I){await y(e);let t=a.executeCommand?await a.executeCommand({sessionId:e.sessionId,turnId:s,sourceRoot:e.root,publicHashes:e.publicHashes,...T?{runtimeRoot:T.source}:{},command:c,cwd:h,stdin:I,timeoutMs:Math.min(e.manifest.limits.timeoutMs,18e4),signal:AbortSignal.any([f,g.signal])}):await G({candidateId:e.manifest.id,expectedRevision:1,sessionId:e.sessionId,turnId:s,command:c,cwd:h,stdin:I,signal:AbortSignal.any([f,g.signal]),maxOutputBytes:75e4,timeoutMs:Math.min(e.manifest.limits.timeoutMs,18e4)});if(await y(e),t.timedOut||t.stdoutTruncated||t.stderrTruncated)throw new Error("The target command exceeded its bounded execution or output.");return t}i(H,"command");async function Q(e,s,c,f,h=[]){let I=s.profileEvaluation;if(!I||I.harnessRelease.contentHash!==w.harnessRelease.contentHash||s.population.filter(r=>r.taskId===c&&r.seed===f).length!==1||j(e.metadata?.profileEvaluationRun)!==j({id:s.id,contentHash:s.contentHash}))throw new Error("The target Session differs from its actual sealed source/case admission.");let t=l.join(a.storeDir,"evaluation-policy-cases",j([s.id,e.id])),o={},u={manifest:s,root:t,sessionId:e.id,taskId:c,seed:f,publicHashes:o,skillPaths:new Map};await y(u),await m.mkdir(t,{recursive:!0,mode:448});for(let r of w.harnessRelease.files){if(r.visibility!=="policy"||R.has(r.contentHash))continue;let n=l.join(w.bundlePath,"source",r.path),p=await m.realpath(n),_=await m.realpath(l.join(w.bundlePath,"source"));if(!p.startsWith(`${_}${l.sep}`)||(await m.lstat(n)).isSymbolicLink())throw new Error("Released policy source escaped its immutable closure.");let S=await m.readFile(p);if(S.length!==r.sizeBytes||N(S)!==r.contentHash)throw new Error("Released policy source changed before target admission.");let B=l.join(t,r.path);if(await m.mkdir(l.dirname(B),{recursive:!0,mode:448}),await m.writeFile(B,S,{flag:"wx",mode:256}),o[r.path]=r.contentHash,k.get(r.path)===r.contentHash){let v=z(S.toString("utf8"));if(!v.name||!v.description||v.messages.length||u.skillPaths.has(v.name))throw new Error("The released public skill identity is invalid or duplicated.");u.skillPaths.set(v.name,r.path)}}if(Object.keys(o).some(r=>r.startsWith("harness/")))throw new Error("The policy source uses the reserved Work harness directory.");for(let[r,n]of Object.entries(o)){let p=await m.readFile(l.join(t,r));if(N(p)!==n)throw new Error("The admitted public source changed.");let _=`harness/${r}`;await m.mkdir(l.dirname(l.join(t,_)),{recursive:!0,mode:448}),await m.writeFile(l.join(t,_),p,{flag:"wx",mode:256}),o[_]=n}for(let r of new Set(Object.keys(o).filter(n=>n.startsWith("agents/")).map(n=>n.split("/")[1]))){let n=`agents/${r}`;o[`${n}/agent.ts`]&&!o[`${n}/openpond.yaml`]&&!o[`${n}/agent/agent.ts`]&&(await m.mkdir(l.join(t,n,"agent"),{recursive:!0,mode:448}),await m.rename(l.join(t,n,"agent.ts"),l.join(t,n,"agent","agent.ts")),o[`${n}/agent/agent.ts`]=o[`${n}/agent.ts`],delete o[`${n}/agent.ts`])}for(let r of h){if(r.mediaType!=="application/pdf"||!r.contentsBase64||r.name!==l.basename(r.name))throw new Error("The isolated case has an unsupported input attachment.");let n=Buffer.from(r.contentsBase64,"base64"),p=`inputs/${r.name}`;if(n.length!==r.sizeBytes||n.length>1e7||o[p])throw new Error("The isolated case input identity is invalid.");await m.mkdir(l.join(t,"inputs"),{recursive:!0,mode:448}),await m.writeFile(l.join(t,p),n,{flag:"wx",mode:256}),o[p]=N(n)}await m.mkdir(l.join(t,"outputs"),{mode:448}),await y(u),d.set(e.id,u)}i(Q,"admitSession");let ee=i(async e=>{let s=await O(e.session,e.turn),c=[],f=i((t,o,u,r,n=[])=>c.push({name:t,description:o,parameters:{type:"object",properties:u,additionalProperties:!1,...n.length?{required:n}:{}},execute:i(async p=>{if(await O(p.session,e.turn)!==s||p.turnId!==e.turn.id)throw new Error("Target tool changed its admitted case.");if(s.finishing||s.finished)throw new Error("This case has sealed its Work response and outputs.");let S=await r(p.args,p.signal);return await O(p.session,e.turn),{toolCallId:p.callId,name:t,ok:!0,contentText:JSON.stringify(t==="work_finish"?{completed:!0,responsePath:S.responsePath,responseBytes:S.responseBytes}:S),data:S}},"execute")}),"define");f("harness_inspect","Inspect this released policy source.",{},async()=>({release:{id:w.harnessRelease.id,contentHash:w.harnessRelease.contentHash},files:Object.entries(s.publicHashes).map(([t,o])=>({path:t,contentHash:o}))}));for(let t of["profile_skill_read","skill_inspect","context_read"])f(t,t==="context_read"?"Read an exact public file path relative to the policy source root.":"Read a released public skill by name. The optional path is relative to that skill package and defaults to its released instructions.",t==="context_read"?{path:{type:"string"}}:{name:{type:"string",minLength:1},path:{type:"string"}},async o=>{let u=X(t,o,s.publicHashes,s.skillPaths),r=await H(s,e.turn.id,`${b} -e ${$("const f=require('fs'),p=process.argv[1],b=f.readFileSync(p);if(b.length>250000)throw Error('Policy source exceeds read bound');process.stdout.write(JSON.stringify({path:p,text:b.toString('utf8')}))")} ${$(`/workspace/work/${u}`)}`,e.signal);if(r.code!==0)throw new Error("The public target file could not be read.");return JSON.parse(r.stdout)},t==="context_read"?["path"]:["name"]);for(let t of["exec_command","work_exec"])f(t,"Run a command inside the policy source namespace and writable outputs.",{command:{type:"string"},cwd:{type:"string"}},async(o,u)=>{if(typeof o.command!="string")throw new Error("Select a target command.");let r=typeof o.cwd=="string"?o.cwd:t==="work_exec"?l.join(s.root,"outputs"):s.root,n=r.startsWith("/workspace/work/")?l.join(s.root,r.slice(16)):r==="/workspace/work"?s.root:r;return H(s,e.turn.id,o.command,u,n)});async function h(t,o){return a.readOutput?a.readOutput({sessionId:e.session.id,turnId:e.turn.id,path:t,signal:o}):V({path:t,command:i(u=>H(s,e.turn.id,u,o),"command")})}i(h,"readOutput");async function I(t,o,u){o.throwIfAborted(),await O(e.session,e.turn);let r=await a.saveOutput({session:e.session,sourceTurnId:e.turn.id,suggestedName:u??t.title,bytes:t.bytes,validation:[],validationPolicy:"preserve"});return await O(e.session,e.turn),await a.recordOutput(e.session.id,e.turn.id,r),await O(e.session,e.turn),r}i(I,"saveBytes"),f("work_save_output","Save a completed file from this case's outputs into durable output storage.",{path:{type:"string"},suggestedName:{type:"string"}},async(t,o)=>{if(typeof t.path!="string")throw new Error("Select a completed case output.");return I(await h(t.path,o),o,typeof t.suggestedName=="string"?t.suggestedName:void 0)});for(let t of["work_read_file","harness_read_file"])f(t,"Read a bounded UTF-8 window from admitted Work, inputs or released harness source; continue at nextOffset when truncated.",{root:{type:"string",enum:["work","inputs","harness"]},path:{type:"string"},offset:{type:"integer",minimum:0},maxBytes:{type:"integer",minimum:1,maximum:2e4}},async(o,u)=>{let r=await H(s,e.turn.id,`${b} -e ${$(Z)}`,u,void 0,JSON.stringify({...o,root:t==="harness_read_file"?"harness":o.root??"work"}));if(r.code!==0)throw new Error("The confined Work file window could not be read.");return JSON.parse(r.stdout)},["path"]);f("work_finish","Seal every declared deliverable and retain the complete UTF-8 response from a working file. After success, send a short final answer; the case files are closed.",{responsePath:{type:"string"}},async(t,o)=>{if(typeof t.responsePath!="string")throw new Error("Select the working response file.");let u=x.array(C).min(1).max(100).parse(e.session.metadata?.profileEvaluationOutputs);if(new Set(u.map(n=>n.path)).size!==u.length)throw new Error("Required output paths must be unique.");s.finishing=!0;let r=!1;try{let n=await h(t.responsePath,o);if(n.bytes.length>1048576||!new TextDecoder("utf-8",{fatal:!0}).decode(n.bytes).trim())throw new Error("Select a nonempty UTF-8 response of at most 1 MiB.");let p=[],_=0;for(let v of u){let A=await h(v.path,o);if(_+=A.bytes.length,_>48*1024*1024||v.maxBytes!==null&&A.bytes.length>v.maxBytes)throw new Error("Declared outputs exceeded their admitted byte bounds.");p.push(A)}let S=[];for(let v of p){r=!0;let A=await I(v,o);S.push(A.outputRef)}let B=Y({sessionId:e.session.id,turnId:e.turn.id,responsePath:t.responsePath,response:n.bytes,outputs:S});return s.finished=!0,B}finally{s.finishing=!1,r&&(s.finished=!0)}},["responsePath"]);for(let t of["list_files","read_files","search_files"])f(t,"Inspect files within the public policy namespace.",{paths:{type:"array",items:{type:"string"}},path:{type:"string"},query:{type:"string"}},async(o,u)=>{let r=await H(s,e.turn.id,`${b} -e ${$(D)}`,u,void 0,JSON.stringify({action:t,args:o,writablePaths:["outputs"]}));if(r.code!==0)throw new Error("The confined target file operation failed.");return JSON.parse(r.stdout)});return c},"resolveTools");async function te(e){let s=await O(e.session,e.turn),c=e.action;if(!W(c.inputSchema,e.value).valid)throw new Error("The actual released Agent action input changed.");if(!Object.keys(s.publicHashes).some(o=>o.startsWith(`agents/${c.agentId}/`)))throw new Error("The Agent action has no public policy source closure.");await y(s),T??=await E(),await y(s);let f=l.join(s.root,"agents",c.agentId),h=`/workspace/work/outputs/${e.turn.id}`,I=["run",c.sourceActionId,"--cwd",`/workspace/work/agents/${c.agentId}`,"--input",JSON.stringify(e.value),"--out-dir",h],t=await H(s,e.turn.id,`${b} ${$(`${P}/${T.cliRelativePath}`)} ${I.map($).join(" ")}`,e.signal,f);if(t.code!==0)throw new Error(`The confined released Agent action failed: ${t.stderr.slice(0,1e3)}`);return{output:t.stdout,agentSourcePath:`/workspace/work/agents/${c.agentId}`,runPath:h}}return i(te,"executeAction"),{admitSession:Q,resolveTools:ee,executeAction:te,ownsSession:i(e=>d.has(e),"ownsSession"),settleSession:i(async e=>{let s=d.get(e);try{s?.turnId&&await a.settleRemote?.(e,s.turnId)}finally{d.delete(e)}},"settleSession"),close:i(()=>{g.abort(new Error("Profile evaluation owner closed.")),d.clear()},"close")}}i(xe,"createHostProfileEvaluationTools");export{U as a,xe as b};
|
|
21
|
+
`;var $=i(a=>`'${a.replaceAll("'","'\\''")}'`,"quote");function xe(a){let d=new Map,g=new AbortController,w=a.release,b=a.runtimeNode??"/runtime/node",P=a.runtimeAgentRoot??"/runtime/agent",R=new Set(w.harnessRelease.files.filter(e=>e.visibility!=="policy").map(e=>e.contentHash)),k=new Map(w.agentSnapshot.skills.map(e=>[e.path,e.contentHash])),T,E=J({storeDir:a.storeDir,loadArchive:q({storeDir:a.storeDir})});async function y(e){g.signal.throwIfAborted(),await a.authorize({bindingHash:e.manifest.profileEvaluation.externalDatasetBinding?.contentHash??j(e.manifest.profileEvaluation),manifestHash:e.manifest.contentHash,taskId:e.taskId,seed:e.seed}),g.signal.throwIfAborted()}i(y,"fence");async function O(e,s){let c=d.get(e.id),f=c?.manifest.profileEvaluation;if(!c||!f||s.sessionId!==e.id||s.status!=="in_progress"||j(e.metadata?.profileEvaluationRun)!==j({id:c.manifest.id,contentHash:c.manifest.contentHash})||e.currentProfile?.profileId!==f.profileId||s.profileSnapshot?.sourceHash!==f.harnessRelease.contentHash||s.profileSnapshot.revision!==f.sourceRevision)throw new Error("The target tool has no actual admitted source/case/turn authority.");if(c.turnId&&c.turnId!==s.id)throw new Error("The target case already belongs to another turn.");c.turnId=s.id;let h=await a.getTurn(s.id);if(!h||h.sessionId!==e.id||h.status!=="in_progress"||j(h.profileSnapshot)!==j(s.profileSnapshot))throw new Error("The actual target turn is no longer admitted.");return await y(c),c}i(O,"authority");let G=L({authorize:i(async e=>{let s=d.get(e.sessionId);if(!s||s.turnId!==e.turnId||e.candidateId!==s.manifest.id||e.expectedRevision!==1)throw new Error("Target command changed its original admitted source.");return await O(await a.getSession(e.sessionId),await a.getTurn(e.turnId)),{candidateId:s.manifest.id,candidateRevision:1,ownerId:"host-profile-evaluation",sessionId:e.sessionId,turnId:e.turnId,sourceRoot:s.root,layout:"profile_case",writablePaths:["outputs"],...T?{runtimeMounts:[{source:T.source,destination:"/runtime/agent"},{source:l.join(T.source,"node_modules"),destination:"/workspace/node_modules"}]}:{}}},"authorize")});async function H(e,s,c,f,h,I){await y(e);let t=a.executeCommand?await a.executeCommand({sessionId:e.sessionId,turnId:s,sourceRoot:e.root,publicHashes:e.publicHashes,...T?{runtimeRoot:T.source}:{},command:c,cwd:h,stdin:I,timeoutMs:Math.min(e.manifest.limits.timeoutMs,18e4),signal:AbortSignal.any([f,g.signal])}):await G({candidateId:e.manifest.id,expectedRevision:1,sessionId:e.sessionId,turnId:s,command:c,cwd:h,stdin:I,signal:AbortSignal.any([f,g.signal]),maxOutputBytes:75e4,timeoutMs:Math.min(e.manifest.limits.timeoutMs,18e4)});if(await y(e),t.timedOut||t.stdoutTruncated||t.stderrTruncated)throw new Error("The target command exceeded its bounded execution or output.");return t}i(H,"command");async function Q(e,s,c,f,h=[]){let I=s.profileEvaluation;if(!I||I.harnessRelease.contentHash!==w.harnessRelease.contentHash||s.population.filter(r=>r.taskId===c&&r.seed===f).length!==1||j(e.metadata?.profileEvaluationRun)!==j({id:s.id,contentHash:s.contentHash}))throw new Error("The target Session differs from its actual sealed source/case admission.");let t=l.join(a.storeDir,"evaluation-policy-cases",j([s.id,e.id])),o={},u={manifest:s,root:t,sessionId:e.id,taskId:c,seed:f,publicHashes:o,skillPaths:new Map};await y(u),await m.mkdir(t,{recursive:!0,mode:448});for(let r of w.harnessRelease.files){if(r.visibility!=="policy"||R.has(r.contentHash))continue;let n=l.join(w.bundlePath,"source",r.path),p=await m.realpath(n),_=await m.realpath(l.join(w.bundlePath,"source"));if(!p.startsWith(`${_}${l.sep}`)||(await m.lstat(n)).isSymbolicLink())throw new Error("Released policy source escaped its immutable closure.");let S=await m.readFile(p);if(S.length!==r.sizeBytes||N(S)!==r.contentHash)throw new Error("Released policy source changed before target admission.");let B=l.join(t,r.path);if(await m.mkdir(l.dirname(B),{recursive:!0,mode:448}),await m.writeFile(B,S,{flag:"wx",mode:256}),o[r.path]=r.contentHash,k.get(r.path)===r.contentHash){let v=W(S.toString("utf8"));if(!v.name||!v.description||v.messages.length||u.skillPaths.has(v.name))throw new Error("The released public skill identity is invalid or duplicated.");u.skillPaths.set(v.name,r.path)}}if(Object.keys(o).some(r=>r.startsWith("harness/")))throw new Error("The policy source uses the reserved Work harness directory.");for(let[r,n]of Object.entries(o)){let p=await m.readFile(l.join(t,r));if(N(p)!==n)throw new Error("The admitted public source changed.");let _=`harness/${r}`;await m.mkdir(l.dirname(l.join(t,_)),{recursive:!0,mode:448}),await m.writeFile(l.join(t,_),p,{flag:"wx",mode:256}),o[_]=n}for(let r of new Set(Object.keys(o).filter(n=>n.startsWith("agents/")).map(n=>n.split("/")[1]))){let n=`agents/${r}`;o[`${n}/agent.ts`]&&!o[`${n}/openpond.yaml`]&&!o[`${n}/agent/agent.ts`]&&(await m.mkdir(l.join(t,n,"agent"),{recursive:!0,mode:448}),await m.rename(l.join(t,n,"agent.ts"),l.join(t,n,"agent","agent.ts")),o[`${n}/agent/agent.ts`]=o[`${n}/agent.ts`],delete o[`${n}/agent.ts`])}for(let r of h){if(r.mediaType!=="application/pdf"||!r.contentsBase64||r.name!==l.basename(r.name))throw new Error("The isolated case has an unsupported input attachment.");let n=Buffer.from(r.contentsBase64,"base64"),p=`inputs/${r.name}`;if(n.length!==r.sizeBytes||n.length>1e7||o[p])throw new Error("The isolated case input identity is invalid.");await m.mkdir(l.join(t,"inputs"),{recursive:!0,mode:448}),await m.writeFile(l.join(t,p),n,{flag:"wx",mode:256}),o[p]=N(n)}await m.mkdir(l.join(t,"outputs"),{mode:448}),await y(u),d.set(e.id,u)}i(Q,"admitSession");let ee=i(async e=>{let s=await O(e.session,e.turn),c=[],f=i((t,o,u,r,n=[])=>c.push({name:t,description:o,parameters:{type:"object",properties:u,additionalProperties:!1,...n.length?{required:n}:{}},execute:i(async p=>{if(await O(p.session,e.turn)!==s||p.turnId!==e.turn.id)throw new Error("Target tool changed its admitted case.");if(s.finishing||s.finished)throw new Error("This case has sealed its Work response and outputs.");let S=await r(p.args,p.signal);return await O(p.session,e.turn),{toolCallId:p.callId,name:t,ok:!0,contentText:JSON.stringify(t==="work_finish"?{completed:!0,responsePath:S.responsePath,responseBytes:S.responseBytes}:S),data:S}},"execute")}),"define");f("harness_inspect","Inspect this released policy source.",{},async()=>({release:{id:w.harnessRelease.id,contentHash:w.harnessRelease.contentHash},files:Object.entries(s.publicHashes).map(([t,o])=>({path:t,contentHash:o}))}));for(let t of["profile_skill_read","skill_inspect","context_read"])f(t,t==="context_read"?"Read an exact public file path relative to the policy source root.":"Read a released public skill by name. The optional path is relative to that skill package and defaults to its released instructions.",t==="context_read"?{path:{type:"string"}}:{name:{type:"string",minLength:1},path:{type:"string"}},async o=>{let u=X(t,o,s.publicHashes,s.skillPaths),r=await H(s,e.turn.id,`${b} -e ${$("const f=require('fs'),p=process.argv[1],b=f.readFileSync(p);if(b.length>250000)throw Error('Policy source exceeds read bound');process.stdout.write(JSON.stringify({path:p,text:b.toString('utf8')}))")} ${$(`/workspace/work/${u}`)}`,e.signal);if(r.code!==0)throw new Error("The public target file could not be read.");return JSON.parse(r.stdout)},t==="context_read"?["path"]:["name"]);for(let t of["exec_command","work_exec"])f(t,"Run a command inside the policy source namespace and writable outputs.",{command:{type:"string"},cwd:{type:"string"}},async(o,u)=>{if(typeof o.command!="string")throw new Error("Select a target command.");let r=typeof o.cwd=="string"?o.cwd:t==="work_exec"?l.join(s.root,"outputs"):s.root,n=r.startsWith("/workspace/work/")?l.join(s.root,r.slice(16)):r==="/workspace/work"?s.root:r;return H(s,e.turn.id,o.command,u,n)});async function h(t,o){return a.readOutput?a.readOutput({sessionId:e.session.id,turnId:e.turn.id,path:t,signal:o}):V({path:t,command:i(u=>H(s,e.turn.id,u,o),"command")})}i(h,"readOutput");async function I(t,o,u){o.throwIfAborted(),await O(e.session,e.turn);let r=await a.saveOutput({session:e.session,sourceTurnId:e.turn.id,suggestedName:u??t.title,bytes:t.bytes,validation:[],validationPolicy:"preserve"});return await O(e.session,e.turn),await a.recordOutput(e.session.id,e.turn.id,r),await O(e.session,e.turn),r}i(I,"saveBytes"),f("work_save_output","Save a completed file from this case's outputs into durable output storage.",{path:{type:"string"},suggestedName:{type:"string"}},async(t,o)=>{if(typeof t.path!="string")throw new Error("Select a completed case output.");return I(await h(t.path,o),o,typeof t.suggestedName=="string"?t.suggestedName:void 0)});for(let t of["work_read_file","harness_read_file"])f(t,"Read a bounded UTF-8 window from admitted Work, inputs or released harness source; continue at nextOffset when truncated.",{root:{type:"string",enum:["work","inputs","harness"]},path:{type:"string"},offset:{type:"integer",minimum:0},maxBytes:{type:"integer",minimum:1,maximum:2e4}},async(o,u)=>{let r=await H(s,e.turn.id,`${b} -e ${$(Z)}`,u,void 0,JSON.stringify({...o,root:t==="harness_read_file"?"harness":o.root??"work"}));if(r.code!==0)throw new Error("The confined Work file window could not be read.");return JSON.parse(r.stdout)},["path"]);f("work_finish","Seal every declared deliverable and retain the complete UTF-8 response from a working file. After success, send a short final answer; the case files are closed.",{responsePath:{type:"string"}},async(t,o)=>{if(typeof t.responsePath!="string")throw new Error("Select the working response file.");let u=x.array(z).min(1).max(100).parse(e.session.metadata?.profileEvaluationOutputs);if(new Set(u.map(n=>n.path)).size!==u.length)throw new Error("Required output paths must be unique.");s.finishing=!0;let r=!1;try{let n=await h(t.responsePath,o);if(n.bytes.length>1048576||!new TextDecoder("utf-8",{fatal:!0}).decode(n.bytes).trim())throw new Error("Select a nonempty UTF-8 response of at most 1 MiB.");let p=[],_=0;for(let v of u){let A=await h(v.path,o);if(_+=A.bytes.length,_>48*1024*1024||v.maxBytes!==null&&A.bytes.length>v.maxBytes)throw new Error("Declared outputs exceeded their admitted byte bounds.");p.push(A)}let S=[];for(let v of p){r=!0;let A=await I(v,o);S.push(A.outputRef)}let B=Y({sessionId:e.session.id,turnId:e.turn.id,responsePath:t.responsePath,response:n.bytes,outputs:S});return s.finished=!0,B}finally{s.finishing=!1,r&&(s.finished=!0)}},["responsePath"]);for(let t of["list_files","read_files","search_files"])f(t,"Inspect files within the public policy namespace.",{paths:{type:"array",items:{type:"string"}},path:{type:"string"},query:{type:"string"}},async(o,u)=>{let r=await H(s,e.turn.id,`${b} -e ${$(D)}`,u,void 0,JSON.stringify({action:t,args:o,writablePaths:["outputs"]}));if(r.code!==0)throw new Error("The confined target file operation failed.");return JSON.parse(r.stdout)});return c},"resolveTools");async function te(e){let s=await O(e.session,e.turn),c=e.action;if(!C(c.inputSchema,e.value).valid)throw new Error("The actual released Agent action input changed.");if(!Object.keys(s.publicHashes).some(o=>o.startsWith(`agents/${c.agentId}/`)))throw new Error("The Agent action has no public policy source closure.");await y(s),T??=await E(),await y(s);let f=l.join(s.root,"agents",c.agentId),h=`/workspace/work/outputs/${e.turn.id}`,I=["run",c.sourceActionId,"--cwd",`/workspace/work/agents/${c.agentId}`,"--input",JSON.stringify(e.value),"--out-dir",h],t=await H(s,e.turn.id,`${b} ${$(`${P}/${T.cliRelativePath}`)} ${I.map($).join(" ")}`,e.signal,f);if(t.code!==0)throw new Error(`The confined released Agent action failed: ${t.stderr.slice(0,1e3)}`);return{output:t.stdout,agentSourcePath:`/workspace/work/agents/${c.agentId}`,runPath:h}}return i(te,"executeAction"),{admitSession:Q,resolveTools:ee,executeAction:te,ownsSession:i(e=>d.has(e),"ownsSession"),settleSession:i(async e=>{let s=d.get(e);try{s?.turnId&&await a.settleRemote?.(e,s.turnId)}finally{d.delete(e)}},"settleSession"),close:i(()=>{g.abort(new Error("Profile evaluation owner closed.")),d.clear()},"close")}}i(xe,"createHostProfileEvaluationTools");export{U as a,xe as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{h as a}from"./chunk-
|
|
2
|
+
import{h as a}from"./chunk-RCQYEHHD.js";import{Xb as d,_b as p}from"./chunk-HG2YFMVU.js";import{a as o}from"./chunk-FTQLQJQV.js";function g(n,e,t,i){let s=n.get(`SELECT payload,package_payload FROM local_experiment_definitions WHERE team_id=? AND id=? ${i===void 0?"ORDER BY revision DESC LIMIT 1":"AND revision=?"}`,i===void 0?[e,t]:[e,t,i]);if(!s)throw new a("local_definition_not_found","Local Experiment definition is unavailable in this workspace.",404);return{definition:d.parse(JSON.parse(s.payload)),package:JSON.parse(s.package_payload)}}o(g,"localDefinition");function _(n,e,t){let i=n.get("SELECT payload FROM local_experiment_executions WHERE team_id=? AND id=?",[e,t]);if(!i)throw new a("local_execution_not_found","Local Experiment execution is unavailable in this workspace.",404);return p.parse(JSON.parse(i.payload))}o(_,"localExecution");function f(n,e,t){return n.all("SELECT receipt_id,status,admission,result,error FROM local_experiment_cases WHERE team_id=? AND execution_id=? ORDER BY ordinal",[e,t]).map(i=>({receiptId:i.receipt_id,status:i.status,admission:JSON.parse(i.admission),result:i.result?JSON.parse(i.result):null,error:i.error}))}o(f,"localCases");function L(n,e,t,i={}){let s=_(n,e,t),c={pending:0,running:0,completed:0,failed:0,cancelled:0,unknown:0};for(let u of n.all("SELECT status,COUNT(*) AS count FROM local_experiment_cases WHERE team_id=? AND execution_id=? GROUP BY status",[e,t]))c[u.status]=u.count;let r=n.get(`SELECT COALESCE(SUM(CASE WHEN status='settled' THEN cost_usd ELSE 0 END),0) AS spent,
|
|
3
3
|
COALESCE(SUM(CASE WHEN status IN ('reserved','dispatched','unknown') THEN maximum_usd ELSE 0 END),0) AS held,
|
|
4
4
|
COALESCE(SUM(CASE WHEN status IN ('dispatched','unknown') THEN 1 ELSE 0 END),0) AS uncertain FROM local_experiment_charges WHERE team_id=? AND execution_id=?`,[e,t]),l=p.parse({...s,...i,counts:c,usage:{knownCostUsd:r.spent,costUsd:r.uncertain?null:r.spent,heldUsd:r.held,uncertainRequests:r.uncertain}});return n.run("UPDATE local_experiment_executions SET payload=? WHERE team_id=? AND id=?",[JSON.stringify(l),e,t]),l}o(L,"refreshLocalExecution");function O(n,e,t,i,s,c){let r=n.get("SELECT kind,intent_hash,receipt FROM local_experiment_operations WHERE team_id=? AND operation_id=?",[e,t]);if(r){if(r.kind!==i||r.intent_hash!==s)throw new a("local_operation_conflict","This operation already owns different immutable inputs.");return JSON.parse(r.receipt)}let l=c();return n.run("INSERT INTO local_experiment_operations(team_id,operation_id,kind,intent_hash,receipt) VALUES(?,?,?,?,?)",[e,t,i,s,JSON.stringify(l)]),l}o(O,"localOperation");function w(n,e,t){n.run("INSERT INTO local_experiment_definitions(team_id,id,revision,content_hash,project_id,payload,package_payload) VALUES(?,?,?,?,?,?,?)",[e.teamId,e.id,e.revision,e.contentHash,e.configuration.request.project?.id??null,JSON.stringify(e),JSON.stringify(t)])}o(w,"writeLocalDefinition");var E=15e3;function T(n,e,t){let i=n.get("SELECT owner_id,pid,lease_until FROM local_experiment_owner WHERE singleton=1");if(i&&i.owner_id!==e&&S(i.pid))throw new a("local_runtime_already_owned","Another live local server owns Experiment execution in this installation.");n.run("INSERT INTO local_experiment_owner(singleton,owner_id,pid,lease_until) VALUES(1,?,?,?) ON CONFLICT(singleton) DO UPDATE SET owner_id=excluded.owner_id,pid=excluded.pid,lease_until=excluded.lease_until",[e,t,Date.now()+E])}o(T,"claimLocalExperimentOwner");function m(n,e){let t=n.get("SELECT owner_id,pid FROM local_experiment_owner WHERE singleton=1");if(!t||t.owner_id!==e||t.pid!==process.pid)throw new a("local_runtime_lease_lost","This process no longer owns local Experiment execution.")}o(m,"requireLocalRuntimeOwner");function R(n,e){m(n,e),n.run("UPDATE local_experiment_owner SET lease_until=? WHERE singleton=1 AND owner_id=?",[Date.now()+E,e])}o(R,"renewLocalExperimentOwner");function S(n){if(!Number.isSafeInteger(n)||n<=0)return!0;try{return process.kill(n,0),!0}catch(e){return!(e instanceof Error&&"code"in e&&e.code==="ESRCH")}}o(S,"alive");export{g as a,_ as b,f as c,L as d,O as e,w as f,T as g,m as h,R as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{m as r}from"./chunk-
|
|
2
|
+
import{m as r}from"./chunk-KOC3YJEU.js";import{Da as s,Ea as a,Fa as d}from"./chunk-HG2YFMVU.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(){return{...s.parse(await r({path:"/saved-work"})),webBaseUrl:i()}}n(u,"listHostedSavedWork");async function m(e){let t=a.parse(e);return r({path:"/saved-work",method:"POST",body:t})}n(m,"createHostedSavedWork");async function h(e,t){let o=d.parse(t);return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"PATCH",body:o})}n(h,"updateHostedSavedWork");async function k(e){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"DELETE"})}n(k,"deleteHostedSavedWork");async function P(e,t){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}/run`,method:"POST",body:{clientRequestId:t}})}n(P,"runHostedSavedWork");function i(e=process.env){let t=e.OPENPOND_HOSTED_WEB_URL?.trim()||e.OPENPOND_SANDBOX_BASE_URL?.trim()||e.OPENPOND_API_URL?.trim()||e.OPENPOND_SANDBOX_API_URL?.trim()||"https://api.openpond.ai",o=new URL(t);return o.hostname==="api.openpond.ai"||o.hostname.endsWith(".api.openpond.ai")?"https://openpond.ai":(o.pathname="",o.search="",o.hash="",o.origin)}n(i,"hostedWebBaseUrl");export{u as a,m as b,h as c,k as d,P as e,i as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as b}from"./chunk-WLQEONBF.js";import{b as P}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-WLQEONBF.js";import{b as P}from"./chunk-3A2Y7UK3.js";import{f as _}from"./chunk-VJYOKU3C.js";import{d as h}from"./chunk-U7D6Q744.js";import{x}from"./chunk-HG2YFMVU.js";import{h as T}from"./chunk-4V73I4OL.js";import{h as E,j as I,k as y}from"./chunk-HVM2GUM3.js";import{F as w}from"./chunk-2MEOUS24.js";import{a as l}from"./chunk-FTQLQJQV.js";function L(e){let a=e.result.proposal,d=a?.edits.find(t=>t.target!=="harness.json")??a?.edits[0]??null,c=e.result.outcome.metadata.routed===!0,n=a?e.result.applyReceipt?.decision==="applied"?"applied":"retained":c?"routed":"no_action",r=a?.baseHarnessRelease??e.trigger.harnessRelease,o=n==="applied"?e.result.advanceReceipt?.nextRelease??r:null;return{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:C(e.session)?"always":"material_only",state:"completed",workspaceId:e.result.workspace.id,result:n,decision:a?"propose":c?"route":"no_action",route:a?.route??g(e.result.outcome.metadata.route),operation:d?.operation??null,target:d?.target??null,summary:d?.summary??g(e.result.outcome.metadata.summary)??U(n,a?.route??g(e.result.outcome.metadata.route)),expectedOutcome:a?.expectedOutcome??g(e.result.outcome.metadata.expectedOutcome),reason:e.result.outcome.reason,evidenceBasis:B(e.result),critiqueStatus:a?"passed":"not_applicable",validationStatus:W(e.result),validationReceipts:e.result.validations.map(t=>({id:t.id,contentHash:t.contentHash,status:t.status,summary:t.summary})),edits:a?.edits.map(t=>({id:t.id,operation:t.operation,target:t.target,summary:t.summary,content:t.content}))??[],trigger:{id:e.trigger.id,contentHash:e.trigger.contentHash},outcome:{id:e.result.outcome.id,contentHash:e.result.outcome.contentHash},proposal:a?{id:a.id,contentHash:a.contentHash}:null,applyReceipt:e.result.applyReceipt?{id:e.result.applyReceipt.id,contentHash:e.result.applyReceipt.contentHash}:null,advanceReceipt:e.result.advanceReceipt?{id:e.result.advanceReceipt.id,contentHash:e.result.advanceReceipt.contentHash}:null,inputHarness:r,outputHarness:o}}l(L,"localHarnessRefinerActivityDisplay");function B(e){let a=e.proposal?.metadata.evidenceBasis??e.outcome.metadata.evidenceBasis,d=E.safeParse(a);return d.success?d.data:null}l(B,"evidenceBasisFromResult");function W(e){if(!e.proposal)return"not_applicable";let a=new Map(e.validations.map(c=>[c.validationId,c])),d=e.proposal.validationPlan.filter(c=>c.required);return d.some(c=>!a.has(c.id))?"pending":d.every(c=>a.get(c.id)?.status==="passed")?"passed":"failed"}l(W,"proposalValidationStatus");function C(e){return e.metadata?.automatedTasksetWorkAttempt===!0||typeof e.metadata?.tasksetId=="string"||typeof e.metadata?.benchmarkRuntime=="string"}l(C,"isEvaluationSession");function g(e){return typeof e=="string"&&e.trim()?e.trim():null}l(g,"stringMetadata");function U(e,a){return e==="no_action"?"No reusable change":e==="routed"?a?`${k(a)} issue routed`:"Issue routed":e==="applied"?a?`${k(a)} change`:"Harness change":a?`${k(a)} change`:"Harness change"}l(U,"resultSummary");function k(e){return e.length>0?`${e[0].toUpperCase()}${e.slice(1)}`:e}l(k,"titleCase");function G(e){let a=new Set,d=l((async function(n){if(q(n.session))return;let r=await b({store:e.store,...n});if(!r)return;let o=r.trigger;if(o.decision==="route_deterministically"&&o.deterministicRoute){let t=T({schemaVersion:"openpond.improvementRouteDecision.v1",id:`route-${o.contentHash.slice(0,24)}`,trigger:{id:o.id,contentHash:o.contentHash},route:o.deterministicRoute,authority:"runtime_service",automatic:!0,reason:o.reason,createdAt:o.createdAt,metadata:{}});await e.store.saveHarnessImprovementArtifact(n.turn.harnessSnapshot.workspaceId,"route_decision",t);return}o.decision==="queue_refiner"&&await c(n,o,!1)}),"processLocalHarnessImprovementBoundary");async function c(n,r,o){if(r.decision!=="queue_refiner")throw new Error("Only queued Harness Refiner triggers can be enqueued.");if(a.has(r.contentHash))return;a.add(r.contentHash);let t=Date.now();try{await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.queued",source:"server",appId:n.session.appId,status:"pending",output:r.reason,data:{triggerId:r.id,timeoutMs:I,maxOutputTokens:y,execution:"public_package",recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"running",summary:"Reviewing this Work for a reusable improvement"}}}))}catch(f){throw a.delete(r.contentHash),f}e.queue.enqueue({label:"Refine the Local Harness from a recovered execution detour",metadata:{key:r.contentHash,sessionId:n.session.id,turnId:n.turn.id,triggerId:r.id,recoveredAfterRestart:o}},async()=>{let f=0,p=Date.now(),u=null,i=null;try{await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.started",source:"server",appId:n.session.appId,status:"started",data:{triggerId:r.id,queueWaitMs:Math.max(0,p-t),timeoutMs:I,maxOutputTokens:y,execution:"public_package",recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"running",summary:"Reviewing this Work for a reusable improvement"}}})),await e.prepareReview?.(r);let s=await P({store:e.store,storeDir:e.storeDir,loadActiveRefinerRelease:e.loadActiveRefinerRelease,trigger:r,signal:new AbortController().signal,stream:l(async function*({messages:O,signal:S}){u===null&&(u=Date.now());let M=f++,A=`harness-refiner:${r.id}:${M}`,v=await _({session:n.session,turn:n.turn,provider:"openpond",model:w,requestId:A,requestOrdinal:M,requestKind:"harness_refiner",upsert:e.upsertModelUsageRecord});try{for await(let m of e.streamOpenPondHostedChatTurn({model:w,messages:O,requestId:A,reasoningEffort:"low",maxTokens:y,signal:S}))m.type==="text_delta"&&m.text?(v.observeDelta({text:m.text}),yield{text:m.text}):m.type==="reasoning_delta"&&m.text?v.observeDelta({reasoningText:m.text}):m.type==="usage"&&v.observeDelta({usage:m.usage});await v.complete(),i=Date.now()}catch(m){throw i=Date.now(),await v.fail(m,S.aborted?"interrupted":"failed"),m}},"stream")}),R=Date.now(),H=L({session:n.session,trigger:r,result:s});await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.completed",source:"server",appId:n.session.appId,status:"completed",output:s.outcome.reason,data:{recoveredAfterRestart:o,trigger:{id:r.id,contentHash:r.contentHash},outcome:{id:s.outcome.id,contentHash:s.outcome.contentHash,decision:s.outcome.decision,routed:s.outcome.metadata.routed===!0,route:typeof s.outcome.metadata.route=="string"?s.outcome.metadata.route:null},proposal:s.proposal?{id:s.proposal.id,contentHash:s.proposal.contentHash}:null,workspaceAdvance:s.advanceReceipt?.decision??null,activity:H,timing:{queueWaitMs:Math.max(0,p-t),modelDurationMs:u===null||i===null?null:Math.max(0,i-u),materializationDurationMs:i===null?null:Math.max(0,R-i),totalJobDurationMs:Math.max(0,R-p)}}}))}catch(s){let R=Date.now();throw await e.appendRuntimeEvent(h({sessionId:n.session.id,turnId:n.turn.id,name:"harness.refiner.failed",source:"server",appId:n.session.appId,status:"failed",output:s instanceof Error?s.message:String(s),data:{triggerId:r.id,recoveredAfterRestart:o,activity:{schemaVersion:"openpond.localHarnessRefinerActivityDisplay.v1",visibility:D(n.session),state:"failed",summary:"Refiner review failed",reason:s instanceof Error?s.message:String(s)},timing:{queueWaitMs:Math.max(0,p-t),modelDurationMs:u===null||i===null?null:Math.max(0,i-u),totalJobDurationMs:Math.max(0,R-p)}}})).catch(()=>{}),s}finally{a.delete(r.contentHash)}})}return l(c,"enqueueTrigger"),d.reconcilePending=async()=>{let n=await e.store.listPendingHarnessRefinerTriggers(),r=0;for(let{workspaceId:o,trigger:t}of n){let[f,p]=await Promise.all([e.store.getSession(t.runRef),e.store.getTurn(t.turnId)]);if(!f||!p||p.sessionId!==f.id)throw new Error(`Pending Harness Refiner trigger ${t.id} references an unavailable session or turn.`);if(q(f))continue;let u=p;if(!u.harnessSnapshot){let[i,s]=await Promise.all([e.store.getHarnessWorkspace(o),e.store.getHarnessRunOverlay(t.runRef)]),R=!!(i&&s&&t.overlay&&s.id===t.overlay.id&&s.revision===t.overlay.revision&&s.contentHash===t.overlay.contentHash&&s.workspace.workspaceId===o&&s.workspace.revision===i.revision&&s.workspace.sourceRevision===i.sourceRevision&&s.workspace.channelRevision===i.currentChannel.revision&&s.baseHarnessRelease.id===t.harnessRelease.id&&s.baseHarnessRelease.contentHash===t.harnessRelease.contentHash);if(!i||!s||!t.overlay||!R)throw new Error(`Pending Harness Refiner trigger ${t.id} cannot reconstruct its missing Harness snapshot.`);u=await e.store.updateTurn(u.id,H=>x.parse({...H,harnessSnapshot:{schemaVersion:"openpond.harnessTurnSnapshot.v1",workspaceId:o,workspaceRevision:s.workspace.revision,sourceRevision:s.workspace.sourceRevision,channelName:i.currentChannel.name,channelRevision:s.workspace.channelRevision,harnessRelease:t.harnessRelease,overlay:t.overlay}}))??u}if(u.harnessSnapshot?.workspaceId!==o)throw new Error(`Pending Harness Refiner trigger ${t.id} no longer matches its Harness workspace.`);await c({session:f,turn:u},t,!0),r+=1}return r},d}l(G,"createLocalHarnessImprovementRuntime");function q(e){return e.metadata?.source==="experiment-improvement"&&typeof e.metadata.refinementCandidate=="object"?!0:e.metadata?.automatedTasksetWorkAttempt===!0&&typeof e.metadata.parentModelRunId=="string"&&e.metadata.parentModelRunId.trim().length>0}l(q,"parentModelRunOwnsRefinement");function D(e){return e.metadata?.automatedTasksetWorkAttempt===!0||typeof e.metadata?.tasksetId=="string"||typeof e.metadata?.benchmarkRuntime=="string"?"always":"material_only"}l(D,"refinerActivityVisibility");export{G as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as pt}from"./chunk-IZ6DLEVY.js";import{a as ut}from"./chunk-SYUKES6H.js";import{b as se,m as mt,s as ft,t as ie,y as gt,z as ae}from"./chunk-YU3C6U5V.js";import{a as A,b as L}from"./chunk-KVTBX2UP.js";import{a as dt,d as Te}from"./chunk-U7D6Q744.js";import{$ as it,Ea as ct,ha as at,pa as Ie}from"./chunk-HG2YFMVU.js";import{e as st}from"./chunk-OQPJ7FJF.js";import{P as oe,R as lt}from"./chunk-7OKZCJHS.js";import{I as _e}from"./chunk-2MEOUS24.js";import{a as i,c as Re,e as Pn}from"./chunk-FTQLQJQV.js";var kt=Re((as,yt)=>{"use strict";var Cn=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],ht=/[\n\r\u2028\u2029]/,En=/[\s#!"$&'():;<=>@\\^`|]/g;yt.exports=i(function(t){return t.map(function(n){if(n==="")return"''";if(n&&typeof n=="object"){if("op"in n&&n.op==="glob"){if(typeof n.pattern!="string")throw new TypeError("glob token requires a string `pattern`");if(ht.test(n.pattern))throw new TypeError("glob `pattern` must not contain line terminators");return n.pattern.replace(En,"\\$&")}if("op"in n&&typeof n.op=="string"){if(Cn.indexOf(n.op)<0)throw new TypeError("invalid `op` value: "+JSON.stringify(n.op));return n.op.replace(/[\s\S]/g,"\\$&")}if("comment"in n&&typeof n.comment=="string"){if(ht.test(n.comment))throw new TypeError("`comment` must not contain line terminators");return"#"+n.comment}throw new TypeError("unrecognized object token shape")}return/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")},"quote")});var Tt=Re((ls,It)=>{"use strict";var _t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",wt=new RegExp("^"+_t+"$"),bt="|&;()<> \\t",Mn="'([^']*?)'",Wn='"((\\\\"|[^"])*?)"',On=/^#$/,xt="'",Rt='"',ce="$",D="",qn=4294967296;for(ve=0;ve<4;ve++)D+=(qn*Math.random()).toString(16);var ve,jn=new RegExp("^"+D);function Bn(e,t){for(var n=t.lastIndex,r=[],o;o=t.exec(e);)r[r.length]=o,t.lastIndex===o.index&&(t.lastIndex+=1);return t.lastIndex=n,r}i(Bn,"matchAll");function $n(e,t,n){var r=typeof e=="function"?e(n):e[n];return typeof r>"u"&&n!=""?r="":typeof r>"u"&&(r="$"),typeof r=="object"?t+D+JSON.stringify(r)+D:t+r}i($n,"getVar");function Nn(e,t,n){n||(n={});var r=n.escape||"\\",o=n.splitUnquoted===!0?`
|
|
3
3
|
`:typeof n.splitUnquoted=="string"?n.splitUnquoted:"",s="(\\"+r+`['"`+bt+`]|[^\\s'"`+bt+"])+",a=new RegExp(["("+_t+")","("+s+"|"+Wn+"|"+Mn+")+"].join("|"),"g"),d=Bn(e,a);if(d.length===0)return[];t||(t={});var c=!1;return d.map(function(l){var u=l[0];if(!u||c)return;if(wt.test(u))return{op:u};var p=!1,f=!1,m="",h=[],N=!1,R=null,V=!1,k;function tt(){k+=1;var I,X,be=u.charAt(k);if(be==="{"){if(k+=1,u.charAt(k)==="}")throw new Error("Bad substitution: "+u.slice(k-2,k+1));var re=1;for(I=k;re>0&&I<u.length;)u.charAt(I)==="{"&&u.charAt(I-1)==="$"?re+=1:u.charAt(I)==="}"&&(re-=1),I+=1;if(re!==0)throw new Error("Bad substitution: "+u.slice(k));I-=1,X=u.slice(k,I),k=I}else if(/[*@#?$!_-]/.test(be))X=be,k+=1;else{var xe=u.slice(k);I=xe.match(/[^\w\d_]/),I?(X=xe.slice(0,I.index),k+=I.index-1):(X=xe,k=u.length)}return $n(t,"",X)}i(tt,"parseEnvVar");function nt(){if(R!==null){if(R===0)m!==""&&(h[h.length]=m,m="");else{h[h.length]=m,m="";for(var I=1;I<R;I+=1)h[h.length]=""}R=null}}for(i(nt,"flushRun"),k=0;k<u.length;k++){var w=u.charAt(k);if(o&&w!==ce&&nt(),V=V||!p&&(w==="*"||w==="?"),f)m+=w,f=!1;else if(p)w===p?p=!1:p==xt?m+=w:w===r?(k+=1,w=u.charAt(k),w===Rt||w===r||w===ce?m+=w:m+=r+w):w===ce?m+=tt():m+=w;else if(w===Rt||w===xt)p=w,N=!0;else{if(wt.test(w))return{op:u};if(On.test(w)){c=!0;var rt={comment:e.slice(l.index+k+1)};return m.length?[m,rt]:[rt]}else if(w===r)f=!0;else if(w===ce){var ke=tt();if(!o)m+=ke;else for(var we=0;we<ke.length;we+=1){var W=ke.charAt(we);o.indexOf(W)<0?(nt(),m+=W):R===null?R=W===" "||W===" "||W===`
|
|
4
4
|
`?0:1:W!==" "&&W!==" "&&W!==`
|
|
5
5
|
`&&(R+=1)}}else m+=w}}if(V)return{op:"glob",pattern:m};if(o){if(R!==null&&R>0){h[h.length]=m,m="";for(var ot=1;ot<R;ot+=1)h[h.length]=""}return(m!==""||N&&h.length===0)&&(h[h.length]=m),h}return m}).reduce(function(l,u){return typeof u>"u"||[].concat(u).forEach(function(p){l[l.length]=p}),l},[])}i(Nn,"parseInternal");It.exports=i(function(t,n,r){var o=Nn(t,n,r);return typeof n!="function"?o:o.reduce(function(s,a){if(typeof a=="object")return s[s.length]=a,s;var d=a.split(RegExp("("+D+".*?"+D+")","g"));return d.length===1?(s[s.length]=d[0],s):(d.filter(Boolean).forEach(function(c){s[s.length]=jn.test(c)?JSON.parse(c.split(D)[1]):c}),s)},[])},"parse")});var vt=Re(Se=>{"use strict";Se.quote=kt();Se.parse=Tt()});var Mt=Pn(vt(),1);import{spawn as Ln}from"node:child_process";import{randomUUID as Dn}from"node:crypto";import Z from"node:path";import{mkdir as Fn}from"node:fs/promises";var Un=120,zn=3600,ue=6e4,St=2e4,Jn="Select a project to use this.";function Rs(e){let{upsertApproval:t,appendRuntimeEvent:n}=e,r=new Map,o=new Set;async function s(c){let l=c.command.trim();if(!l)return de(l,null,"Command is empty.",Pt(c.timeoutSeconds));let u=Pt(c.timeoutSeconds),p=A({session:c.session}),f=Yn({requestedCwd:c.cwd,session:c.session}),m=!f&&!c.session.workspaceKind&&!c.session.systemKind&&e.managedChatCwd;m&&(f=Z.join(m,c.session.id.replace(/[^a-zA-Z0-9_-]/g,"_")),await Fn(f,{recursive:!0}));let h=!!(c.cwd?.trim()&&Z.isAbsolute(c.cwd.trim()));if(p.target==="sandbox"||!f||p.target!=="local"&&!h&&!m)return de(l,f,Jn,u);let N=c.session.openPondCommandAccessMode??_e;if(N==="disabled")return de(l,f,"Command access is disabled for this chat.",u);let R=Hn(l);if(N==="ask"&&!o.has(At(c.session.id,R))){let k=await d({command:l,cwd:f,family:R,input:c,timeoutSeconds:u});if(k==="acceptForSession"&&o.add(At(c.session.id,R)),k!=="accept"&&k!=="acceptForSession")return de(l,f,k==="cancel"?"Command was cancelled.":"Command was not approved.",u)}let V=e.executionEnvironment?await e.executionEnvironment(c):{};return Zn({command:l,cwd:f,timeoutSeconds:u,signal:c.signal,env:V})}i(s,"executeCommand");async function a(c,l){let u=r.get(c);if(!u)return null;let p=it.parse(l);r.delete(c);let f=er(p.decision),m={...u.approval,status:f};return await t(m),await n(Te({sessionId:m.sessionId,turnId:m.turnId??void 0,name:"approval.resolved",source:"server",action:"command",status:f==="accepted"||f==="accepted_for_session"?"completed":"failed",output:m.title,data:{approvalId:c,status:f,decision:p.decision,family:u.family}})),u.resolve(p.decision),m}i(a,"resolveApproval");async function d(c){let l={id:`approval_${Dn()}`,sessionId:c.input.session.id,turnId:c.input.turnId??null,providerRequestId:c.input.providerRequestId??c.input.turnId??c.input.session.id,kind:"command",title:c.command,detail:JSON.stringify({command:c.command,cwd:c.cwd,timeoutSeconds:c.timeoutSeconds,source:c.input.source,mode:c.input.session.openPondCommandAccessMode??_e,risk:Xn(c.command),sessionApprovalFamily:{key:c.family.key,label:c.family.label,broad:c.family.broad,reason:c.family.reason}},null,2),status:"pending",createdAt:dt()},u,p=new Promise(f=>{u=f});r.set(l.id,{approval:l,family:c.family,resolve:u});try{await t(l),await n(Te({sessionId:c.input.session.id,turnId:c.input.turnId??void 0,name:"approval.requested",source:"server",action:"command",appId:c.input.session.appId,status:"pending",output:l.title,data:l}))}catch(f){throw r.delete(l.id),f}return p}return i(d,"requestCommandApproval"),{executeCommand:s,resolveApproval:a}}i(Rs,"createOpenPondCommandAccessService");function Wt(e){return JSON.stringify({ok:e.ok,action:"exec_command",output:Qn(e),data:{command:e.command,cwd:e.cwd,exitCode:e.exitCode,stdout:Et(e.stdout),stderr:Et(e.stderr),timedOut:e.timedOut,timeoutSeconds:e.timeoutSeconds,truncated:e.truncated,blockedReason:e.blockedReason}},null,2)}i(Wt,"commandResultForModel");function Hn(e){let t=Kn(e);if(!t)return le(e,"Could not safely parse shell command.");let n=Gn(t);if(n===-1)return le(e,"Could not find command executable.");if(Vn(t))return le(e,"Shell operators require exact-command session approval.");let r=t[n],o=t[n+1]??null;return r==="pwd"?Y("pwd","pwd","Allowlisted read-only command."):r==="ls"?Y("ls","ls","Allowlisted directory listing command."):r==="git"&&o==="status"?Y("git status","git status","Allowlisted git status family."):r==="docker"&&o==="system"?Y("docker system","docker system","Allowlisted Docker system inspection family."):r==="bun"&&o==="run"?Y("bun run","bun run","Allowlisted Bun script execution family."):le(e,"Command is not in the broad session-approval allowlist.")}i(Hn,"classifyCommandFamily");function Kn(e){try{let t=(0,Mt.parse)(e),n=[];for(let r of t){if(typeof r=="string"){n.push(r);continue}if(!r||typeof r!="object")return null;let o=r.op;if(typeof o=="string"){n.push(o);continue}return null}return n}catch{return null}}i(Kn,"safeShellTokens");function Gn(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(!/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(n))return t}return-1}i(Gn,"firstCommandTokenIndex");function Vn(e){return e.some(t=>/^(?:\||&&|\|\||;|&|<|>|\(|\)|\{|\})$/.test(t))}i(Vn,"hasUnsafeShellSyntax");function Y(e,t,n){return{key:e,label:t,broad:!0,reason:n}}i(Y,"broadFamily");function le(e,t){return{key:`exact:${e}`,label:e,broad:!1,reason:t}}i(le,"exactCommandFamily");function At(e,t){return`${e}:${t.key}`}i(At,"sessionFamilyKey");function Xn(e){let t=e.toLowerCase();return/\b(?:sudo|rm\s+-rf|mkfs|dd\s+if=|docker\s+(?:volume\s+rm|system\s+prune|container\s+rm)|kill(?:all)?)\b/.test(t)?"danger":/\b(?:npm|pnpm|yarn|bun)\s+(?:install|add|remove)|\bgit\s+(?:commit|push|reset|checkout|merge|rebase)|[>|]|\b(?:mv|cp|rm|touch|mkdir|docker\s+(?:run|build|compose))\b/.test(t)?"write":"read"}i(Xn,"commandRiskLabel");function Yn(e){let t=e.requestedCwd?.trim();return t?Z.isAbsolute(t)?Z.resolve(t):e.session.cwd?Z.resolve(e.session.cwd,t):null:e.session.cwd?.trim()||null}i(Yn,"resolveCommandCwd");function Pt(e){return Number.isFinite(e??NaN)?Math.max(1,Math.min(Math.floor(e),zn)):Un}i(Pt,"normalizedTimeout");function de(e,t,n,r){return{ok:!1,command:e,cwd:t,exitCode:null,stdout:"",stderr:n,timedOut:!1,timeoutSeconds:r,truncated:!1,blockedReason:n}}i(de,"blockedCommandResult");function Zn(e){return new Promise(t=>{let n=!1,r=!1,o="",s="",a=!1,d=null,c=ut(e.command),l=Ln(c.command,{cwd:e.cwd,shell:c.shell,env:{...process.env,PATH:pt(),...e.env},stdio:["ignore","pipe","pipe"],detached:process.platform!=="win32"}),u=i(h=>{n||(n=!0,clearTimeout(m),d&&clearTimeout(d),e.signal?.removeEventListener("abort",f),t(h))},"finish"),p=i((h,N)=>{let R=N.toString("utf8");h==="stdout"?o=Ae(o,R):s=Ae(s,R),o.length+s.length>=ue&&(a=!0)},"appendOutput"),f=i(()=>{Pe(l,"SIGTERM"),u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:s||"Command was interrupted.",timedOut:!1,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:"Command was interrupted."}),Ct(l)},"abort"),m=setTimeout(()=>{r=!0,Pe(l,"SIGTERM"),d=Ct(l)},e.timeoutSeconds*1e3);e.signal?.addEventListener("abort",f,{once:!0}),l.stdout?.on("data",h=>p("stdout",h)),l.stderr?.on("data",h=>p("stderr",h)),l.on("error",h=>{u({ok:!1,command:e.command,cwd:e.cwd,exitCode:null,stdout:o,stderr:h.message,timedOut:r,timeoutSeconds:e.timeoutSeconds,truncated:a,blockedReason:null})}),l.on("close",h=>{u({ok:!r&&(h??1)===0,command:e.command,cwd:e.cwd,exitCode:r?null:h??1,stdout:o,stderr:r?Ae(s,`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as L,c as u,d as S,e as v,f as C,g as x}from"./chunk-
|
|
2
|
+
import{a as L,c as u,d as S,e as v,f as C,g as x}from"./chunk-UGFSAG4U.js";import{Ab as y,Cb as f,Db as b,Eb as c,Fb as _,Gb as q,M as p,mb as m,wb as w}from"./chunk-4PUOWSDE.js";import{v as h}from"./chunk-ZY32SZ2P.js";import{A as a}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";var i=class extends Error{static{d(this,"OpenPondLearningError")}constructor(e,t,r,s){super(r),this.status=e,this.code=t,this.details=s,this.name="OpenPondLearningError"}status;code;details};var I=a.object({batchId:a.string().trim().min(1).max(500),modelProjectId:a.string().trim().min(1).max(500)}).strict(),P=a.object({batchId:a.string().min(1),projectId:a.string().min(1),tasksetId:a.string().min(1),releaseId:a.string().min(1),revision:a.number().int().positive(),contentHash:a.string().regex(/^[a-f0-9]{64}$/)}).strict(),U=class{static{d(this,"OpenPondLearningClient")}#e;constructor(e){if(!e.apiKey.trim()||!e.scope.trim())throw new Error("Learning API key and scope are required.");let t=new URL(e.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...e,baseUrl:t.toString().replace(/\/+$/,"")}}async command(e,t={}){f(e);let r=b.parse({scope:this.#e.scope,command:e}),s=q.parse(await this.#t("commands",r,t));if(s.operationId!==e.operationId)throw new i(502,"operation_identity_mismatch","Learning response did not match the submitted operation.",null);return s}submitExample(e,t={}){return this.command({action:"submit_example",operationId:e.idempotencyKey,example:e},t)}submitFeedback(e,t={}){return this.command({action:"submit_feedback",operationId:e.idempotencyKey,feedback:e},t)}async get(e,t,r,s={}){let n=c.parse({action:"get",scope:this.#e.scope,kind:e,id:t,...r===void 0?{}:{revision:r}});return m[e].parse(await this.#t("read",n,s))}async inspectEvidence(e,t={}){let r=c.parse({action:"inspect_evidence",scope:this.#e.scope,evidence:e}),s=_.parse(await this.#t("read",r,t));if(!p(s.evidence,e))throw new i(502,"evidence_identity_mismatch","Inspection did not match the requested evidence release.",null);return s}async inspectTaskQueue(e=null,t={}){let r=c.parse({action:"inspect_task_queue",scope:this.#e.scope,modelProjectId:e}),s=y.parse(await this.#t("read",r,t));if(s.modelProjectId!==e)throw new i(502,"model_identity_mismatch","Task queue did not match the requested Model.",null);return s}async inspectPolicy(e,t={}){let r=c.parse({action:"inspect_policy",scope:this.#e.scope,policy:e}),s=w.parse(await this.#t("read",r,t));if(!p(s.policy,e))throw new i(502,"policy_identity_mismatch","Inspection did not match the requested policy release.",null);return s}async createSourceCredential(e,t={}){let r=u.parse({...e,action:"create",scope:this.#e.scope}),s=S.parse(await this.#t("credentials",r,t));if(this.#s(s.credential,e.sourceId),s.apiKey!==e.apiKey||!e.apiKey.startsWith(`${s.credential.keyPrefix}_`))throw new i(502,"credential_identity_mismatch","Credential response did not match the prepared credential.",null);return s}async listSourceCredentials(e,t={},r={}){let s=u.parse({...t,action:"list",scope:this.#e.scope,sourceId:e}),n=v.parse(await this.#t("credentials",s,r));if(n.items.length>(t.limit??30))throw new i(502,"credential_page_invalid","Credential response exceeded the requested page size.",null);for(let o of n.items)this.#s(o,e);return n}async revokeSourceCredential(e,t,r={}){let s=u.parse({action:"revoke",scope:this.#e.scope,sourceId:e,id:t}),n=L.parse(await this.#t("credentials",s,r));if(this.#s(n,e),n.id!==t||n.revokedAt===null)throw new i(502,"credential_revocation_mismatch","Credential revocation did not match the requested credential.",null);return n}async sourceConfiguration(e,t={}){let r=C.parse({scope:this.#e.scope,sourceId:e}),s=x.parse(await this.#t("source-config",r,t));if(s.scope!==this.#e.scope||s.source.id!==e)throw new i(502,"source_identity_mismatch","Source configuration did not match the requested source.",null);return s}#s(e,t){if(e.scope!==this.#e.scope||e.sourceId!==t)throw new i(502,"credential_scope_mismatch","Credential response did not match the requested source.",null)}async list(e,t={},r={}){let s=c.parse({action:"list",scope:this.#e.scope,kind:e,...t});return a.object({items:a.array(m[e]).max(100),nextCursor:a.string().nullable()}).strict().parse(await this.#t("read",s,r))}async publishBatch(e,t={}){let r=I.parse(e),s=P.parse(await this.#t("publish-batch",{...r,scope:this.#e.scope},t));if(s.batchId!==r.batchId)throw new i(502,"batch_identity_mismatch","Published batch response did not match the requested batch.",null);return s}async#t(e,t,r){h(t,16777216);let s=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/learning/${e}`,{method:"POST",headers:{Authorization:`Bearer ${this.#e.apiKey}`,"Content-Type":"application/json",Accept:"application/json","X-OpenPond-Team-Id":this.#e.scope},body:JSON.stringify(t),signal:r.signal,redirect:"error"}),n=await R(s);if(!s.ok){let o=a.object({code:a.string().optional(),error:a.string().optional()}).passthrough().safeParse(n);throw new i(s.status,o.success?o.data.code??"learning_request_failed":"learning_request_failed",o.success?o.data.error??`Learning request failed (${s.status}).`:`Learning request failed (${s.status}).`,n)}return n}};async function R(e){let r=e.body?.getReader();if(!r)throw new i(e.status,"empty_response","Learning response was empty.",null);let s=new TextDecoder,n=0,o="";try{for(;;){let l=await r.read();if(l.done)break;if(n+=l.value.byteLength,n>16777216)throw new i(e.status,"response_too_large","Learning response exceeded 16 MiB; request a smaller page.",null);o+=s.decode(l.value,{stream:!0})}o+=s.decode();let g=JSON.parse(o);return h(g,16777216),g}finally{await r.cancel(),r.releaseLock()}}d(R,"readBoundedLearningResponse");export{i as a,U as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as m}from"./chunk-DMFUEUAZ.js";import{a as c}from"./chunk-U7D6Q744.js";import{t as p}from"./chunk-HG2YFMVU.js";import{I as i,L as d}from"./chunk-2MEOUS24.js";import{a as n}from"./chunk-FTQLQJQV.js";async function r(e,o){return(await e.allPayloadRows(`SELECT payload FROM ${o} ORDER BY sort_index ASC`)).map(t=>JSON.parse(t.payload))}n(r,"readStorePayloads");function S(e){let o=e,a=d.safeParse(o.openPondCommandAccessMode);return{...o,experience:l(o),openPondCommandAccessMode:a.success?a.data:i,currentProfile:o.currentProfile??null}}n(S,"normalizeSessionPayload");function l(e){let o=p.safeParse(e.experience);return o.success?o.data:!!(e.provider==="codex"||e.codexThreadId||e.systemKind||e.parentSessionId||e.subagentRunId||e.appId||e.workspaceKind||e.workspaceId||e.localProjectId||e.cloudProjectId)?"development":"chat"}n(l,"storedSessionExperience");async function E(e){return{sessions:(await r(e,"sessions")).map(S),turns:await r(e,"turns"),approvals:await r(e,"approvals")}}n(E,"readStoreMetadata");async function T(e){return{...await E(e),events:(await r(e,"events")).map(m)}}n(T,"readStoreData");async function D(e,o){let a=c();await o.exec("BEGIN IMMEDIATE");try{await o.exec("DELETE FROM approvals; DELETE FROM events; DELETE FROM turns; DELETE FROM sessions;");for(let[t,s]of e.sessions.entries())await o.run("INSERT INTO sessions (id, sort_index, payload, updated_at) VALUES (?, ?, ?, ?)",[s.id,t,JSON.stringify(s),s.updatedAt]);for(let[t,s]of e.turns.entries())await o.run("INSERT INTO turns (id, session_id, provider_turn_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.providerTurnId,s.status,t,JSON.stringify(s),s.completedAt??s.startedAt]);for(let[t,s]of e.events.entries()){let u=t+1;await o.run("INSERT INTO events (id, session_id, turn_id, name, timestamp, sequence, sort_index, payload) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId??null,s.turnId??null,s.name,s.timestamp,u,t,JSON.stringify(s)])}for(let[t,s]of e.approvals.entries())await o.run("INSERT INTO approvals (id, session_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.status,t,JSON.stringify(s),a]);await o.exec("COMMIT")}catch(t){throw await o.exec("ROLLBACK"),t}}n(D,"persistStoreData");export{S as a,E as b,T as c,D as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-
|
|
2
|
+
import{a as be,b as Ae,c as Ie,d as ve}from"./chunk-EXYSD45J.js";import{c as O,i as L}from"./chunk-RPM4FDRX.js";import{a as Re}from"./chunk-6FA3GG5B.js";import{f as Oe}from"./chunk-UGOK7VTC.js";import{a as s}from"./chunk-FTQLQJQV.js";var W=class extends Error{static{s(this,"OpenPondProfileSetupRequiredError")}code="agent_source_setup_required";details;constructor(t,n){let o=n.blockingRequirements.map(r=>r.label);super(["agent_source_setup_required",`Profile action ${t} has unresolved required setup.`,o.length?`Missing setup: ${o.join(", ")}`:""].filter(Boolean).join(`
|
|
3
3
|
`)),this.name="OpenPondProfileSetupRequiredError",this.details={error:"agent_source_setup_required",actionId:t,setupGate:n,missing:o,blockingSetupRequirements:n.blockingRequirements,setupRequirements:n.requirements}}};function K(e){let t=new Map;for(let a of e.sourceSetupRequirements??[]){let l=bt(a);if(e.actionId&&l&&l!==e.actionId&&h(a.actionName)!==e.actionId&&h(a.sourceActionId)!==e.actionId)continue;let c=Ee({record:a,source:"source_upload_metadata",actionId:l});c&&t.set(c.ref,c)}for(let a of e.actionCatalog)if(!(e.actionId&&a.id!==e.actionId&&a.name!==e.actionId))for(let l of a.setupRequirements??[]){let c=Ee({record:l,source:"action_catalog",actionId:a.id});c&&t.set(c.ref,c)}let n=Array.from(t.values()),o=n.filter(a=>a.blocking),r=n.filter(a=>!a.required&&!ne(a.status)).length,i=n.filter(a=>ne(a.status)).length;return{status:It(o),requirementCount:n.length,blockingCount:o.length,optionalMissingCount:r,readyCount:i,requirements:n,blockingRequirements:o}}s(K,"buildOpenPondProfileSetupGate");function oe(e,t){if(t.blockingRequirements.length>0)throw new W(e,t)}s(oe,"assertOpenPondProfileActionReady");function Rt(e){let t=e.actionId?`${e.actionId}: `:"",n=e.required?"required":"optional";return`${t}${e.label} (${n}, ${e.status})`}s(Rt,"formatOpenPondProfileSetupRequirement");function Ee(e){let t=e.source==="action_catalog"&&h(e.record.source)==="source_upload_metadata"?"source_upload_metadata":e.source,n=h(e.record.kind)??h(e.record.type),o=h(e.record.label)??h(e.record.name)??h(e.record.key)??h(e.record.provider)??h(e.record.tool)??h(e.record.command)??h(e.record.packageName)??h(e.record.path)??h(e.record.repo)??h(e.record.url)??h(e.record.id)??n??"setup requirement",r=e.record.required!==!1,i=At(e.record);return{ref:[t,e.actionId??"source",n??"requirement",o].join(":"),source:t,actionId:e.actionId,kind:n,label:o,status:i,required:r,blocking:r&&!ne(i)}}s(Ee,"setupRequirementFromRecord");function bt(e){return h(e.actionId)??h(e.sourceActionId)??h(e.actionName)}s(bt,"setupRequirementActionId");function At(e){let t=h(e.status)??h(e.state);return t?t==="satisfied"||t==="connected"||t==="provided"?"ready":t:typeof e.satisfied=="boolean"?e.satisfied?"ready":"setup_required":typeof e.ready=="boolean"&&e.ready?"ready":"setup_required"}s(At,"setupStatus");function It(e){return e.length===0?"ready":e.some(t=>["blocked","unsupported","unsupported_dependency","stale"].includes(t.status))?"blocked":"setup_required"}s(It,"gateStatus");function ne(e){return e==="ready"||e==="disabled"}s(ne,"isReadyStatus");function h(e){return typeof e=="string"&&e.trim()?e.trim():null}s(h,"text");import{stat as qt}from"node:fs/promises";import se from"node:path";import{spawn as vt}from"node:child_process";import{existsSync as re}from"node:fs";import{readFile as Et,rm as Kn,writeFile as _e}from"node:fs/promises";import ie from"node:path";var Le=["**/node_modules/","**/.bun/","**/.env","**/.env.*","**/.openpond/traces/","**/.openpond/vendor/","**/.openpond/eval-results.json","**/.openpond/artifact-index.json","**/.openpond/source-upload-cache.json",""].join(`
|
|
4
4
|
`);async function Me(e){if(!re(ie.join(e,".git"))){let i=await R(e,["init","-b","main"]);if(i.code!==0)throw new Error(H("git init",i))}let t=ie.join(e,".gitignore");if(re(t)?await xt(t):await _e(t,Le,"utf8"),await _t(e))return;let n=await N(e);if(!n.dirty&&n.files.length===0)return;let o=await R(e,["add","-A"]);if(o.code!==0)throw new Error(H("git add",o));let r=await R(e,["commit","-m","Initialize OpenPond profile"],{env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"OpenPond",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"openpond@example.invalid",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"OpenPond",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"openpond@example.invalid"}});if(r.code!==0&&!/nothing to commit/i.test(r.stdout+r.stderr))throw new Error(H("git commit",r))}s(Me,"ensureProfileGitRepo");async function xt(e){let t=await Et(e,"utf8").catch(()=>""),n=Le.split(/\r?\n/).map(r=>r.trim()).filter(Boolean).filter(r=>!t.split(/\r?\n/).some(i=>i.trim()===r));if(n.length===0)return;let o=t.endsWith(`
|
|
5
5
|
`)||t.length===0?"":`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{i as m}from"./chunk-AFYYIJ6K.js";import{j as l}from"./chunk-5HPZGLOL.js";import{A as t}from"./chunk-X2J2P5ZT.js";import{a as o}from"./chunk-FTQLQJQV.js";var v="evaluation-source.json",u=t.object({id:t.string().trim().min(1),clusterKey:t.string().trim().min(1),split:t.enum(["train","validation","frozen_eval"])}).passthrough(),h=t.object({schemaVersion:t.literal("openpond.trainingEvaluationSource.v1"),taskset:m,tasks:t.array(u).min(1).max(1e4),assets:t.array(t.object({path:t.string().trim().min(1).max(2e3),sha256:t.string().regex(/^[a-f0-9]{64}$/),sizeBytes:t.number().int().nonnegative(),encoding:t.literal("base64"),content:t.string().max(32*1024*1024)}).strict()).max(1e4)}).strict().superRefine((s,n)=>{let i=new Set;s.tasks.forEach((r,e)=>{r.split==="train"&&n.addIssue({code:"custom",path:["tasks",e,"split"],message:"Evaluation sources require held-out tasks."}),i.has(r.id)&&n.addIssue({code:"custom",path:["tasks",e,"id"],message:"Evaluation task identities must be unique."}),i.add(r.id)})});function k(s,n){let i=t.array(u).min(1).max(1e4).parse(s),r=t.array(u).min(1).max(1e4).parse(n),e=new Set,c=new Set;for(let a of i){if(a.split!=="train")throw new Error("The training population contains a held-out task.");if(e.has(a.id))throw new Error("Training task identities must be unique.");e.add(a.id),c.add(a.clusterKey)}let d=new Set;for(let a of r){if(a.split==="train")throw new Error("The evaluation population contains a training task.");if(d.has(a.id))throw new Error("Evaluation task identities must be unique.");if(e.has(a.id)||c.has(a.clusterKey))throw new Error("Training and evaluation tasks or families overlap.");d.add(a.id)}}o(k,"assertTrainingEvaluationIsolation");async function w(s){let n=h.parse(s),i=await l(n);return{taskset:n.taskset,dataset:{id:`training-evaluation-${i.slice(0,32)}`,contentHash:i}}}o(w,"trainingEvaluationSourceRef");export{v as a,h as b,k as c,w as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as ve}from"./chunk-L3KS6MOV.js";import{b as I,f as $}from"./chunk-
|
|
2
|
+
import{a as ve}from"./chunk-L3KS6MOV.js";import{b as I,f as $}from"./chunk-GY7YSD6J.js";import{E as ke,F as Re}from"./chunk-SV7ZBEK2.js";import{f as U}from"./chunk-UGOK7VTC.js";import{a as s}from"./chunk-FTQLQJQV.js";import{createRequire as at}from"node:module";import{createHash as Qe,randomUUID as et}from"node:crypto";import{spawn as uo}from"node:child_process";import{existsSync as S}from"node:fs";import{cp as fo,mkdir as x,readFile as st,readdir as it,rename as Pe,rm as we,symlink as po,writeFile as z}from"node:fs/promises";import u from"node:path";function ne(e=null){return{actionCount:0,generatedAt:null,manifestPath:null,registryPath:null,stale:!0,error:e}}s(ne,"emptyProfileCatalogState");function re(e=null){return{skillCount:0,generatedAt:null,stale:!0,error:e}}s(re,"emptyProfileSkillCatalogState");function ae(){return{status:"ready",requirementCount:0,blockingCount:0,optionalMissingCount:0,readyCount:0,requirements:[],blockingRequirements:[]}}s(ae,"emptyProfileSetupGate");function K(){return{changedAgents:[],newAgents:[],deletedAgents:[],changedSkills:[],changedActions:[],changedExtensions:[],setupChanges:[],envRequirementChanges:[],files:[]}}s(K,"emptyProfileDiffSummary");function se(e=null){return{state:e?"error":"none",message:e??"No active OpenPond profile.",agentCount:0,actionCount:0,defaultAction:null,checkFresh:!1,checkStaleReason:e??"No active profile.",localHead:null,hostedHead:null}}s(se,"emptyProfileSummary");import{existsSync as G}from"node:fs";import{readFile as It,stat as kt}from"node:fs/promises";import V from"node:path";var be=".openpond/agent-manifest.json",Ee=".openpond/action-registry.json",Rt=".openpond/source-upload-metadata.json",vt=".openpond/agent-package-origin.json";async function _e(e){return Me({agentId:"default",sourcePath:e,preferred:!0})}s(_e,"loadProfileActionCatalog");async function $e(e){if(e.length===0)return{catalog:{actionCount:0,generatedAt:null,manifestPath:null,registryPath:null,stale:!1,error:null},actionCatalog:[],sourceSetupRequirements:[]};let t=[...e.filter(c=>c.preferred),...e.filter(c=>!c.preferred)],o=await Promise.all(t.map(Me)),n=new Map,r=[];for(let c of o)for(let l of c.actionCatalog){let d=n.has(l.id)?`${l.agentId??"agent"}.${l.sourceActionId??l.id}`:l.id,p=d===l.id?l:{...l,id:d};n.set(d,p),r.push(p)}let a=Et(o.map(c=>c.catalog.generatedAt)),i=o.map(c=>c.catalog.error).filter(Boolean);return{catalog:{actionCount:r.length,generatedAt:a,manifestPath:o.find(c=>c.catalog.manifestPath)?.catalog.manifestPath??null,registryPath:o.find(c=>c.catalog.registryPath)?.catalog.registryPath??null,stale:o.some(c=>c.catalog.stale),error:i.length>0?i.join("; "):null},actionCatalog:r,sourceSetupRequirements:o.flatMap(c=>c.sourceSetupRequirements)}}s($e,"loadProfileActionCatalogForSources");async function Me(e){let t=e.sourcePath,o=V.join(t,be),n=V.join(t,Ee),r=V.join(t,Rt),a=V.join(t,vt);try{let i=await X(o),c=await X(n),l=await X(r),d=y(await X(a)),p=y(y(i)?.inputSchemas),h=Oe(y(l)?.setupRequirements)??[],v=xt(h),A=new Map;for(let g of[...ie(y(i)?.actionCatalog),...ie(y(c)?.actions),...ie(y(i)?.actions)]){let j=m(g.id)??m(g.name);if(!j)continue;let C=A.get(j),At=Ot({sourceRequirementsByAction:v,actionId:j,actionName:m(g.name)}),St=_t(Oe(g.setupRequirements)??C?.setupRequirements??[],At),Ct={id:j,agentId:e.agentId,sourcePath:t,sourceActionId:j,name:m(g.name)??C?.name??j,label:m(g.label)??C?.label??Tt(j),description:m(g.description)??C?.description??null,visibility:m(g.visibility)??C?.visibility??"default",inputSchema:qt(g.inputSchema,p)??C?.inputSchema??null,outputSchema:je(g.outputSchema)??C?.outputSchema??null,approvalPolicy:y(g.approvalPolicy)??C?.approvalPolicy??null,artifactPolicy:y(g.artifactPolicy)??C?.artifactPolicy??null,setupRequirements:St,mcp:y(g.mcp)??C?.mcp??null,schedulePolicy:y(g.schedulePolicy)??C?.schedulePolicy??null,trace:bt(y(g.trace)??C?.trace??null,d),implementation:y(g.implementation)??C?.implementation??null,invokesModel:typeof g.invokesModel=="boolean"?g.invokesModel:C?.invokesModel};A.set(j,Ct)}let M=Array.from(A.values()).filter(g=>g.visibility!=="internal"&&g.visibility!=="debug"),L=[...i?[]:[be],...c?[]:[Ee]],_=await jt([o,n]);return{catalog:{actionCount:M.length,generatedAt:_,manifestPath:G(o)?o:null,registryPath:G(n)?n:null,stale:L.length>0,error:L.length>0?Mt(e,L):null},actionCatalog:M,sourceSetupRequirements:h}}catch(i){return{catalog:{actionCount:0,generatedAt:null,manifestPath:G(o)?o:null,registryPath:G(n)?n:null,stale:!0,error:i instanceof Error?i.message:String(i)},actionCatalog:[],sourceSetupRequirements:[]}}}s(Me,"loadProfileActionCatalogSource");function bt(e,t){if(!t)return e;let o=m(t.versionId),n=m(t.digest);return!o||!n?e:{...e??{},agentVersionId:o,agentPackageDigest:n,validationReceiptIds:xe(t.validationReceiptIds),evalReceiptIds:xe(t.evalReceiptIds)}}s(bt,"mergeAgentPackageTrace");function xe(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}s(xe,"stringArray");function Et(e){let t=0;for(let o of e){if(!o)continue;let n=Date.parse(o);Number.isFinite(n)&&(t=Math.max(t,n))}return t>0?new Date(t).toISOString():null}s(Et,"latestIso");function xt(e){let t=new Map;for(let o of e){let n=[m(o.actionId),m(o.sourceActionId),m(o.actionName)].filter(r=>!!r);for(let r of n){let a=t.get(r)??[];a.push(o),t.set(r,a)}}return t}s(xt,"sourceSetupRequirementsByAction");function Ot(e){return[...e.sourceRequirementsByAction.get(e.actionId)??[],...e.actionName&&e.actionName!==e.actionId?e.sourceRequirementsByAction.get(e.actionName)??[]:[]].map(o=>({...o,source:"source_upload_metadata"}))}s(Ot,"setupRequirementsForActionSource");function _t(e,t){if(t.length===0)return e;let o=[],n=new Set;for(let r of[...e,...t]){let a=$t(r);n.has(a)||(n.add(a),o.push(r))}return o}s(_t,"mergeSetupRequirements");function $t(e){return[m(e.actionId)??m(e.sourceActionId)??m(e.actionName)??"",m(e.kind)??m(e.type)??"",m(e.name)??m(e.key)??m(e.provider)??m(e.tool)??m(e.command)??m(e.packageName)??m(e.path)??m(e.repo)??m(e.url)??m(e.id)??""].join(":")}s($t,"setupRequirementIdentity");function Mt(e,t){return[`Profile agent ${e.agentId} at ${e.sourcePath} is missing SDK catalog artifact(s): ${t.join(", ")}.`,"Run `openpond profile check --kind all` after source materialization so each enabled profile agent has inspect/build artifacts."].join(" ")}s(Mt,"missingSourceArtifactsMessage");async function X(e){return G(e)?JSON.parse(await It(e,"utf8")):null}s(X,"readJsonIfExists");async function jt(e){let t=0;for(let o of e){if(!G(o))continue;let n=await kt(o);t=Math.max(t,n.mtimeMs)}return t>0?new Date(t).toISOString():null}s(jt,"latestMtime");function y(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}s(y,"asRecord");function ie(e){return Array.isArray(e)?e.filter(t=>!!y(t)):[]}s(ie,"records");function Oe(e){return Array.isArray(e)?e.filter(t=>!!y(t)):null}s(Oe,"recordArray");function m(e){return typeof e=="string"&&e.trim()?e.trim():null}s(m,"text");function je(e){return m(e)??y(e)}s(je,"schemaValue");function qt(e,t){let o=je(e);return typeof o!="string"?o:y(t?.[o])??o}s(qt,"resolvedSchemaValue");function Tt(e){let t=e.replace(/[._-]+/g," ").trim();return t?t.replace(/\b\w/g,o=>o.toUpperCase()):e}s(Tt,"titleFromActionId");var Y=class extends Error{static{s(this,"OpenPondProfileSetupRequiredError")}code="agent_source_setup_required";details;constructor(t,o){let n=o.blockingRequirements.map(r=>r.label);super(["agent_source_setup_required",`Profile action ${t} has unresolved required setup.`,n.length?`Missing setup: ${n.join(", ")}`:""].filter(Boolean).join(`
|
|
3
3
|
`)),this.name="OpenPondProfileSetupRequiredError",this.details={error:"agent_source_setup_required",actionId:t,setupGate:o,missing:n,blockingSetupRequirements:o.blockingRequirements,setupRequirements:o.requirements}}};function Z(e){let t=new Map;for(let i of e.sourceSetupRequirements??[]){let c=Ft(i);if(e.actionId&&c&&c!==e.actionId&&P(i.actionName)!==e.actionId&&P(i.sourceActionId)!==e.actionId)continue;let l=qe({record:i,source:"source_upload_metadata",actionId:c});l&&t.set(l.ref,l)}for(let i of e.actionCatalog)if(!(e.actionId&&i.id!==e.actionId&&i.name!==e.actionId))for(let c of i.setupRequirements??[]){let l=qe({record:c,source:"action_catalog",actionId:i.id});l&&t.set(l.ref,l)}let o=Array.from(t.values()),n=o.filter(i=>i.blocking),r=o.filter(i=>!i.required&&!ce(i.status)).length,a=o.filter(i=>ce(i.status)).length;return{status:Lt(n),requirementCount:o.length,blockingCount:n.length,optionalMissingCount:r,readyCount:a,requirements:o,blockingRequirements:n}}s(Z,"buildOpenPondProfileSetupGate");function le(e,t){if(t.blockingRequirements.length>0)throw new Y(e,t)}s(le,"assertOpenPondProfileActionReady");function Nt(e){let t=e.actionId?`${e.actionId}: `:"",o=e.required?"required":"optional";return`${t}${e.label} (${o}, ${e.status})`}s(Nt,"formatOpenPondProfileSetupRequirement");function qe(e){let t=e.source==="action_catalog"&&P(e.record.source)==="source_upload_metadata"?"source_upload_metadata":e.source,o=P(e.record.kind)??P(e.record.type),n=P(e.record.label)??P(e.record.name)??P(e.record.key)??P(e.record.provider)??P(e.record.tool)??P(e.record.command)??P(e.record.packageName)??P(e.record.path)??P(e.record.repo)??P(e.record.url)??P(e.record.id)??o??"setup requirement",r=e.record.required!==!1,a=Ht(e.record);return{ref:[t,e.actionId??"source",o??"requirement",n].join(":"),source:t,actionId:e.actionId,kind:o,label:n,status:a,required:r,blocking:r&&!ce(a)}}s(qe,"setupRequirementFromRecord");function Ft(e){return P(e.actionId)??P(e.sourceActionId)??P(e.actionName)}s(Ft,"setupRequirementActionId");function Ht(e){let t=P(e.status)??P(e.state);return t?t==="satisfied"||t==="connected"||t==="provided"?"ready":t:typeof e.satisfied=="boolean"?e.satisfied?"ready":"setup_required":typeof e.ready=="boolean"&&e.ready?"ready":"setup_required"}s(Ht,"setupStatus");function Lt(e){return e.length===0?"ready":e.some(t=>["blocked","unsupported","unsupported_dependency","stale"].includes(t.status))?"blocked":"setup_required"}s(Lt,"gateStatus");function ce(e){return e==="ready"||e==="disabled"}s(ce,"isReadyStatus");function P(e){return typeof e=="string"&&e.trim()?e.trim():null}s(P,"text");import{spawn as Ut}from"node:child_process";import{randomUUID as Gt}from"node:crypto";import{existsSync as ue}from"node:fs";import{readFile as Bt,rm as Dt,writeFile as Fe}from"node:fs/promises";import Q from"node:path";var He=["**/node_modules/","**/.bun/","**/.env","**/.env.*","**/.openpond/traces/","**/.openpond/vendor/","**/.openpond/eval-results.json","**/.openpond/artifact-index.json","**/.openpond/source-upload-cache.json",""].join(`
|
|
4
4
|
`);async function Le(e){if(!ue(Q.join(e,".git"))){let a=await k(e,["init","-b","main"]);if(a.code!==0)throw new Error(T("git init",a))}let t=Q.join(e,".gitignore");if(ue(t)?await zt(t):await Fe(t,He,"utf8"),await Wt(e))return;let o=await N(e);if(!o.dirty&&o.files.length===0)return;let n=await k(e,["add","-A"]);if(n.code!==0)throw new Error(T("git add",n));let r=await k(e,["commit","-m","Initialize OpenPond profile"],{env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"OpenPond",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"openpond@example.invalid",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"OpenPond",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"openpond@example.invalid"}});if(r.code!==0&&!/nothing to commit/i.test(r.stdout+r.stderr))throw new Error(T("git commit",r))}s(Le,"ensureProfileGitRepo");async function zt(e){let t=await Bt(e,"utf8").catch(()=>""),o=He.split(/\r?\n/).map(r=>r.trim()).filter(Boolean).filter(r=>!t.split(/\r?\n/).some(a=>a.trim()===r));if(o.length===0)return;let n=t.endsWith(`
|
|
5
5
|
`)||t.length===0?"":`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as he,b as G,c as j,d as z,e as H,g as be,i as T,j as ve,k as S,l as Re,v as B,x as F}from"./chunk-JPUSTFZC.js";import{a as se,b as D,c as P}from"./chunk-RFQD6B44.js";import{a as ne,b as oe,c as re}from"./chunk-XRKFTPHD.js";import{L as fe,M as me,Q as ye,U as we,g as $,h as ce,k as le,m as de,n as pe,o as ue,p as ge}from"./chunk-JEMECEQH.js";import{d as y,e as ie,f as ae,g as L}from"./chunk-RPM4FDRX.js";import{b as C,c as Z,d as ee,f as w,h as R,i as te}from"./chunk-BSHAIAXY.js";import{a as M,f as v,k as X}from"./chunk-3M53YXEI.js";import{a as g}from"./chunk-FTQLQJQV.js";import{promises as V,existsSync as W}from"node:fs";import U from"node:path";import{stdin as $e}from"node:process";async function Ge(e,o){let t=await y(),r=w(t),n=R(t),i=await P(t,r),{app:a}=await T(n,i,o),s=await pe(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(Ge,"runTemplateStatus");async function je(e,o){let t=await y(),r=w(t),n=R(t),i=await P(t,r),{app:a}=await T(n,i,o),s=await ue(n,i,a.id);console.log(JSON.stringify(s,null,2))}g(je,"runTemplateBranches");async function ze(e,o){let t=await y(),r=w(t),n=R(t),i=await P(t,r),{app:a}=await T(n,i,o),s=typeof e.env=="string"?e.env:typeof e.environment=="string"?e.environment:void 0,f=X(s),c=await ge(n,i,a.id,{environment:f});console.log(JSON.stringify(c,null,2))}g(ze,"runTemplateUpdate");async function He(e){let o=await y(),t=w(o),r=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,n=r?r.trim():await D();if(!n)throw new Error("API key is required");n.startsWith("opk_")||console.log("warning: API keys usually start with opk_."),await L({handle:o.activeProfile?.handle||"default",apiKey:n,baseUrl:t,apiBaseUrl:o.apiBaseUrl,chatApiBaseUrl:o.chatApiBaseUrl,setActive:!0}),console.log("Saved account credentials to the encrypted OpenPond credential store.")}g(He,"runLogin");async function Fe(e,o){let t=o[0]||"list";if(t==="list"){let r=await ie();console.log(JSON.stringify({profiles:r},null,2));return}if(t==="use"){let r=o[1];if(!r)throw new Error("usage: profiles use <name> [--base-url <url>]");let n=await ae(r,{baseUrl:C(e)});console.log(JSON.stringify({profile:n},null,2));return}if(t==="save"){let r=o[1];if(!r)throw new Error("usage: profiles save <name> --api-key <key> [--base-url <url>] [--api-base-url <url>] [--chat-api-base-url <url>]");let n=typeof e.apiKey=="string"?e.apiKey:typeof e.key=="string"?e.key:null,i=n?n.trim():await D(),a=typeof e.environment=="string"?e.environment:typeof e.env=="string"?e.env:void 0,s=await L({handle:r,apiKey:i,baseUrl:C(e),apiBaseUrl:Z(e),chatApiBaseUrl:ee(e),environment:a,setActive:!0});console.log(JSON.stringify({profile:s},null,2));return}throw new Error("usage: profiles <list|use|save> [args]")}g(Fe,"runProfiles");async function Ve(){let e=await y(),o=w(e),t=R(e),r=await P(e,o),n=await fe(t,r);console.log(JSON.stringify(n,null,2))}g(Ve,"runAccount");async function We(e){let o=await y(),t=R(o),r=se(o),n=await me(t,r);console.log(JSON.stringify(n,null,2))}g(We,"runHealth");async function qe(e,o){let t=await y(),r=w(t),n=R(t),i=await P(t,r),{app:a}=await T(n,i,o),s=typeof e.branch=="string"?String(e.branch):void 0,f=await $(n,i,a.id,{branch:s});if(!f?.id){console.log("no deployments found");return}let c=await ce(n,i,f.id),d=(c&&Array.isArray(c.toolsJson)?c.toolsJson:null)||(c&&typeof c.metadataJson=="object"&&c.metadataJson?c.metadataJson.tools:null),u=Array.isArray(d)?d:[];if(u.length===0){console.log("no tools found");return}for(let l of u){let m=l,h=m.profile||m.function,I=m.name||h?.name||"unknown",p=m.description||h?.description||"";console.log(p?`${I} - ${p}`:I)}}g(qe,"runToolList");async function Ye(e,o,t){let r=await y(),n=w(r),i=R(r),a=await P(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=await $(i,a,s.id,{branch:f});if(!c?.id)throw new Error("no deployments found");let d;if(typeof e.body=="string")try{d=JSON.parse(e.body)}catch{throw new Error("tool body must be valid JSON")}let u=typeof e.method=="string"?String(e.method).toUpperCase():"POST",l=await we(n,a,{appId:s.id,deploymentId:c.id,toolName:t,method:u,body:d,headers:a?{"openpond-api-key":a}:void 0});if(!l.ok)throw new Error(l.error||`tool failed (${l.status})`);let m=l.data??{ok:!0};console.log(JSON.stringify(m,null,2))}g(Ye,"runToolRun");async function Qe(e,o,t){let r=await y(),n=w(r),i=R(r),a=await P(r,n),{app:s}=await T(i,a,o),f=typeof e.branch=="string"?String(e.branch):void 0,c=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,d=c?{id:c}:await $(i,a,s.id,{branch:f});if(!d?.id)throw new Error("no deployments found");let u=typeof e.body=="string"?M(String(e.body),"body"):{};if(!u||typeof u!="object"||Array.isArray(u))throw new Error("body must be a JSON object");let l=typeof e.method=="string"?String(e.method).toUpperCase():"POST",m={...u,appId:s.id,deploymentId:d.id,toolName:t,method:l},h=await ye(i,a,m);console.log(JSON.stringify(h,null,2))}g(Qe,"runBacktestRun");async function Xe(e,o){let t=await y(),r=w(t),n=R(t),i=await P(t,r),{app:a,handle:s,repo:f}=await T(n,i,o),c=typeof e.branch=="string"?String(e.branch):void 0,d=typeof e.deploymentId=="string"?String(e.deploymentId):void 0,u=d?{id:d}:await $(n,i,a.id,{branch:c});if(!u?.id){console.log("no deployments found");return}await ve({baseUrl:n,apiKey:i,deploymentId:u.id,prefix:`[${s}/${f}] `,intervalMs:e.interval?Number(e.interval):void 0,timeoutMs:e.timeout?Number(e.timeout):void 0})}g(Xe,"runDeployWatch");async function Ze(e,o){let r=((typeof e.name=="string"?e.name:null)||o.join(" ")).trim();if(!r)throw new Error("usage: repo create --name <name> [--team-id <id>] [--path <dir>] [--template <owner/repo|url>] [--template-branch <branch>] [--empty|--opentool] [--sandbox] [--token] [--auto-schedule-migration <true|false>]");let n=await y(),i=w(n),a=await P(n,i),s=R(n),f=typeof e.teamId=="string"&&e.teamId.trim()?e.teamId.trim():void 0,c=typeof e.template=="string"?e.template.trim():"";if(c&&(e.empty==="true"||e.opentool==="true"))throw new Error("choose one: --template or --empty/--opentool");if(e.empty==="true"&&e.opentool==="true")throw new Error("choose one: --empty or --opentool");let d=typeof e.description=="string"?e.description.trim():void 0,u=typeof e.templateBranch=="string"&&e.templateBranch.trim().length>0?e.templateBranch.trim():void 0,l=typeof e.env=="string"?M(e.env,"env"):void 0;if(l){if(typeof l!="object"||Array.isArray(l))throw new Error("env must be a JSON object");for(let[b,A]of Object.entries(l))if(typeof A!="string")throw new Error(`env value for ${b} must be a string`)}if(c){e.deployOnPush!==void 0&&console.warn("deploy-on-push is not used for template create (auto deploys)");let b=te(c,i),k=(await de(s,a,[{name:r,...d?{description:d}:{},templateRepoUrl:b,...u?{templateBranch:u}:{},...l?{envVars:l}:{}}],f)).items?.[0];if(!k||k.status!=="ok"||!k.appId)throw new Error(k?.error||"Template create failed");console.log(`app_id: ${k.appId}`),k.deploymentId&&console.log(`deployment_id: ${k.deploymentId}`),k.conversationId&&console.log(`conversation_id: ${k.conversationId}`);return}let m=process.cwd(),h=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,I=h&&h.trim().length>0?h.trim():$e.isTTY?await Re(m):m,p=U.resolve(I);if(W(p)){if(!(await V.stat(p)).isDirectory())throw new Error(`path is not a directory: ${p}`)}else await V.mkdir(p,{recursive:!0});let Pe=(await V.readdir(p)).filter(b=>b!==".git").length===0,x=v(e.yes)||v(e.force);if(!Pe&&!x&&!await S(`Directory is not empty (${p}). Continue?`,!1)){console.log("aborted");return}let ke=U.join(p,".git");if(!W(ke)){if(!(x?!0:await S("Initialize git repository here?",!0))){console.log("aborted");return}let A=await B("git",["init"],{cwd:p});if(A.code!==0)throw new Error(`git init failed: ${A.stderr.trim()||A.stdout.trim()||"unknown error"}`)}let K=await F(p,"origin");if(K&&!x&&!await S(`Remote "origin" already set (${K}). Replace it?`,!1)){console.log("aborted");return}let q=e.opentool==="true"?"opentool":"empty",Te=v(e.sandbox),Be=v(e.deployOnPush),N=e.autoScheduleMigration,Y=typeof N=="string"||typeof N=="boolean",Ee=Y?v(N):void 0,E=await le(s,a,{name:r,...f?{teamId:f}:{},...d?{description:d}:{},...q?{repoInit:q}:{},...Te?{sandbox:!0}:{},...l?{envVars:l}:{},...Be?{deployOnPush:!0}:{},...Y?{autoScheduleMigration:Ee}:{}}),O=he(E);H(O);let J=v(e.token)||v(e.setRemoteToken),Oe=G(O,a),Q=J?Oe:O,_=await B("git",K?["remote","set-url","origin",Q]:["remote","add","origin",Q],{cwd:p});if(_.code!==0)throw new Error(`git remote failed: ${z(_.stderr.trim()||_.stdout.trim()||"unknown error")}`);let Ae=J?j(O):O;console.log(`app_id: ${E.appId}`),E.gitOwner&&E.gitRepo&&console.log(`repo: ${E.gitOwner}/${E.gitRepo}`),console.log(`remote: ${Ae}`),console.log('next: git add . && git commit -m "init"');let Ie=E.defaultBranch||"master";console.log(`next: openpond repo push --path ${p} --branch ${Ie}`),J||console.log(`token-remote (non-interactive): git -C ${p} remote set-url origin ${j(O)}`);try{await be({apiBase:s,apiKey:a,forceRefresh:!0})}catch(b){console.warn("cache refresh failed",b)}}g(Ze,"runRepoCreate");async function Se(e){let o=await B("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e});if(o.code!==0)return null;let t=o.stdout.trim();return t.length>0?t:null}g(Se,"resolveGitBranch");async function et(e){let o=await y(),t=w(o),r=await P(o,t),n=typeof e.path=="string"?e.path:typeof e.dir=="string"?e.dir:null,i=U.resolve(n&&n.trim().length>0?n.trim():"."),a=U.join(i,".git");if(!W(a))throw new Error(`git repo not found at ${i} (missing .git)`);let s=await F(i,"origin");if(!s)throw new Error("origin remote not set; run `openpond repo create` first");H(s);let c=(typeof e.branch=="string"?e.branch.trim():"")||await Se(i);if(!c)throw new Error("unable to resolve git branch; pass --branch");let d;try{d=G(s,r)}catch{throw new Error("origin remote must be https for tokenized pushes")}let u=v(e.keepTokenRemote)||v(e.token)||v(e.setRemoteToken),l=s.includes("x-access-token:"),m=!u&&!l?s:null,h=process.env.GIT_TERMINAL_PROMPT;process.env.GIT_TERMINAL_PROMPT="0";try{if(!l){let p=await B("git",["remote","set-url","origin",d],{cwd:i});if(p.code!==0)throw new Error(`git remote set-url failed: ${z(p.stderr.trim()||p.stdout.trim()||"unknown error")}`)}if((await B("git",["push","-u","origin",c],{cwd:i,inherit:!0})).code!==0)throw new Error("git push failed")}finally{m&&await B("git",["remote","set-url","origin",m],{cwd:i}).catch(()=>null),h===void 0?delete process.env.GIT_TERMINAL_PROMPT:process.env.GIT_TERMINAL_PROMPT=h}}g(et,"runRepoPush");async function tt(e){if(e.length===0)throw new Error("usage: opentool <init|validate|build> [args]");let o=process.platform==="win32"?"npx.cmd":"npx";if((await B(o,["opentool",...e],{inherit:!0})).code!==0)throw new Error("opentool command failed")}g(tt,"runOpentool");async function nt(){let e="openpond",o=ne(),t=await re(e),r=`npm i -g ${e}@${t}`,n=oe(o,t);if(n===0){console.log(`${e} is up to date (${o})`);return}if(n===-1){console.log(`Update available: ${o} -> ${t}`),console.log(`Run: ${r}`);return}if(n===1){console.log(`Installed version (${o}) is newer than npm latest (${t}).`);return}if(o===t){console.log(`${e} is up to date (${o})`);return}console.log(`Installed: ${o}`),console.log(`Latest: ${t}`),console.log(`Run: ${r}`)}g(nt,"runCheckUpdate");export{Ge as a,je as b,ze as c,He as d,Fe as e,Ve as f,We as g,qe as h,Ye as i,Qe as j,Xe as k,Ze as l,Se as m,et as n,tt as o,nt as p};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as Je}from"./chunk-ZIQJDTQB.js";import{a as F,e as $,f as Ye,h as Ue}from"./chunk-3Z4VM2LF.js";import{b as ne}from"./chunk-EICS777E.js";import{a as $e}from"./chunk-FEAKTSRS.js";import{a as Ge}from"./chunk-TPOAAJKA.js";import{f as Fe,h as R}from"./chunk-RCQYEHHD.js";import{b as We}from"./chunk-SDHG6CKU.js";import{d as ze}from"./chunk-WCNPGKST.js";import{b as O,c as W}from"./chunk-AFH462DO.js";import{a as Me}from"./chunk-UANH7U3Y.js";import{d as X}from"./chunk-CIZI6Z7D.js";import{a as Oe}from"./chunk-VFH5C6D2.js";import{d as je,e as Ne}from"./chunk-EYTTZ5H4.js";import{m as Be}from"./chunk-DKOVZ6R2.js";import{u as se}from"./chunk-OFJPOTES.js";import{I as Q,mc as Ve,qc as qe,v as Ae}from"./chunk-HG2YFMVU.js";import{i as Le,j as Ce}from"./chunk-AUO5DCEU.js";import{f as Te}from"./chunk-WD4KAKEX.js";import{j as Ie}from"./chunk-WGQ3FMRF.js";import{f as _e}from"./chunk-JVMSN7LH.js";import{r as U,v as K,w as be}from"./chunk-YI6ME6PU.js";import{Ca as De,Ia as He,aa as q,ba as Y,ha as Pe,i as J,ia as Ee,ja as L,oa as N,za as Se}from"./chunk-BU6MW65V.js";import{w as xe,x as Re,z}from"./chunk-D6L6UNUQ.js";import{S as ve,d as we,da as ye}from"./chunk-4PUOWSDE.js";import{Ia as me,Oa as he,bb as ge,e as ce,ja as le,kb as ke,oa as de,pa as M,qa as pe,ra as fe,xa as ue}from"./chunk-ZY32SZ2P.js";import{r as ie}from"./chunk-OTDDXEQ6.js";import{a as re,f as oe}from"./chunk-HNQPEOJD.js";import{c as b,d as _,e as ae,m as V,n as f}from"./chunk-RCT3O3HQ.js";import{A as x}from"./chunk-X2J2P5ZT.js";import{a as h}from"./chunk-FTQLQJQV.js";import{promises as it}from"node:fs";import nt from"node:path";async function _t(e){let o=e.definition.tasksetRelease,c=await je(e.store,e.harnessRelease);if(!c)throw new Error("Evaluation Profile Harness release is unavailable.");let a=await lt({...e,runtime:c});if(a)return a;let s=await e.store.listTasksetRevisions(e.profileId);for(let i of s){if(o.id!==i.id&&o.id!==`taskset-release-${i.id}-r${i.revision}`)continue;let r=await ct(e.storeDir,i);if(r.taskset.id===o.id&&r.taskset.contentHash===o.contentHash)return r}throw new Error(`Released Taskset ${o.id} is unavailable in Profile ${e.profileId}.`)}h(_t,"loadLocalProfileEvaluationTaskset");async function ct(e,o){let c=o.metadata.importedPackageHash;if(typeof c=="string"){let i=await W(e,c);if(i.taskset.id!==o.id||i.taskset.revision!==o.revision)throw new Error("Imported evaluation Taskset differs from its local Profile revision.");return i}if(De(o)!==o.contentHash)throw new Error("Authored evaluation Taskset differs from its immutable revision.");let a=He({taskset:o,adapterId:ze(o)}),s=await We({storeDir:e,taskset:o,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:a.tasksetRelease,environment:a.environmentRelease,verifierSet:a.verifierSetRelease}});return await O(e,s),s}h(ct,"loadCandidate");async function lt(e){let o=e.definition.tasksetRelease,c=e.runtime;if(c.release.harnessRelease.id!==e.harnessRelease.id||c.release.harnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("Evaluation Taskset runtime differs from its requested release.");let a=`evals/tasksets/${o.contentHash}.json`,s=c.release.harnessRelease.files.find(i=>i.path===a);if(s){if(s.visibility!=="verifier")throw new Error("Evaluation Taskset package is not verifier-private.");let i=await it.readFile(nt.join(c.release.bundlePath,"source",...a.split("/")));if(V(i)!==s.contentHash)throw new Error("Released evaluation Taskset package bytes differ from their source receipt.");let r=L(JSON.parse(i.toString("utf8")));if(r.taskset.id!==o.id||r.taskset.contentHash!==o.contentHash)throw new Error("Released evaluation Taskset package differs from its definition.");return r}return null}h(lt,"loadReleasedProfileEvaluationTaskset");function Z(e){return{id:fe(e),label:"Selected Dataset evaluation",description:"Explicit sealed external Dataset evaluation recipe.",target:e.target,tasksetRelease:{id:e.dataset.id,contentHash:e.dataset.contentHash},split:e.split,taskIds:[...new Set(e.population.map(o=>o.taskId))],seeds:[...new Set(e.population.map(o=>o.seed))],criterion:e.criterion}}h(Z,"externalProfileEvaluationDefinition");async function Bt(e){let o=e.manifest.profileEvaluation,c=o?.externalDatasetBinding?M(o.externalDatasetBinding):null;if(!c)return null;if(!e.resolveExternalDataset)throw new Error("This owner has no authorized external Dataset resolver.");let a=await e.resolveExternalDataset(c,e.selected);await a.authorize();let s=L(a.packageValue),i=await e.loadCatalog({ref:e.selected.profileRef,sourceRevision:e.selected.sourceRevision,harnessRelease:e.selected.harnessRelease});if(f(a.binding)!==f(c)||c.profileId!==e.selected.profileRef.profileId||c.declaredProfileCatalogHash!==i.catalogHash||s.contentHash!==c.packageHash||f(s.taskset)!==f(e.taskset)||c.environmentHash!==f(s.taskset.environment)||c.privateDatasetClosureHash!==f(s.files.filter(t=>t.asset.visibility!=="policy").map(t=>t.asset)))throw new Error("External Dataset admission changed its actual Profile, package or private closure.");let r=Z(c),u={schemaVersion:"openpond.profileEvaluations.v1",definitions:[r],suites:[]};if(z(e.manifest,e.taskset,u),!o||o.catalogHash!==f(u)||o.definitionHash!==f(r)||f(o.target)!==f(c.target))throw new Error("External Dataset manifest changed its derived definition.");return await a.authorize(),{...a,packageValue:s,definition:r,catalog:u}}h(Bt,"admitProfileExternalDataset");import vt from"node:path";function Ke(e,o){return e.map(c=>{let a=c.workspace.draft,s=a.metadata.profileTarget,i=s&&typeof s=="object"&&!Array.isArray(s)?s:{},r=typeof i.profileId=="string"?{profileId:i.profileId,workflowId:typeof i.workflowId=="string"?i.workflowId:null}:null,u=c.checks.find(t=>t.kind==="graders"&&t.workspaceHash===c.workspace.contentHash);return{summary:{...o(c),rows:[]},projectId:c.projectId,profileTarget:r,updatedAt:a.updatedAt,workspaceHash:c.workspace.contentHash,packageHash:c.packageHash,graders:a.graders.map(t=>{let p=u?.scopes?.find(l=>l.graderId===t.id),g=t.metadata.portableVerifierRef;return{id:`grader-${f([a.id,t.id]).slice(0,40)}`,graderId:t.id,name:t.label,kind:t.kind,version:t.version,configurationHash:f(t),weight:t.weight,hardGate:t.hardGate,rewardEligible:t.rewardEligible,privileged:t.privileged,checkState:p?`${p.checked}/${p.total} ${p.status}`:u?u.status:"Not checked",verifierPath:g&&typeof g=="object"&&"path"in g&&typeof g.path=="string"?g.path:null,fields:Array.isArray(a.metadata.fields)?a.metadata.fields.filter(l=>typeof l=="string"):[]}})}})}h(Ke,"localLearningCatalog");function B(e){let o=e.workspace.draft,c=e.checks.find(a=>a.kind==="graders");return o.graders.map(a=>{let s=c?.scopes?.find(u=>u.graderId===a.id),i=c&&c.workspaceHash!==e.workspace.contentHash?"Checks stale":s?.status??"Not tested",r=o.graderFixtures.filter(u=>!Array.isArray(u.metadata.graderIds)||u.metadata.graderIds.includes(a.id));return{kind:"grader",id:`grader-${f([o.id,a.id]).slice(0,40)}`,revision:o.revision,name:a.label,datasetId:o.id,datasetRevision:o.revision,graderId:a.id,graderType:a.kind,state:i,description:a.kind==="content"&&typeof a.config.operator=="string"?a.config.operator:`${a.kind} grader \xB7 ${a.version}`,checkState:s?`${s.checked}/${s.total} examples checked \xB7 ${i}`:i,rows:r.slice(0,3).map(u=>({id:u.id,label:u.label,detail:JSON.stringify(u.output)}))}})}h(B,"localGraderSummaries");function Xe(e,o,c){let{offset:a,limit:s}=x.object({offset:x.number().int().nonnegative().default(0),limit:x.number().int().min(1).max(100).default(20)}).parse(c),i=e.workspace.draft,r=i.graders.find(g=>g.id===o.graderId),u=i.graderFixtures.filter(g=>!Array.isArray(g.metadata.graderIds)||g.metadata.graderIds.includes(r.id)),t=r.kind==="custom_verifier"?e.workspace.files.find(g=>g.path===r.module):null,p=t?Buffer.from(t.base64,"base64").toString("utf8"):null;return{summary:o,dataset:{id:i.id,revision:i.revision,name:i.name,workspaceHash:e.workspace.contentHash},grader:r,taskCount:i.tasks.length,fixtures:{total:u.length,offset:a,items:u.slice(a,a+s),hasMore:a+s<u.length},files:t?[{path:t.path,contentHash:t.contentHash,sizeBytes:t.sizeBytes,content:p.slice(0,24e3),truncated:p.length>24e3}]:[]}}h(Xe,"localGraderInspection");async function Qe(e,o,c,a){let s=a?e.checks.find(l=>l.kind==="graders"&&l.revision===e.workspace.draft.revision&&l.workspaceHash===e.workspace.contentHash):void 0,i=s?.scopes?.filter(l=>l.graderId!==a&&o.taskset.graders.some(d=>d.id===l.graderId))??[],r=s?.issues.filter(l=>l.graderId&&i.some(d=>d.graderId===l.graderId))??[],u=e.workspace.draft.graderFixtures,t=i.reduce((l,d)=>l+d.checked,0),p=i.reduce((l,d)=>l+d.total,0),g=[...i];for(let l of o.taskset.graders){let d=u.filter(n=>!Array.isArray(n.metadata.graderIds)||n.metadata.graderIds.includes(l.id));if(a&&l.id!==a){i.some(n=>n.graderId===l.id)||(p+=d.length,g.push({graderId:l.id,checked:0,total:d.length,status:"unavailable"}),r.push({code:"grader_not_checked",message:"This grader has not been checked at the saved revision.",graderId:l.id}));continue}let k=t,I=r.length;p+=d.length,(!d.some(n=>n.label==="positive")||!d.some(n=>n.label==="negative"))&&r.push({code:"examples_missing",message:"Add known-good and known-bad examples before claiming qualification.",graderId:l.id});for(let n of d){c?.throwIfAborted();let P=o.taskset.tasks.find(w=>w.id===n.taskId);if(!P){r.push({code:"fixture_task_missing",message:`Example ${n.id} references a missing task.`,graderId:l.id,taskId:n.taskId});continue}try{let w=Ye(o,n),v={output:n.output,runtimeEventRefs:[],artifactRefs:w.map(E=>E.reference.id),artifacts:w,infrastructureError:n.infrastructureError},[S]=await me({task:P,graders:[l],purpose:"fixture_calibration",signal:c,evidence:v,customVerifier:h(async({grader:E,task:D,evidence:H})=>{let C=o.files.find(y=>y.asset.id===E.verifierRef.id);if(!C||f(C.asset)!==f(E.verifierRef))throw new Error("The exact verifier source is missing.");let T=E.runtime==="sandbox_process"?await F({packageValue:o,grader:E,task:D,evidence:{...H,artifacts:w},signal:c,authorize:h(async()=>{c?.throwIfAborted()},"authorize")}):await $({source:new TextDecoder("utf-8",{fatal:!0}).decode(q(C)),exportName:E.exportName,runtime:E.runtime,timeoutMs:E.timeoutMs,signal:c,value:{task:D,attempt:H,input:D.input,expectedOutput:D.expectedOutput,output:H.output,artifacts:w,infrastructureError:n.infrastructureError}});return{score:T.score,passed:T.passed,rewardEligible:E.rewardEligible,failureClass:null,feedback:[T.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:T.evidenceRefs}},"customVerifier")});!S||S.score===null&&!n.infrastructureError||S.status==="pending"?r.push({code:"grader_unavailable",message:S?.feedback.join(" ")??"The grader returned no evidence.",graderId:l.id,taskId:P.id}):(t++,(S.passed!==n.expectedPassed||S.rewardEligible!==n.expectedRewardEligible)&&r.push({code:"example_mismatch",message:`Example ${n.id} did not match its expected pass/reward outcome. ${S.feedback.join(" ").slice(0,2e3)}`,graderId:l.id,taskId:P.id}))}catch(w){r.push({code:"grader_unavailable",message:w instanceof Error?w.message:"Example check failed.",graderId:l.id,taskId:P.id})}}let m=r.slice(I);g.push({graderId:l.id,checked:t-k,total:d.length,status:m.some(n=>n.code==="example_mismatch")?"failed":m.length?"unavailable":"passed"})}return o.taskset.graders.length||r.push({code:"graders_missing",message:"No graders are configured."}),{kind:"graders",revision:e.workspace.draft.revision,workspaceHash:e.workspace.contentHash,status:r.some(l=>l.code==="example_mismatch")?"failed":r.length?"unavailable":"passed",checked:t,total:p,scopes:g,issues:r,checkedAt:new Date().toISOString()}}h(Qe,"checkLocalDatasetGraders");var dt=new Set(["unknown","other"]);function Ze(e,o){return o?"approved":!e||dt.has(e.toLowerCase())?"review":"approved"}h(Ze,"approvedLicenseStatus");function pt(e,o){if(e.schemaVersion!=="openpond.huggingFaceDatasetSource.v1")throw new Error("Selected source checks require a captured Hugging Face sample.");let c=V(o);if(e.metadata.capturedSourceHash!==c||!e.sourceFileHashes.includes(c))throw new Error("The captured source bytes do not match their retained hash.");let a=new TextDecoder("utf-8",{fatal:!0}).decode(o),s=Te(a);return{...e,secretScanStatus:s.secretStatus,piiScanStatus:s.piiStatus,licensingStatus:Ze(e.declaredLicense,!1),metadata:{...e.metadata,privacyScanner:"openpond-evidence-v1",findings:s.findings,checkedSourceHash:c}}}h(pt,"checkCapturedHuggingFaceSource");function et(e){let o=0,c=e.draft.sourceRefs.map(a=>{if(a.schemaVersion!=="openpond.huggingFaceDatasetSource.v1"||typeof a.metadata.capturedSourcePath!="string")return a;let s=e.files.find(r=>r.path===a.metadata.capturedSourcePath);if(!s)throw new Error("The captured source file is missing.");let i=Buffer.from(s.base64,"base64");if(V(i)!==s.contentHash||i.byteLength!==s.sizeBytes)throw new Error("The captured source file failed integrity verification.");return o++,pt(a,i)});if(!o)throw new Error("This Dataset has no captured Hugging Face samples to check.");return c}h(et,"checkCapturedDatasetSources");function A(e){let{draft:o}=e.workspace,c=e.checks.filter(a=>a.workspaceHash===e.workspace.contentHash);return{kind:"dataset",id:o.id,revision:o.revision,name:o.name||"Untitled dataset",state:e.packageHash?"Runnable":"Saved draft",evaluationHash:e.workspace.contentHash,taskCount:o.datasetArtifact?.rowCount??o.tasks.length,graderCount:o.graders.length,checkState:c.length?c.map(a=>`${a.kind}: ${a.status} (${a.checked}/${a.total})`).join(" \xB7 "):e.checks.length?"Checks stale":"Not checked",syncState:e.sync?e.sync.paused?"Paused":e.sync.acknowledgedHash===e.workspace.contentHash&&e.sync.status==="synced"?"Synced":e.sync.status==="synced"?"Sync pending":e.sync.status:"Local",rows:o.tasks.slice(0,3).map(a=>({id:a.id,label:typeof a.input.prompt=="string"?a.input.prompt:JSON.stringify(a.input),detail:o.graders.map(s=>s.label).join(", ")}))}}h(A,"localDatasetSummary");function tt(e){async function o(r,u){let t=await e.store.readLocalDataset(r,u);if(!t||t.ownerId!==await e.store.localResourceOwnerId())throw new Error("Local Dataset was not found.");return t}h(o,"read");async function c(r,u){let t=await e.store.readLocalDatasetListing(r,u);if(!t||t.ownerId!==await e.store.localResourceOwnerId())throw new Error("Local Dataset was not found.");return t}h(c,"readListing");function a(r,u,t=r.workspace.contentHash){return _e({workspace:u?Me(r.workspace,u):r.workspace,sourceWorkspaceHash:t,maximumBytes:Number.POSITIVE_INFINITY,preparation:null,adapterId:"openpond-desktop-taskset-authoring-v1",now:r.workspace.draft.updatedAt})}h(a,"compile");async function s(r,u,t){if(t){let d=await e.store.readLocalDatasetProjection(r,t,{revision:u});if(!d||d.record.ownerId!==await e.store.localResourceOwnerId())throw new Error("Local Dataset was not found.");let k=a(d.record,void 0,d.sourceWorkspaceHash);return await O(e.home,k,Number.POSITIVE_INFINITY),{record:d.record,package:k}}let p=await o(r,u),g=a(p,t);await O(e.home,g,Number.POSITIVE_INFINITY);let l=await o(r);if(!t&&l.workspace.contentHash===p.workspace.contentHash&&l.packageHash!==g.contentHash)try{p=await e.store.updateLocalDatasetMetadata(r,f(l),d=>({...d,packageHash:g.contentHash}))}catch(d){if(!(d instanceof Error)||!d.message.startsWith("Dataset state changed."))throw d}return{record:p,package:g}}h(s,"packageDataset");async function i(r,u){let t=qe.parse(r),p=await e.store.localResourceOwnerId();if(t.action==="schema"){let m=x.enum(["task","grader","fixture","draft","file"]).parse(t.payload.kind??"task"),n=m==="task"?N.shape.tasks.unwrap().element:m==="grader"?N.shape.graders.unwrap().element:m==="fixture"?N.shape.graderFixtures.unwrap().element:m==="file"?J:N;return{kind:m,schema:x.toJSONSchema(n),...m==="grader"?{example:{id:"exact-answer",version:"1",label:"Exact answer",kind:"content",weight:1,hardGate:!0,rewardEligible:!1,privileged:!0,config:{operator:"final_answer_equals_expected"},metadata:{}}}:{}}}if(t.action==="list"){let m=(await e.store.listLocalDatasetListings()).filter(n=>n.ownerId===p);return t.payload.view==="catalog"?Ke(m,A):m.map(n=>({...A(n),projectId:n.projectId}))}if(t.action==="inspect_source"||t.action==="import_source"){if(!e.sourceAction)throw new Error("This Dataset source adapter is unavailable.");return e.sourceAction(t.action,t.payload,p)}if(t.action==="related_chats"){let m=t.payload.kind;if(m!==void 0&&!["dataset","grader","experiment"].includes(String(m)))throw new Error("Select a supported resource kind.");let n=await e.store.chatResourceLinks({kind:typeof m=="string"?m:"dataset",id:t.id}),P=[...new Set(n.map(w=>w.sessionId))];return(await Promise.all(P.map(w=>e.store.getSession(w)))).filter(w=>w&&!w.systemKind&&w.workspaceKind!=="sandbox").map(w=>({id:w.id,title:w.title}))}let g=f(t);if(["create","save","file","import","save_grader","check_sources"].includes(t.action)){if(!t.operationId)throw new Error("A stable operationId is required. Reuse it after an uncertain response.");let m=await e.store.recoverLocalDatasetOperation(t.operationId,g);if(m)return{record:m,summary:A(m),summaries:B(m)};let n=new Date().toISOString(),P;if(t.action==="create"||t.action==="import"){let v=`dataset-${f([p,t.operationId]).slice(0,40)}`,S;if(t.action==="import"){if(typeof t.payload.path!="string")throw new Error("Import requires a package folder path.");S=(await X({directory:t.payload.path,teamId:p,datasetId:v,expectedRevision:0,maximumBytes:Number.POSITIVE_INFINITY})).workspace}else{let E=Se({profileId:p,id:v,name:typeof t.payload.name=="string"?t.payload.name:"",now:n});S=U({schemaVersion:"openpond.tasksetDraftWorkspace.v1",draft:{...E,...t.payload.draft,id:v,profileId:p,modelScope:null,revision:1,status:"draft",publishedTasksetRef:null,createdAt:n,updatedAt:n},files:Array.isArray(t.payload.files)?t.payload.files:[]},Number.POSITIVE_INFINITY)}P=Ve.parse({schemaVersion:"openpond.localDataset.v1",ownerId:p,projectId:typeof t.payload.projectId=="string"?t.payload.projectId:null,workspace:S,checks:[],packageHash:null,sync:null})}else{if(!t.id||t.expectedRevision===void 0)throw new Error("Editing requires a Dataset ID and expectedRevision.");let v=await o(t.id),S=t.payload.draft;if(t.action==="check_sources"&&(S={sourceRefs:et(v.workspace)}),t.action==="save_grader"){let D=N.shape.graders.unwrap().element.parse(t.payload.grader),H=v.workspace.draft.graders.filter(T=>T.id!==D.id),C=v.workspace.draft.graders.findIndex(T=>T.id===D.id);H.splice(C<0?H.length:C,0,D),S={graders:H,...Array.isArray(t.payload.fixtures)?{graderFixtures:t.payload.fixtures}:{}}}let E;if(t.action==="save"&&typeof t.payload.path=="string"){if(v.workspace.draft.modelScope)throw new Error("Folder replacement requires an ordinary local Dataset.");let D=await X({directory:t.payload.path,teamId:p,datasetId:t.id,expectedRevision:t.expectedRevision,maximumBytes:Number.POSITIVE_INFINITY}),H=K({workspace:v.workspace,expectedDraftRevision:t.expectedRevision,draft:{...D.workspace.draft,id:v.workspace.draft.id,profileId:v.workspace.draft.profileId,modelScope:v.workspace.draft.modelScope,revision:v.workspace.draft.revision,status:v.workspace.draft.status,createdAt:v.workspace.draft.createdAt,publishedTasksetRef:v.workspace.draft.publishedTasksetRef},now:n,maximumBytes:Number.POSITIVE_INFINITY});E=U({schemaVersion:H.schemaVersion,draft:H.draft,files:D.workspace.files},Number.POSITIVE_INFINITY)}else E=t.action==="file"?be({workspace:v.workspace,mutation:J.parse({...t.payload,draftId:t.id,expectedDraftRevision:t.expectedRevision}),now:n,maximumBytes:Number.POSITIVE_INFINITY}):K({workspace:v.workspace,expectedDraftRevision:t.expectedRevision,draft:{...v.workspace.draft,...S},now:n,maximumBytes:Number.POSITIVE_INFINITY});P={...v,workspace:E,packageHash:null}}u?.throwIfAborted();let w=await e.store.saveLocalDataset({record:P,expectedRevision:t.action==="create"||t.action==="import"?0:t.expectedRevision,operationId:t.operationId,requestHash:g});return e.onSaved?.(w),{record:w,summary:A(w),summaries:B(w)}}if(!t.id)throw new Error("A Dataset ID is required.");if(t.action==="read"&&t.payload.view==="metadata"){let m=t.payload.revision===void 0?void 0:x.number().int().positive().parse(t.payload.revision),n=await c(t.id,m);return{record:n,summary:A(n)}}let l=await o(t.id,["read","read_grader","list_graders"].includes(t.action)&&t.expectedRevision?t.expectedRevision:void 0);if(t.action==="list_graders")return{summaries:B(l)};if(t.action==="read_grader"){let m=B(l).find(n=>n.graderId===t.payload.graderId||n.id===t.payload.graderId);if(!m)throw new Error("The saved grader was not found.");return t.payload.view==="inspection"?Xe(l,m,t.payload):{record:l,summary:m,grader:l.workspace.draft.graders.find(n=>n.id===m.graderId)}}if(t.action==="read")return{record:l,summary:A(l)};if(["upload","sync","pause_sync","disconnect_sync","publish"].includes(t.action)){if(t.expectedRevision!==l.workspace.draft.revision)throw new Error("Cloud actions require the exact current saved expectedRevision.");if(!e.syncAction)throw new Error("Cloud Dataset synchronization is unavailable.");let m=await e.syncAction(t.action,l,t.payload);return{record:m,summary:A(m)}}if(t.expectedRevision!==l.workspace.draft.revision)throw new Error("Checks and packaging require the exact saved expectedRevision.");if(t.action==="test_grader"&&!l.workspace.draft.graders.some(m=>m.id===t.payload.graderId))throw new Error("The saved grader was not found.");let d=null,k={kind:"structure",revision:l.workspace.draft.revision,workspaceHash:l.workspace.contentHash,status:"passed",checked:l.workspace.draft.tasks.length,total:l.workspace.draft.datasetArtifact?.rowCount??l.workspace.draft.tasks.length,checkedAt:new Date().toISOString(),issues:[]};try{d=a(l),await O(e.home,d,Number.POSITIVE_INFINITY)}catch(m){k={...k,status:"failed",issues:[{code:"package_invalid",message:m instanceof Error?m.message:"Package validation failed."}]}}if(["check_graders","test_grader"].includes(t.action)&&d){let m=[...new Set(l.workspace.draft.graderFixtures.map(n=>n.taskId))];k=await Qe(l,m.length?a(l,m):d,u,t.action==="test_grader"?t.payload.graderId:void 0)}let I=await e.store.updateLocalDatasetMetadata(t.id,f(l),m=>({...m,packageHash:d?.contentHash??null,checks:[...m.checks.filter(n=>n.kind!==k.kind),k]}));return{record:I,summary:t.action==="test_grader"?B(I).find(m=>m.graderId===t.payload.graderId):A(I),summaries:B(I),check:k,...t.action==="package"&&d?{package:d}:{}}}return h(i,"request"),{request:i,read:o,readListing:c,packageDataset:s,compile:a}}h(tt,"createLocalDatasetService");import{mkdtemp as ft,mkdir as ut,rm as mt}from"node:fs/promises";import ht from"node:os";import at from"node:path";var rt=new Set(["work_exec","work_save_output"]);function ot(e){let o=e.taskset,c=o.environment.kind==="text"&&o.tools.length===0,a=o.environment.kind==="work"&&o.environment.entrypoint==="openpond-work-v1"&&o.tools.every(s=>rt.has(s.name));return(c||a)&&o.policy.connectedAppScopes.length===0&&o.capabilities.every(s=>!s.required||s.id==="private-verifier"||s.id==="tools"&&s.scopes.every(i=>rt.has(i)&&o.tools.some(r=>r.name===i)))}h(ot,"supportsLocalProfileEnvironment");async function ba(){let e=await ft(at.join(ht.tmpdir(),"openpond-work-preflight-"));try{await ut(at.join(e,"outputs"));let o="local-work-preflight",a=await $e({authorize:h(async()=>({candidateId:o,candidateRevision:1,ownerId:o,sessionId:o,turnId:o,sourceRoot:e,layout:"profile_case",writablePaths:["outputs"]}),"authorize")})({candidateId:o,expectedRevision:1,sessionId:o,turnId:o,timeoutMs:5e3,command:`/runtime/node -e 'require("node:fs").writeFileSync("outputs/probe","ready");process.stdout.write("ready")'`});if(a.code!==0||a.timedOut||a.stdout!=="ready")throw new Error("The confined local Work executor is unavailable.")}finally{await mt(e,{recursive:!0,force:!0})}}h(ba,"assertLocalProfileWorkRuntime");function G(e){let o=Pe(e),c=e.modelResources?.rewards??(e.learningResources?ye(e.taskset).rewards:[]);if(o&&f(ge(o,c))!==f(e.taskset.graders))throw new R("local_grader_closure_conflict","The retained Reward closure differs from the released Dataset graders.",422);return e.taskset.graders.map(a=>{let s=o?.sources.find(r=>r.graderId===a.id),i=s&&c.find(r=>r.id===s.reward.id&&r.revision===s.reward.revision&&r.contentHash===s.reward.contentHash);return{id:a.id,version:a.version,contentHash:f(a),name:i?.name??("config"in a&&a.config.operator==="final_answer_equals_expected"?"Answer accuracy":`${a.kind.replaceAll("_"," ")} grader`),feedbackKey:i?he(i):`grader_${f(a.id).slice(0,24)}`,release:i?{id:i.id,revision:i.revision,contentHash:i.contentHash}:null}})}h(G,"localPackageGraders");function za(e,o){let c=G(e),a=o?o.map(s=>{let i=c.find(r=>r.id===s.id&&r.version===s.version&&r.contentHash===s.contentHash);if(!i)throw new R("local_grader_pin_unavailable","Select an exact grader from the retained Dataset package.",422);return{...i,mappings:s.mappings}}):c;try{return Le(a)}catch(s){throw new R("experiment_grader_feedback_conflict",s instanceof Error?s.message:"Grader selection conflicts.",422)}}h(za,"selectLocalPackageGraders");function Wa(e,o,c,a=!1,s=!1,i=!1){let r=L(o),u=e.configuration.request;if(r.contentHash!==e.packageHash||f(u.taskset)!==f({id:r.taskset.id,revision:r.taskset.revision,contentHash:r.taskset.contentHash}))throw new R("local_dataset_pin_conflict","Local execution requires the exact retained Dataset package.",422);if(u.policy.kind!=="hosted_chat"&&!(u.policy.kind==="hosted_harness"&&i))throw new R("local_target_not_qualified","This local execution path requires a qualified exact target owner.",422);let t=i&&u.policy.kind==="hosted_harness"&&ot(r);if(["claude-code","codex"].includes(e.model.providerId)&&!t&&(gt(r)||r.taskset.environment.kind!=="text"||r.taskset.tools.length))throw new R("native_text_environment_not_admitted","This native model adapter requires a text Dataset with no environment tools. Additional tool owners require explicit admission.",422);let p=u.policy.kind==="hosted_chat"?u.policy.harness:void 0;if(p&&!a)throw new R("local_harness_not_qualified","A released Harness must execute through its native turn owner.",422);let g=Y(r);if(r.taskset.policy.connectedAppScopes.length)throw new R("local_connected_scope_not_qualified","This Dataset requires connected scopes that have not been admitted for local execution.",422);for(let l of r.taskset.capabilities.filter(d=>d.required)){if(l.id==="tools"&&i&&l.scopes.every(k=>["work_exec","work_save_output"].includes(k)&&r.taskset.tools.some(I=>I.name===k)))continue;if(l.id!=="private-verifier")throw new R("local_capability_not_qualified","This Dataset requires capabilities not supplied by the local execution owner.",422);if((l.scopes.length?l.scopes:r.taskset.policy.hiddenGraderRefs).some(k=>!r.taskset.policy.hiddenGraderRefs.includes(k)||!r.taskset.graders.some(I=>I.id===k&&I.privileged&&I.kind!=="human")))throw new R("local_capability_not_qualified","The required private grader scope has no supported exact local grader owner.",422)}if(!g&&r.taskset.tools.length&&!i)throw new R("local_tool_target_not_qualified","This Dataset's tools require a released native target executor.",422);if(g?.execution.javascript.executionServices?.length&&!s)throw new R("local_prepared_environment_not_qualified","This Dataset requires prepared compute services that are not yet bound to the local execution owner.",422);if(r.taskset.environment.kind!=="text"&&!g&&!t)throw new R("local_environment_unavailable","The released Dataset has no supported local environment executor.",422);if(p&&(g||r.taskset.environment.kind!=="text"))throw new R("local_harness_environment_not_qualified","This native Harness requires a compatible text Dataset.",422);return u.population.map(l=>{let d=r.taskset.tasks.find(P=>P.id===l.taskId);if(!d)throw new R("local_population_unavailable","The selected task is absent from this immutable Dataset release.",422);let k=le(d);if((k.artifactRefs.length||d.requiredOutputs?.length)&&!(i&&u.policy.kind==="hosted_harness"))throw new R("local_work_target_not_qualified","This Dataset requires document input or Work output capabilities not supplied by this local model target.",422);let I=g?.assets.find(P=>P.id===g.execution.javascript.module.id),m=g?.assets.find(P=>P.id===d.privilegedContextRef);if(g&&(!I||!m))throw new R("local_environment_assets_missing","Private environment resources are missing from the retained package.",422);let n={kind:"model",id:`local-case-${f([c,l.receiptId]).slice(0,48)}`,taskId:d.id,model:e.model,...p?{harness:p}:{},instructions:Ee(r),input:k.input,policyVisibleContext:k.policyVisibleContext,timeoutMs:r.taskset.environment.defaultTimeoutMs,environment:g?{kind:"javascript",definition:g.execution.javascript,asset:I,initialState:JSON.parse(ve(m,m.asset)),seed:Number(l.seed)}:{kind:"text"}};return{receiptId:l.receiptId,taskId:l.taskId,seed:l.seed,request:Fe.parse({...n,admissionHash:f(n)})}})}h(Wa,"localExperimentAdmissions");function gt(e){return!!Y(e)}h(gt,"executionForClaude");import{readFile as kt}from"node:fs/promises";import wt from"node:path";async function st(e,o,c,a){let s=await e.getHarnessReleaseRecord(o.contentHash),i=s&&await e.getHarnessWorkspace(s.workspaceId);if(!s||!i||s.harnessRelease.id!==o.id||i.location!=="local"||i.metadata.sourceLayout!=="openpond.harnessSourceManifest.v1")throw new R("local_profile_source_unavailable","The exact Profile Harness is unavailable.",403);let r=i.metadata.profileExperimentOrigin!==void 0||i.metadata.experimentCandidateOrigin!==void 0;if(r){if(!a||!c)throw new R("local_profile_origin_access_denied","This source requires its authenticated origin.",403);await a(i,o,c)}else{if(i.ownerScope.kind!=="personal"||i.ownerScope.id!=="desktop-personal"||typeof s.harnessRelease.metadata.profileRepositoryId=="string"||typeof s.agentSnapshot.metadata.profileRepositoryId=="string")throw new R("local_profile_origin_access_denied","The Profile is not device-owned.",403);let d=s.harnessRelease.metadata.profile;if(c&&(c.source!=="local"||d?.id!==c.profileId||d.repositoryId&&d.repositoryId!==c.repositoryId))throw new R("local_profile_origin_access_denied","The retained Harness differs from this exact Profile reference.",403);if(i.metadata.selectionEligible===!1&&(!c||!d?.repositoryId||d.repositoryId!==c.repositoryId||i.id!==`${Oe}${f({ref:c,sourceRevision:d.sourceRevision}).slice(0,24)}`))throw new R("local_profile_origin_access_denied","This explicit Profile release requires its canonical accepted reference.",403)}let u=await Ne({workspace:i,release:s}),t=new Map;for(let d of s.harnessRelease.files)t.set(d.path,await kt(wt.join(s.bundlePath,"source",...d.path.split("/"))));let p=ie({agentSnapshot:s.agentSnapshot,harnessRelease:s.harnessRelease,files:t}),g=ke(s);ne({sourcePackage:p,expectedRelease:o,baseSystemPrompt:"",runtimeId:"openpond.native-profile-experiment.v1",maxContextCharacters:262144,tools:g.map(d=>({name:d.name,inputSchema:d.inputSchema,definition:{type:"function",function:{name:d.name,description:d.description,parameters:d.inputSchema}}}))});let l=await e.getHarnessWorkspace(i.id);if(!l||f(l.ownerScope)!==f(i.ownerScope)||f(l.metadata)!==f(i.metadata))throw new R("local_profile_origin_access_denied","Profile source ownership changed during admission.",403);return r&&await a(i,o,c),u}h(st,"resolveLocalProfileExperimentSource");var ee=x.object({id:b,revision:x.number().int().positive(),workspaceHash:_,taskIds:x.array(b).min(1).max(500),seed:x.string().trim().min(1).max(500).default("1")}).strict();function mr(e){let o=tt({store:e.store,home:e.storeDir});async function c(r){if(r.profileRef.source!=="local")throw new Error("Installation-local Datasets require an accepted local Profile.");if(!(await se()).profiles.some(l=>f(l.ref)===f(r.profileRef)))throw new Error("The local Dataset's Profile is no longer in this installation's accepted library.");let t=await st(e.store,r.harnessRelease,r.profileRef),p=await Je({store:e.store,ref:r.profileRef,sourceRevision:r.sourceRevision,harnessRelease:r.harnessRelease}),g=await Be({workspaceId:typeof t.release.agentSnapshot.metadata.workspaceId=="string"?t.release.agentSnapshot.metadata.workspaceId:t.release.workspaceId,sourceDir:vt.join(t.release.bundlePath,"source")});if(g.harnessRelease.contentHash!==r.harnessRelease.contentHash)throw new Error("The local Dataset's frozen Profile source changed.");return{catalog:p,protectedClosureHash:Ge(g).protectedClosureHash}}h(c,"profileAuthority");async function a(r,u,t){let p=await e.store.readLocalDatasetProjection(r,t,{workspaceHash:u});if(!p||p.record.ownerId!==await e.store.localResourceOwnerId())throw new Error("The exact installation-local Dataset workspace is unavailable to this owner.");return{record:p.record,packageValue:o.compile(p.record,void 0,p.sourceWorkspaceHash)}}return h(a,"savedPackage"),{prepareBinding:h(async(r,u,t)=>{let p=ee.parse(r);if((await o.readListing(p.id,p.revision)).workspace.contentHash!==p.workspaceHash)throw new Error("The selected local Dataset revision or workspace hash changed.");if(new Set(p.taskIds).size!==p.taskIds.length)throw new Error("Select each local Dataset task once.");let{package:l}=await o.packageDataset(p.id,p.revision,p.taskIds),d=p.taskIds.map(n=>l.taskset.tasks.find(P=>P.id===n));if(d.some(n=>!n)||d.some(n=>n.split!==d[0].split))throw new Error("Select existing local Dataset tasks from one exact split.");let{catalog:k,protectedClosureHash:I}=await c(u);if(!k.definitions.some(n=>f(n)===f(t)))throw new Error("The local Dataset target differs from the accepted Profile definition.");let m=G(l);return pe({schemaVersion:"openpond.profileExternalDatasetBinding.v1",dataset:{id:l.taskset.id,revision:l.taskset.revision,contentHash:l.taskset.contentHash},packageHash:l.contentHash,profileId:u.profileRef.profileId,target:t.target,declaredProfileCatalogHash:k.catalogHash,protectedProfileClosureHash:I,split:d[0].split,population:p.taskIds.map(n=>({taskId:n,seed:p.seed,fixtureId:null})),evaluators:m.map(n=>({release:n.release??{id:n.id,revision:n.version,contentHash:n.contentHash},feedbackKey:n.feedbackKey,configurationHash:f({graderHash:n.contentHash,mappings:[]}),output:"score",categories:[]})),fieldMappings:[],fieldMappingsHash:f([]),environmentHash:f(l.taskset.environment),privateDatasetClosureHash:f(l.files.filter(n=>n.asset.visibility!=="policy").map(n=>n.asset)),criterion:t.criterion})},"prepareBinding"),resolveExternalDataset:h(async(r,u)=>{let t;try{t=await W(e.storeDir,r.packageHash)}catch(n){if(n.code!=="ENOENT")throw n}let p=t?x.object({sourceTasksetId:b,sourcePackageHash:_}).passthrough().safeParse(t.taskset.metadata):null,g=p?.success?await e.store.readLocalDatasetListing(p.data.sourceTasksetId):null;if(!t||!p?.success||!g){if(!e.remote)throw new Error("This external Dataset has no installation-local owner.");return e.remote(r,u)}let l=p.data,d=t.contentHash,k=g.ownerId;async function I(){let n=[...new Set(r.population.map(S=>S.taskId))],{record:P,packageValue:w}=await a(l.sourceTasksetId,l.sourcePackageHash,n);if(P.ownerId!==k||w.contentHash!==d)throw new Error("The cached Dataset differs from its exact saved local source.");let v=await c(u);if(r.profileId!==u.profileRef.profileId||r.declaredProfileCatalogHash!==v.catalog.catalogHash||r.protectedProfileClosureHash!==v.protectedClosureHash)throw new Error("The local Dataset recipe changed its accepted Profile or protected evaluator closure.");return Ce({binding:r,packageValue:w,graders:G(w)})}h(I,"read");let m=await I();return{binding:r,packageValue:m,authorize:h(async()=>{if(f(await I())!==f(m))throw new Error("The local Dataset authority changed during execution.")},"authorize")}},"resolveExternalDataset")}}h(mr,"createInstallationLocalProfileDatasets");var yt=x.object({id:b,createdAt:ae,definitionId:b,externalDatasetBinding:de.optional(),localDataset:ee.optional(),profileRef:Ae.optional(),profileSource:x.object({sourceRevision:x.string().min(1).max(500),harnessRelease:x.object({id:b,contentHash:_}).strict()}).strict().optional(),modelRef:oe,hostModelConfigurationHash:_.optional(),hostArtifactHash:_.optional(),maximumSpendUsd:x.number().positive().max(1e4).optional(),expectedManifestHash:_.optional(),hostExperiment:x.object({definition:x.object({id:b,revision:x.number().int().positive(),contentHash:_}).strict().nullable(),configurationHash:_,project:x.object({id:b,revision:x.number().int().positive(),contentHash:_,targetId:b.nullable()}).strict().optional()}).strict().optional()}).strict();function Er(e){return async(o,c)=>{let a=yt.parse(o);if(c?.requireExpectedManifestHash&&!a.expectedManifestHash)throw new Error("Profile evaluation execution requires the reviewed manifest hash.");if(a.profileSource&&!a.profileRef)throw new Error("An exact Profile source requires its accepted Profile reference.");let s=c?.selectedWorkflows??await e.selectedWorkflows(a.profileRef,a.profileSource);if(a.profileRef&&f(a.profileRef)!==f(s.profileRef))throw new Error("Profile preparation did not resolve the explicitly selected Profile.");if(a.profileSource&&(s.sourceRevision!==a.profileSource.sourceRevision||f(s.harnessRelease)!==f(a.profileSource.harnessRelease)))throw new Error("Profile preparation changed its explicitly pinned source.");if(a.localDataset&&a.externalDatasetBinding)throw new Error("Select a local Dataset or an external recipe, not both.");let i=await e.loadCatalog({ref:s.profileRef,sourceRevision:s.sourceRevision,harnessRelease:s.harnessRelease}),r=a.localDataset?i.definitions.find(y=>y.id===a.definitionId):null;if(a.localDataset&&!r)throw new Error("Choose an existing accepted Profile definition as the local Dataset target.");let t=(a.localDataset&&r?await(e.prepareLocalDatasetBinding?e.prepareLocalDatasetBinding(a.localDataset,s,r):Promise.reject(new Error("This host has not qualified installation-local Profile Datasets."))):null)??(a.externalDatasetBinding?M(a.externalDatasetBinding):null),p=t?await(e.resolveExternalDataset?e.resolveExternalDataset(t,s):Promise.reject(new Error("This host has not qualified external Dataset Profile execution."))):null;if(p&&(await p.authorize(),f(M(p.binding))!==f(t)))throw new Error("External Dataset admission differs from the actual authorized recipe.");if(t&&t.declaredProfileCatalogHash!==i.catalogHash)throw new Error("The original Profile verifier catalog changed.");let g=t?Z(t):null;if(g&&!a.localDataset&&a.definitionId!==g.id)throw new Error("Use the external recipe's own definition identity.");let l={schemaVersion:"openpond.profileEvaluations.v1",definitions:g?[g]:i.definitions,suites:g?[]:i.suites},d=g??i.definitions.find(y=>y.id===a.definitionId);if(!d)throw new Error(`Evaluation ${a.definitionId} is absent from the selected Profile release.`);let k=d.target,I=k.kind==="workflow"?s.workflows.find(y=>y.binding.workflowId===k.workflowId)?.binding:ce.parse({schemaVersion:"openpond.profileComponentBinding.v1",profileId:s.profileRef.profileId,sourceRevision:s.sourceRevision,harnessRelease:s.harnessRelease,target:k});if(!I)throw new Error(`Evaluation workflow ${k.kind==="workflow"?k.workflowId:""} is absent from the selected Profile release.`);let m=L(p?.packageValue??await e.loadTasksetPackage(d,s.profileRef.profileId,s.harnessRelease)),n=m.taskset;if(n.id!==d.tasksetRelease.id||n.contentHash!==d.tasksetRelease.contentHash)throw new Error("Evaluation Taskset package differs from its released definition.");let P=n.environment.kind==="text"&&n.tools.length===0,w=n.environment.kind==="work"&&n.environment.entrypoint==="openpond-work-v1"&&n.tools.every(y=>["work_exec","work_save_output"].includes(y.name));if(!P&&!w)throw new Error("Profile evaluation supports text cases or Work cases with the built-in execution and output tools.");if(a.maximumSpendUsd!==void 0&&w){if(typeof e.boundedWorkComputeAvailable=="function")await e.boundedWorkComputeAvailable();else if(!e.boundedWorkComputeAvailable)throw new Error("This host has not admitted budgeted Work compute.")}if(n.tasks.some(y=>y.artifactRefs.length>Q.maxAttachments||y.artifactRefs.some(j=>j.visibility!=="policy"||j.mediaType!=="application/pdf"||j.sizeBytes>Q.maxAttachmentBytes)))throw new Error("Profile evaluation accepts only bounded policy-visible PDF task attachments.");if(!t&&!e.privateGradingPreflight&&(n.graders.some(y=>y.kind==="model_judge"||y.kind==="custom_verifier")||n.metrics?.aggregation==="custom"))throw new Error("Profile evaluation cannot run this Taskset's model judge, custom verifier, or custom metric in the current app-server runtime.");await e.privateGradingPreflight?.(m);let v={adapterId:k.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",placement:e.placement,runtimeVersion:"app-server-v1",capabilityReceipt:f({adapterId:k.kind==="workflow"?"openpond.profile-workflow":"openpond.profile-component",packageHash:m.contentHash,connectedAppScopes:n.policy.connectedAppScopes})},E={...ue({catalog:l,definitionId:d.id,profileId:s.profileRef.profileId,sourceRevision:s.sourceRevision,harnessRelease:s.harnessRelease,environmentHash:f({packageHash:m.contentHash,runtimeTarget:v})}),...t?{externalDatasetBinding:t}:{},...e.sourceCandidate?{sourceCandidate:e.sourceCandidate}:{}};if(t&&(t.packageHash!==m.contentHash||t.environmentHash!==f(n.environment)||t.privateDatasetClosureHash!==f(m.files.filter(y=>y.asset.visibility!=="policy").map(y=>y.asset))))throw new Error("External Dataset package/environment/private closure changed.");let D=re.parse({provider:a.modelRef.providerId,model:a.modelRef.modelId,revision:null,artifactHash:a.hostArtifactHash??null,tokenizerRevision:null,chatTemplateHash:null}),H=await e.modelConfigurationHash(a.modelRef,a),C=c?.modelSampling?f({ownerModelConfigurationHash:H,sampling:Ie.parse(c.modelSampling)}):H,T=xe({schemaVersion:"openpond.tasksetRunManifest.v1",id:a.id,tasksetRelease:d.tasksetRelease,packageHash:m.contentHash,execution:{kind:"harness",harnessRelease:s.harnessRelease},profileEvaluation:E,policy:{kind:"model",model:D,configurationHash:C},gradingRole:"evaluation",metricPolicy:Re(n),population:t?t.population.map(y=>({...y,receiptId:`evaluation-${f([a.id,y.taskId,y.seed,y.fixtureId]).slice(0,32)}`})):d.taskIds.flatMap(y=>d.seeds.map(j=>({receiptId:`evaluation-${f([a.id,y,j]).slice(0,32)}`,taskId:y,seed:j,fixtureId:null}))),runtimeTarget:v,limits:{maxTurns:128,timeoutMs:n.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:a.maximumSpendUsd??null},createdAt:a.createdAt,metadata:{sourceTasksetId:n.metadata.sourceTasksetId??n.id,...s.profileRef.source==="openpond_git"?{profileRepositoryId:s.profileRef.repositoryId}:{},...a.hostExperiment?{experimentDefinition:a.hostExperiment.definition,experimentConfigurationHash:a.hostExperiment.configurationHash,...a.hostExperiment.project?{project:a.hostExperiment.project}:{}}:{}}});if(z(T,n,l),p&&await p.authorize(),a.expectedManifestHash&&T.contentHash!==a.expectedManifestHash)throw new Error("Profile evaluation setup changed since preview; prepare the run again.");return{manifest:T,taskset:n,profileRef:s.profileRef,binding:I,modelRef:a.modelRef,modelConfigurationHash:C}}}h(Er,"createProfileEvaluationRunPreparationService");async function xt(e,o){let c=L(e);for(let s of c.taskset.graders){if(s.kind==="model_judge"&&(!o||s.calibrationStatus!=="passed"))throw new Error("This Profile requires its current calibrated judge and bounded private provider owner.");let i="verifierRef"in s?s.verifierRef:"rubricRef"in s?s.rubricRef:null;i&&te(c,i)}let a=c.taskset.metrics?.customAggregator;if(a){let s=c.files.find(i=>i.asset.path===a.module);if(!s||s.asset.visibility==="policy"||V(q(s))!==a.contentHash)throw new Error("The authored aggregate metric is not its exact private release.");new TextDecoder("utf8",{fatal:!0}).decode(q(s))}}h(xt,"preflightProfilePrivateGrading");function te(e,o){let c=e.files.find(a=>a.asset.id===o.id);if(!c||c.asset.visibility==="policy"||f(c.asset)!==f(o))throw new Error("The exact private grader asset is unavailable.");return new TextDecoder("utf8",{fatal:!0}).decode(q(c))}h(te,"readPrivate");async function Ar(e){let o=L(e.packageValue);if(o.contentHash!==e.manifest.packageHash||o.taskset.contentHash!==e.manifest.tasksetRelease.contentHash)throw new Error("The private grading package changed its frozen Run identity.");await e.authorize(),await xt(o,!!e.executeBudgetedJudge),await e.authorize();let c=h(async({grader:i,task:r,evidence:u})=>{let t=e.signal;await e.authorize(),t?.throwIfAborted();let p={manifest:e.manifest,packageValue:o,grader:i,task:r,evidence:u,signal:t,authorize:e.authorize},g=e.executeSandboxVerifier?await e.executeSandboxVerifier(p):i.runtime==="sandbox_process"?await F(p):await $({source:te(o,i.verifierRef),exportName:i.exportName,runtime:i.runtime,timeoutMs:i.timeoutMs,signal:t,value:{task:r,attempt:u,input:r.input,output:u.output,artifacts:"artifacts"in u?u.artifacts:[],expectedOutput:r.expectedOutput,infrastructureError:u.infrastructureError??null}});return await e.authorize(),t?.throwIfAborted(),{score:g.score,passed:g.passed,rewardEligible:i.rewardEligible,failureClass:null,feedback:[g.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:g.evidenceRefs}},"customVerifier"),a=o.taskset.metrics?.customAggregator,s=a?new TextDecoder("utf8",{fatal:!0}).decode(q(o.files.find(i=>i.asset.path===a.module))):void 0;return{authorize:e.authorize,customVerifier:c,...e.executeBudgetedJudge?{modelJudge:we({readRubric:h(async i=>{await e.authorize();let r=te(o,i);return await e.authorize(),r},"readRubric"),executeBudgeted:h(async(i,r)=>{await e.authorize(),r?.throwIfAborted();let u=await e.executeBudgetedJudge(i,r);return await e.authorize(),r?.throwIfAborted(),u},"executeBudgeted")})}:{},...s!==void 0?{metricSource:s,metricExecutor:h(async i=>{await e.authorize(),i.signal?.throwIfAborted();let r=await Ue(i);return await e.authorize(),i.signal?.throwIfAborted(),r},"metricExecutor")}:{}}}h(Ar,"createProfilePrivateGradingOwner");export{_t as a,lt as b,Bt as c,B as d,Ze as e,pt as f,A as g,tt as h,ot as i,ba as j,G as k,za as l,Wa as m,st as n,mr as o,Er as p,xt as q,Ar as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{h as i}from"./chunk-
|
|
2
|
+
import{h as i}from"./chunk-4PUOWSDE.js";import{A as e}from"./chunk-X2J2P5ZT.js";var t=i.extend({mode:e.enum(["nightly","approved_count"]),minimumTasks:e.number().int().min(1).max(1e4),maximumSpendUsd:e.number().positive().max(1e5),maximumDailySpendUsd:e.number().positive().max(1e6)}).strict().superRefine((m,a)=>{m.maximumDailySpendUsd<m.maximumSpendUsd&&a.addIssue({code:"custom",path:["maximumDailySpendUsd"],message:"The daily budget must cover one update."})});export{t as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{b}from"./chunk-JQOVC35K.js";import{ja as M}from"./chunk-HG2YFMVU.js";import{Qb as x,m as T,v as A}from"./chunk-D6L6UNUQ.js";import{n as c,o as S}from"./chunk-RCT3O3HQ.js";import{A as I}from"./chunk-X2J2P5ZT.js";import{a as R}from"./chunk-FTQLQJQV.js";function j(e,a,i){if(a==="agent_action"){let n=e.find(u=>u.name==="workspace_action_result"&&u.action==="profile_workflow_action")?.output;if(typeof n!="string")throw new Error("Profile Agent action evaluation did not produce a released action result.");return n}if(i==="completed"){let n=[...e].reverse().find(s=>s.name==="turn.completed"),r=n?.data?.providerResponse,o=n?.data;if(!r&&o?.turn?.status==="completed"){let s=[...e].reverse().find(t=>P(t)!==null);if(!s)throw new Error("Native Profile evaluation has no retained final answer.");let d=P(s);return e.filter(t=>P(t)===d).map(t=>t.output??"").join("")}if(typeof r?.requestId!="string"||!r.requestId||typeof r.contentHash!="string")throw new Error("Profile evaluation has no retained final provider response.");let p=e.filter(s=>s.name==="assistant.delta"&&s.data?.providerRequestId===r.requestId).map(s=>s.output??"").join("");if(c(p)!==r.contentHash)throw new Error("Profile evaluation final provider response differs from its retained trace.");return b(e)??p}return e.filter(n=>n.name==="assistant.delta"&&typeof n.output=="string").map(n=>n.output??"").join("")}R(j,"profileEvaluationOutput");function P(e){let a=e.data;return e.name==="assistant.delta"&&a?.provider==="codex"&&a.phase==="final_answer"&&typeof a.itemId=="string"?a.itemId:null}R(P,"nativeFinalAnswerItemId");async function _(e){let{store:a,manifest:i,receipt:n}=e;if(!n.metadata.retainedEvidenceRef)return null;let u=x.parse(n.metadata.retainedEvidenceRef),[r,o]=await Promise.all([a.getSession(u.sessionId),a.getTurn(u.turnId)]),p=r?.metadata?.profileEvaluationRun,s=i.profileEvaluation;if(!r||!o||o.sessionId!==r.id||!s||!r.currentProfile||c(r.currentProfile)!==c(e.profileRef)||c(p)!==c({id:i.id,contentHash:i.contentHash})||r.metadata?.taskId!==n.taskId||r.metadata?.seed!==n.seed||!o.completedAt||o.completedAt!==n.completedAt||o.startedAt!==n.startedAt||!o.harnessSnapshot||o.harnessSnapshot.harnessRelease.id!==s.harnessRelease.id||o.harnessSnapshot.harnessRelease.contentHash!==s.harnessRelease.contentHash||i.policy.kind!=="model"||!o.modelRef||o.modelRef.providerId!==i.policy.model.provider||o.modelRef.modelId!==i.policy.model.model)throw new Error("Retained Profile policy turn differs from its admitted case.");let d=await a.runtimeEventsForTurn(o.id);if(d.some(v=>v.turnId!==o.id)||c(d)!==n.traceHash)throw new Error("Retained Profile policy trace differs from its immutable receipt.");let t=j(d,s.target.kind,o.status);if(n.outputHash!==null&&c({text:t})!==n.outputHash)throw new Error("Retained Profile output differs from its immutable receipt.");let m=n.artifactRefs.flatMap(v=>{let y=d.filter(l=>(l.action==="work_output_save"||l.action==="sandbox_save_output")&&l.status==="completed").flatMap(l=>{let C=l.data&&typeof l.data=="object"?l.data:{},k=M.safeParse(C.outputRef);return k.success?[k.data]:[]}).filter(l=>l.sourceTaskId===r.id&&l.sourceTurnId===o.id&&`${r.id}/${l.id}/${l.revision}/${l.title}`===v.id&&l.sha256===v.contentHash&&l.sizeBytes===v.sizeBytes&&l.contentType===v.mediaType);if(y.length!==1)throw new Error("The case output has no unique sealed saved-file identity.");let h=y[0];if(h.location.kind!=="managed")return[];let H=`/api/work/outputs/${encodeURIComponent(h.location.fileId)}`;if(h.location.downloadPath!==H)throw new Error("The saved output has no canonical managed download route.");return[{id:h.id,title:h.title,revision:h.revision,contentType:h.contentType,sizeBytes:h.sizeBytes,sha256:h.sha256,downloadPath:H}]}),f=await a.listModelUsageRecords({sessionId:r.id,turnId:o.id,limit:1e4}),E=e.eventAfterId?d.findIndex(v=>v.id===e.eventAfterId):-1;if(e.eventAfterId&&E<0)throw new Error("Profile trace cursor is unavailable in this case.");let g=E+1,q=Math.max(1,Math.min(250,e.eventLimit??100)),w=d.slice(g,g+q);return{ref:u,prompt:o.prompt,output:n.outputHash===null?null:{text:t},partialOutput:n.outputHash===null&&t?{text:t}:null,error:o.error,events:w,eventCount:d.length,nextEventCursor:g+w.length<d.length?w.at(-1).id:null,files:m,usage:f,usageCoverage:f.length===1e4?"partial":"complete"}}R(_,"readProfileEvaluationPolicyEvidence");var W=I.object({runId:I.string().trim().min(1).max(240),receiptId:I.string().trim().min(1).max(500).optional(),eventAfterId:I.string().trim().min(1).max(500).optional(),eventLimit:I.number().int().min(1).max(250).optional(),manifest:A.optional()}).strict().refine(e=>e.receiptId||!e.eventAfterId&&!e.eventLimit,"Select a case before requesting its trace page.").refine(e=>!e.manifest||e.receiptId,"Interrupted-run inspection requires one exact case.");async function D(e){let a=await e.store.getProfileEvaluationRun(e.runId);if(a&&c(a.profileRef)!==c(e.profileRef))throw new Error("Profile evaluation run is unavailable in the selected Profile.");let i=a?.manifest??e.manifest;if(!i||!a&&!e.receiptId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");if(a){if(e.manifest&&e.manifest.contentHash!==a.manifest.contentHash)throw new Error("Profile evaluation run differs from its pinned manifest.")}else if(S(i,"Interrupted Profile evaluation manifest"),i.id!==e.runId||i.profileEvaluation?.profileId!==e.profileRef.profileId||e.profileRef.source==="openpond_git"&&i.metadata.profileRepositoryId!==e.profileRef.repositoryId)throw new Error("Profile evaluation run is unavailable in the selected Profile.");let n=i.population.map((r,o)=>({member:r,index:o})).filter(({member:r})=>!e.receiptId||r.receiptId===e.receiptId);if(e.receiptId&&n.length!==1)throw new Error("Profile evaluation case is unavailable in the selected run.");let u=await Promise.all(n.map(async({member:r,index:o})=>{let p=a?null:await e.store.getProfileEvaluationReceipt(r.receiptId),s=a?.receiptRefs[o]??(p?{id:p.id,contentHash:p.contentHash}:null),d=a?.gradeRefs[o]??p?.graderEvidenceRefs[0];if(!s||!d)throw new Error("Profile evaluation run has incomplete case evidence.");let[t,m]=await Promise.all([e.store.getProfileEvaluationReceipt(s.id),e.store.getProfileEvaluationGrade(d.contentHash)]);if(!t||!a&&!T(t)||t.contentHash!==s.contentHash||t.id!==r.receiptId||t.taskId!==r.taskId||t.seed!==r.seed||t.runManifest.id!==i.id||t.runManifest.contentHash!==i.contentHash||!m||m.contentHash!==d.contentHash||!t.graderEvidenceRefs.some(f=>f.id===d.id&&f.contentHash===d.contentHash))throw new Error("Profile evaluation case evidence differs from its retained run.");return{taskId:r.taskId,seed:r.seed,receiptId:t.id,receiptHash:t.contentHash,traceHash:t.traceHash,outputHash:t.outputHash,score:m.score,passed:m.passed,gradingStatus:m.gradingStatus,failureClass:m.failureClass,artifactCount:t.artifactRefs.length,latencyMs:t.latencyMs,costUsd:t.costUsd,terminal:t.terminal,feedback:m.components.map(f=>({graderId:f.graderId,graderVersion:f.graderVersion,score:f.score,passed:f.passed,feedback:f.feedback})),...e.receiptId?{receipt:t,evidence:await _({store:e.store,profileRef:e.profileRef,manifest:i,receipt:t,eventAfterId:e.eventAfterId,eventLimit:e.eventLimit})}:{}}}));return{runId:i.id,sourceRevision:i.profileEvaluation?.sourceRevision??null,cases:u}}R(D,"inspectProfileEvaluationRun");export{j as a,W as b,D as c};
|