openpond 0.2.68 → 0.2.70
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/api/client-context.d.ts +4 -0
- package/dist/app-server.js +1 -1
- package/dist/chunks/account-context-LEZDNYMR.js +12 -0
- package/dist/chunks/{acp-2OIXATRY.js → acp-QTA6IU6W.js} +1 -1
- package/dist/chunks/{acp-agent-PAGX2B47.js → acp-agent-N77HPAYQ.js} +1 -1
- package/dist/chunks/{actions-command-2VE6YI4W.js → actions-command-BZQCUDMD.js} +1 -1
- package/dist/chunks/{app-layer-YNEUEOEP.js → app-layer-YQQNLIXA.js} +1 -1
- package/dist/chunks/{app-server-connected-apps-TZOAUOYR.js → app-server-connected-apps-NH4667QJ.js} +1 -1
- package/dist/chunks/{app-server-runtime-GBX65JJ7.js → app-server-runtime-B7AMBGQZ.js} +1 -1
- package/dist/chunks/apps-WG7WY5CB.js +2 -0
- package/dist/chunks/{chunk-RY46UPBO.js → chunk-2ACX7IW5.js} +1 -1
- package/dist/chunks/{chunk-FKUWCJ73.js → chunk-54755JYM.js} +2 -2
- package/dist/chunks/{chunk-HKVFU3B3.js → chunk-5FSPDSAO.js} +1 -1
- package/dist/chunks/{chunk-R4EEGWXB.js → chunk-67U7PAMU.js} +1 -1
- package/dist/chunks/{chunk-2TGHZXJE.js → chunk-6C6ZCYTL.js} +1 -1
- package/dist/chunks/{chunk-7RSQOC5M.js → chunk-7TM25J6S.js} +1 -1
- package/dist/chunks/chunk-BGMAWETL.js +12 -0
- package/dist/chunks/chunk-BLNEHU62.js +12 -0
- package/dist/chunks/{chunk-RBTDSI4L.js → chunk-CUB6PWAJ.js} +6 -6
- package/dist/chunks/chunk-DFZTRMTL.js +2 -0
- package/dist/chunks/{chunk-4N4EH3RJ.js → chunk-EJOV6Z6F.js} +1 -1
- package/dist/chunks/{chunk-MEJLWNRS.js → chunk-EWH64WRR.js} +1 -1
- package/dist/chunks/{chunk-WNXUSELC.js → chunk-EXAJ2B4I.js} +1 -1
- package/dist/chunks/{chunk-BHKXPWFB.js → chunk-FHDH4OUA.js} +1 -1
- package/dist/chunks/chunk-HES4VP3D.js +2 -0
- package/dist/chunks/{chunk-AYOMVI7J.js → chunk-HIMG7S5E.js} +1 -1
- package/dist/chunks/{chunk-2LJCJOJ7.js → chunk-HLJJAOI2.js} +1 -1
- package/dist/chunks/{chunk-JPUSTFZC.js → chunk-HYUTDZ3N.js} +1 -1
- package/dist/chunks/chunk-J7X72QUY.js +2 -0
- package/dist/chunks/chunk-JF7WWLNW.js +2 -0
- package/dist/chunks/{chunk-4KNPCJR4.js → chunk-JVNKSU27.js} +1 -1
- package/dist/chunks/{chunk-XT4CSKHM.js → chunk-JZKTBYNB.js} +1 -1
- package/dist/chunks/{chunk-JEMECEQH.js → chunk-KHDCMVEJ.js} +1 -1
- package/dist/chunks/chunk-KURL76NW.js +6 -0
- package/dist/chunks/chunk-MZKCW6CB.js +2 -0
- package/dist/chunks/{chunk-UMAVVMXL.js → chunk-OL3L3U36.js} +1 -1
- package/dist/chunks/{chunk-IIT66347.js → chunk-OXQ2WFIH.js} +1 -1
- package/dist/chunks/{chunk-73TW6BKK.js → chunk-PPF6EBTQ.js} +1 -1
- package/dist/chunks/{chunk-V24VHT76.js → chunk-REGKOCDO.js} +1 -1
- package/dist/chunks/{chunk-PSY6IRJE.js → chunk-TAXCMCYZ.js} +1 -1
- package/dist/chunks/{chunk-OIH2LPIT.js → chunk-TCTBCAI6.js} +1 -1
- package/dist/chunks/{chunk-GEYZVOGD.js → chunk-UZNRH6I3.js} +1 -1
- package/dist/chunks/{chunk-DWM5G7BU.js → chunk-Y4E5AAI7.js} +1 -1
- package/dist/chunks/chunk-YAA7F5LI.js +2 -0
- package/dist/chunks/{chunk-XQAUHXL4.js → chunk-ZK3ET5EP.js} +2 -2
- package/dist/chunks/{cli-R7TAP6Z2.js → cli-ALEEFAJ7.js} +1 -1
- package/dist/chunks/{command-LNOVZQSK.js → command-5AXJMFYC.js} +11 -11
- package/dist/chunks/{configuration-command-CNITTZRP.js → configuration-command-5LUNWPOL.js} +1 -1
- package/dist/chunks/{connected-app-executor-FGWCLOJO.js → connected-app-executor-DHXZE4X3.js} +1 -1
- package/dist/chunks/connected-evidence-NWMPICKJ.js +2 -0
- package/dist/chunks/{connected-starting-assets-KWOFEIE4.js → connected-starting-assets-NRVXIKQ2.js} +1 -1
- package/dist/chunks/{continual-FVOLGGOE.js → continual-UCKQ2QLH.js} +1 -1
- package/dist/chunks/core-commands-ZPBX35M2.js +2 -0
- package/dist/chunks/datasets-6K3ZANIV.js +2 -0
- package/dist/chunks/desktop-test-57INNJ76.js +3 -0
- package/dist/chunks/evaluation-coordination-B7CN4R2D.js +2 -0
- package/dist/chunks/experiment-improvements-G357VLDB.js +2 -0
- package/dist/chunks/experiments-BHQO26LJ.js +2 -0
- package/dist/chunks/experiments-signal-BI6NKETB.js +2 -0
- package/dist/chunks/{help-K6YLZ3KL.js → help-UQN5RUPA.js} +1 -1
- package/dist/chunks/{hosted-app-server-composition-LA3BZ4SE.js → hosted-app-server-composition-WDDO6F23.js} +1 -1
- package/dist/chunks/{hosted-experiment-improvement-VG2WE7XZ.js → hosted-experiment-improvement-VVYXQ65K.js} +1 -1
- package/dist/chunks/{hosted-tasksets-NXVF4AQA.js → hosted-tasksets-KCLNMPG5.js} +1 -1
- package/dist/chunks/human-review-PX6DBIFT.js +2 -0
- package/dist/chunks/{import-YHYKZ6JN.js → import-2HEYPHPW.js} +1 -1
- package/dist/chunks/learning-LSXBL5DB.js +2 -0
- package/dist/chunks/{local-harness-taskset-review-XQHQ6JCR.js → local-harness-taskset-review-E5GN5LTR.js} +1 -1
- package/dist/chunks/opchat-66BCRKEZ.js +3 -0
- package/dist/chunks/opchat-bounded-chat-KQWXZVFN.js +2 -0
- package/dist/chunks/organizations-IOYWDOCC.js +2 -0
- package/dist/chunks/{profile-P2SJPBOJ.js → profile-YH6G3ZTD.js} +1 -1
- package/dist/chunks/{project-action-payload-LTIQBX77.js → project-action-payload-53OH6WDH.js} +1 -1
- package/dist/chunks/project-agent-RYVMKW2F.js +2 -0
- package/dist/chunks/{runtime-Q7JUJO4D.js → runtime-ISLJIGWC.js} +1 -1
- package/dist/chunks/sandbox-command-DI45NRTV.js +2 -0
- package/dist/chunks/{sandbox-template-U536EEWY.js → sandbox-template-T42MDUSR.js} +1 -1
- package/dist/chunks/{saved-work-KSIQPXC2.js → saved-work-54I5ZJTC.js} +1 -1
- package/dist/chunks/setup-D6TY2GWV.js +2 -0
- package/dist/chunks/{src-SGQYVBNQ.js → src-7RN7BF4W.js} +1 -1
- package/dist/chunks/{src-C3ZUESMK.js → src-LF5X4RNQ.js} +1 -1
- package/dist/chunks/{store-model-configuration-6L3OYXF4.js → store-model-configuration-AYFGMC5D.js} +1 -1
- package/dist/chunks/{store-model-project-preparation-AAEKCF6V.js → store-model-project-preparation-5DEIS7TB.js} +1 -1
- package/dist/chunks/{store-taskset-drafts-FRFL6ITK.js → store-taskset-drafts-EAOOY6CR.js} +1 -1
- package/dist/chunks/{taskset-UDDLFYKV.js → taskset-HNDIGYQG.js} +1 -1
- package/dist/chunks/{teams-bot-MPWL2PP4.js → teams-bot-Z5CZLWE4.js} +1 -1
- package/dist/chunks/{training-5UMT45UL.js → training-JTYQA7GA.js} +1 -1
- package/dist/chunks/training-hardware-MR4FUC4U.js +3 -0
- package/dist/chunks/training-hosted-36SZFS4U.js +2 -0
- package/dist/chunks/{web-search-ZEKJHZW4.js → web-search-FTVNZ7PH.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/sandbox/runtime-handle.d.ts +3 -5
- package/dist/sandbox/sandbox-instance-client.d.ts +11 -5
- package/dist/sandbox/types/billing.d.ts +53 -0
- package/dist/sandbox/types/responses.d.ts +11 -1
- package/dist/sandbox/types/snapshots.d.ts +52 -3
- package/dist/skills/manifest.json +1 -1
- package/dist/web/assets/{App-CCuh99JW.js → App-CXhxya9x.js} +4 -4
- package/dist/web/assets/{AppDialog-CxjDHVk9.js → AppDialog-x1HU1uLv.js} +1 -1
- package/dist/web/assets/{AppTerminalPanel-CKJIVpKa.js → AppTerminalPanel-CNIKmqKc.js} +2 -2
- package/dist/web/assets/{AppToastContext-EpiT1dHs.js → AppToastContext-DNWd43HS.js} +1 -1
- package/dist/web/assets/{AppsView-BsMyPX_3.js → AppsView-BvOD83Z1.js} +1 -1
- package/dist/web/assets/{AttachmentTypeIcon-BXvZy5gB.js → AttachmentTypeIcon-BLdDr3JZ.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-BIIV4aq4.js → BrowserSidebar-Ar0FlFKg.js} +1 -1
- package/dist/web/assets/{CartesianChart-brqLBqnF.js → CartesianChart-tS7f1HZv.js} +1 -1
- package/dist/web/assets/{ChatTimelineEntry-CwZbn16X.js → ChatTimelineEntry-z7_kur3h.js} +1 -1
- package/dist/web/assets/{CollaborationTabs-BU4uc4tZ.js → CollaborationTabs-CaiFEKrv.js} +1 -1
- package/dist/web/assets/{CommandMenu-DkWpXR55.js → CommandMenu-BpubEqaA.js} +1 -1
- package/dist/web/assets/{CommunityView-CsSxJZGn.js → CommunityView-TGR4s99l.js} +1 -1
- package/dist/web/assets/{ComposerAttachments-BdJGCYzI.js → ComposerAttachments-DPWCjKXz.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-CWy0j1vv.js → ComposerCreateImproveStrip-Drji01_6.js} +1 -1
- package/dist/web/assets/{ConversationImportsSettings-DCmiakbZ.js → ConversationImportsSettings-B_oW0cz7.js} +1 -1
- package/dist/web/assets/{DatasetReviewImport-DEnF_pGu.js → DatasetReviewImport-Dr3unJSY.js} +1 -1
- package/dist/web/assets/{ExperimentTrainingDataWorkspace-WhwQ0QBi.js → ExperimentTrainingDataWorkspace-DObvpJAw.js} +2 -2
- package/dist/web/assets/{FilePagePreview-BRhhz99q.js → FilePagePreview-9kkXbARN.js} +2 -2
- package/dist/web/assets/{GetStartedView-CLVD-qEi.js → GetStartedView-Dv2b_SlH.js} +1 -1
- package/dist/web/assets/{GettingStartedDialog-CMxaAMg-.js → GettingStartedDialog-sPaPMc61.js} +1 -1
- package/dist/web/assets/{HostedModelLearningReview-Cn-j-rDo.js → HostedModelLearningReview-BlwhGxS6.js} +1 -1
- package/dist/web/assets/HostedModelLearningSettings-B5ahk3je.js +1 -0
- package/dist/web/assets/{HtmlVisual-D5y2WG9L.js → HtmlVisual-rGsClq0p.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-BxRmYD6h.js → LabModelVersionDetailPage-Da7AwZWV.js} +1 -1
- package/dist/web/assets/{LabModelWorkspace-u2Ulm_z4.js → LabModelWorkspace-DTeYViWH.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-C7IceJTJ.js → LabSkillSidebar-BieHbNl6.js} +1 -1
- package/dist/web/assets/{LabsRoute-CbztQaEf.js → LabsRoute-D3XqPB0-.js} +4 -4
- package/dist/web/assets/{LearningBatchesPage-CJqgZNvM.js → LearningBatchesPage-CCBuf2u4.js} +1 -1
- package/dist/web/assets/{MainChatThread-DNMfrrRq.js → MainChatThread-B6BQJfcq.js} +2 -2
- package/dist/web/assets/{MainPane-CQQxSDPS.js → MainPane-D3fQou29.js} +6 -6
- package/dist/web/assets/{ModelProjectPageHeader-Dge19aE1.js → ModelProjectPageHeader-BZn9Lu_J.js} +1 -1
- package/dist/web/assets/{NativeSetupTerminal-D4JnbpyD.js → NativeSetupTerminal-Bglqab_g.js} +2 -2
- package/dist/web/assets/{NativeSkillSidebar-Jzx1BeKV.js → NativeSkillSidebar-pUGRdnV_.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-DcnGzEd9.js → NewProjectDialog-BpHN38MA.js} +1 -1
- package/dist/web/assets/{OutputsPage-Cmk15Vt_.js → OutputsPage-LunDCQ6w.js} +1 -1
- package/dist/web/assets/{PageChrome-Cz_fCqtn.js → PageChrome-DThEcWAx.js} +1 -1
- package/dist/web/assets/{ProjectsPage-BZ3Eo3Mz.js → ProjectsPage-vct_TQgL.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-C6H2vU9N.js → RightChatPanelStack-CgFK7DY0.js} +1 -1
- package/dist/web/assets/RightSidebarHomePanel-BJmzUcmy.js +1 -0
- package/dist/web/assets/{ScheduledWorkPage-CAkSwM0T.js → ScheduledWorkPage-mmaZfybl.js} +1 -1
- package/dist/web/assets/{SettingsView-DvQXGw3_.js → SettingsView-CJfeRsWR.js} +3 -3
- package/dist/web/assets/{TasksetDraftEditorPrimitives-JuU1k8vr.js → TasksetDraftEditorPrimitives-CuimAfkv.js} +1 -1
- package/dist/web/assets/{TeamChatView-DmHjr8W9.js → TeamChatView-BcK0lF1b.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-DlaM9d8F.js → TerminalOverlay-0pzEvy-C.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-ClpylNsr.js → TrainingCreationPanel-CcyzFz7l.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-6tH2xSDj.js → TrainingDraftPanel-DSLZXdLz.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-CzDqxOYM.js → UsageSettingsSection-BT9pcnCn.js} +1 -1
- package/dist/web/assets/WorkSidebarPanel-CP-nHAsJ.js +1 -0
- package/dist/web/assets/{WorkspaceDiffPanel-B4e0lyF7.js → WorkspaceDiffPanel-Bbz5qrVA.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-D01ZkZZF.js → WorkspaceEnvironmentMenu-6hXpvMTl.js} +1 -1
- package/dist/web/assets/{WorkspaceFileLocation-C5s_njZb.js → WorkspaceFileLocation-BijVemBl.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-DjPZ6KIh.js → WorkspaceGitDialogs-BOO0E5i9.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-CC4sfOiU.js → WorkspaceMonacoEditor-B_YzK7Do.js} +3 -3
- package/dist/web/assets/{WorkspacePdfPreview-vszQqFa4.js → WorkspacePdfPreview-CFti1fvu.js} +2 -2
- package/dist/web/assets/{WorkspacePresentationPreview-DQTvhaRD.js → WorkspacePresentationPreview-DPAhNaV6.js} +1 -1
- package/dist/web/assets/{bot-Doyx3T4j.js → bot-BE2rL_qv.js} +1 -1
- package/dist/web/assets/chevron-down-Bn8yph2O.js +1 -0
- package/dist/web/assets/chevron-right-BU-jUmb2.js +1 -0
- package/dist/web/assets/chevron-up-DacwuDJZ.js +1 -0
- package/dist/web/assets/{chunk-C3TS766N-ppRhs95p.js → chunk-C3TS766N-j1MK0e3c.js} +1 -1
- package/dist/web/assets/{client-DwZ92xtu.js → client-BnJhN-14.js} +1 -1
- package/dist/web/assets/{client-choice-storage-DitqKiIT.js → client-choice-storage-CQ0CNkzG.js} +1 -1
- package/dist/web/assets/{cloud-upload-HdzNTgr2.js → cloud-upload-DFjZE4O4.js} +1 -1
- package/dist/web/assets/{copy-DTQhoBNg.js → copy-CGrLUtw5.js} +1 -1
- package/dist/web/assets/{cssMode-BRTtfXxU.js → cssMode-DvRw2fUx.js} +1 -1
- package/dist/web/assets/{external-link-H1629UU6.js → external-link-3ZnEFUXd.js} +1 -1
- package/dist/web/assets/{folder-open-CAGdWOrr.js → folder-open-i9n8450i.js} +1 -1
- package/dist/web/assets/{folder-plus-C14cs2mE.js → folder-plus-cu8Md_ej.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DFUfuVvF.js → git-commit-horizontal-CwckmC09.js} +1 -1
- package/dist/web/assets/{htmlMode-BVaCcL76.js → htmlMode-8VF4Ovtw.js} +1 -1
- package/dist/web/assets/{icons-Bk2b68aC.js → icons-4yRSxBZj.js} +1 -1
- package/dist/web/assets/{image-0DPVY6Ev.js → image-D-umhyyK.js} +1 -1
- package/dist/web/assets/{index-B6XX_0h3.js → index-DiVhx1GM.js} +2 -2
- package/dist/web/assets/{info-C8b_tafZ.js → info-Dq2RsPDJ.js} +1 -1
- package/dist/web/assets/{jsonMode-BCKKQmmV.js → jsonMode-CvCYQHkB.js} +1 -1
- package/dist/web/assets/loader-circle-DBl6qqtR.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DozmNUOx.js → lspLanguageFeatures-CjufNNFF.js} +1 -1
- package/dist/web/assets/{maximize-2-CByk9-zN.js → maximize-2-CKY8dua6.js} +1 -1
- package/dist/web/assets/{message-square-C889vRqm.js → message-square-CVDgKlKX.js} +1 -1
- package/dist/web/assets/{monaco.contribution-BITdsRbn.js → monaco.contribution-BYAgjZbj.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DxAV1oS5.js → monaco.contribution-BYY3-y9l.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BqA-XZ44.js → monaco.contribution-Bh0CKj9i.js} +2 -2
- package/dist/web/assets/{monaco.contribution-B9q6qbbo.js → monaco.contribution-PjJ1258q.js} +2 -2
- package/dist/web/assets/{monitor-BtxlcLuI.js → monitor-UYe42gew.js} +1 -1
- package/dist/web/assets/{paperclip-BeIdaspf.js → paperclip-DrlSVUoz.js} +1 -1
- package/dist/web/assets/{pdf-perlzwEB.js → pdf-BMhday2W.js} +1 -1
- package/dist/web/assets/play-DIqZnaNf.js +1 -0
- package/dist/web/assets/plus-CFNxAPMK.js +1 -0
- package/dist/web/assets/{presentation-0bzvu6_u.js → presentation-DcZKqH7w.js} +1 -1
- package/dist/web/assets/{python-B9hOnkOI.js → python-CiA01i07.js} +1 -1
- package/dist/web/assets/{refresh-cw-D61-Ozk3.js → refresh-cw-00D-GDnF.js} +1 -1
- package/dist/web/assets/{save-iEMNZoPe.js → save-CXe7bqR7.js} +1 -1
- package/dist/web/assets/{settings-lists-C84qxFmP.js → settings-lists-B5J40WM6.js} +1 -1
- package/dist/web/assets/square-DJEaBefe.js +1 -0
- package/dist/web/assets/{square-terminal-Djpzo2Qs.js → square-terminal-DxC7TTds.js} +1 -1
- package/dist/web/assets/{submit-issue-command-HfKzyxg5.js → submit-issue-command-Dq3TqJLV.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-ClsXu39R.js → toggleHighContrast-BH3Jckfo.js} +1 -1
- package/dist/web/assets/{training-model-data-CIysl8wH.js → training-model-data-B6IZ3x-t.js} +1 -1
- package/dist/web/assets/{tsMode-nbmaMc-D.js → tsMode-DXkj4bqC.js} +1 -1
- package/dist/web/assets/{upload-C6ug8RD-.js → upload-B3KRHVHl.js} +1 -1
- package/dist/web/assets/{useAccountSettings-Dr9h4Qz_.js → useAccountSettings-BGRkTRrp.js} +1 -1
- package/dist/web/assets/{useAgentInventory-ByCk2JAv.js → useAgentInventory-D_1AlAZJ.js} +1 -1
- package/dist/web/assets/{useChatContextSelection-C0eMm2g6.js → useChatContextSelection-hoMSuUSE.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-Do0y_leJ.js → useLocalAgentSchedules-DxTER7Ow.js} +1 -1
- package/dist/web/assets/{useQuery-D2MQ7e5U.js → useQuery-DkPec_9x.js} +1 -1
- package/dist/web/assets/{wifi-off-Dr-CapyW.js → wifi-off-CMzpvbWl.js} +1 -1
- package/dist/web/assets/{workers-DKvM2NdM.js → workers-ziY_bTv2.js} +1 -1
- package/dist/web/assets/x-omjwMPbJ.js +1 -0
- package/dist/web/assets/{yaml-C02vq4ar.js → yaml-mSvqVSko.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +11 -0
- package/package.json +1 -1
- package/dist/chunks/account-context-MWB6HN6I.js +0 -12
- package/dist/chunks/apps-RSFEJOQN.js +0 -2
- package/dist/chunks/chunk-27JGS3KB.js +0 -12
- package/dist/chunks/chunk-APKXXAUF.js +0 -2
- package/dist/chunks/chunk-DRTHKWHK.js +0 -6
- package/dist/chunks/chunk-JCLTFDVW.js +0 -2
- package/dist/chunks/chunk-KOC3YJEU.js +0 -12
- package/dist/chunks/chunk-KTIBXRWQ.js +0 -2
- package/dist/chunks/chunk-YDZBX4XQ.js +0 -2
- package/dist/chunks/connected-evidence-5VZBYNWN.js +0 -2
- package/dist/chunks/core-commands-BPYXVT7O.js +0 -2
- package/dist/chunks/datasets-E5TXSVIY.js +0 -2
- package/dist/chunks/desktop-test-FX7DTY4N.js +0 -3
- package/dist/chunks/evaluation-coordination-KUTZEEPB.js +0 -2
- package/dist/chunks/experiment-improvements-PQNR5YHN.js +0 -2
- package/dist/chunks/experiments-Z4BJWT3Y.js +0 -2
- package/dist/chunks/experiments-signal-3GCLKUWZ.js +0 -2
- package/dist/chunks/human-review-2ZOB7CJZ.js +0 -2
- package/dist/chunks/learning-LAXMGWSQ.js +0 -2
- package/dist/chunks/opchat-XXI2ZM53.js +0 -3
- package/dist/chunks/opchat-bounded-chat-3MZGCRLY.js +0 -2
- package/dist/chunks/organizations-W7HI2JA4.js +0 -2
- package/dist/chunks/project-agent-XRIXMXQK.js +0 -2
- package/dist/chunks/sandbox-command-HVA5FJU4.js +0 -2
- package/dist/chunks/setup-RMZ2BHLM.js +0 -2
- package/dist/chunks/training-hardware-UWQCRDMV.js +0 -3
- package/dist/chunks/training-hosted-CKSDRVL6.js +0 -2
- package/dist/web/assets/HostedModelLearningSettings-VNBvf38S.js +0 -1
- package/dist/web/assets/RightSidebarHomePanel-BfMMVkM1.js +0 -1
- package/dist/web/assets/WorkSidebarPanel-CY-AHZ4-.js +0 -1
- package/dist/web/assets/chevron-down-DX1hzujj.js +0 -1
- package/dist/web/assets/chevron-right-DHN0y3KC.js +0 -1
- package/dist/web/assets/chevron-up-_QrW88NF.js +0 -1
- package/dist/web/assets/loader-circle-y-SSPwpk.js +0 -1
- package/dist/web/assets/play-CHXXdkuO.js +0 -1
- package/dist/web/assets/plus-DFFWjhPw.js +0 -1
- package/dist/web/assets/square-BE_4JMR3.js +0 -1
- package/dist/web/assets/x-Jx2jlP9u.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-W45RKGM6.js";import{a as N,d as L}from"./chunk-GYYJ47GX.js";import{d as x,e as Te,g as ye}from"./chunk-WCNPGKST.js";import{e as we,f as Ee}from"./chunk-HKVFU3B3.js";import{a as ue}from"./chunk-DWF3FCY4.js";import"./chunk-YDZBX4XQ.js";import{b as C,c as D,d as ge}from"./chunk-AFH462DO.js";import{a as ke}from"./chunk-Y2WNZWT2.js";import{a as M,b as g,c as q}from"./chunk-CIZI6Z7D.js";import{a as me}from"./chunk-KCJVFLBB.js";import"./chunk-HG2YFMVU.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-7OKZCJHS.js";import"./chunk-UTIELP6F.js";import"./chunk-7NCM6GBN.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-VEBW7NKD.js";import"./chunk-W45RKGM6.js";import"./chunk-AUO5DCEU.js";import"./chunk-Y4I6CFZJ.js";import"./chunk-EDYCSW22.js";import"./chunk-JT5YQ52I.js";import"./chunk-XGY4OQLC.js";import"./chunk-PAYFJHPO.js";import"./chunk-WD4KAKEX.js";import"./chunk-2PXKSAG6.js";import"./chunk-ULTV6INR.js";import"./chunk-WGQ3FMRF.js";import"./chunk-JXLDEYRW.js";import{a as fe,b as le,c as U,p as pe,q as he}from"./chunk-JVMSN7LH.js";import{h as ie,i as oe,k as ne,l as de,y as ce}from"./chunk-YI6ME6PU.js";import"./chunk-DRLP7GIU.js";import{Ca as H,Fa as re,Ia as F,S as se,aa as A,b as ee,c as te,e as $,i as ae,oa as y,wa as T}from"./chunk-BU6MW65V.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{H as S,I as Z,x as X}from"./chunk-DXJC3QW7.js";import"./chunk-P4QM63L3.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{L as B,M as I}from"./chunk-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import{e as J,f as Y}from"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as m}from"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import{A as u}from"./chunk-X2J2P5ZT.js";import{a as h}from"./chunk-FTQLQJQV.js";import{randomUUID as et}from"node:crypto";import{cp as tt,mkdir as at,readdir as st,rename as G,rm as Ne,stat as rt}from"node:fs/promises";import O from"node:path";function ve(o,t,e,a){let s=t.modelScope;if(!s)return;let i=o.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[s.modelId,t.profileId]);if(!i)throw new Error("Taskset draft Model was not found in this Profile.");let r=S.parse(JSON.parse(i.payload)),n={id:e.id,revision:e.revision,contentHash:e.contentHash},f=e.metadata.rewardBinding===void 0?null:X.parse(e.metadata.rewardBinding),p=s.source?.authoringGraph==="bound"&&f&&r.trainingSetup.rewardBindingRef&&I(f,r.trainingSetup.rewardBindingRef);return we(o,{schemaVersion:"openpond.modelProjectSave.v1",operationId:`draft-publication:${m({draftId:t.id,revision:t.revision,scope:s,tasksetRef:n})}`,expectedRevision:s.expectedModelRevision,project:Z.strip().parse({...r,trainingSetup:{...r.trainingSetup,tasksetRef:n,rewardBindingRef:f,tasksetRelease:null,recipe:p?r.trainingSetup.recipe:null,...r.trainingSetup.evaluationTasksetRef&&r.trainingSetup.tasksetRef&&I(r.trainingSetup.evaluationTasksetRef,r.trainingSetup.tasksetRef)?{evaluationTasksetRef:n}:{}}})},null,a?.modelResources?{...a.modelResources,taskset:a.taskset,executionResources:{environment:a.environment,verifierSet:a.verifierSet}}:a??void 0)}h(ve,"selectTasksetDraftModel");import{createHash as je,randomUUID as Je}from"node:crypto";import{lstat as Se,mkdir as Pe,readdir as Be,readFile as $e,rename as qe,rm as Ue,writeFile as Ve}from"node:fs/promises";import R from"node:path";var b=pe.extend({workspaceHash:u.string().regex(/^[a-f0-9]{64}$/).nullable()}).strict();async function De(o){let{db:t,profileId:e}=o,a=te.parse(o.request),s=h(()=>{let w=t.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[a.modelId,e]);if(!w)throw new Error("Taskset draft Model was not found in this Profile.");return S.parse(JSON.parse(w.payload))},"requireModel"),i=s(),r=m(a),n=t.get("SELECT request_hash, state, payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(n){if(n.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");if(n.state==="deleted")throw new Error("This Taskset draft was deleted.");return b.parse(JSON.parse(n.payload))}if(!o.source)return null;if(i.revision!==a.expectedModelRevision)throw new Error("Model changed before draft initialization. Refresh before editing.");let f=i.trainingSetup.tasksetRef,p=f?t.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND profile_id = ?",[f.id,f.revision,e]):null,d=p?T.parse(JSON.parse(p.payload)):null;if(!d||!f||d.contentHash!==f.contentHash)throw new Error("The selected source Taskset is unavailable.");let l=o.source,c=i.hosted?.apiOrigin?i.hosted.tasksets.find(w=>w.localTasksetId===d.id&&w.localTasksetHash===d.contentHash&&w.packageHash===l.contentHash&&w.releaseId===l.taskset.id&&w.releaseRevision===l.taskset.revision&&w.releaseHash===l.taskset.contentHash):null,k=typeof d.metadata.importedPackageHash=="string"?d.metadata.importedPackageHash:c?.packageHash;if(k?k!==l.contentHash:!I(B(F({taskset:d,adapterId:x(d)}).tasksetRelease),B(l.taskset)))throw new Error("Taskset draft package differs from its selected source.");let P=l.modelResources?se.safeParse(l.taskset.metadata.modelTasksetDerivation):ee.safeParse(l.taskset.metadata.modelTasksetAuthoring),_=c&&P.success&&P.data.owner.modelId===i.id?P.data.owner:{scopeId:e,modelId:i.id},Ce=fe({request:a,owner:_,source:l}),ze=he({sourceDraft:ce(d),source:l,preparation:Ce,expectedModelRevision:a.expectedModelRevision});await C(o.home,l);let K=b.parse({...ze,workspaceHash:null}),We=K.draft;t.exec("BEGIN IMMEDIATE");try{let w=t.get("SELECT request_hash FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(w&&w.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");if(!w&&s().revision!==a.expectedModelRevision)throw new Error("Model changed during draft initialization. Refresh before editing.");t.run("INSERT INTO model_taskset_draft_operations (profile_id, operation_id, request_hash, draft_id, state, payload) VALUES (?, ?, ?, ?, 'prepared', ?) ON CONFLICT(profile_id, operation_id) DO NOTHING",[e,a.operationId,r,We.id,JSON.stringify(K)]),t.exec("COMMIT")}catch(w){throw t.exec("ROLLBACK"),w}let j=t.get("SELECT request_hash, payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(!j||j.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");return b.parse(JSON.parse(j.payload))}h(De,"prepareDraftInitialization");async function Re(o){let{initialized:t,workspacePath:e}=o;if(o.completed())return;if(t.workspaceHash)try{if(await Se(e),o.completed())return;if(await V(e),await g(e)!==t.workspaceHash)throw new Error("Prepared Taskset draft files changed before initialization completed.");return}catch(s){if(s.code!=="ENOENT")throw s}let a=`${e}.initializing-${Je()}`;await Pe(R.dirname(e),{recursive:!0});try{let s=t.draft.modelScope?.source;if(!s)throw new Error("Taskset draft lost its source preparation.");let i=await D(o.home,s.sourcePackageHash),r=new Map;for(let f of t.filePaths){let p=i.files.find(d=>d.asset.id===f.assetId);if(!p)throw new Error("Taskset draft source asset is missing.");for(let d of f.paths){if(d.includes("\\")||R.posix.isAbsolute(d)||d.split("/").some(k=>!k||k==="."||k===".."||k.startsWith(".env")))throw new Error("Taskset draft source path is invalid.");let l=r.get(d);if(l&&l!==p.asset.contentHash)throw new Error("Taskset draft source paths conflict.");if(l)continue;let c=R.join(a,d);await Pe(R.dirname(c),{recursive:!0}),await Ve(c,A(p),{flag:"wx"}),r.set(d,p.asset.contentHash)}}await M(t.draft,a);for(let[f,p]of r)if(je("sha256").update(await $e(R.join(a,f))).digest("hex")!==p)throw new Error(`Taskset draft source asset conflicts with authoring file ${f}.`);let n=await g(a);if(o.retainHash({...t,workspaceHash:n}),o.completed())return;try{await qe(a,e)}catch(f){if(!["EEXIST","ENOTEMPTY"].includes(f.code??""))throw f;if(o.completed())return;if(await V(e),await g(e)!==n)throw new Error("Prepared Taskset draft files changed before initialization completed.")}}finally{await Ue(a,{recursive:!0,force:!0})}}h(Re,"materializeDraftInitialization");async function V(o){let t=await Se(o);if(!t.isDirectory()||t.isSymbolicLink())throw new Error("Taskset draft source must be a regular directory.");for(let e of await Be(o,{withFileTypes:!0})){if(e.name.startsWith(".env")||e.isSymbolicLink())throw new Error("Taskset draft source contains a prohibited file.");if(e.isDirectory())await V(R.join(o,e.name));else if(!e.isFile())throw new Error("Taskset draft source must contain regular files.")}}h(V,"assertRegularTree");import Qe from"node:path";async function be(o){let t=F({taskset:o.taskset,adapterId:x(o.taskset)}),e=await ye({root:o.directory,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:t.tasksetRelease,environment:t.environmentRelease,verifierSet:t.verifierSetRelease},sources:U.parse(o.taskset.metadata.portableFileInventory??[])}),a=o.preparation.authoringGraph==="bound"?await D(o.home,o.preparation.sourcePackageHash):void 0,s=le({preparation:o.preparation,edited:e,source:a});if(s.modelResources){let c=re({package:s,profileId:o.taskset.profileId,name:o.taskset.name,createdAt:o.taskset.createdAt}),k=ue(c.taskset,o.taskset),P=T.parse({...k,authoringProvenance:o.taskset.authoringProvenance,metadata:{...k.metadata,sourcePackageHash:o.taskset.metadata.sourcePackageHash}}),_=T.parse({...P,contentHash:H(P)});return await ge({home:o.home,...c,taskset:_}),{taskset:_,directory:Qe.join(o.home,"training","tasksets",String(_.environment.metadata.runtimeSourceTasksetId))}}let i=U.parse(o.taskset.metadata.portableFileInventory??[]),r=s.files.map(c=>({asset:c.asset,sourcePath:i.find(k=>k.asset.id===c.asset.id)?.sourcePath??c.asset.path})),n=s.taskset.environment.entrypoint==="openpond.javascript-environment.v1"?s.files.find(c=>c.asset.path==="environment/execution.json"):void 0,f=`model-draft-${m({packageHash:s.contentHash,taskset:o.taskset})}`,p=T.parse({...o.taskset,id:s.taskset.id,revision:s.taskset.revision,metadata:{...o.taskset.metadata,portableFileInventory:r,importedPackageHash:s.contentHash,derivedPortableMetadata:s.taskset.metadata},environment:{...o.taskset.environment,metadata:{...o.taskset.environment.metadata,runtimeSourceTasksetId:f,portableExecutionResources:{environment:s.environment,verifierSet:s.verifierSet}}}}),d=T.parse({...p,contentHash:H(p)}),l=await N(o.home,{taskset:d,generatedFiles:n?[{path:n.asset.path,role:"environment",content:new TextDecoder("utf-8",{fatal:!0}).decode(A(n))}]:[]},f,{source:{directory:o.directory,packageHash:await g(o.directory)},verify:h(c=>L(c,d),"verify")});return await C(o.home,s),{directory:l,taskset:d}}h(be,"materializeModelTasksetDraftPublication");import{constants as Q}from"node:fs";import{createHash as Ge}from"node:crypto";import{lstat as Ie,mkdir as Ke,open as Ye,readdir as Xe,rm as _e}from"node:fs/promises";import z from"node:path";var v=h((o,t)=>Y(z.join(o,"state","taskset-draft-writes"),t),"withTasksetDraftLock"),He=oe,Ze=h(o=>Ge("sha256").update(o).digest("hex"),"digest");async function W(o,t,e=!1){$.parse(t);let a=o;for(let s of["",...t.split("/").slice(0,-1)]){s&&(a=z.join(a,s)),e&&await Ke(a,{recursive:!1}).catch(r=>{if(r.code!=="EEXIST")throw r});let i=await Ie(a);if(!i.isDirectory()||i.isSymbolicLink())throw new Error("Taskset draft paths must use regular directories.")}return z.join(o,t)}h(W,"regularPath");async function Me(o,t){let e=await W(o,t),a=await Ye(e,Q.O_RDONLY|Q.O_NOFOLLOW|Q.O_NONBLOCK);try{let s=await a.stat();if(!s.isFile()||s.size>ie)throw new Error("Taskset draft file must be a regular file within the 6 MB editing limit.");let i=Buffer.alloc(s.size),r=0;for(;r<i.length;){let n=await a.read(i,r,i.length-r,r);if(!n.bytesRead)throw new Error("Taskset draft file changed during reading.");r+=n.bytesRead}if((await a.read(Buffer.alloc(1),0,1,r)).bytesRead)throw new Error("Taskset draft file changed during reading.");return i}finally{await a.close()}}h(Me,"readBytes");async function Oe(o,t){let e=await Me(o,t);return ne(t,e)}h(Oe,"readTasksetDraftFile");async function Ae(o){let t=[];async function e(a=""){for(let s of await Xe(z.join(o,a),{withFileTypes:!0})){let i=a?`${a}/${s.name}`:s.name;if($.parse(i),s.isSymbolicLink())throw new Error("Taskset draft files cannot contain symbolic links.");if(s.isDirectory()){await e(i);continue}if(!s.isFile())throw new Error("Taskset draft files must be regular files.");if(t.length>=1e4)throw new Error("Taskset draft file inventory exceeds its limit.");let r=await Ie(await W(o,i));if(!r.isFile()||r.isSymbolicLink())throw new Error("Taskset draft files must be regular files.");t.push({path:i,sizeBytes:r.size,writable:He(i)})}}return h(e,"visit"),await W(o,"taskset.json"),await e(),t.sort((a,s)=>a.path.localeCompare(s.path))}h(Ae,"listTasksetDraftFiles");async function Fe(o,t,e){if(!He(t.path))throw new Error("This file is managed by the Taskset forms or retained source history.");let a=null;try{a=await Me(o,t.path)}catch(r){if(r.code!=="ENOENT")throw r}if((a?Ze(a):null)!==t.expectedFileHash)throw new Error("Taskset draft file changed. Reload it before saving.");if(!a&&t.content===null)throw new Error("Taskset draft file does not exist.");let s=t.content?de(t.content):null,i=await W(o,t.path,!0);s?await J(i,s):await _e(i);try{return await e()}catch(r){throw a?await J(i,a):await _e(i,{force:!0}),r}}h(Fe,"mutateTasksetDraftFile");var E=u.object({schemaVersion:u.literal("openpond.tasksetDraftPointer.v1"),id:u.string().trim().min(1),profileId:u.string().trim().min(1),modelScope:y.shape.modelScope,status:u.enum(["draft","validating","needs_review","published"]),revision:u.number().int().positive(),workspacePath:u.string().trim().min(1),packageHash:u.string().regex(/^[a-f0-9]{64}$/),publishedTasksetRef:u.object({id:u.string().trim().min(1),revision:u.number().int().positive(),contentHash:u.string().trim().min(8)}).nullable(),createdAt:u.string().trim().min(1),updatedAt:u.string().trim().min(1)}),xe=class extends me{static{h(this,"SqliteTasksetDraftStore")}async initializeModelTasksetDraft(t,e,a){await this.ready;let s=this.writeQueue.then(()=>v(this.home,async()=>{let i=this.database,r=await De({db:i,home:this.home,profileId:t,request:e,source:a});if(!r)return null;let n=h(()=>{let d=i.get("SELECT state FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]);if(d?.state==="deleted")throw new Error("This Taskset draft was deleted.");let l=i.get("SELECT payload FROM taskset_drafts WHERE id = ?",[r.draft.id]);if(!l){if(d?.state==="ready")throw new Error("The initialized Taskset draft is unavailable.");return!1}let c=E.parse(JSON.parse(l.payload));if(c.profileId!==t||c.modelScope?.source?.requestHash!==r.draft.modelScope?.source?.requestHash)throw new Error("Taskset draft identity conflicts with its initialization.");return!0},"completed"),f=this.workspacePath(r.draft.id);await Re({home:this.home,initialized:r,workspacePath:f,completed:n,retainHash:h(d=>{let l=i.get("SELECT payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]),c=b.parse(JSON.parse(l.payload));if(c.workspaceHash&&c.workspaceHash!==d.workspaceHash)throw new Error("Taskset draft initialization produced different files on retry.");i.run("UPDATE model_taskset_draft_operations SET payload = ? WHERE profile_id = ? AND operation_id = ? AND state = 'prepared'",[JSON.stringify(d),t,e.operationId])},"retainHash")}),i.exec("BEGIN IMMEDIATE");try{if(!n()){let d=i.get("SELECT payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]),l=b.parse(JSON.parse(d.payload)),c=l.draft,k=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:c.id,profileId:t,modelScope:c.modelScope,status:c.status,revision:c.revision,workspacePath:f,packageHash:l.workspaceHash,publishedTasksetRef:c.publishedTasksetRef,createdAt:c.createdAt,updatedAt:c.updatedAt});i.run("INSERT INTO taskset_drafts (id, profile_id, status, revision, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)",[c.id,t,c.status,c.revision,JSON.stringify(k),c.createdAt,c.updatedAt]),i.run("UPDATE model_taskset_draft_operations SET state = 'ready' WHERE profile_id = ? AND operation_id = ?",[t,e.operationId])}i.exec("COMMIT")}catch(d){throw i.exec("ROLLBACK"),d}let p=i.get("SELECT payload FROM taskset_drafts WHERE id = ?",[r.draft.id]);return this.draftFromStoredPayload(JSON.parse(p.payload))}));return this.writeQueue=s.then(()=>{},()=>{}),s}async saveTasksetDraft(t,e,a={}){let s=y.parse(t);await this.ready;let i=this.writeQueue.then(()=>v(this.home,async()=>{let r=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ?",[s.id]),n=r?E.safeParse(JSON.parse(r.payload)):null;if(n?.success){if(n.data.profileId!==s.profileId)throw new Error("Taskset draft profile cannot change.");if(m(n.data.modelScope?{...n.data.modelScope,expectedModelRevision:0}:null)!==m(s.modelScope?{...s.modelScope,expectedModelRevision:0}:null)||!a.refreshModelRevision&&m(n.data.modelScope)!==m(s.modelScope))throw new Error("Taskset draft Model ownership cannot change.");if(n.data.status==="published")throw new Error("Published Taskset drafts are immutable. Initialize a new draft to revise the Taskset.");if(s.revision<n.data.revision||e!==void 0&&n.data.revision!==e)throw new Error("Taskset draft changed before saving. Refresh before saving.")}else if(e!==void 0)throw new Error("Taskset draft is unavailable for saving.");if((!n?.success||a.refreshModelRevision)&&s.modelScope){let c=this.database.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[s.modelScope.modelId,s.profileId]);if(!c)throw new Error("Taskset draft Model was not found in this Profile.");if(S.parse(JSON.parse(c.payload)).revision!==s.modelScope.expectedModelRevision)throw new Error("Taskset draft Model changed. Refresh before editing.")}let f=this.workspacePath(s.id),d=(await M(s,f)).draft,l=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:d.id,profileId:d.profileId,modelScope:d.modelScope,status:d.status,revision:d.revision,workspacePath:f,packageHash:await g(f),publishedTasksetRef:d.publishedTasksetRef,createdAt:d.createdAt,updatedAt:d.updatedAt});return await this.savePointer(l,!0),d}));return this.writeQueue=i.then(()=>{},()=>{}),i}async importTasksetDraftPackage(t){let e=O.resolve(t.packagePath),s=(await rt(e)).isDirectory()?e:O.dirname(e);await Le(s);let i=await g(s),r=await q(s),n=await this.getTasksetDraft(r.id);if(n){let c=n.metadata.importedTasksetPackage;if(c&&typeof c=="object"&&!Array.isArray(c)&&c.packageHash===i&&n.profileId===t.profileId)return n;throw new Error(`Taskset draft ${r.id} already exists. Import a package with a distinct Taskset id.`)}let f=y.parse({...r,profileId:t.profileId,modelScope:null,status:"draft",revision:1,publishedTasksetRef:null,metadata:{...r.metadata,importedTasksetPackage:{packageHash:i,importedAt:new Date().toISOString()}},updatedAt:new Date().toISOString()}),p=this.workspacePath(f.id),d=`${p}.import-${process.pid}-${Date.now()}`;await at(O.dirname(p),{recursive:!0});try{await tt(s,d,{recursive:!0,errorOnExist:!0,force:!1,preserveTimestamps:!0}),await M(f,d),await G(d,p)}catch(c){throw await Ne(d,{recursive:!0,force:!0}),c}let l=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:f.id,profileId:f.profileId,status:f.status,revision:f.revision,workspacePath:p,packageHash:await g(p),publishedTasksetRef:f.publishedTasksetRef,createdAt:f.createdAt,updatedAt:f.updatedAt});return await this.savePointer(l),this.draftFromStoredPayload(l)}async materializePublishedTasksetPackage(t){let e=await this.getTasksetDraftWorkspace(t.draftId);if(!e)throw new Error(`Taskset draft ${t.draftId} workspace was not found.`);if(t.taskset.metadata.sourcePackageHash!==void 0&&t.taskset.metadata.sourcePackageHash!==e.packageHash)throw new Error("Taskset draft files changed before publication. Refresh before publishing.");let a=`draft-${m({taskset:t.taskset,packageHash:e.packageHash})}`,s=await Te(t.taskset,e.workspacePath),i=T.parse({...s.taskset,metadata:{...s.taskset.metadata,sourcePackageHash:e.packageHash},environment:{...s.taskset.environment,metadata:{...s.taskset.environment.metadata,runtimeSourceTasksetId:a}}}),r=T.parse({...i,contentHash:H(i)}),n=await N(this.home,{taskset:r,generatedFiles:s.generatedFiles},a,{source:{directory:e.workspacePath,packageHash:e.packageHash},verify:h(p=>L(p,r),"verify")}),f=await this.getTasksetDraft(t.draftId);return f?.modelScope?.source?be({home:this.home,directory:n,taskset:r,preparation:f.modelScope.source}):{directory:n,taskset:r}}async finalizeTasksetDraftPublication(t){await this.ready;let e=y.parse(t.draft),a=T.parse(t.taskset),s=e.modelScope?.source?.authoringGraph==="bound"&&typeof a.metadata.importedPackageHash=="string"?await D(this.home,a.metadata.importedPackageHash):null,i=this.writeQueue.then(()=>v(this.home,async()=>{let r=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ?",[e.id]);if(!r)throw new Error("Taskset draft was deleted before publication.");let n=E.parse(JSON.parse(r.payload));if(n.profileId!==e.profileId||a.profileId!==e.profileId)throw new Error("Taskset publication belongs to another Profile.");if(m(n.modelScope)!==m(e.modelScope))throw new Error("Taskset draft Model ownership cannot change.");if(n.status==="published"&&n.publishedTasksetRef){let c=n.publishedTasksetRef,k=this.database.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND content_hash = ?",[c.id,c.revision,c.contentHash]);if(!k)throw new Error("Published draft lost its immutable Taskset revision.");return{draft:y.parse({...e,status:n.status,revision:n.revision,publishedTasksetRef:c,updatedAt:n.updatedAt}),taskset:T.parse(JSON.parse(k.payload))}}if(n.revision!==e.revision||a.metadata.sourcePackageHash!==t.packageHash)throw new Error("Taskset draft changed before publication. Refresh before publishing.");let f=n.modelScope?.source,p=f?.authoringGraph==="bound"&&a.metadata.modelTasksetDerivation&&typeof a.metadata.modelTasksetDerivation=="object"?{...a.metadata.modelTasksetDerivation,schemaVersion:f.lineage.schemaVersion}:a.metadata.modelTasksetAuthoring;if(f&&(a.id!==f.tasksetId||a.revision!==f.tasksetRevision||m(p)!==m(f.lineage)))throw new Error("Taskset publication differs from its retained source preparation.");let d=y.parse({...e,status:"published",revision:e.revision+1,publishedTasksetRef:{id:a.id,revision:a.revision,contentHash:a.contentHash},updatedAt:new Date().toISOString()}),l=E.parse({...n,status:d.status,revision:d.revision,publishedTasksetRef:d.publishedTasksetRef,updatedAt:d.updatedAt});return ke(this.database,a,()=>{if(s&&Ee(this.database,{package:s,taskset:a,generatedFiles:[]}),ve(this.database,e,a,s),this.database.get("SELECT revision FROM taskset_drafts WHERE id = ?",[e.id])?.revision!==e.revision)throw new Error("Taskset draft changed during publication.");this.database.run("UPDATE taskset_drafts SET status = ?, revision = ?, payload = ?, updated_at = ? WHERE id = ?",[l.status,l.revision,JSON.stringify(l),l.updatedAt,e.id])}),{draft:d,taskset:a}}));return this.writeQueue=i.then(()=>{},()=>{}),i}async getTasksetDraft(t){let e=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[t],a=>a);return e===null?null:this.draftFromStoredPayload(e)}async listTasksetDrafts(t){await this.ready,await this.writeQueue;let e=await this.all(t?"SELECT payload FROM taskset_drafts WHERE profile_id = ? ORDER BY updated_at DESC":"SELECT payload FROM taskset_drafts ORDER BY updated_at DESC",t?[t]:[]);return Promise.all(e.map(a=>this.draftFromStoredPayload(JSON.parse(a.payload))))}async readHumanPublishedTasksetDraft(t,e){let a=(await this.listTasksetDrafts(t)).filter(r=>r.status==="published"&&r.modelScope===null&&m(r.publishedTasksetRef)===m(e));if(a.length!==1)return null;let s=a[0],i=await this.getTasksetDraftWorkspace(s.id);return i?{draft:s,workspace:i}:null}async getTasksetDraftWorkspace(t){let e=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[t],s=>s);if(e===null)return null;let a=await this.pointerFromStoredPayload(e);return{draftId:a.id,workspacePath:a.workspacePath,packageHash:await g(a.workspacePath)}}async deleteTasksetDraft(t){await this.ready;let e=this.writeQueue.then(()=>v(this.home,async()=>{let a=this.workspacePath(t),s=`${a}.delete-${et()}`,i=!1;try{await G(a,s),i=!0}catch(r){if(r.code!=="ENOENT")throw r}try{this.database.exec("BEGIN IMMEDIATE");try{this.database.run("DELETE FROM taskset_drafts WHERE id = ?",[t]),this.database.run("UPDATE model_taskset_draft_operations SET state = 'deleted' WHERE draft_id = ?",[t]),this.database.exec("COMMIT")}catch(r){throw this.database.exec("ROLLBACK"),r}}catch(r){throw i&&await G(s,a).catch(()=>{}),r}i&&await Ne(s,{recursive:!0,force:!0})}));this.writeQueue=e.catch(()=>{}),await e}async tasksetDraftFiles(t,e,a){return await this.ready,v(this.home,async()=>{let s=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ? AND profile_id = ?",[e,t]);if(!s)throw new Error("Taskset draft was not found in this Profile.");let i=E.parse(JSON.parse(s.payload));if(a!==void 0){let n=await Oe(i.workspacePath,a);return{draftRevision:i.revision,file:{...n,writable:n.writable&&i.status!=="published"}}}let r=await Ae(i.workspacePath);return{draftRevision:i.revision,files:r.map(n=>({...n,writable:n.writable&&i.status!=="published"}))}})}async saveTasksetDraftFile(t,e){let a=ae.parse(e);await this.ready;let s=this.writeQueue.then(()=>v(this.home,async()=>{let i=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ? AND profile_id = ?",[a.draftId,t]);if(!i)throw new Error("Taskset draft was not found in this Profile.");let r=E.parse(JSON.parse(i.payload));if(r.status==="published")throw new Error("Published Taskset drafts are immutable.");if(r.revision!==a.expectedDraftRevision)throw new Error("Taskset draft changed. Reload before saving a file.");return Fe(r.workspacePath,a,async()=>{let n=E.parse({...r,revision:r.revision+1,packageHash:await g(r.workspacePath),updatedAt:new Date().toISOString()}),f=await this.draftFromStoredPayload(n);this.database.exec("BEGIN IMMEDIATE");try{if(this.database.get("SELECT revision FROM taskset_drafts WHERE id = ? AND profile_id = ?",[a.draftId,t])?.revision!==r.revision)throw new Error("Taskset draft changed during file saving.");this.database.run("UPDATE taskset_drafts SET revision = ?, payload = ?, updated_at = ? WHERE id = ?",[n.revision,JSON.stringify(n),n.updatedAt,n.id]),this.database.exec("COMMIT")}catch(p){throw this.database.exec("ROLLBACK"),p}return f})}));return this.writeQueue=s.then(()=>{},()=>{}),s}workspacePath(t){let e=m(t).slice(0,24);return O.join(this.home,"workspaces","tasksets",`taskset-${e}`)}async draftFromStoredPayload(t){let e=await this.pointerFromStoredPayload(t),a=await q(e.workspacePath);return y.parse({...a,id:e.id,profileId:e.profileId,modelScope:e.modelScope,status:e.status,revision:e.revision,publishedTasksetRef:e.publishedTasksetRef,createdAt:e.createdAt,updatedAt:e.updatedAt})}async pointerFromStoredPayload(t){let e=E.safeParse(t);if(e.success)return e.data;let a=y.parse(t);await this.saveTasksetDraft(a);let s=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[a.id],E.parse);if(!s)throw new Error(`Taskset draft ${a.id} migration failed.`);return s}async savePointer(t,e=!1){await(e?this.run.bind(this):this.upsertPayload.bind(this))(`INSERT INTO taskset_drafts (id, profile_id, status, revision, payload, created_at, updated_at)
|
|
2
|
+
import"./chunk-W45RKGM6.js";import{a as N,d as L}from"./chunk-GYYJ47GX.js";import{d as x,e as Te,g as ye}from"./chunk-WCNPGKST.js";import{e as we,f as Ee}from"./chunk-5FSPDSAO.js";import{a as ue}from"./chunk-DWF3FCY4.js";import"./chunk-YAA7F5LI.js";import{b as C,c as D,d as ge}from"./chunk-AFH462DO.js";import{a as ke}from"./chunk-Y2WNZWT2.js";import{a as M,b as g,c as q}from"./chunk-CIZI6Z7D.js";import{a as me}from"./chunk-KCJVFLBB.js";import"./chunk-HG2YFMVU.js";import"./chunk-OQPJ7FJF.js";import"./chunk-BL3CZWWD.js";import"./chunk-FYWQWKVS.js";import"./chunk-GD3RCUDH.js";import"./chunk-7OKZCJHS.js";import"./chunk-UTIELP6F.js";import"./chunk-7NCM6GBN.js";import"./chunk-4V73I4OL.js";import"./chunk-LE75SVEL.js";import"./chunk-6ESBAHWK.js";import"./chunk-7J2NMUTK.js";import"./chunk-VEBW7NKD.js";import"./chunk-W45RKGM6.js";import"./chunk-AUO5DCEU.js";import"./chunk-Y4I6CFZJ.js";import"./chunk-EDYCSW22.js";import"./chunk-JT5YQ52I.js";import"./chunk-XGY4OQLC.js";import"./chunk-PAYFJHPO.js";import"./chunk-WD4KAKEX.js";import"./chunk-2PXKSAG6.js";import"./chunk-ULTV6INR.js";import"./chunk-WGQ3FMRF.js";import"./chunk-JXLDEYRW.js";import{a as fe,b as le,c as U,p as pe,q as he}from"./chunk-JVMSN7LH.js";import{h as ie,i as oe,k as ne,l as de,y as ce}from"./chunk-YI6ME6PU.js";import"./chunk-DRLP7GIU.js";import{Ca as H,Fa as re,Ia as F,S as se,aa as A,b as ee,c as te,e as $,i as ae,oa as y,wa as T}from"./chunk-BU6MW65V.js";import"./chunk-LVXL7T5O.js";import"./chunk-HIQPGYVH.js";import{H as S,I as Z,x as X}from"./chunk-DXJC3QW7.js";import"./chunk-P4QM63L3.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{L as B,M as I}from"./chunk-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-KUE46HTH.js";import"./chunk-6FA3GG5B.js";import{e as J,f as Y}from"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import{n as m}from"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-ZFJWA4JK.js";import{A as u}from"./chunk-X2J2P5ZT.js";import{a as h}from"./chunk-FTQLQJQV.js";import{randomUUID as et}from"node:crypto";import{cp as tt,mkdir as at,readdir as st,rename as G,rm as Ne,stat as rt}from"node:fs/promises";import O from"node:path";function ve(o,t,e,a){let s=t.modelScope;if(!s)return;let i=o.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[s.modelId,t.profileId]);if(!i)throw new Error("Taskset draft Model was not found in this Profile.");let r=S.parse(JSON.parse(i.payload)),n={id:e.id,revision:e.revision,contentHash:e.contentHash},f=e.metadata.rewardBinding===void 0?null:X.parse(e.metadata.rewardBinding),p=s.source?.authoringGraph==="bound"&&f&&r.trainingSetup.rewardBindingRef&&I(f,r.trainingSetup.rewardBindingRef);return we(o,{schemaVersion:"openpond.modelProjectSave.v1",operationId:`draft-publication:${m({draftId:t.id,revision:t.revision,scope:s,tasksetRef:n})}`,expectedRevision:s.expectedModelRevision,project:Z.strip().parse({...r,trainingSetup:{...r.trainingSetup,tasksetRef:n,rewardBindingRef:f,tasksetRelease:null,recipe:p?r.trainingSetup.recipe:null,...r.trainingSetup.evaluationTasksetRef&&r.trainingSetup.tasksetRef&&I(r.trainingSetup.evaluationTasksetRef,r.trainingSetup.tasksetRef)?{evaluationTasksetRef:n}:{}}})},null,a?.modelResources?{...a.modelResources,taskset:a.taskset,executionResources:{environment:a.environment,verifierSet:a.verifierSet}}:a??void 0)}h(ve,"selectTasksetDraftModel");import{createHash as je,randomUUID as Je}from"node:crypto";import{lstat as Se,mkdir as Pe,readdir as Be,readFile as $e,rename as qe,rm as Ue,writeFile as Ve}from"node:fs/promises";import R from"node:path";var b=pe.extend({workspaceHash:u.string().regex(/^[a-f0-9]{64}$/).nullable()}).strict();async function De(o){let{db:t,profileId:e}=o,a=te.parse(o.request),s=h(()=>{let w=t.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[a.modelId,e]);if(!w)throw new Error("Taskset draft Model was not found in this Profile.");return S.parse(JSON.parse(w.payload))},"requireModel"),i=s(),r=m(a),n=t.get("SELECT request_hash, state, payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(n){if(n.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");if(n.state==="deleted")throw new Error("This Taskset draft was deleted.");return b.parse(JSON.parse(n.payload))}if(!o.source)return null;if(i.revision!==a.expectedModelRevision)throw new Error("Model changed before draft initialization. Refresh before editing.");let f=i.trainingSetup.tasksetRef,p=f?t.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND profile_id = ?",[f.id,f.revision,e]):null,d=p?T.parse(JSON.parse(p.payload)):null;if(!d||!f||d.contentHash!==f.contentHash)throw new Error("The selected source Taskset is unavailable.");let l=o.source,c=i.hosted?.apiOrigin?i.hosted.tasksets.find(w=>w.localTasksetId===d.id&&w.localTasksetHash===d.contentHash&&w.packageHash===l.contentHash&&w.releaseId===l.taskset.id&&w.releaseRevision===l.taskset.revision&&w.releaseHash===l.taskset.contentHash):null,k=typeof d.metadata.importedPackageHash=="string"?d.metadata.importedPackageHash:c?.packageHash;if(k?k!==l.contentHash:!I(B(F({taskset:d,adapterId:x(d)}).tasksetRelease),B(l.taskset)))throw new Error("Taskset draft package differs from its selected source.");let P=l.modelResources?se.safeParse(l.taskset.metadata.modelTasksetDerivation):ee.safeParse(l.taskset.metadata.modelTasksetAuthoring),_=c&&P.success&&P.data.owner.modelId===i.id?P.data.owner:{scopeId:e,modelId:i.id},Ce=fe({request:a,owner:_,source:l}),ze=he({sourceDraft:ce(d),source:l,preparation:Ce,expectedModelRevision:a.expectedModelRevision});await C(o.home,l);let K=b.parse({...ze,workspaceHash:null}),We=K.draft;t.exec("BEGIN IMMEDIATE");try{let w=t.get("SELECT request_hash FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(w&&w.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");if(!w&&s().revision!==a.expectedModelRevision)throw new Error("Model changed during draft initialization. Refresh before editing.");t.run("INSERT INTO model_taskset_draft_operations (profile_id, operation_id, request_hash, draft_id, state, payload) VALUES (?, ?, ?, ?, 'prepared', ?) ON CONFLICT(profile_id, operation_id) DO NOTHING",[e,a.operationId,r,We.id,JSON.stringify(K)]),t.exec("COMMIT")}catch(w){throw t.exec("ROLLBACK"),w}let j=t.get("SELECT request_hash, payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[e,a.operationId]);if(!j||j.request_hash!==r)throw new Error("Taskset draft operation was reused with different input.");return b.parse(JSON.parse(j.payload))}h(De,"prepareDraftInitialization");async function Re(o){let{initialized:t,workspacePath:e}=o;if(o.completed())return;if(t.workspaceHash)try{if(await Se(e),o.completed())return;if(await V(e),await g(e)!==t.workspaceHash)throw new Error("Prepared Taskset draft files changed before initialization completed.");return}catch(s){if(s.code!=="ENOENT")throw s}let a=`${e}.initializing-${Je()}`;await Pe(R.dirname(e),{recursive:!0});try{let s=t.draft.modelScope?.source;if(!s)throw new Error("Taskset draft lost its source preparation.");let i=await D(o.home,s.sourcePackageHash),r=new Map;for(let f of t.filePaths){let p=i.files.find(d=>d.asset.id===f.assetId);if(!p)throw new Error("Taskset draft source asset is missing.");for(let d of f.paths){if(d.includes("\\")||R.posix.isAbsolute(d)||d.split("/").some(k=>!k||k==="."||k===".."||k.startsWith(".env")))throw new Error("Taskset draft source path is invalid.");let l=r.get(d);if(l&&l!==p.asset.contentHash)throw new Error("Taskset draft source paths conflict.");if(l)continue;let c=R.join(a,d);await Pe(R.dirname(c),{recursive:!0}),await Ve(c,A(p),{flag:"wx"}),r.set(d,p.asset.contentHash)}}await M(t.draft,a);for(let[f,p]of r)if(je("sha256").update(await $e(R.join(a,f))).digest("hex")!==p)throw new Error(`Taskset draft source asset conflicts with authoring file ${f}.`);let n=await g(a);if(o.retainHash({...t,workspaceHash:n}),o.completed())return;try{await qe(a,e)}catch(f){if(!["EEXIST","ENOTEMPTY"].includes(f.code??""))throw f;if(o.completed())return;if(await V(e),await g(e)!==n)throw new Error("Prepared Taskset draft files changed before initialization completed.")}}finally{await Ue(a,{recursive:!0,force:!0})}}h(Re,"materializeDraftInitialization");async function V(o){let t=await Se(o);if(!t.isDirectory()||t.isSymbolicLink())throw new Error("Taskset draft source must be a regular directory.");for(let e of await Be(o,{withFileTypes:!0})){if(e.name.startsWith(".env")||e.isSymbolicLink())throw new Error("Taskset draft source contains a prohibited file.");if(e.isDirectory())await V(R.join(o,e.name));else if(!e.isFile())throw new Error("Taskset draft source must contain regular files.")}}h(V,"assertRegularTree");import Qe from"node:path";async function be(o){let t=F({taskset:o.taskset,adapterId:x(o.taskset)}),e=await ye({root:o.directory,content:{schemaVersion:"openpond.tasksetPackage.v1",taskset:t.tasksetRelease,environment:t.environmentRelease,verifierSet:t.verifierSetRelease},sources:U.parse(o.taskset.metadata.portableFileInventory??[])}),a=o.preparation.authoringGraph==="bound"?await D(o.home,o.preparation.sourcePackageHash):void 0,s=le({preparation:o.preparation,edited:e,source:a});if(s.modelResources){let c=re({package:s,profileId:o.taskset.profileId,name:o.taskset.name,createdAt:o.taskset.createdAt}),k=ue(c.taskset,o.taskset),P=T.parse({...k,authoringProvenance:o.taskset.authoringProvenance,metadata:{...k.metadata,sourcePackageHash:o.taskset.metadata.sourcePackageHash}}),_=T.parse({...P,contentHash:H(P)});return await ge({home:o.home,...c,taskset:_}),{taskset:_,directory:Qe.join(o.home,"training","tasksets",String(_.environment.metadata.runtimeSourceTasksetId))}}let i=U.parse(o.taskset.metadata.portableFileInventory??[]),r=s.files.map(c=>({asset:c.asset,sourcePath:i.find(k=>k.asset.id===c.asset.id)?.sourcePath??c.asset.path})),n=s.taskset.environment.entrypoint==="openpond.javascript-environment.v1"?s.files.find(c=>c.asset.path==="environment/execution.json"):void 0,f=`model-draft-${m({packageHash:s.contentHash,taskset:o.taskset})}`,p=T.parse({...o.taskset,id:s.taskset.id,revision:s.taskset.revision,metadata:{...o.taskset.metadata,portableFileInventory:r,importedPackageHash:s.contentHash,derivedPortableMetadata:s.taskset.metadata},environment:{...o.taskset.environment,metadata:{...o.taskset.environment.metadata,runtimeSourceTasksetId:f,portableExecutionResources:{environment:s.environment,verifierSet:s.verifierSet}}}}),d=T.parse({...p,contentHash:H(p)}),l=await N(o.home,{taskset:d,generatedFiles:n?[{path:n.asset.path,role:"environment",content:new TextDecoder("utf-8",{fatal:!0}).decode(A(n))}]:[]},f,{source:{directory:o.directory,packageHash:await g(o.directory)},verify:h(c=>L(c,d),"verify")});return await C(o.home,s),{directory:l,taskset:d}}h(be,"materializeModelTasksetDraftPublication");import{constants as Q}from"node:fs";import{createHash as Ge}from"node:crypto";import{lstat as Ie,mkdir as Ke,open as Ye,readdir as Xe,rm as _e}from"node:fs/promises";import z from"node:path";var v=h((o,t)=>Y(z.join(o,"state","taskset-draft-writes"),t),"withTasksetDraftLock"),He=oe,Ze=h(o=>Ge("sha256").update(o).digest("hex"),"digest");async function W(o,t,e=!1){$.parse(t);let a=o;for(let s of["",...t.split("/").slice(0,-1)]){s&&(a=z.join(a,s)),e&&await Ke(a,{recursive:!1}).catch(r=>{if(r.code!=="EEXIST")throw r});let i=await Ie(a);if(!i.isDirectory()||i.isSymbolicLink())throw new Error("Taskset draft paths must use regular directories.")}return z.join(o,t)}h(W,"regularPath");async function Me(o,t){let e=await W(o,t),a=await Ye(e,Q.O_RDONLY|Q.O_NOFOLLOW|Q.O_NONBLOCK);try{let s=await a.stat();if(!s.isFile()||s.size>ie)throw new Error("Taskset draft file must be a regular file within the 6 MB editing limit.");let i=Buffer.alloc(s.size),r=0;for(;r<i.length;){let n=await a.read(i,r,i.length-r,r);if(!n.bytesRead)throw new Error("Taskset draft file changed during reading.");r+=n.bytesRead}if((await a.read(Buffer.alloc(1),0,1,r)).bytesRead)throw new Error("Taskset draft file changed during reading.");return i}finally{await a.close()}}h(Me,"readBytes");async function Oe(o,t){let e=await Me(o,t);return ne(t,e)}h(Oe,"readTasksetDraftFile");async function Ae(o){let t=[];async function e(a=""){for(let s of await Xe(z.join(o,a),{withFileTypes:!0})){let i=a?`${a}/${s.name}`:s.name;if($.parse(i),s.isSymbolicLink())throw new Error("Taskset draft files cannot contain symbolic links.");if(s.isDirectory()){await e(i);continue}if(!s.isFile())throw new Error("Taskset draft files must be regular files.");if(t.length>=1e4)throw new Error("Taskset draft file inventory exceeds its limit.");let r=await Ie(await W(o,i));if(!r.isFile()||r.isSymbolicLink())throw new Error("Taskset draft files must be regular files.");t.push({path:i,sizeBytes:r.size,writable:He(i)})}}return h(e,"visit"),await W(o,"taskset.json"),await e(),t.sort((a,s)=>a.path.localeCompare(s.path))}h(Ae,"listTasksetDraftFiles");async function Fe(o,t,e){if(!He(t.path))throw new Error("This file is managed by the Taskset forms or retained source history.");let a=null;try{a=await Me(o,t.path)}catch(r){if(r.code!=="ENOENT")throw r}if((a?Ze(a):null)!==t.expectedFileHash)throw new Error("Taskset draft file changed. Reload it before saving.");if(!a&&t.content===null)throw new Error("Taskset draft file does not exist.");let s=t.content?de(t.content):null,i=await W(o,t.path,!0);s?await J(i,s):await _e(i);try{return await e()}catch(r){throw a?await J(i,a):await _e(i,{force:!0}),r}}h(Fe,"mutateTasksetDraftFile");var E=u.object({schemaVersion:u.literal("openpond.tasksetDraftPointer.v1"),id:u.string().trim().min(1),profileId:u.string().trim().min(1),modelScope:y.shape.modelScope,status:u.enum(["draft","validating","needs_review","published"]),revision:u.number().int().positive(),workspacePath:u.string().trim().min(1),packageHash:u.string().regex(/^[a-f0-9]{64}$/),publishedTasksetRef:u.object({id:u.string().trim().min(1),revision:u.number().int().positive(),contentHash:u.string().trim().min(8)}).nullable(),createdAt:u.string().trim().min(1),updatedAt:u.string().trim().min(1)}),xe=class extends me{static{h(this,"SqliteTasksetDraftStore")}async initializeModelTasksetDraft(t,e,a){await this.ready;let s=this.writeQueue.then(()=>v(this.home,async()=>{let i=this.database,r=await De({db:i,home:this.home,profileId:t,request:e,source:a});if(!r)return null;let n=h(()=>{let d=i.get("SELECT state FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]);if(d?.state==="deleted")throw new Error("This Taskset draft was deleted.");let l=i.get("SELECT payload FROM taskset_drafts WHERE id = ?",[r.draft.id]);if(!l){if(d?.state==="ready")throw new Error("The initialized Taskset draft is unavailable.");return!1}let c=E.parse(JSON.parse(l.payload));if(c.profileId!==t||c.modelScope?.source?.requestHash!==r.draft.modelScope?.source?.requestHash)throw new Error("Taskset draft identity conflicts with its initialization.");return!0},"completed"),f=this.workspacePath(r.draft.id);await Re({home:this.home,initialized:r,workspacePath:f,completed:n,retainHash:h(d=>{let l=i.get("SELECT payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]),c=b.parse(JSON.parse(l.payload));if(c.workspaceHash&&c.workspaceHash!==d.workspaceHash)throw new Error("Taskset draft initialization produced different files on retry.");i.run("UPDATE model_taskset_draft_operations SET payload = ? WHERE profile_id = ? AND operation_id = ? AND state = 'prepared'",[JSON.stringify(d),t,e.operationId])},"retainHash")}),i.exec("BEGIN IMMEDIATE");try{if(!n()){let d=i.get("SELECT payload FROM model_taskset_draft_operations WHERE profile_id = ? AND operation_id = ?",[t,e.operationId]),l=b.parse(JSON.parse(d.payload)),c=l.draft,k=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:c.id,profileId:t,modelScope:c.modelScope,status:c.status,revision:c.revision,workspacePath:f,packageHash:l.workspaceHash,publishedTasksetRef:c.publishedTasksetRef,createdAt:c.createdAt,updatedAt:c.updatedAt});i.run("INSERT INTO taskset_drafts (id, profile_id, status, revision, payload, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)",[c.id,t,c.status,c.revision,JSON.stringify(k),c.createdAt,c.updatedAt]),i.run("UPDATE model_taskset_draft_operations SET state = 'ready' WHERE profile_id = ? AND operation_id = ?",[t,e.operationId])}i.exec("COMMIT")}catch(d){throw i.exec("ROLLBACK"),d}let p=i.get("SELECT payload FROM taskset_drafts WHERE id = ?",[r.draft.id]);return this.draftFromStoredPayload(JSON.parse(p.payload))}));return this.writeQueue=s.then(()=>{},()=>{}),s}async saveTasksetDraft(t,e,a={}){let s=y.parse(t);await this.ready;let i=this.writeQueue.then(()=>v(this.home,async()=>{let r=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ?",[s.id]),n=r?E.safeParse(JSON.parse(r.payload)):null;if(n?.success){if(n.data.profileId!==s.profileId)throw new Error("Taskset draft profile cannot change.");if(m(n.data.modelScope?{...n.data.modelScope,expectedModelRevision:0}:null)!==m(s.modelScope?{...s.modelScope,expectedModelRevision:0}:null)||!a.refreshModelRevision&&m(n.data.modelScope)!==m(s.modelScope))throw new Error("Taskset draft Model ownership cannot change.");if(n.data.status==="published")throw new Error("Published Taskset drafts are immutable. Initialize a new draft to revise the Taskset.");if(s.revision<n.data.revision||e!==void 0&&n.data.revision!==e)throw new Error("Taskset draft changed before saving. Refresh before saving.")}else if(e!==void 0)throw new Error("Taskset draft is unavailable for saving.");if((!n?.success||a.refreshModelRevision)&&s.modelScope){let c=this.database.get("SELECT payload FROM model_projects WHERE id = ? AND profile_id = ?",[s.modelScope.modelId,s.profileId]);if(!c)throw new Error("Taskset draft Model was not found in this Profile.");if(S.parse(JSON.parse(c.payload)).revision!==s.modelScope.expectedModelRevision)throw new Error("Taskset draft Model changed. Refresh before editing.")}let f=this.workspacePath(s.id),d=(await M(s,f)).draft,l=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:d.id,profileId:d.profileId,modelScope:d.modelScope,status:d.status,revision:d.revision,workspacePath:f,packageHash:await g(f),publishedTasksetRef:d.publishedTasksetRef,createdAt:d.createdAt,updatedAt:d.updatedAt});return await this.savePointer(l,!0),d}));return this.writeQueue=i.then(()=>{},()=>{}),i}async importTasksetDraftPackage(t){let e=O.resolve(t.packagePath),s=(await rt(e)).isDirectory()?e:O.dirname(e);await Le(s);let i=await g(s),r=await q(s),n=await this.getTasksetDraft(r.id);if(n){let c=n.metadata.importedTasksetPackage;if(c&&typeof c=="object"&&!Array.isArray(c)&&c.packageHash===i&&n.profileId===t.profileId)return n;throw new Error(`Taskset draft ${r.id} already exists. Import a package with a distinct Taskset id.`)}let f=y.parse({...r,profileId:t.profileId,modelScope:null,status:"draft",revision:1,publishedTasksetRef:null,metadata:{...r.metadata,importedTasksetPackage:{packageHash:i,importedAt:new Date().toISOString()}},updatedAt:new Date().toISOString()}),p=this.workspacePath(f.id),d=`${p}.import-${process.pid}-${Date.now()}`;await at(O.dirname(p),{recursive:!0});try{await tt(s,d,{recursive:!0,errorOnExist:!0,force:!1,preserveTimestamps:!0}),await M(f,d),await G(d,p)}catch(c){throw await Ne(d,{recursive:!0,force:!0}),c}let l=E.parse({schemaVersion:"openpond.tasksetDraftPointer.v1",id:f.id,profileId:f.profileId,status:f.status,revision:f.revision,workspacePath:p,packageHash:await g(p),publishedTasksetRef:f.publishedTasksetRef,createdAt:f.createdAt,updatedAt:f.updatedAt});return await this.savePointer(l),this.draftFromStoredPayload(l)}async materializePublishedTasksetPackage(t){let e=await this.getTasksetDraftWorkspace(t.draftId);if(!e)throw new Error(`Taskset draft ${t.draftId} workspace was not found.`);if(t.taskset.metadata.sourcePackageHash!==void 0&&t.taskset.metadata.sourcePackageHash!==e.packageHash)throw new Error("Taskset draft files changed before publication. Refresh before publishing.");let a=`draft-${m({taskset:t.taskset,packageHash:e.packageHash})}`,s=await Te(t.taskset,e.workspacePath),i=T.parse({...s.taskset,metadata:{...s.taskset.metadata,sourcePackageHash:e.packageHash},environment:{...s.taskset.environment,metadata:{...s.taskset.environment.metadata,runtimeSourceTasksetId:a}}}),r=T.parse({...i,contentHash:H(i)}),n=await N(this.home,{taskset:r,generatedFiles:s.generatedFiles},a,{source:{directory:e.workspacePath,packageHash:e.packageHash},verify:h(p=>L(p,r),"verify")}),f=await this.getTasksetDraft(t.draftId);return f?.modelScope?.source?be({home:this.home,directory:n,taskset:r,preparation:f.modelScope.source}):{directory:n,taskset:r}}async finalizeTasksetDraftPublication(t){await this.ready;let e=y.parse(t.draft),a=T.parse(t.taskset),s=e.modelScope?.source?.authoringGraph==="bound"&&typeof a.metadata.importedPackageHash=="string"?await D(this.home,a.metadata.importedPackageHash):null,i=this.writeQueue.then(()=>v(this.home,async()=>{let r=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ?",[e.id]);if(!r)throw new Error("Taskset draft was deleted before publication.");let n=E.parse(JSON.parse(r.payload));if(n.profileId!==e.profileId||a.profileId!==e.profileId)throw new Error("Taskset publication belongs to another Profile.");if(m(n.modelScope)!==m(e.modelScope))throw new Error("Taskset draft Model ownership cannot change.");if(n.status==="published"&&n.publishedTasksetRef){let c=n.publishedTasksetRef,k=this.database.get("SELECT payload FROM taskset_revisions WHERE taskset_id = ? AND revision = ? AND content_hash = ?",[c.id,c.revision,c.contentHash]);if(!k)throw new Error("Published draft lost its immutable Taskset revision.");return{draft:y.parse({...e,status:n.status,revision:n.revision,publishedTasksetRef:c,updatedAt:n.updatedAt}),taskset:T.parse(JSON.parse(k.payload))}}if(n.revision!==e.revision||a.metadata.sourcePackageHash!==t.packageHash)throw new Error("Taskset draft changed before publication. Refresh before publishing.");let f=n.modelScope?.source,p=f?.authoringGraph==="bound"&&a.metadata.modelTasksetDerivation&&typeof a.metadata.modelTasksetDerivation=="object"?{...a.metadata.modelTasksetDerivation,schemaVersion:f.lineage.schemaVersion}:a.metadata.modelTasksetAuthoring;if(f&&(a.id!==f.tasksetId||a.revision!==f.tasksetRevision||m(p)!==m(f.lineage)))throw new Error("Taskset publication differs from its retained source preparation.");let d=y.parse({...e,status:"published",revision:e.revision+1,publishedTasksetRef:{id:a.id,revision:a.revision,contentHash:a.contentHash},updatedAt:new Date().toISOString()}),l=E.parse({...n,status:d.status,revision:d.revision,publishedTasksetRef:d.publishedTasksetRef,updatedAt:d.updatedAt});return ke(this.database,a,()=>{if(s&&Ee(this.database,{package:s,taskset:a,generatedFiles:[]}),ve(this.database,e,a,s),this.database.get("SELECT revision FROM taskset_drafts WHERE id = ?",[e.id])?.revision!==e.revision)throw new Error("Taskset draft changed during publication.");this.database.run("UPDATE taskset_drafts SET status = ?, revision = ?, payload = ?, updated_at = ? WHERE id = ?",[l.status,l.revision,JSON.stringify(l),l.updatedAt,e.id])}),{draft:d,taskset:a}}));return this.writeQueue=i.then(()=>{},()=>{}),i}async getTasksetDraft(t){let e=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[t],a=>a);return e===null?null:this.draftFromStoredPayload(e)}async listTasksetDrafts(t){await this.ready,await this.writeQueue;let e=await this.all(t?"SELECT payload FROM taskset_drafts WHERE profile_id = ? ORDER BY updated_at DESC":"SELECT payload FROM taskset_drafts ORDER BY updated_at DESC",t?[t]:[]);return Promise.all(e.map(a=>this.draftFromStoredPayload(JSON.parse(a.payload))))}async readHumanPublishedTasksetDraft(t,e){let a=(await this.listTasksetDrafts(t)).filter(r=>r.status==="published"&&r.modelScope===null&&m(r.publishedTasksetRef)===m(e));if(a.length!==1)return null;let s=a[0],i=await this.getTasksetDraftWorkspace(s.id);return i?{draft:s,workspace:i}:null}async getTasksetDraftWorkspace(t){let e=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[t],s=>s);if(e===null)return null;let a=await this.pointerFromStoredPayload(e);return{draftId:a.id,workspacePath:a.workspacePath,packageHash:await g(a.workspacePath)}}async deleteTasksetDraft(t){await this.ready;let e=this.writeQueue.then(()=>v(this.home,async()=>{let a=this.workspacePath(t),s=`${a}.delete-${et()}`,i=!1;try{await G(a,s),i=!0}catch(r){if(r.code!=="ENOENT")throw r}try{this.database.exec("BEGIN IMMEDIATE");try{this.database.run("DELETE FROM taskset_drafts WHERE id = ?",[t]),this.database.run("UPDATE model_taskset_draft_operations SET state = 'deleted' WHERE draft_id = ?",[t]),this.database.exec("COMMIT")}catch(r){throw this.database.exec("ROLLBACK"),r}}catch(r){throw i&&await G(s,a).catch(()=>{}),r}i&&await Ne(s,{recursive:!0,force:!0})}));this.writeQueue=e.catch(()=>{}),await e}async tasksetDraftFiles(t,e,a){return await this.ready,v(this.home,async()=>{let s=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ? AND profile_id = ?",[e,t]);if(!s)throw new Error("Taskset draft was not found in this Profile.");let i=E.parse(JSON.parse(s.payload));if(a!==void 0){let n=await Oe(i.workspacePath,a);return{draftRevision:i.revision,file:{...n,writable:n.writable&&i.status!=="published"}}}let r=await Ae(i.workspacePath);return{draftRevision:i.revision,files:r.map(n=>({...n,writable:n.writable&&i.status!=="published"}))}})}async saveTasksetDraftFile(t,e){let a=ae.parse(e);await this.ready;let s=this.writeQueue.then(()=>v(this.home,async()=>{let i=this.database.get("SELECT payload FROM taskset_drafts WHERE id = ? AND profile_id = ?",[a.draftId,t]);if(!i)throw new Error("Taskset draft was not found in this Profile.");let r=E.parse(JSON.parse(i.payload));if(r.status==="published")throw new Error("Published Taskset drafts are immutable.");if(r.revision!==a.expectedDraftRevision)throw new Error("Taskset draft changed. Reload before saving a file.");return Fe(r.workspacePath,a,async()=>{let n=E.parse({...r,revision:r.revision+1,packageHash:await g(r.workspacePath),updatedAt:new Date().toISOString()}),f=await this.draftFromStoredPayload(n);this.database.exec("BEGIN IMMEDIATE");try{if(this.database.get("SELECT revision FROM taskset_drafts WHERE id = ? AND profile_id = ?",[a.draftId,t])?.revision!==r.revision)throw new Error("Taskset draft changed during file saving.");this.database.run("UPDATE taskset_drafts SET revision = ?, payload = ?, updated_at = ? WHERE id = ?",[n.revision,JSON.stringify(n),n.updatedAt,n.id]),this.database.exec("COMMIT")}catch(p){throw this.database.exec("ROLLBACK"),p}return f})}));return this.writeQueue=s.then(()=>{},()=>{}),s}workspacePath(t){let e=m(t).slice(0,24);return O.join(this.home,"workspaces","tasksets",`taskset-${e}`)}async draftFromStoredPayload(t){let e=await this.pointerFromStoredPayload(t),a=await q(e.workspacePath);return y.parse({...a,id:e.id,profileId:e.profileId,modelScope:e.modelScope,status:e.status,revision:e.revision,publishedTasksetRef:e.publishedTasksetRef,createdAt:e.createdAt,updatedAt:e.updatedAt})}async pointerFromStoredPayload(t){let e=E.safeParse(t);if(e.success)return e.data;let a=y.parse(t);await this.saveTasksetDraft(a);let s=await this.getParsedPayload("SELECT payload FROM taskset_drafts WHERE id = ?",[a.id],E.parse);if(!s)throw new Error(`Taskset draft ${a.id} migration failed.`);return s}async savePointer(t,e=!1){await(e?this.run.bind(this):this.upsertPayload.bind(this))(`INSERT INTO taskset_drafts (id, profile_id, status, revision, payload, created_at, updated_at)
|
|
3
3
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
4
4
|
ON CONFLICT(id) DO UPDATE SET
|
|
5
5
|
profile_id = excluded.profile_id,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as m,b as g,d as h,e as k}from"./chunk-
|
|
2
|
+
import{a as m,b as g,d as h,e as k}from"./chunk-67U7PAMU.js";import"./chunk-AFYYIJ6K.js";import"./chunk-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{c as f}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as n,f as u}from"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import{a as c}from"./chunk-FTQLQJQV.js";import T from"node:path";async function I(r,l,w={}){let[t,e]=l;if(!t||!e||l.length!==2||!["import","publish","readiness","delete-draft"].includes(t))throw new Error("usage: taskset <import|publish|readiness|delete-draft> <package-path|draft-id|taskset-id> [--profile <id>] [--model <id>] [--json]");let i=f(r)??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??m,d=new URL(i);if(d.protocol!=="http:"||!["127.0.0.1","localhost","::1"].includes(d.hostname))throw new Error("Taskset package import is available only through the local OpenPond app API.");let a=new k({baseUrl:i,request:w.request??await h(i,{maximumResponseBytes:g})}),s=t==="import"?await a.importTasksetDraftPackage({packagePath:T.resolve(e),profileId:n(r,"profile")||"default"}):t==="publish"?await a.publishTasksetDraft(e,n(r,"model")||null):t==="readiness"?await a.tasksetReadiness(e):await a.deleteTasksetDraft(e);if(u(r.json)){console.log(JSON.stringify(s,null,2));return}let o=s&&typeof s=="object"?s:{};if(t==="import"){console.log(`Imported Taskset draft ${String(o.name??o.id??e)}.`),console.log("Open it in Models \u2192 Tasksets to review it, or publish it with the OpenPond CLI.");return}if(t==="publish"){let p=o.taskset&&typeof o.taskset=="object"?o.taskset:{};console.log(`Published Taskset ${String(p.name??p.id??e)}.`);return}if(t==="readiness"){console.log(`Checked Taskset ${e} readiness.`),console.log(JSON.stringify(s,null,2));return}console.log(`Deleted unpublished Taskset draft ${e}.`)}c(I,"runTasksetCommand");export{I as runTasksetCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{m as f}from"./chunk-
|
|
2
|
+
import{m as f}from"./chunk-HYUTDZ3N.js";import"./chunk-RFQD6B44.js";import"./chunk-Y4E5AAI7.js";import"./chunk-CUB6PWAJ.js";import"./chunk-XRKFTPHD.js";import"./chunk-KHDCMVEJ.js";import"./chunk-PPF6EBTQ.js";import"./chunk-BLNEHU62.js";import"./chunk-BT5YNE5U.js";import"./chunk-RPM4FDRX.js";import"./chunk-DFZTRMTL.js";import"./chunk-KP2MYTP5.js";import"./chunk-PNPV2LDE.js";import"./chunk-4G3GTEVS.js";import"./chunk-KU4TPDPH.js";import"./chunk-55YD4UTW.js";import"./chunk-AFYYIJ6K.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-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{a as g,c as a,d}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 s}from"./chunk-FTQLQJQV.js";function c(){return["usage: teams-bot <overview|bind|rebind|diagnostics|diagnostic-run>"," teams-bot overview --team-id <id>"," teams-bot bind --team-id <id> --token <token> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot rebind <bindingId> --team-id <id> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot diagnostics <bindingId> --team-id <id>"," teams-bot diagnostic-run <bindingId> --team-id <id> --prompt <text> [--attachments-json <json-array>] [--action-input-json <json-object>]"].join(`
|
|
3
3
|
`)}s(c,"usage");function u(n,o){if(!(o in n))return;let t=a(n,o);return!t||t==="null"||t==="none"?null:t}s(u,"nullableOption");function b(n){let o=d(n,"usage: teams-bot rebind <bindingId>"),t=u(n,"sandboxId"),r=u(n,"projectId"),i=u(n,"agentId"),e=u(n,"microsoftConnectionId");return{teamId:o,...t!==void 0?{sandboxId:t}:{},...r!==void 0?{projectId:r}:{},...i!==void 0?{agentId:i}:{},...e!==void 0?{microsoftConnectionId:e}:{}}}s(b,"bindingTargetInput");function l(n){let o=a(n,"attachmentsJson");if(!o)return;let t=g(o,"attachments-json");if(!Array.isArray(t))throw new Error("attachments-json must be a JSON array");for(let r of t)if(!r||typeof r!="object"||Array.isArray(r))throw new Error("attachments-json entries must be JSON objects");return t}s(l,"attachmentsInput");function w(n){let o=a(n,"actionInputJson");if(!o)return;let t=g(o,"action-input-json");if(!t||typeof t!="object"||Array.isArray(t))throw new Error("action-input-json must be a JSON object");return t}s(w,"actionInput");async function j(n,o){let t=o[0]||"overview",r=await f(n);if(t==="overview"){let i=d(n,"usage: teams-bot overview");console.log(JSON.stringify(await r.getMicrosoftTeamsBotOverview({teamId:i}),null,2));return}if(t==="bind"){let i=a(n,"token");if(!i)throw new Error(c());let e=await r.bindMicrosoftTeamsBotConversation({...b(n),token:i});console.log(JSON.stringify(e,null,2));return}if(t==="rebind"){let i=o[1]?.trim();if(!i)throw new Error(c());let e=await r.rebindMicrosoftTeamsBotConversation(i,b(n));console.log(JSON.stringify(e,null,2));return}if(t==="diagnostics"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostics <bindingId>");if(!i)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnostic({teamId:e,bindingId:i}),null,2));return}if(t==="diagnostic-run"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostic-run <bindingId>"),m=a(n,"prompt");if(!i||!m)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnosticRun({teamId:e,bindingId:i,prompt:m,attachments:l(n),actionInput:w(n)}),null,2));return}throw new Error(c())}s(j,"runTeamsBotCommand");export{j as runTeamsBotCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-67U7PAMU.js";import"./chunk-AFYYIJ6K.js";import"./chunk-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-SV7ZBEK2.js";import"./chunk-2MEOUS24.js";import"./chunk-HNQPEOJD.js";import"./chunk-RCT3O3HQ.js";import"./chunk-UGOK7VTC.js";import"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import"./chunk-X2J2P5ZT.js";import"./chunk-FTQLQJQV.js";export{a as DEFAULT_LOCAL_TRAINING_API_URL,b as LOCAL_TRAINING_RESPONSE_LIMIT,e as TrainingApiClient,d as createLocalAuthenticatedRequest,c as runTrainingCommand};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as p}from"./chunk-HIMG7S5E.js";import"./chunk-REGKOCDO.js";import{a as h}from"./chunk-JF7WWLNW.js";import{f as g}from"./chunk-RRWL5BHZ.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as s,f as w,h as d}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{a as b}from"./chunk-JXYJQT5Q.js";import"./chunk-NXN7GJOH.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{once as O}from"node:events";import{setTimeout as k}from"node:timers/promises";async function j(r,E){if(E.length!==1)throw new Error("hosted-hardware does not accept an identifier; use --worker-id or --job-id.");let c=w(r.watch);if(c&&!w(r.json))throw new Error("hosted-hardware --watch requires --json for bounded NDJSON output.");let l=r.intervalMs===void 0?1e3:d(r.intervalMs,"interval-ms")??1e3,f=r.timeoutMs===void 0?15e3:d(r.timeoutMs,"timeout-ms")??15e3;if(l<100||l>6e4||f<1e3||f>6e4)throw new Error("Hardware interval must be 100..60000 ms and timeout 1000..60000 ms.");let{baseUrl:I,teamId:S,headers:v}=await p(r),e=new AbortController,a=i(()=>e.abort(),"abort"),u=i(o=>{o.code==="EPIPE"?a():(a(),process.exitCode=1)},"brokenPipe");process.once("SIGTERM",a),process.once("SIGINT",a),process.stdout.on("error",u);let y=g({baseUrl:I,headers:v,fetch:i((o,t)=>h(o,{...t,redirect:"error",signal:AbortSignal.any([e.signal,AbortSignal.timeout(f),...t?.signal?[t.signal]:[]])}),"fetch")}),A={teamId:S,workerId:s(r,"workerId")||void 0,jobId:s(r,"jobId")||void 0,cursor:s(r,"cursor")||void 0,limit:r.limit===void 0?void 0:d(r.limit,"limit")};try{do{let o=Date.now(),t;try{let n=await y.hardwareObservations(A);if(!c){console.log(JSON.stringify(n,null,2));return}t={schemaVersion:"openpond.hardwareWatch.v1",kind:"snapshot",snapshot:n}}catch(n){if(e.signal.aborted)return;if(!c)throw n;t={schemaVersion:"openpond.hardwareWatch.v1",kind:"error",error:b(n)??{code:"HARDWARE_READ_FAILED",message:n instanceof Error?n.message.slice(0,512):"Hardware read failed."}}}let m=JSON.stringify(t)+`
|
|
3
|
+
`;if(Buffer.byteLength(m)>8*1024*1024+1024)throw new Error("Hardware watch record exceeds its wire bound.");process.stdout.write(m)||await O(process.stdout,"drain",{signal:e.signal}),await k(Math.max(0,l-(Date.now()-o)),void 0,{signal:e.signal})}while(!e.signal.aborted)}catch(o){if(!e.signal.aborted)throw o}finally{process.off("SIGTERM",a),process.off("SIGINT",a),process.stdout.off("error",u)}}i(j,"runHardwareObservations");export{j as runHardwareObservations};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import{a as ce}from"./chunk-7OFD6TFD.js";import{a as de}from"./chunk-R2FYCJL6.js";import{a as le}from"./chunk-IHAEZ73V.js";import{a as oe}from"./chunk-7RJOCGQ6.js";import{a as ae}from"./chunk-5G7BQAUA.js";import{a as se}from"./chunk-XOPHFUUY.js";import{im as ne,lb as ee,nf as re,uf as ie,xb as te}from"./chunk-6D3FI2XT.js";import"./chunk-NSSZ2ZIU.js";import"./chunk-4KTGYHCE.js";import{b as A,c as ue}from"./chunk-KP2MYTP5.js";import"./chunk-PNPV2LDE.js";import"./chunk-55YD4UTW.js";import{q as Y,s as H}from"./chunk-AFYYIJ6K.js";import"./chunk-J256AEEE.js";import"./chunk-D6L6UNUQ.js";import"./chunk-AJXWJLZA.js";import"./chunk-OKKNDQJF.js";import{Cb as K,tc as S,uc as W,vc as Q,wc as X,xc as Z}from"./chunk-4PUOWSDE.js";import"./chunk-ZY32SZ2P.js";import"./chunk-OTDDXEQ6.js";import"./chunk-ECOH24MC.js";import{a as G}from"./chunk-HIMG7S5E.js";import"./chunk-REGKOCDO.js";import{a as V}from"./chunk-JF7WWLNW.js";import"./chunk-RRWL5BHZ.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as f,f as I,h as k}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{b as j}from"./chunk-NXN7GJOH.js";import{a as T}from"./chunk-TBODQT4W.js";import{g as z}from"./chunk-5HPZGLOL.js";import"./chunk-ZFJWA4JK.js";import{A as y}from"./chunk-X2J2P5ZT.js";import{a as v}from"./chunk-FTQLQJQV.js";async function pe(t,p={}){let e=process.env.OPENPOND_CHAT_INVOCATION;if(e)try{let i=process.env.OPENPOND_LOCAL_API_URL;if(!i)throw new Error("The chat executor did not supply its local API URL.");let a=new URL(i);if(a.protocol!=="http:"||!["127.0.0.1","localhost","[::1]"].includes(a.hostname)||a.username||a.password)throw new Error("Chat attachment requires the app's loopback API origin.");let h=await(p.request??await(await import("./training-JTYQA7GA.js")).createLocalAuthenticatedRequest(i,{timeoutMs:15e3}))(new URL("/v1/chat-experiments",a),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"attach_training",invocationToken:e,payload:{location:"cloud",...t}}),signal:AbortSignal.timeout(15e3),redirect:"error"});if(!h.ok)throw new Error(`Chat attachment returned HTTP ${h.status}.`)}catch(i){(p.warn??console.error)(`Hosted operation succeeded, but chat attachment failed: ${i instanceof Error?i.message:String(i)}. Inspect the saved job to retry attachment; do not submit it again.`)}}v(pe,"attachHostedTrainingToChat");import{readFile as Ie}from"node:fs/promises";var M=y.string().trim().min(1).max(500),we=y.object({id:M,contentHash:y.string().regex(/^[a-f0-9]{64}$/)}).strict(),ge=y.object({teamId:M,modelId:M,runId:M.optional(),from:y.string().datetime().optional(),to:y.string().datetime().optional()}).strict(),be=y.discriminatedUnion("action",[y.object({action:y.literal("declare_verification"),teamId:M,operationId:M,plan:y.object({modelId:S.shape.modelId,classification:S.shape.classification,feedback:S.shape.feedback,evidence:S.shape.evidence,trainingJobId:S.shape.trainingJobId,checkpoint:S.shape.checkpoint,artifact:S.shape.artifact,taskset:S.shape.taskset,checks:S.shape.checks,baselineOperationId:S.shape.baselineOperationId,candidateOperationId:S.shape.candidateOperationId,criterion:S.shape.criterion}).strict()}).strict(),y.object({action:y.literal("link_live_opportunity"),teamId:M,operationId:M,correction:we,inferenceRequestId:M,grade:y.object({id:M,revision:y.number().int().positive()}).strict(),checkIds:y.array(M).min(1).max(1e3)}).strict()]),ve=y.object({summary:Z.nullable(),observations:y.array(X).max(1e3)}).strict(),U=class{static{v(this,"OpenPondCorrectionMetricsClient")}options;constructor(p){if(!p.apiKey.trim())throw new Error("Learning API key is required.");let e=new URL(p.baseUrl);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.search||e.hash)throw new Error("Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.options={...p,baseUrl:e.toString().replace(/\/+$/,"")}}async request(p,e,i){let a=await(this.options.fetch??globalThis.fetch)(`${this.options.baseUrl}${p}`,{...i,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"Content-Type":"application/json",Accept:"application/json","X-OpenPond-Team-Id":e}}),s;try{s=await ue(a)}catch(h){throw h instanceof T?h:new T(a.ok?502:a.status,"invalid_response","Correction metrics returned an invalid response.",null)}if(!a.ok){let h=y.object({code:y.string().optional(),error:y.string().optional()}).passthrough().safeParse(s);throw new T(a.status,h.success?h.data.code??"correction_request_failed":"correction_request_failed",h.success?h.data.error??`Correction metrics request failed (${a.status}).`:`Correction metrics request failed (${a.status}).`,s)}return s}async read(p,e={}){let i=ge.parse(p),a=ve.parse(await this.request(`/v1/learning/corrections?query=${encodeURIComponent(JSON.stringify(i))}`,i.teamId,{method:"GET",signal:e.signal}));if(a.summary&&(a.summary.scope.teamId!==i.teamId||a.summary.scope.modelId!==i.modelId||i.runId&&a.summary.scope.runId!==i.runId)||a.observations.some(s=>s.modelId!==i.modelId||i.runId&&s.trainingJobId!==i.runId))throw new T(502,"correction_scope_mismatch","Correction metrics did not match the requested workspace, Model or run.",null);return a}async command(p,e={}){let i=be.parse(p);K(i);let a=await this.request("/v1/learning/corrections",i.teamId,{method:"POST",body:JSON.stringify(i),signal:e.signal});if(i.action==="declare_verification"){let h=W.parse(a);if(h.teamId!==i.teamId||h.modelId!==i.plan.modelId||h.trainingJobId!==i.plan.trainingJobId)throw new T(502,"correction_scope_mismatch","Correction declaration did not match the requested workspace, Model or run.",null);return h}let s=Q.parse(a);if(s.correction.id!==i.correction.id||s.correction.contentHash!==i.correction.contentHash||s.attempt.id!==i.inferenceRequestId)throw new T(502,"correction_scope_mismatch","Correction opportunity did not match the declared correction and serving request.",null);return s}};var O=new Set(["succeeded","failed","cancelled"]);function N(t){let p=k(t.intervalMs,"interval-ms")??1e4,e=k(t.cleanupTimeoutMs,"cleanup-timeout-ms")??18e4,i=k(t.cleanupReserveMs,"cleanup-reserve-ms")??18e4;if([p,e,i].some(h=>!Number.isSafeInteger(h)||h>2147483647))throw new Error("Watch intervals and cleanup bounds must fit a positive 32-bit millisecond timer.");if(p<250)throw new Error("--interval-ms must be at least 250.");if(e<1e3||i<1e3)throw new Error("Cleanup timeout and reserve must be at least 1000 ms.");let a=f(t,"deadlineAt");if(!a&&t.cleanupReserveMs!==void 0)throw new Error("--cleanup-reserve-ms requires --deadline-at.");let s=a?Date.parse(a):null;if(a&&(!/T.*(?:Z|[+-]\d{2}:\d{2})$/.test(a)||!Number.isFinite(s)))throw new Error("--deadline-at requires an ISO timestamp with an explicit timezone.");if(s!==null&&s-i<=Date.now())throw new Error("--deadline-at must leave time for execution and the cleanup reserve.");return{intervalMs:p,deadlineAt:s,cancelAt:s===null?null:s-i,waitForCleanup:s!==null||I(t.waitForCleanup)||I(t.cancelOnInfrastructureError),cleanupTimeoutMs:e,cancelOnInfrastructureError:I(t.cancelOnInfrastructureError)}}v(N,"parseHostedWatchOptions");async function J(t,p,e){for(let i=0;i<4;i++){let a=await t.getJob(p);if($(a,p,e),O.has(a.state)||a.state==="cancelling")return a;try{let s=await t.cancelJob(p,a.version);return $(s,p,e,a.submissionHash),s}catch(s){if(!(s instanceof j)||s.status!==409||s.code!=="stale_version"||i===3)throw s}}throw new Error("Hosted cancellation could not reconcile the current Job version.")}v(J,"cancelHostedTrainingJob");async function fe(t,p,e){for(let i=0;i<4;i++){let a=await t.getJob(p);if($(a,p,e),O.has(a.state)||a.state==="cancelling")return a;try{let s=await t.stopAfterGroup(p,a.version);return $(s,p,e,a.submissionHash),s}catch(s){if(!(s instanceof j)||s.status!==409||s.code!=="stale_version"||i===3)throw s}}throw new Error("Hosted graceful stop could not reconcile the current Job version.")}v(fe,"stopHostedTrainingJobAfterGroup");async function L(t){let{client:p,options:e,jobId:i,teamId:a}=t,s=null,h,q=!1;for(;;){let b=Math.min(e.deadlineAt??1/0,s??1/0);if(t.requestBound.deadlineAt=Number.isFinite(b)?b:null,Date.now()>=b)throw me(i);try{let m=e.cancelAt!==null&&Date.now()>=e.cancelAt&&!q?await J(p,i,a):await p.getJob(i);if($(m,i,a,h),h=m.submissionHash,e.cancelOnInfrastructureError&&!q&&!O.has(m.state)&&m.state!=="cancelling"){let g=await p.events(i);if(g.some(C=>C.jobId!==i))throw new Error("Hosted event does not match the watched Job.");let o=g.find(C=>C.type==="rollout_metric"&&C.data.terminalClass==="infrastructure"&&C.data.rewardEligible===!1);o&&(t.print({jobId:i,event:"hosted_watch_infrastructure_failure",trajectoryEventId:o.id,data:o.data}),m=await J(p,i,a),$(m,i,a,h),s??=Date.now()+e.cleanupTimeoutMs)}if(q||=m.state==="cancelling"||O.has(m.state),t.print(m),O.has(m.state)){let g=m.executionMode==="qualification"&&m.state==="succeeded";if(!e.waitForCleanup&&!g)return;s??=Date.now()+e.cleanupTimeoutMs,t.requestBound.deadlineAt=Math.min(e.deadlineAt??1/0,s);let{receipt:o,outputs:C}=await p.outputs(i);if(o){if(o.jobId!==i||o.teamId!==a||o.submissionHash!==h)throw new Error("Hosted cleanup receipt does not match the watched Job and submission.");if(o.cleanupComplete){g&&await te(o,{submissionHash:h,outputs:C}),t.print({jobId:i,cleanup:{scope:"job",complete:!0,receipt:o}});return}}else if(m.rolloutProgress.groupsTarget===0&&t.readNativeInspection){let E=le(await t.readNativeInspection(i),m);if(E.cleanupComplete){t.print({jobId:i,cleanup:{scope:"job",complete:!0,evidence:"native_read_only_attestation",nativeJobVersion:E.nativeJobVersion,attestation:E.cleanupAttestation}});return}}}}catch(m){if(t.requestBound.deadlineAt!==null&&Date.now()>=t.requestBound.deadlineAt)throw me(i);if(e.deadlineAt===null&&s===null||!ye(m))throw m;console.error(JSON.stringify({jobId:i,event:"hosted_watch_retry",code:m instanceof j?m.code:"transport_unavailable"}))}let c=Math.min(t.requestBound.deadlineAt??1/0,!q&&e.cancelAt!==null&&Date.now()<e.cancelAt?e.cancelAt:1/0);await new Promise(m=>setTimeout(m,Math.max(0,Math.min(e.intervalMs,c-Date.now()))))}}v(L,"watchHostedTrainingJob");function $(t,p,e,i){if(t.id!==p||t.teamId!==e||i!==void 0&&t.submissionHash!==i)throw new Error("Hosted response does not match the requested Job, workspace, and submission.")}v($,"assertJobIdentity");function ye(t){return t instanceof j?t.status===429||t.status>=500:t instanceof z?t.code==="invalid_error_response"||t.code==="invalid_json":t instanceof TypeError||t instanceof Error&&["TimeoutError","AbortError"].includes(t.name)}v(ye,"isTransient");function me(t){return new Error(`Hosted watch deadline reached for ${t}; completed job cleanup is unverified. Inspect hosted-status, hosted-artifacts, and provider retirement before treating resources as released.`)}v(me,"cleanupDeadlineError");var P=v(t=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(t),"money"),D=v(t=>t>=3600?`${(t/3600).toFixed(1)} hours`:`${Math.max(1,Math.ceil(t/60))} minutes`,"duration");function F(t,p){if(p){console.log(JSON.stringify(t,null,2));return}console.log(`Estimate ${t.id} (${t.status.replaceAll("_"," ")})`),console.log(`Model: ${t.configuration.modelId}@${t.configuration.modelRevision}`);let e=t.configuration;console.log(`Configuration: ${e.method}${e.loraRank===null?"":`, rank ${e.loraRank}`}${e.groups===null?"":`, ${e.groups} groups`}${e.rolloutConcurrency===null?"":`, ${e.rolloutConcurrency} rollout lanes`}${e.adapterMode===null?"":`, ${e.adapterMode}`}`),console.log(`GPU: ${t.gpu.resolved?.gpuType??"Awaiting a supported offering"} \xD7 ${t.gpu.resolved?.gpuCount??t.gpu.requested.gpuCount??1} (${t.gpu.requested.mode}, ${t.gpu.availability})`);let i=t.cost;console.log(`Expected cost: ${i.expectedUsd===null?"Not yet calibrated":P(i.expectedUsd)}`),i.planningRangeUsd&&console.log(`Planning range: ${P(i.planningRangeUsd.low)}\u2013${P(i.planningRangeUsd.high)}`),console.log(`Execution time: ${t.executionSeconds.expected===null?"Not yet calibrated":D(t.executionSeconds.expected)}`),t.executionSeconds.planningRange&&console.log(`Execution planning range: ${D(t.executionSeconds.planningRange.low)}\u2013${D(t.executionSeconds.planningRange.high)}`),console.log(`Queue wait: ${t.queueWaitSeconds===null?"Start time not yet known":`about ${D(t.queueWaitSeconds.expected)}`}`);let a=t.workload;if(a){let s=a.method==="sft"?a.trainingRows:a.trainingInitialRequests;console.log(`${a.method==="sft"?"Examples":"Initial prompts"} counted: ${s.coverage==="unavailable"?"Unavailable":`${s.counted} of ${s.total??"unknown"} (${s.coverage})`}`);let h=a.method==="sft"?a.trainingRows.totals?.inputTokens:a.trainingInitialRequests.totals?.promptTokens;console.log(`Tokens in counted inputs: ${h??"Unavailable"}`),a.method==="sft"&&a.planned.exampleExposures!==null&&console.log(`Planned workload: ${a.planned.exampleExposures} example exposures, ${a.planned.optimizerSteps} optimizer steps`),s.reason&&console.log(`Token evidence: ${s.reason}`)}console.log(`Recommended maximum budget: ${i.recommendedMaximumUsd===null?"Unavailable with current evidence":P(i.recommendedMaximumUsd)}`),console.log(`Approved hard cap: ${e.approvedMaximumUsd===null?"Not approved":P(e.approvedMaximumUsd)}`),e.approvedMaximumUsd!==null&&i.expectedUsd!==null&&i.expectedUsd>e.approvedMaximumUsd&&console.log("Expected cost exceeds the approved cap. Change the run or explicitly approve a different budget before submission.");for(let s of i.components)s.expectedUsd!==null?console.log(` ${s.phase.replaceAll("_"," ")} / ${s.resource}: ${P(s.expectedUsd)}`):s.evidence==="configured_rate"&&console.log(` ${s.phase.replaceAll("_"," ")} / ${s.resource}: configured rate; expected usage unknown. ${s.reason??""}`);for(let s of t.assumptions)console.log(`Assumption: ${s}`);for(let s of t.unknowns)console.log(`Unknown: ${s}`);console.log(`Evidence: ${t.calibration.completedSamples} completed, ${t.calibration.partialSamples} partial samples; expires ${t.expiresAt}`),console.log("This estimate reserves no resources and approves no spending.")}v(F,"printTrainingEstimate");var d=v(t=>console.log(JSON.stringify(t,null,2)),"print");async function Xe(t,p){let e=p[0],i=p[1],a=e==="hosted-watch"?N(t):null,s=e==="hosted-score-decision"?33e4:18e4,h={deadlineAt:a?.deadlineAt??null},{context:q,baseUrl:b,teamId:c,headers:m}=await G(t),g=v((r,n)=>{let u=h.deadlineAt===null?1/0:h.deadlineAt-Date.now();if(u<=0)throw new DOMException("Hosted watch deadline reached","TimeoutError");let l=AbortSignal.timeout(Math.max(1,Math.min(a?1e4:s,u)));return V(r,{...n,redirect:"error",signal:n?.signal?AbortSignal.any([n.signal,l]):l})},"request"),o=ne({baseUrl:b,headers:m,fetch:g}),C=v(r=>pe({jobId:r,teamId:c,apiOrigin:new URL(b).origin}),"attach"),E=v(async(r,n)=>{d(r),await C(n)},"printAttached"),w=v(async()=>{if(!i)throw new Error(`${e} requires an input JSON file.`);let r=await Ie(i);if(r.byteLength>64*1024*1024)throw new Error("Hosted training input exceeds 64 MiB.");return JSON.parse(r.toString("utf8"))},"readInput"),B=v(async()=>{let r=await w(),{TrainingExperimentSetupReceiptSchema:n,parseAndVerifyTrainingExperimentSetupReceipt:u}=await import("./training-5NT2YB2L.js"),l=n.safeParse(r).success?(await u(r)).preparation:await ie(r);if(l.plan.request.teamId!==c)throw new Error("Preparation belongs to a different workspace.");return l},"readPreparationInput"),_=v(async r=>{let n=await g(new URL(`/v1/managed-rl/jobs/${encodeURIComponent(r)}`,b),{headers:m});if(!n.ok)throw new j(n.status,{schemaVersion:"openpond.trainingApiError.v2",code:"inspection_failed",message:`Hosted job inspection failed (${n.status}).`,retryable:n.status===429||n.status>=500,requestId:null,details:{}});return n.json()},"readNativeInspection");if(p.length>2)throw new Error(`${e} accepts at most one identifier or input file.`);if(["hosted-serving-pools","hosted-base-serving-prepare","hosted-serving-pool-retire"].includes(e??"")){d(await(await import("./training-hosted-serving-N2MHWGZN.js")).runHostedServingCommand({action:e,target:i,baseUrl:b,headers:m,request:g,readInput:w,confirmed:I(t.yes)}));return}if(e&&oe.has(e)){let{runHostedAlphaEditCommand:r}=await import("./training-hosted-alphaedit-HSMRDJTD.js");d(await r({action:e,target:i,teamId:c,options:t,client:o,readInput:w}));return}if(e&&ae.has(e)){let{runHostedNeuronTrainingCommand:r}=await import("./training-hosted-neuron-training-J42WK4EH.js");d(await r({action:e,target:i,teamId:c,options:t,client:o,readInput:w}));return}if(e&&se.has(e)){let{runHostedEngramCommand:r}=await import("./training-hosted-engram-SXO75MFG.js");d(await r({action:e,target:i,teamId:c,options:t,client:o,readInput:w}));return}if(e&&ce.has(e)){let{runHostedDecisionCommand:r}=await import("./training-hosted-decision-7JALOU6O.js");d(await r({action:e,target:i,teamId:c,options:t,client:o,readInput:w}));return}if(e&&de.has(e)){let{runHostedSteeringCommand:r}=await import("./training-hosted-steering-T556BUBG.js");d(await r({action:e,target:i,teamId:c,options:t,client:o,readInput:w}));return}if(e==="hosted-evaluate-checkpoint"){if(!I(t.yes))throw new Error("Paid checkpoint evaluation requires --yes.");let r=(await import("./training-hosted-checkpoint-evaluation-2X7RSOLC.js")).parseCheckpointEvaluationRequest(await w()),n=new Headers(m);n.set("content-type","application/json");let u=await g(new URL("/v1/managed-rl/serving-soaks",b),{method:"POST",headers:n,body:JSON.stringify(r)}),l=await u.json();if(!u.ok){let R=l&&typeof l=="object"&&"error"in l?String(l.error):"checkpoint_evaluation_failed";throw new Error(`Checkpoint evaluation failed (${u.status}): ${R}. Reconcile hosted-jobs before retrying the same immutable request.`)}let x=(await import("./training-hosted-checkpoint-evaluation-2X7RSOLC.js")).parseCheckpointEvaluationResponse(l,r);await E(x,x.job.id);return}if(e==="hosted-provider"||e==="hosted-quotes"){if(i)throw new Error(`${e} does not accept an identifier.`);let r=e==="hosted-provider"?"/v1/managed-rl/provider-inventory":"/v1/managed-rl/quotes",n=await g(new URL(r,b),{headers:m}),u=await n.json();if(!n.ok)throw new Error(`Hosted capacity read failed (${n.status}).`);d(u);return}if(e==="hosted-hardware"){if(i)throw new Error("hosted-hardware does not accept an identifier; use --worker-id or --job-id.");d(await o.hardwareObservations({teamId:c,workerId:f(t,"workerId")||void 0,jobId:f(t,"jobId")||void 0,cursor:f(t,"cursor")||void 0,limit:t.limit===void 0?void 0:k(t.limit,"limit")}));return}if(e==="hosted-workers"||e==="hosted-worker"||e?.startsWith("hosted-worker-")){d(await(await import("./training-hosted-workers-Y2PO5IOA.js")).runHostedWorkerCommand({action:e,target:i,baseUrl:b,headers:m,request:g,readInput:w,confirmed:I(t.yes)}));return}if(e==="hosted-tasksets"){let{OpenPondTasksetCatalogClient:r}=await import("./taskset-catalog-RZYEBCRQ.js"),n=new r({baseUrl:b,apiKey:q.token,teamId:c,fetch:g}),u=f(t,"cursor"),l=f(t,"projectId"),x=f(t,"search"),R=t.limit===void 0?void 0:k(t.limit,"limit");d(i?await n.get(i):await n.list({...u?{afterId:u}:{},...l?{projectId:l}:{},...x?{search:x}:{},...R===void 0?{}:{limit:R}}));return}if(e==="hosted-models"){d(await H({baseUrl:b,headers:m,fetch:g}).list());return}if(e==="hosted-model"){if(!i)throw new Error("hosted-model requires a Model Project ID.");d(await H({baseUrl:b,headers:m,fetch:g}).get(i));return}if(e==="hosted-corrections"||e==="hosted-learning-inspect"){if(!i)throw new Error(`${e} requires a hosted Model Project ID.`);let{project:r}=await H({baseUrl:b,headers:m,fetch:g}).get(i);d(await(await import("./training-hosted-learning-E2N32YU5.js")).inspectHostedLearning({action:e,options:t,teamId:c,model:r,learning:new A({baseUrl:b,apiKey:q.token,scope:c,fetch:g}),corrections:new U({baseUrl:b,apiKey:q.token,fetch:g})}));return}if(e==="hosted-sync-model"){let r=Y.parse(await w());d(await H({baseUrl:b,headers:m,fetch:g}).upsert(r));return}if(e==="hosted-publish-taskset"){let{OpenPondTasksetPackageClient:r,TasksetPackagePublicationSchema:n}=await import("./taskset-packages-WMG5DUBN.js"),u=n.parse(await w());d(await new r({baseUrl:b,apiKey:q.token,teamId:c,fetch:g}).publish(u));return}if(e==="hosted-capabilities"){d(await o.capabilities());return}if(e==="hosted-modification-capabilities"){let{ModelModificationCapabilitiesQuerySchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.teamId!==c)throw new Error("Choose this workspace's model capability query.");d(await o.modificationCapabilities(n));return}if(e==="hosted-review-dataset"){let{DatasetTrainingReviewRequestSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.teamId!==c)throw new Error("Choose this workspace's Dataset review request.");d(await o.reviewDataset(n));return}if(e==="hosted-funding"||e==="hosted-funding-handoff"){let{TrainingFundingRequestSchema:r,TrainingFundingHandoffRequestSchema:n}=await import("./training-5NT2YB2L.js"),u=await w();if(e==="hosted-funding"){let l=r.parse(u);if(l.teamId!==c)throw new Error("Choose this workspace's funding request.");d(await o.funding(l))}else{let l=n.parse(u);if(l.teamId!==c)throw new Error("Choose this workspace's funding request.");d(await o.fundingHandoff(l))}return}if(e==="hosted-gpu-catalog"){let{TrainingGpuCatalogQuerySchema:r}=await import("./training-5NT2YB2L.js"),n=i?r.parse(await w()):void 0;if(n&&n.teamId!==c)throw new Error("Choose this workspace's GPU query.");d(await o.gpuCatalog(n));return}if(e==="hosted-hardware-catalog"){d(await o.hardwareCatalog());return}if(e==="hosted-start-model"){if(!i)throw new Error("training start requires a saved hosted Model Project ID.");let r=await(await import("./training-model-start-P3PXDWNT.js")).startHostedModel({options:t,modelId:i,teamId:c,client:o,models:H({baseUrl:b,headers:m,fetch:g}),learning:new A({baseUrl:b,apiKey:q.token,scope:c,fetch:g})});d(r),r.preparation.jobId&&await C(r.preparation.jobId),r.preparation.jobId&&!I(t.detach)&&await L({client:o,jobId:r.preparation.jobId,teamId:c,options:N(t),print:d,requestBound:h,readNativeInspection:_});return}if(e==="hosted-estimate-model"){if(!i)throw new Error("training estimate requires a hosted Model Project ID.");let{project:r}=await H({baseUrl:b,headers:m,fetch:g}).get(i),n=f(t,"batchId"),u=n?await new A({baseUrl:b,apiKey:q.token,scope:c,fetch:g}).get("batch",n):null,{trainingGpuChoice:l}=await import("./training-model-start-P3PXDWNT.js"),x=l(t)??r.trainingSetup.managedGpuSelection;F(await o.estimate({schemaVersion:"openpond.trainingEstimateRequest.v1",teamId:c,source:{kind:"configuration",id:r.id,expectedRevision:r.revision,expectedEtag:r.etag,batch:u?{id:u.id,revision:u.revision,contentHash:u.contentHash}:null},...x?{gpuSelection:x}:{}}),I(t.json));return}if(e==="hosted-estimate"){let{TrainingEstimateRequestSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.teamId!==c)throw new Error("Estimate input belongs to a different workspace.");F(await o.estimate(n),I(t.json));return}if(e==="hosted-batches"){let r=new A({baseUrl:b,apiKey:q.token,scope:c,fetch:g});d(await r.list("batch",{limit:100}));return}if(e==="hosted-drafts"){if(i)throw new Error("hosted-drafts accepts filters, not an identifier.");let r=f(t,"cursor"),n=f(t,"projectId"),u=f(t,"search"),l=k(t.limit,"--limit");d(await o.listExperimentDrafts(c,{archived:I(t.archived),...r?{cursor:r}:{},...n?{projectId:n}:{},...u?{search:u}:{},...l===void 0?{}:{limit:l}}));return}if(e==="hosted-draft"){if(!i)throw new Error("hosted-draft requires a draft ID.");d(await o.getExperimentDraft(c,i));return}if(e==="hosted-save-draft"){let{ExperimentDraftSaveSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.teamId!==c)throw new Error("This draft belongs to another workspace.");d(await o.saveExperimentDraft(n));return}if(e==="hosted-archive-draft"){let r=f(t,"operationId"),n=k(t.expectedRevision,"--expected-revision");if(!i||!r||n===void 0)throw new Error("hosted-archive-draft requires an ID, --operation-id and --expected-revision.");d(await o.archiveExperimentDraft(i,{schemaVersion:"openpond.experimentDraftArchive.v1",teamId:c,operationId:r,expectedRevision:n}));return}if(e==="hosted-executions"){if(i)throw new Error("hosted-executions accepts filters, not an identifier.");let r=f(t,"cursor"),n=f(t,"projectId"),u=f(t,"datasetHash"),l=f(t,"search"),x=k(t.limit,"--limit");d(await o.listExecutions(c,{...r?{cursor:r}:{},...n?{projectId:n}:{},...u?{datasetHash:u}:{},...l?{search:l}:{},...x===void 0?{}:{limit:x}}));return}if(e==="hosted-save-steering-model"){let{SteeringProfileSaveRequestSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.teamId!==c)throw new Error("Use this result's original workspace.");d(await o.saveModificationResultModel(n));return}if(e==="hosted-steering-profiles"){d(await o.listSteeringProfiles(c,{projectId:f(t,"projectId")||void 0,modelProjectId:f(t,"modelProjectId")||void 0,cursor:f(t,"cursor")||void 0,archived:I(t.archived),limit:k(t.limit,"--limit")}));return}if(e==="hosted-steering-profile"){if(!i)throw new Error("Supply a profile ID.");d(await o.getSteeringProfile(c,i));return}if(e==="hosted-archive-steering-profile"){let r=await w();d(await o.archiveSteeringProfile(r.id,r.request));return}if(e==="hosted-model-version"){if(!i)throw new Error("Supply a Model ID.");let r=f(t,"versionHash");d(await o.modelVersion(i,{teamId:c,...r?{versionHash:r}:{}}));return}if(e==="hosted-modification-executions"){if(i)throw new Error("hosted-modification-executions accepts filters, not an identifier.");let{ManagedModificationExecutionListQuerySchema:r}=await import("./training-5NT2YB2L.js"),n={};for(let l of["id","projectId","method","phase","cursor"]){let x=f(t,l);x&&(n[l]=x)}let u=k(t.limit,"--limit");u!==void 0&&(n.limit=u),d(await o.listModificationExecutions(c,r.parse(n)));return}if(e==="hosted-modification-execution"){if(!i)throw new Error("hosted-modification-execution requires an execution ID.");d(await o.getModificationExecution(c,i));return}if(e==="hosted-compare-modification"){let{compareHostedModification:r,printHostedModificationComparison:n}=await import("./training-hosted-modification-comparison-TXFDJFTG.js"),u=await r({client:o,teamId:c,executionId:i??"",baselineId:f(t,"baseline"),candidateId:f(t,"candidate"),promptId:f(t,"prompt")||void 0});n(u,I(t.json));return}if(e==="hosted-compile-modification"){let{parseManagedModificationCompile:r}=await import("./training-5NT2YB2L.js"),n=r(await w());if(n.teamId!==c)throw new Error("Modification input belongs to a different workspace.");d(await o.compileModificationExecution(n));return}if(e==="hosted-prepare-modification"){let{ManagedModificationPrepareSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.teamId!==c)throw new Error("Modification input belongs to a different workspace.");d(await o.prepareModificationExecution(n));return}if(e==="hosted-start-modification"||e==="hosted-cancel-modification"){let{ManagedModificationStartSchema:r,ManagedModificationCancelSchema:n}=await import("./training-5NT2YB2L.js"),u=e==="hosted-start-modification",l=u?r.parse(await w()):n.parse(await w());if(l.teamId!==c)throw new Error("Modification input belongs to a different workspace.");if(u&&!I(t.yes))throw new Error("Starting paid hosted modification requires --yes.");d(l.action==="start"?await o.startModificationExecution(l):await o.cancelModificationExecution(l));return}if(e==="hosted-preparations"){let r=f(t,"cursor"),n=f(t,"projectId"),u=k(t.limit,"--limit");d(await o.listPreparations(c,{...r?{afterId:r}:{},...n?{projectId:n}:{},...u===void 0?{}:{limit:u}}));return}if(e==="hosted-preparation"){if(!i)throw new Error("hosted-preparation requires a preparation ID.");d(await o.getPreparation(c,i));return}if(e==="hosted-cancel-preparation"){let r=await B();d(await o.cancelPreparation(r.plan.id,{teamId:c,planHash:r.plan.contentHash,expectedRevision:r.revision}));return}if(e==="hosted-prepare-experiment"){let{TrainingExperimentSetupRequestSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.teamId!==c)throw new Error("Experiment input belongs to a different workspace.");d(await o.prepareExperiment(n));return}if(e==="hosted-jobs"){d(await o.listJobs({limit:100}));return}if(e==="hosted-prepare"){let r=re.parse(await w());if(r.teamId!==c)throw new Error("Preparation input belongs to a different workspace.");d(await o.prepareRun(r));return}if(e==="hosted-start"){let r=await B();if(!I(t.yes))throw new Error("Starting paid hosted training requires --yes.");let n=await o.startPreparation(r.plan.id,{teamId:c,planHash:r.plan.contentHash,expectedRevision:r.revision,...r.plan.usageQuote?{usageQuoteHash:r.plan.usageQuote.contentHash}:{}});d(n),n.jobId&&await C(n.jobId);return}if(e==="hosted-stage"){d(await o.stageArtifact(await w()));return}if(e==="hosted-submit"||e==="hosted-qualify"){let r=await ee(await w());if(e==="hosted-qualify"&&(r.job.kind!=="policy_optimize"||r.job.executionMode!=="qualification"))throw new Error("hosted-qualify requires an immutable policy_optimize submission with executionMode=qualification.");if(!I(t.yes))throw new Error("Submitting paid hosted training requires --yes.");if(r.gpuSelection?.gpuCount===2||r.job.kind==="policy_optimize"&&r.job.executionMode==="qualification"){let u=await o.capabilities();if(r.gpuSelection?.gpuCount===2&&!u.policyDataParallel)throw new Error("This hosted runtime has no qualified two-GPU policy-training image.");if(r.job.kind==="policy_optimize"&&r.job.executionMode==="qualification"&&!u.executionModes?.includes("qualification"))throw new Error("This hosted runtime does not advertise original-learner qualification support.")}let n=await o.createJob(r);if(n.teamId!==c||n.submissionHash!==r.contentHash||n.kind!==r.job.kind||r.job.kind==="policy_optimize"&&n.executionMode!==r.job.executionMode)throw new Error(`Hosted submission response identity or execution mode mismatch; inspect hosted-status ${n.id} before attempting another submission.`);await E(n,n.id);return}if(!i)throw new Error(`${e} requires a hosted job ID.`);if(e==="hosted-status"){await E(await o.getJob(i),i);return}if(e==="hosted-save-model"){let{TrainingResultSaveCommandSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.request.teamId!==c)throw new Error("Save this result in its original workspace.");await E(await o.saveResultModel(n.jobId,n.request),n.jobId);return}if(e==="hosted-saved-model"){d(await o.savedModel(i,{teamId:c}));return}if(e==="hosted-model-serving"){let r=await w();d(await o.modelServing(r.modelProjectId,{teamId:c,versionHash:r.versionHash}));return}if(e==="hosted-control-model-serving"){let{TrainingModelServingControlCommandSchema:r}=await import("./training-5NT2YB2L.js"),n=r.parse(await w());if(n.request.teamId!==c)throw new Error("Control serving in its original workspace.");if(n.request.action==="activate"&&!I(t.yes))throw new Error("Activating billed serving capacity requires --yes.");d(await o.controlModelServing(n.modelProjectId,n.request));return}if(e==="hosted-result"){let r=await o.result(i,{teamId:c});await E(r,i);return}if(e==="hosted-report"){let r=await o.getJob(i),[n,u]=await Promise.all([o.events(i),o.outputs(i)]),l=await o.getJob(i);if(l.id!==i||l.teamId!==c||r.id!==i||r.teamId!==c)throw new Error("Hosted report status identity mismatch.");let x=l.recovery?await o.getJob(l.recovery.sourceJobId):void 0,R=l.rolloutProgress.groupsTarget===0?(await import("./training-hosted-serving-report-BAEABGJH.js")).parseHostedServingReportEvidence(await _(i),l):void 0,{buildHostedTrainingReport:he}=await import("./training-hosted-report-T633TNJG.js");await E(he({job:l,events:n,outputs:u,recoverySourceJob:x,servingEvidence:R,versionBeforeRead:r.version,generatedAt:new Date().toISOString()}),i);return}if(e==="hosted-evaluation-tasks"){let r=f(t,"evaluationId");if(!r)throw new Error("hosted-evaluation-tasks requires --evaluation-id from hosted-artifacts.");let u=(await o.outputs(i)).outputs.find(l=>l.kind==="evaluation"&&l.id===r);if(!u)throw new Error("Evaluation does not belong to this job's retained outputs.");d(await o.evaluationTasks(i,{id:u.id,contentHash:u.contentHash},{cursor:f(t,"cursor")||void 0,limit:k(t.limit,"--limit")}));return}if(e==="hosted-trajectory"){let r=f(t,"trajectoryId");if(!r)throw new Error("hosted-trajectory requires --trajectory-id <receipt-id> from hosted-inspect.");let n=await g(new URL(`/v1/managed-rl/jobs/${encodeURIComponent(i)}/trajectories/${encodeURIComponent(r)}`,b),{headers:m});if(!n.ok)throw new Error(`Hosted trajectory read failed (${n.status}).`);d(await n.json());return}if(e==="hosted-feedback"){let{readHostedGraderFeedback:r}=await import("./training-hosted-feedback-5B2KJGOT.js");d(await r({jobId:i,baseUrl:b,headers:m,request:g,trajectoryId:f(t,"trajectoryId")||void 0,evaluationId:f(t,"evaluationId")||void 0,taskId:f(t,"taskId")||void 0}));return}if(e==="hosted-inspect"){d(await _(i));return}if(e==="hosted-recover"){if(!I(t.yes))throw new Error("hosted-recover requires --yes for its explicit funded execution request.");let{jobId:r,...n}=await w();if(typeof r!="string"||!r)throw new Error("hosted-recover requires jobId in its input JSON.");let u=await o.recoverCheckpoint(r,n);await E(u,u.id);return}if(e==="hosted-cancel"){await E(await J(o,i,c),i);return}if(e==="hosted-stop-after-group"){if(!I(t.yes))throw new Error("hosted-stop-after-group requires --yes to shorten the admitted training schedule.");await E(await fe(o,i,c),i);return}if(e==="hosted-artifacts"){await E(await o.outputs(i),i);return}if(e==="hosted-logs"){await E(await o.logs(i),i);return}if(e==="hosted-events"){await E(await o.events(i),i);return}if(e==="hosted-watch"&&a){await C(i),await L({client:o,jobId:i,teamId:c,options:a,print:d,requestBound:h,readNativeInspection:_});return}throw new Error(`Unknown hosted training command: ${e}`)}v(Xe,"runHostedTrainingCommand");export{Xe as runHostedTrainingCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-EXAJ2B4I.js";import"./chunk-2ACX7IW5.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 createHostedWebSearchExecutor,b as createWebSearchExecutorFromEnv,d as normalizeSearchApiUrl,e as normalizeWebSearchRequest,c as resolveWebSearchEndpoint};
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
3
|
-
import{a as
|
|
3
|
+
import{a as u}from"./chunks/chunk-AZ7BL5FL.js";import{b as C}from"./chunks/chunk-Y4E5AAI7.js";import{g as f}from"./chunks/chunk-CUB6PWAJ.js";import{a as l}from"./chunks/chunk-XRKFTPHD.js";import{a as d}from"./chunks/chunk-J7X72QUY.js";import{a as c,b as m}from"./chunks/chunk-BSHAIAXY.js";import"./chunks/chunk-XWPC3AN4.js";import{f as a}from"./chunks/chunk-3M53YXEI.js";import"./chunks/chunk-GLUWATL5.js";import{a as s}from"./chunks/chunk-FTQLQJQV.js";function w(e){return!e.command&&a(e.options.version)?"version":a(e.options.checkUpdate)?"check-update":!e.command&&a(e.options.help)?"help":!e.command&&a(e.options.tui)?"tui":e.command?"command":"ui"}s(w,"resolveCliTopLevelAction");async function P(e=process.argv.slice(2)){if(!await O(e))return d("openpond-cli",()=>h(e))}s(P,"runOpenPondCli");async function h(e){let{command:i,options:o,rest:t}=C(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-DKE7RJZN.js")).resolveOpenPondHome({home:o.home}));let r=w({command:i,options:o});if(r==="version"){console.log(l());return}if(r==="check-update"){await(await import("./chunks/core-commands-ZPBX35M2.js")).runCheckUpdate();return}if(r==="help"){(await import("./chunks/help-UQN5RUPA.js")).printHelp();return}let n=c(o),p=m(o);if(n&&(process.env.OPENPOND_ACCOUNT=n),p&&(process.env.OPENPOND_BASE_URL=p),r==="tui"){await(await import("./chunks/app-layer-YQQNLIXA.js")).runOpenPondTerminalCommand(o,t);return}if(r==="ui"){await(await import("./chunks/app-layer-YQQNLIXA.js")).runOpenPondServerCommand("web",o,t);return}await f({command:i,options:o,rest:t})||((await import("./chunks/help-UQN5RUPA.js")).printHelp(),process.exit(1))}s(h,"runCommandLine");async function O(e){if(e[0]==="__dataset-preparation-authoring")return await(await import("./chunks/dataset-preparation-authoring-UUYFWWCT.js")).runDatasetPreparationAuthoringCli(e.slice(1)),!0;if(e[0]==="__inspect-hosted-profile-evaluation")return await(await import("./chunks/hosted-profile-compiler-FS5R6CHJ.js")).runHostedProfileInspectionCli(e.slice(1)),!0;if(e[0]==="__prepare-hosted-profile-evaluation")return await(await import("./chunks/hosted-profile-compiler-FS5R6CHJ.js")).runHostedProfileEvaluationCli(e.slice(1)),!0;if(e[0]==="__hosted-experiment-improvement")return await(await import("./chunks/hosted-experiment-improvement-VVYXQ65K.js")).runHostedExperimentImprovementCli(e.slice(1)),!0;if(e[0]==="__compile-hosted-profile-candidate")return await(await import("./chunks/hosted-profile-candidate-PTGQLPZO.js")).runHostedProfileCandidateCli(e.slice(1)),!0;if(e[0]==="__compile-hosted-profile")return await(await import("./chunks/hosted-profile-compiler-FS5R6CHJ.js")).runHostedProfileCompilerCli(e.slice(1)),!0;if(e[0]==="__app-server"){process.argv=[process.execPath,"openpond-app-server",...e.slice(1)];let[{createOpenPondAppServer:i},{runOpenPondAppServerCli:o}]=await Promise.all([import("./chunks/app-server-runtime-B7AMBGQZ.js"),import("./chunks/cli-ALEEFAJ7.js")]);return await o(i),!0}if(e[0]==="__server"){process.argv=[process.execPath,"openpond-server",...e.slice(1)];let[{createOpenPondServer:i},{runOpenPondServerCli:o}]=await Promise.all([import("./chunks/src-7RN7BF4W.js"),import("./chunks/cli-ALEEFAJ7.js")]),{createOpenPondAppServer:t}=await import("./chunks/app-server-runtime-B7AMBGQZ.js");return await o({createOpenPondServer:i,createOpenPondAppServer:t}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-LF5X4RNQ.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}s(O,"runEmbeddedCompanion");P().catch(async e=>{if(e instanceof u){process.exitCode=e.exitCode;return}let i=e instanceof Error?e.message:String(e),o=e.issue,t=(await import("./chunks/training-error-WF463UNZ.js")).trainingCliError(e);if(process.argv.includes("--json")&&!(e instanceof Error&&e.name==="OpenPondChildProcessExitError"))console.log(JSON.stringify({error:o??t??{code:"CLI_ERROR",message:i}}));else if(o&&typeof o=="object"){let n=o;console.error(`${n.code}: ${n.message}
|
|
4
4
|
${n.path}
|
|
5
|
-
${n.action}`)}else console.error(t?`${t.code}: ${i}`:i);let r=typeof e.exitCode=="number"?e.exitCode:1;process.exit(r)});export{
|
|
5
|
+
${n.action}`)}else console.error(t?`${t.code}: ${i}`:i);let r=typeof e.exitCode=="number"?e.exitCode:1;process.exit(r)});export{P as runOpenPondCli};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as Qe}from"./chunks/chunk-Q34IF4PW.js";import{a as fe,b as $e,c as ge,d as ye,e as Ve,f as Re,g as Ae,h as Ye,i as Ce,j as Oe}from"./chunks/chunk-6XSSM4WT.js";import{a as ze,b as de,c as Je}from"./chunks/chunk-22UARBPW.js";import"./chunks/chunk-X37KMV27.js";import{A as zt,B as Jt,C as $t,D as Vt,E as Yt,F as Qt,G as Xt,H as Zt,I as en,J as tn,K as nn,L as on,b as Ot,c as St,d as Tt,e as Pt,f as wt,g as Et,h as xt,i as bt,j as Lt,k as Bt,l as Dt,m as It,n as vt,o as Ut,p as Mt,q as _t,r as Ht,s as Nt,t as qt,u as kt,v as Kt,w as Ft,x as Gt,y as jt,z as Wt}from"./chunks/chunk-NRYC4NH6.js";import"./chunks/chunk-EXYSD45J.js";import{A as J,B as $,C as V,D as Y,E as Q,F as X,G as Z,H as ee,I as te,J as ne,K as oe,L as se,M as re,N as ae,O as je,P as le,T as We,U as pe,V as ie,W as ce,X as ue,Y as me,Z as he,_ as Ct,a as ke,b as E,c as x,d as b,e as L,f as B,g as D,h as I,i as v,j as Ke,k as U,m as Fe,n as M,o as _,p as H,q as N,r as q,s as Ge,t as k,u as K,v as F,w as G,x as j,y as W,z}from"./chunks/chunk-JEMECEQH.js";import"./chunks/chunk-73TW6BKK.js";import{a as Rt,b as At}from"./chunks/chunk-27JGS3KB.js";import"./chunks/chunk-BT5YNE5U.js";import{a as Be,b as De,c as Ie,d as ve,e as Ue,f as Me,g as _e,h as He,i as Ne}from"./chunks/chunk-RPM4FDRX.js";import{a as qe}from"./chunks/chunk-KTIBXRWQ.js";import"./chunks/chunk-KP2MYTP5.js";import"./chunks/chunk-PNPV2LDE.js";import"./chunks/chunk-4G3GTEVS.js";import"./chunks/chunk-KU4TPDPH.js";import"./chunks/chunk-55YD4UTW.js";import"./chunks/chunk-AFYYIJ6K.js";import"./chunks/chunk-J256AEEE.js";import"./chunks/chunk-UN2LKLGV.js";import{a as yt}from"./chunks/chunk-2LJCJOJ7.js";import"./chunks/chunk-AMC4Z7G4.js";import"./chunks/chunk-LK77GI6M.js";import"./chunks/chunk-HVM2GUM3.js";import"./chunks/chunk-I6VMRQF4.js";import"./chunks/chunk-D6L6UNUQ.js";import"./chunks/chunk-AJXWJLZA.js";import"./chunks/chunk-OKKNDQJF.js";import"./chunks/chunk-4PUOWSDE.js";import"./chunks/chunk-ZY32SZ2P.js";import"./chunks/chunk-OTDDXEQ6.js";import"./chunks/chunk-ECOH24MC.js";import"./chunks/chunk-3A7HZJNE.js";import{a as sn,b as rn,c as an,d as ln,e as pn,f as cn,g as un,h as mn,i as hn,j as dn,k as fn,l as gn,m as yn,n as Rn,o as An,p as Cn,q as On,r as Sn,s as Tn,t as Pn,u as wn}from"./chunks/chunk-G7X73SBG.js";import{a as P,b as w,c as be,d as Le}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-JCLTFDVW.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-SV7ZBEK2.js";import"./chunks/chunk-2MEOUS24.js";import"./chunks/chunk-HNQPEOJD.js";import"./chunks/chunk-RCT3O3HQ.js";import"./chunks/chunk-UGOK7VTC.js";import"./chunks/chunk-TBODQT4W.js";import"./chunks/chunk-5HPZGLOL.js";import"./chunks/chunk-ZFJWA4JK.js";import"./chunks/chunk-X2J2P5ZT.js";import{a as s}from"./chunks/chunk-FTQLQJQV.js";function Xe(t,e=14){if(t.length<e+1)return null;let r=0,o=0;for(let l=1;l<=e;l+=1){let m=t[l]-t[l-1];m>=0?r+=m:o-=m}let a=r/e,i=o/e;for(let l=e+1;l<t.length;l+=1){let m=t[l]-t[l-1],d=m>0?m:0,n=m<0?-m:0;a=(a*(e-1)+d)/e,i=(i*(e-1)+n)/e}return i===0?100:100-100/(1+a/i)}s(Xe,"computeRsi");function T(t,e){if(t.length<e)return[];let r=[],o=0;for(let a=0;a<t.length;a+=1)o+=t[a],a>=e&&(o-=t[a-e]),a>=e-1&&r.push(o/e);return r}s(T,"computeSmaSeries");function Ze(t,e){let r=T(t,e);return r.length>0?r[r.length-1]:null}s(Ze,"computeSma");function A(t,e){if(t.length<e)return[];let r=2/(e+1),a=t.slice(0,e).reduce((p,l)=>p+l,0)/e,i=[a];for(let p=e;p<t.length;p+=1)a=t[p]*r+a*(1-r),i.push(a);return i}s(A,"computeEmaSeries");function et(t,e){let r=A(t,e);return r.length>0?r[r.length-1]:null}s(et,"computeEma");function tt(t){let e=A(t,12),r=A(t,26);if(e.length===0||r.length===0)return null;let o=e.length-r.length,a=r.map((m,d)=>e[d+o]-m),i=A(a,9);if(i.length===0)return null;let p=a[a.length-1],l=i[i.length-1];return{macd:p,signalLine:l,histogram:p-l}}s(tt,"computeMacd");function nt(t,e,r,o){if(t.length<o)return null;let a=e==="ema"?A(t,r):T(t,r),i=e==="ema"?A(t,o):T(t,o);if(a.length===0||i.length===0)return null;let p=a.length-i.length;if(p<0)return null;let l=i.length-1,m=a[l+p],d=i[l],n=l-1,c=n>=0?a[n+p]:null,u=n>=0?i[n]:null,h="neutral";return c!=null&&u!=null?c<=u&&m>d?h="bullish-cross":c>=u&&m<d?h="bearish-cross":m>d?h="bullish":m<d&&(h="bearish"):m>d?h="bullish":m<d&&(h="bearish"),{fast:m,slow:d,signal:h}}s(nt,"computeMaCross");function ot(t,e=20,r=2){if(t.length<e)return null;let o=t.slice(-e),a=o.reduce((l,m)=>l+m,0)/e,i=o.reduce((l,m)=>l+Math.pow(m-a,2),0)/e,p=Math.sqrt(i);return{middle:a,upper:a+r*p,lower:a-r*p}}s(ot,"computeBollinger");function st(t,e=24){if(t.length<2)return null;let r=t[t.length-1],o=Math.max(0,t.length-1-e),a=t[o];if(a===0)return null;let i=(r-a)/a*100;return{previous:a,percent:i}}s(st,"computePriceChange");function rt(t,e=14){if(t.length<e+1)return null;let r=[];for(let i=1;i<t.length;i+=1){let p=t[i],l=t[i-1],m=p.high-p.low,d=Math.abs(p.high-l.close),n=Math.abs(p.low-l.close);r.push(Math.max(m,d,n))}return r.length<e?null:r.slice(-e).reduce((i,p)=>i+p,0)/e}s(rt,"computeAtr");function Te(t){return t.replace(/\/$/,"")}s(Te,"resolveUrl");function at(t){let e=process.env.OPENPOND_BASE_URL,r=t.baseUrl||e||P;return Te(r.trim())}s(at,"resolveBaseUrl");function lt(t){let e=process.env.OPENPOND_API_URL,r=t.apiUrl||e||w;return Te(r.trim())}s(lt,"resolveApiUrl");function pt(t,e){return fe({apiBaseUrl:e,opChatApiBaseUrl:t.opChatApiUrl,chatApiBaseUrl:t.chatApiUrl})}s(pt,"resolveChatApiUrl");function it(t,e){let r=process.env.OPENPOND_TOOL_URL,o=t.toolUrl||r||e;return Te(o.trim())}s(it,"resolveToolUrl");function ct(t){let e=t.apiKey?.trim();if(e)return e;let r=process.env.OPENPOND_API_KEY?.trim();if(r)return r;throw new Error("OPENPOND_API_KEY is required")}s(ct,"resolveApiKey");function ut(t){let e=t.split("/").filter(Boolean);if(e.length!==2)throw new Error("expected <handle>/<repo>");return{handle:e[0],repo:e[1]}}s(ut,"parseHandleRepo");function Pe(t){return(t||"").trim().toLowerCase()}s(Pe,"normalizeRepoName");function mt(t){if(!t||typeof t!="object")return{name:"unknown",raw:t};let e=t,r=e.profile||e.function,o=typeof e.name=="string"?e.name:typeof r?.name=="string"?r.name:"unknown",a=typeof e.description=="string"?e.description:typeof r?.description=="string"?r.description:void 0;return{name:o,description:a,raw:t}}s(mt,"normalizeToolSummary");function ht(t){if(!t)return[];if(Array.isArray(t.toolsJson))return t.toolsJson;if(t.metadataJson&&typeof t.metadataJson=="object"){let e=t.metadataJson.tools;if(Array.isArray(e))return e}return[]}s(ht,"extractDeploymentTools");async function O(t){let{handle:e,repo:r}=ut(t.target),o=await Se({apiBase:t.apiBase,apiKey:t.apiKey,useCache:t.useCache,cacheTtlMs:t.cacheTtlMs,forceRefresh:t.forceRefresh}),a=Pe(r),i=o.find(p=>p.handle&&p.handle!==e?!1:[p.repo,p.gitRepo,p.id].map(Pe).includes(a));if(!i)throw new Error(`app not found for ${e}/${r}`);return{app:i,handle:e,repo:r}}s(O,"resolveAppTarget");async function Se(t){if(t.useCache&&!t.forceRefresh){let r=await ce({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(r)return r}let e=await v(t.apiBase,t.apiKey);return t.useCache&&await ue({apiBase:t.apiBase,apiKey:t.apiKey,apps:e}),e}s(Se,"fetchAppsWithCache");async function we(t){if(t.useCache&&!t.forceRefresh){let o=await me({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(o)return o}let e=await k(t.apiBase,t.apiKey),r=Array.isArray(e.tools)?e.tools:[];return t.useCache&&await he({apiBase:t.apiBase,apiKey:t.apiKey,tools:r}),r}s(we,"fetchToolsWithCache");function dt(t){if(!t)return"POST";let e=t.toUpperCase();switch(e){case"GET":case"POST":case"PUT":case"DELETE":return e;default:throw new Error("method must be GET, POST, PUT, or DELETE")}}s(dt,"normalizeMethod");async function ft(t,e){let r,o,a;return await de(t,{...e,onConversationId:s(i=>{r=i,e?.onConversationId?.(i)},"onConversationId"),onItems:s(i=>{for(let p of i){let l=p;!o&&typeof l.appId=="string"&&(o=l.appId,e?.onAppId?.(l.appId)),!a&&typeof l.deploymentId=="string"&&(a=l.deploymentId,e?.onDeploymentId?.(l.deploymentId))}e?.onItems?.(i)},"onItems")}),{conversationId:r,appId:o,deploymentId:a}}s(ft,"consumeAgentCreateStream");function vn(t){let e=ct(t),r=at(t),o=lt(t),a=pt(t,o),i=it(t,r),p=t.cacheTtlMs??ie,l=t.useCache!==!1,m=s(async()=>{l&&await Promise.all([Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0}),we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0})])},"refreshCache"),d=s(async(n,c)=>(await D(o,e,n,{branch:c}))?.id??null,"resolveLatestDeploymentId");return{baseUrl:r,apiUrl:o,chatApiUrl:a,toolUrl:i,apiKey:e,account:{get:s(async()=>se(o,e),"get"),health:s(async()=>re(o,e),"health")},chat:{providers:s(async()=>Re({apiBaseUrl:a,token:e}),"providers"),provider:s(async n=>Ae({apiBaseUrl:a,token:e,provider:n}),"provider"),models:s(async()=>ge({apiBaseUrl:a,token:e}),"models"),model:s(async n=>ye({apiBaseUrl:a,token:e,model:n}),"model"),send:s(async n=>Ce({...n,apiBaseUrl:a,token:e}),"send"),stream:s(n=>Oe({...n,apiBaseUrl:a,token:e}),"stream")},tool:{list:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)return{app:u,deploymentId:null,tools:[]};let g=await I(o,e,h),y=ht(g).map(mt);return{app:u,deploymentId:h,tools:y}},"list"),run:s(async(n,c,u)=>{let{app:h}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:u?.forceRefresh}),g=u?.deploymentId||await d(h.id,u?.branch);if(!g)throw new Error("no deployments found");let f=dt(u?.method);return pe(i,e,{appId:h.id,deploymentId:g,toolName:c,method:f,body:u?.body,headers:u?.headers})},"run")},deploy:{watch:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)throw new Error("no deployments found");let g=c?.intervalMs??5e3,f=c?.timeoutMs??240*1e3,y=[],S=new Set,Ee=Date.now(),R=null;for(;Date.now()-Ee<f;){let xe=await L(o,e,h);for(let C of xe)S.has(C.id)||(S.add(C.id),y.push(C),c?.onLog?.(C));if(R=(await B(o,e,h)).status??null,c?.onStatus?.(R),R==="failed")return{deploymentId:h,status:R,logs:y};if(R==="running"||R==="deployed")return{deploymentId:h,status:R,logs:y};await new Promise(C=>setTimeout(C,g))}return{deploymentId:h,status:"timeout",logs:y}},"watch")},template:{status:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return M(o,e,u.id)},"status"),branches:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return _(o,e,u.id)},"branches"),update:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.environment==="preview"?"preview":"production";return H(o,e,u.id,{environment:h})},"update")},opentool:{recipesList:s(async(n={})=>F(o,e,n),"recipesList"),recipesSearch:s(async n=>G(o,e,n),"recipesSearch"),recipeGet:s(async n=>j(o,e,n),"recipeGet"),rulesGet:s(async n=>W(o,e,n),"rulesGet")},apps:{list:s(async n=>{let c=await Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh});return n?.handle?c.filter(u=>u.handle===n.handle):c},"list"),tools:s(async n=>we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh}),"tools"),performance:s(async n=>ne(o,e,{appId:n?.appId}),"performance"),summary:s(async n=>oe(o,e,n.appId),"summary"),schedules:s(async n=>K(o,e,n.appId),"schedules"),schedulesStart:s(async n=>{let{appId:c,...u}=n;return z(o,e,c,u)},"schedulesStart"),schedulesStop:s(async n=>J(o,e,n.appId),"schedulesStop"),schedulesStopCurrent:s(async()=>$(o,e),"schedulesStopCurrent"),scheduleRunNow:s(async n=>V(o,e,n),"scheduleRunNow"),scheduleDelete:s(async n=>Y(o,e,n.appId,n.scheduleId),"scheduleDelete"),scheduleExecutionLogs:s(async n=>Q(o,e,n.scheduleId,{limit:n.limit}),"scheduleExecutionLogs"),scheduleExecutionLog:s(async n=>Z(o,e,n.runId),"scheduleExecutionLog"),deploymentScheduleExecutionLogs:s(async n=>X(o,e,n.deploymentId,{limit:n.limit}),"deploymentScheduleExecutionLogs"),executionTimeline:s(async n=>ee(o,e,n.appId,{limit:n.limit}),"executionTimeline"),assistantRun:s(async n=>ae(o,e,n),"assistantRun"),agentCreate:s(async(n,c)=>{let{refreshCache:u,...h}=n,g={...h,streamDeployLogs:h.streamDeployLogs??!0},f=await te(o,e,g);if(!f.ok){let S=await f.text().catch(()=>"");throw new Error(`agent create failed: ${f.status} ${S}`)}let y=await ft(f,c);if(l&&u!==!1)try{await m()}catch{}return y},"agentCreate"),toolsExecute:s(async n=>le(o,e,n),"toolsExecute"),deploy:s(async n=>E(o,e,n.appId,{environment:n.environment,commitSha:n.commitSha,branch:n.branch}),"deploy"),startApp:s(async n=>{let{appId:c,...u}=n;return b(o,e,c,u)},"startApp"),promotePreview:s(async n=>{let{appId:c,...u}=n;return x(o,e,c,u)},"promotePreview"),envGet:s(async n=>q(o,e,n.appId),"envGet"),envSet:s(async n=>N(o,e,n.appId,{envVars:n.envVars}),"envSet")},repo:{create:s(async n=>{let{refreshCache:c,...u}=n,h=await U(o,e,u);if(l&&c!==!1)try{await m()}catch{}return h},"create")},cache:{refresh:m}}}s(vn,"createClient");export{ie as DEFAULT_CACHE_TTL_MS,It as DEFAULT_LOCAL_PROFILE,w as DEFAULT_OPENPOND_API_BASE_URL,Le as DEFAULT_OPENPOND_CHAT_API_BASE_URL,be as DEFAULT_OPENPOND_OPCHAT_API_BASE_URL,P as DEFAULT_OPENPOND_WEB_BASE_URL,vt as DEFAULT_PROFILE_AGENT,an as OPENPOND_MANIFEST_FILE_NAME,Ot as OpenPondProfileSetupRequiredError,Rt as OpenPondSandboxClient,Dt as PROFILE_MANIFEST,Bt as PROFILE_REPO_MANIFEST,Ct as SANDBOX_RUNTIME_PROFILE_IDS,ln as SANDBOX_TEMPLATE_BUILD_PLAN_FILE_NAME,pn as SANDBOX_TEMPLATE_BUILD_PLAN_KIND,rn as SANDBOX_TEMPLATE_PREVIEW_PORT_MAX,sn as SANDBOX_TEMPLATE_PREVIEW_PORT_MIN,cn as SandboxTemplateManifestSchema,un as SandboxTemplateValidationDiagnosticSchema,qe as apiFetch,Tt as assertOpenPondProfileActionReady,St as buildOpenPondProfileSetupGate,re as checkOpenPondApiHealth,wt as collectProfileSourceUploadEntries,tn as commitActiveProfileChanges,ke as commitFiles,rt as computeAtr,ot as computeBollinger,et as computeEma,A as computeEmaSeries,nt as computeMaCross,tt as computeMacd,st as computePriceChange,Xe as computeRsi,Ze as computeSma,T as computeSmaSeries,ft as consumeAgentCreateStream,de as consumeStream,te as createAgentFromPrompt,vn as createClient,Fe as createHeadlessApps,Ke as createLocalProject,At as createOpenPondSandboxClient,U as createRepo,_t as defaultLocalProfileRepoPath,gn as defineSandboxTemplate,Y as deleteOrArchiveSchedule,E as deployApp,H as deployLatestTemplate,Ht as emptyProfileState,pe as executeHostedTool,le as executeUserTool,Ge as fetchToolManifest,Pt as formatOpenPondProfileSetupRequirement,fn as formatSandboxTemplateDiagnostics,Je as formatStreamItem,q as getAppEnvironment,ee as getAppExecutionTimeline,oe as getAppRuntimeSummary,ce as getCachedApps,me as getCachedTools,Be as getConfigPath,I as getDeploymentDetail,L as getDeploymentLogs,B as getDeploymentStatus,D as getLatestDeploymentForApp,ye as getOpChatModel,Ae as getOpChatProvider,se as getOpenPondAccount,j as getOpenToolRecipe,W as getOpenToolRules,Z as getScheduleExecutionLog,M as getTemplateStatus,ne as getUserPerformance,xt as hostedPublishStatusFromPayload,Lt as hostedRunStatusFromRunSummary,bt as hostedRunSummaryFromPayload,Et as hostedSourceCheckStatusFromPayload,Nt as initLocalProfileRepo,Vt as inspectOpenPondProfileSource,Ft as installAgentPackageIntoActiveProfile,K as listAppSchedules,v as listApps,Ue as listConfiguredProfiles,X as listDeploymentScheduleExecutionLogs,Ve as listHostedModels,Ye as listHostedProviders,ge as listOpChatModels,Re as listOpChatProviders,F as listOpenToolRecipes,Q as listScheduleExecutionLogs,_ as listTemplateBranches,k as listUserTools,ve as loadConfig,Ie as loadGlobalConfig,qt as loadLocalProfileRepo,Wt as loadOpenPondProfileLibrary,Gt as loadOpenPondProfileState,zt as loadOpenPondProfileStateForRef,Yt as loadOpenPondProfileStateFromSource,Mt as mergeActiveLocalProfileConfig,Ut as mergeProfileRepoManifestEntry,ze as normalizeDataFrames,yt as normalizeSandboxApiUrl,jt as openPondProfileRef,dn as parseSandboxTemplateYaml,je as postAgentDigest,on as prepareAgentSdkRuntimePackage,x as promotePreviewToProduction,kt as registerLocalProfileRepo,$t as removeOpenPondProfile,Kt as renameActiveProfileAgent,Qt as requireActiveLocalProfile,$e as resolveHostedChatApiBaseUrl,fe as resolveOpChatApiBaseUrl,We as resolveWorkerBaseUrl,Zt as runAgentSdkProjectCommand,ae as runAssistantMode,Qe as runOpChatSmoke,en as runProfileCheck,Xt as runProfileSdkCommand,V as runScheduleNow,Sn as sandboxTemplateBuildMetadata,Tn as sandboxTemplateBuildPlan,Rn as sandboxTemplateDurableVolume,On as sandboxTemplateExecutableEntries,Cn as sandboxTemplateFileInput,wn as sandboxTemplateJsonSchema,An as sandboxTemplatePreviewPort,yn as sandboxTemplateResources,Pn as sandboxTemplateScaffoldFiles,He as saveConfig,Ne as saveGlobalConfig,_e as saveProfileApiKey,nn as saveProfilePushStatus,G as searchOpenToolRecipes,Jt as selectOpenPondProfile,Ce as sendHostedChatTurn,Me as setActiveProfile,ue as setCachedApps,he as setCachedTools,b as startAppLifecycle,z as startAppSchedules,J as stopAppSchedules,$ as stopCurrentAppSchedules,Oe as streamHostedChatTurn,N as updateAppEnvironment,De as updateGlobalConfig,hn as validateSandboxTemplateManifest,mn as validateSandboxTemplateYaml};
|
|
2
|
+
import{a as Qe}from"./chunks/chunk-Q34IF4PW.js";import{a as fe,b as $e,c as ge,d as ye,e as Ve,f as Re,g as Ae,h as Ye,i as Ce,j as Oe}from"./chunks/chunk-6XSSM4WT.js";import{a as ze,b as de,c as Je}from"./chunks/chunk-22UARBPW.js";import"./chunks/chunk-X37KMV27.js";import{A as zt,B as Jt,C as $t,D as Vt,E as Yt,F as Qt,G as Xt,H as Zt,I as en,J as tn,K as nn,L as on,b as Ot,c as St,d as Tt,e as Pt,f as wt,g as Et,h as xt,i as bt,j as Lt,k as Bt,l as Dt,m as It,n as vt,o as Ut,p as Mt,q as _t,r as Ht,s as Nt,t as qt,u as kt,v as Kt,w as Ft,x as Gt,y as jt,z as Wt}from"./chunks/chunk-NRYC4NH6.js";import"./chunks/chunk-EXYSD45J.js";import{A as J,B as $,C as V,D as Y,E as Q,F as X,G as Z,H as ee,I as te,J as ne,K as oe,L as se,M as re,N as ae,O as je,P as le,T as We,U as pe,V as ie,W as ce,X as ue,Y as me,Z as he,_ as Ct,a as ke,b as E,c as x,d as b,e as L,f as B,g as D,h as I,i as v,j as Ke,k as U,m as Fe,n as M,o as _,p as H,q as N,r as q,s as Ge,t as k,u as K,v as F,w as G,x as j,y as W,z}from"./chunks/chunk-KHDCMVEJ.js";import"./chunks/chunk-PPF6EBTQ.js";import{a as Rt,b as At}from"./chunks/chunk-BLNEHU62.js";import"./chunks/chunk-BT5YNE5U.js";import{a as Be,b as De,c as Ie,d as ve,e as Ue,f as Me,g as _e,h as He,i as Ne}from"./chunks/chunk-RPM4FDRX.js";import{a as qe}from"./chunks/chunk-DFZTRMTL.js";import"./chunks/chunk-KP2MYTP5.js";import"./chunks/chunk-PNPV2LDE.js";import"./chunks/chunk-4G3GTEVS.js";import"./chunks/chunk-KU4TPDPH.js";import"./chunks/chunk-55YD4UTW.js";import"./chunks/chunk-AFYYIJ6K.js";import"./chunks/chunk-J256AEEE.js";import"./chunks/chunk-J7X72QUY.js";import"./chunks/chunk-UN2LKLGV.js";import{a as yt}from"./chunks/chunk-HLJJAOI2.js";import"./chunks/chunk-AMC4Z7G4.js";import"./chunks/chunk-LK77GI6M.js";import"./chunks/chunk-HVM2GUM3.js";import"./chunks/chunk-I6VMRQF4.js";import"./chunks/chunk-D6L6UNUQ.js";import"./chunks/chunk-AJXWJLZA.js";import"./chunks/chunk-OKKNDQJF.js";import"./chunks/chunk-4PUOWSDE.js";import"./chunks/chunk-ZY32SZ2P.js";import"./chunks/chunk-OTDDXEQ6.js";import"./chunks/chunk-ECOH24MC.js";import"./chunks/chunk-3A7HZJNE.js";import{a as sn,b as rn,c as an,d as ln,e as pn,f as cn,g as un,h as mn,i as hn,j as dn,k as fn,l as gn,m as yn,n as Rn,o as An,p as Cn,q as On,r as Sn,s as Tn,t as Pn,u as wn}from"./chunks/chunk-G7X73SBG.js";import{a as P,b as w,c as be,d as Le}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-MZKCW6CB.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-SV7ZBEK2.js";import"./chunks/chunk-2MEOUS24.js";import"./chunks/chunk-HNQPEOJD.js";import"./chunks/chunk-RCT3O3HQ.js";import"./chunks/chunk-UGOK7VTC.js";import"./chunks/chunk-TBODQT4W.js";import"./chunks/chunk-5HPZGLOL.js";import"./chunks/chunk-ZFJWA4JK.js";import"./chunks/chunk-X2J2P5ZT.js";import{a as s}from"./chunks/chunk-FTQLQJQV.js";function Xe(t,e=14){if(t.length<e+1)return null;let r=0,o=0;for(let l=1;l<=e;l+=1){let m=t[l]-t[l-1];m>=0?r+=m:o-=m}let a=r/e,i=o/e;for(let l=e+1;l<t.length;l+=1){let m=t[l]-t[l-1],d=m>0?m:0,n=m<0?-m:0;a=(a*(e-1)+d)/e,i=(i*(e-1)+n)/e}return i===0?100:100-100/(1+a/i)}s(Xe,"computeRsi");function T(t,e){if(t.length<e)return[];let r=[],o=0;for(let a=0;a<t.length;a+=1)o+=t[a],a>=e&&(o-=t[a-e]),a>=e-1&&r.push(o/e);return r}s(T,"computeSmaSeries");function Ze(t,e){let r=T(t,e);return r.length>0?r[r.length-1]:null}s(Ze,"computeSma");function A(t,e){if(t.length<e)return[];let r=2/(e+1),a=t.slice(0,e).reduce((p,l)=>p+l,0)/e,i=[a];for(let p=e;p<t.length;p+=1)a=t[p]*r+a*(1-r),i.push(a);return i}s(A,"computeEmaSeries");function et(t,e){let r=A(t,e);return r.length>0?r[r.length-1]:null}s(et,"computeEma");function tt(t){let e=A(t,12),r=A(t,26);if(e.length===0||r.length===0)return null;let o=e.length-r.length,a=r.map((m,d)=>e[d+o]-m),i=A(a,9);if(i.length===0)return null;let p=a[a.length-1],l=i[i.length-1];return{macd:p,signalLine:l,histogram:p-l}}s(tt,"computeMacd");function nt(t,e,r,o){if(t.length<o)return null;let a=e==="ema"?A(t,r):T(t,r),i=e==="ema"?A(t,o):T(t,o);if(a.length===0||i.length===0)return null;let p=a.length-i.length;if(p<0)return null;let l=i.length-1,m=a[l+p],d=i[l],n=l-1,c=n>=0?a[n+p]:null,u=n>=0?i[n]:null,h="neutral";return c!=null&&u!=null?c<=u&&m>d?h="bullish-cross":c>=u&&m<d?h="bearish-cross":m>d?h="bullish":m<d&&(h="bearish"):m>d?h="bullish":m<d&&(h="bearish"),{fast:m,slow:d,signal:h}}s(nt,"computeMaCross");function ot(t,e=20,r=2){if(t.length<e)return null;let o=t.slice(-e),a=o.reduce((l,m)=>l+m,0)/e,i=o.reduce((l,m)=>l+Math.pow(m-a,2),0)/e,p=Math.sqrt(i);return{middle:a,upper:a+r*p,lower:a-r*p}}s(ot,"computeBollinger");function st(t,e=24){if(t.length<2)return null;let r=t[t.length-1],o=Math.max(0,t.length-1-e),a=t[o];if(a===0)return null;let i=(r-a)/a*100;return{previous:a,percent:i}}s(st,"computePriceChange");function rt(t,e=14){if(t.length<e+1)return null;let r=[];for(let i=1;i<t.length;i+=1){let p=t[i],l=t[i-1],m=p.high-p.low,d=Math.abs(p.high-l.close),n=Math.abs(p.low-l.close);r.push(Math.max(m,d,n))}return r.length<e?null:r.slice(-e).reduce((i,p)=>i+p,0)/e}s(rt,"computeAtr");function Te(t){return t.replace(/\/$/,"")}s(Te,"resolveUrl");function at(t){let e=process.env.OPENPOND_BASE_URL,r=t.baseUrl||e||P;return Te(r.trim())}s(at,"resolveBaseUrl");function lt(t){let e=process.env.OPENPOND_API_URL,r=t.apiUrl||e||w;return Te(r.trim())}s(lt,"resolveApiUrl");function pt(t,e){return fe({apiBaseUrl:e,opChatApiBaseUrl:t.opChatApiUrl,chatApiBaseUrl:t.chatApiUrl})}s(pt,"resolveChatApiUrl");function it(t,e){let r=process.env.OPENPOND_TOOL_URL,o=t.toolUrl||r||e;return Te(o.trim())}s(it,"resolveToolUrl");function ct(t){let e=t.apiKey?.trim();if(e)return e;let r=process.env.OPENPOND_API_KEY?.trim();if(r)return r;throw new Error("OPENPOND_API_KEY is required")}s(ct,"resolveApiKey");function ut(t){let e=t.split("/").filter(Boolean);if(e.length!==2)throw new Error("expected <handle>/<repo>");return{handle:e[0],repo:e[1]}}s(ut,"parseHandleRepo");function Pe(t){return(t||"").trim().toLowerCase()}s(Pe,"normalizeRepoName");function mt(t){if(!t||typeof t!="object")return{name:"unknown",raw:t};let e=t,r=e.profile||e.function,o=typeof e.name=="string"?e.name:typeof r?.name=="string"?r.name:"unknown",a=typeof e.description=="string"?e.description:typeof r?.description=="string"?r.description:void 0;return{name:o,description:a,raw:t}}s(mt,"normalizeToolSummary");function ht(t){if(!t)return[];if(Array.isArray(t.toolsJson))return t.toolsJson;if(t.metadataJson&&typeof t.metadataJson=="object"){let e=t.metadataJson.tools;if(Array.isArray(e))return e}return[]}s(ht,"extractDeploymentTools");async function O(t){let{handle:e,repo:r}=ut(t.target),o=await Se({apiBase:t.apiBase,apiKey:t.apiKey,useCache:t.useCache,cacheTtlMs:t.cacheTtlMs,forceRefresh:t.forceRefresh}),a=Pe(r),i=o.find(p=>p.handle&&p.handle!==e?!1:[p.repo,p.gitRepo,p.id].map(Pe).includes(a));if(!i)throw new Error(`app not found for ${e}/${r}`);return{app:i,handle:e,repo:r}}s(O,"resolveAppTarget");async function Se(t){if(t.useCache&&!t.forceRefresh){let r=await ce({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(r)return r}let e=await v(t.apiBase,t.apiKey);return t.useCache&&await ue({apiBase:t.apiBase,apiKey:t.apiKey,apps:e}),e}s(Se,"fetchAppsWithCache");async function we(t){if(t.useCache&&!t.forceRefresh){let o=await me({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(o)return o}let e=await k(t.apiBase,t.apiKey),r=Array.isArray(e.tools)?e.tools:[];return t.useCache&&await he({apiBase:t.apiBase,apiKey:t.apiKey,tools:r}),r}s(we,"fetchToolsWithCache");function dt(t){if(!t)return"POST";let e=t.toUpperCase();switch(e){case"GET":case"POST":case"PUT":case"DELETE":return e;default:throw new Error("method must be GET, POST, PUT, or DELETE")}}s(dt,"normalizeMethod");async function ft(t,e){let r,o,a;return await de(t,{...e,onConversationId:s(i=>{r=i,e?.onConversationId?.(i)},"onConversationId"),onItems:s(i=>{for(let p of i){let l=p;!o&&typeof l.appId=="string"&&(o=l.appId,e?.onAppId?.(l.appId)),!a&&typeof l.deploymentId=="string"&&(a=l.deploymentId,e?.onDeploymentId?.(l.deploymentId))}e?.onItems?.(i)},"onItems")}),{conversationId:r,appId:o,deploymentId:a}}s(ft,"consumeAgentCreateStream");function vn(t){let e=ct(t),r=at(t),o=lt(t),a=pt(t,o),i=it(t,r),p=t.cacheTtlMs??ie,l=t.useCache!==!1,m=s(async()=>{l&&await Promise.all([Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0}),we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0})])},"refreshCache"),d=s(async(n,c)=>(await D(o,e,n,{branch:c}))?.id??null,"resolveLatestDeploymentId");return{baseUrl:r,apiUrl:o,chatApiUrl:a,toolUrl:i,apiKey:e,account:{get:s(async()=>se(o,e),"get"),health:s(async()=>re(o,e),"health")},chat:{providers:s(async()=>Re({apiBaseUrl:a,token:e}),"providers"),provider:s(async n=>Ae({apiBaseUrl:a,token:e,provider:n}),"provider"),models:s(async()=>ge({apiBaseUrl:a,token:e}),"models"),model:s(async n=>ye({apiBaseUrl:a,token:e,model:n}),"model"),send:s(async n=>Ce({...n,apiBaseUrl:a,token:e}),"send"),stream:s(n=>Oe({...n,apiBaseUrl:a,token:e}),"stream")},tool:{list:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)return{app:u,deploymentId:null,tools:[]};let g=await I(o,e,h),y=ht(g).map(mt);return{app:u,deploymentId:h,tools:y}},"list"),run:s(async(n,c,u)=>{let{app:h}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:u?.forceRefresh}),g=u?.deploymentId||await d(h.id,u?.branch);if(!g)throw new Error("no deployments found");let f=dt(u?.method);return pe(i,e,{appId:h.id,deploymentId:g,toolName:c,method:f,body:u?.body,headers:u?.headers})},"run")},deploy:{watch:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)throw new Error("no deployments found");let g=c?.intervalMs??5e3,f=c?.timeoutMs??240*1e3,y=[],S=new Set,Ee=Date.now(),R=null;for(;Date.now()-Ee<f;){let xe=await L(o,e,h);for(let C of xe)S.has(C.id)||(S.add(C.id),y.push(C),c?.onLog?.(C));if(R=(await B(o,e,h)).status??null,c?.onStatus?.(R),R==="failed")return{deploymentId:h,status:R,logs:y};if(R==="running"||R==="deployed")return{deploymentId:h,status:R,logs:y};await new Promise(C=>setTimeout(C,g))}return{deploymentId:h,status:"timeout",logs:y}},"watch")},template:{status:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return M(o,e,u.id)},"status"),branches:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return _(o,e,u.id)},"branches"),update:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.environment==="preview"?"preview":"production";return H(o,e,u.id,{environment:h})},"update")},opentool:{recipesList:s(async(n={})=>F(o,e,n),"recipesList"),recipesSearch:s(async n=>G(o,e,n),"recipesSearch"),recipeGet:s(async n=>j(o,e,n),"recipeGet"),rulesGet:s(async n=>W(o,e,n),"rulesGet")},apps:{list:s(async n=>{let c=await Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh});return n?.handle?c.filter(u=>u.handle===n.handle):c},"list"),tools:s(async n=>we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh}),"tools"),performance:s(async n=>ne(o,e,{appId:n?.appId}),"performance"),summary:s(async n=>oe(o,e,n.appId),"summary"),schedules:s(async n=>K(o,e,n.appId),"schedules"),schedulesStart:s(async n=>{let{appId:c,...u}=n;return z(o,e,c,u)},"schedulesStart"),schedulesStop:s(async n=>J(o,e,n.appId),"schedulesStop"),schedulesStopCurrent:s(async()=>$(o,e),"schedulesStopCurrent"),scheduleRunNow:s(async n=>V(o,e,n),"scheduleRunNow"),scheduleDelete:s(async n=>Y(o,e,n.appId,n.scheduleId),"scheduleDelete"),scheduleExecutionLogs:s(async n=>Q(o,e,n.scheduleId,{limit:n.limit}),"scheduleExecutionLogs"),scheduleExecutionLog:s(async n=>Z(o,e,n.runId),"scheduleExecutionLog"),deploymentScheduleExecutionLogs:s(async n=>X(o,e,n.deploymentId,{limit:n.limit}),"deploymentScheduleExecutionLogs"),executionTimeline:s(async n=>ee(o,e,n.appId,{limit:n.limit}),"executionTimeline"),assistantRun:s(async n=>ae(o,e,n),"assistantRun"),agentCreate:s(async(n,c)=>{let{refreshCache:u,...h}=n,g={...h,streamDeployLogs:h.streamDeployLogs??!0},f=await te(o,e,g);if(!f.ok){let S=await f.text().catch(()=>"");throw new Error(`agent create failed: ${f.status} ${S}`)}let y=await ft(f,c);if(l&&u!==!1)try{await m()}catch{}return y},"agentCreate"),toolsExecute:s(async n=>le(o,e,n),"toolsExecute"),deploy:s(async n=>E(o,e,n.appId,{environment:n.environment,commitSha:n.commitSha,branch:n.branch}),"deploy"),startApp:s(async n=>{let{appId:c,...u}=n;return b(o,e,c,u)},"startApp"),promotePreview:s(async n=>{let{appId:c,...u}=n;return x(o,e,c,u)},"promotePreview"),envGet:s(async n=>q(o,e,n.appId),"envGet"),envSet:s(async n=>N(o,e,n.appId,{envVars:n.envVars}),"envSet")},repo:{create:s(async n=>{let{refreshCache:c,...u}=n,h=await U(o,e,u);if(l&&c!==!1)try{await m()}catch{}return h},"create")},cache:{refresh:m}}}s(vn,"createClient");export{ie as DEFAULT_CACHE_TTL_MS,It as DEFAULT_LOCAL_PROFILE,w as DEFAULT_OPENPOND_API_BASE_URL,Le as DEFAULT_OPENPOND_CHAT_API_BASE_URL,be as DEFAULT_OPENPOND_OPCHAT_API_BASE_URL,P as DEFAULT_OPENPOND_WEB_BASE_URL,vt as DEFAULT_PROFILE_AGENT,an as OPENPOND_MANIFEST_FILE_NAME,Ot as OpenPondProfileSetupRequiredError,Rt as OpenPondSandboxClient,Dt as PROFILE_MANIFEST,Bt as PROFILE_REPO_MANIFEST,Ct as SANDBOX_RUNTIME_PROFILE_IDS,ln as SANDBOX_TEMPLATE_BUILD_PLAN_FILE_NAME,pn as SANDBOX_TEMPLATE_BUILD_PLAN_KIND,rn as SANDBOX_TEMPLATE_PREVIEW_PORT_MAX,sn as SANDBOX_TEMPLATE_PREVIEW_PORT_MIN,cn as SandboxTemplateManifestSchema,un as SandboxTemplateValidationDiagnosticSchema,qe as apiFetch,Tt as assertOpenPondProfileActionReady,St as buildOpenPondProfileSetupGate,re as checkOpenPondApiHealth,wt as collectProfileSourceUploadEntries,tn as commitActiveProfileChanges,ke as commitFiles,rt as computeAtr,ot as computeBollinger,et as computeEma,A as computeEmaSeries,nt as computeMaCross,tt as computeMacd,st as computePriceChange,Xe as computeRsi,Ze as computeSma,T as computeSmaSeries,ft as consumeAgentCreateStream,de as consumeStream,te as createAgentFromPrompt,vn as createClient,Fe as createHeadlessApps,Ke as createLocalProject,At as createOpenPondSandboxClient,U as createRepo,_t as defaultLocalProfileRepoPath,gn as defineSandboxTemplate,Y as deleteOrArchiveSchedule,E as deployApp,H as deployLatestTemplate,Ht as emptyProfileState,pe as executeHostedTool,le as executeUserTool,Ge as fetchToolManifest,Pt as formatOpenPondProfileSetupRequirement,fn as formatSandboxTemplateDiagnostics,Je as formatStreamItem,q as getAppEnvironment,ee as getAppExecutionTimeline,oe as getAppRuntimeSummary,ce as getCachedApps,me as getCachedTools,Be as getConfigPath,I as getDeploymentDetail,L as getDeploymentLogs,B as getDeploymentStatus,D as getLatestDeploymentForApp,ye as getOpChatModel,Ae as getOpChatProvider,se as getOpenPondAccount,j as getOpenToolRecipe,W as getOpenToolRules,Z as getScheduleExecutionLog,M as getTemplateStatus,ne as getUserPerformance,xt as hostedPublishStatusFromPayload,Lt as hostedRunStatusFromRunSummary,bt as hostedRunSummaryFromPayload,Et as hostedSourceCheckStatusFromPayload,Nt as initLocalProfileRepo,Vt as inspectOpenPondProfileSource,Ft as installAgentPackageIntoActiveProfile,K as listAppSchedules,v as listApps,Ue as listConfiguredProfiles,X as listDeploymentScheduleExecutionLogs,Ve as listHostedModels,Ye as listHostedProviders,ge as listOpChatModels,Re as listOpChatProviders,F as listOpenToolRecipes,Q as listScheduleExecutionLogs,_ as listTemplateBranches,k as listUserTools,ve as loadConfig,Ie as loadGlobalConfig,qt as loadLocalProfileRepo,Wt as loadOpenPondProfileLibrary,Gt as loadOpenPondProfileState,zt as loadOpenPondProfileStateForRef,Yt as loadOpenPondProfileStateFromSource,Mt as mergeActiveLocalProfileConfig,Ut as mergeProfileRepoManifestEntry,ze as normalizeDataFrames,yt as normalizeSandboxApiUrl,jt as openPondProfileRef,dn as parseSandboxTemplateYaml,je as postAgentDigest,on as prepareAgentSdkRuntimePackage,x as promotePreviewToProduction,kt as registerLocalProfileRepo,$t as removeOpenPondProfile,Kt as renameActiveProfileAgent,Qt as requireActiveLocalProfile,$e as resolveHostedChatApiBaseUrl,fe as resolveOpChatApiBaseUrl,We as resolveWorkerBaseUrl,Zt as runAgentSdkProjectCommand,ae as runAssistantMode,Qe as runOpChatSmoke,en as runProfileCheck,Xt as runProfileSdkCommand,V as runScheduleNow,Sn as sandboxTemplateBuildMetadata,Tn as sandboxTemplateBuildPlan,Rn as sandboxTemplateDurableVolume,On as sandboxTemplateExecutableEntries,Cn as sandboxTemplateFileInput,wn as sandboxTemplateJsonSchema,An as sandboxTemplatePreviewPort,yn as sandboxTemplateResources,Pn as sandboxTemplateScaffoldFiles,He as saveConfig,Ne as saveGlobalConfig,_e as saveProfileApiKey,nn as saveProfilePushStatus,G as searchOpenToolRecipes,Jt as selectOpenPondProfile,Ce as sendHostedChatTurn,Me as setActiveProfile,ue as setCachedApps,he as setCachedTools,b as startAppLifecycle,z as startAppSchedules,J as stopAppSchedules,$ as stopCurrentAppSchedules,Oe as streamHostedChatTurn,N as updateAppEnvironment,De as updateGlobalConfig,hn as validateSandboxTemplateManifest,mn as validateSandboxTemplateYaml};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OpenPondSandboxRuntimeHandle, SandboxExecInput, SandboxFileDownloadInput, SandboxFileListInput, SandboxFileMkdirInput, SandboxFileMoveInput, SandboxFileSearchInput, SandboxOpenPortInput, SandboxRecord, SandboxRuntime, SandboxRuntimeCheckpointInput, SandboxRuntimeEventInput, SandboxRuntimePromoteInput, SandboxRuntimePromoteResponse, SandboxRuntimeSourcePreserveInput, SandboxRuntimeSourcePreserveResponse, SandboxRuntimeSandboxCreateInput, SandboxRuntimeSandboxResponse, SandboxRuntimeTransitionInput, SandboxRuntimeEventsResponse, SandboxRuntimeEventResponse, SandboxAsyncRequestOptions, SandboxFileUploadResponse, SandboxFileDownloadResponse, SandboxFileDeleteResponse, SandboxFileListResponse, SandboxFileMkdirResponse, SandboxFileMoveResponse, SandboxFileStatResponse, SandboxFileSearchResponse, SandboxOpenPortResponse, SandboxExecResponse } from "./types/index.js";
|
|
1
|
+
import type { OpenPondSandboxRuntimeHandle, SandboxExecInput, SandboxFileDownloadInput, SandboxFileListInput, SandboxFileMkdirInput, SandboxFileMoveInput, SandboxFileSearchInput, SandboxOpenPortInput, SandboxRecord, SandboxRestoreInput, SandboxRestoreResponse, SandboxStartInput, SandboxRuntime, SandboxRuntimeCheckpointInput, SandboxRuntimeEventInput, SandboxRuntimePromoteInput, SandboxRuntimePromoteResponse, SandboxRuntimeSourcePreserveInput, SandboxRuntimeSourcePreserveResponse, SandboxRuntimeSandboxCreateInput, SandboxRuntimeSandboxResponse, SandboxRuntimeTransitionInput, SandboxRuntimeEventsResponse, SandboxRuntimeEventResponse, SandboxAsyncRequestOptions, SandboxFileUploadResponse, SandboxFileDownloadResponse, SandboxFileDeleteResponse, SandboxFileListResponse, SandboxFileMkdirResponse, SandboxFileMoveResponse, SandboxFileStatResponse, SandboxFileSearchResponse, SandboxOpenPortResponse, SandboxExecResponse } from "./types/index.js";
|
|
2
2
|
export type SandboxRuntimeHandleClient = {
|
|
3
3
|
getSandboxRuntime(runtimeId: string): Promise<SandboxRuntime>;
|
|
4
4
|
createSandboxRuntimeSandbox(runtimeId: string, input?: SandboxRuntimeSandboxCreateInput, options?: SandboxAsyncRequestOptions): Promise<SandboxRuntimeSandboxResponse>;
|
|
@@ -13,12 +13,10 @@ export type SandboxRuntimeHandleClient = {
|
|
|
13
13
|
teamId?: string;
|
|
14
14
|
}): Promise<SandboxRuntimeSourcePreserveResponse>;
|
|
15
15
|
get(sandboxId: string): Promise<SandboxRecord>;
|
|
16
|
-
start(sandboxId: string, options?: SandboxAsyncRequestOptions): Promise<{
|
|
17
|
-
sandbox: SandboxRecord;
|
|
18
|
-
}>;
|
|
19
|
-
restore(sandboxId: string): Promise<{
|
|
16
|
+
start(sandboxId: string, options?: SandboxAsyncRequestOptions & SandboxStartInput): Promise<{
|
|
20
17
|
sandbox: SandboxRecord;
|
|
21
18
|
}>;
|
|
19
|
+
restore(sandboxId: string, input?: SandboxRestoreInput): Promise<SandboxRestoreResponse>;
|
|
22
20
|
uploadFile(sandboxId: string, path: string, contents: string): Promise<SandboxFileUploadResponse>;
|
|
23
21
|
downloadFile(sandboxId: string, path: string): Promise<string>;
|
|
24
22
|
downloadFileResponse(sandboxId: string, input: string | SandboxFileDownloadInput): Promise<SandboxFileDownloadResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ApiFetchOptions } from "../api/core.js";
|
|
2
|
-
import type { SandboxIntegrationConnectionLeaseInput, SandboxCreateInput, SandboxCreateOptions, SandboxAsyncRequestOptions, SandboxForkInput, SandboxExecInput, SandboxProcessStartInput, SandboxPtyStartInput, SandboxPtyInput, SandboxOpenPortInput, SandboxGitDiffInput, SandboxGitPatchExportInput, SandboxGitBranchInput, SandboxGitCommitInput, SandboxGitPullInput, SandboxGitPushInput, SandboxFileDownloadInput, SandboxFileListInput, SandboxFileMkdirInput, SandboxFileMoveInput, SandboxFileSearchInput, SandboxReceipt, SandboxSnapshotValidateInput, SandboxSnapshotUpdateInput, SandboxSnapshotInput, SandboxRecord, SandboxIntegrationLeasesResponse, SandboxExecResponse, SandboxProcessStartResponse, SandboxProcessListResponse, SandboxProcessStatusResponse, SandboxProcessStopResponse, SandboxPtyStartResponse, SandboxPtyListResponse, SandboxPtyStatusResponse, SandboxPtyInputResponse, SandboxPtyStopResponse, SandboxOpenPortResponse, SandboxSnapshotResponse, SandboxSnapshotValidationResponse, SandboxForkResponse, SandboxReceiptResponse, SandboxLifecycleAcceptedResponse, SandboxStartResponse, SandboxRestoreResponse, SandboxGitStatusResponse, SandboxGitDiffResponse, SandboxGitPatchExportResponse, SandboxGitBranchResponse, SandboxGitCommitResponse, SandboxGitPullResponse, SandboxGitPushResponse, SandboxFileUploadResponse, SandboxFileDownloadResponse, SandboxFileListResponse, SandboxFileDeleteResponse, SandboxFileMkdirResponse, SandboxFileMoveResponse, SandboxFileStatResponse, SandboxFileSearchResponse, SandboxBillingStatusResponse, SandboxPricingResponse, SandboxCostSummaryResponse, OpenPondSandboxClientOptions } from "./types/index.js";
|
|
2
|
+
import type { SandboxIntegrationConnectionLeaseInput, SandboxCreateInput, SandboxCreateOptions, SandboxAsyncRequestOptions, SandboxForkInput, SandboxExecInput, SandboxProcessStartInput, SandboxPtyStartInput, SandboxPtyInput, SandboxOpenPortInput, SandboxGitDiffInput, SandboxGitPatchExportInput, SandboxGitBranchInput, SandboxGitCommitInput, SandboxGitPullInput, SandboxGitPushInput, SandboxFileDownloadInput, SandboxFileListInput, SandboxFileMkdirInput, SandboxFileMoveInput, SandboxFileSearchInput, SandboxReceipt, SandboxSnapshotValidateInput, SandboxSnapshotUpdateInput, SandboxSnapshotInput, SandboxSnapshotRetentionQuoteInput, SandboxSnapshotJobResponse, SandboxRestoreInput, SandboxStartInput, SandboxRecord, SandboxIntegrationLeasesResponse, SandboxExecResponse, SandboxProcessStartResponse, SandboxProcessListResponse, SandboxProcessStatusResponse, SandboxProcessStopResponse, SandboxPtyStartResponse, SandboxPtyListResponse, SandboxPtyStatusResponse, SandboxPtyInputResponse, SandboxPtyStopResponse, SandboxOpenPortResponse, SandboxSnapshotResponse, SandboxSnapshotValidationResponse, SandboxForkResponse, SandboxReceiptResponse, SandboxLifecycleAcceptedResponse, SandboxStartResponse, SandboxRestoreResponse, SandboxGitStatusResponse, SandboxGitDiffResponse, SandboxGitPatchExportResponse, SandboxGitBranchResponse, SandboxGitCommitResponse, SandboxGitPullResponse, SandboxGitPushResponse, SandboxFileUploadResponse, SandboxFileDownloadResponse, SandboxFileListResponse, SandboxFileDeleteResponse, SandboxFileMkdirResponse, SandboxFileMoveResponse, SandboxFileStatResponse, SandboxFileSearchResponse, SandboxBillingStatusResponse, SandboxPricingResponse, SandboxCostSummaryResponse, OpenPondSandboxClientOptions } from "./types/index.js";
|
|
3
3
|
export declare class OpenPondSandboxInstanceClient {
|
|
4
4
|
readonly apiKey: string;
|
|
5
5
|
readonly apiRootUrl: string;
|
|
@@ -41,14 +41,20 @@ export declare class OpenPondSandboxInstanceClient {
|
|
|
41
41
|
moveFile(sandboxId: string, input: SandboxFileMoveInput): Promise<SandboxFileMoveResponse>;
|
|
42
42
|
searchFiles(sandboxId: string, input: SandboxFileSearchInput): Promise<SandboxFileSearchResponse>;
|
|
43
43
|
openPort(sandboxId: string, input: SandboxOpenPortInput): Promise<SandboxOpenPortResponse>;
|
|
44
|
-
createSnapshot(sandboxId: string, input: SandboxSnapshotInput
|
|
44
|
+
createSnapshot(sandboxId: string, input: SandboxSnapshotInput & {
|
|
45
|
+
async: true;
|
|
46
|
+
}): Promise<SandboxSnapshotJobResponse>;
|
|
47
|
+
createSnapshot(sandboxId: string, input: SandboxSnapshotInput & {
|
|
48
|
+
async?: false;
|
|
49
|
+
}): Promise<SandboxSnapshotResponse>;
|
|
50
|
+
createSnapshot(sandboxId: string, input: SandboxSnapshotInput): Promise<SandboxSnapshotResponse | SandboxSnapshotJobResponse>;
|
|
45
51
|
updateSnapshot(sandboxId: string, snapshotId: string, input: SandboxSnapshotUpdateInput): Promise<SandboxSnapshotResponse>;
|
|
46
52
|
validateSnapshot(sandboxId: string, snapshotId: string, input?: SandboxSnapshotValidateInput): Promise<SandboxSnapshotValidationResponse>;
|
|
47
53
|
publishSnapshot(sandboxId: string, snapshotId: string): Promise<SandboxSnapshotResponse>;
|
|
48
54
|
fork(sandboxId: string, input?: SandboxForkInput): Promise<SandboxForkResponse>;
|
|
49
55
|
stop(sandboxId: string, options?: SandboxAsyncRequestOptions): Promise<SandboxReceiptResponse | SandboxLifecycleAcceptedResponse>;
|
|
50
|
-
start(sandboxId: string, options?: SandboxAsyncRequestOptions): Promise<SandboxStartResponse>;
|
|
51
|
-
restore(sandboxId: string): Promise<SandboxRestoreResponse>;
|
|
56
|
+
start(sandboxId: string, options?: SandboxAsyncRequestOptions & SandboxStartInput): Promise<SandboxStartResponse>;
|
|
57
|
+
restore(sandboxId: string, input?: SandboxRestoreInput): Promise<SandboxRestoreResponse>;
|
|
52
58
|
delete(sandboxId: string, options?: SandboxAsyncRequestOptions): Promise<SandboxRecord>;
|
|
53
59
|
receipts(sandboxId: string): Promise<SandboxReceipt[]>;
|
|
54
60
|
logs(sandboxId: string): Promise<string[]>;
|
|
@@ -59,7 +65,7 @@ export declare class OpenPondSandboxInstanceClient {
|
|
|
59
65
|
gitCommit(sandboxId: string, input: SandboxGitCommitInput): Promise<SandboxGitCommitResponse>;
|
|
60
66
|
gitPull(sandboxId: string, input?: SandboxGitPullInput): Promise<SandboxGitPullResponse>;
|
|
61
67
|
gitPush(sandboxId: string, input?: SandboxGitPushInput): Promise<SandboxGitPushResponse>;
|
|
62
|
-
billing(sandboxId: string): Promise<SandboxBillingStatusResponse>;
|
|
68
|
+
billing(sandboxId: string, input?: SandboxSnapshotRetentionQuoteInput): Promise<SandboxBillingStatusResponse>;
|
|
63
69
|
pricing(): Promise<SandboxPricingResponse>;
|
|
64
70
|
costs(input?: {
|
|
65
71
|
teamId?: string;
|
|
@@ -85,6 +85,8 @@ export type SandboxBillingStatus = {
|
|
|
85
85
|
billingModel: "reserve_capture" | "session" | "actual_usage";
|
|
86
86
|
computeUsage?: SandboxComputeUsageStatus;
|
|
87
87
|
nativeRootStorage?: SandboxNativeRootStorageStatus;
|
|
88
|
+
snapshotRetention?: SandboxSnapshotRetentionStatus[];
|
|
89
|
+
snapshotRetentionOffer?: SandboxSnapshotRetentionOffer;
|
|
88
90
|
reservationStatus: SandboxReservation["status"];
|
|
89
91
|
budgetUsd: string | null;
|
|
90
92
|
reservedUsd: string;
|
|
@@ -255,3 +257,54 @@ export interface SandboxNativeRootStorageStatus {
|
|
|
255
257
|
status: "current" | "funding_shortfall";
|
|
256
258
|
shortfallReason: "credit_exhausted" | "member_cap_reached" | "billing_suspended" | null;
|
|
257
259
|
}
|
|
260
|
+
/** Finite reserved-source-disk retail; captured snapshot byte size is unknown. */
|
|
261
|
+
export type SandboxSnapshotRetentionStatus = {
|
|
262
|
+
snapshotId: string;
|
|
263
|
+
phase: "reserved" | "capture_submitted" | "ready" | "deleting" | "deleted" | "cancelled";
|
|
264
|
+
termsSha256: string;
|
|
265
|
+
reservedDiskGiB: number;
|
|
266
|
+
ttlSeconds: number;
|
|
267
|
+
expiresAt: string;
|
|
268
|
+
maximumUsd: string;
|
|
269
|
+
quotedUsd: string;
|
|
270
|
+
price: {
|
|
271
|
+
version: string;
|
|
272
|
+
currency: "USD";
|
|
273
|
+
unit: "GiB-second";
|
|
274
|
+
unitPriceUsd: string;
|
|
275
|
+
};
|
|
276
|
+
quantityGiBMillis: number;
|
|
277
|
+
ratedUsd: string;
|
|
278
|
+
chargedUsd: string;
|
|
279
|
+
includedStandardUsd: string;
|
|
280
|
+
prepaidStandardUsd: string;
|
|
281
|
+
prepaidPayableUsd: string;
|
|
282
|
+
heldIncludedStandardUsd: string;
|
|
283
|
+
heldPrepaidPayableUsd: string;
|
|
284
|
+
releasedUnusedStandardUsd: string | null;
|
|
285
|
+
meteredTo: string;
|
|
286
|
+
closedAt: string | null;
|
|
287
|
+
status: "current" | "funding_shortfall" | "external_settlement" | "internal_tracked";
|
|
288
|
+
shortfallReason: "credit_exhausted" | "member_cap_reached" | "billing_suspended" | null;
|
|
289
|
+
};
|
|
290
|
+
export type SandboxSnapshotRetentionQuoteInput = {
|
|
291
|
+
snapshotRetentionTtlSeconds: number;
|
|
292
|
+
snapshotRetentionClass: "ephemeral" | "cached" | "pinned";
|
|
293
|
+
};
|
|
294
|
+
/** Discovery/quote only; creates no reservation or execution authority. */
|
|
295
|
+
export type SandboxSnapshotRetentionOffer = {
|
|
296
|
+
available: false;
|
|
297
|
+
reason: "unsupported_source" | "source_unavailable" | "billing_unavailable" | "terms_unavailable" | "retention_out_of_range";
|
|
298
|
+
} | {
|
|
299
|
+
available: true;
|
|
300
|
+
termsSha256: string;
|
|
301
|
+
price: SandboxSnapshotRetentionStatus["price"];
|
|
302
|
+
reservedDiskGiB: number;
|
|
303
|
+
maximumTtlSeconds: number;
|
|
304
|
+
maximumCustomerUsd: string;
|
|
305
|
+
quote: null | {
|
|
306
|
+
retentionClass: "ephemeral" | "cached" | "pinned";
|
|
307
|
+
ttlSeconds: number;
|
|
308
|
+
quotedUsd: string;
|
|
309
|
+
};
|
|
310
|
+
};
|