openpond 0.2.66 → 0.2.67
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 +23 -0
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-YYZ3ZO3Q.js → acp-NASAJV5E.js} +1 -1
- package/dist/chunks/{acp-agent-T26S7TU2.js → acp-agent-C3CRF6DT.js} +1 -1
- package/dist/chunks/{actions-command-VLKMHCMI.js → actions-command-BYPLSGZL.js} +1 -1
- package/dist/chunks/{app-layer-5XUMNHDO.js → app-layer-XIEZ6ALX.js} +1 -1
- package/dist/chunks/{app-server-evaluations-V6LRWDUF.js → app-server-evaluations-5YZUFXQ2.js} +1 -1
- package/dist/chunks/{app-server-harness-services-6ZRLA3YD.js → app-server-harness-services-N5F5QVZI.js} +1 -1
- package/dist/chunks/{app-server-runtime-TH56EG2Z.js → app-server-runtime-HJ2N57DL.js} +1 -1
- package/dist/chunks/{apps-MNT3KXIY.js → apps-WJTW64NW.js} +1 -1
- package/dist/chunks/{chunk-ZWW227M3.js → chunk-263WS3TB.js} +1 -1
- package/dist/chunks/{chunk-HX6GXMDK.js → chunk-26ID6A5C.js} +1 -1
- package/dist/chunks/{chunk-DSJZS77R.js → chunk-2RSGVLZT.js} +4 -4
- package/dist/chunks/{chunk-L4EJ5R3B.js → chunk-2UZHLO2V.js} +1 -1
- package/dist/chunks/{chunk-QYQZQVVN.js → chunk-375PADDM.js} +1 -1
- package/dist/chunks/{chunk-FUFI4THX.js → chunk-43QYVOYA.js} +1 -1
- package/dist/chunks/{chunk-H5ML7735.js → chunk-46RMTR2Z.js} +1 -1
- package/dist/chunks/{chunk-Z2TOBS3P.js → chunk-4B7EGNYX.js} +1 -1
- package/dist/chunks/{chunk-2GJD23CM.js → chunk-4EZI4KCT.js} +1 -1
- package/dist/chunks/{chunk-DMO3UIS7.js → chunk-4JJ4RYIB.js} +1 -1
- package/dist/chunks/{chunk-JKI53ED7.js → chunk-4NN5OLKW.js} +2 -2
- package/dist/chunks/{chunk-66HFW4OU.js → chunk-4VZJQRQI.js} +1 -1
- package/dist/chunks/{chunk-7PKTCMZ6.js → chunk-543QHE3D.js} +1 -1
- package/dist/chunks/{chunk-TVDZXDQW.js → chunk-5QOFUGYQ.js} +1 -1
- package/dist/chunks/{chunk-6S2MWJVD.js → chunk-5TPYBXWM.js} +1 -1
- package/dist/chunks/{chunk-WLZJOCLA.js → chunk-5ZNE43XC.js} +1 -1
- package/dist/chunks/{chunk-KOKBDIGR.js → chunk-6HQUIKC5.js} +1 -1
- package/dist/chunks/{chunk-3BJ7LPE3.js → chunk-6IS5OLI5.js} +1 -1
- package/dist/chunks/{chunk-VS3AMJEK.js → chunk-6LFTQBXP.js} +1 -1
- package/dist/chunks/{chunk-VD2TQCMH.js → chunk-7HAGSE7L.js} +1 -1
- package/dist/chunks/{chunk-NTM3KQ25.js → chunk-ADOCQA4D.js} +1 -1
- package/dist/chunks/{chunk-4D3CICBG.js → chunk-ATFV2NA4.js} +1 -1
- package/dist/chunks/{chunk-YU4JYWCA.js → chunk-AXO6OHJB.js} +1 -1
- package/dist/chunks/{chunk-5KJMFK65.js → chunk-AXYAEWWA.js} +1 -1
- package/dist/chunks/{chunk-Q4AXZY2P.js → chunk-B2K5WQZE.js} +1 -1
- package/dist/chunks/{chunk-ANG2YMMD.js → chunk-B7XJBP4U.js} +1 -1
- package/dist/chunks/{chunk-BQVB2SPF.js → chunk-BBIA24GD.js} +6 -6
- package/dist/chunks/{chunk-CYQLXS2U.js → chunk-BUZ7CBJC.js} +1 -1
- package/dist/chunks/{chunk-MVPKU72J.js → chunk-CJDGLPNX.js} +1 -1
- package/dist/chunks/{chunk-ZU3YBRXS.js → chunk-CSU7RDA5.js} +1 -1
- package/dist/chunks/{chunk-JLW5BQVO.js → chunk-CWAQOFLP.js} +1 -1
- package/dist/chunks/{chunk-WKHGXLJD.js → chunk-CX7HKSQ4.js} +2 -2
- package/dist/chunks/{chunk-M5QPL5NO.js → chunk-D5OFN47Z.js} +1 -1
- package/dist/chunks/{chunk-QCJY6FTC.js → chunk-FCXDPVGJ.js} +1 -1
- package/dist/chunks/{chunk-FEQ7HNJR.js → chunk-FE2ENE3U.js} +1 -1
- package/dist/chunks/{chunk-6TRVEA3T.js → chunk-FVK4W27G.js} +1 -1
- package/dist/chunks/{chunk-7FBWUVX7.js → chunk-GC6RJBRZ.js} +1 -1
- package/dist/chunks/{chunk-5Z3AU5CL.js → chunk-H2XG5N7D.js} +1 -1
- package/dist/chunks/chunk-H6EUFJJK.js +2 -0
- package/dist/chunks/{chunk-V3S2B6WU.js → chunk-IDILAYCW.js} +1 -1
- package/dist/chunks/{chunk-PLVWARB7.js → chunk-IF5A3XWP.js} +1 -1
- package/dist/chunks/chunk-IHAEZ73V.js +2 -0
- package/dist/chunks/{chunk-GDJ4X2ZN.js → chunk-IR2Y2VQY.js} +1 -1
- package/dist/chunks/{chunk-WBO6FQHR.js → chunk-IXZ5ZGIL.js} +1 -1
- package/dist/chunks/{chunk-67HXM6AL.js → chunk-K3LS5SK7.js} +1 -1
- package/dist/chunks/{chunk-4MQHIFZL.js → chunk-K6DB5QWG.js} +1 -1
- package/dist/chunks/{chunk-QJJNHKLT.js → chunk-KQD36SBJ.js} +1 -1
- package/dist/chunks/{chunk-LXZLLTYQ.js → chunk-LI56PPCN.js} +1 -1
- package/dist/chunks/{chunk-KAWXVMHI.js → chunk-MX7KV5DA.js} +1 -1
- package/dist/chunks/{chunk-LARJARMS.js → chunk-N54CPLVD.js} +1 -1
- package/dist/chunks/{chunk-JRGECNP3.js → chunk-OE2OOWEQ.js} +1 -1
- package/dist/chunks/{chunk-B32CW3NT.js → chunk-OY4B7Y3T.js} +1 -1
- package/dist/chunks/chunk-OYIFH2OM.js +2 -0
- package/dist/chunks/{chunk-C5B3FMV3.js → chunk-P6NQYXN6.js} +1 -1
- package/dist/chunks/{chunk-D7R2AAX2.js → chunk-QFL2VQKX.js} +1 -1
- package/dist/chunks/{chunk-Y3B6ZUE6.js → chunk-QOUOU7FE.js} +1 -1
- package/dist/chunks/{chunk-GIU3Z45P.js → chunk-QQLS5FB7.js} +1 -1
- package/dist/chunks/chunk-R5GRESW3.js +2 -0
- package/dist/chunks/{chunk-6ZTP6CUJ.js → chunk-R6MMWEH4.js} +1 -1
- package/dist/chunks/{chunk-XHBMK6LC.js → chunk-R6VI7MX5.js} +1 -1
- package/dist/chunks/{chunk-GFAI2MCJ.js → chunk-RS526BG7.js} +1 -1
- package/dist/chunks/{chunk-EVQISX7M.js → chunk-RWRKUO5D.js} +1 -1
- package/dist/chunks/{chunk-DXA2UHBE.js → chunk-SD2XDZQW.js} +1 -1
- package/dist/chunks/{chunk-S6UCVXBC.js → chunk-SODAOLAP.js} +1 -1
- package/dist/chunks/{chunk-UK5LGSGT.js → chunk-SVNEPXU3.js} +1 -1
- package/dist/chunks/{chunk-5WPMI6QX.js → chunk-TERKCK4I.js} +1 -1
- package/dist/chunks/{chunk-OKEC2EIE.js → chunk-TS5HNRZB.js} +1 -1
- package/dist/chunks/{chunk-5KWKSR4P.js → chunk-TSQ2I6XV.js} +1 -1
- package/dist/chunks/{chunk-YRDPVTEI.js → chunk-TV2LE2BD.js} +1 -1
- package/dist/chunks/chunk-U3MVH2YT.js +2 -0
- package/dist/chunks/{chunk-FS2VKOT7.js → chunk-UBTP3QWI.js} +1 -1
- package/dist/chunks/{chunk-7XOUM6RK.js → chunk-UKSSFB4Q.js} +1 -1
- package/dist/chunks/{chunk-W7NXFRHN.js → chunk-UNE52L3Y.js} +1 -1
- package/dist/chunks/{chunk-ZUT4EM64.js → chunk-UXO33ST5.js} +1 -1
- package/dist/chunks/{chunk-FHLSLOKH.js → chunk-V3ILZQER.js} +1 -1
- package/dist/chunks/chunk-V3T2OJBZ.js +33 -0
- package/dist/chunks/{chunk-QAEZNFAM.js → chunk-V5AOM5MZ.js} +1 -1
- package/dist/chunks/{chunk-LI3FTPAH.js → chunk-VEXJV5H5.js} +1 -1
- package/dist/chunks/{chunk-AF3AVDPP.js → chunk-VPAEFG7X.js} +1 -1
- package/dist/chunks/{chunk-NABPZ7AK.js → chunk-W3ZILZUL.js} +1 -1
- package/dist/chunks/{chunk-U2BD545L.js → chunk-WD6ANOLL.js} +1 -1
- package/dist/chunks/{chunk-OTUS7NTQ.js → chunk-WDKZMXIU.js} +1 -1
- package/dist/chunks/chunk-WGISITX6.js +4 -0
- package/dist/chunks/{chunk-55Q64WWF.js → chunk-XD4ZIQZ2.js} +1 -1
- package/dist/chunks/{chunk-W22KWKF6.js → chunk-XDFXKRTI.js} +1 -1
- package/dist/chunks/{chunk-GRLQHYAU.js → chunk-XEU4J4GJ.js} +1 -1
- package/dist/chunks/{chunk-IEVJLG3V.js → chunk-XGJG2ZKE.js} +1 -1
- package/dist/chunks/chunk-XHU4BZQY.js +13 -0
- package/dist/chunks/{chunk-DIDQHTAX.js → chunk-XKZ4PFMQ.js} +1 -1
- package/dist/chunks/{chunk-B666Z2NS.js → chunk-XT5WUQGT.js} +1 -1
- package/dist/chunks/{chunk-UXPO3ZV7.js → chunk-YKTJPCYZ.js} +3 -3
- package/dist/chunks/{chunk-5AU5Y6KS.js → chunk-YMCF5GR2.js} +1 -1
- package/dist/chunks/{chunk-LYVHYT3L.js → chunk-YONDU5TN.js} +1 -1
- package/dist/chunks/{chunk-BTJACFU3.js → chunk-YQBL5P6R.js} +1 -1
- package/dist/chunks/{chunk-SAZTOGX6.js → chunk-YR5URT73.js} +1 -1
- package/dist/chunks/{chunk-OXRVILDW.js → chunk-ZVMQLIRA.js} +1 -1
- package/dist/chunks/{chunk-MHPCVQOE.js → chunk-ZWEY66RT.js} +1 -1
- package/dist/chunks/cli-HV32F7HD.js +2 -0
- package/dist/chunks/command-NWOZXU57.js +58 -0
- package/dist/chunks/{configuration-command-4WTS2MZS.js → configuration-command-ZEIBQKB3.js} +1 -1
- package/dist/chunks/{connected-app-executor-7DYMZCD7.js → connected-app-executor-DFHWNMRM.js} +1 -1
- package/dist/chunks/{connected-evidence-D7C45HYD.js → connected-evidence-WOM6N5HO.js} +1 -1
- package/dist/chunks/{connected-starting-assets-4LDXQVLN.js → connected-starting-assets-66Y46ZPM.js} +1 -1
- package/dist/chunks/{continual-HQCFY7GN.js → continual-TNPTWTKK.js} +1 -1
- package/dist/chunks/{core-commands-RXPXOYOP.js → core-commands-GWRHH53F.js} +1 -1
- package/dist/chunks/{dataset-preparation-authoring-KWRTMKN6.js → dataset-preparation-authoring-WJ2XEUO7.js} +1 -1
- package/dist/chunks/{datasets-LBLEKLCS.js → datasets-XIMF54QN.js} +1 -1
- package/dist/chunks/{desktop-test-INJPZ5VP.js → desktop-test-HF42V2EP.js} +1 -1
- package/dist/chunks/dist-T6ES2TSM.js +2 -0
- package/dist/chunks/{evaluation-coordination-3ARLJAFH.js → evaluation-coordination-WZT6FDMS.js} +1 -1
- package/dist/chunks/{experiment-improvements-UB4C5CSP.js → experiment-improvements-H35VS6XZ.js} +1 -1
- package/dist/chunks/{experiments-AHHKFJD6.js → experiments-F54C32EE.js} +1 -1
- package/dist/chunks/{experiments-signal-MTR475QV.js → experiments-signal-ONIGTGYR.js} +1 -1
- package/dist/chunks/{help-JQA3YMCX.js → help-O53DTZGN.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-LMCJ3MDJ.js +2 -0
- package/dist/chunks/{host-profile-external-dataset-YRKG2GL5.js → host-profile-external-dataset-4HOXANWK.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-GPXH3BOG.js → hosted-app-server-composition-Y64A2A2B.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-NZTPZTDH.js → hosted-experiment-improvement-B2V2WIUI.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-C7I4KSDK.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-3CAT3XBI.js → hosted-profile-candidate-CXPVEEYQ.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-RXU626Q6.js → hosted-profile-compiler-FGCI2VRW.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-control-CBDRKJ5J.js → hosted-profile-evaluation-control-INNUYMBD.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-CHYKDYUQ.js → hosted-profile-evaluation-inspection-UPTBRYMS.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-H5S7JZMD.js → hosted-profile-evaluation-preparation-TIQSVKLQ.js} +1 -1
- package/dist/chunks/{hosted-tasksets-AMGDDB2R.js → hosted-tasksets-7VMYOTIO.js} +1 -1
- package/dist/chunks/{human-review-DVHVJXBA.js → human-review-7XC77NQP.js} +1 -1
- package/dist/chunks/{import-CLWTKDG6.js → import-OBAKUJPM.js} +1 -1
- 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-3XDGIYUL.js +2 -0
- package/dist/chunks/{learning-XTY5VOTK.js → learning-CRR6NRPN.js} +1 -1
- package/dist/chunks/{local-harness-improvement-runtime-XEA73RGS.js → local-harness-improvement-runtime-UIKQSAMM.js} +1 -1
- package/dist/chunks/{local-harness-taskset-review-SW35G4DM.js → local-harness-taskset-review-6KJN3EQL.js} +1 -1
- package/dist/chunks/{model-projects-GHWCKDON.js → model-projects-HP4DELCP.js} +1 -1
- package/dist/chunks/{opchat-LMKH3OWR.js → opchat-NWYWWIA7.js} +1 -1
- package/dist/chunks/{opchat-bounded-chat-PPOWO7H4.js → opchat-bounded-chat-ICURZM6R.js} +1 -1
- package/dist/chunks/{organizations-T6ZUSHNJ.js → organizations-7DBQGCCV.js} +1 -1
- package/dist/chunks/{profile-RIDNU2I5.js → profile-3WZJ65CT.js} +1 -1
- package/dist/chunks/{project-action-payload-2G57RL74.js → project-action-payload-7DRABTHY.js} +1 -1
- package/dist/chunks/{project-agent-GBMVDJY3.js → project-agent-AXJOWXRU.js} +1 -1
- package/dist/chunks/{published-experiment-source-D3C2AWQD.js → published-experiment-source-YBBPLNF2.js} +1 -1
- package/dist/chunks/{refiner-profile-service-PPGGNVOV.js → refiner-profile-service-ATEFPF5O.js} +1 -1
- package/dist/chunks/{runtime-VSOOPNYN.js → runtime-XP4DEGR3.js} +1 -1
- package/dist/chunks/{sandbox-command-L5VQ2T6C.js → sandbox-command-CF2PJCFX.js} +1 -1
- package/dist/chunks/{sandbox-template-NN3XQI7M.js → sandbox-template-YFMHEMUQ.js} +1 -1
- package/dist/chunks/{saved-work-LAVTNKPT.js → saved-work-3OAVRBH3.js} +1 -1
- package/dist/chunks/setup-RHIMFI2Y.js +2 -0
- package/dist/chunks/{src-662QOKNP.js → src-GQPWOPYA.js} +1 -1
- package/dist/chunks/{src-HJHIBDFX.js → src-V236S6MV.js} +112 -112
- package/dist/chunks/{standalone-experiment-turn-owner-KKYIGGPF.js → standalone-experiment-turn-owner-CDRMGLWW.js} +1 -1
- package/dist/chunks/{store-chat-resources-ZWDYMDJF.js → store-chat-resources-P4EKCLSY.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-7PDLGRWF.js → store-continual-support-reviews-VVRQO2JK.js} +1 -1
- package/dist/chunks/{store-conversation-serving-WRT4N7N2.js → store-conversation-serving-YFEZYQD3.js} +1 -1
- package/dist/chunks/{store-create-improve-G46KIUVT.js → store-create-improve-2XI36AET.js} +1 -1
- package/dist/chunks/{store-datasets-O67F75BL.js → store-datasets-UFY422NG.js} +1 -1
- package/dist/chunks/{store-evaluation-results-BEPR4LVD.js → store-evaluation-results-VBH4R2U7.js} +1 -1
- package/dist/chunks/{store-harness-workspaces-PJJQ74G6.js → store-harness-workspaces-SGUEYDO2.js} +1 -1
- package/dist/chunks/{store-human-review-HJ3D7ZFA.js → store-human-review-RFCVZ3HP.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-EXNRDHCO.js → store-learned-preference-migration-validation-FNBGGZU6.js} +1 -1
- package/dist/chunks/{store-learning-6P6IS7GH.js → store-learning-BFOT4QVT.js} +1 -1
- package/dist/chunks/{store-learning-credentials-EGJ2WTZI.js → store-learning-credentials-DYTMWQTC.js} +1 -1
- package/dist/chunks/{store-local-experiments-CBJA56X2.js → store-local-experiments-XPXGYXNM.js} +1 -1
- package/dist/chunks/{store-model-batch-review-YIVD7T2T.js → store-model-batch-review-J2L5JQV2.js} +1 -1
- package/dist/chunks/{store-model-configuration-T6XJJDAB.js → store-model-configuration-NJFWSYSA.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-WWU5CJTV.js → store-model-project-preparation-OCLIFKI2.js} +1 -1
- package/dist/chunks/{store-preference-comparison-XQFTLMGH.js → store-preference-comparison-MZAYONCK.js} +1 -1
- package/dist/chunks/{store-task-inbox-VVXZUJIO.js → store-task-inbox-3BREANOX.js} +1 -1
- package/dist/chunks/{store-task-inventory-MQX44AI6.js → store-task-inventory-5HRZCDUT.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-G3WFVN4M.js → store-taskset-drafts-BNKUVHPA.js} +1 -1
- package/dist/chunks/{store-training-DUVIDYK5.js → store-training-S3FXWLT6.js} +1 -1
- package/dist/chunks/{store-training-jobs-HHFH3V5O.js → store-training-jobs-2LCXPA7G.js} +1 -1
- package/dist/chunks/{store-training-models-C7UUZDTO.js → store-training-models-7AMKS7ZW.js} +1 -1
- package/dist/chunks/{taskset-7FQCJ55X.js → taskset-PLKWRT4X.js} +1 -1
- package/dist/chunks/{taskset-packages-NRRPON7B.js → taskset-packages-SXBLYHSP.js} +1 -1
- package/dist/chunks/{taskset-packages-RW4SFGDU.js → taskset-packages-V5T4V7YN.js} +1 -1
- package/dist/chunks/{teams-bot-FXMCOCPP.js → teams-bot-VQXUA7U4.js} +1 -1
- package/dist/chunks/{tool-learning-O7QTTEDB.js → tool-learning-47XQKELE.js} +1 -1
- package/dist/chunks/{training-XFM3OOPN.js → training-7VQNCOGH.js} +1 -1
- package/dist/chunks/{training-XILDD5RG.js → training-VKLPNCMC.js} +1 -1
- package/dist/chunks/{training-hosted-6BX2IASC.js → training-hosted-NNE6BP6S.js} +1 -1
- package/dist/chunks/training-hosted-checkpoint-evaluation-2X7RSOLC.js +2 -0
- package/dist/chunks/{training-hosted-learning-YN5VD3PW.js → training-hosted-learning-WQ2IP5FP.js} +1 -1
- package/dist/chunks/training-hosted-report-T633TNJG.js +2 -0
- package/dist/chunks/training-hosted-serving-report-VZ4SMLMG.js +2 -0
- package/dist/chunks/training-hosted-workers-Y2PO5IOA.js +2 -0
- package/dist/chunks/{training-model-start-E5MP3URL.js → training-model-start-G7YDZ7ZG.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/skills/manifest.json +1 -1
- package/dist/web/assets/App-DmEA-Lia.js +53 -0
- package/dist/web/assets/{AppDialog-DuSd0wk6.js → AppDialog-BvskhHE9.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-ScQKJV4z.js +2 -0
- package/dist/web/assets/{AppToastContext-Dklk6CaG.js → AppToastContext-D2788RqX.js} +1 -1
- package/dist/web/assets/AppsView-B1uNg9IQ.js +1 -0
- package/dist/web/assets/{AppsView-DNHWzJb2.css → AppsView-D3vVesNd.css} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-DipNT6Tj.js → AttachmentTypeIcon-DVluUHuc.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BBaaanMS.js → BrowserSidebar-DfVQoJHn.js} +1 -1
- package/dist/web/assets/{CartesianChart-UU1sdoUO.js → CartesianChart-DdBZ69lI.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-Ct59FKw1.js → ChatTimelineEntry-Bbc6HRks.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BWYRQ1PE.js → CollaborationTabs-ba6WupeJ.js} +1 -1
- package/dist/web/assets/{CommandMenu-B08F9x5g.js → CommandMenu-D7wTaEgl.js} +1 -1
- package/dist/web/assets/{CommunityView-BLTlSxyb.js → CommunityView-mO58f2B0.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-srWBKvCv.js → ComposerAttachments-aO90qXYz.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DqTpU5cO.js → ComposerCreateImproveStrip-BPUJBSyS.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-2KC-KQvu.js → ConversationImportsSettings-Bo836wKJ.js} +1 -1
- package/dist/web/assets/{FilePagePreview-B-iUVPhh.js → FilePagePreview-C6wIp6uX.js} +2 -2
- package/dist/web/assets/{GetStartedView-5v0vBWXy.js → GetStartedView-CxMv8q-h.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-Bn4072K-.js → GettingStartedDialog-CEb0cS-o.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DWF6WPao.js → HostedModelLearningReview-BQIS7hkd.js} +1 -1
- package/dist/web/assets/HostedModelLearningSettings-BQ-YeFMT.js +1 -0
- package/dist/web/assets/{HtmlVisual-C2WsMj90.js → HtmlVisual-CCuUkYT8.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-CQz29DwD.js → LabModelVersionDetailPage-BkHeVbAx.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-C50P74LI.js → LabSkillSidebar-CFROlATQ.js} +1 -1
- package/dist/web/assets/LabsRoute-YA9YckKj.js +101 -0
- package/dist/web/assets/MainChatThread-DpyPgGKW.js +2 -0
- package/dist/web/assets/{MainPane-Dje-hfUM.css → MainPane-BOWkynGB.css} +1 -1
- package/dist/web/assets/MainPane-WOeodByM.js +10 -0
- package/dist/web/assets/NativeSetupTerminal-fmG2c65K.js +2 -0
- package/dist/web/assets/{NativeSkillSidebar-Clv0IWyn.js → NativeSkillSidebar-MAJWS4mL.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-Cw_F5Eaa.js → NewProjectDialog-MQiUBVx3.js} +1 -1
- package/dist/web/assets/{OutputsPage-Btyiie4B.js → OutputsPage-DpF-aRTu.js} +1 -1
- package/dist/web/assets/{PageChrome-BLLw_cEA.js → PageChrome-8gH2hyDb.js} +1 -1
- package/dist/web/assets/{ProjectsPage-BpSHWQgj.js → ProjectsPage-BQ98oGyu.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-xW5rKbp0.js → RightChatPanelStack-Bs7A4dLs.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-C-D4kba2.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-WytWGQgw.js → ScheduledWorkPage-CGCqZz_H.js} +1 -1
- package/dist/web/assets/{SettingsView-BJq5zNkv.js → SettingsView-CqpMFLxy.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-BxFEWI9W.js → TasksetDraftEditorPrimitives-DJvIvzBb.js} +1 -1
- package/dist/web/assets/{TeamChatView-BisSMAXy.js → TeamChatView-DjmIaLO1.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-C7OM2F0-.js → TerminalOverlay-D--M876l.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-KH5GFacT.js → TrainingCreationPanel-DDUoHQHU.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-DzOw13Md.js → TrainingDraftPanel-CwLXn3Z7.js} +1 -1
- package/dist/web/assets/{TrainingRunLineage-B2WBOchk.js → TrainingRunLineage-CtYe1KGX.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-nZHno_4P.js → UsageSettingsSection-CGwPregx.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-C6wWuo7U.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-CyTa8Cjs.js → WorkspaceDiffPanel-JDOUmrC-.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-CtZzxQ1e.js → WorkspaceEnvironmentMenu-sfL5LZeB.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-1U8DDj1J.js → WorkspaceFileLocation-D-ctFM4d.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-BO1EUA3G.js → WorkspaceGitDialogs-CQ28j3R7.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-Rqq_sKW_.js → WorkspaceMonacoEditor-BrZs6-EW.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-zmmMp09R.js → WorkspacePdfPreview-CU6PSjjN.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DNbhGjkE.js → WorkspacePresentationPreview-IjXVXpIy.js} +1 -1
- package/dist/web/assets/{app-models-Cz3yxq4x.js → app-models-CKXrDTEU.js} +1 -1
- package/dist/web/assets/{bot-D-eTQib6.js → bot-Cd761lRF.js} +1 -1
- package/dist/web/assets/{browser-sidebar-links-ZyYiYBBd.js → browser-sidebar-links-D9v2cyJa.js} +1 -1
- package/dist/web/assets/chat-resources-BUDXdoG0.js +1 -0
- package/dist/web/assets/{chevron-down-75im8nFF.js → chevron-down-DEbd6Ek-.js} +1 -1
- package/dist/web/assets/chevron-right-DLYNg_Oq.js +1 -0
- package/dist/web/assets/{chevron-up-BD8jg0bQ.js → chevron-up-DFJJccDl.js} +1 -1
- package/dist/web/assets/chunk-GHPCQXG5-DKDBSd8H.js +9 -0
- package/dist/web/assets/chunk-GJRXJL6G-luaxRTYI.js +1 -0
- package/dist/web/assets/chunk-H3JZ3P5T-CzpTARDY.js +2 -0
- package/dist/web/assets/chunk-JDQVAG3R-C0-rh1aR.js +1 -0
- package/dist/web/assets/chunk-TLSP5JKG-BrrVo5rJ.js +1 -0
- package/dist/web/assets/chunk-XMVSQIK4-BBU7r_NH.js +1 -0
- package/dist/web/assets/client-BNjO4Xi8.js +1 -0
- package/dist/web/assets/{client-choice-storage-CXlWJW5g.js → client-choice-storage-DUWsS4X0.js} +1 -1
- package/dist/web/assets/{cloud-upload-4lP-5zmp.js → cloud-upload-CoM1FGeB.js} +1 -1
- package/dist/web/assets/{common-BMjyKlX-.js → common-CFsO2ppZ.js} +1 -1
- package/dist/web/assets/{copy-DRnATDDY.js → copy-BGOhV6Pk.js} +1 -1
- package/dist/web/assets/{create-pipeline-CyUZrbbO.js → create-pipeline-DRR0Qeec.js} +1 -1
- package/dist/web/assets/{createLucideIcon-CmkSm39S.js → createLucideIcon-Bv-_eGcE.js} +1 -1
- package/dist/web/assets/{cssMode-Cps-05f3.js → cssMode-SclUkqPt.js} +1 -1
- package/dist/web/assets/{external-link-D_nBEDFO.js → external-link-CVXsNeO3.js} +1 -1
- package/dist/web/assets/{folder-open-tD5Lle1M.js → folder-open-MnOmh19D.js} +1 -1
- package/dist/web/assets/{folder-plus-DlZ4hM48.js → folder-plus-BRddLBtO.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-g8KBhvfr.js → git-commit-horizontal-Bm4rkXug.js} +1 -1
- package/dist/web/assets/{htmlMode-Do72TyNy.js → htmlMode-X3mQtOeh.js} +1 -1
- package/dist/web/assets/icons-CZxmQtZs.js +1 -0
- package/dist/web/assets/{image-CUZMnZYi.js → image-BViGUAiq.js} +1 -1
- package/dist/web/assets/{index-D7igQSAg.js → index-LXNhSUEL.js} +2 -2
- package/dist/web/assets/{info-SmuBZiE5.js → info-DYPIbKKD.js} +1 -1
- package/dist/web/assets/intake-contracts-wCkD2ErR.js +1 -0
- package/dist/web/assets/{jsonMode-B2N7W15Y.js → jsonMode-BoKiIdHd.js} +1 -1
- package/dist/web/assets/loader-circle-JFgFNsP5.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DPmyOFVA.js → lspLanguageFeatures-CO2mzpy1.js} +1 -1
- package/dist/web/assets/{maximize-2-B8HN3jsA.js → maximize-2-DXZCQO0b.js} +1 -1
- package/dist/web/assets/{message-square-CrDvzn66.js → message-square-cOCAL8J1.js} +1 -1
- package/dist/web/assets/{monaco.contribution-CRdTg0FH.js → monaco.contribution-C7CAQIKF.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BfOxF9PJ.js → monaco.contribution-CVe3mWSY.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DNONXznc.js → monaco.contribution-hrusiaZi.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DqqJBDzF.js → monaco.contribution-wacA5FjV.js} +2 -2
- package/dist/web/assets/{monitor-CW-M_aaj.js → monitor-B35XSAvn.js} +1 -1
- package/dist/web/assets/{paperclip-DL449Io5.js → paperclip-CKgDxioG.js} +1 -1
- package/dist/web/assets/{pdf-BCq2Oosd.js → pdf-Ct3M2mVw.js} +1 -1
- package/dist/web/assets/play-DzqLr7fM.js +1 -0
- package/dist/web/assets/plus-Ddp1vXnw.js +1 -0
- package/dist/web/assets/{ponder-desktop-Dm7tOkKo.js → ponder-desktop-D-zB6X4L.js} +1 -1
- package/dist/web/assets/{presentation-CupIXaYv.js → presentation-B0S9v7ib.js} +1 -1
- package/dist/web/assets/{profile-ref-DSNkG6Ol.js → profile-ref-CCxrOCio.js} +1 -1
- package/dist/web/assets/{python-DuGMr666.js → python-C0-pUUAU.js} +1 -1
- package/dist/web/assets/{refresh-cw-CzVf5_oo.js → refresh-cw-D45mW-vs.js} +1 -1
- package/dist/web/assets/{requests-BCbaFiqV.js → requests-DjSt-duM.js} +1 -1
- package/dist/web/assets/{reward-checks-Bcq9ETCA.js → reward-checks-D139zwha.js} +2 -2
- package/dist/web/assets/{save-DatjrYPV.js → save-Gu4R_82E.js} +1 -1
- package/dist/web/assets/schemas-C9IwV7NS.js +64 -0
- package/dist/web/assets/{settings-D7C-Auyi.js → settings-DdonLCIN.js} +1 -1
- package/dist/web/assets/settings-lists-CFHFtO0D.js +5 -0
- package/dist/web/assets/square-Dqduqyyu.js +1 -0
- package/dist/web/assets/{square-terminal-Buj-s-fz.js → square-terminal-DS3zwi6X.js} +1 -1
- package/dist/web/assets/{submit-issue-command-wfngGS6Y.js → submit-issue-command-Gk3RKrY-.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-cl0cw2QK.js → toggleHighContrast-BnYUBgZB.js} +1 -1
- package/dist/web/assets/training-QBuGBGJd.js +2 -0
- package/dist/web/assets/{training-model-data-CWnu1bz9.js → training-model-data-CxR3xpmK.js} +1 -1
- package/dist/web/assets/{tsMode-DLEc0PYL.js → tsMode-BVNyOY8h.js} +1 -1
- package/dist/web/assets/{upload-DaFVH6R1.js → upload-ABSJxuUM.js} +1 -1
- package/dist/web/assets/{useAccountSettings-ByxjI9BG.js → useAccountSettings-4_XfwJQi.js} +1 -1
- package/dist/web/assets/{useAgentInventory-Df64T07n.js → useAgentInventory-CVuamyT3.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-DNh_x9gQ.js → useLocalAgentSchedules-CmwN4ohy.js} +1 -1
- package/dist/web/assets/{useQuery-yUz7Ui8g.js → useQuery-CCjwL8VI.js} +1 -1
- package/dist/web/assets/{wifi-off-CtNwnIJc.js → wifi-off-DGJH7Pke.js} +1 -1
- package/dist/web/assets/{work-outputs-CK0nHe4g.js → work-outputs-CnbRtTLg.js} +1 -1
- package/dist/web/assets/{workers-CnqrOtic.js → workers-CjtQ2aBD.js} +1 -1
- package/dist/web/assets/x-B-_zJVOZ.js +1 -0
- package/dist/web/assets/{yaml-C9vtYV4w.js → yaml-N1KUjBZ8.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +7 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-2ZNW6GUU.js +0 -2
- package/dist/chunks/chunk-3MVKXAH7.js +0 -2
- package/dist/chunks/chunk-G4E3WGLM.js +0 -13
- package/dist/chunks/chunk-I3NYYOSS.js +0 -2
- package/dist/chunks/chunk-JBFPTEVE.js +0 -2
- package/dist/chunks/chunk-OW3EOC5Q.js +0 -4
- package/dist/chunks/chunk-SBQ6KLXB.js +0 -33
- package/dist/chunks/chunk-YBKDEEEH.js +0 -2
- package/dist/chunks/cli-TE7RP5H7.js +0 -2
- package/dist/chunks/command-NW6BGKOM.js +0 -13
- package/dist/chunks/dist-J4KHAVO3.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-75EPCRSZ.js +0 -2
- package/dist/chunks/hosted-harness-runtime-3AJGEIFD.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/setup-TXEM2QSG.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/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/HostedModelLearningSettings-BYl-2j7B.js +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/RightSidebarHomePanel-BDmIxvIm.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-D3Ub_jVj.js +0 -1
- package/dist/web/assets/chat-resources-CTN4f6KC.js +0 -1
- package/dist/web/assets/chevron-right-CpbCIUFo.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/contracts-BLiqJxBv.js +0 -1
- package/dist/web/assets/icons-B8_Rkg-l.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/play-DYLqBrwg.js +0 -1
- package/dist/web/assets/plus-DXZIpQuY.js +0 -1
- package/dist/web/assets/schemas-lO3MoWQr.js +0 -64
- package/dist/web/assets/settings-lists-D2ol3uNK.js +0 -5
- package/dist/web/assets/square-BWB1nbZF.js +0 -1
- package/dist/web/assets/training-DCdoHJ0Y.js +0 -2
- package/dist/web/assets/x-Bhl-4Zlt.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as De,b as te,c as Ee,e as qe,g as Ce,h as G,k as de}from"./chunk-2UZHLO2V.js";import{A as oe,C as O,D as Ie,F as He,H as _e,I as A,J as Be,L as W,M as Me,N as ee,O as S,P as je,X as ce,Z as Ae,_ as J,l as Se,s as ye,t as Pe}from"./chunk-TV2LE2BD.js";import{h as re,k as Te,l as xe}from"./chunk-TERKCK4I.js";import{A as ke,K as v,L as V,M as j,N as ve,P as we,R as D,ca as F,ia as Re,k as $,l as U,o as L,ob as ie,pb as ne,qb as be,s as Q,v as K,y as Z}from"./chunk-XHU4BZQY.js";import{$a as ge,Aa as _,Wa as fe,_a as he,ab as X,bb as Y}from"./chunk-ZY32SZ2P.js";import{m as ue,n as f}from"./chunk-RCT3O3HQ.js";import{A as c}from"./chunk-X2J2P5ZT.js";import{a as b}from"./chunk-FTQLQJQV.js";function Ke(s){let t=S(s.source);if(t.modelResources||t.learningResources)throw new Error("Binding an ordinary Reward requires an ordinary source package.");let a=ee(t);if(!a.trim())throw new Error("Add collection instructions before selecting a saved Reward.");let e=new Map,i=Ie(t);for(let g of i?.assets??[])e.set(g.id,g);let r=new Set([...t.taskset.tasks.flatMap(g=>g.privilegedContextRef?[g.privilegedContextRef]:[]),...[t.environment.actionSchemaRef,t.environment.observationSchemaRef,t.environment.stateSchemaRef].flatMap(g=>g?[g.id]:[])]);for(let g of r){if(e.has(g))continue;let H=t.files.find(q=>q.asset.id===g);if(!H)throw new Error(`Source Taskset context is missing: ${g}.`);let y=new TextDecoder("utf-8",{fatal:!0}).decode(O(H));e.set(g,we.parse(j({schemaVersion:"openpond.learningTextAsset.v1",id:g,revision:1,asset:H.asset,text:y})))}for(let g of s.assets){let H=t.files.find(y=>y.asset.id===g.id);if(H&&j({asset:H.asset}).contentHash!==j({asset:g.asset}).contentHash)throw new Error(`Selected Reward conflicts with a source asset: ${g.id}.`);e.set(g.id,g)}let{policy:p,environment:o,environmentRelease:k,tools:w,capabilities:n,verifierSetRelease:R}=t.taskset,m=t.taskset.metadata.tasksetOutputContract,x=m&&typeof m=="object"&&!Array.isArray(m)&&"mode"in m&&m.mode==="structured_json"?"jsonSchema"in m?m.jsonSchema:null:{type:"object"},l=L.parse(j({schemaVersion:"openpond.taskDefinition.v1",id:`${t.taskset.id}-definition`,revision:1,name:t.taskset.id,description:"",instructions:a,category:"custom",familyNamespace:t.taskset.id,inputSchema:{type:"object"},outputSchema:x,rewardBinding:v(s.rewardBinding),harness:null,execution:{policy:p,environment:o,environmentRelease:k,tools:w,capabilities:n,verifierSetRelease:R}})),I=Se({...s,assets:[...e.values()],source:{taskset:t.taskset,taskDefinition:l,instructionMode:"per_task",executionResources:{environment:t.environment,verifierSet:t.verifierSet},...i?{execution:i.execution}:{}}}),u=new Map(t.files.map(g=>[g.asset.id,g]));for(let g of I.assets){let H="";for(let y of new TextEncoder().encode(g.text))H+=String.fromCharCode(y);u.set(g.id,{asset:g.asset,base64:btoa(H)})}let{taskset:h,executionResources:M,...E}=I;return je({schemaVersion:"openpond.tasksetPackage.v1",taskset:h,...M,modelResources:E,files:[...u.values()]})}b(Ke,"bindOrdinaryModelTasksetReward");var B=c.string().trim().min(1).max(500),N=c.string().regex(/^[a-f0-9]{64}$/),We=Te.pick({portableProjectId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,sourceRevision:!0,sourceUpdatedAt:!0}).extend({trainingSetup:re.omit({tasksetRef:!0,rewardBindingRef:!0,tasksetRelease:!0})}).strict(),Je=c.object({schemaVersion:c.literal("openpond.tasksetPackagePublication.v1"),operationId:B,modelProjectId:B,expectedProjectEtag:N.nullable(),name:c.string().trim().min(1).max(200),description:c.string().max(5e3),buildIntent:c.enum(["demonstrations","preferences","verifiable_reward","rubric","discovery"]),methodHint:c.enum(["sft","dpo","grpo","ppo"]).nullable(),package:W,modelConfiguration:We.optional(),evaluationPackage:W.optional(),selection:c.enum(["select","attach"]).optional()}).strict().refine(s=>s.selection!=="attach"||s.modelConfiguration===void 0,"Attachment-only publication cannot replace Model configuration.").refine(s=>!s.evaluationPackage||s.modelConfiguration!==void 0&&s.modelConfiguration.trainingSetup.evaluationTasksetRef!=null&&f(s.modelConfiguration.trainingSetup.evaluationTasksetRef)===f(v(s.evaluationPackage.taskset)),"Evaluation package must match the selected immutable evaluation in Model configuration."),Xe=c.object({schemaVersion:c.literal("openpond.tasksetPackageReceipt.v1"),teamId:B,modelProjectId:B,operationId:B,taskset:G,packageHash:N,hostedTasksetId:B,projectEtag:N,project:xe.optional(),selection:c.enum(["select","attach"]).optional(),evaluation:c.object({taskset:G,packageHash:N,hostedTasksetId:B}).strict().optional()}).strict(),Ye=c.object({schemaVersion:c.literal("openpond.tasksetPackageReadback.v1"),teamId:B,modelProjectId:B,package:W}).strict(),Qe=c.object({schemaVersion:c.literal("openpond.tasksetReleasePackageReadback.v1"),teamId:B,release:G,package:W}).strict(),P=class extends Error{constructor(a,e,i){super(i);this.status=a;this.code=e;this.name="OpenPondTasksetPackageError"}status;code;static{b(this,"OpenPondTasksetPackageError")}},$e=class{static{b(this,"OpenPondTasksetPackageClient")}#e;constructor(t){let a=new URL(t.baseUrl);if(!["http:","https:"].includes(a.protocol)||a.username||a.password||a.search||a.hash||!t.apiKey.trim()||!t.teamId.trim())throw new Error("Taskset package client requires a clean HTTP(S) endpoint and workspace credentials.");this.#e={...t,baseUrl:a.toString().replace(/\/+$/,"")}}async publish(t,a={}){let e=Je.parse(t);S(e.package),e.evaluationPackage&&S(e.evaluationPackage);let{evaluationPackage:i,...r}=e,p=i?.contentHash===e.package.contentHash?r:e,o=Xe.parse(await this.#t("","POST",p,a.signal)),k=e.package.taskset;if(o.teamId!==this.#e.teamId||o.modelProjectId!==e.modelProjectId||o.operationId!==e.operationId||o.packageHash!==e.package.contentHash||o.taskset.id!==k.id||o.taskset.revision!==k.revision||o.taskset.contentHash!==k.contentHash)throw new P(502,"package_receipt_mismatch","Taskset publication receipt did not match the requested package and owner.");if(e.selection!==void 0&&o.selection!==e.selection)throw new P(502,"package_receipt_mismatch","Taskset publication did not retain its selection mode.");if(e.evaluationPackage&&(!o.evaluation||o.evaluation.packageHash!==e.evaluationPackage.contentHash||f(o.evaluation.taskset)!==f(v(e.evaluationPackage.taskset))))throw new P(502,"package_receipt_mismatch","Taskset publication did not retain the complete selected evaluation package.");if(e.selection==="attach"&&o.projectEtag!==e.expectedProjectEtag)throw new P(502,"package_receipt_mismatch","Attaching a historical Taskset changed the Model configuration.");if(e.modelConfiguration){let w=e.modelConfiguration,n=o.project,R=Me(e.package),m=re.parse({...w.trainingSetup,tasksetRef:v(k),rewardBindingRef:R?v(R):null,tasksetRelease:null});if(!n||n.teamId!==this.#e.teamId||n.etag!==o.projectEtag||![n.id,n.portableProjectId].includes(e.modelProjectId)||n.portableProjectId!==w.portableProjectId||n.name!==w.name||n.objective!==w.objective||n.sourceRevision!==w.sourceRevision||Date.parse(n.sourceUpdatedAt)!==Date.parse(w.sourceUpdatedAt)||f(n.defaultBaseModel)!==f(w.defaultBaseModel)||n.defaultDestinationId!==w.defaultDestinationId||f(n.trainingSetup)!==f(m))throw new P(502,"package_receipt_mismatch","Taskset publication did not retain the requested Model configuration.")}return o}async getByRelease(t,a={}){let e=G.parse(t),i=a.expectedPackageHash===void 0?void 0:N.parse(a.expectedPackageHash),r=Qe.parse(await this.#t(`/releases/${encodeURIComponent(e.id)}/${e.revision}/${e.contentHash}/package`,"GET",void 0,a.signal)),p=S(r.package),o={id:p.taskset.id,revision:p.taskset.revision,contentHash:p.taskset.contentHash};if(r.teamId!==this.#e.teamId||f(r.release)!==f(e)||f(o)!==f(e)||i!==void 0&&p.contentHash!==i)throw new P(502,"package_readback_mismatch","Independent Dataset package differs from the requested workspace or exact release.");return p}async get(t,a,e={}){let i=B.parse(t),r=G.parse(a),p=e.expectedPackageHash===void 0?void 0:N.parse(e.expectedPackageHash),o=Ye.parse(await this.#t(`/${encodeURIComponent(i)}/${encodeURIComponent(r.id)}/${r.revision}/${r.contentHash}`,"GET",void 0,e.signal)),k=o.package.taskset;if(o.teamId!==this.#e.teamId||o.modelProjectId!==i||k.id!==r.id||k.revision!==r.revision||k.contentHash!==r.contentHash)throw new P(502,"package_readback_mismatch","Taskset package did not match the requested release and owner.");if(p!==void 0&&o.package.contentHash!==p)throw new P(502,"package_readback_mismatch","Taskset package did not match the saved publication receipt.");return S(o.package)}async#t(t,a,e,i){let r=e===void 0?void 0:JSON.stringify(e);if(r&&new TextEncoder().encode(r).byteLength>oe)throw new P(413,"package_too_large","Taskset publication exceeds the 64 MiB envelope.");let p=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-packages${t}`,{method:a,headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json",...r?{"Content-Type":"application/json"}:{}},body:r,signal:i,redirect:"error"}),o=p.body?.getReader();if(!o)throw new P(p.status,"empty_response","Taskset package response was empty.");let k=new TextDecoder("utf-8",{fatal:!0}),w=0,n="";try{for(;;){let m=await o.read();if(m.done)break;if(w+=m.value.byteLength,w>oe)throw new P(413,"package_too_large","Taskset response exceeds the 64 MiB envelope.");n+=k.decode(m.value,{stream:!0})}n+=k.decode()}finally{await o.cancel(),o.releaseLock()}let R=JSON.parse(n);if(!p.ok){let m=c.object({code:c.string(),message:c.string()}).safeParse(R);throw new P(p.status,m.success?m.data.code:"package_request_failed",m.success?m.data.message:`Taskset package request failed (${p.status}).`)}return R}};var ae=U.shape.id,Le=c.object({schemaVersion:c.literal("openpond.modelBatchReviewInspection.v1"),packageHash:c.string().regex(/^[a-f0-9]{64}$/),definition:L,binding:fe,evidence:c.array(K).min(1).max(1e4),decisions:c.array(ke).min(1).max(1e4)}).strict(),pe=c.object({schemaVersion:c.literal("openpond.modelBatchReviewRequest.v1"),operationId:ae,modelId:ae,expectedModelRevision:c.number().int().positive(),tasksetRef:U,rewardBindingRef:U.nullable(),definition:c.object({name:c.string().trim().min(1).max(500).optional(),instructions:c.string().trim().min(1).max(2e4).optional(),inputSchema:$.optional(),outputSchema:$.optional(),requiredOutputs:L.shape.requiredOutputs}).strict(),examples:c.array(c.object({evidence:U,input:$.optional(),expected:$.nullable().optional(),evaluatorContext:$.nullable().optional(),proposedTarget:$.nullable().optional()}).strict()).max(1e4)}).strict(),Fe=c.object({schemaVersion:c.literal("openpond.modelBatchReviewReceipt.v1"),operationId:ae,modelId:ae,source:Q,evidence:c.array(K).min(1).max(1e4),proposals:c.array(Z).max(1e4)}).strict();function ze(s){let{request:t,package:a}=s,e=a.learningResources;if(!e)throw new _("model_review_batch_required",422);let i=F(a.taskset),r=`model-review-${f([s.scope,t.modelId,t.operationId])}`,p=new Map(t.examples.map(d=>[f(d.evidence),d])),o=new Set(e.evidence.map(d=>f(v(d)))),k=new Map(e.decisions.map(d=>[f(d.evidence),d]));if(p.size!==t.examples.length||t.examples.some(d=>!o.has(f(d.evidence))))throw new _("model_review_evidence_mismatch",409);for(let d of[s.binding,...s.rewards,...s.assets])ve(d);X(s.binding,s.rewards);let w=new Map;for(let d of s.binding.sources){let T=s.rewards.find(Ue=>V(v(Ue),d.reward)),{contentHash:C,...z}=T;w.set(T.contentHash,he({...z,id:`${r}-reward-${T.contentHash}`,revision:1}))}let n=[...w.values()],{contentHash:R,recipeRef:m,...x}=s.binding,l=ge({...x,id:`${r}-binding`,revision:1,sources:s.binding.sources.map(d=>({...d,reward:v(w.get(d.reward.contentHash))}))},n),I=n.flatMap(d=>[...d.assets,..."verifierRef"in d.implementation?[d.implementation.verifierRef]:[],..."rubricRef"in d.implementation?[d.implementation.rubricRef]:[],..."inputContract"in d.implementation?[d.implementation.inputContract]:[]]),u=[...new Map(I.map(d=>{let T=s.assets.find(C=>C.id===d.id);if(!T)throw new _("model_review_reward_asset_missing",422);if(D(T,d),d.visibility==="policy")throw new _("reward_asset_visibility_invalid",422);return[T.id,T]})).values()],{environmentRelease:h,verifierSetRelease:M,...E}=i.definition.execution,{contentHash:g,...H}=i.definition,y=L.parse(j({...H,...t.definition,id:`${r}-definition`,revision:1,rewardBinding:v(l),execution:{...E,policy:{...E.policy,hiddenGraderRefs:Y(l,n).filter(d=>d.privileged).map(d=>d.id)}}})),q=Q.parse(j({schemaVersion:"openpond.learningSource.v1",id:r,revision:1,name:`${y.name} review`,kind:"direct",taskDefinition:v(y),enabled:!0,allowedSplits:[...new Set(e.evidence.map(d=>d.submission.split))],mapping:null,adapterVersion:null,reviewOrigin:{modelId:t.modelId,packageHash:a.contentHash,taskset:v(a.taskset),batch:v(e.batch),rewardBinding:v(s.binding)}})),le=e.evidence.map(d=>{let T=p.get(f(v(d))),C=`review-${d.contentHash}`,z=f({instructions:y.instructions,inputSchema:y.inputSchema,outputSchema:y.outputSchema,requiredOutputs:y.requiredOutputs??[],input:T?.input??d.submission.input})!==f({instructions:i.definition.instructions,inputSchema:i.definition.inputSchema,outputSchema:i.definition.outputSchema,requiredOutputs:i.definition.requiredOutputs??[],input:d.submission.input});return K.parse(j({schemaVersion:"openpond.taskEvidence.v1",id:be(q.id,d.submission.exampleId,C),revision:1,source:v(q),submission:{...d.submission,sourceId:q.id,taskDefinition:v(y),attemptId:C,observedOutput:z?null:d.submission.observedOutput,idempotencyKey:`${r}-${d.contentHash}`,...T?.input===void 0?{}:{input:T.input},...T?.expected===void 0?{}:{expected:T.expected},...T?.evaluatorContext===void 0?{}:{evaluatorContext:T.evaluatorContext}},supersedes:v(d),correctionFeedbackId:null,receivedAt:s.now}))}),Ne=le.flatMap(d=>{let T=p.get(f(d.supersedes)),C=k.get(f(d.supersedes)),z=T?.proposedTarget===void 0?C.approvedTarget:T.proposedTarget;return z===null?[]:[Z.parse({schemaVersion:"openpond.taskFeedbackRecord.v1",id:`feedback-${f([r,d.id])}`,revision:1,submission:{schemaVersion:"openpond.taskFeedback.v1",sourceId:q.id,idempotencyKey:`${r}-${d.id}`,exampleId:d.submission.exampleId,attemptId:d.submission.attemptId,expectedEvidenceHash:d.contentHash,occurredAt:s.now,kind:"target_correction",value:z,note:"Proposed target for the revised task. Grade and review before admission."},status:"pending_review",evidence:v(d),createdAt:s.now,review:null})]});return{source:q,definition:y,binding:l,rewards:n,assets:u,evidence:le,proposals:Ne}}b(ze,"prepareModelBatchReview");var Ve=b(s=>`model-batch-review-${f([s.modelId,s.operationId])}`,"operation");function At(s){let t=S(s);if(!t.learningResources)throw new _("model_review_batch_required",422);let a=F(t.taskset);return Le.parse({schemaVersion:"openpond.modelBatchReviewInspection.v1",packageHash:t.contentHash,definition:a.definition,binding:a.binding,evidence:t.learningResources.evidence,decisions:t.learningResources.decisions})}b(At,"inspectModelBatchPackage");async function Ze(s,t){let a=pe.parse(t),e=await s.operation(Ve(a));if(!e)return null;if(e.requestHash!==f(a))throw new _("learning_idempotency_conflict",409);return Oe(s,a,e.resources)}b(Ze,"findModelBatchReview");async function Dt(s,t){let a=pe.parse(t.request),e=await Ze(s,a);if(e)return e;let i=S(t.package);if(!i.learningResources)throw new _("model_review_batch_required",422);let r=F(i.taskset),p=a.rewardBindingRef,o=!p||V(p,v(r.binding)),k=o?r.binding:await ne(s,"binding",p),w=o?r.rewards:await Promise.all(k.sources.map(l=>ne(s,"reward",l.reward))),n=new Set(w.flatMap(l=>[...l.assets,..."verifierRef"in l.implementation?[l.implementation.verifierRef]:[],..."rubricRef"in l.implementation?[l.implementation.rubricRef]:[],..."inputContract"in l.implementation?[l.implementation.inputContract]:[]]).map(l=>l.id)),R=o?i.learningResources.assets:await Promise.all([...n].map(l=>ie(s,"asset",l,1))),m=ze({...t,request:a,package:i,binding:k,rewards:w,assets:R}),x=[];for(let l of m.assets){let I=await s.get("asset",l.id,1);if(I&&I.contentHash!==l.contentHash)throw new _("model_review_asset_conflict",409);I||await s.put("asset",l,0)}for(let l of m.rewards)await s.put("reward",l,0);await s.put("binding",m.binding,0),await s.put("definition",m.definition,0),await s.put("source",m.source,0,{parentId:a.modelId}),x.push({kind:"source",id:m.source.id,revision:1});for(let l of m.evidence)await s.put("evidence",l,0,{parentId:m.source.id}),x.push({kind:"evidence",id:l.id,revision:1});for(let l of m.proposals)await s.put("feedback",l,0,{parentId:l.evidence.id,status:l.status}),x.push({kind:"feedback",id:l.id,revision:1});return await s.saveOperation(Ve(a),{requestHash:f(a),resources:x}),Oe(s,a,x)}b(Dt,"beginModelBatchReview");async function Oe(s,t,a){let e=await Promise.all(a.map(i=>ie(s,i.kind,i.id,i.revision)));return Fe.parse({schemaVersion:"openpond.modelBatchReviewReceipt.v1",operationId:t.operationId,modelId:t.modelId,source:e.find(i=>i.schemaVersion==="openpond.learningSource.v1"),evidence:e.filter(i=>i.schemaVersion==="openpond.taskEvidence.v1"),proposals:e.filter(i=>i.schemaVersion==="openpond.taskFeedbackRecord.v1")})}b(Oe,"readReceipt");function Ge(s){let t=s.taskset.metadata.ordinaryAuthoring,a=c.record(c.string(),c.array(c.string().min(1)).max(1e5)).parse(t?.judgeCalibrationFixtures??{});return s.taskset.graders.map(e=>{let i={...e,label:e.id,metadata:{portableGrader:e}};if(e.kind==="custom_verifier")return A.parse({...i,module:e.verifierRef.path,exportName:e.exportName??"verify",metadata:{...i.metadata,portableVerifierRef:e.verifierRef}});if(e.kind==="human"||e.kind==="model_judge"){let r=s.files.find(k=>k.asset.id===e.rubricRef.id);if(!r)throw new Error(`Imported rubric is missing: ${e.id}.`);let p=new TextDecoder("utf-8",{fatal:!0}).decode(O(r)),o={...i.metadata,portableRubricRef:e.rubricRef};if(e.kind==="human")return A.parse({...i,rubric:p,metadata:o});if(!e.model)throw new Error(`Imported judge ${e.id} requires its declared model before local preparation.`);return A.parse({...i,rubric:p,metadata:o,judge:e.model,temperature:e.temperature??0,calibrationStatus:"pending",calibrationFixtureRefs:a[e.id]??[]})}return A.parse({...i,kind:e.kind==="artifact"?"file":e.kind,config:e.kind==="artifact"?{...e.config,...e.config.refIncludes===void 0?{}:{pathIncludes:e.config.refIncludes}}:e.config})})}b(Ge,"importedPackageGraders");function se(s,t,a=[]){let e=X(s,t);return Y(s,t).map(i=>{let r=e.find(({source:o})=>o.graderId===i.id).reward,p={...i,label:r.name,metadata:{rewardBinding:v(s)}};if(i.kind==="model_judge"){if(!i.model||i.calibrationStatus!=="passed"||!r.calibrationCheckRef||!r.fixtureSetRef)throw new Error(`Reward ${i.id} needs a retained passing calibration check before preparation.`);let o=a.find(n=>n.id===i.rubricRef.id),k=a.find(n=>n.id===r.fixtureSetRef.id);if(!o||!k)throw new Error(`Reward ${i.id} is missing its immutable rubric or calibration fixtures.`);let w=Re.array().min(1).max(50).parse(JSON.parse(D(k,r.fixtureSetRef)));return A.parse({...p,rubric:D(o,i.rubricRef),judge:i.model,temperature:i.temperature??0,calibrationFixtureRefs:w.map(n=>n.id),metadata:{...p.metadata,portableGrader:i,portableRubricRef:i.rubricRef,calibrationEvidenceHash:r.calibrationCheckRef.contentHash,calibrationCheckRef:r.calibrationCheckRef}})}if(i.kind==="custom_verifier")return A.parse({...p,module:i.verifierRef.path,exportName:i.exportName??"verify",metadata:{...p.metadata,portableVerifierRef:i.verifierRef}});if(i.kind==="human"){let o=a.find(k=>k.id===i.rubricRef.id);if(!o)throw new Error(`Reward ${i.id} is missing its immutable rubric.`);return A.parse({...p,rubric:D(o,i.rubricRef),metadata:{...p.metadata,portableGrader:i,portableRubricRef:i.rubricRef}})}return A.parse({...p,kind:i.kind==="artifact"?"file":i.kind})})}b(se,"projectLearningBatchGraders");function et(s){return`graders/reward-${s}.js`}b(et,"learningVerifierModule");function ta(s){let t=S(s.package),a=t.taskset,e=t.modelResources,i=t.learningResources?F(a):void 0,r=He.parse({schemaVersion:"openpond.uploadedFileDatasetSource.v1",kind:"uploaded_file",id:`package-source-${f({profileId:s.profileId,packageHash:t.contentHash})}`,profileId:s.profileId,title:s.name,sourceHash:t.contentHash,occurredAt:s.createdAt,licensingStatus:"pending",secretScanStatus:"pending",piiScanStatus:"pending",originalFileNames:["taskset-package.json"],mediaTypes:["application/json"],sourceFileHashes:[t.contentHash],totalBytes:new TextEncoder().encode(JSON.stringify(t)).byteLength,parserVersion:"openpond.tasksetPackage.v1",metadata:{}}),p=De({profileId:s.profileId,id:`${a.id}-import`,name:s.name,now:s.createdAt}),o=[];for(let u of a.graders)if(u.kind==="custom_verifier"){let h=e?.assets.find(g=>g.id===u.verifierRef.id),M=t.files.find(g=>g.asset.id===u.verifierRef.id);if(!M)throw new Error(`Imported verifier source is missing: ${u.id}.`);let E=u.verifierRef.path;o.some(g=>g.path===E)||o.push({path:E,role:"verifier",content:h?D(h,u.verifierRef):new TextDecoder("utf-8",{fatal:!0}).decode(O(M))})}let k=a.metadata.ordinaryAuthoring??a.metadata.starterAuthoring,w=Be.array().max(1e5).parse(k?.graderFixtures??[]),n=a.environment.kind==="text"?"chat":a.environment.kind==="custom_program"?"program":a.environment.kind,R=c.record(c.string(),c.record(c.string(),c.string())).parse(a.metadata.workAssetStagingPaths??{}),m=_e.array().max(1e4).parse(a.metadata.environmentResources??[]),x=m.filter(u=>u.visibility==="policy_visible").map(u=>{let h=t.files.filter(M=>M.asset.path===u.path);if(h.length!==1||h[0].asset.visibility!=="policy")throw new Error(`Policy environment resource requires one public package file: ${u.path}.`);return h[0].asset}),l=new Set(x.map(u=>u.id)),I=ce.parse({schemaVersion:"openpond.taskset.v1",id:a.id,revision:a.revision,profileId:s.profileId,profileRelease:null,createImproveRunId:null,name:s.name,objective:ee(t),status:"needs_review",sourceRefs:[r],datasetArtifact:null,policy:a.policy,environment:{...p.environment,kind:n,entrypoint:a.environment.entrypoint,resources:m,stateful:a.environment.stateful,deterministicSeeds:a.environment.deterministicSeeds,toolNames:a.tools.map(u=>u.name),defaultTimeoutMs:a.environment.defaultTimeoutMs,networkPolicy:a.environment.networkPolicy,metadata:{runtimeSourceTasksetId:tt(s.profileId,t.contentHash),portableEnvironment:a.environment,portableTools:a.tools,portableExecutionResources:{environment:t.environment,verifierSet:t.verifierSet}}},capabilities:{...p.capabilities,taskKind:n==="chat"?"chat":n==="program"?"custom_program":"single_agent",compatibleMethods:["none"],requiresTools:a.tools.length>0,requiresState:a.environment.stateful,rewardKinds:[...new Set(a.graders.map(u=>u.kind==="human"?"human":u.kind==="model_judge"?"model_judge":"deterministic"))]},tasks:a.tasks.map(u=>({...u,schemaVersion:"openpond.taskData.v1",sourceRefs:[r.id],assets:[...new Map([...u.artifactRefs,...(u.requiredOutputs??[]).flatMap(h=>h.submissionMode==="structured_json"&&h.schemaRef?[h.schemaRef]:[]),...x].map(h=>[h.id,h])).values()].map(h=>({id:h.id,sourceRefId:r.id,artifactRef:h.path,fileName:h.path.split("/").at(-1),...l.has(h.id)?{stagingPath:h.path}:R[u.id]?.[h.id]?{stagingPath:R[u.id][h.id]}:{},mediaType:h.mediaType,sha256:h.contentHash,sizeBytes:h.sizeBytes,split:u.split,metadata:{portableAsset:h,...l.has(h.id)?{sharedEnvironmentResource:{id:m.find(M=>M.path===h.path).id,path:h.path}}:{}}})),...u.requiredOutputs?{requiredOutputs:u.requiredOutputs.map(h=>({...h,schemaRef:h.schemaRef?.id??null,maxBytes:h.maxBytes??void 0}))}:{},metadata:{portableTaskRecord:u,exampleOrigin:"imported"}})),graders:e?se(e.rewardBinding,e.rewards,e.assets):i?se(i.binding,i.rewards,t.learningResources.assets):Ge(t),graderFixtures:w,learningSignals:p.learningSignals,...a.metrics?{metrics:a.metrics}:{},authoringProvenance:{schemaVersion:"openpond.taskAuthoringProvenance.v1",model:null,modelConfig:{},skillHash:f("openpond-package-import-v1"),promptTemplateVersion:"package-import-v1",buildIntent:"discovery",buildSpecification:null,evidenceHashes:[t.contentHash],tasksetSdkVersion:"package-import-v1",sourceCommit:null,repairHistory:[],createdAt:s.createdAt},readiness:null,contentHash:"00000000",createdAt:s.createdAt,updatedAt:s.createdAt,metadata:{importedPackageHash:t.contentHash,...a.metadata.tasksetOutputContract===void 0?{}:{tasksetOutputContract:a.metadata.tasksetOutputContract},...i?{learning:i}:{},portableFileInventory:t.files.map(u=>({asset:u.asset,sourcePath:u.asset.path})),...e?{taskDefinition:v(e.taskDefinition),rewardBinding:v(e.rewardBinding),rewardExecution:{binding:e.rewardBinding,rewards:e.rewards}}:{},portableCapabilities:a.capabilities,derivedPortableMetadata:a.metadata,...a.metadata.modelTasksetDerivation?{modelTasksetDerivation:a.metadata.modelTasksetDerivation}:{}}});return{package:t,taskset:ce.parse({...I,contentHash:Ae(I)}),generatedFiles:o}}b(ta,"prepareImportedTasksetPackage");function tt(s,t){return`package-${f({profileId:s,packageHash:t})}`}b(tt,"tasksetPackageSourceId");var me=c.object({draft:J,filePaths:c.array(c.object({assetId:c.string().min(1),paths:c.array(Pe).min(1).max(1e4)}).strict()).max(1e4)}).strict();function at(s){let t=S(s.source),a=J.parse(s.sourceDraft),e=ye.parse(s.preparation);if(t.contentHash!==e.sourcePackageHash||!V(v(t.taskset),e.sourceTasksetRef))throw new Error("Taskset draft preparation differs from its source package.");if(t.learningResources)throw new Error("Reviewed Tasksets require their reviewed authoring workflow.");if(!!t.modelResources!=(e.authoringGraph==="bound"))throw new Error("Taskset draft authoring graph differs from its source.");let i=de.parse(a.metadata.portableFileInventory??[]),r=b(n=>te(n)?`source-artifacts/${t.contentHash}/${f(n)}/${n.split("/").at(-1)}`:n,"sourcePath");if([...a.tasks.flatMap(n=>(n.assets??[]).map(R=>R.artifactRef)),...(a.environment.resources??[]).map(n=>n.path),...t.taskset.tasks.flatMap(n=>(n.requiredOutputs??[]).flatMap(R=>R.schemaRef?[R.schemaRef.path]:[])),...a.metrics.customAggregator?[a.metrics.customAggregator.module]:[],...a.graders.flatMap(n=>n.kind==="custom_verifier"?[n.module]:[])].some(te))throw new Error("A referenced source asset occupies a reserved Taskset authoring path.");let o=t.files.map(n=>{let R=new Set([n.asset.path]);for(let m of i)m.asset.id===n.asset.id&&R.add(m.sourcePath);for(let m of a.tasks)for(let x of m.assets??[])x.id===n.asset.id&&R.add(x.artifactRef);for(let m of t.taskset.graders)if(m.kind==="custom_verifier"&&m.verifierRef.id===n.asset.id){let x=a.graders.find(l=>l.id===m.id);x?.kind==="custom_verifier"&&R.add(x.module)}return{assetId:n.asset.id,paths:[...R].map(r)}}),k={...a.metadata};if(t.modelResources)for(let n of["taskDefinition","rewardBinding","rewardExecution","derivedPortableMetadata","modelTasksetDerivation","importedPackageHash"])delete k[n];let w=J.parse({...a,id:e.draftId,revision:1,status:"draft",graders:a.graders.map(n=>({...n,metadata:{...n.metadata,portableGrader:t.taskset.graders.find(R=>R.id===n.id)}})),environment:{...a.environment,metadata:{...a.environment.metadata,portableExecutionResources:{environment:t.environment}}},modelScope:{modelId:e.lineage.owner.modelId,expectedModelRevision:s.expectedModelRevision,source:e},publishedTasksetRef:e.tasksetRevision>1?e.sourceTasksetRef:null,metadata:{...k,modelTasksetAuthoring:e.lineage,portableFileInventory:i.map(n=>({...n,sourcePath:r(n.sourcePath),asset:{...n.asset,id:te(n.sourcePath)?`source-artifact-${f({packageHash:t.contentHash,assetId:n.asset.id})}`:n.asset.id,path:r(n.asset.path)}}))}});return me.parse({draft:w,filePaths:o})}b(at,"prepareTasksetDraftSource");function st(s){let t=me.parse(s.initialized),a=S(s.source);if(t.draft.modelScope?.source?.sourcePackageHash!==a.contentHash)throw new Error("Taskset draft lost its source preparation.");let e=new Map;for(let r of t.filePaths){let p=a.files.find(o=>o.asset.id===r.assetId);if(!p)throw new Error("Taskset draft source asset is missing.");for(let o of r.paths){let k=e.get(o);if(k&&k.contentHash!==p.asset.contentHash)throw new Error("Taskset draft source paths conflict.");e.set(o,{path:o,contentHash:p.asset.contentHash,sizeBytes:p.asset.sizeBytes,base64:p.base64})}}for(let r of Ee(t.draft))if(!e.has(r.relativePath)){let p=new TextEncoder().encode(r.source);e.set(r.relativePath,{path:r.relativePath,contentHash:ue(p),sizeBytes:p.byteLength,base64:Buffer.from(p).toString("base64")})}let i=t.draft;if(i.metrics.customAggregator){let r=e.get(i.metrics.customAggregator.module);if(!r)throw new Error("Declared Taskset metric module is missing.");Ce(r),i=J.parse({...i,metrics:{...i.metrics,customAggregator:{...i.metrics.customAggregator,contentHash:r.contentHash}}})}return qe({schemaVersion:"openpond.tasksetDraftWorkspace.v1",draft:i,files:[...e.values()]})}b(st,"materializeTasksetDraftWorkspace");export{se as a,et as b,ta as c,tt as d,Ke as e,We as f,Je as g,Xe as h,Ye as i,Qe as j,P as k,$e as l,Le as m,pe as n,Fe as o,At as p,Ze as q,Dt as r,me as s,at as t,st as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{E as x,n as v}from"./chunk-
|
|
2
|
+
import{E as x,n as v}from"./chunk-RS526BG7.js";import{a as l,c as j}from"./chunk-GF55VEMR.js";import{M as w,b as g,pb as p,ub as y,wa as P,xc as E}from"./chunk-CJDGLPNX.js";import{m as f}from"./chunk-WJSJXK2N.js";import{A as s}from"./chunk-X2J2P5ZT.js";import{s as S}from"./chunk-UGOK7VTC.js";import{a as n}from"./chunk-FTQLQJQV.js";function z(e){if(e.kind==="command"||e.kind==="file_change")return!0;if(e.kind!=="permissions")return!1;try{let o=JSON.parse(e.detail);return!o.questions&&Array.isArray(o.options)&&o.options.some(r=>r.kind==="allow_once")&&o.options.some(r=>r.kind==="reject_once")}catch{return!1}}n(z,"remoteApprovalSupported");import{createHash as A}from"node:crypto";import{realpath as R,stat as O}from"node:fs/promises";var k=n(e=>A("sha256").update(g("POST","/local/ponder-project",e)).digest("hex"),"hash"),_=s.object({projectId:s.string().min(1).max(200),name:s.string().min(1).max(300),cwd:s.string().min(1).max(8192),sourceFolders:s.array(s.object({path:s.string().min(1).max(8192),realpath:s.string().min(1).max(8192)}).strict()).min(1).max(1e3),configurationHash:s.string().regex(/^[a-f0-9]{64}$/),revision:s.string().regex(/^[a-f0-9]{64}$/)}).strict();function X(e){let o=Object.values(S(e,"saved_local_projects"));if(o.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return o.map(r=>f.parse(r.value))}n(X,"readPonderLocalProjects");async function Y(e){if(e.hiddenFromDefaultSidebar)throw new Error("ponder_desktop_project_unavailable");let o=[...new Set([...e.sourceFolders??[e.path],e.path,...e.repoPath?[e.repoPath]:[]])];if(!o.length||o.length>1e3)throw new Error("ponder_desktop_project_folder_limit_exceeded");let r=await R(e.workspacePath);if(!(await O(r)).isDirectory())throw new Error("ponder_desktop_project_unavailable");let t=[];for(let c of o){let i=await R(c);if(!(await O(i)).isDirectory())throw new Error("ponder_desktop_project_unavailable");t.push({path:c,realpath:i})}let a={projectId:e.id,name:e.name,cwd:r,sourceFolders:t,configurationHash:k({id:e.id,name:e.name,path:e.path,workspacePath:e.workspacePath,repoPath:e.repoPath,sourceFolders:e.sourceFolders??null,hiddenFromDefaultSidebar:e.hiddenFromDefaultSidebar??!1})};return _.parse({...a,revision:k(a)})}n(Y,"capturePonderProjectSnapshot");import{createHash as D}from"node:crypto";var I=E,m=s.object({revision:s.number().int().positive(),owner:l,authority:I,project:_,shared:s.boolean(),updatedAt:s.string().datetime()}).strict(),b=m.omit({revision:!0}),h=n(e=>D("sha256").update(JSON.stringify(l.parse(e))).digest("hex"),"ownerKey");function N(e,o,r){let t=l.parse(o),a=I.parse(r),c=e.get("SELECT payload FROM ponder_desktop_authority WHERE id = 1"),i=c?y.parse(JSON.parse(c.payload)):null;if(!i||i.state!=="attached"||Date.parse(i.leaseExpiresAt)<=Date.now()||i.authorizationRevision!==a.authorizationRevision||!Object.entries(a.scope).every(([d,u])=>i.scope[d]===u)||i.scope.installationId!==t.installationId||i.scope.profileId!==t.profileId||i.scope.ownerUserId!==t.ownerUserId||i.scope.teamId!==t.teamId)throw new Error("ponder_desktop_project_authority_changed")}n(N,"assertAuthority");function ne(e,o){let r=b.parse(o);N(e,r.owner,r.authority);let t=h(r.owner),a=e.get("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? AND project_id = ?",[t,r.project.projectId]);if(!a&&(e.get("SELECT count(*) AS count FROM ponder_project_sharing WHERE owner_key = ?",[t])?.count??0)>=p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");let c=a?m.parse(JSON.parse(a.payload)):null,i=c&&c.shared===r.shared&&c.project.revision===r.project.revision&&c.authority.authorizationRevision===r.authority.authorizationRevision&&Object.entries(r.authority.scope).every(([u,L])=>c.authority.scope[u]===L),d=m.parse({...r,revision:c?c.revision+(i?0:1):1});return e.run("INSERT INTO ponder_project_sharing (owner_key, project_id, payload) VALUES (?, ?, ?) ON CONFLICT(owner_key, project_id) DO UPDATE SET payload = excluded.payload",[t,r.project.projectId,JSON.stringify(d)]),d}n(ne,"setPonderProjectSharing");function ae(e,o){let r=e.all("SELECT payload FROM ponder_project_sharing WHERE owner_key = ? ORDER BY project_id LIMIT ?",[h(o),p+1]);if(r.length>p)throw new Error("ponder_desktop_project_sharing_limit_exceeded");return r.map(t=>{let a=m.parse(JSON.parse(t.payload));if(h(a.owner)!==h(o))throw new Error("ponder_desktop_project_owner_changed");return a})}n(ae,"readPonderProjectSharing");function ie(e,o){return e.shared&&e.authority.authorizationRevision===o.authorizationRevision&&Object.entries(o.scope).every(([r,t])=>e.authority.scope[r]===t)}n(ie,"projectSharingMatchesAuthority");import{createHash as F}from"node:crypto";function ue(e,o,r){let t=F("sha256").update(JSON.stringify({ownership:x(e,o),paused:r.paused,activeTurnId:r.activeTurnId})).digest("hex");return Number.parseInt(t.slice(0,13),16)}n(ue,"remoteCommandTargetRevision");function le(e,o){let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o]),t=r&&r.lease_until>Date.now()&&e.get("SELECT status FROM turns WHERE id=?",[r.turn_id])?.status==="in_progress";return{paused:!!r?.paused,activeTurnId:t?r.turn_id:null}}n(le,"readRemoteCommandTargetState");function he(e,o){if(o.payload.resume!==!0)return;if(o.action!=="follow_up")throw new Error("remote_resume_action_invalid");let r=e.get("SELECT turn_id,paused,lease_until FROM task_inbox_turns WHERE session_id=?",[o.localSessionId]),t=e.get("SELECT id,status FROM turns WHERE session_id=? ORDER BY sort_index DESC LIMIT 1",[o.localSessionId]);if(!o.expectedTurnId||t?.id!==o.expectedTurnId||r?.turn_id!==o.expectedTurnId||!r.paused||r.lease_until>Date.now()||!["completed","failed","interrupted"].includes(t.status))throw new Error("remote_resume_target_changed");e.run("UPDATE task_inbox_turns SET paused=0 WHERE session_id=?",[o.localSessionId])}n(he,"resumeRemoteTaskInput");import{createHash as M}from"node:crypto";function T(e){return w.parse({provider:e.provider,cwd:e.cwd,localProjectId:e.localProjectId,workspaceId:e.workspaceId,workspaceKind:e.workspaceKind,workspaceName:e.workspaceName,...e.modelRef?{modelRef:e.modelRef}:{},currentProfile:e.currentProfile,experience:e.experience,profileWorkflowBinding:e.profileWorkflowBinding,profileComponentBinding:e.profileComponentBinding,openPondCommandAccessMode:e.openPondCommandAccessMode})}n(T,"remoteStarterPayload");function q(e){return Number.parseInt(M("sha256").update(P({payload:T(e),owner:e.metadata?.ponderLocalOwner})).digest("hex").slice(0,13),16)}n(q,"remoteStarterRevision");function H(e,o){let r=new Map;for(let t of e){if(!j(t,o)||!t.localProjectId||!t.cwd||t.archived||t.status==="closed"||t.systemKind||t.hiddenFromDefaultSidebar||t.metadata?.nativeHistoryProjection||!v(t.provider)||["sandbox","sandbox_template","sandbox_app"].includes(t.workspaceKind??""))continue;try{T(t)}catch{continue}let a=`starter:${t.id}`;r.set(a,{source:t,target:{id:a,projectId:t.localProjectId,projectLabel:t.workspaceName??"Local project",title:`New ${t.provider} task in ${t.workspaceName??"local project"}`,revision:q(t)}})}return r}n(H,"captureRemoteStarters");function Pe(e){return async o=>{let r=await e.current();if(!r)throw new Error("remote_account_unavailable");let t=[];for(let c of await e.store.sessionShells()){let i=await e.store.getSession(c.id);i&&t.push(i)}let a=H(t,r.owner).get(o.localStarterId);if(!a||a.target.revision!==o.expectedRevision||a.target.projectId!==o.payload.projectId||a.target.revision!==o.payload.starterRevision)throw new Error("remote_starter_changed");return a.source}}n(Pe,"createRemoteStarterResolver");var C=class extends Error{constructor(r,t=409){super(r);this.status=t;this.name="LocalManagedMessageError"}status;static{n(this,"LocalManagedMessageError")}};export{ue as a,le as b,he as c,T as d,q as e,H as f,Pe as g,z as h,C as i,X as j,Y as k,ne as l,ae as m,ie as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{F as d}from"./chunk-
|
|
2
|
+
import{F as d}from"./chunk-CJDGLPNX.js";import{a as n}from"./chunk-FTQLQJQV.js";import{access as m,readFile as g}from"node:fs/promises";import{createHash as h}from"node:crypto";import o from"node:path";import{fileURLToPath as w}from"node:url";var i="openpond-taskset-authoring",f="artifact.json",u=o.dirname(w(import.meta.url));async function P(e=process.cwd()){return(await p(e)).bundle}n(P,"loadTasksetAuthoringSkillBundle");async function p(e=process.cwd()){let s=await k(e),t=JSON.parse(await g(o.join(s,f),"utf8"));if(t.schemaVersion!==1||t.skillName!==i||!t.artifactVersion||!t.bundle||!/^[a-f0-9]{64}$/.test(t.contentHash))throw new Error("Bundled Taskset Authoring artifact is invalid.");let{contentHash:r,...a}=t;if(h("sha256").update(JSON.stringify(a)).digest("hex")!==r)throw new Error("Bundled Taskset Authoring artifact hash does not match.");for(let l of t.files)if(h("sha256").update(l.contents).digest("hex")!==l.sha256)throw new Error(`Bundled Taskset Authoring file hash does not match: ${l.path}`);return t}n(p,"loadTasksetAuthoringSkillArtifact");async function S(e=process.cwd()){let s=await k(e),t=await p(e),r=t.bundle,a=d.find(c=>c.name===i);if(!a)throw new Error("Taskset Authoring skill metadata is missing.");return{...a,path:o.join(s,"SKILL.md"),sourcePath:s,charCount:r.length,sourceHash:t.contentHash,validationMessages:[...a.validationMessages],resourceFiles:[...a.resourceFiles]}}n(S,"loadTasksetAuthoringProfileSkill");async function O(e=process.cwd()){let s=await S(e),t=await P(e);return{name:s.name,description:s.description,body:t,path:s.path,sourceHash:s.sourceHash,charCount:s.charCount,packagePath:s.sourcePath,resourceFiles:s.resourceFiles}}n(O,"readTasksetAuthoringProfileSkill");async function k(e=process.cwd(),s=process.execPath){let t=[process.env.OPENPOND_TASKSET_AUTHORING_SKILL_ROOT,o.resolve(e,"apps","cli","skills",i),o.resolve(e,"dist","skills",i),o.resolve(o.dirname(s),"skills",i),o.resolve(u,"skills",i),o.resolve(u,"..","skills",i)].filter(r=>!!r);for(let r of t)if(await m(o.join(r,f)).then(()=>!0,()=>!1))return r;throw new Error(`Bundled Taskset Authoring skill was not found. Checked: ${t.join(", ")}`)}n(k,"resolveTasksetAuthoringSkillRoot");export{p as a,S as b,O as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{Aa as G,Ba as X,Ca as Y,F as N,_ as D,e as T,g as V,ga as R,ha as J,i as z,ja as H,oa as y,wa as E,ya as $}from"./chunk-WLZJOCLA.js";import{k as w,l as x,m as u}from"./chunk-HIQPGYVH.js";import{I as W,J as K,x as C}from"./chunk-ZWW227M3.js";import{K as j}from"./chunk-G4E3WGLM.js";import{v as A}from"./chunk-ZY32SZ2P.js";import{A as n}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var S=n.string().trim().min(1).max(500),pe=n.string().regex(/^[a-f0-9]{64}$/),b=n.object({id:S,revision:n.number().int().positive(),contentHash:pe}).strict(),M=n.object({schemaVersion:n.literal("openpond.hostedTasksetSummary.v1"),id:S,teamId:S,release:b,name:n.string().min(1).max(500),description:n.string().max(2e4),taskCount:n.number().int().nonnegative(),buildIntent:n.string().min(1).max(100),methodHint:n.string().min(1).max(100).nullable(),packageBytes:n.number().int().nonnegative().nullable(),storedBytes:n.number().int().nonnegative().nullable(),createdAt:n.string().datetime({offset:!0})}).strict(),ue=n.object({afterId:n.string().trim().min(1).max(2e3).optional(),limit:n.number().int().min(1).max(100).default(30),modelProjectId:S.optional(),projectId:S.optional(),search:n.string().trim().max(100).optional(),sort:n.enum(["id","name","updated"]).default("id")}).strict(),he=n.object({items:n.array(M).max(100),nextCursor:n.string().trim().min(1).max(2e3).nullable()}).strict(),me=n.object({code:n.string().min(1),message:n.string().min(1)}).strict(),I=class extends Error{static{l(this,"OpenPondTasksetCatalogError")}constructor(a,t,e){super(e),this.status=a,this.code=t,this.name="OpenPondTasksetCatalogError"}status;code},_e=class{static{l(this,"OpenPondTasksetCatalogClient")}#e;constructor(a){if(!a.apiKey.trim()||!a.teamId.trim())throw new Error("Taskset API key and workspace are required.");let t=new URL(a.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Taskset base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...a,baseUrl:t.toString().replace(/\/+$/,"")}}async list(a={},t={}){let e=ue.parse(a),s=new URLSearchParams({limit:String(e.limit)});e.afterId&&s.set("afterId",e.afterId),e.modelProjectId&&s.set("modelProjectId",e.modelProjectId),e.projectId&&s.set("projectId",e.projectId),e.search!==void 0&&s.set("search",e.search),s.set("sort",e.sort);let r=he.parse(await this.#t(`?${s}`,t.signal));if(r.items.length>e.limit||new Set(r.items.map(o=>o.id)).size!==r.items.length||r.items.some(o=>o.teamId!==this.#e.teamId))throw new I(502,"catalog_scope_mismatch","Taskset inventory did not match the requested workspace or page size.");return r}async get(a,t={}){let e=S.parse(a),s=M.parse(await this.#t(`/${encodeURIComponent(e)}`,t.signal));if(s.id!==e||s.teamId!==this.#e.teamId)throw new I(502,"catalog_identity_mismatch","Taskset metadata did not match the requested identity.");return s}async resolve(a,t={}){let e=b.parse(a),s=M.parse(await this.#t(`/releases/${encodeURIComponent(e.id)}/${e.revision}/${e.contentHash}`,t.signal));if(s.teamId!==this.#e.teamId||s.release.id!==e.id||s.release.revision!==e.revision||s.release.contentHash!==e.contentHash)throw new I(502,"catalog_release_mismatch","Taskset metadata did not match the requested immutable release.");return s}async#t(a,t){let e=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-catalog${a}`,{headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json"},signal:t,redirect:"error"}),s=e.body?.getReader();if(!s)throw new I(e.status,"empty_response","Taskset catalog response was empty.");let r=new TextDecoder,o=0,i="";try{for(;;){let d=await s.read();if(d.done)break;if(o+=d.value.byteLength,o>4194304)throw new I(e.status,"response_too_large","Taskset catalog response exceeded 4 MiB.");i+=r.decode(d.value,{stream:!0})}i+=r.decode()}finally{await s.cancel(),s.releaseLock()}let c=JSON.parse(i);if(!e.ok){let d=me.safeParse(c);throw new I(e.status,d.success?d.data.code:"invalid_error_response",d.success?d.data.message:`Taskset catalog request failed (${e.status}).`)}return c}};var g=n.string().trim().min(1).max(500),P=n.string().regex(/^[a-f0-9]{64}$/),fe=W.pick({portableProjectId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,sourceRevision:!0,sourceUpdatedAt:!0}).extend({trainingSetup:C.omit({tasksetRef:!0,rewardBindingRef:!0,tasksetRelease:!0})}).strict(),ge=n.object({schemaVersion:n.literal("openpond.tasksetPackagePublication.v1"),operationId:g,modelProjectId:g,expectedProjectEtag:P.nullable(),name:n.string().trim().min(1).max(200),description:n.string().max(5e3),buildIntent:n.enum(["demonstrations","preferences","verifiable_reward","rubric","discovery"]),methodHint:n.enum(["sft","dpo","grpo","ppo"]).nullable(),package:R,modelConfiguration:fe.optional(),evaluationPackage:R.optional(),selection:n.enum(["select","attach"]).optional()}).strict().refine(a=>a.selection!=="attach"||a.modelConfiguration===void 0,"Attachment-only publication cannot replace Model configuration.").refine(a=>!a.evaluationPackage||a.modelConfiguration!==void 0&&a.modelConfiguration.trainingSetup.evaluationTasksetRef!=null&&u(a.modelConfiguration.trainingSetup.evaluationTasksetRef)===u(j(a.evaluationPackage.taskset)),"Evaluation package must match the selected immutable evaluation in Model configuration."),ke=n.object({schemaVersion:n.literal("openpond.tasksetPackageReceipt.v1"),teamId:g,modelProjectId:g,operationId:g,taskset:b,packageHash:P,hostedTasksetId:g,projectEtag:P,project:K.optional(),selection:n.enum(["select","attach"]).optional(),evaluation:n.object({taskset:b,packageHash:P,hostedTasksetId:g}).strict().optional()}).strict(),ve=n.object({schemaVersion:n.literal("openpond.tasksetPackageReadback.v1"),teamId:g,modelProjectId:g,package:R}).strict(),we=n.object({schemaVersion:n.literal("openpond.tasksetReleasePackageReadback.v1"),teamId:g,release:b,package:R}).strict(),f=class extends Error{static{l(this,"OpenPondTasksetPackageError")}constructor(a,t,e){super(e),this.status=a,this.code=t,this.name="OpenPondTasksetPackageError"}status;code},Le=class{static{l(this,"OpenPondTasksetPackageClient")}#e;constructor(a){let t=new URL(a.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash||!a.apiKey.trim()||!a.teamId.trim())throw new Error("Taskset package client requires a clean HTTP(S) endpoint and workspace credentials.");this.#e={...a,baseUrl:t.toString().replace(/\/+$/,"")}}async publish(a,t={}){let e=ge.parse(a);H(e.package),e.evaluationPackage&&H(e.evaluationPackage);let{evaluationPackage:s,...r}=e,o=s?.contentHash===e.package.contentHash?r:e,i=ke.parse(await this.#t("","POST",o,t.signal)),c=e.package.taskset;if(i.teamId!==this.#e.teamId||i.modelProjectId!==e.modelProjectId||i.operationId!==e.operationId||i.packageHash!==e.package.contentHash||i.taskset.id!==c.id||i.taskset.revision!==c.revision||i.taskset.contentHash!==c.contentHash)throw new f(502,"package_receipt_mismatch","Taskset publication receipt did not match the requested package and owner.");if(e.selection!==void 0&&i.selection!==e.selection)throw new f(502,"package_receipt_mismatch","Taskset publication did not retain its selection mode.");if(e.evaluationPackage&&(!i.evaluation||i.evaluation.packageHash!==e.evaluationPackage.contentHash||u(i.evaluation.taskset)!==u(j(e.evaluationPackage.taskset))))throw new f(502,"package_receipt_mismatch","Taskset publication did not retain the complete selected evaluation package.");if(e.selection==="attach"&&i.projectEtag!==e.expectedProjectEtag)throw new f(502,"package_receipt_mismatch","Attaching a historical Taskset changed the Model configuration.");if(e.modelConfiguration){let d=e.modelConfiguration,p=i.project,v=J(e.package),m=C.parse({...d.trainingSetup,tasksetRef:j(c),rewardBindingRef:v?j(v):null,tasksetRelease:null});if(!p||p.teamId!==this.#e.teamId||p.etag!==i.projectEtag||![p.id,p.portableProjectId].includes(e.modelProjectId)||p.portableProjectId!==d.portableProjectId||p.name!==d.name||p.objective!==d.objective||p.sourceRevision!==d.sourceRevision||Date.parse(p.sourceUpdatedAt)!==Date.parse(d.sourceUpdatedAt)||u(p.defaultBaseModel)!==u(d.defaultBaseModel)||p.defaultDestinationId!==d.defaultDestinationId||u(p.trainingSetup)!==u(m))throw new f(502,"package_receipt_mismatch","Taskset publication did not retain the requested Model configuration.")}return i}async getByRelease(a,t={}){let e=b.parse(a),s=t.expectedPackageHash===void 0?void 0:P.parse(t.expectedPackageHash),r=we.parse(await this.#t(`/releases/${encodeURIComponent(e.id)}/${e.revision}/${e.contentHash}/package`,"GET",void 0,t.signal)),o=H(r.package),i={id:o.taskset.id,revision:o.taskset.revision,contentHash:o.taskset.contentHash};if(r.teamId!==this.#e.teamId||u(r.release)!==u(e)||u(i)!==u(e)||s!==void 0&&o.contentHash!==s)throw new f(502,"package_readback_mismatch","Independent Dataset package differs from the requested workspace or exact release.");return o}async get(a,t,e={}){let s=g.parse(a),r=b.parse(t),o=e.expectedPackageHash===void 0?void 0:P.parse(e.expectedPackageHash),i=ve.parse(await this.#t(`/${encodeURIComponent(s)}/${encodeURIComponent(r.id)}/${r.revision}/${r.contentHash}`,"GET",void 0,e.signal)),c=i.package.taskset;if(i.teamId!==this.#e.teamId||i.modelProjectId!==s||c.id!==r.id||c.revision!==r.revision||c.contentHash!==r.contentHash)throw new f(502,"package_readback_mismatch","Taskset package did not match the requested release and owner.");if(o!==void 0&&i.package.contentHash!==o)throw new f(502,"package_readback_mismatch","Taskset package did not match the saved publication receipt.");return H(i.package)}async#t(a,t,e,s){let r=e===void 0?void 0:JSON.stringify(e);if(r&&new TextEncoder().encode(r).byteLength>D)throw new f(413,"package_too_large","Taskset publication exceeds the 64 MiB envelope.");let o=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-packages${a}`,{method:t,headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json",...r?{"Content-Type":"application/json"}:{}},body:r,signal:s,redirect:"error"}),i=o.body?.getReader();if(!i)throw new f(o.status,"empty_response","Taskset package response was empty.");let c=new TextDecoder("utf-8",{fatal:!0}),d=0,p="";try{for(;;){let m=await i.read();if(m.done)break;if(d+=m.value.byteLength,d>D)throw new f(413,"package_too_large","Taskset response exceeds the 64 MiB envelope.");p+=c.decode(m.value,{stream:!0})}p+=c.decode()}finally{await i.cancel(),i.releaseLock()}let v=JSON.parse(p);if(!o.ok){let m=n.object({code:n.string(),message:n.string()}).safeParse(v);throw new f(o.status,m.success?m.data.code:"package_request_failed",m.success?m.data.message:`Taskset package request failed (${o.status}).`)}return v}};var Z=6e6,ee=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","tasks/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","metrics/policy.json","assets/manifest.json","environment/contract.json","environment/taskset.ts","rubrics/preference-review.md","comparisons/policy.json"]);function B(a){let t=T.parse(a);return!ee.has(t)&&!t.startsWith("source-artifacts/")}l(B,"isWritableTasksetDraftFilePath");function te(a){return ee.has(T.parse(a))}l(te,"isManagedTasksetDraftFilePath");function be(a,t){let e=B(a);if(t.byteLength>Z)throw new Error("Taskset draft file content is invalid or exceeds 6 MB.");let s;try{let r=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t);s=/[\u0000-\u0008\u000e-\u001f]/.test(r)?Q(t):{encoding:"utf8",data:r}}catch{s=Q(t)}return{path:a,writable:e,content:s,sizeBytes:t.byteLength,contentHash:x(t)}}l(be,"createTasksetDraftFile");function Te(a){let t=V.parse(a),e;try{if(t.encoding==="utf8")e=new TextEncoder().encode(t.data);else{let s=atob(t.data);if(btoa(s)!==t.data)throw new Error("Noncanonical base64");e=new Uint8Array(s.length);for(let r=0;r<s.length;r++)e[r]=s.charCodeAt(r)}}catch{throw new Error("Taskset draft file content is invalid or exceeds 6 MB.")}if(e.byteLength>Z)throw new Error("Taskset draft file content is invalid or exceeds 6 MB.");return e}l(Te,"decodeTasksetDraftFileContent");function Q(a){let t="";for(let e=0;e<a.length;e+=8192)t+=String.fromCharCode(...a.subarray(e,e+8192));return{encoding:"base64",data:btoa(t)}}l(Q,"base64Content");function ye(a){let t=[];a.output.renderer&&t.push({relativePath:a.output.renderer.module,source:`export async function ${a.output.renderer.exportName}(output: unknown) {
|
|
2
|
+
import{Aa as G,Ba as X,Ca as Y,F as N,_ as D,e as T,g as V,ga as R,ha as J,i as z,ja as H,oa as y,wa as E,ya as $}from"./chunk-5ZNE43XC.js";import{k as w,l as x,m as u}from"./chunk-HIQPGYVH.js";import{I as W,J as K,x as C}from"./chunk-263WS3TB.js";import{K as j}from"./chunk-XHU4BZQY.js";import{v as A}from"./chunk-ZY32SZ2P.js";import{A as n}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var S=n.string().trim().min(1).max(500),pe=n.string().regex(/^[a-f0-9]{64}$/),b=n.object({id:S,revision:n.number().int().positive(),contentHash:pe}).strict(),M=n.object({schemaVersion:n.literal("openpond.hostedTasksetSummary.v1"),id:S,teamId:S,release:b,name:n.string().min(1).max(500),description:n.string().max(2e4),taskCount:n.number().int().nonnegative(),buildIntent:n.string().min(1).max(100),methodHint:n.string().min(1).max(100).nullable(),packageBytes:n.number().int().nonnegative().nullable(),storedBytes:n.number().int().nonnegative().nullable(),createdAt:n.string().datetime({offset:!0})}).strict(),ue=n.object({afterId:n.string().trim().min(1).max(2e3).optional(),limit:n.number().int().min(1).max(100).default(30),modelProjectId:S.optional(),projectId:S.optional(),search:n.string().trim().max(100).optional(),sort:n.enum(["id","name","updated"]).default("id")}).strict(),he=n.object({items:n.array(M).max(100),nextCursor:n.string().trim().min(1).max(2e3).nullable()}).strict(),me=n.object({code:n.string().min(1),message:n.string().min(1)}).strict(),I=class extends Error{static{l(this,"OpenPondTasksetCatalogError")}constructor(a,t,e){super(e),this.status=a,this.code=t,this.name="OpenPondTasksetCatalogError"}status;code},_e=class{static{l(this,"OpenPondTasksetCatalogClient")}#e;constructor(a){if(!a.apiKey.trim()||!a.teamId.trim())throw new Error("Taskset API key and workspace are required.");let t=new URL(a.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Taskset base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...a,baseUrl:t.toString().replace(/\/+$/,"")}}async list(a={},t={}){let e=ue.parse(a),s=new URLSearchParams({limit:String(e.limit)});e.afterId&&s.set("afterId",e.afterId),e.modelProjectId&&s.set("modelProjectId",e.modelProjectId),e.projectId&&s.set("projectId",e.projectId),e.search!==void 0&&s.set("search",e.search),s.set("sort",e.sort);let r=he.parse(await this.#t(`?${s}`,t.signal));if(r.items.length>e.limit||new Set(r.items.map(o=>o.id)).size!==r.items.length||r.items.some(o=>o.teamId!==this.#e.teamId))throw new I(502,"catalog_scope_mismatch","Taskset inventory did not match the requested workspace or page size.");return r}async get(a,t={}){let e=S.parse(a),s=M.parse(await this.#t(`/${encodeURIComponent(e)}`,t.signal));if(s.id!==e||s.teamId!==this.#e.teamId)throw new I(502,"catalog_identity_mismatch","Taskset metadata did not match the requested identity.");return s}async resolve(a,t={}){let e=b.parse(a),s=M.parse(await this.#t(`/releases/${encodeURIComponent(e.id)}/${e.revision}/${e.contentHash}`,t.signal));if(s.teamId!==this.#e.teamId||s.release.id!==e.id||s.release.revision!==e.revision||s.release.contentHash!==e.contentHash)throw new I(502,"catalog_release_mismatch","Taskset metadata did not match the requested immutable release.");return s}async#t(a,t){let e=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-catalog${a}`,{headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json"},signal:t,redirect:"error"}),s=e.body?.getReader();if(!s)throw new I(e.status,"empty_response","Taskset catalog response was empty.");let r=new TextDecoder,o=0,i="";try{for(;;){let d=await s.read();if(d.done)break;if(o+=d.value.byteLength,o>4194304)throw new I(e.status,"response_too_large","Taskset catalog response exceeded 4 MiB.");i+=r.decode(d.value,{stream:!0})}i+=r.decode()}finally{await s.cancel(),s.releaseLock()}let c=JSON.parse(i);if(!e.ok){let d=me.safeParse(c);throw new I(e.status,d.success?d.data.code:"invalid_error_response",d.success?d.data.message:`Taskset catalog request failed (${e.status}).`)}return c}};var g=n.string().trim().min(1).max(500),P=n.string().regex(/^[a-f0-9]{64}$/),fe=W.pick({portableProjectId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,sourceRevision:!0,sourceUpdatedAt:!0}).extend({trainingSetup:C.omit({tasksetRef:!0,rewardBindingRef:!0,tasksetRelease:!0})}).strict(),ge=n.object({schemaVersion:n.literal("openpond.tasksetPackagePublication.v1"),operationId:g,modelProjectId:g,expectedProjectEtag:P.nullable(),name:n.string().trim().min(1).max(200),description:n.string().max(5e3),buildIntent:n.enum(["demonstrations","preferences","verifiable_reward","rubric","discovery"]),methodHint:n.enum(["sft","dpo","grpo","ppo"]).nullable(),package:R,modelConfiguration:fe.optional(),evaluationPackage:R.optional(),selection:n.enum(["select","attach"]).optional()}).strict().refine(a=>a.selection!=="attach"||a.modelConfiguration===void 0,"Attachment-only publication cannot replace Model configuration.").refine(a=>!a.evaluationPackage||a.modelConfiguration!==void 0&&a.modelConfiguration.trainingSetup.evaluationTasksetRef!=null&&u(a.modelConfiguration.trainingSetup.evaluationTasksetRef)===u(j(a.evaluationPackage.taskset)),"Evaluation package must match the selected immutable evaluation in Model configuration."),ke=n.object({schemaVersion:n.literal("openpond.tasksetPackageReceipt.v1"),teamId:g,modelProjectId:g,operationId:g,taskset:b,packageHash:P,hostedTasksetId:g,projectEtag:P,project:K.optional(),selection:n.enum(["select","attach"]).optional(),evaluation:n.object({taskset:b,packageHash:P,hostedTasksetId:g}).strict().optional()}).strict(),ve=n.object({schemaVersion:n.literal("openpond.tasksetPackageReadback.v1"),teamId:g,modelProjectId:g,package:R}).strict(),we=n.object({schemaVersion:n.literal("openpond.tasksetReleasePackageReadback.v1"),teamId:g,release:b,package:R}).strict(),f=class extends Error{static{l(this,"OpenPondTasksetPackageError")}constructor(a,t,e){super(e),this.status=a,this.code=t,this.name="OpenPondTasksetPackageError"}status;code},Le=class{static{l(this,"OpenPondTasksetPackageClient")}#e;constructor(a){let t=new URL(a.baseUrl);if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.search||t.hash||!a.apiKey.trim()||!a.teamId.trim())throw new Error("Taskset package client requires a clean HTTP(S) endpoint and workspace credentials.");this.#e={...a,baseUrl:t.toString().replace(/\/+$/,"")}}async publish(a,t={}){let e=ge.parse(a);H(e.package),e.evaluationPackage&&H(e.evaluationPackage);let{evaluationPackage:s,...r}=e,o=s?.contentHash===e.package.contentHash?r:e,i=ke.parse(await this.#t("","POST",o,t.signal)),c=e.package.taskset;if(i.teamId!==this.#e.teamId||i.modelProjectId!==e.modelProjectId||i.operationId!==e.operationId||i.packageHash!==e.package.contentHash||i.taskset.id!==c.id||i.taskset.revision!==c.revision||i.taskset.contentHash!==c.contentHash)throw new f(502,"package_receipt_mismatch","Taskset publication receipt did not match the requested package and owner.");if(e.selection!==void 0&&i.selection!==e.selection)throw new f(502,"package_receipt_mismatch","Taskset publication did not retain its selection mode.");if(e.evaluationPackage&&(!i.evaluation||i.evaluation.packageHash!==e.evaluationPackage.contentHash||u(i.evaluation.taskset)!==u(j(e.evaluationPackage.taskset))))throw new f(502,"package_receipt_mismatch","Taskset publication did not retain the complete selected evaluation package.");if(e.selection==="attach"&&i.projectEtag!==e.expectedProjectEtag)throw new f(502,"package_receipt_mismatch","Attaching a historical Taskset changed the Model configuration.");if(e.modelConfiguration){let d=e.modelConfiguration,p=i.project,v=J(e.package),m=C.parse({...d.trainingSetup,tasksetRef:j(c),rewardBindingRef:v?j(v):null,tasksetRelease:null});if(!p||p.teamId!==this.#e.teamId||p.etag!==i.projectEtag||![p.id,p.portableProjectId].includes(e.modelProjectId)||p.portableProjectId!==d.portableProjectId||p.name!==d.name||p.objective!==d.objective||p.sourceRevision!==d.sourceRevision||Date.parse(p.sourceUpdatedAt)!==Date.parse(d.sourceUpdatedAt)||u(p.defaultBaseModel)!==u(d.defaultBaseModel)||p.defaultDestinationId!==d.defaultDestinationId||u(p.trainingSetup)!==u(m))throw new f(502,"package_receipt_mismatch","Taskset publication did not retain the requested Model configuration.")}return i}async getByRelease(a,t={}){let e=b.parse(a),s=t.expectedPackageHash===void 0?void 0:P.parse(t.expectedPackageHash),r=we.parse(await this.#t(`/releases/${encodeURIComponent(e.id)}/${e.revision}/${e.contentHash}/package`,"GET",void 0,t.signal)),o=H(r.package),i={id:o.taskset.id,revision:o.taskset.revision,contentHash:o.taskset.contentHash};if(r.teamId!==this.#e.teamId||u(r.release)!==u(e)||u(i)!==u(e)||s!==void 0&&o.contentHash!==s)throw new f(502,"package_readback_mismatch","Independent Dataset package differs from the requested workspace or exact release.");return o}async get(a,t,e={}){let s=g.parse(a),r=b.parse(t),o=e.expectedPackageHash===void 0?void 0:P.parse(e.expectedPackageHash),i=ve.parse(await this.#t(`/${encodeURIComponent(s)}/${encodeURIComponent(r.id)}/${r.revision}/${r.contentHash}`,"GET",void 0,e.signal)),c=i.package.taskset;if(i.teamId!==this.#e.teamId||i.modelProjectId!==s||c.id!==r.id||c.revision!==r.revision||c.contentHash!==r.contentHash)throw new f(502,"package_readback_mismatch","Taskset package did not match the requested release and owner.");if(o!==void 0&&i.package.contentHash!==o)throw new f(502,"package_readback_mismatch","Taskset package did not match the saved publication receipt.");return H(i.package)}async#t(a,t,e,s){let r=e===void 0?void 0:JSON.stringify(e);if(r&&new TextEncoder().encode(r).byteLength>D)throw new f(413,"package_too_large","Taskset publication exceeds the 64 MiB envelope.");let o=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/taskset-packages${a}`,{method:t,headers:{Authorization:`Bearer ${this.#e.apiKey}`,"X-OpenPond-Team-Id":this.#e.teamId,Accept:"application/json",...r?{"Content-Type":"application/json"}:{}},body:r,signal:s,redirect:"error"}),i=o.body?.getReader();if(!i)throw new f(o.status,"empty_response","Taskset package response was empty.");let c=new TextDecoder("utf-8",{fatal:!0}),d=0,p="";try{for(;;){let m=await i.read();if(m.done)break;if(d+=m.value.byteLength,d>D)throw new f(413,"package_too_large","Taskset response exceeds the 64 MiB envelope.");p+=c.decode(m.value,{stream:!0})}p+=c.decode()}finally{await i.cancel(),i.releaseLock()}let v=JSON.parse(p);if(!o.ok){let m=n.object({code:n.string(),message:n.string()}).safeParse(v);throw new f(o.status,m.success?m.data.code:"package_request_failed",m.success?m.data.message:`Taskset package request failed (${o.status}).`)}return v}};var Z=6e6,ee=new Set(["taskset.json","capabilities.json","data/tasks.jsonl","tasks/tasks.jsonl","graders/graders.json","fixtures/grader-fixtures.json","metrics/policy.json","assets/manifest.json","environment/contract.json","environment/taskset.ts","rubrics/preference-review.md","comparisons/policy.json"]);function B(a){let t=T.parse(a);return!ee.has(t)&&!t.startsWith("source-artifacts/")}l(B,"isWritableTasksetDraftFilePath");function te(a){return ee.has(T.parse(a))}l(te,"isManagedTasksetDraftFilePath");function be(a,t){let e=B(a);if(t.byteLength>Z)throw new Error("Taskset draft file content is invalid or exceeds 6 MB.");let s;try{let r=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t);s=/[\u0000-\u0008\u000e-\u001f]/.test(r)?Q(t):{encoding:"utf8",data:r}}catch{s=Q(t)}return{path:a,writable:e,content:s,sizeBytes:t.byteLength,contentHash:x(t)}}l(be,"createTasksetDraftFile");function Te(a){let t=V.parse(a),e;try{if(t.encoding==="utf8")e=new TextEncoder().encode(t.data);else{let s=atob(t.data);if(btoa(s)!==t.data)throw new Error("Noncanonical base64");e=new Uint8Array(s.length);for(let r=0;r<s.length;r++)e[r]=s.charCodeAt(r)}}catch{throw new Error("Taskset draft file content is invalid or exceeds 6 MB.")}if(e.byteLength>Z)throw new Error("Taskset draft file content is invalid or exceeds 6 MB.");return e}l(Te,"decodeTasksetDraftFileContent");function Q(a){let t="";for(let e=0;e<a.length;e+=8192)t+=String.fromCharCode(...a.subarray(e,e+8192));return{encoding:"base64",data:btoa(t)}}l(Q,"base64Content");function ye(a){let t=[];a.output.renderer&&t.push({relativePath:a.output.renderer.module,source:`export async function ${a.output.renderer.exportName}(output: unknown) {
|
|
3
3
|
// Return artifact paths or bytes derived from the model's structured output.
|
|
4
4
|
return output;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as g}from"./chunk-
|
|
2
|
+
import{b as g}from"./chunk-VPAEFG7X.js";import{A as p}from"./chunk-X2J2P5ZT.js";import{a as o}from"./chunk-FTQLQJQV.js";var x=p.object({schemaVersion:p.literal("openpond.taskAuthoringDecision.v1"),proposal:g}),T=10*6e4;function S(e){return b(e)}o(S,"createTaskAuthoringMessages");function A(e,n){let r=f(e);if(!r)throw new Error("Task authoring returned invalid structured output.");let i=h(r.proposal),s=m(i,n);if(s)throw new Error(`Task authoring returned an incompatible proposal: ${s}`);return i}o(A,"parseTaskAuthoringDecision");async function P(e){let n=w(e.signal,e.timeoutMs??T);try{let r=b(e),i=await y(e.stream({model:e.model,reasoningEffort:e.reasoningEffort,messages:r,signal:n.signal})),s=f(i),d=s?h(s.proposal):null,t=d?m(d,e.evidence):null;if(d&&!t)return{proposal:d,repairHistory:[]};let l=s?`The prior proposal is incompatible with the current Taskset materializer: ${t} Redesign it without changing the selected evidence.`:`The prior response was invalid. Return only valid JSON matching openpond.taskAuthoringDecision.v1. Invalid response:
|
|
3
3
|
${i.slice(0,2e4)}`,u=await y(e.stream({model:e.model,reasoningEffort:e.reasoningEffort,signal:n.signal,messages:[...r,{role:"user",content:l}]})),c=f(u);if(!c)throw new Error("Task authoring model returned invalid structured output after one repair attempt.");let a=h(c.proposal),v=m(a,e.evidence);if(v)throw new Error(`Task authoring model returned an incompatible proposal after one repair attempt: ${v}`);return{proposal:a,repairHistory:[{attempt:1,summary:"Repaired invalid or method-incompatible TaskDesignProposal output.",createdAt:new Date().toISOString()}]}}catch(r){throw n.signal.aborted&&!e.signal.aborted?new Error(`Task authoring timed out after ${n.timeoutMs}ms.`):r}finally{n.cleanup()}}o(P,"authorTaskDesignWithModel");function b(e){return[{role:"system",content:["You are OpenPond Taskset Authoring.","Use only the consented evidence supplied below.","Diagnose the work before designing a task. Repetition alone is not evidence that weights are the right intervention.","Produce one provider-neutral capability diagnosis and, only when justified, one task design. Separate policy-visible input from privileged outcomes.","The diagnosis must identify stableBehavior, changingKnowledge, requiredContext, requiredTools, the recommended intervention, whether training is eligible, and an evidence-backed rationale.","Use intervention=no_training when the behavior is already reliable or lacks a coherent repeated job. Use prompting when instructions or application logic are sufficient. Use retrieval when the primary value is changing facts or documents.","Prefer deterministic graders. Model judges must be calibrated and cannot silently become reward.","Do not fabricate expert approval, preferences, corrections, or rewards.","A methodHint is a user preference, not permission to misclassify the evidence. Explain a different recommendation when the hint is unsuitable.","A buildIntent is the learning signal the user wants to construct, not permission to invent unsupported demonstrations, preferences, rewards, or labels.","Historical assistant messages are candidate outcomes, not automatically approved truth. Exclude stale, contradictory, speculative, context-incomplete, or unsuccessful answers.","Explicitly selected local chats may supply extracted candidate examples when the assistant output is complete, internally consistent, and supports the stated objective. Do not require a separate historical expert-approval field; final approval occurs when the user creates the Taskset.","For each usable example, populate proposedExamples with its exact input and expected output, source and turn provenance, split, origin, and rationale.","Use origin=extracted only when inputPrompt and expectedOutputText exactly match the selected user/assistant pair. Label any repaired or newly generated text corrected or synthetic.","Keep every source cluster wholly within one data split. Evaluation examples should come from independent conversations when available.","For no_training, prompting, or retrieval recommendations, set trainingEligible=false, proposedMethod to none or retrieval as appropriate, and leave proposedExamples, graders, fixtures, and generated files empty.","Recommend provider-neutral methods from the evidence. A versioned executable environment with deterministic reward variance may justify GRPO even when the current local destination can execute only a separately labeled SFT trajectory bootstrap.","For Cross-System Operations traces, preserve the four required tools, the shared tool-contract hash, structured tool messages, split-isolated worlds, and the exact trajectory verifier. Never relabel the primary GRPO recommendation as SFT because local GPU execution is unavailable.","Generated verifier paths and custom-verifier modules must start with graders/. Fixture files must start with fixtures/ and environment files with environment/.","Return JSON only: {schemaVersion:'openpond.taskAuthoringDecision.v1', proposal: TaskDesignProposal}.",`TaskDesignProposal JSON schema:
|
|
4
4
|
${JSON.stringify(p.toJSONSchema(g),null,2)}`,"Follow the bundled Taskset Authoring skill below:",e.skillText].join(`
|
|
5
5
|
`)},{role:"user",content:JSON.stringify({proposalId:e.id,buildIntent:e.buildIntent,buildSpecification:e.buildSpecification,methodHint:e.methodHint??null,instruction:e.instruction??null,currentProposal:e.currentProposal??null,evidence:e.evidence},null,2)}]}o(b,"taskAuthoringMessages");function m(e,n){if(new Set(["no_training","prompting","retrieval"]).has(e.diagnosis.intervention)&&e.diagnosis.trainingEligible)return`${e.diagnosis.intervention} cannot be trainingEligible.`;if(e.diagnosis.intervention==="retrieval"&&e.proposedMethod!=="retrieval")return"Retrieval diagnoses must set proposedMethod=retrieval.";if((e.diagnosis.intervention==="no_training"||e.diagnosis.intervention==="prompting")&&e.proposedMethod!=="none")return`${e.diagnosis.intervention} diagnoses must set proposedMethod=none.`;if(!e.diagnosis.trainingEligible&&(e.proposedExamples.length||e.proposedGraders.length||e.graderFixtures.length||e.generatedFiles.length))return"Non-training diagnoses must not package training examples, graders, fixtures, or generated files.";if(e.diagnosis.trainingEligible&&e.diagnosis.stableBehavior.length===0)return"Training-eligible diagnoses must identify at least one stable behavior.";let i=new Set(n.map(t=>t.source.id));if(e.sourceIds.some(t=>!i.has(t)))return"proposal sourceIds must stay within the selected evidence.";for(let t of e.proposedExamples){if(!i.has(t.sourceId))return`Example ${t.id} references unselected source ${t.sourceId}.`;if(t.origin!=="extracted")continue;if(!t.sourceTurnId)return`Extracted example ${t.id} must declare sourceTurnId.`;let l=n.find(a=>a.source.id===t.sourceId),u=l?.excerpts.find(a=>a.role==="user"&&a.turnId===t.sourceTurnId),c=l?.excerpts.find(a=>a.role==="assistant"&&a.turnId===t.sourceTurnId);if(!u||u.text!==t.inputPrompt||!c||c.text!==t.expectedOutputText)return`Extracted example ${t.id} must exactly match its selected user/assistant pair.`}if(!e.diagnosis.trainingEligible)return null;if(!e.policy.policyVisibleFields.includes("input.prompt"))return"policyVisibleFields must include input.prompt.";if(!e.policy.privilegedFields.includes("expectedOutput.text"))return"privilegedFields must include expectedOutput.text.";if(e.proposedGraders.length===0)return"Training-eligible proposals must include an evaluation grader.";let s={verifier:"graders/",fixture:"fixtures/",environment:"environment/"};for(let t of e.generatedFiles)if(!t.path.replaceAll("\\","/").startsWith(s[t.role]))return`${t.role} file ${t.path} must start with ${s[t.role]}.`;let d=new Set(e.generatedFiles.map(t=>t.path.replaceAll("\\","/")));for(let t of e.proposedGraders){if(t.kind!=="custom_verifier")continue;let l=t.module.replaceAll("\\","/");if(!l.startsWith("graders/"))return`custom verifier ${t.id} module must start with graders/.`;if(!d.has(l))return`custom verifier ${t.id} module ${l} must have a matching generated file.`}return null}o(m,"proposalCompatibilityIssue");function h(e){return e.diagnosis.trainingEligible?g.parse({...e,policy:{...e.policy,policyVisibleFields:[...new Set([...e.policy.policyVisibleFields,"input.prompt"])],privilegedFields:[...new Set([...e.policy.privilegedFields,"expectedOutput.text"])]}}):e}o(h,"normalizePolicyBoundary");function w(e,n){let r=new AbortController,i=o(()=>r.abort(e.reason),"abortFromParent");e.aborted?i():e.addEventListener("abort",i,{once:!0});let s=setTimeout(()=>r.abort(new Error(`Task authoring timed out after ${n}ms.`)),n);return s.unref?.(),{signal:r.signal,timeoutMs:n,cleanup:o(()=>{clearTimeout(s),e.removeEventListener("abort",i)},"cleanup")}}o(w,"authoringTimeoutSignal");function f(e){let n=[e,e.replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"")];for(let r of n)try{let i=x.safeParse(JSON.parse(r));if(i.success)return i.data}catch{}return null}o(f,"parseEnvelope");async function y(e){let n="";for await(let r of e)r.text&&(n+=r.text);return n}o(y,"collect");export{S as a,A as b,P as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{c as D}from"./chunk-IR3YJWPW.js";import{Wb as G}from"./chunk-CJDGLPNX.js";import{b as $,c as z,d as H,e as V,f as R,g as U}from"./chunk-I6VMRQF4.js";import{P,R as Q}from"./chunk-XHU4BZQY.js";import{fb as q,v,x as T}from"./chunk-ZY32SZ2P.js";import{n as E}from"./chunk-RCT3O3HQ.js";import{A as n}from"./chunk-X2J2P5ZT.js";import{a}from"./chunk-FTQLQJQV.js";async function K(e){let t=F(await e),[o,c,{QuickJSWASMModule:w}]=await Promise.all([t.importModuleLoader().then(F),t.importFFI(),import("./module-ES6BEMUI-ZVL3F6NW.js").then(F)]),l=await o();l.type="sync";let s=new c(l);return new w(l,s)}a(K,"newQuickJSWASMModuleFromVariant");function F(e){return e&&"default"in e&&e.default?e.default&&"default"in e.default&&e.default.default?e.default.default:e.default:e}a(F,"smartUnwrap");var k=class extends Error{static{a(this,"JavaScriptIsolateExecutionError")}constructor(t){super(t),this.name="JavaScriptIsolateExecutionError"}};async function O(e,t){te(e),e.signal?.throwIfAborted();let o=a(s=>new Error(`${e.errorPrefix}_${s}`),"error"),c=Date.now()+e.timeoutMs,{default:w}=await import("./dist-SKYG5LZO.js");e.signal?.throwIfAborted();let l=await K(w);e.signal?.throwIfAborted();try{return D.withScope(s=>{let m=s.manage(l.newRuntime());m.setMemoryLimit(33554432),m.setMaxStackSize(262144),m.setInterruptHandler(()=>Date.now()>=c||e.signal?.aborted===!0);let i=s.manage(m.newContext());t&&(c=Date.now()+e.timeoutMs,t.onExecutionReady()),e.deterministic&&s.manage(i.unwrapResult(i.evalCode("globalThis.Date = undefined; Math.random = () => { throw new Error('environment_random_requires_explicit_seed'); };")));let r=s.manage(i.unwrapResult(i.evalCode("JSON.stringify"))),p=s.manage(i.unwrapResult(i.evalCode(`JSON.parse(${JSON.stringify(JSON.stringify(e.value))})`))),S=s.manage(i.unwrapResult(i.evalCode(e.source,`${e.errorPrefix}.mjs`,{type:"module"}))),M=s.manage(X(i,S,c,e.signal,o)),g=s.manage(i.getProp(M,e.exportName));if(i.typeof(g)!=="function")throw o("function_export_missing");let b=s.manage(i.unwrapResult(i.callFunction(g,i.undefined,p))),d=s.manage(X(i,b,c,e.signal,o)),h=s.manage(i.unwrapResult(i.callFunction(r,i.undefined,d)));if(i.typeof(h)!=="string")throw o("result_not_json");let y=i.getString(h);if(new TextEncoder().encode(y).byteLength>e.maxResultBytes)throw o("result_too_large");if(e.signal?.throwIfAborted(),Date.now()>=c)throw o("timeout");let f=JSON.parse(y);return v(f,e.maxResultBytes),f})}catch(s){throw e.signal?.throwIfAborted(),new k(s instanceof Error?s.message:"JavaScript execution failed.")}}a(O,"executeJavaScriptIsolate");function te(e){if(!Number.isInteger(e.timeoutMs)||e.timeoutMs<1||e.timeoutMs>3e5)throw new Error(`${e.errorPrefix}_timeout_invalid`);if(!Number.isInteger(e.maxResultBytes)||e.maxResultBytes<1||e.maxResultBytes>4194304)throw new Error(`${e.errorPrefix}_result_limit_invalid`);if(new TextEncoder().encode(e.source).byteLength>524288)throw new Error(`${e.errorPrefix}_source_too_large`);v(e.value,4194304)}a(te,"validateJavaScriptIsolateInput");function X(e,t,o,c,w){for(;;){if(c?.throwIfAborted(),Date.now()>=o)throw w("timeout");let l=e.getPromiseState(t);if(l.type==="fulfilled")return l.notAPromise?l.value.dup():l.value;if(l.type==="rejected")return e.unwrapResult(l);if(e.runtime.executePendingJobs(1).unwrap()===0)throw w("unresolved_promise")}}a(X,"settle");function I(e,t){let o=t.scope==="arguments"?e.action?.arguments:e[t.scope];for(let c of t.path){if(!o||typeof o!="object"||!Object.hasOwn(o,c))throw new Error("environment_service_reference_missing");o=o[c]}return o}a(I,"resolveValue");async function Y(e,t){if(!e.executionServices?.length)return t.controller(e);if(!Number.isSafeInteger(e.timeoutMs)||e.timeoutMs<1||e.timeoutMs>3e4)throw new Error("environment_timeout_invalid");v(e.value,4194304);let o=e.executionServices.map(m=>z.parse(m));if(o.length>16)throw new Error("environment_service_limit");if(new Set(o.map(m=>m.id)).size!==o.length)throw new Error("environment_service_identity_collision");let c=Date.now(),w=new AbortController,l=e.signal?AbortSignal.any([e.signal,w.signal]):w.signal,s=setTimeout(()=>w.abort(new Error("environment_timeout")),e.timeoutMs);try{let m=Object.create(null);for(let r of o){if(l.throwIfAborted(),r.operation!==e.operation||r.operation==="step"&&r.toolName!==e.value.action?.name)throw new Error("environment_service_operation_mismatch");let p=Math.min(r.timeoutMs,e.timeoutMs-(Date.now()-c));if(p<1)throw new Error("environment_timeout");let S=new AbortController,M=AbortSignal.any([l,S.signal]),g=setTimeout(()=>S.abort(new Error("environment_service_timeout")),p),b=Date.now();try{if(r.kind==="sqlite.v1"){if(!t.sql)throw new Error("environment_sql_executor_required");let d=I(e.value,r.sql);if(typeof d!="string"||!d.length||new TextEncoder().encode(d).byteLength>65536||d.includes("\0")){m[r.id]={status:"rejected",code:"invalid_submission"};continue}let h=$({schemaVersion:"openpond.sqlExecution.v1",snapshot:I(e.value,r.snapshot),sql:d,maxRows:r.maxRows,maxResultBytes:r.maxResultBytes});m[r.id]=await t.sql({request:h,timeoutMs:e.timeoutMs,signal:M})}else{let d=I(e.value,r.source),h=I(e.value,r.cases);if(typeof d!="string"||new TextEncoder().encode(d).byteLength>524288){m[r.id]={status:"rejected",code:"invalid_submission"};continue}if(!Array.isArray(h)||!h.length||h.length>r.maxCases||h.some(f=>!f||typeof f!="object"||!Object.hasOwn(f,"input")))throw new Error("environment_service_cases_invalid");let y=[];for(let f of h){let u=p-(Date.now()-b);if(u<1&&(S.abort(new Error("environment_service_timeout")),M.throwIfAborted()),y.push(await t.candidate({source:d,exportName:r.exportName,value:structuredClone(f.input),timeoutMs:Math.max(1,u),maxResultBytes:r.maxResultBytes,deterministic:!0,errorPrefix:"candidate",signal:M})),new TextEncoder().encode(JSON.stringify({status:"completed",cases:y})).byteLength>r.maxResultBytes)throw new k("candidate_result_too_large")}m[r.id]={status:"completed",cases:y}}}catch(d){if(l.throwIfAborted(),S.signal.aborted)m[r.id]={status:"rejected",code:"timeout"};else if(d instanceof k)m[r.id]={status:"rejected",code:"execution_failed"};else throw d}finally{clearTimeout(g)}}l.throwIfAborted();let i=e.timeoutMs-(Date.now()-c);if(i<1)throw new Error("environment_timeout");return await t.controller({...e,executionServices:void 0,value:{...e.value,services:m},timeoutMs:i,signal:l})}finally{clearTimeout(s)}}a(Y,"executeEnvironmentWithServices");async function re(e){let t=V.parse(e.operation);return Y(e,{candidate:O,controller:a(async o=>R.parse(await O({...o,exportName:t,maxResultBytes:1572864,deterministic:!0,errorPrefix:"environment"})),"controller")})}a(re,"executeJavaScriptEnvironment");var J=class extends Error{static{a(this,"JavaScriptEnvironmentActionError")}code;constructor(t){super(`environment_${t}`),this.code=t,this.name="JavaScriptEnvironmentActionError"}};async function Qe(e){let t=U(e.definition),o=Q(e.asset,t.module);if(!Number.isSafeInteger(e.seed))throw new Error("environment_seed_invalid");let c=e.seed;v(e.input,1048576),v(e.initialState,t.maxStateBytes);let w=structuredClone(e.input),l=structuredClone(e.initialState),s=e.execute??re,m=new AbortController,i=e.signal?AbortSignal.any([e.signal,m.signal]):m.signal,r={},p=0,S=!1,M=!1,g=null,b=[],d=null;async function h(f,u){if(S||M)throw new Error("environment_closed");if(g)throw new Error("environment_operation_in_progress");i.throwIfAborted(),u&&(v(u,262144),u=structuredClone(u));let L=E(r),_=u?t.tools.find(x=>x.name===u.name):null;if(f==="step"){if(p>=t.maxSteps)throw new J("step_budget_exhausted");p++}let j=a((x,C)=>b.push({sequence:b.length,operation:f,toolName:u?.name??null,arguments:u?structuredClone(u.arguments):null,observation:x,beforeStateHash:L,afterStateHash:E(r),error:C}),"record");try{if(u&&!_)throw new J("unknown_tool");if(u&&_&&!T(_.inputSchema,u.arguments).valid)throw new J("invalid_arguments");let x=t.executionServices?.filter(N=>N.operation===f&&(f!=="step"||N.toolName===u?.name)),C=s({source:o,operation:f,value:{input:w,initialState:l,seed:c,state:structuredClone(r),sequence:p,action:u?structuredClone(u):null},timeoutMs:Math.min(t.operationTimeoutMs,_?.timeoutMs??t.operationTimeoutMs),signal:i,...x?.length?{executionServices:x}:{}});g=C;let A=R.parse(await C);if(i.throwIfAborted(),v(A.state,t.maxStateBytes),v(A.observation,t.maxObservationBytes),(f==="collect"||_?.sideEffect==="read")&&E(A.state)!==L)throw new Error("environment_read_changed_state");r=structuredClone(A.state);let B=structuredClone(A.observation);return j(B,null),{state:structuredClone(r),observation:B}}catch(x){throw j(null,x instanceof Error?x.message:"environment_execution_failed"),x}finally{g=null}}a(h,"invoke");async function y(){return d||(M=!0,m.abort(new Error("environment_destroyed")),d=(async()=>{try{try{await g}catch{}await s({source:o,operation:"destroy",value:{input:w,initialState:l,seed:c,state:structuredClone(r),sequence:p,action:null},timeoutMs:t.operationTimeoutMs})}finally{r={},S=!0}})(),d)}a(y,"destroy");try{await h("create");let f=await h("reset"),u=E(r),L=a(()=>{if(S)throw new Error("environment_closed");return{definition:{id:t.id,revision:t.revision,contentHash:t.contentHash},inputHash:E(w),seed:c,initialStateHash:u,finalStateHash:E(r),state:structuredClone(r),events:structuredClone(b)}},"snapshot");return{definition:structuredClone(t),observation:f.observation,async step(_){return(await h("step",_)).observation},async collect(){let _=await h("collect");return{...L(),observation:_.observation}},snapshot:L,destroy:y}}catch(f){try{await y()}catch{}throw f}}a(Qe,"createJavaScriptEnvironmentSession");var ne=n.string().trim().min(1).max(500),oe=n.string().regex(/^[a-f0-9]{64}$/),W=n.object({kind:n.literal("model"),id:n.string().trim().min(1).max(191),taskId:ne,admissionHash:oe,model:G,instructions:n.string().max(262144),harness:q.optional(),input:n.record(n.string(),n.unknown()),policyVisibleContext:n.record(n.string(),n.unknown()),timeoutMs:n.number().int().positive().max(36e5),environment:n.discriminatedUnion("kind",[n.object({kind:n.literal("text")}).strict(),n.object({kind:n.literal("javascript"),definition:H,asset:P,initialState:n.record(n.string(),n.unknown()),seed:n.number().int().safe()}).strict()])}).strict(),Ye=n.discriminatedUnion("kind",[W,n.object({kind:n.literal("profile"),request:n.unknown()}).strict()]);var Z=n.string().trim().min(1).max(200),mt=n.object({receiptId:Z,taskId:Z,seed:n.string(),request:W}).strict(),ee=class extends Error{constructor(o,c,w=409){super(c);this.code=o;this.status=w}code;status;static{a(this,"LocalExperimentError")}};export{k as a,te as b,Y as c,J as d,Qe as e,W as f,Ye as g,ee as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-TBODQT4W.js";import{a as b,c as p,d as S,e as _,f as O,g as x}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-TBODQT4W.js";import{a as b,c as p,d as S,e as _,f as O,g as x}from"./chunk-UNE52L3Y.js";import{Bb as f,Cb as w,Db as c,Eb as R,Fb as q,L as m,lb as g,vb as L,zb as y}from"./chunk-XHU4BZQY.js";import{v as h}from"./chunk-ZY32SZ2P.js";import{A as i}from"./chunk-X2J2P5ZT.js";import{a as l}from"./chunk-FTQLQJQV.js";var C=i.object({batchId:i.string().trim().min(1).max(500),modelProjectId:i.string().trim().min(1).max(500)}).strict(),k=i.object({batchId:i.string().min(1),projectId:i.string().min(1),tasksetId:i.string().min(1),releaseId:i.string().min(1),revision:i.number().int().positive(),contentHash:i.string().regex(/^[a-f0-9]{64}$/)}).strict(),P=class{static{l(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 s=w.parse({scope:this.#e.scope,command:e}),n=q.parse(await this.#t("commands",s,t));if(n.operationId!==e.operationId)throw new a(502,"operation_identity_mismatch","Learning response did not match the submitted operation.",null);return n}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,s,n={}){let r=c.parse({action:"get",scope:this.#e.scope,kind:e,id:t,...s===void 0?{}:{revision:s}});return g[e].parse(await this.#t("read",r,n))}async inspectEvidence(e,t={}){let s=c.parse({action:"inspect_evidence",scope:this.#e.scope,evidence:e}),n=R.parse(await this.#t("read",s,t));if(!m(n.evidence,e))throw new a(502,"evidence_identity_mismatch","Inspection did not match the requested evidence release.",null);return n}async inspectTaskQueue(e=null,t={}){let s=c.parse({action:"inspect_task_queue",scope:this.#e.scope,modelProjectId:e}),n=y.parse(await this.#t("read",s,t));if(n.modelProjectId!==e)throw new a(502,"model_identity_mismatch","Task queue did not match the requested Model.",null);return n}async inspectPolicy(e,t={}){let s=c.parse({action:"inspect_policy",scope:this.#e.scope,policy:e}),n=L.parse(await this.#t("read",s,t));if(!m(n.policy,e))throw new a(502,"policy_identity_mismatch","Inspection did not match the requested policy release.",null);return n}async createSourceCredential(e,t={}){let s=p.parse({...e,action:"create",scope:this.#e.scope}),n=S.parse(await this.#t("credentials",s,t));if(this.#n(n.credential,e.sourceId),n.apiKey!==e.apiKey||!e.apiKey.startsWith(`${n.credential.keyPrefix}_`))throw new a(502,"credential_identity_mismatch","Credential response did not match the prepared credential.",null);return n}async listSourceCredentials(e,t={},s={}){let n=p.parse({...t,action:"list",scope:this.#e.scope,sourceId:e}),r=_.parse(await this.#t("credentials",n,s));if(r.items.length>(t.limit??30))throw new a(502,"credential_page_invalid","Credential response exceeded the requested page size.",null);for(let o of r.items)this.#n(o,e);return r}async revokeSourceCredential(e,t,s={}){let n=p.parse({action:"revoke",scope:this.#e.scope,sourceId:e,id:t}),r=b.parse(await this.#t("credentials",n,s));if(this.#n(r,e),r.id!==t||r.revokedAt===null)throw new a(502,"credential_revocation_mismatch","Credential revocation did not match the requested credential.",null);return r}async sourceConfiguration(e,t={}){let s=O.parse({scope:this.#e.scope,sourceId:e}),n=x.parse(await this.#t("source-config",s,t));if(n.scope!==this.#e.scope||n.source.id!==e)throw new a(502,"source_identity_mismatch","Source configuration did not match the requested source.",null);return n}#n(e,t){if(e.scope!==this.#e.scope||e.sourceId!==t)throw new a(502,"credential_scope_mismatch","Credential response did not match the requested source.",null)}async list(e,t={},s={}){let n=c.parse({action:"list",scope:this.#e.scope,kind:e,...t});return i.object({items:i.array(g[e]).max(100),nextCursor:i.string().nullable()}).strict().parse(await this.#t("read",n,s))}async publishBatch(e,t={}){let s=C.parse(e),n=k.parse(await this.#t("publish-batch",{...s,scope:this.#e.scope},t));if(n.batchId!==s.batchId)throw new a(502,"batch_identity_mismatch","Published batch response did not match the requested batch.",null);return n}async#t(e,t,s){h(t,16777216);let n=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:s.signal,redirect:"error"}),r=await I(n);if(!n.ok){let o=i.object({code:i.string().optional(),error:i.string().optional()}).passthrough().safeParse(r);throw new a(n.status,o.success?o.data.code??"learning_request_failed":"learning_request_failed",o.success?o.data.error??`Learning request failed (${n.status}).`:`Learning request failed (${n.status}).`,r)}return r}};async function I(u){let t=u.body?.getReader();if(!t)throw new a(u.status,"empty_response","Learning response was empty.",null);let s=new TextDecoder,n=0,r="";try{for(;;){let d=await t.read();if(d.done)break;if(n+=d.value.byteLength,n>16777216)throw new a(u.status,"response_too_large","Learning response exceeded 16 MiB; request a smaller page.",null);r+=s.decode(d.value,{stream:!0})}r+=s.decode();let o=JSON.parse(r);return h(o,16777216),o}finally{await t.cancel(),t.releaseLock()}}l(I,"readBoundedLearningResponse");export{C as a,P as b,I as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{d as v}from"./chunk-
|
|
2
|
+
import{d as v}from"./chunk-KQD36SBJ.js";import{h as b,i as E}from"./chunk-CSU7RDA5.js";import{b as S}from"./chunk-L3KS6MOV.js";import{m as u,o as f}from"./chunk-RCT3O3HQ.js";import{a as p}from"./chunk-FTQLQJQV.js";var c="desktop-personal",L="personal-default";async function K(s){let a=await s.store.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});if(a&&a.metadata.selectionEligible!==!1)return await v({store:s.store,storeDir:s.storeDir,workspaceId:a.id}),H(s.store,a.id,a.currentChannel.release?.contentHash??null);let t=(await s.store.listHarnessWorkspaces({ownerKind:"personal",ownerId:c})).find(o=>o.metadata.selectionEligible!==!1);if(t)return await s.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:c,workspaceId:t.id,updatedAt:(s.now??(()=>new Date().toISOString()))()}),H(s.store,t.id,t.currentChannel.release?.contentHash??null);let r=await s.loadProfileState(),n=r.mode==="local"&&r.sourcePath&&!r.error?await E({store:s.store,storeDir:s.storeDir,id:L,ownerId:c,name:r.activeProfile?.trim()||"Personal Harness",profile:r,now:s.now}):await b({store:s.store,storeDir:s.storeDir,id:L,ownerId:c,name:"Personal Harness",now:s.now});return await s.store.selectHarnessWorkspace({ownerKind:"personal",ownerId:c,workspaceId:n.workspace.id,updatedAt:(s.now??(()=>new Date().toISOString()))()}),n.release}p(K,"ensureSelectedLocalHarnessWorkspace");async function W(s){let a=await s.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});return a?H(s,a.id,a.currentChannel.release?.contentHash??null):null}p(W,"resolveSelectedLocalHarnessRelease");async function H(s,a,t){if(!t)throw new Error(`Selected Harness workspace ${a} has no current release.`);let r=await s.getHarnessReleaseRecord(t);if(!r||r.workspaceId!==a)throw new Error(`Selected Harness workspace ${a} points to a missing release ${t}.`);return f(r.agentSnapshot,"Selected Agent snapshot"),f(r.harnessRelease,"Selected Harness release"),r}p(H,"requireCurrentRelease");import{promises as I}from"node:fs";import i from"node:path";async function J(s,a){if(a){let n=await s.getHarnessReleaseRecord(a.contentHash);if(!n||n.harnessRelease.id!==a.id)throw new Error("The selected immutable Harness release is unavailable.");let o=await s.getHarnessWorkspace(n.workspaceId);if(!o||o.ownerScope.kind!=="personal"||o.ownerScope.id!==c)throw new Error("The selected Harness release is not available to this local owner.");return f(n.agentSnapshot,"Selected Agent snapshot"),f(n.harnessRelease,"Selected Harness release"),A({workspace:o,release:n})}let t=await W(s);if(!t)return null;let r=await s.getSelectedHarnessWorkspace({ownerKind:"personal",ownerId:c});if(!r||r.id!==t.workspaceId)throw new Error("Selected Harness workspace changed while its release was being admitted.");return A({workspace:r,release:t})}p(J,"loadSelectedLocalHarnessRuntime");async function A(s){let{workspace:a,release:t}=s;if(t.workspaceId!==a.id)throw new Error("Harness release does not belong to the requested workspace.");let r=i.join(t.bundlePath,"source");await Promise.all(t.harnessRelease.files.map(e=>x(r,e.path,e.contentHash)));let n=await Promise.all(t.agentSnapshot.instructions.map(async e=>({path:e.path,content:await g(r,e.path,e.contentHash)}))),o=[],m=new Map;for(let e of t.agentSnapshot.skills){let l=await g(r,e.path,e.contentHash),d=S(l);if(!d.name||!d.description||d.messages.length>0)throw new Error(`Released Harness Skill ${e.path} is invalid: ${d.messages.join(" ")||"missing name or description"}`);if(m.has(d.name))throw new Error(`Released Harness has duplicate Skill ${d.name}.`);let k=`${i.posix.dirname(e.path)}/`,P=t.harnessRelease.files.filter(h=>h.visibility==="policy"&&h.path.startsWith(k)&&h.path!==e.path).map(h=>h.path.slice(k.length)).sort(),y={name:d.name,description:d.description,path:e.path,scope:"profile",enabled:!0,sourcePath:r,charCount:l.length,sourceHash:e.contentHash,validationStatus:"valid",validationMessages:[],resourceFiles:P};o.push(y),m.set(y.name,async()=>{let h=await g(r,e.path,e.contentHash),w=S(h);if(!w.name||!w.description||w.messages.length>0)throw new Error(`Released Harness Skill ${e.path} failed validation while loading.`);return{name:w.name,description:w.description,body:w.body,path:e.path,sourceHash:e.contentHash,charCount:h.length,packagePath:i.join(r,...i.posix.dirname(e.path).split("/")),resourceFiles:P}})}o.sort((e,l)=>e.name.localeCompare(l.name));let $={profileSourcePath:r,skills:o,readSkill:m.size>0?async e=>{let l=m.get(e);if(!l)throw new Error(`Released Harness Skill not found: ${e}`);return l()}:null},R=n.sort((e,l)=>e.path.localeCompare(l.path)).map(({path:e,content:l})=>[`Active Harness instruction (${e}):`,l.trim()].join(`
|
|
3
3
|
`)).filter(e=>e.trim().length>0),D=[["Harness capability receipt:",JSON.stringify({harnessRelease:{id:t.harnessRelease.id,contentHash:t.harnessRelease.contentHash},agentSnapshot:{id:t.agentSnapshot.id,contentHash:t.agentSnapshot.contentHash},files:t.harnessRelease.files.filter(e=>e.visibility==="policy").map(e=>({path:e.path,contentHash:e.contentHash})),skills:t.agentSnapshot.skills.map(e=>e.path),agents:t.agentSnapshot.agents.map(e=>e.path),tools:t.agentSnapshot.toolDeclarations.map(e=>e.name),capabilityRequirements:t.agentSnapshot.capabilityRequirements})].join(`
|
|
4
4
|
`),R.length>0?["Active Harness preflight:","Apply the following released instructions when planning work and immediately before every tool call.","Preflight each call: (1) identify any active instruction that matches the planned operation, (2) inspect the exact tool arguments for a forbidden pattern, and (3) rewrite the call before sending it when a pattern matches. Compliance is required even when the prohibited call might still succeed.",...R].join(`
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as bt,c as at}from"./chunk-GF55VEMR.js";import{I as At,L as ne,b as Y,fa as st,ob as Pt,pb as Rt,qb as oe,ub as re,vb as se,xb as ae}from"./chunk-
|
|
2
|
+
import{a as bt,c as at}from"./chunk-GF55VEMR.js";import{I as At,L as ne,b as Y,fa as st,ob as Pt,pb as Rt,qb as oe,ub as re,vb as se,xb as ae}from"./chunk-CJDGLPNX.js";import{S as mt,T as ee,U as vt,e as Qt}from"./chunk-SH7POUVX.js";import{I as te}from"./chunk-2MEOUS24.js";import{e as qt,f as Zt}from"./chunk-HNQPEOJD.js";import{A as y}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";var Ko=y.object({id:y.string(),location:y.literal("local"),sessionId:y.string().nullable(),modelRef:Zt.nullable(),revision:y.number().int().positive(),remoteAccessEnabled:y.literal(!1),hostedSandboxesEnabled:y.boolean(),hostedActivation:y.literal("inactive")}),Vo=y.object({sessionId:y.string(),coordinatorId:y.string(),coordinatorSessionId:y.string(),owner:y.enum(["ponder","user"]),revision:y.number().int().positive(),assignment:y.string(),creationKey:y.string(),createdAt:y.string(),updatedAt:y.string()}),Jo="You are Pal (Ponder Assisted Learning), the user's persistent desktop coordinator. Delegate bounded assignments to real local agents through openpond_start_agent. Use the exact inputId returned by delegation or follow-up when waiting for completion. Inspect real transcripts/results before synthesizing. Never claim acceptance means completion. Workers are persistent sessions. A user-controlled worker remains observable but you must not send it instructions until the user explicitly returns control. Never launch paid compute, deploy, or expand access without user authority. Local history stays on this desktop. Hosted capabilities are unavailable unless explicitly enabled and authorized. Discover configured models and projects before selecting a worker; do not invent provider availability or paths. Native workers own their context and compaction.";var kt="This native agent is controlled by its parent conversation. You can inspect its transcript; send further instructions through the parent conversation.";function qo(t){if(t.metadata?.nativeWorker===!0&&t.metadata.nativeWorkerCanResume===!1)throw new Error(kt)}s(qo,"assertNativeWorkerDirectInput");import{promises as Ht}from"node:fs";import{createHash as rn}from"node:crypto";import Dt from"node:path";import en from"node:os";import ie from"node:path";function Mt(t){let e=t.trim();return e.startsWith("# AGENTS.md instructions for ")||e.startsWith("<environment_context>")||e.startsWith("<summary>")||e.startsWith("<user_info>")||/^<external_codex_apps_open_page>[\s\S]*<\/external_codex_apps_open_page>$/.test(e)}s(Mt,"isCodexInjectedUserMessage");function pt(t){let e=t.trim(),n=/^<(goal_context|turn_aborted)>\s*([\s\S]*?)\s*<\/\1>$/.exec(e);if(n){let o=n[1];return{kind:o,text:n[2]?.trim()||Et(o)}}return e==="<turn_aborted>"?{kind:"turn_aborted",text:Et("turn_aborted")}:e==="<goal_context>"?{kind:"goal_context",text:Et("goal_context")}:null}s(pt,"codexControlMessage");function Z(t,e){return t.length<=e?t:`${t.slice(0,e)}
|
|
3
3
|
|
|
4
4
|
[truncated ${t.length-e} characters from Codex history]`}s(Z,"truncateText");function it(t){return t.replace(/\s+/g," ").trim()}s(it,"normalizeTitleText");function de(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}s(de,"parseMaybeJson");function tt(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}s(tt,"parseJson");function _(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}s(_,"asRecord");function l(t){return typeof t=="string"&&t.trim()?t.trim():null}s(l,"stringValue");function j(t){return typeof t=="number"&&Number.isFinite(t)?t:null}s(j,"numberValue");function ce(t){let e=new Map;if(!t)return e;for(let[n,o]of Object.entries(t))typeof o=="string"&&o.trim()&&e.set(n,o.trim());return e}s(ce,"stringMap");function k(t){return t.replace(/[^a-zA-Z0-9_-]+/g,"_").slice(0,96)||"item"}s(k,"safeId");function Nt(t){let e=0;for(let n of t)typeof n=="number"&&n>e&&(e=n);return e}s(Nt,"latestMillis");function et(t){let e=Nt(t.map(E));return new Date(e||Date.now()).toISOString()}s(et,"latestIso");function E(t){if(!t)return 0;let e=Date.parse(t);return Number.isFinite(e)?e:0}s(E,"millisFromIso");function J(t){if(typeof t!="string"||!t.trim())return null;let e=t.trim().replace(/(\.\d{3})\d+(Z)$/i,"$1$2"),n=Date.parse(e);return Number.isFinite(n)?new Date(n).toISOString():null}s(J,"isoTimestamp");function le(t){if(t===null)return null;let e=t*1e3;return Number.isFinite(e)?new Date(e).toISOString():null}s(le,"isoFromEpochSeconds");function ue(t){let e=/rollout-(\d{4}-\d{2}-\d{2})T(\d{2})-(\d{2})-(\d{2})-/.exec(ie.basename(t));return e?J(`${e[1]}T${e[2]}:${e[3]}:${e[4]}.000Z`):null}s(ue,"isoFromFileName");function nt(){return process.env.CODEX_HOME?.trim()||ie.join(en.homedir(),".codex")}s(nt,"codexHomePath");function Et(t){return t==="turn_aborted"?"The previous turn was interrupted.":"Goal context updated."}s(Et,"defaultCodexControlText");import{createReadStream as nn}from"node:fs";import{createInterface as on}from"node:readline";async function Q(t,e){let n=nn(t,{encoding:"utf8"}),o=on({input:n,crlfDelay:1/0});for await(let r of o){if(!r.trim())continue;let a=tt(r);a&&e(a)}}s(Q,"readJsonlRecords");function $t(t,e=!1){let n=new Map;async function o(r){let a=await Ht.stat(r),i=e?rn("sha256").update(await Ht.readFile(r)).digest("hex"):"";return`${a.dev}:${a.ino}:${a.size}:${a.mtimeMs}:${a.ctimeMs}:${i}`}return s(o,"signature"),async r=>{let a;try{a=await o(r)}catch{return n.delete(r),t(r)}let i=n.get(r);if(i?.signature===a)return i.value;let d=t(r).then(async c=>(await o(r).catch(()=>null)!==a&&n.get(r)?.value===d&&n.delete(r),c)).catch(c=>{throw n.get(r)?.value===d&&n.delete(r),c});return n.set(r,{signature:a,value:d}),n.size>4&&n.delete(n.keys().next().value),d}}s($t,"cachedFileReader");var sn=$t(cn),an=$t(ln,!0),dn=$t(un,!0),me=s(t=>sn(Dt.join(t,"history.jsonl")),"readPromptHistory"),pe=s(t=>an(Dt.join(t,"session_index.jsonl")),"readSessionIndex"),ge=s(t=>dn(Dt.join(t,".codex-global-state.json")),"readGlobalState");async function cn(t){let e=new Map;return await Q(t,n=>{let o=_(n),r=l(o?.session_id),a=l(o?.text)??"",i=le(j(o?.ts));if(!r||!/\S/.test(a)||!i)return;let d=e.get(r)??{firstPrompt:null,latestPrompt:null,firstAt:null,latestAt:null};(!d.firstAt||E(i)<E(d.firstAt))&&(d.firstAt=i,d.firstPrompt=it(a).slice(0,160)),(!d.latestAt||E(i)>E(d.latestAt))&&(d.latestAt=i),e.set(r,d)}).catch(()=>{}),e}s(cn,"parsePromptHistory");async function ln(t){let e=new Map;return await Q(t,n=>{let o=_(n),r=l(o?.id);r&&e.set(r,{id:r,threadName:it(l(o?.thread_name)??"")||null,updatedAt:J(l(o?.updated_at))})}).catch(()=>{}),e}s(ln,"parseSessionIndex");async function un(t){let e;try{e=JSON.parse(await Ht.readFile(t,"utf8"))}catch{e=null}let n=_(e);return{workspaceRootHints:ce(_(n?.["thread-workspace-root-hints"]))}}s(un,"parseGlobalState");import{createReadStream as On,existsSync as Pe,mkdirSync as Fn,promises as Ln,readFileSync as jn,statSync as Gt,writeFileSync as Bn}from"node:fs";import xt from"node:os";import M from"node:path";import{createInterface as zn}from"node:readline";import{promises as gt}from"node:fs";import O from"node:path";var mn=12e4,pn=15*1024*1024,dt=2*1024*1024,fe=new Map([[".gif","image/gif"],[".jpeg","image/jpeg"],[".jpg","image/jpeg"],[".png","image/png"],[".webp","image/webp"]]),gn=new Set(fe.values()),fn=new Set(["application/javascript","application/json","application/ld+json","application/sql","application/toml","application/typescript","application/x-httpd-php","application/x-javascript","application/x-sh","application/x-yaml","application/xml","application/yaml"]),hn=new Set([".c",".cc",".cpp",".css",".csv",".go",".h",".html",".java",".js",".json",".jsx",".log",".md",".mdx",".php",".py",".rb",".rs",".sh",".sql",".toml",".ts",".tsx",".txt",".xml",".yaml",".yml"]);async function _r(t){let e=t.attachments??[];if(e.length===0)return[];let n=O.join(t.attachmentRootDir,A(t.sessionId),A(t.turnId)),o=new Set,r=[];for(let[a,i]of e.entries()){let c={...he(i),...i.text?{text:i.text}:{}};if(i.contentsBase64){await gt.mkdir(n,{recursive:!0});let m=_n(i.relativePath||i.name,o,a+1),u=O.join(n,m);await gt.mkdir(O.dirname(u),{recursive:!0});let f=Buffer.from(i.contentsBase64,"base64"),p=await mt(t.storageHome,{owner:{domain:"chat_attachment",id:JSON.stringify([t.sessionId,t.turnId,m])},displayName:i.name,mediaType:i.mediaType,bytes:f});await Qt(u,f),c.localPath=p.path,c.storageName=m}r.push(c)}return r}s(_r,"materializeChatAttachments");function Tr(t,e){let n=new Map(e?.materialized.map(o=>[o.id,o])??[]);return(t??[]).map(o=>{let r=he(o),a=n.get(o.id),i=K(o.mediaType,a?.storageName??o.name);return e&&r.kind==="image"&&a?.localPath&&a.storageName&&i?{...r,imagePreview:{sessionId:e.sessionId,turnId:e.turnId,attachmentId:o.id,storageName:a.storageName,contentType:i}}:e&&a?.localPath&&a.storageName&&o.sizeBytes<=dt&&ct(o.mediaType,a.storageName)?{...r,filePreview:{sessionId:e.sessionId,turnId:e.turnId,attachmentId:o.id,storageName:a.storageName,contentType:o.mediaType}}:r})}s(Tr,"chatAttachmentSummaries");function Cr(t){if(!t||t.length===0)return"";let e=["<attachments>",`The user attached ${t.length} file${t.length===1?"":"s"} with this message.`],n=mn;for(let[o,r]of t.entries()){let a=r.localPath?` Saved locally at: ${r.localPath}`:"";e.push(`${o+1}. ${r.name} (${r.mediaType}, ${Tn(r.sizeBytes)}, ${r.kind}).${a}`);let i=r.text?.trim();if(i&&n>0){let d=i.length>n?`${i.slice(0,Math.max(0,n-34))}
|
|
5
5
|
[attachment text truncated]`:i;e.push("Text content:"),e.push("~~~text"),e.push(d),e.push("~~~"),n-=d.length}}return e.push("</attachments>"),e.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{v as x}from"./chunk-66HFW4OU.js";import{B as I}from"./chunk-4TTXNVCE.js";import{p as T}from"./chunk-YU3C6U5V.js";import{a as A}from"./chunk-KVTBX2UP.js";import{a}from"./chunk-FTQLQJQV.js";function G(e){let n=e.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"");try{let t=JSON.parse(n);return typeof t.score!="number"||typeof t.passed!="boolean"?null:{score:Math.max(0,Math.min(1,t.score)),passed:t.passed,feedback:typeof t.feedback=="string"?t.feedback.slice(0,2e4):"Model judge completed.",evidenceRefs:[]}}catch{return null}}a(G,"parseModelJudgeResult");function X(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return Math.floor(e);let n=process.env.OPENPOND_HOSTED_WORKSPACE_TOOL_ROUNDS?.trim();if(!n)return 64;if(/^(unlimited|infinite|infinity)$/i.test(n))return Number.POSITIVE_INFINITY;let t=Number.parseInt(n,10);return Number.isFinite(t)&&t>0?t:64}a(X,"resolveMaxHostedWorkspaceToolRounds");function Y(e,n,t){let o=Date.now()-6e4;for(let r=e.length-1;r>=0;r-=1){let i=e[r],s=Date.parse(i.timestamp);if(Number.isFinite(s)&&s<o)return null;if(i.sessionId!==n||i.name!=="session.compaction.completed")continue;let d=i.data&&typeof i.data=="object"?i.data:null;if(d?.provider==="codex"&&d.codexThreadId===t)return i}return null}a(Y,"findRecentCodexCompactionCompleted");function Q(e){return e==="agent"||e==="skill"||e==="extension"||e==="model"||e==="configuration"?e:null}a(Q,"createImproveTargetKind");function V(e){if(!e)return;let n=Number(e);return Number.isFinite(n)&&n>0?Math.trunc(n):void 0}a(V,"createImproveLimit");var ne=new Set(["ask_user","get_profile","agent_inspect","agent_build","agent_validate","agent_eval","agent_run","agent_traces","agent_check","exec_command","view_image","list_files","read_files","search_files","write_file","write_files","edit_file","delete_file","workspace_status"]);function re(e){let n={type:"string"},t={type:"string",minLength:1};return[["list_files",{},[]],["workspace_status",{},[]],["read_files",{paths:{type:"array",items:t,minItems:1,maxItems:30}},["paths"]],["search_files",{query:{type:"string",minLength:1,maxLength:2e3}},["query"]],["write_file",{path:t,content:n},["path","content"]],["write_files",{files:{type:"object",additionalProperties:n,maxProperties:30}},["files"]],["edit_file",{path:t,oldText:{type:"string",minLength:1},newText:n,replaceAll:{type:"boolean"}},["path","oldText","newText"]],["delete_file",{path:t},["path"]]].map(([r,i,s])=>({name:r,description:`${r.replaceAll("_"," ")} in the isolated selected candidate component. Paths are relative to its public source tree.`,parameters:{type:"object",additionalProperties:!1,properties:i,required:s},execute:a(async d=>{let c=await e(d.session.id,{action:r,args:d.args,source:"chat_action"},{turnId:d.turnId,workspaceDiffBaseline:d.workspaceDiffBaseline});return x(d.callId,r,c)},"execute")}))}a(re,"candidateFileToolDefinitions");import{realpath as C}from"node:fs/promises";import p from"node:path";function ce(e){let n=[O()];if(!e.loadProfileState)return n;let t=a(async(r,i)=>{if(i&&(i.turnMetadata?.source==="experiment-improvement"||i.turnMetadata?.refinementCandidate!==void 0||i.session.metadata?.source==="experiment-improvement"||i.session.metadata?.refinementCandidate!==void 0)){if(!e.resolveCandidateProfile)throw new Error("Candidate authoring requires an admitted isolated Profile resolver.");let s=await e.resolveCandidateProfile(i);return S(s),s}return e.loadProfileState(r,i)},"loadProfileState"),o=a(async r=>{if(r.context.turnMetadata?.source==="experiment-improvement"||r.context.turnMetadata?.refinementCandidate!==void 0||r.context.session.metadata?.source==="experiment-improvement"||r.context.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateAgentCommand)throw new Error("Candidate Agent commands require filesystem-confined execution.");return e.executeCandidateAgentCommand(r)}return I({...r,throwOnFailure:!1})},"runCommand");return n.push(E(t),u(t,o,"agent_inspect","inspect"),u(t,o,"agent_build","build"),u(t,o,"agent_validate","validate"),u(t,o,"agent_eval","eval"),D(t,o),u(t,o,"agent_traces","traces"),L(t,o)),n}a(ce,"createAuthoringModelToolDefinitions");function O(){return{name:"ask_user",description:"Ask one blocking user question when the answer materially changes the requested work and cannot be inferred safely. This call ends the current model turn after persisting the question; do not batch it with mutations.",parameters:{type:"object",additionalProperties:!1,properties:{question:{type:"string",minLength:1,maxLength:2e3},reason:{type:"string",minLength:1,maxLength:1e3},options:{type:"array",minItems:2,maxItems:5,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:80},label:{type:"string",minLength:1,maxLength:160},description:{type:"string",minLength:1,maxLength:500}},required:["id","label"]}},allowFreeform:{type:"boolean"}},required:["question"]},execute:a(async e=>{let n=m(e.args,"question"),t=R(e.args,"reason"),o=q(e.args,"options").map(i=>g(i)).filter(i=>!!i).map(i=>({id:m(i,"id"),label:m(i,"label"),description:R(i,"description")})),r={questionId:`question_${e.turnId}_${e.callId}`,question:n,reason:t,options:o,allowFreeform:e.args.allowFreeform!==!1,status:"awaiting_user_input",nextStep:"end_turn"};return{...l(e.callId,"ask_user",!0,n,r),turnControl:"await_user_input"}},"execute")}}a(O,"askUserDefinition");function E(e){return{name:"get_profile",description:"Return the exact OpenPond Profile selected for this chat turn, including bounded local path, Skill, Agent, action, and Git context. Call before Profile authoring. This tool does not change the selected Profile or grant filesystem permission.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:a(async n=>{let t=h(n),o=await e(t,n),r=N(o,n.turnMetadata,t);return l(n.callId,"get_profile",!o.error,o.error??"Resolved selected Profile.",r)},"execute")}}a(E,"getProfileDefinition");function u(e,n,t,o){return{name:t,description:j(t),parameters:M(),execute:a(async r=>{let i=await f(e,r),s=await v(n,r,o,i.cwd);return l(r.callId,t,s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`${t} passed for ${i.agentId}.`:`${t} failed for ${i.agentId}.`,{agentId:i.agentId,cwd:i.cwd,command:o,...P(s)})},"execute")}}a(u,"agentCommandDefinition");function D(e,n){return{name:"agent_run",description:"Run one declared action on an exact enabled Profile Agent with typed JSON input. Use for behavioral proof, not as the default validation gate.",parameters:{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1},action:{type:"string",minLength:1},input:{type:"object",additionalProperties:!0}},required:["agentId","action"]},execute:a(async t=>{let o=await f(e,t),r=m(t.args,"action"),i=g(t.args,"input")??{},s=await n({context:t,command:"run",args:[r,"--json","--input",JSON.stringify(i),"--cwd",o.cwd],cwd:o.cwd,timeoutMs:12e4,maxOutputBytes:25e4});return l(t.callId,"agent_run",s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`Action ${r} passed for ${o.agentId}.`:`Action ${r} failed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,action:r,input:i,...P(s)})},"execute")}}a(D,"agentRunDefinition");function L(e,n){return{name:"agent_check",description:"Run the mandatory Agent authoring gate\u2014inspect, build, validate, and eval\u2014in order for one exact Profile Agent. Stops on the first failure and returns bounded per-step receipts.",parameters:M(),execute:a(async t=>{let o=await f(e,t),r=[];for(let s of["inspect","build","validate","eval"]){let d=await v(n,t,s,o.cwd),c=P(d);if(r.push({command:s,receipt:c}),d.code!==0||d.timedOut)return l(t.callId,"agent_check",!1,`agent_check stopped at ${s} for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!1,failedStep:s,steps:r})}let i=await e(h(t),t);return l(t.callId,"agent_check",!0,`agent_check passed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!0,failedStep:null,steps:r,profileRefresh:{activeProfile:i.activeProfile,agentIds:i.agents.map(s=>s.id).slice(0,200),actionIds:i.actionCatalog.map(s=>s.id).slice(0,500)}})},"execute")}}a(L,"agentCheckDefinition");async function f(e,n){let t=m(n.args,"agentId"),o=await e(h(n),n);S(o);let r=g(n.turnMetadata,"authoringIntent");if(r?.artifact==="agent"&&r.operation==="improve"&&typeof r.targetAgentId=="string"&&r.targetAgentId!==t)throw new Error(`Agent improve is bound to ${r.targetAgentId}; ${t} is not authorized.`);if(!o.agents.find(k=>k.id===t)?.enabled)throw new Error(`Enabled Profile Agent not found: ${t}`);let s=t==="default"?o.sourcePath:p.resolve(o.sourcePath,"agents",t),d=await C(o.sourcePath),c=await C(s).catch(()=>null);if(!c)throw new Error(`Profile Agent source does not exist: ${t}`);if(!F(d,c))throw new Error(`Profile Agent source escapes the selected Profile: ${t}`);return{profile:o,agentId:t,cwd:c}}a(f,"resolveAgentTarget");async function v(e,n,t,o){return e({context:n,command:t,args:t==="inspect"||t==="validate"||t==="eval"||t==="traces"?["--json"]:[],cwd:o,timeoutMs:t==="eval"?18e4:12e4,maxOutputBytes:25e4})}a(v,"executeAgentCommand");function S(e){if(e.error)throw new Error(e.error);if(e.mode!=="local"||!e.repoPath||!e.sourcePath)throw new Error("The selected OpenPond Profile is not locally editable.")}a(S,"assertEditableProfile");function N(e,n,t){let o=e.git?.files.slice(0,200).map(r=>r.path)??[];return{mode:e.mode,editable:e.mode==="local"&&!!(e.repoPath&&e.sourcePath)&&!e.error,blockedReason:e.error??(e.mode==="local"&&e.repoPath&&e.sourcePath?null:"The selected Profile is not locally editable."),ref:t,activeProfile:e.activeProfile,repoPath:e.repoPath,sourcePath:e.sourcePath,manifestPath:e.manifestPath,profileConfigPath:e.sourcePath?p.join(e.sourcePath,"settings","profile.yaml"):null,authoring:g(n,"authoringIntent"),skills:e.skills.slice(0,200).map(r=>({name:r.name,description:r.description,path:r.path,sourcePath:r.sourcePath,enabled:r.enabled,validationStatus:r.validationStatus})),agents:e.agents.slice(0,200).map(r=>{let i=e.actionCatalog.filter(s=>s.agentId===r.id).slice(0,100);return{id:r.id,name:r.name,path:r.path,sourcePath:e.sourcePath?r.id==="default"?e.sourcePath:p.resolve(e.sourcePath,"agents",r.id):r.path,enabled:r.enabled,defaultAction:i.find(s=>s.sourceActionId==="chat"||s.id===`${r.id}.chat`)?.id??i[0]?.id??null,actionNames:i.map(s=>s.id)}}),git:e.git?{branch:e.git.branch,head:e.git.head,dirty:e.git.dirty,changedPaths:o,truncated:e.git.files.length>o.length}:null}}a(N,"profileProjection");function h(e){let n=g(e.turnMetadata,"selectedProfileRef");return n&&(n.source==="local"||n.source==="github"||n.source==="openpond_git")&&typeof n.repositoryId=="string"&&n.repositoryId.trim()&&typeof n.profileId=="string"&&n.profileId.trim()?{source:n.source,repositoryId:n.repositoryId,profileId:n.profileId}:e.session.currentProfile??null}a(h,"selectedProfileRef");function M(){return{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1,description:"Exact enabled Agent ID from get_profile."}},required:["agentId"]}}a(M,"agentTargetParameters");function j(e){return`Run OpenPond Agent SDK ${e.replace(/^agent_/,"")} for one exact enabled Agent beneath the selected Profile and return a bounded structured receipt.`}a(j,"agentToolDescription");function P(e){return{code:e.code,timedOut:e.timedOut,stdout:$(e.stdout),stderr:e.stderr,stdoutTruncated:e.stdoutTruncated,stderrTruncated:e.stderrTruncated}}a(P,"commandReceipt");function $(e){let n=e.trim();if(!n)return"";try{return JSON.parse(n)}catch{return n}}a($,"parseJsonOrText");function l(e,n,t,o,r){return{toolCallId:e,name:n,ok:t,contentText:JSON.stringify({ok:t,action:n,output:o,data:r},null,2),data:r}}a(l,"modelResult");function m(e,n){let t=e[n];if(typeof t!="string"||!t.trim())throw new Error(`${n} is required`);return t.trim()}a(m,"stringArg");function R(e,n){let t=e[n];return typeof t=="string"&&t.trim()?t.trim():null}a(R,"optionalStringArg");function q(e,n){let t=e[n];return Array.isArray(t)?t:[]}a(q,"arrayArg");function g(e,n){let t=n&&e&&typeof e=="object"&&!Array.isArray(e)?e[n]:e;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}a(g,"recordArg");function F(e,n){let t=p.relative(e,n);return t===""||!t.startsWith("..")&&!p.isAbsolute(t)}a(F,"isWithin");import{execFile as B}from"node:child_process";import y from"node:path";var b=12,_=8,w=" .:-=+*#%@";function he(e={}){return{name:"view_image",description:"Inspect a real local PNG, JPEG, GIF, WebP, or AVIF file. Reads the image bytes directly and returns dimensions plus a coarse pixel/color map; it also creates an actual image preview in the chat UI. Use this instead of opening file:// URLs or browser snapshots, which cannot inspect local image pixels. For many video frames, build one contact sheet and inspect that rather than reading frames one by one.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,description:"Absolute image path, or a path relative to the selected local project."}},required:["path"]},enabled:a(n=>n.provider==="codex"||n.session.provider==="codex"||n.session.openPondCommandAccessMode==="disabled"?!1:A({session:n.session}).target!=="sandbox","enabled"),execute:a(async n=>{if(n.turnMetadata?.source==="experiment-improvement"||n.turnMetadata?.refinementCandidate!==void 0||n.session.metadata?.source==="experiment-improvement"||n.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateImage)throw new Error("Candidate image inspection requires its confined filesystem executor.");return e.executeCandidateImage(n)}let t=K(n.args.path,"path"),o=y.isAbsolute(t)?y.resolve(t):n.session.cwd?y.resolve(n.session.cwd,t):"";if(!o)throw new Error("A relative image path requires a selected local project.");let r=await T(o);if(!r)throw new Error(`Local image was not found or is not a supported image: ${o}`);let i=await U(r.path,n.signal);return{toolCallId:n.callId,name:"view_image",ok:!0,contentText:JSON.stringify({ok:!0,action:"view_image",output:`Read actual image pixels from ${r.path}.`,data:{path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i,note:"The luminance and color maps are deterministic pixel samples, not a semantic vision caption."}},null,2),data:{openpondImagePreviewPath:r.path,path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i}}},"execute")}}a(he,"createLocalImageModelToolDefinition");async function U(e,n,t=z){let o=await t("identify",["-format","%m %w %h",e],n),r=/^(\S+)\s+(\d+)\s+(\d+)/.exec(o.trim());if(!r)throw new Error("Image metadata could not be decoded.");let i=await t("convert",[e,"-resize",`${b}x${_}!`,"-depth","8","txt:-"],n),s=W(i);return{format:r[1],width:Number.parseInt(r[2],10),height:Number.parseInt(r[3],10),luminanceMap:s.map(d=>d.map(J).join("")),colorMap:s.map(d=>d.map(c=>`#${c.map(H).join("")}`))}}a(U,"inspectImagePixels");function W(e){let n=Array.from({length:_},()=>Array.from({length:b},()=>[0,0,0]));for(let t of e.split(/\r?\n/)){let o=/^(\d+),(\d+):\s*\(\s*(\d+),\s*(\d+),\s*(\d+)/.exec(t);if(!o)continue;let r=Number.parseInt(o[1],10),i=Number.parseInt(o[2],10);r>=b||i>=_||(n[i][r]=[Number.parseInt(o[3],10),Number.parseInt(o[4],10),Number.parseInt(o[5],10)])}return n}a(W,"sampledPixelRows");function J([e,n,t]){let o=.2126*e+.7152*n+.0722*t;return w[Math.min(w.length-1,Math.round(o/255*(w.length-1)))]}a(J,"luminanceCharacter");function H(e){return Math.max(0,Math.min(255,e)).toString(16).padStart(2,"0")}a(H,"hexByte");function z(e,n,t){return new Promise((o,r)=>{B(e,n,{encoding:"utf8",maxBuffer:256*1024,signal:t},(i,s)=>{if(i){r(new Error(`${e} could not inspect the image: ${i.message}`));return}o(s)})})}a(z,"runImageCommand");function K(e,n){if(typeof e!="string"||!e.trim())throw new Error(`${n} is required.`);return e.trim()}a(K,"stringArg");export{ne as a,re as b,ce as c,he as d,U as e,G as f,X as g,Y as h,Q as i,V as j};
|
|
2
|
+
import{v as x}from"./chunk-4VZJQRQI.js";import{B as I}from"./chunk-4TTXNVCE.js";import{p as T}from"./chunk-YU3C6U5V.js";import{a as A}from"./chunk-KVTBX2UP.js";import{a}from"./chunk-FTQLQJQV.js";function G(e){let n=e.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"");try{let t=JSON.parse(n);return typeof t.score!="number"||typeof t.passed!="boolean"?null:{score:Math.max(0,Math.min(1,t.score)),passed:t.passed,feedback:typeof t.feedback=="string"?t.feedback.slice(0,2e4):"Model judge completed.",evidenceRefs:[]}}catch{return null}}a(G,"parseModelJudgeResult");function X(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return Math.floor(e);let n=process.env.OPENPOND_HOSTED_WORKSPACE_TOOL_ROUNDS?.trim();if(!n)return 64;if(/^(unlimited|infinite|infinity)$/i.test(n))return Number.POSITIVE_INFINITY;let t=Number.parseInt(n,10);return Number.isFinite(t)&&t>0?t:64}a(X,"resolveMaxHostedWorkspaceToolRounds");function Y(e,n,t){let o=Date.now()-6e4;for(let r=e.length-1;r>=0;r-=1){let i=e[r],s=Date.parse(i.timestamp);if(Number.isFinite(s)&&s<o)return null;if(i.sessionId!==n||i.name!=="session.compaction.completed")continue;let d=i.data&&typeof i.data=="object"?i.data:null;if(d?.provider==="codex"&&d.codexThreadId===t)return i}return null}a(Y,"findRecentCodexCompactionCompleted");function Q(e){return e==="agent"||e==="skill"||e==="extension"||e==="model"||e==="configuration"?e:null}a(Q,"createImproveTargetKind");function V(e){if(!e)return;let n=Number(e);return Number.isFinite(n)&&n>0?Math.trunc(n):void 0}a(V,"createImproveLimit");var ne=new Set(["ask_user","get_profile","agent_inspect","agent_build","agent_validate","agent_eval","agent_run","agent_traces","agent_check","exec_command","view_image","list_files","read_files","search_files","write_file","write_files","edit_file","delete_file","workspace_status"]);function re(e){let n={type:"string"},t={type:"string",minLength:1};return[["list_files",{},[]],["workspace_status",{},[]],["read_files",{paths:{type:"array",items:t,minItems:1,maxItems:30}},["paths"]],["search_files",{query:{type:"string",minLength:1,maxLength:2e3}},["query"]],["write_file",{path:t,content:n},["path","content"]],["write_files",{files:{type:"object",additionalProperties:n,maxProperties:30}},["files"]],["edit_file",{path:t,oldText:{type:"string",minLength:1},newText:n,replaceAll:{type:"boolean"}},["path","oldText","newText"]],["delete_file",{path:t},["path"]]].map(([r,i,s])=>({name:r,description:`${r.replaceAll("_"," ")} in the isolated selected candidate component. Paths are relative to its public source tree.`,parameters:{type:"object",additionalProperties:!1,properties:i,required:s},execute:a(async d=>{let c=await e(d.session.id,{action:r,args:d.args,source:"chat_action"},{turnId:d.turnId,workspaceDiffBaseline:d.workspaceDiffBaseline});return x(d.callId,r,c)},"execute")}))}a(re,"candidateFileToolDefinitions");import{realpath as C}from"node:fs/promises";import p from"node:path";function ce(e){let n=[O()];if(!e.loadProfileState)return n;let t=a(async(r,i)=>{if(i&&(i.turnMetadata?.source==="experiment-improvement"||i.turnMetadata?.refinementCandidate!==void 0||i.session.metadata?.source==="experiment-improvement"||i.session.metadata?.refinementCandidate!==void 0)){if(!e.resolveCandidateProfile)throw new Error("Candidate authoring requires an admitted isolated Profile resolver.");let s=await e.resolveCandidateProfile(i);return S(s),s}return e.loadProfileState(r,i)},"loadProfileState"),o=a(async r=>{if(r.context.turnMetadata?.source==="experiment-improvement"||r.context.turnMetadata?.refinementCandidate!==void 0||r.context.session.metadata?.source==="experiment-improvement"||r.context.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateAgentCommand)throw new Error("Candidate Agent commands require filesystem-confined execution.");return e.executeCandidateAgentCommand(r)}return I({...r,throwOnFailure:!1})},"runCommand");return n.push(E(t),u(t,o,"agent_inspect","inspect"),u(t,o,"agent_build","build"),u(t,o,"agent_validate","validate"),u(t,o,"agent_eval","eval"),D(t,o),u(t,o,"agent_traces","traces"),L(t,o)),n}a(ce,"createAuthoringModelToolDefinitions");function O(){return{name:"ask_user",description:"Ask one blocking user question when the answer materially changes the requested work and cannot be inferred safely. This call ends the current model turn after persisting the question; do not batch it with mutations.",parameters:{type:"object",additionalProperties:!1,properties:{question:{type:"string",minLength:1,maxLength:2e3},reason:{type:"string",minLength:1,maxLength:1e3},options:{type:"array",minItems:2,maxItems:5,items:{type:"object",additionalProperties:!1,properties:{id:{type:"string",minLength:1,maxLength:80},label:{type:"string",minLength:1,maxLength:160},description:{type:"string",minLength:1,maxLength:500}},required:["id","label"]}},allowFreeform:{type:"boolean"}},required:["question"]},execute:a(async e=>{let n=m(e.args,"question"),t=R(e.args,"reason"),o=q(e.args,"options").map(i=>g(i)).filter(i=>!!i).map(i=>({id:m(i,"id"),label:m(i,"label"),description:R(i,"description")})),r={questionId:`question_${e.turnId}_${e.callId}`,question:n,reason:t,options:o,allowFreeform:e.args.allowFreeform!==!1,status:"awaiting_user_input",nextStep:"end_turn"};return{...l(e.callId,"ask_user",!0,n,r),turnControl:"await_user_input"}},"execute")}}a(O,"askUserDefinition");function E(e){return{name:"get_profile",description:"Return the exact OpenPond Profile selected for this chat turn, including bounded local path, Skill, Agent, action, and Git context. Call before Profile authoring. This tool does not change the selected Profile or grant filesystem permission.",parameters:{type:"object",additionalProperties:!1,properties:{}},execute:a(async n=>{let t=h(n),o=await e(t,n),r=N(o,n.turnMetadata,t);return l(n.callId,"get_profile",!o.error,o.error??"Resolved selected Profile.",r)},"execute")}}a(E,"getProfileDefinition");function u(e,n,t,o){return{name:t,description:j(t),parameters:M(),execute:a(async r=>{let i=await f(e,r),s=await v(n,r,o,i.cwd);return l(r.callId,t,s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`${t} passed for ${i.agentId}.`:`${t} failed for ${i.agentId}.`,{agentId:i.agentId,cwd:i.cwd,command:o,...P(s)})},"execute")}}a(u,"agentCommandDefinition");function D(e,n){return{name:"agent_run",description:"Run one declared action on an exact enabled Profile Agent with typed JSON input. Use for behavioral proof, not as the default validation gate.",parameters:{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1},action:{type:"string",minLength:1},input:{type:"object",additionalProperties:!0}},required:["agentId","action"]},execute:a(async t=>{let o=await f(e,t),r=m(t.args,"action"),i=g(t.args,"input")??{},s=await n({context:t,command:"run",args:[r,"--json","--input",JSON.stringify(i),"--cwd",o.cwd],cwd:o.cwd,timeoutMs:12e4,maxOutputBytes:25e4});return l(t.callId,"agent_run",s.code===0&&!s.timedOut,s.code===0&&!s.timedOut?`Action ${r} passed for ${o.agentId}.`:`Action ${r} failed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,action:r,input:i,...P(s)})},"execute")}}a(D,"agentRunDefinition");function L(e,n){return{name:"agent_check",description:"Run the mandatory Agent authoring gate\u2014inspect, build, validate, and eval\u2014in order for one exact Profile Agent. Stops on the first failure and returns bounded per-step receipts.",parameters:M(),execute:a(async t=>{let o=await f(e,t),r=[];for(let s of["inspect","build","validate","eval"]){let d=await v(n,t,s,o.cwd),c=P(d);if(r.push({command:s,receipt:c}),d.code!==0||d.timedOut)return l(t.callId,"agent_check",!1,`agent_check stopped at ${s} for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!1,failedStep:s,steps:r})}let i=await e(h(t),t);return l(t.callId,"agent_check",!0,`agent_check passed for ${o.agentId}.`,{agentId:o.agentId,cwd:o.cwd,passed:!0,failedStep:null,steps:r,profileRefresh:{activeProfile:i.activeProfile,agentIds:i.agents.map(s=>s.id).slice(0,200),actionIds:i.actionCatalog.map(s=>s.id).slice(0,500)}})},"execute")}}a(L,"agentCheckDefinition");async function f(e,n){let t=m(n.args,"agentId"),o=await e(h(n),n);S(o);let r=g(n.turnMetadata,"authoringIntent");if(r?.artifact==="agent"&&r.operation==="improve"&&typeof r.targetAgentId=="string"&&r.targetAgentId!==t)throw new Error(`Agent improve is bound to ${r.targetAgentId}; ${t} is not authorized.`);if(!o.agents.find(k=>k.id===t)?.enabled)throw new Error(`Enabled Profile Agent not found: ${t}`);let s=t==="default"?o.sourcePath:p.resolve(o.sourcePath,"agents",t),d=await C(o.sourcePath),c=await C(s).catch(()=>null);if(!c)throw new Error(`Profile Agent source does not exist: ${t}`);if(!F(d,c))throw new Error(`Profile Agent source escapes the selected Profile: ${t}`);return{profile:o,agentId:t,cwd:c}}a(f,"resolveAgentTarget");async function v(e,n,t,o){return e({context:n,command:t,args:t==="inspect"||t==="validate"||t==="eval"||t==="traces"?["--json"]:[],cwd:o,timeoutMs:t==="eval"?18e4:12e4,maxOutputBytes:25e4})}a(v,"executeAgentCommand");function S(e){if(e.error)throw new Error(e.error);if(e.mode!=="local"||!e.repoPath||!e.sourcePath)throw new Error("The selected OpenPond Profile is not locally editable.")}a(S,"assertEditableProfile");function N(e,n,t){let o=e.git?.files.slice(0,200).map(r=>r.path)??[];return{mode:e.mode,editable:e.mode==="local"&&!!(e.repoPath&&e.sourcePath)&&!e.error,blockedReason:e.error??(e.mode==="local"&&e.repoPath&&e.sourcePath?null:"The selected Profile is not locally editable."),ref:t,activeProfile:e.activeProfile,repoPath:e.repoPath,sourcePath:e.sourcePath,manifestPath:e.manifestPath,profileConfigPath:e.sourcePath?p.join(e.sourcePath,"settings","profile.yaml"):null,authoring:g(n,"authoringIntent"),skills:e.skills.slice(0,200).map(r=>({name:r.name,description:r.description,path:r.path,sourcePath:r.sourcePath,enabled:r.enabled,validationStatus:r.validationStatus})),agents:e.agents.slice(0,200).map(r=>{let i=e.actionCatalog.filter(s=>s.agentId===r.id).slice(0,100);return{id:r.id,name:r.name,path:r.path,sourcePath:e.sourcePath?r.id==="default"?e.sourcePath:p.resolve(e.sourcePath,"agents",r.id):r.path,enabled:r.enabled,defaultAction:i.find(s=>s.sourceActionId==="chat"||s.id===`${r.id}.chat`)?.id??i[0]?.id??null,actionNames:i.map(s=>s.id)}}),git:e.git?{branch:e.git.branch,head:e.git.head,dirty:e.git.dirty,changedPaths:o,truncated:e.git.files.length>o.length}:null}}a(N,"profileProjection");function h(e){let n=g(e.turnMetadata,"selectedProfileRef");return n&&(n.source==="local"||n.source==="github"||n.source==="openpond_git")&&typeof n.repositoryId=="string"&&n.repositoryId.trim()&&typeof n.profileId=="string"&&n.profileId.trim()?{source:n.source,repositoryId:n.repositoryId,profileId:n.profileId}:e.session.currentProfile??null}a(h,"selectedProfileRef");function M(){return{type:"object",additionalProperties:!1,properties:{agentId:{type:"string",minLength:1,description:"Exact enabled Agent ID from get_profile."}},required:["agentId"]}}a(M,"agentTargetParameters");function j(e){return`Run OpenPond Agent SDK ${e.replace(/^agent_/,"")} for one exact enabled Agent beneath the selected Profile and return a bounded structured receipt.`}a(j,"agentToolDescription");function P(e){return{code:e.code,timedOut:e.timedOut,stdout:$(e.stdout),stderr:e.stderr,stdoutTruncated:e.stdoutTruncated,stderrTruncated:e.stderrTruncated}}a(P,"commandReceipt");function $(e){let n=e.trim();if(!n)return"";try{return JSON.parse(n)}catch{return n}}a($,"parseJsonOrText");function l(e,n,t,o,r){return{toolCallId:e,name:n,ok:t,contentText:JSON.stringify({ok:t,action:n,output:o,data:r},null,2),data:r}}a(l,"modelResult");function m(e,n){let t=e[n];if(typeof t!="string"||!t.trim())throw new Error(`${n} is required`);return t.trim()}a(m,"stringArg");function R(e,n){let t=e[n];return typeof t=="string"&&t.trim()?t.trim():null}a(R,"optionalStringArg");function q(e,n){let t=e[n];return Array.isArray(t)?t:[]}a(q,"arrayArg");function g(e,n){let t=n&&e&&typeof e=="object"&&!Array.isArray(e)?e[n]:e;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}a(g,"recordArg");function F(e,n){let t=p.relative(e,n);return t===""||!t.startsWith("..")&&!p.isAbsolute(t)}a(F,"isWithin");import{execFile as B}from"node:child_process";import y from"node:path";var b=12,_=8,w=" .:-=+*#%@";function he(e={}){return{name:"view_image",description:"Inspect a real local PNG, JPEG, GIF, WebP, or AVIF file. Reads the image bytes directly and returns dimensions plus a coarse pixel/color map; it also creates an actual image preview in the chat UI. Use this instead of opening file:// URLs or browser snapshots, which cannot inspect local image pixels. For many video frames, build one contact sheet and inspect that rather than reading frames one by one.",parameters:{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,description:"Absolute image path, or a path relative to the selected local project."}},required:["path"]},enabled:a(n=>n.provider==="codex"||n.session.provider==="codex"||n.session.openPondCommandAccessMode==="disabled"?!1:A({session:n.session}).target!=="sandbox","enabled"),execute:a(async n=>{if(n.turnMetadata?.source==="experiment-improvement"||n.turnMetadata?.refinementCandidate!==void 0||n.session.metadata?.source==="experiment-improvement"||n.session.metadata?.refinementCandidate!==void 0){if(!e.executeCandidateImage)throw new Error("Candidate image inspection requires its confined filesystem executor.");return e.executeCandidateImage(n)}let t=K(n.args.path,"path"),o=y.isAbsolute(t)?y.resolve(t):n.session.cwd?y.resolve(n.session.cwd,t):"";if(!o)throw new Error("A relative image path requires a selected local project.");let r=await T(o);if(!r)throw new Error(`Local image was not found or is not a supported image: ${o}`);let i=await U(r.path,n.signal);return{toolCallId:n.callId,name:"view_image",ok:!0,contentText:JSON.stringify({ok:!0,action:"view_image",output:`Read actual image pixels from ${r.path}.`,data:{path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i,note:"The luminance and color maps are deterministic pixel samples, not a semantic vision caption."}},null,2),data:{openpondImagePreviewPath:r.path,path:r.path,contentType:r.contentType,sizeBytes:r.sizeBytes,...i}}},"execute")}}a(he,"createLocalImageModelToolDefinition");async function U(e,n,t=z){let o=await t("identify",["-format","%m %w %h",e],n),r=/^(\S+)\s+(\d+)\s+(\d+)/.exec(o.trim());if(!r)throw new Error("Image metadata could not be decoded.");let i=await t("convert",[e,"-resize",`${b}x${_}!`,"-depth","8","txt:-"],n),s=W(i);return{format:r[1],width:Number.parseInt(r[2],10),height:Number.parseInt(r[3],10),luminanceMap:s.map(d=>d.map(J).join("")),colorMap:s.map(d=>d.map(c=>`#${c.map(H).join("")}`))}}a(U,"inspectImagePixels");function W(e){let n=Array.from({length:_},()=>Array.from({length:b},()=>[0,0,0]));for(let t of e.split(/\r?\n/)){let o=/^(\d+),(\d+):\s*\(\s*(\d+),\s*(\d+),\s*(\d+)/.exec(t);if(!o)continue;let r=Number.parseInt(o[1],10),i=Number.parseInt(o[2],10);r>=b||i>=_||(n[i][r]=[Number.parseInt(o[3],10),Number.parseInt(o[4],10),Number.parseInt(o[5],10)])}return n}a(W,"sampledPixelRows");function J([e,n,t]){let o=.2126*e+.7152*n+.0722*t;return w[Math.min(w.length-1,Math.round(o/255*(w.length-1)))]}a(J,"luminanceCharacter");function H(e){return Math.max(0,Math.min(255,e)).toString(16).padStart(2,"0")}a(H,"hexByte");function z(e,n,t){return new Promise((o,r)=>{B(e,n,{encoding:"utf8",maxBuffer:256*1024,signal:t},(i,s)=>{if(i){r(new Error(`${e} could not inspect the image: ${i.message}`));return}o(s)})})}a(z,"runImageCommand");function K(e,n){if(typeof e!="string"||!e.trim())throw new Error(`${n} is required.`);return e.trim()}a(K,"stringArg");export{ne as a,re as b,ce as c,he as d,U as e,G as f,X as g,Y as h,Q as i,V as j};
|
|
@@ -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-XHU4BZQY.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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as F,b as H,d as _}from"./chunk-DRMOHADV.js";import{k as j}from"./chunk-
|
|
2
|
+
import{a as F,b as H,d as _}from"./chunk-DRMOHADV.js";import{k as j}from"./chunk-IXZ5ZGIL.js";import{a as R}from"./chunk-MCBRB5D6.js";import{b as P,s as C,t as N,z as x}from"./chunk-YU3C6U5V.js";import{d as U}from"./chunk-BJXPQIVD.js";import{B as D}from"./chunk-CJDGLPNX.js";import{b as I,c as T}from"./chunk-JCLTFDVW.js";import{a as n}from"./chunk-FTQLQJQV.js";import{randomUUID as Pt}from"node:crypto";var ot="https://api.openpond.ai";async function K(t){let e=await R(),o=e.token?.trim();if(!o)throw new Error("OpenPond account API key is required to manage organizations.");let r=rt(e);if(t.type==="list")return m(r,o,"/v1/organizations");if(t.type==="invitations_list")return m(r,o,"/v1/teams/invitations");if(t.type==="invitation_accept"||t.type==="invitation_decline"){let i=t.type==="invitation_accept"?"accept":"decline";return m(r,o,`/v1/teams/invitations/${i}`,{method:"POST",body:JSON.stringify(t.payload??{})})}if(t.type==="create")return m(r,o,"/v1/organizations",{method:"POST",body:JSON.stringify(t.payload??{})});if(t.type==="get")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}`);if(t.type==="update")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}`,{method:"PATCH",body:JSON.stringify(t.payload??{})});if(t.type==="members")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/members`);if(t.type==="member_upsert")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/members`,{method:"POST",body:JSON.stringify(t.payload??{})});if(t.type==="mcp_get")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server`);if(t.type==="mcp_generate")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server`,{method:"POST",body:JSON.stringify(t.payload??{})});if(t.type==="mcp_rotate")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server/rotate`,{method:"POST"});if(t.type==="mcp_disable")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server/disable`,{method:"POST"});if(t.type==="mcp_enable")return m(r,o,`/v1/organizations/${encodeURIComponent(t.slug)}/mcp-server/enable`,{method:"POST"});throw new Error(`Unsupported organization action: ${t.type}`)}n(K,"organizationRequestPayload");async function m(t,e,o,r={}){let i=await I(t,e,o,r),a=await i.json().catch(()=>({}));if(!i.ok){let l=typeof a.message=="string"?a.message:typeof a.error=="string"?a.error:i.statusText;throw new Error(l)}return a}n(m,"openPondApiRequest");function rt(t){return S(process.env.OPENPOND_API_URL)??S(t.apiBaseUrl)??S(t.account?.apiBaseUrl)??S(t.config.apiBaseUrl)??M(t.account?.baseUrl)??M(t.config.baseUrl)??ot}n(rt,"resolveApiBaseUrl");function M(t){let e=S(t);if(!e)return null;try{let o=new URL(e);if(o.hostname==="openpond.ai")return"https://api.openpond.ai";if(!o.hostname.startsWith("api.")&&o.hostname.endsWith(".openpond.ai"))return o.hostname=`api.${o.hostname}`,o.origin}catch{return e}return e}n(M,"normalizeOpenPondWebBaseAsApi");function S(t){let e=t?.trim();return e?e.replace(/\/$/,""):null}n(S,"normalizeOptionalUrl");import{promises as y}from"node:fs";import nt from"node:os";import g from"node:path";var at=5e3,it=32*1024*1024,st=250*1024*1024;async function J(t){let e=await O(t),o=await z(e.rootPath),r=[];for(let i of e.files)r.push({path:i.path,type:"file",contentsBase64:(await y.readFile(i.absolutePath)).toString("base64")});return{rootPath:e.rootPath,headCommit:o,entries:r,totalBytes:e.totalBytes,skipped:e.skipped}}n(J,"collectLocalProjectSourceUploadBundle");async function Ft(t){let e=await O(t),o=await z(e.rootPath);return{rootPath:e.rootPath,headCommit:o,fileCount:e.files.length,byteCount:e.totalBytes,skippedCount:e.skipped.length,initializedEmptyProject:e.files.length===0,skipped:e.skipped}}n(Ft,"previewLocalProjectSourceUpload");async function W(t,e){let o=pt(e.branch),r=await O(t),i=await z(r.rootPath);if(t.repoPath&&r.files.length>0&&await ut(r.rootPath))try{return await G({cwd:r.rootPath,repoUrl:e.repoUrl,apiKey:e.apiKey,branch:o}),{rootPath:r.rootPath,branch:o,headCommit:i,fileCount:r.files.length,byteCount:r.totalBytes,skipped:r.skipped,initializedEmptyProject:!1,transport:"git_head"}}catch(c){if(!yt(c))throw c}let a=await y.mkdtemp(g.join(nt.tmpdir(),"openpond-cloud-source-")),l=r.files.length===0;try{return l?await y.writeFile(g.join(a,"README.md"),e.fallbackReadme,"utf8"):await mt(r,a),await gt({cwd:a,branch:o,commitMessage:e.commitMessage,repoUrl:e.repoUrl,apiKey:e.apiKey}),await G({cwd:a,repoUrl:e.repoUrl,apiKey:e.apiKey,branch:o}),{rootPath:r.rootPath,branch:o,headCommit:i,fileCount:l?1:r.files.length,byteCount:l?Buffer.byteLength(e.fallbackReadme,"utf8"):r.totalBytes,skipped:r.skipped,initializedEmptyProject:l,transport:"snapshot"}}finally{await y.rm(a,{recursive:!0,force:!0})}}n(W,"pushLocalProjectSourceToGit");async function O(t){let e=t.repoPath??t.workspacePath,o=t.repoPath?await dt(e):await ct(e),r=[],i=[],a=0;for(let l of o){if(r.length>=at){i.push({path:l,reason:"total_limit"});continue}let c=C(l);if(!c){i.push({path:l,reason:"invalid_path"});continue}if(N(c)&&!q(c)){i.push({path:c,reason:"generated"});continue}let d=g.resolve(e,c),u=g.resolve(e);if(d!==u&&!d.startsWith(`${u}${g.sep}`)){i.push({path:c,reason:"invalid_path"});continue}try{let f=await y.lstat(d);if(!f.isFile()){i.push({path:c,reason:"not_file"});continue}if(f.size>it){i.push({path:c,reason:"too_large",sizeBytes:f.size});continue}if(a+f.size>st){i.push({path:c,reason:"total_limit",sizeBytes:f.size});continue}r.push({path:c,absolutePath:d,sizeBytes:f.size}),a+=f.size}catch{i.push({path:c,reason:"read_error"})}}return{rootPath:e,files:r,totalBytes:a,skipped:i}}n(O,"selectLocalProjectSourceFiles");async function ct(t){let e=await x(t),o=await lt(t);return Array.from(new Set([...e,...o])).sort((r,i)=>r.localeCompare(i))}n(ct,"listLocalProjectSourceUploadFiles");async function lt(t){let e=[],o=g.join(t,".openpond","skills");async function r(i){let a=g.join(t,i),l;try{l=await y.readdir(a,{withFileTypes:!0})}catch{return}l.sort((c,d)=>c.name.localeCompare(d.name));for(let c of l){let d=g.join(i,c.name).replace(/\\/g,"/"),u=C(d);if(u){if(c.isDirectory()){await r(u);continue}c.isFile()&&q(u)&&e.push(u)}}}return n(r,"visit"),await r(g.relative(t,o).replace(/\\/g,"/")),e}n(lt,"listGeneratedSkillSourceUploadFiles");function q(t){let e=C(t);if(!e)return!1;let o=e.split("/"),r=o.indexOf(".openpond");return r>=0&&o[r+1]==="skills"&&o.length>r+3}n(q,"isAllowedGeneratedSourceUploadPath");async function dt(t){let e=await P("git",["ls-files","-z","--cached","--others","--exclude-standard"],t);return e.code!==0?x(t):Array.from(new Set(e.stdout.split("\0").map(o=>o.trim()).filter(Boolean))).sort((o,r)=>o.localeCompare(r))}n(dt,"gitVisibleProjectFiles");function pt(t){let e=t.trim()||"main";if(e.length>120||e.startsWith("/")||e.endsWith("/")||e.includes("..")||!/^[A-Za-z0-9._/-]+$/.test(e))throw new Error("Cloud source branch contains unsupported characters.");return e}n(pt,"normalizeGitBranchName");async function ut(t){if((await P("git",["rev-parse","--verify","HEAD"],t)).code!==0)return!1;let o=await P("git",["status","--porcelain=v1"],t);return o.code===0&&o.stdout.trim().length===0}n(ut,"gitRepoHasCleanHead");async function z(t){let e=await P("git",["rev-parse","--verify","HEAD"],t);return e.code===0&&e.stdout.trim()||null}n(z,"readGitHeadCommit");async function mt(t,e){for(let o of t.files){let r=g.resolve(e,o.path),i=g.resolve(e);r!==i&&!r.startsWith(`${i}${g.sep}`)||(await y.mkdir(g.dirname(r),{recursive:!0}),await y.copyFile(o.absolutePath,r))}}n(mt,"copySelectedFilesToSnapshot");async function gt(t){await w(t.cwd,["init"],"Initialize Cloud source snapshot"),await w(t.cwd,["checkout","-B",t.branch],"Create Cloud source branch"),await w(t.cwd,["config","user.name","OpenPond Desktop"],"Configure Git user"),await w(t.cwd,["config","user.email","desktop@openpond.ai"],"Configure Git email"),await ft({cwd:t.cwd,repoUrl:t.repoUrl,apiKey:t.apiKey,branch:t.branch}),await w(t.cwd,["add","-A"],"Stage Cloud source snapshot"),await w(t.cwd,["commit","-m",t.commitMessage],"Commit Cloud source snapshot")}n(gt,"createSnapshotCommit");async function ft(t){let e=`refs/remotes/openpond/${t.branch}`,o=await V(t.cwd,["fetch","--depth=1",t.repoUrl,`refs/heads/${t.branch}:${e}`],t.apiKey);if(o.code!==0){let r=`${o.stderr}
|
|
3
3
|
${o.stdout}`;if(ht(r))return;throw new Error(`Fetch Cloud source parent failed: ${E(o)}`)}await w(t.cwd,["reset","--mixed",e],"Attach Cloud source snapshot to remote branch")}n(ft,"applyRemoteBranchParent");async function G(t){let e=await V(t.cwd,["push",t.repoUrl,`HEAD:${t.branch}`],t.apiKey);if(e.code!==0)throw new Error(`Push Cloud source to OpenPond Git failed: ${E(e)}`)}n(G,"pushGitHead");async function V(t,e,o){let r=Buffer.from(`openpond:${o}`,"utf8").toString("base64");return P("git",["-c",`http.extraHeader=Authorization: Basic ${r}`,...e],t)}n(V,"runGitWithAuth");function yt(t){let e=t instanceof Error?t.message:String(t);return e.includes("non-fast-forward")||e.includes("fetch first")||e.includes("remote contains work that you do not")}n(yt,"isNonFastForwardPushError");function ht(t){return t.includes("couldn't find remote ref")||t.includes("could not find remote ref")||t.includes("Remote branch")&&t.includes("not found")}n(ht,"isMissingRemoteRefOutput");function E(t){return(t.stderr||t.stdout||"Git command failed").trim().replace(/\s+/g," ").slice(0,500)}n(E,"formatGitError");async function w(t,e,o){let r=await P("git",e,t);if(r.code!==0)throw new Error(`${o} failed: ${E(r)}`)}n(w,"runGitOrThrow");var wt=new Set(["github_repo","internal_repo","template","manual"]);function Jt(t,e){return e&&t.status!=="active"?{...t,status:"active"}:t}n(Jt,"codexHistorySessionWithLiveStatus");async function Wt(){try{let t=p(await K({type:"list"})),e=L(t.organizations),o=(e.length>0?e:L(t.teams)).map(bt).filter(a=>!!a?.teamId),r=await Promise.all(o.map(async a=>{try{let l=p(await j({type:"project_list",payload:{teamId:a.teamId}}));return L(l.projects).map(c=>X(c,a)).filter(c=>!!c)}catch{return[]}})),i=new Map;for(let a of r.flat())i.set(`${a.teamId}:${a.id}`,a);return Array.from(i.values()).sort((a,l)=>{let c=Date.parse(a.updatedAt??"")||0,d=Date.parse(l.updatedAt??"")||0;return c!==d?d-c:a.name.localeCompare(l.name)})}catch{return[]}}n(Wt,"fetchCloudProjects");function bt(t){let e=s(t.teamId)??s(t.id);return e?{teamId:e,slug:s(t.slug),displayName:s(t.displayName)??s(t.name)}:null}n(bt,"normalizeOpenPondOrganization");function X(t,e){let o=s(t.id),r=s(t.teamId)??e.teamId;if(!o||!r||s(t.status)==="archived"||s(t.archivedAt))return null;let a=s(t.name)??s(t.slug)??o,l=$(t.sourceType);return{id:o,teamId:r,name:a,slug:s(t.slug),sourceType:l,sourceLabel:Y(t,l),defaultBranch:s(t.defaultBranch)??s(t.gitBranch),internalRepoPath:s(t.internalRepoPath),manifestPath:s(t.sandboxManifestPath),manifestHash:s(t.sandboxManifestHash),syncedAt:s(t.sandboxManifestSyncedAt),organizationName:e.displayName,organizationSlug:e.slug,createdAt:s(t.createdAt),updatedAt:s(t.updatedAt)}}n(X,"normalizeCloudProject");function $(t){return typeof t=="string"&&wt.has(t)?t:"manual"}n($,"normalizeCloudProjectSourceType");function Y(t,e){if(e==="github_repo"){let o=s(t.gitOwner),r=s(t.gitRepo);if(o&&r)return`${o}/${r}`}return e==="internal_repo"?s(t.internalRepoPath)??"Internal repo":e==="template"?s(t.templateRepoUrl)??s(t.templateSourceProjectId)??"Template":s(t.normalizedSourceIdentity)}n(Y,"cloudProjectSourceLabel");function qt(t){return typeof t=="boolean"?t:null}n(qt,"booleanValue");function p(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}n(p,"asRecord");function Vt(t){let e=p(t);return Object.keys(e).length>0?e:null}n(Vt,"nonEmptyRecord");function L(t){return Array.isArray(t)?t.map(p).filter(e=>Object.keys(e).length>0):[]}n(L,"asRecordArray");function s(t){return typeof t=="string"&&t.trim()?t.trim():null}n(s,"stringValue");function Xt(t){if(!t)return null;if(t==="request_only"||t==="coding_core")return t;throw new Error("hostedSourceDispatch must be one of request_only, coding_core.")}n(Xt,"parseHostedSourceDispatch");function jt(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"&&e.trim().length>0).map(e=>e.trim()):[]}n(jt,"stringArrayValue");function Yt(t){let e=t.code===0||t.code===null?"completed":"failed",o=t.stdout.trim()||t.stderr.trim()||`Ran profile action ${t.action}.`,r=[],i=[];try{let a=JSON.parse(t.stdout),l=p(a),c=p(l.result),d=s(c.text)??s(c.summary)??s(c.message);d&&(o=d),r=jt(c.artifactRefs);let u=s(l.traceArtifactRef);i=u?[u]:[]}catch{}return{artifactRefs:r,output:o,responseSummary:{status:e==="completed"?"available":"failed",text:o},status:e,traceArtifactRefs:i}}n(Yt,"profileActionRunSummary");function Zt(t){let e=At(t.name),o=t.id.replace(/^local_/,"").replace(/[^a-z0-9]/gi,"").slice(0,16);return`desktop-${e}-${o||"project"}`}n(Zt,"internalRepoPathForLocalProject");function At(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"project"}n(At,"slugifyInternalRepoSegment");async function Qt(t){try{let e=await W(t.localProject,{repoUrl:t.repoUrl,apiKey:t.apiKey,branch:t.branch,commitMessage:t.commitMessage,fallbackReadme:t.fallbackReadme}),o=p(await j({type:"project_sync",projectId:t.targetProjectId,payload:{teamId:t.teamId}}).catch(()=>({})));return{rootPath:e.rootPath,branch:e.branch,headCommit:e.headCommit,fileCount:e.fileCount,byteCount:e.byteCount,skippedCount:e.skipped.length,initializedEmptyProject:e.initializedEmptyProject,transport:e.transport,syncPayload:o}}catch{let e=await J(t.localProject),o=e.entries.length===0,r=o?[{path:"README.md",type:"file",contentsBase64:Buffer.from(t.fallbackReadme,"utf8").toString("base64")}]:e.entries,i=o?Buffer.byteLength(t.fallbackReadme,"utf8"):e.totalBytes,a=p(await j({type:"project_source_upload",projectId:t.targetProjectId,payload:{teamId:t.teamId,entries:r,branch:t.branch,commitMessage:t.commitMessage,metadata:{source:"openpond-app-local-project-cloud-setup",transport:"api_source_upload"}}}));return{rootPath:e.rootPath,branch:t.branch,headCommit:e.headCommit,fileCount:r.length,byteCount:i,skippedCount:e.skipped.length,initializedEmptyProject:o,transport:"api_source_upload",syncPayload:a}}}n(Qt,"uploadLocalProjectCloudSource");async function te(t){try{let e=p(await j({type:"project_get",projectId:t.projectId,payload:{teamId:t.teamId}})),o=p(e.project);return Object.keys(o).length>0?o:t.fallback}catch{return t.fallback}}n(te,"sandboxProjectRecordOrFallback");async function ee(t){let e=p(await j({type:"project_upsert",payload:{teamId:t.teamId,name:t.projectName,sourceType:"internal_repo",normalizedSourceIdentity:t.internalRepoPath,defaultBranch:t.branch,sourceConfig:{sourceType:"internal_repo",sourceValue:t.internalRepoPath},metadata:{source:"openpond-app-local-project-cloud-setup",localProjectId:t.localProjectId}}})),o=p(e.project);if(Object.keys(o).length===0)throw new Error("OpenPond Cloud Project response did not include a project.");return o}n(ee,"upsertInternalSandboxProject");function oe(t,e,o,r){let i=X({...t,teamId:e},{teamId:e,slug:null,displayName:null});if(i)return i;let a=s(t.id);if(!a)throw new Error("OpenPond Cloud Project response did not include a project id.");return{id:a,teamId:e,name:s(t.name)??o,slug:s(t.slug),sourceType:$(t.sourceType),sourceLabel:Y(t,$(t.sourceType)),defaultBranch:s(t.defaultBranch)??s(t.gitBranch)??r,internalRepoPath:s(t.internalRepoPath),manifestPath:s(t.sandboxManifestPath),manifestHash:s(t.sandboxManifestHash),syncedAt:s(t.sandboxManifestSyncedAt),organizationName:null,organizationSlug:null,createdAt:s(t.createdAt),updatedAt:s(t.updatedAt)}}n(oe,"cloudProjectFromSandboxRecord");function re(t){if(!t)return{};let e=St(t.searchParams.get("limit"));return{...e?{maxEvents:e}:{},tail:t.searchParams.get("tail")==="1"}}n(re,"codexHistoryThreadReadOptions");function ne(t){return`${t}_turn_attachment_${Pt()}`}n(ne,"nextCodexHistoryTurnId");function St(t){if(!t)return;let e=Number.parseInt(t,10);if(!(!Number.isFinite(e)||e<=0))return Math.min(5e4,e)}n(St,"positiveIntegerParam");var It={"tools.web_search":!0,"tools.view_image":!0,"features.web_search_request":!0};function ae(t){return{...It,approvals_reviewer:t==="auto-review"?"auto_review":"user"}}n(ae,"codexHistorySessionConfig");import Z from"node:path";import{promises as Rt}from"node:fs";async function ue(t){let e=await Ct(t.workspacePath);return(await Rt.stat(e).catch(()=>null))?.isDirectory()?(await _({projectRoot:t.workspacePath,build:"always"}).catalog()).actions.map(a=>D.parse({...a,sourcePath:t.workspacePath,implementation:{...a.implementation,projectId:t.id,projectRoot:Z.resolve(t.workspacePath)}})):[]}n(ue,"localProjectActionCatalog");async function Q(t){return _({projectRoot:t.projectRoot,build:"always"}).run({actionId:t.actionId,input:t.value,runId:t.runId,idempotencyKey:t.idempotencyKey,signal:t.signal})}n(Q,"runLocalProjectAction");async function Ct(t){try{let e=await H(t);return Z.resolve(t,e.sourceDirectory??"openpond/actions")}catch(e){throw new Error(`Cannot load ${F}: ${e instanceof Error?e.message:String(e)}`)}}n(Ct,"projectActionSourceDirectory");var kt="https://api.openpond.ai";async function B(t={}){let e=await(t.loadAccountContext??R)(),o=e.token?.trim();if(!o)throw new Error("OpenPond account API key is required.");return{apiBaseUrl:_t(e),token:o}}n(B,"resolveHostedApiAccess");async function ye(t={}){return{...await B(t),teamId:Ut(t.teamId)}}n(ye,"resolveManagedAdapterUserAccess");function he(t){let e=new Headers;return t.startsWith("opk_")?(e.set("Authorization",`ApiKey ${t}`),e.set("openpond-api-key",t)):e.set("Authorization",`Bearer ${t}`),e}n(he,"hostedApiAuthHeaders");function _t(t){return k(t.apiBaseUrl)??k(t.account?.apiBaseUrl)??k(t.config.apiBaseUrl)??tt(t.account?.baseUrl)??tt(t.config.baseUrl)??kt}n(_t,"resolveApiBaseUrl");function Ut(t){let e=t?.trim();if(!e||!/^[A-Za-z0-9_-]{3,191}$/.test(e))throw new Error("Select an OpenPond workspace before using OpenPond Managed RL.");return e}n(Ut,"managedAdapterTeamId");function tt(t){let e=k(t);if(!e)return null;try{let o=new URL(e);if(o.hostname==="openpond.ai")return"https://api.openpond.ai";if(!o.hostname.startsWith("api.")&&o.hostname.endsWith(".openpond.ai"))return o.hostname=`api.${o.hostname}`,o.origin}catch{return e}return e}n(tt,"normalizeOpenPondWebBaseAsApi");function k(t){let e=t?.trim();return e?e.replace(/\/$/,""):null}n(k,"normalizeOptionalUrl");async function et(t,e={}){let o=await(e.resolveAccess??B)(),r=await(e.fetch??I)(o.apiBaseUrl,o.token,`/v1/project-actions/${encodeURIComponent(t.projectId)}/actions/${encodeURIComponent(t.actionId)}?teamId=${encodeURIComponent(t.teamId)}`,{method:"POST",body:JSON.stringify({input:t.value,releaseId:t.releaseId,idempotencyKey:t.idempotencyKey,callerType:"work",callerId:t.callerId}),signal:t.signal,timeoutMs:900*1e3}),i=await T(r,"Run hosted Project Action");if(i.invocation.status==="failed")throw new Error(i.invocation.failureMessage||i.invocation.failureCode||"Hosted Project Action failed.");return i.invocation}n(et,"runHostedProjectAction");function _e(t){return n(async function(o){let r=p(o),i=s(r.action)??s(r.actionName);if(!i)throw new Error("Project Action name is required.");let a=p(r.metadata);if(s(a.execution)==="hosted"){let b=await et({projectId:A(a,"projectId"),teamId:A(a,"teamId"),releaseId:A(a,"releaseId"),actionId:i,value:r.input??{},idempotencyKey:s(a.toolCallId)?`${A(a,"turnId")}:${A(a,"toolCallId")}`:void 0,callerId:s(a.turnId)??void 0}),v=s(a.sessionId);return v&&await t.appendRuntimeEvent(U({name:"workspace_action_result",sessionId:v,turnId:A(a,"turnId"),source:"chat_action",action:"project_action_run",appId:null,status:"completed",output:JSON.stringify(b.resultJson),data:{openPondHostedProjectActionRun:!0,action:{name:i,label:s(a.selectedActionLabel)??i},releaseId:b.releaseId,invocationId:b.id,traces:b.traceJson,outputs:b.outputJson}})),b}let l=s(a.projectId);if(!l)throw new Error("Project Action Project id is required.");let c=await t.resolveProjectRoot(l);if(!c)throw new Error("Project Action Project is not registered locally.");let d=s(a.sessionId),u=s(a.turnId)??`openpond_project_action_${Date.now()}`,f=s(a.toolCallId),h=await Q({projectRoot:c,actionId:i,value:r.input??{},runId:f??void 0,idempotencyKey:f?`${u}:${f}`:null});return d&&await t.appendRuntimeEvent(U({name:"workspace_action_result",sessionId:d,turnId:u,source:"chat_action",action:"project_action_run",appId:null,status:"completed",output:JSON.stringify(h.output),data:{openPondProjectActionRun:!0,action:{name:i,label:s(a.selectedActionLabel)??i},runId:h.runId,traces:h.traces,outputs:h.outputs,outputDirectory:h.outputDirectory,durationMs:h.durationMs}})),h},"projectActionRunPayload")}n(_e,"createProjectActionRunPayload");function A(t,e){let o=s(t[e]);if(!o)throw new Error(`Hosted Project Action ${e} is required.`);return o}n(A,"requiredMetadata");export{K as a,Ft as b,Jt as c,Wt as d,qt as e,p as f,Vt as g,s as h,Xt as i,Yt as j,Zt as k,Qt as l,te as m,ee as n,oe as o,re as p,ne as q,ae as r,ue as s,B as t,ye as u,he as v,_e as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as x}from"./chunk-TPOAAJKA.js";import{m as w}from"./chunk-
|
|
2
|
+
import{a as x}from"./chunk-TPOAAJKA.js";import{m as w}from"./chunk-CSU7RDA5.js";import{j as u}from"./chunk-543QHE3D.js";import{ja as f}from"./chunk-5ZNE43XC.js";import{i as h,oa as m,pa as p}from"./chunk-ZY32SZ2P.js";import{n as s}from"./chunk-RCT3O3HQ.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";import g from"node:path";import{lstat as k,readFile as v,realpath as b}from"node:fs/promises";import{randomUUID as D}from"node:crypto";var y=e.object({id:e.string(),version:e.string(),contentHash:e.string().regex(/^[a-f0-9]{64}$/),feedbackKey:e.string(),release:e.object({id:e.string(),revision:e.union([e.string(),e.number()]),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().nullable()}).strict(),H=e.object({binding:m,packageValue:e.unknown(),graders:e.array(y).max(100),actualGrading:e.object({pass:e.unknown(),evidence:e.unknown()}).strict().optional(),sourceCandidate:h.optional()}).strict();async function q(i,o){let n=await b(o),a=g.resolve(i);if(g.dirname(a)!==n||await b(a)!==a)throw new Error("External Dataset package escaped its private owner home.");let l=await k(a);if(!l.isFile()||l.isSymbolicLink()||l.size>32*1024*1024)throw new Error("External Dataset package is not a bounded regular file.");let r=H.parse(JSON.parse(new TextDecoder("utf8",{fatal:!0}).decode(await v(a))));return r.binding=p(r.binding),r.packageValue=u({...r,packageValue:f(r.packageValue)}),r}c(q,"readHostProfileExternalDataset");async function A(i){let o=H.parse(i.value),n=p(o.binding),a=i.release,l={id:a.harnessRelease.id,contentHash:a.harnessRelease.contentHash};if(n.protectedProfileClosureHash!==s(a.harnessRelease.files.filter(t=>t.visibility!=="policy").map(t=>({path:t.path,asset:t}))))throw new Error("The external Dataset protected Profile closure changed.");if(o.sourceCandidate){let t=await w({workspaceId:typeof a.agentSnapshot.metadata.workspaceId=="string"?a.agentSnapshot.metadata.workspaceId:a.workspaceId,sourceDir:g.join(a.bundlePath,"source")});if(s(o.sourceCandidate.harnessRelease)!==s(l)||x(t).protectedClosureHash!==o.sourceCandidate.protectedClosureHash)throw new Error("The external Dataset candidate differs from its retained frozen compiled source.")}let r=c(async t=>{if(e.object({authorized:e.literal(!0),bindingHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().parse(await i.client.request({contractVersion:1,requestId:D(),operation:"profile.externalDataset.authorize",params:{...t,bindingHash:n.contentHash}})).bindingHash!==n.contentHash)throw new Error("The host authorized another external Dataset binding.")},"authorize");return{authorize:r,resolveExternalDataset:c(async(t,d)=>{if(await r(),s(t)!==s(n)||d.profileRef.profileId!==n.profileId||d.sourceRevision!==i.sourceRevision||s(d.harnessRelease)!==s(l))throw new Error("External Dataset requested another actual Profile source or recipe.");let E=u({...o,binding:t,packageValue:f(o.packageValue)});return{binding:n,packageValue:E,authorize:r}},"resolveExternalDataset"),sourceCandidate:o.sourceCandidate}}c(A,"createHostProfileExternalDataset");export{q as a,A as b};
|