ryco-cli 0.1.25 → 0.1.26
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/{GrokDriver-CduUwiOH.mjs → AcpAdapter-BemMQNbj.mjs} +102 -604
- package/dist/{GrokDriver-D0jraOC_.cjs → AcpAdapter-CadxcdZV.cjs} +129 -612
- package/dist/AcpNativeLogging-BsbZRRD7.mjs +312 -0
- package/dist/AcpNativeLogging-DZPZNoju.cjs +383 -0
- package/dist/AcpRegistryDriver-BfCPf8FX.cjs +222 -0
- package/dist/AcpRegistryDriver-BpXCjh9I.mjs +221 -0
- package/dist/{AzureDevOpsSourceControlProvider-COmd21c-.cjs → AzureDevOpsSourceControlProvider-B9N_8NJg.cjs} +14 -14
- package/dist/{AzureDevOpsSourceControlProvider-B_E0XXfD.mjs → AzureDevOpsSourceControlProvider-BcQO_CyW.mjs} +3 -3
- package/dist/{BitbucketSourceControlProvider-pUKsNXcg.mjs → BitbucketSourceControlProvider-BTUY2ZT8.mjs} +3 -3
- package/dist/{BitbucketSourceControlProvider-CD8IvXQK.cjs → BitbucketSourceControlProvider-C9WuwvY2.cjs} +14 -14
- package/dist/{BunPTY-TbHbSc8S.mjs → BunPTY-DdnqQAdw.mjs} +1 -1
- package/dist/{ClaudeDriver-Dry5uJfX.cjs → ClaudeDriver-BSTxNNGO.cjs} +162 -126
- package/dist/{ClaudeDriver-CGifBixr.mjs → ClaudeDriver-Csnp78qR.mjs} +129 -93
- package/dist/{CodexDriver-BzR8gA8w.cjs → CodexDriver-BK4HVNV4.cjs} +145 -60
- package/dist/{CodexDriver-V4CL9APE.mjs → CodexDriver-fwcV84hX.mjs} +99 -14
- package/dist/{CodexTextGeneration-DTrSzY-I.cjs → CodexTextGeneration-Y2GSS7f1.cjs} +145 -99
- package/dist/{CodexTextGeneration-DoCidwvI.mjs → CodexTextGeneration-_4aT5BHa.mjs} +141 -95
- package/dist/{CopilotDriver-Dt13X60f.mjs → CopilotDriver-B12ZJ-L_.mjs} +69 -7
- package/dist/{CopilotDriver-rLcA8PSN.cjs → CopilotDriver-C7IyIwVW.cjs} +98 -36
- package/dist/{CursorDriver-C3s-8s9F.cjs → CursorDriver-BWmCfJ-w.cjs} +38 -32
- package/dist/{CursorDriver-HIPUs7cz.mjs → CursorDriver-C_p0v-ul.mjs} +12 -6
- package/dist/{ForgejoSourceControlProvider-JgiyrMqp.cjs → ForgejoSourceControlProvider-DTRrllIH.cjs} +14 -14
- package/dist/{ForgejoSourceControlProvider-CmvOAzEG.mjs → ForgejoSourceControlProvider-DmOGJEaJ.mjs} +3 -3
- package/dist/{GitHubSourceControlProvider-CItCpOcC.cjs → GitHubSourceControlProvider-D-YV8WP6.cjs} +16 -17
- package/dist/{GitHubSourceControlProvider-BYuvbcBf.mjs → GitHubSourceControlProvider-sQGcwnr3.mjs} +6 -7
- package/dist/{GitLabSourceControlProvider-CMce22nU.cjs → GitLabSourceControlProvider-kKYYnpER.cjs} +14 -14
- package/dist/{GitLabSourceControlProvider-DZzEaVSi.mjs → GitLabSourceControlProvider-mIl-K-4F.mjs} +3 -3
- package/dist/GrokDriver-BFOniP_K.cjs +567 -0
- package/dist/GrokDriver-CDcWkiAi.mjs +552 -0
- package/dist/{Metrics-a1h4iBQi.mjs → Metrics-C-3MahDy.mjs} +1 -107
- package/dist/{Metrics-Bcb9vCAe.cjs → Metrics-DCKbdeoH.cjs} +0 -168
- package/dist/{NodePTY-B_p5tLYO.mjs → NodePTY-DArvQ9bX.mjs} +1 -1
- package/dist/{OpenCodeDriver-DxGpgtDS.cjs → OpenCodeDriver-CckbFEQJ.cjs} +459 -141
- package/dist/{OpenCodeDriver-Bz_uJdMA.mjs → OpenCodeDriver-CnWJHyDJ.mjs} +430 -112
- package/dist/SideQuestionIsolation-5eGFRW0t.mjs +26 -0
- package/dist/SideQuestionIsolation-DvVKZWxi.cjs +37 -0
- package/dist/{SourceControlProviderDiscoveryCatalog-ZtwPWoxE.mjs → SourceControlProviderDiscoveryCatalog-BVvq7liJ.mjs} +2 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-Dm_lhrhv.cjs → SourceControlProviderDiscoveryCatalog-CyUhKJLD.cjs} +6 -5
- package/dist/bin.cjs +12537 -3029
- package/dist/bin.mjs +10444 -965
- package/dist/client/assets/AccountSettings-DLbcE2w-.js +1 -0
- package/dist/client/assets/Adobe-CNS1-UCS2-fO900upv.bcmap +0 -0
- package/dist/client/assets/Adobe-GB1-UCS2-BA083yIo.bcmap +0 -0
- package/dist/client/assets/Adobe-Japan1-UCS2-BL-4M2vS.bcmap +0 -0
- package/dist/client/assets/Adobe-Korea1-UCS2-BEQZuOdo.bcmap +0 -0
- package/dist/client/assets/AiFocusSettings-FKvdkl4P.js +1 -0
- package/dist/client/assets/{AnimatedHeight-DPqb09B0.js → AnimatedHeight-CbIEyMLg.js} +1 -1
- package/dist/client/assets/AppearanceSettings-B2LsGKmL.js +1 -0
- package/dist/client/assets/{BranchToolbar.logic-CHRK3hDt.js → BranchToolbar.logic-BqkvYNPk.js} +1 -1
- package/dist/client/assets/{BrowserPanel-2Xu08il5.js → BrowserPanel-C_C4zjrh.js} +1 -1
- package/dist/client/assets/ChatRightPanel-ibiQ79jI.js +195 -0
- package/dist/client/assets/{ChatThreadRouteView-CNww3i2J.js → ChatThreadRouteView-c7AXmbSk.js} +1 -1
- package/dist/client/assets/CommandPaletteDialog-DdPKN6rv.js +1 -0
- package/dist/client/assets/CompositeRoot-DKwS-ADi.js +1 -0
- package/dist/client/assets/{ComputerUseSettings-BJs7jqR0.js → ComputerUseSettings-DM17BYP5.js} +1 -1
- package/dist/client/assets/ConnectionsSettings-D6wysIC8.js +7 -0
- package/dist/client/assets/ContextHandoffEndpointLabel-CsF_maM_.js +4 -0
- package/dist/client/assets/{DiagnosticsSettings-BmrqOKMe.js → DiagnosticsSettings-Bq2l-C4J.js} +2 -2
- package/dist/client/assets/{DialogHandle-pelzaaiH.js → DialogHandle-DuKTleCw.js} +1 -1
- package/dist/client/assets/{DialogPopup-BLM0vN4N.js → DialogPopup-Dt7DzTWv.js} +1 -1
- package/dist/client/assets/DialogRoot-DRyawL6l.js +1 -0
- package/dist/client/assets/{DialogTitle-BvIjMtMm.js → DialogTitle-BaxfPC6e.js} +1 -1
- package/dist/client/assets/DialogTrigger-D0PJ8bRT.js +1 -0
- package/dist/client/assets/{DialogViewport-Cz0OadGI.js → DialogViewport-C3B2JZWQ.js} +1 -1
- package/dist/client/assets/DraftChatThreadRouteView-B8YiD5NP.js +1 -0
- package/dist/client/assets/ETHK-B5-H-1MLb5v9x.bcmap +0 -0
- package/dist/client/assets/{ExternalIdentityWeb.logic-3rlDV7lT.js → ExternalIdentityWeb.logic-CrcNfdHK.js} +1 -1
- package/dist/client/assets/FoxitDingbats-BaQLufoW.pfb +0 -0
- package/dist/client/assets/FoxitFixed-Dyd5Nipw.pfb +0 -0
- package/dist/client/assets/FoxitFixedBold-D5TuYRwj.pfb +0 -0
- package/dist/client/assets/FoxitFixedBoldItalic-BqlXQ_Yv.pfb +0 -0
- package/dist/client/assets/FoxitFixedItalic-DqjQkmbS.pfb +0 -0
- package/dist/client/assets/FoxitSerif-qbgiDIe-.pfb +0 -0
- package/dist/client/assets/FoxitSerifBold-DZZ4CclT.pfb +0 -0
- package/dist/client/assets/FoxitSerifBoldItalic-DSQtwd_X.pfb +0 -0
- package/dist/client/assets/FoxitSerifItalic-CQs5lx9Y.pfb +0 -0
- package/dist/client/assets/FoxitSymbol-BVtbc20u.pfb +0 -0
- package/dist/client/assets/GBK-EUC-H-CAORqCkf.bcmap +0 -0
- package/dist/client/assets/GBK2K-H-Cv55KPk8.bcmap +0 -0
- package/dist/client/assets/GBKp-EUC-H-CElrnV5g.bcmap +0 -0
- package/dist/client/assets/GBT-EUC-H-BTsQIL1M.bcmap +0 -0
- package/dist/client/assets/GBT-H-DL9h-WkS.bcmap +0 -0
- package/dist/client/assets/GBTpc-EUC-H-DnIh5WJ3.bcmap +0 -0
- package/dist/client/assets/{GlassSurface-CEVIdyfP.js → GlassSurface-CBIEgwt1.js} +1 -1
- package/dist/client/assets/HKscs-B5-H-CXbBbq6g.bcmap +0 -0
- package/dist/client/assets/{HostedConnectionControls-r9cyZPyF.js → HostedConnectionControls-DOpTlXzE.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-BkfafJ5x.js → HostedHubRoot-C1jq8cM6.js} +2 -2
- package/dist/client/assets/{HostedNativeAuthorizationRoute-CqHuW853.js → HostedNativeAuthorizationRoute-Clw1DHQW.js} +2 -2
- package/dist/client/assets/{HostedNodeRenameDialog-C7m-nvTj.js → HostedNodeRenameDialog-Bd_Qu_ek.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-DNZQyAX0.js → HostedRelayTrustNotice-CGcBpT9m.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-hul3ysgL.js → IntegrationsSettingsPanel-J0qODRW-.js} +2 -2
- package/dist/client/assets/KSC-Johab-H-CGtV3MPT.bcmap +0 -0
- package/dist/client/assets/{KeybindingsSettings-Cme6omBM.js → KeybindingsSettings-CwxIHsFy.js} +1 -1
- package/dist/client/assets/{LazyBrowserPanel-COJFwNK7.js → LazyBrowserPanel-VNAn6AUL.js} +2 -2
- package/dist/client/assets/LiberationSans-Bold-BPt4bU5Z.ttf +0 -0
- package/dist/client/assets/LiberationSans-BoldItalic-Bj53-jFw.ttf +0 -0
- package/dist/client/assets/LiberationSans-Italic-5QhGB3P9.ttf +0 -0
- package/dist/client/assets/LiberationSans-Regular-cbskN6YR.ttf +0 -0
- package/dist/client/assets/McpServersSettings-1pkIeutq.js +6 -0
- package/dist/client/assets/MobileSheet-DddfN8c2.js +1 -0
- package/dist/client/assets/{NodeSecuritySettings-CwT5nEW9.js → NodeSecuritySettings-BOIZeFZo.js} +1 -1
- package/dist/client/assets/OpinionatedPluginsSettings-oTIrPtIb.js +1 -0
- package/dist/client/assets/PdfAttachmentPreview-BCMO9OHD.js +54 -0
- package/dist/client/assets/{PhoneGetAppInterstitial-BBnGXVkR.js → PhoneGetAppInterstitial-0EOj-PbW.js} +1 -1
- package/dist/client/assets/PhoneHome-Cg7l3b1T.js +1 -0
- package/dist/client/assets/{PhoneSettingsSurface-DdVCndyt.js → PhoneSettingsSurface-BXAUtZ9M.js} +2 -2
- package/dist/client/assets/ProvidersSettingsPanel-BaJgypXu.js +1 -0
- package/dist/client/assets/{QuitShortcutFeedback-mF7X0WMD.js → QuitShortcutFeedback-DgJFEd6b.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-DovqFcmM.js → RedactedSensitiveText-D1VC2xa7.js} +1 -1
- package/dist/client/assets/RootAppShell-D2RjZ9jQ.js +7 -0
- package/dist/client/assets/Separator-CeMncdkm.js +1 -0
- package/dist/client/assets/SettingsDialog-B2hEb6u8.js +2 -0
- package/dist/client/assets/SettingsPanels-DtWLQDne.js +3 -0
- package/dist/client/assets/{SettingsPanels.editor-d-rVlbeN.js → SettingsPanels.editor-DJRckD71.js} +1 -1
- package/dist/client/assets/SourceControlSettings-IpoZrjt5.js +1 -0
- package/dist/client/assets/StatisticsPage-CUpE_5Gr.js +1 -0
- package/dist/client/assets/StatisticsPanel-CHrAY5AP.js +1 -0
- package/dist/client/assets/StatisticsSettingsLink-bGWuxNG3.js +1 -0
- package/dist/client/assets/{ThreadTerminalDrawer-DaLrSTn9.js → ThreadTerminalDrawer-BEv83xrk.js} +3 -3
- package/dist/client/assets/ThreadWorkspacePanel-BdMdJVHJ.js +2073 -0
- package/dist/client/assets/UniCNS-UCS2-H-DWzv8UhH.bcmap +0 -0
- package/dist/client/assets/UniCNS-UTF16-H-Bw0JKgCq.bcmap +0 -0
- package/dist/client/assets/UniCNS-UTF32-H-IE_GrH2i.bcmap +0 -0
- package/dist/client/assets/UniCNS-UTF8-H-BbLcFh6Q.bcmap +0 -0
- package/dist/client/assets/UniGB-UCS2-H-D7xzRvZN.bcmap +0 -0
- package/dist/client/assets/UniGB-UTF16-H-DKjbEwc0.bcmap +0 -0
- package/dist/client/assets/UniGB-UTF32-H-Behfouj5.bcmap +0 -0
- package/dist/client/assets/UniGB-UTF8-H-EROft1ro.bcmap +0 -0
- package/dist/client/assets/UniJIS-UCS2-H-2DbZ0MaQ.bcmap +0 -0
- package/dist/client/assets/UniJIS-UTF16-H-BlDDPdCK.bcmap +0 -0
- package/dist/client/assets/UniJIS-UTF32-H-BIQPWkjv.bcmap +0 -0
- package/dist/client/assets/UniJIS-UTF8-H-CGusholx.bcmap +0 -0
- package/dist/client/assets/UniJIS2004-UTF16-H-KXixH-HI.bcmap +0 -0
- package/dist/client/assets/UniJIS2004-UTF32-H-CXrD-9YE.bcmap +0 -0
- package/dist/client/assets/UniJIS2004-UTF8-H-BkOctZjn.bcmap +0 -0
- package/dist/client/assets/UniJISX0213-UTF32-H-BavAhZjb.bcmap +0 -0
- package/dist/client/assets/UniJISX02132004-UTF32-H-DAH-AgUq.bcmap +0 -0
- package/dist/client/assets/UniKS-UCS2-H-YeUc7k1L.bcmap +0 -0
- package/dist/client/assets/UniKS-UTF16-H-B0dvB-Td.bcmap +0 -0
- package/dist/client/assets/UniKS-UTF32-H-olR_LtmR.bcmap +0 -0
- package/dist/client/assets/UniKS-UTF8-H-CbpebD-y.bcmap +0 -0
- package/dist/client/assets/{activity-bn_fBQGf.js → activity-BmRcsTyL.js} +1 -1
- package/dist/client/assets/{alert-BmLJh6DH.js → alert-C5UiA2xk.js} +1 -1
- package/dist/client/assets/{appChrome-Dy57Ve9N.js → appChrome-CsZ2ylc1.js} +1 -1
- package/dist/client/assets/{arrow-left-pzj1cbX3.js → arrow-left-CSz-z20j.js} +1 -1
- package/dist/client/assets/{arrow-right-BW5jU-vo.js → arrow-right-DEi91hao.js} +1 -1
- package/dist/client/assets/{arrow-up-right-AfC5AaSO.js → arrow-up-right-D7SpcTV9.js} +1 -1
- package/dist/client/assets/authorization-B1YXfej3.js +1 -0
- package/dist/client/assets/badge-BjvTY7-E.js +1 -0
- package/dist/client/assets/{bot-CsKkSRlb.js → bot-SC4UGZyw.js} +1 -1
- package/dist/client/assets/{capabilities-DskyVNd2.js → capabilities-BCkDNe83.js} +1 -1
- package/dist/client/assets/{chart-column-DhvWXIiH.js → chart-column-C08MuLgY.js} +1 -1
- package/dist/client/assets/chevron-right-DgB53U1_.js +1 -0
- package/dist/client/assets/{clipboard-copy-fJnfdl4H.js → clipboard-copy-D74Wvnon.js} +1 -1
- package/dist/client/assets/{data-list-_E-Al1sf.js → data-list-CZ4Utnfl.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-DycXKuMm.js → desktopWorkspace-DVfn9ZT_.js} +1 -1
- package/dist/client/assets/{download-CLQzE1di.js → download-Dio40wIJ.js} +1 -1
- package/dist/client/assets/editorPreferences-2dG4uloq.js +1 -0
- package/dist/client/assets/{empty-YXFtCUDN.js → empty-6LExKYgQ.js} +1 -1
- package/dist/client/assets/{group-DOCkUmuY.js → group-D_mu0Kiq.js} +1 -1
- package/dist/client/assets/{hostedConnectionCoordinator-JZ1dLx4v.js → hostedConnectionCoordinator-YkDLnATK.js} +1 -1
- package/dist/client/assets/{hubRoutes-C2S5of9_.js → hubRoutes-D3quWvU7.js} +1 -1
- package/dist/client/assets/{index-CvRFRkBK.js → index-7MTgf8YI.js} +2 -2
- package/dist/client/assets/{input-C2xv8mMt.js → input-CfVJycb1.js} +1 -1
- package/dist/client/assets/jbig2-CNFLgX9F.wasm +0 -0
- package/dist/client/assets/kbd-uFa_tY-L.js +1 -0
- package/dist/client/assets/{key-round-CYcb9lAa.js → key-round-C-oUSjpF.js} +1 -1
- package/dist/client/assets/{layers-CGlOWYxu.js → layers-Co2a5C1k.js} +1 -1
- package/dist/client/assets/{log-out-CZW2EpNJ.js → log-out-pWFhbvwr.js} +1 -1
- package/dist/client/assets/{logging-BpmZOfmu.js → logging-JMrwaeZh.js} +1 -1
- package/dist/client/assets/main-BNPtp9Z0.css +2 -0
- package/dist/client/assets/main-CGeD6yVE.js +9 -0
- package/dist/client/assets/openjpeg-MeY6OQBn.wasm +0 -0
- package/dist/client/assets/{palette-CQOuNfSO.js → palette-B_6C4fD6.js} +1 -1
- package/dist/client/assets/pdf.worker.min-Dswkl-cV.mjs +29 -0
- package/dist/client/assets/{play-CPVy9wwV.js → play-DFtc9zBy.js} +1 -1
- package/dist/client/assets/primary-CNUdEGcv.js +2 -0
- package/dist/client/assets/providerDriverMeta-Cg_XLUfo.js +1 -0
- package/dist/client/assets/{ProviderModelPicker-DoYEUZrn.js → providerInstances-JaDrOWPZ.js} +1 -1
- package/dist/client/assets/providerModels-5uOq3qPC.js +1 -0
- package/dist/client/assets/qcms_bg-3PJi_GXR.wasm +0 -0
- package/dist/client/assets/{qr-code-BPqDlVMn.js → qr-code-BU354aLS.js} +1 -1
- package/dist/client/assets/{qr-code-C6BVTc4V.js → qr-code-DaHWf7Oq.js} +1 -1
- package/dist/client/assets/quickjs-eval-zJSp5SB4.wasm +0 -0
- package/dist/client/assets/radio-group-DKaA1eey.js +2 -0
- package/dist/client/assets/{refresh-cw-B5Cz1z3e.js → refresh-cw-CY5BeUEr.js} +1 -1
- package/dist/client/assets/runtime-BKneT96Q.js +17 -0
- package/dist/client/assets/{save-C7zM6ey6.js → save-DIHMjHXd.js} +1 -1
- package/dist/client/assets/{scroll-area-5OU_pvTW.js → scroll-area-Cq4SX9P8.js} +1 -1
- package/dist/client/assets/{scrollEdges-qnEXfIOg.js → scrollEdges-BaWRjrac.js} +1 -1
- package/dist/client/assets/{separator-B5HfRiaO.js → separator-BN705fC0.js} +1 -1
- package/dist/client/assets/{settingsLayout-CfKq88KD.js → settingsLayout-DQERzSce.js} +1 -1
- package/dist/client/assets/{sheet-B9gQDy_I.js → sheet-CFvRY7T6.js} +1 -1
- package/dist/client/assets/{shield-rdjnBE2Q.js → shield-Zn2kFj5M.js} +1 -1
- package/dist/client/assets/{shield-alert-7yBlEyOs.js → shield-alert-DMB5gKiC.js} +1 -1
- package/dist/client/assets/{shield-check-CnKgVJ0F.js → shield-check-DyNf6Bky.js} +1 -1
- package/dist/client/assets/{sidebar-BdvL1Pbj.js → sidebar-Bsh64sLK.js} +1 -1
- package/dist/client/assets/sidebarProjectFolders-CQbpO9ZI.js +4 -0
- package/dist/client/assets/{sidebarStatusText-CZKsUFBD.js → sidebarStatusText-DCo-whyK.js} +1 -1
- package/dist/client/assets/{skeleton-CoyLqyaB.js → skeleton-DEuowfjY.js} +1 -1
- package/dist/client/assets/{smartphone-CBgpMHXR.js → smartphone-BLWJ7C9-.js} +1 -1
- package/dist/client/assets/{sparkles-w-UZXQx1.js → sparkles-DAXDXp_s.js} +1 -1
- package/dist/client/assets/src-DPpEXU6w.js +14 -0
- package/dist/client/assets/{star-BZ-RtSFD.js → star-CjQxHYbD.js} +1 -1
- package/dist/client/assets/switch-LahPAvrd.js +48 -0
- package/dist/client/assets/{toggle-DVGrNHjq.js → toggle-45lsrmyi.js} +1 -1
- package/dist/client/assets/{toggle-group-CNDOfNhH.js → toggle-group-D5pl24ED.js} +1 -1
- package/dist/client/assets/{tokenModePresentation-CQNdC9CW.js → tokenModePresentation-CPUsUGY4.js} +1 -1
- package/dist/client/assets/tooltip-B8-izeMo.js +1 -0
- package/dist/client/assets/{unplug-CRUwFNFw.js → unplug-Bjpxv8i0.js} +1 -1
- package/dist/client/assets/usage-8vQUo0mr.js +1 -0
- package/dist/client/assets/useAppSidebarCollapsed-uwz9Hlgc.js +1 -0
- package/dist/client/assets/useBaseUiId-BtuL7q77.js +1 -0
- package/dist/client/assets/useLabelableId-N_LsKNbf.js +1 -0
- package/dist/client/assets/useNavigate-DADLi29i.js +1 -0
- package/dist/client/assets/usePhoneThreadActions-B9_HK7tn.js +1 -0
- package/dist/client/assets/usePopupViewport-w8BEny9j.js +1 -0
- package/dist/client/assets/useScrollLock-bCmUzTgK.js +1 -0
- package/dist/client/assets/useStatistics-DJtONxT0.js +55 -0
- package/dist/client/assets/useTriggerFocusGuards-C7JWO2LT.js +1 -0
- package/dist/client/assets/useValueChanged-DkoUO9bY.js +1 -0
- package/dist/client/assets/{user-round-DStbWN3z.js → user-round-DEWIPpNs.js} +1 -1
- package/dist/client/assets/{vscode-icons-BihBo3tb.js → vscode-icons-DTH-Vj-_.js} +1 -1
- package/dist/client/assets/workspaceMetadataProjection-BnpxBe8S.js +1 -0
- package/dist/client/assets/{wrench-BBIgGxy9.js → wrench-36WYdK_a.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/collectUint8StreamText-BAUF-vzz.mjs +37 -0
- package/dist/collectUint8StreamText-vagpNUMJ.cjs +42 -0
- package/dist/deviceHostWorker-C-BSnmkn.mjs +167 -0
- package/dist/deviceHostWorker-CYnrwfrv.cjs +169 -0
- package/dist/git-C4iJMbBu.mjs +132 -0
- package/dist/git-irmB8_k7.cjs +218 -0
- package/dist/{makeManagedServerProvider-CwYhl_P-.mjs → makeManagedServerProvider-BINne1KE.mjs} +3 -38
- package/dist/{makeManagedServerProvider-Dy2Ny9tk.cjs → makeManagedServerProvider-DGbd8BhM.cjs} +1 -60
- package/dist/resource-monitor/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
- package/dist/runtimeSession-Bj0OUcNJ.cjs +63 -0
- package/dist/runtimeSession-CA6cLWg0.mjs +40 -0
- package/dist/schemaJson-CaG1bOvo.mjs +49 -0
- package/dist/schemaJson-CuhFxa8p.cjs +66 -0
- package/dist/{collectUint8StreamText-whblCEfg.cjs → src-BlzIcnVG.cjs} +522 -116
- package/dist/{collectUint8StreamText-CE1Re5Ij.mjs → src-DtEOcXdl.mjs} +350 -94
- package/package.json +1 -1
- package/dist/AcpNativeLogging-CA6XYzIS.cjs +0 -5130
- package/dist/AcpNativeLogging-D4-VoHrq.mjs +0 -5015
- package/dist/client/assets/AccountSettings-Bv57-JYy.js +0 -1
- package/dist/client/assets/AiFocusSettings-DCPHmJpA.js +0 -1
- package/dist/client/assets/AppearanceSettings-EmTrtb_U.js +0 -1
- package/dist/client/assets/ChatRightPanel-C1VD6GCV.js +0 -194
- package/dist/client/assets/CommandPaletteDialog-B_f3fKp7.js +0 -1
- package/dist/client/assets/CompositeRoot-B40iitmH.js +0 -1
- package/dist/client/assets/ConnectionsSettings-B9nfvgLG.js +0 -7
- package/dist/client/assets/ContextHandoffEndpointLabel-BSQOArMR.js +0 -4
- package/dist/client/assets/DialogRoot-CY6ZzEUS.js +0 -1
- package/dist/client/assets/DialogTrigger-CIeVAA-a.js +0 -1
- package/dist/client/assets/DraftChatThreadRouteView-DMIGMESb.js +0 -1
- package/dist/client/assets/McpServersSettings-CPeNF8_u.js +0 -6
- package/dist/client/assets/MobileSheet-BZo-RAfm.js +0 -1
- package/dist/client/assets/OpinionatedPluginsSettings-D8A1CbMG.js +0 -1
- package/dist/client/assets/PhoneHome-BTKOPVjw.js +0 -1
- package/dist/client/assets/ProvidersSettingsPanel-ldDCPVIY.js +0 -1
- package/dist/client/assets/RootAppShell-CzmEWO9w.js +0 -7
- package/dist/client/assets/Separator-BhAVTIOc.js +0 -1
- package/dist/client/assets/SettingsDialog-ByXgBN0U.js +0 -2
- package/dist/client/assets/SettingsPanels-Bgf4vkrJ.js +0 -3
- package/dist/client/assets/SourceControlSettings-dKw0FaN1.js +0 -1
- package/dist/client/assets/StatisticsPage-C2RuqDIK.js +0 -1
- package/dist/client/assets/StatisticsPanel-DqoXnrhQ.js +0 -1
- package/dist/client/assets/StatisticsSettingsLink-C_f31sb4.js +0 -1
- package/dist/client/assets/ThreadWorkspacePanel-BvRZIxZQ.js +0 -2073
- package/dist/client/assets/authorization-7xVVtCBu.js +0 -1
- package/dist/client/assets/badge-DnBuGHGL.js +0 -1
- package/dist/client/assets/chevron-right-CITtTwME.js +0 -1
- package/dist/client/assets/editorPreferences-Bg624RVT.js +0 -1
- package/dist/client/assets/kbd-4-4mGdIa.js +0 -1
- package/dist/client/assets/main-CC-U8LrA.css +0 -2
- package/dist/client/assets/main-CzDOnLFw.js +0 -9
- package/dist/client/assets/primary-CjhRI8fe.js +0 -2
- package/dist/client/assets/providerDriverMeta-BVHpFupf.js +0 -1
- package/dist/client/assets/providerModels-BsybzP4P.js +0 -1
- package/dist/client/assets/radio-group-C8qudOQH.js +0 -2
- package/dist/client/assets/runtime-Bxg7k81u.js +0 -17
- package/dist/client/assets/sidebarProjectFolders-BH8XBqNe.js +0 -4
- package/dist/client/assets/src-Bi-5Nw9C.js +0 -14
- package/dist/client/assets/switch-CEJEmLe7.js +0 -48
- package/dist/client/assets/tooltip-B7Z4qomY.js +0 -1
- package/dist/client/assets/useAppSidebarCollapsed-wq6czkNJ.js +0 -1
- package/dist/client/assets/useBaseUiId-OYaGjnkh.js +0 -1
- package/dist/client/assets/useLabelableId-VMc-yITe.js +0 -1
- package/dist/client/assets/useNavigate-DVi0rBlf.js +0 -1
- package/dist/client/assets/usePhoneThreadActions-CwwHikjB.js +0 -1
- package/dist/client/assets/usePopupViewport-BcSIK_ph.js +0 -1
- package/dist/client/assets/useScrollLock-BQf9VYJT.js +0 -1
- package/dist/client/assets/useStatistics-DczKdEfy.js +0 -55
- package/dist/client/assets/useTriggerFocusGuards-DjP-D0_a.js +0 -1
- package/dist/client/assets/useValueChanged-CRwCkFdy.js +0 -1
- package/dist/client/assets/workspaceMetadataProjection-j3BGlVOB.js +0 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
3
|
+
import { As as EventId, Bs as RuntimeSubagentId, Eo as ProviderInstanceId, Is as ProviderItemId, Ls as RuntimeItemId, Pr as OpenCodeSettings, Rs as RuntimeRequestId, To as ProviderDriverKind, Ws as TurnId, cr as TextGenerationError, na as PROVIDER_SEND_TURN_MAX_ATTACHMENT_TOTAL_BYTES } from "./src-DtEOcXdl.mjs";
|
|
4
|
+
import { Z as ServerConfig } from "./Metrics-C-3MahDy.mjs";
|
|
5
|
+
import { m as sanitizeFeatureBranchName, p as sanitizeBranchFragment } from "./git-C4iJMbBu.mjs";
|
|
6
|
+
import { $ as buildCommitMessagePrompt, A as makeEventNdjsonLogger, At as providerModelsFromSettings, Bt as ProviderAdapterSessionClosedError, C as runOpenCodeSdk, D as verifyOpenCodeServerVersion, E as toOpenCodeQuestionAnswers, Ht as ProviderAdapterValidationError, Lt as createProcessDeviceToolBinding, Nt as agentControlHostContext, Ot as nonEmptyTrimmed, Q as buildBranchNamePrompt, Rt as ProviderAdapterProcessError, S as parseOpenCodeModelSlug, Sr as getModelSelectionStringOptionValue, T as toOpenCodePermissionReply, Ut as ProviderDriverError, Vt as ProviderAdapterSessionNotFoundError, Z as validateRankInboxThreadsResult, _ as OpenCodeRuntimeError, _r as resolveAttachmentPath, at as buildThreadTitlePrompt, b as openCodeQuestionId, br as createModelCapabilities, cr as makePackageManagedProviderMaintenanceResolver, ct as sanitizeCommitSubject, dr as normalizeCommandPath, et as buildIssueContentPolishPrompt, fr as resolveProviderMaintenanceCapabilitiesEffect, g as OpenCodeRuntime, gr as readPersistedAttachment, gt as mergeProviderInstanceEnvironment, h as MINIMUM_OPENCODE_VERSION, it as buildThreadPriorityPrompt, k as ProviderEventLoggers, kt as parseGenericCliVersion, lt as sanitizePrTitle, mr as ServerSettingsService, nt as buildPrContentPrompt, or as enrichProviderSnapshotWithVersionAdvisory, ot as extractJsonObject, pr as compareCliVersions, t as makeServerQueueMetrics, tt as buildIssueContentTitlePrompt, ut as sanitizeThreadTitle, v as buildOpenCodePermissionRules, w as toOpenCodeFileParts, wt as buildServerProvider, x as openCodeRuntimeErrorDetail, y as isOpenCodeNativeAttachment, zt as ProviderAdapterRequestError } from "./bin.mjs";
|
|
7
|
+
import { i as formatAttachmentPathLines, n as stampRuntimeEvent, r as appendAttachmentPathLines, t as requireRuntimeSessionId } from "./runtimeSession-CA6cLWg0.mjs";
|
|
8
8
|
import { t as defaultProviderContinuationIdentity } from "./ProviderDriver-kCV60GKk.mjs";
|
|
9
|
+
import { t as formatSourceControlContextsForAgent } from "./sourceControlContextFormatter-DEwpnVAH.mjs";
|
|
10
|
+
import { t as makeManagedServerProvider } from "./makeManagedServerProvider-BINne1KE.mjs";
|
|
9
11
|
import { Cause, Data, Effect, Exit, Fiber, Queue, Ref, Schema, Scope, Semaphore, Stream } from "effect";
|
|
10
12
|
import { HttpClient } from "effect/unstable/http";
|
|
11
13
|
import * as NodePath from "node:path";
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
12
15
|
import * as NodeOS from "node:os";
|
|
13
16
|
import * as NodeFS from "node:fs/promises";
|
|
14
17
|
import "effect/unstable/process";
|
|
@@ -210,106 +213,115 @@ const makeOpenCodeTextGeneration = Effect.fn("makeOpenCodeTextGeneration")(funct
|
|
|
210
213
|
cause
|
|
211
214
|
}))));
|
|
212
215
|
});
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
const generateCommitMessage = Effect.fn("OpenCodeTextGeneration.generateCommitMessage")(function* (input) {
|
|
217
|
+
const { prompt, outputSchema } = buildCommitMessagePrompt({
|
|
218
|
+
branch: input.branch,
|
|
219
|
+
stagedSummary: input.stagedSummary,
|
|
220
|
+
stagedPatch: input.stagedPatch,
|
|
221
|
+
includeBranch: input.includeBranch === true
|
|
222
|
+
});
|
|
223
|
+
const generated = yield* runOpenCodeJson({
|
|
224
|
+
operation: "generateCommitMessage",
|
|
225
|
+
cwd: input.cwd,
|
|
226
|
+
prompt,
|
|
227
|
+
outputSchemaJson: outputSchema,
|
|
228
|
+
modelSelection: input.modelSelection
|
|
229
|
+
});
|
|
230
|
+
return {
|
|
231
|
+
subject: sanitizeCommitSubject(generated.subject),
|
|
232
|
+
body: generated.body.trim(),
|
|
233
|
+
..."branch" in generated && typeof generated.branch === "string" ? { branch: sanitizeFeatureBranchName(generated.branch) } : {}
|
|
234
|
+
};
|
|
235
|
+
});
|
|
236
|
+
const generatePrContent = Effect.fn("OpenCodeTextGeneration.generatePrContent")(function* (input) {
|
|
237
|
+
const { prompt, outputSchema } = buildPrContentPrompt({
|
|
238
|
+
baseBranch: input.baseBranch,
|
|
239
|
+
headBranch: input.headBranch,
|
|
240
|
+
commitSummary: input.commitSummary,
|
|
241
|
+
diffSummary: input.diffSummary,
|
|
242
|
+
diffPatch: input.diffPatch
|
|
243
|
+
});
|
|
244
|
+
const generated = yield* runOpenCodeJson({
|
|
245
|
+
operation: "generatePrContent",
|
|
246
|
+
cwd: input.cwd,
|
|
247
|
+
prompt,
|
|
248
|
+
outputSchemaJson: outputSchema,
|
|
249
|
+
modelSelection: input.modelSelection
|
|
250
|
+
});
|
|
251
|
+
return {
|
|
252
|
+
title: sanitizePrTitle(generated.title),
|
|
253
|
+
body: generated.body.trim()
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
const generateBranchName = Effect.fn("OpenCodeTextGeneration.generateBranchName")(function* (input) {
|
|
257
|
+
const { prompt, outputSchema } = buildBranchNamePrompt({
|
|
258
|
+
message: input.message,
|
|
259
|
+
attachments: input.attachments
|
|
260
|
+
});
|
|
261
|
+
const generated = yield* runOpenCodeJson({
|
|
262
|
+
operation: "generateBranchName",
|
|
263
|
+
cwd: input.cwd,
|
|
264
|
+
prompt,
|
|
265
|
+
outputSchemaJson: outputSchema,
|
|
266
|
+
modelSelection: input.modelSelection,
|
|
267
|
+
attachments: input.attachments
|
|
268
|
+
});
|
|
269
|
+
return { branch: sanitizeBranchFragment(generated.branch) };
|
|
270
|
+
});
|
|
271
|
+
const generateThreadTitle = Effect.fn("OpenCodeTextGeneration.generateThreadTitle")(function* (input) {
|
|
272
|
+
const { prompt, outputSchema } = buildThreadTitlePrompt({
|
|
273
|
+
message: input.message,
|
|
274
|
+
attachments: input.attachments
|
|
275
|
+
});
|
|
276
|
+
const generated = yield* runOpenCodeJson({
|
|
277
|
+
operation: "generateThreadTitle",
|
|
278
|
+
cwd: input.cwd,
|
|
279
|
+
prompt,
|
|
280
|
+
outputSchemaJson: outputSchema,
|
|
281
|
+
modelSelection: input.modelSelection,
|
|
282
|
+
attachments: input.attachments
|
|
283
|
+
});
|
|
284
|
+
return { title: sanitizeThreadTitle(generated.title) };
|
|
285
|
+
});
|
|
286
|
+
const generateIssueContent = Effect.fn("OpenCodeTextGeneration.generateIssueContent")(function* (input) {
|
|
287
|
+
if (input.mode === "polish") {
|
|
288
|
+
const { prompt, outputSchema } = buildIssueContentPolishPrompt({
|
|
289
|
+
rough: input.rough ?? "",
|
|
290
|
+
...input.currentTitle ? { currentTitle: input.currentTitle } : {},
|
|
291
|
+
...input.customInstructions ? { customInstructions: input.customInstructions } : {}
|
|
220
292
|
});
|
|
221
|
-
const
|
|
222
|
-
operation: "
|
|
293
|
+
const decoded = yield* runOpenCodeJson({
|
|
294
|
+
operation: "generateIssueContent",
|
|
223
295
|
cwd: input.cwd,
|
|
224
296
|
prompt,
|
|
225
297
|
outputSchemaJson: outputSchema,
|
|
226
298
|
modelSelection: input.modelSelection
|
|
227
299
|
});
|
|
228
300
|
return {
|
|
229
|
-
|
|
230
|
-
body:
|
|
231
|
-
..."branch" in generated && typeof generated.branch === "string" ? { branch: sanitizeFeatureBranchName(generated.branch) } : {}
|
|
301
|
+
title: decoded.title.trim(),
|
|
302
|
+
body: decoded.body.trim()
|
|
232
303
|
};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
headBranch: input.headBranch,
|
|
238
|
-
commitSummary: input.commitSummary,
|
|
239
|
-
diffSummary: input.diffSummary,
|
|
240
|
-
diffPatch: input.diffPatch
|
|
241
|
-
});
|
|
242
|
-
const generated = yield* runOpenCodeJson({
|
|
243
|
-
operation: "generatePrContent",
|
|
304
|
+
} else {
|
|
305
|
+
const { prompt, outputSchema } = buildIssueContentTitlePrompt({ body: input.body ?? "" });
|
|
306
|
+
return { title: (yield* runOpenCodeJson({
|
|
307
|
+
operation: "generateIssueContent",
|
|
244
308
|
cwd: input.cwd,
|
|
245
309
|
prompt,
|
|
246
310
|
outputSchemaJson: outputSchema,
|
|
247
311
|
modelSelection: input.modelSelection
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
cwd: input.cwd,
|
|
262
|
-
prompt,
|
|
263
|
-
outputSchemaJson: outputSchema,
|
|
264
|
-
modelSelection: input.modelSelection,
|
|
265
|
-
attachments: input.attachments
|
|
266
|
-
});
|
|
267
|
-
return { branch: sanitizeBranchFragment(generated.branch) };
|
|
268
|
-
}),
|
|
269
|
-
generateThreadTitle: Effect.fn("OpenCodeTextGeneration.generateThreadTitle")(function* (input) {
|
|
270
|
-
const { prompt, outputSchema } = buildThreadTitlePrompt({
|
|
271
|
-
message: input.message,
|
|
272
|
-
attachments: input.attachments
|
|
273
|
-
});
|
|
274
|
-
const generated = yield* runOpenCodeJson({
|
|
275
|
-
operation: "generateThreadTitle",
|
|
276
|
-
cwd: input.cwd,
|
|
277
|
-
prompt,
|
|
278
|
-
outputSchemaJson: outputSchema,
|
|
279
|
-
modelSelection: input.modelSelection,
|
|
280
|
-
attachments: input.attachments
|
|
281
|
-
});
|
|
282
|
-
return { title: sanitizeThreadTitle(generated.title) };
|
|
283
|
-
}),
|
|
284
|
-
generateIssueContent: Effect.fn("OpenCodeTextGeneration.generateIssueContent")(function* (input) {
|
|
285
|
-
if (input.mode === "polish") {
|
|
286
|
-
const { prompt, outputSchema } = buildIssueContentPolishPrompt({
|
|
287
|
-
rough: input.rough ?? "",
|
|
288
|
-
...input.currentTitle ? { currentTitle: input.currentTitle } : {},
|
|
289
|
-
...input.customInstructions ? { customInstructions: input.customInstructions } : {}
|
|
290
|
-
});
|
|
291
|
-
const decoded = yield* runOpenCodeJson({
|
|
292
|
-
operation: "generateIssueContent",
|
|
293
|
-
cwd: input.cwd,
|
|
294
|
-
prompt,
|
|
295
|
-
outputSchemaJson: outputSchema,
|
|
296
|
-
modelSelection: input.modelSelection
|
|
297
|
-
});
|
|
298
|
-
return {
|
|
299
|
-
title: decoded.title.trim(),
|
|
300
|
-
body: decoded.body.trim()
|
|
301
|
-
};
|
|
302
|
-
} else {
|
|
303
|
-
const { prompt, outputSchema } = buildIssueContentTitlePrompt({ body: input.body ?? "" });
|
|
304
|
-
return { title: (yield* runOpenCodeJson({
|
|
305
|
-
operation: "generateIssueContent",
|
|
306
|
-
cwd: input.cwd,
|
|
307
|
-
prompt,
|
|
308
|
-
outputSchemaJson: outputSchema,
|
|
309
|
-
modelSelection: input.modelSelection
|
|
310
|
-
})).title.trim() };
|
|
311
|
-
}
|
|
312
|
-
}),
|
|
312
|
+
})).title.trim() };
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
const answerSideQuestion = () => Effect.fail(new TextGenerationError({
|
|
316
|
+
operation: "answerSideQuestion",
|
|
317
|
+
detail: "OpenCode cannot isolate configured server plugins for a tool-free side question. Select Codex, Claude, or GitHub Copilot for side chat."
|
|
318
|
+
}));
|
|
319
|
+
return {
|
|
320
|
+
generateCommitMessage,
|
|
321
|
+
generatePrContent,
|
|
322
|
+
generateBranchName,
|
|
323
|
+
generateThreadTitle,
|
|
324
|
+
generateIssueContent,
|
|
313
325
|
rankInboxThreads: Effect.fn("OpenCodeTextGeneration.rankInboxThreads")(function* (input) {
|
|
314
326
|
const { prompt, outputSchema } = buildThreadPriorityPrompt({ serializedCandidates: input.chunk.serializedCandidates });
|
|
315
327
|
const generated = yield* runOpenCodeJson({
|
|
@@ -320,10 +332,177 @@ const makeOpenCodeTextGeneration = Effect.fn("makeOpenCodeTextGeneration")(funct
|
|
|
320
332
|
modelSelection: input.modelSelection
|
|
321
333
|
});
|
|
322
334
|
return yield* validateRankInboxThreadsResult(input, generated.rankings);
|
|
323
|
-
})
|
|
335
|
+
}),
|
|
336
|
+
answerSideQuestion
|
|
324
337
|
};
|
|
325
338
|
});
|
|
326
339
|
//#endregion
|
|
340
|
+
//#region src/provider/openCodeTaskLifecycle.ts
|
|
341
|
+
const text = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
342
|
+
const record = (value) => value !== null && typeof value === "object" ? value : {};
|
|
343
|
+
const terminal = (status) => status === "completed" || status === "failed" || status === "stopped";
|
|
344
|
+
function resultText(output) {
|
|
345
|
+
const result = output.match(/<task_result>\s*([\s\S]*?)\s*<\/task_result>/)?.[1];
|
|
346
|
+
return text(result ?? output.split("\n").filter((line) => !line.trimStart().startsWith("task_id:")).join("\n"));
|
|
347
|
+
}
|
|
348
|
+
/** Native Task lifecycle state stays here; clients consume the shared subagent events. */
|
|
349
|
+
var OpenCodeTaskLifecycle = class {
|
|
350
|
+
tasks = /* @__PURE__ */ new Map();
|
|
351
|
+
calls = /* @__PURE__ */ new Map();
|
|
352
|
+
sessions = /* @__PURE__ */ new Map();
|
|
353
|
+
emitted = /* @__PURE__ */ new Set();
|
|
354
|
+
notifications = /* @__PURE__ */ new Set();
|
|
355
|
+
values() {
|
|
356
|
+
return Array.from(this.tasks.values(), (task) => task.ref);
|
|
357
|
+
}
|
|
358
|
+
hasSession(id) {
|
|
359
|
+
return this.sessions.has(id);
|
|
360
|
+
}
|
|
361
|
+
refForSession(id) {
|
|
362
|
+
return this.sessions.get(id)?.ref;
|
|
363
|
+
}
|
|
364
|
+
transition(task, type, source) {
|
|
365
|
+
const eventKey = JSON.stringify([
|
|
366
|
+
task.ref.subagentId,
|
|
367
|
+
task.callId ?? source,
|
|
368
|
+
type,
|
|
369
|
+
task.status,
|
|
370
|
+
task.summary,
|
|
371
|
+
task.ref
|
|
372
|
+
]);
|
|
373
|
+
if (this.emitted.has(eventKey)) return [];
|
|
374
|
+
this.emitted.add(eventKey);
|
|
375
|
+
return [{
|
|
376
|
+
type,
|
|
377
|
+
subagent: task.ref,
|
|
378
|
+
status: task.status,
|
|
379
|
+
...task.summary ? { summary: task.summary } : {},
|
|
380
|
+
eventKey
|
|
381
|
+
}];
|
|
382
|
+
}
|
|
383
|
+
stop() {
|
|
384
|
+
return Array.from(this.tasks.values()).flatMap((task) => {
|
|
385
|
+
if (terminal(task.status)) return [];
|
|
386
|
+
task.status = "stopped";
|
|
387
|
+
return this.transition(task, "completed", "stop");
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
project(part, existingRef) {
|
|
391
|
+
if (part.type === "text") {
|
|
392
|
+
if (part.synthetic !== true) return [];
|
|
393
|
+
const envelope = part.text.match(/<task id="([^"]+)" state="(completed|error|interrupted|cancelled)">/);
|
|
394
|
+
const sessionId = text(envelope?.[1]);
|
|
395
|
+
if (!sessionId) return [];
|
|
396
|
+
const notificationKey = JSON.stringify([
|
|
397
|
+
part.sessionID,
|
|
398
|
+
part.id,
|
|
399
|
+
part.text
|
|
400
|
+
]);
|
|
401
|
+
if (this.notifications.has(notificationKey)) return [];
|
|
402
|
+
this.notifications.add(notificationKey);
|
|
403
|
+
let task = this.sessions.get(sessionId);
|
|
404
|
+
if (task && terminal(task.status)) return [];
|
|
405
|
+
const events = [];
|
|
406
|
+
if (!task) {
|
|
407
|
+
task = {
|
|
408
|
+
ref: existingRef ?? this.makeRef(sessionId, part.sessionID),
|
|
409
|
+
callId: void 0,
|
|
410
|
+
status: "running",
|
|
411
|
+
summary: void 0,
|
|
412
|
+
seenCalls: /* @__PURE__ */ new Set()
|
|
413
|
+
};
|
|
414
|
+
this.tasks.set(String(task.ref.subagentId), task);
|
|
415
|
+
this.sessions.set(sessionId, task);
|
|
416
|
+
events.push(...this.transition(task, "started", part.id));
|
|
417
|
+
}
|
|
418
|
+
task.status = envelope?.[2] === "error" ? "failed" : envelope?.[2] === "completed" ? "completed" : "stopped";
|
|
419
|
+
task.summary = task.status === "failed" ? text(part.text.match(/<task_error>\s*([\s\S]*?)\s*<\/task_error>/)?.[1]) : resultText(part.text);
|
|
420
|
+
return [...events, ...this.transition(task, "completed", part.id)];
|
|
421
|
+
}
|
|
422
|
+
if (part.type !== "tool" || part.tool.toLowerCase() !== "task") return [];
|
|
423
|
+
const callKey = JSON.stringify([part.sessionID, part.callID]);
|
|
424
|
+
const previousCall = this.calls.get(callKey);
|
|
425
|
+
const metadata = "metadata" in part.state ? record(part.state.metadata) : {};
|
|
426
|
+
const input = record(part.state.input);
|
|
427
|
+
const output = part.state.status === "completed" ? part.state.output : "";
|
|
428
|
+
const sessionId = text(metadata.sessionId) ?? text(metadata.sessionID) ?? text(input.task_id) ?? text(metadata.jobId) ?? text(output.match(/<task id="([^"]+)"/)?.[1]) ?? text(output.match(/(?:^|\n)\s*task_id:\s*(\S+)/)?.[1]);
|
|
429
|
+
if (part.state.status === "pending" && !sessionId && !previousCall) return [];
|
|
430
|
+
let task = previousCall ?? (sessionId ? this.sessions.get(sessionId) : void 0);
|
|
431
|
+
if (!task && !sessionId && part.state.status !== "error") return [];
|
|
432
|
+
if (task && task.callId !== void 0 && task.callId !== callKey && task.seenCalls.has(callKey)) return [];
|
|
433
|
+
if (task && task.callId === callKey && task.status !== "starting" && part.state.status === "pending") return [];
|
|
434
|
+
const newTask = !task;
|
|
435
|
+
if (!task) {
|
|
436
|
+
task = {
|
|
437
|
+
ref: existingRef ?? this.makeRef(sessionId, part.sessionID, part.callID),
|
|
438
|
+
callId: callKey,
|
|
439
|
+
status: "starting",
|
|
440
|
+
summary: void 0,
|
|
441
|
+
seenCalls: /* @__PURE__ */ new Set()
|
|
442
|
+
};
|
|
443
|
+
this.tasks.set(String(task.ref.subagentId), task);
|
|
444
|
+
}
|
|
445
|
+
const reopen = task.callId !== void 0 && task.callId !== callKey;
|
|
446
|
+
const terminalBeforeTool = task.callId === void 0 && terminal(task.status);
|
|
447
|
+
const priorRef = task.ref;
|
|
448
|
+
const priorStatus = task.status;
|
|
449
|
+
if (reopen) {
|
|
450
|
+
task.status = "starting";
|
|
451
|
+
task.summary = void 0;
|
|
452
|
+
}
|
|
453
|
+
task.callId = callKey;
|
|
454
|
+
task.seenCalls.add(callKey);
|
|
455
|
+
this.calls.set(callKey, task);
|
|
456
|
+
const modelRecord = record(metadata.model);
|
|
457
|
+
const provider = text(modelRecord.providerID);
|
|
458
|
+
const model = text(modelRecord.modelID);
|
|
459
|
+
task.ref = {
|
|
460
|
+
...task.ref,
|
|
461
|
+
...sessionId ? {
|
|
462
|
+
providerSessionId: sessionId,
|
|
463
|
+
providerThreadId: sessionId
|
|
464
|
+
} : {},
|
|
465
|
+
...text(input.description) ? { description: text(input.description) } : {},
|
|
466
|
+
...text(input.subagent_type) ? { label: text(input.subagent_type) } : {},
|
|
467
|
+
...provider && model ? { model: `${provider}/${model}` } : {},
|
|
468
|
+
parentProviderItemId: ProviderItemId.make(part.callID),
|
|
469
|
+
metadata: {
|
|
470
|
+
...task.ref.metadata,
|
|
471
|
+
...metadata,
|
|
472
|
+
source: "opencode.task",
|
|
473
|
+
parentSessionId: part.sessionID
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
if (sessionId) this.sessions.set(sessionId, task);
|
|
477
|
+
const outputState = output.match(/<task id="[^"]+" state="([^"]+)">/)?.[1];
|
|
478
|
+
const interrupted = outputState === "interrupted" || outputState === "cancelled";
|
|
479
|
+
const background = metadata.background === true || outputState === "running";
|
|
480
|
+
const events = [];
|
|
481
|
+
if (newTask) events.push(...this.transition(task, "started", part.id));
|
|
482
|
+
if (!terminalBeforeTool && (!terminal(task.status) || reopen)) {
|
|
483
|
+
task.status = interrupted ? "stopped" : part.state.status === "error" ? "failed" : part.state.status === "completed" && !background ? "completed" : part.state.status === "pending" ? "starting" : "running";
|
|
484
|
+
task.summary = part.state.status === "error" ? text(part.state.error) : task.status === "completed" ? resultText(output) : void 0;
|
|
485
|
+
events.push(...this.transition(task, terminal(task.status) ? "completed" : "updated", part.id));
|
|
486
|
+
} else if (JSON.stringify(priorRef) !== JSON.stringify(task.ref) || priorStatus !== task.status) events.push(...this.transition(task, "updated", part.id));
|
|
487
|
+
return events;
|
|
488
|
+
}
|
|
489
|
+
makeRef(sessionId, parentSessionId, callId) {
|
|
490
|
+
return {
|
|
491
|
+
subagentId: RuntimeSubagentId.make(sessionId ? `opencode:session:${sessionId}` : `opencode:task:${parentSessionId}:${callId}`),
|
|
492
|
+
origin: "native",
|
|
493
|
+
capability: "summary",
|
|
494
|
+
...sessionId ? {
|
|
495
|
+
providerSessionId: sessionId,
|
|
496
|
+
providerThreadId: sessionId
|
|
497
|
+
} : {},
|
|
498
|
+
metadata: {
|
|
499
|
+
source: "opencode.task",
|
|
500
|
+
parentSessionId
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
//#endregion
|
|
327
506
|
//#region src/provider/Layers/OpenCodeAdapter.ts
|
|
328
507
|
const PROVIDER$1 = ProviderDriverKind.make("opencode");
|
|
329
508
|
const OPENCODE_RESUME_VERSION = 1;
|
|
@@ -693,6 +872,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
693
872
|
});
|
|
694
873
|
});
|
|
695
874
|
const emitOpenCodeSubagentUpdated = Effect.fn("emitOpenCodeSubagentUpdated")(function* (context, input) {
|
|
875
|
+
if (context.completedSubagentIds.has(subagentKey(input.subagent.subagentId))) return;
|
|
696
876
|
yield* emitOpenCodeSubagentStarted(context, input.subagent, input.raw);
|
|
697
877
|
yield* emitForContext(context, {
|
|
698
878
|
...yield* buildEventBase({
|
|
@@ -728,7 +908,98 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
728
908
|
}
|
|
729
909
|
});
|
|
730
910
|
});
|
|
911
|
+
const emitOpenCodeTaskTransition = Effect.fn("emitOpenCodeTaskTransition")(function* (context, transition, raw) {
|
|
912
|
+
const nativeRef = transition.subagent;
|
|
913
|
+
const existing = nativeRef.providerSessionId ? context.subagentBySessionId.get(nativeRef.providerSessionId) : void 0;
|
|
914
|
+
const subagent = {
|
|
915
|
+
...existing,
|
|
916
|
+
...nativeRef,
|
|
917
|
+
subagentId: existing?.subagentId ?? nativeRef.subagentId,
|
|
918
|
+
capability: existing?.capability === "transcript" ? "transcript" : nativeRef.capability,
|
|
919
|
+
metadata: {
|
|
920
|
+
...existing?.metadata,
|
|
921
|
+
...nativeRef.metadata,
|
|
922
|
+
providerInstanceId: boundInstanceId
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
if (subagent.providerSessionId) {
|
|
926
|
+
context.childSessionIds.add(subagent.providerSessionId);
|
|
927
|
+
context.subagentBySessionId.set(subagent.providerSessionId, subagent);
|
|
928
|
+
}
|
|
929
|
+
const key = subagentKey(subagent.subagentId);
|
|
930
|
+
const base = {
|
|
931
|
+
...yield* buildEventBase({
|
|
932
|
+
threadId: context.session.threadId,
|
|
933
|
+
turnId: context.activeTurnId,
|
|
934
|
+
raw
|
|
935
|
+
}),
|
|
936
|
+
eventId: EventId.make(createHash("sha256").update(JSON.stringify([
|
|
937
|
+
context.session.threadId,
|
|
938
|
+
context.openCodeSessionId,
|
|
939
|
+
transition.eventKey
|
|
940
|
+
])).digest("hex"))
|
|
941
|
+
};
|
|
942
|
+
if (transition.type === "started") {
|
|
943
|
+
if (context.startedSubagentIds.has(key)) yield* emitForContext(context, {
|
|
944
|
+
...base,
|
|
945
|
+
type: "subagent.updated",
|
|
946
|
+
payload: {
|
|
947
|
+
subagent,
|
|
948
|
+
status: transition.status
|
|
949
|
+
}
|
|
950
|
+
});
|
|
951
|
+
else {
|
|
952
|
+
context.startedSubagentIds.add(key);
|
|
953
|
+
yield* emitForContext(context, {
|
|
954
|
+
...base,
|
|
955
|
+
type: "subagent.started",
|
|
956
|
+
payload: { subagent }
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
context.completedSubagentIds.delete(key);
|
|
960
|
+
} else if (transition.type === "completed") {
|
|
961
|
+
context.startedSubagentIds.add(key);
|
|
962
|
+
context.completedSubagentIds.add(key);
|
|
963
|
+
yield* emitForContext(context, {
|
|
964
|
+
...base,
|
|
965
|
+
type: "subagent.completed",
|
|
966
|
+
payload: {
|
|
967
|
+
subagent,
|
|
968
|
+
status: transition.status,
|
|
969
|
+
...transition.summary ? { summary: transition.summary } : {}
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
} else {
|
|
973
|
+
if (transition.status === "running" || transition.status === "starting") context.completedSubagentIds.delete(key);
|
|
974
|
+
yield* emitForContext(context, {
|
|
975
|
+
...base,
|
|
976
|
+
type: "subagent.updated",
|
|
977
|
+
payload: {
|
|
978
|
+
subagent,
|
|
979
|
+
status: transition.status,
|
|
980
|
+
...transition.summary ? { summary: transition.summary } : {}
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
const projectOpenCodeTask = Effect.fn("projectOpenCodeTask")(function* (context, part) {
|
|
986
|
+
for (const transition of context.tasks.project(part)) yield* emitOpenCodeTaskTransition(context, transition, part);
|
|
987
|
+
});
|
|
988
|
+
const loadOpenCodeTasks = Effect.fn("loadOpenCodeTasks")(function* (context) {
|
|
989
|
+
const messages = yield* runOpenCodeSdk("session.messages", () => context.client.session.messages({ sessionID: context.openCodeSessionId }));
|
|
990
|
+
const latest = /* @__PURE__ */ new Map();
|
|
991
|
+
for (const entry of messages.data ?? []) for (const part of entry.parts) {
|
|
992
|
+
if (part.sessionID !== context.openCodeSessionId) continue;
|
|
993
|
+
if (entry.info.role !== "assistant" && !(part.type === "text" && part.synthetic)) continue;
|
|
994
|
+
for (const transition of context.tasks.project(part)) latest.set(String(transition.subagent.subagentId), {
|
|
995
|
+
transition,
|
|
996
|
+
part
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
return [...latest.values()];
|
|
1000
|
+
});
|
|
731
1001
|
const emitStoppedOpenCodeChildren = Effect.fn("emitStoppedOpenCodeChildren")(function* (context, raw) {
|
|
1002
|
+
for (const transition of context.tasks.stop()) yield* emitOpenCodeTaskTransition(context, transition, raw);
|
|
732
1003
|
for (const subagent of context.subagentBySessionId.values()) yield* emitOpenCodeSubagentCompleted(context, {
|
|
733
1004
|
subagent,
|
|
734
1005
|
status: subagentCompletionStatus("stopped"),
|
|
@@ -757,10 +1028,12 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
757
1028
|
};
|
|
758
1029
|
const registerOpenCodeChildSession = Effect.fn("registerOpenCodeChildSession")(function* (context, session, raw) {
|
|
759
1030
|
if (session.parentID !== context.openCodeSessionId && (session.parentID === void 0 || !context.childSessionIds.has(session.parentID))) return;
|
|
760
|
-
const
|
|
1031
|
+
const taskRef = context.tasks.refForSession(session.id);
|
|
1032
|
+
const subagent = mergeOpenCodeChildSessionRef(context.subagentBySessionId.get(session.id) ?? taskRef ?? takeUnboundOpenCodeSubtask(context), session, session.parentID ?? context.openCodeSessionId);
|
|
761
1033
|
const known = context.childSessionIds.has(session.id);
|
|
762
1034
|
context.childSessionIds.add(session.id);
|
|
763
1035
|
context.subagentBySessionId.set(session.id, subagent);
|
|
1036
|
+
if (taskRef) return subagent;
|
|
764
1037
|
if (known) {
|
|
765
1038
|
yield* emitOpenCodeSubagentUpdated(context, {
|
|
766
1039
|
subagent,
|
|
@@ -886,6 +1159,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
886
1159
|
});
|
|
887
1160
|
const emitUnexpectedExit = Effect.fn("emitUnexpectedExit")(function* (context, message) {
|
|
888
1161
|
if (yield* Ref.getAndSet(context.stopped, true)) return;
|
|
1162
|
+
yield* emitStoppedOpenCodeChildren(context, { reason: "transport-exit" });
|
|
889
1163
|
const turnId = context.activeTurnId;
|
|
890
1164
|
yield* emitForContext(context, {
|
|
891
1165
|
...yield* buildEventBase({
|
|
@@ -982,6 +1256,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
982
1256
|
}
|
|
983
1257
|
});
|
|
984
1258
|
const handleSubscribedEvent = Effect.fn("handleSubscribedEvent")(function* (context, event) {
|
|
1259
|
+
if (yield* Ref.get(context.stopped)) return;
|
|
985
1260
|
const payloadSessionId = "properties" in event ? event.properties.sessionID : void 0;
|
|
986
1261
|
const eventSessionId = typeof payloadSessionId === "string" ? payloadSessionId : void 0;
|
|
987
1262
|
const isRootSessionEvent = eventSessionId === context.openCodeSessionId;
|
|
@@ -1099,14 +1374,17 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1099
1374
|
case "message.part.updated": {
|
|
1100
1375
|
const part = event.properties.part;
|
|
1101
1376
|
context.partById.set(scopedOpenCodeId(part.sessionID, part.id), part);
|
|
1102
|
-
|
|
1377
|
+
const messageRole = messageRoleForPart(context, part);
|
|
1378
|
+
if (part.sessionID === context.openCodeSessionId && messageRole !== "user") yield* projectOpenCodeTask(context, part);
|
|
1379
|
+
else if (part.sessionID === context.openCodeSessionId && part.type === "text" && part.synthetic) yield* projectOpenCodeTask(context, part);
|
|
1380
|
+
if (messageRole === "assistant") yield* emitAssistantTextDelta(context, part, turnId, event);
|
|
1103
1381
|
if (part.type === "subtask" && part.sessionID === context.openCodeSessionId) yield* bindOpenCodeSubtaskPart(context, part, event);
|
|
1104
1382
|
if (part.type === "tool") {
|
|
1105
1383
|
const itemType = toToolLifecycleItemType(part.tool);
|
|
1106
1384
|
const title = part.state.status === "running" ? part.state.title ?? part.tool : part.tool;
|
|
1107
1385
|
const detail = detailFromToolPart(part);
|
|
1108
1386
|
const childSubagent = context.subagentBySessionId.get(part.sessionID);
|
|
1109
|
-
if (childSubagent) yield* emitOpenCodeSubagentUpdated(context, {
|
|
1387
|
+
if (childSubagent && !context.tasks.hasSession(part.sessionID)) yield* emitOpenCodeSubagentUpdated(context, {
|
|
1110
1388
|
subagent: childSubagent,
|
|
1111
1389
|
status: statusFromOpenCodeSubagentState("running"),
|
|
1112
1390
|
summary: title,
|
|
@@ -1223,6 +1501,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1223
1501
|
});
|
|
1224
1502
|
break;
|
|
1225
1503
|
case "session.status": {
|
|
1504
|
+
if (context.tasks.hasSession(event.properties.sessionID)) break;
|
|
1226
1505
|
const childSubagent = context.subagentBySessionId.get(event.properties.sessionID);
|
|
1227
1506
|
if (childSubagent) {
|
|
1228
1507
|
if (event.properties.status.type === "idle") {
|
|
@@ -1290,6 +1569,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1290
1569
|
break;
|
|
1291
1570
|
}
|
|
1292
1571
|
case "session.idle": {
|
|
1572
|
+
if (context.tasks.hasSession(event.properties.sessionID)) break;
|
|
1293
1573
|
const childSubagent = context.subagentBySessionId.get(event.properties.sessionID);
|
|
1294
1574
|
if (childSubagent) yield* emitOpenCodeSubagentCompleted(context, {
|
|
1295
1575
|
subagent: childSubagent,
|
|
@@ -1299,6 +1579,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1299
1579
|
break;
|
|
1300
1580
|
}
|
|
1301
1581
|
case "session.error": {
|
|
1582
|
+
if (event.properties.sessionID && context.tasks.hasSession(event.properties.sessionID)) break;
|
|
1302
1583
|
const message = sessionErrorMessage(event.properties.error);
|
|
1303
1584
|
const childSubagent = event.properties.sessionID !== void 0 ? context.subagentBySessionId.get(event.properties.sessionID) : void 0;
|
|
1304
1585
|
if (childSubagent) {
|
|
@@ -1351,14 +1632,41 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1351
1632
|
}
|
|
1352
1633
|
}
|
|
1353
1634
|
});
|
|
1354
|
-
const
|
|
1635
|
+
const prepareEventSubscription = Effect.fn("prepareEventSubscription")(function* (context) {
|
|
1355
1636
|
const eventsAbortController = new AbortController();
|
|
1356
1637
|
yield* Scope.addFinalizer(context.sessionScope, Effect.sync(() => eventsAbortController.abort()));
|
|
1357
|
-
yield*
|
|
1638
|
+
const iterator = (yield* runOpenCodeSdk("event.subscribe", () => context.client.event.subscribe(void 0, { signal: eventsAbortController.signal }))).stream[Symbol.asyncIterator]();
|
|
1639
|
+
const first = yield* runOpenCodeSdk("event.subscribe", () => iterator.next()).pipe(Effect.timeoutOrElse({
|
|
1640
|
+
duration: "10 seconds",
|
|
1641
|
+
orElse: () => Effect.fail(new OpenCodeRuntimeError({
|
|
1642
|
+
operation: "event.subscribe",
|
|
1643
|
+
detail: "Timed out opening OpenCode event stream."
|
|
1644
|
+
}))
|
|
1645
|
+
}));
|
|
1646
|
+
return {
|
|
1647
|
+
subscription: { stream: (async function* () {
|
|
1648
|
+
try {
|
|
1649
|
+
if (!first.done) yield first.value;
|
|
1650
|
+
if (first.done) return;
|
|
1651
|
+
while (true) {
|
|
1652
|
+
const next = await iterator.next();
|
|
1653
|
+
if (next.done) return;
|
|
1654
|
+
yield next.value;
|
|
1655
|
+
}
|
|
1656
|
+
} finally {
|
|
1657
|
+
await iterator.return?.();
|
|
1658
|
+
}
|
|
1659
|
+
})() },
|
|
1660
|
+
eventsAbortController
|
|
1661
|
+
};
|
|
1662
|
+
});
|
|
1663
|
+
const startEventPump = Effect.fn("startEventPump")(function* (context, prepared) {
|
|
1664
|
+
const { subscription, eventsAbortController } = prepared;
|
|
1665
|
+
yield* Stream.fromAsyncIterable(subscription.stream, (cause) => new OpenCodeRuntimeError({
|
|
1358
1666
|
operation: "event.subscribe",
|
|
1359
1667
|
detail: openCodeRuntimeErrorDetail(cause),
|
|
1360
1668
|
cause
|
|
1361
|
-
})).pipe(Stream.runForEach((event) => handleSubscribedEvent(context, event)))
|
|
1669
|
+
})).pipe(Stream.runForEach((event) => handleSubscribedEvent(context, event))).pipe(Effect.exit, Effect.flatMap((exit) => Effect.gen(function* () {
|
|
1362
1670
|
if (eventsAbortController.signal.aborted || (yield* Ref.get(context.stopped))) return;
|
|
1363
1671
|
if (Exit.isFailure(exit)) yield* emitUnexpectedExit(context, openCodeRuntimeErrorDetail(Cause.squash(exit.cause)));
|
|
1364
1672
|
})), Effect.forkIn(context.sessionScope));
|
|
@@ -1447,7 +1755,8 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1447
1755
|
sessionScope,
|
|
1448
1756
|
server,
|
|
1449
1757
|
client,
|
|
1450
|
-
openCodeSession: openCodeSession.data
|
|
1758
|
+
openCodeSession: openCodeSession.data,
|
|
1759
|
+
adopted: adoptedSession !== void 0
|
|
1451
1760
|
};
|
|
1452
1761
|
}).pipe(Effect.provideService(Scope.Scope, sessionScope)));
|
|
1453
1762
|
if (Exit.isFailure(startedExit)) {
|
|
@@ -1456,12 +1765,6 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1456
1765
|
}
|
|
1457
1766
|
return startedExit.value;
|
|
1458
1767
|
});
|
|
1459
|
-
const raceWinner = sessions.get(input.threadId);
|
|
1460
|
-
if (raceWinner) {
|
|
1461
|
-
yield* runOpenCodeSdk("session.abort", () => started.client.session.abort({ sessionID: started.openCodeSession.id })).pipe(Effect.ignore);
|
|
1462
|
-
yield* Scope.close(started.sessionScope, Exit.void).pipe(Effect.ignore);
|
|
1463
|
-
return raceWinner.session;
|
|
1464
|
-
}
|
|
1465
1768
|
const createdAt = nowIso();
|
|
1466
1769
|
const tokenMode = input.tokenMode ?? "balanced";
|
|
1467
1770
|
const session = {
|
|
@@ -1500,6 +1803,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1500
1803
|
unboundSubtaskPartIds: [],
|
|
1501
1804
|
startedSubagentIds: /* @__PURE__ */ new Set(),
|
|
1502
1805
|
completedSubagentIds: /* @__PURE__ */ new Set(),
|
|
1806
|
+
tasks: new OpenCodeTaskLifecycle(),
|
|
1503
1807
|
turns: [],
|
|
1504
1808
|
activeTurnId: void 0,
|
|
1505
1809
|
activeAgent: void 0,
|
|
@@ -1513,6 +1817,19 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1513
1817
|
stopped: yield* Ref.make(false),
|
|
1514
1818
|
sessionScope: started.sessionScope
|
|
1515
1819
|
};
|
|
1820
|
+
const prepared = yield* Effect.exit(prepareEventSubscription(context));
|
|
1821
|
+
if (Exit.isFailure(prepared)) {
|
|
1822
|
+
if (!started.adopted) yield* runOpenCodeSdk("session.abort", () => started.client.session.abort({ sessionID: started.openCodeSession.id })).pipe(Effect.ignore);
|
|
1823
|
+
yield* Scope.close(started.sessionScope, Exit.void).pipe(Effect.ignore);
|
|
1824
|
+
return yield* toProcessError(input.threadId, Cause.squash(prepared.cause));
|
|
1825
|
+
}
|
|
1826
|
+
const storedTasks = started.adopted ? yield* loadOpenCodeTasks(context).pipe(Effect.catch((error) => Effect.logWarning("OpenCode Task history reconstruction failed", error).pipe(Effect.as([])))) : [];
|
|
1827
|
+
const raceWinner = sessions.get(input.threadId);
|
|
1828
|
+
if (raceWinner) {
|
|
1829
|
+
if (!started.adopted) yield* runOpenCodeSdk("session.abort", () => started.client.session.abort({ sessionID: started.openCodeSession.id })).pipe(Effect.ignore);
|
|
1830
|
+
yield* Scope.close(started.sessionScope, Exit.void).pipe(Effect.ignore);
|
|
1831
|
+
return raceWinner.session;
|
|
1832
|
+
}
|
|
1516
1833
|
deviceToolContext = context;
|
|
1517
1834
|
sessions.set(input.threadId, context);
|
|
1518
1835
|
yield* emitForContext(context, {
|
|
@@ -1525,7 +1842,8 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1525
1842
|
type: "thread.started",
|
|
1526
1843
|
payload: { providerThreadId: started.openCodeSession.id }
|
|
1527
1844
|
});
|
|
1528
|
-
yield*
|
|
1845
|
+
for (const { transition, part } of storedTasks) yield* emitOpenCodeTaskTransition(context, transition, part);
|
|
1846
|
+
yield* startEventPump(context, prepared.value);
|
|
1529
1847
|
yield* Effect.gen(function* () {
|
|
1530
1848
|
yield* hydrateOpenCodeChildSessions(context);
|
|
1531
1849
|
yield* recoverPendingOpenCodeRequests(context);
|
|
@@ -1694,6 +2012,10 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1694
2012
|
const context = ensureSessionContext(sessions, threadId);
|
|
1695
2013
|
const interruptedTurnId = turnId ?? context.activeTurnId;
|
|
1696
2014
|
if (turnId !== void 0 && context.activeTurnId !== void 0 && turnId !== context.activeTurnId) return;
|
|
2015
|
+
yield* emitStoppedOpenCodeChildren(context, {
|
|
2016
|
+
method: "session.abort",
|
|
2017
|
+
reason: "turn-interrupted"
|
|
2018
|
+
});
|
|
1697
2019
|
const pendingPrompt = context.pendingPrompt;
|
|
1698
2020
|
if (pendingPrompt && pendingPrompt.turnId === interruptedTurnId) {
|
|
1699
2021
|
context.pendingPrompt = void 0;
|
|
@@ -1701,10 +2023,6 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1701
2023
|
}
|
|
1702
2024
|
const rootAbortExit = yield* abortOpenCodeSession(context, context.openCodeSessionId).pipe(Effect.mapError(toRequestError), Effect.exit);
|
|
1703
2025
|
yield* Effect.forEach(context.childSessionIds, (sessionID) => abortOpenCodeSession(context, sessionID).pipe(Effect.ignore({ log: true })), { discard: true });
|
|
1704
|
-
yield* emitStoppedOpenCodeChildren(context, {
|
|
1705
|
-
method: "session.abort",
|
|
1706
|
-
reason: "turn-interrupted"
|
|
1707
|
-
});
|
|
1708
2026
|
if (Exit.isFailure(rootAbortExit)) return yield* Effect.failCause(rootAbortExit.cause);
|
|
1709
2027
|
if (interruptedTurnId) {
|
|
1710
2028
|
if (context.activeTurnId === interruptedTurnId) {
|