openpond 0.2.73 → 0.2.75
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.js +1 -1
- package/dist/chunks/{acp-35QBGOMJ.js → acp-HGJMC75K.js} +1 -1
- package/dist/chunks/{acp-agent-4PKMX52I.js → acp-agent-CWV5NF6V.js} +1 -1
- package/dist/chunks/{app-layer-42ZKHTPN.js → app-layer-76YRQY7S.js} +1 -1
- package/dist/chunks/{app-server-evaluations-5JVNCET7.js → app-server-evaluations-PQDIMJJ7.js} +1 -1
- package/dist/chunks/{app-server-harness-services-4E236TXE.js → app-server-harness-services-5MB7CCCT.js} +1 -1
- package/dist/chunks/{app-server-runtime-CI2NTKX7.js → app-server-runtime-N3XZV35H.js} +1 -1
- package/dist/chunks/{apps-EGFRTFAJ.js → apps-DJQ2ZJKC.js} +1 -1
- package/dist/chunks/{chunk-QKGNAYSC.js → chunk-2HWSF4FS.js} +1 -1
- package/dist/chunks/{chunk-KQ7RFPG5.js → chunk-3SIZBCEO.js} +1 -1
- package/dist/chunks/{chunk-TP222CV2.js → chunk-5SBKDKGI.js} +1 -1
- package/dist/chunks/{chunk-U73T66FP.js → chunk-5VHHQZMT.js} +1 -1
- package/dist/chunks/{chunk-NDNSLCPE.js → chunk-5W2OJKJW.js} +1 -1
- package/dist/chunks/{chunk-XSDWRRZP.js → chunk-6EZHEVXS.js} +1 -1
- package/dist/chunks/{chunk-YIZE3M5S.js → chunk-7NLKMY7L.js} +1 -1
- package/dist/chunks/{chunk-MHSSPMLB.js → chunk-B7ELZHQN.js} +1 -1
- package/dist/chunks/{chunk-KE5PYRJ6.js → chunk-BZPNCSUY.js} +1 -1
- package/dist/chunks/{chunk-IXMY4EKS.js → chunk-CABXOJ3I.js} +1 -1
- package/dist/chunks/{chunk-E7SQBMYW.js → chunk-CBJ33EIB.js} +1 -1
- package/dist/chunks/{chunk-2IIVBBF5.js → chunk-CILYQK2G.js} +1 -1
- package/dist/chunks/{chunk-OBMMO5NC.js → chunk-CNVPZKJG.js} +3 -3
- package/dist/chunks/{chunk-4KG7GJ5O.js → chunk-CZ2JSEUK.js} +1 -1
- package/dist/chunks/{chunk-H5EHSILL.js → chunk-D2PEB6AJ.js} +1 -1
- package/dist/chunks/{chunk-FRQYH4QD.js → chunk-DAWHZU7L.js} +1 -1
- package/dist/chunks/{chunk-WOYBWRRV.js → chunk-DVBZBJSK.js} +1 -1
- package/dist/chunks/{chunk-MXDSB2C5.js → chunk-EOQTBH4U.js} +1 -1
- package/dist/chunks/{chunk-P7RLDDPN.js → chunk-FPW3RFZR.js} +1 -1
- package/dist/chunks/{chunk-WAWVFSIQ.js → chunk-FWYJ3MIN.js} +1 -1
- package/dist/chunks/{chunk-5VQK3CCJ.js → chunk-FXLLAAGI.js} +1 -1
- package/dist/chunks/{chunk-ODH5XGE6.js → chunk-HCQTAFTX.js} +1 -1
- package/dist/chunks/{chunk-FCC24XUI.js → chunk-HHLQG7PN.js} +1 -1
- package/dist/chunks/{chunk-TRXOE7TT.js → chunk-HRJ4EPR3.js} +1 -1
- package/dist/chunks/{chunk-O6L4NO3M.js → chunk-HYYQCBX5.js} +1 -1
- package/dist/chunks/{chunk-OFC5N6R3.js → chunk-IPH4LGK2.js} +6 -6
- package/dist/chunks/{chunk-3XNUG4FO.js → chunk-JBIAEQHI.js} +1 -1
- package/dist/chunks/{chunk-XN5BXPAT.js → chunk-JQDZYC72.js} +1 -1
- package/dist/chunks/{chunk-3BIB6KKL.js → chunk-JRW6MFV6.js} +1 -1
- package/dist/chunks/{chunk-EAW5FHU4.js → chunk-JSJB3PR2.js} +2 -2
- package/dist/chunks/{chunk-O4YHISU2.js → chunk-KAW26NGC.js} +1 -1
- package/dist/chunks/{chunk-HIPKU57Y.js → chunk-LK7TJYEP.js} +1 -1
- package/dist/chunks/{chunk-2IECLXB2.js → chunk-LRGMGXL2.js} +1 -1
- package/dist/chunks/{chunk-G2P2PYEO.js → chunk-NACSY3HS.js} +1 -1
- package/dist/chunks/{chunk-E5HDJCKK.js → chunk-NGTNI3YX.js} +1 -1
- package/dist/chunks/{chunk-ONR2AKRI.js → chunk-O5FYAVDK.js} +4 -4
- package/dist/chunks/{chunk-LWF5MQJ4.js → chunk-OJEIYU7D.js} +1 -1
- package/dist/chunks/{chunk-AWUSAHXG.js → chunk-OOSF2SPF.js} +1 -1
- package/dist/chunks/{chunk-JG6JA7YT.js → chunk-P4SXDU55.js} +1 -1
- package/dist/chunks/{chunk-DUR32LJG.js → chunk-PQGR2MTX.js} +1 -1
- package/dist/chunks/{chunk-6IKIGVJF.js → chunk-QSITPC3X.js} +1 -1
- package/dist/chunks/chunk-RGSMU6N4.js +2 -0
- package/dist/chunks/{chunk-CBD554GZ.js → chunk-RORT6K3Y.js} +1 -1
- package/dist/chunks/{chunk-OXUS4QOT.js → chunk-SFLL3TKE.js} +1 -1
- package/dist/chunks/chunk-SYFJVLEL.js +2 -0
- package/dist/chunks/{chunk-6KKWSUEW.js → chunk-THLBUON5.js} +1 -1
- package/dist/chunks/{chunk-X4CN3FIN.js → chunk-VU6S2S3O.js} +1 -1
- package/dist/chunks/{chunk-H2YQ4AA2.js → chunk-W5FL7EH2.js} +1 -1
- package/dist/chunks/{chunk-WBV6A6NS.js → chunk-WHI4XNBI.js} +1 -1
- package/dist/chunks/{chunk-FA3GXQYA.js → chunk-WOA6XFQU.js} +1 -1
- package/dist/chunks/{chunk-SUILNZQJ.js → chunk-WOER246B.js} +1 -1
- package/dist/chunks/{chunk-645T6LH7.js → chunk-XJP7RIHL.js} +1 -1
- package/dist/chunks/{chunk-KOLVSUOS.js → chunk-Z3OW37CO.js} +1 -1
- package/dist/chunks/{chunk-OUOOKEU3.js → chunk-ZACCHQWK.js} +1 -1
- package/dist/chunks/{chunk-3V2XAYYA.js → chunk-ZKH4Z3EQ.js} +1 -1
- package/dist/chunks/{chunk-OXRN2257.js → chunk-ZLYQR44C.js} +1 -1
- package/dist/chunks/chunk-ZQOJLPWD.js +2 -0
- package/dist/chunks/{chunk-EZ435RGA.js → chunk-ZYJHMX4T.js} +1 -1
- package/dist/chunks/{cli-NHRYN2G3.js → cli-B6JFFXMI.js} +1 -1
- package/dist/chunks/{command-54MMVWS2.js → command-GZ3Z37WJ.js} +3 -3
- package/dist/chunks/{configuration-command-XMXTU2FQ.js → configuration-command-OHW7RPSC.js} +1 -1
- package/dist/chunks/{connected-app-executor-WJEDXUA4.js → connected-app-executor-P35Y6B5Y.js} +1 -1
- package/dist/chunks/{connected-evidence-NFQPO5E3.js → connected-evidence-I4I7DQRX.js} +1 -1
- package/dist/chunks/{connected-starting-assets-M54PSOEP.js → connected-starting-assets-Q7CYZT25.js} +1 -1
- package/dist/chunks/{continual-C2YWPEJZ.js → continual-3OIKJ3PG.js} +1 -1
- package/dist/chunks/{core-commands-SY4I5FHE.js → core-commands-BWDKP6AI.js} +1 -1
- package/dist/chunks/{dataset-preparation-authoring-CH6Z4NE6.js → dataset-preparation-authoring-RPYFOFBV.js} +1 -1
- package/dist/chunks/{datasets-2OQDMF7E.js → datasets-2W4JPKSP.js} +1 -1
- package/dist/chunks/{desktop-test-VNMR5H4I.js → desktop-test-EUBEZJDU.js} +1 -1
- package/dist/chunks/{evaluation-coordination-GULGPATI.js → evaluation-coordination-IYNDZB6X.js} +1 -1
- package/dist/chunks/{experiment-improvements-XNXTU6ZA.js → experiment-improvements-D3DHZ7QI.js} +1 -1
- package/dist/chunks/{experiments-DZX6ZU6F.js → experiments-7OXSDLJG.js} +1 -1
- package/dist/chunks/{experiments-signal-QDVPO3M5.js → experiments-signal-6SWD3TSR.js} +1 -1
- package/dist/chunks/{help-UCN67FN7.js → help-XVZ4RRAB.js} +1 -1
- package/dist/chunks/{host-profile-evaluation-tools-XMGGHVH3.js → host-profile-evaluation-tools-I7ESCZH7.js} +1 -1
- package/dist/chunks/{host-profile-external-dataset-C6ZPMTX6.js → host-profile-external-dataset-MD4X7BCL.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-U7WGMN5B.js → hosted-app-server-composition-PYKNSE3O.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-VQN6PJKR.js → hosted-experiment-improvement-5L3Z7IV6.js} +1 -1
- package/dist/chunks/{hosted-harness-runtime-O6E5LCGN.js → hosted-harness-runtime-XDCLEP3C.js} +1 -1
- package/dist/chunks/{hosted-profile-candidate-HQ544PNP.js → hosted-profile-candidate-6Q3GOLII.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-K4OACT7S.js → hosted-profile-compiler-FYBOGHZF.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-control-TKYM73YY.js → hosted-profile-evaluation-control-MXXZR6XA.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-inspection-HFCFUYQ4.js → hosted-profile-evaluation-inspection-4J7LAVY2.js} +1 -1
- package/dist/chunks/{hosted-profile-evaluation-preparation-OJ6AR5P5.js → hosted-profile-evaluation-preparation-EF43QUMG.js} +1 -1
- package/dist/chunks/{human-review-DNVIVJRK.js → human-review-6WAUW3BG.js} +1 -1
- package/dist/chunks/{import-QT5AKEA3.js → import-333V3CGC.js} +1 -1
- package/dist/chunks/{local-harness-improvement-runtime-BWZBMOGL.js → local-harness-improvement-runtime-HC42DG74.js} +1 -1
- package/dist/chunks/{local-harness-taskset-review-JL2XNXML.js → local-harness-taskset-review-CUL73U4A.js} +1 -1
- package/dist/chunks/{opchat-7PWUXQSY.js → opchat-R7FBOSCD.js} +1 -1
- package/dist/chunks/{opchat-bounded-chat-B3GOCGWY.js → opchat-bounded-chat-IOV6FYBH.js} +1 -1
- package/dist/chunks/{organizations-TWBMN7KF.js → organizations-EG5BSG26.js} +1 -1
- package/dist/chunks/{profile-RVARQYG4.js → profile-VLGYQXEP.js} +1 -1
- package/dist/chunks/{project-action-payload-65MTQMQW.js → project-action-payload-5PL65D3W.js} +1 -1
- package/dist/chunks/{project-agent-ZC33YRZE.js → project-agent-XT47W7MT.js} +1 -1
- package/dist/chunks/{published-experiment-source-L7BER6AE.js → published-experiment-source-7TDPGSOJ.js} +1 -1
- package/dist/chunks/{refiner-profile-service-56776J7B.js → refiner-profile-service-4RRRB33P.js} +1 -1
- package/dist/chunks/{runtime-GN2H2R7L.js → runtime-K3BUZ3ZQ.js} +1 -1
- package/dist/chunks/{sandbox-command-HWIAH6JA.js → sandbox-command-D7T2GKQA.js} +1 -1
- package/dist/chunks/{sandbox-template-MNZ6OXQQ.js → sandbox-template-WTIQRKE6.js} +1 -1
- package/dist/chunks/{saved-work-OMBDT3ZR.js → saved-work-GQEYG77G.js} +1 -1
- package/dist/chunks/{setup-C6673TJK.js → setup-5MZKOZY2.js} +1 -1
- package/dist/chunks/{src-UHNSXT34.js → src-PEOADF2P.js} +2 -2
- package/dist/chunks/{src-HHFJIPL5.js → src-ZUOZOCQ2.js} +1 -1
- package/dist/chunks/{standalone-experiment-turn-owner-UYPA6XHW.js → standalone-experiment-turn-owner-N7PEBGW3.js} +1 -1
- package/dist/chunks/{store-chat-resources-TYR7D2UP.js → store-chat-resources-7JEZFCC2.js} +1 -1
- package/dist/chunks/{store-continual-support-reviews-63YCKG3P.js → store-continual-support-reviews-RJ5OQZTC.js} +1 -1
- package/dist/chunks/{store-conversation-serving-PDSBGL3E.js → store-conversation-serving-D3HJ5OZK.js} +1 -1
- package/dist/chunks/{store-create-improve-RYASTT56.js → store-create-improve-ERPWR2LH.js} +1 -1
- package/dist/chunks/{store-datasets-PELTRO4A.js → store-datasets-R6P5KBAH.js} +1 -1
- package/dist/chunks/{store-evaluation-results-OUTNEMAY.js → store-evaluation-results-ZCABU3X5.js} +1 -1
- package/dist/chunks/{store-human-review-GIMAXCJQ.js → store-human-review-2PHLILEI.js} +1 -1
- package/dist/chunks/{store-learned-preference-migration-validation-DHOSHA6C.js → store-learned-preference-migration-validation-OGFFAM3Q.js} +1 -1
- package/dist/chunks/{store-local-experiments-AH4Z6RWX.js → store-local-experiments-ZG4NWB63.js} +1 -1
- package/dist/chunks/{store-model-batch-review-UUW6ZLDH.js → store-model-batch-review-LQAM7FQJ.js} +1 -1
- package/dist/chunks/{store-model-configuration-4U5A6DU7.js → store-model-configuration-3S74O2IQ.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-MYHO43VH.js → store-model-project-preparation-ARDV4U77.js} +1 -1
- package/dist/chunks/{store-modification-recordings-OZBLFYCT.js → store-modification-recordings-BHJTHW3A.js} +1 -1
- package/dist/chunks/{store-task-inbox-M7YZNCRF.js → store-task-inbox-YRN2UDW3.js} +1 -1
- package/dist/chunks/{store-task-inventory-TTJQAM3T.js → store-task-inventory-6V4UX5BY.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-4GVHDLJJ.js → store-taskset-drafts-H2O4CRIF.js} +1 -1
- package/dist/chunks/{store-training-MGGTGTV2.js → store-training-MQGXXKTX.js} +1 -1
- package/dist/chunks/{store-training-jobs-XKDUX4SV.js → store-training-jobs-YASPKBB3.js} +1 -1
- package/dist/chunks/{store-training-models-4S4ZT3BL.js → store-training-models-HAJCN3IS.js} +1 -1
- package/dist/chunks/{taskset-SLQSCYJI.js → taskset-65BR2KOE.js} +1 -1
- package/dist/chunks/{teams-bot-7U6JOV6T.js → teams-bot-VMG23AFI.js} +1 -1
- package/dist/chunks/{tool-learning-25Z2JOBS.js → tool-learning-YSYQEASN.js} +1 -1
- package/dist/chunks/training-5V53RWI7.js +2 -0
- package/dist/chunks/training-U6OPNRP4.js +2 -0
- package/dist/chunks/{training-2LUQ2IZM.js → training-YUWQXGJX.js} +1 -1
- package/dist/chunks/{training-hosted-NLXMISNL.js → training-hosted-KO4SCSLZ.js} +1 -1
- package/dist/chunks/{training-hosted-alphaedit-WGMJ3L2D.js → training-hosted-alphaedit-HQTKGEZU.js} +1 -1
- package/dist/chunks/{training-hosted-decision-66EUMUIW.js → training-hosted-decision-LN7MQGBF.js} +1 -1
- package/dist/chunks/{training-hosted-engram-QDXSJ77I.js → training-hosted-engram-7UAVQFBA.js} +1 -1
- package/dist/chunks/{training-hosted-modification-comparison-2MH5FZMZ.js → training-hosted-modification-comparison-ZOYOSVHI.js} +1 -1
- package/dist/chunks/{training-hosted-neuron-training-3QXKIEKT.js → training-hosted-neuron-training-37Y6WJH5.js} +1 -1
- package/dist/chunks/{training-hosted-serving-report-ZG75ACZK.js → training-hosted-serving-report-EXJ5X7GB.js} +1 -1
- package/dist/chunks/{training-hosted-steering-KFMTKCTX.js → training-hosted-steering-EAFICV6I.js} +1 -1
- package/dist/chunks/{training-model-start-NMQ55UHZ.js → training-model-start-5QB7A5TD.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/skills/manifest.json +1 -1
- package/dist/web/assets/{App-CV1p0_Zy.js → App-CqqK4NLa.js} +4 -4
- package/dist/web/assets/{AppDialog-DdGt7aU1.js → AppDialog-wmL4BlOJ.js} +1 -1
- package/dist/web/assets/AppTerminalPanel-BHFgtq4f.js +2 -0
- package/dist/web/assets/{AppToastContext-D7z0w1PS.js → AppToastContext-DyaZYQXu.js} +1 -1
- package/dist/web/assets/{AppsView-B-Ts-M_V.js → AppsView-C6u5q5ro.js} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-BJ5i12im.js → AttachmentTypeIcon-AqiS2gzg.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BVHthjXU.js → BrowserSidebar-nNTQ1E4K.js} +1 -1
- package/dist/web/assets/{CartesianChart-BuJ1wFS7.js → CartesianChart-C5ptcXRG.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-CfiiTrK4.js → ChatTimelineEntry-DH0-itET.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-1t9zAhDC.js → CollaborationTabs-C22BMWJ4.js} +1 -1
- package/dist/web/assets/{CommandMenu-DTB6xjGG.js → CommandMenu-CKtBVjuO.js} +1 -1
- package/dist/web/assets/{CommunityView-BjeZ56id.js → CommunityView-Baq8HqVm.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-C_K_05H9.js → ComposerAttachments-BOyEXVhV.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-A38jnNGd.js → ComposerCreateImproveStrip-EbNwu1gE.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-jwaoKQZt.js → ConversationImportsSettings-Cqg66Lcb.js} +1 -1
- package/dist/web/assets/{DatasetReviewImport-DZA1s3XG.js → DatasetReviewImport--FgZ3Zk-.js} +1 -1
- package/dist/web/assets/{ExperimentTrainingDataWorkspace-DowPuAXk.js → ExperimentTrainingDataWorkspace-B04Cg7Hc.js} +2 -2
- package/dist/web/assets/{FilePagePreview-11ZNRtdT.js → FilePagePreview-CeZF-oOW.js} +2 -2
- package/dist/web/assets/{GetStartedView-bLVKmjqg.js → GetStartedView-DOpCgmrC.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-BeimFLZh.js → GettingStartedDialog-tB38Q6JA.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-DiFVb3WK.js → HostedModelLearningReview-CQ0bI6Np.js} +1 -1
- package/dist/web/assets/{HostedModelLearningSettings-DtUF5ejq.js → HostedModelLearningSettings-DEdV2dXx.js} +1 -1
- package/dist/web/assets/{HtmlVisual-CgVTWr64.js → HtmlVisual-krrlNGFX.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-BvinwnBN.js → LabModelVersionDetailPage-DeVfdS7p.js} +1 -1
- package/dist/web/assets/{LabModelWorkspace-Q5DG2mLP.js → LabModelWorkspace-Di_yTjzH.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-cmhZzr4f.js → LabSkillSidebar-CNjUmnfC.js} +1 -1
- package/dist/web/assets/{LabsRoute-DS_mlprv.js → LabsRoute-Gznx60Cp.js} +4 -4
- package/dist/web/assets/{LearningBatchesPage-Cm-btgWc.js → LearningBatchesPage-CpZ0UTX3.js} +1 -1
- package/dist/web/assets/{MainChatThread-DbTn4Bag.js → MainChatThread-Dr2DipCD.js} +2 -2
- package/dist/web/assets/{MainPane-BtzUF6O_.js → MainPane-aEELnEKb.js} +7 -7
- package/dist/web/assets/{ModelProjectPageHeader-C4mgVJGx.js → ModelProjectPageHeader-BVwW-R0w.js} +1 -1
- package/dist/web/assets/{NativeSetupTerminal-bJpDkKk1.js → NativeSetupTerminal-BXvrxj-m.js} +2 -2
- package/dist/web/assets/{NativeSkillSidebar-BuToZvK-.js → NativeSkillSidebar-CYsBopsX.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-F0BPQy0S.js → NewProjectDialog-BR5DChE9.js} +1 -1
- package/dist/web/assets/{OutputsPage-DC4g59_8.js → OutputsPage-CR8pWUj0.js} +1 -1
- package/dist/web/assets/{PageChrome-ufq2jePD.js → PageChrome-BXMG877B.js} +1 -1
- package/dist/web/assets/{ProjectsPage-7mbOvMfO.js → ProjectsPage-CwCes2kZ.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-sR9xN3RP.js → RightChatPanelStack-BvApbQCc.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-Dm6hhkKw.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-s9CN6nR_.js → ScheduledWorkPage-nJJH1fwV.js} +1 -1
- package/dist/web/assets/{SettingsView-CZNWYK-D.js → SettingsView-CBZ6rqak.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-BnMqzE-T.js → TasksetDraftEditorPrimitives-Bcw6T4Lf.js} +1 -1
- package/dist/web/assets/{TeamChatView-XthM6n4S.js → TeamChatView-CIwlZFqB.js} +1 -1
- package/dist/web/assets/{TerminalOverlay--HCFZaQW.js → TerminalOverlay-Dhgy0NC3.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-D2F6kPg_.js → TrainingCreationPanel-yLiEL2tM.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-BurWPp9F.js → TrainingDraftPanel-Dng3C-zU.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-D7jdscDm.js → UsageSettingsSection-CTa7T7tS.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-BEIDC3vx.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-CPaCC1_p.js → WorkspaceDiffPanel-DnZlUEbx.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-BZxu6mUS.js → WorkspaceEnvironmentMenu-D-w36AYB.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-C4K_D_yh.js → WorkspaceFileLocation-D2kiU_FJ.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-C0Yf29V0.js → WorkspaceGitDialogs-CylEGfzD.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BRPLaFZS.js → WorkspaceMonacoEditor-ChBjvgxE.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-9wypyV6H.js → WorkspacePdfPreview-CBS6GjeP.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-C-Cn-9pj.js → WorkspacePresentationPreview-DhltPUL4.js} +1 -1
- package/dist/web/assets/{bot-BuaAVlz6.js → bot-C0e4zzW4.js} +1 -1
- package/dist/web/assets/{chat-resources-DMPHClhQ.js → chat-resources-BFT0vtdv.js} +1 -1
- package/dist/web/assets/chevron-down-C4LIbeSz.js +1 -0
- package/dist/web/assets/chevron-right-BKelERU6.js +1 -0
- package/dist/web/assets/chevron-up-Dj1vY1ME.js +1 -0
- package/dist/web/assets/{chunk-C3TS766N-BXUEjt7d.js → chunk-C3TS766N-bHAuW3qR.js} +1 -1
- package/dist/web/assets/chunk-GS5HEE4M-DTj6NX5d.js +1 -0
- package/dist/web/assets/{client-C-ZuakZR.js → client-BO8YuI8Z.js} +1 -1
- package/dist/web/assets/{client-choice-storage-DWIA0Vou.js → client-choice-storage-D_6dVX8O.js} +1 -1
- package/dist/web/assets/{cloud-upload-B5LqiNCG.js → cloud-upload-U0f9MSd8.js} +1 -1
- package/dist/web/assets/{copy-BYIypHbq.js → copy-B0gWkglr.js} +1 -1
- package/dist/web/assets/{cssMode-ByypIqUN.js → cssMode-BkR1YcfF.js} +1 -1
- package/dist/web/assets/{dataset-workspaces-BTPi71mz.js → dataset-workspaces-DM2zGcAK.js} +1 -1
- package/dist/web/assets/{external-link-Cv7TDVPT.js → external-link-DymjzX8a.js} +1 -1
- package/dist/web/assets/{folder-open-DlIP3g5o.js → folder-open-BPA5YifJ.js} +1 -1
- package/dist/web/assets/{folder-plus-CXwFJqcY.js → folder-plus-BCcE8Q4i.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DMh_-WxU.js → git-commit-horizontal-DbTJXbet.js} +1 -1
- package/dist/web/assets/{htmlMode-CQGeb-h5.js → htmlMode-z1rCf6pX.js} +1 -1
- package/dist/web/assets/{icons-CYvTltSH.js → icons-nr5d1kC-.js} +1 -1
- package/dist/web/assets/{image-Ci1JxTQX.js → image-Us0M7Xxi.js} +1 -1
- package/dist/web/assets/{index-CDtTBysF.js → index-DG0kf1wK.js} +2 -2
- package/dist/web/assets/{info-EjyMkVzV.js → info-M5kOSB9T.js} +1 -1
- package/dist/web/assets/{jsonMode-Dm6YK6Dw.js → jsonMode-AMfP-lcX.js} +1 -1
- package/dist/web/assets/loader-circle-C1-u7BUs.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-BjtOz-Ln.js → lspLanguageFeatures-C6uY6TKM.js} +1 -1
- package/dist/web/assets/{maximize-2-CvvoALtI.js → maximize-2-B2pi1o5S.js} +1 -1
- package/dist/web/assets/{message-square-CPtIPRtf.js → message-square-CPvsC3Wv.js} +1 -1
- package/dist/web/assets/{monaco.contribution-ClH8Tmjq.js → monaco.contribution-5F6IVWCS.js} +2 -2
- package/dist/web/assets/{monaco.contribution-wpC0-Kxw.js → monaco.contribution-BUi28toA.js} +2 -2
- package/dist/web/assets/{monaco.contribution-VSFFgrfZ.js → monaco.contribution-CfQvs13S.js} +2 -2
- package/dist/web/assets/{monaco.contribution-e5DNaEix.js → monaco.contribution-DySvt1jU.js} +2 -2
- package/dist/web/assets/{monitor-BroZpIvk.js → monitor-1YJYctCB.js} +1 -1
- package/dist/web/assets/{paperclip-DYZEL_Gi.js → paperclip-CNTReC0m.js} +1 -1
- package/dist/web/assets/{pdf-DkU37Bi0.js → pdf-DaNAfjLW.js} +1 -1
- package/dist/web/assets/play-DF5h_-8T.js +1 -0
- package/dist/web/assets/plus-D6oFNFQ0.js +1 -0
- package/dist/web/assets/{presentation-CddfsTzp.js → presentation-DbkiE2BE.js} +1 -1
- package/dist/web/assets/{python-CMdyfF2B.js → python-CDlD-992.js} +1 -1
- package/dist/web/assets/{refresh-cw-Cx_7Zlbl.js → refresh-cw-avBifyns.js} +1 -1
- package/dist/web/assets/{save-BaeHeBBw.js → save-DBayPmp_.js} +1 -1
- package/dist/web/assets/{settings-lists-CVg9h-5z.js → settings-lists-Cca729es.js} +1 -1
- package/dist/web/assets/square-CJccmW-i.js +1 -0
- package/dist/web/assets/{square-terminal-CBlQtWQw.js → square-terminal-D7snuW2g.js} +1 -1
- package/dist/web/assets/{submit-issue-command-L5--gt9i.js → submit-issue-command-wDL6xK3b.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-hftC_Rxs.js → toggleHighContrast-CP0qM8JR.js} +1 -1
- package/dist/web/assets/training-KYW8yE6p.js +1 -0
- package/dist/web/assets/{training-model-data-vvvphDlO.js → training-model-data-CilS0W2N.js} +1 -1
- package/dist/web/assets/{tsMode-B0sZU1HD.js → tsMode-DxR6CkQb.js} +1 -1
- package/dist/web/assets/{upload-Bzt1ooBz.js → upload-DEtkeTGw.js} +1 -1
- package/dist/web/assets/{useAccountSettings-BnxwetkP.js → useAccountSettings-BTy8zF0n.js} +1 -1
- package/dist/web/assets/{useAgentInventory-D_qS4ols.js → useAgentInventory-8MWE3pbH.js} +1 -1
- package/dist/web/assets/{useChatContextSelection-D8aSVtCm.js → useChatContextSelection-CBVI5IYj.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-CUQ1MW4l.js → useLocalAgentSchedules-B09iSkPy.js} +1 -1
- package/dist/web/assets/{useQuery-9SCnxwmR.js → useQuery-CKHqHSr0.js} +1 -1
- package/dist/web/assets/{wifi-off-DWtVm7W7.js → wifi-off-C-GF_rPd.js} +1 -1
- package/dist/web/assets/{workers-B3jA6AOv.js → workers-CmqH-dTr.js} +1 -1
- package/dist/web/assets/x-CQ0pGF6Q.js +1 -0
- package/dist/web/assets/{yaml-BEUL30-5.js → yaml-J_HdACeF.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +1 -0
- package/package.json +1 -1
- package/dist/chunks/chunk-5AV2EWFX.js +0 -2
- package/dist/chunks/chunk-64EDQ7UV.js +0 -2
- package/dist/chunks/chunk-DLOJG7LP.js +0 -2
- package/dist/chunks/training-JA5ZQABE.js +0 -2
- package/dist/chunks/training-NL5GYZKU.js +0 -2
- package/dist/web/assets/AppTerminalPanel-B2p_tYh5.js +0 -2
- package/dist/web/assets/RightSidebarHomePanel-joZavyR9.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CmdXCmrZ.js +0 -1
- package/dist/web/assets/chevron-down-CkifKd_O.js +0 -1
- package/dist/web/assets/chevron-right-LsMXJ5SB.js +0 -1
- package/dist/web/assets/chevron-up-Dt5T2Sf5.js +0 -1
- package/dist/web/assets/chunk-GS5HEE4M-C0RLeIsy.js +0 -1
- package/dist/web/assets/loader-circle-AjP2mDJA.js +0 -1
- package/dist/web/assets/play-BrvX67t1.js +0 -1
- package/dist/web/assets/plus-DFjCZeRE.js +0 -1
- package/dist/web/assets/square-Di5JBnVr.js +0 -1
- package/dist/web/assets/training-CGYukv2L.js +0 -1
- package/dist/web/assets/x-EG07vYCF.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as V}from"./chunk-
|
|
2
|
+
import{a as V}from"./chunk-W5FL7EH2.js";import{b as x,p as j,q as D}from"./chunk-FWYJ3MIN.js";import{b as E}from"./chunk-XTT3K3TR.js";import"./chunk-S7A2OGL2.js";import"./chunk-CZ2JSEUK.js";import"./chunk-EICS777E.js";import"./chunk-FEAKTSRS.js";import{a as I}from"./chunk-TPOAAJKA.js";import"./chunk-5VHHQZMT.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-5W2OJKJW.js";import"./chunk-IUYGQO2K.js";import"./chunk-W45RKGM6.js";import"./chunk-KAW26NGC.js";import"./chunk-HT6ILPD6.js";import"./chunk-BTEBZYK3.js";import"./chunk-VMW23TIZ.js";import"./chunk-VFH5C6D2.js";import"./chunk-XLZMSD5K.js";import"./chunk-SVLVIYH2.js";import"./chunk-6I5AUTVO.js";import{m as C}from"./chunk-BQNU4HZW.js";import"./chunk-JCHLDNCX.js";import"./chunk-AFKFN25T.js";import{a as b}from"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-OFJPOTES.js";import"./chunk-HHLQG7PN.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-ZLYQR44C.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-7J2NMUTK.js";import"./chunk-LRGMGXL2.js";import"./chunk-W45RKGM6.js";import{j as m}from"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-RGSMU6N4.js";import"./chunk-SYFJVLEL.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{ja as S}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{f as y,i as H}from"./chunk-ZY32SZ2P.js";import{e as P,i as R}from"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as d}from"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import{A as e}from"./chunk-X2J2P5ZT.js";import{a as s}from"./chunk-FTQLQJQV.js";import{readFile as h,realpath as z,lstat as T}from"node:fs/promises";import l from"node:path";var B=e.object({compile:e.object({repoPath:e.string(),profileId:e.string(),repositoryId:e.string(),sourceRevision:e.string(),workspaceId:e.string(),outputDir:e.string()}).strict(),externalDatasetPackage:e.string().regex(/^external-dataset-[a-f0-9-]+\.json$/).optional(),sourceCandidate:H.optional(),action:e.enum(["catalog","prepare"]),request:e.unknown().optional()}).strict();async function G(t){let o=await V(t.compile);if(t.sourceCandidate){let a=await C({workspaceId:typeof o.agentSnapshot.metadata.workspaceId=="string"?o.agentSnapshot.metadata.workspaceId:o.workspaceId,sourceDir:l.join(o.bundlePath,"source")});if(d(t.sourceCandidate.harnessRelease)!==d({id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash})||I(a).protectedClosureHash!==t.sourceCandidate.protectedClosureHash)throw new Error("Private candidate source differs from its actual frozen compiled release.")}let g={release:b.parse({schemaVersion:"openpond.localHarnessReleaseRecord.v1",workspaceId:o.workspaceId,sourceRevision:o.sourceRevision,agentSnapshot:P.parse(o.agentSnapshot),harnessRelease:R.parse(o.harnessRelease),bundlePath:o.bundlePath,createdAt:new Date().toISOString()})},p={source:"openpond_git",profileId:t.compile.profileId,repositoryId:t.compile.repositoryId},f=t.compile.sourceRevision,c={id:o.harnessRelease.id,contentHash:o.harnessRelease.contentHash},w=s(async a=>E({...a,runtime:g}),"loadCatalog"),q=await w({ref:p,sourceRevision:f,harnessRelease:c}),k=l.join(o.bundlePath,"source"),v=o.harnessRelease.files.some(a=>a.path==="workflows/catalog.json")?await(async()=>{let a=y({agentSnapshot:o.agentSnapshot,harnessRelease:o.harnessRelease,catalogBytes:await h(l.join(k,"workflows/catalog.json")),actionBytes:await h(l.join(k,"workflows/actions.json"))});return a.catalog.workflows.map(r=>({workflow:r,binding:{schemaVersion:"openpond.profileWorkflowBinding.v1",profileId:p.profileId,sourceRevision:f,harnessRelease:c,catalogHash:a.catalogHash,workflowId:r.id}}))})():[],A={profileRef:p,sourceRevision:f,harnessRelease:c,workflows:v};if(t.action==="catalog")return{...q,workflows:v};let u=t.externalDatasetPackage?await(async()=>{let a=await z(t.compile.outputDir),r=l.join(a,t.externalDatasetPackage),i=await T(r);if(!i.isFile()||i.isSymbolicLink()||i.size>32*1024*1024||await z(r)!==r)throw new Error("External Dataset cache is outside its bounded verifier storage.");let n=e.object({packageValue:e.unknown(),graders:e.array(e.object({id:e.string(),version:e.string(),contentHash:e.string(),feedbackKey:e.string(),release:e.object({id:e.string(),revision:e.union([e.string(),e.number()]),contentHash:e.string()}).strict().nullable()}).strict()).max(100)}).strict().parse(JSON.parse(await h(r,"utf8")));return{packageValue:S(n.packageValue),graders:n.graders}})():null;return j({privateGradingPreflight:s(a=>D(a,!1),"privateGradingPreflight"),sourceCandidate:t.sourceCandidate,resolveExternalDataset:u?async a=>{let r=m({binding:a,...u}),i=d(o.harnessRelease.files.filter(n=>n.visibility!=="policy").map(n=>({path:n.path,asset:n})));if(a.protectedProfileClosureHash!==i)throw new Error("The selected Profile's protected evaluator closure changed.");return{binding:a,packageValue:r,authorize:s(async()=>{m({binding:a,...u})},"authorize")}}:void 0,loadCatalog:w,selectedWorkflows:s(async()=>A,"selectedWorkflows"),placement:"remote",boundedWorkComputeAvailable:!0,loadTasksetPackage:s(async a=>{let r=await x({runtime:g,definition:a,harnessRelease:c});if(!r)throw new Error("Hosted evaluation Taskset is absent from its published Profile release.");return r},"loadTasksetPackage"),modelConfigurationHash:s(async(a,r)=>{if(a.providerId!=="openpond"||!r.hostModelConfigurationHash)throw new Error("Hosted evaluation preparation requires a trusted model configuration receipt.");return r.hostModelConfigurationHash},"modelConfigurationHash")})(t.request)}s(G,"prepareHostedProfileEvaluation");async function ae(t){if(t.length!==1||t[0].length>48e3||!/^[A-Za-z0-9_-]+$/.test(t[0]))throw new Error("Hosted Profile evaluation preparation argument is invalid.");let o=B.parse(JSON.parse(Buffer.from(t[0],"base64url").toString("utf8")));process.stdout.write(`${JSON.stringify(await G(o))}
|
|
3
3
|
`)}s(ae,"runHostedProfileEvaluationCli");export{G as prepareHostedProfileEvaluation,ae as runHostedProfileEvaluationCli};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-HYUTDZ3N.js";import{c as S}from"./chunk-RFQD6B44.js";import{a as x,d as y}from"./chunk-
|
|
2
|
+
import"./chunk-HYUTDZ3N.js";import{c as S}from"./chunk-RFQD6B44.js";import{a as x,d as y}from"./chunk-QSITPC3X.js";import"./chunk-FPW3RFZR.js";import"./chunk-IPH4LGK2.js";import"./chunk-XRKFTPHD.js";import"./chunk-KHDCMVEJ.js";import{p as q}from"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import{d as E}from"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import{a as R}from"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{K as g,L as b,U as p,V as I}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{a as f}from"./chunk-JF7WWLNW.js";import{c as h,f as v}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as n}from"./chunk-3M53YXEI.js";import{b as w}from"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as u}from"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as m}from"./chunk-FTQLQJQV.js";import{readFile as L,stat as U}from"node:fs/promises";async function J(r,l){let[i,a]=l,o=n(r,"team"),H=r.local===!0||r.local==="true";if(!o||!i||l.length>2)throw new Error("usage: human-review <read|inbox|inspect|results|request> [id] --team <id> [--input-file <path>] [--local --server-url <loopback-origin>]");let t;if(i==="request"){let e=n(r,"inputFile");if(a||!e||(await U(e)).size>1048576)throw new Error("Request requires a bounded --input-file with exact scoped pins, revision and stable operationId for mutations.");if(t=p.parse(JSON.parse(await L(e,"utf8"))),t.scope!==o)throw new Error("Input belongs to another workspace.")}else if(i==="inbox"){if(a)throw new Error("Inbox does not accept an assignment id.");t=p.parse({endpoint:"inbox",scope:o,view:n(r,"view")||"mine",status:n(r,"status")||"active",limit:Number(n(r,"limit")||100),...n(r,"project")?{projectId:n(r,"project")}:{},...n(r,"afterId")?{afterId:n(r,"afterId")}:{}})}else{if(!a)throw new Error(`${i} requires an exact assignment or execution id.`);t=p.parse(i==="read"?{endpoint:"get",scope:o,id:a,...n(r,"revision")?{revision:Number(n(r,"revision"))}:{}}:i==="inspect"?{endpoint:"inspect",scope:o,id:a,...n(r,"slot")?{slot:Number(n(r,"slot"))}:{},...n(r,"afterId")?{afterId:n(r,"afterId")}:{}}:i==="results"?{endpoint:"results",scope:o,executionId:a}:{endpoint:i,scope:o,id:a})}let s;if(H){let e=new URL(n(r,"serverUrl")||x);if(e.protocol!=="http:"||!["localhost","127.0.0.1","[::1]"].includes(e.hostname)||e.username||e.password||e.search||e.hash||e.pathname!=="/")throw new Error("Local Human review requires an HTTP loopback server origin.");let c=await y(e.origin),d=await c(new URL("/v1/human-review?location=local",e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t),redirect:"error",signal:AbortSignal.timeout(3e4)}),A=await N(d);if(s=JSON.parse(A),!d.ok)throw new Error(typeof s.error=="string"?s.error:`Local Human request failed (${d.status}).`)}else{let e=await E();s=await new q({scope:o,fetch:f,apiKey:await S(e,v(e)),baseUrl:h(r)??e.apiBaseUrl??w}).request(t,AbortSignal.timeout(3e4))}if(t.endpoint==="get"||t.endpoint==="command"){let e=g.parse(s),c=t.endpoint==="get"?t.id:t.command.id;if(e.id!==c||e.scope!==o)throw new Error("Review response differs from the requested identity.")}if(t.endpoint==="inbox"&&b.parse(s).items.some(c=>c.scope!==o||t.projectId&&c.projectId!==t.projectId))throw new Error("Inbox response differs from the requested scope.");if(t.endpoint==="inspect"&&I.parse(s).some(e=>e.reviewId!==t.id))throw new Error("Inspection response differs from the selected assignment.");if(t.endpoint==="results"){let e=R.parse(s),{contentHash:c,...d}=e;if(e.executionId!==t.executionId||u(d)!==c||t.selection!==void 0&&u(e.selection)!==u(t.selection))throw new Error("Result response differs from the selected execution or retained review revisions.")}console.log(JSON.stringify(s,null,2))}m(J,"runHumanReviewCommand");async function N(r){let l=r.body?.getReader();if(!l)throw new Error("Review response is unavailable.");let i=[],a=0;try{for(;;){let o=await l.read();if(o.done)break;if(a+=o.value.byteLength,a>8388608)throw new Error("Review response exceeds its bounded transport.");i.push(o.value)}}finally{await l.cancel(),l.releaseLock()}return Buffer.concat(i).toString("utf8")}m(N,"boundedResponse");export{J as runHumanReviewCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{A as z,a as ue,b as $,c as pe,d as fe,g as me,h as he,i as L,j as we,k as ge,l as ye,m as ve,n as be,o as H,p as N,q as Ie,r as Se,s as Ce,t as V,u as O,v as Q,w as Ee,x as M,y as xe,z as Re}from"./chunk-OTXGAKFH.js";import{k as Y}from"./chunk-HYUTDZ3N.js";import{a as Ne}from"./chunk-RFQD6B44.js";import"./chunk-
|
|
2
|
+
import{A as z,a as ue,b as $,c as pe,d as fe,g as me,h as he,i as L,j as we,k as ge,l as ye,m as ve,n as be,o as H,p as N,q as Ie,r as Se,s as Ce,t as V,u as O,v as Q,w as Ee,x as M,y as xe,z as Re}from"./chunk-OTXGAKFH.js";import{k as Y}from"./chunk-HYUTDZ3N.js";import{a as Ne}from"./chunk-RFQD6B44.js";import"./chunk-FPW3RFZR.js";import"./chunk-IPH4LGK2.js";import"./chunk-XRKFTPHD.js";import"./chunk-JFXINDOQ.js";import"./chunk-KHDCMVEJ.js";import{k as Ue,l as Ae,m as J}from"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import{d as F,g as $e}from"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{c as le,f as de}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as u,f as y}from"./chunk-3M53YXEI.js";import{b as ce}from"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{m as ae,n as x}from"./chunk-RCT3O3HQ.js";import{a as _,f as ie}from"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import{A as g}from"./chunk-X2J2P5ZT.js";import{a as d}from"./chunk-FTQLQJQV.js";import{createInterface as Le}from"node:readline/promises";import{join as so,resolve as Me}from"node:path";import{homedir as io}from"node:os";import{createHash as Te,generateKeyPairSync as Fe,createPublicKey as Ye,diffieHellman as Ge,createDecipheriv as We}from"node:crypto";import{spawn as Ve}from"node:child_process";var Oe=d(e=>Te("sha256").update(e).digest("hex"),"hash"),Qe=g.object({publicKey:g.string().max(200),iv:g.string().max(100),tag:g.string().max(100),ciphertext:g.string().max(1e4)}).strict();async function X(e,t,o){let r=await fetch(`${e}${t}`,{method:"POST",redirect:"error",signal:AbortSignal.timeout(15e3),headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),n=await r.text();if(n.length>16384)throw new Error("Authorization response exceeded its limit.");if(!r.ok)throw Object.assign(new Error(`Browser sign-in failed (${r.status}).`),{status:r.status});return JSON.parse(n)}d(X,"post");function Xe(e){let t=process.platform==="darwin"?"open":process.platform==="win32"?"rundll32":"xdg-open",o=process.platform==="win32"?["url.dll,FileProtocolHandler",e]:[e],r=Ve(t,o,{stdio:"ignore",detached:!0});r.on("error",()=>{}),r.unref()}d(Xe,"openBrowser");async function ke(e,t){let o=await F(),r=le(t)||o.apiBaseUrl||ce,n=u(t,"baseUrl")||de(o),i=new URL(n),c=new URL(r);for(let h of[i,c])if(h.protocol!=="https:"&&!(h.protocol==="http:"&&["localhost","127.0.0.1"].includes(h.hostname))||h.username||h.password||h.search||h.hash)throw new Error("Sign-in requires a clean HTTPS origin or local development origin.");let s=`import-${Oe([i.origin,e.machineId,e.instanceId].join(":")).slice(0,24)}`,a=Fe("x25519"),f=a.publicKey.export({format:"der",type:"spki"}).toString("base64"),l=g.object({deviceCode:g.string(),userCode:g.string(),expiresAt:g.string().datetime(),intervalSeconds:g.number().min(2).max(10)}).strict().parse(await X(i.origin,"/api/cli/import/device",{publicKey:f,machineId:e.machineId,sourceInstanceId:e.instanceId,sourceLabel:$[e.source],sourceRoot:e.root,...u(t,"team")?{requestedTeamId:u(t,"team")}:{}})),w=`${i.origin}/console/connections/authorize?code=${encodeURIComponent(l.userCode)}`;for(console.log(`OpenPond sign-in code: ${l.userCode}
|
|
3
3
|
${w}`),Xe(w);Date.now()<Date.parse(l.expiresAt);){await new Promise(R=>setTimeout(R,l.intervalSeconds*1e3));let h;try{h=await X(i.origin,"/api/cli/import/token",{deviceCode:l.deviceCode})}catch(R){if(Number(R.status)===429)continue;throw R}let b=g.object({state:g.enum(["pending","approved","denied","consumed"]),envelope:Qe.nullable().optional()}).strict().parse(h);if(b.state==="denied"||b.state==="consumed")throw new Error("Browser sign-in was declined or already consumed. Start the connection again.");if(b.state!=="approved"||!b.envelope)continue;let m=b.envelope,p=Ye({key:Buffer.from(m.publicKey,"base64"),format:"der",type:"spki"});if(p.asymmetricKeyType!=="x25519")throw new Error("Invalid sign-in encryption key.");let C=Te("sha256").update(Ge({privateKey:a.privateKey,publicKey:p})).digest(),v=We("aes-256-gcm",C,Buffer.from(m.iv,"base64"));v.setAAD(Buffer.from(Oe(l.deviceCode))),v.setAuthTag(Buffer.from(m.tag,"base64"));let S=g.object({apiKey:g.string().min(1),teamId:g.string().min(1),expiresAt:g.string().datetime()}).strict().parse(JSON.parse(Buffer.concat([v.update(Buffer.from(m.ciphertext,"base64")),v.final()]).toString("utf8")));if(u(t,"team")&&S.teamId!==u(t,"team"))throw new Error("Browser approved a different workspace.");return await $e({handle:s,apiKey:S.apiKey,baseUrl:i.origin,apiBaseUrl:c.origin,setActive:!1}),await X(i.origin,"/api/cli/import/token",{deviceCode:l.deviceCode,acknowledge:!0}),{apiKey:S.apiKey,teamId:S.teamId,baseUrl:c.origin,account:s,accountBaseUrl:i.origin}}throw new Error("Browser sign-in expired. Start the connection again.")}d(ke,"authorizeImporter");import{homedir as Ze}from"node:os";import{join as eo}from"node:path";import{zstdCompressSync as oo}from"node:zlib";function je(e,t,o){if(t.connectionId!==e.id||!t.boundaryIds.length||new Set(t.boundaryIds).size!==t.boundaryIds.length)throw Object.assign(new Error("Retained source selection differs from its connection."),{status:400});if(o.issues.length)throw Object.assign(new Error("Retained source normalization failed."),{status:400});let r=o.sessions.find(n=>JSON.stringify([e.source.instanceId,n.sessionId,n.branchId])===t.sessionKey);if(!r||t.boundaryIds.some(n=>{let i=r.boundaries.find(s=>s.id===n),c=i?r.events[i.start]?.occurredAt:null;return!i||i.projection!=="turn"||i.terminal==="unknown"||!c||!Number.isFinite(Date.parse(c))||e.since!==null&&Date.parse(c)<Date.parse(e.since)}))throw Object.assign(new Error("Retained source boundaries changed; inspect the connection before resuming."),{status:400});return{...t,contentHash:r.contentHash,operationId:r.contentHash===t.contentHash?t.operationId:`sync-${x([t.operationId,"source-normalization",r.contentHash]).slice(0,48)}`}}d(je,"refreshRetainedAdmission");async function k(e){let t=await _(e.credentialHome??eo(Ze(),".openpond"),()=>F({account:e.account,baseUrl:e.accountBaseUrl})),o=e.account?t.apiKey:Ne(t);if(!o)throw Object.assign(new Error("This source is disconnected. Reconnect it with OpenPond Importer to authorize collection."),{status:401});let r={apiKey:o,baseUrl:e.apiBaseUrl,teamId:e.teamId};return{evidence:new Ae(r),sync:new J(r)}}d(k,"collectorClients");var Z=null;async function ee(e,t,o){let r=AbortSignal.any([AbortSignal.timeout(6e4),...t?[t]:[]]);try{return await o(r)}catch(n){let i=n&&typeof n=="object"&&"status"in n?n.status:void 0;throw Object.assign(new Error(`Conversation import ${e} failed: ${n instanceof Error?n.message:String(n)}`,{cause:n}),typeof i=="number"?{status:i}:{})}}d(ee,"admissionStep");var Be={async publishCoverage(e,t,o){let{sync:r}=await k(e);await r.publishCoverage({id:e.id,expectedRevision:e.revision,manifest:t},AbortSignal.any([AbortSignal.timeout(6e4),...o?[o]:[]]))},async heartbeat(e,t,o){let{sync:r}=await k(e),n=await r.heartbeat({id:e.id,expectedRevision:e.revision,...t},AbortSignal.any([AbortSignal.timeout(6e4),...o?[o]:[]]));return{revision:n.revision,state:n.state,destinations:ge(e,n),requestedSyncRevision:n.requestedSyncRevision,completedSyncRevision:n.completedSyncRevision}},async admit(e,t,o){let{evidence:r,sync:n}=await k(e),i=x([e.id,e.revision,e.apiBaseUrl,e.teamId,e.account,e.credentialHome,e.projectId,e.source.instanceId,t.branchLeafId,t.files]);if(Z?.key!==i){let m=Buffer.from(JSON.stringify(t.files.map(C=>({path:C.path,encoding:"zstd",base64:oo(Buffer.from(C.text)).toString("base64")})))),p=ue({source:e.source.source,files:t.files,acquisition:{machineId:e.source.machineId,sourceInstanceId:e.source.instanceId},...t.branchLeafId?{branchLeafId:t.branchLeafId}:{}});Z={key:i,bytes:m,upload:{hash:ae(m),parts:Math.ceil(m.length/2e5)},nextPart:0,normalized:p}}let c=Z,s=je(e,t,c.normalized),a=c.upload;for(;c.nextPart<a.parts;){let m=c.nextPart,p=Math.min(4,a.parts-m),C=await Promise.allSettled(Array.from({length:p},(R,j)=>{let B=m+j;return ee(`upload part ${B+1}/${a.parts}`,o,K=>r.uploadPart({...a,index:B,base64:c.bytes.subarray(B*2e5,(B+1)*2e5).toString("base64")},K))})),v=C.findIndex(R=>R.status==="rejected");c.nextPart+=v<0?p:v;let S=C[v];if(S?.status==="rejected")throw S.reason}let f={upload:a,source:e.source.source,...t.branchLeafId?{branchLeafId:t.branchLeafId}:{},destination:{kind:"existing",projectId:e.projectId},acquisition:{machineId:e.source.machineId,sourceInstanceId:e.source.instanceId}},l=c.preview??=await ee("preview",o,m=>r.preview(f,m));if(l.issues.length)throw Object.assign(new Error("Source schema was rejected; inspect the connection before resuming."),{status:400});let w=l.sessions.find(m=>m.sessionHash===s.contentHash);if(!w||t.boundaryIds.some(m=>!w.boundaries.some(p=>p.id===m&&p.projection==="turn"&&p.terminal!=="unknown")))throw Object.assign(new Error("Server preview differs from the retained source boundaries."),{status:400});let h={...f,operationId:s.operationId,previewHash:l.previewHash,selection:[{sessionHash:w.sessionHash,boundaryIds:t.boundaryIds}]},b=Ue.parse(await ee("commit",o,m=>n.commit({connectionId:e.id,expectedRevision:e.revision,request:h},m)));if(b.state!=="completed"||b.operationId!==s.operationId||b.requestHash!==x(h)||b.projectId!==e.projectId)throw new Error("Admission did not acknowledge this retained operation.")}};function G(e){if(e.everyMinute!==void 0)throw new Error("Every-minute imports are no longer supported. Use --continual --hourly or a slower schedule.");let t=y(e.continual),o=["daily","weekly","hourly"].filter(a=>y(e[a]));e.cron!==void 0&&o.push("cron");let r=e.at!==void 0||e.on!==void 0;if(!t&&(o.length||r))throw new Error("Add --continual to enable recurring imports. Without it, imports run once.");if(!t)return null;if(o.length>1)throw new Error("Choose one cadence: --daily, --weekly, --hourly, or --cron.");if(e.off!==void 0)throw new Error("Choose --continual or --off, not both.");let n=o[0]??"daily";if(["cron","hourly"].includes(n)){if(r)throw new Error("--at and --on are for daily/weekly imports; use a cron expression for other times.");return n==="cron"?be({frequency:"cron",expression:u(e,"cron")}):{frequency:"hourly"}}if(n!=="weekly"&&e.on!==void 0)throw new Error("--on selects a weekday and requires --weekly.");let i=ve(e.at===void 0?"00:00":u(e,"at"));if(n==="daily")return{frequency:"daily",time:i};let c=e.on===void 0?"mon":u(e,"on").toLowerCase(),s=ye.findIndex(a=>a===c);if(s<0)throw new Error("Use --on sun|mon|tue|wed|thu|fri|sat (default: mon).");return{frequency:"weekly",time:i,day:s}}d(G,"importSchedule");import{setTimeout as to}from"node:timers/promises";async function Pe(e){console.log("Importing saved conversations. Ctrl+C cancels this run; queued work is retained.");let t=0;try{for(;!e.signal.aborted;){let n=(await O(e.directory)).connections.filter(s=>!e.connectionId||s.id===e.connectionId).find(s=>s.run?.state==="running"),i=n?.run,c=n&&i?`${n.source}: ${i.phase} \xB7 ${i.processed}/${i.discovered} conversations checked \xB7 ${i.uploaded} turns uploaded \xB7 ${n.queued} queued`:"Starting import\u2026";process.stdout.clearLine(0),process.stdout.cursorTo(0),process.stdout.write(`${["|","/","-","\\"][t++%4]} ${c}`);try{await to(500,void 0,{signal:e.signal})}catch{if(!e.signal.aborted)throw new Error("Import progress interrupted.")}}}finally{process.stdout.clearLine(0),process.stdout.cursorTo(0)}}d(Pe,"monitorImport");async function P(e){let t=new AbortController,o=d(()=>t.abort(new Error("Import cancelled.")),"stop");process.once("SIGINT",o),process.once("SIGTERM",o);let r=new AbortController,n=!!process.stdin.isTTY&&!!process.stdout.isTTY&&!e.json,i;try{let s=Ce({directory:e.directory,signal:t.signal,until:e.until,...e.connectionId?{connectionIds:[e.connectionId]}:{},...e.retainedStart?{}:{trigger:e.scheduled?"scheduled":"manual"},transport:Be}).finally(()=>r.abort());await Promise.all([s,n?Pe({directory:e.directory,connectionId:e.connectionId,signal:r.signal}):Promise.resolve()]),i=await O(e.directory)}finally{r.abort(),process.off("SIGINT",o),process.off("SIGTERM",o)}let c=i.connections.filter(s=>!e.connectionId||s.id===e.connectionId);if(e.json)console.log(JSON.stringify(i,null,2));else for(let s of c){let a=s.run;a&&console.log(`${s.source}: ${a.state}. ${a.processed} conversations checked, ${a.uploaded} turns uploaded, ${s.queued} queued.${a.error?` ${a.error}`:""}`),console.log(s.schedule?`Continual imports: ${H(s.schedule)} (${i.timezone}). Next: ${s.nextRunAt??"source paused"}.`:"Automatic sync is off. Run openpond import sync to import again.")}return t.signal.aborted?process.exitCode=130:c.some(s=>s.run?.state==="failed")&&(process.exitCode=1),i}d(P,"runImportJob");import{readFile as no}from"node:fs/promises";async function oe(e){let t=await no(e);if(t.byteLength>1024*1024)throw new Error("Conversation selection exceeds 1 MiB.");return me.parse(JSON.parse(t.toString("utf8")))}d(oe,"readUploadSelection");async function qe(e,t){let o=await L(e.source,await oe(t));return{...e,since:null,selectedSessionKeys:[...o.sessionKeys].sort()}}d(qe,"applyUploadSelection");function W(e){return{directory:e,executable:process.execPath,args:[...process.execArgv,process.argv[1]],environment:{...process.env.OPENPOND_HOME?{OPENPOND_HOME:process.env.OPENPOND_HOME}:{},...process.env.ELECTRON_RUN_AS_NODE==="1"?{ELECTRON_RUN_AS_NODE:"1"}:{}}}}d(W,"collectorSetup");async function He(e,t,o,r){let n=d(c=>console.log(JSON.stringify(c,null,2)),"print"),i=y(r.json);if(t==="status")return n(await O(e)),!0;if(t==="conversations"){if(!o)throw new Error("Use openpond import conversations <connection-id> [--query <text>] [--range day|week|all] [--offset <number>].");let c=await N.open(e);try{let s=c.connections().find(a=>a.id===o);if(!s)throw new Error("Select a retained connection from import status.");n({sourceInstanceId:s.source.instanceId,...we(s,await he(s.source),{query:u(r,"query"),range:u(r,"range")||"all",offset:Number(u(r,"offset")||"0")})})}finally{c.close()}return!0}if(t==="coverage"){if(!o)throw new Error("Use openpond import coverage <connection-id>.");let c=await N.open(e);try{if(!c.connections().some(a=>a.id===o))throw new Error("Select a retained connection from import status.");let s=c.coverage.manifest(o);if(!s)throw new Error("This connection has no retained source coverage. Run import sync first.");n({manifest:s,summary:c.coverage.summary(o)})}finally{c.close()}return!0}if(t==="cancel")return n(await Q(e,"stop")),!0;if(t==="schedule"){if(!o)throw new Error("Use openpond import schedule <connection-id> --continual [--daily|--weekly|--hourly|--cron <expression>] or --off.");let c=G(r),s=y(r.off);if(!c&&!s)throw new Error("Choose --continual [--daily|--weekly|--hourly|--cron <expression>] or --off.");return n(await M(W(e),o,c)),!0}if(t==="sync"){let c=await O(e);if(o&&!c.connections.some(a=>a.id===o&&a.state==="active"))throw new Error("Select an active connection from import status; resume or reconnect it first.");if(!c.connections.some(a=>a.state==="active"))throw new Error("No active sources. Connect or resume a source first.");let s=u(r,"selectionFile");if(s){if(!o)throw new Error("Select a connection ID when uploading chosen conversations.");if(c.running)throw new Error("Wait for the running import or cancel it before selecting more conversations.");let a=await N.open(e);try{let f=a.connections().find(w=>w.id===o);if(!f)throw new Error("The selected connection is unavailable.");let l=await qe(f,s);if(f.since!==null){let{sync:w}=await k(f),h=await w.register({id:f.id,source:f.source.source,machineId:f.source.machineId,sourceInstanceId:f.source.instanceId,sourceLabel:$[f.source.source],sourceRoot:f.source.root,destination:{kind:"existing",projectId:f.projectId},since:null,keepSyncing:f.keepSyncing,expectedRevision:f.revision});l={...l,revision:h.revision,state:h.state,requestedSyncRevision:h.requestedSyncRevision,completedSyncRevision:h.completedSyncRevision}}a.put(l)}finally{a.close()}}else if(!c.connections.some(a=>a.state==="active"&&(!o||a.id===o)&&a.selectedConversations!==0))throw new Error("Choose conversations first with --selection-file <path>.");return await P({directory:e,connectionId:o,json:i,until:u(r,"until")||void 0}),!0}if(t!=="service")return!1;if(o==="status")n(await O(e));else if(o==="stop")n(await Q(e,"stop"));else if(o==="uninstall")n(await xe(e));else if(o==="install")n(await Ee(W(e)));else if(o==="start")await P({directory:e,json:i});else if(o==="run")await P({directory:e,json:i,scheduled:y(r.scheduled),retainedStart:!y(r.scheduled)});else throw new Error("usage: openpond import service <install|start|stop|status|run|uninstall>");return!0}d(He,"runImporterControl");async function te(e,t){let o=await N.open(e),r;try{r=o.connections().find(n=>n.id===t)}finally{o.close()}if(!r)throw new Error("Select a retained connection from openpond import status.");if(r.source.machineId!==await z(e))throw new Error("This connection belongs to another machine. Use explicit Connect setup.");if(!r.accountBaseUrl)throw new Error("The original sign-in destination is unavailable. Use explicit Connect setup.");return r}d(te,"retainedReconnect");function Ke(e,t){if(!t?.available||!t.capabilities.history||t.source!==e.source.source||t.machineId!==e.source.machineId||t.instanceId!==e.source.instanceId||t.root!==e.source.root)throw new Error("The retained source is unavailable or its identity changed. Restore its original location or use explicit Connect setup.")}d(Ke,"assertReconnectSource");async function De(e,t){let o=await te(e,t.id),r=d(n=>({...n,destinations:void 0,requestedSyncRevision:n.requestedSyncRevision??0,completedSyncRevision:n.completedSyncRevision??0}),"scope");if(x(r(o))!==x(r(t)))throw new Error("The connection changed during sign-in. Reconnect again after reviewing its current scope.")}d(De,"assertReconnectUnchanged");import{createInterface as ro}from"node:readline/promises";async function _e(e,t,o,r){let n=u(r,"session");if(!o||!n)throw new Error("Use openpond import branches <connection-id> --session <native-session-id>.");let i=await Ie(e,o,n);if(t==="branches"){console.log(JSON.stringify(i,null,2));return}let c=process.stdin.isTTY&&process.stdout.isTTY&&!y(r.json),s=u(r,"leaf"),a=u(r,"revision");if(!s&&c){i.branches.forEach((w,h)=>console.log(`${h+1}. ${w.title||w.leafId} (${w.messages} messages; ${w.updatedAt||"date unavailable"})`));let l=ro({input:process.stdin,output:process.stdout});try{s=i.branches[Number(await l.question("Choose the branch to sync: "))-1]?.leafId??"",a=i.revision}finally{l.close()}}if(!s||!a)throw new Error("Supply --leaf and --revision from import branches, or choose interactively. No branch was selected.");if(!i.branches.some(l=>l.leafId===s)||a!==i.revision)throw new Error("Branch selection is stale or invalid. Run import branches again.");if(!y(r.yes)&&(!c||!await Y("Sync only this branch and its unambiguous future continuation for this conversation? Other branches stay excluded.",!1)))throw new Error("Branch selection was not approved.");let f=await Se(e,o,n,{leafId:s,revision:a});console.log(JSON.stringify({...f,next:`openpond import resume ${o}`},null,2))}d(_e,"runImporterBranchCommand");async function $t(e,t){let[o="connect",r]=t,n=Me(u(e,"collectorDir")||Re()),i=y(e.json),c=d(I=>console.log(JSON.stringify(I,null,2)),"print"),s=G(e),a=y(e.upload),f=u(e,"selectionFile");if(a&&!["connect","reconnect"].includes(o))throw new Error("Use --upload with import connect or reconnect; import sync is already an explicit upload.");if(f&&!["connect","reconnect","sync"].includes(o))throw new Error("Use --selection-file with connect, reconnect, or sync.");if(f&&o!=="sync"&&!a)throw new Error("Use --upload to confirm the selected initial upload.");if(s&&!a&&o==="connect")throw new Error("Select an initial upload with --upload before enabling continual imports.");if(e.until&&o!=="sync")throw new Error("Use --until with import sync to select a fixed event-time cutoff.");if(s&&!["connect","reconnect","schedule"].includes(o))throw new Error("Use --continual with import connect, reconnect, or schedule.");if(y(e.off)&&o!=="schedule")throw new Error("Use import schedule <connection-id> --off to disable recurring imports.");if(o==="branches"||o==="branch"){await _e(n,o,r,e);return}if(await He(n,o,r,e))return;if(["pause","resume","disconnect"].includes(o)){let I=await N.open(n),U;try{U=I.connections().find(Je=>Je.id===r)}finally{I.close()}if(!U)throw new Error("Select a connection id from openpond import status.");let{sync:A}=await k(U),q=await A.control({id:U.id,expectedRevision:U.revision,action:o});await V(n,{...U,revision:q.revision,state:q.state}),c(q);return}let l=o==="reconnect"?await te(n,r):null;l&&(e={...e,source:l.source.source,sourcePath:l.source.root,project:l.projectId,connection:l.id,team:l.teamId,apiBaseUrl:l.apiBaseUrl,baseUrl:l.accountBaseUrl});let w=u(e,"source");if(w&&!(w in $))throw new Error("Choose a supported native source name.");let h=await z(n),b=await pe({machineId:h,...w&&u(e,"sourcePath")?{locations:{[w]:Me(u(e,"sourcePath"))}}:{}});if(o==="discover"){c(b);return}if(o!=="connect"&&o!=="reconnect")throw new Error("usage: openpond import <connect|reconnect|discover|status|conversations|coverage|sync|schedule|cancel|pause|resume|disconnect|branches|branch|service>");let m=b.filter(I=>I.source===w),p=m.length===1?m[0]:void 0,C=process.stdin.isTTY&&process.stdout.isTTY&&!i;if(l&&Ke(l,p),!p&&C){let I=m.length>1?m:b.filter(A=>A.available);I.forEach((A,q)=>console.log(`${q+1}. ${$[A.source]} ${A.root}${A.capabilities.history?"":` (${A.reason})`}`));let U=Le({input:process.stdin,output:process.stdout});try{p=I[Number(await U.question("Choose a source: "))-1]}finally{U.close()}}if(!p?.capabilities.history)throw new Error(p?.reason??(m.length>1?"Multiple source instances found. Select the exact --source-path or use interactive setup.":"Select --source and optionally --source-path."));let v=u(e,"range")||"week";if(a&&!l&&C&&!e.range){let I=Le({input:process.stdin,output:process.stdout});try{v=(await I.question("Initial history: day, week, or all [default: week]: ")).trim()||"week"}finally{I.close()}}if(!["day","week","all"].includes(v))throw new Error("--range must be day, week or all.");let S=f?null:l?l.since:v==="all"?null:new Date(Date.now()-(v==="day"?1:7)*864e5).toISOString(),R=l?S?`since ${S}`:"all":v==="week"?`last week${e.range?"":" (default)"}`:v==="day"?"last day":"all",j=f?await L(p,await oe(f)):null,B=j?j.sessionKeys:l?l.selectedSessionKeys:a?void 0:[],K=await fe(p,{since:S??void 0,limit:100});i||console.log(`Found ${K.items.length}${K.nextCursor?"+":""} sessions in ${p.root}. Initial history: ${R}.`),i||console.log(a?s?`Continual imports: ${H(s)} local time. Continual learning is unchanged.`:"One-time import. Continual imports default to off; existing schedules are unchanged.":"Connect only. No conversations will be uploaded. Choose conversations with import sync --selection-file when ready.");let D=u(e,"project");if(!y(e.yes)&&(!C||!await Y(`Connect this source to ${D||"your personal Imported conversations Project"}${a?` and upload ${j?`${j.sessionKeys.length} selected conversations`:"the selected history window"}`:" without uploading history"}${s?` and enable continual imports ${H(s)} local time`:""}?`,!0)))throw new Error("Connection was not approved. No history was uploaded.");let ne=l?l.credentialHome??so(io(),".openpond"):ie(),T=await _(ne,()=>ke(p,e)),re=new J(T),se=u(e,"connection")||`sync-${x([T.baseUrl,T.teamId,p.instanceId,D||"default"]).slice(0,40)}`;l&&await De(n,l);let ze=(await re.list()).items.find(I=>I.id===se),E=await re.register({id:se,source:p.source,machineId:h,sourceInstanceId:p.instanceId,sourceLabel:$[p.source],sourceRoot:p.root,destination:D?{kind:"existing",projectId:D}:{kind:"new",name:"Imported conversations"},since:S,keepSyncing:!1,expectedRevision:ze?.revision??0});await V(n,{id:E.id,teamId:T.teamId,apiBaseUrl:T.baseUrl,account:T.account,accountBaseUrl:T.accountBaseUrl,credentialHome:ne,source:p,projectId:E.projectId,revision:E.revision,requestedSyncRevision:E.requestedSyncRevision,completedSyncRevision:E.completedSyncRevision,since:S,selectedSessionKeys:B,keepSyncing:!1,state:E.state}),s&&await M(W(n),E.id,s),a?await P({directory:n,connectionId:E.id,json:i}):i?c({connectionId:E.id,uploaded:!1}):console.log(`Connected ${E.id}. Choose conversations to upload when ready.`)}d($t,"runImportCommand");export{$t as runImportCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-CABXOJ3I.js";import"./chunk-WLQEONBF.js";import"./chunk-B7ELZHQN.js";import"./chunk-3SIZBCEO.js";import"./chunk-IZ6DLEVY.js";import"./chunk-SVLVIYH2.js";import"./chunk-BQNU4HZW.js";import"./chunk-AFKFN25T.js";import"./chunk-G4747MOW.js";import"./chunk-KCJVFLBB.js";import"./chunk-OVEQAEKR.js";import"./chunk-SSJV3VX7.js";import"./chunk-7KWD2I6W.js";import"./chunk-OFJPOTES.js";import"./chunk-FDYWGE2Y.js";import"./chunk-HHLQG7PN.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-ZLYQR44C.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-LZPCA6DH.js";import"./chunk-L3KS6MOV.js";import"./chunk-7J2NMUTK.js";import"./chunk-LRGMGXL2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-F64TR23C.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-RGSMU6N4.js";import"./chunk-SYFJVLEL.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as createLocalHarnessImprovementRuntime};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{i as a,j as b}from"./chunk-
|
|
2
|
+
import{i as a,j as b}from"./chunk-D2PEB6AJ.js";import"./chunk-NACSY3HS.js";import"./chunk-EOQTBH4U.js";import"./chunk-S7A2OGL2.js";import"./chunk-CZ2JSEUK.js";import"./chunk-XVDFJ3ZF.js";import"./chunk-FEAKTSRS.js";import"./chunk-5VHHQZMT.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-5W2OJKJW.js";import"./chunk-CWE2N3JI.js";import"./chunk-KAW26NGC.js";import"./chunk-2HWSF4FS.js";import"./chunk-HT6ILPD6.js";import"./chunk-VMW23TIZ.js";import"./chunk-JRW6MFV6.js";import"./chunk-6EZHEVXS.js";import"./chunk-AN525SPP.js";import"./chunk-IZ6DLEVY.js";import"./chunk-SYUKES6H.js";import"./chunk-6I5AUTVO.js";import"./chunk-SSJV3VX7.js";import"./chunk-7KWD2I6W.js";import"./chunk-2ACX7IW5.js";import"./chunk-OFJPOTES.js";import"./chunk-JAIFVT3D.js";import"./chunk-YU3C6U5V.js";import"./chunk-KVTBX2UP.js";import"./chunk-FDYWGE2Y.js";import"./chunk-HHLQG7PN.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-ZLYQR44C.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-L3KS6MOV.js";import"./chunk-7J2NMUTK.js";import"./chunk-LRGMGXL2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-F64TR23C.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-RGSMU6N4.js";import"./chunk-SYFJVLEL.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as createLocalHarnessTasksetReviewControl,b as runLocalHarnessEvaluationBaseline};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-T4QXKU5Y.js";import"./chunk-HYUTDZ3N.js";import{c as h}from"./chunk-RFQD6B44.js";import"./chunk-
|
|
2
|
+
import"./chunk-T4QXKU5Y.js";import"./chunk-HYUTDZ3N.js";import{c as h}from"./chunk-RFQD6B44.js";import"./chunk-FPW3RFZR.js";import"./chunk-IPH4LGK2.js";import"./chunk-XRKFTPHD.js";import{a as k}from"./chunk-Q34IF4PW.js";import{a as d,c as w,d as B}from"./chunk-6XSSM4WT.js";import"./chunk-KHDCMVEJ.js";import"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import{d as f}from"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{c as u,d as m,f as g}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{f as p}from"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{randomUUID as U}from"node:crypto";async function T(t,r){let e=r[0]||"smoke";if(e==="chat"){if(r.length!==1)throw new Error("opchat chat accepts options, not positional arguments.");await(await import("./opchat-bounded-chat-IOV6FYBH.js")).runBoundedOpChat(t);return}let o=await f(),s=await h(o,g(o)),l=C(o,t);if(e==="provider-catalog"||e==="providers-catalog"||e==="catalog"){let n=await y({apiBaseUrl:l,token:s});console.log(JSON.stringify(n,null,2));return}if(e==="models"||e==="model-list"){let n=await w({apiBaseUrl:l,token:s});console.log(JSON.stringify(n,null,2));return}if(e==="model"||e==="model-get"){let n=r[1]||a(t,"model");if(!n)throw new Error("usage: opchat model <model>");let c=await B({apiBaseUrl:l,token:s,model:n});console.log(JSON.stringify(c,null,2));return}if(e==="smoke"){let n=await k({apiBaseUrl:l,token:s,defaultModel:a(t,"model")||void 0,compatibilityModel:a(t,"compatibilityModel")||a(t,"compatModel")||void 0,skipStream:p(t.skipStream),skipTool:p(t.skipTool),log:i(c=>console.log(c),"log")});p(t.json)&&console.log(JSON.stringify(n,null,2));return}throw new Error(`usage: opchat <provider-catalog|models|model|smoke> [--opchat-api-base-url <url>]
|
|
3
3
|
opchat chat --model <id> --message <text> --team-id <id> --max-output-tokens <n> --request-id <id> --timeout-sec <1..600> --max-spend <usd> [--stream] (one bounded request; JSON receipt after completion)`)}i(T,"runOpChatCommand");async function y(t){let r=t.apiBaseUrl.trim().replace(/\/+$/,"");if(!r)throw new Error("OpChat API base URL is required.");let e=t.token.trim();if(!e)throw new Error("OpenPond API key is required.");let o=await fetch(`${r}/provider-catalog`,{method:"GET",headers:{Authorization:`Bearer ${e}`,Accept:"application/json","Content-Type":"application/json","x-openpond-client":"openpond-cli","x-openpond-request-id":U()}});if(!o.ok)throw new Error(`Hosted provider catalog failed: ${o.status} ${await A(o)}`);return o.json()}i(y,"getOpChatProviderCatalog");async function A(t){let r=await t.text().catch(()=>"");if(!r)return t.statusText||`HTTP ${t.status}`;try{let e=JSON.parse(r);if(typeof e.message=="string")return e.message;if(typeof e.error=="string")return e.error;if(e.error&&typeof e.error=="object"&&!Array.isArray(e.error)){let o=e.error;return[o.code,o.message].filter(Boolean).join(": ")||r}return r}catch{return r}}i(A,"readResponseError");function C(t,r){let e=a(r,"opchatApiBaseUrl")||a(r,"opchatApiBaseurl")||a(r,"opChatApiBaseUrl")||a(r,"opChatApiBaseurl")||a(r,"opchatApiUrl")||a(r,"opChatApiUrl");return e?d({opChatApiBaseUrl:e}):d({apiBaseUrl:u(r)||t.apiBaseUrl,chatApiBaseUrl:m(r)||t.chatApiBaseUrl})}i(C,"resolveOpChatCliBaseUrl");function a(t,r){let e=t[r];return typeof e=="string"?e.trim():""}i(a,"optionString");export{T as runOpChatCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-T4QXKU5Y.js";import"./chunk-HYUTDZ3N.js";import"./chunk-RFQD6B44.js";import{a as Z}from"./chunk-AZ7BL5FL.js";import"./chunk-
|
|
2
|
+
import"./chunk-T4QXKU5Y.js";import"./chunk-HYUTDZ3N.js";import"./chunk-RFQD6B44.js";import{a as Z}from"./chunk-AZ7BL5FL.js";import"./chunk-FPW3RFZR.js";import"./chunk-IPH4LGK2.js";import"./chunk-XRKFTPHD.js";import{a as D,d as X,i as J,j as Y}from"./chunk-6XSSM4WT.js";import"./chunk-KHDCMVEJ.js";import"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{a as j}from"./chunk-REGKOCDO.js";import{c as $,d as z}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as A,f as H}from"./chunk-3M53YXEI.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import{M as L}from"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import{A as s}from"./chunk-X2J2P5ZT.js";import{a as p}from"./chunk-FTQLQJQV.js";import{createHash as ne}from"node:crypto";var ee=new Set(["Error","TypeError","SyntaxError","AbortError","TimeoutError","SocketError","HeadersTimeoutError","BodyTimeoutError","ConnectTimeoutError"]),te=new Set(["UND_ERR_SOCKET","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT","UND_ERR_ABORTED","UND_ERR_DESTROYED","UND_ERR_CLOSED","UND_ERR_RESPONSE_STATUS_CODE","ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","ENOTFOUND","EAI_AGAIN","ABORT_ERR"]);function K(n){let o=[],e=new Set,a=n;for(;a&&typeof a=="object"&&o.length<3&&!e.has(a);){e.add(a);let d=a;o.push({name:typeof d.name=="string"&&ee.has(d.name)?d.name:"unrecognized",code:d.code===void 0?null:typeof d.code=="string"&&te.has(d.code)?d.code:"unrecognized"}),a=d.cause}return o}p(K,"boundedTransportError");function V(){let n=null,o=null,e=null,a=null,d=null,M=null,l=0,y=0,m=0,S=0,c=0,i=0,E=null;return{observe:p(t=>{t.type==="request"&&(n=performance.now()-t.elapsedMs),t.type==="headers"&&(o=t),t.type==="bytes"&&(l=Math.max(l,t.elapsedMs-(a??o?.elapsedMs??0)),e??=t.elapsedMs,a=t.elapsedMs,y=Math.min(Number.MAX_SAFE_INTEGER,y+t.byteLength),m=Math.min(Number.MAX_SAFE_INTEGER,m+1)),t.type==="data"&&(S=Math.min(Number.MAX_SAFE_INTEGER,S+1),d=t.elapsedMs,t.errorFrame&&(i=Math.min(Number.MAX_SAFE_INTEGER,i+1))),t.type==="comment"&&(c=Math.min(Number.MAX_SAFE_INTEGER,c+1),M=t.elapsedMs),t.type==="done"&&(E=t.elapsedMs)},"observe"),snapshot:p(()=>{let t=n===null?null:Math.round(performance.now()-n);return{phase:n===null?"not_started":o?E!==null?"done":i>0?"error_frame":"response_body":"before_headers",elapsedMs:t,response:o===null?null:{status:o.status,headersAtMs:o.elapsedMs,eventStream:o.eventStream,noCache:o.noCache,noTransform:o.noTransform,bufferingDisabled:o.bufferingDisabled},bytes:y,readChunks:m,dataFrames:S,commentFrames:c,errorFrames:i,firstByteAtMs:e,lastByteAtMs:a,lastDataAtMs:d,lastCommentAtMs:M,doneAtMs:E,maxByteGapMs:l,silentForMs:t===null||o===null?null:Math.max(0,t-(a??o.elapsedMs))}},"snapshot")}}p(V,"createStreamDiagnostics");var O=s.coerce.number().int().positive().safe(),oe=s.object({model:s.string().trim().min(1).max(512),message:s.string().trim().min(1).max(131072),teamId:s.string().regex(/^[A-Za-z0-9_-]{3,191}$/),requestId:s.string().regex(/^[A-Za-z0-9._:-]{1,200}$/),maxOutputTokens:O,timeoutSec:O.max(600),maxSpend:s.coerce.number().finite().positive()}),q=s.number().finite().nonnegative(),re=s.object({id:s.string(),context_window:O,output_limit:O,metadata:s.object({billing:s.object({pricing:s.object({version:s.string().trim().min(1),source:s.string().trim().min(1),effectiveAt:s.string().refine(n=>Number.isFinite(Date.parse(n))),inputUsdPerMillionTokens:q,cachedInputUsdPerMillionTokens:q,outputUsdPerMillionTokens:q}).passthrough()})})});async function ge(n,o={}){let e=oe.parse({...n,message:A(n,"message")||A(n,"prompt")}),a=H(n.stream),d=n.effort===void 0?void 0:L.parse(n.effort),M=o.emit??(u=>console.log(JSON.stringify(u,null,2))),l=new AbortController,y=new Date().toISOString(),m=!1,S=null,c=null,i=null,E="",_=null,C=null,t=V(),x=null,B=p(u=>l.abort(new Error(`OpChat cancelled by ${u}.`)),"abort"),P=p(()=>B("SIGINT"),"interrupt"),v=p(()=>B("SIGTERM"),"terminate"),W=setTimeout(()=>l.abort(new DOMException("OpChat deadline reached.","TimeoutError")),e.timeoutSec*1e3);process.once("SIGINT",P),process.once("SIGTERM",v);let F=p((u,r)=>{let b=u==="completed"&&i&&i.estimated!==!0&&[i.prompt_tokens??i.input_tokens,i.completion_tokens??i.output_tokens].every(w=>typeof w=="number"&&Number.isSafeInteger(w)&&w>=0);return{schemaVersion:"openpond.boundedOpChatReceipt.v1",status:u,requestId:e.requestId,model:e.model,teamId:e.teamId,automaticRetry:!1,transport:a?"sse":"json",...a?{streamDiagnostics:t.snapshot()}:{},...x?{errorCauses:x}:{},startedAt:y,completedAt:new Date().toISOString(),apiOrigin:C,maxOutputTokens:e.maxOutputTokens,timeoutSec:e.timeoutSec,maximumSpendUsd:e.maxSpend,quote:S,dispatchAttempted:m,completion:c,usage:i,text:E,finishReason:_,accounting:{state:m?b?"usage_recorded":"unknown":"not_dispatched",chargedUsd:m?null:0,requiresLedgerReconciliation:m,cleanupConfirmed:!m},...r?{error:r}:{}}},"receipt");try{let u=await(o.account??j)(A(n,"account"));if(!u.token)throw new Error("Sign in to an OpenPond account before using OpChat.");let r=new URL(D({opChatApiBaseUrl:u.chatApiBaseUrl,env:{}})),b=[A(n,"opchatApiBaseUrl"),A(n,"opchatApiUrl"),z(n),$(n)].filter(g=>!!g);for(let g of b){let f=new URL(g);if(f.origin!==r.origin||f.username||f.password||f.search||f.hash)throw new Error("The OpChat API URL must match the signed-in account's chat origin.")}if(r.username||r.password||r.search||r.hash)throw new Error("The signed-in account has an invalid OpChat URL.");let w=D({opChatApiBaseUrl:b[0]??r.href,env:{}});C=r.origin,l.signal.throwIfAborted();let U=await X({apiBaseUrl:w,token:u.token,teamId:e.teamId,model:e.model,signal:AbortSignal.any([l.signal,AbortSignal.timeout(3e4)])}),Q=new Date().toISOString(),R=re.parse(U);if(R.id!==e.model)throw new Error("The catalog returned a different model identity.");if(e.maxOutputTokens>R.output_limit)throw new Error("The requested output limit exceeds the model's current limit.");let I=R.metadata.billing.pricing,N=Math.ceil(R.context_window*Math.max(I.inputUsdPerMillionTokens,I.cachedInputUsdPerMillionTokens)+e.maxOutputTokens*I.outputUsdPerMillionTokens);if(!Number.isSafeInteger(N)||N<=0)throw new Error("The model does not publish an enforceable positive request ceiling.");let k=N/1e6;if(S={kind:"worst_case_request_reservation",observedAt:Q,contextWindow:R.context_window,outputLimit:R.output_limit,pricing:I,maximumRequestCostUsd:k,predictedSpend:!1,catalog:U,catalogSha256:ne("sha256").update(JSON.stringify(U)).digest("hex")},k>e.maxSpend)throw new Error(`The current worst-case request reservation $${k} exceeds --max-spend $${e.maxSpend}.`);l.signal.throwIfAborted();let G={apiBaseUrl:w,token:u.token,teamId:e.teamId,model:e.model,requestId:e.requestId,reasoningEffort:d,maxTokens:e.maxOutputTokens,signal:l.signal,messages:[{role:"user",content:e.message}],...a?{onStreamDiagnostic:t.observe}:{}};if(m=!0,a){let g=null,f;for await(let h of Y(G)){l.signal.throwIfAborted();let T=h.raw&&typeof h.raw=="object"?h.raw:{};if(typeof T.id!="string"||!T.id||T.model!==e.model||T.request_id!==e.requestId||g!==null&&T.id!==g)throw new Error("The stream does not match the admitted completion, model and request identity.");if(g=T.id,typeof T.created=="number"&&(f=T.created),h.type==="text_delta"&&(E+=h.text),h.type==="usage"&&(i=h.usage),h.type==="finish"&&(_=h.finishReason),h.type==="tool_call_delta")throw new Error("The bounded OpChat request did not admit tool calls.")}if(!g||!_)throw new Error("The stream ended without a terminal completion receipt.");c={id:g,model:e.model,request_id:e.requestId,object:"chat.completion",assembledFromStream:!0,...f===void 0?{}:{created:f},choices:[{index:0,message:{role:"assistant",content:E},finish_reason:_}],...i===null?{}:{usage:i}}}else c=await J(G),i=c.usage??null,E=c.choices?.[0]?.message?.content??"",_=c.choices?.[0]?.finish_reason??null;if(!c.id||c.model!==e.model||c.request_id!==e.requestId)throw new Error("The completion does not match the admitted model and request identity.");if(l.signal.throwIfAborted(),!_)throw new Error("The response ended without a terminal completion receipt.");M(F("completed"))}catch(u){let r=l.signal.aborted?l.signal.reason:u;x=K(r);let b=r instanceof Error?r.message:String(r),w=l.signal.aborted?r instanceof Error&&r.name==="TimeoutError"?"timed_out":"cancelled":m?"failed":"rejected";throw M(F(w,b)),new Z(b)}finally{clearTimeout(W),process.removeListener("SIGINT",P),process.removeListener("SIGTERM",v)}}p(ge,"runBoundedOpChat");export{ge as runBoundedOpChat};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{m as M}from"./chunk-HYUTDZ3N.js";import"./chunk-RFQD6B44.js";import"./chunk-P7RLDDPN.js";import"./chunk-OFC5N6R3.js";import"./chunk-XRKFTPHD.js";import"./chunk-KHDCMVEJ.js";import"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{b as x}from"./chunk-REGKOCDO.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as _,f as O,h as k,i as S}from"./chunk-3M53YXEI.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createHash as j,randomBytes as L}from"node:crypto";import{createServer as B}from"node:http";function D(e){return[e.slug,`team=${e.teamId}`,`role=${e.role}`,`status=${e.status}`,e.displayName].join(" ")}i(D,"formatOrganizationLine");function H(e){return[e.email??e.userId,`user=${e.userId}`,`role=${e.role}`,e.createdAt].join(" ")}i(H,"formatOrganizationMemberLine");function W(e){return e?[e.slug,`team=${e.teamId}`,`status=${e.status}`,`tools=${e.toolset.join(",")||"-"}`,e.resourceUrl].join(" "):"no mcp server configured"}i(W,"formatOrganizationMcpServerLine");var F=["estimate.read","estimate.write","estimate.execute","artifacts.read","artifacts.write"];function b(e){let t=e.trim().replace(/\/$/,"");if(!t)throw new Error("MCP resource URL must be non-empty");return new URL(t).toString().replace(/\/$/,"")}i(b,"normalizeMcpResourceUrl");function R(e,t){let r=typeof t.resourceUrl=="string"&&t.resourceUrl.trim()?t.resourceUrl.trim():typeof t.url=="string"&&t.url.trim()?t.url.trim():"";if(r)return b(r);if(!e?.resourceUrl)throw new Error("organization does not have an MCP server; run organizations mcp-generate first");return b(e.resourceUrl)}i(R,"resolveMcpProbeResourceUrl");function v(e,t){let r=typeof t.origin=="string"&&t.origin.trim()?t.origin.trim():"";return r?b(r):new URL(e).origin}i(v,"resolveMcpProbeOrigin");function U(e=32){return L(e).toString("base64url")}i(U,"randomOauthToken");function G(e){return j("sha256").update(e).digest("base64url")}i(G,"buildMcpOauthPkceChallenge");function V(e){let t=typeof e.scope=="string"&&e.scope.trim()?e.scope:typeof e.scopes=="string"&&e.scopes.trim()?e.scopes:"";if(!t)return[...F];let r=t.split(/[,\s]+/g).map(o=>o.trim()).filter(Boolean);if(r.length===0)throw new Error("scope must include at least one OAuth scope");return r}i(V,"parseMcpOAuthScopes");function q(e){let t=typeof e.clientId=="string"&&e.clientId.trim()?e.clientId.trim():"openpond-code-mcp-proof";if(t==="true")throw new Error("client-id must be a non-empty value");return t}i(q,"resolveMcpOAuthClientId");function Y(e){let t=k(e.timeoutSeconds,"timeout-seconds")??k(e.timeout,"timeout")??180;if(t<=0)throw new Error("timeout must be greater than zero");return t*1e3}i(Y,"resolveMcpOAuthTimeoutMs");function Z(e){let t=k(e.callbackPort,"callback-port")??0;if(t<0||t>65535)throw new Error("callback-port must be between 0 and 65535");return t}i(Z,"resolveMcpOAuthCallbackPort");function E(e){return new Promise((t,r)=>{e.close(o=>{o?r(o):t()})})}i(E,"closeServer");async function K(e){let t=!1,r=null,o=null,s=null,n=new Promise((u,l)=>{o=u,s=l}),a=i((u,l,g,m,p)=>{if(t){u.writeHead(204).end();return}t=!0,u.writeHead(l,{"cache-control":"no-store","content-type":"text/html; charset=utf-8"}),u.end(g),r&&clearTimeout(r),m?o?.(m):s?.(p??new Error("oauth_callback_failed"))},"settle"),c=B((u,l)=>{let g=u.headers.host??"127.0.0.1",m=new URL(u.url??"/",`http://${g}`);if(m.pathname!=="/callback"){l.writeHead(404,{"content-type":"text/plain; charset=utf-8"}),l.end("Not found");return}let p=m.searchParams.get("state")??"",f=m.searchParams.get("error")??"",w=m.searchParams.get("code")??"";if(p!==e.expectedState){a(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>State mismatch. Return to the terminal and retry.</p>",void 0,new Error("oauth_state_mismatch"));return}if(f){a(l,400,"<!doctype html><title>OpenPond OAuth denied</title><p>Authorization was not completed. Return to the terminal.</p>",void 0,new Error(`oauth_authorization_failed:${f}`));return}if(!w){a(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>Missing authorization code. Return to the terminal and retry.</p>",void 0,new Error("oauth_code_missing"));return}a(l,200,"<!doctype html><title>OpenPond OAuth complete</title><p>Authorization complete. You can return to the terminal.</p>",{code:w,state:p})});await new Promise((u,l)=>{let g=i(p=>{c.off("listening",m),l(p)},"onError"),m=i(()=>{c.off("error",g),u()},"onListening");c.once("error",g),c.once("listening",m),c.listen(e.port,"127.0.0.1")});let d=c.address();if(!d||typeof d.port!="number")throw await E(c),new Error("oauth_callback_listener_failed");return r=setTimeout(()=>{t||(t=!0,s?.(new Error("oauth_callback_timeout")))},e.timeoutMs),{close:i(async()=>{r&&clearTimeout(r),await E(c).catch(()=>{})},"close"),redirectUri:`http://127.0.0.1:${d.port}/callback`,waitForCallback:i(()=>n,"waitForCallback")}}i(K,"startMcpOAuthCallbackListener");function Q(e){x(e)}i(Q,"openUrlWithSystemBrowser");function X(e){let t=new URL(e.authorizationEndpoint);return t.searchParams.set("response_type","code"),t.searchParams.set("client_id",e.clientId),t.searchParams.set("redirect_uri",e.redirectUri),t.searchParams.set("code_challenge",e.codeChallenge),t.searchParams.set("code_challenge_method","S256"),t.searchParams.set("resource",e.resourceUrl),t.searchParams.set("scope",e.scopes.join(" ")),t.searchParams.set("state",e.state),t.toString()}i(X,"buildMcpOAuthAuthorizeUrl");async function ee(e){let t=new URLSearchParams;t.set("grant_type","authorization_code"),t.set("client_id",e.clientId),t.set("redirect_uri",e.redirectUri),t.set("code",e.code),t.set("code_verifier",e.codeVerifier);let r=await fetch(`${e.origin}/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:t}),o=await N(r);if(!r.ok)throw new Error(`oauth_token_exchange_failed:${r.status}:${JSON.stringify(o)}`);if(!o||typeof o!="object"||Array.isArray(o))throw new Error("oauth_token_exchange_invalid_response");let s=o;if(typeof s.access_token!="string"||!s.access_token.trim())throw new Error("oauth_token_exchange_missing_access_token");return{access_token:s.access_token,...typeof s.expires_in=="number"?{expires_in:s.expires_in}:{},...typeof s.refresh_token=="string"?{refresh_token:s.refresh_token}:{},...typeof s.scope=="string"?{scope:s.scope}:{},...typeof s.token_type=="string"?{token_type:s.token_type}:{}}}i(ee,"exchangeMcpOAuthAuthorizationCode");async function N(e){let t=await e.text().catch(()=>"");if(!t)return null;let r=t.trim();if((e.headers.get("content-type")??"").toLowerCase().includes("application/json")||r.startsWith("{")||r.startsWith("["))try{return JSON.parse(r)}catch{return t}return t}i(N,"readMcpProbeBody");async function P(e,t={}){let r=await fetch(e,t);return{url:e,status:r.status,ok:r.ok,headers:{contentType:r.headers.get("content-type"),location:r.headers.get("location"),wwwAuthenticate:r.headers.get("www-authenticate")},body:await N(r)}}i(P,"fetchMcpProbe");function te(e,t,r){return r?{jsonrpc:"2.0",id:e,method:t,params:r}:{jsonrpc:"2.0",id:e,method:t}}i(te,"buildMcpJsonRpcRequest");function T(e){let t=typeof e.arguments=="string"&&e.arguments.trim()?e.arguments:typeof e.args=="string"&&e.args.trim()?e.args:"";if(!t)return{};let r=_(t,"arguments");if(!r||typeof r!="object"||Array.isArray(r))throw new Error("arguments must be a JSON object");return r}i(T,"parseMcpToolArguments");async function z(e){let t={"content-type":"application/json"};return e.accessToken&&(t.authorization=`Bearer ${e.accessToken}`),P(e.resourceUrl,{method:"POST",headers:t,body:JSON.stringify(te(e.id,e.method,e.params))})}i(z,"postMcpJsonRpcProbe");async function A(e){let t=b(e.resourceUrl),r=b(e.origin),o=`${t}/.well-known/oauth-protected-resource`,s=`${r}/.well-known/oauth-authorization-server`,[n,a,c,d,u,l,g]=await Promise.all([P(o),P(s),P(t),z({resourceUrl:t,id:1,method:"initialize"}),z({resourceUrl:t,id:2,method:"tools/list"}),z({resourceUrl:t,id:3,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments}}),e.accessToken?z({resourceUrl:t,id:4,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments},accessToken:e.accessToken}):Promise.resolve(null)]);return{resourceUrl:t,origin:r,protectedResource:n,authorizationServer:a,directGetChallenge:c,initialize:d,toolsList:u,unauthenticatedToolCall:l,...g?{authenticatedToolCall:g}:{}}}i(A,"probeOrganizationMcp");function re(e){let t=typeof e=="string"?e.trim():"";if(t==="owner"||t==="admin"||t==="member")return t;throw new Error("role must be owner, admin, or member")}i(re,"parseOrganizationRole");function ne(e){let t=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(!t)throw new Error("usage: organizations create --name <name> [--slug <slug>]");return{displayName:t,...typeof e.slug=="string"&&e.slug.trim()?{slug:e.slug.trim()}:{},...typeof e.primaryContactEmail=="string"&&e.primaryContactEmail.trim()?{primaryContactEmail:e.primaryContactEmail.trim()}:{},...typeof e.customDomain=="string"&&e.customDomain.trim()?{customDomain:e.customDomain.trim()}:{}}}i(ne,"buildOrganizationCreateInput");function oe(e){let t={},r=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(r&&(t.displayName=r),typeof e.slug=="string"&&e.slug.trim()&&(t.slug=e.slug.trim()),typeof e.primaryContactEmail=="string"&&(t.primaryContactEmail=e.primaryContactEmail.trim()||null),typeof e.customDomain=="string"&&(t.customDomain=e.customDomain.trim()||null),typeof e.status=="string"&&e.status.trim()){let o=e.status.trim();if(o!=="active"&&o!=="disabled"&&o!=="archived")throw new Error("status must be active, disabled, or archived");t.status=o}if(Object.keys(t).length===0)throw new Error("organizations update requires at least one changed field");return t}i(oe,"buildOrganizationUpdateInput");function ie(e){let t=typeof e.email=="string"?e.email.trim():"";if(!t)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");return{email:t,role:re(e.role)}}i(ie,"buildOrganizationMemberInput");function ae(e){return{...typeof e.origin=="string"&&e.origin.trim()?{origin:e.origin.trim()}:{},...typeof e.toolset=="string"&&e.toolset.trim()?{toolset:S(e.toolset)}:{}}}i(ae,"buildOrganizationMcpGenerateInput");async function ge(e,t){let r=t[0]||"list",o=await M(e),s=O(e.json);if(r==="list"){let n=await o.listOrganizations();if(s){console.log(JSON.stringify({organizations:n},null,2));return}if(n.length===0){console.log("no organizations found");return}for(let a of n)console.log(D(a));return}if(r==="create"){let n=await o.createOrganization(ne(e));console.log(JSON.stringify({organization:n},null,2));return}if(r==="get"){let n=t[1];if(!n)throw new Error("usage: organizations get <slug>");let a=await o.getOrganization(n);console.log(JSON.stringify({organization:a},null,2));return}if(r==="update"){let n=t[1];if(!n)throw new Error("usage: organizations update <slug> [--name <name>]");let a=await o.updateOrganization(n,oe(e));console.log(JSON.stringify({organization:a},null,2));return}if(r==="members"||r==="member-list"){let n=t[1];if(!n)throw new Error("usage: organizations members <slug>");let a=await o.listOrganizationMembers(n);if(s){console.log(JSON.stringify({members:a},null,2));return}if(a.length===0){console.log("no organization members found");return}for(let c of a)console.log(H(c));return}if(r==="member-upsert"||r==="member-add"){let n=t[1];if(!n)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");let a=await o.upsertOrganizationMember(n,ie(e));console.log(JSON.stringify({member:a},null,2));return}if(r==="mcp-get"||r==="mcp-server"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-get <slug>");let a=await o.getOrganizationMcpServer(n);if(s){console.log(JSON.stringify({mcpServer:a},null,2));return}console.log(W(a));return}if(r==="mcp-generate"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-generate <slug> [--origin <url>]");let a=await o.generateOrganizationMcpServer(n,ae(e));console.log(JSON.stringify({mcpServer:a},null,2));return}if(r==="mcp-probe"||r==="mcp-inspect"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-probe <slug> [--origin <url>] [--tool <name>] [--arguments <json>] [--access-token <token>]");let a=await o.getOrganizationMcpServer(n),c=R(a,e),d=v(c,e),u=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",l=T(e),g=typeof e.accessToken=="string"&&e.accessToken.trim()?e.accessToken.trim():"",m=await A({resourceUrl:c,origin:d,toolName:u,toolArguments:l,...g?{accessToken:g}:{}});console.log(JSON.stringify({mcpServer:a,probe:m},null,2));return}if(r==="mcp-authorize"||r==="mcp-oauth"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-authorize <slug> [--origin <url>] [--scope <csv|space>] [--tool <name>] [--arguments <json>] [--open]");let a=await o.getOrganizationMcpServer(n),c=R(a,e),d=v(c,e),u=q(e),l=V(e),g=U(18),m=U(48),p=G(m),f=await K({expectedState:g,port:Z(e),timeoutMs:Y(e)}),w=X({authorizationEndpoint:`${d}/oauth/authorize`,clientId:u,codeChallenge:p,redirectUri:f.redirectUri,resourceUrl:c,scopes:l,state:g});if(console.error("Open this URL to authorize the organization MCP connection:"),console.error(w),console.error(`Waiting for OAuth callback on ${f.redirectUri}`),O(e.open))try{Q(w)}catch(y){console.error(`Unable to open a browser automatically: ${y instanceof Error?y.message:String(y)}`)}try{let y=await f.waitForCallback(),h=await ee({clientId:u,code:y.code,codeVerifier:m,origin:d,redirectUri:f.redirectUri}),C=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",I=T(e),$=await A({accessToken:h.access_token,origin:d,resourceUrl:c,toolArguments:I,toolName:C}),J=O(e.printToken);console.log(JSON.stringify({mcpServer:a,oauth:{accessTokenReceived:!0,clientId:u,expiresIn:h.expires_in??null,refreshTokenReceived:!!h.refresh_token,scope:h.scope??l.join(" "),tokenType:h.token_type??"Bearer",...J?{accessToken:h.access_token,refreshToken:h.refresh_token??null}:{}},probe:$},null,2))}finally{await f.close()}return}if(r==="mcp-rotate"||r==="mcp-disable"||r==="mcp-enable"){let n=t[1];if(!n)throw new Error(`usage: organizations ${r} <slug>`);let a=r==="mcp-rotate"?await o.rotateOrganizationMcpServer(n):r==="mcp-disable"?await o.disableOrganizationMcpServer(n):await o.enableOrganizationMcpServer(n);console.log(JSON.stringify({mcpServer:a},null,2));return}throw new Error("usage: organizations <list|create|get|update|members|member-upsert|mcp-get|mcp-generate|mcp-probe|mcp-authorize|mcp-rotate|mcp-disable|mcp-enable> [args]")}i(ge,"runOrganizationsCommand");export{F as DEFAULT_MCP_AUTHORIZE_SCOPES,te as buildMcpJsonRpcRequest,X as buildMcpOAuthAuthorizeUrl,G as buildMcpOauthPkceChallenge,ne as buildOrganizationCreateInput,ae as buildOrganizationMcpGenerateInput,ie as buildOrganizationMemberInput,oe as buildOrganizationUpdateInput,E as closeServer,ee as exchangeMcpOAuthAuthorizationCode,P as fetchMcpProbe,D as formatOrganizationLine,W as formatOrganizationMcpServerLine,H as formatOrganizationMemberLine,b as normalizeMcpResourceUrl,Q as openUrlWithSystemBrowser,V as parseMcpOAuthScopes,T as parseMcpToolArguments,re as parseOrganizationRole,z as postMcpJsonRpcProbe,A as probeOrganizationMcp,U as randomOauthToken,N as readMcpProbeBody,Z as resolveMcpOAuthCallbackPort,q as resolveMcpOAuthClientId,Y as resolveMcpOAuthTimeoutMs,v as resolveMcpProbeOrigin,R as resolveMcpProbeResourceUrl,ge as runOrganizationsCommand,K as startMcpOAuthCallbackListener};
|
|
2
|
+
import{m as M}from"./chunk-HYUTDZ3N.js";import"./chunk-RFQD6B44.js";import"./chunk-FPW3RFZR.js";import"./chunk-IPH4LGK2.js";import"./chunk-XRKFTPHD.js";import"./chunk-KHDCMVEJ.js";import"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{b as x}from"./chunk-REGKOCDO.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as _,f as O,h as k,i as S}from"./chunk-3M53YXEI.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createHash as j,randomBytes as L}from"node:crypto";import{createServer as B}from"node:http";function D(e){return[e.slug,`team=${e.teamId}`,`role=${e.role}`,`status=${e.status}`,e.displayName].join(" ")}i(D,"formatOrganizationLine");function H(e){return[e.email??e.userId,`user=${e.userId}`,`role=${e.role}`,e.createdAt].join(" ")}i(H,"formatOrganizationMemberLine");function W(e){return e?[e.slug,`team=${e.teamId}`,`status=${e.status}`,`tools=${e.toolset.join(",")||"-"}`,e.resourceUrl].join(" "):"no mcp server configured"}i(W,"formatOrganizationMcpServerLine");var F=["estimate.read","estimate.write","estimate.execute","artifacts.read","artifacts.write"];function b(e){let t=e.trim().replace(/\/$/,"");if(!t)throw new Error("MCP resource URL must be non-empty");return new URL(t).toString().replace(/\/$/,"")}i(b,"normalizeMcpResourceUrl");function R(e,t){let r=typeof t.resourceUrl=="string"&&t.resourceUrl.trim()?t.resourceUrl.trim():typeof t.url=="string"&&t.url.trim()?t.url.trim():"";if(r)return b(r);if(!e?.resourceUrl)throw new Error("organization does not have an MCP server; run organizations mcp-generate first");return b(e.resourceUrl)}i(R,"resolveMcpProbeResourceUrl");function v(e,t){let r=typeof t.origin=="string"&&t.origin.trim()?t.origin.trim():"";return r?b(r):new URL(e).origin}i(v,"resolveMcpProbeOrigin");function U(e=32){return L(e).toString("base64url")}i(U,"randomOauthToken");function G(e){return j("sha256").update(e).digest("base64url")}i(G,"buildMcpOauthPkceChallenge");function V(e){let t=typeof e.scope=="string"&&e.scope.trim()?e.scope:typeof e.scopes=="string"&&e.scopes.trim()?e.scopes:"";if(!t)return[...F];let r=t.split(/[,\s]+/g).map(o=>o.trim()).filter(Boolean);if(r.length===0)throw new Error("scope must include at least one OAuth scope");return r}i(V,"parseMcpOAuthScopes");function q(e){let t=typeof e.clientId=="string"&&e.clientId.trim()?e.clientId.trim():"openpond-code-mcp-proof";if(t==="true")throw new Error("client-id must be a non-empty value");return t}i(q,"resolveMcpOAuthClientId");function Y(e){let t=k(e.timeoutSeconds,"timeout-seconds")??k(e.timeout,"timeout")??180;if(t<=0)throw new Error("timeout must be greater than zero");return t*1e3}i(Y,"resolveMcpOAuthTimeoutMs");function Z(e){let t=k(e.callbackPort,"callback-port")??0;if(t<0||t>65535)throw new Error("callback-port must be between 0 and 65535");return t}i(Z,"resolveMcpOAuthCallbackPort");function E(e){return new Promise((t,r)=>{e.close(o=>{o?r(o):t()})})}i(E,"closeServer");async function K(e){let t=!1,r=null,o=null,s=null,n=new Promise((u,l)=>{o=u,s=l}),a=i((u,l,g,m,p)=>{if(t){u.writeHead(204).end();return}t=!0,u.writeHead(l,{"cache-control":"no-store","content-type":"text/html; charset=utf-8"}),u.end(g),r&&clearTimeout(r),m?o?.(m):s?.(p??new Error("oauth_callback_failed"))},"settle"),c=B((u,l)=>{let g=u.headers.host??"127.0.0.1",m=new URL(u.url??"/",`http://${g}`);if(m.pathname!=="/callback"){l.writeHead(404,{"content-type":"text/plain; charset=utf-8"}),l.end("Not found");return}let p=m.searchParams.get("state")??"",f=m.searchParams.get("error")??"",w=m.searchParams.get("code")??"";if(p!==e.expectedState){a(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>State mismatch. Return to the terminal and retry.</p>",void 0,new Error("oauth_state_mismatch"));return}if(f){a(l,400,"<!doctype html><title>OpenPond OAuth denied</title><p>Authorization was not completed. Return to the terminal.</p>",void 0,new Error(`oauth_authorization_failed:${f}`));return}if(!w){a(l,400,"<!doctype html><title>OpenPond OAuth failed</title><p>Missing authorization code. Return to the terminal and retry.</p>",void 0,new Error("oauth_code_missing"));return}a(l,200,"<!doctype html><title>OpenPond OAuth complete</title><p>Authorization complete. You can return to the terminal.</p>",{code:w,state:p})});await new Promise((u,l)=>{let g=i(p=>{c.off("listening",m),l(p)},"onError"),m=i(()=>{c.off("error",g),u()},"onListening");c.once("error",g),c.once("listening",m),c.listen(e.port,"127.0.0.1")});let d=c.address();if(!d||typeof d.port!="number")throw await E(c),new Error("oauth_callback_listener_failed");return r=setTimeout(()=>{t||(t=!0,s?.(new Error("oauth_callback_timeout")))},e.timeoutMs),{close:i(async()=>{r&&clearTimeout(r),await E(c).catch(()=>{})},"close"),redirectUri:`http://127.0.0.1:${d.port}/callback`,waitForCallback:i(()=>n,"waitForCallback")}}i(K,"startMcpOAuthCallbackListener");function Q(e){x(e)}i(Q,"openUrlWithSystemBrowser");function X(e){let t=new URL(e.authorizationEndpoint);return t.searchParams.set("response_type","code"),t.searchParams.set("client_id",e.clientId),t.searchParams.set("redirect_uri",e.redirectUri),t.searchParams.set("code_challenge",e.codeChallenge),t.searchParams.set("code_challenge_method","S256"),t.searchParams.set("resource",e.resourceUrl),t.searchParams.set("scope",e.scopes.join(" ")),t.searchParams.set("state",e.state),t.toString()}i(X,"buildMcpOAuthAuthorizeUrl");async function ee(e){let t=new URLSearchParams;t.set("grant_type","authorization_code"),t.set("client_id",e.clientId),t.set("redirect_uri",e.redirectUri),t.set("code",e.code),t.set("code_verifier",e.codeVerifier);let r=await fetch(`${e.origin}/oauth/token`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:t}),o=await N(r);if(!r.ok)throw new Error(`oauth_token_exchange_failed:${r.status}:${JSON.stringify(o)}`);if(!o||typeof o!="object"||Array.isArray(o))throw new Error("oauth_token_exchange_invalid_response");let s=o;if(typeof s.access_token!="string"||!s.access_token.trim())throw new Error("oauth_token_exchange_missing_access_token");return{access_token:s.access_token,...typeof s.expires_in=="number"?{expires_in:s.expires_in}:{},...typeof s.refresh_token=="string"?{refresh_token:s.refresh_token}:{},...typeof s.scope=="string"?{scope:s.scope}:{},...typeof s.token_type=="string"?{token_type:s.token_type}:{}}}i(ee,"exchangeMcpOAuthAuthorizationCode");async function N(e){let t=await e.text().catch(()=>"");if(!t)return null;let r=t.trim();if((e.headers.get("content-type")??"").toLowerCase().includes("application/json")||r.startsWith("{")||r.startsWith("["))try{return JSON.parse(r)}catch{return t}return t}i(N,"readMcpProbeBody");async function P(e,t={}){let r=await fetch(e,t);return{url:e,status:r.status,ok:r.ok,headers:{contentType:r.headers.get("content-type"),location:r.headers.get("location"),wwwAuthenticate:r.headers.get("www-authenticate")},body:await N(r)}}i(P,"fetchMcpProbe");function te(e,t,r){return r?{jsonrpc:"2.0",id:e,method:t,params:r}:{jsonrpc:"2.0",id:e,method:t}}i(te,"buildMcpJsonRpcRequest");function T(e){let t=typeof e.arguments=="string"&&e.arguments.trim()?e.arguments:typeof e.args=="string"&&e.args.trim()?e.args:"";if(!t)return{};let r=_(t,"arguments");if(!r||typeof r!="object"||Array.isArray(r))throw new Error("arguments must be a JSON object");return r}i(T,"parseMcpToolArguments");async function z(e){let t={"content-type":"application/json"};return e.accessToken&&(t.authorization=`Bearer ${e.accessToken}`),P(e.resourceUrl,{method:"POST",headers:t,body:JSON.stringify(te(e.id,e.method,e.params))})}i(z,"postMcpJsonRpcProbe");async function A(e){let t=b(e.resourceUrl),r=b(e.origin),o=`${t}/.well-known/oauth-protected-resource`,s=`${r}/.well-known/oauth-authorization-server`,[n,a,c,d,u,l,g]=await Promise.all([P(o),P(s),P(t),z({resourceUrl:t,id:1,method:"initialize"}),z({resourceUrl:t,id:2,method:"tools/list"}),z({resourceUrl:t,id:3,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments}}),e.accessToken?z({resourceUrl:t,id:4,method:"tools/call",params:{name:e.toolName,arguments:e.toolArguments},accessToken:e.accessToken}):Promise.resolve(null)]);return{resourceUrl:t,origin:r,protectedResource:n,authorizationServer:a,directGetChallenge:c,initialize:d,toolsList:u,unauthenticatedToolCall:l,...g?{authenticatedToolCall:g}:{}}}i(A,"probeOrganizationMcp");function re(e){let t=typeof e=="string"?e.trim():"";if(t==="owner"||t==="admin"||t==="member")return t;throw new Error("role must be owner, admin, or member")}i(re,"parseOrganizationRole");function ne(e){let t=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(!t)throw new Error("usage: organizations create --name <name> [--slug <slug>]");return{displayName:t,...typeof e.slug=="string"&&e.slug.trim()?{slug:e.slug.trim()}:{},...typeof e.primaryContactEmail=="string"&&e.primaryContactEmail.trim()?{primaryContactEmail:e.primaryContactEmail.trim()}:{},...typeof e.customDomain=="string"&&e.customDomain.trim()?{customDomain:e.customDomain.trim()}:{}}}i(ne,"buildOrganizationCreateInput");function oe(e){let t={},r=typeof e.displayName=="string"&&e.displayName.trim()?e.displayName.trim():typeof e.name=="string"&&e.name.trim()?e.name.trim():"";if(r&&(t.displayName=r),typeof e.slug=="string"&&e.slug.trim()&&(t.slug=e.slug.trim()),typeof e.primaryContactEmail=="string"&&(t.primaryContactEmail=e.primaryContactEmail.trim()||null),typeof e.customDomain=="string"&&(t.customDomain=e.customDomain.trim()||null),typeof e.status=="string"&&e.status.trim()){let o=e.status.trim();if(o!=="active"&&o!=="disabled"&&o!=="archived")throw new Error("status must be active, disabled, or archived");t.status=o}if(Object.keys(t).length===0)throw new Error("organizations update requires at least one changed field");return t}i(oe,"buildOrganizationUpdateInput");function ie(e){let t=typeof e.email=="string"?e.email.trim():"";if(!t)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");return{email:t,role:re(e.role)}}i(ie,"buildOrganizationMemberInput");function ae(e){return{...typeof e.origin=="string"&&e.origin.trim()?{origin:e.origin.trim()}:{},...typeof e.toolset=="string"&&e.toolset.trim()?{toolset:S(e.toolset)}:{}}}i(ae,"buildOrganizationMcpGenerateInput");async function ge(e,t){let r=t[0]||"list",o=await M(e),s=O(e.json);if(r==="list"){let n=await o.listOrganizations();if(s){console.log(JSON.stringify({organizations:n},null,2));return}if(n.length===0){console.log("no organizations found");return}for(let a of n)console.log(D(a));return}if(r==="create"){let n=await o.createOrganization(ne(e));console.log(JSON.stringify({organization:n},null,2));return}if(r==="get"){let n=t[1];if(!n)throw new Error("usage: organizations get <slug>");let a=await o.getOrganization(n);console.log(JSON.stringify({organization:a},null,2));return}if(r==="update"){let n=t[1];if(!n)throw new Error("usage: organizations update <slug> [--name <name>]");let a=await o.updateOrganization(n,oe(e));console.log(JSON.stringify({organization:a},null,2));return}if(r==="members"||r==="member-list"){let n=t[1];if(!n)throw new Error("usage: organizations members <slug>");let a=await o.listOrganizationMembers(n);if(s){console.log(JSON.stringify({members:a},null,2));return}if(a.length===0){console.log("no organization members found");return}for(let c of a)console.log(H(c));return}if(r==="member-upsert"||r==="member-add"){let n=t[1];if(!n)throw new Error("usage: organizations member-upsert <slug> --email <email> --role <role>");let a=await o.upsertOrganizationMember(n,ie(e));console.log(JSON.stringify({member:a},null,2));return}if(r==="mcp-get"||r==="mcp-server"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-get <slug>");let a=await o.getOrganizationMcpServer(n);if(s){console.log(JSON.stringify({mcpServer:a},null,2));return}console.log(W(a));return}if(r==="mcp-generate"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-generate <slug> [--origin <url>]");let a=await o.generateOrganizationMcpServer(n,ae(e));console.log(JSON.stringify({mcpServer:a},null,2));return}if(r==="mcp-probe"||r==="mcp-inspect"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-probe <slug> [--origin <url>] [--tool <name>] [--arguments <json>] [--access-token <token>]");let a=await o.getOrganizationMcpServer(n),c=R(a,e),d=v(c,e),u=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",l=T(e),g=typeof e.accessToken=="string"&&e.accessToken.trim()?e.accessToken.trim():"",m=await A({resourceUrl:c,origin:d,toolName:u,toolArguments:l,...g?{accessToken:g}:{}});console.log(JSON.stringify({mcpServer:a,probe:m},null,2));return}if(r==="mcp-authorize"||r==="mcp-oauth"){let n=t[1];if(!n)throw new Error("usage: organizations mcp-authorize <slug> [--origin <url>] [--scope <csv|space>] [--tool <name>] [--arguments <json>] [--open]");let a=await o.getOrganizationMcpServer(n),c=R(a,e),d=v(c,e),u=q(e),l=V(e),g=U(18),m=U(48),p=G(m),f=await K({expectedState:g,port:Z(e),timeoutMs:Y(e)}),w=X({authorizationEndpoint:`${d}/oauth/authorize`,clientId:u,codeChallenge:p,redirectUri:f.redirectUri,resourceUrl:c,scopes:l,state:g});if(console.error("Open this URL to authorize the organization MCP connection:"),console.error(w),console.error(`Waiting for OAuth callback on ${f.redirectUri}`),O(e.open))try{Q(w)}catch(y){console.error(`Unable to open a browser automatically: ${y instanceof Error?y.message:String(y)}`)}try{let y=await f.waitForCallback(),h=await ee({clientId:u,code:y.code,codeVerifier:m,origin:d,redirectUri:f.redirectUri}),C=typeof e.tool=="string"&&e.tool.trim()?e.tool.trim():typeof e.toolName=="string"&&e.toolName.trim()?e.toolName.trim():"estimate_search_history",I=T(e),$=await A({accessToken:h.access_token,origin:d,resourceUrl:c,toolArguments:I,toolName:C}),J=O(e.printToken);console.log(JSON.stringify({mcpServer:a,oauth:{accessTokenReceived:!0,clientId:u,expiresIn:h.expires_in??null,refreshTokenReceived:!!h.refresh_token,scope:h.scope??l.join(" "),tokenType:h.token_type??"Bearer",...J?{accessToken:h.access_token,refreshToken:h.refresh_token??null}:{}},probe:$},null,2))}finally{await f.close()}return}if(r==="mcp-rotate"||r==="mcp-disable"||r==="mcp-enable"){let n=t[1];if(!n)throw new Error(`usage: organizations ${r} <slug>`);let a=r==="mcp-rotate"?await o.rotateOrganizationMcpServer(n):r==="mcp-disable"?await o.disableOrganizationMcpServer(n):await o.enableOrganizationMcpServer(n);console.log(JSON.stringify({mcpServer:a},null,2));return}throw new Error("usage: organizations <list|create|get|update|members|member-upsert|mcp-get|mcp-generate|mcp-probe|mcp-authorize|mcp-rotate|mcp-disable|mcp-enable> [args]")}i(ge,"runOrganizationsCommand");export{F as DEFAULT_MCP_AUTHORIZE_SCOPES,te as buildMcpJsonRpcRequest,X as buildMcpOAuthAuthorizeUrl,G as buildMcpOauthPkceChallenge,ne as buildOrganizationCreateInput,ae as buildOrganizationMcpGenerateInput,ie as buildOrganizationMemberInput,oe as buildOrganizationUpdateInput,E as closeServer,ee as exchangeMcpOAuthAuthorizationCode,P as fetchMcpProbe,D as formatOrganizationLine,W as formatOrganizationMcpServerLine,H as formatOrganizationMemberLine,b as normalizeMcpResourceUrl,Q as openUrlWithSystemBrowser,V as parseMcpOAuthScopes,T as parseMcpToolArguments,re as parseOrganizationRole,z as postMcpJsonRpcProbe,A as probeOrganizationMcp,U as randomOauthToken,N as readMcpProbeBody,Z as resolveMcpOAuthCallbackPort,q as resolveMcpOAuthClientId,Y as resolveMcpOAuthTimeoutMs,v as resolveMcpProbeOrigin,R as resolveMcpProbeResourceUrl,ge as runOrganizationsCommand,K as startMcpOAuthCallbackListener};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{i as Ie,j as K,k as W,r as $e,s as Re}from"./chunk-UZNRH6I3.js";import{m as G}from"./chunk-HYUTDZ3N.js";import"./chunk-RFQD6B44.js";import"./chunk-P7RLDDPN.js";import"./chunk-OFC5N6R3.js";import"./chunk-XRKFTPHD.js";import{e as le}from"./chunk-LZPCA6DH.js";import{a as ae}from"./chunk-L3KS6MOV.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{ja as fe}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-X37KMV27.js";import{G as Pe,I as ke,J as ye,K as R,e as Q,f as he,g as X,h as ge,i as me,j as pe,q as ee,s as Se,t as we,x}from"./chunk-NRYC4NH6.js";import"./chunk-EXYSD45J.js";import"./chunk-KHDCMVEJ.js";import"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{c as ie,sa as ce,ta as de,wa as ue}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-G7X73SBG.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as f,d as B,f as S}from"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{readFile as qe}from"node:fs/promises";import L from"node:path";import{promises as A}from"node:fs";import b from"node:path";async function oe(e,t){let o=b.join(e,t),n=await A.lstat(o).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!n)return[];if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`Profile source directory is not a regular directory: ${t}`);let a=[];for(let l of await A.readdir(o,{withFileTypes:!0})){let h=b.join(o,l.name),d=b.relative(e,h).split(b.sep).join("/");if(l.isSymbolicLink())throw new Error(`Profile source contains a symlink: ${d}`);if(l.isDirectory())a.push(...await oe(e,d));else if(l.isFile())a.push(d);else throw new Error(`Profile source contains a non-regular file: ${d}`)}return a.sort()}i(oe,"sourceFiles");async function Ce(e,t=new Set){let{skills:o,skillCatalog:n}=await ae(e);if(n.error)throw new Error(`Profile Skills: ${n.error}`);for(let s of o)if(s.validationStatus!=="valid")throw new Error(`Profile Skill ${s.name}: ${s.validationMessages.join(" ")}`);let a=new Set(o.map(s=>s.path)),l=[...await oe(e,"workflows"),...await oe(e,"evals")].sort(),h=l.filter(s=>s.startsWith("workflows/")),d=h.some(s=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(s)),u=h.includes("workflows/catalog.json");if(d&&u)throw new Error("Workflow packages and legacy workflows/catalog.json cannot coexist.");let y=d?le({files:new Map(await Promise.all(h.map(async s=>[s,await A.readFile(b.join(e,s),"utf8")]))),skillPaths:a,actionIds:t}).catalog:u?ie({catalog:JSON.parse(await A.readFile(b.join(e,"workflows/catalog.json"),"utf8")),sourcePaths:a,actionIds:t}):{workflows:[]},$=new Set(y.workflows.map(s=>s.id)),C=l.filter(s=>/^workflows\/[^/]+\/evals\/[^/]+\.json$/.test(s)||/^evals\/definitions\/[^/]+\.json$/.test(s)),w=l.filter(s=>/^evals\/suites\/[^/]+\.json$/.test(s));if(l.includes("evals/catalog.json")&&(C.length||w.length))throw new Error("Evaluation packages and legacy evals/catalog.json cannot coexist.");let j=await Promise.all(C.map(async s=>{let r=ce.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))),m=/^workflows\/([^/]+)\/evals\//.exec(s)?.[1];if(m&&(r.target.kind!=="workflow"||r.target.workflowId!==m))throw new Error(`Evaluation ${r.id} must target its containing Workflow ${m}.`);return r})),N=await Promise.all(w.map(async s=>de.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))))),_=l.includes("evals/catalog.json")?JSON.parse(await A.readFile(b.join(e,"evals/catalog.json"),"utf8")):{schemaVersion:"openpond.profileEvaluations.v1",definitions:j,suites:N},P=ue({catalog:_,workflowIds:$,skillPaths:a,actionIds:t}).catalog,g=l.filter(s=>/^evals\/tasksets\/[^/]+\.json$/.test(s)),O=new Map;for(let s of g){let r=fe(JSON.parse(await A.readFile(b.join(e,s),"utf8"))).taskset;if(s!==`evals/tasksets/${r.contentHash}.json`)throw new Error(`Frozen Taskset file name differs from its content hash: ${s}.`);O.set(r.contentHash,r)}for(let s of P.definitions){let r=s.tasksetRelease.contentHash,m=`evals/tasksets/${r}.json`,H=O.get(r);if(!H)throw new Error(`Evaluation ${s.id} is missing Taskset ${m}.`);if(H.id!==s.tasksetRelease.id||H.contentHash!==r)throw new Error(`Evaluation ${s.id} references a different frozen Taskset.`);let E=new Set(H.tasks.filter(k=>k.split===s.split).map(k=>k.id));for(let k of s.taskIds)if(!E.has(k))throw new Error(`Evaluation ${s.id} references missing Taskset case ${k} in split ${s.split}.`)}return{workflows:y.workflows.length,skills:o.length,evaluations:P.definitions.length,tasksets:O.size}}i(Ce,"checkLocalProfileSource");import te from"node:path";async function Ae(e){if(!e.state.sourcePath)throw new Error("Active OpenPond profile is missing a source path.");let t=e.state.agents.find(s=>s.id===e.agentId);if(!t)throw new Error(`Profile agent not found for hosted materialization: ${e.agentId}`);if(!t.enabled)throw new Error(`Profile agent is disabled: ${e.agentId}`);let o=xe(e.state.sourcePath,t.path),n=await Ie(o),a=await K(o,n.entries),l=W(n,a.entries),h=await Me({client:e.client,teamId:e.teamId,projectId:e.projectId??null,profileProjectId:e.profileProjectId,profileName:e.profileName,agentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}),d=await e.client.projects.uploadSource(h.id,{teamId:e.teamId,entries:l.entries,branch:e.sourceRef,commitMessage:`Materialize OpenPond profile agent ${e.agentId}`}),u=await e.client.projects.sync(d.id,{teamId:e.teamId}),y=be(u)??be(d),$=je(u)??je(d)??e.sourceRef,C=`openpond-profile-agent:${e.profileProjectId}:${e.profileName}:${e.agentId}`,w=(await e.client.agents.list({teamId:e.teamId})).find(s=>s.externalId===C),j=await e.client.agents.upsert({teamId:e.teamId,projectId:u.id,name:t.name||e.agentId,slug:_e(e.profileName,e.agentId),selectedEntrypoint:Ne(e.state,e.agentId),triggerType:"manual",runtimeSource:{mode:"latest_source",...$?{sourceRef:$}:{},...y?{sourceCommitSha:y}:{}},metadata:{...w?.metadata??{},source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,profileSourcePath:t.path,localHead:e.localHead,hostedHead:e.hostedHead},externalId:C}),N=v(a.uploadMetadata),_=v(N?.commands),P=v(N?.dependencySetup),g=Ue(P?.commands),O=[I(_?.validate),I(_?.eval)].filter(s=>!!s);return{status:"uploaded",agentId:e.agentId,runtimeAgentId:j.id,projectId:u.id,sourceRoot:o,sourceRef:$,sourceCommitSha:y??null,manifestHash:u.sandboxManifestHash??null,manifestPath:u.sandboxManifestPath??null,manifestSyncedAt:u.sandboxManifestSyncedAt??null,fileCount:l.fileCount,totalBytes:l.totalBytes,generatedManifestPath:a.generatedManifestPath,synthesizedOpenPondYaml:a.synthesizedOpenPondYaml,uploadMetadataPath:a.uploadMetadataPath,setupCommands:g,validationCommands:O,materializedAt:new Date().toISOString()}}i(Ae,"materializeHostedProfileAgentSource");async function Me(e){if(e.projectId)try{return await e.client.projects.get(e.projectId,{teamId:e.teamId})}catch{}return e.client.projects.upsert({teamId:e.teamId,name:`OpenPond profile ${e.profileName} ${e.agentId}`,sourceType:"manual",externalId:`openpond-profile:${e.profileProjectId}:${e.profileName}:${e.agentId}`,description:`Materialized OpenPond profile agent ${e.agentId} for hosted Team execution.`,metadata:{source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}})}i(Me,"getOrCreateHostedSourceProject");function xe(e,t){let o=t.replace(/\\/g,"/"),n=te.resolve(e,o),a=te.relative(e,n);if(a.startsWith("..")||te.isAbsolute(a))throw new Error(`Profile agent path escapes profile source: ${t}`);return o==="agent/agent.ts"||o.endsWith("/agent.ts")?e:n}i(xe,"resolveProfileAgentSourceRoot");function Ne(e,t){let o=e.actionCatalog.find(n=>n.agentId===t&&(n.sourceActionId==="chat"||n.name==="chat"))??e.actionCatalog.find(n=>n.agentId===t);return{scope:"action",name:typeof o?.sourceActionId=="string"&&o.sourceActionId||typeof o?.name=="string"&&o.name||"chat"}}i(Ne,"hostedEntrypointForProfileAgent");function _e(e,t){return`openpond-profile-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"openpond-profile-agent"}i(_e,"hostedRuntimeAgentSlug");function be(e){let t=v(e),o=v(t?.sourceConfig),n=v(t?.metadata);return I(o?.sourceCommitSha)??I(o?.commitSha)??I(o?.remoteSha)??I(n?.projectSourceUploadCommitSha)??I(n?.sourceCommitSha)??I(t?.templateRemoteSha)}i(be,"sandboxProjectSourceCommitSha");function je(e){let t=v(e),o=v(t?.sourceConfig);return I(o?.sourceRef)??I(o?.branch)??I(t?.gitBranch)??I(t?.defaultBranch)}i(je,"sandboxProjectSourceRef");function v(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(v,"record");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}i(I,"text");function Ue(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}i(Ue,"stringArray");import{createHash as Fe,randomUUID as Le}from"node:crypto";function ve(e){let t=e.explicitKey?.trim();if(t)return t;let o=e.sourceHead?.trim()||"unknown-source",n=e.targetProjectId?.trim()||"no-target-project",a=Te(e.input).slice(0,16),l=`profile-push-run:${e.localHead}:${o}:${e.runtimeAgentId}:${n}:${a}`;return e.retry?`${l}:retry:${(e.randomId??Le)()}`:l}i(ve,"buildHostedRunIdempotencyKey");function Te(e){return Fe("sha256").update(ne(e)).digest("hex")}i(Te,"hashStableJson");function ne(e){return e===void 0?"undefined":e===null||typeof e!="object"?JSON.stringify(e)??"null":Array.isArray(e)?`[${e.map(t=>ne(t)).join(",")}]`:`{${Object.entries(e).sort(([t],[o])=>t.localeCompare(o)).map(([t,o])=>`${JSON.stringify(t)}:${ne(o)}`).join(",")}}`}i(ne,"stableJsonStringify");async function zo(e){let t=await Se({repoPath:f(e,"path")||ee(),profile:f(e,"profile")||"default",template:f(e,"template")||"blank-agent",force:S(e.force)});if(S(e.json)){console.log(JSON.stringify(t,null,2));return}console.log(`Initialized OpenPond profile ${t.activeProfile} at ${t.repoPath}`),console.log(`Profile source: ${t.sourcePath}`)}i(zo,"runOpenPondInitCommand");async function Mo(e,t){let o=t[0]??"current";if(o==="load"){let n=f(e,"path")||t[1];if(!n)throw new Error("usage: openpond profile load --path <dir> [--profile <name>]");let a=await we(n,f(e,"profile")||void 0);if(S(e.json)){console.log(JSON.stringify(a,null,2));return}console.log(`Loaded OpenPond profile ${a.activeProfile} from ${a.repoPath}`);return}if(o==="current"||o==="status"){let n=await x();if(S(e.json)){console.log(JSON.stringify(n,null,2));return}re(n);return}if(o==="diff"){let n=await x();if(S(e.json)){console.log(JSON.stringify({diff:n.diff,profile:n},null,2));return}to(n);return}if(o==="catalog"){let n=await x();if(S(e.json)){console.log(JSON.stringify({catalog:n.catalog,actions:n.actionCatalog,profile:n},null,2));return}no(n);return}if(o==="commit"){await Je(e,t.slice(1));return}if(o==="push"){await De(e);return}if(o==="check"){let n=f(e,"kind")||t[1]||"all";if(!["all","inspect","build","validate","eval"].includes(n))throw new Error("check kind must be one of inspect, build, validate, eval, all");if(n==="all"||n==="validate"){let a=await x();if(!a.sourcePath)throw new Error("No active Profile source to validate.");let l=await Ce(a.sourcePath,new Set(a.actionCatalog.map(h=>h.id)));console.log(`Profile source valid: ${l.workflows} Workflows, ${l.skills} Skills, ${l.evaluations} evaluations, ${l.tasksets} frozen Tasksets.`)}await ke(n);return}if(o==="ensure-hosted"){await He(e);return}if(o==="hosted"){let n=t[1]??"status";if(n==="ensure"){await He(e);return}if(n==="status"||n==="current"){await eo(e);return}throw new Error("usage: openpond profile hosted [status|ensure] --team-id <id> [--json]")}if(o==="agents"){if((t[1]??"list")!=="list")throw new Error("usage: openpond profile agents list [--json]");await oo(e,["list"]);return}throw new Error("usage: openpond profile <status|diff|catalog|commit|push|load|check|agents|hosted|ensure-hosted> [args]")}i(Mo,"runOpenPondProfileCommand");async function Je(e,t){let o=f(e,"message")||f(e,"commitMessage")||t.join(" ").trim()||void 0,n=await ye(o);if(S(e.json)){console.log(JSON.stringify(n,null,2));return}if(!n.committed){console.log("No profile changes to commit."),re(n.state);return}console.log("Committed OpenPond profile changes."),n.stdout.trim()&&console.log(n.stdout.trim()),re(n.state)}i(Je,"runProfileCommitCommand");async function De(e){let t=B(e,"usage: openpond profile push"),o=await x();if(o.error)throw new Error(o.error);if(!o.repoPath||!o.sourcePath||!o.manifestPath)throw new Error("No active OpenPond profile. Run `openpond init`.");if(!o.git?.isRepo)throw new Error("Active OpenPond profile source is not Git-backed. Run `openpond init` or reload a Git-backed profile.");if(!o.git.head)throw new Error("Profile source must have a committed Git head before push. Run `openpond profile commit` first.");if(o.git.dirty)throw new Error("Profile source has uncommitted changes. Run `openpond profile commit` before push.");let n=await G(e),a=S(e.ensureHosted)?await n.profile.ensureHosted({teamId:t}):await n.profile.get({teamId:t});if(!a)throw new Error("No hosted OpenPond profile repo found. Run `openpond profile ensure-hosted --team-id <id>` first, or pass `--ensure-hosted` to push.");let l=S(e.force),h=a.sourceUpload?.sourceCommitSha??null,d=o.hosted?.sourceCommitSha??null;if(d&&h!==d&&!l)throw new Error(["Hosted profile source changed since the last local push.",`Last pushed hosted head: ${d}`,`Current hosted head: ${h??"none"}`,"Inspect hosted changes before pushing, or rerun with --force to overwrite explicitly."].join(`
|
|
2
|
+
import{i as Ie,j as K,k as W,r as $e,s as Re}from"./chunk-UZNRH6I3.js";import{m as G}from"./chunk-HYUTDZ3N.js";import"./chunk-RFQD6B44.js";import"./chunk-FPW3RFZR.js";import"./chunk-IPH4LGK2.js";import"./chunk-XRKFTPHD.js";import{e as le}from"./chunk-LZPCA6DH.js";import{a as ae}from"./chunk-L3KS6MOV.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import{ja as fe}from"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-X37KMV27.js";import{G as Pe,I as ke,J as ye,K as R,e as Q,f as he,g as X,h as ge,i as me,j as pe,q as ee,s as Se,t as we,x}from"./chunk-NRYC4NH6.js";import"./chunk-EXYSD45J.js";import"./chunk-KHDCMVEJ.js";import"./chunk-K3WM4NEC.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-2QHB5P2K.js";import"./chunk-BZS2PA4O.js";import"./chunk-VSQPWLAG.js";import"./chunk-6LAGMWJE.js";import"./chunk-IV2HEX3I.js";import"./chunk-C7NQPICU.js";import"./chunk-J256AEEE.js";import"./chunk-J7X72QUY.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import{c as ie,sa as ce,ta as de,wa as ue}from"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-G7X73SBG.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as f,d as B,f as S}from"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-TBODQT4W.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as i}from"./chunk-FTQLQJQV.js";import{readFile as qe}from"node:fs/promises";import L from"node:path";import{promises as A}from"node:fs";import b from"node:path";async function oe(e,t){let o=b.join(e,t),n=await A.lstat(o).catch(l=>{if(l.code==="ENOENT")return null;throw l});if(!n)return[];if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`Profile source directory is not a regular directory: ${t}`);let a=[];for(let l of await A.readdir(o,{withFileTypes:!0})){let h=b.join(o,l.name),d=b.relative(e,h).split(b.sep).join("/");if(l.isSymbolicLink())throw new Error(`Profile source contains a symlink: ${d}`);if(l.isDirectory())a.push(...await oe(e,d));else if(l.isFile())a.push(d);else throw new Error(`Profile source contains a non-regular file: ${d}`)}return a.sort()}i(oe,"sourceFiles");async function Ce(e,t=new Set){let{skills:o,skillCatalog:n}=await ae(e);if(n.error)throw new Error(`Profile Skills: ${n.error}`);for(let s of o)if(s.validationStatus!=="valid")throw new Error(`Profile Skill ${s.name}: ${s.validationMessages.join(" ")}`);let a=new Set(o.map(s=>s.path)),l=[...await oe(e,"workflows"),...await oe(e,"evals")].sort(),h=l.filter(s=>s.startsWith("workflows/")),d=h.some(s=>/^workflows\/[^/]+\/(PROMPT\.md|ACTION\.json)$/.test(s)),u=h.includes("workflows/catalog.json");if(d&&u)throw new Error("Workflow packages and legacy workflows/catalog.json cannot coexist.");let y=d?le({files:new Map(await Promise.all(h.map(async s=>[s,await A.readFile(b.join(e,s),"utf8")]))),skillPaths:a,actionIds:t}).catalog:u?ie({catalog:JSON.parse(await A.readFile(b.join(e,"workflows/catalog.json"),"utf8")),sourcePaths:a,actionIds:t}):{workflows:[]},$=new Set(y.workflows.map(s=>s.id)),C=l.filter(s=>/^workflows\/[^/]+\/evals\/[^/]+\.json$/.test(s)||/^evals\/definitions\/[^/]+\.json$/.test(s)),w=l.filter(s=>/^evals\/suites\/[^/]+\.json$/.test(s));if(l.includes("evals/catalog.json")&&(C.length||w.length))throw new Error("Evaluation packages and legacy evals/catalog.json cannot coexist.");let j=await Promise.all(C.map(async s=>{let r=ce.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))),m=/^workflows\/([^/]+)\/evals\//.exec(s)?.[1];if(m&&(r.target.kind!=="workflow"||r.target.workflowId!==m))throw new Error(`Evaluation ${r.id} must target its containing Workflow ${m}.`);return r})),N=await Promise.all(w.map(async s=>de.parse(JSON.parse(await A.readFile(b.join(e,s),"utf8"))))),_=l.includes("evals/catalog.json")?JSON.parse(await A.readFile(b.join(e,"evals/catalog.json"),"utf8")):{schemaVersion:"openpond.profileEvaluations.v1",definitions:j,suites:N},P=ue({catalog:_,workflowIds:$,skillPaths:a,actionIds:t}).catalog,g=l.filter(s=>/^evals\/tasksets\/[^/]+\.json$/.test(s)),O=new Map;for(let s of g){let r=fe(JSON.parse(await A.readFile(b.join(e,s),"utf8"))).taskset;if(s!==`evals/tasksets/${r.contentHash}.json`)throw new Error(`Frozen Taskset file name differs from its content hash: ${s}.`);O.set(r.contentHash,r)}for(let s of P.definitions){let r=s.tasksetRelease.contentHash,m=`evals/tasksets/${r}.json`,H=O.get(r);if(!H)throw new Error(`Evaluation ${s.id} is missing Taskset ${m}.`);if(H.id!==s.tasksetRelease.id||H.contentHash!==r)throw new Error(`Evaluation ${s.id} references a different frozen Taskset.`);let E=new Set(H.tasks.filter(k=>k.split===s.split).map(k=>k.id));for(let k of s.taskIds)if(!E.has(k))throw new Error(`Evaluation ${s.id} references missing Taskset case ${k} in split ${s.split}.`)}return{workflows:y.workflows.length,skills:o.length,evaluations:P.definitions.length,tasksets:O.size}}i(Ce,"checkLocalProfileSource");import te from"node:path";async function Ae(e){if(!e.state.sourcePath)throw new Error("Active OpenPond profile is missing a source path.");let t=e.state.agents.find(s=>s.id===e.agentId);if(!t)throw new Error(`Profile agent not found for hosted materialization: ${e.agentId}`);if(!t.enabled)throw new Error(`Profile agent is disabled: ${e.agentId}`);let o=xe(e.state.sourcePath,t.path),n=await Ie(o),a=await K(o,n.entries),l=W(n,a.entries),h=await Me({client:e.client,teamId:e.teamId,projectId:e.projectId??null,profileProjectId:e.profileProjectId,profileName:e.profileName,agentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}),d=await e.client.projects.uploadSource(h.id,{teamId:e.teamId,entries:l.entries,branch:e.sourceRef,commitMessage:`Materialize OpenPond profile agent ${e.agentId}`}),u=await e.client.projects.sync(d.id,{teamId:e.teamId}),y=be(u)??be(d),$=je(u)??je(d)??e.sourceRef,C=`openpond-profile-agent:${e.profileProjectId}:${e.profileName}:${e.agentId}`,w=(await e.client.agents.list({teamId:e.teamId})).find(s=>s.externalId===C),j=await e.client.agents.upsert({teamId:e.teamId,projectId:u.id,name:t.name||e.agentId,slug:_e(e.profileName,e.agentId),selectedEntrypoint:Ne(e.state,e.agentId),triggerType:"manual",runtimeSource:{mode:"latest_source",...$?{sourceRef:$}:{},...y?{sourceCommitSha:y}:{}},metadata:{...w?.metadata??{},source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,profileSourcePath:t.path,localHead:e.localHead,hostedHead:e.hostedHead},externalId:C}),N=v(a.uploadMetadata),_=v(N?.commands),P=v(N?.dependencySetup),g=Ue(P?.commands),O=[I(_?.validate),I(_?.eval)].filter(s=>!!s);return{status:"uploaded",agentId:e.agentId,runtimeAgentId:j.id,projectId:u.id,sourceRoot:o,sourceRef:$,sourceCommitSha:y??null,manifestHash:u.sandboxManifestHash??null,manifestPath:u.sandboxManifestPath??null,manifestSyncedAt:u.sandboxManifestSyncedAt??null,fileCount:l.fileCount,totalBytes:l.totalBytes,generatedManifestPath:a.generatedManifestPath,synthesizedOpenPondYaml:a.synthesizedOpenPondYaml,uploadMetadataPath:a.uploadMetadataPath,setupCommands:g,validationCommands:O,materializedAt:new Date().toISOString()}}i(Ae,"materializeHostedProfileAgentSource");async function Me(e){if(e.projectId)try{return await e.client.projects.get(e.projectId,{teamId:e.teamId})}catch{}return e.client.projects.upsert({teamId:e.teamId,name:`OpenPond profile ${e.profileName} ${e.agentId}`,sourceType:"manual",externalId:`openpond-profile:${e.profileProjectId}:${e.profileName}:${e.agentId}`,description:`Materialized OpenPond profile agent ${e.agentId} for hosted Team execution.`,metadata:{source:"openpond_profile_agent_materialization",profileProjectId:e.profileProjectId,profileName:e.profileName,profileAgentId:e.agentId,localHead:e.localHead,hostedHead:e.hostedHead}})}i(Me,"getOrCreateHostedSourceProject");function xe(e,t){let o=t.replace(/\\/g,"/"),n=te.resolve(e,o),a=te.relative(e,n);if(a.startsWith("..")||te.isAbsolute(a))throw new Error(`Profile agent path escapes profile source: ${t}`);return o==="agent/agent.ts"||o.endsWith("/agent.ts")?e:n}i(xe,"resolveProfileAgentSourceRoot");function Ne(e,t){let o=e.actionCatalog.find(n=>n.agentId===t&&(n.sourceActionId==="chat"||n.name==="chat"))??e.actionCatalog.find(n=>n.agentId===t);return{scope:"action",name:typeof o?.sourceActionId=="string"&&o.sourceActionId||typeof o?.name=="string"&&o.name||"chat"}}i(Ne,"hostedEntrypointForProfileAgent");function _e(e,t){return`openpond-profile-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"openpond-profile-agent"}i(_e,"hostedRuntimeAgentSlug");function be(e){let t=v(e),o=v(t?.sourceConfig),n=v(t?.metadata);return I(o?.sourceCommitSha)??I(o?.commitSha)??I(o?.remoteSha)??I(n?.projectSourceUploadCommitSha)??I(n?.sourceCommitSha)??I(t?.templateRemoteSha)}i(be,"sandboxProjectSourceCommitSha");function je(e){let t=v(e),o=v(t?.sourceConfig);return I(o?.sourceRef)??I(o?.branch)??I(t?.gitBranch)??I(t?.defaultBranch)}i(je,"sandboxProjectSourceRef");function v(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(v,"record");function I(e){return typeof e=="string"&&e.trim()?e.trim():null}i(I,"text");function Ue(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}i(Ue,"stringArray");import{createHash as Fe,randomUUID as Le}from"node:crypto";function ve(e){let t=e.explicitKey?.trim();if(t)return t;let o=e.sourceHead?.trim()||"unknown-source",n=e.targetProjectId?.trim()||"no-target-project",a=Te(e.input).slice(0,16),l=`profile-push-run:${e.localHead}:${o}:${e.runtimeAgentId}:${n}:${a}`;return e.retry?`${l}:retry:${(e.randomId??Le)()}`:l}i(ve,"buildHostedRunIdempotencyKey");function Te(e){return Fe("sha256").update(ne(e)).digest("hex")}i(Te,"hashStableJson");function ne(e){return e===void 0?"undefined":e===null||typeof e!="object"?JSON.stringify(e)??"null":Array.isArray(e)?`[${e.map(t=>ne(t)).join(",")}]`:`{${Object.entries(e).sort(([t],[o])=>t.localeCompare(o)).map(([t,o])=>`${JSON.stringify(t)}:${ne(o)}`).join(",")}}`}i(ne,"stableJsonStringify");async function zo(e){let t=await Se({repoPath:f(e,"path")||ee(),profile:f(e,"profile")||"default",template:f(e,"template")||"blank-agent",force:S(e.force)});if(S(e.json)){console.log(JSON.stringify(t,null,2));return}console.log(`Initialized OpenPond profile ${t.activeProfile} at ${t.repoPath}`),console.log(`Profile source: ${t.sourcePath}`)}i(zo,"runOpenPondInitCommand");async function Mo(e,t){let o=t[0]??"current";if(o==="load"){let n=f(e,"path")||t[1];if(!n)throw new Error("usage: openpond profile load --path <dir> [--profile <name>]");let a=await we(n,f(e,"profile")||void 0);if(S(e.json)){console.log(JSON.stringify(a,null,2));return}console.log(`Loaded OpenPond profile ${a.activeProfile} from ${a.repoPath}`);return}if(o==="current"||o==="status"){let n=await x();if(S(e.json)){console.log(JSON.stringify(n,null,2));return}re(n);return}if(o==="diff"){let n=await x();if(S(e.json)){console.log(JSON.stringify({diff:n.diff,profile:n},null,2));return}to(n);return}if(o==="catalog"){let n=await x();if(S(e.json)){console.log(JSON.stringify({catalog:n.catalog,actions:n.actionCatalog,profile:n},null,2));return}no(n);return}if(o==="commit"){await Je(e,t.slice(1));return}if(o==="push"){await De(e);return}if(o==="check"){let n=f(e,"kind")||t[1]||"all";if(!["all","inspect","build","validate","eval"].includes(n))throw new Error("check kind must be one of inspect, build, validate, eval, all");if(n==="all"||n==="validate"){let a=await x();if(!a.sourcePath)throw new Error("No active Profile source to validate.");let l=await Ce(a.sourcePath,new Set(a.actionCatalog.map(h=>h.id)));console.log(`Profile source valid: ${l.workflows} Workflows, ${l.skills} Skills, ${l.evaluations} evaluations, ${l.tasksets} frozen Tasksets.`)}await ke(n);return}if(o==="ensure-hosted"){await He(e);return}if(o==="hosted"){let n=t[1]??"status";if(n==="ensure"){await He(e);return}if(n==="status"||n==="current"){await eo(e);return}throw new Error("usage: openpond profile hosted [status|ensure] --team-id <id> [--json]")}if(o==="agents"){if((t[1]??"list")!=="list")throw new Error("usage: openpond profile agents list [--json]");await oo(e,["list"]);return}throw new Error("usage: openpond profile <status|diff|catalog|commit|push|load|check|agents|hosted|ensure-hosted> [args]")}i(Mo,"runOpenPondProfileCommand");async function Je(e,t){let o=f(e,"message")||f(e,"commitMessage")||t.join(" ").trim()||void 0,n=await ye(o);if(S(e.json)){console.log(JSON.stringify(n,null,2));return}if(!n.committed){console.log("No profile changes to commit."),re(n.state);return}console.log("Committed OpenPond profile changes."),n.stdout.trim()&&console.log(n.stdout.trim()),re(n.state)}i(Je,"runProfileCommitCommand");async function De(e){let t=B(e,"usage: openpond profile push"),o=await x();if(o.error)throw new Error(o.error);if(!o.repoPath||!o.sourcePath||!o.manifestPath)throw new Error("No active OpenPond profile. Run `openpond init`.");if(!o.git?.isRepo)throw new Error("Active OpenPond profile source is not Git-backed. Run `openpond init` or reload a Git-backed profile.");if(!o.git.head)throw new Error("Profile source must have a committed Git head before push. Run `openpond profile commit` first.");if(o.git.dirty)throw new Error("Profile source has uncommitted changes. Run `openpond profile commit` before push.");let n=await G(e),a=S(e.ensureHosted)?await n.profile.ensureHosted({teamId:t}):await n.profile.get({teamId:t});if(!a)throw new Error("No hosted OpenPond profile repo found. Run `openpond profile ensure-hosted --team-id <id>` first, or pass `--ensure-hosted` to push.");let l=S(e.force),h=a.sourceUpload?.sourceCommitSha??null,d=o.hosted?.sourceCommitSha??null;if(d&&h!==d&&!l)throw new Error(["Hosted profile source changed since the last local push.",`Last pushed hosted head: ${d}`,`Current hosted head: ${h??"none"}`,"Inspect hosted changes before pushing, or rerun with --force to overwrite explicitly."].join(`
|
|
3
3
|
`));let u=f(e,"hostedSourceAgentId"),y=S(e.hostedSourceChecks),$=S(e.publishHostedSource),C=f(e,"hostedRunAgentId"),w=u||(y||$?C:null),j=JSON.parse(await qe(o.manifestPath,"utf8")),N=Ge(j),_=j.profiles[o.activeProfile??j.defaultProfile]?.path??"profiles/default",P=await Ke({state:o,hostedSourceAgentId:w}),g=await n.profile.push({teamId:t,entries:P.entries,branch:o.git.branch??"main",commitMessage:f(e,"commitMessage")||f(e,"message")||`Push OpenPond profile ${o.activeProfile??"default"} at ${o.git.shortHead??o.git.head}`,expectedSourceCommitSha:h,localHeadSha:o.git.head,manifest:N,sourcePath:_,agents:o.agents.map(c=>({id:c.id,path:c.path,enabled:c.enabled}))}),O=new Date().toISOString(),s=o.hosted?.lastPushedLocalHead===o.git.head&&o.hosted?.sourceCommitSha===g.sourceUpload.sourceCommitSha,r={status:"pushed",promotionStatus:s?o.hosted?.promotionStatus??"uploaded":"uploaded",hostedRunStatus:s?o.hosted?.hostedRunStatus??"not_started":"not_started",pushedAt:O,teamId:t,projectId:g.profile.project.id,localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,sourceRef:g.sourceUpload.sourceRef,hostedRunAgentId:s?o.hosted?.hostedRunAgentId??null:null,hostedRunId:s?o.hosted?.hostedRunId??null:null,hostedRunAt:s?o.hosted?.hostedRunAt??null:null,hostedSourceMaterialization:s?o.hosted?.hostedSourceMaterialization??null:null,hostedSourceCheck:s?o.hosted?.hostedSourceCheck??null:null,hostedPublish:s?o.hosted?.hostedPublish??null:null,hostedRun:s?o.hosted?.hostedRun??null:null};await R(r);let m=w??Ve(o,C),H=Re(e.hostedSourceDispatch,"hosted-source-dispatch")??"coding_core",E=null,k=null,Z=null;if(w&&(y||$||u))try{let c=await Ae({client:n,teamId:t,profileProjectId:g.profile.project.id,profileName:o.activeProfile??j.defaultProfile,state:o,agentId:w,sourceRef:g.sourceUpload.sourceRef??o.git.branch??"main",localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,projectId:f(e,"hostedSourceProjectId")||(o.hosted?.hostedSourceMaterialization?.agentId===w?o.hosted.hostedSourceMaterialization.projectId:null)});r={...r,promotionStatus:"hosted_source_materialized",hostedSourceMaterialization:c},m=c.runtimeAgentId??w,await R(r)}catch(c){let p=c instanceof Error?c.message:String(c);throw r={...r,promotionStatus:"hosted_source_materialize_failed",hostedSourceMaterialization:{status:"failed",agentId:w,projectId:f(e,"hostedSourceProjectId")??null,error:p},error:p},await R(r),new Error(`Hosted source materialization failed after push: ${p}`)}if(y||$){if(!w)throw new Error("--hosted-source-agent-id or --hosted-run-agent-id is required for hosted source checks or publish.");if(!m)throw new Error("Unable to resolve the hosted runtime agent for source checks.");try{if(E=await n.agents.sourceDeployPlan(m,{teamId:t}),y){let c=r.hostedSourceMaterialization?.sourceRef??g.sourceUpload.sourceRef,p=r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha;if(k=await n.agents.requestSourceChecks(m,{teamId:t,...c?{sourceRef:c}:{},...p?{baseSha:p}:{},checkKind:$e(f(e,"hostedCheckKind")||f(e,"checkKind"))??"all",dispatch:H,metadata:{source:"openpond_profile_push_checks",localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,materializedProjectId:r.hostedSourceMaterialization?.projectId??null,materializedSourceCommitSha:r.hostedSourceMaterialization?.sourceCommitSha??null,sourceRef:c,dispatch:H}}),k.dispatchResult?.status==="failed")throw new Error(k.dispatchResult.error??"hosted_source_check_dispatch_failed");if(k.dispatchResult?.status==="completed"){let J=Y(k.sourceCheckStatus);Ze(J)&&(await Ye({client:n,teamId:t,runtimeAgentId:m,sourceRef:c,sourceCommitSha:p,validatedAt:new Date().toISOString()}),E=await n.agents.sourceDeployPlan(m,{teamId:t}))}}r={...r,promotionStatus:y?"hosted_source_check_pending":r.promotionStatus,hostedSourceCheck:X({agentId:m,status:y?"requested":"deploy_plan_ready",deployPlan:E,checkResult:k})},await R(r)}catch(c){let p=c instanceof Error?c.message:String(c);throw r={...r,promotionStatus:"hosted_source_check_failed",hostedSourceCheck:X({agentId:m,status:"failed",deployPlan:E,checkedAt:new Date().toISOString(),error:p}),error:p},await R(r),new Error(`Hosted source check failed after push: ${p}`)}}if($){if(!w)throw new Error("--hosted-source-agent-id or --hosted-run-agent-id is required for hosted source publish.");if(!m)throw new Error("Unable to resolve the hosted runtime agent for source publish.");try{let c=f(e,"expectedManifestHash")||r.hostedSourceCheck?.manifestHash||E?.source.manifestHash||void 0;Z=await n.agents.publishSource(m,{teamId:t,...c?{expectedManifestHash:c}:{},...r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha?{expectedSourceCommitSha:r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha}:{}}),r={...r,promotionStatus:"hosted_source_published",hostedPublish:ge({agentId:m,publishResult:Z})},await R(r)}catch(c){let p=c instanceof Error?c.message:String(c);throw r={...r,promotionStatus:"hosted_source_publish_failed",hostedPublish:{status:"failed",agentId:m,error:p},error:p},await R(r),new Error(`Hosted source publish failed after push: ${p}`)}}let z=null;if(C){let c=m||C,p=new Date().toISOString(),J=so(e,"hostedRunInput")??{prompt:"hello",channel:"openpond_chat"},D=f(e,"hostedRunConversationId")||f(e,"conversationId"),U=f(e,"hostedRunTargetProjectId"),se=ve({explicitKey:f(e,"hostedRunIdempotencyKey"),retry:S(e.hostedRunRetry),localHead:o.git.head,sourceHead:r.hostedSourceMaterialization?.sourceCommitSha??g.sourceUpload.sourceCommitSha,runtimeAgentId:c,targetProjectId:U,input:J});await R({...r,promotionStatus:"hosted_run_pending",hostedRunStatus:"running",hostedRunAgentId:c,hostedRunAt:p});try{z=await n.agents.run(c,{teamId:t,...D?{conversationId:D}:{},...U?{targetProjectId:U}:{},...U?{targetProject:{id:U}}:{},idempotencyKey:se,input:J,metadata:{source:"openpond_profile_push_run",...D?{conversationId:D}:{},targetProjectId:U||null,localHead:o.git.head,hostedHead:g.sourceUpload.sourceCommitSha,hostedRunIdempotencyKey:se,hostedRunRetry:S(e.hostedRunRetry),materializedProjectId:r.hostedSourceMaterialization?.projectId??null,materializedSourceCommitSha:r.hostedSourceMaterialization?.sourceCommitSha??null,sourceRef:r.hostedSourceMaterialization?.sourceRef??g.sourceUpload.sourceRef,publishedSnapshotId:r.hostedPublish?.snapshotId??null,manifestHash:r.hostedPublish?.manifestHash??r.hostedSourceCheck?.manifestHash??null},runtimeSourcePolicy:$?{requirePublishedSnapshot:!0,source:"diagnostic"}:{allowLatestSource:!0,source:"diagnostic"}});let F=me({agentId:c,runResult:z}),M=pe(F);await R({...r,promotionStatus:M==="passed"?"hosted_run_passed":M==="failed"?"hosted_run_failed":"hosted_run_pending",hostedRunStatus:M,hostedRunAgentId:c,hostedRunId:z.run.id,hostedRunAt:z.run.createdAt??p,hostedRun:F})}catch(F){let M=F instanceof Error?F.message:String(F);throw await R({...r,promotionStatus:"hosted_run_failed",hostedRunStatus:"failed",hostedRunAgentId:c,hostedRunAt:new Date().toISOString(),hostedRun:{status:"failed",agentId:c,error:M},error:M}),new Error(`Hosted invocation failed to start after push: ${M}`)}}if(S(e.json)){console.log(JSON.stringify({...g,uploaded:Be(P),hostedSourceMaterialization:r.hostedSourceMaterialization??null,hostedSourceChecks:k,hostedSourcePublish:Z,hostedRun:z},null,2));return}console.log(`Pushed OpenPond profile ${o.activeProfile??"default"} to hosted profile repo.`),console.log(`Project id: ${g.profile.project.id}`),console.log(`Local head: ${o.git.head}`),console.log(`Hosted source commit: ${g.sourceUpload.sourceCommitSha??"unknown"}`),console.log(`Uploaded ${P.fileCount} file(s), ${P.totalBytes} byte(s) via ${P.transport.mode} (limits: ${P.limits.maxFiles} files, ${P.limits.maxFileBytes} bytes/file, ${P.limits.maxTotalBytes} bytes total).`),console.log(z?`Hosted invocation: running ${z.run.id}`:"Hosted invocation: not started"),r.hostedSourceMaterialization&&console.log(`Hosted materialized: ${r.hostedSourceMaterialization.status}`+(r.hostedSourceMaterialization.projectId?` ${r.hostedSourceMaterialization.projectId}`:"")+(r.hostedSourceMaterialization.sourceCommitSha?` ${r.hostedSourceMaterialization.sourceCommitSha}`:"")),r.hostedSourceCheck&&console.log(`Hosted source checks: ${r.hostedSourceCheck.status}`),r.hostedPublish&&console.log(`Hosted publish: ${r.hostedPublish.status}`+(r.hostedPublish.snapshotId?` ${r.hostedPublish.snapshotId}`:"")),console.log(`Uploaded files: ${P.fileCount}`)}i(De,"runProfilePushCommand");function Be(e){return{fileCount:e.fileCount,totalBytes:e.totalBytes,limits:e.limits,transport:e.transport}}i(Be,"summarizeProfileSourceUpload");function Ge(e){return{...e,profiles:Object.fromEntries(Object.entries(e.profiles).map(([t,o])=>[t,{path:o.path,defaultAgent:o.defaultAgent??"default",enabledAgents:o.enabledAgents??[]}]))}}i(Ge,"normalizeHostedProfileManifest");async function Ke(e){let t=e.state.repoPath;if(!t)throw new Error("Active OpenPond profile is missing a repository path.");let o=await he(t);if(!e.hostedSourceAgentId)return o;if(!e.state.sourcePath)throw new Error("Active OpenPond profile is missing a source path.");let n=e.state.agents.find(d=>d.id===e.hostedSourceAgentId);if(!n)throw new Error(`Profile agent not found for hosted source upload: ${e.hostedSourceAgentId}`);let a=We(e.state.sourcePath,n.path),l=L.relative(t,a).replace(/\\/g,"/");if(l.startsWith("..")||L.isAbsolute(l))throw new Error(`Profile agent path escapes profile repo: ${n.path}`);let h=await K(a,[]);return h.entries.length===0?o:W(o,h.entries.map(d=>({...d,path:l?`${l}/${d.path}`:d.path})))}i(Ke,"collectProfileSourceUploadForPush");function We(e,t){let o=t.replace(/\\/g,"/"),n=L.resolve(e,o),a=L.relative(e,n);if(a.startsWith("..")||L.isAbsolute(a))throw new Error(`Profile agent path escapes profile source: ${t}`);return o==="agent/agent.ts"||o.endsWith("/agent.ts")?e:n}i(We,"resolveProfileAgentSourceRoot");function Y(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(Y,"record");function T(e){return typeof e=="string"&&e.trim()?e.trim():null}i(T,"text");function Ve(e,t){if(!t)return null;let o=e.hosted?.hostedSourceMaterialization;return o?.agentId===t&&o.runtimeAgentId?o.runtimeAgentId:t}i(Ve,"resolveHostedRuntimeAgentIdForRun");async function Ye(e){!e.sourceRef||!e.sourceCommitSha||await e.client.agents.update(e.runtimeAgentId,{teamId:e.teamId,runtimeSource:{mode:"latest_source",sourceRef:e.sourceRef,sourceCommitSha:e.sourceCommitSha,buildStatus:"succeeded",validationStatus:"passed",validatedAt:e.validatedAt}})}i(Ye,"bindValidatedHostedRuntimeSource");function Ze(e){if(!e)return!1;let t=T(e.finalResultState)?.toLowerCase();if(t&&t!=="completed"&&!Ee(t))return!1;let o=Array.isArray(e.checkRuns)?e.checkRuns.map(Y).filter(u=>!!u):[];if(o.some(Qe))return!1;let n=o.some(u=>V(u).includes("build")&&q(u)),a=q(Y(e.validation))||o.some(u=>V(u).includes("validate")&&q(u)),l=Y(e.eval),d=!((T(e.requestedCheckKind)??"all")==="all"||(T(e.requestedCheckKind)??"")==="eval"||!!l||o.some(u=>V(u).includes("eval")))||q(l)||o.some(u=>V(u).includes("eval")&&q(u));return n&&a&&d}i(Ze,"sourceCheckStatusPassed");function V(e){return(T(e.command)??"").toLowerCase()}i(V,"checkRunCommand");function Qe(e){let t=e.passed;if(typeof t=="boolean")return!t;let o=e.exitCode;if(typeof o=="number"&&o!==0)return!0;let n=T(e.status)?.toLowerCase();return!!(n&&Xe(n))}i(Qe,"checkRunFailed");function q(e){if(!e)return!1;if(typeof e.passed=="boolean")return e.passed;let t=Oe(e.failed)??Oe(e.failedCount);if(t!==null&&t>0)return!1;let o=e.exitCode;if(typeof o=="number")return o===0;let n=T(e.status)?.toLowerCase();return!!(n&&Ee(n))}i(q,"checkEvidencePassed");function Oe(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){let t=Number(e);return Number.isFinite(t)?t:null}return null}i(Oe,"numericEvidence");function Ee(e){return e==="passed"||e==="succeeded"||e==="success"}i(Ee,"passingStatus");function Xe(e){return e==="failed"||e==="failure"||e==="cancelled"}i(Xe,"failingStatus");async function eo(e){let t=B(e,"usage: openpond profile hosted status"),n=await(await G(e)).profile.get({teamId:t});if(S(e.json)){console.log(JSON.stringify({profile:n},null,2));return}if(!n){console.log("No hosted OpenPond profile repo found."),console.log("Run `openpond profile ensure-hosted --team-id <id>` to create one.");return}ze(n)}i(eo,"runHostedProfileStatusCommand");async function He(e){let t=B(e,"usage: openpond profile ensure-hosted"),n=await(await G(e)).profile.ensureHosted({teamId:t});if(S(e.json)){console.log(JSON.stringify({profile:n},null,2));return}ze(n)}i(He,"runHostedProfileEnsureCommand");async function oo(e,t){if((t[0]??"list")!=="list")throw new Error("usage: openpond agents list [--json]");let n=await x();if(n.error)throw new Error(n.error);if(S(e.json)){console.log(JSON.stringify({agents:n.agents,profile:n},null,2));return}if(n.mode==="none"){console.log("No active OpenPond profile. Run `openpond init`.");return}if(n.agents.length===0){console.log(`No agents found in ${n.activeProfile}.`);return}for(let a of n.agents)console.log(`${a.id} ${a.enabled?"enabled":"disabled"} ${a.path}`)}i(oo,"runOpenPondAgentsCommand");async function xo(e,t,o){let n=f(t,"cwd"),a=[...o,...ro(t,new Set(["cwd","account","profile","handle","baseUrl"]))];await Pe({command:e,cwd:n?L.resolve(n):void 0,args:a,inherit:!0})}i(xo,"runOpenPondProfileSdkAlias");function re(e){if(e.mode==="none"){console.log("No active OpenPond profile."),console.log(`Default location: ${ee()}`);return}if(console.log(`Mode: ${e.mode}`),console.log(`Repo: ${e.repoPath}`),console.log(`Profile: ${e.activeProfile}`),console.log(`Source: ${e.sourcePath??"missing"}`),console.log(`State: ${e.summary.message}`),e.git&&(console.log(`Git: ${e.git.branch??"detached"} ${e.git.shortHead??"no-head"}${e.git.dirty?" dirty":" clean"}`),e.git.upstream&&console.log(`Upstream: ${e.git.upstream} ahead ${e.git.ahead??"?"} behind ${e.git.behind??"?"}`)),(e.hosted?.projectId||e.hosted?.sourceCommitSha)&&(console.log(`Hosted: ${e.hosted.projectId??"unbound"} ${e.hosted.sourceCommitSha??"no-source-head"}`),e.hosted.hostedSourceMaterialization&&console.log(`Hosted materialized: ${e.hosted.hostedSourceMaterialization.status}`+(e.hosted.hostedSourceMaterialization.agentId?` ${e.hosted.hostedSourceMaterialization.agentId}`:"")+(e.hosted.hostedSourceMaterialization.sourceCommitSha?` ${e.hosted.hostedSourceMaterialization.sourceCommitSha}`:"")),e.hosted.hostedSourceCheck&&console.log(`Hosted checks: ${e.hosted.hostedSourceCheck.status}`+(e.hosted.hostedSourceCheck.sandboxId?` sandbox ${e.hosted.hostedSourceCheck.sandboxId}`:"")),e.hosted.hostedPublish&&console.log(`Hosted publish: ${e.hosted.hostedPublish.status}`+(e.hosted.hostedPublish.snapshotId?` ${e.hosted.hostedPublish.snapshotId}`:"")),e.hosted.hostedRun&&console.log(`Hosted run: ${e.hosted.hostedRun.status}`+(e.hosted.hostedRun.runId?` ${e.hosted.hostedRun.runId}`:"")+(e.hosted.hostedRun.runtimeId?` runtime ${e.hosted.hostedRun.runtimeId}`:""))),console.log(`Catalog: ${e.catalog.actionCount} action(s)${e.catalog.stale?" stale":""}`),console.log(`Setup gate: ${e.setupGate.status} (${e.setupGate.blockingCount} blocking, ${e.setupGate.optionalMissingCount} optional missing)`),e.summary.defaultAction&&console.log(`Default action: ${e.summary.defaultAction}`),e.setupGate.blockingRequirements.length>0){console.log("Blocking setup:");for(let t of e.setupGate.blockingRequirements.slice(0,10))console.log(` ${Q(t)}`);e.setupGate.blockingRequirements.length>10&&console.log(` ... ${e.setupGate.blockingRequirements.length-10} more`)}if(!e.summary.checkFresh&&e.summary.checkStaleReason?console.log(`Checks: stale - ${e.summary.checkStaleReason}`):e.summary.checkFresh&&console.log("Checks: fresh"),e.lastCheck&&console.log(`Last check: ${e.lastCheck.command} ${e.lastCheck.status} at ${e.lastCheck.checkedAt}`),e.error&&console.log(`Error: ${e.error}`),e.agents.length>0){console.log("Agents:");for(let t of e.agents)console.log(` ${t.id} (${t.enabled?"enabled":"disabled"}) ${t.path}`)}if(e.skills.length>0){console.log("Skills:");for(let t of e.skills){let o=t.validationStatus==="valid"?"valid":t.validationStatus;console.log(` ${t.name} (${o}) ${t.path}`)}}}i(re,"printProfileState");function to(e){if(e.mode==="none"){console.log("No active OpenPond profile.");return}console.log(`Profile: ${e.activeProfile}`),console.log(`State: ${e.summary.message}`);let t=[["Changed agents",e.diff.changedAgents],["New agents",e.diff.newAgents],["Deleted agents",e.diff.deletedAgents],["Changed skills",e.diff.changedSkills],["Changed actions",e.diff.changedActions],["Changed extensions",e.diff.changedExtensions],["Setup changes",e.diff.setupChanges],["Env requirement changes",e.diff.envRequirementChanges]];for(let[o,n]of t)n.length!==0&&console.log(`${o}: ${n.join(", ")}`);if(e.diff.files.length===0){console.log("No source changes.");return}console.log("Files:");for(let o of e.diff.files)console.log(` ${o.status.padEnd(2)} ${o.path}`)}i(to,"printProfileDiff");function no(e){if(e.mode==="none"){console.log("No active OpenPond profile.");return}if(console.log(`Profile: ${e.activeProfile}`),console.log(`Catalog: ${e.catalog.actionCount} action(s)${e.catalog.stale?" stale":""}`),console.log(`Setup gate: ${e.setupGate.status} (${e.setupGate.blockingCount} blocking, ${e.setupGate.optionalMissingCount} optional missing)`),e.catalog.generatedAt&&console.log(`Generated at: ${e.catalog.generatedAt}`),e.catalog.error&&console.log(`Catalog error: ${e.catalog.error}`),e.actionCatalog.length===0){console.log("No catalog actions found. Run `openpond inspect` or `openpond build`.");return}for(let o of e.actionCatalog){let n=o.label??o.name??o.id,a=o.visibility??"default",l=e.setupGate.blockingRequirements.filter(d=>d.actionId===o.id),h=l.length?`setup_required:${l.map(d=>d.label).join(",")}`:"setup_ready";console.log(`${o.id} ${a} ${h} ${n}`)}let t=e.setupGate.blockingRequirements.filter(o=>o.actionId===null);if(t.length>0){console.log("Source setup blockers:");for(let o of t)console.log(` ${Q(o)}`)}}i(no,"printProfileCatalog");function ze(e){if(console.log(`Hosted profile repo: ${e.project.name}`),console.log(`Project id: ${e.project.id}`),console.log(`Role: ${e.project.role??"profile"}`),console.log(`Default profile: ${e.defaultProfile}`),console.log(`Source path: ${e.sourcePath}`),console.log(`Seed status: ${e.seedStatus}`),e.sourceUpload?.sourceRef&&console.log(`Source ref: ${e.sourceUpload.sourceRef}`),e.sourceUpload?.sourceCommitSha&&console.log(`Source commit: ${e.sourceUpload.sourceCommitSha}`),e.seededAt&&console.log(`Seeded at: ${e.seededAt}`),e.agents.length>0){console.log("Agents:");for(let t of e.agents)console.log(` ${t.id} (${t.enabled?"enabled":"disabled"}) ${t.path}`)}}i(ze,"printHostedProfileSummary");function ro(e,t){let o=[],n=new Set(["force","json"]);for(let[a,l]of Object.entries(e)){if(t.has(a))continue;let h=`--${a.replace(/[A-Z]/g,d=>`-${d.toLowerCase()}`)}`;if(l===!0||n.has(a)&&l==="true")o.push(h);else{if(n.has(a)&&l==="false")continue;typeof l=="string"&&o.push(h,l)}}return o}i(ro,"optionArgs");function so(e,t){let o=f(e,t);if(!o)return null;let n=JSON.parse(o);if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`--${t} must be a JSON object`);return n}i(so,"parseJsonObjectOption");export{Ke as collectProfileSourceUploadForPush,oo as runOpenPondAgentsCommand,zo as runOpenPondInitCommand,Mo as runOpenPondProfileCommand,xo as runOpenPondProfileSdkAlias};
|
package/dist/chunks/{project-action-payload-65MTQMQW.js → project-action-payload-5PL65D3W.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{w as a}from"./chunk-
|
|
2
|
+
import{w as a}from"./chunk-OJEIYU7D.js";import"./chunk-DRMOHADV.js";import"./chunk-DNRC6TPJ.js";import"./chunk-6YR5IYHH.js";import"./chunk-SYUKES6H.js";import"./chunk-OOKHHOIU.js";import"./chunk-JCHLDNCX.js";import"./chunk-2ACX7IW5.js";import"./chunk-YU3C6U5V.js";import"./chunk-FDYWGE2Y.js";import"./chunk-HHLQG7PN.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-ZLYQR44C.js";import"./chunk-UTIELP6F.js";import"./chunk-TOWY6Y23.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-LRGMGXL2.js";import"./chunk-W45RKGM6.js";import"./chunk-73COPJ32.js";import"./chunk-UGDBMRCT.js";import"./chunk-YG3HITOU.js";import"./chunk-F64TR23C.js";import"./chunk-EDYCSW22.js";import"./chunk-Z6HWSTEP.js";import"./chunk-XGY4OQLC.js";import"./chunk-2PVW2XFF.js";import"./chunk-RGSMU6N4.js";import"./chunk-SYFJVLEL.js";import"./chunk-ULTV6INR.js";import"./chunk-XKDOPNQ5.js";import"./chunk-JXLDEYRW.js";import"./chunk-GR4MJJCE.js";import"./chunk-GG6PM7TB.js";import"./chunk-2GEZ3ZY7.js";import"./chunk-BYVE4TMU.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import"./chunk-3VT2PPKW.js";import"./chunk-5ZBDHIIE.js";import"./chunk-MTP3B2SU.js";import"./chunk-UN2LKLGV.js";import"./chunk-HLJJAOI2.js";import"./chunk-AMC4Z7G4.js";import"./chunk-LK77GI6M.js";import"./chunk-HVM2GUM3.js";import"./chunk-I6VMRQF4.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import"./chunk-ZEOYNUHL.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-EJOV6Z6F.js";import"./chunk-GY7YSD6J.js";import"./chunk-KUE46HTH.js";import"./chunk-MZKCW6CB.js";import"./chunk-6FA3GG5B.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as createProjectActionRunPayload};
|