openpond 0.2.61 → 0.2.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-server.d.ts +3264 -18
- package/dist/app-server.js +1 -1
- package/dist/chunks/{acp-FUAWCKBH.js → acp-DYRBDJRU.js} +1 -1
- package/dist/chunks/{acp-agent-XBSJ27KI.js → acp-agent-UTLP7C3I.js} +1 -1
- package/dist/chunks/{actions-command-LOHNQUWP.js → actions-command-6LF4Z4WK.js} +1 -1
- package/dist/chunks/{app-layer-4BFMOMKM.js → app-layer-N2H3RBEN.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-Q2VWWJNX.js → app-server-connected-apps-3T546FE7.js} +1 -1
- package/dist/chunks/app-server-evaluations-TXD747QA.js +2 -0
- package/dist/chunks/{app-server-harness-services-2PSZBT7U.js → app-server-harness-services-BBCDV5P3.js} +1 -1
- package/dist/chunks/app-server-runtime-VEJPDAFP.js +2 -0
- package/dist/chunks/{apps-7PIBF32Q.js → apps-CTT2XYRR.js} +1 -1
- package/dist/chunks/{chunk-KK626T3Z.js → chunk-2EPR4HLF.js} +1 -1
- package/dist/chunks/{chunk-5VPU7OS7.js → chunk-2IIBCCOK.js} +1 -1
- package/dist/chunks/{chunk-ZISYLRH6.js → chunk-2UDAKLJ4.js} +1 -1
- package/dist/chunks/{chunk-BDCTN4PU.js → chunk-2V4LPUBH.js} +1 -1
- package/dist/chunks/{chunk-I3X6M6ZO.js → chunk-3R4MSE2S.js} +1 -1
- package/dist/chunks/{chunk-OFVUN4KI.js → chunk-47AXSBPV.js} +1 -1
- package/dist/chunks/{chunk-BFKYRQMA.js → chunk-4N4EH3RJ.js} +1 -1
- package/dist/chunks/chunk-4PZWGNX4.js +86 -0
- package/dist/chunks/{chunk-VFLSBDNZ.js → chunk-4RZBGKT7.js} +1 -1
- package/dist/chunks/{chunk-VBW2X42G.js → chunk-4TM75R7V.js} +1 -1
- package/dist/chunks/chunk-4U2FNXQW.js +2 -0
- package/dist/chunks/{chunk-SCCYSPQ5.js → chunk-4ZBOYWQ3.js} +1 -1
- package/dist/chunks/{chunk-VWJ5IYQP.js → chunk-547AUVKN.js} +1 -1
- package/dist/chunks/{chunk-FJ3HMHT6.js → chunk-557XSPVS.js} +1 -1
- package/dist/chunks/{chunk-ZHFH2TZN.js → chunk-557YG77L.js} +1 -1
- package/dist/chunks/{chunk-MF35MALN.js → chunk-5A6ER3M2.js} +1 -1
- package/dist/chunks/{chunk-U4HZD2GM.js → chunk-5OSM75X5.js} +1 -1
- package/dist/chunks/{chunk-TH6Y4K5Z.js → chunk-6SH4B7DV.js} +1 -1
- package/dist/chunks/chunk-6XSSM4WT.js +3 -0
- package/dist/chunks/{chunk-HN2ZK6EV.js → chunk-7JBB4PXS.js} +1 -1
- package/dist/chunks/{chunk-SID4X3YN.js → chunk-7JXZNCBC.js} +1 -1
- package/dist/chunks/chunk-7KTARW23.js +2 -0
- package/dist/chunks/{chunk-M6JRS5PA.js → chunk-ABF3W2MO.js} +1 -1
- package/dist/chunks/{chunk-CGAL7IHZ.js → chunk-AKZPMKWP.js} +1 -1
- package/dist/chunks/{chunk-SIV5P6JO.js → chunk-AMO5DVKM.js} +2 -2
- package/dist/chunks/chunk-AZ7BL5FL.js +2 -0
- package/dist/chunks/{chunk-4RHM4WN2.js → chunk-B42QQUZY.js} +1 -1
- package/dist/chunks/{chunk-3DVWJCOA.js → chunk-B4RKHHF7.js} +1 -1
- package/dist/chunks/{chunk-CQF6QZEL.js → chunk-BEI4YULC.js} +1 -1
- package/dist/chunks/chunk-BKEDG3A4.js +22 -0
- package/dist/chunks/{chunk-GEXKTGLY.js → chunk-C7M2WBWZ.js} +14 -14
- package/dist/chunks/{chunk-ELYRVTTG.js → chunk-CJUVHE4U.js} +1 -1
- package/dist/chunks/{chunk-ZUNG6YDO.js → chunk-EIX2V2KU.js} +1 -1
- package/dist/chunks/{chunk-AWPYTDH4.js → chunk-EWOTDVDJ.js} +1 -1
- package/dist/chunks/{chunk-B47JMAVW.js → chunk-F4TJ7WQV.js} +1 -1
- package/dist/chunks/{chunk-TXBIZDXG.js → chunk-F7D4BMTO.js} +1 -1
- package/dist/chunks/{chunk-BWY4D3BN.js → chunk-FFWOTZQM.js} +1 -1
- package/dist/chunks/{chunk-6RVF2J47.js → chunk-FUSCTBJI.js} +1 -1
- package/dist/chunks/{chunk-BN5AVRUG.js → chunk-GAQLXFOT.js} +1 -1
- package/dist/chunks/{chunk-LHENAWLH.js → chunk-GEKORCMN.js} +1 -1
- package/dist/chunks/{chunk-ORLJJGZZ.js → chunk-GNCEZ3UP.js} +1 -1
- package/dist/chunks/{chunk-WRQEYW3V.js → chunk-GOIKLFXK.js} +1 -1
- package/dist/chunks/{chunk-65SM7Y2G.js → chunk-GQGLPKU4.js} +1 -1
- package/dist/chunks/{chunk-LBBXVOVR.js → chunk-GSWBNJGZ.js} +1 -1
- package/dist/chunks/{chunk-7EAWLYYB.js → chunk-GV3LFSMI.js} +1 -1
- package/dist/chunks/{chunk-GQUS7MCH.js → chunk-GW5SE3FM.js} +1 -1
- package/dist/chunks/{chunk-I3W27VK4.js → chunk-HBLN4OLY.js} +1 -1
- package/dist/chunks/{chunk-SGK4GR44.js → chunk-HFJUXKT5.js} +1 -1
- package/dist/chunks/{chunk-4P3X2RXA.js → chunk-HKV7RX5E.js} +1 -1
- package/dist/chunks/{chunk-QDBYLJGH.js → chunk-HXZXDDKW.js} +1 -1
- package/dist/chunks/{chunk-LNRFRAV5.js → chunk-INO67SEN.js} +1 -1
- package/dist/chunks/{chunk-E67M5WGY.js → chunk-IWK3RTLR.js} +1 -1
- package/dist/chunks/{chunk-U447MS3Y.js → chunk-J3B2GM4A.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-D4JZALZ4.js → chunk-JIFUGA3U.js} +1 -1
- package/dist/chunks/{chunk-H2AUR7OT.js → chunk-JQRMDFF3.js} +1 -1
- package/dist/chunks/{chunk-FWIPHEVA.js → chunk-JX6OX6XE.js} +1 -1
- package/dist/chunks/{chunk-D5ADDBS5.js → chunk-JY3YSI54.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-LILXHGIA.js +2 -0
- package/dist/chunks/{chunk-MCIIGQT7.js → chunk-LJDBR3RN.js} +1 -1
- package/dist/chunks/{chunk-3TYCIYW6.js → chunk-LJPO3TEL.js} +1 -1
- package/dist/chunks/{chunk-MHYI7ATG.js → chunk-LRRBYIGH.js} +2 -2
- package/dist/chunks/{chunk-P4XM7LUT.js → chunk-M5IX6VUA.js} +1 -1
- package/dist/chunks/chunk-MEK7DLX3.js +2 -0
- package/dist/chunks/{chunk-TYHCBVQT.js → chunk-MILEWROZ.js} +1 -1
- package/dist/chunks/{chunk-ZBBVRYU3.js → chunk-MNFW5WLD.js} +1 -1
- package/dist/chunks/{chunk-2VXL6AU3.js → chunk-MNXNZDDW.js} +1 -1
- package/dist/chunks/chunk-N5GPINVP.js +2 -0
- package/dist/chunks/{chunk-TSAW2QVU.js → chunk-NBE74GLF.js} +1 -1
- package/dist/chunks/{chunk-VZXZ6CHS.js → chunk-NE4ESZPT.js} +1 -1
- package/dist/chunks/{chunk-CO3OJFPU.js → chunk-NKZNPTLA.js} +1 -1
- package/dist/chunks/{chunk-WFVOG5PU.js → chunk-NLQ2UPN2.js} +1 -1
- package/dist/chunks/chunk-NOSBNHGC.js +18 -0
- package/dist/chunks/{chunk-TTN63EAM.js → chunk-NWOK6NLE.js} +1 -1
- package/dist/chunks/{chunk-6MWT6BVU.js → chunk-NWQL6FNF.js} +1 -1
- package/dist/chunks/chunk-O3MHHGC5.js +151 -0
- package/dist/chunks/{chunk-IUGK6BBY.js → chunk-OCC43RSJ.js} +1 -1
- package/dist/chunks/{chunk-BQUWZRWU.js → chunk-P74RR2GB.js} +1 -1
- package/dist/chunks/{chunk-PAZDQRYU.js → chunk-PAE3PQEC.js} +1 -1
- package/dist/chunks/{chunk-M4ZRCRJM.js → chunk-PGO4FRHU.js} +2 -2
- package/dist/chunks/chunk-Q34IF4PW.js +2 -0
- package/dist/chunks/{chunk-Q324ZA5M.js → chunk-QAVQJZCM.js} +1 -1
- package/dist/chunks/{chunk-EIIGTADO.js → chunk-RBDUMASL.js} +1 -1
- package/dist/chunks/{chunk-TMMFF6DO.js → chunk-RH43WLBX.js} +1 -1
- package/dist/chunks/{chunk-RPOD6I64.js → chunk-RTJCELRR.js} +1 -1
- package/dist/chunks/{chunk-L3GA2CQI.js → chunk-SD64CLJX.js} +1 -1
- package/dist/chunks/{chunk-TNHDD3LO.js → chunk-SXMR6E2W.js} +1 -1
- package/dist/chunks/{chunk-MLTKB5G3.js → chunk-SZKFNKWO.js} +1 -1
- package/dist/chunks/chunk-T4QXKU5Y.js +1 -0
- package/dist/chunks/{chunk-PE7UKJXK.js → chunk-T6C5BNXK.js} +1 -1
- package/dist/chunks/{chunk-OMICIPPY.js → chunk-T6JN4PND.js} +1 -1
- package/dist/chunks/{chunk-OQUKSRU3.js → chunk-TGEGXTPR.js} +1 -1
- package/dist/chunks/chunk-TM4VEMNN.js +2 -0
- package/dist/chunks/chunk-TUCKED4T.js +4 -0
- package/dist/chunks/chunk-TVTFEGTU.js +2 -0
- package/dist/chunks/{chunk-HZLV773Y.js → chunk-TW3SRBLU.js} +1 -1
- package/dist/chunks/{chunk-BNZTJPK7.js → chunk-U456UP3N.js} +1 -1
- package/dist/chunks/chunk-UC3FXTDL.js +9 -0
- package/dist/chunks/{chunk-XLULTQLZ.js → chunk-UT6F6AIB.js} +1 -1
- package/dist/chunks/{chunk-OJFDI7VM.js → chunk-UTNGEMW5.js} +1 -1
- package/dist/chunks/{chunk-DW3GJRY3.js → chunk-VAJSRUAB.js} +1 -1
- package/dist/chunks/chunk-VE6ZIGUQ.js +2 -0
- package/dist/chunks/{chunk-GLVR74PX.js → chunk-VI32G77S.js} +1 -1
- package/dist/chunks/{chunk-ROE24PN5.js → chunk-VK4TPZTA.js} +1 -1
- package/dist/chunks/{chunk-Q66LWQGF.js → chunk-VSQXDS6H.js} +1 -1
- package/dist/chunks/{chunk-4GZ2FPB5.js → chunk-VWRTE64Y.js} +1 -1
- package/dist/chunks/{chunk-QRJPLZF7.js → chunk-W5W4IODW.js} +1 -1
- package/dist/chunks/{chunk-57RY3LSR.js → chunk-WGLVSGFA.js} +1 -1
- package/dist/chunks/{chunk-I7JCARVH.js → chunk-WQMXEZVE.js} +3 -3
- package/dist/chunks/chunk-X4ZT22SG.js +2 -0
- package/dist/chunks/{chunk-DGPGOBYZ.js → chunk-XSB3T4JZ.js} +1 -1
- package/dist/chunks/{chunk-ZZWAQBA2.js → chunk-XWDFXM3S.js} +1 -1
- package/dist/chunks/{chunk-4LZLO4OW.js → chunk-Y2KPHVZK.js} +1 -1
- package/dist/chunks/chunk-ZQHPGEYT.js +2 -0
- package/dist/chunks/{chunk-T4LLJC5N.js → chunk-ZXT7V64X.js} +1 -1
- package/dist/chunks/cli-GCSO2OAI.js +2 -0
- package/dist/chunks/{configuration-command-ONGI2BJD.js → configuration-command-BU2RPG33.js} +1 -1
- package/dist/chunks/connected-app-executor-UDE7U4KG.js +2 -0
- package/dist/chunks/{connected-evidence-4J3YXU4O.js → connected-evidence-GXIY2L7C.js} +1 -1
- package/dist/chunks/{connected-starting-assets-OXLT7S4O.js → connected-starting-assets-V5QXRK5Q.js} +1 -1
- package/dist/chunks/{connection-HJWE6SEW.js → connection-XMAAGMXJ.js} +1 -1
- package/dist/chunks/{continual-CJUZM5ZQ.js → continual-FLW6DAJK.js} +1 -1
- package/dist/chunks/{core-commands-JGXU6B4C.js → core-commands-NJ6TGND4.js} +1 -1
- package/dist/chunks/{dataset-preparation-authoring-DFGJBMVF.js → dataset-preparation-authoring-IUXUQK3L.js} +1 -1
- package/dist/chunks/{datasets-MNHZAZIB.js → datasets-AH56DKLZ.js} +1 -1
- package/dist/chunks/{desktop-test-P23MHAIG.js → desktop-test-PYUTEOWO.js} +1 -1
- package/dist/chunks/{dist-IIFTZWNR.js → dist-5267UT3V.js} +1 -1
- package/dist/chunks/{dist-X64FC6NA.js → dist-HSC43RG4.js} +1 -1
- package/dist/chunks/{evaluation-coordination-6NQEH5WU.js → evaluation-coordination-3AUICOC5.js} +1 -1
- package/dist/chunks/{experiment-improvements-M27Z5OF4.js → experiment-improvements-YS7GGPDW.js} +1 -1
- package/dist/chunks/experiments-EJZK7FPT.js +2 -0
- package/dist/chunks/{experiments-signal-R3NNH7WR.js → experiments-signal-NKUIJCIY.js} +1 -1
- package/dist/chunks/{extension-C33NUFDL.js → extension-ZM6NI5O5.js} +1 -1
- package/dist/chunks/{help-M2VQGPVC.js → help-PXUUREHZ.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-CTC5JQPD.js +2 -0
- package/dist/chunks/host-profile-external-dataset-GJWDY3YT.js +2 -0
- package/dist/chunks/hosted-app-server-composition-TLJSKMJT.js +2 -0
- package/dist/chunks/hosted-experiment-improvement-TIVXXRPG.js +3 -0
- package/dist/chunks/hosted-harness-runtime-SFLJEZFI.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-37ZFY2LH.js → hosted-profile-candidate-DKEMVIYG.js} +1 -1
- package/dist/chunks/hosted-profile-compiler-V6YR6EHO.js +2 -0
- package/dist/chunks/{hosted-profile-evaluation-control-UQBMML6K.js → hosted-profile-evaluation-control-ERCXAPZD.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-YASS4T6L.js → hosted-profile-evaluation-inspection-Q3AIIIB6.js} +1 -1
- package/dist/chunks/hosted-profile-evaluation-preparation-ELLGH44Z.js +3 -0
- package/dist/chunks/{hosted-tasksets-CVUP7MS6.js → hosted-tasksets-X2YCFYEJ.js} +1 -1
- package/dist/chunks/{human-review-IJETDOWB.js → human-review-5WM6MSON.js} +1 -1
- package/dist/chunks/{import-WLLUIDS6.js → import-JWZSZCE4.js} +1 -1
- package/dist/chunks/local-harness-improvement-runtime-IGIKM6GJ.js +2 -0
- package/dist/chunks/local-harness-taskset-review-DR2ZIDOH.js +2 -0
- package/dist/chunks/{model-projects-AVBQDNYG.js → model-projects-H22KENI4.js} +1 -1
- package/dist/chunks/opchat-3S6TSDZO.js +3 -0
- package/dist/chunks/opchat-bounded-chat-B7LPCD4U.js +2 -0
- package/dist/chunks/{organizations-DJRJWC5I.js → organizations-62YNTZTO.js} +1 -1
- package/dist/chunks/{profile-JRS3JNRC.js → profile-ELE2D7HU.js} +1 -1
- package/dist/chunks/project-action-payload-32F4X2BB.js +2 -0
- package/dist/chunks/{project-agent-2KNJFNZI.js → project-agent-O4REKO6T.js} +1 -1
- package/dist/chunks/{published-experiment-source-LFYHKFAO.js → published-experiment-source-DAOTJLIN.js} +1 -1
- package/dist/chunks/refiner-profile-service-DYMZ7J3X.js +2 -0
- package/dist/chunks/{runtime-CBJF5GMB.js → runtime-776NUSE7.js} +2 -2
- package/dist/chunks/{sandbox-command-IIGTPYN3.js → sandbox-command-UQ26NDIX.js} +1 -1
- package/dist/chunks/{sandbox-template-FTANKQIA.js → sandbox-template-WP6YCGBK.js} +1 -1
- package/dist/chunks/saved-work-PG52WCRQ.js +2 -0
- package/dist/chunks/{send-turn-5UB7ZBJV.js → send-turn-RPB65PME.js} +1 -1
- package/dist/chunks/{src-4YZF6L6H.js → src-2R4CMCJ5.js} +1 -1
- package/dist/chunks/src-AU6LG7E6.js +421 -0
- package/dist/chunks/standalone-experiment-turn-owner-SD3SUTKX.js +2 -0
- package/dist/chunks/{store-chat-resources-CGW7PDCG.js → store-chat-resources-T4LR7K25.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-GWI2FRII.js → store-continual-support-reviews-R62D2HD6.js} +1 -1
- package/dist/chunks/{store-conversation-serving-637AHKBP.js → store-conversation-serving-25O7BAR2.js} +1 -1
- package/dist/chunks/{store-create-improve-ZG653Z63.js → store-create-improve-T5E2GUKK.js} +1 -1
- package/dist/chunks/{store-datasets-IW6F2QZM.js → store-datasets-5Y4U5L3R.js} +1 -1
- package/dist/chunks/{store-evaluation-results-V5J6L4NV.js → store-evaluation-results-WUVJWCFU.js} +1 -1
- package/dist/chunks/{store-harness-workspaces-HHMM6GNK.js → store-harness-workspaces-IFEFY5CK.js} +1 -1
- package/dist/chunks/{store-human-review-V5H4QDHR.js → store-human-review-ZQNLZRGG.js} +1 -1
- package/dist/chunks/store-learned-preference-migration-validation-UH6MJQSH.js +2 -0
- package/dist/chunks/{store-local-experiments-A2UWYPVQ.js → store-local-experiments-LOH4F4TF.js} +1 -1
- package/dist/chunks/{store-model-batch-review-KMYPYWJR.js → store-model-batch-review-QO4VVKWC.js} +1 -1
- package/dist/chunks/{store-model-configuration-UXNC4PGY.js → store-model-configuration-C3HSOFD5.js} +1 -1
- package/dist/chunks/store-model-project-preparation-RQ2YTC2Y.js +2 -0
- package/dist/chunks/{store-preference-comparison-HTOXLWKF.js → store-preference-comparison-RNIFLJRW.js} +1 -1
- package/dist/chunks/{store-schedules-QVWT7AEB.js → store-schedules-DVQ2PP4F.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-G5Z6NZWL.js → store-sidebar-file-bookmarks-LXWFFYCZ.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-27FFMUWU.js → store-sidebar-preferences-4HH7LX6N.js} +1 -1
- package/dist/chunks/{store-subagents-PK7ZWLPR.js → store-subagents-JLW4GD4Q.js} +1 -1
- package/dist/chunks/{store-task-inbox-LNDCZOYE.js → store-task-inbox-DL5RYFPO.js} +1 -1
- package/dist/chunks/{store-task-inventory-IG6HGWSQ.js → store-task-inventory-NJXRXFLC.js} +1 -1
- package/dist/chunks/store-taskset-drafts-UFGN4SGF.js +9 -0
- package/dist/chunks/{store-training-NQRRPKEZ.js → store-training-VRLU6NFX.js} +1 -1
- package/dist/chunks/{store-training-jobs-F6Y2ZTXP.js → store-training-jobs-3ZHG4LGI.js} +1 -1
- package/dist/chunks/{store-training-models-NRSLSBEW.js → store-training-models-KWQD5PRP.js} +1 -1
- package/dist/chunks/{store-usage-GFHQYT34.js → store-usage-ZRS3ILF2.js} +1 -1
- package/dist/chunks/{taskset-NYLUYX6K.js → taskset-QDMCQQDJ.js} +1 -1
- package/dist/chunks/{taskset-packages-I7I5KBFP.js → taskset-packages-CBLJFWDQ.js} +1 -1
- package/dist/chunks/{teams-bot-FMAEDGSD.js → teams-bot-GF272RGC.js} +1 -1
- package/dist/chunks/{training-UBX6E7SK.js → training-DF5UEPY3.js} +1 -1
- package/dist/chunks/{training-error-AYOGHHL2.js → training-error-L5V5IBX3.js} +1 -1
- package/dist/chunks/training-hosted-I2NDBYGS.js +2 -0
- package/dist/chunks/training-hosted-report-4F25RZZ4.js +2 -0
- package/dist/chunks/training-hosted-serving-QAV7ZGGV.js +2 -0
- package/dist/chunks/training-project-preparation-XWGRY5ME.js +3 -0
- package/dist/chunks/{web-search-Q4OQVUNH.js → web-search-5RUXYIOF.js} +1 -1
- package/dist/chunks/{workspaces-XREEVSTS.js → workspaces-JRY2IE7H.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/skills/openpond-cli/SKILL.md +15 -2
- 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 +155 -10
- 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-DHJVXTI2.js +54 -0
- package/dist/web/assets/App-DpFKLxuA.css +1 -0
- package/dist/web/assets/AppDialog-BurL61qE.js +1 -0
- package/dist/web/assets/AppTerminalPanel-RjFlF-a4.js +2 -0
- package/dist/web/assets/{AppToastContext-BB_2hRfw.js → AppToastContext-DZLErwj0.js} +1 -1
- package/dist/web/assets/AppsView-ttlr9ckQ.js +1 -0
- package/dist/web/assets/{AttachmentTypeIcon-DOAsVQjt.js → AttachmentTypeIcon-CpMSfHCK.js} +1 -1
- package/dist/web/assets/BrowserSidebar-Cp2l0kg0.js +1 -0
- package/dist/web/assets/{CartesianChart-DO76yfJb.js → CartesianChart-CEbM980A.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-IKzZsHoI.js → ChatTimelineEntry-BITv20Ze.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-DNoknVMD.js → CollaborationTabs-DrKJmJZK.js} +1 -1
- package/dist/web/assets/{CommandMenu-CBY2AJxV.js → CommandMenu-6oj8FUr6.js} +1 -1
- package/dist/web/assets/CommunityView-BzpIq1lD.js +1 -0
- package/dist/web/assets/ComposerAttachments-6en7m_ov.js +2 -0
- package/dist/web/assets/ComposerCreateImproveStrip-ChplO9YP.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-DRHgc7j_.js +1 -0
- package/dist/web/assets/FilePagePreview-CW4J_1u7.js +2 -0
- package/dist/web/assets/GetStartedView-CaBk_mX6.js +1 -0
- package/dist/web/assets/GettingStartedDialog-EsH-8Diz.css +1 -0
- package/dist/web/assets/GettingStartedDialog-JtFLyU3F.js +1 -0
- package/dist/web/assets/{HostedModelLearningReview-B0rbIVvn.js → HostedModelLearningReview-hhcjDifK.js} +1 -1
- package/dist/web/assets/HostedModelLearningSettings-CY8198Y1.js +1 -0
- package/dist/web/assets/LabModelVersionDetailPage-f0tHT-Sn.js +1 -0
- package/dist/web/assets/LabSkillSidebar-HibUEEko.js +1 -0
- package/dist/web/assets/{LabsRoute-DOnw39du.js → LabsRoute-B61l1b8P.js} +8 -8
- package/dist/web/assets/MainChatThread-egKi0gLk.js +2 -0
- package/dist/web/assets/MainPane-2dj6Dg4l.js +95 -0
- package/dist/web/assets/{MainPane-CuBUBA9F.css → MainPane-BwHw3UYp.css} +1 -1
- package/dist/web/assets/NativeSetupTerminal-3eR9D_R3.css +1 -0
- package/dist/web/assets/NativeSetupTerminal-CNHTByLo.js +2 -0
- package/dist/web/assets/NativeSkillSidebar-DCdMbSfe.js +1 -0
- package/dist/web/assets/NewProjectDialog-t9Imnb__.js +1 -0
- package/dist/web/assets/OutputsPage-CeGq_F1S.js +1 -0
- package/dist/web/assets/{PageChrome-BBnWAENV.js → PageChrome-VHME5V8j.js} +1 -1
- package/dist/web/assets/ProjectsPage-2TMZoEPB.js +1 -0
- package/dist/web/assets/RightChatPanelStack-B3mBViGC.js +1 -0
- package/dist/web/assets/RightSidebarHomePanel-CxDYSyyx.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-Dh47iH11.js +1 -0
- package/dist/web/assets/SettingsView-D2bu3tK_.js +5 -0
- package/dist/web/assets/TeamChatView-CN17AsgA.js +1 -0
- package/dist/web/assets/TerminalOverlay-DlhRpi-X.js +16 -0
- package/dist/web/assets/TrainingCreationPanel-DJKzaNFj.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-HznyNCJ4.js → TrainingDraftPanel-BhhZPPuY.js} +1 -1
- package/dist/web/assets/{TrainingMetricWorkbench-BmzHLwIP.js → TrainingMetricWorkbench-DBy8F1xp.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-C3oZ1UEP.js → UsageSettingsSection-DTZslBeW.js} +2 -2
- package/dist/web/assets/WorkSidebarPanel-Ds-eTQLs.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-D_iyg2D4.js +11 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-Fn-NlfMQ.js +35 -0
- package/dist/web/assets/WorkspaceFileLocation-ChEeZffU.js +1 -0
- package/dist/web/assets/WorkspaceGitDialogs-D_RUXhTi.js +1 -0
- package/dist/web/assets/{WorkspaceMonacoEditor-DfsL1WIi.js → WorkspaceMonacoEditor-BJxaiDrj.js} +3 -3
- package/dist/web/assets/{WorkspacePresentationPreview-WuS_B45u.js → WorkspacePresentationPreview-A28Poeca.js} +1 -1
- package/dist/web/assets/{chat-resources-CItQ4mZD.js → chat-resources-3SvnVeKv.js} +1 -1
- package/dist/web/assets/{chevron-down-Bnma8EMP.js → chevron-down-dYn0pd4Q.js} +1 -1
- package/dist/web/assets/chevron-right-sFx2xRvT.js +1 -0
- package/dist/web/assets/{chunk-24N6A6SF-BUjzKvRC.js → chunk-BYNVSWIQ-DWh9SmdB.js} +1 -1
- package/dist/web/assets/{chunk-GAIDBPFY-BLuHpurI.js → chunk-ZFYI4P6C-BmsNtSkR.js} +1 -1
- package/dist/web/assets/{client-choice-storage-BuNdhYSV.js → client-choice-storage-DTTLbrYt.js} +1 -1
- package/dist/web/assets/{cloud-upload-DOftANif.js → cloud-upload-CRMPCFnq.js} +1 -1
- package/dist/web/assets/connected-app-mentions-D3wRZLwI.js +1 -0
- package/dist/web/assets/copy-DR4ielPn.js +1 -0
- package/dist/web/assets/{createLucideIcon-C4b2afqG.js → createLucideIcon-DmttVQ_a.js} +1 -1
- package/dist/web/assets/{cssMode-0Hn7tCrE.js → cssMode-d-2GuNvW.js} +1 -1
- package/dist/web/assets/external-link-B4rPiZEp.js +1 -0
- package/dist/web/assets/{folder-open-wJwCoIDs.js → folder-open-BrIUcUk_.js} +1 -1
- package/dist/web/assets/{folder-plus-DnTN6mcP.js → folder-plus-DwImGEt-.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-98y7PP6G.js → git-commit-horizontal-Ds1mkrlW.js} +1 -1
- package/dist/web/assets/{htmlMode-JO_QluNH.js → htmlMode-s15GR0Fn.js} +1 -1
- package/dist/web/assets/icons-CK5-nxVC.js +1 -0
- package/dist/web/assets/{image-C7HVlg3X.js → image-CY-sHbfQ.js} +1 -1
- package/dist/web/assets/{index-BsPUniZy.js → index-DYrLeSyY.js} +2 -2
- package/dist/web/assets/index-Dezj4Z2p.css +1 -0
- package/dist/web/assets/{info-BLWDShaz.js → info-aSvM8YlJ.js} +1 -1
- package/dist/web/assets/{jsonMode-BfTXJted.js → jsonMode-vos9H2hz.js} +1 -1
- package/dist/web/assets/loader-circle-cyf35w3i.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-68cAgnuv.js → lspLanguageFeatures-pQmEaoMt.js} +1 -1
- package/dist/web/assets/{maximize-2-DUWvLap6.js → maximize-2-DgF6ZVOM.js} +1 -1
- package/dist/web/assets/{monaco.contribution-_3aU1TTb.js → monaco.contribution-BPwsKvRB.js} +2 -2
- package/dist/web/assets/{monaco.contribution-h8U8HXFT.js → monaco.contribution-BbMpa0_-.js} +2 -2
- package/dist/web/assets/{monaco.contribution-CWeY6ia1.js → monaco.contribution-CJlccVX3.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DOiiDDen.js → monaco.contribution-pWurLXbm.js} +2 -2
- package/dist/web/assets/{monitor-B6OuAu13.js → monitor-DlEV241C.js} +1 -1
- package/dist/web/assets/{paperclip-DSHxP9CY.js → paperclip-fnRZSIRc.js} +1 -1
- package/dist/web/assets/{pdf-RXlFwNte.js → pdf-CT3zVKCE.js} +1 -1
- package/dist/web/assets/play-wI_3FLr4.js +1 -0
- package/dist/web/assets/plus-DoJe4fLj.js +1 -0
- package/dist/web/assets/{presentation-C9WnPDVr.js → presentation-Bb8ecExR.js} +1 -1
- package/dist/web/assets/profile-agent-labels-Duh96b8x.js +1 -0
- package/dist/web/assets/{python-BQXo7wMt.js → python-DXA1xp0A.js} +1 -1
- package/dist/web/assets/{refresh-cw-NXOER_CD.js → refresh-cw-B53QjxMO.js} +1 -1
- package/dist/web/assets/{save-BxXc21N6.js → save-V1Q4Fcqa.js} +1 -1
- package/dist/web/assets/settings-lists-CtH1A57b.js +5 -0
- package/dist/web/assets/square-BqSK-hv9.js +1 -0
- package/dist/web/assets/square-terminal-Dmgkm5zY.js +1 -0
- package/dist/web/assets/submit-issue-command-DRgUboVW.js +3 -0
- package/dist/web/assets/{toggleHighContrast-Di1cRuQ4.js → toggleHighContrast-B-BD2K2Q.js} +1 -1
- package/dist/web/assets/{training-managed-adapter-81RrdT1k.js → training-managed-adapter-BXNwgd3P.js} +1 -1
- package/dist/web/assets/{training-model-data-CmVo80ZR.js → training-model-data-14942K_Z.js} +5 -5
- package/dist/web/assets/{tsMode-PxisJRYB.js → tsMode-DdgIcxK3.js} +1 -1
- package/dist/web/assets/ui-theme.generated-D-mc26qt.js +144 -0
- package/dist/web/assets/{upload-NXasN1wU.js → upload-82Y6RjLi.js} +1 -1
- package/dist/web/assets/{useAccountSettings-Dqqt1vUY.js → useAccountSettings-BgHXNpq_.js} +1 -1
- package/dist/web/assets/{useAgentInventory-BV4CUWzJ.js → useAgentInventory-B-LNn3up.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-Cc0M_qax.js → useLocalAgentSchedules-CsKv22Hs.js} +1 -1
- package/dist/web/assets/{useQuery-ByaRC9SK.js → useQuery-CPC2wsWm.js} +1 -1
- package/dist/web/assets/{wifi-off-aVJ3AvT_.js → wifi-off-DXOoDN9l.js} +1 -1
- package/dist/web/assets/{workers-u92Boudu.js → workers-Clf4hKt5.js} +1 -1
- package/dist/web/assets/x-IPhrr4ju.js +1 -0
- package/dist/web/assets/{yaml-BxQUS0ew.js → yaml-I1tf8Uxx.js} +1 -1
- package/dist/web/index.html +12 -3
- package/docs/command-reference.md +28 -2
- package/package.json +2 -1
- package/dist/chunks/app-server-evaluations-HAAYVEXB.js +0 -2
- package/dist/chunks/app-server-runtime-B6BAJA6L.js +0 -2
- package/dist/chunks/chunk-4N3UF3U5.js +0 -2
- package/dist/chunks/chunk-6DCXAXVD.js +0 -22
- package/dist/chunks/chunk-BLKTUFGB.js +0 -2
- package/dist/chunks/chunk-E3EKBPCB.js +0 -2
- package/dist/chunks/chunk-F5JDBDYL.js +0 -2
- package/dist/chunks/chunk-JEVA7YQL.js +0 -3
- package/dist/chunks/chunk-KC7I6E6W.js +0 -2
- package/dist/chunks/chunk-OJSK4NSW.js +0 -151
- 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-X3WEQL3O.js +0 -2
- package/dist/chunks/chunk-XK7SPL63.js +0 -2
- package/dist/chunks/chunk-YR5ID2SS.js +0 -2
- package/dist/chunks/cli-WC45SI7E.js +0 -2
- package/dist/chunks/connected-app-executor-TZJB25UZ.js +0 -2
- package/dist/chunks/experiments-IWSCFDBB.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-compiler-SW2RWTDZ.js +0 -2
- package/dist/chunks/hosted-profile-evaluation-preparation-ZAOGDQXO.js +0 -3
- 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/opchat-KSOJEL4W.js +0 -3
- package/dist/chunks/project-action-payload-SQ5BSQHY.js +0 -2
- package/dist/chunks/refiner-profile-service-UWI4NAZ3.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-learned-preference-migration-validation-KOCW5NOZ.js +0 -2
- package/dist/chunks/store-taskset-drafts-TA6X245D.js +0 -9
- package/dist/chunks/training-hosted-4R4QTSAN.js +0 -2
- package/dist/chunks/training-hosted-report-UQVK6FTG.js +0 -2
- 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/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/MainChatThread-BUKup-JB.js +0 -2
- package/dist/web/assets/MainPane-BpE7AKXu.js +0 -92
- 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/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/chevron-right-Cxv_xBz5.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-lists-DMNPkGYk.js +0 -5
- package/dist/web/assets/square-Da8RuqW4.js +0 -1
- package/dist/web/assets/ui-theme.generated-R0MY_Jy0.js +0 -136
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{Ca as I,Da as H,Ra as d,Sa as r,Ta as j,Ua as m,Za as p,ea as s}from"./chunk-
|
|
2
|
+
import{Ca as I,Da as H,Ra as d,Sa as r,Ta as j,Ua as m,Za as p,ea as s}from"./chunk-PGO4FRHU.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{d as c}from"./chunk-
|
|
2
|
+
import{d as c}from"./chunk-557XSPVS.js";import{a as m}from"./chunk-DMFUEUAZ.js";import{n as p}from"./chunk-JY3YSI54.js";import{I as i,L as d}from"./chunk-BKEDG3A4.js";import{a as n}from"./chunk-FTQLQJQV.js";async function r(e,o){return(await e.allPayloadRows(`SELECT payload FROM ${o} ORDER BY sort_index ASC`)).map(t=>JSON.parse(t.payload))}n(r,"readStorePayloads");function S(e){let o=e,a=d.safeParse(o.openPondCommandAccessMode);return{...o,experience:l(o),openPondCommandAccessMode:a.success?a.data:i,currentProfile:o.currentProfile??null}}n(S,"normalizeSessionPayload");function l(e){let o=p.safeParse(e.experience);return o.success?o.data:!!(e.provider==="codex"||e.codexThreadId||e.systemKind||e.parentSessionId||e.subagentRunId||e.appId||e.workspaceKind||e.workspaceId||e.localProjectId||e.cloudProjectId)?"development":"chat"}n(l,"storedSessionExperience");async function E(e){return{sessions:(await r(e,"sessions")).map(S),turns:await r(e,"turns"),approvals:await r(e,"approvals")}}n(E,"readStoreMetadata");async function T(e){return{...await E(e),events:(await r(e,"events")).map(m)}}n(T,"readStoreData");async function D(e,o){let a=c();await o.exec("BEGIN IMMEDIATE");try{await o.exec("DELETE FROM approvals; DELETE FROM events; DELETE FROM turns; DELETE FROM sessions;");for(let[t,s]of e.sessions.entries())await o.run("INSERT INTO sessions (id, sort_index, payload, updated_at) VALUES (?, ?, ?, ?)",[s.id,t,JSON.stringify(s),s.updatedAt]);for(let[t,s]of e.turns.entries())await o.run("INSERT INTO turns (id, session_id, provider_turn_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.providerTurnId,s.status,t,JSON.stringify(s),s.completedAt??s.startedAt]);for(let[t,s]of e.events.entries()){let u=t+1;await o.run("INSERT INTO events (id, session_id, turn_id, name, timestamp, sequence, sort_index, payload) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",[s.id,s.sessionId??null,s.turnId??null,s.name,s.timestamp,u,t,JSON.stringify(s)])}for(let[t,s]of e.approvals.entries())await o.run("INSERT INTO approvals (id, session_id, status, sort_index, payload, updated_at) VALUES (?, ?, ?, ?, ?, ?)",[s.id,s.sessionId,s.status,t,JSON.stringify(s),a]);await o.exec("COMMIT")}catch(t){throw await o.exec("ROLLBACK"),t}}n(D,"persistStoreData");export{S as a,E as b,T as c,D as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as l,s as b}from"./chunk-
|
|
2
|
+
import{a as l,s as b}from"./chunk-TW3SRBLU.js";import{m as h}from"./chunk-VNJAAYNQ.js";import{e as u,f as I}from"./chunk-YBNKGA5C.js";import{c as m,d as f,f as v}from"./chunk-LV3CQ72P.js";import{A as e}from"./chunk-PF56N7ZY.js";import{a as g}from"./chunk-FTQLQJQV.js";var t=e.string().trim().min(1).max(500),n=e.string().regex(/^[a-f0-9]{64}$/),P=e.object({teamId:t,ownerUserId:t}).strict(),S=e.object({id:t,snapshotHash:n,boundaryId:t,boundaryRevisionHash:n}).strict(),E=e.object({sourceId:t,source:f,sessionId:t,snapshotHash:n,title:e.string().max(500),projectId:t.nullable(),capturedAt:e.string().datetime(),boundaries:e.array(v.omit({start:!0,end:!0})).max(m.boundaries)}).strict(),T=e.object({operationId:t,conversationId:t.optional(),cursor:t.optional(),limit:e.number().int().min(1).max(50).default(20)}).strict(),x=e.object({hash:n,parts:e.number().int().min(1).max(1500)}).strict(),U=x.extend({index:e.number().int().nonnegative().max(1499),base64:e.string().max(35e4)}).strict(),q=e.object({path:e.string().min(1).max(500),encoding:e.enum(["utf8","zstd"]),base64:e.string()}).strict(),w=e.object({upload:x,source:e.enum(["codex","claude_code","hermes","openclaw","opencode","grok_build","pi","oh_my_pi"]),branchLeafId:t.optional(),acquisition:e.object({machineId:t,sourceInstanceId:t}).strict().optional(),destination:e.discriminatedUnion("kind",[e.object({kind:e.literal("existing"),projectId:t}).strict(),e.object({kind:e.literal("new"),name:e.string().trim().min(1).max(200)}).strict()])}).strict(),V=w.extend({operationId:t,previewHash:n,selection:e.array(e.object({sessionHash:n,boundaryIds:e.array(t).min(1).max(m.boundaries)}).strict()).min(1).max(m.sessions)}).strict(),y=e.object({from:e.string().datetime(),to:e.string().datetime(),projectId:t.optional()}).strict(),_=e.object({teamId:t,range:y,activity:e.object({conversations:e.number().int().nonnegative(),turns:e.number().int().nonnegative(),chatTurns:e.number().int().nonnegative(),workTurns:e.number().int().nonnegative()}).strict(),accounting:e.object({contextSnapshots:e.number().int().nonnegative()}).strict(),usage:I}).strict(),r=e.string().trim().min(1).max(240),c=e.string().regex(/^[a-f0-9]{64}$/),L=e.object({cursor:e.string().trim().min(1).max(2e3).optional(),projectId:r.optional(),search:e.string().trim().max(100).optional(),sort:e.enum(["id","name","updated"]).default("id"),limit:e.number().int().min(1).max(100).default(100)}).strict(),B=e.object({operationId:r,expectedRevision:e.number().int().nonnegative(),originProjectId:r.optional(),workspace:b,ownerScope:e.enum(["workspace","personal"]).optional()}).strict().superRefine((a,s)=>{a.workspace.draft.modelScope!==null&&s.addIssue({code:"custom",message:"Independent datasets cannot carry Model-owned draft preparation."}),a.workspace.draft.status!=="draft"&&s.addIssue({code:"custom",message:"Only draft workspaces can be saved."})}),j=e.object({schemaVersion:e.literal("openpond.datasetWorkspaceReceipt.v1"),teamId:r,datasetId:r,revision:e.number().int().positive(),originProjectId:r.optional(),workspace:b,ownerScope:e.enum(["workspace","personal"]).optional(),publication:e.object({tasksetId:r,release:l,packageHash:c}).strict().nullable()}).strict().superRefine((a,s)=>{(a.workspace.draft.id!==a.datasetId||a.workspace.draft.profileId!==a.teamId||a.workspace.draft.revision!==a.revision||a.workspace.draft.modelScope!==null)&&s.addIssue({code:"custom",message:"Dataset workspace scope/revision mismatch."})}),N=e.object({operationId:r,expectedRevision:e.number().int().positive(),workspaceHash:c,packageHash:c}).strict(),O=e.object({operationId:r,expectedRevision:e.number().int().positive()}).strict(),Q=e.object({teamId:r,datasetId:r,items:e.array(e.object({workspaceRevision:e.number().int().positive(),publication:j.shape.publication.unwrap(),publishedAt:e.iso.datetime()}).strict()).max(25),nextBeforeRevision:e.number().int().positive().nullable()}).strict(),F=e.object({teamId:r,datasets:e.array(e.object({id:r,revision:e.number().int().positive(),originProjectId:r.optional(),name:e.string(),status:e.enum(["draft","published"]),ownerScope:e.enum(["workspace","personal"]).optional(),taskCount:e.number().int().nonnegative().optional(),publication:j.shape.publication,updatedAt:e.string().datetime()}).strict()).max(100),nextCursor:e.string().trim().min(1).max(2e3).nullable()}).strict(),M=e.object({teamId:r,datasetId:r,revision:e.number().int().positive(),workspaceHash:c,packageHash:c,release:l}).strict(),i=e.string().trim().min(1).max(240),o=e.string().regex(/^[a-f0-9]{64}$/),K=e.object({operationId:i,source:S,proofs:e.array(u).min(1).max(100)}).strict().superRefine((a,s)=>{new Set(a.proofs.map(d=>d.path)).size!==a.proofs.length&&s.addIssue({code:"custom",message:"Select each starting path once."}),new TextEncoder().encode(JSON.stringify(a)).byteLength>15*1024*1024&&s.addIssue({code:"custom",message:"Starting assets exceed the retained upload allowance."})}),C=e.object({path:u.shape.path,commitHash:e.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),gitObjectHash:e.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),mode:e.enum(["100644","100755"]),sizeBytes:e.number().int().nonnegative().max(2*1024*1024),sha256:o}).strict(),H=e.object({schemaVersion:e.literal("openpond.connectedStartingAssetsReceipt.v1"),id:i,operationId:i,teamId:i,ownerUserId:i,projectId:i,requestHash:o,source:S,inputHash:o,observationHash:o,assets:e.array(C).min(1).max(100),selectedPathsUnmodified:e.literal(!0),dependencyClosureQualified:e.literal(!1),createdAt:e.iso.datetime(),receiptHash:o}).strict();function X(a){let s=H.parse(a),{receiptHash:d,...k}=s;if(h(k)!==d||s.id!==`starting-assets-${h(s.operationId).slice(0,40)}`||new Set(s.assets.map(p=>p.path)).size!==s.assets.length||s.assets.some(p=>p.commitHash!==s.assets[0].commitHash))throw new Error("Connected starting assets receipt identity differs from its retained evidence.");return s}g(X,"verifyConnectedStartingAssetsReceipt");export{S as a,E as b,T as c,U as d,w as e,V as f,L as g,B as h,j as i,N as j,O as k,Q as l,F as m,M as n,K as o,C as p,X as q};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{n as V,o as G,u as J}from"./chunk-
|
|
2
|
+
import{n as V,o as G,u as J}from"./chunk-VSQXDS6H.js";import{c as o,d as H,e as l,f as K,h as ae,i as w}from"./chunk-3M53YXEI.js";import{b as ie,c as se,d as ce}from"./chunk-JEISPWWM.js";import{h as X,k as Z}from"./chunk-ERJV5BMC.js";import{a as I}from"./chunk-6FA3GG5B.js";import{a as i}from"./chunk-FTQLQJQV.js";import{existsSync as j,readFileSync as _e}from"node:fs";import{createRequire as Ie}from"node:module";import b from"node:path";function de(e){let n=b.join(e,"node_modules","openpond-agent-sdk","dist","cli.js");if(j(n))return{command:process.execPath,args:[n]};let t=b.join(e,"node_modules",".bin","openpond-agent");if(j(t))return{command:t,args:[]};let r=b.join(e,"node_modules","openpond-agent-sdk","src","cli.ts");if(j(r))return ue(b.dirname(b.dirname(r)),r);let a=De(e);return a||{command:"openpond-agent",args:[]}}i(de,"resolveLocalAgentSdkCommand");function De(e){let n=b.join(e,"package.json");if(!j(n))return null;try{let t=JSON.parse(_e(n,"utf8")),r=t.dependencies?.["openpond-agent-sdk"]??t.devDependencies?.["openpond-agent-sdk"]??t.peerDependencies?.["openpond-agent-sdk"];if(!r?.startsWith("file:"))return null;let a=b.resolve(e,r.slice(5)),d=b.join(a,"src","cli.ts");if(j(d))return ue(a,d);let s=b.join(a,"dist","cli.js");if(j(s))return{command:process.execPath,args:[s]}}catch{return null}return null}i(De,"resolveAgentSdkDependencyCli");function ue(e,n){let t=Ie(b.join(e,"package.json")).resolve("tsx/cli");return{command:process.execPath,args:[t,n]}}i(ue,"nodeTypescriptCommand");import{Buffer as A}from"node:buffer";import{existsSync as U,promises as P}from"node:fs";import m from"node:path";import{createHash as Te}from"node:crypto";import{existsSync as T,promises as M,readFileSync as ye,statSync as Me}from"node:fs";import{tmpdir as $e}from"node:os";import y from"node:path";import{gunzipSync as ze}from"node:zlib";import{existsSync as C}from"node:fs";import v from"node:path";function L(e,n){let t=n.packageManager;if(typeof t=="string"){let r=t.split("@")[0];if(r==="bun"||r==="npm"||r==="pnpm"||r==="yarn")return r}return C(v.join(e,"bun.lock"))||C(v.join(e,"bun.lockb"))?"bun":C(v.join(e,"pnpm-lock.yaml"))?"pnpm":C(v.join(e,"yarn.lock"))?"yarn":C(v.join(e,"package-lock.json"))||C(v.join(e,"npm-shrinkwrap.json"))?"npm":"unknown"}i(L,"detectAgentSdkPackageManager");function le(e){return e==="npm"?"npm install --offline":e==="pnpm"?"pnpm install --offline":e==="yarn"?"yarn install --offline":e==="bun"?"bun install --offline":"pnpm install --offline"}i(le,"agentSdkDependencyInstallCommand");function pe(e,n){return e==="pnpm"?`pnpm run ${n}`:e==="yarn"?`yarn ${n}`:e==="npm"?`npm run ${n}`:e==="bun"?`bun run ${n}`:`pnpm run ${n}`}i(pe,"agentSdkRunScriptCommand");function ge(e,n){return e==="pnpm"?`pnpm --silent run ${n}`:e==="yarn"?`yarn --silent ${n}`:e==="npm"?`npm run --silent ${n}`:e==="bun"?`bun run --silent ${n}`:`pnpm --silent run ${n}`}i(ge,"agentSdkRunJsonScriptCommand");var ke=".openpond/vendor/openpond-agent-sdk.tgz",Ue=".openpond/vendor/npm",Ne=`file:${ke}`,fe="# openpond-agent-sdk-source-upload: synthesized-openpond-yaml";async function ne(e,n,t={}){return J(e,n,{cwd:t.cwd})}i(ne,"runCommand");function Je(e){for(let n of["dependencies","devDependencies","peerDependencies"]){let t=e[n];if(!t||typeof t!="object"||Array.isArray(t))continue;let r=t["openpond-agent-sdk"];if(typeof r=="string"&&r.trim())return r.trim()}return null}i(Je,"readOpenPondAgentSdkVersionSpec");async function he(e,n){let t=Ke(e,n);if(!t)return null;let r=await M.mkdtemp(y.join($e(),"openpond-agent-sdk-pack-"));try{let a=t.kind==="package_root"?await Le(t.packageRoot,r):t.kind==="registry"?await He(t.versionSpec,r):t.tarballContents,d=await Fe({sdkPackageJson:t.packageJson,dependencyBaseDir:t.dependencyBaseDir,projectPackageJson:n,projectPath:e,tempDir:r}),s=L(e,n),c=Xe(n,d,s),u=s==="pnpm"||s==="unknown"?Ze(e,d):null,p=le(s),f={packageName:"openpond-agent-sdk",source:"uploaded_tarball",path:ke,sha256:O(a),sizeBytes:a.byteLength};return{rewrittenPackageJson:c,pnpmWorkspaceSource:u,tarballs:[{...f,contents:a},...d],dependencySetup:{required:!0,packageManager:s,installCommand:p,commands:[p],packageJsonPath:"package.json",expectedBinaryPath:"node_modules/.bin/openpond-agent",generatedArtifactDirectory:".openpond",sdkPackage:f,dependencyPackages:d.map(g=>({packageName:g.packageName,source:g.source,versionSpec:g.versionSpec,path:g.path,sha256:g.sha256,sizeBytes:g.sizeBytes}))}}}finally{await M.rm(r,{recursive:!0,force:!0})}}i(he,"buildAgentSdkMaterializedDependency");async function Le(e,n){let t=await ne("npm",["pack","--silent","--pack-destination",n,e],{cwd:e});if(t.code!==0){let a=[t.stderr.trim(),t.stdout.trim()].filter(Boolean).join(`
|
|
3
3
|
`);throw new Error(`failed to pack openpond-agent-sdk for source upload${a?`:
|
|
4
4
|
${a}`:""}`)}let r=t.stdout.trim().split(/\r?\n/).filter(Boolean).pop();if(!r)throw new Error("failed to pack openpond-agent-sdk for source upload: npm pack did not return a tarball name");return M.readFile(y.join(n,r))}i(Le,"packOpenPondAgentSdkPackageRoot");async function Fe(e){let n=D(e.sdkPackageJson.dependencies),t=D(e.projectPackageJson.dependencies),r=D(e.projectPackageJson.devDependencies);delete t["openpond-agent-sdk"],delete r["openpond-agent-sdk"];let a=[...Object.entries(n).map(([c,u])=>({packageName:c,versionSpec:u,dependencyBaseDir:e.dependencyBaseDir})),...Object.entries(t).map(([c,u])=>({packageName:c,versionSpec:u,dependencyBaseDir:e.projectPath})),...Object.entries(r).map(([c,u])=>({packageName:c,versionSpec:u,dependencyBaseDir:e.projectPath}))].sort((c,u)=>c.packageName.localeCompare(u.packageName)),d=new Set,s=[];for(;a.length>0;){let{packageName:c,versionSpec:u,dependencyBaseDir:p}=a.shift();if(d.has(c))continue;d.add(c);let f=We({packageName:c,versionSpec:u,dependencyBaseDir:p}),g=await ne("npm",["pack","--silent","--pack-destination",e.tempDir,f],{cwd:p});if(g.code!==0){let h=[g.stderr.trim(),g.stdout.trim()].filter(Boolean).join(`
|
|
5
5
|
`);throw new Error(`failed to pack openpond-agent-sdk dependency ${c}${h?`:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{p as r}from"./chunk-
|
|
2
|
+
import{p as r}from"./chunk-JY3YSI54.js";import{v as o}from"./chunk-ABF3W2MO.js";import{O as t}from"./chunk-PBZCXPPC.js";import{g as a}from"./chunk-VVNV4NNW.js";import{A as e}from"./chunk-PF56N7ZY.js";var s=e.object({profileRef:r,manifest:o,metric:t,gradeRefs:e.array(a),receiptRefs:e.array(a),passRate:e.number().min(0).max(1),passed:e.boolean(),completedAt:e.string().datetime(),contentHash:e.string().regex(/^[a-f0-9]{64}$/)}).strict();export{s as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{c as k}from"./chunk-6DCXAXVD.js";import{A as h}from"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createHash as J}from"node:crypto";var ie=h.object({models:h.array(h.object({slug:h.string().trim().min(1),display_name:h.string().trim().min(1),visibility:h.string(),priority:h.number().default(0),context_window:h.number().positive().nullable().optional(),input_modalities:h.array(h.string()).default([]),supported_reasoning_levels:h.array(h.object({effort:h.string()})).default([])})).max(500)});function j(e){let t=ie.parse(e).models.filter(n=>n.visibility==="list").sort((n,r)=>n.priority-r.priority),o=new Set;return t.map(n=>{if(o.has(n.slug))throw new Error("OpenAI returned a duplicate subscription model.");o.add(n.slug);let r=n.supported_reasoning_levels.map(s=>s.effort).filter(s=>["off","low","medium","high","xhigh","max"].includes(s));return k.parse({id:n.slug,providerId:"openai",displayName:n.display_name,source:"provider",contextWindow:n.context_window,capabilities:{streaming:!0,toolCalling:!0,reasoning:r.length>0,reasoningEfforts:r,vision:n.input_modalities.includes("image")}})})}i(j,"openAiSubscriptionModels");import{createHash as se,randomBytes as D}from"node:crypto";import{createServer as ae}from"node:http";var O="app_EMoamEEZ73f0CkXaXp7hrann",y="https://auth.openai.com",w=1455,I=300*1e3,de=5e3,le=3e3;function We(e){let t=null,o=null;async function n(){let{redirectUri:a}=await l(),d=ue(),u=R(D(32));o&&(o.reject(new Error("A previous OpenAI ChatGPT login was replaced.")),clearTimeout(o.timeout),o=null);let v=Date.now()+I;return new Promise((b,C)=>{o={pkce:d,state:u,resolve:b,reject:C,timeout:setTimeout(()=>{o=null,C(new Error("OpenAI ChatGPT login timed out."))},I)}}).then(b=>f(b)).catch(()=>{}).finally(()=>p()),{url:ce(a,d,u),redirectUri:a,expiresAt:v}}i(n,"startBrowserLogin");async function r(){let a=await fetch(`${y}/api/accounts/deviceauth/usercode`,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"openpond-app"},body:JSON.stringify({client_id:O})});if(!a.ok)throw new Error(`OpenAI device authorization failed: ${a.status}`);let d=await a.json();if(!d.device_auth_id||!d.user_code)throw new Error("OpenAI device authorization returned an incomplete response.");let u=Math.max(Number.parseInt(d.interval??"",10)||de/1e3,1)*1e3,v=Date.now()+I;return s({deviceAuthId:d.device_auth_id,userCode:d.user_code,intervalMs:u,expiresAt:v}).catch(()=>{}),{url:`${y}/codex/device`,userCode:d.user_code,expiresAt:v}}i(r,"startDeviceLogin");async function s(a){for(;Date.now()<a.expiresAt;){let d=await fetch(`${y}/api/accounts/deviceauth/token`,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"openpond-app"},body:JSON.stringify({device_auth_id:a.deviceAuthId,user_code:a.userCode})});if(d.ok){let u=await d.json();if(!u.authorization_code||!u.code_verifier)throw new Error("OpenAI device login returned an incomplete authorization response.");await f(await L(u.authorization_code,`${y}/deviceauth/callback`,{verifier:u.code_verifier}));return}if(d.status!==403&&d.status!==404)throw new Error(`OpenAI device login failed: ${d.status}`);await me(a.intervalMs+le)}throw new Error("OpenAI device login timed out.")}i(s,"pollDeviceLogin");async function l(){return t?{redirectUri:`http://localhost:${w}/auth/callback`}:(t=ae((a,d)=>{let u=new URL(a.url||"/",`http://localhost:${w}`);if(u.pathname!=="/auth/callback"){d.writeHead(404),d.end("Not found");return}let v=o,P=u.searchParams.get("error"),b=u.searchParams.get("error_description");if(P){c(b||P),d.writeHead(200,{"Content-Type":"text/html"}),d.end(A("Authorization Failed",b||P));return}let C=u.searchParams.get("code"),re=u.searchParams.get("state");if(!C){c("Missing authorization code."),d.writeHead(400,{"Content-Type":"text/html"}),d.end(A("Authorization Failed","Missing authorization code."));return}if(!v||re!==v.state){c("Invalid OAuth state."),d.writeHead(400,{"Content-Type":"text/html"}),d.end(A("Authorization Failed","Invalid OAuth state."));return}o=null,clearTimeout(v.timeout),L(C,`http://localhost:${w}/auth/callback`,v.pkce).then(v.resolve).catch(v.reject),d.writeHead(200,{"Content-Type":"text/html"}),d.end(A("Authorization Successful","You can close this window and return to OpenPond."))}),await new Promise((a,d)=>{t.once("error",d),t.listen(w,()=>{t.off("error",d),a()})}),{redirectUri:`http://localhost:${w}/auth/callback`})}i(l,"ensureOAuthServer");function c(a){let d=o;o=null,d&&(clearTimeout(d.timeout),d.reject(new Error(a)))}i(c,"failBrowserOAuth");function p(){let a=t;t=null,a&&a.close()}i(p,"stopOAuthServer");async function f(a){let d=a.access_token?.trim()||null,u=a.refresh_token?.trim();if(!u)throw new Error("OpenAI login did not return a refresh token.");await e.saveCredential({accessToken:d,refreshToken:u,expiresAt:Date.now()+(a.expires_in??3600)*1e3,accountId:z(a)})}return i(f,"saveTokens"),{startBrowserLogin:n,startDeviceLogin:r}}i(We,"createOpenAiSubscriptionAuthService");function ce(e,t,o){let n=new URLSearchParams({response_type:"code",client_id:O,redirect_uri:e,scope:"openid profile email offline_access",code_challenge:t.challenge,code_challenge_method:"S256",id_token_add_organizations:"true",codex_cli_simplified_flow:"true",state:o,originator:"openpond"});return`${y}/oauth/authorize?${n.toString()}`}i(ce,"buildAuthorizeUrl");async function L(e,t,o){let n=await fetch(`${y}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:e,redirect_uri:t,client_id:O,code_verifier:o.verifier}).toString()});if(!n.ok)throw new Error(`OpenAI token exchange failed: ${n.status}`);return await n.json()}i(L,"exchangeCodeForTokens");async function B(e){let t=await fetch(`${y}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:e,client_id:O}).toString()});if(t.status===401)throw new Error("Your OpenAI ChatGPT sign-in has expired or was invalidated. Reconnect it in Settings > Providers > OpenAI > Subscription by selecting Connect ChatGPT. This is an authentication issue, not a billing or model-access error.");if(!t.ok)throw new Error(`OpenAI token refresh failed: ${t.status}`);return await t.json()}i(B,"refreshOpenAiSubscriptionToken");function N(e,t){return{accessToken:e.access_token?.trim()||t.accessToken,refreshToken:e.refresh_token?.trim()||t.refreshToken,expiresAt:Date.now()+(e.expires_in??3600)*1e3,accountId:z(e)??t.accountId}}i(N,"credentialFromRefreshResponse");function ue(){let e=R(D(32)),t=R(se("sha256").update(e).digest());return{verifier:e,challenge:t}}i(ue,"generatePkce");function z(e){for(let t of[e.id_token,e.access_token]){let o=pe(t),n=x(o?.chatgpt_account_id);if(n)return n;let r=o?.["https://api.openai.com/auth"];if(r&&typeof r=="object"){let l=x(r.chatgpt_account_id);if(l)return l}let s=o?.organizations;if(Array.isArray(s)){for(let l of s)if(l&&typeof l=="object"){let c=x(l.id);if(c)return c}}}return null}i(z,"extractAccountId");function pe(e){if(!e)return null;let t=e.split(".");if(t.length!==3)return null;try{return JSON.parse(Buffer.from(t[1],"base64url").toString("utf8"))}catch{return null}}i(pe,"parseJwtClaims");function A(e,t){return`<!doctype html><html><head><meta charset="utf-8"><title>OpenPond - ${S(e)}</title></head><body><h1>${S(e)}</h1><p>${S(t)}</p></body></html>`}i(A,"htmlPage");function S(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}i(S,"escapeHtml");function R(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}i(R,"base64Url");function x(e){return typeof e=="string"&&e.trim()?e.trim():null}i(x,"stringValue");function me(e){return new Promise(t=>setTimeout(t,e))}i(me,"sleep");function E(e){let t=e.model?.trim().toLowerCase()??"";return e.provider==="zai"&&/(?:^|[/_-])glm-(?:4\.(?:[5-9]|\d{2,})|[5-9](?:\.\d+)?)(?:$|[/_-])/.test(t)?{kind:"chat_completions_reasoning",requestThinking:"zai_clear_thinking",supportsToolChoice:!0}:e.provider==="deepseek"&&/(?:^|[/_-])deepseek-v(?:3\.2|[4-9](?:\.\d+)?)(?:$|[/_-])/.test(t)?{kind:"chat_completions_reasoning",requestThinking:"deepseek_enabled",supportsToolChoice:!1}:null}i(E,"chatCompletionsReasoningPolicy");function G(e){return!e.hasToolCalls||e.reasoningText.length===0||!E(e)?null:{kind:"chat_completions_reasoning",reasoningContent:e.reasoningText}}i(G,"chatCompletionsContinuation");function q(e){return e.some(t=>t.continuation?.kind==="chat_completions_reasoning"&&t.continuation.reasoningContent.length>0)}i(q,"hasChatCompletionsReasoningContinuation");var fe=["openai","xai","openrouter","deepseek","zai","moonshot","together","groq","custom-openai-compatible"],he=9e4,F=5*6e4,ge=5*1024*1024,ve=64*1024,ye="https://chatgpt.com/backend-api/codex/responses",be=6e4;function _e(e){return fe.includes(e)}i(_e,"isOpenAiCompatibleProviderId");function M(e){if(!_e(e.providerId))throw new Error(`Provider ${e.providerId} is not OpenAI-compatible.`);let t=e.settings.providers[e.providerId],o=e.settings.modelCaches[e.providerId],n=X(e.baseUrl??t?.baseUrl??"");if(!n)throw new Error(`Provider ${e.providerId} requires a base URL.`);let r=e.secrets.providers[e.providerId],s=Ce(e.providerId,r);if(!s)throw new Error(we(e.providerId,e.settings));let l=e.modelId?.trim()||t?.defaultModel?.trim()||o?.models.find(c=>c.id.trim())?.id.trim()||"";if(!l&&e.requireModel!==!1)throw new Error(`Provider ${e.providerId} requires a model.`);return{providerId:e.providerId,baseUrl:n,auth:s,model:l}}i(M,"resolveOpenAiCompatibleProvider");function Ce(e,t){if(e==="openai"&&t?.source==="chatgpt_subscription"&&t.oauth?.refreshToken)return{type:"chatgpt_subscription",credential:t.oauth};let o=t?.source==="local_secret"?t.value?.trim()??"":t?.source==="env"&&t.envVar?process.env[t.envVar]?.trim()??"":"";return o?{type:"api_key",apiKey:o}:null}i(Ce,"resolveProviderAuth");function we(e,t){let o=t.statuses[e]?.displayName?.trim()||e,n="Add an API key in Settings > Providers.";return e==="openai"?`${o} has no connected API key. The raw OpenAI provider uses Platform API credentials. ${n}`:`${o} has no connected API key. ${n}`}i(we,"missingApiKeyMessage");async function Pe(e){let t=M({...e,requireModel:!1}),o=U(e.signal,e.requestTimeoutMs);try{let n=t.auth.type==="chatgpt_subscription",r=t.auth.type==="chatgpt_subscription"?await Y({providerId:t.providerId,credential:t.auth.credential,saveChatGptSubscriptionCredential:e.saveChatGptSubscriptionCredential}):null,s=new URL(n?"https://chatgpt.com/backend-api/codex/models":W(t.baseUrl,"models"));n&&s.searchParams.set("client_version",e.subscriptionClientVersion??"0.159.1");let l=r?Z(r,void 0):Q(t.auth.type==="api_key"?t.auth.apiKey:"","application/json");l.set("Accept","application/json");let c=await fetch(s,{method:"GET",headers:l,signal:o.signal});if(!c.ok){o.touch();let a=await $(c,e.errorBodyLimitBytes,o.signal,o.touch);throw new Error(`Provider ${t.providerId} model list failed: ${c.status} ${ee(t,a)}`)}let p=await De(c,`Provider ${t.providerId} model list`,e.responseBodyLimitBytes,o.signal,o.touch),f=n?j(p):$e(t.providerId,p);if(f.length===0)throw new Error(`Provider ${t.providerId} returned no models.`);return f}finally{o.cleanup()}}i(Pe,"listOpenAiCompatibleProviderModels");async function st(e){let t=M(e),o=await Pe({...e,providerId:t.providerId,baseUrl:t.baseUrl,modelId:t.model}),n=o.some(s=>s.id===t.model),r=n?[]:[`Model ${t.model} was not returned by provider model discovery.`];return{providerId:t.providerId,ok:r.length===0,live:!0,baseUrl:t.baseUrl,modelId:t.model,modelFound:n,modelCount:o.length,errors:r}}i(st,"validateOpenAiCompatibleProvider");async function*at(e){let t=e.resolvedProvider??M(e);if(t.auth.type==="chatgpt_subscription"){let n={...t,auth:t.auth};yield*ke({...e,provider:n});return}let o=U(e.signal,e.requestTimeoutMs);try{let n=W(t.baseUrl,"chat/completions"),r=await fetch(n,{method:"POST",redirect:"error",headers:Q(t.auth.apiKey,"text/event-stream",e.allowAnonymous),body:JSON.stringify(Ae({providerId:t.providerId,model:t.model,messages:e.messages,tools:e.tools,toolChoice:e.toolChoice,reasoningEffort:e.reasoningEffort,maxOutputTokens:e.maxOutputTokens,temperature:e.temperature,topP:e.topP,seed:e.seed})),signal:o.signal});if(!r.ok||!r.body){o.touch();let a=await $(r,e.errorBodyLimitBytes,o.signal,o.touch);throw new Error(`Provider ${t.providerId} stream failed: ${r.status} ${ee(t,a)}`)}let s="",l=!1,c=null,p=null;o.touch();for await(let a of ne(r.body,o.signal,o.touch)){if(p=a,a&&typeof a=="object"&&"error"in a)throw new Error(`Provider ${t.providerId} stream failed: ${H(a)}`);let d=Ge(a);d&&(yield{type:"usage",usage:d,raw:a});for(let u of Be(a))u.type==="reasoning_delta"&&(s+=u.text),u.type==="tool_call_delta"&&(l=!0),u.type==="finish"?c=u:yield u}let f=G({provider:t.providerId,model:t.model,reasoningText:s,hasToolCalls:l});f&&(yield{type:"continuation",continuation:f,raw:p}),c&&(yield c)}finally{o.cleanup()}}i(at,"streamOpenAiCompatibleChatCompletion");async function*ke(e){let t=await Y({providerId:e.provider.providerId,credential:e.provider.auth.credential,saveChatGptSubscriptionCredential:e.saveChatGptSubscriptionCredential});if(!t.accessToken)throw new Error("OpenAI ChatGPT subscription credential has no access token.");let o=Ie(e.promptCacheKey),n=U(e.signal,e.requestTimeoutMs);try{let r=await fetch(ye,{method:"POST",headers:Z(t,o??e.requestId),body:JSON.stringify(Te({model:e.provider.model,messages:e.messages,tools:e.tools,toolChoice:e.toolChoice,reasoningEffort:e.reasoningEffort,promptCacheKey:o})),signal:n.signal});if(!r.ok||!r.body){n.touch();let a=await $(r,e.errorBodyLimitBytes,n.signal,n.touch);throw new Error(`Provider ${e.provider.providerId} subscription stream failed: ${r.status} ${a}`)}let s=new Set,l=new Map,c=!1,p=null,f=null;n.touch();for await(let a of ne(r.body,n.signal,n.touch)){if(f=a,a&&typeof a=="object"&&"error"in a)throw new Error(`Provider ${e.provider.providerId} subscription stream failed: ${H(a)}`);for(let d of xe(a)){let u=m(d.id)??JSON.stringify(d);l.set(u,d)}for(let d of Ne(a,s))d.type==="tool_call_delta"&&(c=!0),d.type==="finish"?p=d:yield d}c&&l.size>0&&(yield{type:"continuation",continuation:{kind:"responses_reasoning_items",items:[...l.values()]},raw:f}),p&&(yield p)}finally{n.cleanup()}}i(ke,"streamOpenAiSubscriptionResponses");async function Y(e){if(e.credential.accessToken&&e.credential.expiresAt>Date.now()+be)return e.credential;let t=N(await B(e.credential.refreshToken),e.credential);return await e.saveChatGptSubscriptionCredential?.(e.providerId,t),t}i(Y,"usableSubscriptionCredential");function Ae(e){let t={model:e.model,messages:Oe(Me(e.messages)),stream:!0};e.tools&&(t.tools=e.tools),e.providerId==="openai"&&e.reasoningEffort&&(t.reasoning_effort=e.reasoningEffort),e.maxOutputTokens!=null&&(t.max_tokens=e.maxOutputTokens),e.temperature!=null&&(t.temperature=e.temperature),e.topP!=null&&(t.top_p=e.topP),e.seed!=null&&(t.seed=e.seed),e.providerId==="zai"&&e.tools&&e.tools.length>0&&(t.tool_stream=!0);let o=E({provider:e.providerId,model:e.model});return e.tools&&e.tools.length>0&&o?.requestThinking==="zai_clear_thinking"&&(t.thinking={type:"enabled",clear_thinking:!q(e.messages)}),e.tools&&e.tools.length>0&&o?.requestThinking==="deepseek_enabled"&&(t.thinking={type:"enabled"}),e.toolChoice!==void 0&&o?.supportsToolChoice!==!1&&(t.tool_choice=e.toolChoice),t}i(Ae,"buildChatCompletionBody");function Oe(e){return e.map(t=>{let{continuation:o,images:n,...r}=t,s=n?.length?[...typeof t.content=="string"&&t.content.trim()?[{type:"text",text:t.content}]:[],...n.map(l=>({type:"image_url",image_url:{url:l.url,...l.detail?{detail:l.detail}:{}}}))]:t.content;return o?.kind==="chat_completions_reasoning"?{...r,...s!==void 0?{content:s}:{},reasoning_content:o.reasoningContent}:{...r,...s!==void 0?{content:s}:{}}})}i(Oe,"chatCompletionMessages");function Te(e){let t=Se(e.messages),o={model:e.model,input:t.input,stream:!0,store:!1};t.instructions&&(o.instructions=t.instructions),e.promptCacheKey&&(o.prompt_cache_key=e.promptCacheKey),o.reasoning={...e.reasoningEffort?{effort:e.reasoningEffort}:{},summary:"auto"},e.maxOutputTokens!=null&&(o.max_output_tokens=e.maxOutputTokens),e.temperature!=null&&(o.temperature=e.temperature),e.topP!=null&&(o.top_p=e.topP);let n=Re(e.tools);n.length>0&&(o.tools=n);let r=Ee(e.toolChoice);return r!==void 0&&(o.tool_choice=r),o}i(Te,"buildResponsesBody");function Ie(e){let t=e?.trim();if(t)return t.length<=64?t:J("sha256").update(t).digest("hex")}i(Ie,"normalizedPromptCacheKey");function Se(e){let t=[],o=[];for(let n of e){let r=typeof n.content=="string"?n.content:"";if(n.role==="system"){r.trim()&&t.push(r.trim());continue}if(n.role==="tool"){o.push({type:"function_call_output",call_id:n.tool_call_id,output:r});continue}n.continuation?.kind==="responses_reasoning_items"&&o.push(...n.continuation.items),(r.trim()||n.images?.length)&&o.push({type:"message",role:n.role,content:[...r.trim()?[{type:n.role==="assistant"?"output_text":"input_text",text:r}]:[],...(n.images??[]).map(s=>({type:"input_image",image_url:s.url,...s.detail?{detail:s.detail}:{}}))]});for(let s of n.tool_calls??[]){let l=s.function&&typeof s.function=="object"?s.function:{};o.push({type:"function_call",call_id:s.id,name:l.name,arguments:typeof l.arguments=="string"?l.arguments:""})}}return{instructions:t.join(`
|
|
2
|
+
import{c as k}from"./chunk-BKEDG3A4.js";import{A as h}from"./chunk-PF56N7ZY.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createHash as J}from"node:crypto";var ie=h.object({models:h.array(h.object({slug:h.string().trim().min(1),display_name:h.string().trim().min(1),visibility:h.string(),priority:h.number().default(0),context_window:h.number().positive().nullable().optional(),input_modalities:h.array(h.string()).default([]),supported_reasoning_levels:h.array(h.object({effort:h.string()})).default([])})).max(500)});function j(e){let t=ie.parse(e).models.filter(n=>n.visibility==="list").sort((n,r)=>n.priority-r.priority),o=new Set;return t.map(n=>{if(o.has(n.slug))throw new Error("OpenAI returned a duplicate subscription model.");o.add(n.slug);let r=n.supported_reasoning_levels.map(s=>s.effort).filter(s=>["off","low","medium","high","xhigh","max"].includes(s));return k.parse({id:n.slug,providerId:"openai",displayName:n.display_name,source:"provider",contextWindow:n.context_window,capabilities:{streaming:!0,toolCalling:!0,reasoning:r.length>0,reasoningEfforts:r,vision:n.input_modalities.includes("image")}})})}i(j,"openAiSubscriptionModels");import{createHash as se,randomBytes as D}from"node:crypto";import{createServer as ae}from"node:http";var O="app_EMoamEEZ73f0CkXaXp7hrann",y="https://auth.openai.com",w=1455,I=300*1e3,de=5e3,le=3e3;function We(e){let t=null,o=null;async function n(){let{redirectUri:a}=await l(),d=ue(),u=R(D(32));o&&(o.reject(new Error("A previous OpenAI ChatGPT login was replaced.")),clearTimeout(o.timeout),o=null);let v=Date.now()+I;return new Promise((b,C)=>{o={pkce:d,state:u,resolve:b,reject:C,timeout:setTimeout(()=>{o=null,C(new Error("OpenAI ChatGPT login timed out."))},I)}}).then(b=>f(b)).catch(()=>{}).finally(()=>p()),{url:ce(a,d,u),redirectUri:a,expiresAt:v}}i(n,"startBrowserLogin");async function r(){let a=await fetch(`${y}/api/accounts/deviceauth/usercode`,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"openpond-app"},body:JSON.stringify({client_id:O})});if(!a.ok)throw new Error(`OpenAI device authorization failed: ${a.status}`);let d=await a.json();if(!d.device_auth_id||!d.user_code)throw new Error("OpenAI device authorization returned an incomplete response.");let u=Math.max(Number.parseInt(d.interval??"",10)||de/1e3,1)*1e3,v=Date.now()+I;return s({deviceAuthId:d.device_auth_id,userCode:d.user_code,intervalMs:u,expiresAt:v}).catch(()=>{}),{url:`${y}/codex/device`,userCode:d.user_code,expiresAt:v}}i(r,"startDeviceLogin");async function s(a){for(;Date.now()<a.expiresAt;){let d=await fetch(`${y}/api/accounts/deviceauth/token`,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"openpond-app"},body:JSON.stringify({device_auth_id:a.deviceAuthId,user_code:a.userCode})});if(d.ok){let u=await d.json();if(!u.authorization_code||!u.code_verifier)throw new Error("OpenAI device login returned an incomplete authorization response.");await f(await L(u.authorization_code,`${y}/deviceauth/callback`,{verifier:u.code_verifier}));return}if(d.status!==403&&d.status!==404)throw new Error(`OpenAI device login failed: ${d.status}`);await me(a.intervalMs+le)}throw new Error("OpenAI device login timed out.")}i(s,"pollDeviceLogin");async function l(){return t?{redirectUri:`http://localhost:${w}/auth/callback`}:(t=ae((a,d)=>{let u=new URL(a.url||"/",`http://localhost:${w}`);if(u.pathname!=="/auth/callback"){d.writeHead(404),d.end("Not found");return}let v=o,P=u.searchParams.get("error"),b=u.searchParams.get("error_description");if(P){c(b||P),d.writeHead(200,{"Content-Type":"text/html"}),d.end(A("Authorization Failed",b||P));return}let C=u.searchParams.get("code"),re=u.searchParams.get("state");if(!C){c("Missing authorization code."),d.writeHead(400,{"Content-Type":"text/html"}),d.end(A("Authorization Failed","Missing authorization code."));return}if(!v||re!==v.state){c("Invalid OAuth state."),d.writeHead(400,{"Content-Type":"text/html"}),d.end(A("Authorization Failed","Invalid OAuth state."));return}o=null,clearTimeout(v.timeout),L(C,`http://localhost:${w}/auth/callback`,v.pkce).then(v.resolve).catch(v.reject),d.writeHead(200,{"Content-Type":"text/html"}),d.end(A("Authorization Successful","You can close this window and return to OpenPond."))}),await new Promise((a,d)=>{t.once("error",d),t.listen(w,()=>{t.off("error",d),a()})}),{redirectUri:`http://localhost:${w}/auth/callback`})}i(l,"ensureOAuthServer");function c(a){let d=o;o=null,d&&(clearTimeout(d.timeout),d.reject(new Error(a)))}i(c,"failBrowserOAuth");function p(){let a=t;t=null,a&&a.close()}i(p,"stopOAuthServer");async function f(a){let d=a.access_token?.trim()||null,u=a.refresh_token?.trim();if(!u)throw new Error("OpenAI login did not return a refresh token.");await e.saveCredential({accessToken:d,refreshToken:u,expiresAt:Date.now()+(a.expires_in??3600)*1e3,accountId:z(a)})}return i(f,"saveTokens"),{startBrowserLogin:n,startDeviceLogin:r}}i(We,"createOpenAiSubscriptionAuthService");function ce(e,t,o){let n=new URLSearchParams({response_type:"code",client_id:O,redirect_uri:e,scope:"openid profile email offline_access",code_challenge:t.challenge,code_challenge_method:"S256",id_token_add_organizations:"true",codex_cli_simplified_flow:"true",state:o,originator:"openpond"});return`${y}/oauth/authorize?${n.toString()}`}i(ce,"buildAuthorizeUrl");async function L(e,t,o){let n=await fetch(`${y}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:e,redirect_uri:t,client_id:O,code_verifier:o.verifier}).toString()});if(!n.ok)throw new Error(`OpenAI token exchange failed: ${n.status}`);return await n.json()}i(L,"exchangeCodeForTokens");async function B(e){let t=await fetch(`${y}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:e,client_id:O}).toString()});if(t.status===401)throw new Error("Your OpenAI ChatGPT sign-in has expired or was invalidated. Reconnect it in Settings > Providers > OpenAI > Subscription by selecting Connect ChatGPT. This is an authentication issue, not a billing or model-access error.");if(!t.ok)throw new Error(`OpenAI token refresh failed: ${t.status}`);return await t.json()}i(B,"refreshOpenAiSubscriptionToken");function N(e,t){return{accessToken:e.access_token?.trim()||t.accessToken,refreshToken:e.refresh_token?.trim()||t.refreshToken,expiresAt:Date.now()+(e.expires_in??3600)*1e3,accountId:z(e)??t.accountId}}i(N,"credentialFromRefreshResponse");function ue(){let e=R(D(32)),t=R(se("sha256").update(e).digest());return{verifier:e,challenge:t}}i(ue,"generatePkce");function z(e){for(let t of[e.id_token,e.access_token]){let o=pe(t),n=x(o?.chatgpt_account_id);if(n)return n;let r=o?.["https://api.openai.com/auth"];if(r&&typeof r=="object"){let l=x(r.chatgpt_account_id);if(l)return l}let s=o?.organizations;if(Array.isArray(s)){for(let l of s)if(l&&typeof l=="object"){let c=x(l.id);if(c)return c}}}return null}i(z,"extractAccountId");function pe(e){if(!e)return null;let t=e.split(".");if(t.length!==3)return null;try{return JSON.parse(Buffer.from(t[1],"base64url").toString("utf8"))}catch{return null}}i(pe,"parseJwtClaims");function A(e,t){return`<!doctype html><html><head><meta charset="utf-8"><title>OpenPond - ${S(e)}</title></head><body><h1>${S(e)}</h1><p>${S(t)}</p></body></html>`}i(A,"htmlPage");function S(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}i(S,"escapeHtml");function R(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}i(R,"base64Url");function x(e){return typeof e=="string"&&e.trim()?e.trim():null}i(x,"stringValue");function me(e){return new Promise(t=>setTimeout(t,e))}i(me,"sleep");function E(e){let t=e.model?.trim().toLowerCase()??"";return e.provider==="zai"&&/(?:^|[/_-])glm-(?:4\.(?:[5-9]|\d{2,})|[5-9](?:\.\d+)?)(?:$|[/_-])/.test(t)?{kind:"chat_completions_reasoning",requestThinking:"zai_clear_thinking",supportsToolChoice:!0}:e.provider==="deepseek"&&/(?:^|[/_-])deepseek-v(?:3\.2|[4-9](?:\.\d+)?)(?:$|[/_-])/.test(t)?{kind:"chat_completions_reasoning",requestThinking:"deepseek_enabled",supportsToolChoice:!1}:null}i(E,"chatCompletionsReasoningPolicy");function G(e){return!e.hasToolCalls||e.reasoningText.length===0||!E(e)?null:{kind:"chat_completions_reasoning",reasoningContent:e.reasoningText}}i(G,"chatCompletionsContinuation");function q(e){return e.some(t=>t.continuation?.kind==="chat_completions_reasoning"&&t.continuation.reasoningContent.length>0)}i(q,"hasChatCompletionsReasoningContinuation");var fe=["openai","xai","openrouter","deepseek","zai","moonshot","together","groq","custom-openai-compatible"],he=9e4,F=5*6e4,ge=5*1024*1024,ve=64*1024,ye="https://chatgpt.com/backend-api/codex/responses",be=6e4;function _e(e){return fe.includes(e)}i(_e,"isOpenAiCompatibleProviderId");function M(e){if(!_e(e.providerId))throw new Error(`Provider ${e.providerId} is not OpenAI-compatible.`);let t=e.settings.providers[e.providerId],o=e.settings.modelCaches[e.providerId],n=X(e.baseUrl??t?.baseUrl??"");if(!n)throw new Error(`Provider ${e.providerId} requires a base URL.`);let r=e.secrets.providers[e.providerId],s=Ce(e.providerId,r);if(!s)throw new Error(we(e.providerId,e.settings));let l=e.modelId?.trim()||t?.defaultModel?.trim()||o?.models.find(c=>c.id.trim())?.id.trim()||"";if(!l&&e.requireModel!==!1)throw new Error(`Provider ${e.providerId} requires a model.`);return{providerId:e.providerId,baseUrl:n,auth:s,model:l}}i(M,"resolveOpenAiCompatibleProvider");function Ce(e,t){if(e==="openai"&&t?.source==="chatgpt_subscription"&&t.oauth?.refreshToken)return{type:"chatgpt_subscription",credential:t.oauth};let o=t?.source==="local_secret"?t.value?.trim()??"":t?.source==="env"&&t.envVar?process.env[t.envVar]?.trim()??"":"";return o?{type:"api_key",apiKey:o}:null}i(Ce,"resolveProviderAuth");function we(e,t){let o=t.statuses[e]?.displayName?.trim()||e,n="Add an API key in Settings > Providers.";return e==="openai"?`${o} has no connected API key. The raw OpenAI provider uses Platform API credentials. ${n}`:`${o} has no connected API key. ${n}`}i(we,"missingApiKeyMessage");async function Pe(e){let t=M({...e,requireModel:!1}),o=U(e.signal,e.requestTimeoutMs);try{let n=t.auth.type==="chatgpt_subscription",r=t.auth.type==="chatgpt_subscription"?await Y({providerId:t.providerId,credential:t.auth.credential,saveChatGptSubscriptionCredential:e.saveChatGptSubscriptionCredential}):null,s=new URL(n?"https://chatgpt.com/backend-api/codex/models":W(t.baseUrl,"models"));n&&s.searchParams.set("client_version",e.subscriptionClientVersion??"0.159.1");let l=r?Z(r,void 0):Q(t.auth.type==="api_key"?t.auth.apiKey:"","application/json");l.set("Accept","application/json");let c=await fetch(s,{method:"GET",headers:l,signal:o.signal});if(!c.ok){o.touch();let a=await $(c,e.errorBodyLimitBytes,o.signal,o.touch);throw new Error(`Provider ${t.providerId} model list failed: ${c.status} ${ee(t,a)}`)}let p=await De(c,`Provider ${t.providerId} model list`,e.responseBodyLimitBytes,o.signal,o.touch),f=n?j(p):$e(t.providerId,p);if(f.length===0)throw new Error(`Provider ${t.providerId} returned no models.`);return f}finally{o.cleanup()}}i(Pe,"listOpenAiCompatibleProviderModels");async function st(e){let t=M(e),o=await Pe({...e,providerId:t.providerId,baseUrl:t.baseUrl,modelId:t.model}),n=o.some(s=>s.id===t.model),r=n?[]:[`Model ${t.model} was not returned by provider model discovery.`];return{providerId:t.providerId,ok:r.length===0,live:!0,baseUrl:t.baseUrl,modelId:t.model,modelFound:n,modelCount:o.length,errors:r}}i(st,"validateOpenAiCompatibleProvider");async function*at(e){let t=e.resolvedProvider??M(e);if(t.auth.type==="chatgpt_subscription"){let n={...t,auth:t.auth};yield*ke({...e,provider:n});return}let o=U(e.signal,e.requestTimeoutMs);try{let n=W(t.baseUrl,"chat/completions"),r=await fetch(n,{method:"POST",redirect:"error",headers:Q(t.auth.apiKey,"text/event-stream",e.allowAnonymous),body:JSON.stringify(Ae({providerId:t.providerId,model:t.model,messages:e.messages,tools:e.tools,toolChoice:e.toolChoice,reasoningEffort:e.reasoningEffort,maxOutputTokens:e.maxOutputTokens,temperature:e.temperature,topP:e.topP,seed:e.seed})),signal:o.signal});if(!r.ok||!r.body){o.touch();let a=await $(r,e.errorBodyLimitBytes,o.signal,o.touch);throw new Error(`Provider ${t.providerId} stream failed: ${r.status} ${ee(t,a)}`)}let s="",l=!1,c=null,p=null;o.touch();for await(let a of ne(r.body,o.signal,o.touch)){if(p=a,a&&typeof a=="object"&&"error"in a)throw new Error(`Provider ${t.providerId} stream failed: ${H(a)}`);let d=Ge(a);d&&(yield{type:"usage",usage:d,raw:a});for(let u of Be(a))u.type==="reasoning_delta"&&(s+=u.text),u.type==="tool_call_delta"&&(l=!0),u.type==="finish"?c=u:yield u}let f=G({provider:t.providerId,model:t.model,reasoningText:s,hasToolCalls:l});f&&(yield{type:"continuation",continuation:f,raw:p}),c&&(yield c)}finally{o.cleanup()}}i(at,"streamOpenAiCompatibleChatCompletion");async function*ke(e){let t=await Y({providerId:e.provider.providerId,credential:e.provider.auth.credential,saveChatGptSubscriptionCredential:e.saveChatGptSubscriptionCredential});if(!t.accessToken)throw new Error("OpenAI ChatGPT subscription credential has no access token.");let o=Ie(e.promptCacheKey),n=U(e.signal,e.requestTimeoutMs);try{let r=await fetch(ye,{method:"POST",headers:Z(t,o??e.requestId),body:JSON.stringify(Te({model:e.provider.model,messages:e.messages,tools:e.tools,toolChoice:e.toolChoice,reasoningEffort:e.reasoningEffort,promptCacheKey:o})),signal:n.signal});if(!r.ok||!r.body){n.touch();let a=await $(r,e.errorBodyLimitBytes,n.signal,n.touch);throw new Error(`Provider ${e.provider.providerId} subscription stream failed: ${r.status} ${a}`)}let s=new Set,l=new Map,c=!1,p=null,f=null;n.touch();for await(let a of ne(r.body,n.signal,n.touch)){if(f=a,a&&typeof a=="object"&&"error"in a)throw new Error(`Provider ${e.provider.providerId} subscription stream failed: ${H(a)}`);for(let d of xe(a)){let u=m(d.id)??JSON.stringify(d);l.set(u,d)}for(let d of Ne(a,s))d.type==="tool_call_delta"&&(c=!0),d.type==="finish"?p=d:yield d}c&&l.size>0&&(yield{type:"continuation",continuation:{kind:"responses_reasoning_items",items:[...l.values()]},raw:f}),p&&(yield p)}finally{n.cleanup()}}i(ke,"streamOpenAiSubscriptionResponses");async function Y(e){if(e.credential.accessToken&&e.credential.expiresAt>Date.now()+be)return e.credential;let t=N(await B(e.credential.refreshToken),e.credential);return await e.saveChatGptSubscriptionCredential?.(e.providerId,t),t}i(Y,"usableSubscriptionCredential");function Ae(e){let t={model:e.model,messages:Oe(Me(e.messages)),stream:!0};e.tools&&(t.tools=e.tools),e.providerId==="openai"&&e.reasoningEffort&&(t.reasoning_effort=e.reasoningEffort),e.maxOutputTokens!=null&&(t.max_tokens=e.maxOutputTokens),e.temperature!=null&&(t.temperature=e.temperature),e.topP!=null&&(t.top_p=e.topP),e.seed!=null&&(t.seed=e.seed),e.providerId==="zai"&&e.tools&&e.tools.length>0&&(t.tool_stream=!0);let o=E({provider:e.providerId,model:e.model});return e.tools&&e.tools.length>0&&o?.requestThinking==="zai_clear_thinking"&&(t.thinking={type:"enabled",clear_thinking:!q(e.messages)}),e.tools&&e.tools.length>0&&o?.requestThinking==="deepseek_enabled"&&(t.thinking={type:"enabled"}),e.toolChoice!==void 0&&o?.supportsToolChoice!==!1&&(t.tool_choice=e.toolChoice),t}i(Ae,"buildChatCompletionBody");function Oe(e){return e.map(t=>{let{continuation:o,images:n,...r}=t,s=n?.length?[...typeof t.content=="string"&&t.content.trim()?[{type:"text",text:t.content}]:[],...n.map(l=>({type:"image_url",image_url:{url:l.url,...l.detail?{detail:l.detail}:{}}}))]:t.content;return o?.kind==="chat_completions_reasoning"?{...r,...s!==void 0?{content:s}:{},reasoning_content:o.reasoningContent}:{...r,...s!==void 0?{content:s}:{}}})}i(Oe,"chatCompletionMessages");function Te(e){let t=Se(e.messages),o={model:e.model,input:t.input,stream:!0,store:!1};t.instructions&&(o.instructions=t.instructions),e.promptCacheKey&&(o.prompt_cache_key=e.promptCacheKey),o.reasoning={...e.reasoningEffort?{effort:e.reasoningEffort}:{},summary:"auto"},e.maxOutputTokens!=null&&(o.max_output_tokens=e.maxOutputTokens),e.temperature!=null&&(o.temperature=e.temperature),e.topP!=null&&(o.top_p=e.topP);let n=Re(e.tools);n.length>0&&(o.tools=n);let r=Ee(e.toolChoice);return r!==void 0&&(o.tool_choice=r),o}i(Te,"buildResponsesBody");function Ie(e){let t=e?.trim();if(t)return t.length<=64?t:J("sha256").update(t).digest("hex")}i(Ie,"normalizedPromptCacheKey");function Se(e){let t=[],o=[];for(let n of e){let r=typeof n.content=="string"?n.content:"";if(n.role==="system"){r.trim()&&t.push(r.trim());continue}if(n.role==="tool"){o.push({type:"function_call_output",call_id:n.tool_call_id,output:r});continue}n.continuation?.kind==="responses_reasoning_items"&&o.push(...n.continuation.items),(r.trim()||n.images?.length)&&o.push({type:"message",role:n.role,content:[...r.trim()?[{type:n.role==="assistant"?"output_text":"input_text",text:r}]:[],...(n.images??[]).map(s=>({type:"input_image",image_url:s.url,...s.detail?{detail:s.detail}:{}}))]});for(let s of n.tool_calls??[]){let l=s.function&&typeof s.function=="object"?s.function:{};o.push({type:"function_call",call_id:s.id,name:l.name,arguments:typeof l.arguments=="string"?l.arguments:""})}}return{instructions:t.join(`
|
|
3
3
|
|
|
4
4
|
`)||null,input:o}}i(Se,"responsesInputFromMessages");function xe(e){if(!e||typeof e!="object")return[];let t=e,o=m(t.type);if(o==="response.output_item.done"){let r=t.item&&typeof t.item=="object"?t.item:null;return r?.type==="reasoning"?[r]:[]}if(o!=="response.completed")return[];let n=t.response&&typeof t.response=="object"?t.response:null;return Array.isArray(n?.output)?n.output.filter(r=>!!r&&typeof r=="object"&&r.type==="reasoning"):[]}i(xe,"responsesReasoningItemsFromEvent");function Re(e){return(e??[]).filter(t=>t.type==="function"&&t.function?.name).map(t=>({type:"function",name:t.function.name,description:t.function.description,parameters:t.function.parameters??{}}))}i(Re,"responsesTools");function Ee(e){if(e!==void 0)return typeof e=="string"?e:{type:"function",name:e.function.name}}i(Ee,"responsesToolChoice");function Me(e){let t=[],o=[];for(let n of e){if(n.role==="system"){let r=typeof n.content=="string"?n.content.trim():"";r&&t.push(r);continue}o.push(n)}return t.length===0?e:[{role:"system",content:t.join(`
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{A as O,l as U,o as W,p as K,q,t as X}from"./chunk-
|
|
2
|
+
import{A as O,l as U,o as W,p as K,q,t as X}from"./chunk-TW3SRBLU.js";import{la as y,ta as N,ya as V}from"./chunk-PGO4FRHU.js";import{N as D}from"./chunk-4M3YW3EQ.js";import{A as F,B as z,Ba as P,H as G,I as A,Xa as $,Ya as L,Za as J}from"./chunk-PBZCXPPC.js";import{i as B,l as j,m as E,n as g}from"./chunk-VVNV4NNW.js";import{a as f}from"./chunk-FTQLQJQV.js";import{createHash as Y}from"node:crypto";import{mkdir as Z,readdir as ie,readFile as H,writeFile as Q}from"node:fs/promises";import m from"node:path";async function Ae(e,t){let a=y.parse(e),s=["tasks","assets","environment","graders","rubrics","comparisons","metrics","fixtures"];await Promise.all(s.map(w=>Z(m.join(t,w),{recursive:!0})));let i=await oe(a,t);if(a.metrics.customAggregator){let w=m.join(t,a.metrics.customAggregator.module),v=Y("sha256").update(await H(w)).digest("hex");a=y.parse({...a,metrics:{...a.metrics,customAggregator:{...a.metrics.customAggregator,contentHash:v}}})}let c=m.join(t,"taskset.json"),d=m.join(t,"tasks","tasks.jsonl"),n=m.join(t,"graders","graders.json"),o=m.join(t,"fixtures","grader-fixtures.json"),u=m.join(t,"metrics","policy.json"),r=m.join(t,"assets","manifest.json"),l=m.join(t,"environment","contract.json"),p=m.join(t,"rubrics","preference-review.md"),k=m.join(t,"comparisons","policy.json");return await Promise.all([...K(a)].map(([w,v])=>Q(m.join(t,w),v,"utf8"))),{directory:t,files:[c,d,r,l,n,p,k,u,o,...i],draft:a}}f(Ae,"writeTasksetDraftPackage");async function _e(e){let t=await ce(e),a=Y("sha256");for(let s of t)a.update(m.relative(e,s).replaceAll(m.sep,"/")),a.update("\0"),a.update(await H(s)),a.update("\0");return a.digest("hex")}f(_e,"hashTasksetDraftPackage");async function ee(e,t){let a=m.basename(e)==="taskset.json"?e:m.join(e,"taskset.json"),s=m.dirname(a),i=f(async n=>{if(!t)return H(n,"utf8");let o=t.get(m.relative(s,n).replaceAll(m.sep,"/"));if(!o)throw Object.assign(new Error("Authored file is absent."),{code:"ENOENT"});return new TextDecoder("utf-8",{fatal:!0}).decode(o)},"read"),c=JSON.parse(await i(a)),d=y.safeParse(c);if(d.success){let[n,o,u,r,l,p]=await Promise.all([de(m.join(s,"tasks","tasks.jsonl"),i),I(m.join(s,"graders","graders.json"),i),I(m.join(s,"fixtures","grader-fixtures.json"),i),I(m.join(s,"metrics","policy.json"),i),I(m.join(s,"environment","contract.json"),i),I(m.join(s,"comparisons","policy.json"),i)]);return y.parse({...d.data,...n===null?{}:{tasks:n},...o===null?{}:{graders:o},...u===null?{}:{graderFixtures:u},...r===null?{}:{metrics:r},...l===null?{}:{environment:l},...p===null?{}:{review:p}})}return O(c)}f(ee,"readTasksetDraftPackage");async function oe(e,t){let a=W(e),s=[];for(let i of a){let c=m.join(t,i.relativePath);await Z(m.dirname(c),{recursive:!0});try{await Q(c,i.source,{encoding:"utf8",flag:"wx"})}catch(d){if(!le(d))throw d}s.push(c)}return s}f(oe,"writeConfiguredStarterCode");async function ce(e){let t=[];async function a(s){let i=await ie(s,{withFileTypes:!0});i.sort((c,d)=>c.name.localeCompare(d.name));for(let c of i){let d=m.join(s,c.name);if(c.isSymbolicLink())throw new Error(`Taskset workspaces cannot contain symbolic links: ${d}`);c.isDirectory()?await a(d):c.isFile()&&t.push(d)}}return f(a,"visit"),await a(e),t}f(ce,"packageFiles");async function I(e,t=a=>H(a,"utf8")){try{return JSON.parse(await t(e))}catch(a){if(te(a))return null;throw a}}f(I,"readOptionalJson");async function de(e,t=a=>H(a,"utf8")){try{return(await t(e)).split(/\r?\n/).map(s=>s.trim()).filter(Boolean).map(s=>JSON.parse(s))}catch(a){if(te(a))return null;throw a}}f(de,"readOptionalJsonLines");function te(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}f(te,"isMissingFile");function le(e){return e instanceof Error&&"code"in e&&e.code==="EEXIST"}f(le,"isFileExists");import{constants as re}from"node:fs";import{lstat as fe,open as me,readdir as ue}from"node:fs/promises";import _ from"node:path";async function Ge(e){let t=_.resolve(e.directory);if(!(await fe(t)).isDirectory())throw new Error("Dataset upload requires a regular authored folder.");let a=new Map,s=0;async function i(r,l){if(l>30)throw new Error("Dataset folder nesting exceeds 30 levels.");for(let p of(await ue(r,{withFileTypes:!0})).sort((k,w)=>k.name<w.name?-1:k.name>w.name?1:0)){if(p.name.startsWith("."))throw new Error("Dataset folders cannot include hidden files or directories.");if(p.isSymbolicLink()||!p.isDirectory()&&!p.isFile())throw new Error("Dataset folders can contain only regular files and directories.");let k=_.join(r,p.name);if(p.isDirectory()){await i(k,l+1);continue}if(a.size>=1e4)throw new Error("Dataset folder exceeds 10,000 files.");let w=await me(k,re.O_RDONLY|re.O_NOFOLLOW);try{let v=await w.stat();if(!v.isFile()||v.size>(e.maximumBytes??q)-s)throw new Error("Dataset folder exceeds its capture byte limit.");let R=new Uint8Array(v.size),S=0;for(;S<R.length;){let M=await w.read(R,S,R.length-S,S);if(!M.bytesRead)throw new Error("Dataset file changed during capture.");S+=M.bytesRead}let C=await w.stat();if(C.size!==v.size||C.mtimeMs!==v.mtimeMs||C.ctimeMs!==v.ctimeMs)throw new Error("Dataset file changed during capture.");s+=R.length,a.set(_.relative(t,k).replaceAll(_.sep,"/"),R)}finally{await w.close()}}}f(i,"visit"),await i(t,0);let c=await ee(t,a),d=[...a].map(([r,l])=>({path:r,contentHash:E(l),sizeBytes:l.byteLength})),n=g(d),o=y.parse({...c,id:e.datasetId??c.id,profileId:e.teamId,revision:e.expectedRevision+1,modelScope:null,status:"draft",publishedTasksetRef:null,metadata:{...c.metadata,importedTasksetPackage:{packageHash:n}}});return{workspace:X({schemaVersion:"openpond.tasksetDraftWorkspace.v1",draft:o,files:[...a].filter(([r])=>!U(r)).map(([r,l])=>({path:r,base64:Buffer.from(l).toString("base64"),contentHash:E(l),sizeBytes:l.byteLength}))},e.maximumBytes),sourceHash:n,sourceFiles:d,capturedBytes:s}}f(Ge,"captureTasksetDraftWorkspace");async function ae(e){let{binding:t,rewards:a}=e.learning,s=$(t,a),i=new Set(e.graders.map(r=>r.id));if(!i.size||i.size!==e.graders.length||e.graders.some(r=>{let l=s.find(p=>p.source.graderId===r.id);return!l||r.version!==String(l.reward.revision)||g(r.metadata.rewardBinding)!==g(D(t))}))throw new Error("Calibration graders differ from the immutable Reward binding.");let c=L(t,a).filter(r=>i.has(r.id)),d=P.parse({id:e.task.id,clusterKey:e.task.clusterKey,split:e.task.split,input:e.task.input,expectedOutput:e.task.expectedOutput,policyVisibleContext:e.task.policyVisibleContext,privilegedContextRef:e.task.privilegedContextRef,artifactRefs:[],tags:e.task.tags}),n=await G({task:d,graders:c,signal:e.signal,evidence:{output:e.attempt.output,artifactRefs:e.attempt.artifactRefs,runtimeEventRefs:e.attempt.runtimeEventRefs,infrastructureError:e.attempt.infrastructureError},customVerifier:e.customVerifier?async({grader:r})=>{let l=e.graders.find(k=>k.id===r.id);if(l?.kind!=="custom_verifier")throw new Error("Calibration verifier projection is missing.");let p=await e.customVerifier({grader:l,task:e.task,attempt:e.attempt,signal:e.signal});return{score:p.score,passed:p.passed,rewardEligible:r.rewardEligible,failureClass:null,feedback:[p.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:p.evidenceRefs??[]}}:void 0,modelJudge:e.modelJudge?async({grader:r})=>{let l=e.graders.find(k=>k.id===r.id);if(l?.kind!=="model_judge")throw new Error("Calibration judge projection is missing.");let p=await e.modelJudge({grader:l,task:e.task,attempt:e.attempt});return{score:p.score,passed:p.passed,rewardEligible:r.rewardEligible,failureClass:null,feedback:[p.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:p.evidenceRefs??[]}}:void 0}),o=A({graders:c,components:n,infrastructureError:e.attempt.infrastructureError}),u=n.map(r=>{let l=e.graders.find(p=>p.id===r.graderId);return{graderId:r.graderId,graderVersion:r.graderVersion,score:r.score,passed:r.passed,hardGate:l.hardGate,rewardEligible:r.rewardEligible,feedback:r.feedback.join(`
|
|
3
3
|
`)||null,evidenceRefs:[...r.visibleEvidenceRefs,...r.privilegedEvidenceRefs],judge:l.kind==="model_judge"?l.judge:null,calibrationStatus:l.kind==="model_judge"?l.calibrationStatus:"not_applicable"}});return{schemaVersion:"openpond.gradeResult.v1",id:`calibration_${g([e.attempt.id,t.contentHash,n]).slice(0,24)}`,attemptId:e.attempt.id,graderSetHash:g(e.graders),score:o.score,passed:o.passed,components:u,failureClass:o.failureClass,feedback:n.flatMap(r=>r.feedback),rewardEligible:o.rewardEligible,createdAt:e.now?.()??new Date().toISOString()}}f(ae,"gradeLearningCalibrationAttempt");async function se(e){let{binding:t,rewards:a}=e.learning,s=$(t,a);if(e.graders.length!==s.length||s.some(({source:o,reward:u})=>!e.graders.some(r=>r.id===o.graderId&&r.version===String(u.revision)&&g(r.metadata.rewardBinding)===g(D(t)))))throw new Error("Prepared Taskset graders do not match their immutable Reward binding.");let i=P.parse({id:e.task.id,clusterKey:e.task.clusterKey,split:e.task.split,input:e.task.input,expectedOutput:e.task.expectedOutput,policyVisibleContext:e.task.policyVisibleContext,privilegedContextRef:e.task.privilegedContextRef,artifactRefs:[],tags:e.task.tags}),c=await J({binding:t,rewards:a,task:i,signal:e.signal,evidence:{output:e.attempt.output,artifactRefs:e.attempt.artifactRefs,runtimeEventRefs:e.attempt.runtimeEventRefs,infrastructureError:e.attempt.infrastructureError},customVerifier:e.customVerifier?async({grader:o})=>{let u=e.graders.find(l=>l.id===o.id);if(u?.kind!=="custom_verifier")throw new Error("Bound verifier projection is missing.");let r=await e.customVerifier({grader:u,task:e.task,attempt:e.attempt,signal:e.signal});return{score:r.score,passed:r.passed,rewardEligible:o.rewardEligible,failureClass:null,feedback:[r.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:r.evidenceRefs??[]}}:void 0,modelJudge:e.modelJudge?async({grader:o})=>{let u=e.graders.find(l=>l.id===o.id);if(u?.kind!=="model_judge")throw new Error("Bound judge projection is missing.");let r=await e.modelJudge({grader:u,task:e.task,attempt:e.attempt});return{score:r.score,passed:r.passed,rewardEligible:o.rewardEligible,failureClass:null,feedback:[r.feedback],visibleEvidenceRefs:[],privilegedEvidenceRefs:r.evidenceRefs??[]}}:void 0}),d=c.training.status==="not_configured"?c.evaluation:c.training,n=g(e.graders);return{schemaVersion:"openpond.gradeResult.v1",id:`grade_${g([e.attempt.id,c.contentHash]).slice(0,24)}`,attemptId:e.attempt.id,graderSetHash:n,score:d.score,passed:d.passed===!0,components:c.results.map(o=>{let u=t.sources.find(l=>l.graderId===o.graderId),r=e.graders.find(l=>l.id===o.graderId);return{graderId:o.graderId,graderVersion:r.version,score:o.normalizedScore,passed:o.passed===!0,hardGate:u.hardGate,rewardEligible:u.role==="training"&&o.status==="scored",feedback:o.message?.trim()||null,evidenceRefs:o.evidenceHashes,judge:r.kind==="model_judge"?r.judge:null,calibrationStatus:r.kind==="model_judge"?r.calibrationStatus:"not_applicable"}}),failureClass:e.attempt.infrastructureError?"infrastructure_failure":d.status!=="scored"?"grader_failure":d.passed?null:"policy_failure",feedback:c.results.flatMap(o=>o.message?.trim()?[o.message.trim()]:[]),rewardEligible:c.training.status==="scored",rewardComposition:c,createdAt:e.now?.()??new Date().toISOString()}}f(se,"gradeLearningBatchAttempt");async function ft(e){return e.learning?ae({...e,learning:e.learning}):he(e)}f(ft,"gradeCalibrationAttempt");async function he(e){if(e.learning)return se({...e,learning:e.learning});if(e.graders.some(i=>i.metadata.rewardBinding!==void 0))throw new Error("This Taskset requires its immutable public Reward binding to grade an attempt.");let t=g(e.graders),a=[];for(let i of e.graders)e.signal?.throwIfAborted(),a.push(e.attempt.infrastructureError?b(i,null,!1,"Infrastructure failure; no reward was produced.",[],!1):await we(i,e.task,e.attempt,e.modelJudge,e.customVerifier,e.signal));let s=A({graders:e.graders,infrastructureError:e.attempt.infrastructureError,components:a.map(i=>({...i,failureClass:i.score===null?"grader_failure":i.passed?null:"policy_failure"}))});return{schemaVersion:"openpond.gradeResult.v1",id:`grade_${g([e.attempt.id,t,a]).slice(0,24)}`,attemptId:e.attempt.id,graderSetHash:t,score:s.score,passed:s.passed,components:a,failureClass:s.failureClass,feedback:e.attempt.infrastructureError?[e.attempt.infrastructureError]:a.flatMap(i=>i.feedback?[i.feedback]:[]),rewardEligible:s.rewardEligible,createdAt:e.now?.()??new Date().toISOString()}}f(he,"gradeAttempt");async function we(e,t,a,s,i,c){if(e.kind==="model_judge"){if(!s)return b(e,null,!1,"Model judge runner is unavailable.",[],!1);if(e.calibrationStatus!=="passed")return b(e,null,!1,"Model judge calibration has not passed.",[],!1);let n=await s({grader:e,task:t,attempt:a});return b(e,n.score,n.passed,n.feedback,n.evidenceRefs??[])}if(e.kind==="human")return b(e,null,!1,"Human review is pending.",[],!1);if(e.kind==="custom_verifier"){if(!i)return b(e,null,!1,"Sandboxed verifier runner is unavailable.",[],!1);let n=await i({grader:e,task:t,attempt:a,signal:c});return b(e,n.score,n.passed,n.feedback,n.evidenceRefs??[])}let d=F({grader:z(e),task:t,evidence:a});return b(e,d.score,d.passed,d.feedback,[...a.artifactRefs,...a.runtimeEventRefs])}f(we,"runGrader");function b(e,t,a,s,i,c=e.rewardEligible){let d=t!==null&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null;return{graderId:e.id,graderVersion:e.version,score:d,passed:d!==null&&a,hardGate:e.hardGate,rewardEligible:d!==null&&c,feedback:s,evidenceRefs:i,judge:e.kind==="model_judge"?e.judge:null,calibrationStatus:e.kind==="model_judge"?e.calibrationStatus:"not_applicable"}}f(b,"component");import{access as ke,mkdir as T,readFile as ve,writeFile as x}from"node:fs/promises";import h from"node:path";async function Ft(e,t,a={}){let s=N.parse(e),i=new Map(s.graders.flatMap(n=>{if(n.kind!=="custom_verifier")return[];let o=B.safeParse(n.metadata.portableVerifierRef);return o.success&&o.data.visibility!=="policy"&&o.data.path===n.module?[[n.module,o.data]]:[]})),c=V(s);if(!c.valid)throw new Error(c.issues.map(n=>`${n.code}: ${n.message}`).join(`
|
|
4
4
|
`));await T(h.join(t,"data"),{recursive:!0}),await T(h.join(t,"graders"),{recursive:!0}),await T(h.join(t,"environment"),{recursive:!0}),await T(h.join(t,"fixtures"),{recursive:!0});let d=[h.join(t,"taskset.json"),h.join(t,"capabilities.json"),h.join(t,"data","tasks.jsonl"),h.join(t,"graders","graders.json"),h.join(t,"fixtures","grader-fixtures.json"),h.join(t,"environment","taskset.ts")];await x(d[0],j(s),"utf8"),await x(d[1],j(s.capabilities),"utf8"),await x(d[2],s.tasks.map(n=>JSON.stringify(n)).join(`
|
|
5
5
|
`)+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{e as S}from"./chunk-
|
|
2
|
+
import{e as S}from"./chunk-NWOK6NLE.js";import{Z as h}from"./chunk-5MTN6KXV.js";import{a as A}from"./chunk-IZ56L2ZK.js";import{a as b,e as H,f as w,j as f}from"./chunk-OZ6LRNRE.js";import{f as O,g as k}from"./chunk-PBZCXPPC.js";import{e as I,i as P}from"./chunk-NJLULBTM.js";import{n as g}from"./chunk-VVNV4NNW.js";import{A as c}from"./chunk-PF56N7ZY.js";import{a as u}from"./chunk-FTQLQJQV.js";import{randomUUID as T}from"node:crypto";import{readFile as v}from"node:fs/promises";import p from"node:path";import{randomUUID as $}from"node:crypto";var y=c.object({revision:c.number().int().nonnegative(),overlay:H}).strict(),z=y.extend({proposal:w}).strict(),m=class{constructor(e){this.client=e}client;static{u(this,"HostedHarnessOverlayStorage")}async getHarnessRunOverlay(e){let s=await this.client.request({contractVersion:h,requestId:$(),operation:"harness/overlay/get",params:{runId:e}});return s===null?null:y.parse(s).overlay}async putHarnessRunOverlay(e){let s=H.parse(e.overlay);if(!e.requestId.trim()||s.revision!==(e.expectedRevision===null?0:e.expectedRevision+1))throw new Error("Hosted Harness overlay mutation requires a stable request and next revision.");let r=y.parse(await this.client.request({contractVersion:h,requestId:e.requestId,operation:"harness/overlay/put",params:{runId:s.runId,expectedRevision:e.expectedRevision,overlay:s}}));if(r.revision!==s.revision||r.overlay.contentHash!==s.contentHash)throw new Error("Host Harness overlay response changed committed identity.");return r.overlay}async createHarnessRunOverlay(e){if(e.revision!==0||e.status!=="active")throw new Error("A new Harness run overlay must be active at revision 0.");return this.putHarnessRunOverlay({overlay:e,expectedRevision:null,requestId:`harness-overlay:${e.runId}:${e.contentHash}`})}async ensureHarnessRunOverlay(e){let s=await this.getHarnessRunOverlay(e.runId);if(s){if(s.workspace.workspaceId!==e.workspace.id||s.baseHarnessRelease.id!==e.harnessRelease.id||s.baseHarnessRelease.contentHash!==e.harnessRelease.contentHash)throw new Error("The durable Agent run is already bound to another Harness release.");return s}let r=f({schemaVersion:"openpond.harnessRunOverlay.v1",id:`overlay-${g({runId:e.runId,harnessRelease:e.harnessRelease}).slice(0,24)}`,runId:e.runId,baseHarnessRelease:e.harnessRelease,workspace:{workspaceId:e.workspace.id,revision:e.workspace.revision,sourceRevision:e.workspace.sourceRevision,channelRevision:e.workspace.currentChannel.revision},revision:0,status:"active",edits:[],createdAt:e.admittedAt,updatedAt:e.admittedAt,metadata:{}});return this.createHarnessRunOverlay(r)}async appendHarnessRunOverlayEditsAtomically(e){return this.transition(e,"append")}async freezeHarnessRunOverlayAtomically(e){return this.transition({...e,edits:[]},"freeze")}async abandonHarnessRunOverlayAtomically(e){return this.transition({...e,edits:[]},"abandon")}async freezeHarnessRunOverlayWithProposalAtomically(e){let s=await this.getHarnessRunOverlay(e.runId);if(!s||s.revision!==e.expectedRevision||s.status!=="active")throw new Error("Hosted Harness overlay revision or status changed.");let r=new Set(s.edits.map(i=>i.id));for(let i of e.edits){if(r.has(i.id))throw new Error(`Harness overlay edit id already exists: ${i.id}.`);r.add(i.id)}let{contentHash:l,...n}=s,t=f({...n,revision:s.revision+1,status:"frozen",edits:[...s.edits,...e.edits],updatedAt:e.updatedAt}),d=w.parse(e.buildProposal(t)),a=z.parse(await this.client.request({contractVersion:h,requestId:`harness-proposal:${t.runId}:${d.contentHash}`,operation:"harness/overlay/freezeProposal",params:{runId:t.runId,expectedRevision:s.revision,overlay:t,proposal:d}}));if(a.overlay.contentHash!==t.contentHash||a.proposal.contentHash!==d.contentHash)throw new Error("Host Harness proposal response changed committed identity.");return{overlay:a.overlay,proposal:a.proposal}}async transition(e,s){let r=await this.getHarnessRunOverlay(e.runId);if(!r||r.revision!==e.expectedRevision||r.status==="abandoned"||s!=="abandon"&&r.status!=="active")throw new Error("Hosted Harness overlay revision or status changed.");if(s==="append"&&e.edits.length===0)throw new Error("Harness overlay append requires edits.");let l=new Set(r.edits.map(a=>a.id));for(let a of e.edits){if(l.has(a.id))throw new Error(`Harness overlay edit id already exists: ${a.id}.`);l.add(a.id)}let{contentHash:n,...t}=r,d=f({...t,revision:r.revision+1,status:s==="append"?"active":s==="freeze"?"frozen":"abandoned",edits:[...r.edits,...e.edits],updatedAt:e.updatedAt});return this.putHarnessRunOverlay({overlay:d,expectedRevision:r.revision,requestId:`harness-overlay:${d.runId}:${d.contentHash}`})}};var N=c.object({workspace:b,release:c.object({id:c.string().min(1),contentHash:c.string().regex(/^[a-f0-9]{64}$/),sourceRevision:c.string().min(1),assetsPath:c.string().min(1)}).strict()}).strict();async function C(o,e=null){let s=await o.request({contractVersion:h,requestId:T(),operation:"harness/get",params:{reference:e}});if(s===null)return null;let r=N.parse(s);if(!p.isAbsolute(r.release.assetsPath))throw new Error("Hosted Harness assets path must be absolute.");let[l,n]=await Promise.all([v(p.join(r.release.assetsPath,"agent-snapshot.json"),"utf8"),v(p.join(r.release.assetsPath,"harness-release.json"),"utf8")]),t=A.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:r.workspace.id,sourceRevision:r.release.sourceRevision,agentSnapshot:I.parse(JSON.parse(l)),harnessRelease:P.parse(JSON.parse(n)),bundlePath:r.release.assetsPath,createdAt:new Date().toISOString()});if(t.harnessRelease.id!==r.release.id||t.harnessRelease.contentHash!==r.release.contentHash||(e!==null?e.id!==r.release.id||e.contentHash!==r.release.contentHash:r.workspace.currentChannel.release?.contentHash!==r.release.contentHash))throw new Error("Hosted Harness release differs from its bound workspace.");return S({workspace:r.workspace,release:t})}u(C,"loadHostedHarnessRuntime");async function se(o,e){let s=e.profileComponentBinding,r=e.profileWorkflowBinding;if(s){if(r||e.currentProfile?.profileId!==s.profileId)throw new Error("Profile component binding differs from the session Profile reference.");let n=await x(o,s.harnessRelease);if(E(n,s.profileId,s.sourceRevision,e.currentProfile?.repositoryId),s.target.kind==="profile")return n;if(s.target.kind==="skill"){let i=s.target.skillPath;if(!n.release.agentSnapshot.skills.some(j=>j.path===i))throw new Error("Bound Profile Skill is unavailable in its released source.");let R=await v(p.join(n.release.bundlePath,"source",i),"utf8");return{...n,instructionContext:[n.instructionContext,`Released Profile Skill (${i}):
|
|
3
3
|
${R}`].join(`
|
|
4
4
|
|
|
5
5
|
`)}}let t=await q(n),d=s.target.actionId,a=t.actions.find(i=>i.id===d);if(!a)throw new Error("Bound Profile Agent action is unavailable in its released source.");return{...n,workflowAction:a}}if(r){if(e.currentProfile?.profileId!==r.profileId)throw new Error("Profile workflow binding differs from the session Profile reference.");let n=await x(o,r.harnessRelease);E(n,r.profileId,r.sourceRevision,e.currentProfile?.repositoryId);let t=await q(n),d=k({binding:r,harnessRelease:n.release.harnessRelease,catalog:t.catalog,catalogHash:t.catalogHash}),a=d.invocation.kind==="agent_action"?d.invocation.actionId:null,i=a?t.actions.find(R=>R.id===a):void 0;if(a&&!i)throw new Error(`Bound Profile action ${a} is missing from its release.`);return{...n,workflow:d,...i?{workflowAction:i}:{}}}let l=await new m(o).getHarnessRunOverlay(e.id);return C(o,l?.baseHarnessRelease??null)}u(se,"loadHostedHarnessRuntimeForSession");async function x(o,e){let s=await C(o,e);if(!s)throw new Error("The bound Profile Harness release is unavailable.");return s}u(x,"requireRelease");function E(o,e,s,r){let l=o.release.harnessRelease.metadata.profile;if(!l||typeof l!="object"||l.id!==e||l.sourceRevision!==s||l.repositoryId!==void 0&&l.repositoryId!==r)throw new Error("Bound Profile source differs from its released Harness source.")}u(E,"assertProfileProvenance");async function q(o){let e=p.join(o.release.bundlePath,"source"),[s,r]=await Promise.all([v(p.join(e,"workflows","catalog.json")),v(p.join(e,"workflows","actions.json"))]);return O({agentSnapshot:o.release.agentSnapshot,harnessRelease:o.release.harnessRelease,catalogBytes:s,actionBytes:r})}u(q,"loadHostedProfileCatalog");export{m as a,C as b,se as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{P as k,Q as E,_ as S}from"./chunk-KK626T3Z.js";import{f as B}from"./chunk-UGOK7VTC.js";import{a as l}from"./chunk-FTQLQJQV.js";import T from"node:path";var P="default",H=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}l(y,"hasOwn");function m(t){if(typeof t!="string")return null;let e=t.trim();return e.length>0?e:null}l(m,"normalizeHandle");function d(t){if(typeof t!="string")return null;let e=t.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function N(t){let e=m(t);if(!e)throw new Error("profile handle must be non-empty");return e}l(N,"requireHandle");function $(t){if(typeof t!="string")throw new Error("apiKey must be a non-empty string");let e=t.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l($,"requireApiKey");function b(t,e){let n=m(t),s=m(e);return!!(n&&s&&n.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function R(t,e,n){let s=d(n);return t.findIndex(r=>b(r.handle,e)?s?d(r.baseUrl)===s:!0:!1)}l(R,"findAccountIndex");function U(t){let e=m(t.handle)??P,n=d(t.baseUrl);return n?{handle:e,baseUrl:n}:{handle:e}}l(U,"selectorFromAccount");function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:n,baseUrl:s}:{handle:n}}l(A,"sanitizeActiveProfile");function x(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!n)return;let r={repoPath:n,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,c=o.status,f=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(c==="passed"||c==="failed")&&typeof f=="string"&&(r.lastCheck={command:a,status:c,checkedAt:f,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,c=o.pushedAt;(a==="pushed"||a==="failed")&&typeof c=="string"&&(r.lastPush={status:a,pushedAt:c,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...z(o.hostedSourceMaterialization)?{hostedSourceMaterialization:z(o.hostedSourceMaterialization)}:{},...K(o.hostedSourceCheck)?{hostedSourceCheck:K(o.hostedSourceCheck)}:{},...j(o.hostedPublish)?{hostedPublish:j(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let c=x(a);if(!c)return[];let f=a,p=f.source==="github"||f.source==="openpond_git"?f.source:"local",g=typeof f.repositoryId=="string"&&f.repositoryId.trim()?f.repositoryId.trim():T.resolve(c.repoPath);return[{source:p,repositoryId:g,repoPath:c.repoPath,profile:c.profile,...c.lastCheck?{lastCheck:c.lastCheck}:{},...c.lastPush?{lastPush:c.lastPush}:{}}]});o.length>0&&(r.profiles=o)}return r}l(x,"sanitizeLocalOpenPondProfile");function z(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runtimeAgentId"),...i(e,"projectId"),...i(e,"sourceRoot"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"manifestSyncedAt"),...O(e,"fileCount"),...O(e,"totalBytes"),...i(e,"generatedManifestPath"),...C(e,"synthesizedOpenPondYaml"),...i(e,"uploadMetadataPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...i(e,"materializedAt"),...i(e,"error")}:null}l(z,"sanitizeHostedMaterializationStatus");function K(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"deployPlanStatus"),...C(e,"canRun"),...C(e,"canDeploy"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...u(e,"requiredChecks"),...u(e,"evalNames"),...u(e,"blockedReasons"),...u(e,"staleReasons"),...i(e,"runtimeId"),...i(e,"sandboxId"),...u(e,"traceArtifactRefs"),...u(e,"evalResultArtifactRefs"),...u(e,"validatorArtifactRefs"),...i(e,"checkedAt"),...i(e,"error")}:null}l(K,"sanitizeHostedSourceCheckStatus");function j(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"snapshotId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"buildStatus"),...i(e,"validationStatus"),...i(e,"evalStatus"),...i(e,"publishedAt"),...i(e,"error")}:null}l(j,"sanitizeHostedPublishStatus");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runId"),...i(e,"runtimeId"),...i(e,"sandboxId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"setupGateStatus"),...u(e,"setupRequirementRefs"),...u(e,"artifactRefs"),...u(e,"traceArtifactRefs"),...u(e,"evalArtifactRefs"),...i(e,"startedAt"),...i(e,"completedAt"),...i(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function i(t,e){let n=t[e];return typeof n=="string"||n===null?{[e]:n}:{}}l(i,"nullableStringProp");function C(t,e){let n=t[e];return typeof n=="boolean"||n===null?{[e]:n}:{}}l(C,"nullableBooleanProp");function O(t,e){let n=t[e];return typeof n=="number"||n===null?{[e]:n}:{}}l(O,"nullableNumberProp");function u(t,e){let n=t[e];if(!Array.isArray(n))return{};let s=n.filter(r=>typeof r=="string");return{[e]:s}}l(u,"stringArrayProp");function I(t){return typeof t=="string"&&t.trim()?t.trim():null}l(I,"stringField");function D(t,e){if(!b(t.handle,e.handle))return!1;let n=d(e.baseUrl);return n?d(t.baseUrl)===n:!d(t.baseUrl)}l(D,"accountMatchesSelector");function v(t,e,n={}){let s=d(e.baseUrl);if(s)return R(t,e.handle,s);let r=t.findIndex(a=>D(a,e));if(r!==-1)return r;let o=t.map((a,c)=>({account:a,index:c})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&n.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(v,"findAccountIndexForSelector");function F(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n={};return typeof e.token=="string"&&(n.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(n.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(n.conversationId=e.conversationId),Object.keys(n).length>0?n:void 0}l(F,"sanitizeSession");function Y(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s={handle:n};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let r=F(e.session);return r&&(s.session=r),s}l(Y,"sanitizeAccount");function J(t){let e={};return typeof t.token=="string"&&(e.token=t.token),(typeof t.appId=="string"||t.appId===null)&&(e.appId=t.appId),(typeof t.conversationId=="string"||t.conversationId===null)&&(e.conversationId=t.conversationId),Object.keys(e).length>0?e:void 0}l(J,"extractLegacySession");function Q(t,e){let n={handle:e};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseUrl=="string"&&(n.baseUrl=t.baseUrl),typeof t.apiBaseUrl=="string"&&(n.apiBaseUrl=t.apiBaseUrl),typeof t.chatApiBaseUrl=="string"&&(n.chatApiBaseUrl=t.chatApiBaseUrl);let s=J(t);return s&&(n.session=s),n}l(Q,"extractLegacyAccount");function L(t){let e={};typeof t.lspEnabled=="boolean"&&(e.lspEnabled=t.lspEnabled),(t.executionMode==="local"||t.executionMode==="hosted")&&(e.executionMode=t.executionMode),(t.mode==="general"||t.mode==="builder")&&(e.mode=t.mode);let n=x(t.openpondProfile);n&&(e.openpondProfile=n);let s=[],r=Array.isArray(t.accounts)?t.accounts:[];for(let f of r){let p=Y(f);p&&R(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let f=A(t.activeProfile)?.handle||P;s.push(Q(t,f))}let o=A(t.activeProfile),a=o?v(s,o):-1,c=s[a===-1?0:a];return e.accounts=s,e.activeProfile=U(c),e}l(L,"normalizeGlobalConfig");function V(t,e,n){let s=t.accounts??[],r=d(n??process.env.OPENPOND_BASE_URL),o=m(e);if(o)return r?{handle:o,baseUrl:r}:{handle:o};let a=m(process.env.OPENPOND_ACCOUNT);if(a)return r?{handle:a,baseUrl:r}:{handle:a};let c=A(t.activeProfile);return c?r?{handle:c.handle,baseUrl:r}:c:s[0]?U(s[0]):{handle:P}}l(V,"resolveRequestedProfile");function w(t,e,n){let s=d(n);if(s){let o=R(t,e,s);if(o!==-1)return t[o]}else{let o=t.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let r={handle:e};return s&&(r.baseUrl=s),t.push(r),r}l(w,"ensureAccount");function q(t){t.session&&Object.keys(t.session).length===0&&delete t.session}l(q,"cleanupAccount");function W(t,e,n,s){let r=n===null||n===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(r){delete t.apiKey;return}typeof n=="string"&&(t.apiKey=n);return}case"baseUrl":{if(r){delete t.baseUrl;return}typeof n=="string"&&(t.baseUrl=n);return}case"apiBaseUrl":{if(r){delete t.apiBaseUrl;return}typeof n=="string"&&(t.apiBaseUrl=n);return}case"chatApiBaseUrl":{if(r){delete t.chatApiBaseUrl;return}typeof n=="string"&&(t.chatApiBaseUrl=n);return}case"token":case"appId":case"conversationId":{if(t.session||(t.session={}),r){delete t.session[e],q(t);return}(typeof n=="string"||n===null)&&(t.session[e]=n),q(t);return}}}l(W,"applyScopedKey");function X(t,e,n){if(!H.some(f=>y(e,f)))return!1;let r=t.accounts??[],o=A(e.activeProfile)??V(t),a=d(y(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),c=w(r,o.handle,a);for(let f of H)y(e,f)&&W(c,f,e[f],n);return t.accounts=r,t.activeProfile=U(c),!0}l(X,"applyAccountPatch");function Z(t,e){if(y(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?t.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete t.lspEnabled),y(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?t.executionMode=e.executionMode:e.executionMode===null&&delete t.executionMode),y(e,"mode")&&(e.mode==="general"||e.mode==="builder"?t.mode=e.mode:e.mode===null&&delete t.mode),y(e,"activeProfile")){let n=A(e.activeProfile);if(n){let s=v(t.accounts??[],n);t.activeProfile=s===-1?n:U((t.accounts??[])[s])}else e.activeProfile===null&&delete t.activeProfile}if(y(e,"openpondProfile")){let n=x(e.openpondProfile);n?t.openpondProfile=n:e.openpondProfile===null&&delete t.openpondProfile}}l(Z,"applyTopLevelPatch");async function _(t){let e=B();return await S(e),await E(e,n=>{let s=L(n);return t(s),s})}l(_,"updateGlobalConfig");async function ee(){let t=B();return await S(t),L(await k(t))}l(ee,"loadGlobalConfig");async function G(){let t=await ee(),e=A(t.activeProfile);return(t.accounts??[]).map(n=>{let s=m(n.handle)??P;return{handle:s,baseUrl:d(n.baseUrl),apiBaseUrl:d(n.apiBaseUrl),chatApiBaseUrl:d(n.chatApiBaseUrl),environment:n.environment?.trim()||null,isActive:!!(e&&D({...n,handle:s},e)),hasApiKey:!!n.apiKey?.trim(),hasSessionToken:!!n.session?.token?.trim(),sessionAppId:n.session?.appId??null,sessionConversationId:n.session?.conversationId??null}})}l(G,"listConfiguredProfiles");async function se(t,e={}){let n=N(t),s=d(e.baseUrl),r=-1;await _(a=>{let c=a.accounts??[];if(r=v(c,s?{handle:n,baseUrl:s}:{handle:n},{requireUnambiguous:!0}),r===-1)throw new Error(`profile not found: ${n}`);a.activeProfile=U(c[r])});let o=await G();return o.find(a=>a.isActive)??o[r]}l(se,"setActiveProfile");async function re(t){let e=N(t.handle),n=$(t.apiKey),s=d(t.baseUrl),r=d(t.apiBaseUrl),o=d(t.chatApiBaseUrl),a={handle:e};await _(p=>{let g=p.accounts??[],h=w(g,e,s);h.apiKey=n,s&&(h.baseUrl=s),r?h.apiBaseUrl=r:t.apiBaseUrl===null&&delete h.apiBaseUrl,o?h.chatApiBaseUrl=o:t.chatApiBaseUrl===null&&delete h.chatApiBaseUrl,t.environment===null?delete h.environment:typeof t.environment=="string"&&t.environment.trim()&&(h.environment=t.environment.trim()),p.accounts=g,a=U(h),t.setActive!==!1&&(p.activeProfile=a)});let f=(await G()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!f)throw new Error(`failed to save profile: ${e}`);return f}l(re,"saveProfileApiKey");async function ie(t){await _(e=>{Z(e,t),X(e,t,{undefinedDeletes:!1})})}l(ie,"saveGlobalConfig");export{_ as a,ee as b,G as c,se as d,re as e,ie as f};
|
|
2
|
+
import{P as k,Q as E,_ as S}from"./chunk-2EPR4HLF.js";import{f as B}from"./chunk-UGOK7VTC.js";import{a as l}from"./chunk-FTQLQJQV.js";import T from"node:path";var P="default",H=["apiKey","baseUrl","apiBaseUrl","chatApiBaseUrl","token","appId","conversationId"];function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}l(y,"hasOwn");function m(t){if(typeof t!="string")return null;let e=t.trim();return e.length>0?e:null}l(m,"normalizeHandle");function d(t){if(typeof t!="string")return null;let e=t.trim();return e?e.replace(/\/$/,""):null}l(d,"normalizeBaseUrl");function N(t){let e=m(t);if(!e)throw new Error("profile handle must be non-empty");return e}l(N,"requireHandle");function $(t){if(typeof t!="string")throw new Error("apiKey must be a non-empty string");let e=t.trim();if(!e)throw new Error("apiKey must be a non-empty string");return e}l($,"requireApiKey");function b(t,e){let n=m(t),s=m(e);return!!(n&&s&&n.toLowerCase()===s.toLowerCase())}l(b,"handleEquals");function R(t,e,n){let s=d(n);return t.findIndex(r=>b(r.handle,e)?s?d(r.baseUrl)===s:!0:!1)}l(R,"findAccountIndex");function U(t){let e=m(t.handle)??P,n=d(t.baseUrl);return n?{handle:e,baseUrl:n}:{handle:e}}l(U,"selectorFromAccount");function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s=d(typeof e.baseUrl=="string"?e.baseUrl:void 0);return s?{handle:n,baseUrl:s}:{handle:n}}l(A,"sanitizeActiveProfile");function x(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n=typeof e.repoPath=="string"?e.repoPath.trim():"",s=typeof e.profile=="string"&&e.profile.trim()?e.profile.trim():"default";if(!n)return;let r={repoPath:n,profile:s,mode:"local"};if(e.lastCheck&&typeof e.lastCheck=="object"&&!Array.isArray(e.lastCheck)){let o=e.lastCheck,a=o.command,c=o.status,f=o.checkedAt;(a==="inspect"||a==="build"||a==="validate"||a==="eval"||a==="run")&&(c==="passed"||c==="failed")&&typeof f=="string"&&(r.lastCheck={command:a,status:c,checkedAt:f,...typeof o.exitCode=="number"||o.exitCode===null?{exitCode:o.exitCode}:{},...typeof o.sourceHead=="string"||o.sourceHead===null?{sourceHead:o.sourceHead}:{}})}if(e.lastPush&&typeof e.lastPush=="object"&&!Array.isArray(e.lastPush)){let o=e.lastPush,a=o.status,c=o.pushedAt;(a==="pushed"||a==="failed")&&typeof c=="string"&&(r.lastPush={status:a,pushedAt:c,...typeof o.teamId=="string"||o.teamId===null?{teamId:o.teamId}:{},...typeof o.projectId=="string"||o.projectId===null?{projectId:o.projectId}:{},...typeof o.localHead=="string"||o.localHead===null?{localHead:o.localHead}:{},...typeof o.hostedHead=="string"||o.hostedHead===null?{hostedHead:o.hostedHead}:{},...typeof o.sourceRef=="string"||o.sourceRef===null?{sourceRef:o.sourceRef}:{},...o.promotionStatus==="uploaded"||o.promotionStatus==="hosted_source_materialized"||o.promotionStatus==="hosted_source_materialize_failed"||o.promotionStatus==="hosted_source_check_pending"||o.promotionStatus==="hosted_source_check_failed"||o.promotionStatus==="hosted_source_published"||o.promotionStatus==="hosted_source_publish_failed"||o.promotionStatus==="hosted_run_pending"||o.promotionStatus==="hosted_run_passed"||o.promotionStatus==="hosted_run_failed"||o.promotionStatus===null?{promotionStatus:o.promotionStatus}:{},...o.hostedRunStatus==="not_started"||o.hostedRunStatus==="running"||o.hostedRunStatus==="passed"||o.hostedRunStatus==="failed"||o.hostedRunStatus===null?{hostedRunStatus:o.hostedRunStatus}:{},...typeof o.hostedRunAgentId=="string"||o.hostedRunAgentId===null?{hostedRunAgentId:o.hostedRunAgentId}:{},...typeof o.hostedRunId=="string"||o.hostedRunId===null?{hostedRunId:o.hostedRunId}:{},...typeof o.hostedRunAt=="string"||o.hostedRunAt===null?{hostedRunAt:o.hostedRunAt}:{},...z(o.hostedSourceMaterialization)?{hostedSourceMaterialization:z(o.hostedSourceMaterialization)}:{},...K(o.hostedSourceCheck)?{hostedSourceCheck:K(o.hostedSourceCheck)}:{},...j(o.hostedPublish)?{hostedPublish:j(o.hostedPublish)}:{},...M(o.hostedRun)?{hostedRun:M(o.hostedRun)}:{},...typeof o.error=="string"||o.error===null?{error:o.error}:{}})}if(Array.isArray(e.profiles)){let o=e.profiles.flatMap(a=>{let c=x(a);if(!c)return[];let f=a,p=f.source==="github"||f.source==="openpond_git"?f.source:"local",g=typeof f.repositoryId=="string"&&f.repositoryId.trim()?f.repositoryId.trim():T.resolve(c.repoPath);return[{source:p,repositoryId:g,repoPath:c.repoPath,profile:c.profile,...c.lastCheck?{lastCheck:c.lastCheck}:{},...c.lastPush?{lastPush:c.lastPush}:{}}]});o.length>0&&(r.profiles=o)}return r}l(x,"sanitizeLocalOpenPondProfile");function z(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runtimeAgentId"),...i(e,"projectId"),...i(e,"sourceRoot"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"manifestSyncedAt"),...O(e,"fileCount"),...O(e,"totalBytes"),...i(e,"generatedManifestPath"),...C(e,"synthesizedOpenPondYaml"),...i(e,"uploadMetadataPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...i(e,"materializedAt"),...i(e,"error")}:null}l(z,"sanitizeHostedMaterializationStatus");function K(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"deployPlanStatus"),...C(e,"canRun"),...C(e,"canDeploy"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...u(e,"setupCommands"),...u(e,"validationCommands"),...u(e,"requiredChecks"),...u(e,"evalNames"),...u(e,"blockedReasons"),...u(e,"staleReasons"),...i(e,"runtimeId"),...i(e,"sandboxId"),...u(e,"traceArtifactRefs"),...u(e,"evalResultArtifactRefs"),...u(e,"validatorArtifactRefs"),...i(e,"checkedAt"),...i(e,"error")}:null}l(K,"sanitizeHostedSourceCheckStatus");function j(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"snapshotId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"manifestPath"),...i(e,"buildStatus"),...i(e,"validationStatus"),...i(e,"evalStatus"),...i(e,"publishedAt"),...i(e,"error")}:null}l(j,"sanitizeHostedPublishStatus");function M(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=I(e.status);return n?{status:n,...i(e,"agentId"),...i(e,"runId"),...i(e,"runtimeId"),...i(e,"sandboxId"),...i(e,"sourceRef"),...i(e,"sourceCommitSha"),...i(e,"manifestHash"),...i(e,"setupGateStatus"),...u(e,"setupRequirementRefs"),...u(e,"artifactRefs"),...u(e,"traceArtifactRefs"),...u(e,"evalArtifactRefs"),...i(e,"startedAt"),...i(e,"completedAt"),...i(e,"error")}:null}l(M,"sanitizeHostedRunSummary");function i(t,e){let n=t[e];return typeof n=="string"||n===null?{[e]:n}:{}}l(i,"nullableStringProp");function C(t,e){let n=t[e];return typeof n=="boolean"||n===null?{[e]:n}:{}}l(C,"nullableBooleanProp");function O(t,e){let n=t[e];return typeof n=="number"||n===null?{[e]:n}:{}}l(O,"nullableNumberProp");function u(t,e){let n=t[e];if(!Array.isArray(n))return{};let s=n.filter(r=>typeof r=="string");return{[e]:s}}l(u,"stringArrayProp");function I(t){return typeof t=="string"&&t.trim()?t.trim():null}l(I,"stringField");function D(t,e){if(!b(t.handle,e.handle))return!1;let n=d(e.baseUrl);return n?d(t.baseUrl)===n:!d(t.baseUrl)}l(D,"accountMatchesSelector");function v(t,e,n={}){let s=d(e.baseUrl);if(s)return R(t,e.handle,s);let r=t.findIndex(a=>D(a,e));if(r!==-1)return r;let o=t.map((a,c)=>({account:a,index:c})).filter(({account:a})=>b(a.handle,e.handle));if(o.length>1&&n.requireUnambiguous)throw new Error(`multiple profiles found for ${e.handle}; pass --base-url to select one`);return o[0]?.index??-1}l(v,"findAccountIndexForSelector");function F(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,n={};return typeof e.token=="string"&&(n.token=e.token),(typeof e.appId=="string"||e.appId===null)&&(n.appId=e.appId),(typeof e.conversationId=="string"||e.conversationId===null)&&(n.conversationId=e.conversationId),Object.keys(n).length>0?n:void 0}l(F,"sanitizeSession");function Y(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,n=m(typeof e.handle=="string"?e.handle:void 0);if(!n)return null;let s={handle:n};typeof e.apiKey=="string"&&(s.apiKey=e.apiKey),typeof e.baseUrl=="string"&&(s.baseUrl=e.baseUrl),typeof e.apiBaseUrl=="string"&&(s.apiBaseUrl=e.apiBaseUrl),typeof e.chatApiBaseUrl=="string"&&(s.chatApiBaseUrl=e.chatApiBaseUrl),typeof e.environment=="string"&&(s.environment=e.environment);let r=F(e.session);return r&&(s.session=r),s}l(Y,"sanitizeAccount");function J(t){let e={};return typeof t.token=="string"&&(e.token=t.token),(typeof t.appId=="string"||t.appId===null)&&(e.appId=t.appId),(typeof t.conversationId=="string"||t.conversationId===null)&&(e.conversationId=t.conversationId),Object.keys(e).length>0?e:void 0}l(J,"extractLegacySession");function Q(t,e){let n={handle:e};typeof t.apiKey=="string"&&(n.apiKey=t.apiKey),typeof t.baseUrl=="string"&&(n.baseUrl=t.baseUrl),typeof t.apiBaseUrl=="string"&&(n.apiBaseUrl=t.apiBaseUrl),typeof t.chatApiBaseUrl=="string"&&(n.chatApiBaseUrl=t.chatApiBaseUrl);let s=J(t);return s&&(n.session=s),n}l(Q,"extractLegacyAccount");function L(t){let e={};typeof t.lspEnabled=="boolean"&&(e.lspEnabled=t.lspEnabled),(t.executionMode==="local"||t.executionMode==="hosted")&&(e.executionMode=t.executionMode),(t.mode==="general"||t.mode==="builder")&&(e.mode=t.mode);let n=x(t.openpondProfile);n&&(e.openpondProfile=n);let s=[],r=Array.isArray(t.accounts)?t.accounts:[];for(let f of r){let p=Y(f);p&&R(s,p.handle,p.baseUrl)===-1&&s.push(p)}if(s.length===0){let f=A(t.activeProfile)?.handle||P;s.push(Q(t,f))}let o=A(t.activeProfile),a=o?v(s,o):-1,c=s[a===-1?0:a];return e.accounts=s,e.activeProfile=U(c),e}l(L,"normalizeGlobalConfig");function V(t,e,n){let s=t.accounts??[],r=d(n??process.env.OPENPOND_BASE_URL),o=m(e);if(o)return r?{handle:o,baseUrl:r}:{handle:o};let a=m(process.env.OPENPOND_ACCOUNT);if(a)return r?{handle:a,baseUrl:r}:{handle:a};let c=A(t.activeProfile);return c?r?{handle:c.handle,baseUrl:r}:c:s[0]?U(s[0]):{handle:P}}l(V,"resolveRequestedProfile");function w(t,e,n){let s=d(n);if(s){let o=R(t,e,s);if(o!==-1)return t[o]}else{let o=t.filter(a=>b(a.handle,e));if(o.length>1)throw new Error(`multiple profiles found for ${e}; pass --base-url to select one`);if(o.length===1)return o[0]}let r={handle:e};return s&&(r.baseUrl=s),t.push(r),r}l(w,"ensureAccount");function q(t){t.session&&Object.keys(t.session).length===0&&delete t.session}l(q,"cleanupAccount");function W(t,e,n,s){let r=n===null||n===void 0&&s.undefinedDeletes;switch(e){case"apiKey":{if(r){delete t.apiKey;return}typeof n=="string"&&(t.apiKey=n);return}case"baseUrl":{if(r){delete t.baseUrl;return}typeof n=="string"&&(t.baseUrl=n);return}case"apiBaseUrl":{if(r){delete t.apiBaseUrl;return}typeof n=="string"&&(t.apiBaseUrl=n);return}case"chatApiBaseUrl":{if(r){delete t.chatApiBaseUrl;return}typeof n=="string"&&(t.chatApiBaseUrl=n);return}case"token":case"appId":case"conversationId":{if(t.session||(t.session={}),r){delete t.session[e],q(t);return}(typeof n=="string"||n===null)&&(t.session[e]=n),q(t);return}}}l(W,"applyScopedKey");function X(t,e,n){if(!H.some(f=>y(e,f)))return!1;let r=t.accounts??[],o=A(e.activeProfile)??V(t),a=d(y(e,"baseUrl")?e.baseUrl??null:o.baseUrl??process.env.OPENPOND_BASE_URL),c=w(r,o.handle,a);for(let f of H)y(e,f)&&W(c,f,e[f],n);return t.accounts=r,t.activeProfile=U(c),!0}l(X,"applyAccountPatch");function Z(t,e){if(y(e,"lspEnabled")&&(typeof e.lspEnabled=="boolean"?t.lspEnabled=e.lspEnabled:e.lspEnabled===null&&delete t.lspEnabled),y(e,"executionMode")&&(e.executionMode==="local"||e.executionMode==="hosted"?t.executionMode=e.executionMode:e.executionMode===null&&delete t.executionMode),y(e,"mode")&&(e.mode==="general"||e.mode==="builder"?t.mode=e.mode:e.mode===null&&delete t.mode),y(e,"activeProfile")){let n=A(e.activeProfile);if(n){let s=v(t.accounts??[],n);t.activeProfile=s===-1?n:U((t.accounts??[])[s])}else e.activeProfile===null&&delete t.activeProfile}if(y(e,"openpondProfile")){let n=x(e.openpondProfile);n?t.openpondProfile=n:e.openpondProfile===null&&delete t.openpondProfile}}l(Z,"applyTopLevelPatch");async function _(t){let e=B();return await S(e),await E(e,n=>{let s=L(n);return t(s),s})}l(_,"updateGlobalConfig");async function ee(){let t=B();return await S(t),L(await k(t))}l(ee,"loadGlobalConfig");async function G(){let t=await ee(),e=A(t.activeProfile);return(t.accounts??[]).map(n=>{let s=m(n.handle)??P;return{handle:s,baseUrl:d(n.baseUrl),apiBaseUrl:d(n.apiBaseUrl),chatApiBaseUrl:d(n.chatApiBaseUrl),environment:n.environment?.trim()||null,isActive:!!(e&&D({...n,handle:s},e)),hasApiKey:!!n.apiKey?.trim(),hasSessionToken:!!n.session?.token?.trim(),sessionAppId:n.session?.appId??null,sessionConversationId:n.session?.conversationId??null}})}l(G,"listConfiguredProfiles");async function se(t,e={}){let n=N(t),s=d(e.baseUrl),r=-1;await _(a=>{let c=a.accounts??[];if(r=v(c,s?{handle:n,baseUrl:s}:{handle:n},{requireUnambiguous:!0}),r===-1)throw new Error(`profile not found: ${n}`);a.activeProfile=U(c[r])});let o=await G();return o.find(a=>a.isActive)??o[r]}l(se,"setActiveProfile");async function re(t){let e=N(t.handle),n=$(t.apiKey),s=d(t.baseUrl),r=d(t.apiBaseUrl),o=d(t.chatApiBaseUrl),a={handle:e};await _(p=>{let g=p.accounts??[],h=w(g,e,s);h.apiKey=n,s&&(h.baseUrl=s),r?h.apiBaseUrl=r:t.apiBaseUrl===null&&delete h.apiBaseUrl,o?h.chatApiBaseUrl=o:t.chatApiBaseUrl===null&&delete h.chatApiBaseUrl,t.environment===null?delete h.environment:typeof t.environment=="string"&&t.environment.trim()&&(h.environment=t.environment.trim()),p.accounts=g,a=U(h),t.setActive!==!1&&(p.activeProfile=a)});let f=(await G()).find(p=>b(p.handle,a.handle)?s?d(p.baseUrl)===s:!0:!1);if(!f)throw new Error(`failed to save profile: ${e}`);return f}l(re,"saveProfileApiKey");async function ie(t){await _(e=>{Z(e,t),X(e,t,{undefinedDeletes:!1})})}l(ie,"saveGlobalConfig");export{_ as a,ee as b,G as c,se as d,re as e,ie as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{m as r}from"./chunk-
|
|
2
|
+
import{m as r}from"./chunk-UT6F6AIB.js";import{N as s,O as a,P as d}from"./chunk-TUCKED4T.js";import{a as n}from"./chunk-FTQLQJQV.js";async function u(){return{...s.parse(await r({path:"/saved-work"})),webBaseUrl:i()}}n(u,"listHostedSavedWork");async function m(e){let t=a.parse(e);return r({path:"/saved-work",method:"POST",body:t})}n(m,"createHostedSavedWork");async function h(e,t){let o=d.parse(t);return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"PATCH",body:o})}n(h,"updateHostedSavedWork");async function k(e){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}`,method:"DELETE"})}n(k,"deleteHostedSavedWork");async function P(e,t){return r({path:`/saved-work/schedules/${encodeURIComponent(e)}/run`,method:"POST",body:{clientRequestId:t}})}n(P,"runHostedSavedWork");function i(e=process.env){let t=e.OPENPOND_HOSTED_WEB_URL?.trim()||e.OPENPOND_SANDBOX_BASE_URL?.trim()||e.OPENPOND_API_URL?.trim()||e.OPENPOND_SANDBOX_API_URL?.trim()||"https://api.openpond.ai",o=new URL(t);return o.hostname==="api.openpond.ai"||o.hostname.endsWith(".api.openpond.ai")?"https://openpond.ai":(o.pathname="",o.search="",o.hash="",o.origin)}n(i,"hostedWebBaseUrl");export{u as a,m as b,h as c,k as d,P as e,i as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{a as w,d as h}from"./chunk-4U2FNXQW.js";import{c}from"./chunk-SXMR6E2W.js";import{c as u,f}from"./chunk-BSHAIAXY.js";import{c as a}from"./chunk-3M53YXEI.js";import{d as s}from"./chunk-UTNGEMW5.js";import{b as l}from"./chunk-GLUWATL5.js";import{a as i}from"./chunk-FTQLQJQV.js";import{readFile as p,stat as m}from"node:fs/promises";async function v(r,t=1048576){let o=a(r,"inputFile");if(!o)throw new Error("Provide --input-file with the exact reviewed request.");let e=await m(o);if(!e.isFile()||e.size>t)throw new Error(`The request must be a regular JSON file of at most ${t} bytes.`);let n=await p(o);if(n.byteLength>t)throw new Error("The request file grew beyond its byte allowance.");return JSON.parse(n.toString("utf8"))}i(v,"readEvaluationCommandInput");async function E(r){let t=a(r,"team");if(!t)throw new Error("Select --team for the evaluation owner.");if(r.local===!0||r.local==="true"){let e=new URL(a(r,"serverUrl")||w);if(e.protocol!=="http:"||!["localhost","127.0.0.1","[::1]"].includes(e.hostname)||e.username||e.password||e.search||e.hash||e.pathname!=="/")throw new Error("Local evaluation commands require an HTTP loopback server origin.");return{teamId:t,baseUrl:e.origin,apiKey:"local-capability",fetch:await h(e.origin)}}let o=await s();return{teamId:t,apiKey:await c(o,f(o)),baseUrl:u(r)??o.apiBaseUrl??l}}i(E,"evaluationCommandAccess");export{v as a,E as b};
|