openpond 0.2.57 → 0.2.59
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 +2 -1
- package/dist/app-server.js +1 -1
- package/dist/chunks/{actions-command-QU4H53OG.js → actions-command-JJ3CU7J6.js} +1 -1
- package/dist/chunks/{app-layer-NSTE5HIT.js → app-layer-KAUZAHGE.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-JHGWLBXT.js → app-server-connected-apps-SXGZOUJJ.js} +1 -1
- package/dist/chunks/{app-server-evaluations-GJPFWIDA.js → app-server-evaluations-N4OMTPCI.js} +1 -1
- package/dist/chunks/{app-server-harness-services-IH4G6POY.js → app-server-harness-services-DDFUMNYC.js} +1 -1
- package/dist/chunks/app-server-runtime-SVB6L26M.js +2 -0
- package/dist/chunks/{apps-BKTOR4F7.js → apps-EZB56RHV.js} +1 -1
- package/dist/chunks/{chunk-SDXFLO7J.js → chunk-22VMH6JV.js} +1 -1
- package/dist/chunks/{chunk-FTEOCCPB.js → chunk-25JDHAZ5.js} +1 -1
- package/dist/chunks/{chunk-PPAPVGJP.js → chunk-2G4BEISF.js} +1 -1
- package/dist/chunks/{chunk-O72BSKSO.js → chunk-2L5XWJJ5.js} +1 -1
- package/dist/chunks/{chunk-QOTVNQDI.js → chunk-2RNQQNB7.js} +2 -2
- package/dist/chunks/{chunk-O6ULLQJ6.js → chunk-2WKUBGIF.js} +1 -1
- package/dist/chunks/{chunk-F4KOGISR.js → chunk-37MWETFU.js} +1 -1
- package/dist/chunks/{chunk-D74JEERO.js → chunk-3CDEBKSU.js} +1 -1
- package/dist/chunks/{chunk-L6K7ERG5.js → chunk-4EDIRCD3.js} +1 -1
- package/dist/chunks/{chunk-JYKRR7E5.js → chunk-4GPXTISD.js} +1 -1
- package/dist/chunks/chunk-57TRXBLT.js +3 -0
- package/dist/chunks/{chunk-LQQNBVEB.js → chunk-76M2MEHV.js} +1 -1
- package/dist/chunks/{chunk-HCYX6RHP.js → chunk-776WNDV2.js} +1 -1
- package/dist/chunks/{chunk-HDL5YSAA.js → chunk-7AVNZF36.js} +1 -1
- package/dist/chunks/{chunk-3K4VVB7S.js → chunk-7K7O3CKY.js} +1 -1
- package/dist/chunks/chunk-7UH4YDA7.js +3 -0
- package/dist/chunks/{chunk-KUERKVEU.js → chunk-ABZ2ZOLU.js} +1 -1
- package/dist/chunks/{chunk-ZRDGQDZL.js → chunk-ANFDRKUU.js} +1 -1
- package/dist/chunks/{chunk-GWCHDF2C.js → chunk-AQD7K4Z5.js} +1 -1
- package/dist/chunks/{chunk-4D7HWVWD.js → chunk-ARLOVWQ3.js} +1 -1
- package/dist/chunks/{chunk-2QUCCP6Z.js → chunk-ATAOHSFR.js} +1 -1
- package/dist/chunks/{chunk-3RCRSMWZ.js → chunk-BE6SS65L.js} +2 -2
- package/dist/chunks/{chunk-Z54O534A.js → chunk-BGJYITVI.js} +1 -1
- package/dist/chunks/{chunk-BLXEAZCQ.js → chunk-BL3YH2QU.js} +1 -1
- package/dist/chunks/{chunk-2D4Y3HNW.js → chunk-BO5JZYWG.js} +1 -1
- package/dist/chunks/{chunk-ZGTOK7ZK.js → chunk-BQS7Z4AP.js} +1 -1
- package/dist/chunks/{chunk-7HPDGZOR.js → chunk-BRORSFJX.js} +3 -3
- package/dist/chunks/{chunk-XXYGGNVM.js → chunk-BVQWVIGK.js} +1 -1
- package/dist/chunks/{chunk-SWUEFLOH.js → chunk-C37PUHA6.js} +1 -1
- package/dist/chunks/{chunk-3VUATFZD.js → chunk-CGWA54LE.js} +1 -1
- package/dist/chunks/{chunk-EQFGBL3O.js → chunk-CKMSBAI2.js} +1 -1
- package/dist/chunks/{chunk-YOBN7KTF.js → chunk-COHMDT7A.js} +7 -7
- package/dist/chunks/{chunk-JDEEWOD7.js → chunk-DPHAN6N3.js} +1 -1
- package/dist/chunks/{chunk-YOQRYNLP.js → chunk-DZUN5YWB.js} +1 -1
- package/dist/chunks/{chunk-6FDWRG55.js → chunk-E72UU4VX.js} +1 -1
- package/dist/chunks/{chunk-ABD5M2D2.js → chunk-EOBHQ3JT.js} +1 -1
- package/dist/chunks/chunk-EQOV34UH.js +2 -0
- package/dist/chunks/chunk-EUMXMT3S.js +2 -0
- package/dist/chunks/{chunk-773TH7FN.js → chunk-EWOSLZDX.js} +1 -1
- package/dist/chunks/{chunk-HIOKCIL7.js → chunk-FAYASU7Z.js} +1 -1
- package/dist/chunks/{chunk-EIRYMSEG.js → chunk-FKJHEZCW.js} +1 -1
- package/dist/chunks/{chunk-Q2QL6UWN.js → chunk-GL3NX3F3.js} +1 -1
- package/dist/chunks/{chunk-UKMA4R6X.js → chunk-GOPFFQZU.js} +1 -1
- package/dist/chunks/{chunk-RAXOSUSW.js → chunk-GUOLMLZN.js} +1 -1
- package/dist/chunks/{chunk-GZ7M5XBP.js → chunk-GVZLGS2U.js} +1 -1
- package/dist/chunks/chunk-GYJQKCEO.js +5 -0
- package/dist/chunks/{chunk-XDQMGUWL.js → chunk-H7ATCPPB.js} +1 -1
- package/dist/chunks/{chunk-J2TWKFML.js → chunk-IFDALGZE.js} +4 -4
- package/dist/chunks/{chunk-S5ESN275.js → chunk-IRV6GWGG.js} +3 -3
- package/dist/chunks/chunk-JFXINDOQ.js +3 -0
- package/dist/chunks/{chunk-PRGBLQVH.js → chunk-JMBQYBPI.js} +1 -1
- package/dist/chunks/{chunk-DBK66CJP.js → chunk-JQKSXCAJ.js} +1 -1
- package/dist/chunks/{chunk-DARVPBZ4.js → chunk-JUQMSHNR.js} +1 -1
- package/dist/chunks/{chunk-3Z47M3YY.js → chunk-K44RHALX.js} +1 -1
- package/dist/chunks/{chunk-4EPSHPZL.js → chunk-KO3HNMLJ.js} +1 -1
- package/dist/chunks/{chunk-4NESNOK5.js → chunk-LNCHFVHT.js} +1 -1
- package/dist/chunks/{chunk-7E6T7GP5.js → chunk-LPWBIGKW.js} +1 -1
- package/dist/chunks/{chunk-OIUTWU6K.js → chunk-MFMYWZK2.js} +1 -1
- package/dist/chunks/{chunk-A6USMRWK.js → chunk-MMQRHR3V.js} +1 -1
- package/dist/chunks/{chunk-I7AQMAQI.js → chunk-MNC4YUDI.js} +6 -6
- package/dist/chunks/{chunk-ZFSHBFG5.js → chunk-N6ENLEMY.js} +2 -2
- package/dist/chunks/{chunk-SH5CBAFC.js → chunk-NTB2O4RP.js} +1 -1
- package/dist/chunks/{chunk-OQKJGTTO.js → chunk-O3RF72BT.js} +1 -1
- package/dist/chunks/{chunk-QEFHOJFE.js → chunk-O4VIXU7A.js} +1 -1
- package/dist/chunks/{chunk-5MCNZCVQ.js → chunk-OLDK2LKJ.js} +1 -1
- package/dist/chunks/{chunk-WMKYHXVM.js → chunk-OX3XZKGK.js} +2 -2
- package/dist/chunks/{chunk-SDAUS5PY.js → chunk-P2RSBSCT.js} +1 -1
- package/dist/chunks/{chunk-EKM2D7JU.js → chunk-PFSMXKTI.js} +1 -1
- package/dist/chunks/{chunk-FUOEIDMA.js → chunk-PH6IORGZ.js} +1 -1
- package/dist/chunks/{chunk-PUZQU66L.js → chunk-PQJTYOR2.js} +1 -1
- package/dist/chunks/{chunk-OLLLZVHF.js → chunk-PY6K2JRH.js} +1 -1
- package/dist/chunks/{chunk-EYPCBBMS.js → chunk-RBZH6A6M.js} +1 -1
- package/dist/chunks/{chunk-6QSSIT62.js → chunk-RZUEVS64.js} +1 -1
- package/dist/chunks/{chunk-Q5LEXXJG.js → chunk-SF5HJ7PL.js} +4 -4
- package/dist/chunks/{chunk-NHQ36THU.js → chunk-TG7P7BSV.js} +1 -1
- package/dist/chunks/{chunk-G3RXYI2L.js → chunk-TIHXUKFD.js} +1 -1
- package/dist/chunks/{chunk-QOGJAQDO.js → chunk-TKLBP3MM.js} +1 -1
- package/dist/chunks/{chunk-M4JWQSV7.js → chunk-U2MAPON2.js} +1 -1
- package/dist/chunks/chunk-U5FKRYJO.js +86 -0
- package/dist/chunks/{chunk-QNG27G3T.js → chunk-V34H7Y2T.js} +2 -2
- package/dist/chunks/chunk-VGRMAGOK.js +9 -0
- package/dist/chunks/chunk-VRODAXFS.js +145 -0
- package/dist/chunks/{chunk-EIEZHFIW.js → chunk-WC42WOLG.js} +1 -1
- package/dist/chunks/{chunk-OS3LO5J3.js → chunk-WRI4XKSK.js} +1 -1
- package/dist/chunks/{chunk-XTFPDQMH.js → chunk-XJZSIXEO.js} +2 -2
- package/dist/chunks/{chunk-25MBPJVY.js → chunk-XMKCCLGB.js} +1 -1
- package/dist/chunks/{chunk-HZEIRHEB.js → chunk-XMWXH7TS.js} +1 -1
- package/dist/chunks/chunk-YCQSVHCD.js +9 -0
- package/dist/chunks/{chunk-B7RFL4N2.js → chunk-YHHF4Q7Y.js} +1 -1
- package/dist/chunks/{chunk-DMVD2RFZ.js → chunk-ZAN4DYLH.js} +1 -1
- package/dist/chunks/chunk-ZH3K7LKQ.js +2 -0
- package/dist/chunks/cli-5DFVQL5Y.js +2 -0
- package/dist/chunks/{configuration-command-6C5UO7GE.js → configuration-command-JS6U3RMC.js} +1 -1
- package/dist/chunks/connected-app-executor-UBMGMV76.js +2 -0
- package/dist/chunks/{connected-evidence-GH2ATNEX.js → connected-evidence-NLAIEVQ3.js} +1 -1
- package/dist/chunks/connection-NZSD3U5O.js +2 -0
- package/dist/chunks/{continual-6CQAMTTR.js → continual-WFPIDWPH.js} +1 -1
- package/dist/chunks/core-commands-U4IBRRY5.js +2 -0
- package/dist/chunks/{datasets-7BNMVJOY.js → datasets-UX47DTTB.js} +1 -1
- package/dist/chunks/{desktop-test-3CUHVLXV.js → desktop-test-UUU7PD4P.js} +1 -1
- package/dist/chunks/{dist-VYC5VMQB.js → dist-OGLX76LL.js} +1 -1
- package/dist/chunks/{dist-ZVJPJLXR.js → dist-W5MJYSPF.js} +1 -1
- package/dist/chunks/{evaluation-coordination-XEF5L7KZ.js → evaluation-coordination-3YQN5JQW.js} +1 -1
- package/dist/chunks/{experiment-improvements-KRX2DP27.js → experiment-improvements-ZRVD2AGY.js} +1 -1
- package/dist/chunks/{experiments-DFGQYA4O.js → experiments-JEB5A2N5.js} +1 -1
- package/dist/chunks/{extension-XKXXOP5N.js → extension-JCUA3RWV.js} +1 -1
- package/dist/chunks/{help-S7THC6IE.js → help-KA4OINP5.js} +1 -1
- package/dist/chunks/host-profile-evaluation-tools-2URLU5SG.js +2 -0
- package/dist/chunks/host-profile-external-dataset-B2AQNSDR.js +2 -0
- package/dist/chunks/{hosted-app-server-composition-HPL3CRXN.js → hosted-app-server-composition-VJQ3FM4I.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-NFSVS5TU.js → hosted-experiment-improvement-42YWXB3P.js} +1 -1
- package/dist/chunks/hosted-harness-runtime-BM4WONJN.js +2 -0
- package/dist/chunks/{hosted-profile-candidate-2S5LFUWD.js → hosted-profile-candidate-HVVC43XQ.js} +1 -1
- package/dist/chunks/hosted-profile-compiler-RKDWHYK3.js +2 -0
- package/dist/chunks/{hosted-profile-evaluation-control-76BTRTYD.js → hosted-profile-evaluation-control-57V24UGU.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-V6Z3A5XJ.js → hosted-profile-evaluation-inspection-BUWLCKCD.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-IDJYREW3.js → hosted-profile-evaluation-preparation-3XLRR6UH.js} +1 -1
- package/dist/chunks/{hosted-tasksets-ANAE2PIW.js → hosted-tasksets-THKM5QY5.js} +1 -1
- package/dist/chunks/{human-review-WR777ODH.js → human-review-CSYAW4PC.js} +1 -1
- package/dist/chunks/import-CBDJ4DME.js +3 -0
- package/dist/chunks/local-harness-improvement-runtime-3T6E7I5Q.js +2 -0
- package/dist/chunks/local-harness-taskset-review-LQPQBALH.js +2 -0
- package/dist/chunks/{opchat-T4QTNEIY.js → opchat-6ADSONAD.js} +1 -1
- package/dist/chunks/{organizations-75L5DZDV.js → organizations-GT24ZTCN.js} +1 -1
- package/dist/chunks/{profile-TFZMUEDR.js → profile-Y2MCSOUK.js} +1 -1
- package/dist/chunks/project-action-payload-GHSLE7K3.js +2 -0
- package/dist/chunks/{project-agent-6RRO233B.js → project-agent-YYSQIHVE.js} +1 -1
- package/dist/chunks/{published-experiment-source-DZFENAQA.js → published-experiment-source-5TMGLKDM.js} +1 -1
- package/dist/chunks/refiner-profile-service-ZK7KAFP5.js +2 -0
- package/dist/chunks/{runtime-A7OZXM43.js → runtime-QFXCXSVB.js} +2 -2
- package/dist/chunks/{sandbox-command-IU5XFTJP.js → sandbox-command-U6346TVJ.js} +1 -1
- package/dist/chunks/{sandbox-template-C4V6T36U.js → sandbox-template-XWWPWWNR.js} +1 -1
- package/dist/chunks/saved-work-SWHZ4OLO.js +2 -0
- package/dist/chunks/{send-turn-XTAIS2JN.js → send-turn-SIXOZUVJ.js} +1 -1
- package/dist/chunks/{src-LMC3K6LH.js → src-6SHCCYEN.js} +1 -1
- package/dist/chunks/{src-INHPJ63Z.js → src-EZAKCCUV.js} +56 -56
- package/dist/chunks/standalone-experiment-turn-owner-LIAQWTGI.js +2 -0
- package/dist/chunks/{store-continual-support-reviews-HHA6NX7K.js → store-continual-support-reviews-GDX6CSUU.js} +1 -1
- package/dist/chunks/{store-conversation-serving-KPC62UEY.js → store-conversation-serving-W55XMDH4.js} +1 -1
- package/dist/chunks/{store-create-improve-QV54XIZW.js → store-create-improve-A7E7CUPZ.js} +1 -1
- package/dist/chunks/{store-datasets-RXJ33SUN.js → store-datasets-HKF3EO7B.js} +1 -1
- package/dist/chunks/{store-evaluation-results-3F3P527G.js → store-evaluation-results-645RFBGR.js} +1 -1
- package/dist/chunks/{store-human-review-RAH7WMIP.js → store-human-review-F5KESW52.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-4CI2IRUF.js → store-learned-preference-migration-validation-V27XD4I7.js} +1 -1
- package/dist/chunks/{store-local-experiments-5LUJR7GI.js → store-local-experiments-HWQWNTIU.js} +1 -1
- package/dist/chunks/{store-model-batch-review-YEGX327M.js → store-model-batch-review-TOCSDVAP.js} +1 -1
- package/dist/chunks/{store-model-configuration-5ZURQATB.js → store-model-configuration-6543ASY2.js} +1 -1
- package/dist/chunks/{store-sidebar-file-bookmarks-VB5GTLFY.js → store-sidebar-file-bookmarks-53B7QIGS.js} +1 -1
- package/dist/chunks/{store-sidebar-preferences-GWIOG2NH.js → store-sidebar-preferences-YXGEJVUO.js} +1 -1
- package/dist/chunks/{store-subagents-T7R2Z6TB.js → store-subagents-HRCAK7VZ.js} +1 -1
- package/dist/chunks/{store-task-inbox-JJTBW76C.js → store-task-inbox-WF74W4U2.js} +11 -11
- package/dist/chunks/{store-task-inventory-OB3F2APC.js → store-task-inventory-KHCTEZVK.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-EKQWWFYQ.js → store-taskset-drafts-3ACG5AVX.js} +1 -1
- package/dist/chunks/{store-training-G6YLFSIR.js → store-training-R46WOGXB.js} +1 -1
- package/dist/chunks/{store-training-jobs-RC46YBF6.js → store-training-jobs-D4LECE7O.js} +1 -1
- package/dist/chunks/{store-training-models-6BA43IPP.js → store-training-models-EQVNXOVB.js} +1 -1
- package/dist/chunks/{taskset-EQRFQBYM.js → taskset-NR2X2UOK.js} +1 -1
- package/dist/chunks/{taskset-packages-XC6HEE3K.js → taskset-packages-ONULEIVI.js} +1 -1
- package/dist/chunks/{teams-bot-EAPGPTHZ.js → teams-bot-CHUYMD6K.js} +1 -1
- package/dist/chunks/{training-UF6RPI4T.js → training-IDSGYGU2.js} +1 -1
- package/dist/chunks/{web-search-CZ3NCLPY.js → web-search-BPON7H5N.js} +1 -1
- package/dist/chunks/{workspaces-EKKE5NAC.js → workspaces-2TJRDM5K.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/web/assets/App-pcwmC4IR.js +154 -0
- package/dist/web/assets/{AppDialog-t2Fx5tK3.js → AppDialog-CdHad7GT.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-Dj1Y32oI.js → AppTerminalPanel-CrmoOgd4.js} +2 -2
- package/dist/web/assets/AppsView-0P6cBsD4.js +1 -0
- package/dist/web/assets/{BrowserSidebar-jhWi4rVm.js → BrowserSidebar-Cb6edJw6.js} +1 -1
- package/dist/web/assets/{CartesianChart-C1DIx0Ia.js → CartesianChart-B2Sxi0lv.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-Bdr-HmOL.js → CollaborationTabs-PP0AIXhb.js} +1 -1
- package/dist/web/assets/{CommandMenu-Ux2yOHAc.js → CommandMenu-GfQIMe6W.js} +1 -1
- package/dist/web/assets/{CommunityView-DPEeVKFn.js → CommunityView-V6KmMl5n.js} +1 -1
- package/dist/web/assets/ComposerCreateImproveStrip-oeVeyhPX.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-CuQcvVgE.js +1 -0
- package/dist/web/assets/ConversationImportsSettings-PfUa8V7X.css +1 -0
- package/dist/web/assets/{GetStartedView-CFHP0AaI.js → GetStartedView-2oZ068h_.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-D8BGTPVN.js → HostedModelLearningReview-DLzak_Vf.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-JS1S7vNO.js → HostedModelLearningSettings-Eca6Pd9R.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-Dx5Q3xV2.js → LabModelVersionDetailPage-DsBblnMp.js} +1 -1
- package/dist/web/assets/LabSkillSidebar-DDknttrB.js +1 -0
- package/dist/web/assets/{LabsRoute-CyYF8-dw.js → LabsRoute-CgNiUHsy.js} +4 -4
- package/dist/web/assets/MainChatThread-yCVg99LU.js +2 -0
- package/dist/web/assets/MainPane-C86le7UF.js +65 -0
- package/dist/web/assets/{MarkdownText-BR4V6lNO.js → MarkdownText-BBVriBCj.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-DU9IEgIO.js → NativeSkillSidebar-D2uVZkqh.js} +1 -1
- package/dist/web/assets/{NewExperienceSwitcher-mIy6FzCj.js → NewExperienceSwitcher-DuD6GScJ.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-RfTZTHxl.js → NewProjectDialog-B6XZkJrU.js} +1 -1
- package/dist/web/assets/OutputsPage-PUlmcWjv.js +1 -0
- package/dist/web/assets/{ProjectsPage-CE6QUB-b.js → ProjectsPage-DWBRmej6.js} +1 -1
- package/dist/web/assets/RightChatPanelStack-HaCVep4t.js +1 -0
- package/dist/web/assets/{RightSidebarHomePanel-CK0rP3WT.js → RightSidebarHomePanel-BUtdPb2L.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-vOrYv8pp.js → ScheduledWorkPage-Dg9GkGrT.js} +1 -1
- package/dist/web/assets/SettingsView-DjjnCnlb.css +1 -0
- package/dist/web/assets/{SettingsView-DCKVrfjj.js → SettingsView-DtldfnV-.js} +4 -4
- package/dist/web/assets/{TeamChatView-Bwrjr-vk.js → TeamChatView-C71JX4je.js} +2 -2
- package/dist/web/assets/{TerminalOverlay-DhPoKZAq.js → TerminalOverlay-B4F6Q36s.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-B9MxFzQx.js +1 -0
- package/dist/web/assets/{TrainingDraftPanel-C9cRX5qf.js → TrainingDraftPanel-7C48sHfC.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CrdcSGeW.js → UsageSettingsSection-CC57FcUB.js} +1 -1
- package/dist/web/assets/{WorkSidebarPanel-DSSikNFQ.js → WorkSidebarPanel-Cto1usLM.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-BAFo0CPN.js → WorkspaceDiffPanel-CL7wi3kp.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-BVHAhwnJ.js → WorkspaceEnvironmentMenu-zdzSDofs.js} +18 -18
- package/dist/web/assets/{WorkspaceGitDialogs-CwVoiDQ2.js → WorkspaceGitDialogs-CZSmjnrc.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-TxLyhzNp.js → WorkspaceMonacoEditor-TrUDJMKb.js} +3 -3
- package/dist/web/assets/agent-connections-4Dza2mDg.js +1 -0
- package/dist/web/assets/{arrow-up-right-C9aE8Mfz.js → arrow-up-right-xKb5kWQJ.js} +1 -1
- package/dist/web/assets/{chunk-P3BRSSRD-DUGfuKA8.js → chunk-P3BRSSRD-BsGTkgyC.js} +1 -1
- package/dist/web/assets/{clipboard-Dk158Qp4.js → clipboard-BgjV3aCx.js} +1 -1
- package/dist/web/assets/{cloud-upload-k9eqBsHr.js → cloud-upload-Bw9XUsKQ.js} +1 -1
- package/dist/web/assets/{cssMode-CO35ARZp.js → cssMode-DxsFJGb-.js} +1 -1
- package/dist/web/assets/{folder-open-sYgceW_f.js → folder-open-CbmUjIYS.js} +1 -1
- package/dist/web/assets/{folder-plus-CS0R49m9.js → folder-plus-slsst7Ct.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DrGxH2h4.js → git-commit-horizontal-BIS-8MuS.js} +1 -1
- package/dist/web/assets/{htmlMode-REMmzdfq.js → htmlMode-BE4VOrZo.js} +1 -1
- package/dist/web/assets/{index-C8aCGagb.js → index-DEg0S7Qk.js} +2 -2
- package/dist/web/assets/index-erq7hUne.css +1 -0
- package/dist/web/assets/{info-DLdbiUrh.js → info-5bL9xSSf.js} +1 -1
- package/dist/web/assets/{jsonMode-KEdMfkIf.js → jsonMode-CYimnBhD.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-5KZwEoxW.js → lspLanguageFeatures-CiFuk-P7.js} +1 -1
- package/dist/web/assets/{minimize-2-CqcI4zcM.js → minimize-2-BGVWKvTg.js} +1 -1
- package/dist/web/assets/{monaco.contribution-omszXBEj.js → monaco.contribution-BTY4dJ0f.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BJGj65F9.js → monaco.contribution-C7sMrcos.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DO10L0zW.js → monaco.contribution-DUE3CQph.js} +2 -2
- package/dist/web/assets/{monaco.contribution-Cly9Wt7L.js → monaco.contribution-DkLVGT8N.js} +2 -2
- package/dist/web/assets/{monitor-BFVCcbxp.js → monitor-B5hx_tzp.js} +1 -1
- package/dist/web/assets/{play-C469pVZq.js → play-pmSO95Qg.js} +1 -1
- package/dist/web/assets/{python-Dw0YcVy9.js → python-CiZvL3LX.js} +1 -1
- package/dist/web/assets/{save-CtSjPydi.js → save-CvYL4DUg.js} +1 -1
- package/dist/web/assets/{square-BuImvLhT.js → square-DT_uFOml.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-DjCO9lIP.js → toggleHighContrast-CrE1_HY0.js} +1 -1
- package/dist/web/assets/{tsMode-BAOnxKd6.js → tsMode-CI_PdZmj.js} +1 -1
- package/dist/web/assets/{upload-2JkFZo3h.js → upload-PVi8vC3T.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-BNqAisfS.js → useLocalAgentSchedules-BHJNVf42.js} +1 -1
- package/dist/web/assets/useProviderSettings-CU3zXyie.js +5 -0
- package/dist/web/assets/{useProviderSettings-CmL_BaxP.css → useProviderSettings-Cktvzinz.css} +1 -1
- package/dist/web/assets/{useSessionTurnCache-BHU2-Jmz.js → useSessionTurnCache-BE7cipLX.js} +1 -1
- package/dist/web/assets/{wifi-off-CpOAH62M.js → wifi-off-7WiFuOhD.js} +1 -1
- package/dist/web/assets/{workers-0QvlA2T5.js → workers-Cv8r4CvM.js} +1 -1
- package/dist/web/assets/{yaml-BK3qxo7D.js → yaml-Bj7mdkV2.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +10 -3
- package/docs/conversation-imports.md +57 -0
- package/package.json +1 -1
- package/dist/chunks/app-server-runtime-VCRNCNX2.js +0 -2
- package/dist/chunks/chunk-FV2R5RUN.js +0 -3
- package/dist/chunks/chunk-FY5KHLMW.js +0 -2
- package/dist/chunks/chunk-HY3GOBFJ.js +0 -58
- package/dist/chunks/chunk-KG325WTN.js +0 -2
- package/dist/chunks/chunk-MULXCKG7.js +0 -10
- package/dist/chunks/chunk-OGDADQGH.js +0 -143
- package/dist/chunks/chunk-QHWGQ3A4.js +0 -5
- package/dist/chunks/chunk-VRIEKBBH.js +0 -9
- package/dist/chunks/chunk-WJ43MJ3F.js +0 -2
- package/dist/chunks/chunk-YY7LEQGP.js +0 -2
- package/dist/chunks/cli-X25RSO2X.js +0 -2
- package/dist/chunks/connected-app-executor-IVLGQP65.js +0 -2
- package/dist/chunks/connection-HTF6CC7M.js +0 -2
- package/dist/chunks/core-commands-A2DGGIPS.js +0 -2
- package/dist/chunks/host-profile-evaluation-tools-NRLXL2S5.js +0 -2
- package/dist/chunks/host-profile-external-dataset-K3ICDHIP.js +0 -2
- package/dist/chunks/hosted-harness-runtime-723S5ZSH.js +0 -2
- package/dist/chunks/hosted-profile-compiler-2DQIFSXW.js +0 -2
- package/dist/chunks/import-MLZUHITH.js +0 -4
- package/dist/chunks/local-harness-improvement-runtime-JIQ6ZVDW.js +0 -2
- package/dist/chunks/local-harness-taskset-review-XVYTGAGK.js +0 -2
- package/dist/chunks/project-action-payload-7VGL7OER.js +0 -2
- package/dist/chunks/refiner-profile-service-UUIWFJVT.js +0 -2
- package/dist/chunks/saved-work-6BMBFP43.js +0 -2
- package/dist/chunks/standalone-experiment-turn-owner-JCY5LL5R.js +0 -2
- package/dist/web/assets/App-s-CJswyt.js +0 -154
- package/dist/web/assets/AppsView-BYE5EBDJ.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-CEgh4OtN.js +0 -1
- package/dist/web/assets/LabSkillSidebar-BxffN-pN.js +0 -1
- package/dist/web/assets/MainChatThread-DZpcFRFl.js +0 -2
- package/dist/web/assets/MainPane-5DTtwVCk.js +0 -65
- package/dist/web/assets/OutputsPage-Cr1Spf7S.js +0 -1
- package/dist/web/assets/RightChatPanelStack-T6VRWuHo.js +0 -1
- package/dist/web/assets/SettingsView-Dulr_xlq.css +0 -1
- package/dist/web/assets/TrainingCreationPanel-BXHfohNm.js +0 -1
- package/dist/web/assets/index-3iPNbbER.css +0 -1
- package/dist/web/assets/useProviderSettings-C4L4wDoh.js +0 -5
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{g as E,m as g,n as j}from"./chunk-QNG27G3T.js";import{k as P}from"./chunk-N4FFQPLR.js";import{e as A,f as x,g as D,l as I}from"./chunk-GJ2ZJFDD.js";import{b as W}from"./chunk-L3KS6MOV.js";import{m as $}from"./chunk-KGNCKIFP.js";import{a as v}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as M}from"node:module";import m from"node:path";async function Q(e){let r=A.parse(e.overlay),t=x.parse(e.proposal),o=e.validations.map(h=>D.parse(h));if((t.route==="agent"?t.edits.filter(h=>h.target!=="harness.json"&&h.operation!=="delete"):[]).length>0){let h=t.validationPlan.find(n=>n.kind==="component_activation"&&n.required);if(!h)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(o.find(n=>n.validationId===h.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let i=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!i)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(i.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let s=E(e.storeDir,i.id),l=await g({workspaceId:i.id,sourceDir:s.source});if(l.sourceRevision!==i.sourceRevision)throw new Error(`Harness source is ${l.sourceRevision}; workspace expects ${i.sourceRevision}. Record or revert the source change before refinement.`);let w=m.join(s.root,`.source-candidate-${H()}`);await p.cp(s.source,w,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await V(w,t);let h=await g({workspaceId:i.id,sourceDir:w}),f=(e.now??(()=>new Date().toISOString()))(),n=await j({storeDir:e.storeDir,workspaceId:i.id,compiled:h,createdAt:f});await e.store.saveHarnessReleaseRecord(n),await e.store.saveHarnessImprovementArtifact(i.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(i.id,"proposal",t);for(let a of o)await e.store.saveHarnessImprovementArtifact(i.id,"targeted_validation",a);if(!P({workspace:i,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});let u=m.join(s.root,`.source-backup-${H()}`),c=m.join(s.root,"source-swap.json");await _(c,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:i.id,expectedWorkspaceRevision:i.revision,previousSourceRevision:i.sourceRevision,nextSourceRevision:n.sourceRevision,backupSource:u,candidateSource:w,createdAt:f}),await p.rename(s.source,u),await p.rename(w,s.source);try{let a=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:f}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});return a.receipt.decision!=="advanced"?await b(s.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(c,{force:!0}),a}catch(a){throw await b(s.source,u).catch(()=>{}),await p.rm(c,{force:!0}).catch(()=>{}),a}}finally{await p.rm(w,{recursive:!0,force:!0}).catch(()=>{})}}v(Q,"applyLocalHarnessRefinerProposal");async function X(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let o=E(e.storeDir,r.id);if((await g({workspaceId:r.id,sourceDir:o.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let i=m.join(o.root,`.source-rollback-${H()}`);await p.cp(m.join(t.bundlePath,"source"),i,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await g({workspaceId:r.id,sourceDir:i})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let l=(e.now??(()=>new Date().toISOString()))(),w=m.join(o.root,`.source-backup-${H()}`),h=m.join(o.root,"source-swap.json");await _(h,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:w,candidateSource:i,createdAt:l}),await p.rename(o.source,w),await p.rename(i,o.source);try{let f=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:l});return f.receipt.decision!=="rolled_back"?await b(o.source,w):await p.rm(w,{recursive:!0,force:!0}),await p.rm(h,{force:!0}),f}catch(f){throw await b(o.source,w).catch(()=>{}),await p.rm(h,{force:!0}).catch(()=>{}),f}}finally{await p.rm(i,{recursive:!0,force:!0}).catch(()=>{})}}v(X,"rollbackLocalHarnessWorkspaceRelease");async function Y(e){let r=x.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return q({proposal:r,now:e.now});let t=E(e.storeDir,e.workspace.id),o=await g({workspaceId:e.workspace.id,sourceDir:t.source});if(o.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let d=m.join(t.root,`.validation-candidate-${H()}`);await p.cp(t.source,d,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let i=(e.now??(()=>new Date().toISOString()))();try{await V(d,r);let s=await g({workspaceId:e.workspace.id,sourceDir:d}),l=new Map(s.manifest.files.map(n=>[n.path,n])),w=new Map(r.edits.map(n=>[n.target,n])),h=O(o),f=O(s);return Promise.all(r.validationPlan.map(async n=>{let y="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(n.kind==="observed_recovery"){let c=r.evidence.filter(a=>a.kind==="recovery");if(c.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${c.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(n.kind==="prompt"){let c=r.edits.filter(a=>a.route==="prompt"&&a.target!=="harness.json");if(c.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted instruction ${a.target} remains declared.`)}else if(k?.kind!=="instruction")throw new Error(`Instruction ${a.target} is not declared in the candidate Harness.`);if(a.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(a.content))throw new Error(`Instruction ${a.target} appears to contain credential material.`)}u=`Validated ${c.length} textual instruction edit(s) and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="skill"){let c=r.edits.filter(a=>a.route==="skill"&&a.target!=="harness.json");if(c.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted Skill ${a.target} remains declared.`);continue}if(k?.kind!=="skill")throw new Error(`Skill ${a.target} is not declared in the candidate Harness.`);let S=w.get(a.target)?.content;if(!S)throw new Error(`Skill edit ${a.target} has no content.`);let R=W(S);if(!R.name||!R.description||R.messages.length>0)throw new Error(`Skill ${a.target} is invalid: ${R.messages.join(" ")}`)}u=`Validated ${c.length} Skill edit(s), Skill frontmatter, and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="dependency"){let c=s.manifest.files.find(a=>a.kind==="dependency_lock");if(!c)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(T(d,c.path),"utf8")),u=`Validated dependency lock ${c.path} and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="schema")x.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${s.harnessRelease.id}.`;else if(n.kind==="package"){let c=r.edits.filter(a=>a.route==="agent"&&a.operation!=="delete"&&a.target!=="harness.json");for(let a of c){if(!a.content)throw new Error(`Agent edit ${a.target} has no source.`);M(a.content,{mode:"transform",sourceUrl:a.target,sourceMap:!1})}u=c.length>0?`Syntax-checked ${c.length} Agent source edit(s) and compiled candidate ${s.harnessRelease.id}.`:`Compiled candidate package ${s.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(n.kind==="component_activation"){let c=r.edits.filter(a=>a.target!=="harness.json");if(c.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(c.filter(k=>k.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${c.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let a=r.route==="prompt"?"instruction":"skill";for(let k of c){let S=f.components.find(R=>R.path===k.target&&R.kind===a);if(k.operation==="delete"?S:!S)throw new Error(`${a} ${k.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(h.contentHash===f.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${c.length} ${a} edit(s) in the candidate Desktop Work runtime surface.`}}else n.kind==="business_formula"?(y="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):n.kind==="targeted_evaluation"?(y="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):n.kind==="file_render"?(y="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(y="blocked",u=`Local targeted validation does not yet own ${n.kind}; it requires its dedicated validator.`)}catch(c){y="failed",u=c instanceof Error?c.message:String(c)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${n.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:n.id,kind:n.kind,status:y,summary:u,evidenceRefs:r.evidence,createdAt:i,metadata:{candidateHarnessRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},sourceRevision:s.sourceRevision,...n.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:h.contentHash,afterEffectiveRuntimeHash:f.contentHash,activatedComponentRefs:f.components,inactiveAgentRefs:f.inactiveAgents}:{}}})}))}catch(s){let l=s instanceof Error?s.message:String(s);return r.validationPlan.map(w=>I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${w.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:w.id,kind:w.kind,status:"failed",summary:l,evidenceRefs:r.evidence,createdAt:i,metadata:{}}))}finally{await p.rm(d,{recursive:!0,force:!0}).catch(()=>{})}}v(Y,"validateLocalHarnessRefinerProposal");function O(e){let r=[...e.agentSnapshot.instructions.map(o=>({kind:"instruction",path:o.path,contentHash:o.contentHash})),...e.agentSnapshot.skills.map(o=>({kind:"skill",path:o.path,contentHash:o.contentHash}))].sort((o,d)=>o.path.localeCompare(d.path)),t=e.agentSnapshot.agents.map(o=>({path:o.path,contentHash:o.contentHash})).sort((o,d)=>o.path.localeCompare(d.path));return{contentHash:$({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}v(O,"desktopWorkRuntimeSurface");function q(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(o=>o.route==="memory");return e.proposal.validationPlan.map(o=>{let d="passed",i="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(o.kind==="observed_recovery"){if(!e.proposal.evidence.some(s=>s.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");i="Memory proposal is grounded in immutable recovery evidence."}else if(o.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let s=e.proposal.metadata.expectedMemory;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("Memory proposal requires an expected revision snapshot.");let l=s;if(l.key!==C(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(l.revision!==null&&(!Number.isInteger(l.revision)||Number(l.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(l.contentHash!==null&&typeof l.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(l.status!==null&&l.status!=="active"&&l.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(l.revision===null&&(l.contentHash!==null||l.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(l.revision!==null&&(typeof l.contentHash!="string"||l.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&l.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else d="blocked",i=`Memory validation cannot satisfy ${o.kind}.`}catch(s){d="failed",i=s instanceof Error?s.message:String(s)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${o.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:o.id,kind:o.kind,status:d,summary:i,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}v(q,"validateMemoryProposal");function C(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}v(C,"memoryKeyFromTarget");async function Z(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=E(e.storeDir,r.id),o=m.join(t.root,"source-swap.json"),d=await p.readFile(o,"utf8").then(JSON.parse).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!d)return"none";let i=await g({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===d.nextSourceRevision&&i.sourceRevision===d.nextSourceRevision)return await p.rm(d.backupSource,{recursive:!0,force:!0}),await p.rm(o,{force:!0}),"completed";let s=await g({workspaceId:r.id,sourceDir:d.backupSource});if(r.sourceRevision===d.previousSourceRevision&&s.sourceRevision===d.previousSourceRevision)return await b(t.source,d.backupSource),await p.rm(o,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}v(Z,"recoverLocalHarnessSourceSwap");async function V(e,r){for(let t of r.edits){let o=T(e,t.target);if(t.operation==="delete"){await p.rm(o,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(m.dirname(o),{recursive:!0}),await p.writeFile(o,t.content,{flag:"wx"});else{let d=await p.lstat(o);if(!d.isFile()||d.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(o,t.content,{flag:"w"})}}}v(V,"applyOverlayEdits");function T(e,r){let t=m.resolve(e),o=m.resolve(t,...r.replaceAll("\\","/").split("/")),d=m.relative(t,o);if(!d||d.startsWith("..")||m.isAbsolute(d))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return o}v(T,"containedPath");async function _(e,r){let t=`${e}.${H()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
|
|
2
|
+
import{g as E,m as g,n as j}from"./chunk-V34H7Y2T.js";import{k as P}from"./chunk-N4FFQPLR.js";import{e as A,f as x,g as D,l as I}from"./chunk-GJ2ZJFDD.js";import{b as W}from"./chunk-L3KS6MOV.js";import{m as $}from"./chunk-KGNCKIFP.js";import{a as v}from"./chunk-FTQLQJQV.js";import{randomUUID as H}from"node:crypto";import{promises as p}from"node:fs";import{stripTypeScriptTypes as M}from"node:module";import m from"node:path";async function Q(e){let r=A.parse(e.overlay),t=x.parse(e.proposal),o=e.validations.map(h=>D.parse(h));if((t.route==="agent"?t.edits.filter(h=>h.target!=="harness.json"&&h.operation!=="delete"):[]).length>0){let h=t.validationPlan.find(n=>n.kind==="component_activation"&&n.required);if(!h)throw new Error("Desktop Work Agent proposals require component-activation validation before review.");if(o.find(n=>n.validationId===h.id)?.status==="passed")throw new Error("Desktop Work cannot accept a passed Agent activation receipt until an Agent source executor exists.")}if(t.overlay.id!==r.id||t.overlay.revision!==r.revision||t.overlay.contentHash!==r.contentHash)throw new Error("Refiner proposal is not bound to the supplied run overlay.");if(r.status!=="frozen")throw new Error("Only a frozen run overlay can advance a Harness workspace.");let i=await e.store.getHarnessWorkspace(t.expectedWorkspace.workspaceId);if(!i)throw new Error(`Harness workspace ${t.expectedWorkspace.workspaceId} does not exist.`);if(i.location!==e.store.harnessStoragePlacement)throw new Error("Refiner workspace does not match the admitted storage placement.");let s=E(e.storeDir,i.id),l=await g({workspaceId:i.id,sourceDir:s.source});if(l.sourceRevision!==i.sourceRevision)throw new Error(`Harness source is ${l.sourceRevision}; workspace expects ${i.sourceRevision}. Record or revert the source change before refinement.`);let w=m.join(s.root,`.source-candidate-${H()}`);await p.cp(s.source,w,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{await V(w,t);let h=await g({workspaceId:i.id,sourceDir:w}),f=(e.now??(()=>new Date().toISOString()))(),n=await j({storeDir:e.storeDir,workspaceId:i.id,compiled:h,createdAt:f});await e.store.saveHarnessReleaseRecord(n),await e.store.saveHarnessImprovementArtifact(i.id,"run_overlay",r),await e.store.saveHarnessImprovementArtifact(i.id,"proposal",t);for(let a of o)await e.store.saveHarnessImprovementArtifact(i.id,"targeted_validation",a);if(!P({workspace:i,proposal:t}).eligible&&!e.reviewAuthority)return e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});let u=m.join(s.root,`.source-backup-${H()}`),c=m.join(s.root,"source-swap.json");await _(c,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:i.id,expectedWorkspaceRevision:i.revision,previousSourceRevision:i.sourceRevision,nextSourceRevision:n.sourceRevision,backupSource:u,candidateSource:w,createdAt:f}),await p.rename(s.source,u),await p.rename(w,s.source);try{let a=e.reviewAuthority?await e.store.advanceReviewedHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,reviewer:e.reviewAuthority.reviewer,now:f}):await e.store.advanceHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:i.id,proposal:t,validations:o,nextRelease:{id:n.harnessRelease.id,contentHash:n.harnessRelease.contentHash},nextSourceRevision:n.sourceRevision,now:f});return a.receipt.decision!=="advanced"?await b(s.source,u):await p.rm(u,{recursive:!0,force:!0}),await p.rm(c,{force:!0}),a}catch(a){throw await b(s.source,u).catch(()=>{}),await p.rm(c,{force:!0}).catch(()=>{}),a}}finally{await p.rm(w,{recursive:!0,force:!0}).catch(()=>{})}}v(Q,"applyLocalHarnessRefinerProposal");async function X(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r||r.location!==e.store.harnessStoragePlacement)throw new Error(`Local Harness workspace ${e.workspaceId} does not exist.`);if(r.currentChannel.release?.id!==e.rollbackOf.id||r.currentChannel.release.contentHash!==e.rollbackOf.contentHash)throw new Error("Harness rollback source is no longer the current release.");let t=await e.store.getHarnessReleaseRecord(e.targetRelease.contentHash);if(!t||t.workspaceId!==r.id||t.harnessRelease.id!==e.targetRelease.id)throw new Error("Harness rollback target is unavailable in this workspace.");let o=E(e.storeDir,r.id);if((await g({workspaceId:r.id,sourceDir:o.source})).sourceRevision!==r.sourceRevision)throw new Error("Harness source changed before rollback.");let i=m.join(o.root,`.source-rollback-${H()}`);await p.cp(m.join(t.bundlePath,"source"),i,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});try{if((await g({workspaceId:r.id,sourceDir:i})).sourceRevision!==t.sourceRevision)throw new Error("Harness rollback bundle does not reproduce its registered source revision.");let l=(e.now??(()=>new Date().toISOString()))(),w=m.join(o.root,`.source-backup-${H()}`),h=m.join(o.root,"source-swap.json");await _(h,{schemaVersion:"openpond.localHarnessSourceSwap.v1",workspaceId:r.id,expectedWorkspaceRevision:r.revision,previousSourceRevision:r.sourceRevision,nextSourceRevision:t.sourceRevision,backupSource:w,candidateSource:i,createdAt:l}),await p.rename(o.source,w),await p.rename(i,o.source);try{let f=await e.store.rollbackHarnessWorkspaceAtomically({receiptId:e.receiptId,workspaceId:r.id,expectedWorkspaceRevision:r.revision,expectedChannelRevision:r.currentChannel.revision,targetRelease:e.targetRelease,targetSourceRevision:t.sourceRevision,rollbackOf:e.rollbackOf,now:l});return f.receipt.decision!=="rolled_back"?await b(o.source,w):await p.rm(w,{recursive:!0,force:!0}),await p.rm(h,{force:!0}),f}catch(f){throw await b(o.source,w).catch(()=>{}),await p.rm(h,{force:!0}).catch(()=>{}),f}}finally{await p.rm(i,{recursive:!0,force:!0}).catch(()=>{})}}v(X,"rollbackLocalHarnessWorkspaceRelease");async function Y(e){let r=x.parse(e.proposal);if(r.expectedWorkspace.workspaceId!==e.workspace.id)throw new Error("Refiner proposal targets a different Harness workspace.");if(r.route==="memory")return q({proposal:r,now:e.now});let t=E(e.storeDir,e.workspace.id),o=await g({workspaceId:e.workspace.id,sourceDir:t.source});if(o.sourceRevision!==r.expectedWorkspace.sourceRevision)throw new Error("Refiner proposal source revision no longer matches the Local Harness workspace.");let d=m.join(t.root,`.validation-candidate-${H()}`);await p.cp(t.source,d,{recursive:!0,force:!1,errorOnExist:!0,verbatimSymlinks:!1});let i=(e.now??(()=>new Date().toISOString()))();try{await V(d,r);let s=await g({workspaceId:e.workspace.id,sourceDir:d}),l=new Map(s.manifest.files.map(n=>[n.path,n])),w=new Map(r.edits.map(n=>[n.target,n])),h=O(o),f=O(s);return Promise.all(r.validationPlan.map(async n=>{let y="passed",u="The candidate Harness source compiles and preserves its manifest contract.";try{if(n.kind==="observed_recovery"){let c=r.evidence.filter(a=>a.kind==="recovery");if(c.length===0)throw new Error("Observed-recovery validation requires recorded recovery evidence.");u=`Validated ${c.length} immutable recovery evidence reference(s) before candidate advancement.`}else if(n.kind==="prompt"){let c=r.edits.filter(a=>a.route==="prompt"&&a.target!=="harness.json");if(c.length===0)throw new Error("Prompt validation requires an instruction-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted instruction ${a.target} remains declared.`)}else if(k?.kind!=="instruction")throw new Error(`Instruction ${a.target} is not declared in the candidate Harness.`);if(a.content!==null&&/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(a.content))throw new Error(`Instruction ${a.target} appears to contain credential material.`)}u=`Validated ${c.length} textual instruction edit(s) and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="skill"){let c=r.edits.filter(a=>a.route==="skill"&&a.target!=="harness.json");if(c.length===0)throw new Error("Skill validation requires a declared Skill-file edit.");for(let a of c){let k=l.get(a.target);if(a.operation==="delete"){if(k)throw new Error(`Deleted Skill ${a.target} remains declared.`);continue}if(k?.kind!=="skill")throw new Error(`Skill ${a.target} is not declared in the candidate Harness.`);let S=w.get(a.target)?.content;if(!S)throw new Error(`Skill edit ${a.target} has no content.`);let R=W(S);if(!R.name||!R.description||R.messages.length>0)throw new Error(`Skill ${a.target} is invalid: ${R.messages.join(" ")}`)}u=`Validated ${c.length} Skill edit(s), Skill frontmatter, and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="dependency"){let c=s.manifest.files.find(a=>a.kind==="dependency_lock");if(!c)throw new Error("Candidate Harness has no dependency lock.");JSON.parse(await p.readFile(T(d,c.path),"utf8")),u=`Validated dependency lock ${c.path} and compiled candidate ${s.harnessRelease.id}.`}else if(n.kind==="schema")x.parse(r),u=`Validated proposal, manifest, and candidate release schemas for ${s.harnessRelease.id}.`;else if(n.kind==="package"){let c=r.edits.filter(a=>a.route==="agent"&&a.operation!=="delete"&&a.target!=="harness.json");for(let a of c){if(!a.content)throw new Error(`Agent edit ${a.target} has no source.`);M(a.content,{mode:"transform",sourceUrl:a.target,sourceMap:!1})}u=c.length>0?`Syntax-checked ${c.length} Agent source edit(s) and compiled candidate ${s.harnessRelease.id}.`:`Compiled candidate package ${s.harnessRelease.id} and preserved the Harness source manifest contract.`}else if(n.kind==="component_activation"){let c=r.edits.filter(a=>a.target!=="harness.json");if(c.length===0)throw new Error("Component activation requires a concrete Harness component edit.");if(r.route==="agent"){if(c.filter(k=>k.operation!=="delete").length>0)throw new Error("Desktop Work does not compile or execute released Agent source; use an active instruction or standalone Skill, or add an Agent executor before release.");u=`Confirmed ${c.length} deleted Agent component(s) were inactive in Desktop Work.`}else{if(!["prompt","skill"].includes(r.route))throw new Error(`Desktop Work has no activation policy for ${r.route} proposals.`);let a=r.route==="prompt"?"instruction":"skill";for(let k of c){let S=f.components.find(R=>R.path===k.target&&R.kind===a);if(k.operation==="delete"?S:!S)throw new Error(`${a} ${k.target} is not reflected in the candidate Desktop Work runtime surface.`)}if(h.contentHash===f.contentHash)throw new Error("The candidate does not change the effective Desktop Work runtime surface.");u=`Activated ${c.length} ${a} edit(s) in the candidate Desktop Work runtime surface.`}}else n.kind==="business_formula"?(y="blocked",u="Business or financial logic is retained for review until an approved deterministic fixture supplies inputs and expected outputs."):n.kind==="targeted_evaluation"?(y="blocked",u="This sensitive change requires an explicit authority-preserving targeted Evaluation before release."):n.kind==="file_render"?(y="blocked",u="File-render validation requires an exact produced artifact reference; no artifact was attached to this Harness-source proposal."):(y="blocked",u=`Local targeted validation does not yet own ${n.kind}; it requires its dedicated validator.`)}catch(c){y="failed",u=c instanceof Error?c.message:String(c)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${n.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:n.id,kind:n.kind,status:y,summary:u,evidenceRefs:r.evidence,createdAt:i,metadata:{candidateHarnessRelease:{id:s.harnessRelease.id,contentHash:s.harnessRelease.contentHash},sourceRevision:s.sourceRevision,...n.kind==="component_activation"?{targetRuntime:"desktop_work",beforeEffectiveRuntimeHash:h.contentHash,afterEffectiveRuntimeHash:f.contentHash,activatedComponentRefs:f.components,inactiveAgentRefs:f.inactiveAgents}:{}}})}))}catch(s){let l=s instanceof Error?s.message:String(s);return r.validationPlan.map(w=>I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${r.id}-${w.id}`,proposal:{id:r.id,contentHash:r.contentHash},validationId:w.id,kind:w.kind,status:"failed",summary:l,evidenceRefs:r.evidence,createdAt:i,metadata:{}}))}finally{await p.rm(d,{recursive:!0,force:!0}).catch(()=>{})}}v(Y,"validateLocalHarnessRefinerProposal");function O(e){let r=[...e.agentSnapshot.instructions.map(o=>({kind:"instruction",path:o.path,contentHash:o.contentHash})),...e.agentSnapshot.skills.map(o=>({kind:"skill",path:o.path,contentHash:o.contentHash}))].sort((o,d)=>o.path.localeCompare(d.path)),t=e.agentSnapshot.agents.map(o=>({path:o.path,contentHash:o.contentHash})).sort((o,d)=>o.path.localeCompare(d.path));return{contentHash:$({schemaVersion:"openpond.desktopWorkHarnessSurface.v1",components:r}),components:r,inactiveAgents:t}}v(O,"desktopWorkRuntimeSurface");function q(e){let r=(e.now??(()=>new Date().toISOString()))(),t=e.proposal.edits.find(o=>o.route==="memory");return e.proposal.validationPlan.map(o=>{let d="passed",i="Memory candidate is bounded, scoped, and contains no obvious credential material.";try{if(o.kind==="observed_recovery"){if(!e.proposal.evidence.some(s=>s.kind==="recovery"))throw new Error("Observed-recovery validation requires recorded recovery evidence.");i="Memory proposal is grounded in immutable recovery evidence."}else if(o.kind==="memory"){if(!t||!/^memory\/[a-z0-9][a-z0-9-]{0,119}$/.test(t.target))throw new Error("Memory proposal requires one safe memory/<slug> target.");let s=e.proposal.metadata.expectedMemory;if(!s||typeof s!="object"||Array.isArray(s))throw new Error("Memory proposal requires an expected revision snapshot.");let l=s;if(l.key!==C(t.target))throw new Error("Memory proposal expected revision targets a different key.");if(l.revision!==null&&(!Number.isInteger(l.revision)||Number(l.revision)<1))throw new Error("Memory proposal expected revision is invalid.");if(l.contentHash!==null&&typeof l.contentHash!="string")throw new Error("Memory proposal expected content hash is invalid.");if(l.status!==null&&l.status!=="active"&&l.status!=="deleted")throw new Error("Memory proposal expected status is invalid.");if(l.revision===null&&(l.contentHash!==null||l.status!==null))throw new Error("New memory snapshot must not claim existing content or status.");if(l.revision!==null&&(typeof l.contentHash!="string"||l.status===null))throw new Error("Existing memory snapshot requires its content hash and status.");if(t.operation==="delete"&&l.status!=="active")throw new Error("Memory deletion requires an active expected revision.");if(t.operation!=="delete"){if(!t.content?.trim()||t.content.length>24e3)throw new Error("Memory content must contain 1-24,000 characters.");if(/\b(?:api[_-]?key|access[_-]?token|password|secret)\s*[:=]/i.test(t.content))throw new Error("Memory content appears to contain credential material.")}}else d="blocked",i=`Memory validation cannot satisfy ${o.kind}.`}catch(s){d="failed",i=s instanceof Error?s.message:String(s)}return I({schemaVersion:"openpond.harnessTargetedValidationReceipt.v1",id:`validation-${e.proposal.id}-${o.id}`,proposal:{id:e.proposal.id,contentHash:e.proposal.contentHash},validationId:o.id,kind:o.kind,status:d,summary:i,evidenceRefs:e.proposal.evidence,createdAt:r,metadata:{externalState:"harness_memory"}})})}v(q,"validateMemoryProposal");function C(e){let r=e.replaceAll("\\","/"),t=/^memory\/([a-z0-9][a-z0-9-]{0,119})$/.exec(r);if(!t)throw new Error(`Invalid Harness memory target: ${e}.`);return t[1]}v(C,"memoryKeyFromTarget");async function Z(e){let r=await e.store.getHarnessWorkspace(e.workspaceId);if(!r)throw new Error(`Harness workspace ${e.workspaceId} does not exist.`);let t=E(e.storeDir,r.id),o=m.join(t.root,"source-swap.json"),d=await p.readFile(o,"utf8").then(JSON.parse).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!d)return"none";let i=await g({workspaceId:r.id,sourceDir:t.source});if(r.sourceRevision===d.nextSourceRevision&&i.sourceRevision===d.nextSourceRevision)return await p.rm(d.backupSource,{recursive:!0,force:!0}),await p.rm(o,{force:!0}),"completed";let s=await g({workspaceId:r.id,sourceDir:d.backupSource});if(r.sourceRevision===d.previousSourceRevision&&s.sourceRevision===d.previousSourceRevision)return await b(t.source,d.backupSource),await p.rm(o,{force:!0}),"restored";throw new Error("Harness source-swap recovery cannot reconcile filesystem and workspace revisions.")}v(Z,"recoverLocalHarnessSourceSwap");async function V(e,r){for(let t of r.edits){let o=T(e,t.target);if(t.operation==="delete"){await p.rm(o,{force:!1});continue}if(t.content===null)throw new Error(`Refiner edit ${t.id} has no content.`);if(t.operation==="create")await p.mkdir(m.dirname(o),{recursive:!0}),await p.writeFile(o,t.content,{flag:"wx"});else{let d=await p.lstat(o);if(!d.isFile()||d.isSymbolicLink())throw new Error(`Refiner update target must be a regular file: ${t.target}`);await p.writeFile(o,t.content,{flag:"w"})}}}v(V,"applyOverlayEdits");function T(e,r){let t=m.resolve(e),o=m.resolve(t,...r.replaceAll("\\","/").split("/")),d=m.relative(t,o);if(!d||d.startsWith("..")||m.isAbsolute(d))throw new Error(`Refiner edit target escapes the Harness source: ${r}`);return o}v(T,"containedPath");async function _(e,r){let t=`${e}.${H()}.tmp`;await p.writeFile(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,{flag:"wx"}),await p.rename(t,e)}v(_,"writeSwapJournal");async function b(e,r){await p.rm(e,{recursive:!0,force:!0}),await p.rename(r,e)}v(b,"restoreSource");export{Q as a,X as b,Y as c,Z as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as Ae}from"./chunk-GW766ZSO.js";import{b as be}from"./chunk-XW6HGSIT.js";import{g as H}from"./chunk-KG325WTN.js";import{B as O,a as Pe,b as Ie}from"./chunk-EIRYMSEG.js";import{a as re,b as ye,j as A}from"./chunk-Q4TBTRIG.js";import{r as Ce}from"./chunk-PRGBLQVH.js";import{D as we}from"./chunk-Z4Z5UOZM.js";import{m as $}from"./chunk-KGNCKIFP.js";import{a as o}from"./chunk-FTQLQJQV.js";import{existsSync as z}from"node:fs";import{cp as xe,mkdir as Ee,readFile as Oe}from"node:fs/promises";import k from"node:path";import{existsSync as L}from"node:fs";import{readFile as K}from"node:fs/promises";import q from"node:path";async function F(e){await V(e.target);let t={},a=new Set([`${e.target.sourceRootRelativePath}/.openpond/agent-inspect.json`,`${e.target.sourceRootRelativePath}/.openpond/action-registry.json`,`${e.target.sourceRootRelativePath}/.openpond/eval-results.json`]),n=[{name:"inspect",command:"inspect",args:["--json"]},{name:"build",command:"build"},{name:"validate",command:"validate",args:["--json"]},{name:"eval",command:"eval",args:["--json"]},{name:"direct-run",command:"run",args:[e.target.defaultAction,"--json","--input",JSON.stringify({prompt:e.snapshot.objective,channel:"openpond_chat"})]}];for(let r of n){let s=await O({cwd:e.target.sourceRoot,command:r.command,args:r.args,...r.command==="eval"&&e.requireEvalPass===!1?{throwOnFailure:!1}:{}});if(s.code!==0&&!(r.command==="eval"&&e.requireEvalPass===!1))throw new Error(s.stderr.trim()||s.stdout.trim()||`${r.command} failed with exit code ${s.code??"unknown"}`);let i=lt(s.stdout),d=mt(i);d&&a.add(q.join(e.target.sourceRootRelativePath,d)),t[r.name]={summary:pt(r.name,i),traceArtifactRef:d,stdout:s.stdout.trim().slice(0,4e3),stderr:s.stderr.trim().slice(0,4e3)}}return await dt(e.target,e.requireEvalPass!==!1),{checkRefs:[...a],metadata:t}}o(F,"runLocalCreatePipelineChecks");async function V(e){if(!L(e.sourceRoot))throw new Error(`Codex did not create the expected agent source root: ${e.sourceRoot}`);let t=q.join(e.sourceRoot,"agent","agent.ts");if(!L(t))throw new Error(`Codex did not create the expected SDK agent source: ${t}`);let a=q.join(e.repoPath,"openpond-profile.json");if(!L(a))throw new Error(`Codex did not update the profile repo manifest: ${a}`);let n=q.join(e.sourcePath,"settings","profile.yaml");if(!L(n))throw new Error(`Codex did not update the profile manifest: ${n}`);let s=JSON.parse(await K(a,"utf8")).profiles?.[e.activeProfile];if(!s)throw new Error(`openpond-profile.json does not register profile ${e.activeProfile}.`);if(!s.enabledAgents?.includes(e.agentId))throw new Error(`openpond-profile.json does not enable generated agent ${e.agentId}.`);let i=await K(n,"utf8");if(!i.includes(`id: ${e.agentId}`)&&!i.includes(`id: "${e.agentId}"`))throw new Error(`settings/profile.yaml does not register generated agent ${e.agentId}.`);let d=e.agentId==="default"?["agent/agent.ts","agent"]:[`agents/${e.agentId}`];if(!d.some(u=>i.includes(u)))throw new Error(`settings/profile.yaml does not point ${e.agentId} at ${d[0]}.`)}o(V,"assertLocalCreateSourceLayout");async function dt(e,t=!0){let a=q.join(e.sourceRoot,".openpond","action-registry.json"),n=q.join(e.sourceRoot,".openpond","eval-results.json");if(!L(a))throw new Error(`Generated source did not produce an action registry: ${a}`);if(!L(n))throw new Error(`Generated source did not produce eval results: ${n}`);let r=JSON.parse(await K(a,"utf8")),s=Array.isArray(r.actions)?r.actions:[];if(!new Set(s.map(c=>typeof c.id=="string"?c.id:null).filter(c=>!!c)).has(e.defaultAction))throw new Error(`Generated action registry does not expose default action ${e.defaultAction}.`);let d=s.filter(c=>typeof c.id=="string"&&(!W(c.label)||!W(c.description)||typeof c.timeoutSeconds!="number"));if(d.length>0)throw new Error(`Generated action registry has actions missing labels, descriptions, or timeout policies: ${d.map(c=>c.id).join(", ")}`);let u=Pe({actionCatalog:s.filter(c=>typeof c.id=="string").map(c=>({id:c.id,name:W(c.name),setupRequirements:ut(c.setupRequirements)??[]})),actionId:e.defaultAction});if(u.blockingRequirements.length>0)throw new Error(`Generated default action ${e.defaultAction} has unresolved required setup and cannot be ready_local: ${u.blockingRequirements.map(Ie).join("; ")}. Mark built-in/local fixture requirements ready or optional when they are satisfied, or leave the pipeline blocked until the setup is configured.`);let m=JSON.parse(await K(n,"utf8"));if(typeof m.summary?.total!="number"||m.summary.total<1)throw new Error("Generated source must define at least one deterministic SDK eval.");if(t&&m.summary.failed!==0)throw new Error("Generated source evals did not all pass.")}o(dt,"assertGeneratedSdkArtifacts");function lt(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return null;try{return JSON.parse(t)}catch{return null}}o(lt,"parseJsonOutput");function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(E,"asRecord");function ut(e){return Array.isArray(e)?e.filter(t=>!!E(t)):null}o(ut,"recordArray");function mt(e){let t=E(e),a=W(t?.traceArtifactRef);return a?.startsWith(".openpond/")?a:null}o(mt,"traceRefFromCommandResult");function pt(e,t){let a=E(t);return a?e==="inspect"?{actionCount:Array.isArray(a.actionCatalog)?a.actionCatalog.length:null,defaultAction:E(a.agent)?.defaultAction??null,projectName:E(a.project)?.name??null}:e==="validate"?{status:a.status??null,errors:E(a.summary)?.errors??null,warnings:E(a.summary)?.warnings??null}:e==="eval"?E(a.summary):e==="direct-run"?{hasResult:!!E(a.result),resultKeys:Object.keys(E(a.result)??{})}:null:null}o(pt,"summaryFromCommandResult");function W(e){return typeof e=="string"&&e.trim()?e.trim():null}o(W,"stringValue");var gt="Approved local Create plans require model-backed SDK source application; no source mutation was performed.",ft=1800*1e3,Te=".openpond-harness-source-application.json",ht=300*1e3,vt=2*1e3,Rt=5*1e3;async function He(e,t={}){if(!kt(e))return e;let a=t.now??(()=>new Date().toISOString()),n=e.adapter;if(n.kind!=="local")return e;if(!t.session||!t.turn||!t.ensureCodexRuntime||!t.appendRuntimeEvent||!t.setProviderTurnId)return Y(e,{now:a(),reason:gt,metadata:{reason:"model_backed_source_application_required",sourcePath:n.sourcePath??null,repoPath:n.repoPath??null,activeProfile:n.activeProfile??null,operation:e.operation,requestedAgentId:e.target.kind==="agent"?e.target.id:null}});let r;try{r=se(e)}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_target_unresolved"}})}try{await ie({snapshot:e,session:t.session,turn:t.turn,target:r,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,model:t.model??we,codexReasoningEffort:t.codexReasoningEffort})}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"model_backed_source_application_failed",target:r}})}let s=oe(e,{state:"running_checks",now:a(),blockedReason:null,sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],metadata:{localCreatePipeline:{status:"running_checks",target:r}},candidates:[{id:Se(e.id),target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},status:"checking",git:null,parentCandidateId:null,tasksetRef:e.tasksetRef,authoringModelRef:t.model??null,allowedPaths:e.plan?.sourcePlan.map(i=>i.path)??[],sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:e.createdAt,updatedAt:a(),metadata:{sourceAuthority:e.adapter.sourceAuthority}}]});await t.onSnapshot?.(s);try{let i=await(t.runChecks??F)({snapshot:s,target:r}),d=a(),u=Se(e.id),m=`agent_eval_${e.id}`;return oe(s,{state:"ready_local",now:d,blockedReason:null,checkRefs:i.checkRefs,candidates:s.candidates.map(c=>c.id===u?{...c,status:"accepted",checkRefs:X(c.checkRefs,i.checkRefs),evaluationReceiptRefs:X(c.evaluationReceiptRefs,[m]),updatedAt:d}:c),evaluationReceipts:[...s.evaluationReceipts.filter(c=>c.id!==m),{id:m,candidateId:u,target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},evaluatorKind:"agent_sdk",subject:"candidate",sourceCommit:e.adapter.kind==="local"?e.adapter.localHead:null,sourceBranch:null,tasksetId:e.tasksetRef?.id??null,tasksetHash:e.tasksetRef?.contentHash??null,taskAttemptRefs:i.checkRefs.filter(c=>c.includes("eval")),status:"passed",publishGate:"passed",summaryCounts:null,evalRefs:i.checkRefs.filter(c=>c.includes("eval")),artifactRefs:i.checkRefs,summary:wt(i.metadata),createdAt:d,metadata:i.metadata??{}}],metadata:{localCreatePipeline:{status:"ready_local",target:r,checks:i.metadata??{}}}})}catch(i){return Y(s,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_checks_failed",target:r}})}}o(He,"applyApprovedLocalCreateImproveRun");function kt(e){return e.state==="applying_source"&&e.plan?.status==="approved"&&e.adapter.kind==="local"&&e.target.kind==="agent"}o(kt,"shouldApplyLocalCreatePipeline");function oe(e,t){return A(e,{state:t.state,blockedReason:t.blockedReason===void 0?e.blockedReason:t.blockedReason,checkRefs:X(e.checkRefs,t.checkRefs??[]),sourceRefs:X(e.sourceRefs,t.sourceRefs??[]),candidates:t.candidates??e.candidates,evaluationReceipts:t.evaluationReceipts??e.evaluationReceipts,metadata:{...e.metadata,...t.metadata??{}},updatedAt:t.now})}o(oe,"transitionCreatePipeline");function Y(e,t){return oe(e,{state:"blocked",now:t.now,blockedReason:t.reason,metadata:{localCreatePipeline:{status:"blocked",...t.metadata}}})}o(Y,"blockLocalCreatePipeline");function X(e,t){return Array.from(new Set([...e,...t].filter(Boolean)))}o(X,"mergeRefs");function Se(e){return`agent_candidate_${e}`}o(Se,"agentCandidateId");function wt(e){let t=M(e?.eval),a=typeof t?.total=="number"?t.total:null;return a===null?"Agent SDK checks and deterministic Evals passed.":`${a} Agent SDK Eval${a===1?"":"s"} passed.`}o(wt,"checkSummary");function se(e){let t=e.adapter;if(t.kind!=="local")throw new Error("Create/Improve target must use the local adapter.");if(e.target.kind!=="agent")throw new Error("Local agent source application requires an Agent target.");let a=t.sourcePath?.trim(),n=t.repoPath?.trim();if(!a)throw new Error("Local Create approval is missing a profile source path.");if(!n)throw new Error("Local Create approval is missing a profile repo path.");let r=t.activeProfile?.trim()||"default",s=k.resolve(a),i=k.resolve(n),d=qe(e.target.id)??xt(e)??St(e.objective),u=Tt(Et(e.plan?.defaultChatAction.key)??"chat",d),m=e.operation==="improve"&&d==="default"?s:k.join(s,"agents",d);return{activeProfile:r,agentId:d,defaultAction:u,repoPath:i,sourcePath:s,workspaceRoot:i,profileRelativePath:je(k.relative(i,s)),sourceRoot:m,sourceRootRelativePath:je(k.relative(i,m))}}o(se,"resolveLocalCreatePipelineTarget");async function ie(e){if(!z(e.target.workspaceRoot))throw new Error(`Profile repo path does not exist: ${e.target.workspaceRoot}`);if(!z(e.target.sourcePath))throw new Error(`Profile source path does not exist: ${e.target.sourcePath}`);if(await Ct(e.snapshot,e.target)){await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Applied prepared harness ${e.snapshot.operation==="improve"?"Improve":"Create"} source for ${e.target.agentId}; running local checks.`,data:{phase:"prepared_source_apply_completed",runId:e.snapshot.id,target:e.target}}));return}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Applying approved ${e.snapshot.operation==="improve"?"Improve":"Create"} plan with Codex in ${e.target.sourceRootRelativePath}.`,data:{phase:"source_apply_started",runId:e.snapshot.id,target:e.target}}));let t={...e.session,provider:"codex",cwd:e.target.workspaceRoot,workspaceKind:"local_project",workspaceId:e.session.workspaceId??`openpond-profile:${e.target.activeProfile}`,workspaceName:e.session.workspaceName??`OpenPond profile ${e.target.activeProfile}`},a=e.session.provider==="codex"?e.model:null,n=await e.ensureCodexRuntime(t,{approvalPolicy:"never",sandbox:"workspace-write",model:a,codexPermissionMode:"auto-review",codexReasoningEffort:e.codexReasoningEffort}),r=await n.client.startTurn({threadId:n.threadId,prompt:At(e.snapshot,e.target),cwd:e.target.workspaceRoot,model:a,approvalPolicy:"never",sandbox:"workspace-write"});await e.setProviderTurnId(r.turnId);try{await n.client.waitForTurn(r.turnId,ft)}catch(s){if(!$e(s,r.turnId)&&!It(s))throw s;let i=$e(s,r.turnId)?"timed out":"exited cleanly before returning a turn completion";if(await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Codex source application ${i}; checking for completed generated source before blocking.`,data:{phase:"source_apply_recovery_started",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}})),!await yt(e.target))throw s;await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Recovered completed ${e.snapshot.operation==="improve"?"Improve":"Create"} source after Codex source application ${i} for ${e.target.agentId}; running local checks.`,data:{phase:"source_apply_recovered",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}}))}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"provider",appId:e.session.appId,status:"completed",output:`Codex completed approved ${e.snapshot.operation==="improve"?"Improve":"Create"} source application for ${e.target.agentId}.`,data:{phase:"source_apply_completed",runId:e.snapshot.id,providerTurnId:r.turnId,target:e.target}}))}o(ie,"runModelBackedLocalCreateSourceApplication");async function Ct(e,t,a=process.env){if(!Ae(a))return!1;let n=k.join(t.workspaceRoot,Te);if(!z(n))return!1;let r=JSON.parse(await Oe(n,"utf8")),s=M(r);if(s?.schema!=="openpond.harnessPreparedSource.v1")throw new Error(`${Te} must use schema openpond.harnessPreparedSource.v1.`);let i=M(s.agents),d=M(i?.[t.agentId]),u=Pt(d?.[e.operation]);if(!u)return!1;let m=ne(t.workspaceRoot,u.source,"source");if(!z(m))throw new Error(`Prepared harness source does not exist: ${u.source}`);await Ee(t.sourceRoot,{recursive:!0}),await xe(m,t.sourceRoot,{recursive:!0,force:!0});for(let c of u.registrations??[]){let g=ne(t.workspaceRoot,c.source,"registration source"),l=ne(t.workspaceRoot,c.target,"registration target");if(!z(g))throw new Error(`Prepared harness registration source does not exist: ${c.source}`);await Ee(k.dirname(l),{recursive:!0}),await xe(g,l,{force:!0})}return!0}o(Ct,"applyPreparedHarnessSourceApplication");function Pt(e){let t=M(e);if(!t||typeof t.source!="string"||!t.source.trim())return null;if(t.registrations!==void 0&&!Array.isArray(t.registrations))throw new Error("Prepared harness source registrations must be an array.");let a=(t.registrations??[]).map(n=>{let r=M(n);if(!r||typeof r.source!="string"||!r.source.trim()||typeof r.target!="string"||!r.target.trim())throw new Error("Prepared harness source registrations require source and target paths.");return{source:r.source,target:r.target}});return{source:t.source,registrations:a}}o(Pt,"asHarnessPreparedSourceOperation");function ne(e,t,a){if(k.isAbsolute(t))throw new Error(`Prepared harness ${a} must be relative to the profile repo.`);let n=k.resolve(e),r=k.resolve(n,t);if(r!==n&&!r.startsWith(`${n}${k.sep}`))throw new Error(`Prepared harness ${a} must stay inside the profile repo.`);return r}o(ne,"resolveHarnessManifestPath");function $e(e,t){return(e instanceof Error?e.message:String(e))===`codex turn ${t} timed out`}o($e,"isCodexTurnTimeoutError");function It(e){return(e instanceof Error?e.message:String(e)).startsWith("codex app-server exited with code 0")}o(It,"isCodexAppServerCleanExitError");async function yt(e){let t=Date.now()+ht;for(;Date.now()<t;){if(await bt(e))return!0;await Le(vt)}return!1}o(yt,"waitForTimedOutSourceApplication");async function bt(e){try{await V(e);let t=await _e(e);await Le(Rt),await V(e);let a=await _e(e);return t===a}catch{return!1}}o(bt,"localCreateSourceLayoutIsStable");async function _e(e){let t=[k.join(e.sourceRoot,"agent","agent.ts"),k.join(e.sourceRoot,"package.json"),k.join(e.repoPath,"openpond-profile.json"),k.join(e.sourcePath,"settings","profile.yaml")];return(await Promise.all(t.map(async n=>{let r=await Oe(n,"utf8");return`${n}:${r.length}:${r}`}))).join(`
|
|
2
|
+
import{a as Ae}from"./chunk-GW766ZSO.js";import{b as be}from"./chunk-XW6HGSIT.js";import{g as H}from"./chunk-57TRXBLT.js";import{B as O,a as Pe,b as Ie}from"./chunk-FKJHEZCW.js";import{a as re,b as ye,j as A}from"./chunk-Q4TBTRIG.js";import{r as Ce}from"./chunk-JMBQYBPI.js";import{D as we}from"./chunk-Z4Z5UOZM.js";import{m as $}from"./chunk-KGNCKIFP.js";import{a as o}from"./chunk-FTQLQJQV.js";import{existsSync as z}from"node:fs";import{cp as xe,mkdir as Ee,readFile as Oe}from"node:fs/promises";import k from"node:path";import{existsSync as L}from"node:fs";import{readFile as K}from"node:fs/promises";import q from"node:path";async function F(e){await V(e.target);let t={},a=new Set([`${e.target.sourceRootRelativePath}/.openpond/agent-inspect.json`,`${e.target.sourceRootRelativePath}/.openpond/action-registry.json`,`${e.target.sourceRootRelativePath}/.openpond/eval-results.json`]),n=[{name:"inspect",command:"inspect",args:["--json"]},{name:"build",command:"build"},{name:"validate",command:"validate",args:["--json"]},{name:"eval",command:"eval",args:["--json"]},{name:"direct-run",command:"run",args:[e.target.defaultAction,"--json","--input",JSON.stringify({prompt:e.snapshot.objective,channel:"openpond_chat"})]}];for(let r of n){let s=await O({cwd:e.target.sourceRoot,command:r.command,args:r.args,...r.command==="eval"&&e.requireEvalPass===!1?{throwOnFailure:!1}:{}});if(s.code!==0&&!(r.command==="eval"&&e.requireEvalPass===!1))throw new Error(s.stderr.trim()||s.stdout.trim()||`${r.command} failed with exit code ${s.code??"unknown"}`);let i=lt(s.stdout),d=mt(i);d&&a.add(q.join(e.target.sourceRootRelativePath,d)),t[r.name]={summary:pt(r.name,i),traceArtifactRef:d,stdout:s.stdout.trim().slice(0,4e3),stderr:s.stderr.trim().slice(0,4e3)}}return await dt(e.target,e.requireEvalPass!==!1),{checkRefs:[...a],metadata:t}}o(F,"runLocalCreatePipelineChecks");async function V(e){if(!L(e.sourceRoot))throw new Error(`Codex did not create the expected agent source root: ${e.sourceRoot}`);let t=q.join(e.sourceRoot,"agent","agent.ts");if(!L(t))throw new Error(`Codex did not create the expected SDK agent source: ${t}`);let a=q.join(e.repoPath,"openpond-profile.json");if(!L(a))throw new Error(`Codex did not update the profile repo manifest: ${a}`);let n=q.join(e.sourcePath,"settings","profile.yaml");if(!L(n))throw new Error(`Codex did not update the profile manifest: ${n}`);let s=JSON.parse(await K(a,"utf8")).profiles?.[e.activeProfile];if(!s)throw new Error(`openpond-profile.json does not register profile ${e.activeProfile}.`);if(!s.enabledAgents?.includes(e.agentId))throw new Error(`openpond-profile.json does not enable generated agent ${e.agentId}.`);let i=await K(n,"utf8");if(!i.includes(`id: ${e.agentId}`)&&!i.includes(`id: "${e.agentId}"`))throw new Error(`settings/profile.yaml does not register generated agent ${e.agentId}.`);let d=e.agentId==="default"?["agent/agent.ts","agent"]:[`agents/${e.agentId}`];if(!d.some(u=>i.includes(u)))throw new Error(`settings/profile.yaml does not point ${e.agentId} at ${d[0]}.`)}o(V,"assertLocalCreateSourceLayout");async function dt(e,t=!0){let a=q.join(e.sourceRoot,".openpond","action-registry.json"),n=q.join(e.sourceRoot,".openpond","eval-results.json");if(!L(a))throw new Error(`Generated source did not produce an action registry: ${a}`);if(!L(n))throw new Error(`Generated source did not produce eval results: ${n}`);let r=JSON.parse(await K(a,"utf8")),s=Array.isArray(r.actions)?r.actions:[];if(!new Set(s.map(c=>typeof c.id=="string"?c.id:null).filter(c=>!!c)).has(e.defaultAction))throw new Error(`Generated action registry does not expose default action ${e.defaultAction}.`);let d=s.filter(c=>typeof c.id=="string"&&(!W(c.label)||!W(c.description)||typeof c.timeoutSeconds!="number"));if(d.length>0)throw new Error(`Generated action registry has actions missing labels, descriptions, or timeout policies: ${d.map(c=>c.id).join(", ")}`);let u=Pe({actionCatalog:s.filter(c=>typeof c.id=="string").map(c=>({id:c.id,name:W(c.name),setupRequirements:ut(c.setupRequirements)??[]})),actionId:e.defaultAction});if(u.blockingRequirements.length>0)throw new Error(`Generated default action ${e.defaultAction} has unresolved required setup and cannot be ready_local: ${u.blockingRequirements.map(Ie).join("; ")}. Mark built-in/local fixture requirements ready or optional when they are satisfied, or leave the pipeline blocked until the setup is configured.`);let m=JSON.parse(await K(n,"utf8"));if(typeof m.summary?.total!="number"||m.summary.total<1)throw new Error("Generated source must define at least one deterministic SDK eval.");if(t&&m.summary.failed!==0)throw new Error("Generated source evals did not all pass.")}o(dt,"assertGeneratedSdkArtifacts");function lt(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return null;try{return JSON.parse(t)}catch{return null}}o(lt,"parseJsonOutput");function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(E,"asRecord");function ut(e){return Array.isArray(e)?e.filter(t=>!!E(t)):null}o(ut,"recordArray");function mt(e){let t=E(e),a=W(t?.traceArtifactRef);return a?.startsWith(".openpond/")?a:null}o(mt,"traceRefFromCommandResult");function pt(e,t){let a=E(t);return a?e==="inspect"?{actionCount:Array.isArray(a.actionCatalog)?a.actionCatalog.length:null,defaultAction:E(a.agent)?.defaultAction??null,projectName:E(a.project)?.name??null}:e==="validate"?{status:a.status??null,errors:E(a.summary)?.errors??null,warnings:E(a.summary)?.warnings??null}:e==="eval"?E(a.summary):e==="direct-run"?{hasResult:!!E(a.result),resultKeys:Object.keys(E(a.result)??{})}:null:null}o(pt,"summaryFromCommandResult");function W(e){return typeof e=="string"&&e.trim()?e.trim():null}o(W,"stringValue");var gt="Approved local Create plans require model-backed SDK source application; no source mutation was performed.",ft=1800*1e3,Te=".openpond-harness-source-application.json",ht=300*1e3,vt=2*1e3,Rt=5*1e3;async function He(e,t={}){if(!kt(e))return e;let a=t.now??(()=>new Date().toISOString()),n=e.adapter;if(n.kind!=="local")return e;if(!t.session||!t.turn||!t.ensureCodexRuntime||!t.appendRuntimeEvent||!t.setProviderTurnId)return Y(e,{now:a(),reason:gt,metadata:{reason:"model_backed_source_application_required",sourcePath:n.sourcePath??null,repoPath:n.repoPath??null,activeProfile:n.activeProfile??null,operation:e.operation,requestedAgentId:e.target.kind==="agent"?e.target.id:null}});let r;try{r=se(e)}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_target_unresolved"}})}try{await ie({snapshot:e,session:t.session,turn:t.turn,target:r,ensureCodexRuntime:t.ensureCodexRuntime,appendRuntimeEvent:t.appendRuntimeEvent,setProviderTurnId:t.setProviderTurnId,model:t.model??we,codexReasoningEffort:t.codexReasoningEffort})}catch(i){return Y(e,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"model_backed_source_application_failed",target:r}})}let s=oe(e,{state:"running_checks",now:a(),blockedReason:null,sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],metadata:{localCreatePipeline:{status:"running_checks",target:r}},candidates:[{id:Se(e.id),target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},status:"checking",git:null,parentCandidateId:null,tasksetRef:e.tasksetRef,authoringModelRef:t.model??null,allowedPaths:e.plan?.sourcePlan.map(i=>i.path)??[],sourceRefs:[r.sourceRootRelativePath,k.join(r.profileRelativePath,"settings","profile.yaml"),"openpond-profile.json"],artifactRefs:[],checkRefs:[],evaluationReceiptRefs:[],createdAt:e.createdAt,updatedAt:a(),metadata:{sourceAuthority:e.adapter.sourceAuthority}}]});await t.onSnapshot?.(s);try{let i=await(t.runChecks??F)({snapshot:s,target:r}),d=a(),u=Se(e.id),m=`agent_eval_${e.id}`;return oe(s,{state:"ready_local",now:d,blockedReason:null,checkRefs:i.checkRefs,candidates:s.candidates.map(c=>c.id===u?{...c,status:"accepted",checkRefs:X(c.checkRefs,i.checkRefs),evaluationReceiptRefs:X(c.evaluationReceiptRefs,[m]),updatedAt:d}:c),evaluationReceipts:[...s.evaluationReceipts.filter(c=>c.id!==m),{id:m,candidateId:u,target:{kind:"agent",id:r.agentId,displayName:e.target.displayName,defaultActionKey:r.defaultAction},evaluatorKind:"agent_sdk",subject:"candidate",sourceCommit:e.adapter.kind==="local"?e.adapter.localHead:null,sourceBranch:null,tasksetId:e.tasksetRef?.id??null,tasksetHash:e.tasksetRef?.contentHash??null,taskAttemptRefs:i.checkRefs.filter(c=>c.includes("eval")),status:"passed",publishGate:"passed",summaryCounts:null,evalRefs:i.checkRefs.filter(c=>c.includes("eval")),artifactRefs:i.checkRefs,summary:wt(i.metadata),createdAt:d,metadata:i.metadata??{}}],metadata:{localCreatePipeline:{status:"ready_local",target:r,checks:i.metadata??{}}}})}catch(i){return Y(s,{now:a(),reason:i instanceof Error?i.message:String(i),metadata:{reason:"local_create_checks_failed",target:r}})}}o(He,"applyApprovedLocalCreateImproveRun");function kt(e){return e.state==="applying_source"&&e.plan?.status==="approved"&&e.adapter.kind==="local"&&e.target.kind==="agent"}o(kt,"shouldApplyLocalCreatePipeline");function oe(e,t){return A(e,{state:t.state,blockedReason:t.blockedReason===void 0?e.blockedReason:t.blockedReason,checkRefs:X(e.checkRefs,t.checkRefs??[]),sourceRefs:X(e.sourceRefs,t.sourceRefs??[]),candidates:t.candidates??e.candidates,evaluationReceipts:t.evaluationReceipts??e.evaluationReceipts,metadata:{...e.metadata,...t.metadata??{}},updatedAt:t.now})}o(oe,"transitionCreatePipeline");function Y(e,t){return oe(e,{state:"blocked",now:t.now,blockedReason:t.reason,metadata:{localCreatePipeline:{status:"blocked",...t.metadata}}})}o(Y,"blockLocalCreatePipeline");function X(e,t){return Array.from(new Set([...e,...t].filter(Boolean)))}o(X,"mergeRefs");function Se(e){return`agent_candidate_${e}`}o(Se,"agentCandidateId");function wt(e){let t=M(e?.eval),a=typeof t?.total=="number"?t.total:null;return a===null?"Agent SDK checks and deterministic Evals passed.":`${a} Agent SDK Eval${a===1?"":"s"} passed.`}o(wt,"checkSummary");function se(e){let t=e.adapter;if(t.kind!=="local")throw new Error("Create/Improve target must use the local adapter.");if(e.target.kind!=="agent")throw new Error("Local agent source application requires an Agent target.");let a=t.sourcePath?.trim(),n=t.repoPath?.trim();if(!a)throw new Error("Local Create approval is missing a profile source path.");if(!n)throw new Error("Local Create approval is missing a profile repo path.");let r=t.activeProfile?.trim()||"default",s=k.resolve(a),i=k.resolve(n),d=qe(e.target.id)??xt(e)??St(e.objective),u=Tt(Et(e.plan?.defaultChatAction.key)??"chat",d),m=e.operation==="improve"&&d==="default"?s:k.join(s,"agents",d);return{activeProfile:r,agentId:d,defaultAction:u,repoPath:i,sourcePath:s,workspaceRoot:i,profileRelativePath:je(k.relative(i,s)),sourceRoot:m,sourceRootRelativePath:je(k.relative(i,m))}}o(se,"resolveLocalCreatePipelineTarget");async function ie(e){if(!z(e.target.workspaceRoot))throw new Error(`Profile repo path does not exist: ${e.target.workspaceRoot}`);if(!z(e.target.sourcePath))throw new Error(`Profile source path does not exist: ${e.target.sourcePath}`);if(await Ct(e.snapshot,e.target)){await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Applied prepared harness ${e.snapshot.operation==="improve"?"Improve":"Create"} source for ${e.target.agentId}; running local checks.`,data:{phase:"prepared_source_apply_completed",runId:e.snapshot.id,target:e.target}}));return}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Applying approved ${e.snapshot.operation==="improve"?"Improve":"Create"} plan with Codex in ${e.target.sourceRootRelativePath}.`,data:{phase:"source_apply_started",runId:e.snapshot.id,target:e.target}}));let t={...e.session,provider:"codex",cwd:e.target.workspaceRoot,workspaceKind:"local_project",workspaceId:e.session.workspaceId??`openpond-profile:${e.target.activeProfile}`,workspaceName:e.session.workspaceName??`OpenPond profile ${e.target.activeProfile}`},a=e.session.provider==="codex"?e.model:null,n=await e.ensureCodexRuntime(t,{approvalPolicy:"never",sandbox:"workspace-write",model:a,codexPermissionMode:"auto-review",codexReasoningEffort:e.codexReasoningEffort}),r=await n.client.startTurn({threadId:n.threadId,prompt:At(e.snapshot,e.target),cwd:e.target.workspaceRoot,model:a,approvalPolicy:"never",sandbox:"workspace-write"});await e.setProviderTurnId(r.turnId);try{await n.client.waitForTurn(r.turnId,ft)}catch(s){if(!$e(s,r.turnId)&&!It(s))throw s;let i=$e(s,r.turnId)?"timed out":"exited cleanly before returning a turn completion";if(await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"started",output:`Codex source application ${i}; checking for completed generated source before blocking.`,data:{phase:"source_apply_recovery_started",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}})),!await yt(e.target))throw s;await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"server",appId:e.session.appId,status:"completed",output:`Recovered completed ${e.snapshot.operation==="improve"?"Improve":"Create"} source after Codex source application ${i} for ${e.target.agentId}; running local checks.`,data:{phase:"source_apply_recovered",runId:e.snapshot.id,providerTurnId:r.turnId,reason:i,target:e.target}}))}await e.appendRuntimeEvent(H({sessionId:e.session.id,turnId:e.turn.id,name:"create_improve.updated",source:"provider",appId:e.session.appId,status:"completed",output:`Codex completed approved ${e.snapshot.operation==="improve"?"Improve":"Create"} source application for ${e.target.agentId}.`,data:{phase:"source_apply_completed",runId:e.snapshot.id,providerTurnId:r.turnId,target:e.target}}))}o(ie,"runModelBackedLocalCreateSourceApplication");async function Ct(e,t,a=process.env){if(!Ae(a))return!1;let n=k.join(t.workspaceRoot,Te);if(!z(n))return!1;let r=JSON.parse(await Oe(n,"utf8")),s=M(r);if(s?.schema!=="openpond.harnessPreparedSource.v1")throw new Error(`${Te} must use schema openpond.harnessPreparedSource.v1.`);let i=M(s.agents),d=M(i?.[t.agentId]),u=Pt(d?.[e.operation]);if(!u)return!1;let m=ne(t.workspaceRoot,u.source,"source");if(!z(m))throw new Error(`Prepared harness source does not exist: ${u.source}`);await Ee(t.sourceRoot,{recursive:!0}),await xe(m,t.sourceRoot,{recursive:!0,force:!0});for(let c of u.registrations??[]){let g=ne(t.workspaceRoot,c.source,"registration source"),l=ne(t.workspaceRoot,c.target,"registration target");if(!z(g))throw new Error(`Prepared harness registration source does not exist: ${c.source}`);await Ee(k.dirname(l),{recursive:!0}),await xe(g,l,{force:!0})}return!0}o(Ct,"applyPreparedHarnessSourceApplication");function Pt(e){let t=M(e);if(!t||typeof t.source!="string"||!t.source.trim())return null;if(t.registrations!==void 0&&!Array.isArray(t.registrations))throw new Error("Prepared harness source registrations must be an array.");let a=(t.registrations??[]).map(n=>{let r=M(n);if(!r||typeof r.source!="string"||!r.source.trim()||typeof r.target!="string"||!r.target.trim())throw new Error("Prepared harness source registrations require source and target paths.");return{source:r.source,target:r.target}});return{source:t.source,registrations:a}}o(Pt,"asHarnessPreparedSourceOperation");function ne(e,t,a){if(k.isAbsolute(t))throw new Error(`Prepared harness ${a} must be relative to the profile repo.`);let n=k.resolve(e),r=k.resolve(n,t);if(r!==n&&!r.startsWith(`${n}${k.sep}`))throw new Error(`Prepared harness ${a} must stay inside the profile repo.`);return r}o(ne,"resolveHarnessManifestPath");function $e(e,t){return(e instanceof Error?e.message:String(e))===`codex turn ${t} timed out`}o($e,"isCodexTurnTimeoutError");function It(e){return(e instanceof Error?e.message:String(e)).startsWith("codex app-server exited with code 0")}o(It,"isCodexAppServerCleanExitError");async function yt(e){let t=Date.now()+ht;for(;Date.now()<t;){if(await bt(e))return!0;await Le(vt)}return!1}o(yt,"waitForTimedOutSourceApplication");async function bt(e){try{await V(e);let t=await _e(e);await Le(Rt),await V(e);let a=await _e(e);return t===a}catch{return!1}}o(bt,"localCreateSourceLayoutIsStable");async function _e(e){let t=[k.join(e.sourceRoot,"agent","agent.ts"),k.join(e.sourceRoot,"package.json"),k.join(e.repoPath,"openpond-profile.json"),k.join(e.sourcePath,"settings","profile.yaml")];return(await Promise.all(t.map(async n=>{let r=await Oe(n,"utf8");return`${n}:${r.length}:${r}`}))).join(`
|
|
3
3
|
---
|
|
4
4
|
`)}o(_e,"sourceLayoutFingerprint");function Le(e){return new Promise(t=>setTimeout(t,e))}o(Le,"sleep");function At(e,t){return[`Apply this already-approved OpenPond ${e.operation==="improve"?"Improve":"Create"} plan by editing the local profile repo source.`,"","This is the source-materialization step, not another plan review. Make the file changes, inspect the existing profile shape first, and leave the repo with a valid openpond-agent-sdk source project.","","Hard requirements:",`- Current working directory is the profile repo root: ${t.workspaceRoot}`,`- Active profile source path relative to cwd: ${t.profileRelativePath}`,`- Target agent id: ${t.agentId}`,`- Target generated source root: ${t.sourceRootRelativePath}`,`- Default action to expose: ${t.defaultAction}`,`- For a create request, create the new SDK project under ${t.profileRelativePath}/agents/<agent-id>; do not overwrite ${t.profileRelativePath}/agent/agent.ts or unrelated existing agents.`,"- For an edit request, only edit the approved target agent source and shared profile registration files required for that edit.",`- Update openpond-profile.json and ${t.profileRelativePath}/settings/profile.yaml so the generated agent is registered, enabled, and catalog-discoverable.`,"- The generated source must be an actual openpond-agent-sdk project with package.json, tsconfig.json when needed, agent/agent.ts, deterministic evals, and action metadata.","- Preserve the approved objective and any captured conversation context in source metadata, instructions, fixture comments, or eval intent so source readback can prove what was captured.","- Treat plan.metadata.actionShape as the approved public action-shape decision when actionShapeDecisionSource is request_metadata or another explicit planner source.","- If plan.metadata.actionShapeDecisionSource is default_chat_fallback, use the approved objective and captured context to choose the actual generated public actions: keep chat-only for conversational assistants, create direct actions for explicit repeatable runs/workflows/artifact transforms, and expose both when the user needs normal chat plus a repeatable catalog action.","- When refining a default fallback during source materialization, encode the chosen public actions in generated SDK action metadata and evals; do not use business-example hardcoding.","- Every public action must have a stable action id, label, description, input/output schema when useful, timeout policy, artifact policy, setup requirement metadata, and deterministic eval coverage.","- The default action must be invocable through the local profile setup gate after checks. Do not leave built-in openpond_chat or committed local fixture/artifact requirements as unresolved required setup; mark those rows ready/satisfied or optional when the generated source already provides them.","- If the approved objective names multiple capabilities or direct action ids, implement each requested public action instead of collapsing everything into a single chat-only action.","- If a capability writes an artifact, declare it in the action artifact policy and assert it from at least one eval.","- Package scripts must be portable from the generated source root; do not hardcode absolute machine-local paths to this repository or CLI.","- Do not hardcode secrets, API keys, provider tokens, or user credentials in source, evals, traces, fixtures, or comments.","- Use realistic deterministic fixture-backed behavior when external systems are unavailable. Declare setup requirements rather than pretending live integrations exist.","- Run or prepare the source so these commands can pass from the target source root: inspect, build, validate, eval, and run of the default action.","","Approved Create request and plan:",JSON.stringify({run:e,plan:e.plan,questions:e.questions,workflowCapture:e.workflowCapture},null,2)].join(`
|
|
5
5
|
`)}o(At,"localCreatePipelinePrompt");function xt(e){for(let t of e.plan?.sourcePlan??[]){let a=/^agents\/([^/]+)/.exec(t.path),n=qe(a?.[1]);if(n)return n}return null}o(xt,"agentIdFromSourcePlan");function qe(e){let t=e?.trim();return t&&t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||null}o(qe,"normalizeAgentId");function Et(e){return e?.trim()||null}o(Et,"normalizeActionId");function M(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}o(M,"asRecord");function Tt(e,t){let a=`${t}.`;return e.startsWith(a)?e.slice(a.length)||"chat":e}o(Tt,"sourceActionIdForAgent");function St(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64).replace(/-+$/g,"")||"generated-agent"}o(St,"slugFromObjective");function je(e){return e.replace(/\\/g,"/")||"."}o(je,"normalizeRelativePath");import de from"node:path";function Pa(e){let t=e.sources.length?e.sources.map(r=>({kind:"conversation",id:r.id,sourceHash:r.sourceHash,excerptRef:`training-source:${r.id}`})):[{kind:"manual_intent",id:`manual_intent_${$(e.objective).slice(0,24)}`,sourceHash:$({objective:e.objective}),excerptRef:null}],a={consent:{status:"granted",scope:e.sources.length?"selected_turns":"direct_intent",reviewedBy:"local_user",reviewedAt:e.timestamp},sources:t,reviewerIntent:e.objective},n=$(a);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_snapshot_${n.slice(0,24)}`,contentHash:n,...a,createdAt:e.timestamp,metadata:{immutable:!0,sourceCount:t.length}})}o(Pa,"createEvidenceSnapshot");function Ia(e){let t={runId:e.run.id,candidateId:e.candidateId,tasksetId:e.run.tasksetRef?.id??null,tasksetRevision:e.run.tasksetRef?.revision??null,tasksetHash:e.run.tasksetRef?.contentHash??null,outcome:e.outcome,reason:e.reason,receiptRefs:e.receiptRefs},a=$(t);return re.parse({schemaVersion:"openpond.createImprove.evidenceSnapshot.v1",id:`evidence_outcome_${a.slice(0,24)}`,contentHash:a,consent:{status:"granted",scope:"direct_intent",reviewedBy:e.run.actor.id??"local_user",reviewedAt:e.timestamp},sources:[{kind:"artifact",id:`${e.outcome}:${e.run.id}:${e.candidateId}`,sourceHash:a,excerptRef:e.receiptRefs[0]??null}],reviewerIntent:e.reason,createdAt:e.timestamp,metadata:{immutable:!0,evidenceKind:"candidate_outcome",outcome:e.outcome,priorTasksetRevision:e.run.tasksetRef?.revision??null,recommendedNextTasksetRevision:e.run.tasksetRef?e.run.tasksetRef.revision+1:1,receiptRefs:e.receiptRefs}})}o(Ia,"createOutcomeEvidenceSnapshot");function ya(e){let t=e.proposal?$t(e.proposal):{kind:"model",rationale:["A reviewed training plan selected Model execution for this Taskset."],confidence:1};return ye.parse({schemaVersion:"openpond.createImprove.tasksetRef.v1",id:e.taskset.id,revision:e.taskset.revision,contentHash:e.taskset.contentHash,evidenceSnapshotIds:e.evidenceSnapshotIds,policyBoundary:e.taskset.policy,targetRecommendation:t,authoringSplitRefs:e.taskset.tasks.filter(a=>a.split==="train"||a.split==="validation").map(a=>a.id),privateSplitRefs:e.taskset.tasks.filter(a=>a.split==="test"||a.split==="frozen_eval").map(a=>a.id),approvedBy:"local_user",approvedAt:e.approvedAt,metadata:{immutable:!0,taskCreationProposalId:e.proposal?.id??null}})}o(ya,"createTasksetRef");function Me(e,t){if(e.id!==t.id||e.revision!==t.revision||e.contentHash!==t.contentHash)throw new Error(`Taskset lineage mismatch: the run approved ${e.id}@${e.revision} (${e.contentHash}), but execution resolved ${t.id}@${t.revision} (${t.contentHash}).`)}o(Me,"assertTasksetRefMatches");function $t(e){let t=_t(e);return{kind:t,rationale:e.diagnosis.rationale.length?e.diagnosis.rationale:[`${t} best matches the reviewed behavior boundary.`],confidence:e.diagnosis.confidence}}o($t,"recommendationForProposal");function _t(e){return e.diagnosis.trainingEligible?"model":e.diagnosis.intervention==="retrieval"?"configuration":"agent"}o(_t,"targetKindForProposal");async function Ge(e){let t=e.run.tasksetRef;if(!t)throw new Error("Agent Taskset execution requires an approved Taskset ref.");if(Me(t,e.taskset),e.taskset.environment.kind!=="agent")throw new Error(`Taskset ${e.taskset.id} is not an Agent-shaped Taskset.`);let a=new Set(t.privateSplitRefs),n=e.taskset.tasks.filter(c=>a.has(c.id));if(!n.length||n.length!==a.size)throw new Error("The approved Agent Taskset private split could not be resolved exactly.");let r={tasksetId:t.id,tasksetRevision:t.revision,tasksetHash:t.contentHash,taskRefs:n.map(c=>c.id),seed:0,timeoutMs:e.taskset.environment.defaultTimeoutMs,entrypoint:e.taskset.environment.entrypoint,evaluator:"openpond-agent-sdk-taskset.v1"},s=$(r),i=[],d=[],u=[];for(let c of n){let g=new Date().toISOString(),l=Date.now(),p=await(e.execute??O)({cwd:e.cwd,command:"run",args:[e.taskset.environment.entrypoint,"--json","--input",JSON.stringify({...c.input,channel:"manual"})],timeoutMs:e.taskset.environment.defaultTimeoutMs,throwOnFailure:!1}),x=p.code===0?jt(p.stdout):null,b=`agent_task_attempt_${$([e.run.id,e.subject,e.sourceCommit,t.contentHash,c.id,0]).slice(0,24)}`,f=Ot(x?.traceArtifactRef),P=Ce.parse({schemaVersion:"openpond.taskAttempt.v1",id:b,tasksetId:e.taskset.id,taskId:c.id,split:c.split,attempt:0,seed:0,modelRef:null,startedAt:g,completedAt:new Date().toISOString(),output:ce(x?.result),runtimeEventRefs:f?[f]:[],artifactRefs:f?[f]:[],privilegedOutcomeRef:c.privilegedContextRef,infrastructureError:p.code===0?null:p.stderr.trim().slice(0,1e4)||`Agent SDK action exited with code ${String(p.code)}.`,costUsd:0,latencyMs:Math.max(0,Date.now()-l),userInterventions:0,metadata:{executor:"openpond-agent-sdk",trustedTasksetExecution:!0,tasksetRevision:t.revision,tasksetHash:t.contentHash,sourceCommit:e.sourceCommit,subject:e.subject,executionContractHash:s}}),R=await e.gradeAttempt({tasksetId:e.taskset.id,taskId:c.id,attempt:P});d.push(P.id),i.push(R),f&&u.push(f)}let m=i.filter(c=>c.passed).length;return{taskAttemptRefs:d,gradeRefs:i.map(c=>c.id),taskRefs:n.map(c=>c.id),artifactRefs:[...new Set(u)],total:i.length,passed:m,failed:i.length-m,executionContractHash:s}}o(Ge,"executeAgentTasksetEvaluation");function jt(e){let t=e.trim();if(!t)return null;try{return ce(JSON.parse(t))}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a<0||n<=a)return null;try{return ce(JSON.parse(t.slice(a,n+1)))}catch{return null}}}o(jt,"parseAgentRunPayload");function ce(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}o(ce,"recordValue");function Ot(e){return typeof e=="string"&&e.trim()?e.trim():null}o(Ot,"stringValue");async function le(e){let t=await(e.execute??O)({cwd:e.cwd,command:"eval",args:["--json"],throwOnFailure:!1}),a=qt(t.stdout),n=G(a.summary?.total)??0,r=G(a.summary?.passed)??0,s=G(a.summary?.failed)??Math.max(0,n-r),i=a.publishGate?.status==="passed"?"passed":"failed",d=Array.isArray(a.results)?a.results:[],u=d.map(R=>I(R.name)).filter(R=>!!R),m=new Set([de.posix.join(e.sourceRef,".openpond/eval-results.json")]);for(let R of d){let _=I(R.traceArtifactRef);_&&m.add(de.posix.join(e.sourceRef,Ne(_)));for(let J of De(R.artifacts))m.add(de.posix.join(e.sourceRef,Ne(J)))}let c=e.run.tasksetRef?await Ge({run:e.run,taskset:Ht(e.taskset),cwd:e.cwd,sourceCommit:e.sourceCommit,subject:e.subject,gradeAttempt:Lt(e.gradeAttempt),execute:e.execute}):null;for(let R of c?.artifactRefs??[])m.add(R);let g=n+(c?.total??0),l=r+(c?.passed??0),p=s+(c?.failed??0),x=[...new Set([...u,...c?.taskRefs??[]])],b=i==="passed"&&(c?.failed??0)===0?"passed":"failed",f=t.code===0&&p===0&&b==="passed"?"passed":"failed",P=e.timestamp??new Date().toISOString();return{id:`agent_eval_${e.run.id}_${e.subject}_${e.sourceCommit.slice(0,12)}`,candidateId:e.candidateId,target:e.run.target,evaluatorKind:"agent_sdk",subject:e.subject,sourceCommit:e.sourceCommit,sourceBranch:e.sourceBranch,tasksetId:e.run.tasksetRef?.id??null,tasksetHash:e.run.tasksetRef?.contentHash??null,taskAttemptRefs:c?.taskAttemptRefs??u,status:f,publishGate:b,summaryCounts:{total:g,passed:l,failed:p},evalRefs:x,artifactRefs:[...m],summary:`${e.subject==="active"?"Active":e.subject==="candidate"?"Candidate":"Post-release"} Agent SDK and Taskset Evals: ${l}/${g} passed${b==="failed"?"; publish gate failed":""}.`,createdAt:P,metadata:{schemaVersion:I(a.schemaVersion),schema:I(a.schema),project:{name:I(a.project?.name),version:I(a.project?.version)},source:{configPath:I(a.source?.configPath),configHash:I(a.source?.configHash)},publishGate:{total:G(a.publishGate?.total),passed:G(a.publishGate?.passed),failed:G(a.publishGate?.failed),blockingFailures:De(a.publishGate?.blockingFailures)},command:{code:t.code,timedOut:t.timedOut,stderr:t.stderr.trim().slice(0,4e3)},trustedTasksetExecution:!!c,tasksetRevision:e.run.tasksetRef?.revision??null,executionContractHash:c?.executionContractHash??null,gradeRefs:c?.gradeRefs??[],results:d.map(R=>({name:I(R.name),status:I(R.status),error:I(R.error),traceArtifactRef:I(R.traceArtifactRef)}))}}}o(le,"runNormalizedAgentEvaluation");function Ht(e){if(!e)throw new Error("The approved Agent Taskset could not be resolved for evaluation.");return e}o(Ht,"requireTaskset");function Lt(e){if(!e)throw new Error("Trusted Taskset grading is unavailable for Agent evaluation.");return e}o(Lt,"requireGradeAttempt");function qt(e){let t=e.trim();if(!t)throw new Error("Agent SDK Eval returned no JSON output.");try{return JSON.parse(t)}catch{let a=t.indexOf("{"),n=t.lastIndexOf("}");if(a>=0&&n>a)try{return JSON.parse(t.slice(a,n+1))}catch{}throw new Error("Agent SDK Eval returned invalid JSON output.")}}o(qt,"parseAgentEvalPayload");function Ne(e){return e.replace(/^\.\//,"").replaceAll("\\","/")}o(Ne,"normalizeRef");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}o(I,"stringValue");function G(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(G,"numberValue");function De(e){return Array.isArray(e)?e.map(I).filter(t=>!!t):[]}o(De,"stringArray");import{existsSync as Z}from"node:fs";import{mkdir as Xe,realpath as Qe,rm as he,writeFile as Ft}from"node:fs/promises";import Ze from"node:os";import S from"node:path";import{existsSync as ue}from"node:fs";import{cp as Mt,lstat as Gt,mkdir as Be,rm as Nt,symlink as Dt,writeFile as Bt}from"node:fs/promises";import w from"node:path";function Ue(e,t){let a=C(t.profileRelativePath),n=[C(t.sourceRootRelativePath),w.posix.join(a,"evals"),w.posix.join(a,"settings"),w.posix.join(a,"package.json"),w.posix.join(a,"tsconfig.json"),w.posix.join(a,"openpond.lock"),w.posix.join(a,".gitignore"),"openpond-profile.json"],r=(e.plan?.sourcePlan??[]).flatMap(s=>{let i=C(s.path);return i?i==="."||i.startsWith(`${a}/`)?[i]:[w.posix.join(a,i),i]:[]});return[...new Set([...n,...r])]}o(Ue,"allowedAgentImprovementPaths");function Je(e,t){let a=C(e);return t.some(n=>a===n||a.startsWith(`${n}/`))}o(Je,"pathAllowed");function me(e){return C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts")}o(me,"isCandidateRuntimePath");function Fe(e){return e.split(/\r?\n/).map(t=>t.trimEnd()).filter(Boolean).map(t=>{let a=t.slice(3),n=a.split(" -> ");return C(n.at(-1)??a)})}o(Fe,"parseGitStatusPaths");async function pe(e,t,a){let n=await e("git",["diff","--name-only","-z",a,"--","."],t);return h(n,"Unable to inspect Agent candidate paths."),[...new Set(n.stdout.split("\0").map(C).filter(r=>r!=="."&&!me(r)))]}o(pe,"gitChangedPaths");async function ge(e){for(let t of e.paths){let a=await B(e.command,e.repoPath,["rev-parse",`${e.commit}:${t}`]),n=w.join(e.repoPath,...t.split("/"));if(!a){if(ue(n))return!1;continue}if(!ue(n))return!1;let r=await B(e.command,e.repoPath,["hash-object","--",t]);if(!r||r!==a)return!1}return!0}o(ge,"workingTreeMatchesCommit");async function ze(e,t){let a=new Set(["node_modules",w.posix.join(C(e.profileRelativePath),"node_modules"),w.posix.join(C(e.sourceRootRelativePath),"node_modules")]);for(let n of a){let r=w.join(e.repoPath,...n.split("/")),s=w.join(t,...n.split("/"));!await Jt(r)||ue(s)||(await Be(w.dirname(s),{recursive:!0}),await Dt(r,s,process.platform==="win32"?"junction":"dir"))}}o(ze,"linkCandidateDependencies");async function We(e){let t=await e.command("git",["diff","--binary","HEAD","--",".",":(exclude)**/tasksets/**"],e.repoPath);if(h(t,"Unable to capture active Profile changes."),t.stdout){let i=w.join(e.workspaceRoot,"active-profile.patch");await Bt(i,t.stdout,"utf8");let d=await e.command("git",["apply","--whitespace=nowarn",i],e.worktreePath);h(d,"Unable to apply active Profile changes to the candidate baseline."),await Nt(i,{force:!0})}let a=await e.command("git",["ls-files","--others","--exclude-standard","-z"],e.repoPath);h(a,"Unable to inspect untracked Profile source.");for(let i of a.stdout.split("\0").filter(Ut)){let d=w.join(e.repoPath,...i.split("/")),u=w.join(e.worktreePath,...i.split("/"));await Be(w.dirname(u),{recursive:!0}),await Mt(d,u,{recursive:!0,preserveTimestamps:!0})}let n=await e.command("git",["add","-A"],e.worktreePath);h(n,"Unable to stage the active Profile snapshot.");let r=await e.command("git",["diff","--cached","--quiet"],e.worktreePath);if(r.code===0)return;r.code!==1&&h(r,"Unable to inspect the active Profile snapshot.");let s=await e.command("git",["commit","-m","Snapshot active Profile before OpenPond improvement"],e.worktreePath,Q());h(s,"Unable to commit the active Profile snapshot.")}o(We,"snapshotActiveProfileChanges");function Ut(e){return e?!C(e).split("/").some(a=>a==="node_modules"||a===".openpond"||a==="artifacts"||a==="tasksets"):!1}o(Ut,"snapshotEligiblePath");function Q(){return{GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"OpenPond",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"openpond@example.invalid",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"OpenPond",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"openpond@example.invalid"}}o(Q,"gitIdentityEnv");async function Jt(e){try{return(await Gt(e)).isDirectory()}catch{return!1}}o(Jt,"directoryExists");async function Ke(e,t,a){let n=await e("gh",["pr","list","--head",a,"--state","all","--json","number,url,state,mergedAt,mergeCommit,baseRefName,headRefName","--limit","20"],t);h(n,"Unable to inspect existing Agent improvement pull requests.");let r=JSON.parse(n.stdout);return Array.isArray(r)?r.filter(s=>!!(s&&typeof s=="object")):[]}o(Ke,"listPullRequestsForBranch");function fe(e,t=new Date().toISOString(),a=new Date().toISOString()){let n=typeof e.number=="number"?e.number:Number(e.number),r=typeof e.state=="string"?e.state.toLowerCase():"",i=N(e.mergedAt)||r==="merged"?"merged":r==="open"?"open":"closed",d=e.mergeCommit&&typeof e.mergeCommit=="object"?e.mergeCommit:null,u=N(d?.oid)??N(e.mergeCommit),m=N(e.url),c=N(e.baseRefName),g=N(e.headRefName);if(!Number.isInteger(n)||n<=0||!m||!c||!g)throw new Error("GitHub returned an incomplete pull request payload.");return{provider:"github",number:n,url:m,state:i,baseBranch:c,headBranch:g,mergeCommit:u,openedAt:t,updatedAt:a}}o(fe,"normalizePullRequest");function Ve(e,t){return`openpond/improve/${D(t)}/${D(e.id).slice(0,36)}`}o(Ve,"candidateBranch");function U(e){if(!e.worktreePath)throw new Error("Agent candidate worktree is unavailable.");return e.worktreePath}o(U,"requireWorktreePath");function Ye(e){let t=e.replace(/^git@github\.com:/i,"").replace(/^https?:\/\/github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,"");return/^[^/]+\/[^/]+$/.test(t)?t:null}o(Ye,"githubRepoFromRemote");function C(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+|\/+$/g,"")||"."}o(C,"normalizeRepoPath");function D(e){return e.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"candidate"}o(D,"safePathSegment");async function y(e,t,a,n){let r=await e("git",a,t);h(r,n);let s=r.stdout.trim();if(!s)throw new Error(n);return s}o(y,"requiredGitText");async function B(e,t,a){let n=await e("git",a,t);return n.code===0&&n.stdout.trim()?n.stdout.trim():null}o(B,"optionalGitText");function h(e,t){if(e.code!==0)throw new Error(e.stderr.trim()||e.stdout.trim()||t)}o(h,"assertCommand");function N(e){return typeof e=="string"&&e.trim()?e.trim():null}o(N,"stringValue");function T(e,t,a,n={}){return be(e,t,a,n)}o(T,"defaultCommandRunner");function et(e,t){let a=U(t);if(!Z(a))throw new Error("The existing Agent candidate worktree is no longer available.");let n=C(e.profileRelativePath),r=C(e.sourceRootRelativePath);return{target:{...e,repoPath:a,workspaceRoot:a,sourcePath:S.join(a,...n.split("/")),sourceRoot:S.join(a,...r.split("/"))},git:t}}o(et,"restoreAgentImprovementWorkspace");async function tt(e){let t=e.command??T,a=await y(t,e.target.repoPath,["rev-parse","--show-toplevel"],"Profile source is not a Git repository."),[n,r]=await Promise.all([Qe(a),Qe(e.target.repoPath)]);if(n!==r)throw new Error("Profile repo path does not match the Git repository root.");let s=await t("git",["status","--porcelain=v1","-uall"],a);h(s,"Unable to inspect Profile Git status.");let[i,d,u]=await Promise.all([y(t,a,["rev-parse","HEAD"],"Profile Git repo has no HEAD commit."),y(t,a,["branch","--show-current"],"Profile Git repo must be on a branch."),B(t,a,["remote","get-url","origin"])]);if(e.run.adapter.kind==="local"&&e.run.adapter.localHead&&e.run.adapter.localHead!==i)throw new Error(`Profile source changed from ${e.run.adapter.localHead.slice(0,12)} to ${i.slice(0,12)}. Re-plan the improvement against the current source.`);let m=Ve(e.run,e.target.agentId),c=S.join(Ze.tmpdir(),"openpond-agent-improvements",D(S.basename(a)||"profile"),D(e.run.id)),g=S.join(c,"repo");await Xe(c,{recursive:!0});let l=await t("git",["show-ref","--verify","--quiet",`refs/heads/${m}`],a);if(Z(g)&&await B(t,g,["branch","--show-current"])!==m&&(await t("git",["worktree","remove","--force",g],a),await he(c,{recursive:!0,force:!0}),await Xe(c,{recursive:!0})),!Z(g)){let P=l.code===0?["worktree","add",g,m]:["worktree","add","-b",m,g,i],R=await t("git",P,a);h(R,"Unable to create the Agent candidate worktree.")}s.stdout.trim()&&await We({command:t,repoPath:a,worktreePath:g,workspaceRoot:c});let p=await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no baseline commit.");if(await y(t,g,["rev-parse","HEAD"],"Agent candidate worktree has no HEAD commit.")!==p)throw new Error("Agent candidate baseline could not be resolved.");await ze(e.target,g);let b=C(e.target.profileRelativePath),f=C(e.target.sourceRootRelativePath);return{target:{...e.target,repoPath:g,workspaceRoot:g,sourcePath:S.join(g,...b.split("/")),sourceRoot:S.join(g,...f.split("/"))},git:{baseBranch:d,baseCommit:p,branch:m,headCommit:null,remoteName:"origin",remoteUrl:u,worktreePath:g,changedPaths:[],diffStat:null,pullRequest:null}}}o(tt,"prepareAgentImprovementWorkspace");async function at(e){let t=e.command??T,a=U(e.workspace.git),n=await t("git",["status","--porcelain=v1","-uall"],a);h(n,"Unable to inspect Agent candidate changes.");let r=Fe(n.stdout).filter(g=>!me(g));if(r.length===0)throw new Error("The Agent improvement produced no source changes.");let s=Ue(e.run,e.activeTarget),i=r.filter(g=>!Je(g,s));if(i.length>0)throw new Error(`Agent candidate changed paths outside the approved scope: ${i.join(", ")}`);let d=await t("git",["add","--",...r],a);h(d,"Unable to stage Agent candidate changes.");let u=await t("git",["commit","-m",`Improve ${e.run.target.displayName??e.activeTarget.agentId} via OpenPond`],a,Q());h(u,"Unable to commit Agent candidate changes.");let m=await y(t,a,["rev-parse","HEAD"],"Agent candidate commit was not created."),c=await B(t,a,["diff","--stat",`${e.workspace.git.baseCommit}..${m}`]);return{...e.workspace.git,headCommit:m,changedPaths:r,diffStat:c}}o(at,"commitAgentImprovementCandidate");async function Va(e){let t=e.command??T,a=U(e.git);if(!e.git.headCommit)throw new Error("Agent candidate has no commit to push.");if(!e.git.remoteUrl||!Ye(e.git.remoteUrl))throw new Error("Agent candidate is ready locally. Configure a GitHub origin remote before opening a pull request.");let n=await t("git",["push","--set-upstream",e.git.remoteName,e.git.branch],a);h(n,"Unable to push the Agent candidate branch.");let r=await Ke(t,a,e.git.branch);if(r.length>0)return fe(r[0],e.timestamp);let s=`Improve ${e.run.target.displayName??e.run.target.id??"Agent"}`,i=["## OpenPond Agent improvement","",e.run.objective,"","## Evaluation","",e.evaluationSummary,"",`Create/Improve run: \`${e.run.id}\``,`Base commit: \`${e.git.baseCommit}\``,`Candidate commit: \`${e.git.headCommit}\``].join(`
|