ryco-cli 0.1.24 → 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-DSPEmiwq.mjs → AcpAdapter-BemMQNbj.mjs} +102 -604
- package/dist/{GrokDriver-RyyFeh_q.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-CrvgKNf2.cjs → AzureDevOpsSourceControlProvider-B9N_8NJg.cjs} +14 -14
- package/dist/{AzureDevOpsSourceControlProvider-BNGEg1R8.mjs → AzureDevOpsSourceControlProvider-BcQO_CyW.mjs} +3 -3
- package/dist/{BitbucketSourceControlProvider-Bt21jw68.mjs → BitbucketSourceControlProvider-BTUY2ZT8.mjs} +3 -3
- package/dist/{BitbucketSourceControlProvider-BzhsQwH-.cjs → BitbucketSourceControlProvider-C9WuwvY2.cjs} +14 -14
- package/dist/{BunPTY-TbHbSc8S.mjs → BunPTY-DdnqQAdw.mjs} +1 -1
- package/dist/{ClaudeDriver-B7mbf51W.cjs → ClaudeDriver-BSTxNNGO.cjs} +162 -126
- package/dist/{ClaudeDriver-C4yu7Jit.mjs → ClaudeDriver-Csnp78qR.mjs} +129 -93
- package/dist/{CodexDriver-CR0S17Lb.cjs → CodexDriver-BK4HVNV4.cjs} +145 -60
- package/dist/{CodexDriver-DnnqkGoY.mjs → CodexDriver-fwcV84hX.mjs} +99 -14
- package/dist/{CodexTextGeneration-tlfe1S5W.cjs → CodexTextGeneration-Y2GSS7f1.cjs} +145 -99
- package/dist/{CodexTextGeneration-Cw-FZbSS.mjs → CodexTextGeneration-_4aT5BHa.mjs} +141 -95
- package/dist/{CopilotDriver-GxKLX5pL.mjs → CopilotDriver-B12ZJ-L_.mjs} +69 -7
- package/dist/{CopilotDriver-IBd27Ji2.cjs → CopilotDriver-C7IyIwVW.cjs} +98 -36
- package/dist/{CursorDriver-C4Enoe9N.cjs → CursorDriver-BWmCfJ-w.cjs} +38 -32
- package/dist/{CursorDriver-CNo9Uzo8.mjs → CursorDriver-C_p0v-ul.mjs} +12 -6
- package/dist/{ForgejoSourceControlProvider-Dh6DOoc8.cjs → ForgejoSourceControlProvider-DTRrllIH.cjs} +14 -14
- package/dist/{ForgejoSourceControlProvider-BGXysSX6.mjs → ForgejoSourceControlProvider-DmOGJEaJ.mjs} +3 -3
- package/dist/{GitHubSourceControlProvider-8hsv_kCE.cjs → GitHubSourceControlProvider-D-YV8WP6.cjs} +16 -17
- package/dist/{GitHubSourceControlProvider-CPCYV8Xo.mjs → GitHubSourceControlProvider-sQGcwnr3.mjs} +6 -7
- package/dist/{GitLabSourceControlProvider-B0ZbF9Zx.cjs → GitLabSourceControlProvider-kKYYnpER.cjs} +14 -14
- package/dist/{GitLabSourceControlProvider-Bvknpaon.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-CDcvPT9v.cjs → OpenCodeDriver-CckbFEQJ.cjs} +459 -141
- package/dist/{OpenCodeDriver-0q44rSQX.mjs → OpenCodeDriver-CnWJHyDJ.mjs} +430 -112
- package/dist/SideQuestionIsolation-5eGFRW0t.mjs +26 -0
- package/dist/SideQuestionIsolation-DvVKZWxi.cjs +37 -0
- package/dist/{SourceControlProviderDiscoveryCatalog-B37RHe2u.mjs → SourceControlProviderDiscoveryCatalog-BVvq7liJ.mjs} +2 -1
- package/dist/{SourceControlProviderDiscoveryCatalog-DreaAH1H.cjs → SourceControlProviderDiscoveryCatalog-CyUhKJLD.cjs} +6 -5
- package/dist/bin.cjs +12772 -3149
- package/dist/bin.mjs +10669 -1075
- 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-i0YhvlGD.js → AnimatedHeight-CbIEyMLg.js} +1 -1
- package/dist/client/assets/AppearanceSettings-B2LsGKmL.js +1 -0
- package/dist/client/assets/{BranchToolbar.logic-AgPy06Mx.js → BranchToolbar.logic-BqkvYNPk.js} +1 -1
- package/dist/client/assets/{BrowserPanel-BWztlNuL.js → BrowserPanel-C_C4zjrh.js} +1 -1
- package/dist/client/assets/ChatRightPanel-ibiQ79jI.js +195 -0
- package/dist/client/assets/{ChatThreadRouteView-CWoBLzR_.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-DM17BYP5.js +1 -0
- package/dist/client/assets/ConnectionsSettings-D6wysIC8.js +7 -0
- package/dist/client/assets/ContextHandoffEndpointLabel-CsF_maM_.js +4 -0
- package/dist/client/assets/{DiagnosticsSettings-DvnNz2AZ.js → DiagnosticsSettings-Bq2l-C4J.js} +2 -2
- package/dist/client/assets/{DialogHandle-8o3kfoiI.js → DialogHandle-DuKTleCw.js} +1 -1
- package/dist/client/assets/{DialogPopup-CLw6NCkW.js → DialogPopup-Dt7DzTWv.js} +1 -1
- package/dist/client/assets/DialogRoot-DRyawL6l.js +1 -0
- package/dist/client/assets/{DialogTitle-DCHX74Tz.js → DialogTitle-BaxfPC6e.js} +1 -1
- package/dist/client/assets/DialogTrigger-D0PJ8bRT.js +1 -0
- package/dist/client/assets/{DialogViewport-DVDl03yd.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-arHvT6AX.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-GY6owikG.js → GlassSurface-CBIEgwt1.js} +1 -1
- package/dist/client/assets/HKscs-B5-H-CXbBbq6g.bcmap +0 -0
- package/dist/client/assets/{HostedConnectionControls-COUhSe9x.js → HostedConnectionControls-DOpTlXzE.js} +1 -1
- package/dist/client/assets/HostedHubRoot-C1jq8cM6.js +2 -0
- package/dist/client/assets/{HostedNativeAuthorizationRoute-DZhYxv--.js → HostedNativeAuthorizationRoute-Clw1DHQW.js} +2 -2
- package/dist/client/assets/HostedNodeRenameDialog-Bd_Qu_ek.js +1 -0
- package/dist/client/assets/{HostedRelayTrustNotice-Bl6On0Yi.js → HostedRelayTrustNotice-CGcBpT9m.js} +1 -1
- package/dist/client/assets/IntegrationsSettingsPanel-J0qODRW-.js +2 -0
- package/dist/client/assets/KSC-Johab-H-CGtV3MPT.bcmap +0 -0
- package/dist/client/assets/{KeybindingsSettings-CPtXx-W2.js → KeybindingsSettings-CwxIHsFy.js} +1 -1
- package/dist/client/assets/{LazyBrowserPanel-SUIBB7B4.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-BFifrshE.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-R0cqI17q.js → PhoneGetAppInterstitial-0EOj-PbW.js} +1 -1
- package/dist/client/assets/PhoneHome-Cg7l3b1T.js +1 -0
- package/dist/client/assets/PhoneSettingsSurface-BXAUtZ9M.js +2 -0
- package/dist/client/assets/ProvidersSettingsPanel-BaJgypXu.js +1 -0
- package/dist/client/assets/{QuitShortcutFeedback-CklL3jMd.js → QuitShortcutFeedback-DgJFEd6b.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-CLPBtvH1.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-9pSZP875.js → SettingsPanels.editor-DJRckD71.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-C1F3Brcn.js → SourceControlSettings-IpoZrjt5.js} +1 -1
- 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-CHZ60lPI.js → ThreadTerminalDrawer-BEv83xrk.js} +11 -11
- 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-BMBx2Fu0.js → activity-BmRcsTyL.js} +1 -1
- package/dist/client/assets/{alert-CXnC_RJc.js → alert-C5UiA2xk.js} +1 -1
- package/dist/client/assets/{appChrome-BzM66lXM.js → appChrome-CsZ2ylc1.js} +1 -1
- package/dist/client/assets/{arrow-left-CymyVbCi.js → arrow-left-CSz-z20j.js} +1 -1
- package/dist/client/assets/{arrow-right-9wyq4YVq.js → arrow-right-DEi91hao.js} +1 -1
- package/dist/client/assets/{arrow-up-right-mfU38K6p.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-BR3RyOWP.js → bot-SC4UGZyw.js} +1 -1
- package/dist/client/assets/{capabilities-C8sxDbKT.js → capabilities-BCkDNe83.js} +1 -1
- package/dist/client/assets/{chart-column-CcRi3pAd.js → chart-column-C08MuLgY.js} +1 -1
- package/dist/client/assets/chevron-right-DgB53U1_.js +1 -0
- package/dist/client/assets/{clipboard-copy-ezz8rnaT.js → clipboard-copy-D74Wvnon.js} +1 -1
- package/dist/client/assets/{data-list-ZLhzdlED.js → data-list-CZ4Utnfl.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-P28r2lN2.js → desktopWorkspace-DVfn9ZT_.js} +1 -1
- package/dist/client/assets/{download-BA9L9tK9.js → download-Dio40wIJ.js} +1 -1
- package/dist/client/assets/editorPreferences-2dG4uloq.js +1 -0
- package/dist/client/assets/{empty-3NpXLnAM.js → empty-6LExKYgQ.js} +1 -1
- package/dist/client/assets/{group-D5qBdsaB.js → group-D_mu0Kiq.js} +1 -1
- package/dist/client/assets/{hostedConnectionCoordinator-CLV-JD1S.js → hostedConnectionCoordinator-YkDLnATK.js} +1 -1
- package/dist/client/assets/{hubRoutes-EWJ3Gdod.js → hubRoutes-D3quWvU7.js} +1 -1
- package/dist/client/assets/{index-DxCd1PgA.js → index-7MTgf8YI.js} +2 -2
- package/dist/client/assets/{input-DrOL1KPS.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-D2DtQ7aS.js → key-round-C-oUSjpF.js} +1 -1
- package/dist/client/assets/{layers-DtSJWmwy.js → layers-Co2a5C1k.js} +1 -1
- package/dist/client/assets/{log-out-YAp9fsOg.js → log-out-pWFhbvwr.js} +1 -1
- package/dist/client/assets/{logging-BuUPX1SP.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-D18VboLH.js → palette-B_6C4fD6.js} +1 -1
- package/dist/client/assets/pdf.worker.min-Dswkl-cV.mjs +29 -0
- package/dist/client/assets/{play-d3KUi4G6.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-dwWhl7Uf.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-Bk1kdf_k.js → qr-code-BU354aLS.js} +1 -1
- package/dist/client/assets/{qr-code-MAZkoKtL.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-DY3_Ph-S.js → refresh-cw-CY5BeUEr.js} +1 -1
- package/dist/client/assets/runtime-BKneT96Q.js +17 -0
- package/dist/client/assets/{save-ugJXuJRM.js → save-DIHMjHXd.js} +1 -1
- package/dist/client/assets/{scroll-area-BMnGzd2a.js → scroll-area-Cq4SX9P8.js} +1 -1
- package/dist/client/assets/{scrollEdges-QLSFwGSQ.js → scrollEdges-BaWRjrac.js} +1 -1
- package/dist/client/assets/{separator-BwUYkCkX.js → separator-BN705fC0.js} +1 -1
- package/dist/client/assets/{settingsLayout-C6SUmJVB.js → settingsLayout-DQERzSce.js} +1 -1
- package/dist/client/assets/{sheet-DLy4aeVa.js → sheet-CFvRY7T6.js} +1 -1
- package/dist/client/assets/{shield-Zq_ygsnJ.js → shield-Zn2kFj5M.js} +1 -1
- package/dist/client/assets/{shield-alert-DfUhTI4-.js → shield-alert-DMB5gKiC.js} +1 -1
- package/dist/client/assets/{shield-check-CO4SMhAs.js → shield-check-DyNf6Bky.js} +1 -1
- package/dist/client/assets/{sidebar-DNnW-a2V.js → sidebar-Bsh64sLK.js} +1 -1
- package/dist/client/assets/sidebarProjectFolders-CQbpO9ZI.js +4 -0
- package/dist/client/assets/{sidebarStatusText-CawrXnx0.js → sidebarStatusText-DCo-whyK.js} +1 -1
- package/dist/client/assets/{skeleton-DRm4_OvB.js → skeleton-DEuowfjY.js} +1 -1
- package/dist/client/assets/{smartphone-O2VACDhU.js → smartphone-BLWJ7C9-.js} +1 -1
- package/dist/client/assets/{sparkles-isHutYWU.js → sparkles-DAXDXp_s.js} +1 -1
- package/dist/client/assets/src-DPpEXU6w.js +14 -0
- package/dist/client/assets/{star-7UHEnC3x.js → star-CjQxHYbD.js} +1 -1
- package/dist/client/assets/switch-LahPAvrd.js +48 -0
- package/dist/client/assets/{toggle-CaKBNe6W.js → toggle-45lsrmyi.js} +1 -1
- package/dist/client/assets/{toggle-group-UeFeTI3u.js → toggle-group-D5pl24ED.js} +1 -1
- package/dist/client/assets/{tokenModePresentation-DV56ekA4.js → tokenModePresentation-CPUsUGY4.js} +1 -1
- package/dist/client/assets/tooltip-B8-izeMo.js +1 -0
- package/dist/client/assets/{unplug-DisTpujT.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-DctamWV6.js → user-round-DEWIPpNs.js} +1 -1
- package/dist/client/assets/{vscode-icons-Dw-LGJAv.js → vscode-icons-DTH-Vj-_.js} +1 -1
- package/dist/client/assets/workspaceMetadataProjection-BnpxBe8S.js +1 -0
- package/dist/client/assets/{wrench-Ds8eZerZ.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-GZcpSLrW.mjs → makeManagedServerProvider-BINne1KE.mjs} +3 -38
- package/dist/{makeManagedServerProvider-VzxWN-04.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-DStwNTTK.cjs → src-BlzIcnVG.cjs} +573 -117
- package/dist/{collectUint8StreamText-C_VNyArd.mjs → src-DtEOcXdl.mjs} +389 -95
- package/package.json +1 -1
- package/dist/AcpNativeLogging-COepku4a.cjs +0 -5130
- package/dist/AcpNativeLogging-D7e1dn7s.mjs +0 -5015
- package/dist/client/assets/AccountSettings-ApnDA1f-.js +0 -1
- package/dist/client/assets/AiFocusSettings-CNmGHEcA.js +0 -1
- package/dist/client/assets/AppearanceSettings-BG8W4DP0.js +0 -1
- package/dist/client/assets/ChatRightPanel-a6UOHNMm.js +0 -194
- package/dist/client/assets/CommandPaletteDialog-B2iKWCUi.js +0 -1
- package/dist/client/assets/CompositeRoot-C1G-Ejus.js +0 -1
- package/dist/client/assets/ComputerUseSettings-CPwWoHWj.js +0 -1
- package/dist/client/assets/ConnectionsSettings-CPMkuxza.js +0 -7
- package/dist/client/assets/ContextHandoffEndpointLabel-BildLLDY.js +0 -4
- package/dist/client/assets/DialogRoot-SKkIuQHA.js +0 -1
- package/dist/client/assets/DialogTrigger-Bl_fcIV2.js +0 -1
- package/dist/client/assets/DraftChatThreadRouteView-CEDYjbKq.js +0 -1
- package/dist/client/assets/HostedHubRoot-BTWc0XoQ.js +0 -2
- package/dist/client/assets/IntegrationsSettingsPanel-n9owMZf-.js +0 -2
- package/dist/client/assets/McpServersSettings-BWIUud0Z.js +0 -6
- package/dist/client/assets/MobileSheet-NTayGHF6.js +0 -1
- package/dist/client/assets/OpinionatedPluginsSettings-D7WuuNWZ.js +0 -1
- package/dist/client/assets/PhoneHome-FqWvnJP_.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-w5PJnoBc.js +0 -2
- package/dist/client/assets/ProvidersSettingsPanel-Ww1ch3xA.js +0 -1
- package/dist/client/assets/RootAppShell-BdQCs2XJ.js +0 -7
- package/dist/client/assets/Separator-CpYBhf-I.js +0 -1
- package/dist/client/assets/SettingsDialog-DeMzEeCP.js +0 -2
- package/dist/client/assets/SettingsPanels-ZxNz9ZfL.js +0 -3
- package/dist/client/assets/StatisticsPage-C7v-6CTr.js +0 -1
- package/dist/client/assets/StatisticsPanel-CeIjiBm8.js +0 -1
- package/dist/client/assets/StatisticsSettingsLink-5s_violW.js +0 -1
- package/dist/client/assets/ThreadWorkspacePanel-Ct5kMcuY.js +0 -2073
- package/dist/client/assets/authorization-CjOFkg7b.js +0 -1
- package/dist/client/assets/badge-Dg7mXiOh.js +0 -1
- package/dist/client/assets/chevron-right-CuUjBsQV.js +0 -1
- package/dist/client/assets/editorPreferences-DeKdSV3s.js +0 -1
- package/dist/client/assets/kbd-rWDjJnWX.js +0 -1
- package/dist/client/assets/main-BbtLAX7M.js +0 -9
- package/dist/client/assets/main-D4CtFNPY.css +0 -2
- package/dist/client/assets/monitor-OyD484tI.js +0 -1
- package/dist/client/assets/primary-D_D7eLwT.js +0 -2
- package/dist/client/assets/providerDriverMeta-DNTocCcU.js +0 -1
- package/dist/client/assets/providerModels-bFbEIfL9.js +0 -1
- package/dist/client/assets/radio-group-D-VCGinX.js +0 -2
- package/dist/client/assets/runtime-Djy96GJd.js +0 -17
- package/dist/client/assets/sidebarProjectFolders-ygpaKZM6.js +0 -4
- package/dist/client/assets/src-BSuAGqhK.js +0 -14
- package/dist/client/assets/switch-DD1qVLgN.js +0 -48
- package/dist/client/assets/tooltip-DXvXxL37.js +0 -1
- package/dist/client/assets/useAppSidebarCollapsed-CaAsLi1q.js +0 -1
- package/dist/client/assets/useBaseUiId-CJN4MvrU.js +0 -1
- package/dist/client/assets/useLabelableId-BsDFG9Oj.js +0 -1
- package/dist/client/assets/useNavigate-cLfxn_9L.js +0 -1
- package/dist/client/assets/usePhoneThreadActions-rekHL1Mi.js +0 -1
- package/dist/client/assets/usePopupViewport-kXU31P6l.js +0 -1
- package/dist/client/assets/useScrollLock-DjMxrUJe.js +0 -1
- package/dist/client/assets/useStatistics-BYP-9CmW.js +0 -55
- package/dist/client/assets/useTriggerFocusGuards-DuAm2B8C.js +0 -1
- package/dist/client/assets/useValueChanged-DreFjrMK.js +0 -1
- package/dist/client/assets/workspaceMetadataProjection-BL4sEIL2.js +0 -1
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const require_rolldown_runtime = require("./rolldown-runtime-LGfotAqq.cjs");
|
|
4
|
-
const
|
|
5
|
-
const require_Metrics = require("./Metrics-
|
|
4
|
+
const require_src = require("./src-BlzIcnVG.cjs");
|
|
5
|
+
const require_Metrics = require("./Metrics-DCKbdeoH.cjs");
|
|
6
|
+
const require_git = require("./git-irmB8_k7.cjs");
|
|
6
7
|
const require_bin = require("./bin.cjs");
|
|
7
|
-
const
|
|
8
|
-
const require_sourceControlContextFormatter = require("./sourceControlContextFormatter-BDZqn-4T.cjs");
|
|
8
|
+
const require_runtimeSession = require("./runtimeSession-Bj0OUcNJ.cjs");
|
|
9
9
|
const require_ProviderDriver = require("./ProviderDriver--rNeAi3B.cjs");
|
|
10
|
+
const require_sourceControlContextFormatter = require("./sourceControlContextFormatter-BDZqn-4T.cjs");
|
|
11
|
+
const require_makeManagedServerProvider = require("./makeManagedServerProvider-DGbd8BhM.cjs");
|
|
10
12
|
let effect = require("effect");
|
|
11
13
|
let effect_unstable_http = require("effect/unstable/http");
|
|
12
14
|
let node_path = require("node:path");
|
|
13
15
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
16
|
+
let node_crypto = require("node:crypto");
|
|
14
17
|
let node_os = require("node:os");
|
|
15
18
|
node_os = require_rolldown_runtime.__toESM(node_os, 1);
|
|
16
19
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -105,14 +108,14 @@ const makeOpenCodeTextGeneration = effect.Effect.fn("makeOpenCodeTextGeneration"
|
|
|
105
108
|
const serverOwner = options?.serverOwner ?? (openCodeSettings.serverUrl.trim().length === 0 ? yield* makeOpenCodeServerOwner(openCodeSettings, environment) : void 0);
|
|
106
109
|
const runOpenCodeJson = effect.Effect.fn("runOpenCodeJson")(function* (input) {
|
|
107
110
|
const parsedModel = require_bin.parseOpenCodeModelSlug(input.modelSelection.model);
|
|
108
|
-
if (!parsedModel) return yield* new
|
|
111
|
+
if (!parsedModel) return yield* new require_src.TextGenerationError({
|
|
109
112
|
operation: input.operation,
|
|
110
113
|
detail: "OpenCode model selection must use the 'provider/model' format."
|
|
111
114
|
});
|
|
112
115
|
const declaredAttachmentBytes = (input.attachments ?? []).reduce((total, attachment) => total + (attachment.sizeBytes ?? 0), 0);
|
|
113
|
-
if (declaredAttachmentBytes > 52428800) return yield* new
|
|
116
|
+
if (declaredAttachmentBytes > 52428800) return yield* new require_src.TextGenerationError({
|
|
114
117
|
operation: input.operation,
|
|
115
|
-
detail: `Attachments total ${declaredAttachmentBytes} bytes; limit is ${
|
|
118
|
+
detail: `Attachments total ${declaredAttachmentBytes} bytes; limit is ${require_src.PROVIDER_SEND_TURN_MAX_ATTACHMENT_TOTAL_BYTES} bytes.`
|
|
116
119
|
});
|
|
117
120
|
const attachmentUrlById = /* @__PURE__ */ new Map();
|
|
118
121
|
let attachmentTotalBytes = 0;
|
|
@@ -133,14 +136,14 @@ const makeOpenCodeTextGeneration = effect.Effect.fn("makeOpenCodeTextGeneration"
|
|
|
133
136
|
attachmentsDir: serverConfig.attachmentsDir,
|
|
134
137
|
attachment
|
|
135
138
|
});
|
|
136
|
-
if (!persisted.ok) return yield* new
|
|
139
|
+
if (!persisted.ok) return yield* new require_src.TextGenerationError({
|
|
137
140
|
operation: input.operation,
|
|
138
141
|
detail: persisted.reason
|
|
139
142
|
});
|
|
140
143
|
attachmentTotalBytes += persisted.sizeBytes;
|
|
141
|
-
if (attachmentTotalBytes > 52428800) return yield* new
|
|
144
|
+
if (attachmentTotalBytes > 52428800) return yield* new require_src.TextGenerationError({
|
|
142
145
|
operation: input.operation,
|
|
143
|
-
detail: `Attachments total ${attachmentTotalBytes} bytes; limit is ${
|
|
146
|
+
detail: `Attachments total ${attachmentTotalBytes} bytes; limit is ${require_src.PROVIDER_SEND_TURN_MAX_ATTACHMENT_TOTAL_BYTES} bytes.`
|
|
144
147
|
});
|
|
145
148
|
attachmentUrlById.set(attachment.id, `data:${attachment.mimeType};base64,${persisted.bytes.toString("base64")}`);
|
|
146
149
|
}
|
|
@@ -148,18 +151,18 @@ const makeOpenCodeTextGeneration = effect.Effect.fn("makeOpenCodeTextGeneration"
|
|
|
148
151
|
attachments: input.attachments,
|
|
149
152
|
resolveAttachmentUrl: (attachment) => attachment.id === void 0 ? null : attachmentUrlById.get(attachment.id) ?? null
|
|
150
153
|
});
|
|
151
|
-
const finalPrompt =
|
|
154
|
+
const finalPrompt = require_runtimeSession.appendAttachmentPathLines(input.prompt, require_runtimeSession.formatAttachmentPathLines(pathLineEntries)) ?? input.prompt;
|
|
152
155
|
const runAgainstServer = (server) => effect.Effect.gen(function* () {
|
|
153
156
|
const client = yield* openCodeRuntime.createOpenCodeSdkClient({
|
|
154
157
|
baseUrl: server.url,
|
|
155
158
|
directory: input.cwd,
|
|
156
159
|
...server.serverPassword ? { serverPassword: server.serverPassword } : {}
|
|
157
|
-
}).pipe(effect.Effect.mapError((cause) => new
|
|
160
|
+
}).pipe(effect.Effect.mapError((cause) => new require_src.TextGenerationError({
|
|
158
161
|
operation: input.operation,
|
|
159
162
|
detail: require_bin.openCodeRuntimeErrorDetail(cause),
|
|
160
163
|
cause
|
|
161
164
|
})));
|
|
162
|
-
yield* require_bin.verifyOpenCodeServerVersion(client).pipe(effect.Effect.mapError((cause) => new
|
|
165
|
+
yield* require_bin.verifyOpenCodeServerVersion(client).pipe(effect.Effect.mapError((cause) => new require_src.TextGenerationError({
|
|
163
166
|
operation: input.operation,
|
|
164
167
|
detail: require_bin.openCodeRuntimeErrorDetail(cause),
|
|
165
168
|
cause
|
|
@@ -194,7 +197,7 @@ const makeOpenCodeTextGeneration = effect.Effect.fn("makeOpenCodeTextGeneration"
|
|
|
194
197
|
if (rawText.length === 0) throw new Error("OpenCode returned empty output.");
|
|
195
198
|
return rawText;
|
|
196
199
|
},
|
|
197
|
-
catch: (cause) => new
|
|
200
|
+
catch: (cause) => new require_src.TextGenerationError({
|
|
198
201
|
operation: input.operation,
|
|
199
202
|
detail: require_bin.openCodeRuntimeErrorDetail(cause),
|
|
200
203
|
cause
|
|
@@ -204,117 +207,126 @@ const makeOpenCodeTextGeneration = effect.Effect.fn("makeOpenCodeTextGeneration"
|
|
|
204
207
|
const rawOutput = openCodeSettings.serverUrl.length > 0 ? yield* runAgainstServer({
|
|
205
208
|
url: openCodeSettings.serverUrl,
|
|
206
209
|
...openCodeSettings.serverPassword ? { serverPassword: openCodeSettings.serverPassword } : {}
|
|
207
|
-
}) : yield* effect.Effect.scoped(serverOwner.acquire.pipe(effect.Effect.mapError((cause) => new
|
|
210
|
+
}) : yield* effect.Effect.scoped(serverOwner.acquire.pipe(effect.Effect.mapError((cause) => new require_src.TextGenerationError({
|
|
208
211
|
operation: input.operation,
|
|
209
212
|
detail: require_bin.openCodeRuntimeErrorDetail(cause),
|
|
210
213
|
cause
|
|
211
214
|
})), effect.Effect.flatMap(runAgainstServer)));
|
|
212
|
-
return yield* effect.Schema.decodeEffect(effect.Schema.fromJsonString(input.outputSchemaJson))(require_bin.extractJsonObject(rawOutput)).pipe(effect.Effect.catchTag("SchemaError", (cause) => effect.Effect.fail(new
|
|
215
|
+
return yield* effect.Schema.decodeEffect(effect.Schema.fromJsonString(input.outputSchemaJson))(require_bin.extractJsonObject(rawOutput)).pipe(effect.Effect.catchTag("SchemaError", (cause) => effect.Effect.fail(new require_src.TextGenerationError({
|
|
213
216
|
operation: input.operation,
|
|
214
217
|
detail: "OpenCode returned invalid structured output.",
|
|
215
218
|
cause
|
|
216
219
|
}))));
|
|
217
220
|
});
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
const generateCommitMessage = effect.Effect.fn("OpenCodeTextGeneration.generateCommitMessage")(function* (input) {
|
|
222
|
+
const { prompt, outputSchema } = require_bin.buildCommitMessagePrompt({
|
|
223
|
+
branch: input.branch,
|
|
224
|
+
stagedSummary: input.stagedSummary,
|
|
225
|
+
stagedPatch: input.stagedPatch,
|
|
226
|
+
includeBranch: input.includeBranch === true
|
|
227
|
+
});
|
|
228
|
+
const generated = yield* runOpenCodeJson({
|
|
229
|
+
operation: "generateCommitMessage",
|
|
230
|
+
cwd: input.cwd,
|
|
231
|
+
prompt,
|
|
232
|
+
outputSchemaJson: outputSchema,
|
|
233
|
+
modelSelection: input.modelSelection
|
|
234
|
+
});
|
|
235
|
+
return {
|
|
236
|
+
subject: require_bin.sanitizeCommitSubject(generated.subject),
|
|
237
|
+
body: generated.body.trim(),
|
|
238
|
+
..."branch" in generated && typeof generated.branch === "string" ? { branch: require_git.sanitizeFeatureBranchName(generated.branch) } : {}
|
|
239
|
+
};
|
|
240
|
+
});
|
|
241
|
+
const generatePrContent = effect.Effect.fn("OpenCodeTextGeneration.generatePrContent")(function* (input) {
|
|
242
|
+
const { prompt, outputSchema } = require_bin.buildPrContentPrompt({
|
|
243
|
+
baseBranch: input.baseBranch,
|
|
244
|
+
headBranch: input.headBranch,
|
|
245
|
+
commitSummary: input.commitSummary,
|
|
246
|
+
diffSummary: input.diffSummary,
|
|
247
|
+
diffPatch: input.diffPatch
|
|
248
|
+
});
|
|
249
|
+
const generated = yield* runOpenCodeJson({
|
|
250
|
+
operation: "generatePrContent",
|
|
251
|
+
cwd: input.cwd,
|
|
252
|
+
prompt,
|
|
253
|
+
outputSchemaJson: outputSchema,
|
|
254
|
+
modelSelection: input.modelSelection
|
|
255
|
+
});
|
|
256
|
+
return {
|
|
257
|
+
title: require_bin.sanitizePrTitle(generated.title),
|
|
258
|
+
body: generated.body.trim()
|
|
259
|
+
};
|
|
260
|
+
});
|
|
261
|
+
const generateBranchName = effect.Effect.fn("OpenCodeTextGeneration.generateBranchName")(function* (input) {
|
|
262
|
+
const { prompt, outputSchema } = require_bin.buildBranchNamePrompt({
|
|
263
|
+
message: input.message,
|
|
264
|
+
attachments: input.attachments
|
|
265
|
+
});
|
|
266
|
+
const generated = yield* runOpenCodeJson({
|
|
267
|
+
operation: "generateBranchName",
|
|
268
|
+
cwd: input.cwd,
|
|
269
|
+
prompt,
|
|
270
|
+
outputSchemaJson: outputSchema,
|
|
271
|
+
modelSelection: input.modelSelection,
|
|
272
|
+
attachments: input.attachments
|
|
273
|
+
});
|
|
274
|
+
return { branch: require_git.sanitizeBranchFragment(generated.branch) };
|
|
275
|
+
});
|
|
276
|
+
const generateThreadTitle = effect.Effect.fn("OpenCodeTextGeneration.generateThreadTitle")(function* (input) {
|
|
277
|
+
const { prompt, outputSchema } = require_bin.buildThreadTitlePrompt({
|
|
278
|
+
message: input.message,
|
|
279
|
+
attachments: input.attachments
|
|
280
|
+
});
|
|
281
|
+
const generated = yield* runOpenCodeJson({
|
|
282
|
+
operation: "generateThreadTitle",
|
|
283
|
+
cwd: input.cwd,
|
|
284
|
+
prompt,
|
|
285
|
+
outputSchemaJson: outputSchema,
|
|
286
|
+
modelSelection: input.modelSelection,
|
|
287
|
+
attachments: input.attachments
|
|
288
|
+
});
|
|
289
|
+
return { title: require_bin.sanitizeThreadTitle(generated.title) };
|
|
290
|
+
});
|
|
291
|
+
const generateIssueContent = effect.Effect.fn("OpenCodeTextGeneration.generateIssueContent")(function* (input) {
|
|
292
|
+
if (input.mode === "polish") {
|
|
293
|
+
const { prompt, outputSchema } = require_bin.buildIssueContentPolishPrompt({
|
|
294
|
+
rough: input.rough ?? "",
|
|
295
|
+
...input.currentTitle ? { currentTitle: input.currentTitle } : {},
|
|
296
|
+
...input.customInstructions ? { customInstructions: input.customInstructions } : {}
|
|
225
297
|
});
|
|
226
|
-
const
|
|
227
|
-
operation: "
|
|
298
|
+
const decoded = yield* runOpenCodeJson({
|
|
299
|
+
operation: "generateIssueContent",
|
|
228
300
|
cwd: input.cwd,
|
|
229
301
|
prompt,
|
|
230
302
|
outputSchemaJson: outputSchema,
|
|
231
303
|
modelSelection: input.modelSelection
|
|
232
304
|
});
|
|
233
305
|
return {
|
|
234
|
-
|
|
235
|
-
body:
|
|
236
|
-
..."branch" in generated && typeof generated.branch === "string" ? { branch: require_Metrics.sanitizeFeatureBranchName(generated.branch) } : {}
|
|
306
|
+
title: decoded.title.trim(),
|
|
307
|
+
body: decoded.body.trim()
|
|
237
308
|
};
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
headBranch: input.headBranch,
|
|
243
|
-
commitSummary: input.commitSummary,
|
|
244
|
-
diffSummary: input.diffSummary,
|
|
245
|
-
diffPatch: input.diffPatch
|
|
246
|
-
});
|
|
247
|
-
const generated = yield* runOpenCodeJson({
|
|
248
|
-
operation: "generatePrContent",
|
|
309
|
+
} else {
|
|
310
|
+
const { prompt, outputSchema } = require_bin.buildIssueContentTitlePrompt({ body: input.body ?? "" });
|
|
311
|
+
return { title: (yield* runOpenCodeJson({
|
|
312
|
+
operation: "generateIssueContent",
|
|
249
313
|
cwd: input.cwd,
|
|
250
314
|
prompt,
|
|
251
315
|
outputSchemaJson: outputSchema,
|
|
252
316
|
modelSelection: input.modelSelection
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
cwd: input.cwd,
|
|
267
|
-
prompt,
|
|
268
|
-
outputSchemaJson: outputSchema,
|
|
269
|
-
modelSelection: input.modelSelection,
|
|
270
|
-
attachments: input.attachments
|
|
271
|
-
});
|
|
272
|
-
return { branch: require_Metrics.sanitizeBranchFragment(generated.branch) };
|
|
273
|
-
}),
|
|
274
|
-
generateThreadTitle: effect.Effect.fn("OpenCodeTextGeneration.generateThreadTitle")(function* (input) {
|
|
275
|
-
const { prompt, outputSchema } = require_bin.buildThreadTitlePrompt({
|
|
276
|
-
message: input.message,
|
|
277
|
-
attachments: input.attachments
|
|
278
|
-
});
|
|
279
|
-
const generated = yield* runOpenCodeJson({
|
|
280
|
-
operation: "generateThreadTitle",
|
|
281
|
-
cwd: input.cwd,
|
|
282
|
-
prompt,
|
|
283
|
-
outputSchemaJson: outputSchema,
|
|
284
|
-
modelSelection: input.modelSelection,
|
|
285
|
-
attachments: input.attachments
|
|
286
|
-
});
|
|
287
|
-
return { title: require_bin.sanitizeThreadTitle(generated.title) };
|
|
288
|
-
}),
|
|
289
|
-
generateIssueContent: effect.Effect.fn("OpenCodeTextGeneration.generateIssueContent")(function* (input) {
|
|
290
|
-
if (input.mode === "polish") {
|
|
291
|
-
const { prompt, outputSchema } = require_bin.buildIssueContentPolishPrompt({
|
|
292
|
-
rough: input.rough ?? "",
|
|
293
|
-
...input.currentTitle ? { currentTitle: input.currentTitle } : {},
|
|
294
|
-
...input.customInstructions ? { customInstructions: input.customInstructions } : {}
|
|
295
|
-
});
|
|
296
|
-
const decoded = yield* runOpenCodeJson({
|
|
297
|
-
operation: "generateIssueContent",
|
|
298
|
-
cwd: input.cwd,
|
|
299
|
-
prompt,
|
|
300
|
-
outputSchemaJson: outputSchema,
|
|
301
|
-
modelSelection: input.modelSelection
|
|
302
|
-
});
|
|
303
|
-
return {
|
|
304
|
-
title: decoded.title.trim(),
|
|
305
|
-
body: decoded.body.trim()
|
|
306
|
-
};
|
|
307
|
-
} else {
|
|
308
|
-
const { prompt, outputSchema } = require_bin.buildIssueContentTitlePrompt({ body: input.body ?? "" });
|
|
309
|
-
return { title: (yield* runOpenCodeJson({
|
|
310
|
-
operation: "generateIssueContent",
|
|
311
|
-
cwd: input.cwd,
|
|
312
|
-
prompt,
|
|
313
|
-
outputSchemaJson: outputSchema,
|
|
314
|
-
modelSelection: input.modelSelection
|
|
315
|
-
})).title.trim() };
|
|
316
|
-
}
|
|
317
|
-
}),
|
|
317
|
+
})).title.trim() };
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
const answerSideQuestion = () => effect.Effect.fail(new require_src.TextGenerationError({
|
|
321
|
+
operation: "answerSideQuestion",
|
|
322
|
+
detail: "OpenCode cannot isolate configured server plugins for a tool-free side question. Select Codex, Claude, or GitHub Copilot for side chat."
|
|
323
|
+
}));
|
|
324
|
+
return {
|
|
325
|
+
generateCommitMessage,
|
|
326
|
+
generatePrContent,
|
|
327
|
+
generateBranchName,
|
|
328
|
+
generateThreadTitle,
|
|
329
|
+
generateIssueContent,
|
|
318
330
|
rankInboxThreads: effect.Effect.fn("OpenCodeTextGeneration.rankInboxThreads")(function* (input) {
|
|
319
331
|
const { prompt, outputSchema } = require_bin.buildThreadPriorityPrompt({ serializedCandidates: input.chunk.serializedCandidates });
|
|
320
332
|
const generated = yield* runOpenCodeJson({
|
|
@@ -325,12 +337,179 @@ const makeOpenCodeTextGeneration = effect.Effect.fn("makeOpenCodeTextGeneration"
|
|
|
325
337
|
modelSelection: input.modelSelection
|
|
326
338
|
});
|
|
327
339
|
return yield* require_bin.validateRankInboxThreadsResult(input, generated.rankings);
|
|
328
|
-
})
|
|
340
|
+
}),
|
|
341
|
+
answerSideQuestion
|
|
329
342
|
};
|
|
330
343
|
});
|
|
331
344
|
//#endregion
|
|
345
|
+
//#region src/provider/openCodeTaskLifecycle.ts
|
|
346
|
+
const text = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
347
|
+
const record = (value) => value !== null && typeof value === "object" ? value : {};
|
|
348
|
+
const terminal = (status) => status === "completed" || status === "failed" || status === "stopped";
|
|
349
|
+
function resultText(output) {
|
|
350
|
+
const result = output.match(/<task_result>\s*([\s\S]*?)\s*<\/task_result>/)?.[1];
|
|
351
|
+
return text(result ?? output.split("\n").filter((line) => !line.trimStart().startsWith("task_id:")).join("\n"));
|
|
352
|
+
}
|
|
353
|
+
/** Native Task lifecycle state stays here; clients consume the shared subagent events. */
|
|
354
|
+
var OpenCodeTaskLifecycle = class {
|
|
355
|
+
tasks = /* @__PURE__ */ new Map();
|
|
356
|
+
calls = /* @__PURE__ */ new Map();
|
|
357
|
+
sessions = /* @__PURE__ */ new Map();
|
|
358
|
+
emitted = /* @__PURE__ */ new Set();
|
|
359
|
+
notifications = /* @__PURE__ */ new Set();
|
|
360
|
+
values() {
|
|
361
|
+
return Array.from(this.tasks.values(), (task) => task.ref);
|
|
362
|
+
}
|
|
363
|
+
hasSession(id) {
|
|
364
|
+
return this.sessions.has(id);
|
|
365
|
+
}
|
|
366
|
+
refForSession(id) {
|
|
367
|
+
return this.sessions.get(id)?.ref;
|
|
368
|
+
}
|
|
369
|
+
transition(task, type, source) {
|
|
370
|
+
const eventKey = JSON.stringify([
|
|
371
|
+
task.ref.subagentId,
|
|
372
|
+
task.callId ?? source,
|
|
373
|
+
type,
|
|
374
|
+
task.status,
|
|
375
|
+
task.summary,
|
|
376
|
+
task.ref
|
|
377
|
+
]);
|
|
378
|
+
if (this.emitted.has(eventKey)) return [];
|
|
379
|
+
this.emitted.add(eventKey);
|
|
380
|
+
return [{
|
|
381
|
+
type,
|
|
382
|
+
subagent: task.ref,
|
|
383
|
+
status: task.status,
|
|
384
|
+
...task.summary ? { summary: task.summary } : {},
|
|
385
|
+
eventKey
|
|
386
|
+
}];
|
|
387
|
+
}
|
|
388
|
+
stop() {
|
|
389
|
+
return Array.from(this.tasks.values()).flatMap((task) => {
|
|
390
|
+
if (terminal(task.status)) return [];
|
|
391
|
+
task.status = "stopped";
|
|
392
|
+
return this.transition(task, "completed", "stop");
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
project(part, existingRef) {
|
|
396
|
+
if (part.type === "text") {
|
|
397
|
+
if (part.synthetic !== true) return [];
|
|
398
|
+
const envelope = part.text.match(/<task id="([^"]+)" state="(completed|error|interrupted|cancelled)">/);
|
|
399
|
+
const sessionId = text(envelope?.[1]);
|
|
400
|
+
if (!sessionId) return [];
|
|
401
|
+
const notificationKey = JSON.stringify([
|
|
402
|
+
part.sessionID,
|
|
403
|
+
part.id,
|
|
404
|
+
part.text
|
|
405
|
+
]);
|
|
406
|
+
if (this.notifications.has(notificationKey)) return [];
|
|
407
|
+
this.notifications.add(notificationKey);
|
|
408
|
+
let task = this.sessions.get(sessionId);
|
|
409
|
+
if (task && terminal(task.status)) return [];
|
|
410
|
+
const events = [];
|
|
411
|
+
if (!task) {
|
|
412
|
+
task = {
|
|
413
|
+
ref: existingRef ?? this.makeRef(sessionId, part.sessionID),
|
|
414
|
+
callId: void 0,
|
|
415
|
+
status: "running",
|
|
416
|
+
summary: void 0,
|
|
417
|
+
seenCalls: /* @__PURE__ */ new Set()
|
|
418
|
+
};
|
|
419
|
+
this.tasks.set(String(task.ref.subagentId), task);
|
|
420
|
+
this.sessions.set(sessionId, task);
|
|
421
|
+
events.push(...this.transition(task, "started", part.id));
|
|
422
|
+
}
|
|
423
|
+
task.status = envelope?.[2] === "error" ? "failed" : envelope?.[2] === "completed" ? "completed" : "stopped";
|
|
424
|
+
task.summary = task.status === "failed" ? text(part.text.match(/<task_error>\s*([\s\S]*?)\s*<\/task_error>/)?.[1]) : resultText(part.text);
|
|
425
|
+
return [...events, ...this.transition(task, "completed", part.id)];
|
|
426
|
+
}
|
|
427
|
+
if (part.type !== "tool" || part.tool.toLowerCase() !== "task") return [];
|
|
428
|
+
const callKey = JSON.stringify([part.sessionID, part.callID]);
|
|
429
|
+
const previousCall = this.calls.get(callKey);
|
|
430
|
+
const metadata = "metadata" in part.state ? record(part.state.metadata) : {};
|
|
431
|
+
const input = record(part.state.input);
|
|
432
|
+
const output = part.state.status === "completed" ? part.state.output : "";
|
|
433
|
+
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]);
|
|
434
|
+
if (part.state.status === "pending" && !sessionId && !previousCall) return [];
|
|
435
|
+
let task = previousCall ?? (sessionId ? this.sessions.get(sessionId) : void 0);
|
|
436
|
+
if (!task && !sessionId && part.state.status !== "error") return [];
|
|
437
|
+
if (task && task.callId !== void 0 && task.callId !== callKey && task.seenCalls.has(callKey)) return [];
|
|
438
|
+
if (task && task.callId === callKey && task.status !== "starting" && part.state.status === "pending") return [];
|
|
439
|
+
const newTask = !task;
|
|
440
|
+
if (!task) {
|
|
441
|
+
task = {
|
|
442
|
+
ref: existingRef ?? this.makeRef(sessionId, part.sessionID, part.callID),
|
|
443
|
+
callId: callKey,
|
|
444
|
+
status: "starting",
|
|
445
|
+
summary: void 0,
|
|
446
|
+
seenCalls: /* @__PURE__ */ new Set()
|
|
447
|
+
};
|
|
448
|
+
this.tasks.set(String(task.ref.subagentId), task);
|
|
449
|
+
}
|
|
450
|
+
const reopen = task.callId !== void 0 && task.callId !== callKey;
|
|
451
|
+
const terminalBeforeTool = task.callId === void 0 && terminal(task.status);
|
|
452
|
+
const priorRef = task.ref;
|
|
453
|
+
const priorStatus = task.status;
|
|
454
|
+
if (reopen) {
|
|
455
|
+
task.status = "starting";
|
|
456
|
+
task.summary = void 0;
|
|
457
|
+
}
|
|
458
|
+
task.callId = callKey;
|
|
459
|
+
task.seenCalls.add(callKey);
|
|
460
|
+
this.calls.set(callKey, task);
|
|
461
|
+
const modelRecord = record(metadata.model);
|
|
462
|
+
const provider = text(modelRecord.providerID);
|
|
463
|
+
const model = text(modelRecord.modelID);
|
|
464
|
+
task.ref = {
|
|
465
|
+
...task.ref,
|
|
466
|
+
...sessionId ? {
|
|
467
|
+
providerSessionId: sessionId,
|
|
468
|
+
providerThreadId: sessionId
|
|
469
|
+
} : {},
|
|
470
|
+
...text(input.description) ? { description: text(input.description) } : {},
|
|
471
|
+
...text(input.subagent_type) ? { label: text(input.subagent_type) } : {},
|
|
472
|
+
...provider && model ? { model: `${provider}/${model}` } : {},
|
|
473
|
+
parentProviderItemId: require_src.ProviderItemId.make(part.callID),
|
|
474
|
+
metadata: {
|
|
475
|
+
...task.ref.metadata,
|
|
476
|
+
...metadata,
|
|
477
|
+
source: "opencode.task",
|
|
478
|
+
parentSessionId: part.sessionID
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
if (sessionId) this.sessions.set(sessionId, task);
|
|
482
|
+
const outputState = output.match(/<task id="[^"]+" state="([^"]+)">/)?.[1];
|
|
483
|
+
const interrupted = outputState === "interrupted" || outputState === "cancelled";
|
|
484
|
+
const background = metadata.background === true || outputState === "running";
|
|
485
|
+
const events = [];
|
|
486
|
+
if (newTask) events.push(...this.transition(task, "started", part.id));
|
|
487
|
+
if (!terminalBeforeTool && (!terminal(task.status) || reopen)) {
|
|
488
|
+
task.status = interrupted ? "stopped" : part.state.status === "error" ? "failed" : part.state.status === "completed" && !background ? "completed" : part.state.status === "pending" ? "starting" : "running";
|
|
489
|
+
task.summary = part.state.status === "error" ? text(part.state.error) : task.status === "completed" ? resultText(output) : void 0;
|
|
490
|
+
events.push(...this.transition(task, terminal(task.status) ? "completed" : "updated", part.id));
|
|
491
|
+
} else if (JSON.stringify(priorRef) !== JSON.stringify(task.ref) || priorStatus !== task.status) events.push(...this.transition(task, "updated", part.id));
|
|
492
|
+
return events;
|
|
493
|
+
}
|
|
494
|
+
makeRef(sessionId, parentSessionId, callId) {
|
|
495
|
+
return {
|
|
496
|
+
subagentId: require_src.RuntimeSubagentId.make(sessionId ? `opencode:session:${sessionId}` : `opencode:task:${parentSessionId}:${callId}`),
|
|
497
|
+
origin: "native",
|
|
498
|
+
capability: "summary",
|
|
499
|
+
...sessionId ? {
|
|
500
|
+
providerSessionId: sessionId,
|
|
501
|
+
providerThreadId: sessionId
|
|
502
|
+
} : {},
|
|
503
|
+
metadata: {
|
|
504
|
+
source: "opencode.task",
|
|
505
|
+
parentSessionId
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
//#endregion
|
|
332
511
|
//#region src/provider/Layers/OpenCodeAdapter.ts
|
|
333
|
-
const PROVIDER$1 =
|
|
512
|
+
const PROVIDER$1 = require_src.ProviderDriverKind.make("opencode");
|
|
334
513
|
const OPENCODE_RESUME_VERSION = 1;
|
|
335
514
|
function nowIso() {
|
|
336
515
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -352,7 +531,7 @@ function scopedOpenCodeId(sessionId, id) {
|
|
|
352
531
|
return `${sessionId}:${id}`;
|
|
353
532
|
}
|
|
354
533
|
function openCodeSubagentId(kind, id) {
|
|
355
|
-
return
|
|
534
|
+
return require_src.RuntimeSubagentId.make(`opencode:${kind}:${id}`);
|
|
356
535
|
}
|
|
357
536
|
function subagentKey(subagentId) {
|
|
358
537
|
return String(subagentId);
|
|
@@ -381,7 +560,7 @@ function makeSubtaskSubagentRef(part) {
|
|
|
381
560
|
...label ? { label } : {},
|
|
382
561
|
...description ? { description } : {},
|
|
383
562
|
...model ? { model } : {},
|
|
384
|
-
parentProviderItemId:
|
|
563
|
+
parentProviderItemId: require_src.ProviderItemId.make(part.id),
|
|
385
564
|
metadata: metadataWithEntries([
|
|
386
565
|
["source", "opencode.subtask"],
|
|
387
566
|
["prompt", nonEmptyString(part.prompt)],
|
|
@@ -445,13 +624,13 @@ const abortOpenCodeSession = (context, sessionID) => require_bin.runOpenCodeSdk(
|
|
|
445
624
|
}))
|
|
446
625
|
}));
|
|
447
626
|
const buildEventBase = (input) => effect.Effect.sync(() => crypto.randomUUID()).pipe(effect.Effect.map((uuid) => ({
|
|
448
|
-
eventId:
|
|
627
|
+
eventId: require_src.EventId.make(uuid),
|
|
449
628
|
provider: PROVIDER$1,
|
|
450
629
|
threadId: input.threadId,
|
|
451
630
|
createdAt: input.createdAt ?? nowIso(),
|
|
452
631
|
...input.turnId ? { turnId: input.turnId } : {},
|
|
453
|
-
...input.itemId ? { itemId:
|
|
454
|
-
...input.requestId ? { requestId:
|
|
632
|
+
...input.itemId ? { itemId: require_src.RuntimeItemId.make(input.itemId) } : {},
|
|
633
|
+
...input.requestId ? { requestId: require_src.RuntimeRequestId.make(input.requestId) } : {},
|
|
455
634
|
...input.raw !== void 0 ? { raw: {
|
|
456
635
|
source: "opencode.sdk.event",
|
|
457
636
|
payload: input.raw
|
|
@@ -652,7 +831,7 @@ const stopOpenCodeContext = effect.Effect.fn("stopOpenCodeContext")(function* (c
|
|
|
652
831
|
});
|
|
653
832
|
function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
654
833
|
return effect.Effect.gen(function* () {
|
|
655
|
-
const boundInstanceId = options?.instanceId ??
|
|
834
|
+
const boundInstanceId = options?.instanceId ?? require_src.ProviderInstanceId.make("opencode");
|
|
656
835
|
const serverConfig = yield* require_Metrics.ServerConfig;
|
|
657
836
|
const openCodeRuntime = yield* require_bin.OpenCodeRuntime;
|
|
658
837
|
const nativeEventLogger = options?.nativeEventLogger ?? (options?.nativeEventLogPath !== void 0 ? yield* require_bin.makeEventNdjsonLogger(options.nativeEventLogPath, { stream: "native" }) : void 0);
|
|
@@ -676,7 +855,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
676
855
|
}).pipe(effect.Effect.ensuring(runtimeEventQueueMetrics.reset), effect.Effect.ensuring(effect.Queue.shutdown(runtimeEvents))));
|
|
677
856
|
const emitForContext = (context, event) => {
|
|
678
857
|
if (context.session.runtimeSessionId === void 0) return effect.Effect.die(/* @__PURE__ */ new Error(`OpenCodeAdapter emitted '${event.type}' without a runtime session for thread '${event.threadId}'.`));
|
|
679
|
-
return effect.Queue.offer(runtimeEvents,
|
|
858
|
+
return effect.Queue.offer(runtimeEvents, require_runtimeSession.stampRuntimeEvent(event, {
|
|
680
859
|
providerInstanceId: boundInstanceId,
|
|
681
860
|
runtimeSessionId: context.session.runtimeSessionId
|
|
682
861
|
})).pipe(effect.Effect.andThen(runtimeEventQueueMetrics.recordEnqueued()), effect.Effect.asVoid);
|
|
@@ -698,6 +877,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
698
877
|
});
|
|
699
878
|
});
|
|
700
879
|
const emitOpenCodeSubagentUpdated = effect.Effect.fn("emitOpenCodeSubagentUpdated")(function* (context, input) {
|
|
880
|
+
if (context.completedSubagentIds.has(subagentKey(input.subagent.subagentId))) return;
|
|
701
881
|
yield* emitOpenCodeSubagentStarted(context, input.subagent, input.raw);
|
|
702
882
|
yield* emitForContext(context, {
|
|
703
883
|
...yield* buildEventBase({
|
|
@@ -733,7 +913,98 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
733
913
|
}
|
|
734
914
|
});
|
|
735
915
|
});
|
|
916
|
+
const emitOpenCodeTaskTransition = effect.Effect.fn("emitOpenCodeTaskTransition")(function* (context, transition, raw) {
|
|
917
|
+
const nativeRef = transition.subagent;
|
|
918
|
+
const existing = nativeRef.providerSessionId ? context.subagentBySessionId.get(nativeRef.providerSessionId) : void 0;
|
|
919
|
+
const subagent = {
|
|
920
|
+
...existing,
|
|
921
|
+
...nativeRef,
|
|
922
|
+
subagentId: existing?.subagentId ?? nativeRef.subagentId,
|
|
923
|
+
capability: existing?.capability === "transcript" ? "transcript" : nativeRef.capability,
|
|
924
|
+
metadata: {
|
|
925
|
+
...existing?.metadata,
|
|
926
|
+
...nativeRef.metadata,
|
|
927
|
+
providerInstanceId: boundInstanceId
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
if (subagent.providerSessionId) {
|
|
931
|
+
context.childSessionIds.add(subagent.providerSessionId);
|
|
932
|
+
context.subagentBySessionId.set(subagent.providerSessionId, subagent);
|
|
933
|
+
}
|
|
934
|
+
const key = subagentKey(subagent.subagentId);
|
|
935
|
+
const base = {
|
|
936
|
+
...yield* buildEventBase({
|
|
937
|
+
threadId: context.session.threadId,
|
|
938
|
+
turnId: context.activeTurnId,
|
|
939
|
+
raw
|
|
940
|
+
}),
|
|
941
|
+
eventId: require_src.EventId.make((0, node_crypto.createHash)("sha256").update(JSON.stringify([
|
|
942
|
+
context.session.threadId,
|
|
943
|
+
context.openCodeSessionId,
|
|
944
|
+
transition.eventKey
|
|
945
|
+
])).digest("hex"))
|
|
946
|
+
};
|
|
947
|
+
if (transition.type === "started") {
|
|
948
|
+
if (context.startedSubagentIds.has(key)) yield* emitForContext(context, {
|
|
949
|
+
...base,
|
|
950
|
+
type: "subagent.updated",
|
|
951
|
+
payload: {
|
|
952
|
+
subagent,
|
|
953
|
+
status: transition.status
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
else {
|
|
957
|
+
context.startedSubagentIds.add(key);
|
|
958
|
+
yield* emitForContext(context, {
|
|
959
|
+
...base,
|
|
960
|
+
type: "subagent.started",
|
|
961
|
+
payload: { subagent }
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
context.completedSubagentIds.delete(key);
|
|
965
|
+
} else if (transition.type === "completed") {
|
|
966
|
+
context.startedSubagentIds.add(key);
|
|
967
|
+
context.completedSubagentIds.add(key);
|
|
968
|
+
yield* emitForContext(context, {
|
|
969
|
+
...base,
|
|
970
|
+
type: "subagent.completed",
|
|
971
|
+
payload: {
|
|
972
|
+
subagent,
|
|
973
|
+
status: transition.status,
|
|
974
|
+
...transition.summary ? { summary: transition.summary } : {}
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
} else {
|
|
978
|
+
if (transition.status === "running" || transition.status === "starting") context.completedSubagentIds.delete(key);
|
|
979
|
+
yield* emitForContext(context, {
|
|
980
|
+
...base,
|
|
981
|
+
type: "subagent.updated",
|
|
982
|
+
payload: {
|
|
983
|
+
subagent,
|
|
984
|
+
status: transition.status,
|
|
985
|
+
...transition.summary ? { summary: transition.summary } : {}
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
const projectOpenCodeTask = effect.Effect.fn("projectOpenCodeTask")(function* (context, part) {
|
|
991
|
+
for (const transition of context.tasks.project(part)) yield* emitOpenCodeTaskTransition(context, transition, part);
|
|
992
|
+
});
|
|
993
|
+
const loadOpenCodeTasks = effect.Effect.fn("loadOpenCodeTasks")(function* (context) {
|
|
994
|
+
const messages = yield* require_bin.runOpenCodeSdk("session.messages", () => context.client.session.messages({ sessionID: context.openCodeSessionId }));
|
|
995
|
+
const latest = /* @__PURE__ */ new Map();
|
|
996
|
+
for (const entry of messages.data ?? []) for (const part of entry.parts) {
|
|
997
|
+
if (part.sessionID !== context.openCodeSessionId) continue;
|
|
998
|
+
if (entry.info.role !== "assistant" && !(part.type === "text" && part.synthetic)) continue;
|
|
999
|
+
for (const transition of context.tasks.project(part)) latest.set(String(transition.subagent.subagentId), {
|
|
1000
|
+
transition,
|
|
1001
|
+
part
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
return [...latest.values()];
|
|
1005
|
+
});
|
|
736
1006
|
const emitStoppedOpenCodeChildren = effect.Effect.fn("emitStoppedOpenCodeChildren")(function* (context, raw) {
|
|
1007
|
+
for (const transition of context.tasks.stop()) yield* emitOpenCodeTaskTransition(context, transition, raw);
|
|
737
1008
|
for (const subagent of context.subagentBySessionId.values()) yield* emitOpenCodeSubagentCompleted(context, {
|
|
738
1009
|
subagent,
|
|
739
1010
|
status: subagentCompletionStatus("stopped"),
|
|
@@ -762,10 +1033,12 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
762
1033
|
};
|
|
763
1034
|
const registerOpenCodeChildSession = effect.Effect.fn("registerOpenCodeChildSession")(function* (context, session, raw) {
|
|
764
1035
|
if (session.parentID !== context.openCodeSessionId && (session.parentID === void 0 || !context.childSessionIds.has(session.parentID))) return;
|
|
765
|
-
const
|
|
1036
|
+
const taskRef = context.tasks.refForSession(session.id);
|
|
1037
|
+
const subagent = mergeOpenCodeChildSessionRef(context.subagentBySessionId.get(session.id) ?? taskRef ?? takeUnboundOpenCodeSubtask(context), session, session.parentID ?? context.openCodeSessionId);
|
|
766
1038
|
const known = context.childSessionIds.has(session.id);
|
|
767
1039
|
context.childSessionIds.add(session.id);
|
|
768
1040
|
context.subagentBySessionId.set(session.id, subagent);
|
|
1041
|
+
if (taskRef) return subagent;
|
|
769
1042
|
if (known) {
|
|
770
1043
|
yield* emitOpenCodeSubagentUpdated(context, {
|
|
771
1044
|
subagent,
|
|
@@ -891,6 +1164,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
891
1164
|
});
|
|
892
1165
|
const emitUnexpectedExit = effect.Effect.fn("emitUnexpectedExit")(function* (context, message) {
|
|
893
1166
|
if (yield* effect.Ref.getAndSet(context.stopped, true)) return;
|
|
1167
|
+
yield* emitStoppedOpenCodeChildren(context, { reason: "transport-exit" });
|
|
894
1168
|
const turnId = context.activeTurnId;
|
|
895
1169
|
yield* emitForContext(context, {
|
|
896
1170
|
...yield* buildEventBase({
|
|
@@ -987,6 +1261,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
987
1261
|
}
|
|
988
1262
|
});
|
|
989
1263
|
const handleSubscribedEvent = effect.Effect.fn("handleSubscribedEvent")(function* (context, event) {
|
|
1264
|
+
if (yield* effect.Ref.get(context.stopped)) return;
|
|
990
1265
|
const payloadSessionId = "properties" in event ? event.properties.sessionID : void 0;
|
|
991
1266
|
const eventSessionId = typeof payloadSessionId === "string" ? payloadSessionId : void 0;
|
|
992
1267
|
const isRootSessionEvent = eventSessionId === context.openCodeSessionId;
|
|
@@ -1104,14 +1379,17 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1104
1379
|
case "message.part.updated": {
|
|
1105
1380
|
const part = event.properties.part;
|
|
1106
1381
|
context.partById.set(scopedOpenCodeId(part.sessionID, part.id), part);
|
|
1107
|
-
|
|
1382
|
+
const messageRole = messageRoleForPart(context, part);
|
|
1383
|
+
if (part.sessionID === context.openCodeSessionId && messageRole !== "user") yield* projectOpenCodeTask(context, part);
|
|
1384
|
+
else if (part.sessionID === context.openCodeSessionId && part.type === "text" && part.synthetic) yield* projectOpenCodeTask(context, part);
|
|
1385
|
+
if (messageRole === "assistant") yield* emitAssistantTextDelta(context, part, turnId, event);
|
|
1108
1386
|
if (part.type === "subtask" && part.sessionID === context.openCodeSessionId) yield* bindOpenCodeSubtaskPart(context, part, event);
|
|
1109
1387
|
if (part.type === "tool") {
|
|
1110
1388
|
const itemType = toToolLifecycleItemType(part.tool);
|
|
1111
1389
|
const title = part.state.status === "running" ? part.state.title ?? part.tool : part.tool;
|
|
1112
1390
|
const detail = detailFromToolPart(part);
|
|
1113
1391
|
const childSubagent = context.subagentBySessionId.get(part.sessionID);
|
|
1114
|
-
if (childSubagent) yield* emitOpenCodeSubagentUpdated(context, {
|
|
1392
|
+
if (childSubagent && !context.tasks.hasSession(part.sessionID)) yield* emitOpenCodeSubagentUpdated(context, {
|
|
1115
1393
|
subagent: childSubagent,
|
|
1116
1394
|
status: statusFromOpenCodeSubagentState("running"),
|
|
1117
1395
|
summary: title,
|
|
@@ -1228,6 +1506,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1228
1506
|
});
|
|
1229
1507
|
break;
|
|
1230
1508
|
case "session.status": {
|
|
1509
|
+
if (context.tasks.hasSession(event.properties.sessionID)) break;
|
|
1231
1510
|
const childSubagent = context.subagentBySessionId.get(event.properties.sessionID);
|
|
1232
1511
|
if (childSubagent) {
|
|
1233
1512
|
if (event.properties.status.type === "idle") {
|
|
@@ -1295,6 +1574,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1295
1574
|
break;
|
|
1296
1575
|
}
|
|
1297
1576
|
case "session.idle": {
|
|
1577
|
+
if (context.tasks.hasSession(event.properties.sessionID)) break;
|
|
1298
1578
|
const childSubagent = context.subagentBySessionId.get(event.properties.sessionID);
|
|
1299
1579
|
if (childSubagent) yield* emitOpenCodeSubagentCompleted(context, {
|
|
1300
1580
|
subagent: childSubagent,
|
|
@@ -1304,6 +1584,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1304
1584
|
break;
|
|
1305
1585
|
}
|
|
1306
1586
|
case "session.error": {
|
|
1587
|
+
if (event.properties.sessionID && context.tasks.hasSession(event.properties.sessionID)) break;
|
|
1307
1588
|
const message = sessionErrorMessage(event.properties.error);
|
|
1308
1589
|
const childSubagent = event.properties.sessionID !== void 0 ? context.subagentBySessionId.get(event.properties.sessionID) : void 0;
|
|
1309
1590
|
if (childSubagent) {
|
|
@@ -1356,14 +1637,41 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1356
1637
|
}
|
|
1357
1638
|
}
|
|
1358
1639
|
});
|
|
1359
|
-
const
|
|
1640
|
+
const prepareEventSubscription = effect.Effect.fn("prepareEventSubscription")(function* (context) {
|
|
1360
1641
|
const eventsAbortController = new AbortController();
|
|
1361
1642
|
yield* effect.Scope.addFinalizer(context.sessionScope, effect.Effect.sync(() => eventsAbortController.abort()));
|
|
1362
|
-
yield*
|
|
1643
|
+
const iterator = (yield* require_bin.runOpenCodeSdk("event.subscribe", () => context.client.event.subscribe(void 0, { signal: eventsAbortController.signal }))).stream[Symbol.asyncIterator]();
|
|
1644
|
+
const first = yield* require_bin.runOpenCodeSdk("event.subscribe", () => iterator.next()).pipe(effect.Effect.timeoutOrElse({
|
|
1645
|
+
duration: "10 seconds",
|
|
1646
|
+
orElse: () => effect.Effect.fail(new require_bin.OpenCodeRuntimeError({
|
|
1647
|
+
operation: "event.subscribe",
|
|
1648
|
+
detail: "Timed out opening OpenCode event stream."
|
|
1649
|
+
}))
|
|
1650
|
+
}));
|
|
1651
|
+
return {
|
|
1652
|
+
subscription: { stream: (async function* () {
|
|
1653
|
+
try {
|
|
1654
|
+
if (!first.done) yield first.value;
|
|
1655
|
+
if (first.done) return;
|
|
1656
|
+
while (true) {
|
|
1657
|
+
const next = await iterator.next();
|
|
1658
|
+
if (next.done) return;
|
|
1659
|
+
yield next.value;
|
|
1660
|
+
}
|
|
1661
|
+
} finally {
|
|
1662
|
+
await iterator.return?.();
|
|
1663
|
+
}
|
|
1664
|
+
})() },
|
|
1665
|
+
eventsAbortController
|
|
1666
|
+
};
|
|
1667
|
+
});
|
|
1668
|
+
const startEventPump = effect.Effect.fn("startEventPump")(function* (context, prepared) {
|
|
1669
|
+
const { subscription, eventsAbortController } = prepared;
|
|
1670
|
+
yield* effect.Stream.fromAsyncIterable(subscription.stream, (cause) => new require_bin.OpenCodeRuntimeError({
|
|
1363
1671
|
operation: "event.subscribe",
|
|
1364
1672
|
detail: require_bin.openCodeRuntimeErrorDetail(cause),
|
|
1365
1673
|
cause
|
|
1366
|
-
})).pipe(effect.Stream.runForEach((event) => handleSubscribedEvent(context, event)))
|
|
1674
|
+
})).pipe(effect.Stream.runForEach((event) => handleSubscribedEvent(context, event))).pipe(effect.Effect.exit, effect.Effect.flatMap((exit) => effect.Effect.gen(function* () {
|
|
1367
1675
|
if (eventsAbortController.signal.aborted || (yield* effect.Ref.get(context.stopped))) return;
|
|
1368
1676
|
if (effect.Exit.isFailure(exit)) yield* emitUnexpectedExit(context, require_bin.openCodeRuntimeErrorDetail(effect.Cause.squash(exit.cause)));
|
|
1369
1677
|
})), effect.Effect.forkIn(context.sessionScope));
|
|
@@ -1383,7 +1691,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1383
1691
|
operation: "startSession",
|
|
1384
1692
|
issue: `Expected provider instance '${boundInstanceId}' but received '${input.providerInstanceId}'.`
|
|
1385
1693
|
});
|
|
1386
|
-
const runtimeSessionId = yield*
|
|
1694
|
+
const runtimeSessionId = yield* require_runtimeSession.requireRuntimeSessionId(PROVIDER$1, input);
|
|
1387
1695
|
const binaryPath = openCodeSettings.binaryPath;
|
|
1388
1696
|
const serverUrl = openCodeSettings.serverUrl;
|
|
1389
1697
|
const serverPassword = openCodeSettings.serverPassword;
|
|
@@ -1452,7 +1760,8 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1452
1760
|
sessionScope,
|
|
1453
1761
|
server,
|
|
1454
1762
|
client,
|
|
1455
|
-
openCodeSession: openCodeSession.data
|
|
1763
|
+
openCodeSession: openCodeSession.data,
|
|
1764
|
+
adopted: adoptedSession !== void 0
|
|
1456
1765
|
};
|
|
1457
1766
|
}).pipe(effect.Effect.provideService(effect.Scope.Scope, sessionScope)));
|
|
1458
1767
|
if (effect.Exit.isFailure(startedExit)) {
|
|
@@ -1461,12 +1770,6 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1461
1770
|
}
|
|
1462
1771
|
return startedExit.value;
|
|
1463
1772
|
});
|
|
1464
|
-
const raceWinner = sessions.get(input.threadId);
|
|
1465
|
-
if (raceWinner) {
|
|
1466
|
-
yield* require_bin.runOpenCodeSdk("session.abort", () => started.client.session.abort({ sessionID: started.openCodeSession.id })).pipe(effect.Effect.ignore);
|
|
1467
|
-
yield* effect.Scope.close(started.sessionScope, effect.Exit.void).pipe(effect.Effect.ignore);
|
|
1468
|
-
return raceWinner.session;
|
|
1469
|
-
}
|
|
1470
1773
|
const createdAt = nowIso();
|
|
1471
1774
|
const tokenMode = input.tokenMode ?? "balanced";
|
|
1472
1775
|
const session = {
|
|
@@ -1505,6 +1808,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1505
1808
|
unboundSubtaskPartIds: [],
|
|
1506
1809
|
startedSubagentIds: /* @__PURE__ */ new Set(),
|
|
1507
1810
|
completedSubagentIds: /* @__PURE__ */ new Set(),
|
|
1811
|
+
tasks: new OpenCodeTaskLifecycle(),
|
|
1508
1812
|
turns: [],
|
|
1509
1813
|
activeTurnId: void 0,
|
|
1510
1814
|
activeAgent: void 0,
|
|
@@ -1518,6 +1822,19 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1518
1822
|
stopped: yield* effect.Ref.make(false),
|
|
1519
1823
|
sessionScope: started.sessionScope
|
|
1520
1824
|
};
|
|
1825
|
+
const prepared = yield* effect.Effect.exit(prepareEventSubscription(context));
|
|
1826
|
+
if (effect.Exit.isFailure(prepared)) {
|
|
1827
|
+
if (!started.adopted) yield* require_bin.runOpenCodeSdk("session.abort", () => started.client.session.abort({ sessionID: started.openCodeSession.id })).pipe(effect.Effect.ignore);
|
|
1828
|
+
yield* effect.Scope.close(started.sessionScope, effect.Exit.void).pipe(effect.Effect.ignore);
|
|
1829
|
+
return yield* toProcessError(input.threadId, effect.Cause.squash(prepared.cause));
|
|
1830
|
+
}
|
|
1831
|
+
const storedTasks = started.adopted ? yield* loadOpenCodeTasks(context).pipe(effect.Effect.catch((error) => effect.Effect.logWarning("OpenCode Task history reconstruction failed", error).pipe(effect.Effect.as([])))) : [];
|
|
1832
|
+
const raceWinner = sessions.get(input.threadId);
|
|
1833
|
+
if (raceWinner) {
|
|
1834
|
+
if (!started.adopted) yield* require_bin.runOpenCodeSdk("session.abort", () => started.client.session.abort({ sessionID: started.openCodeSession.id })).pipe(effect.Effect.ignore);
|
|
1835
|
+
yield* effect.Scope.close(started.sessionScope, effect.Exit.void).pipe(effect.Effect.ignore);
|
|
1836
|
+
return raceWinner.session;
|
|
1837
|
+
}
|
|
1521
1838
|
deviceToolContext = context;
|
|
1522
1839
|
sessions.set(input.threadId, context);
|
|
1523
1840
|
yield* emitForContext(context, {
|
|
@@ -1530,7 +1847,8 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1530
1847
|
type: "thread.started",
|
|
1531
1848
|
payload: { providerThreadId: started.openCodeSession.id }
|
|
1532
1849
|
});
|
|
1533
|
-
yield*
|
|
1850
|
+
for (const { transition, part } of storedTasks) yield* emitOpenCodeTaskTransition(context, transition, part);
|
|
1851
|
+
yield* startEventPump(context, prepared.value);
|
|
1534
1852
|
yield* effect.Effect.gen(function* () {
|
|
1535
1853
|
yield* hydrateOpenCodeChildSessions(context);
|
|
1536
1854
|
yield* recoverPendingOpenCodeRequests(context);
|
|
@@ -1544,7 +1862,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1544
1862
|
provider: PROVIDER$1,
|
|
1545
1863
|
threadId: input.threadId
|
|
1546
1864
|
});
|
|
1547
|
-
const turnId =
|
|
1865
|
+
const turnId = require_src.TurnId.make(`opencode-turn-${yield* effect.Effect.sync(() => crypto.randomUUID())}`);
|
|
1548
1866
|
const modelSelection = input.modelSelection ?? (context.session.model ? {
|
|
1549
1867
|
instanceId: boundInstanceId,
|
|
1550
1868
|
model: context.session.model
|
|
@@ -1567,7 +1885,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1567
1885
|
if (declaredAttachmentBytes > 52428800) return yield* new require_bin.ProviderAdapterRequestError({
|
|
1568
1886
|
provider: PROVIDER$1,
|
|
1569
1887
|
method: "session.prompt",
|
|
1570
|
-
detail: `Attachments total ${declaredAttachmentBytes} bytes; limit is ${
|
|
1888
|
+
detail: `Attachments total ${declaredAttachmentBytes} bytes; limit is ${require_src.PROVIDER_SEND_TURN_MAX_ATTACHMENT_TOTAL_BYTES} bytes.`
|
|
1571
1889
|
});
|
|
1572
1890
|
let attachmentTotalBytes = 0;
|
|
1573
1891
|
const pathLineEntries = [];
|
|
@@ -1596,10 +1914,10 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1596
1914
|
if (attachmentTotalBytes > 52428800) return yield* new require_bin.ProviderAdapterRequestError({
|
|
1597
1915
|
provider: PROVIDER$1,
|
|
1598
1916
|
method: "session.prompt",
|
|
1599
|
-
detail: `Attachments total ${attachmentTotalBytes} bytes; limit is ${
|
|
1917
|
+
detail: `Attachments total ${attachmentTotalBytes} bytes; limit is ${require_src.PROVIDER_SEND_TURN_MAX_ATTACHMENT_TOTAL_BYTES} bytes.`
|
|
1600
1918
|
});
|
|
1601
1919
|
}
|
|
1602
|
-
text =
|
|
1920
|
+
text = require_runtimeSession.appendAttachmentPathLines(text, require_runtimeSession.formatAttachmentPathLines(pathLineEntries));
|
|
1603
1921
|
const fileParts = require_bin.toOpenCodeFileParts({
|
|
1604
1922
|
attachments: input.attachments,
|
|
1605
1923
|
resolveAttachmentUrl: (attachment) => attachment.id === void 0 ? null : attachmentUrlById.get(attachment.id) ?? null
|
|
@@ -1699,6 +2017,10 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1699
2017
|
const context = ensureSessionContext(sessions, threadId);
|
|
1700
2018
|
const interruptedTurnId = turnId ?? context.activeTurnId;
|
|
1701
2019
|
if (turnId !== void 0 && context.activeTurnId !== void 0 && turnId !== context.activeTurnId) return;
|
|
2020
|
+
yield* emitStoppedOpenCodeChildren(context, {
|
|
2021
|
+
method: "session.abort",
|
|
2022
|
+
reason: "turn-interrupted"
|
|
2023
|
+
});
|
|
1702
2024
|
const pendingPrompt = context.pendingPrompt;
|
|
1703
2025
|
if (pendingPrompt && pendingPrompt.turnId === interruptedTurnId) {
|
|
1704
2026
|
context.pendingPrompt = void 0;
|
|
@@ -1706,10 +2028,6 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1706
2028
|
}
|
|
1707
2029
|
const rootAbortExit = yield* abortOpenCodeSession(context, context.openCodeSessionId).pipe(effect.Effect.mapError(toRequestError), effect.Effect.exit);
|
|
1708
2030
|
yield* effect.Effect.forEach(context.childSessionIds, (sessionID) => abortOpenCodeSession(context, sessionID).pipe(effect.Effect.ignore({ log: true })), { discard: true });
|
|
1709
|
-
yield* emitStoppedOpenCodeChildren(context, {
|
|
1710
|
-
method: "session.abort",
|
|
1711
|
-
reason: "turn-interrupted"
|
|
1712
|
-
});
|
|
1713
2031
|
if (effect.Exit.isFailure(rootAbortExit)) return yield* effect.Effect.failCause(rootAbortExit.cause);
|
|
1714
2032
|
if (interruptedTurnId) {
|
|
1715
2033
|
if (context.activeTurnId === interruptedTurnId) {
|
|
@@ -1787,7 +2105,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
1787
2105
|
return {
|
|
1788
2106
|
threadId,
|
|
1789
2107
|
turns: ((yield* require_bin.runOpenCodeSdk("session.messages", () => context.client.session.messages({ sessionID: context.openCodeSessionId })).pipe(effect.Effect.mapError(toRequestError))).data ?? []).filter((entry) => entry.info.role === "assistant").map((entry) => ({
|
|
1790
|
-
id:
|
|
2108
|
+
id: require_src.TurnId.make(entry.info.id),
|
|
1791
2109
|
items: [entry.info, ...entry.parts]
|
|
1792
2110
|
}))
|
|
1793
2111
|
};
|
|
@@ -1918,7 +2236,7 @@ const probeOpenCodeGoUsageRateLimits = effect.Effect.fn("probeOpenCodeGoUsageRat
|
|
|
1918
2236
|
});
|
|
1919
2237
|
//#endregion
|
|
1920
2238
|
//#region src/provider/Layers/OpenCodeProvider.ts
|
|
1921
|
-
const PROVIDER =
|
|
2239
|
+
const PROVIDER = require_src.ProviderDriverKind.make("opencode");
|
|
1922
2240
|
const OPENCODE_PRESENTATION = {
|
|
1923
2241
|
displayName: "OpenCode",
|
|
1924
2242
|
showInteractionModeToggle: false
|
|
@@ -2222,7 +2540,7 @@ const checkOpenCodeProviderStatus = effect.Effect.fn("checkOpenCodeProviderStatu
|
|
|
2222
2540
|
*
|
|
2223
2541
|
* @module provider/Drivers/OpenCodeDriver
|
|
2224
2542
|
*/
|
|
2225
|
-
const DRIVER_KIND =
|
|
2543
|
+
const DRIVER_KIND = require_src.ProviderDriverKind.make("opencode");
|
|
2226
2544
|
function isOpenCodeNativeCommandPath(commandPath) {
|
|
2227
2545
|
const normalized = require_bin.normalizeCommandPath(commandPath);
|
|
2228
2546
|
return normalized.endsWith("/.opencode/bin/opencode") || normalized.endsWith("/.opencode/bin/opencode.exe");
|
|
@@ -2252,8 +2570,8 @@ const OpenCodeDriver = {
|
|
|
2252
2570
|
displayName: "OpenCode",
|
|
2253
2571
|
supportsMultipleInstances: true
|
|
2254
2572
|
},
|
|
2255
|
-
configSchema:
|
|
2256
|
-
defaultConfig: () => effect.Schema.decodeSync(
|
|
2573
|
+
configSchema: require_src.OpenCodeSettings,
|
|
2574
|
+
defaultConfig: () => effect.Schema.decodeSync(require_src.OpenCodeSettings)({}),
|
|
2257
2575
|
create: ({ instanceId, displayName, accentColor, environment, enabled, config }) => effect.Effect.gen(function* () {
|
|
2258
2576
|
const openCodeRuntime = yield* require_bin.OpenCodeRuntime;
|
|
2259
2577
|
const serverConfig = yield* require_Metrics.ServerConfig;
|