openpond 0.2.61 → 0.2.63
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/README.md +2 -0
- package/dist/app-server.d.ts +4713 -477
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-FUAWCKBH.js → acp-H3MJCPHX.js} +1 -1
- package/dist/chunks/{acp-agent-XBSJ27KI.js → acp-agent-DWA7272M.js} +1 -1
- package/dist/chunks/actions-command-IIYOO4LL.js +2 -0
- package/dist/chunks/{app-layer-4BFMOMKM.js → app-layer-K7H2WJ56.js} +1 -1
- package/dist/chunks/app-server-connected-apps-RM5E2VWF.js +2 -0
- package/dist/chunks/{app-server-evaluations-HAAYVEXB.js → app-server-evaluations-XGMGS67X.js} +1 -1
- package/dist/chunks/app-server-harness-services-BHD6S5II.js +2 -0
- package/dist/chunks/app-server-runtime-LFIL6F7D.js +2 -0
- package/dist/chunks/apps-QKAHJGQ4.js +2 -0
- package/dist/chunks/chunk-25XXZS3E.js +2 -0
- package/dist/chunks/chunk-27JGS3KB.js +12 -0
- package/dist/chunks/{chunk-KK626T3Z.js → chunk-2EPR4HLF.js} +1 -1
- package/dist/chunks/{chunk-HN2ZK6EV.js → chunk-2HAWOMZK.js} +1 -1
- package/dist/chunks/chunk-2LJCJOJ7.js +2 -0
- package/dist/chunks/{chunk-BDCTN4PU.js → chunk-2V4LPUBH.js} +1 -1
- package/dist/chunks/{chunk-CN5OXQ7A.js → chunk-3YXYBYWK.js} +1 -1
- package/dist/chunks/{chunk-LHENAWLH.js → chunk-42V4NV2F.js} +1 -1
- package/dist/chunks/{chunk-DW3GJRY3.js → chunk-4FNCBA3Y.js} +1 -1
- package/dist/chunks/{chunk-TXBIZDXG.js → chunk-4L6DU6Z2.js} +1 -1
- package/dist/chunks/{chunk-BFKYRQMA.js → chunk-4N4EH3RJ.js} +1 -1
- package/dist/chunks/{chunk-MLTKB5G3.js → chunk-4SZ3HKHU.js} +1 -1
- package/dist/chunks/{chunk-SCCYSPQ5.js → chunk-4ZBOYWQ3.js} +1 -1
- package/dist/chunks/chunk-5EP2DZLJ.js +2 -0
- package/dist/chunks/chunk-5FU5RLML.js +2 -0
- package/dist/chunks/{chunk-TH6Y4K5Z.js → chunk-5MHYGMJG.js} +1 -1
- package/dist/chunks/chunk-6EBCS57F.js +2 -0
- package/dist/chunks/chunk-6RS4NAOY.js +2 -0
- package/dist/chunks/chunk-6XSSM4WT.js +3 -0
- package/dist/chunks/{chunk-NVHZRKXB.js → chunk-7HRLWPPZ.js} +1 -1
- package/dist/chunks/chunk-7O6Z3VOZ.js +2 -0
- package/dist/chunks/{chunk-BQUWZRWU.js → chunk-7WYL2IDD.js} +1 -1
- package/dist/chunks/chunk-7YLXGILH.js +2 -0
- package/dist/chunks/chunk-7ZLXFKRI.js +2 -0
- package/dist/chunks/{chunk-M6JRS5PA.js → chunk-ABF3W2MO.js} +1 -1
- package/dist/chunks/{chunk-TTN63EAM.js → chunk-AH26AQN7.js} +1 -1
- package/dist/chunks/chunk-AHOBCBVZ.js +2 -0
- package/dist/chunks/chunk-AZ7BL5FL.js +2 -0
- package/dist/chunks/{chunk-3DVWJCOA.js → chunk-B4RKHHF7.js} +1 -1
- package/dist/chunks/chunk-B5R53U74.js +2 -0
- package/dist/chunks/chunk-BKEDG3A4.js +22 -0
- package/dist/chunks/{chunk-CO3OJFPU.js → chunk-BPZOABMC.js} +1 -1
- package/dist/chunks/{chunk-5VPU7OS7.js → chunk-BSPFY3Y5.js} +1 -1
- package/dist/chunks/{chunk-U4HZD2GM.js → chunk-BU27SLZP.js} +2 -2
- package/dist/chunks/chunk-C2AXMKK4.js +2 -0
- package/dist/chunks/{chunk-SIV5P6JO.js → chunk-C2LAEGOW.js} +2 -2
- package/dist/chunks/{chunk-ORLJJGZZ.js → chunk-CZ5R4JXZ.js} +1 -1
- package/dist/chunks/{chunk-D4JZALZ4.js → chunk-DABBHWSF.js} +1 -1
- package/dist/chunks/{chunk-ROE24PN5.js → chunk-DLANLLKH.js} +1 -1
- package/dist/chunks/{chunk-57RY3LSR.js → chunk-DQI5TE6A.js} +2 -2
- package/dist/chunks/chunk-DTTFUANI.js +12 -0
- package/dist/chunks/{chunk-VBW2X42G.js → chunk-DUL6DXOI.js} +1 -1
- package/dist/chunks/{chunk-OQUKSRU3.js → chunk-ELX7VRSU.js} +1 -1
- package/dist/chunks/chunk-ERL2M773.js +3 -0
- package/dist/chunks/chunk-ERT32RZA.js +86 -0
- package/dist/chunks/{chunk-RPOD6I64.js → chunk-EZRUWIP6.js} +1 -1
- package/dist/chunks/{chunk-MCIIGQT7.js → chunk-F6UQ6PPK.js} +1 -1
- package/dist/chunks/chunk-F7QTIHXX.js +2 -0
- package/dist/chunks/chunk-FAKDGLZQ.js +8 -0
- package/dist/chunks/{chunk-BWY4D3BN.js → chunk-FVRII5XO.js} +1 -1
- package/dist/chunks/{chunk-GEXKTGLY.js → chunk-FYYYECHE.js} +50 -48
- package/dist/chunks/chunk-G32BO6M5.js +4 -0
- package/dist/chunks/{chunk-TSAW2QVU.js → chunk-G6OR5NB6.js} +1 -1
- package/dist/chunks/{chunk-65SM7Y2G.js → chunk-GGJUWIGR.js} +1 -1
- package/dist/chunks/{chunk-Q66LWQGF.js → chunk-GPL2Z65R.js} +1 -1
- package/dist/chunks/{chunk-LNRFRAV5.js → chunk-GS6ZUSIN.js} +2 -2
- package/dist/chunks/{chunk-OFVUN4KI.js → chunk-GVARQXYI.js} +1 -1
- package/dist/chunks/chunk-GXCUH2VV.js +17 -0
- package/dist/chunks/{chunk-IUGK6BBY.js → chunk-GXZCMO6S.js} +1 -1
- package/dist/chunks/{chunk-CLFYRN46.js → chunk-H6C4MAUN.js} +1 -1
- package/dist/chunks/{chunk-SGK4GR44.js → chunk-HFJUXKT5.js} +1 -1
- package/dist/chunks/{chunk-I3W27VK4.js → chunk-HUCBKXTU.js} +1 -1
- package/dist/chunks/{chunk-P4XM7LUT.js → chunk-IHB5GTOJ.js} +2 -2
- package/dist/chunks/{chunk-U447MS3Y.js → chunk-IWWXIUAQ.js} +1 -1
- package/dist/chunks/chunk-J572ANHX.js +13 -0
- package/dist/chunks/{chunk-CGAL7IHZ.js → chunk-J7ZTPXRQ.js} +1 -1
- package/dist/chunks/chunk-JCLTFDVW.js +2 -0
- package/dist/chunks/{chunk-25RDE7DV.js → chunk-JEISPWWM.js} +1 -1
- package/dist/chunks/{chunk-ELYRVTTG.js → chunk-JORRZ4BB.js} +1 -1
- package/dist/chunks/{chunk-H2AUR7OT.js → chunk-JQRMDFF3.js} +1 -1
- package/dist/chunks/chunk-JSQRLLN6.js +2 -0
- package/dist/chunks/chunk-KCOTDUGW.js +2 -0
- package/dist/chunks/{chunk-NK4JKB7C.js → chunk-KHTAAVC2.js} +1 -1
- package/dist/chunks/{chunk-CM5USMXN.js → chunk-KOKX7PBS.js} +1 -1
- package/dist/chunks/{chunk-3ZWLRBYZ.js → chunk-KUPJNBWG.js} +1 -1
- package/dist/chunks/{chunk-MHYI7ATG.js → chunk-LK2K3SPM.js} +2 -2
- package/dist/chunks/{chunk-FJ3HMHT6.js → chunk-LKKMLBOH.js} +1 -1
- package/dist/chunks/{chunk-BNZTJPK7.js → chunk-LSZJ5M3X.js} +1 -1
- package/dist/chunks/chunk-M3FLEZ4E.js +4 -0
- package/dist/chunks/{chunk-4LZLO4OW.js → chunk-M3SCON53.js} +1 -1
- package/dist/chunks/{chunk-VPDG2V2R.js → chunk-MEGKXGW3.js} +1 -1
- package/dist/chunks/{chunk-TYHCBVQT.js → chunk-MILEWROZ.js} +1 -1
- package/dist/chunks/chunk-MPNJ2BB4.js +2 -0
- package/dist/chunks/{chunk-VFLSBDNZ.js → chunk-N33D7KCW.js} +1 -1
- package/dist/chunks/chunk-N42HT64M.js +2 -0
- package/dist/chunks/{chunk-L3GA2CQI.js → chunk-N4VHLJBZ.js} +1 -1
- package/dist/chunks/chunk-NEJLJ2XY.js +2 -0
- package/dist/chunks/chunk-NG2L6D7G.js +2 -0
- package/dist/chunks/{chunk-7EAWLYYB.js → chunk-NLYZ5K7U.js} +2 -2
- package/dist/chunks/{chunk-B47JMAVW.js → chunk-NT7N6KLE.js} +1 -1
- package/dist/chunks/{chunk-6MWT6BVU.js → chunk-NWQL6FNF.js} +1 -1
- package/dist/chunks/{chunk-PAZDQRYU.js → chunk-NZTCH6K5.js} +1 -1
- package/dist/chunks/{chunk-CQF6QZEL.js → chunk-OG33QAG6.js} +1 -1
- package/dist/chunks/chunk-OTUBJV6C.js +6 -0
- package/dist/chunks/{chunk-TMMFF6DO.js → chunk-PBTXLQAU.js} +1 -1
- package/dist/chunks/chunk-Q34IF4PW.js +2 -0
- package/dist/chunks/{chunk-I3X6M6ZO.js → chunk-QJ6KUVAR.js} +1 -1
- package/dist/chunks/{chunk-SID4X3YN.js → chunk-QU4UE73E.js} +1 -1
- package/dist/chunks/{chunk-I7JCARVH.js → chunk-R6VJDOQM.js} +3 -3
- package/dist/chunks/{chunk-6RVF2J47.js → chunk-R6WMY6AH.js} +1 -1
- package/dist/chunks/{chunk-ZUNG6YDO.js → chunk-RDSVU6F6.js} +1 -1
- package/dist/chunks/{chunk-R4PDSOB4.js → chunk-RFMME46Z.js} +1 -1
- package/dist/chunks/{chunk-GQUS7MCH.js → chunk-RZUCVF2Q.js} +1 -1
- package/dist/chunks/chunk-SFKZITAG.js +9 -0
- package/dist/chunks/{chunk-MF35MALN.js → chunk-SHJY5RLU.js} +1 -1
- package/dist/chunks/chunk-SI5W5LBV.js +2 -0
- package/dist/chunks/chunk-SO42ZB5K.js +2 -0
- package/dist/chunks/{chunk-TNHDD3LO.js → chunk-SXMR6E2W.js} +1 -1
- package/dist/chunks/{chunk-OMICIPPY.js → chunk-T6JN4PND.js} +1 -1
- package/dist/chunks/{chunk-ZISYLRH6.js → chunk-TCOTXCV6.js} +1 -1
- package/dist/chunks/{chunk-QCSLEMZF.js → chunk-U2K7QJCG.js} +1 -1
- package/dist/chunks/{chunk-ISIXFK6U.js → chunk-UH4JSSRL.js} +28 -28
- package/dist/chunks/chunk-UPWJSNL5.js +2 -0
- package/dist/chunks/chunk-URNMC46H.js +157 -0
- package/dist/chunks/{chunk-OJFDI7VM.js → chunk-UTNGEMW5.js} +1 -1
- package/dist/chunks/{chunk-WFVOG5PU.js → chunk-V7KR74NO.js} +1 -1
- package/dist/chunks/{chunk-QDBYLJGH.js → chunk-VHXDWAEH.js} +1 -1
- package/dist/chunks/{chunk-VZXZ6CHS.js → chunk-W2TICQ62.js} +1 -1
- package/dist/chunks/{chunk-QRJPLZF7.js → chunk-W5W4IODW.js} +1 -1
- package/dist/chunks/chunk-WP2L2NY2.js +2 -0
- package/dist/chunks/chunk-WSOUMXH3.js +24 -0
- package/dist/chunks/chunk-WWQNMC7C.js +6 -0
- package/dist/chunks/chunk-XMHIQ3SK.js +5 -0
- package/dist/chunks/{chunk-5MTN6KXV.js → chunk-XNOMIWEY.js} +1 -1
- package/dist/chunks/{chunk-T4LLJC5N.js → chunk-XOB6FKQV.js} +1 -1
- package/dist/chunks/chunk-Y766IN7Y.js +2 -0
- package/dist/chunks/chunk-YCZZ62C2.js +2 -0
- package/dist/chunks/chunk-YM4PSVFW.js +4 -0
- package/dist/chunks/chunk-YNQWJWIC.js +10 -0
- package/dist/chunks/{chunk-LBBXVOVR.js → chunk-Z3BWCFLV.js} +1 -1
- package/dist/chunks/{chunk-WRQEYW3V.js → chunk-ZG6353RM.js} +1 -1
- package/dist/chunks/{chunk-PE7UKJXK.js → chunk-ZPTKR3GB.js} +1 -1
- package/dist/chunks/{chunk-2VXL6AU3.js → chunk-ZYVHOVKL.js} +1 -1
- package/dist/chunks/chunk-ZZHXQCNB.js +22 -0
- package/dist/chunks/cli-PSXMIJTF.js +2 -0
- package/dist/chunks/{configuration-command-ONGI2BJD.js → configuration-command-XYKMXIWF.js} +1 -1
- package/dist/chunks/connected-app-executor-6G2LA3PQ.js +2 -0
- package/dist/chunks/connected-evidence-IRXYN6YD.js +2 -0
- package/dist/chunks/{connected-starting-assets-OXLT7S4O.js → connected-starting-assets-JONPTII6.js} +1 -1
- package/dist/chunks/{connection-HJWE6SEW.js → connection-XMAAGMXJ.js} +1 -1
- package/dist/chunks/{continual-CJUZM5ZQ.js → continual-Z7MO2PF6.js} +1 -1
- package/dist/chunks/core-commands-WWN7X3XC.js +2 -0
- package/dist/chunks/dataset-preparation-authoring-F3OZIQSP.js +4 -0
- package/dist/chunks/datasets-2PC2HP7N.js +2 -0
- package/dist/chunks/desktop-test-VU6AFAMO.js +3 -0
- package/dist/chunks/dist-47AYOIH6.js +2 -0
- package/dist/chunks/{dist-X64FC6NA.js → dist-HSC43RG4.js} +1 -1
- package/dist/chunks/{dist-DCSLPBO2.js → dist-MXBEBM4D.js} +1 -1
- package/dist/chunks/evaluation-coordination-UOWZHHC5.js +2 -0
- package/dist/chunks/experiment-improvements-EB2CV5RA.js +2 -0
- package/dist/chunks/experiments-SZQYR6MH.js +2 -0
- package/dist/chunks/experiments-signal-2KJCP25D.js +2 -0
- package/dist/chunks/{extension-C33NUFDL.js → extension-ZM6NI5O5.js} +1 -1
- package/dist/chunks/{help-M2VQGPVC.js → help-7HXFWIKS.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-Y2LQ4WQN.js +2 -0
- package/dist/chunks/host-profile-external-dataset-FRIGXOO7.js +2 -0
- package/dist/chunks/hosted-app-server-composition-PGKQNDW6.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-UXC542SZ.js +3 -0
- package/dist/chunks/hosted-harness-runtime-6PEI7F2U.js +2 -0
- package/dist/chunks/hosted-profile-candidate-HM44BIUX.js +3 -0
- package/dist/chunks/hosted-profile-compiler-UAZ4PHYE.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-control-EUL57FAB.js +2 -0
- package/dist/chunks/hosted-profile-evaluation-inspection-7USY75Z4.js +3 -0
- package/dist/chunks/{hosted-profile-evaluation-preparation-ZAOGDQXO.js → hosted-profile-evaluation-preparation-2LSMZQNA.js} +1 -1
- package/dist/chunks/{hosted-tasksets-CVUP7MS6.js → hosted-tasksets-WGXGXJ7E.js} +1 -1
- package/dist/chunks/human-review-M26UKGJL.js +2 -0
- package/dist/chunks/{import-WLLUIDS6.js → import-6SI4BEKS.js} +2 -2
- package/dist/chunks/learning-HM3NWOV5.js +2 -0
- package/dist/chunks/local-harness-improvement-runtime-QGWFWNSR.js +2 -0
- package/dist/chunks/local-harness-taskset-review-KS4WPMN6.js +2 -0
- package/dist/chunks/model-projects-YUAMBQTO.js +2 -0
- package/dist/chunks/opchat-AG4CWVY4.js +3 -0
- package/dist/chunks/opchat-bounded-chat-IQMP5IIO.js +2 -0
- package/dist/chunks/organizations-KDKX77XZ.js +2 -0
- package/dist/chunks/{profile-JRS3JNRC.js → profile-O5HL5DTQ.js} +1 -1
- package/dist/chunks/project-action-payload-QA24HYGF.js +2 -0
- package/dist/chunks/project-agent-XBOOM5TS.js +2 -0
- package/dist/chunks/published-experiment-source-GZGN354O.js +2 -0
- package/dist/chunks/refiner-profile-service-BJMOYKTC.js +2 -0
- package/dist/chunks/{runtime-CBJF5GMB.js → runtime-XBA744HJ.js} +2 -2
- package/dist/chunks/sandbox-command-5ECGS7DG.js +2 -0
- package/dist/chunks/{sandbox-template-FTANKQIA.js → sandbox-template-27U3FQN7.js} +1 -1
- package/dist/chunks/saved-work-KUNVTJ7O.js +2 -0
- package/dist/chunks/{send-turn-5UB7ZBJV.js → send-turn-FIPWOXWV.js} +1 -1
- package/dist/chunks/src-BLWX6DRG.js +424 -0
- package/dist/chunks/{src-4YZF6L6H.js → src-PU7QTFO5.js} +1 -1
- package/dist/chunks/standalone-experiment-turn-owner-XIE46VNH.js +2 -0
- package/dist/chunks/store-chat-resources-YOEJ2BI6.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-GWI2FRII.js → store-continual-support-reviews-FOMYYS25.js} +1 -1
- package/dist/chunks/{store-conversation-serving-637AHKBP.js → store-conversation-serving-K324SQTO.js} +1 -1
- package/dist/chunks/{store-create-improve-ZG653Z63.js → store-create-improve-3LQMIYAP.js} +1 -1
- package/dist/chunks/{store-datasets-IW6F2QZM.js → store-datasets-3KSX7RSO.js} +1 -1
- package/dist/chunks/store-evaluation-results-LHCCNNE6.js +7 -0
- package/dist/chunks/{store-harness-evaluation-review-settings-I2R3HPO3.js → store-harness-evaluation-review-settings-AAN7KKJ5.js} +1 -1
- package/dist/chunks/{store-harness-refinement-candidates-SUT45FQX.js → store-harness-refinement-candidates-3PHL3BUY.js} +1 -1
- package/dist/chunks/store-harness-workspaces-ZHNCNWVI.js +2 -0
- package/dist/chunks/store-human-review-QJY3ZPPF.js +7 -0
- package/dist/chunks/store-learned-preference-migration-validation-X32SRBOM.js +2 -0
- package/dist/chunks/{store-learning-MFS4DGQR.js → store-learning-DW3QLQXU.js} +1 -1
- package/dist/chunks/{store-learning-credentials-BECWEG2Y.js → store-learning-credentials-67QNTPA7.js} +1 -1
- package/dist/chunks/{store-local-experiments-A2UWYPVQ.js → store-local-experiments-QTVHJAEP.js} +1 -1
- package/dist/chunks/store-model-batch-review-PBYQZJJJ.js +2 -0
- package/dist/chunks/store-model-configuration-3SU73CMS.js +3 -0
- package/dist/chunks/store-model-project-preparation-TFCG2F2F.js +2 -0
- package/dist/chunks/store-ponder-history-WDLMXBIJ.js +2 -0
- package/dist/chunks/store-ponder-hosted-DX6E2BVW.js +4 -0
- package/dist/chunks/{store-preference-comparison-HTOXLWKF.js → store-preference-comparison-DWV5XSMY.js} +1 -1
- package/dist/chunks/{store-schedules-QVWT7AEB.js → store-schedules-2KUY4T6M.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-G5Z6NZWL.js → store-sidebar-file-bookmarks-A4XCS7RM.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-27FFMUWU.js → store-sidebar-preferences-V2PKRXUZ.js} +1 -1
- package/dist/chunks/{store-subagents-PK7ZWLPR.js → store-subagents-UGVEFA6M.js} +1 -1
- package/dist/chunks/store-task-inbox-QABI4ZAH.js +33 -0
- package/dist/chunks/{store-task-inventory-IG6HGWSQ.js → store-task-inventory-GEQIZELY.js} +1 -1
- package/dist/chunks/store-taskset-drafts-GXABQR5G.js +9 -0
- package/dist/chunks/{store-training-NQRRPKEZ.js → store-training-CQV7PL3V.js} +1 -1
- package/dist/chunks/{store-training-jobs-F6Y2ZTXP.js → store-training-jobs-XKN6K66J.js} +18 -10
- package/dist/chunks/{store-training-models-NRSLSBEW.js → store-training-models-Q7DTTR4S.js} +1 -1
- package/dist/chunks/{store-usage-GFHQYT34.js → store-usage-XGAX7NLB.js} +1 -1
- package/dist/chunks/{taskset-NYLUYX6K.js → taskset-ARKJQKYQ.js} +1 -1
- package/dist/chunks/taskset-packages-X4K65DTW.js +2 -0
- package/dist/chunks/taskset-packages-XK7FSD45.js +2 -0
- package/dist/chunks/{teams-bot-FMAEDGSD.js → teams-bot-UTQAJA6H.js} +1 -1
- package/dist/chunks/training-3IWW4256.js +2 -0
- package/dist/chunks/{training-UBX6E7SK.js → training-RVIESURJ.js} +1 -1
- package/dist/chunks/training-error-2EWDOQ4G.js +2 -0
- package/dist/chunks/training-hosted-PFJHYTEU.js +2 -0
- package/dist/chunks/training-hosted-checkpoint-evaluation-JJPP7KFW.js +2 -0
- package/dist/chunks/training-hosted-feedback-5B2KJGOT.js +2 -0
- package/dist/chunks/training-hosted-learning-Y7NHRY4V.js +2 -0
- package/dist/chunks/training-hosted-report-UVGTPDOK.js +2 -0
- package/dist/chunks/training-hosted-serving-QAV7ZGGV.js +2 -0
- package/dist/chunks/training-hosted-serving-report-OX4A5OKB.js +2 -0
- package/dist/chunks/training-hosted-workers-LST4ZUXN.js +2 -0
- package/dist/chunks/training-model-start-ROLS3E4V.js +2 -0
- package/dist/chunks/training-project-preparation-XWGRY5ME.js +3 -0
- package/dist/chunks/{web-search-Q4OQVUNH.js → web-search-7FBUBZ66.js} +1 -1
- package/dist/chunks/{workspaces-XREEVSTS.js → workspaces-G3CMY7ZA.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/hosted-chat.d.ts +28 -0
- package/dist/index.js +1 -1
- package/dist/sandbox/url.d.ts +3 -1
- package/dist/skills/LICENSE +21 -0
- package/dist/skills/manifest.json +168 -0
- package/dist/skills/openpond-agent-authoring/SKILL.md +9 -3
- package/dist/skills/openpond-agent-authoring/references/profile-layout.md +1 -1
- package/dist/skills/openpond-agent-authoring/references/validation-and-repair.md +2 -2
- package/dist/skills/openpond-cli/SKILL.md +24 -7
- package/dist/skills/openpond-cli/references/compact-resource-tables.md +3 -3
- package/dist/skills/openpond-cli/references/diagnose-and-improve.md +4 -2
- package/dist/skills/openpond-cli/references/experiments-and-training.md +156 -11
- package/dist/skills/openpond-refiner-authoring/SKILL.md +4 -0
- package/dist/skills/openpond-skill-authoring/SKILL.md +5 -1
- package/dist/skills/openpond-taskset-authoring/SKILL.md +5 -4
- package/dist/skills/openpond-taskset-authoring/artifact.json +7 -7
- package/dist/skills/openpond-taskset-authoring/references/failure-diagnosis.md +52 -1
- package/dist/web/assets/App-DY2R8Z6r.js +53 -0
- package/dist/web/assets/App-DpFKLxuA.css +1 -0
- package/dist/web/assets/AppDialog-8Y0FYalT.js +1 -0
- package/dist/web/assets/AppTerminalPanel-YcnBD5DF.js +2 -0
- package/dist/web/assets/{AppToastContext-BB_2hRfw.js → AppToastContext-BiQbbVxq.js} +1 -1
- package/dist/web/assets/AppsView-Dtte4h6e.js +1 -0
- package/dist/web/assets/{AttachmentTypeIcon-DOAsVQjt.js → AttachmentTypeIcon-DgADV7dn.js} +1 -1
- package/dist/web/assets/BrowserSidebar-BUqDvEv9.js +1 -0
- package/dist/web/assets/{CartesianChart-DO76yfJb.js → CartesianChart-J4ChOjvG.js} +1 -1
- package/dist/web/assets/ChatTimelineEntry-DC93wlDa.js +8 -0
- package/dist/web/assets/ChatTimelineEntry-DztFb85D.css +1 -0
- package/dist/web/assets/{CollaborationTabs-DNoknVMD.js → CollaborationTabs-CFCpk2Ck.js} +1 -1
- package/dist/web/assets/CommandMenu-EPPjB14H.js +1 -0
- package/dist/web/assets/CommunityView-Okydjpqm.js +1 -0
- package/dist/web/assets/ComposerAttachments-RXCiE88M.js +2 -0
- package/dist/web/assets/ComposerCreateImproveStrip-CSngc8-V.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-DS73kyfj.js +1 -0
- package/dist/web/assets/FilePagePreview-Qc4B0vue.js +2 -0
- package/dist/web/assets/GetStartedView-DGFPQ1We.js +1 -0
- package/dist/web/assets/GettingStartedDialog-DFBYQdHz.js +1 -0
- package/dist/web/assets/GettingStartedDialog-EsH-8Diz.css +1 -0
- package/dist/web/assets/{HostedModelLearningReview-B0rbIVvn.js → HostedModelLearningReview-BDu3FlcU.js} +1 -1
- package/dist/web/assets/HostedModelLearningSettings-CHaTHwC8.js +1 -0
- package/dist/web/assets/HtmlVisual-C7GlEVfH.css +1 -0
- package/dist/web/assets/HtmlVisual-D9Mh7xds.js +81 -0
- package/dist/web/assets/LabModelVersionDetailPage-DgY7lAu5.js +1 -0
- package/dist/web/assets/LabSkillSidebar-BwtlThO7.js +1 -0
- package/dist/web/assets/LabsRoute-BV7ZJGEw.js +101 -0
- package/dist/web/assets/MainChatThread-pzHKd_YN.js +2 -0
- package/dist/web/assets/MainPane-6OlLiKKb.js +10 -0
- package/dist/web/assets/MainPane-Dje-hfUM.css +1 -0
- package/dist/web/assets/NativeSetupTerminal-3eR9D_R3.css +1 -0
- package/dist/web/assets/NativeSetupTerminal-CPDChcMi.js +2 -0
- package/dist/web/assets/NativeSkillSidebar-BEJvt5_H.js +1 -0
- package/dist/web/assets/NewProjectDialog-CjrjgkTN.js +1 -0
- package/dist/web/assets/OutputsPage-jzx93QQ3.js +1 -0
- package/dist/web/assets/{PageChrome-BBnWAENV.js → PageChrome-C1M13qG2.js} +1 -1
- package/dist/web/assets/ProjectsPage-DZrjlMp2.js +1 -0
- package/dist/web/assets/RightChatPanelStack-BsxJg9sy.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-CCVQ9LMB.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-Cw1ja2GF.js +1 -0
- package/dist/web/assets/{SettingsView-Y8f98GSE.css → SettingsView-Cc0376pY.css} +1 -1
- package/dist/web/assets/SettingsView-CckoIki3.js +5 -0
- package/dist/web/assets/TasksetDraftEditorPrimitives-ByC8bDjp.js +1 -0
- package/dist/web/assets/TeamChatView-OprnSKLF.js +1 -0
- package/dist/web/assets/TerminalOverlay-d7A2F9Lx.js +16 -0
- package/dist/web/assets/TrainingCreationPanel-Cyn6R6I6.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-HznyNCJ4.js → TrainingDraftPanel-Mpb5e7t5.js} +1 -1
- package/dist/web/assets/TrainingRunLineage-PXzWR65d.css +1 -0
- package/dist/web/assets/TrainingRunLineage-VcKz7dIR.js +1 -0
- package/dist/web/assets/{UsageSettingsSection-C3oZ1UEP.js → UsageSettingsSection-FhYymrfc.js} +2 -2
- package/dist/web/assets/WorkSidebarPanel-u87uptH0.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-B5rlW7bA.js +11 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-C8y3537a.js +35 -0
- package/dist/web/assets/WorkspaceFileLocation-LrEWj4UK.js +1 -0
- package/dist/web/assets/WorkspaceGitDialogs-NRIMXnkS.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-DfsL1WIi.js → WorkspaceMonacoEditor-CvDGjKAL.js} +3 -3
- package/dist/web/assets/WorkspacePdfPreview-BZ0BbnHv.js +2 -0
- package/dist/web/assets/{WorkspacePresentationPreview-WuS_B45u.js → WorkspacePresentationPreview-DJrjrvT0.js} +1 -1
- package/dist/web/assets/app-models-CUA9XB9U.js +1 -0
- package/dist/web/assets/bot-6OhUEmkE.js +1 -0
- package/dist/web/assets/browser-sidebar-links-ZyYiYBBd.js +1 -0
- package/dist/web/assets/chat-resources-CI8KFVO5.js +1 -0
- package/dist/web/assets/{chevron-down-Bnma8EMP.js → chevron-down-jmVA1BIf.js} +1 -1
- package/dist/web/assets/chevron-right-BYmDQ7ti.js +1 -0
- package/dist/web/assets/chevron-up-CstyLXH3.js +1 -0
- package/dist/web/assets/{chunk-GAIDBPFY-BLuHpurI.js → chunk-ONGOAEY6-C__DQmRT.js} +5 -5
- package/dist/web/assets/{chunk-24N6A6SF-BUjzKvRC.js → chunk-SQBYHWZU-DumrB9SB.js} +1 -1
- package/dist/web/assets/{client-choice-storage-BuNdhYSV.js → client-choice-storage-BdQ_YDuk.js} +1 -1
- package/dist/web/assets/{cloud-upload-DOftANif.js → cloud-upload-Ck1ufAr8.js} +1 -1
- package/dist/web/assets/connected-app-mentions-D3wRZLwI.js +1 -0
- package/dist/web/assets/contracts-BLiqJxBv.js +1 -0
- package/dist/web/assets/copy-CPkbMfXt.js +1 -0
- package/dist/web/assets/{createLucideIcon-C4b2afqG.js → createLucideIcon-CXQny8HU.js} +1 -1
- package/dist/web/assets/{cssMode-0Hn7tCrE.js → cssMode-CYxYl_om.js} +1 -1
- package/dist/web/assets/external-link-CDKOLG_v.js +1 -0
- package/dist/web/assets/{folder-open-wJwCoIDs.js → folder-open-CEtOb_lK.js} +1 -1
- package/dist/web/assets/{folder-plus-DnTN6mcP.js → folder-plus-CVMYZs3e.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-98y7PP6G.js → git-commit-horizontal-DDyhPjxS.js} +1 -1
- package/dist/web/assets/{htmlMode-JO_QluNH.js → htmlMode-DoY4V_j0.js} +1 -1
- package/dist/web/assets/icons-D7jkCa2d.js +1 -0
- package/dist/web/assets/{image-C7HVlg3X.js → image-B-PjDSwU.js} +1 -1
- package/dist/web/assets/{index-BsPUniZy.js → index-D9WbJMSq.js} +2 -2
- package/dist/web/assets/index-g7UqJhnX.css +1 -0
- package/dist/web/assets/{info-BLWDShaz.js → info-CCnw-K3b.js} +1 -1
- package/dist/web/assets/intake-contracts-BW0Y0C2R.js +1 -0
- package/dist/web/assets/{jsonMode-BfTXJted.js → jsonMode-CeOpZdPj.js} +1 -1
- package/dist/web/assets/loader-circle-CPaJeTDy.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-68cAgnuv.js → lspLanguageFeatures-DAbgLCqZ.js} +1 -1
- package/dist/web/assets/{maximize-2-DUWvLap6.js → maximize-2-BZX38cpr.js} +1 -1
- package/dist/web/assets/message-square-CvgSecgD.js +1 -0
- package/dist/web/assets/{monaco.contribution-_3aU1TTb.js → monaco.contribution-CF2JDhi4.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CWeY6ia1.js → monaco.contribution-cbDqt48m.js} +2 -2
- package/dist/web/assets/{monaco.contribution-h8U8HXFT.js → monaco.contribution-m2ze2EsL.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DOiiDDen.js → monaco.contribution-yeyow_-Q.js} +2 -2
- package/dist/web/assets/{monitor-B6OuAu13.js → monitor-By0s4hxb.js} +1 -1
- package/dist/web/assets/{paperclip-DSHxP9CY.js → paperclip-BJ2QgJLa.js} +1 -1
- package/dist/web/assets/{pdf-RXlFwNte.js → pdf-C4x-1jjP.js} +1 -1
- package/dist/web/assets/pdf.worker.min-BrEVksTu.js +1 -0
- package/dist/web/assets/play-D_SuGDBM.js +1 -0
- package/dist/web/assets/plus-yw95Iaj8.js +1 -0
- package/dist/web/assets/{presentation-C9WnPDVr.js → presentation-I86G1Gd9.js} +1 -1
- package/dist/web/assets/profile-agent-labels-Duh96b8x.js +1 -0
- package/dist/web/assets/{python-BQXo7wMt.js → python-CqFTPj8r.js} +1 -1
- package/dist/web/assets/{refresh-cw-NXOER_CD.js → refresh-cw-Dga35Eay.js} +1 -1
- package/dist/web/assets/requests-BCbaFiqV.js +1 -0
- package/dist/web/assets/{reward-checks-5AOStF27.js → reward-checks-Bcq9ETCA.js} +1 -1
- package/dist/web/assets/{save-BxXc21N6.js → save-BLKjYtzR.js} +1 -1
- package/dist/web/assets/settings-D7C-Auyi.js +21 -0
- package/dist/web/assets/settings-lists-DMKA1lCN.js +5 -0
- package/dist/web/assets/square-BY5lG2Ol.js +1 -0
- package/dist/web/assets/square-terminal-B-n7vUex.js +1 -0
- package/dist/web/assets/submit-issue-command-B7Hrt2tU.js +3 -0
- package/dist/web/assets/{toggleHighContrast-Di1cRuQ4.js → toggleHighContrast-BhmBE5XE.js} +1 -1
- package/dist/web/assets/training-QrdkRQZQ.js +2 -0
- package/dist/web/assets/{training-model-data-CmVo80ZR.js → training-model-data-DB-jg6L_.js} +12 -12
- package/dist/web/assets/{tsMode-PxisJRYB.js → tsMode-BSWEII2p.js} +1 -1
- package/dist/web/assets/ui-theme.generated-D-mc26qt.js +144 -0
- package/dist/web/assets/{upload-NXasN1wU.js → upload-C4MPhQn8.js} +1 -1
- package/dist/web/assets/{useAccountSettings-Dqqt1vUY.js → useAccountSettings-9oqWdRLs.js} +1 -1
- package/dist/web/assets/useAgentInventory-isO79ui9.js +1 -0
- package/dist/web/assets/{useLocalAgentSchedules-Cc0M_qax.js → useLocalAgentSchedules-CZX6PxoK.js} +1 -1
- package/dist/web/assets/{useQuery-ByaRC9SK.js → useQuery-BD0Uexmh.js} +1 -1
- package/dist/web/assets/{wifi-off-aVJ3AvT_.js → wifi-off-Cloe0WuQ.js} +1 -1
- package/dist/web/assets/{workers-u92Boudu.js → workers-BXagz5eg.js} +1 -1
- package/dist/web/assets/x-Dqpel42h.js +1 -0
- package/dist/web/assets/{yaml-BxQUS0ew.js → yaml-sBdvVbCc.js} +1 -1
- package/dist/web/index.html +12 -3
- package/docs/command-reference.md +49 -5
- package/package.json +6 -2
- package/dist/chunks/actions-command-LOHNQUWP.js +0 -2
- package/dist/chunks/app-server-connected-apps-Q2VWWJNX.js +0 -2
- package/dist/chunks/app-server-harness-services-2PSZBT7U.js +0 -2
- package/dist/chunks/app-server-runtime-B6BAJA6L.js +0 -2
- package/dist/chunks/apps-7PIBF32Q.js +0 -2
- package/dist/chunks/chunk-3TYCIYW6.js +0 -17
- package/dist/chunks/chunk-4GZ2FPB5.js +0 -2
- package/dist/chunks/chunk-4M3YW3EQ.js +0 -13
- package/dist/chunks/chunk-4N3UF3U5.js +0 -2
- package/dist/chunks/chunk-4P3X2RXA.js +0 -2
- package/dist/chunks/chunk-4RHM4WN2.js +0 -2
- package/dist/chunks/chunk-6DCXAXVD.js +0 -22
- package/dist/chunks/chunk-AWPYTDH4.js +0 -4
- package/dist/chunks/chunk-BLKTUFGB.js +0 -2
- package/dist/chunks/chunk-BN5AVRUG.js +0 -2
- package/dist/chunks/chunk-D5ADDBS5.js +0 -2
- package/dist/chunks/chunk-DGPGOBYZ.js +0 -5
- package/dist/chunks/chunk-E3EKBPCB.js +0 -2
- package/dist/chunks/chunk-E67M5WGY.js +0 -2
- package/dist/chunks/chunk-EIIGTADO.js +0 -2
- package/dist/chunks/chunk-F5JDBDYL.js +0 -2
- package/dist/chunks/chunk-FWIPHEVA.js +0 -12
- package/dist/chunks/chunk-GLVR74PX.js +0 -2
- package/dist/chunks/chunk-HZLV773Y.js +0 -22
- package/dist/chunks/chunk-JEVA7YQL.js +0 -3
- package/dist/chunks/chunk-KC7I6E6W.js +0 -2
- package/dist/chunks/chunk-M4ZRCRJM.js +0 -10
- package/dist/chunks/chunk-N663LL27.js +0 -2
- package/dist/chunks/chunk-NR5VASQB.js +0 -2
- package/dist/chunks/chunk-OJSK4NSW.js +0 -151
- package/dist/chunks/chunk-OZ6LRNRE.js +0 -2
- package/dist/chunks/chunk-Q324ZA5M.js +0 -2
- package/dist/chunks/chunk-UBCLPZSQ.js +0 -4
- package/dist/chunks/chunk-UJBEWIR3.js +0 -8
- package/dist/chunks/chunk-V67IFV26.js +0 -86
- package/dist/chunks/chunk-VSUHJ46L.js +0 -18
- package/dist/chunks/chunk-VWJ5IYQP.js +0 -2
- package/dist/chunks/chunk-X3WEQL3O.js +0 -2
- package/dist/chunks/chunk-XK7SPL63.js +0 -2
- package/dist/chunks/chunk-XLULTQLZ.js +0 -12
- package/dist/chunks/chunk-YR5ID2SS.js +0 -2
- package/dist/chunks/chunk-ZBBVRYU3.js +0 -6
- package/dist/chunks/chunk-ZHFH2TZN.js +0 -2
- package/dist/chunks/chunk-ZZWAQBA2.js +0 -2
- package/dist/chunks/cli-WC45SI7E.js +0 -2
- package/dist/chunks/connected-app-executor-TZJB25UZ.js +0 -2
- package/dist/chunks/connected-evidence-4J3YXU4O.js +0 -2
- package/dist/chunks/core-commands-JGXU6B4C.js +0 -2
- package/dist/chunks/dataset-preparation-authoring-DFGJBMVF.js +0 -4
- package/dist/chunks/datasets-MNHZAZIB.js +0 -2
- package/dist/chunks/desktop-test-P23MHAIG.js +0 -3
- package/dist/chunks/dist-IIFTZWNR.js +0 -2
- package/dist/chunks/evaluation-coordination-6NQEH5WU.js +0 -2
- package/dist/chunks/experiment-improvements-M27Z5OF4.js +0 -2
- package/dist/chunks/experiments-IWSCFDBB.js +0 -2
- package/dist/chunks/experiments-signal-R3NNH7WR.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-EFB2YIK2.js +0 -2
- package/dist/chunks/host-profile-external-dataset-KSNREH3Q.js +0 -2
- package/dist/chunks/hosted-app-server-composition-VV545TYL.js +0 -2
- package/dist/chunks/hosted-experiment-improvement-NYLADI7S.js +0 -3
- package/dist/chunks/hosted-harness-runtime-Z54E5MD7.js +0 -2
- package/dist/chunks/hosted-profile-candidate-37ZFY2LH.js +0 -3
- package/dist/chunks/hosted-profile-compiler-SW2RWTDZ.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-control-UQBMML6K.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-inspection-YASS4T6L.js +0 -3
- package/dist/chunks/human-review-IJETDOWB.js +0 -2
- package/dist/chunks/learning-KVLTMRLD.js +0 -2
- package/dist/chunks/local-harness-improvement-runtime-KB4OP3SM.js +0 -2
- package/dist/chunks/local-harness-taskset-review-SUDEUGUU.js +0 -2
- package/dist/chunks/model-projects-AVBQDNYG.js +0 -2
- package/dist/chunks/opchat-KSOJEL4W.js +0 -3
- package/dist/chunks/organizations-DJRJWC5I.js +0 -2
- package/dist/chunks/project-action-payload-SQ5BSQHY.js +0 -2
- package/dist/chunks/project-agent-2KNJFNZI.js +0 -2
- package/dist/chunks/published-experiment-source-LFYHKFAO.js +0 -2
- package/dist/chunks/refiner-profile-service-UWI4NAZ3.js +0 -2
- package/dist/chunks/sandbox-command-IIGTPYN3.js +0 -2
- package/dist/chunks/saved-work-QA46KCME.js +0 -2
- package/dist/chunks/src-E7NWAN5B.js +0 -420
- package/dist/chunks/standalone-experiment-turn-owner-SQJ5HXDZ.js +0 -2
- package/dist/chunks/store-chat-resources-CGW7PDCG.js +0 -2
- package/dist/chunks/store-evaluation-results-V5J6L4NV.js +0 -7
- package/dist/chunks/store-harness-workspaces-HHMM6GNK.js +0 -2
- package/dist/chunks/store-human-review-V5H4QDHR.js +0 -7
- package/dist/chunks/store-learned-preference-migration-validation-KOCW5NOZ.js +0 -2
- package/dist/chunks/store-model-batch-review-KMYPYWJR.js +0 -2
- package/dist/chunks/store-model-configuration-UXNC4PGY.js +0 -3
- package/dist/chunks/store-task-inbox-LNDCZOYE.js +0 -33
- package/dist/chunks/store-taskset-drafts-TA6X245D.js +0 -9
- package/dist/chunks/taskset-packages-I7I5KBFP.js +0 -2
- package/dist/chunks/training-error-AYOGHHL2.js +0 -2
- package/dist/chunks/training-hosted-4R4QTSAN.js +0 -2
- package/dist/chunks/training-hosted-report-UQVK6FTG.js +0 -2
- package/dist/chunks/training-hosted-workers-KI767T4Y.js +0 -2
- package/dist/skills/openpond-desktop-harness/SKILL.md +0 -113
- package/dist/skills/openpond-desktop-harness/agents/openai.yaml +0 -4
- package/dist/web/assets/App-Df7uYQGj.css +0 -1
- package/dist/web/assets/App-Yy3l2sdD.js +0 -56
- package/dist/web/assets/AppTerminalPanel-Dqr6VS3I.js +0 -2
- package/dist/web/assets/AppsView-27Fl_-49.js +0 -1
- package/dist/web/assets/BrowserSidebar-bnI3sSZO.js +0 -1
- package/dist/web/assets/ChatTimelineEntry-IKzZsHoI.js +0 -1
- package/dist/web/assets/CommandMenu-CBY2AJxV.js +0 -1
- package/dist/web/assets/CommunityView-CFKM7FTY.js +0 -1
- package/dist/web/assets/ComposerAttachments-BdjBddKf.js +0 -2
- package/dist/web/assets/ComposerCreateImproveStrip-ViJ5E0We.js +0 -1
- package/dist/web/assets/ConversationImportsSettings-xLl-7G9R.js +0 -1
- package/dist/web/assets/FilePagePreview-CTHuPzJt.js +0 -2
- package/dist/web/assets/GetStartedView-DvV_RMgM.js +0 -1
- package/dist/web/assets/GettingStartedDialog-B1jFmfgd.js +0 -1
- package/dist/web/assets/GettingStartedDialog-C73Bdcz2.css +0 -1
- package/dist/web/assets/HostedModelLearningSettings-DzAiutjq.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-CF8FkRUY.js +0 -1
- package/dist/web/assets/LabSkillSidebar-gjbl9Nlv.js +0 -1
- package/dist/web/assets/LabsRoute-DOnw39du.js +0 -101
- package/dist/web/assets/MainChatThread-BUKup-JB.js +0 -2
- package/dist/web/assets/MainPane-BpE7AKXu.js +0 -92
- package/dist/web/assets/MainPane-CuBUBA9F.css +0 -1
- package/dist/web/assets/NativeSkillSidebar-Br5Lk6iU.js +0 -1
- package/dist/web/assets/NewProjectDialog-DyuKPOvF.js +0 -1
- package/dist/web/assets/OutputsPage-Dl63CVrw.js +0 -1
- package/dist/web/assets/ProjectsPage-BNF1TiyR.js +0 -1
- package/dist/web/assets/RightChatPanelStack-CxVAAbp-.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-D46ktZg-.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-Cp0Hf-hs.js +0 -1
- package/dist/web/assets/SettingsView-BT57Q5Wx.js +0 -5
- package/dist/web/assets/TeamChatView-BmxTJ9E5.js +0 -1
- package/dist/web/assets/TerminalOverlay-D-Yq8av_.js +0 -16
- package/dist/web/assets/TrainingCreationPanel-CwfNPj_G.js +0 -1
- package/dist/web/assets/TrainingMetricWorkbench-BmzHLwIP.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-myTA9tsh.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-D0dzFgzW.js +0 -11
- package/dist/web/assets/WorkspaceEnvironmentMenu-AUzME1eX.js +0 -35
- package/dist/web/assets/WorkspaceFileLocation-Ai8Tz2Mz.js +0 -1
- package/dist/web/assets/WorkspaceGitDialogs-D-UCCckC.js +0 -1
- package/dist/web/assets/app-models-BviS9b7U.js +0 -1
- package/dist/web/assets/browser-sidebar-links-ujSvTf5h.js +0 -1
- package/dist/web/assets/chat-resources-CItQ4mZD.js +0 -1
- package/dist/web/assets/chevron-right-Cxv_xBz5.js +0 -1
- package/dist/web/assets/contracts-BHTOD1nd.js +0 -1
- package/dist/web/assets/git-dialogs-C631EFyO.css +0 -1
- package/dist/web/assets/icons-kaq6k88m.js +0 -1
- package/dist/web/assets/index-DUMDOdB2.css +0 -1
- package/dist/web/assets/play-BPPQoqMl.js +0 -1
- package/dist/web/assets/plus-D18vYzHF.js +0 -1
- package/dist/web/assets/settings-BKmRueaw.js +0 -21
- package/dist/web/assets/settings-lists-DMNPkGYk.js +0 -5
- package/dist/web/assets/square-Da8RuqW4.js +0 -1
- package/dist/web/assets/training-managed-adapter-81RrdT1k.js +0 -1
- package/dist/web/assets/ui-theme.generated-R0MY_Jy0.js +0 -136
- package/dist/web/assets/useAgentInventory-BV4CUWzJ.js +0 -1
- /package/dist/chunks/{chunk-GLDYJM7O.js → chunk-T4QXKU5Y.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as p,b as g,c as R,f as k,g as S,m as d}from"./chunk-OZ6LRNRE.js";import{c,d as u,e as m,g as l,n as H}from"./chunk-VVNV4NNW.js";import{A as t}from"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";var C=t.string().trim().min(1).max(1e5),x=t.record(t.string(),t.unknown()).default({}),$=t.enum(["completed_tool_batch","before_model_step","turn_completed","turn_paused"]),_=t.object({kind:$,eventSequence:t.number().int().nonnegative(),occurredAt:m}).strict(),A=t.object({id:c,sequence:t.number().int().nonnegative().nullable(),contentHash:u}).strict(),j=t.enum(["tool_failure","retry","recovery","validation","user_turn","reusable_success","completion_detour"]),D=t.enum(["open","recovered","terminal"]),U=t.object({name:t.string().trim().min(1).max(500),invocationKey:u}).strict(),O=t.object({schemaVersion:t.literal("openpond.improvementObservation.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),eventRefs:t.array(A).min(1).max(100),kind:j,state:D,tool:U.nullable(),deterministicClass:t.string().trim().min(1).max(500).nullable(),summary:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{new Set(e.eventRefs.map(a=>a.id)).size!==e.eventRefs.length&&n.addIssue({code:"custom",message:"observation event refs must be unique",path:["eventRefs"]}),["tool_failure","retry","recovery","completion_detour"].includes(e.kind)&&e.tool===null&&n.addIssue({code:"custom",message:`${e.kind} observations require a tool identity`,path:["tool"]})}),M=O.extend({contentHash:u}).strict(),B=t.object({schemaVersion:t.literal("openpond.refinementTriggerPolicy.v1"),maxEstimatedCostUsd:t.number().finite().nonnegative(),cooldownMs:t.number().int().nonnegative(),maxPendingPlans:t.number().int().min(1).max(100),maxEvidenceEvents:t.number().int().min(1).max(1e3),maxProposalEdits:t.number().int().min(1).max(1e3),maxProposalBytes:t.number().int().min(1).max(1e7)}).strict(),K=t.enum(["no_action","route_deterministically","queue_refiner"]),W=t.object({schemaVersion:t.literal("openpond.refinementTriggerDecision.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),observations:t.array(l).max(100),decision:K,deterministicRoute:g.nullable(),suggestedRoutes:t.array(g).max(8),reason:C,deduplicationKey:u,policy:B,estimatedMaxCostUsd:t.number().finite().nonnegative(),pendingPlanCount:t.number().int().nonnegative(),boundary:_,cooldownUntil:m.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.estimatedMaxCostUsd>e.policy.maxEstimatedCostUsd&&n.addIssue({code:"custom",message:"estimated Refiner cost exceeds the trigger policy budget",path:["estimatedMaxCostUsd"]}),e.pendingPlanCount>e.policy.maxPendingPlans&&n.addIssue({code:"custom",message:"pending plan count exceeds the trigger policy limit",path:["pendingPlanCount"]}),e.observations.length>e.policy.maxEvidenceEvents&&n.addIssue({code:"custom",message:"trigger observations exceed the evidence budget",path:["observations"]}),e.decision==="route_deterministically"&&e.deterministicRoute===null&&n.addIssue({code:"custom",message:"deterministic decisions require a route",path:["deterministicRoute"]}),e.decision!=="route_deterministically"&&e.deterministicRoute!==null&&n.addIssue({code:"custom",message:"only deterministic decisions may declare a deterministic route",path:["deterministicRoute"]}),e.decision==="no_action"&&e.suggestedRoutes.length>0&&n.addIssue({code:"custom",message:"no-action decisions cannot suggest routes",path:["suggestedRoutes"]}),e.decision!=="no_action"&&e.observations.length===0&&n.addIssue({code:"custom",message:"actionable trigger decisions require observations",path:["observations"]})}),z=W.extend({contentHash:u}).strict(),F=t.enum(["runtime_service","refiner_model","human_review","evaluation_system","training_system"]),q=t.object({schemaVersion:t.literal("openpond.improvementRouteDecision.v1"),id:c,trigger:l,route:g,authority:F,automatic:t.boolean(),reason:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.automatic&&["human_review","evaluation_system","training_system"].includes(e.authority)&&n.addIssue({code:"custom",message:`${e.authority} routes cannot be marked automatic`,path:["automatic"]}),e.route==="training"&&e.automatic&&e.authority!=="training_system"&&n.addIssue({code:"custom",message:"automatic training routes require training-system authority",path:["authority"]})}),L=q.extend({contentHash:u}).strict(),E=t.object({schemaVersion:t.literal("openpond.harnessRefinerOutcome.v1"),id:c,trigger:l,decision:t.enum(["no_action","proposed"]),proposal:l.nullable(),reason:C,evidenceRefs:t.array(l).max(100),estimatedCostUsd:t.number().finite().nonnegative(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="proposed"!=(e.proposal!==null)&&n.addIssue({code:"custom",message:"proposed Refiner outcomes require a proposal; no-action outcomes cannot include one",path:["proposal"]})}),N=E.extend({contentHash:u}).strict(),G=t.enum(["applied","retained","declined","conflict","rolled_back"]),T=t.object({schemaVersion:t.literal("openpond.improvementApplyReceipt.v1"),id:c,proposal:l,beforeOverlay:R,afterOverlay:R.nullable(),decision:G,boundary:_,validationRefs:t.array(l).max(100),outcomeEvidenceRefs:t.array(A).max(1e3),rollbackOf:l.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="applied"!=(e.afterOverlay!==null)&&n.addIssue({code:"custom",message:"applied receipts require an after-overlay; other decisions cannot include one",path:["afterOverlay"]}),e.decision==="rolled_back"!=(e.rollbackOf!==null)&&n.addIssue({code:"custom",message:"only rollback receipts require rollbackOf",path:["rollbackOf"]})}),J=T.extend({contentHash:u}).strict();function b(e){let n=e.contentSchema.parse(e.content);return e.resultSchema.parse({...n,contentHash:H(n)})}i(b,"createHashedContract");function te(e){return b({content:e,contentSchema:O,resultSchema:M})}i(te,"createImprovementObservation");function ae(e){return b({content:e,contentSchema:W,resultSchema:z})}i(ae,"createRefinementTriggerDecision");function oe(e){return b({content:e,contentSchema:q,resultSchema:L})}i(oe,"createImprovementRouteDecision");function re(e){return b({content:e,contentSchema:E,resultSchema:N})}i(re,"createHarnessRefinerOutcome");function se(e){return b({content:e,contentSchema:T,resultSchema:J})}i(se,"createImprovementApplyReceipt");var Q=new Set(["text_instruction","memory","dependency_selection"]),X=new Set(["runtime","memory","prompt","skill"]);function Y(e){let n=p.parse(e.workspace),a=k.parse(e.proposal);if(n.ownerScope.kind!=="personal")return{eligible:!1,reason:"Team workspaces require explicit promotion authority."};if(a.requestedScope!=="personal")return{eligible:!1,reason:`${a.requestedScope} changes require explicit promotion authority.`};if(a.risk!=="low")return{eligible:!1,reason:`${a.risk} risk changes require review.`};if(!X.has(a.route))return{eligible:!1,reason:`${a.route} changes cannot auto-advance.`};if(a.edits.some(r=>r.operation==="delete"))return{eligible:!1,reason:"Delete edits require review."};let o=typeof a.metadata.generatedManifestEditId=="string"?a.metadata.generatedManifestEditId:null,s=a.edits.filter(r=>!(r.target.replaceAll("\\","/").toLowerCase()==="harness.json"&&r.id===o&&r.operation==="update"&&["prompt","skill"].includes(a.route))).map(r=>r.target.replaceAll("\\","/").toLowerCase()).filter(r=>r==="harness.json"||r==="program.json"||r.startsWith("agents/")||/\.(?:[cm]?[jt]sx?|py|sh|bash|zsh|fish|ps1|exe|dll|so|dylib)$/.test(r));if(s.length>0)return{eligible:!1,reason:`Executable or structural targets require review: ${[...new Set(s)].join(", ")}.`};let v=a.effects.filter(r=>!Q.has(r));return v.length>0?{eligible:!1,reason:`Effects require review: ${[...new Set(v)].join(", ")}.`}:{eligible:!0}}i(Y,"classifyHarnessAutoAdvanceAuthority");function de(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(y=>S.parse(y)),s={id:a.id,contentHash:a.contentHash},v=o.map(y=>({id:y.id,contentHash:y.contentHash})),r={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:s,expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:v,rollbackOf:null,createdAt:e.now,metadata:{}},f=V(n,a);if(f)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:f})};let h=P(a,o);if(h)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:h})};let w=Y({workspace:n,proposal:a});if(!w.eligible)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:w.reason})};if(n.currentChannel.release?.id===e.nextRelease.id&&n.currentChannel.release.contentHash===e.nextRelease.contentHash)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:"The candidate release is already current."})};let I=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:I,receipt:d({...r,nextChannelRevision:I.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:"Validated low-risk Personal proposal advanced atomically."})}}i(de,"advanceHarnessWorkspace");function ue(e){let n=p.parse(e.workspace),a=n.revision!==e.expectedWorkspaceRevision||n.currentChannel.revision!==e.expectedChannelRevision,o={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:null,expectedWorkspaceRevision:e.expectedWorkspaceRevision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:[],createdAt:e.now,metadata:{}};if(a)return{workspace:n,receipt:d({...o,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:"Workspace or current-channel revision changed before rollback.",rollbackOf:null})};let s=p.parse({...n,sourceRevision:e.targetSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.targetRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:s,receipt:d({...o,nextChannelRevision:s.currentChannel.revision,nextRelease:e.targetRelease,decision:"rolled_back",reason:"Current channel rolled back atomically to an immutable release.",rollbackOf:e.rollbackOf})}}i(ue,"rollbackHarnessWorkspace");function me(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(h=>S.parse(h)),s={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:{id:a.id,contentHash:a.contentHash},expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:o.map(h=>({id:h.id,contentHash:h.contentHash})),rollbackOf:null,createdAt:e.now,metadata:{authority:"human_review",reviewer:e.reviewer}},v=V(n,a);if(v)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:v})};let r=P(a,o);if(r)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:r})};let f=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:f,receipt:d({...s,nextChannelRevision:f.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:`Validated proposal approved by ${e.reviewer} and advanced atomically.`})}}i(me,"advanceReviewedHarnessWorkspace");function V(e,n){if(n.expectedWorkspace.workspaceId!==e.id)return"Proposal targets a different Harness workspace.";if(n.expectedWorkspace.revision!==e.revision)return"Harness workspace revision changed before advancement.";if(n.expectedWorkspace.sourceRevision!==e.sourceRevision)return"Harness source revision changed before advancement.";if(n.expectedWorkspace.channelRevision!==e.currentChannel.revision)return"Harness current-channel revision changed before advancement.";let a=e.currentChannel.release;return a===null||a.id!==n.baseHarnessRelease.id||a.contentHash!==n.baseHarnessRelease.contentHash?"Proposal base Harness release is not current.":null}i(V,"workspaceConflictReason");function P(e,n){let a=new Map;for(let o of n){if(o.proposal.id!==e.id||o.proposal.contentHash!==e.contentHash)return`Validation ${o.id} is bound to a different proposal.`;a.set(o.validationId,o)}for(let o of e.validationPlan){if(!o.required)continue;let s=a.get(o.id);if(!s)return`Required validation ${o.id} is missing.`;if(s.kind!==o.kind)return`Validation ${o.id} has kind ${s.kind}; expected ${o.kind}.`;if(s.status!=="passed")return`Required validation ${o.id} did not pass (${s.status}).`}return null}i(P,"failedValidationReason");export{M as a,z as b,L as c,N as d,J as e,te as f,ae as g,oe as h,re as i,se as j,Y as k,de as l,ue as m,me as n};
|
|
2
|
+
import{a as p,b as g,c as R,f as k,g as S,m as d}from"./chunk-MPNJ2BB4.js";import{c,d as u,e as m,g as l,n as H}from"./chunk-VVNV4NNW.js";import{A as t}from"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";var C=t.string().trim().min(1).max(1e5),x=t.record(t.string(),t.unknown()).default({}),$=t.enum(["completed_tool_batch","before_model_step","turn_completed","turn_paused"]),_=t.object({kind:$,eventSequence:t.number().int().nonnegative(),occurredAt:m}).strict(),A=t.object({id:c,sequence:t.number().int().nonnegative().nullable(),contentHash:u}).strict(),j=t.enum(["tool_failure","retry","recovery","validation","user_turn","reusable_success","completion_detour"]),D=t.enum(["open","recovered","terminal"]),U=t.object({name:t.string().trim().min(1).max(500),invocationKey:u}).strict(),O=t.object({schemaVersion:t.literal("openpond.improvementObservation.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),eventRefs:t.array(A).min(1).max(100),kind:j,state:D,tool:U.nullable(),deterministicClass:t.string().trim().min(1).max(500).nullable(),summary:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{new Set(e.eventRefs.map(a=>a.id)).size!==e.eventRefs.length&&n.addIssue({code:"custom",message:"observation event refs must be unique",path:["eventRefs"]}),["tool_failure","retry","recovery","completion_detour"].includes(e.kind)&&e.tool===null&&n.addIssue({code:"custom",message:`${e.kind} observations require a tool identity`,path:["tool"]})}),M=O.extend({contentHash:u}).strict(),B=t.object({schemaVersion:t.literal("openpond.refinementTriggerPolicy.v1"),maxEstimatedCostUsd:t.number().finite().nonnegative(),cooldownMs:t.number().int().nonnegative(),maxPendingPlans:t.number().int().min(1).max(100),maxEvidenceEvents:t.number().int().min(1).max(1e3),maxProposalEdits:t.number().int().min(1).max(1e3),maxProposalBytes:t.number().int().min(1).max(1e7)}).strict(),K=t.enum(["no_action","route_deterministically","queue_refiner"]),W=t.object({schemaVersion:t.literal("openpond.refinementTriggerDecision.v1"),id:c,runRef:c,turnId:c,harnessRelease:l,overlay:R.nullable(),observations:t.array(l).max(100),decision:K,deterministicRoute:g.nullable(),suggestedRoutes:t.array(g).max(8),reason:C,deduplicationKey:u,policy:B,estimatedMaxCostUsd:t.number().finite().nonnegative(),pendingPlanCount:t.number().int().nonnegative(),boundary:_,cooldownUntil:m.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.estimatedMaxCostUsd>e.policy.maxEstimatedCostUsd&&n.addIssue({code:"custom",message:"estimated Refiner cost exceeds the trigger policy budget",path:["estimatedMaxCostUsd"]}),e.pendingPlanCount>e.policy.maxPendingPlans&&n.addIssue({code:"custom",message:"pending plan count exceeds the trigger policy limit",path:["pendingPlanCount"]}),e.observations.length>e.policy.maxEvidenceEvents&&n.addIssue({code:"custom",message:"trigger observations exceed the evidence budget",path:["observations"]}),e.decision==="route_deterministically"&&e.deterministicRoute===null&&n.addIssue({code:"custom",message:"deterministic decisions require a route",path:["deterministicRoute"]}),e.decision!=="route_deterministically"&&e.deterministicRoute!==null&&n.addIssue({code:"custom",message:"only deterministic decisions may declare a deterministic route",path:["deterministicRoute"]}),e.decision==="no_action"&&e.suggestedRoutes.length>0&&n.addIssue({code:"custom",message:"no-action decisions cannot suggest routes",path:["suggestedRoutes"]}),e.decision!=="no_action"&&e.observations.length===0&&n.addIssue({code:"custom",message:"actionable trigger decisions require observations",path:["observations"]})}),z=W.extend({contentHash:u}).strict(),F=t.enum(["runtime_service","refiner_model","human_review","evaluation_system","training_system"]),q=t.object({schemaVersion:t.literal("openpond.improvementRouteDecision.v1"),id:c,trigger:l,route:g,authority:F,automatic:t.boolean(),reason:C,createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.automatic&&["human_review","evaluation_system","training_system"].includes(e.authority)&&n.addIssue({code:"custom",message:`${e.authority} routes cannot be marked automatic`,path:["automatic"]}),e.route==="training"&&e.automatic&&e.authority!=="training_system"&&n.addIssue({code:"custom",message:"automatic training routes require training-system authority",path:["authority"]})}),L=q.extend({contentHash:u}).strict(),E=t.object({schemaVersion:t.literal("openpond.harnessRefinerOutcome.v1"),id:c,trigger:l,decision:t.enum(["no_action","proposed"]),proposal:l.nullable(),reason:C,evidenceRefs:t.array(l).max(100),estimatedCostUsd:t.number().finite().nonnegative(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="proposed"!=(e.proposal!==null)&&n.addIssue({code:"custom",message:"proposed Refiner outcomes require a proposal; no-action outcomes cannot include one",path:["proposal"]})}),N=E.extend({contentHash:u}).strict(),G=t.enum(["applied","retained","declined","conflict","rolled_back"]),T=t.object({schemaVersion:t.literal("openpond.improvementApplyReceipt.v1"),id:c,proposal:l,beforeOverlay:R,afterOverlay:R.nullable(),decision:G,boundary:_,validationRefs:t.array(l).max(100),outcomeEvidenceRefs:t.array(A).max(1e3),rollbackOf:l.nullable(),createdAt:m,metadata:x}).strict().superRefine((e,n)=>{e.decision==="applied"!=(e.afterOverlay!==null)&&n.addIssue({code:"custom",message:"applied receipts require an after-overlay; other decisions cannot include one",path:["afterOverlay"]}),e.decision==="rolled_back"!=(e.rollbackOf!==null)&&n.addIssue({code:"custom",message:"only rollback receipts require rollbackOf",path:["rollbackOf"]})}),J=T.extend({contentHash:u}).strict();function b(e){let n=e.contentSchema.parse(e.content);return e.resultSchema.parse({...n,contentHash:H(n)})}i(b,"createHashedContract");function te(e){return b({content:e,contentSchema:O,resultSchema:M})}i(te,"createImprovementObservation");function ae(e){return b({content:e,contentSchema:W,resultSchema:z})}i(ae,"createRefinementTriggerDecision");function oe(e){return b({content:e,contentSchema:q,resultSchema:L})}i(oe,"createImprovementRouteDecision");function re(e){return b({content:e,contentSchema:E,resultSchema:N})}i(re,"createHarnessRefinerOutcome");function se(e){return b({content:e,contentSchema:T,resultSchema:J})}i(se,"createImprovementApplyReceipt");var Q=new Set(["text_instruction","memory","dependency_selection"]),X=new Set(["runtime","memory","prompt","skill"]);function Y(e){let n=p.parse(e.workspace),a=k.parse(e.proposal);if(n.ownerScope.kind!=="personal")return{eligible:!1,reason:"Team workspaces require explicit promotion authority."};if(a.requestedScope!=="personal")return{eligible:!1,reason:`${a.requestedScope} changes require explicit promotion authority.`};if(a.risk!=="low")return{eligible:!1,reason:`${a.risk} risk changes require review.`};if(!X.has(a.route))return{eligible:!1,reason:`${a.route} changes cannot auto-advance.`};if(a.edits.some(r=>r.operation==="delete"))return{eligible:!1,reason:"Delete edits require review."};let o=typeof a.metadata.generatedManifestEditId=="string"?a.metadata.generatedManifestEditId:null,s=a.edits.filter(r=>!(r.target.replaceAll("\\","/").toLowerCase()==="harness.json"&&r.id===o&&r.operation==="update"&&["prompt","skill"].includes(a.route))).map(r=>r.target.replaceAll("\\","/").toLowerCase()).filter(r=>r==="harness.json"||r==="program.json"||r.startsWith("agents/")||/\.(?:[cm]?[jt]sx?|py|sh|bash|zsh|fish|ps1|exe|dll|so|dylib)$/.test(r));if(s.length>0)return{eligible:!1,reason:`Executable or structural targets require review: ${[...new Set(s)].join(", ")}.`};let v=a.effects.filter(r=>!Q.has(r));return v.length>0?{eligible:!1,reason:`Effects require review: ${[...new Set(v)].join(", ")}.`}:{eligible:!0}}i(Y,"classifyHarnessAutoAdvanceAuthority");function de(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(y=>S.parse(y)),s={id:a.id,contentHash:a.contentHash},v=o.map(y=>({id:y.id,contentHash:y.contentHash})),r={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:s,expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:v,rollbackOf:null,createdAt:e.now,metadata:{}},f=V(n,a);if(f)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:f})};let h=P(a,o);if(h)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:h})};let w=Y({workspace:n,proposal:a});if(!w.eligible)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:w.reason})};if(n.currentChannel.release?.id===e.nextRelease.id&&n.currentChannel.release.contentHash===e.nextRelease.contentHash)return{workspace:n,receipt:d({...r,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:"The candidate release is already current."})};let I=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:I,receipt:d({...r,nextChannelRevision:I.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:"Validated low-risk Personal proposal advanced atomically."})}}i(de,"advanceHarnessWorkspace");function ue(e){let n=p.parse(e.workspace),a=n.revision!==e.expectedWorkspaceRevision||n.currentChannel.revision!==e.expectedChannelRevision,o={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:null,expectedWorkspaceRevision:e.expectedWorkspaceRevision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:[],createdAt:e.now,metadata:{}};if(a)return{workspace:n,receipt:d({...o,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:"Workspace or current-channel revision changed before rollback.",rollbackOf:null})};let s=p.parse({...n,sourceRevision:e.targetSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.targetRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:s,receipt:d({...o,nextChannelRevision:s.currentChannel.revision,nextRelease:e.targetRelease,decision:"rolled_back",reason:"Current channel rolled back atomically to an immutable release.",rollbackOf:e.rollbackOf})}}i(ue,"rollbackHarnessWorkspace");function me(e){let n=p.parse(e.workspace),a=k.parse(e.proposal),o=e.validations.map(h=>S.parse(h)),s={schemaVersion:"openpond.harnessAdvanceReceipt.v1",id:e.receiptId,workspaceId:n.id,ownerScope:n.ownerScope,proposal:{id:a.id,contentHash:a.contentHash},expectedWorkspaceRevision:a.expectedWorkspace.revision,observedWorkspaceRevision:n.revision,previousChannelRevision:n.currentChannel.revision,previousRelease:n.currentChannel.release,validationReceipts:o.map(h=>({id:h.id,contentHash:h.contentHash})),rollbackOf:null,createdAt:e.now,metadata:{authority:"human_review",reviewer:e.reviewer}},v=V(n,a);if(v)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"conflict",reason:v})};let r=P(a,o);if(r)return{workspace:n,receipt:d({...s,nextChannelRevision:n.currentChannel.revision,nextRelease:null,decision:"retained",reason:r})};let f=p.parse({...n,sourceRevision:e.nextSourceRevision,revision:n.revision+1,dirty:!1,currentChannel:{...n.currentChannel,release:e.nextRelease,revision:n.currentChannel.revision+1},updatedAt:e.now});return{workspace:f,receipt:d({...s,nextChannelRevision:f.currentChannel.revision,nextRelease:e.nextRelease,decision:"advanced",reason:`Validated proposal approved by ${e.reviewer} and advanced atomically.`})}}i(me,"advanceReviewedHarnessWorkspace");function V(e,n){if(n.expectedWorkspace.workspaceId!==e.id)return"Proposal targets a different Harness workspace.";if(n.expectedWorkspace.revision!==e.revision)return"Harness workspace revision changed before advancement.";if(n.expectedWorkspace.sourceRevision!==e.sourceRevision)return"Harness source revision changed before advancement.";if(n.expectedWorkspace.channelRevision!==e.currentChannel.revision)return"Harness current-channel revision changed before advancement.";let a=e.currentChannel.release;return a===null||a.id!==n.baseHarnessRelease.id||a.contentHash!==n.baseHarnessRelease.contentHash?"Proposal base Harness release is not current.":null}i(V,"workspaceConflictReason");function P(e,n){let a=new Map;for(let o of n){if(o.proposal.id!==e.id||o.proposal.contentHash!==e.contentHash)return`Validation ${o.id} is bound to a different proposal.`;a.set(o.validationId,o)}for(let o of e.validationPlan){if(!o.required)continue;let s=a.get(o.id);if(!s)return`Required validation ${o.id} is missing.`;if(s.kind!==o.kind)return`Validation ${o.id} has kind ${s.kind}; expected ${o.kind}.`;if(s.status!=="passed")return`Required validation ${o.id} did not pass (${s.status}).`}return null}i(P,"failedValidationReason");export{M as a,z as b,L as c,N as d,J as e,te as f,ae as g,oe as h,re as i,se as j,Y as k,de as l,ue as m,me as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{Fa as I,Ga as H,Ua as d,Va as r,Wa as j,Xa as m,ab as p,ga as s}from"./chunk-YNQWJWIC.js";import{Hb as y,Mb as R,Pb as P,lb as S,wb as L}from"./chunk-PBZCXPPC.js";import{n as b}from"./chunk-VVNV4NNW.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as E}from"./chunk-FTQLQJQV.js";var u=e.object({source:e.enum(["local","github","openpond_git"]),repositoryId:e.string().trim().min(1),profileId:e.string().trim().min(1)}),N=e.object({ref:u,revision:e.string().nullable(),sourceHash:e.string()});var n=e.string().trim().min(1).max(200),o=e.string().regex(/^[a-f0-9]{64}$/),k=e.enum(["queued","running","cancelling","completed","failed","cancelled","interrupted"]),z=e.object({providerId:e.enum(["openpond","custom-openai-compatible","claude-code","codex"]),modelId:e.string().trim().min(1).max(500),configurationHash:o,maxOutputTokens:e.number().int().positive().max(262144),temperature:e.number().min(0).max(2).optional(),topP:e.number().positive().max(1).optional(),messages:e.array(e.object({role:e.enum(["system","user","assistant"]),content:e.string().max(262144)}).strict()).max(200)}).strict(),Y=e.object({configuration:m,package:s}).strict(),Z=e.object({configuration:m,expectedPackageHash:o.optional()}).strict(),ee=e.object({schemaVersion:e.literal("openpond.localExperimentDefinition.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,revision:e.number().int().positive(),configuration:m,model:z,packageHash:o,graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime(),contentHash:o}).strict(),te=e.object({operationId:n,definition:d}).strict(),ne=e.object({teamId:n,id:n}).strict(),oe=e.object({teamId:n,projectId:n.optional(),status:k.optional(),datasetHash:o.optional(),search:e.string().max(100).optional(),afterId:n.optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),f=e.object({schemaVersion:e.literal("openpond.localExperimentExecution.v1"),location:e.literal("local"),id:n,teamId:n,ownerActorId:n,operationId:n,definition:d,kind:e.enum(["target","scoring"]),executionHash:o,sourceExecution:e.object({id:n,executionHash:o}).strict().nullable(),packageHash:o,maximumCostUsd:e.number().finite().positive(),status:k,createdAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),counts:e.object({pending:e.number().int().nonnegative(),running:e.number().int().nonnegative(),completed:e.number().int().nonnegative(),failed:e.number().int().nonnegative(),cancelled:e.number().int().nonnegative(),unknown:e.number().int().nonnegative()}).strict(),usage:e.object({knownCostUsd:e.number().finite().nonnegative(),costUsd:e.number().finite().nonnegative().nullable(),heldUsd:e.number().finite().nonnegative(),uncertainRequests:e.number().int().nonnegative()}).strict(),cleanupComplete:e.boolean(),error:e.string().max(2e3).nullable()}).strict(),v=f.omit({definition:!0});function g(t,i){t.kind==="scoring"!=(t.sourceExecution!==null)&&i.addIssue({code:"custom",message:"Only retained scoring passes name an original execution."}),["completed","failed","cancelled","interrupted"].includes(t.status)&&(!t.completedAt||t.counts.pending||t.counts.running)&&i.addIssue({code:"custom",message:"Terminal local execution requires complete population accounting."}),["completed","cancelled"].includes(t.status)&&!t.cleanupComplete&&i.addIssue({code:"custom",message:"Successful completion or cancellation requires confirmed local transport cleanup."}),t.usage.uncertainRequests>0&&t.usage.costUsd!==null&&i.addIssue({code:"custom",message:"Uncertain provider charges cannot claim a measured total."})}E(g,"validateLocalExecutionState");var ie=f.superRefine(g),c=v.superRefine(g),A=e.object({configuration:p,package:s}).strict(),U=e.object({configuration:p,expectedPackageHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),x=e.object({configuration:p,model:z,packageHash:e.string().regex(/^[a-f0-9]{64}$/),graders:e.array(r).min(1).max(100),availableGraders:e.array(r).min(1).max(1e3),retainedConfigurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional(),configurationHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((t,i)=>{let{configurationHash:a,...h}=t;b(h)!==a&&i.addIssue({code:"custom",message:"Local configuration snapshot bytes changed."})}),{definition:ae,...O}=f.shape,l=e.object({...O,kind:e.literal("target"),...x.shape}).strict().superRefine((t,i)=>{let a={configuration:t.configuration,model:t.model,packageHash:t.packageHash,graders:t.graders,availableGraders:t.availableGraders,...t.retainedConfigurationHash?{retainedConfigurationHash:t.retainedConfigurationHash}:{},configurationHash:t.configurationHash};g(t,i),x.safeParse(a).success||i.addIssue({code:"custom",message:"Local Experiment configuration changed."}),(t.operationId!==t.configuration.operationId||t.teamId!==t.configuration.request.teamId||t.maximumCostUsd!==t.configuration.maximumCostUsd)&&i.addIssue({code:"custom",message:"Local Experiment differs from its sealed admission."})}),q=e.object({items:e.array(l).max(100),nextCursor:e.string().nullable()}).strict(),G=e.object({teamId:e.string().min(1).max(200),id:e.string().min(1).max(200),configurationHash:e.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),T=e.object({operationId:n,execution:e.object({id:n,executionHash:o}).strict(),graderPackage:s,graders:e.array(j).min(1).max(100),maximumCostUsd:e.number().finite().positive().max(1e4)}).strict(),re=T.omit({graderPackage:!0}),D=L,F=e.object({sessionId:n,turnId:n,source:S,profileRef:u,admissionHash:o,modelConfigurationHash:o,traceHash:o,runtimeEventRefs:e.array(n).max(1e4),startedAt:e.iso.datetime(),completedAt:e.iso.datetime(),outputHash:o,partialOutputAvailable:e.boolean()}).strict(),w=e.object({receiptId:n,taskId:n,seed:e.string(),status:e.enum(["pending","running","completed","failed","cancelled","unknown"]),input:e.record(e.string(),e.unknown()),policyVisibleContext:e.record(e.string(),e.unknown()),output:e.string().nullable(),messages:e.array(e.unknown()).max(4002),grade:H.nullable(),error:e.string().nullable(),native:D.optional(),profileNative:F.optional(),externalProcess:I.optional()}).strict(),ce=e.object({execution:e.union([l,c]),cases:e.array(w).max(1e4),contentHash:o}).strict(),$=e.object({items:e.array(e.object({sequence:e.number().int().positive(),type:e.string().min(1),payload:e.unknown()}).strict()).max(500),nextCursor:e.number().int().positive().nullable()}).strict(),se=e.object({location:e.literal("local"),execution:e.union([l,c]),case:w,trace:$}).strict(),me=e.object({items:e.array(c).max(100),nextCursor:n.nullable()}).strict(),pe=e.object({execution:c,graders:e.array(r).min(1).max(100),graderPackageHash:o}).strict(),C=e.object({execution:c,manifest:y,result:R}).strict().superRefine((t,i)=>{try{if(P(t),t.manifest.id!==t.execution.id||t.manifest.teamId!==t.execution.teamId||t.manifest.lineage?.execution.id!==(t.execution.sourceExecution?.id??t.execution.id)||t.manifest.lineage.execution.contentHash!==(t.execution.sourceExecution?.executionHash??t.execution.executionHash)||t.manifest.lineage.scoringPassId!==(t.execution.kind==="scoring"?t.execution.id:null)||t.manifest.maximumCostUsd!==t.execution.maximumCostUsd)throw new Error("Portable evidence differs from its retained local execution.")}catch(a){i.addIssue({code:"custom",message:a instanceof Error?a.message:"Local portable evidence verification failed."})}}),le=e.object({location:e.literal("local"),baseline:C,candidate:C}).strict();export{u as a,l as b,ce as c,le as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as P}from"./chunk-
|
|
2
|
+
import{a as P}from"./chunk-WWQNMC7C.js";import{f as O}from"./chunk-M3FLEZ4E.js";import{b as A}from"./chunk-OQPJ7FJF.js";import{a as m}from"./chunk-2LJCJOJ7.js";import{b as d,e as f}from"./chunk-JCLTFDVW.js";import{a as n}from"./chunk-FTQLQJQV.js";async function N(t,e,r,s={}){let o=await(s.apiFetch??d)(t,e,s.path??A,{method:"POST",signal:s.signal,body:JSON.stringify(r)}),i=await o.json().catch(()=>({})),c=o.status!==404&&o.status!==405&&o.status!==501;return o.ok?{ok:typeof i.ok=="boolean"?i.ok:!0,status:o.status,endpointAvailable:c,output:g(i),data:E(i)}:{ok:!1,status:o.status,endpointAvailable:c,output:g(i)??(c?`Connected app tool call failed with status ${o.status}.`:`Connected app tool-call endpoint is not available (${o.status}).`),data:E(i)}}n(N,"executeConnectedAppToolCall");function g(t){return typeof t.output=="string"&&t.output.trim()?t.output.trim():typeof t.message=="string"&&t.message.trim()?t.message.trim():typeof t.error=="string"&&t.error.trim()?t.error.trim():null}n(g,"responsePayloadMessage");function E(t){return"data"in t?t.data:"result"in t?t.result:null}n(E,"responsePayloadData");var h=A;function z(t={}){let e=t.env??process.env,r=t.apiFetch??d,s=t.loadAccountContext??P;return async(o,i)=>{if(I(e.OPENPOND_CONNECTED_APP_TOOL_EXECUTOR))return l(o.provider,"Cloud connected app execution is disabled.");let c=D(o),C=O.safeParse(c);if(!C.success)return l(o.provider,L(C.error));let u;try{u=await v({env:e,loadAccountContext:s})}catch(a){return l(o.provider,T(a))}try{let a=await N(u.apiBaseUrl,u.apiKey,C.data,{path:u.path,signal:i?.signal,apiFetch:r});return a.endpointAvailable?{ok:a.ok,output:a.output,data:a.data}:l(o.provider,`Cloud connected app connector endpoint is not available (${a.status}).`)}catch(a){if(a instanceof Error&&a.name==="AbortError")throw a;return l(o.provider,`Cloud connected app connector request failed: ${T(a)}`)}}}n(z,"createCloudConnectedAppToolExecutor");async function v(t={}){let e=t.env??process.env,r=y(e.OPENPOND_CONNECTED_APP_TOOL_PATH),s=e.OPENPOND_CONNECTED_APP_API_KEY?.trim()||e.OPENPOND_SANDBOX_API_KEY?.trim()||e.OPENPOND_API_KEY?.trim();if(s)return{apiBaseUrl:_(e,null),apiKey:s,path:r};let i=await(t.loadAccountContext??P)(),c=i.token?.trim();if(!c)throw new Error("OpenPond account API key is required for connected app connector execution.");return{apiBaseUrl:_(e,i.apiBaseUrl),apiKey:c,path:r}}n(v,"resolveCloudConnectedAppToolTarget");function _(t,e){return p(t.OPENPOND_CONNECTED_APP_API_URL)??U(t.OPENPOND_SANDBOX_API_URL)??p(t.OPENPOND_SANDBOX_BASE_URL)??p(t.OPENPOND_API_URL)??p(e)??f}n(_,"resolveCloudConnectedAppApiBaseUrl");function D(t){return{provider:t.provider,operation:t.operation,toolName:t.toolName,sessionId:t.sessionId,turnId:t.turnId,toolCallId:t.toolCallId,userPrompt:t.userPrompt,connectionIds:t.connectionIds,capabilityIds:t.capabilityIds,args:t.args}}n(D,"cloudConnectedAppToolPayload");function U(t){let e=x(t);return e?p(m(e,{apiBaseUrl:e})):null}n(U,"apiBaseUrlFromSandboxApiUrl");function p(t){let e=x(t);if(!e)return null;try{let r=new URL(e);return r.pathname=b(r.pathname),r.search="",r.hash="",r.toString().replace(/\/$/,"")}catch{return e.replace(/\/v1\/sandboxes\/?$/i,"").replace(/\/api\/sandboxes\/?$/i,"").replace(/\/sandboxes\/?$/i,"").replace(/\/v1\/?$/i,"").replace(/\/+$/,"")}}n(p,"normalizeApiBaseUrl");function b(t){let e=t.replace(/\/+$/,"");return e=e.replace(/\/v1\/sandboxes$/i,"").replace(/\/api\/sandboxes$/i,"").replace(/\/sandboxes$/i,"").replace(/\/v1$/i,""),e||"/"}n(b,"normalizeApiBasePath");function x(t){let e=t?.trim();return e?e.replace(/\/+$/,""):null}n(x,"normalizeOptionalUrl");function y(t){let e=t?.trim()||h;return e.startsWith("/")?e:`/${e}`}n(y,"normalizeToolPath");function l(t,e){return{ok:!1,output:`${e} No ${t} provider API call was made.`}}n(l,"connectorUnavailable");function I(t){let e=t?.trim().toLowerCase();return e==="0"||e==="false"||e==="off"||e==="disabled"}n(I,"isDisabled");function L(t){return t.issues?.[0]?.message??"Connected app tool call request is invalid."}n(L,"connectedAppToolCallValidationMessage");function T(t){return t instanceof Error?t.message:"Unknown error"}n(T,"errorMessage");export{h as a,z as b,v as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{wa as n}from"./chunk-YNQWJWIC.js";import{a}from"./chunk-FTQLQJQV.js";function l(i,e,s){i.exec("BEGIN IMMEDIATE");try{let o=i.get("SELECT content_hash, profile_id FROM taskset_revisions WHERE taskset_id = ? AND revision = ?",[e.id,e.revision]);if(o&&o.content_hash!==e.contentHash)throw new Error(`Taskset ${e.id}@${e.revision} is immutable and already has another content hash.`);let t=i.get("SELECT payload FROM tasksets WHERE id = ?",[e.id]),d=t?n.parse(JSON.parse(t.payload)):null;if(o&&o.profile_id!==e.profileId||d&&d.profileId!==e.profileId)throw new Error(`Taskset ${e.id} belongs to another Profile.`);let r=JSON.stringify(e);i.run(`INSERT INTO taskset_revisions (taskset_id, revision, content_hash, profile_id, status, payload, created_at, updated_at)
|
|
3
3
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
4
4
|
ON CONFLICT(taskset_id, revision) DO UPDATE SET status = excluded.status, payload = excluded.payload, updated_at = excluded.updated_at`,[e.id,e.revision,e.contentHash,e.profileId,e.status,r,e.createdAt,e.updatedAt]),(!d||d.revision<=e.revision)&&i.run(`INSERT INTO tasksets (id, profile_id, status, payload, created_at, updated_at)
|
|
5
5
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{b as r,d as i,e as p}from"./chunk-
|
|
2
|
+
import{b as r,d as i,e as p}from"./chunk-JCLTFDVW.js";import{a}from"./chunk-FTQLQJQV.js";var T=new URL(p).hostname,A=new URL(i).hostname;async function d(n,s,e){let t=new URLSearchParams;e?.handle&&t.set("handle",e.handle),typeof e?.limit=="number"&&Number.isFinite(e.limit)&&t.set("limit",String(Math.max(1,Math.floor(e.limit)))),typeof e?.offset=="number"&&Number.isFinite(e.offset)&&t.set("offset",String(Math.max(0,Math.floor(e.offset)))),typeof e?.includeScheduled=="boolean"&&t.set("includeScheduled",e.includeScheduled?"true":"false");let o=t.toString(),c=await r(n,s,`/apps/list${o?`?${o}`:""}`,{method:"GET"});if(!c.ok){let u=await c.text().catch(()=>"");throw new Error(`Apps list failed: ${c.status} ${u}`)}let l=await c.json().catch(()=>({}));return Array.isArray(l.apps)?l.apps:[]}a(d,"listApps");async function h(n,s,e){let t=await r(n,s,"/apps/repo/create",{method:"POST",body:JSON.stringify(e)});if(!t.ok){let o=await t.text().catch(()=>"");throw new Error(`Repo create failed: ${t.status} ${o}`)}return await t.json()}a(h,"createRepo");async function x(n,s,e,t){let o=await r(n,s,`/apps/${encodeURIComponent(e)}/code-visibility`,{method:"PATCH",body:JSON.stringify({codeVisibility:t})});if(!o.ok){let c=await o.text().catch(()=>"");throw new Error(`Code visibility update failed: ${o.status} ${c}`)}return await o.json()}a(x,"updateAppCodeVisibility");async function f(n,s,e){let t=await r(n,s,`/v4/apps/${e}/environment`,{method:"GET"});if(!t.ok){let o=await t.text().catch(()=>"");throw new Error(`Environment get failed: ${t.status} ${o}`)}return await t.json()}a(f,"getAppEnvironment");async function m(n,s){let e=await r(n,s,"/v1/account",{method:"GET"});if(!e.ok){let t=await e.text().catch(()=>"");throw new Error(`Account lookup failed: ${e.status} ${t}`)}return await e.json()}a(m,"getOpenPondAccount");export{d as a,h as b,x as c,f as d,m as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{C as x}from"./chunk-57RY3LSR.js";import{B as I}from"./chunk-3DVWJCOA.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-DQI5TE6A.js";import{B as I}from"./chunk-B4RKHHF7.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{a as u}from"./chunk-DMFUEUAZ.js";import{b as a}from"./chunk-
|
|
2
|
+
import{a as u}from"./chunk-DMFUEUAZ.js";import{b as a}from"./chunk-W5W4IODW.js";import{C as o,z as s}from"./chunk-BKEDG3A4.js";import{a as e}from"./chunk-FTQLQJQV.js";function p(t){return JSON.parse(t.payload)}e(p,"localAgentScheduleFromRow");function g(t){return s.parse({...JSON.parse(t.payload),updatedAt:t.updated_at})}e(g,"subagentRunFromRow");function _(t,r){let n=s.parse({...t,updatedAt:r});return[n.id,n.parentSessionId,n.parentTurnId,n.childSessionId,n.roleId,n.status,JSON.stringify(n),n.createdAt,r]}e(_,"subagentRunParams");function m(t){return o.parse(JSON.parse(t.payload))}e(m,"subagentMessageFromRow");function R(t){return[t.id,t.fromRunId,t.toRunId,t.toRole,t.kind,JSON.stringify(t),t.createdAt]}e(R,"subagentMessageParams");function S(t){return[t.id,t.localProjectId,t.scheduleName,t.enabled?1:0,t.nextRunAt,JSON.stringify(t),t.createdAt,t.updatedAt]}e(S,"localAgentScheduleParams");function h(t){return JSON.parse(t.payload)}e(h,"localAgentScheduleRunFromRow");function y(t){return[t.id,t.scheduleId,t.localProjectId,t.scheduleName,t.scheduledFor,t.trigger,t.status,JSON.stringify(t),t.createdAt,t.updatedAt]}e(y,"localAgentScheduleRunParams");function b(t){return a.parse({id:t.id,requestId:t.request_id,requestOrdinal:t.request_ordinal,sessionId:t.session_id,turnId:t.turn_id,provider:t.provider,model:t.model,route:t.route,source:t.source,requestKind:t.request_kind,visibility:t.visibility,status:t.status,startedAt:t.started_at,completedAt:t.completed_at,durationMs:t.duration_ms,firstTokenMs:t.first_token_ms,promptTokens:t.prompt_tokens,cachedPromptTokens:t.cached_prompt_tokens,uncachedPromptTokens:t.uncached_prompt_tokens,cacheWritePromptTokens:t.cache_write_prompt_tokens,cacheTelemetrySource:t.cache_telemetry_source,completionTokens:t.completion_tokens,totalTokens:t.total_tokens,errorType:t.error_type,errorMessage:t.error_message,attribution:JSON.parse(t.attribution_json)})}e(b,"modelUsageRecordFromRow");function k(t){return[t.id,t.requestId,t.requestOrdinal,t.sessionId,t.turnId,t.provider,t.model,t.route,t.source,t.requestKind,t.visibility,t.status,t.startedAt,t.completedAt,t.durationMs,t.firstTokenMs,t.promptTokens,t.cachedPromptTokens,t.uncachedPromptTokens,t.cacheWritePromptTokens,t.cacheTelemetrySource,t.completionTokens,t.totalTokens,t.errorType,t.errorMessage,JSON.stringify(t.attribution)]}e(k,"modelUsageRecordParams");function A(){return new Date().toISOString().replace(/\D/g,"").slice(0,14)}e(A,"timestampForPath");function f(t,r){return{...u(JSON.parse(t)),sequence:r}}e(f,"runtimeEventWithSequence");function T(t){return i({sessionId:t.session_id,eventCount:t.event_count,latestEventSequence:t.latest_event_sequence,latestEventAt:t.latest_event_at,latestTurnId:t.latest_turn_id,latestTurnStatus:t.latest_turn_status,pendingApprovalCount:t.pending_approval_count,updatedAt:t.updated_at})}e(T,"threadDetailProjectionFromRow");function i(t){return{sessionId:t.sessionId,eventCount:t.eventCount,latestEventSequence:t.latestEventSequence,latestEventAt:t.latestEventAt,latestTurnId:t.latestTurnId,latestTurnStatus:t.latestTurnStatus,pendingApprovalCount:t.pendingApprovalCount,updatedAt:t.updatedAt}}e(i,"threadDetailProjectionPayload");export{p as a,g as b,_ as c,m as d,R as e,S as f,h as g,y as h,b as i,k as j,A as k,f as l,T as m,i as n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{Ab as me,Bb as ue,Ca as J,Cb as fe,Db as he,Eb as ge,Mb as ve,Rb as be,Sb as we,_ as ae,ja as se,kb as ne,lb as re,na as ie,nb as oe,ob as ce,pb as de,qb as le,v as te,wa as F,xb as W,yb as Z,zb as pe}from"./chunk-YNQWJWIC.js";import{b as I,c as H,d as V,f as _,k as G,l as O,m as d}from"./chunk-VNJAAYNQ.js";import{a as ee}from"./chunk-7ZLXFKRI.js";import{O as L,ba as Y,ca as X,d as C,f as U}from"./chunk-J572ANHX.js";import{Ya as K}from"./chunk-PBZCXPPC.js";import{A as n}from"./chunk-PF56N7ZY.js";import{a as k}from"./chunk-FTQLQJQV.js";var Ae=n.object({id:I,purpose:n.string().trim().min(1).max(500),audience:n.enum(["orchestrator","environment","privileged_scorer","trainer","infrastructure"]),required:n.boolean(),ttlSeconds:n.number().int().positive().max(86400),scopes:n.array(n.string().trim().min(1).max(500)).max(100).default([])}).strict(),Ie=n.object({declarationId:I,leaseRef:n.string().trim().min(8).max(1e3),audience:Ae.shape.audience,expiresAt:V}).strict(),qe=n.object({adapterId:I,placement:n.enum(["local","remote","colocated","provider_native"]),capabilityReceipt:H,runtimeVersion:n.string().trim().min(1).max(200),dataPlane:n.object({provider:I,dataPlaneId:I,cellId:I,runnerPoolId:I,runtimeImageDigest:n.string().regex(/^sha256:[a-f0-9]{64}$/),capabilityReceipt:H}).strict().nullable()}).strict(),Me=n.object({adapterId:I,kind:n.enum(["local","ssh","managed","custom"]),deviceOrPool:n.string().trim().min(1).max(1e3),capabilityReceipt:H,provider:I.nullable()}).strict(),je=n.object({adapterId:I,workerVersion:n.string().trim().min(1).max(200),workerImageDigest:n.string().regex(/^sha256:[a-f0-9]{64}$/).nullable(),upstreamRevision:n.string().trim().min(1).max(500),capabilityReceipt:H}).strict(),ye=n.object({schemaVersion:n.literal("openpond.harnessRunManifest.v1"),executionMode:n.literal("qualification").optional(),qualificationSamples:n.number().int().min(1).max(32).optional(),id:I,harnessRelease:_,datasetRelease:_,evidenceSets:n.array(_).max(1e4),model:n.object({source:n.string().trim().min(1).max(200),revision:n.string().trim().min(1).max(500),artifactHash:H.nullable(),tokenizerRevision:n.string().trim().min(1).max(500),chatTemplateHash:H}).strict(),recipe:n.object({method:n.string().trim().min(1).max(100),version:n.string().trim().min(1).max(200),configHash:H}).strict(),runtimeTarget:qe,computeTarget:Me,engine:je,resolvedBundleHash:H,secretLeaseRefs:n.array(Ie).max(1e3),approval:n.object({approvalHash:H,approvedAt:V,maximumSpendUsd:n.number().nonnegative().nullable()}).strict(),createdAt:V}).strict(),Re=ye.extend({contentHash:H}).strict(),xe=n.object({schemaVersion:n.literal("openpond.resolvedTrainingBundle.v1"),executionMode:n.literal("qualification").optional(),qualificationSamples:n.number().int().min(1).max(32).optional(),projection:n.literal("trainer"),harnessRelease:_,datasetRelease:_,evidenceSetRelease:_.nullable(),files:n.array(n.object({path:n.string().trim().min(1).max(2e3),sha256:H,sizeBytes:n.number().int().nonnegative()}).strict()).max(1e5)}).strict(),Te=xe.extend({contentHash:H}).strict(),Pe=[{label:"OpenAI-style API key",pattern:/\bsk-[A-Za-z0-9_-]{16,}\b/g},{label:"OpenPond API key",pattern:/\bopk_[A-Za-z0-9_-]{12,}\b/g},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/g},{label:"credential assignment",pattern:/\b(?:api[_-]?key|password|secret|token)["']?\s*[:=]\s*["']?[^\s"']{8,}/gi}],D=/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,N=/\b(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]\d{3}[-.\s]\d{4}\b/g;function _e(e){let t=[],a=e;for(let s of Pe)s.pattern.lastIndex=0,s.pattern.test(a)&&t.push(s.label),s.pattern.lastIndex=0,a=a.replace(s.pattern,`[REDACTED ${s.label}]`);D.lastIndex=0;let r=D.test(a);D.lastIndex=0,r&&t.push("email address"),a=a.replace(D,"[REDACTED email]"),N.lastIndex=0;let o=N.test(a);return N.lastIndex=0,o&&t.push("phone number"),a=a.replace(N,"[REDACTED phone]"),{secretStatus:t.some(s=>!s.includes("email")&&!s.includes("phone"))?"blocked":"passed",piiStatus:r||o?"review":"passed",findings:t,redacted:a}}k(_e,"scanAndRedactEvidence");function Be(e){let t=new Map;return{tasks:e.tasks.map(({artifactRefs:r,...o})=>({...o,assets:r.map(s=>{if(s.visibility!=="policy")throw new Error("Learning task inputs must be policy-visible assets.");let i=e.assets?.find(m=>m.id===s.id),l=e.assetBytes?.get(s.id)??(i?new TextEncoder().encode(C(i,s)):void 0);if(!l||l.byteLength!==s.sizeBytes||O(l)!==s.contentHash)throw new Error(`Learning task input bytes are missing or changed: ${s.id}.`);let p=`learning/assets/${d({task:o.id,asset:s.id}).slice(0,40)}/${s.path}`;return t.set(p,new Uint8Array(l)),{id:s.id,sourceRefId:e.sourceId,artifactRef:p,fileName:s.path.split("/").at(-1),stagingPath:s.path,mediaType:s.mediaType,sha256:s.contentHash,sizeBytes:s.sizeBytes,split:o.split,metadata:{portableAsset:s}}}),...o.requiredOutputs?{requiredOutputs:o.requiredOutputs.map(s=>({...s,schemaRef:s.schemaRef?.id??null,maxBytes:s.maxBytes??void 0}))}:{}})),tasksetAssetBytes:t}}k(Be,"materializeLearningBatchAssets");function ze(e){let t=Y(e),a=X(t),r=t.environment.kind==="work";if(!r&&(t.environment.kind!=="text"||t.tools.length||t.tasks.some(c=>c.artifactRefs.length))||r&&t.tasks.some(c=>!c.requiredOutputs?.length))throw new Error("This learning batch requires a supported text or Work environment with declared outputs.");let o=e.source.id,s=Be({tasks:t.tasks,sourceId:o,assets:e.assets,assetBytes:e.assetBytes}),i={demonstrations:[],preferences:[],corrections:[],feedback:[],rewards:[],labels:[]},l=[];for(let c of a.admissions){let x=e.evidence.find(g=>g.id===c.evidence.id),f=e.decisions.find(g=>g.id===c.decision.id);e.batch.purpose==="reward_training"&&f.grade?.training.status==="scored"&&i.rewards.push({id:`reward-${c.taskId}`,taskId:c.taskId,kind:"reward",task:e.definition.instructions,rules:[{id:e.binding.id,points:1,condition:"Execute the released Reward binding with its declared normalization, weights and gates."}],otherwisePoints:0,executable:!0,approved:!0,confidence:1,sourceRefs:[o],artifactRef:e.binding.id,metadata:{rewardBinding:L(e.binding),evidence:c.evidence,decision:c.decision}}),c.supervisedTarget!==null&&i.demonstrations.push({kind:"demonstration",id:`demo-${c.taskId}`,taskId:c.taskId,sourceRefs:[o],artifactRef:c.decision.id,approved:!0,confidence:1,prompt:null,response:JSON.stringify(c.supervisedTarget),metadata:{evidence:c.evidence,decision:c.decision,targetGradeHash:f.targetGrade?.contentHash}});for(let[g,v,E]of[["observed",x.submission.observedOutput,f.grade],["target",f.approvedTarget,f.targetGrade]]){let b=Ce(E);v===null||b===null||l.push({id:`fixture-${g}-${c.taskId}`,taskId:c.taskId,label:b.passed?"positive":"negative",output:v,infrastructureError:null,expectedPassed:b.passed,expectedRewardEligible:b.rewardEligible,metadata:{gradeReceiptHash:E.contentHash,evidence:c.evidence,decision:c.decision}})}}if(!l.length&&e.batch.purpose!=="reward_training")throw new Error("Grade at least one reviewed response before preparing this batch. Grader fixtures must come from actual receipts.");let p=we(e.binding,e.rewards,e.assets),m=[];for(let c of t.graders){if(c.kind!=="custom_verifier")continue;let x=e.assets?.find(g=>g.id===c.verifierRef.id);if(!x)throw new Error(`Reward ${c.id} is missing its immutable verifier source.`);let f=c.verifierRef.path;m.some(g=>g.path===f)||m.push({path:f,role:"verifier",content:C(x,c.verifierRef)})}let R=F.parse({schemaVersion:"openpond.taskset.v1",id:`learning-${d([e.profileId,e.batch.contentHash]).slice(0,40)}`,revision:1,profileId:e.profileId,profileRelease:null,createImproveRunId:null,name:`${e.definition.name} \xB7 ${e.batch.examples.length} approved examples`,objective:e.definition.instructions,purpose:"general",benchmark:null,status:"needs_review",sourceRefs:[e.source],datasetArtifact:null,policy:t.policy,environment:{protocolVersion:"openpond.taskEnvironment.v1",kind:r?"work":"chat",entrypoint:t.environment.entrypoint,stateful:t.environment.stateful,deterministicSeeds:t.environment.deterministicSeeds,toolNames:t.tools.map(c=>c.name),lifecycle:["create","reset","step","grade","cleanup"],defaultTimeoutMs:t.environment.defaultTimeoutMs,networkPolicy:t.environment.networkPolicy,metadata:{portableEnvironment:t.environment,portableTools:t.tools}},capabilities:{schemaVersion:"openpond.tasksetCapabilities.v1",taskKind:r?"single_agent":"chat",supportedSignals:i.demonstrations.length?["demonstration","reward"]:["reward"],compatibleMethods:e.batch.purpose==="supervised_training"?["sft"]:e.batch.purpose==="reward_training"?["grpo","ppo"]:["none"],rewardKinds:[...new Set(t.graders.map(c=>c.kind==="human"?"human":c.kind==="model_judge"?"model_judge":"deterministic"))],requiresTools:t.tools.length>0,requiresState:t.environment.stateful,requiresPrivilegedGrading:!0,environmentPlacements:["local","remote"],exportable:!0,portabilityBlockers:[]},tasks:s.tasks.map(c=>({...c,schemaVersion:"openpond.taskData.v1",sourceRefs:[o],metadata:{admission:a.admissions.find(x=>x.taskId===c.id),exampleOrigin:e.evidence.find(x=>x.id===c.id)?.correctionFeedbackId?"corrected":"extracted"}})),graders:p,graderFixtures:l,learningSignals:i,authoringProvenance:{schemaVersion:"openpond.taskAuthoringProvenance.v1",model:null,modelConfig:{},skillHash:d("openpond-learning-batch-v1"),promptTemplateVersion:"learning-batch-v1",buildIntent:e.batch.purpose==="supervised_training"?"demonstrations":"verifiable_reward",buildSpecification:null,evidenceHashes:e.batch.examples.map(c=>c.evidence.contentHash),tasksetSdkVersion:"learning-batch-v1",sourceCommit:null,repairHistory:[],createdAt:e.batch.sealedAt},readiness:null,contentHash:"00000000",createdAt:e.batch.sealedAt,updatedAt:e.batch.sealedAt,metadata:{learning:a,learningRelease:L(t),trainingMethod:e.batch.purpose==="supervised_training"?"sft":e.batch.purpose==="reward_training"?"grpo":"none",tasksetOutputContract:r?{mode:"artifacts",requiredOutputSource:"task.requiredOutputs"}:{mode:"structured_json",jsonSchema:e.definition.outputSchema,renderer:null}}});return{taskset:F.parse({...R,contentHash:J(R)}),release:t,generatedFiles:m,tasksetAssetBytes:s.tasksetAssetBytes}}k(ze,"materializeLearningBatchTaskset");function Ce(e){if(!e)return null;let t=e.training.status==="not_configured"?e.evaluation:e.training;return t.status!=="scored"?null:{passed:t.passed===!0,rewardEligible:e.training.status==="scored"}}k(Ce,"fixtureOutcome");function rt(e){let t=[],a=0;for(let s of new Map(e.evidence.flatMap(i=>i.submission.assets.map(l=>[l.id,l]))).values()){let i=e.assetBytes?.get(s.id),l=e.assets?.find(m=>m.id===s.id),p=i?.byteLength??(l?new TextEncoder().encode(l.text).byteLength:0);if(a+=p,a>ae)throw new Error("Learning input assets exceed the training package limit.");i?t.push(new TextDecoder().decode(i)):l&&t.push(l.text)}let r=_e(JSON.stringify({tasks:e.evidence.map(s=>s.submission),targets:e.decisions.map(s=>s.approvedTarget),definition:e.definition,inputAssets:t}));if(r.secretStatus!=="passed"||r.piiStatus!=="passed")throw new Error(`Learning batch contains unresolved data findings (${r.findings.join(", ")}). Correct the source examples and seal a revised batch before training.`);let o=te.parse({schemaVersion:"openpond.learningBatchDatasetSource.v1",kind:"learning_batch",id:`batch-source-${e.batch.contentHash.slice(0,40)}`,profileId:e.profileId,title:e.definition.name,sourceHash:e.batch.contentHash,occurredAt:e.batch.sealedAt,batch:L(e.batch),taskDefinition:e.batch.taskDefinition,admittedBy:e.batch.sealedBy,licensingStatus:"approved",secretScanStatus:r.secretStatus,piiScanStatus:r.piiStatus,metadata:{admission:e.admissionContext??"explicit_local_batch_review",privacyScanner:"openpond-evidence-v1",findings:r.findings}});return ze({...e,source:o})}k(rt,"prepareReviewedLearningBatch");async function ct(e){let t=structuredClone(e),{project:a,recipe:r,taskset:o,approval:s}=t,i=Re.parse(t.manifest),l=Te.parse(t.bundleManifest),p=t.executionMode==="qualification",m=t.physicalPlacement?le.parse(t.physicalPlacement):void 0,R=i.qualificationSamples===void 0?null:n.object({rollout:n.object({groupSize:n.number().int().min(2).max(32)}).passthrough()}).passthrough().parse(r).rollout.groupSize;if(i.qualificationSamples!==l.qualificationSamples||i.qualificationSamples!==void 0&&(!p||i.qualificationSamples>R))throw new Error("Qualification samples must be within the pinned rollout group and cannot be used for training.");if(i.executionMode!==t.executionMode||l.executionMode!==t.executionMode)throw new Error("Managed submission execution mode differs from its immutable bundle.");if(p&&(t.evaluationSource||t.resumeFrom||t.rewardSource.kind!=="deterministic"))throw new Error("Qualification requires the original learner, deterministic rewards, and no evaluation source.");let{contentHash:c,...x}=i,{contentHash:f,...g}=l;if(d(x)!==c||d(g)!==f||i.resolvedBundleHash!==f||d(i.harnessRelease)!==d(l.harnessRelease)||d(i.datasetRelease)!==d(l.datasetRelease)||d(i.evidenceSets)!==d(l.evidenceSetRelease?[l.evidenceSetRelease]:[]))throw new Error("The managed training manifest or resolved bundle changed.");if(!a.hosted||a.hosted.syncedSourceRevision!==a.revision||a.hosted.portableProjectId!==a.id)throw new Error("Sync the exact Model Project revision before preparing managed training.");let v=a.trainingSetup.baseModel;if(!v||v.modelId!==i.model.source||v.revision!==i.model.revision||v.tokenizerRevision!==i.model.tokenizerRevision||v.chatTemplateHash!==i.model.chatTemplateHash)throw new Error("The synced Model Project base Model does not match the Run manifest.");if(r.method!=="grpo"||d(r)!==i.recipe.configHash||s.approvalHash!==i.approval.approvalHash||s.maximumSpendUsd!==i.approval.maximumSpendUsd)throw new Error("Managed training requires the exact approved GRPO recipe and spend ceiling.");let E=n.object({wallTimeMs:n.number().positive()}).parse(r.resourceLimits);t.idempotencyKey!==void 0&&n.string().trim().min(16).max(191).parse(t.idempotencyKey);let b=Oe(l,t.files),T=p?null:Z.parse(t.evaluationSource),M=b.find(h=>h.path===W);if(T&&(!M||d(JSON.parse(Buffer.from(M.content,"base64").toString("utf8")))!==d(T)))throw new Error("The evaluation source differs from the immutable training bundle.");if(p&&(M||b.some(h=>h.path==="dataset/train.json")||!b.some(h=>h.path==="dataset/qualification.json")||!b.some(h=>h.path==="qualification-source.json")))throw new Error("Qualification requires its dedicated dataset and no training/evaluation datasets.");if(!p&&b.some(h=>h.path==="dataset/qualification.json"||h.path==="qualification-source.json"))throw new Error("Qualification datasets cannot be prepared as training.");let y=T?await me(T):null,z={schemaVersion:"openpond.managedRlPortableSubmission.v1",...p?{executionMode:"qualification"}:{},...t.origin?{origin:U.parse(t.origin)}:{},...m?{physicalPlacement:m}:{},sourceRunRef:`openpond:model-run:${i.id}`,name:`OpenPond Managed \xB7 ${a.id}`.slice(0,191),idempotencyKey:t.idempotencyKey??`openpond-managed:${c}`.slice(0,191),modelProject:{id:a.hosted.projectId,portableProjectId:a.hosted.portableProjectId},manifest:i,sourceTaskset:o,modelImprovementQualification:t.modelImprovementQualification??null,recipe:r,resolvedBundle:{manifest:l,files:b},validationTasks:T?.tasks??[],validationAssets:T?.assets??[]},j={schemaVersion:"openpond.trainingInputArtifactUpload.v2",kind:"portable_training_bundle",idempotencyKey:`stage:${t.idempotencyKey??c}`,sourceManifest:{id:i.id,contentHash:c},payload:z},P=await fe({...j,contentHash:await ue(j)}),A={schemaVersion:"openpond.trainingJobSubmission.v2",idempotencyKey:t.idempotencyKey??`openpond-training-v2:${c}`,name:`OpenPond Managed \xB7 ${a.id}`.slice(0,200),source:{...t.origin?{origin:U.parse(t.origin)}:{},modelProject:{id:a.hosted.projectId,portableProjectId:a.hosted.portableProjectId,revision:a.revision,contentHash:a.hosted.etag},harnessRunManifest:j.sourceManifest,harnessRelease:i.harnessRelease,taskset:o,tasksetRelease:{id:o.id,contentHash:o.contentHash},dataset:l.datasetRelease,...y?{evaluation:y}:{},evidenceSets:l.evidenceSetRelease?[l.evidenceSetRelease]:[]},job:{kind:"policy_optimize",...p?{executionMode:"qualification"}:{},baseModel:v,recipe:r,rewardSource:t.rewardSource,resumeFrom:t.resumeFrom},requestedCapabilities:[{id:p?"managed_rl.policy.qualification":"managed_rl.policy.grpo",version:"1",required:!0},{id:`managed_rl.rollouts.${i.runtimeTarget.placement}`,version:"1",required:!0},...a.trainingSetup.managedGpuRequirement==="h100_hbm3"?[{id:"managed_rl.gpu.h100_hbm3",version:"1",required:!0}]:[]],placementObjective:a.trainingSetup.managedGpuPlacementObjective,...t.gpuSelection??a.trainingSetup.managedGpuSelection?{gpuSelection:ee.parse(t.gpuSelection??a.trainingSetup.managedGpuSelection)}:{},...m?{physicalPlacement:m}:{},budget:{maximumSpendUsd:s.maximumSpendUsd,maximumWallSeconds:Math.ceil(E.wallTimeMs/1e3)},approval:{...s,approvedAt:i.approval.approvedAt,exportApproved:!0}},u=await ge({...A,contentHash:await he(A)});return{artifact:P,submission:u}}k(ct,"prepareManagedTrainingSubmission");function Oe(e,t){if(t.length!==e.files.length||new Set(t.map(r=>r.path)).size!==t.length)throw new Error("The managed bundle file inventory changed.");let a=new Map(t.map(r=>[r.path,r]));return e.files.map(r=>{let o=a.get(r.path);if(!o||o.path.includes("\\")||o.path.includes("\0")||o.path.split("/").some(i=>!i||i==="."||i==="..")||o.path==="bundle-manifest.json"||o.encoding!=="base64")throw new Error("The managed bundle contains an invalid file.");let s=Buffer.from(o.content,"base64");if(s.toString("base64")!==o.content||o.sha256!==r.sha256||o.sizeBytes!==r.sizeBytes||s.byteLength!==r.sizeBytes||O(s)!==r.sha256)throw new Error(`Managed training bundle file ${o.path} changed before upload.`);return o})}k(Oe,"verifyFiles");var $e=n.object({name:n.literal("adamw").default("adamw"),weightDecay:n.number().nonnegative().max(1).default(0),beta1:n.number().positive().lt(1).default(.9),beta2:n.number().positive().lt(1).default(.999),epsilon:n.number().positive().max(.01).default(1e-8)}).strict().default({name:"adamw",weightDecay:0,beta1:.9,beta2:.999,epsilon:1e-8});function lt(e,t){if(!t||typeof t!="object"||Array.isArray(t))return t;let a=t;if(a.method==="dpo"){let y=S(a.policyModel),z=S(a.referenceModel),j=S(a.dataset),P=d({tasksetHash:e.contentHash,preferenceSignals:e.learningSignals.preferences.map(A=>({id:A.id,artifactRef:A.artifactRef,prompt:A.prompt,chosen:A.chosen,rejected:A.rejected,approved:A.approved})),policyModel:y,referenceModel:z,dataset:j});return{...a,referenceLogprobs:{cacheSchemaVersion:"openpond.dpoReferenceLogprobs.v1",cacheKey:d(["dpo-reference-logprobs",P]),invalidationHash:P}}}if(a.method==="ppo"){let y=S(a.policyOptimization),z=S(y.policyModel),j=S(y.referenceModel),P=S(y.optimizer),A=S(P.valueModel),u=S(y.dataset),h=S(y.reward),Q=d(z),w=d(j),$=d(A);return{...a,policyOptimization:{...y,dataset:{...u,tasksetId:e.id,tasksetHash:e.contentHash},reward:{...h,graderHash:d(e.graders)}},resume:{...S(a.resume),policyHash:Q,referenceHash:w,valueModelHash:$}}}if(a.method!=="grpo")return t;let r=a.reward&&typeof a.reward=="object"&&!Array.isArray(a.reward)?a.reward:{},o=e.environment.metadata.toolContractHash,s=typeof o=="string"&&o.trim()?o:r.toolContractHash,i=S(a.baseModel),l=S(a.dataset),p=S(a.rollout),m=S(a.optimizer),R=S(a.loss),c=S(a.resourceLimits),x=q(l.maxExamples,1),f=q(p.groupSize,2),g=q(p.maxOutputTokens,1),v=q(l.maxPromptTokens,1),E=q(m.maxSteps,1),b=q(m.iterations,2),T=q(c.maxRollouts,E*f),M=q(p.maxTurns,1);return{...a,resourceLimits:{...c,maxGpuSeconds:c.maxGpuSeconds??Math.min(10800,Math.ceil(q(c.wallTimeMs,18e4)/1e3))},reward:{...r,graderHash:d(e.graders),toolContractHash:s},policyOptimization:{schemaVersion:"openpond.policyOptimization.v1",policyModel:i,referenceModel:i,dataset:{tasksetId:e.id,tasksetHash:e.contentHash,split:"train",selectionStrategy:l.selectionStrategy,selectionSeed:p.seed,maxExamples:x},sampler:{temperature:p.temperature,topP:p.topP,maxOutputTokens:g,maxTurns:p.maxTurns,concurrency:p.concurrency},environment:{id:r.environmentId,version:r.environmentVersion,toolContractHash:s},reward:{graderId:r.graderId,graderHash:d(e.graders),learnedPreference:r.learnedPreference??null},kl:{coefficient:R.klBeta??null,referenceConstraint:"fixed_reference"},budgets:{maxRollouts:T,maxEnvironmentExecutions:T,maxInputTokens:T*M*v,maxOutputTokens:T*M*g,maxOptimizerSteps:E*b,wallTimeMs:q(c.wallTimeMs,18e4),maximumCostUsd:null},checkpointEverySteps:1,seed:p.seed,evaluationSplit:"frozen_eval",optimizer:{method:"grpo",groupSize:f,normalization:"group_standardized",advantageEpsilon:typeof m.advantageEpsilon=="number"?m.advantageEpsilon:1e-8,loss:R.method??"grpo",clipRange:typeof m.clipRange=="number"?m.clipRange:.2,iterations:b,microbatchSize:q(m.microbatchSize,1),gradientAccumulationSteps:q(m.gradientAccumulationSteps,1),adamw:$e.parse(m.adamw)}}}}k(lt,"withAuthoritativeRecipeHashes");function S(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}k(S,"record");function q(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>0?e:t}k(q,"positiveInteger");function pt(e){let t=e.sourceRelease,a=[],r=e.skills??[],o=e.agents??[];if([...r,...o].some(m=>m.visibility!=="policy"))throw new Error("The portable policy Harness requires policy-visible dependencies.");let s=ke({id:"desktop-dependency-lock",path:".openpond/harness/dependency-lock.json",hashInput:{profileHead:e.profileHead??null,sourceRelease:t,tools:a,skills:r.map(({id:m,contentHash:R})=>({id:m,contentHash:R})),agents:o.map(({id:m,contentHash:R})=>({id:m,contentHash:R}))},mediaType:"application/json",visibility:"policy"}),i=ne({schemaVersion:"openpond.agentSnapshot.v2",id:`agent-snapshot-${d([t,a,s.contentHash]).slice(0,24)}`,sourceRelease:t,instructions:[],skills:r,agents:o,toolDeclarations:a,capabilityRequirements:[],dependencyLock:s,portability:{portable:!0,blockers:[],localOnlyAssetRefs:[],hostPrivateAssetRefs:[]},metadata:{sourceReleaseId:t?.id??null}}),l=ke({id:"desktop-harness-program",path:".openpond/harness/program.json",hashInput:{program:"openpond.desktop-agent-loop.v1"},mediaType:"application/json",visibility:"policy"}),p=re({schemaVersion:"openpond.harnessRelease.v2",id:`harness-${d([i.contentHash,l.contentHash,a]).slice(0,24)}`,agentSnapshot:{id:i.id,contentHash:i.contentHash},program:l,tools:a,lifecycle:{create:!0,reset:!0,step:!0,collect:!0,destroy:!0,resetScope:"attempt"},graderInterface:{visibleEvidence:["output","runtime_events","artifacts"],privilegedEvidence:["expected_output","private_verifier"],privateVerifierIsolation:!0},files:[...r,...o],metadata:{runtimeProtocol:"openpond.desktop-agent-loop.v1"}});return{agentSnapshot:i,harnessRelease:p}}k(pt,"createPolicyHarnessContext");function ke(e){let t=G(e.hashInput);return{id:e.id,path:e.path,contentHash:d(e.hashInput),sizeBytes:new TextEncoder().encode(t).byteLength,mediaType:e.mediaType,visibility:e.visibility}}k(ke,"asset");function mt(e){let{taskset:t,modelProject:a,harnessRelease:r,tasksetRelease:o}=e,s=a.trainingSetup,i=e.executionMode==="qualification",l=e.qualificationSamples===void 0?null:n.object({rollout:n.object({groupSize:n.number().int().min(2).max(32)}).passthrough()}).passthrough().parse(e.modelProject.trainingSetup.recipe).rollout.groupSize;if(e.qualificationSamples!==void 0&&(!i||!Number.isInteger(e.qualificationSamples)||e.qualificationSamples<1||e.qualificationSamples>l))throw new Error("Qualification samples must be within the pinned rollout group and cannot be used for training.");if(i&&e.evaluationSource)throw new Error("Qualification does not consume an independent evaluation source.");let p=i?se(e.qualificationSource):null;if(!i&&e.qualificationSource)throw new Error("Qualification sources cannot be used for training.");if(!i&&e.qualificationTaskId!==void 0)throw new Error("Qualification selection cannot be used for training.");if(i&&(!e.qualificationTaskId||!t.tasks.some(u=>u.id===e.qualificationTaskId)))throw new Error("Qualification requires one explicit task ID from its published source.");if(p&&(p.modelResources||p.learningResources||d(t.tasks.map(be))!==d(p.taskset.tasks)||Se(e.tasksetRelease)!==Se(p.taskset)))throw new Error("Qualification must preserve its ordinary source release and complete task population.");let m=_.parse(r),R=_.parse(o);if(e.openpondRelease,e.workerProtocol,J(t)!==t.contentHash)throw new Error("Taskset authoring state changed after its release was selected.");if(!s.baseModel?.revision||!s.baseModel.tokenizerRevision||!s.baseModel.chatTemplateHash||!s.recipe||!s.tasksetRef||s.tasksetRef.id!==(i?o.id:t.id)||s.tasksetRef.contentHash!==(i?o.contentHash:t.contentHash))throw new Error("Model Run must bind an exact Taskset, Model revision, tokenizer, chat template, and Recipe.");let x=t.profileRelease??{id:`profile_${t.profileId}`,revision:t.revision,contentHash:d({profileId:t.profileId,sourceCommit:t.authoringProvenance.sourceCommit,skillHash:t.authoringProvenance.skillHash})},f=new Map;if(p&&B(f,"qualification-source.json",p),e.evaluationSource){let u=Z.parse(e.evaluationSource);if(d(u.taskset)!==d(s.evaluationTasksetRef))throw new Error("The evaluation source differs from the prepared Model configuration.");pe(t.tasks.filter(h=>h.split==="train"),u.tasks),f.set(W,new TextEncoder().encode(G(u)))}else if(!i&&s.evaluationTasksetRef)throw new Error("The prepared Model requires its pinned evaluation source bytes.");let g=e.harnessSource?e.harnessSource.schemaVersion==="openpond.harnessPolicySourcePackage.v1"?ce(e.harnessSource,m):de(e.harnessSource,m):null;if(s.harnessRelease&&!g)throw new Error("A selected Harness requires its complete immutable source package.");if(g&&(!s.harnessRelease||s.harnessRelease.id!==m.id||s.harnessRelease.contentHash!==m.contentHash))throw new Error("Harness source differs from the Model's explicit selection.");if(g){if((e.runtime.placement!=="local"||e.compute.kind!=="local")&&(!g.agentSnapshot.portability.portable||g.schemaVersion==="openpond.harnessSourcePackage.v1"&&g.harnessRelease.files.some(h=>h.visibility!=="policy")))throw new Error("The selected Harness contains source that cannot leave its local host.");B(f,"harness/source-package.json",g)}B(f,"harness/execution.json",oe.parse({schemaVersion:"openpond.harnessSourceSelection.v1",mode:g?"selected_release":"taskset_owned",harnessRelease:m,sourcePackageHash:g?.contentHash??null}));let v=ve(t,e.rewardExecution);if(p&&(!v||d(K(v.binding,v.rewards))!==d(p.taskset.graders)||p.taskset.graders.some(u=>u.kind==="model_judge"||u.kind==="human")))throw new Error("Qualification requires the source package's exact deterministic graders.");if(v){let u=e.verifierAssets??[],h=[...v.rewards.flatMap(w=>w.assets),...K(v.binding,v.rewards).flatMap(w=>w.kind==="custom_verifier"?[w.verifierRef]:w.kind==="model_judge"?[w.rubricRef]:[])],Q=new Set(h.map(w=>w.id));if(new Set(u.map(w=>w.id)).size!==u.length||new Set(u.map(w=>w.asset.path)).size!==u.length||u.some(w=>!Q.has(w.id)))throw new Error("Unexpected or duplicate private verifier asset.");for(let w of h){let $=u.find(Ee=>Ee.id===w.id);if(!$||w.visibility!=="verifier")throw new Error("Training bundle requires its private verifier asset.");C($,w)}B(f,"reward-binding.json",{kind:"reward_binding_v1",binding:v.binding,rewards:v.rewards,assets:u})}else if(e.verifierAssets?.length)throw new Error("Private verifier assets require a published Reward binding.");let E=t.metadata.tasksetOutputContract;E&&typeof E=="object"&&"responsePath"in E&&ie.parse({jsonSchema:null,renderer:null,...E}),B(f,"environment.json",{schemaVersion:"openpond.harnessEnvironment.v1",environment:{...t.environment,metadata:{...t.environment.metadata,policySystemPrompt:t.objective}},capabilities:t.capabilities,policy:t.policy,outputContract:t.metadata.tasksetOutputContract?.mode==="text"?null:t.metadata.tasksetOutputContract??null}),B(f,"graders.json",{schemaVersion:"openpond.harnessGraders.v1",graders:t.graders,fixtures:t.graderFixtures}),B(f,"tool-contract.json",{schemaVersion:"openpond.harnessToolContract.v1",toolNames:t.environment.toolNames,actionBindings:t.environment.actionBindings??[],capabilities:t.capabilities,connectedAppScopes:t.policy.connectedAppScopes});let b=i?t.tasks.filter(u=>u.id===e.qualificationTaskId):t.tasks.filter(u=>u.split==="train");if(b.length>0)B(f,i?"dataset/qualification.json":"dataset/train.json",{schemaVersion:i?"openpond.qualificationDataset.v1":"openpond.datasetSplit.v1",...i?{selectedTaskId:e.qualificationTaskId}:{split:"train"},tasks:b}),Le({assets:f,tasks:b,tasksetAssetBytes:e.tasksetAssetBytes??new Map});else if(t.datasetArtifact)B(f,"dataset/artifact.json",t.datasetArtifact);else throw new Error("Taskset has no training dataset.");let T=Object.values(t.learningSignals).flat().filter(u=>u.approved);for(let u of T){let h=He(u);f.set(`evidence/signals/${O(h)}.json`,h)}let M={id:`dataset_${t.id}_r${t.revision}`,contentHash:d({taskset:R,sourceRefs:t.sourceRefs,datasetArtifact:t.datasetArtifact??null,...i?{executionMode:"qualification",tasks:b}:{trainTasks:b}})},y=T.length>0?{id:`evidence_${t.id}_r${t.revision}`,contentHash:d({taskset:R,harnessRelease:m,datasetRelease:M,profileRelease:x,signals:T})}:null,z=xe.parse({schemaVersion:"openpond.resolvedTrainingBundle.v1",...i?{executionMode:"qualification"}:{},...e.qualificationSamples!==void 0?{qualificationSamples:e.qualificationSamples}:{},projection:"trainer",harnessRelease:m,datasetRelease:M,evidenceSetRelease:y,files:[...f.entries()].sort(([u],[h])=>u.localeCompare(h)).map(([u,h])=>({path:u,sha256:O(h),sizeBytes:h.byteLength}))}),j=Te.parse({...z,contentHash:d(z)}),P=ye.parse({schemaVersion:"openpond.harnessRunManifest.v1",...i?{executionMode:"qualification"}:{},...e.qualificationSamples!==void 0?{qualificationSamples:e.qualificationSamples}:{},id:`manifest_${e.modelRunId}_${e.approval.approvalHash.slice(0,16)}`,harnessRelease:r,datasetRelease:M,evidenceSets:y?[y]:[],model:{source:s.baseModel.modelId,revision:s.baseModel.revision,artifactHash:null,tokenizerRevision:s.baseModel.tokenizerRevision,chatTemplateHash:s.baseModel.chatTemplateHash},recipe:{method:s.recipe.method,version:"openpond.trainingRecipe.v1",configHash:d(s.recipe)},runtimeTarget:e.runtime,computeTarget:e.compute,engine:e.engine,resolvedBundleHash:j.contentHash,secretLeaseRefs:e.secretLeaseRefs??[],approval:e.approval,createdAt:a.updatedAt});return{manifest:Re.parse({...P,contentHash:d(P)}),resolvedBundleManifest:j,assets:f,profileRelease:x,harnessRelease:m,tasksetRelease:R,datasetRelease:M,evidenceSetRelease:y}}k(mt,"buildTasksetTrainingBundle");function Le(e){let t=new Set;for(let a of e.tasks)for(let r of a.assets??[]){t.add(r.artifactRef);let o=e.tasksetAssetBytes.get(r.artifactRef);if(!o)throw new Error(`Resolved Training Bundle is missing Work asset ${r.artifactRef}.`);if(o.byteLength!==r.sizeBytes||O(o)!==r.sha256)throw new Error(`Resolved Training Bundle Work asset ${r.artifactRef} failed immutable verification.`);e.assets.set(r.artifactRef,o)}for(let a of e.tasksetAssetBytes.keys())if(!t.has(a))throw new Error(`Resolved Training Bundle received unexpected Work asset ${a}.`)}k(Le,"addTasksetAssets");function B(e,t,a){e.set(t,He(a))}k(B,"addJsonAsset");function He(e){return Buffer.from(G(e),"utf8")}k(He,"bytes");function Se(e){return d({id:e.id,contentHash:e.contentHash})}k(Se,"releasedRefHash");export{qe as a,Me as b,je as c,Re as d,Te as e,_e as f,rt as g,ct as h,$e as i,lt as j,pt as k,mt as l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{pc as a,sc as u,tc as h}from"./chunk-J572ANHX.js";import{Ma as l}from"./chunk-PBZCXPPC.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as p}from"./chunk-FTQLQJQV.js";var o=e.string().trim().min(1).max(240),S=e.object({projectId:o.optional(),search:e.string().max(300).optional(),kind:e.string().max(100).optional(),sort:e.enum(["name","type","version","projects","datasets","runs"]).optional(),direction:e.enum(["asc","desc"]).optional(),after:e.string().max(3e3).optional(),limit:e.number().int().min(1).max(100).default(30)}).strict(),v=e.object({teamId:o,items:e.array(e.object({reward:l,projects:e.number().int().nonnegative(),datasets:e.number().int().nonnegative(),runs:e.number().int().nonnegative()}).strict()).max(100),nextCursor:e.string().nullable()}).strict(),b=e.object({teamId:o,id:o,items:e.array(l).max(100),nextRevision:e.number().int().positive().nullable()}).strict(),g=e.object({section:e.enum(["projects","datasets","runs"]),after:o.optional(),limit:e.number().int().min(1).max(100).default(25)}).strict(),I=e.object({teamId:o,id:o,section:g.shape.section,items:e.array(e.union([e.object({id:o,name:e.string(),graderRevisions:e.array(e.number().int().positive()),archived:e.boolean()}).strict(),e.object({id:o,name:e.string(),revision:e.number().int().positive(),graderRevisions:e.array(e.number().int().positive())}).strict(),e.object({id:o,name:e.string(),status:e.string()}).strict()])).max(100),nextCursor:o.nullable()}).strict(),G=class{static{p(this,"OpenPondGraderInspectionClient")}constructor(n){this.options=n;let i=new URL(n.baseUrl);if(!["http:","https:"].includes(i.protocol)||i.username||i.password||i.search||i.hash||!n.apiKey.trim()||!n.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=i.toString().replace(/\/+$/,"")}options;baseUrl;async catalog(n={},i){let c=S.parse(n),t=v.parse(await this.read("",c,i));if(t.teamId!==this.options.teamId||t.items.length>c.limit||new Set(t.items.map(r=>r.reward.id)).size!==t.items.length)throw new Error("Grader catalog differs from its requested workspace or bounds.");return t}async versions(n,i={},c){let t=e.object({beforeRevision:e.number().int().positive().optional(),limit:e.number().int().min(1).max(100).default(25)}).strict().parse(i),r=b.parse(await this.read(`/${encodeURIComponent(o.parse(n))}/versions`,t,c));if(r.teamId!==this.options.teamId||r.id!==n||r.items.length>t.limit||r.items.some((d,m)=>d.id!==n||t.beforeRevision&&d.revision>=t.beforeRevision||m>0&&d.revision>=r.items[m-1].revision))throw new Error("Grader versions differ from their requested identity or revision order.");return r}async usage(n,i,c){let t=g.parse(i),r=I.parse(await this.read(`/${encodeURIComponent(o.parse(n))}/usage`,t,c));if(r.teamId!==this.options.teamId||r.id!==n||r.section!==t.section||r.items.length>t.limit)throw new Error("Grader usage differs from its requested workspace, identity or bounds.");return r}async read(n,i,c){let t=new URLSearchParams(Object.entries(i).filter(([,m])=>m!==void 0).map(([m,f])=>[m,String(f)])),r=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/learning/read/graders${n}?${t}`,{signal:c,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,Accept:"application/json"}}),d=await r.json();if(!r.ok)throw new Error(e.object({error:e.string()}).parse(d).error);return d}};var s=e.string().trim().min(1).max(500),w=e.object({id:s,contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),J=e.object({teamId:s,modelId:s,runId:s.optional(),from:e.string().datetime().optional(),to:e.string().datetime().optional()}).strict(),K=e.discriminatedUnion("action",[e.object({action:e.literal("declare_verification"),teamId:s,operationId:s,plan:e.object({modelId:a.shape.modelId,classification:a.shape.classification,feedback:a.shape.feedback,evidence:a.shape.evidence,trainingJobId:a.shape.trainingJobId,checkpoint:a.shape.checkpoint,artifact:a.shape.artifact,taskset:a.shape.taskset,checks:a.shape.checks,baselineOperationId:a.shape.baselineOperationId,candidateOperationId:a.shape.candidateOperationId,criterion:a.shape.criterion}).strict()}).strict(),e.object({action:e.literal("link_live_opportunity"),teamId:s,operationId:s,correction:w,inferenceRequestId:s,grade:e.object({id:s,revision:e.number().int().positive()}).strict(),checkIds:e.array(s).min(1).max(1e3)}).strict()]),N=e.object({summary:h.nullable(),observations:e.array(u).max(1e3)}).strict();export{S as a,g as b,G as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{g as E,m as g,n as j}from"./chunk-MHYI7ATG.js";import{b as W}from"./chunk-L3KS6MOV.js";import{k as P}from"./chunk-CN5OXQ7A.js";import{e as A,f as x,g as D,l as I}from"./chunk-OZ6LRNRE.js";import{n as $}from"./chunk-VVNV4NNW.js";import{a as v}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as M}from"node:module";import m from"node:path";async function Q(e){let r=A.parse(e.overlay),t=x.parse(e.proposal),o=e.validations.map(h=>D.parse(h));if((t.route==="agent"?t.edits.filter(h=>h.target!=="harness.json"&&h.operation!=="delete"):[]).length>0){let h=t.validationPlan.find(n=>n.kind==="component_activation"&&n.required);if(!h)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(o.find(n=>n.validationId===h.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let i=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!i)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(i.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let s=E(e.storeDir,i.id),l=await g({workspaceId:i.id,sourceDir:s.source});if(l.sourceRevision!==i.sourceRevision)throw new Error(`Harness source is ${l.sourceRevision}; workspace expects ${i.sourceRevision}. Record or revert the source change before refinement.`);let w=m.join(s.root,`.source-candidate-${H()}`);await p.cp(s.source,w,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await V(w,t);let h=await g({workspaceId:i.id,sourceDir:w}),f=(e.now??(()=>new Date().toISOString()))(),n=await j({storeDir:e.storeDir,workspaceId:i.id,compiled:h,createdAt:f});await e.store.saveHarnessReleaseRecord(n),await e.store.saveHarnessImprovementArtifact(i.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(i.id,"proposal",t);for(let a of o)await e.store.saveHarnessImprovementArtifact(i.id,"targeted_validation",a);if(!P({workspace:i,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});let u=m.join(s.root,`.source-backup-${H()}`),c=m.join(s.root,"source-swap.json");await _(c,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:i.id,expectedWorkspaceRevision:i.revision,previousSourceRevision:i.sourceRevision,nextSourceRevision:n.sourceRevision,backupSource:u,candidateSource:w,createdAt:f}),await p.rename(s.source,u),await p.rename(w,s.source);try{let a=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:f}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});return a.receipt.decision!=="advanced"?await b(s.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(c,{force:!0}),a}catch(a){throw await b(s.source,u).catch(()=>{}),await p.rm(c,{force:!0}).catch(()=>{}),a}}finally{await p.rm(w,{recursive:!0,force:!0}).catch(()=>{})}}v(Q,"applyLocalHarnessRefinerProposal");async function X(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let o=E(e.storeDir,r.id);if((await g({workspaceId:r.id,sourceDir:o.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let i=m.join(o.root,`.source-rollback-${H()}`);await p.cp(m.join(t.bundlePath,"source"),i,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await g({workspaceId:r.id,sourceDir:i})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let l=(e.now??(()=>new Date().toISOString()))(),w=m.join(o.root,`.source-backup-${H()}`),h=m.join(o.root,"source-swap.json");await _(h,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:w,candidateSource:i,createdAt:l}),await p.rename(o.source,w),await p.rename(i,o.source);try{let f=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:l});return f.receipt.decision!=="rolled_back"?await b(o.source,w):await p.rm(w,{recursive:!0,force:!0}),await p.rm(h,{force:!0}),f}catch(f){throw await b(o.source,w).catch(()=>{}),await p.rm(h,{force:!0}).catch(()=>{}),f}}finally{await p.rm(i,{recursive:!0,force:!0}).catch(()=>{})}}v(X,"rollbackLocalHarnessWorkspaceRelease");async function Y(e){let r=x.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return q({proposal:r,now:e.now});let t=E(e.storeDir,e.workspace.id),o=await g({workspaceId:e.workspace.id,sourceDir:t.source});if(o.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let d=m.join(t.root,`.validation-candidate-${H()}`);await p.cp(t.source,d,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let i=(e.now??(()=>new Date().toISOString()))();try{await V(d,r);let s=await g({workspaceId:e.workspace.id,sourceDir:d}),l=new Map(s.manifest.files.map(n=>[n.path,n])),w=new Map(r.edits.map(n=>[n.target,n])),h=O(o),f=O(s);return Promise.all(r.validationPlan.map(async n=>{let y="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(n.kind==="observed_recovery"){let c=r.evidence.filter(a=>a.kind==="recovery");if(c.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${c.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(n.kind==="prompt"){let c=r.edits.filter(a=>a.route==="prompt"&&a.target!=="harness.json");if(c.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted instruction ${a.target} remains declared.`)}else if(k?.kind!=="instruction")throw new Error(`Instruction ${a.target} is not declared in the candidate Harness.`);if(a.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(a.content))throw new Error(`Instruction ${a.target} appears to contain credential material.`)}u=`Validated ${c.length} textual instruction edit(s) and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="skill"){let c=r.edits.filter(a=>a.route==="skill"&&a.target!=="harness.json");if(c.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted Skill ${a.target} remains declared.`);continue}if(k?.kind!=="skill")throw new Error(`Skill ${a.target} is not declared in the candidate Harness.`);let S=w.get(a.target)?.content;if(!S)throw new Error(`Skill edit ${a.target} has no content.`);let R=W(S);if(!R.name||!R.description||R.messages.length>0)throw new Error(`Skill ${a.target} is invalid: ${R.messages.join(" ")}`)}u=`Validated ${c.length} Skill edit(s), Skill frontmatter, and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="dependency"){let c=s.manifest.files.find(a=>a.kind==="dependency_lock");if(!c)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(T(d,c.path),"utf8")),u=`Validated dependency lock ${c.path} and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="schema")x.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${s.harnessRelease.id}.`;else if(n.kind==="package"){let c=r.edits.filter(a=>a.route==="agent"&&a.operation!=="delete"&&a.target!=="harness.json");for(let a of c){if(!a.content)throw new Error(`Agent edit ${a.target} has no source.`);M(a.content,{mode:"transform",sourceUrl:a.target,sourceMap:!1})}u=c.length>0?`Syntax-checked ${c.length} Agent source edit(s) and compiled candidate ${s.harnessRelease.id}.`:`Compiled candidate package ${s.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(n.kind==="component_activation"){let c=r.edits.filter(a=>a.target!=="harness.json");if(c.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(c.filter(k=>k.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${c.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let a=r.route==="prompt"?"instruction":"skill";for(let k of c){let S=f.components.find(R=>R.path===k.target&&R.kind===a);if(k.operation==="delete"?S:!S)throw new Error(`${a} ${k.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(h.contentHash===f.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${c.length} ${a} edit(s) in the candidate Desktop Work runtime surface.`}}else n.kind==="business_formula"?(y="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):n.kind==="targeted_evaluation"?(y="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):n.kind==="file_render"?(y="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(y="blocked",u=`Local targeted validation does not yet own ${n.kind}; it requires its dedicated validator.`)}catch(c){y="failed",u=c instanceof Error?c.message:String(c)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${n.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:n.id,kind:n.kind,status:y,summary:u,evidenceRefs:r.evidence,createdAt:i,metadata:{candidateHarnessRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},sourceRevision:s.sourceRevision,...n.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:h.contentHash,afterEffectiveRuntimeHash:f.contentHash,activatedComponentRefs:f.components,inactiveAgentRefs:f.inactiveAgents}:{}}})}))}catch(s){let l=s instanceof Error?s.message:String(s);return r.validationPlan.map(w=>I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${w.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:w.id,kind:w.kind,status:"failed",summary:l,evidenceRefs:r.evidence,createdAt:i,metadata:{}}))}finally{await p.rm(d,{recursive:!0,force:!0}).catch(()=>{})}}v(Y,"validateLocalHarnessRefinerProposal");function O(e){let r=[...e.agentSnapshot.instructions.map(o=>({kind:"instruction",path:o.path,contentHash:o.contentHash})),...e.agentSnapshot.skills.map(o=>({kind:"skill",path:o.path,contentHash:o.contentHash}))].sort((o,d)=>o.path.localeCompare(d.path)),t=e.agentSnapshot.agents.map(o=>({path:o.path,contentHash:o.contentHash})).sort((o,d)=>o.path.localeCompare(d.path));return{contentHash:$({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}v(O,"desktopWorkRuntimeSurface");function q(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(o=>o.route==="memory");return e.proposal.validationPlan.map(o=>{let d="passed",i="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(o.kind==="observed_recovery"){if(!e.proposal.evidence.some(s=>s.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");i="Memory proposal is grounded in immutable recovery evidence."}else if(o.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let s=e.proposal.metadata.expectedMemory;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("Memory proposal requires an expected revision snapshot.");let l=s;if(l.key!==C(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(l.revision!==null&&(!Number.isInteger(l.revision)||Number(l.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(l.contentHash!==null&&typeof l.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(l.status!==null&&l.status!=="active"&&l.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(l.revision===null&&(l.contentHash!==null||l.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(l.revision!==null&&(typeof l.contentHash!="string"||l.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&l.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else d="blocked",i=`Memory validation cannot satisfy ${o.kind}.`}catch(s){d="failed",i=s instanceof Error?s.message:String(s)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${o.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:o.id,kind:o.kind,status:d,summary:i,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}v(q,"validateMemoryProposal");function C(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}v(C,"memoryKeyFromTarget");async function Z(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=E(e.storeDir,r.id),o=m.join(t.root,"source-swap.json"),d=await p.readFile(o,"utf8").then(JSON.parse).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!d)return"none";let i=await g({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===d.nextSourceRevision&&i.sourceRevision===d.nextSourceRevision)return await p.rm(d.backupSource,{recursive:!0,force:!0}),await p.rm(o,{force:!0}),"completed";let s=await g({workspaceId:r.id,sourceDir:d.backupSource});if(r.sourceRevision===d.previousSourceRevision&&s.sourceRevision===d.previousSourceRevision)return await b(t.source,d.backupSource),await p.rm(o,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}v(Z,"recoverLocalHarnessSourceSwap");async function V(e,r){for(let t of r.edits){let o=T(e,t.target);if(t.operation==="delete"){await p.rm(o,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(m.dirname(o),{recursive:!0}),await p.writeFile(o,t.content,{flag:"wx"});else{let d=await p.lstat(o);if(!d.isFile()||d.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(o,t.content,{flag:"w"})}}}v(V,"applyOverlayEdits");function T(e,r){let t=m.resolve(e),o=m.resolve(t,...r.replaceAll("\\","/").split("/")),d=m.relative(t,o);if(!d||d.startsWith("..")||m.isAbsolute(d))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return o}v(T,"containedPath");async function _(e,r){let t=`${e}.${H()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
|
|
2
|
+
import{g as E,m as g,n as j}from"./chunk-LK2K3SPM.js";import{b as W}from"./chunk-L3KS6MOV.js";import{k as P}from"./chunk-3YXYBYWK.js";import{e as A,f as x,g as D,l as I}from"./chunk-MPNJ2BB4.js";import{n as $}from"./chunk-VVNV4NNW.js";import{a as v}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as M}from"node:module";import m from"node:path";async function Q(e){let r=A.parse(e.overlay),t=x.parse(e.proposal),o=e.validations.map(h=>D.parse(h));if((t.route==="agent"?t.edits.filter(h=>h.target!=="harness.json"&&h.operation!=="delete"):[]).length>0){let h=t.validationPlan.find(n=>n.kind==="component_activation"&&n.required);if(!h)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(o.find(n=>n.validationId===h.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let i=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!i)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(i.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let s=E(e.storeDir,i.id),l=await g({workspaceId:i.id,sourceDir:s.source});if(l.sourceRevision!==i.sourceRevision)throw new Error(`Harness source is ${l.sourceRevision}; workspace expects ${i.sourceRevision}. Record or revert the source change before refinement.`);let w=m.join(s.root,`.source-candidate-${H()}`);await p.cp(s.source,w,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await V(w,t);let h=await g({workspaceId:i.id,sourceDir:w}),f=(e.now??(()=>new Date().toISOString()))(),n=await j({storeDir:e.storeDir,workspaceId:i.id,compiled:h,createdAt:f});await e.store.saveHarnessReleaseRecord(n),await e.store.saveHarnessImprovementArtifact(i.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(i.id,"proposal",t);for(let a of o)await e.store.saveHarnessImprovementArtifact(i.id,"targeted_validation",a);if(!P({workspace:i,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});let u=m.join(s.root,`.source-backup-${H()}`),c=m.join(s.root,"source-swap.json");await _(c,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:i.id,expectedWorkspaceRevision:i.revision,previousSourceRevision:i.sourceRevision,nextSourceRevision:n.sourceRevision,backupSource:u,candidateSource:w,createdAt:f}),await p.rename(s.source,u),await p.rename(w,s.source);try{let a=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:f}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});return a.receipt.decision!=="advanced"?await b(s.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(c,{force:!0}),a}catch(a){throw await b(s.source,u).catch(()=>{}),await p.rm(c,{force:!0}).catch(()=>{}),a}}finally{await p.rm(w,{recursive:!0,force:!0}).catch(()=>{})}}v(Q,"applyLocalHarnessRefinerProposal");async function X(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let o=E(e.storeDir,r.id);if((await g({workspaceId:r.id,sourceDir:o.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let i=m.join(o.root,`.source-rollback-${H()}`);await p.cp(m.join(t.bundlePath,"source"),i,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await g({workspaceId:r.id,sourceDir:i})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let l=(e.now??(()=>new Date().toISOString()))(),w=m.join(o.root,`.source-backup-${H()}`),h=m.join(o.root,"source-swap.json");await _(h,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:w,candidateSource:i,createdAt:l}),await p.rename(o.source,w),await p.rename(i,o.source);try{let f=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:l});return f.receipt.decision!=="rolled_back"?await b(o.source,w):await p.rm(w,{recursive:!0,force:!0}),await p.rm(h,{force:!0}),f}catch(f){throw await b(o.source,w).catch(()=>{}),await p.rm(h,{force:!0}).catch(()=>{}),f}}finally{await p.rm(i,{recursive:!0,force:!0}).catch(()=>{})}}v(X,"rollbackLocalHarnessWorkspaceRelease");async function Y(e){let r=x.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return q({proposal:r,now:e.now});let t=E(e.storeDir,e.workspace.id),o=await g({workspaceId:e.workspace.id,sourceDir:t.source});if(o.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let d=m.join(t.root,`.validation-candidate-${H()}`);await p.cp(t.source,d,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let i=(e.now??(()=>new Date().toISOString()))();try{await V(d,r);let s=await g({workspaceId:e.workspace.id,sourceDir:d}),l=new Map(s.manifest.files.map(n=>[n.path,n])),w=new Map(r.edits.map(n=>[n.target,n])),h=O(o),f=O(s);return Promise.all(r.validationPlan.map(async n=>{let y="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(n.kind==="observed_recovery"){let c=r.evidence.filter(a=>a.kind==="recovery");if(c.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${c.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(n.kind==="prompt"){let c=r.edits.filter(a=>a.route==="prompt"&&a.target!=="harness.json");if(c.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted instruction ${a.target} remains declared.`)}else if(k?.kind!=="instruction")throw new Error(`Instruction ${a.target} is not declared in the candidate Harness.`);if(a.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(a.content))throw new Error(`Instruction ${a.target} appears to contain credential material.`)}u=`Validated ${c.length} textual instruction edit(s) and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="skill"){let c=r.edits.filter(a=>a.route==="skill"&&a.target!=="harness.json");if(c.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted Skill ${a.target} remains declared.`);continue}if(k?.kind!=="skill")throw new Error(`Skill ${a.target} is not declared in the candidate Harness.`);let S=w.get(a.target)?.content;if(!S)throw new Error(`Skill edit ${a.target} has no content.`);let R=W(S);if(!R.name||!R.description||R.messages.length>0)throw new Error(`Skill ${a.target} is invalid: ${R.messages.join(" ")}`)}u=`Validated ${c.length} Skill edit(s), Skill frontmatter, and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="dependency"){let c=s.manifest.files.find(a=>a.kind==="dependency_lock");if(!c)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(T(d,c.path),"utf8")),u=`Validated dependency lock ${c.path} and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="schema")x.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${s.harnessRelease.id}.`;else if(n.kind==="package"){let c=r.edits.filter(a=>a.route==="agent"&&a.operation!=="delete"&&a.target!=="harness.json");for(let a of c){if(!a.content)throw new Error(`Agent edit ${a.target} has no source.`);M(a.content,{mode:"transform",sourceUrl:a.target,sourceMap:!1})}u=c.length>0?`Syntax-checked ${c.length} Agent source edit(s) and compiled candidate ${s.harnessRelease.id}.`:`Compiled candidate package ${s.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(n.kind==="component_activation"){let c=r.edits.filter(a=>a.target!=="harness.json");if(c.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(c.filter(k=>k.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${c.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let a=r.route==="prompt"?"instruction":"skill";for(let k of c){let S=f.components.find(R=>R.path===k.target&&R.kind===a);if(k.operation==="delete"?S:!S)throw new Error(`${a} ${k.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(h.contentHash===f.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${c.length} ${a} edit(s) in the candidate Desktop Work runtime surface.`}}else n.kind==="business_formula"?(y="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):n.kind==="targeted_evaluation"?(y="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):n.kind==="file_render"?(y="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(y="blocked",u=`Local targeted validation does not yet own ${n.kind}; it requires its dedicated validator.`)}catch(c){y="failed",u=c instanceof Error?c.message:String(c)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${n.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:n.id,kind:n.kind,status:y,summary:u,evidenceRefs:r.evidence,createdAt:i,metadata:{candidateHarnessRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},sourceRevision:s.sourceRevision,...n.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:h.contentHash,afterEffectiveRuntimeHash:f.contentHash,activatedComponentRefs:f.components,inactiveAgentRefs:f.inactiveAgents}:{}}})}))}catch(s){let l=s instanceof Error?s.message:String(s);return r.validationPlan.map(w=>I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${w.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:w.id,kind:w.kind,status:"failed",summary:l,evidenceRefs:r.evidence,createdAt:i,metadata:{}}))}finally{await p.rm(d,{recursive:!0,force:!0}).catch(()=>{})}}v(Y,"validateLocalHarnessRefinerProposal");function O(e){let r=[...e.agentSnapshot.instructions.map(o=>({kind:"instruction",path:o.path,contentHash:o.contentHash})),...e.agentSnapshot.skills.map(o=>({kind:"skill",path:o.path,contentHash:o.contentHash}))].sort((o,d)=>o.path.localeCompare(d.path)),t=e.agentSnapshot.agents.map(o=>({path:o.path,contentHash:o.contentHash})).sort((o,d)=>o.path.localeCompare(d.path));return{contentHash:$({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}v(O,"desktopWorkRuntimeSurface");function q(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(o=>o.route==="memory");return e.proposal.validationPlan.map(o=>{let d="passed",i="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(o.kind==="observed_recovery"){if(!e.proposal.evidence.some(s=>s.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");i="Memory proposal is grounded in immutable recovery evidence."}else if(o.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let s=e.proposal.metadata.expectedMemory;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("Memory proposal requires an expected revision snapshot.");let l=s;if(l.key!==C(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(l.revision!==null&&(!Number.isInteger(l.revision)||Number(l.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(l.contentHash!==null&&typeof l.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(l.status!==null&&l.status!=="active"&&l.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(l.revision===null&&(l.contentHash!==null||l.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(l.revision!==null&&(typeof l.contentHash!="string"||l.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&l.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else d="blocked",i=`Memory validation cannot satisfy ${o.kind}.`}catch(s){d="failed",i=s instanceof Error?s.message:String(s)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${o.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:o.id,kind:o.kind,status:d,summary:i,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}v(q,"validateMemoryProposal");function C(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}v(C,"memoryKeyFromTarget");async function Z(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=E(e.storeDir,r.id),o=m.join(t.root,"source-swap.json"),d=await p.readFile(o,"utf8").then(JSON.parse).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!d)return"none";let i=await g({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===d.nextSourceRevision&&i.sourceRevision===d.nextSourceRevision)return await p.rm(d.backupSource,{recursive:!0,force:!0}),await p.rm(o,{force:!0}),"completed";let s=await g({workspaceId:r.id,sourceDir:d.backupSource});if(r.sourceRevision===d.previousSourceRevision&&s.sourceRevision===d.previousSourceRevision)return await b(t.source,d.backupSource),await p.rm(o,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}v(Z,"recoverLocalHarnessSourceSwap");async function V(e,r){for(let t of r.edits){let o=T(e,t.target);if(t.operation==="delete"){await p.rm(o,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(m.dirname(o),{recursive:!0}),await p.writeFile(o,t.content,{flag:"wx"});else{let d=await p.lstat(o);if(!d.isFile()||d.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(o,t.content,{flag:"w"})}}}v(V,"applyOverlayEdits");function T(e,r){let t=m.resolve(e),o=m.resolve(t,...r.replaceAll("\\","/").split("/")),d=m.relative(t,o);if(!d||d.startsWith("..")||m.isAbsolute(d))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return o}v(T,"containedPath");async function _(e,r){let t=`${e}.${H()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,{flag:"wx"}),await p.rename(t,e)}v(_,"writeSwapJournal");async function b(e,r){await p.rm(e,{recursive:!0,force:!0}),await p.rename(r,e)}v(b,"restoreSource");export{Q as a,X as b,Y as c,Z as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{k as Y}from"./chunk-5EP2DZLJ.js";import{g as W,h as U}from"./chunk-6RS4NAOY.js";import{Nb as K,Pb as V,Qb as N,Y as v,_ as w,ka as q}from"./chunk-YNQWJWIC.js";import{V as z,W as B,Xb as j,f as _,k as M,l as $,la as G,ma as D,ta as F,ua as L}from"./chunk-ABF3W2MO.js";import{d as P}from"./chunk-J572ANHX.js";import{e as E,i as I}from"./chunk-NJLULBTM.js";import{i as x,l as C,n as u}from"./chunk-VVNV4NNW.js";import{a as c}from"./chunk-FTQLQJQV.js";import{constants as b}from"node:fs";import{lstat as oe,open as ne,readdir as ie}from"node:fs/promises";import S from"node:path";function pe(e){let t=N(e.taskset),{agentSnapshot:a,harnessRelease:s}=e.releasedHarness?{agentSnapshot:E.parse(e.releasedHarness.agentSnapshot),harnessRelease:I.parse(e.releasedHarness.harnessRelease)}:Q(e.taskset,e.profile);if(s.agentSnapshot.id!==a.id||s.agentSnapshot.contentHash!==a.contentHash)throw new Error("Released Harness does not bind the supplied Agent snapshot.");let d=V(e.taskset),n=e.taskset.tasks.length?e.taskset.tasks:e.selectedTask?[e.selectedTask]:[];if(!n.length)throw new Error("A portable Taskset release requires at least one resolved task.");let{environmentRelease:i,verifierSetRelease:o,tasksetRelease:l}=K({taskset:e.taskset,selectedTasks:n,adapterId:e.adapterId??A(e.taskset),admittedTasksetRelease:e.tasksetRelease,rewardExecution:e.rewardExecution}),R=e.now??(()=>new Date().toISOString()),f=M({schemaVersion:"openpond.runManifest.v1",id:`run-manifest-${u([s.contentHash,l.contentHash,e.model]).slice(0,24)}`,harnessRelease:{id:s.id,contentHash:s.contentHash},tasksetRelease:{id:l.id,contentHash:l.contentHash},model:{provider:e.model.providerId,model:e.model.modelId,revision:null,artifactHash:null,tokenizerRevision:null,chatTemplateHash:null},runtimeTarget:{adapterId:e.adapterId??A(e.taskset),placement:"local",runtimeVersion:"desktop-v1",capabilityReceipt:u({environment:d,tools:t,capabilities:e.taskset.capabilities})},limits:{maxTurns:128,timeoutMs:e.taskset.environment.defaultTimeoutMs,maxOutputBytes:25e7,maximumSpendUsd:null},approval:null,createdAt:R(),metadata:{sourceTasksetId:e.taskset.id,sourceTasksetRevision:e.taskset.revision,reasoningEffort:e.reasoningEffort??null}});return{agentSnapshot:a,harnessRelease:s,environmentRelease:i,verifierSetRelease:o,tasksetRelease:l,runManifest:f}}c(pe,"compileDesktopHarnessContext");function Q(e,t){let a=e.profileRelease?{id:e.profileRelease.id,contentHash:k(e.profileRelease.contentHash)}:t?.git?.head?{id:`source-${h(t.git.head)}`,contentHash:k(t.git.head)}:null;return Y({sourceRelease:a,profileHead:t?.git?.head??null,skills:se(t),agents:re(t)})}c(Q,"compileTemporaryProfileHarness");function ee(e){let t=e.artifacts.map(T),a=e.artifacts.find(n=>n.kind==="environment_state")??e.artifacts.find(n=>n.kind==="runtime_trace")??e.artifacts.find(n=>n.kind==="raw_model_response"),s=J(e.attempt,e.grade),d=e.grade.components.map(n=>({id:`grader-${h(n.graderId)}-${e.grade.id}`,contentHash:u(n),mediaType:"application/vnd.openpond.grader-evidence+json",sizeBytes:Buffer.byteLength(C(n))}));return _.parse($({schemaVersion:"openpond.attemptReceipt.v1",id:`receipt-${u([e.manifest.contentHash,e.attempt.id,e.grade.id]).slice(0,24)}`,runManifest:{id:e.manifest.id,contentHash:e.manifest.contentHash},taskId:e.attempt.taskId,seed:String(e.attempt.seed),terminal:!["infrastructure_failure","timeout","cancelled"].includes(s??""),failureClass:s,outputHash:e.attempt.infrastructureError?null:u(e.attempt.output),traceHash:a?k(a.sha256):u({attemptId:e.attempt.id,output:e.attempt.output,runtimeEventRefs:e.attempt.runtimeEventRefs,artifactRefs:e.attempt.artifactRefs,metadata:e.attempt.metadata}),artifactRefs:t,graderEvidenceRefs:d,startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,latencyMs:e.attempt.latencyMs,costUsd:e.attempt.costUsd,legacyAttemptRef:e.attempt.id,metadata:{legacyGradeRef:e.grade.id,rewardEligible:e.grade.rewardEligible,score:e.grade.score,passed:e.grade.passed,usage:e.attempt.metadata.usage??[]}}))}c(ee,"projectDesktopAttemptReceipt");function ue(e){let t=ee({manifest:e.context.runManifest,attempt:e.attempt,grade:e.grade,artifacts:e.artifacts}),a=e.context.tasksetRelease.tasks.find(r=>r.id===e.attempt.taskId);if(!a)throw new Error(`Task ${e.attempt.taskId} is absent from the admitted Taskset Release.`);let s=a.requiredOutputs??[],d=e.artifacts.filter(r=>r.kind==="output_artifact").map(r=>({path:typeof r.metadata.requiredOutputPath=="string"?r.metadata.requiredOutputPath:r.path,artifact:T(r),detectedMediaType:r.mediaType??null,status:"collected",parseStatus:X(r.metadata.parseStatus),schemaStatus:X(r.metadata.schemaStatus),evidenceRefs:[T(r)],metadata:{sourceArtifactId:r.id}})),n=F({id:`artifact-manifest-${t.id}`,attemptRef:{id:t.id,contentHash:t.contentHash},requiredOutputs:s,collectedArtifacts:d,createdAt:e.attempt.completedAt,metadata:{legacyAttemptRef:e.attempt.id}}),i=e.grade.components.map((r,O)=>te({component:r,grader:e.context.verifierSetRelease.graders.find(g=>g.id===r.graderId),evidenceRef:t.graderEvidenceRefs[O]??null,gradeScored:e.grade.score!==null,boundResult:e.grade.rewardComposition?.results.find(g=>g.graderId===r.graderId)})),o=L({requiredOutputs:s,manifest:n}),l=ae(e.attempt,e.grade),R=o.some(r=>r.status==="unscorable"&&r.failureOwner==="collector"),f=o.some(r=>r.status==="scored"&&!r.passed),p=l.outcomeClass==="completed"&&R?{outcomeClass:"collector_failure",failureOwner:"collector"}:l.outcomeClass==="completed"&&f?{outcomeClass:"incomplete_output",failureOwner:"policy"}:l,m=D({id:`reward-${u([t.contentHash,e.context.verifierSetRelease.contentHash,n.contentHash,e.grade.id]).slice(0,24)}`,attemptRef:{id:t.id,contentHash:t.contentHash},verifierSet:e.context.verifierSetRelease,artifactManifest:n,...p,components:[...i,...o],createdAt:e.grade.createdAt,metadata:{legacyGradeRef:e.grade.id,legacyAttemptRef:e.attempt.id,...e.grade.rewardComposition?{rewardComposition:e.grade.rewardComposition}:{}}});return{attemptReceipt:t,artifactManifest:n,rewardReceipt:m}}c(ue,"projectDesktopCanonicalReceipts");function Re(e){let t=e.artifacts.find(n=>n.kind==="runtime_trace")??e.artifacts.find(n=>n.kind==="raw_model_response"),a=t?T(t):{id:`trace-${e.canonical.attemptReceipt.id}`,contentHash:e.canonical.attemptReceipt.traceHash,mediaType:"application/vnd.openpond.attempt-trace+json",sizeBytes:null},s=e.canonical.rewardReceipt.outcomeClass==="task_deadline"||e.canonical.rewardReceipt.outcomeClass==="infrastructure_timeout",d=e.canonical.rewardReceipt.outcomeClass==="cancelled";return j({id:`rollout-${u([e.canonical.attemptReceipt.contentHash,e.canonical.rewardReceipt.contentHash,a.contentHash]).slice(0,24)}`,attemptReceipt:e.canonical.attemptReceipt,rewardReceipt:e.canonical.rewardReceipt,artifactManifestRef:{id:e.canonical.artifactManifest.id,contentHash:e.canonical.artifactManifest.contentHash},tasksetRelease:{id:e.context.tasksetRelease.id,contentHash:e.context.tasksetRelease.contentHash},environmentRelease:{id:e.context.environmentRelease.id,contentHash:e.context.environmentRelease.contentHash},harnessRelease:{id:e.context.harnessRelease.id,contentHash:e.context.harnessRelease.contentHash},taskId:e.attempt.taskId,split:e.attempt.split,model:e.context.runManifest.model,seed:String(e.attempt.seed),traceRef:a,optimizerSample:e.optimizerSample??null,environmentExecutions:[{id:`environment-execution-${e.attempt.id}`,environmentRelease:{id:e.context.environmentRelease.id,contentHash:e.context.environmentRelease.contentHash},status:d?"cancelled":s?"timed_out":e.canonical.rewardReceipt.status==="scored"?"completed":"failed",startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,traceRefs:[a],metadata:{legacyAttemptRef:e.attempt.id,runtimeEventCount:e.attempt.runtimeEventRefs.length}}],startedAt:e.attempt.startedAt,completedAt:e.attempt.completedAt,metadata:{source:"openpond.desktop-local-runtime",optimizerSamplePresent:!!e.optimizerSample}})}c(Re,"projectDesktopCanonicalRollout");function te(e){if(!e.grader)throw new Error(`Grade component ${e.component.graderId} has no admitted Verifier definition.`);let t=(e.boundResult?e.boundResult.status==="scored":e.gradeScored)?"scored":"unscorable",a=t==="scored"&&e.component.rewardEligible,s=e.evidenceRef?[e.evidenceRef]:[];return{verifierId:e.component.graderId,verifierVersion:e.component.graderVersion,status:t,rawScore:t==="scored"?e.boundResult?.rawScore??e.component.score:null,normalizedScore:t==="scored"?e.boundResult?.normalizedScore??e.component.score:null,weight:e.grader.weight,passed:e.component.passed,hardGate:e.component.hardGate,rewardEligible:a,rewardContribution:a?e.component.score:null,failureOwner:e.component.passed?null:t==="scored"?"policy":"verifier",feedback:e.component.feedback?[e.component.feedback]:[],visibleEvidenceRefs:e.grader.privileged?[]:s,privilegedEvidenceRefs:e.grader.privileged?s:[],metadata:{judge:e.component.judge??null,calibrationStatus:e.component.calibrationStatus,legacyEvidenceRefs:e.component.evidenceRefs}}}c(te,"portableRewardComponent");function ae(e,t){let a=B.safeParse(e.metadata.outcomeClass);if(a.success){let d=e.metadata.failureOwner===null?null:z.safeParse(e.metadata.failureOwner);if(d!==null&&!d.success)throw new Error("Attempt has an invalid explicit failure owner.");return{outcomeClass:a.data,failureOwner:d===null?null:d.data}}let s=J(e,t);return s?G({failureClass:s,timeoutKind:e.metadata.timeoutKind==="task_deadline"?"task_deadline":"infrastructure_timeout"}):t.score===null?{outcomeClass:"verifier_failure",failureOwner:"verifier"}:t.passed?{outcomeClass:"completed",failureOwner:null}:{outcomeClass:"policy_failure",failureOwner:"policy"}}c(ae,"canonicalOutcome");function X(e){return e==="passed"||e==="failed"?e:"not_requested"}c(X,"artifactValidationStatus");function se(e){return(e?.skills??[]).filter(t=>t.enabled).map(t=>({id:`skill-${h(t.name)}`,path:`skills/${h(t.name)}/SKILL.md`,contentHash:k(t.sourceHash),sizeBytes:Math.max(0,t.charCount),mediaType:"text/markdown",visibility:"policy"}))}c(se,"portableSkills");function re(e){let t=new Map;for(let a of e?.agents??[])a.enabled&&t.set(a.id,u({name:a.name,path:a.path}));return[...t].map(([a,s])=>({id:`agent-${h(a)}`,path:`agents/${h(a)}/release.json`,contentHash:k(s),sizeBytes:0,mediaType:"application/vnd.openpond.agent-release+json",visibility:"policy"}))}c(re,"portableAgents");function A(e){let t=e.environment.metadata.runtimeAdapterId;if(typeof t=="string"&&t.trim())return t.trim();let a=e.environment.metadata.benchmark;if(a&&typeof a=="object"&&!Array.isArray(a)){let s=Reflect.get(a,"id");if(typeof s=="string"&&s.trim())return`conformance:${s.trim()}`}return e.environment.kind==="work"?"openpond:desktop-work":e.environment.kind==="chat"?"openpond:desktop-text":`openpond:${h(e.environment.entrypoint)}`}c(A,"desktopTasksetRuntimeAdapterId");function T(e){return{id:e.id,contentHash:k(e.sha256),mediaType:e.mediaType??null,sizeBytes:e.sizeBytes}}c(T,"portableArtifact");function J(e,t){if(e.infrastructureError)return"infrastructure_failure";if(t.failureClass)return t.failureClass;let a=e.metadata.failureClass;return a==="policy_failure"||a==="grader_failure"||a==="environment_failure"||a==="infrastructure_failure"||a==="timeout"||a==="cancelled"?a:null}c(J,"attemptFailureClass");function k(e){return/^[a-f0-9]{64}$/.test(e)?e:u(e)}c(k,"hash");function h(e){return e.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"asset"}c(h,"segment");async function be(e,t){if(e.metadata.taskDefinition!==void 0||e.metadata.rewardBinding!==void 0)return{taskset:e,generatedFiles:[]};let a=await oe(t);if(!a.isDirectory()||a.isSymbolicLink())throw new Error("Taskset source must be a regular directory.");let s=new Map,d=0;async function n(i=""){for(let o of await ie(S.join(t,i),{withFileTypes:!0})){let l=S.posix.join(i,o.name);if(o.isSymbolicLink())throw new Error("Taskset files cannot contain symbolic links.");if(o.name.startsWith(".env"))throw new Error("Environment files cannot be included in a Taskset package.");if(o.isDirectory()){await n(l);continue}if(!o.isFile())throw new Error("Taskset packages require regular files.");if(W(l))continue;if(s.size>=1e4)throw new Error("Taskset source exceeds the file inventory limit.");let R=await ne(S.join(t,l),b.O_RDONLY|b.O_NOFOLLOW|b.O_NONBLOCK);try{let f=await R.stat();if(d+=f.size,!f.isFile()||d>w*3/4)throw new Error("Taskset source exceeds the package byte limit.");let p=Buffer.alloc(f.size),m=0;for(;m<p.length;){let r=await R.read(p,m,p.length-m,m);if(!r.bytesRead)throw new Error("Taskset source changed during capture.");m+=r.bytesRead}if((await R.read(Buffer.alloc(1),0,1,m)).bytesRead)throw new Error("Taskset source changed during capture.");s.set(l,p)}finally{await R.close()}}}return c(n,"visit"),await n(),U(e,s,A(e))}c(be,"prepareAuthoredTasksetFiles");import{constants as H}from"node:fs";import{open as ce,realpath as Z}from"node:fs/promises";import y from"node:path";function Me(e,t){return t?new Set:new Set([...(e.modelResources?.assets??[]).map(a=>a.asset.id),...(e.learningResources?.assets??[]).map(a=>a.asset.id),...e.learningResources?v(e.learningResources).map(a=>a.asset.id):[]])}c(Me,"tasksetPackageInlineAssetIds");async function $e(e){let t=e.sources.length?await Z(e.root):y.resolve(e.root),a=[],s=new Set,d=0,n=c((i,o)=>{if(s.has(i.id))throw new Error(`Duplicate local Taskset asset: ${i.id}.`);if(s.add(i.id),d+=4*Math.ceil(o.byteLength/3),d>w)throw new Error("Local Taskset files exceed the package envelope.");a.push({asset:i,base64:Buffer.from(o).toString("base64")})},"append");for(let i of e.sources){let o=x.parse(i.asset);if(!i.sourcePath||y.isAbsolute(i.sourcePath))throw new Error(`Taskset asset ${o.id} requires a relative source path.`);let l=y.resolve(t,i.sourcePath);if(!l.startsWith(`${t}${y.sep}`))throw new Error(`Taskset asset ${o.id} escapes its local package.`);if(!(await Z(l)).startsWith(`${t}${y.sep}`))throw new Error(`Taskset asset ${o.id} escapes its local package.`);let f=await ce(l,H.O_RDONLY|H.O_NOFOLLOW|H.O_NONBLOCK);try{let p=await f.stat();if(!p.isFile()||p.size!==o.sizeBytes)throw new Error(`Taskset asset ${o.id} differs from its immutable file size.`);if(4*Math.ceil(p.size/3)+d>w)throw new Error("Local Taskset files exceed the package envelope.");let m=Buffer.alloc(p.size),r=0;for(;r<m.length;){let g=await f.read(m,r,m.length-r,r);if(!g.bytesRead)throw new Error(`Taskset asset ${o.id} changed during capture.`);r+=g.bytesRead}if((await f.read(Buffer.alloc(1),0,1,r)).bytesRead)throw new Error(`Taskset asset ${o.id} changed during capture.`);n(o,m)}finally{await f.close()}}for(let i of[...e.content.modelResources?.assets??[],...e.content.learningResources?.assets??[]])s.has(i.asset.id)||n(i.asset,Buffer.from(P(i,i.asset),"utf8"));if(e.content.learningResources)for(let i of v(e.content.learningResources))s.has(i.asset.id)||n(i.asset,Buffer.from(i.base64,"base64"));if(e.fileOrder){if(new Set(e.fileOrder).size!==a.length||e.fileOrder.length!==a.length||e.fileOrder.some(o=>!s.has(o)))throw new Error("Saved package file order differs from its inventory.");let i=new Map(e.fileOrder.map((o,l)=>[o,l]));a.sort((o,l)=>i.get(o.asset.id)-i.get(l.asset.id))}return q({...e.content,files:a})}c($e,"captureLocalTasksetPackage");export{pe as a,ue as b,Re as c,A as d,be as e,Me as f,$e as g};
|