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,26 +1,20 @@
|
|
|
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
6
|
const require_bin = require("./bin.cjs");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const require_AcpNativeLogging = require("./AcpNativeLogging-COepku4a.cjs");
|
|
7
|
+
const require_AcpNativeLogging = require("./AcpNativeLogging-DZPZNoju.cjs");
|
|
8
|
+
const require_runtimeSession = require("./runtimeSession-Bj0OUcNJ.cjs");
|
|
10
9
|
let effect_Effect = require("effect/Effect");
|
|
11
10
|
effect_Effect = require_rolldown_runtime.__toESM(effect_Effect, 1);
|
|
12
|
-
let effect_Layer = require("effect/Layer");
|
|
13
|
-
effect_Layer = require_rolldown_runtime.__toESM(effect_Layer, 1);
|
|
14
11
|
let effect_Schema = require("effect/Schema");
|
|
15
12
|
effect_Schema = require_rolldown_runtime.__toESM(effect_Schema, 1);
|
|
16
|
-
let effect_unstable_http = require("effect/unstable/http");
|
|
17
13
|
let effect_unstable_process = require("effect/unstable/process");
|
|
18
14
|
let effect_Semaphore = require("effect/Semaphore");
|
|
19
15
|
effect_Semaphore = require_rolldown_runtime.__toESM(effect_Semaphore, 1);
|
|
20
16
|
let effect_Scope = require("effect/Scope");
|
|
21
17
|
effect_Scope = require_rolldown_runtime.__toESM(effect_Scope, 1);
|
|
22
|
-
let effect_Cause = require("effect/Cause");
|
|
23
|
-
effect_Cause = require_rolldown_runtime.__toESM(effect_Cause, 1);
|
|
24
18
|
let effect_Deferred = require("effect/Deferred");
|
|
25
19
|
effect_Deferred = require_rolldown_runtime.__toESM(effect_Deferred, 1);
|
|
26
20
|
let effect_Exit = require("effect/Exit");
|
|
@@ -31,22 +25,28 @@ let effect_Ref = require("effect/Ref");
|
|
|
31
25
|
effect_Ref = require_rolldown_runtime.__toESM(effect_Ref, 1);
|
|
32
26
|
let effect_Stream = require("effect/Stream");
|
|
33
27
|
effect_Stream = require_rolldown_runtime.__toESM(effect_Stream, 1);
|
|
34
|
-
let effect_Duration = require("effect/Duration");
|
|
35
|
-
effect_Duration = require_rolldown_runtime.__toESM(effect_Duration, 1);
|
|
36
28
|
let effect_Fiber = require("effect/Fiber");
|
|
37
29
|
effect_Fiber = require_rolldown_runtime.__toESM(effect_Fiber, 1);
|
|
30
|
+
let effect_DateTime = require("effect/DateTime");
|
|
31
|
+
effect_DateTime = require_rolldown_runtime.__toESM(effect_DateTime, 1);
|
|
38
32
|
let effect_FileSystem = require("effect/FileSystem");
|
|
39
33
|
effect_FileSystem = require_rolldown_runtime.__toESM(effect_FileSystem, 1);
|
|
40
34
|
let effect_Path = require("effect/Path");
|
|
41
35
|
effect_Path = require_rolldown_runtime.__toESM(effect_Path, 1);
|
|
42
|
-
let effect_DateTime = require("effect/DateTime");
|
|
43
|
-
effect_DateTime = require_rolldown_runtime.__toESM(effect_DateTime, 1);
|
|
44
36
|
let effect_PubSub = require("effect/PubSub");
|
|
45
37
|
effect_PubSub = require_rolldown_runtime.__toESM(effect_PubSub, 1);
|
|
46
38
|
let effect_SynchronizedRef = require("effect/SynchronizedRef");
|
|
47
39
|
effect_SynchronizedRef = require_rolldown_runtime.__toESM(effect_SynchronizedRef, 1);
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
//#region src/provider/acp/AcpModelSelection.ts
|
|
41
|
+
function currentAcpModelIdFromSessionSetup(sessionSetupResult) {
|
|
42
|
+
const option = sessionSetupResult.configOptions?.find((entry) => entry.category === "model" && entry.type === "select");
|
|
43
|
+
return sessionSetupResult.models?.currentModelId?.trim() || (typeof option?.currentValue === "string" ? option.currentValue : void 0);
|
|
44
|
+
}
|
|
45
|
+
function applyAcpModelSelection(input) {
|
|
46
|
+
if (!(input.requestedModelId !== void 0 && input.requestedModelId !== input.currentModelId)) return effect_Effect.succeed(input.currentModelId);
|
|
47
|
+
return input.runtime.setSessionModel(input.requestedModelId).pipe(effect_Effect.mapError(input.mapError), effect_Effect.as(input.requestedModelId));
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
50
|
//#region src/provider/acp/XAiAcpExtension.ts
|
|
51
51
|
const XAiPromptCompleteNotification = effect_Schema.Struct({
|
|
52
52
|
sessionId: effect_Schema.String,
|
|
@@ -320,228 +320,9 @@ function normalizeXAiStopReason(value) {
|
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
//#endregion
|
|
323
|
-
//#region src/provider/
|
|
324
|
-
const GROK_API_KEY_ENV = "XAI_API_KEY";
|
|
325
|
-
const GROK_OAUTH2_REFERRER_ENV = "GROK_OAUTH2_REFERRER";
|
|
326
|
-
const RYCO_OAUTH_REFERRER = "ryco";
|
|
327
|
-
const GROK_AUTH_METHOD_API_KEY = "xai.api_key";
|
|
328
|
-
const GROK_AUTH_METHOD_CACHED_TOKEN = "cached_token";
|
|
329
|
-
const GROK_DRIVER_KIND = require_collectUint8StreamText.ProviderDriverKind.make("grok");
|
|
330
|
-
function buildGrokAcpSpawnInput(grokSettings, cwd, environment) {
|
|
331
|
-
return {
|
|
332
|
-
command: grokSettings?.binaryPath || "grok",
|
|
333
|
-
args: ["agent", "stdio"],
|
|
334
|
-
cwd,
|
|
335
|
-
env: {
|
|
336
|
-
...environment,
|
|
337
|
-
[GROK_OAUTH2_REFERRER_ENV]: RYCO_OAUTH_REFERRER
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
function resolveGrokAuthMethodId(environment) {
|
|
342
|
-
return environment?.[GROK_API_KEY_ENV]?.trim() ? GROK_AUTH_METHOD_API_KEY : GROK_AUTH_METHOD_CACHED_TOKEN;
|
|
343
|
-
}
|
|
344
|
-
const makeGrokAcpRuntime = (input) => effect_Effect.gen(function* () {
|
|
345
|
-
const acpContext = yield* effect_Layer.build(require_AcpNativeLogging.AcpSessionRuntime.layer({
|
|
346
|
-
...input,
|
|
347
|
-
spawn: buildGrokAcpSpawnInput(input.grokSettings, input.cwd, input.environment),
|
|
348
|
-
authMethodId: resolveGrokAuthMethodId(input.environment)
|
|
349
|
-
}).pipe(effect_Layer.provide(effect_Layer.succeed(effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner, input.childProcessSpawner))));
|
|
350
|
-
const runtime = yield* effect_Effect.service(require_AcpNativeLogging.AcpSessionRuntime).pipe(effect_Effect.provide(acpContext));
|
|
351
|
-
return yield* makeXAiPromptCompletionRuntime(runtime);
|
|
352
|
-
});
|
|
353
|
-
function resolveGrokAcpBaseModelId(model) {
|
|
354
|
-
const trimmed = model?.trim();
|
|
355
|
-
const base = trimmed && trimmed.length > 0 ? trimmed : "grok-build";
|
|
356
|
-
return require_bin.normalizeModelSlug(base, GROK_DRIVER_KIND) ?? "grok-build";
|
|
357
|
-
}
|
|
358
|
-
function currentGrokModelIdFromSessionSetup(sessionSetupResult) {
|
|
359
|
-
return sessionSetupResult.models?.currentModelId?.trim() || void 0;
|
|
360
|
-
}
|
|
361
|
-
function applyGrokAcpModelSelection(input) {
|
|
362
|
-
if (!(input.requestedModelId !== void 0 && input.requestedModelId !== input.currentModelId)) return effect_Effect.succeed(input.currentModelId);
|
|
363
|
-
return input.runtime.setSessionModel(input.requestedModelId).pipe(effect_Effect.mapError(input.mapError), effect_Effect.as(input.requestedModelId));
|
|
364
|
-
}
|
|
365
|
-
//#endregion
|
|
366
|
-
//#region src/textGeneration/GrokTextGeneration.ts
|
|
367
|
-
const GROK_TIMEOUT_MS = 18e4;
|
|
368
|
-
function mapGrokAcpError(operation, detail, cause) {
|
|
369
|
-
return new require_collectUint8StreamText.TextGenerationError({
|
|
370
|
-
operation,
|
|
371
|
-
detail,
|
|
372
|
-
...cause !== void 0 ? { cause } : {}
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
function isTextGenerationError(error) {
|
|
376
|
-
return typeof error === "object" && error !== null && "_tag" in error && error._tag === "TextGenerationError";
|
|
377
|
-
}
|
|
378
|
-
const makeGrokTextGeneration = effect_Effect.fn("makeGrokTextGeneration")(function* (grokSettings, environment = process.env) {
|
|
379
|
-
const commandSpawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
|
|
380
|
-
const runGrokJson = ({ operation, cwd, prompt, outputSchemaJson, modelSelection }) => effect_Effect.gen(function* () {
|
|
381
|
-
const resolvedModel = resolveGrokAcpBaseModelId(modelSelection.model);
|
|
382
|
-
const outputRef = yield* effect_Ref.make("");
|
|
383
|
-
const runtime = yield* makeGrokAcpRuntime({
|
|
384
|
-
grokSettings,
|
|
385
|
-
environment,
|
|
386
|
-
childProcessSpawner: commandSpawner,
|
|
387
|
-
cwd,
|
|
388
|
-
clientInfo: {
|
|
389
|
-
name: "ryco-git-text",
|
|
390
|
-
version: "0.0.0"
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
yield* runtime.handleSessionUpdate((notification) => {
|
|
394
|
-
const update = notification.update;
|
|
395
|
-
if (update.sessionUpdate !== "agent_message_chunk") return effect_Effect.void;
|
|
396
|
-
const content = update.content;
|
|
397
|
-
if (content.type !== "text") return effect_Effect.void;
|
|
398
|
-
return effect_Ref.update(outputRef, (current) => current + content.text);
|
|
399
|
-
});
|
|
400
|
-
const promptResult = yield* effect_Effect.gen(function* () {
|
|
401
|
-
const started = yield* runtime.start();
|
|
402
|
-
yield* applyGrokAcpModelSelection({
|
|
403
|
-
runtime,
|
|
404
|
-
currentModelId: currentGrokModelIdFromSessionSetup(started.sessionSetupResult),
|
|
405
|
-
requestedModelId: resolvedModel,
|
|
406
|
-
mapError: (cause) => mapGrokAcpError(operation, "Failed to set Grok ACP base model for text generation.", cause)
|
|
407
|
-
});
|
|
408
|
-
return yield* runtime.prompt({ prompt: [{
|
|
409
|
-
type: "text",
|
|
410
|
-
text: prompt
|
|
411
|
-
}] });
|
|
412
|
-
}).pipe(effect_Effect.timeoutOption(GROK_TIMEOUT_MS), effect_Effect.flatMap(effect_Option.match({
|
|
413
|
-
onNone: () => effect_Effect.fail(new require_collectUint8StreamText.TextGenerationError({
|
|
414
|
-
operation,
|
|
415
|
-
detail: "Grok ACP request timed out."
|
|
416
|
-
})),
|
|
417
|
-
onSome: (value) => effect_Effect.succeed(value)
|
|
418
|
-
})), effect_Effect.mapError((cause) => isTextGenerationError(cause) ? cause : mapGrokAcpError(operation, "Grok ACP request failed.", cause)));
|
|
419
|
-
const trimmed = (yield* effect_Ref.get(outputRef)).trim();
|
|
420
|
-
if (!trimmed) return yield* new require_collectUint8StreamText.TextGenerationError({
|
|
421
|
-
operation,
|
|
422
|
-
detail: promptResult.stopReason === "cancelled" ? "Grok ACP request was cancelled." : "Grok Agent returned empty output."
|
|
423
|
-
});
|
|
424
|
-
return yield* effect_Schema.decodeEffect(effect_Schema.fromJsonString(outputSchemaJson))(require_bin.extractJsonObject(trimmed)).pipe(effect_Effect.catchTag("SchemaError", (cause) => effect_Effect.fail(new require_collectUint8StreamText.TextGenerationError({
|
|
425
|
-
operation,
|
|
426
|
-
detail: "Grok Agent returned invalid structured output.",
|
|
427
|
-
cause
|
|
428
|
-
}))));
|
|
429
|
-
}).pipe(effect_Effect.mapError((cause) => isTextGenerationError(cause) ? cause : mapGrokAcpError(operation, "Grok ACP text generation failed.", cause)), effect_Effect.scoped);
|
|
430
|
-
return {
|
|
431
|
-
generateCommitMessage: effect_Effect.fn("GrokTextGeneration.generateCommitMessage")(function* (input) {
|
|
432
|
-
const { prompt, outputSchema } = require_bin.buildCommitMessagePrompt({
|
|
433
|
-
branch: input.branch,
|
|
434
|
-
stagedSummary: input.stagedSummary,
|
|
435
|
-
stagedPatch: input.stagedPatch,
|
|
436
|
-
includeBranch: input.includeBranch === true
|
|
437
|
-
});
|
|
438
|
-
const generated = yield* runGrokJson({
|
|
439
|
-
operation: "generateCommitMessage",
|
|
440
|
-
cwd: input.cwd,
|
|
441
|
-
prompt,
|
|
442
|
-
outputSchemaJson: outputSchema,
|
|
443
|
-
modelSelection: input.modelSelection
|
|
444
|
-
});
|
|
445
|
-
return {
|
|
446
|
-
subject: require_bin.sanitizeCommitSubject(generated.subject),
|
|
447
|
-
body: generated.body.trim(),
|
|
448
|
-
..."branch" in generated && typeof generated.branch === "string" ? { branch: require_Metrics.sanitizeFeatureBranchName(generated.branch) } : {}
|
|
449
|
-
};
|
|
450
|
-
}),
|
|
451
|
-
generatePrContent: effect_Effect.fn("GrokTextGeneration.generatePrContent")(function* (input) {
|
|
452
|
-
const { prompt, outputSchema } = require_bin.buildPrContentPrompt({
|
|
453
|
-
baseBranch: input.baseBranch,
|
|
454
|
-
headBranch: input.headBranch,
|
|
455
|
-
commitSummary: input.commitSummary,
|
|
456
|
-
diffSummary: input.diffSummary,
|
|
457
|
-
diffPatch: input.diffPatch
|
|
458
|
-
});
|
|
459
|
-
const generated = yield* runGrokJson({
|
|
460
|
-
operation: "generatePrContent",
|
|
461
|
-
cwd: input.cwd,
|
|
462
|
-
prompt,
|
|
463
|
-
outputSchemaJson: outputSchema,
|
|
464
|
-
modelSelection: input.modelSelection
|
|
465
|
-
});
|
|
466
|
-
return {
|
|
467
|
-
title: require_bin.sanitizePrTitle(generated.title),
|
|
468
|
-
body: generated.body.trim()
|
|
469
|
-
};
|
|
470
|
-
}),
|
|
471
|
-
generateBranchName: effect_Effect.fn("GrokTextGeneration.generateBranchName")(function* (input) {
|
|
472
|
-
const { prompt, outputSchema } = require_bin.buildBranchNamePrompt({
|
|
473
|
-
message: input.message,
|
|
474
|
-
attachments: input.attachments
|
|
475
|
-
});
|
|
476
|
-
const generated = yield* runGrokJson({
|
|
477
|
-
operation: "generateBranchName",
|
|
478
|
-
cwd: input.cwd,
|
|
479
|
-
prompt,
|
|
480
|
-
outputSchemaJson: outputSchema,
|
|
481
|
-
modelSelection: input.modelSelection
|
|
482
|
-
});
|
|
483
|
-
return { branch: require_Metrics.sanitizeBranchFragment(generated.branch) };
|
|
484
|
-
}),
|
|
485
|
-
generateThreadTitle: effect_Effect.fn("GrokTextGeneration.generateThreadTitle")(function* (input) {
|
|
486
|
-
const { prompt, outputSchema } = require_bin.buildThreadTitlePrompt({
|
|
487
|
-
message: input.message,
|
|
488
|
-
attachments: input.attachments
|
|
489
|
-
});
|
|
490
|
-
const generated = yield* runGrokJson({
|
|
491
|
-
operation: "generateThreadTitle",
|
|
492
|
-
cwd: input.cwd,
|
|
493
|
-
prompt,
|
|
494
|
-
outputSchemaJson: outputSchema,
|
|
495
|
-
modelSelection: input.modelSelection
|
|
496
|
-
});
|
|
497
|
-
return { title: require_bin.sanitizeThreadTitle(generated.title) };
|
|
498
|
-
}),
|
|
499
|
-
generateIssueContent: effect_Effect.fn("GrokTextGeneration.generateIssueContent")(function* (input) {
|
|
500
|
-
if (input.mode === "polish") {
|
|
501
|
-
const { prompt, outputSchema } = require_bin.buildIssueContentPolishPrompt({
|
|
502
|
-
rough: input.rough,
|
|
503
|
-
...input.currentTitle ? { currentTitle: input.currentTitle } : {},
|
|
504
|
-
...input.customInstructions ? { customInstructions: input.customInstructions } : {}
|
|
505
|
-
});
|
|
506
|
-
const decoded = yield* runGrokJson({
|
|
507
|
-
operation: "generateIssueContent",
|
|
508
|
-
cwd: input.cwd,
|
|
509
|
-
prompt,
|
|
510
|
-
outputSchemaJson: outputSchema,
|
|
511
|
-
modelSelection: input.modelSelection
|
|
512
|
-
});
|
|
513
|
-
return {
|
|
514
|
-
title: decoded.title.trim(),
|
|
515
|
-
body: decoded.body.trim()
|
|
516
|
-
};
|
|
517
|
-
}
|
|
518
|
-
const { prompt, outputSchema } = require_bin.buildIssueContentTitlePrompt({ body: input.body });
|
|
519
|
-
return { title: (yield* runGrokJson({
|
|
520
|
-
operation: "generateIssueContent",
|
|
521
|
-
cwd: input.cwd,
|
|
522
|
-
prompt,
|
|
523
|
-
outputSchemaJson: outputSchema,
|
|
524
|
-
modelSelection: input.modelSelection
|
|
525
|
-
})).title.trim() };
|
|
526
|
-
}),
|
|
527
|
-
rankInboxThreads: effect_Effect.fn("GrokTextGeneration.rankInboxThreads")(function* (input) {
|
|
528
|
-
const { prompt, outputSchema } = require_bin.buildThreadPriorityPrompt({ serializedCandidates: input.chunk.serializedCandidates });
|
|
529
|
-
const generated = yield* runGrokJson({
|
|
530
|
-
operation: "rankInboxThreads",
|
|
531
|
-
cwd: input.cwd,
|
|
532
|
-
prompt,
|
|
533
|
-
outputSchemaJson: outputSchema,
|
|
534
|
-
modelSelection: input.modelSelection
|
|
535
|
-
});
|
|
536
|
-
return yield* require_bin.validateRankInboxThreadsResult(input, generated.rankings);
|
|
537
|
-
})
|
|
538
|
-
};
|
|
539
|
-
});
|
|
540
|
-
//#endregion
|
|
541
|
-
//#region src/provider/Layers/GrokAdapter.ts
|
|
323
|
+
//#region src/provider/Layers/AcpAdapter.ts
|
|
542
324
|
const encodeUnknownJsonStringExit = effect_Schema.encodeUnknownExit(effect_Schema.fromJsonString(effect_Schema.Unknown));
|
|
543
|
-
const
|
|
544
|
-
const GROK_RESUME_VERSION = 1;
|
|
325
|
+
const ACP_RESUME_VERSION = 1;
|
|
545
326
|
function encodeJsonStringForDiagnostics(input) {
|
|
546
327
|
const result = encodeUnknownJsonStringExit(input);
|
|
547
328
|
return effect_Exit.isSuccess(result) ? result.value : void 0;
|
|
@@ -555,9 +336,9 @@ function settlePendingUserInputsAsCancelled(pendingUserInputs) {
|
|
|
555
336
|
function isRecord(value) {
|
|
556
337
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
557
338
|
}
|
|
558
|
-
function
|
|
339
|
+
function parseAcpResume(raw) {
|
|
559
340
|
if (!isRecord(raw)) return void 0;
|
|
560
|
-
if (raw.schemaVersion !==
|
|
341
|
+
if (raw.schemaVersion !== ACP_RESUME_VERSION) return void 0;
|
|
561
342
|
if (typeof raw.sessionId !== "string" || !raw.sessionId.trim()) return void 0;
|
|
562
343
|
return { sessionId: raw.sessionId.trim() };
|
|
563
344
|
}
|
|
@@ -568,9 +349,11 @@ function selectPermissionOptionId(request, decision) {
|
|
|
568
349
|
function selectAutoApprovedPermissionOption(request) {
|
|
569
350
|
return selectPermissionOptionId(request, "acceptForSession") ?? selectPermissionOptionId(request, "accept");
|
|
570
351
|
}
|
|
571
|
-
function
|
|
352
|
+
function makeAcpAdapter(options) {
|
|
353
|
+
const PROVIDER = options.provider;
|
|
354
|
+
const normalizeModel = options.normalizeModel;
|
|
572
355
|
return effect_Effect.gen(function* () {
|
|
573
|
-
const boundInstanceId = options?.instanceId ??
|
|
356
|
+
const boundInstanceId = options?.instanceId ?? require_src.ProviderInstanceId.make(PROVIDER);
|
|
574
357
|
const fileSystem = yield* effect_FileSystem.FileSystem;
|
|
575
358
|
const path = yield* effect_Path.Path;
|
|
576
359
|
const childProcessSpawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
|
|
@@ -582,17 +365,17 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
582
365
|
const runtimeEventPubSub = yield* effect_PubSub.bounded(2048);
|
|
583
366
|
const nowIso = effect_Effect.map(effect_DateTime.now, effect_DateTime.formatIso);
|
|
584
367
|
const randomUUIDv4 = effect_Effect.sync(() => crypto.randomUUID());
|
|
585
|
-
const nextEventId = effect_Effect.map(randomUUIDv4, (id) =>
|
|
368
|
+
const nextEventId = effect_Effect.map(randomUUIDv4, (id) => require_src.EventId.make(id));
|
|
586
369
|
const makeEventStamp = () => effect_Effect.all({
|
|
587
370
|
eventId: nextEventId,
|
|
588
371
|
createdAt: nowIso
|
|
589
372
|
});
|
|
590
|
-
const mapAcpCallbackFailure = (effect) => effect.pipe(effect_Effect.mapError((cause) => new
|
|
591
|
-
detail: "Failed to process
|
|
373
|
+
const mapAcpCallbackFailure = (effect) => effect.pipe(effect_Effect.mapError((cause) => new require_bin.AcpTransportError({
|
|
374
|
+
detail: "Failed to process ACP callback.",
|
|
592
375
|
cause
|
|
593
376
|
})));
|
|
594
377
|
const offerRuntimeEventForRuntime = (runtimeSessionId, event) => {
|
|
595
|
-
return effect_PubSub.publish(runtimeEventPubSub,
|
|
378
|
+
return effect_PubSub.publish(runtimeEventPubSub, require_runtimeSession.stampRuntimeEvent(event, {
|
|
596
379
|
providerInstanceId: boundInstanceId,
|
|
597
380
|
runtimeSessionId
|
|
598
381
|
})).pipe(effect_Effect.asVoid);
|
|
@@ -617,14 +400,14 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
617
400
|
event: {
|
|
618
401
|
id: yield* randomUUIDv4,
|
|
619
402
|
kind: "notification",
|
|
620
|
-
provider: PROVIDER
|
|
403
|
+
provider: PROVIDER,
|
|
621
404
|
createdAt: observedAt,
|
|
622
405
|
method,
|
|
623
406
|
threadId,
|
|
624
407
|
payload
|
|
625
408
|
}
|
|
626
409
|
}, threadId);
|
|
627
|
-
}).pipe(effect_Effect.catchCause((cause) => effect_Effect.logWarning("Failed to write native
|
|
410
|
+
}).pipe(effect_Effect.catchCause((cause) => effect_Effect.logWarning("Failed to write native ACP notification log.", {
|
|
628
411
|
cause,
|
|
629
412
|
threadId,
|
|
630
413
|
method
|
|
@@ -635,7 +418,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
635
418
|
ctx.lastPlanFingerprint = fingerprint;
|
|
636
419
|
yield* offerRuntimeEventForRuntime(ctx.session.runtimeSessionId, require_AcpNativeLogging.makeAcpPlanUpdatedEvent({
|
|
637
420
|
stamp: yield* makeEventStamp(),
|
|
638
|
-
provider: PROVIDER
|
|
421
|
+
provider: PROVIDER,
|
|
639
422
|
threadId: ctx.threadId,
|
|
640
423
|
turnId: ctx.activeTurnId,
|
|
641
424
|
payload,
|
|
@@ -647,7 +430,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
647
430
|
const requireSession = (threadId) => {
|
|
648
431
|
const ctx = sessions.get(threadId);
|
|
649
432
|
if (!ctx || ctx.stopped) return effect_Effect.fail(new require_bin.ProviderAdapterSessionNotFoundError({
|
|
650
|
-
provider: PROVIDER
|
|
433
|
+
provider: PROVIDER,
|
|
651
434
|
threadId
|
|
652
435
|
}));
|
|
653
436
|
return effect_Effect.succeed(ctx);
|
|
@@ -663,42 +446,42 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
663
446
|
yield* offerRuntimeEventForRuntime(ctx.session.runtimeSessionId, {
|
|
664
447
|
type: "session.exited",
|
|
665
448
|
...yield* makeEventStamp(),
|
|
666
|
-
provider: PROVIDER
|
|
449
|
+
provider: PROVIDER,
|
|
667
450
|
threadId: ctx.threadId,
|
|
668
451
|
payload: { exitKind: "graceful" }
|
|
669
452
|
});
|
|
670
453
|
});
|
|
671
454
|
const startSession = (input) => withThreadLock(input.threadId, effect_Effect.gen(function* () {
|
|
672
|
-
if (input.provider !== void 0 && input.provider !== PROVIDER
|
|
673
|
-
provider: PROVIDER
|
|
455
|
+
if (input.provider !== void 0 && input.provider !== PROVIDER) return yield* new require_bin.ProviderAdapterValidationError({
|
|
456
|
+
provider: PROVIDER,
|
|
674
457
|
operation: "startSession",
|
|
675
|
-
issue: `Expected provider '${PROVIDER
|
|
458
|
+
issue: `Expected provider '${PROVIDER}' but received '${input.provider}'.`
|
|
676
459
|
});
|
|
677
460
|
if (input.providerInstanceId !== void 0 && input.providerInstanceId !== boundInstanceId) return yield* new require_bin.ProviderAdapterValidationError({
|
|
678
|
-
provider: PROVIDER
|
|
461
|
+
provider: PROVIDER,
|
|
679
462
|
operation: "startSession",
|
|
680
463
|
issue: `Expected provider instance '${boundInstanceId}' but received '${input.providerInstanceId}'.`
|
|
681
464
|
});
|
|
682
|
-
const runtimeSessionId = yield*
|
|
465
|
+
const runtimeSessionId = yield* require_runtimeSession.requireRuntimeSessionId(PROVIDER, input);
|
|
683
466
|
if (!input.cwd?.trim()) return yield* new require_bin.ProviderAdapterValidationError({
|
|
684
|
-
provider: PROVIDER
|
|
467
|
+
provider: PROVIDER,
|
|
685
468
|
operation: "startSession",
|
|
686
469
|
issue: "cwd is required and must be non-empty."
|
|
687
470
|
});
|
|
688
471
|
const effectiveResumeCursor = input.resumePolicy === "fresh" ? void 0 : input.resumeCursor;
|
|
689
|
-
const
|
|
690
|
-
if (effectiveResumeCursor !== void 0 &&
|
|
691
|
-
provider: PROVIDER
|
|
472
|
+
const acpResume = effectiveResumeCursor === void 0 ? void 0 : parseAcpResume(effectiveResumeCursor);
|
|
473
|
+
if (effectiveResumeCursor !== void 0 && acpResume === void 0) return yield* new require_bin.ProviderAdapterValidationError({
|
|
474
|
+
provider: PROVIDER,
|
|
692
475
|
operation: "startSession",
|
|
693
476
|
issue: "resumeCursor must use schema version 1 and contain a non-empty sessionId."
|
|
694
477
|
});
|
|
695
478
|
const cwd = path.resolve(input.cwd.trim());
|
|
696
|
-
const
|
|
479
|
+
const acpModelSelection = input.modelSelection?.instanceId === boundInstanceId ? input.modelSelection : void 0;
|
|
697
480
|
const existing = sessions.get(input.threadId);
|
|
698
481
|
if (existing && !existing.stopped) {
|
|
699
482
|
if (existing.session.runtimeSessionId === runtimeSessionId) return existing.session;
|
|
700
483
|
return yield* new require_bin.ProviderAdapterValidationError({
|
|
701
|
-
provider: PROVIDER
|
|
484
|
+
provider: PROVIDER,
|
|
702
485
|
operation: "startSession",
|
|
703
486
|
issue: `Thread '${input.threadId}' still has runtime '${existing.session.runtimeSessionId ?? "legacy"}'; stop it before starting '${runtimeSessionId}'.`
|
|
704
487
|
});
|
|
@@ -714,14 +497,13 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
714
497
|
isTurnActive: () => ctx !== void 0 && ctx.activeTurnId !== void 0 && !ctx.stopped
|
|
715
498
|
});
|
|
716
499
|
if (deviceToolBinding) yield* effect_Scope.addFinalizer(sessionScope, effect_Effect.sync(() => deviceToolBinding.dispose()));
|
|
717
|
-
const resumeSessionId =
|
|
500
|
+
const resumeSessionId = acpResume?.sessionId;
|
|
718
501
|
const acpNativeLoggers = require_AcpNativeLogging.makeAcpNativeLoggers({
|
|
719
502
|
nativeEventLogger,
|
|
720
|
-
provider: PROVIDER
|
|
503
|
+
provider: PROVIDER,
|
|
721
504
|
threadId: input.threadId
|
|
722
505
|
});
|
|
723
|
-
const acp = yield*
|
|
724
|
-
grokSettings,
|
|
506
|
+
const acp = yield* options.makeRuntime({
|
|
725
507
|
...options?.environment ? { environment: options.environment } : {},
|
|
726
508
|
childProcessSpawner,
|
|
727
509
|
cwd,
|
|
@@ -741,22 +523,22 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
741
523
|
}] } : {},
|
|
742
524
|
...acpNativeLoggers
|
|
743
525
|
}).pipe(effect_Effect.provideService(effect_Scope.Scope, sessionScope), effect_Effect.mapError((cause) => new require_bin.ProviderAdapterProcessError({
|
|
744
|
-
provider: PROVIDER
|
|
526
|
+
provider: PROVIDER,
|
|
745
527
|
threadId: input.threadId,
|
|
746
528
|
detail: cause.message,
|
|
747
529
|
cause
|
|
748
530
|
})));
|
|
749
531
|
const started = yield* effect_Effect.gen(function* () {
|
|
750
|
-
yield* effect_Effect.forEach(["x.ai/ask_user_question", "_x.ai/ask_user_question"], (method) => acp.handleExtRequest(method, XAiAskUserQuestionRequest, (params) => mapAcpCallbackFailure(effect_Effect.gen(function* () {
|
|
532
|
+
yield* effect_Effect.forEach(options.xaiExtensions ? ["x.ai/ask_user_question", "_x.ai/ask_user_question"] : [], (method) => acp.handleExtRequest(method, XAiAskUserQuestionRequest, (params) => mapAcpCallbackFailure(effect_Effect.gen(function* () {
|
|
751
533
|
yield* logNative(input.threadId, method, params);
|
|
752
|
-
const requestId =
|
|
753
|
-
const runtimeRequestId =
|
|
534
|
+
const requestId = require_src.ApprovalRequestId.make(yield* randomUUIDv4);
|
|
535
|
+
const runtimeRequestId = require_src.RuntimeRequestId.make(requestId);
|
|
754
536
|
const resolution = yield* effect_Deferred.make();
|
|
755
537
|
pendingUserInputs.set(requestId, { resolution });
|
|
756
538
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, {
|
|
757
539
|
type: "user-input.requested",
|
|
758
540
|
...yield* makeEventStamp(),
|
|
759
|
-
provider: PROVIDER
|
|
541
|
+
provider: PROVIDER,
|
|
760
542
|
threadId: input.threadId,
|
|
761
543
|
turnId: sessions.get(input.threadId)?.activeTurnId,
|
|
762
544
|
requestId: runtimeRequestId,
|
|
@@ -773,7 +555,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
773
555
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, {
|
|
774
556
|
type: "user-input.resolved",
|
|
775
557
|
...yield* makeEventStamp(),
|
|
776
|
-
provider: PROVIDER
|
|
558
|
+
provider: PROVIDER,
|
|
777
559
|
threadId: input.threadId,
|
|
778
560
|
turnId: sessions.get(input.threadId)?.activeTurnId,
|
|
779
561
|
requestId: runtimeRequestId,
|
|
@@ -798,14 +580,14 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
798
580
|
optionId: autoApprovedOptionId
|
|
799
581
|
} };
|
|
800
582
|
}
|
|
801
|
-
const permissionRequest =
|
|
802
|
-
const requestId =
|
|
803
|
-
const runtimeRequestId =
|
|
583
|
+
const permissionRequest = require_bin.parsePermissionRequest(params);
|
|
584
|
+
const requestId = require_src.ApprovalRequestId.make(yield* randomUUIDv4);
|
|
585
|
+
const runtimeRequestId = require_src.RuntimeRequestId.make(requestId);
|
|
804
586
|
const decision = yield* effect_Deferred.make();
|
|
805
587
|
pendingApprovals.set(requestId, { decision });
|
|
806
588
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpRequestOpenedEvent({
|
|
807
589
|
stamp: yield* makeEventStamp(),
|
|
808
|
-
provider: PROVIDER
|
|
590
|
+
provider: PROVIDER,
|
|
809
591
|
threadId: input.threadId,
|
|
810
592
|
turnId: sessions.get(input.threadId)?.activeTurnId,
|
|
811
593
|
requestId: runtimeRequestId,
|
|
@@ -820,7 +602,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
820
602
|
pendingApprovals.delete(requestId);
|
|
821
603
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpRequestResolvedEvent({
|
|
822
604
|
stamp: yield* makeEventStamp(),
|
|
823
|
-
provider: PROVIDER
|
|
605
|
+
provider: PROVIDER,
|
|
824
606
|
threadId: input.threadId,
|
|
825
607
|
turnId: sessions.get(input.threadId)?.activeTurnId,
|
|
826
608
|
requestId: runtimeRequestId,
|
|
@@ -834,27 +616,28 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
834
616
|
} : { outcome: "cancelled" } };
|
|
835
617
|
})));
|
|
836
618
|
return yield* acp.start();
|
|
837
|
-
}).pipe(effect_Effect.mapError((error) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER
|
|
838
|
-
|
|
839
|
-
const
|
|
619
|
+
}).pipe(effect_Effect.mapError((error) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER, input.threadId, "session/start", error)));
|
|
620
|
+
if (options.onStarted) yield* options.onStarted(started);
|
|
621
|
+
const requestedStartModelId = acpModelSelection?.model ? normalizeModel(acpModelSelection.model) : void 0;
|
|
622
|
+
const boundModelId = yield* applyAcpModelSelection({
|
|
840
623
|
runtime: acp,
|
|
841
|
-
currentModelId:
|
|
842
|
-
requestedModelId: requestedStartModelId,
|
|
843
|
-
mapError: (cause) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER
|
|
624
|
+
currentModelId: currentAcpModelIdFromSessionSetup(started.sessionSetupResult),
|
|
625
|
+
requestedModelId: requestedStartModelId || void 0,
|
|
626
|
+
mapError: (cause) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER, input.threadId, "session/set_model", cause)
|
|
844
627
|
});
|
|
845
628
|
const now = yield* nowIso;
|
|
846
629
|
const session = {
|
|
847
|
-
provider: PROVIDER
|
|
630
|
+
provider: PROVIDER,
|
|
848
631
|
providerInstanceId: boundInstanceId,
|
|
849
632
|
runtimeSessionId,
|
|
850
633
|
status: "ready",
|
|
851
634
|
runtimeMode: input.runtimeMode,
|
|
852
635
|
tokenMode: input.tokenMode ?? "balanced",
|
|
853
636
|
cwd,
|
|
854
|
-
...boundModelId ? { model:
|
|
637
|
+
...boundModelId ? { model: normalizeModel(boundModelId) } : {},
|
|
855
638
|
threadId: input.threadId,
|
|
856
639
|
resumeCursor: {
|
|
857
|
-
schemaVersion:
|
|
640
|
+
schemaVersion: ACP_RESUME_VERSION,
|
|
858
641
|
sessionId: started.sessionId
|
|
859
642
|
},
|
|
860
643
|
createdAt: now,
|
|
@@ -874,14 +657,18 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
874
657
|
lastPlanFingerprint: void 0,
|
|
875
658
|
activeTurnId: void 0,
|
|
876
659
|
currentModelId: boundModelId,
|
|
660
|
+
promptImages: started.initializeResult.agentCapabilities?.promptCapabilities?.image === true,
|
|
877
661
|
stopped: false
|
|
878
662
|
};
|
|
879
663
|
const nf = yield* effect_Stream.runDrain(effect_Stream.mapEffect(acp.getEvents(), (event) => effect_Effect.gen(function* () {
|
|
880
664
|
switch (event._tag) {
|
|
665
|
+
case "CommandsUpdated":
|
|
666
|
+
if (options.onCommands) yield* options.onCommands(event.commands);
|
|
667
|
+
return;
|
|
881
668
|
case "AssistantItemStarted":
|
|
882
669
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpAssistantItemEvent({
|
|
883
670
|
stamp: yield* makeEventStamp(),
|
|
884
|
-
provider: PROVIDER
|
|
671
|
+
provider: PROVIDER,
|
|
885
672
|
threadId: ctx.threadId,
|
|
886
673
|
turnId: ctx.activeTurnId,
|
|
887
674
|
itemId: event.itemId,
|
|
@@ -891,7 +678,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
891
678
|
case "AssistantItemCompleted":
|
|
892
679
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpAssistantItemEvent({
|
|
893
680
|
stamp: yield* makeEventStamp(),
|
|
894
|
-
provider: PROVIDER
|
|
681
|
+
provider: PROVIDER,
|
|
895
682
|
threadId: ctx.threadId,
|
|
896
683
|
turnId: ctx.activeTurnId,
|
|
897
684
|
itemId: event.itemId,
|
|
@@ -906,14 +693,14 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
906
693
|
yield* logNative(ctx.threadId, "session/update", event.rawPayload);
|
|
907
694
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpToolCallEvent({
|
|
908
695
|
stamp: yield* makeEventStamp(),
|
|
909
|
-
provider: PROVIDER
|
|
696
|
+
provider: PROVIDER,
|
|
910
697
|
threadId: ctx.threadId,
|
|
911
698
|
turnId: ctx.activeTurnId,
|
|
912
699
|
toolCall: event.toolCall,
|
|
913
700
|
rawPayload: event.rawPayload
|
|
914
701
|
}));
|
|
915
702
|
for (const subagentEvent of yield* ctx.subagentEvents({
|
|
916
|
-
provider: PROVIDER
|
|
703
|
+
provider: PROVIDER,
|
|
917
704
|
threadId: ctx.threadId,
|
|
918
705
|
turnId: ctx.activeTurnId,
|
|
919
706
|
state: event.toolCall.subagent,
|
|
@@ -925,7 +712,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
925
712
|
yield* logNative(ctx.threadId, "session/update", event.rawPayload);
|
|
926
713
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpContentDeltaEvent({
|
|
927
714
|
stamp: yield* makeEventStamp(),
|
|
928
|
-
provider: PROVIDER
|
|
715
|
+
provider: PROVIDER,
|
|
929
716
|
threadId: ctx.threadId,
|
|
930
717
|
turnId: ctx.activeTurnId,
|
|
931
718
|
...event.itemId ? { itemId: event.itemId } : {},
|
|
@@ -937,7 +724,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
937
724
|
yield* logNative(ctx.threadId, "session/update", event.rawPayload);
|
|
938
725
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpThoughtDeltaEvent({
|
|
939
726
|
stamp: yield* makeEventStamp(),
|
|
940
|
-
provider: PROVIDER
|
|
727
|
+
provider: PROVIDER,
|
|
941
728
|
threadId: ctx.threadId,
|
|
942
729
|
turnId: ctx.activeTurnId,
|
|
943
730
|
text: event.text,
|
|
@@ -945,10 +732,11 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
945
732
|
}));
|
|
946
733
|
return;
|
|
947
734
|
case "UsageUpdated":
|
|
735
|
+
if (options.onUsage) yield* options.onUsage();
|
|
948
736
|
yield* logNative(ctx.threadId, "session/update", event.rawPayload);
|
|
949
737
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, require_AcpNativeLogging.makeAcpTokenUsageEvent({
|
|
950
738
|
stamp: yield* makeEventStamp(),
|
|
951
|
-
provider: PROVIDER
|
|
739
|
+
provider: PROVIDER,
|
|
952
740
|
threadId: ctx.threadId,
|
|
953
741
|
turnId: ctx.activeTurnId,
|
|
954
742
|
usage: event.usage,
|
|
@@ -963,24 +751,24 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
963
751
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, {
|
|
964
752
|
type: "session.started",
|
|
965
753
|
...yield* makeEventStamp(),
|
|
966
|
-
provider: PROVIDER
|
|
754
|
+
provider: PROVIDER,
|
|
967
755
|
threadId: input.threadId,
|
|
968
756
|
payload: { resume: started.initializeResult }
|
|
969
757
|
});
|
|
970
758
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, {
|
|
971
759
|
type: "session.state.changed",
|
|
972
760
|
...yield* makeEventStamp(),
|
|
973
|
-
provider: PROVIDER
|
|
761
|
+
provider: PROVIDER,
|
|
974
762
|
threadId: input.threadId,
|
|
975
763
|
payload: {
|
|
976
764
|
state: "ready",
|
|
977
|
-
reason: "
|
|
765
|
+
reason: "ACP session ready"
|
|
978
766
|
}
|
|
979
767
|
});
|
|
980
768
|
yield* offerRuntimeEventForRuntime(runtimeSessionId, {
|
|
981
769
|
type: "thread.started",
|
|
982
770
|
...yield* makeEventStamp(),
|
|
983
|
-
provider: PROVIDER
|
|
771
|
+
provider: PROVIDER,
|
|
984
772
|
threadId: input.threadId,
|
|
985
773
|
payload: { providerThreadId: started.sessionId }
|
|
986
774
|
});
|
|
@@ -989,18 +777,18 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
989
777
|
const sendTurn = (input) => effect_Effect.gen(function* () {
|
|
990
778
|
const prepared = yield* withThreadLock(input.threadId, effect_Effect.gen(function* () {
|
|
991
779
|
const ctx = yield* requireSession(input.threadId);
|
|
992
|
-
const turnId =
|
|
780
|
+
const turnId = require_src.TurnId.make(yield* randomUUIDv4);
|
|
993
781
|
const turnModelSelection = input.modelSelection?.instanceId === boundInstanceId ? input.modelSelection : void 0;
|
|
994
|
-
const requestedTurnModelId = turnModelSelection?.model ?
|
|
995
|
-
const currentModelId = yield*
|
|
782
|
+
const requestedTurnModelId = turnModelSelection?.model ? normalizeModel(turnModelSelection.model) : void 0;
|
|
783
|
+
const currentModelId = yield* applyAcpModelSelection({
|
|
996
784
|
runtime: ctx.acp,
|
|
997
785
|
currentModelId: ctx.currentModelId,
|
|
998
|
-
requestedModelId: requestedTurnModelId,
|
|
999
|
-
mapError: (cause) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER
|
|
786
|
+
requestedModelId: requestedTurnModelId || void 0,
|
|
787
|
+
mapError: (cause) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER, input.threadId, "session/set_model", cause)
|
|
1000
788
|
});
|
|
1001
789
|
const pathLineEntries = [];
|
|
1002
790
|
const imagePromptParts = yield* effect_Effect.forEach(input.attachments ?? [], (attachment) => effect_Effect.gen(function* () {
|
|
1003
|
-
if (!require_bin.isPersistableChatAttachment(attachment) || attachment.type !== "image") {
|
|
791
|
+
if (!require_bin.isPersistableChatAttachment(attachment) || attachment.type !== "image" || options.respectPromptCapabilities && !ctx.promptImages) {
|
|
1004
792
|
pathLineEntries.push({
|
|
1005
793
|
attachment,
|
|
1006
794
|
...attachment.id === void 0 ? {} : { resolvedPath: require_bin.resolveAttachmentPath({
|
|
@@ -1015,12 +803,12 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1015
803
|
attachment
|
|
1016
804
|
});
|
|
1017
805
|
if (!attachmentPath) return yield* new require_bin.ProviderAdapterRequestError({
|
|
1018
|
-
provider: PROVIDER
|
|
806
|
+
provider: PROVIDER,
|
|
1019
807
|
method: "session/prompt",
|
|
1020
808
|
detail: `Invalid attachment id '${attachment.id}'.`
|
|
1021
809
|
});
|
|
1022
810
|
const bytes = yield* fileSystem.readFile(attachmentPath).pipe(effect_Effect.mapError((cause) => new require_bin.ProviderAdapterRequestError({
|
|
1023
|
-
provider: PROVIDER
|
|
811
|
+
provider: PROVIDER,
|
|
1024
812
|
method: "session/prompt",
|
|
1025
813
|
detail: cause.message,
|
|
1026
814
|
cause
|
|
@@ -1031,18 +819,18 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1031
819
|
mimeType: attachment.mimeType
|
|
1032
820
|
};
|
|
1033
821
|
}));
|
|
1034
|
-
const promptText =
|
|
822
|
+
const promptText = require_runtimeSession.appendAttachmentPathLines(input.input?.trim(), require_runtimeSession.formatAttachmentPathLines(pathLineEntries));
|
|
1035
823
|
const promptParts = [...promptText && promptText.trim().length > 0 ? [{
|
|
1036
824
|
type: "text",
|
|
1037
825
|
text: promptText
|
|
1038
826
|
}] : [], ...imagePromptParts.filter((part) => part !== null)];
|
|
1039
827
|
if (promptParts.length === 0) return yield* new require_bin.ProviderAdapterValidationError({
|
|
1040
|
-
provider: PROVIDER
|
|
828
|
+
provider: PROVIDER,
|
|
1041
829
|
operation: "sendTurn",
|
|
1042
830
|
issue: "Turn requires non-empty text or attachments."
|
|
1043
831
|
});
|
|
1044
832
|
ctx.currentModelId = currentModelId;
|
|
1045
|
-
const displayModel = currentModelId ?
|
|
833
|
+
const displayModel = currentModelId ? normalizeModel(currentModelId) : void 0;
|
|
1046
834
|
ctx.activeTurnId = turnId;
|
|
1047
835
|
ctx.lastPlanFingerprint = void 0;
|
|
1048
836
|
ctx.session = {
|
|
@@ -1054,7 +842,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1054
842
|
yield* offerRuntimeEventForRuntime(ctx.session.runtimeSessionId, {
|
|
1055
843
|
type: "turn.started",
|
|
1056
844
|
...yield* makeEventStamp(),
|
|
1057
|
-
provider: PROVIDER
|
|
845
|
+
provider: PROVIDER,
|
|
1058
846
|
threadId: input.threadId,
|
|
1059
847
|
turnId,
|
|
1060
848
|
payload: displayModel ? { model: displayModel } : {}
|
|
@@ -1067,13 +855,13 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1067
855
|
turnId
|
|
1068
856
|
};
|
|
1069
857
|
}));
|
|
1070
|
-
const result = yield* prepared.acp.prompt({ prompt: prepared.promptParts }).pipe(effect_Effect.mapError((error) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER
|
|
858
|
+
const result = yield* prepared.acp.prompt({ prompt: prepared.promptParts }).pipe(effect_Effect.mapError((error) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER, input.threadId, "session/prompt", error)));
|
|
1071
859
|
return yield* withThreadLock(input.threadId, effect_Effect.gen(function* () {
|
|
1072
860
|
const ctx = yield* requireSession(input.threadId);
|
|
1073
861
|
if (ctx.acpSessionId !== prepared.acpSessionId) return yield* new require_bin.ProviderAdapterRequestError({
|
|
1074
|
-
provider: PROVIDER
|
|
862
|
+
provider: PROVIDER,
|
|
1075
863
|
method: "session/prompt",
|
|
1076
|
-
detail: "
|
|
864
|
+
detail: "ACP session changed before the turn completed."
|
|
1077
865
|
});
|
|
1078
866
|
ctx.turns = [...ctx.turns, {
|
|
1079
867
|
id: prepared.turnId,
|
|
@@ -1091,7 +879,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1091
879
|
yield* offerRuntimeEventForRuntime(ctx.session.runtimeSessionId, {
|
|
1092
880
|
type: "turn.completed",
|
|
1093
881
|
...yield* makeEventStamp(),
|
|
1094
|
-
provider: PROVIDER
|
|
882
|
+
provider: PROVIDER,
|
|
1095
883
|
threadId: input.threadId,
|
|
1096
884
|
turnId: prepared.turnId,
|
|
1097
885
|
payload: {
|
|
@@ -1110,12 +898,12 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1110
898
|
const ctx = yield* requireSession(threadId);
|
|
1111
899
|
yield* settlePendingApprovalsAsCancelled(ctx.pendingApprovals);
|
|
1112
900
|
yield* settlePendingUserInputsAsCancelled(ctx.pendingUserInputs);
|
|
1113
|
-
yield* effect_Effect.ignore(ctx.acp.cancel.pipe(effect_Effect.mapError((error) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER
|
|
901
|
+
yield* effect_Effect.ignore(ctx.acp.cancel.pipe(effect_Effect.mapError((error) => require_AcpNativeLogging.mapAcpToAdapterError(PROVIDER, threadId, "session/cancel", error))));
|
|
1114
902
|
});
|
|
1115
903
|
const respondToRequest = (threadId, requestId, decision) => effect_Effect.gen(function* () {
|
|
1116
904
|
const pending = (yield* requireSession(threadId)).pendingApprovals.get(requestId);
|
|
1117
905
|
if (!pending) return yield* new require_bin.ProviderAdapterRequestError({
|
|
1118
|
-
provider: PROVIDER
|
|
906
|
+
provider: PROVIDER,
|
|
1119
907
|
method: "session/request_permission",
|
|
1120
908
|
detail: `Unknown pending approval request: ${requestId}`
|
|
1121
909
|
});
|
|
@@ -1124,7 +912,7 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1124
912
|
const respondToUserInput = (threadId, requestId, answers) => effect_Effect.gen(function* () {
|
|
1125
913
|
const pending = (yield* requireSession(threadId)).pendingUserInputs.get(requestId);
|
|
1126
914
|
if (!pending) return yield* new require_bin.ProviderAdapterRequestError({
|
|
1127
|
-
provider: PROVIDER
|
|
915
|
+
provider: PROVIDER,
|
|
1128
916
|
method: "_x.ai/ask_user_question",
|
|
1129
917
|
detail: `Unknown pending user-input request: ${requestId}`
|
|
1130
918
|
});
|
|
@@ -1142,14 +930,14 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1142
930
|
const rollbackThread = (threadId, numTurns) => effect_Effect.gen(function* () {
|
|
1143
931
|
yield* requireSession(threadId);
|
|
1144
932
|
if (!Number.isInteger(numTurns) || numTurns < 1) return yield* new require_bin.ProviderAdapterValidationError({
|
|
1145
|
-
provider: PROVIDER
|
|
933
|
+
provider: PROVIDER,
|
|
1146
934
|
operation: "rollbackThread",
|
|
1147
935
|
issue: "numTurns must be an integer >= 1."
|
|
1148
936
|
});
|
|
1149
937
|
return yield* new require_bin.ProviderAdapterRequestError({
|
|
1150
|
-
provider: PROVIDER
|
|
938
|
+
provider: PROVIDER,
|
|
1151
939
|
method: "thread/rollback",
|
|
1152
|
-
detail: "
|
|
940
|
+
detail: "ACP sessions do not support provider-side rollback yet."
|
|
1153
941
|
});
|
|
1154
942
|
});
|
|
1155
943
|
const stopSession = (threadId) => withThreadLock(threadId, effect_Effect.gen(function* () {
|
|
@@ -1165,8 +953,10 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1165
953
|
yield* effect_Effect.addFinalizer(() => effect_Effect.ignore(stopAll()).pipe(effect_Effect.tap(() => effect_PubSub.shutdown(runtimeEventPubSub)), effect_Effect.tap(() => managedNativeEventLogger?.close() ?? effect_Effect.void)));
|
|
1166
954
|
const streamEvents = effect_Stream.fromPubSub(runtimeEventPubSub);
|
|
1167
955
|
return {
|
|
1168
|
-
provider: PROVIDER
|
|
1169
|
-
capabilities: { sessionModelSwitch
|
|
956
|
+
provider: PROVIDER,
|
|
957
|
+
capabilities: { get sessionModelSwitch() {
|
|
958
|
+
return options.getSessionModelSwitch?.() ?? "unsupported";
|
|
959
|
+
} },
|
|
1170
960
|
startSession,
|
|
1171
961
|
sendTurn,
|
|
1172
962
|
interruptTurn,
|
|
@@ -1183,300 +973,27 @@ function makeGrokAdapter(grokSettings, options) {
|
|
|
1183
973
|
});
|
|
1184
974
|
}
|
|
1185
975
|
//#endregion
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
showInteractionModeToggle: false
|
|
1191
|
-
};
|
|
1192
|
-
const PROVIDER = require_collectUint8StreamText.ProviderDriverKind.make("grok");
|
|
1193
|
-
const EMPTY_CAPABILITIES = require_bin.createModelCapabilities({ optionDescriptors: [] });
|
|
1194
|
-
const VERSION_PROBE_TIMEOUT_MS = 4e3;
|
|
1195
|
-
const GROK_ACP_MODEL_DISCOVERY_TIMEOUT_MS = 15e3;
|
|
1196
|
-
const GROK_BUILT_IN_MODELS = [{
|
|
1197
|
-
slug: "grok-build",
|
|
1198
|
-
name: "Grok Build",
|
|
1199
|
-
isCustom: false,
|
|
1200
|
-
capabilities: EMPTY_CAPABILITIES
|
|
1201
|
-
}];
|
|
1202
|
-
function buildInitialGrokProviderSnapshot(grokSettings) {
|
|
1203
|
-
const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1204
|
-
const models = grokModelsFromSettings(grokSettings.customModels);
|
|
1205
|
-
if (!grokSettings.enabled) return require_bin.buildServerProvider({
|
|
1206
|
-
presentation: GROK_PRESENTATION,
|
|
1207
|
-
enabled: false,
|
|
1208
|
-
checkedAt,
|
|
1209
|
-
models,
|
|
1210
|
-
probe: {
|
|
1211
|
-
installed: false,
|
|
1212
|
-
version: null,
|
|
1213
|
-
status: "warning",
|
|
1214
|
-
auth: { status: "unknown" },
|
|
1215
|
-
message: "Grok is disabled in Ryco settings."
|
|
1216
|
-
}
|
|
1217
|
-
});
|
|
1218
|
-
return require_bin.buildServerProvider({
|
|
1219
|
-
presentation: GROK_PRESENTATION,
|
|
1220
|
-
enabled: true,
|
|
1221
|
-
checkedAt,
|
|
1222
|
-
models,
|
|
1223
|
-
probe: {
|
|
1224
|
-
installed: true,
|
|
1225
|
-
version: null,
|
|
1226
|
-
status: "warning",
|
|
1227
|
-
auth: { status: "unknown" },
|
|
1228
|
-
message: "Checking Grok CLI availability..."
|
|
1229
|
-
}
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
function grokModelsFromSettings(customModels, builtInModels = GROK_BUILT_IN_MODELS) {
|
|
1233
|
-
return require_bin.providerModelsFromSettings(builtInModels, PROVIDER, customModels ?? [], EMPTY_CAPABILITIES);
|
|
1234
|
-
}
|
|
1235
|
-
function buildGrokDiscoveredModelsFromSessionModelState(modelState) {
|
|
1236
|
-
if (!modelState || modelState.availableModels.length === 0) return [];
|
|
1237
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1238
|
-
return modelState.availableModels.map((model) => {
|
|
1239
|
-
const slug = resolveGrokAcpBaseModelId(model.modelId);
|
|
1240
|
-
if (!slug || seen.has(slug)) return;
|
|
1241
|
-
seen.add(slug);
|
|
1242
|
-
return {
|
|
1243
|
-
slug,
|
|
1244
|
-
name: model.name.trim() || slug,
|
|
1245
|
-
isCustom: false,
|
|
1246
|
-
capabilities: EMPTY_CAPABILITIES
|
|
1247
|
-
};
|
|
1248
|
-
}).filter((model) => model !== void 0);
|
|
1249
|
-
}
|
|
1250
|
-
const discoverGrokModelsViaAcp = (grokSettings, environment = process.env) => effect_Effect.gen(function* () {
|
|
1251
|
-
const childProcessSpawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
|
|
1252
|
-
return buildGrokDiscoveredModelsFromSessionModelState((yield* (yield* makeGrokAcpRuntime({
|
|
1253
|
-
grokSettings,
|
|
1254
|
-
environment,
|
|
1255
|
-
childProcessSpawner,
|
|
1256
|
-
cwd: process.cwd(),
|
|
1257
|
-
clientInfo: {
|
|
1258
|
-
name: "ryco-provider-probe",
|
|
1259
|
-
version: "0.0.0"
|
|
1260
|
-
}
|
|
1261
|
-
})).start()).sessionSetupResult.models);
|
|
1262
|
-
}).pipe(effect_Effect.scoped);
|
|
1263
|
-
const runGrokVersionCommand = (grokSettings, environment = process.env) => {
|
|
1264
|
-
const command = grokSettings.binaryPath || "grok";
|
|
1265
|
-
return require_bin.spawnAndCollect(command, effect_unstable_process.ChildProcess.make(command, ["--version"], {
|
|
1266
|
-
env: environment,
|
|
1267
|
-
shell: process.platform === "win32"
|
|
1268
|
-
}));
|
|
1269
|
-
};
|
|
1270
|
-
const checkGrokProviderStatus = effect_Effect.fn("checkGrokProviderStatus")(function* (grokSettings, environment = process.env) {
|
|
1271
|
-
const checkedAt = effect_DateTime.formatIso(yield* effect_DateTime.now);
|
|
1272
|
-
const fallbackModels = grokModelsFromSettings(grokSettings.customModels);
|
|
1273
|
-
if (!grokSettings.enabled) return require_bin.buildServerProvider({
|
|
1274
|
-
presentation: GROK_PRESENTATION,
|
|
1275
|
-
enabled: false,
|
|
1276
|
-
checkedAt,
|
|
1277
|
-
models: fallbackModels,
|
|
1278
|
-
probe: {
|
|
1279
|
-
installed: false,
|
|
1280
|
-
version: null,
|
|
1281
|
-
status: "warning",
|
|
1282
|
-
auth: { status: "unknown" },
|
|
1283
|
-
message: "Grok is disabled in Ryco settings."
|
|
1284
|
-
}
|
|
1285
|
-
});
|
|
1286
|
-
const versionResult = yield* runGrokVersionCommand(grokSettings, environment).pipe(effect_Effect.timeoutOption(VERSION_PROBE_TIMEOUT_MS), effect_Effect.result);
|
|
1287
|
-
if (effect_Result.isFailure(versionResult)) {
|
|
1288
|
-
const error = versionResult.failure;
|
|
1289
|
-
yield* effect_Effect.logWarning("Grok CLI health check failed.", { errorTag: error.name });
|
|
1290
|
-
return require_bin.buildServerProvider({
|
|
1291
|
-
presentation: GROK_PRESENTATION,
|
|
1292
|
-
enabled: grokSettings.enabled,
|
|
1293
|
-
checkedAt,
|
|
1294
|
-
models: fallbackModels,
|
|
1295
|
-
probe: {
|
|
1296
|
-
installed: !require_bin.isCommandMissingCause(error),
|
|
1297
|
-
version: null,
|
|
1298
|
-
status: "error",
|
|
1299
|
-
auth: { status: "unknown" },
|
|
1300
|
-
message: require_bin.isCommandMissingCause(error) ? "Grok CLI (`grok`) is not installed or not on PATH." : "Failed to execute Grok CLI health check."
|
|
1301
|
-
}
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1304
|
-
if (effect_Option.isNone(versionResult.success)) return require_bin.buildServerProvider({
|
|
1305
|
-
presentation: GROK_PRESENTATION,
|
|
1306
|
-
enabled: grokSettings.enabled,
|
|
1307
|
-
checkedAt,
|
|
1308
|
-
models: fallbackModels,
|
|
1309
|
-
probe: {
|
|
1310
|
-
installed: true,
|
|
1311
|
-
version: null,
|
|
1312
|
-
status: "error",
|
|
1313
|
-
auth: { status: "unknown" },
|
|
1314
|
-
message: "Grok CLI is installed but timed out while running `grok --version`."
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
const versionOutput = versionResult.success.value;
|
|
1318
|
-
const version = require_bin.parseGenericCliVersion(`${versionOutput.stdout}\n${versionOutput.stderr}`);
|
|
1319
|
-
if (versionOutput.code !== 0) {
|
|
1320
|
-
yield* effect_Effect.logWarning("Grok CLI version probe exited with a non-zero status.", {
|
|
1321
|
-
exitCode: versionOutput.code,
|
|
1322
|
-
stdoutLength: versionOutput.stdout.length,
|
|
1323
|
-
stderrLength: versionOutput.stderr.length
|
|
1324
|
-
});
|
|
1325
|
-
return require_bin.buildServerProvider({
|
|
1326
|
-
presentation: GROK_PRESENTATION,
|
|
1327
|
-
enabled: grokSettings.enabled,
|
|
1328
|
-
checkedAt,
|
|
1329
|
-
models: fallbackModels,
|
|
1330
|
-
probe: {
|
|
1331
|
-
installed: true,
|
|
1332
|
-
version,
|
|
1333
|
-
status: "error",
|
|
1334
|
-
auth: { status: "unknown" },
|
|
1335
|
-
message: "Grok CLI is installed but failed to run."
|
|
1336
|
-
}
|
|
1337
|
-
});
|
|
976
|
+
Object.defineProperty(exports, "applyAcpModelSelection", {
|
|
977
|
+
enumerable: true,
|
|
978
|
+
get: function() {
|
|
979
|
+
return applyAcpModelSelection;
|
|
1338
980
|
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
enabled: grokSettings.enabled,
|
|
1345
|
-
checkedAt,
|
|
1346
|
-
models: fallbackModels,
|
|
1347
|
-
probe: {
|
|
1348
|
-
installed: true,
|
|
1349
|
-
version,
|
|
1350
|
-
status: "error",
|
|
1351
|
-
auth: { status: "unknown" },
|
|
1352
|
-
message: "Grok CLI is installed but ACP startup failed. Check server logs for details."
|
|
1353
|
-
}
|
|
1354
|
-
});
|
|
981
|
+
});
|
|
982
|
+
Object.defineProperty(exports, "currentAcpModelIdFromSessionSetup", {
|
|
983
|
+
enumerable: true,
|
|
984
|
+
get: function() {
|
|
985
|
+
return currentAcpModelIdFromSessionSetup;
|
|
1355
986
|
}
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
checkedAt,
|
|
1362
|
-
models: fallbackModels,
|
|
1363
|
-
probe: {
|
|
1364
|
-
installed: true,
|
|
1365
|
-
version,
|
|
1366
|
-
status: "error",
|
|
1367
|
-
auth: { status: "unknown" },
|
|
1368
|
-
message: `Grok CLI is installed but ACP startup timed out after ${GROK_ACP_MODEL_DISCOVERY_TIMEOUT_MS}ms.`
|
|
1369
|
-
}
|
|
1370
|
-
});
|
|
987
|
+
});
|
|
988
|
+
Object.defineProperty(exports, "makeAcpAdapter", {
|
|
989
|
+
enumerable: true,
|
|
990
|
+
get: function() {
|
|
991
|
+
return makeAcpAdapter;
|
|
1371
992
|
}
|
|
1372
|
-
const discoveredModels = discoveryExit.value.value;
|
|
1373
|
-
const models = discoveredModels.length > 0 ? grokModelsFromSettings(grokSettings.customModels, discoveredModels) : fallbackModels;
|
|
1374
|
-
return require_bin.buildServerProvider({
|
|
1375
|
-
presentation: GROK_PRESENTATION,
|
|
1376
|
-
enabled: grokSettings.enabled,
|
|
1377
|
-
checkedAt,
|
|
1378
|
-
models,
|
|
1379
|
-
probe: {
|
|
1380
|
-
installed: true,
|
|
1381
|
-
version,
|
|
1382
|
-
status: "ready",
|
|
1383
|
-
auth: { status: "unknown" }
|
|
1384
|
-
}
|
|
1385
|
-
});
|
|
1386
993
|
});
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
//#region src/provider/Drivers/GrokDriver.ts
|
|
1393
|
-
const decodeGrokSettings = effect_Schema.decodeSync(require_collectUint8StreamText.GrokSettings);
|
|
1394
|
-
const DRIVER_KIND = require_collectUint8StreamText.ProviderDriverKind.make("grok");
|
|
1395
|
-
const SNAPSHOT_REFRESH_INTERVAL = effect_Duration.minutes(5);
|
|
1396
|
-
const UPDATE = require_bin.makeStaticProviderMaintenanceResolver(require_bin.makeManualOnlyProviderMaintenanceCapabilities({
|
|
1397
|
-
provider: DRIVER_KIND,
|
|
1398
|
-
packageName: null
|
|
1399
|
-
}));
|
|
1400
|
-
const withInstanceIdentity = (input) => (snapshot) => ({
|
|
1401
|
-
...snapshot,
|
|
1402
|
-
instanceId: input.instanceId,
|
|
1403
|
-
driver: DRIVER_KIND,
|
|
1404
|
-
...input.displayName ? { displayName: input.displayName } : {},
|
|
1405
|
-
...input.accentColor ? { accentColor: input.accentColor } : {},
|
|
1406
|
-
continuation: { groupKey: input.continuationGroupKey }
|
|
994
|
+
Object.defineProperty(exports, "makeXAiPromptCompletionRuntime", {
|
|
995
|
+
enumerable: true,
|
|
996
|
+
get: function() {
|
|
997
|
+
return makeXAiPromptCompletionRuntime;
|
|
998
|
+
}
|
|
1407
999
|
});
|
|
1408
|
-
const GrokDriver = {
|
|
1409
|
-
driverKind: DRIVER_KIND,
|
|
1410
|
-
metadata: {
|
|
1411
|
-
displayName: "Grok",
|
|
1412
|
-
supportsMultipleInstances: true
|
|
1413
|
-
},
|
|
1414
|
-
configSchema: require_collectUint8StreamText.GrokSettings,
|
|
1415
|
-
defaultConfig: () => decodeGrokSettings({}),
|
|
1416
|
-
create: ({ instanceId, displayName, accentColor, environment, enabled, config }) => effect_Effect.gen(function* () {
|
|
1417
|
-
const spawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
|
|
1418
|
-
const httpClient = yield* effect_unstable_http.HttpClient.HttpClient;
|
|
1419
|
-
const serverSettings = yield* require_bin.ServerSettingsService;
|
|
1420
|
-
const eventLoggers = yield* require_bin.ProviderEventLoggers;
|
|
1421
|
-
const processEnv = require_bin.mergeProviderInstanceEnvironment(environment);
|
|
1422
|
-
const continuationIdentity = require_ProviderDriver.defaultProviderContinuationIdentity({
|
|
1423
|
-
driverKind: DRIVER_KIND,
|
|
1424
|
-
instanceId
|
|
1425
|
-
});
|
|
1426
|
-
const stampIdentity = withInstanceIdentity({
|
|
1427
|
-
instanceId,
|
|
1428
|
-
displayName,
|
|
1429
|
-
accentColor,
|
|
1430
|
-
continuationGroupKey: continuationIdentity.continuationKey
|
|
1431
|
-
});
|
|
1432
|
-
const effectiveConfig = {
|
|
1433
|
-
...config,
|
|
1434
|
-
enabled
|
|
1435
|
-
};
|
|
1436
|
-
const maintenanceCapabilities = yield* require_bin.resolveProviderMaintenanceCapabilitiesEffect(UPDATE, {
|
|
1437
|
-
binaryPath: effectiveConfig.binaryPath,
|
|
1438
|
-
env: processEnv
|
|
1439
|
-
});
|
|
1440
|
-
const adapter = yield* makeGrokAdapter(effectiveConfig, {
|
|
1441
|
-
environment: processEnv,
|
|
1442
|
-
...eventLoggers.native ? { nativeEventLogger: eventLoggers.native } : {},
|
|
1443
|
-
instanceId
|
|
1444
|
-
});
|
|
1445
|
-
const textGeneration = yield* makeGrokTextGeneration(effectiveConfig, processEnv);
|
|
1446
|
-
const checkProvider = checkGrokProviderStatus(effectiveConfig, processEnv).pipe(effect_Effect.map(stampIdentity), effect_Effect.provideService(effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner, spawner));
|
|
1447
|
-
const snapshot = yield* require_makeManagedServerProvider.makeManagedServerProvider({
|
|
1448
|
-
maintenanceCapabilities,
|
|
1449
|
-
getSettings: effect_Effect.succeed(effectiveConfig),
|
|
1450
|
-
streamSettings: effect_Stream.never,
|
|
1451
|
-
haveSettingsChanged: () => false,
|
|
1452
|
-
initialSnapshot: (settings) => stampIdentity(buildInitialGrokProviderSnapshot(settings)),
|
|
1453
|
-
checkProvider,
|
|
1454
|
-
enrichSnapshot: ({ snapshot: currentSnapshot, publishSnapshot }) => enrichGrokSnapshot({
|
|
1455
|
-
snapshot: currentSnapshot,
|
|
1456
|
-
maintenanceCapabilities,
|
|
1457
|
-
publishSnapshot,
|
|
1458
|
-
httpClient,
|
|
1459
|
-
serverSettings
|
|
1460
|
-
}),
|
|
1461
|
-
refreshInterval: SNAPSHOT_REFRESH_INTERVAL
|
|
1462
|
-
}).pipe(effect_Effect.mapError((cause) => new require_bin.ProviderDriverError({
|
|
1463
|
-
driver: DRIVER_KIND,
|
|
1464
|
-
instanceId,
|
|
1465
|
-
detail: `Failed to build Grok snapshot: ${cause.message ?? String(cause)}`,
|
|
1466
|
-
cause
|
|
1467
|
-
})));
|
|
1468
|
-
return {
|
|
1469
|
-
instanceId,
|
|
1470
|
-
driverKind: DRIVER_KIND,
|
|
1471
|
-
continuationIdentity,
|
|
1472
|
-
displayName,
|
|
1473
|
-
accentColor,
|
|
1474
|
-
enabled,
|
|
1475
|
-
snapshot,
|
|
1476
|
-
adapter,
|
|
1477
|
-
textGeneration
|
|
1478
|
-
};
|
|
1479
|
-
})
|
|
1480
|
-
};
|
|
1481
|
-
//#endregion
|
|
1482
|
-
exports.GrokDriver = GrokDriver;
|