claude-code-best 2.5.0 → 2.6.5
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/chunks/AddWorkspaceDirectory-BYyM_V0q.js +1 -0
- package/dist/chunks/App-BboadKdn.js +1 -0
- package/dist/chunks/ApproveApiKey-BLp4742y.js +1 -0
- package/dist/chunks/ApproveApiKey-DiEe4eui.js +1 -0
- package/dist/chunks/AssistantSessionChooser-B88DM0Oq.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-ByraVuXh.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BDvmz12S.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-B6XNhFqq.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BNhlq7_K.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +1 -0
- package/dist/chunks/DesktopHandoff-S-w4bs5T.js +1 -0
- package/dist/chunks/DevChannelsDialog-BljR0X9X.js +1 -0
- package/dist/chunks/Dialog-DYFGqyDs.js +1 -0
- package/dist/chunks/DiffDialog-BhQ2QaLW.js +3 -0
- package/dist/chunks/Doctor-BXb0qv6n.js +3 -0
- package/dist/chunks/Doctor-C5DYPEGl.js +1 -0
- package/dist/chunks/ExitFlow-CSBDxw9H.js +2 -0
- package/dist/chunks/Feedback-DwHzc4UT.js +2 -0
- package/dist/chunks/Grove-DSXRnXKv.js +11 -0
- package/dist/chunks/Grove-DnTo982-.js +1 -0
- package/dist/chunks/HybridTransport-CuT3KI5e.js +4 -0
- package/dist/chunks/ITermBackend-mokGZVH_.js +1 -0
- package/dist/chunks/InProcessTransport-DB52dh4f.js +1 -0
- package/dist/chunks/InvalidConfigDialog-Bi4RKYlk.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-0zKo4-so.js +1 -0
- package/dist/chunks/ListItem-OFARanN7.js +1 -0
- package/dist/chunks/MCPConnectionManager-DYGoS1Ht.js +1 -0
- package/dist/chunks/McpParsingWarnings-EzgsOoHw.js +1 -0
- package/dist/chunks/MessageSelector-DTmUuEKJ.js +3 -0
- package/dist/chunks/Messages-DWiKTx5o.js +11 -0
- package/dist/chunks/Onboarding-odmthwzz.js +1 -0
- package/dist/chunks/OverageCreditUpsell-Cpk_5Lv0.js +1 -0
- package/dist/chunks/PermissionDialog-5MlJf7ew.js +1 -0
- package/dist/chunks/PluginSettings-eYcWehI8.js +17 -0
- package/dist/chunks/PressEnterToContinue-BdA9zDGs.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-DrrkNOuS.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-DMsF4D6d.js +1 -0
- package/dist/chunks/QueryEngine-C_KZts4y.js +1 -0
- package/dist/chunks/REPL-C6YR0VKU.js +1 -0
- package/dist/chunks/REPL-DzHz-LOY.js +97 -0
- package/dist/chunks/RemoteCallout-CnpCWRPk.js +1 -0
- package/dist/chunks/RemoteSessionManager-OWg_Yccq.js +2 -0
- package/dist/chunks/ResumeConversation-BktSnsCm.js +1 -0
- package/dist/chunks/SSETransport-BpnapvlK.js +4 -0
- package/dist/chunks/SearchBox-DfOmUoaI.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +1 -0
- package/dist/chunks/SentryErrorBoundary-C-NlfQZw.js +2 -0
- package/dist/chunks/Settings-vfFvcweR.js +2 -0
- package/dist/chunks/TeleportProgress-CYXay2ZL.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-_zbZTvcJ.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-DiHQeZIM.js +1 -0
- package/dist/chunks/ThemePicker-BRh027fA.js +1 -0
- package/dist/chunks/TmuxBackend-BaX2U7iZ.js +9 -0
- package/dist/chunks/TrustDialog-CVbzrv6g.js +1 -0
- package/dist/chunks/TungstenTool-C5IqKVr0.js +1 -0
- package/dist/chunks/TungstenTool-V-Bwqlx3.js +1 -0
- package/dist/chunks/ValidationErrorsList-CdCUgfIl.js +2 -0
- package/dist/chunks/WelcomeV2-DCXcYd2x.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-BE9NX5IH.js +2 -0
- package/dist/chunks/add-dir-ldGd3Ppz.js +1 -0
- package/dist/chunks/agentDisplay-CVnAeURF.js +1 -0
- package/dist/chunks/agents-C08NzRZx.js +2 -0
- package/dist/chunks/agents-DH5fmbVw.js +103 -0
- package/dist/chunks/ajv-B_OpU_Uh.js +8 -0
- package/dist/chunks/analytics-DqMQntaB.js +1 -0
- package/dist/chunks/ant-DJren1Aa.js +1 -0
- package/dist/chunks/api-6tcwJlf_.js +1 -0
- package/dist/chunks/api-CGOR_Xfl.js +1 -0
- package/dist/chunks/asciicast-aoKFhc7C.js +1 -0
- package/dist/chunks/asciicast-o5Zg4dJt.js +4 -0
- package/dist/chunks/assistant-BlzrMSkM.js +1 -0
- package/dist/chunks/assistant-CwbhlCM-.js +1 -0
- package/dist/chunks/assistant-aWkDcurV.js +1 -0
- package/dist/chunks/attributionHooks-PygdohOh.js +1 -0
- package/dist/chunks/attributionTrailer-BpvhXgRP.js +1 -0
- package/dist/chunks/auth-CSB2RDKF.js +1 -0
- package/dist/chunks/auth-GxZhOvQ1.js +1 -0
- package/dist/chunks/autoMode-CWvZs1jO.js +45 -0
- package/dist/chunks/autoModeDenials-Cp6VFdsm.js +1 -0
- package/dist/chunks/autonomy-BkVcSMCZ.js +19 -0
- package/dist/chunks/autonomy-DK42aJYt.js +1 -0
- package/dist/chunks/autonomyPanel-Cn4IhXgE.js +1 -0
- package/dist/chunks/axios-DLnc2dVy.js +1 -0
- package/dist/chunks/axios-DhfaybwJ.js +12 -0
- package/dist/chunks/backgroundHousekeeping-BIZTAYho.js +17 -0
- package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +1 -0
- package/dist/chunks/banner-CVXH2xts.js +2 -0
- package/dist/chunks/base64-js-DIVSFswY.js +1 -0
- package/dist/chunks/bedrockClient-qi1-JCOK.js +15 -0
- package/dist/chunks/bg-DK0E4ZtW.js +9 -0
- package/dist/chunks/bg-Dbh5z3Y8.js +1 -0
- package/dist/chunks/branch-juox_fko.js +3 -0
- package/dist/chunks/break-cache-ByJ7U2Ts.js +8 -0
- package/dist/chunks/bridge-DudsCZkh.js +2 -0
- package/dist/chunks/bridgeConfig-D4tpc568.js +1 -0
- package/dist/chunks/bridgeConfig-lRZfQqmA.js +1 -0
- package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +1 -0
- package/dist/chunks/bridgeEnabled-D2IykaHE.js +1 -0
- package/dist/chunks/bridgeMain-C5RDihlX.js +68 -0
- package/dist/chunks/bridgeMain-D7_lg2iJ.js +1 -0
- package/dist/chunks/bridgeMessaging-CqNURC4-.js +1 -0
- package/dist/chunks/bridgePointer-FvAMj3re.js +1 -0
- package/dist/chunks/browser-fLRXxIsQ.js +1 -0
- package/dist/chunks/btw-DKlE3Dea.js +1 -0
- package/dist/chunks/buddy-DQYgHR63.js +3 -0
- package/dist/chunks/bundledMode-kSQejuY4.js +1 -0
- package/dist/chunks/bypassPermissionsKillswitch-Bof-UtM-.js +1 -0
- package/dist/chunks/caches-B5QZDncQ.js +3 -0
- package/dist/chunks/caches-dGk7xsDu.js +1 -0
- package/dist/chunks/capacityWake-BXlUpptF.js +1 -0
- package/dist/chunks/ccrClient-BaWg4E9-.js +1 -0
- package/dist/chunks/ccshareResume-DWLjTF22.js +1 -0
- package/dist/chunks/changeDetector-DoLfg8a6.js +1 -0
- package/dist/chunks/channelNotification-B7A-9DIl.js +1 -0
- package/dist/chunks/channelNotification-DDErroWn.js +1 -0
- package/dist/chunks/chokidar-BcI3rIKm.js +1 -0
- package/dist/chunks/chokidar-SzksMqYp.js +1 -0
- package/dist/chunks/chrome-jMAks7-w.js +1 -0
- package/dist/chunks/chromeNativeHost-4U39yLtd.js +1 -0
- package/dist/chunks/chunk-DR8-3Aex.js +1 -0
- package/dist/chunks/classPrivateFieldSet2-EAQNhHs8.js +1 -0
- package/dist/chunks/claudeDesktop-D0S1eq1F.js +1 -0
- package/dist/chunks/cleanup-Bg_gFgcj.js +1 -0
- package/dist/chunks/clear-OudnCGa7.js +1 -0
- package/dist/chunks/cliLaunch-BQa48gsr.js +1 -0
- package/dist/chunks/client-CPn1wQyc.js +7 -0
- package/dist/chunks/client-DxDmXXTh.js +1 -0
- package/dist/chunks/client-_sjL0I7A.js +35 -0
- package/dist/chunks/color-DG_R5-hl.js +1 -0
- package/dist/chunks/color-convert-ULbeSgNC.js +1 -0
- package/dist/chunks/commands-BWIOEBPs.js +1 -0
- package/dist/chunks/commitAttribution-BA4fcbHf.js +1 -0
- package/dist/chunks/commitAttribution-C22a3OCi.js +2 -0
- package/dist/chunks/common-B379wT22.js +1 -0
- package/dist/chunks/common-B_BC3eMY.js +1 -0
- package/dist/chunks/common-CMCv4N_v.js +1 -0
- package/dist/chunks/compact-BWvnb4or.js +3 -0
- package/dist/chunks/companion-Bkn2lSLj.js +1 -0
- package/dist/chunks/completionCache-DHfUBBMH.js +1 -0
- package/dist/chunks/completionCache-DORrtxkS.js +4 -0
- package/dist/chunks/computerUseLock-BjoDJH2h.js +1 -0
- package/dist/chunks/config-BvpTbJ5p.js +1 -0
- package/dist/chunks/config-D-dzD6n-.js +1 -0
- package/dist/chunks/connectHeadless-CwsFt-Mh.js +1 -0
- package/dist/chunks/constants-41VpZw2G.js +1 -0
- package/dist/chunks/context-DzNahdyP.js +1 -0
- package/dist/chunks/context-noninteractive-CM1-lUSe.js +1 -0
- package/dist/chunks/context-noninteractive-yiyJriiw.js +54 -0
- package/dist/chunks/controlMessageCompat-BJhFiS7u.js +1 -0
- package/dist/chunks/conversation-DKlz47xf.js +1 -0
- package/dist/chunks/conversation-cUxdb8MN.js +1 -0
- package/dist/chunks/copy-9k9JPRqW.js +7 -0
- package/dist/chunks/createSSHSession-BZf-Loo5.js +6 -0
- package/dist/chunks/createSession-BuJcoBAj.js +1 -0
- package/dist/chunks/createSession-kiTHYXSL.js +1 -0
- package/dist/chunks/cron-DiW7eIPP.js +1 -0
- package/dist/chunks/cronJitterConfig-CYP7yrQu.js +6 -0
- package/dist/chunks/crossProjectResume-BJisir9Z.js +40 -0
- package/dist/chunks/cwd--iizewsn.js +1 -0
- package/dist/chunks/cwd-BgpSJxd7.js +1 -0
- package/dist/chunks/daemon-VYRit6Aq.js +2 -0
- package/dist/chunks/dangerousBackend-BU_PHGR2.js +1 -0
- package/dist/chunks/datadog-Bg-zL-i7.js +1 -0
- package/dist/chunks/datadog-CVeFkaQu.js +1 -0
- package/dist/chunks/debug-DM5ezCBS.js +1 -0
- package/dist/chunks/debug-UI3T040K.js +5 -0
- package/dist/chunks/debugUtils-BBMFODKH.js +1 -0
- package/dist/chunks/defineProperty-80gRi2ZW.js +1 -0
- package/dist/chunks/desktop-DpaStjc-.js +1 -0
- package/dist/chunks/detached-D300jlhj.js +5 -0
- package/dist/chunks/detect-libc-DNuQfUvI.js +1 -0
- package/dist/chunks/detectRepository-CBk3S2zv.js +1 -0
- package/dist/chunks/detectRepository-DCTvg4p0.js +1 -0
- package/dist/chunks/detection-CQsNad64.js +1 -0
- package/dist/chunks/detection-DJ-vTbBf.js +1 -0
- package/dist/chunks/diff-N_VSBo3Z.js +1 -0
- package/dist/chunks/directoryCompletion-DP_4B1GL.js +1 -0
- package/dist/chunks/dist-CanSxOZ1.js +5 -0
- package/dist/chunks/dist-Cg1a1Exw.js +29 -0
- package/dist/chunks/dist-Q7YNoZ0H.js +20 -0
- package/dist/chunks/dist-es-4z5T3Jzm.js +1 -0
- package/dist/chunks/dist-es-B2jg52tM2.js +1 -0
- package/dist/chunks/dist-es-B6OXHQ1S.js +1 -0
- package/dist/chunks/dist-es-B8NEy5hc.js +1 -0
- package/dist/chunks/dist-es-BVGppqE4.js +1 -0
- package/dist/chunks/dist-es-Bcw5GZko.js +1 -0
- package/dist/chunks/dist-es-BoIJpncb.js +9 -0
- package/dist/chunks/dist-es-Bu_Fshi1.js +1 -0
- package/dist/chunks/dist-es-C-1vn4OP2.js +1 -0
- package/dist/chunks/dist-es-C41b_0B5.js +1 -0
- package/dist/chunks/dist-es-CCZYybbG2.js +1 -0
- package/dist/chunks/dist-es-CLK1mey-.js +1 -0
- package/dist/chunks/dist-es-CQz2aNf72.js +1 -0
- package/dist/chunks/dist-es-CSfI8B8l.js +1 -0
- package/dist/chunks/dist-es-CUZBYppo.js +1 -0
- package/dist/chunks/dist-es-CZkzHpjF.js +1 -0
- package/dist/chunks/dist-es-Cbf0_D8d.js +5 -0
- package/dist/chunks/dist-es-ChHe-SVL.js +1 -0
- package/dist/chunks/dist-es-ClYOf0My.js +1 -0
- package/dist/chunks/dist-es-D-kJbj4A2.js +1 -0
- package/dist/chunks/dist-es-D1LN6CJd.js +1 -0
- package/dist/chunks/dist-es-DC1sC3ph.js +1 -0
- package/dist/chunks/dist-es-DGn8uOwQ2.js +1 -0
- package/dist/chunks/dist-es-DK5fTeKM2.js +1 -0
- package/dist/chunks/dist-es-DN7otr6F.js +1 -0
- package/dist/chunks/dist-es-DPM0mPK5.js +1 -0
- package/dist/chunks/dist-es-DqZAh3nG.js +1 -0
- package/dist/chunks/dist-es-DuAZyxJ02.js +5 -0
- package/dist/chunks/dist-es-HVQrM0oE.js +1 -0
- package/dist/chunks/dist-es-OVleIB54.js +1 -0
- package/dist/chunks/dist-es-UAs0rdXg.js +1 -0
- package/dist/chunks/dist-es-WvMMuHmx2.js +1 -0
- package/dist/chunks/dist-es-fjXft-jH.js +1 -0
- package/dist/chunks/dist-es-hdN_ShpZ.js +3 -0
- package/dist/chunks/dist-es-neiUvMJb.js +1 -0
- package/dist/chunks/dist-es-yMYpDtui2.js +1 -0
- package/dist/chunks/dist-es-zjcbuB72.js +1 -0
- package/dist/chunks/distRoot-CcxmnzqQ.js +1 -0
- package/dist/chunks/doctor-CUWjbh1X.js +1 -0
- package/dist/chunks/earlyInput-JGJo1zcC.js +1 -0
- package/dist/chunks/earlyInput-tRkbxFv2.js +2 -0
- package/dist/chunks/effort-loH1TUvE.js +9 -0
- package/dist/chunks/entry-D58E-E6Y.js +14 -0
- package/dist/chunks/env-chR0gV31.js +1 -0
- package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +1 -0
- package/dist/chunks/envLessBridgeConfig-SPEr9oqO.js +1 -0
- package/dist/chunks/envUtils-BWeoiL4Y.js +1 -0
- package/dist/chunks/escHotkey-Cyz0yyh1.js +259 -0
- package/dist/chunks/esm--xjzB1hI.js +1 -0
- package/dist/chunks/esm-B2HIF0XY.js +1 -0
- package/dist/chunks/esm-BGQPWnJy.js +1 -0
- package/dist/chunks/esm-C-1qL9Mn.js +1 -0
- package/dist/chunks/esm-C3jcs1DH.js +1 -0
- package/dist/chunks/esm-C97WL9nC.js +1 -0
- package/dist/chunks/esm-CIL-SKM8.js +1 -0
- package/dist/chunks/esm-CJlBxjtx.js +1 -0
- package/dist/chunks/esm-CsGLyWmS.js +56 -0
- package/dist/chunks/esm-DQHmDm-H.js +1 -0
- package/dist/chunks/esm-DcdOXSzi.js +1 -0
- package/dist/chunks/esm-DhNYgGTV.js +1 -0
- package/dist/chunks/esm-DxPW7qPs.js +1 -0
- package/dist/chunks/esm-FBUWr3vI.js +1 -0
- package/dist/chunks/esm-QgL6y---.js +10 -0
- package/dist/chunks/esm-v0kPjgVS.js +1 -0
- package/dist/chunks/esm-vIn-YV_h.js +1 -0
- package/dist/chunks/event-streams-BV7ngMXu.js +1 -0
- package/dist/chunks/eventLoopStallDetector-Dnh1fc31.js +1 -0
- package/dist/chunks/execAsync-BkA6ogic.js +1 -0
- package/dist/chunks/execFileNoThrow-CuQN1sz8.js +1 -0
- package/dist/chunks/execSyncWrapper-C2XQnFVo.js +1 -0
- package/dist/chunks/execa-CGue6Z3n.js +34 -0
- package/dist/chunks/executor-4EeD8GNm.js +1561 -0
- package/dist/chunks/executor-BHEuNh5F.js +1 -0
- package/dist/chunks/exit-D-tuPpbx.js +1 -0
- package/dist/chunks/exit-_obETqBv.js +2 -0
- package/dist/chunks/export-BIZ_SPXJ.js +2 -0
- package/dist/chunks/exportRenderer-CWPSMaqM.js +1 -0
- package/dist/chunks/extra-usage-CCMwIa85.js +1 -0
- package/dist/chunks/extra-usage-core-BNW4VT7o.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-B_WjXO1E.js +1 -0
- package/dist/chunks/extra-usage-rdJ7ecEb.js +1 -0
- package/dist/chunks/extraUsage-CNMMTNJi.js +1 -0
- package/dist/chunks/extractMemories-BrvZVsmM.js +1 -0
- package/dist/chunks/fast-CG1v3fRr.js +1 -0
- package/dist/chunks/fast-CLKKsx2H.js +1 -0
- package/dist/chunks/featureCheck-Cm0YNDXO.js +1 -0
- package/dist/chunks/featureCheck-p7OeCYzj.js +1 -0
- package/dist/chunks/feedback-CG4mS_-B.js +1 -0
- package/dist/chunks/figures-gfT9mM8P.js +1 -0
- package/dist/chunks/fileStateCache-C7-TxF8G.js +1 -0
- package/dist/chunks/files-DYvAZGxp.js +2 -0
- package/dist/chunks/firstPartyEventLogger-Y_jAnHoR.js +1 -0
- package/dist/chunks/flushGate-COPcye5f.js +1 -0
- package/dist/chunks/foundry-sdk-BFN5VDFQ.js +1 -0
- package/dist/chunks/fpsMetrics-DeezdcwV.js +1 -0
- package/dist/chunks/fuse-Ch_OAlm3.js +1 -0
- package/dist/chunks/gates-CSHuXnUx.js +1 -0
- package/dist/chunks/gates-CSKxLmMJ.js +1 -0
- package/dist/chunks/gemini-B3uSLiNp.js +1 -0
- package/dist/chunks/generateRecap-D7rG3jIm.js +1 -0
- package/dist/chunks/generateSessionName-zbqanivg.js +1 -0
- package/dist/chunks/genericProcessUtils-BGvcwuPt.js +23 -0
- package/dist/chunks/getMachineId-bsd-BMtYGBUL.js +1 -0
- package/dist/chunks/getMachineId-darwin-CiLdFH7z.js +2 -0
- package/dist/chunks/getMachineId-linux-Cr27rIeY.js +1 -0
- package/dist/chunks/getMachineId-unsupported-ceiBLwAN.js +1 -0
- package/dist/chunks/getMachineId-win-DFTmsQHq.js +1 -0
- package/dist/chunks/git-CN3qtTb_.js +6 -0
- package/dist/chunks/git-D23Mzu_K.js +1 -0
- package/dist/chunks/githubRepoPathMapping-B04nEUDG.js +1 -0
- package/dist/chunks/graceful-fs-Cgc0rjGF.js +2 -0
- package/dist/chunks/grok-CDOpos8E.js +1 -0
- package/dist/chunks/growthbook-C_EY78Sn.js +1 -0
- package/dist/chunks/hash-BRmOQc3c.js +1 -0
- package/dist/chunks/heapdump-CpmhJ55b.js +5 -0
- package/dist/chunks/help-EHn2neTv.js +1 -0
- package/dist/chunks/hooks-BFdX17Za.js +1 -0
- package/dist/chunks/hooks-BV6HqbU4.js +79 -0
- package/dist/chunks/hostAdapter-_SmFAVNf.js +1 -0
- package/dist/chunks/hostGuard-zim_4F9V.js +1 -0
- package/dist/chunks/httpAuthSchemes-Wq4XWeLL.js +13 -0
- package/dist/chunks/ide-DkN0KdTR.js +2 -0
- package/dist/chunks/inboundAttachments-BVUunfAX.js +1 -0
- package/dist/chunks/inboundAttachments-DnGQw7Pf.js +1 -0
- package/dist/chunks/index.min-BJnb9GQI.js +1 -0
- package/dist/chunks/initReplBridge-tPRGPBq7.js +1 -0
- package/dist/chunks/insights-Bs9kJDG6.js +822 -0
- package/dist/chunks/install-CFX_ph9z.js +1 -0
- package/dist/chunks/install-github-app-CvRjY1Wi.js +147 -0
- package/dist/chunks/install-slack-app-DjhnVSe0.js +1 -0
- package/dist/chunks/instinctParser-DHMa8xa0.js +1 -0
- package/dist/chunks/instrumentation-c5zlOWom.js +12 -0
- package/dist/chunks/intl-Pse97ORk.js +1 -0
- package/dist/chunks/isObject-DaxDnPKm.js +1 -0
- package/dist/chunks/isSymbol-Dp3irZaY.js +1 -0
- package/dist/chunks/job-3QwLq609.js +2 -0
- package/dist/chunks/json-bigint-OxRwRvup.js +8 -0
- package/dist/chunks/jsx-runtime-D-D469L8.js +1 -0
- package/dist/chunks/jws-2vqRyZtR.js +3 -0
- package/dist/chunks/jwtUtils-CpXwh_du.js +1 -0
- package/dist/chunks/keybindings-7mDm3UKD.js +2 -0
- package/dist/chunks/lang-DyyjY20G.js +1 -0
- package/dist/chunks/language-CPRGmY8Q.js +1 -0
- package/dist/chunks/language-Cf6bMI4N.js +1 -0
- package/dist/chunks/launchAgentsPlatform-CpsMsTqQ.js +1 -0
- package/dist/chunks/launchAutofixPr-D9h6YAZY.js +2 -0
- package/dist/chunks/launchCommand-Du91jxMC.js +1 -0
- package/dist/chunks/launchLocalMemory-DlYQcEQJ.js +3 -0
- package/dist/chunks/launchLocalVault-CP0AyPjj.js +3 -0
- package/dist/chunks/launchMemoryStores-BHoDFkJ5.js +1 -0
- package/dist/chunks/launchOnboarding-CFTNXcnc.js +8 -0
- package/dist/chunks/launchSchedule-5KQr6x_A.js +1 -0
- package/dist/chunks/launchSkillStore-D0yGuE68.js +1 -0
- package/dist/chunks/launchTeleport-DRKnXOwY.js +3 -0
- package/dist/chunks/launchVault-XA-zAswX.js +1 -0
- package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
- package/dist/chunks/lib-B4Q0Nrpb.js +14 -0
- package/dist/chunks/lib-Ca3QWJjN.js +2 -0
- package/dist/chunks/lib-inCisXen.js +8 -0
- package/dist/chunks/loadAgentsDir-DCyiY0MN.js +1 -0
- package/dist/chunks/loadAgentsDir-DI1a76pd.js +4601 -0
- package/dist/chunks/loadPluginHooks-C0Ei-0E2.js +1 -0
- package/dist/chunks/loadSso-sDs471GC.js +1 -0
- package/dist/chunks/localSearch-CDOJNc_E.js +1 -0
- package/dist/chunks/localSearch-MBx7KzC2.js +1 -0
- package/dist/chunks/lockfile-DBwdlC3K.js +1 -0
- package/dist/chunks/log-CzsijfHZ.js +1 -0
- package/dist/chunks/login-D8UKKaud.js +1 -0
- package/dist/chunks/login-nwTOoyxv.js +1 -0
- package/dist/chunks/logoV2Utils-DDUoPClc.js +1 -0
- package/dist/chunks/logout-B0BjqlGi.js +1 -0
- package/dist/chunks/magicDocs-CmUlOWjI.js +57 -0
- package/dist/chunks/main-C6be1KFk.js +31 -0
- package/dist/chunks/main-CeG_nUsC.js +1108 -0
- package/dist/chunks/mappers-CJ8IO1o1.js +1 -0
- package/dist/chunks/mcp-CanCqnch.js +2 -0
- package/dist/chunks/mcp-Dq0kxZFx.js +6 -0
- package/dist/chunks/mcp-zbxZM9BP.js +1 -0
- package/dist/chunks/mcpServer-DPHQVYdC.js +1 -0
- package/dist/chunks/mcpServer-lIneUZ5p.js +1 -0
- package/dist/chunks/memoize-DNnuA2aU.js +1 -0
- package/dist/chunks/memoize-DxwLawI2.js +1 -0
- package/dist/chunks/memory-BcWBkKV8.js +1 -0
- package/dist/chunks/mobile-umu5P0cM.js +2 -0
- package/dist/chunks/modalContext-CmSKRyea.js +1 -0
- package/dist/chunks/model-DJLzVvcF.js +1 -0
- package/dist/chunks/model-H3rtl6eR.js +1 -0
- package/dist/chunks/normalization-Cox8C0dP.js +1 -0
- package/dist/chunks/oauth-CdZEzMww.js +1 -0
- package/dist/chunks/oauth-CmensepG.js +1 -0
- package/dist/chunks/observationStore-tvkldXUo.js +4 -0
- package/dist/chunks/onChangeAppState-Dxbl8fvk.js +1 -0
- package/dist/chunks/open-CDditBQ-.js +1 -0
- package/dist/chunks/openai-DkYK4THc.js +10 -0
- package/dist/chunks/openaiShared-D5lOejS1.js +16 -0
- package/dist/chunks/output-style-XDb9-2Kk.js +1 -0
- package/dist/chunks/overageCreditGrant-DLKadMYU.js +1 -0
- package/dist/chunks/p-map-9Ud1LOrJ.js +1 -0
- package/dist/chunks/p-map-D7WEmnBE.js +1 -0
- package/dist/chunks/package-BhL7chzt.js +1 -0
- package/dist/chunks/panel-ByW1omJn.js +1 -0
- package/dist/chunks/panel-Bz_8td5D.js +1 -0
- package/dist/chunks/parseConnectUrl-BS6i9JPo.js +1 -0
- package/dist/chunks/parser-CmngCwjB.js +1 -0
- package/dist/chunks/parser-SWIZo39J.js +1 -0
- package/dist/chunks/passes-BIfuerjL.js +1 -0
- package/dist/chunks/path-C4kbwvSH.js +1 -0
- package/dist/chunks/paths-BBvuDQl9.js +39 -0
- package/dist/chunks/permissions-DXLfdE7b.js +1 -0
- package/dist/chunks/permissions-Ps_D01ZB.js +1 -0
- package/dist/chunks/permissions-S2EvIRKj.js +3 -0
- package/dist/chunks/pipeTransport-DVoIA1uN.js +1 -0
- package/dist/chunks/plan--lnWxB3Q.js +1 -0
- package/dist/chunks/platform-CuyedWpe.js +2 -0
- package/dist/chunks/plist-BO4ZqMZc.js +6 -0
- package/dist/chunks/plugin-DWLyrLw4.js +1 -0
- package/dist/chunks/pluginAutoupdate-CGXIWBrb.js +1 -0
- package/dist/chunks/pluginBlocklist-DJrMdzT0.js +1 -0
- package/dist/chunks/pluginCliCommands-C08q9dHk.js +1 -0
- package/dist/chunks/pluginFlagging-Dggxke70.js +1 -0
- package/dist/chunks/pluginOperations-CNCImIe8.js +2 -0
- package/dist/chunks/pluginStartupCheck-BW2fjg2P.js +1 -0
- package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +1 -0
- package/dist/chunks/plugins-DQ3CRWWO.js +4 -0
- package/dist/chunks/policyLimits-BotYrS-v.js +1 -0
- package/dist/chunks/pollConfig-DAQ-ives.js +1 -0
- package/dist/chunks/poller-Ds0Y6Cir.js +1 -0
- package/dist/chunks/poor-DqfrQT61.js +1 -0
- package/dist/chunks/poorMode-DEAe3hiK.js +1 -0
- package/dist/chunks/poorMode-DzYT47KW.js +1 -0
- package/dist/chunks/postCommitAttribution-Ehmwzzuq.js +1 -0
- package/dist/chunks/print-GGVp62vj.js +39 -0
- package/dist/chunks/privacy-settings-agwqjYJo.js +1 -0
- package/dist/chunks/process-CWupreF6.js +1 -0
- package/dist/chunks/process-DMKLUQIO.js +1 -0
- package/dist/chunks/processBashCommand-DHHN8Ca4.js +1 -0
- package/dist/chunks/processSlashCommand-COtIO6Jy.js +6 -0
- package/dist/chunks/projectContext-0fpRKUeH.js +1 -0
- package/dist/chunks/projectContext-eXMSfgdZ.js +1 -0
- package/dist/chunks/prompt-4tea6NJQ.js +54 -0
- package/dist/chunks/prompt-CO160cIr.js +1 -0
- package/dist/chunks/prompt-CjFAtm3w.js +222 -0
- package/dist/chunks/prompt-GY9hlRvI.js +1 -0
- package/dist/chunks/promptEditor-EgosPsy-.js +4 -0
- package/dist/chunks/protocolHandler-mtPUT9U0.js +13 -0
- package/dist/chunks/protocols-CAyQOlkr.js +7 -0
- package/dist/chunks/proxy-CfZp-wce.js +99 -0
- package/dist/chunks/rate-limit-options-C6SFOHue.js +1 -0
- package/dist/chunks/rcDebugLog-CPKZCtR8.js +11 -0
- package/dist/chunks/referral-DeDr9zAE.js +1 -0
- package/dist/chunks/refresh-D7pdoY_X.js +1 -0
- package/dist/chunks/registerProtocol-BZBH8Zgl.js +36 -0
- package/dist/chunks/registry-Dz6AbiYP.js +1 -0
- package/dist/chunks/release-notes-DiUNOrg9.js +4 -0
- package/dist/chunks/releaseNotes-CnhQit0y.js +2 -0
- package/dist/chunks/reload-plugins-Dx52GcaG.js +1 -0
- package/dist/chunks/remote-env-B67Oo3sI.js +1 -0
- package/dist/chunks/remoteBridgeCore-BzSUgPbt.js +1 -0
- package/dist/chunks/remoteControlServer-L8smP7Zu.js +3 -0
- package/dist/chunks/rename-C4PauyTZ.js +1 -0
- package/dist/chunks/renderOptions-BiyC2rj1.js +1 -0
- package/dist/chunks/resume-CrSn26xq.js +2 -0
- package/dist/chunks/rewind-CXplHgh_.js +1 -0
- package/dist/chunks/rollback-DbSpxmJE.js +11 -0
- package/dist/chunks/runtimeObserver-YNy3mIb7.js +1 -0
- package/dist/chunks/runtimeObserver-nAhH4Wca.js +10 -0
- package/dist/chunks/sandbox-adapter-CzwHes1i.js +1 -0
- package/dist/chunks/sandbox-toggle-BYqbcI5d.js +1 -0
- package/dist/chunks/sanitization-CYp-9DbE.js +1 -0
- package/dist/chunks/satisfies-BaHgd_ie.js +1 -0
- package/dist/chunks/schemas-BGAvj1T4.js +40 -0
- package/dist/chunks/sdk-DEtgRZvI.js +1 -0
- package/dist/chunks/sdkHeapDumpMonitor--fevrC5z.js +1 -0
- package/dist/chunks/searchExtraTools-CcpdCO6l.js +1 -0
- package/dist/chunks/semver-Cq33BYay.js +1 -0
- package/dist/chunks/semver-Tw0AFar5.js +1 -0
- package/dist/chunks/sentry-BNVxoVLS.js +13 -0
- package/dist/chunks/server-C5XZSlto.js +1 -0
- package/dist/chunks/server-DzOdtq8A.js +1 -0
- package/dist/chunks/serverBanner-WlSYP-f8.js +1 -0
- package/dist/chunks/serverLog-DtsUvDiY.js +1 -0
- package/dist/chunks/session-BuEmHrqM.js +2 -0
- package/dist/chunks/sessionDataUploader-Ctjo1bgR.js +1 -0
- package/dist/chunks/sessionDiscovery-Mcsfa0g-.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +1 -0
- package/dist/chunks/sessionManager-Dw72ZUTg.js +1 -0
- package/dist/chunks/sessionMemory-CMahwDdW.js +1 -0
- package/dist/chunks/sessionMemory-pFSn4HSN.js +1 -0
- package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +1 -0
- package/dist/chunks/sessionObserver-DG2zQgfi.js +20 -0
- package/dist/chunks/sessionObserver-Je868MC9.js +1 -0
- package/dist/chunks/sessionStorage-D3FhAADV.js +1 -0
- package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +3 -0
- package/dist/chunks/sessionTitle-zUVSAHO7.js +14 -0
- package/dist/chunks/sessionTracing-DoRJ4nSa.js +11 -0
- package/dist/chunks/settingsSync-B9bz77E1.js +1 -0
- package/dist/chunks/setup-B1JbPepL.js +9 -0
- package/dist/chunks/setup-CCOLlRtP.js +1 -0
- package/dist/chunks/setup-DWkSjA49.js +2 -0
- package/dist/chunks/shadowedRuleDetection-BBR3uEgx.js +1 -0
- package/dist/chunks/shellQuote-DgjT8KBA.js +1 -0
- package/dist/chunks/sideQuestion-DHW5rgKz.js +20 -0
- package/dist/chunks/signin-QEeYpJZw.js +1 -0
- package/dist/chunks/sink-DxDOsLa2.js +1 -0
- package/dist/chunks/sink-cQOgsnw3.js +1 -0
- package/dist/chunks/sinks-BrrTUxkC.js +2 -0
- package/dist/chunks/sinks-Djiz_5-Z.js +1 -0
- package/dist/chunks/skill-learning-C0nOKZfg.js +5 -0
- package/dist/chunks/skillChangeDetector-D8C-uQSQ.js +1 -0
- package/dist/chunks/skillGapStore-Czi5jKjJ.js +1 -0
- package/dist/chunks/skillGapStore-_YuJP5KI.js +5 -0
- package/dist/chunks/skillGenerator-kbaRbpqJ.js +8 -0
- package/dist/chunks/skillLearning-3KWrBczS.js +1 -0
- package/dist/chunks/skillLearning-DBbdGbk-.js +1 -0
- package/dist/chunks/skillPanel-BxDvlPzd.js +28 -0
- package/dist/chunks/skillSearchPanel-D-MX6Qgt.js +21 -0
- package/dist/chunks/skills-NpEgFkFZ.js +1 -0
- package/dist/chunks/slashCommandParsing-Cari0pNg.js +1 -0
- package/dist/chunks/sleep-8Eb9j_Ly.js +1 -0
- package/dist/chunks/sprites-DD4eIkN7.js +1 -0
- package/dist/chunks/src-BIPP3_mo.js +26 -0
- package/dist/chunks/src-BJz1KAd_.js +6 -0
- package/dist/chunks/src-BRAdBA8A.js +1 -0
- package/dist/chunks/src-BRC_BuUP.js +1 -0
- package/dist/chunks/src-BaB-bpCj.js +5 -0
- package/dist/chunks/src-BlLavFUS.js +7 -0
- package/dist/chunks/src-C5yhFG0C.js +19 -0
- package/dist/chunks/src-CI_jaaBj.js +2 -0
- package/dist/chunks/src-CRsA-Z4y.js +1 -0
- package/dist/chunks/src-CYLfL70h.js +1 -0
- package/dist/chunks/src-DJXCzwyJ.js +1 -0
- package/dist/chunks/src-DJXKJavk.js +1 -0
- package/dist/chunks/src-Di342QoJ.js +53 -0
- package/dist/chunks/src-DsMd9Q9e.js +2 -0
- package/dist/chunks/src-DzH9IdOo.js +1 -0
- package/dist/chunks/src-hdbPEvzO.js +9 -0
- package/dist/chunks/src-poaoYkuc.js +1 -0
- package/dist/chunks/src-x7u_sB6m.js +1 -0
- package/dist/chunks/sso-oidc-BX1MlBX0.js +1 -0
- package/dist/chunks/startupProfiler-DnXZaX4A.js +3 -0
- package/dist/chunks/startupProfiler-SOE--nM9.js +1 -0
- package/dist/chunks/state-B2GIOsTB.js +1 -0
- package/dist/chunks/state-Ce1HlR-H.js +1 -0
- package/dist/chunks/state-sIHsFpDu.js +1 -0
- package/dist/chunks/staticRender-Br64h1E1.js +1 -0
- package/dist/chunks/stats-xL3NHwhp.js +1 -0
- package/dist/chunks/status-B5E70xRv.js +1 -0
- package/dist/chunks/statusNoticeHelpers-DcssRhLw.js +1 -0
- package/dist/chunks/stdio-BEEzuxaZ.js +1 -0
- package/dist/chunks/stdio-D4cT86R0.js +3 -0
- package/dist/chunks/stickers-2K05wjSp.js +1 -0
- package/dist/chunks/store-DhI7Lcan.js +1 -0
- package/dist/chunks/sts-BDFJ-6QE.js +1 -0
- package/dist/chunks/subprocessEnv-CggQWZCx.js +1 -0
- package/dist/chunks/subprocessEnv-DV6q6o6w.js +1 -0
- package/dist/chunks/supports-color-lkzOMQ6u.js +1 -0
- package/dist/chunks/systemPromptSections-BcN_XBTx.js +1 -0
- package/dist/chunks/systemPromptSections-DB93ZNWP.js +1 -0
- package/dist/chunks/systemTheme-dDbitcxB.js +1 -0
- package/dist/chunks/tag-BELr-qIa.js +11 -0
- package/dist/chunks/tasks-CrdWcSt-.js +1 -0
- package/dist/chunks/teamHelpers--3ZyNDlv.js +1 -0
- package/dist/chunks/teamHelpers-CUAiXng3.js +1 -0
- package/dist/chunks/teammate-DMYOtLTK.js +1 -0
- package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +1 -0
- package/dist/chunks/teammateModeSnapshot-DOQMTKbQ.js +1 -0
- package/dist/chunks/teleport-LXFOan9C.js +1 -0
- package/dist/chunks/templateJobs-8IY2Cgig.js +12 -0
- package/dist/chunks/terminalSetup-C4psrmpb.js +1 -0
- package/dist/chunks/terminalSetup-Lyg4NbGA.js +33 -0
- package/dist/chunks/theme-B8GNnJ_q.js +1 -0
- package/dist/chunks/thinkback-DPXwEK3B.js +1 -0
- package/dist/chunks/thinkback-DZW3Mcx_.js +1 -0
- package/dist/chunks/thinkback-play-BMOE-ceh.js +1 -0
- package/dist/chunks/tmux-CvbhsfwG.js +1 -0
- package/dist/chunks/toolEventObserver-D0TSHm01.js +1 -0
- package/dist/chunks/toolEventObserver-DzLd0MSn.js +1 -0
- package/dist/chunks/toolPool-DVOfpjDz.js +1 -0
- package/dist/chunks/toolPool-Dq-Vtvrj.js +1 -0
- package/dist/chunks/trustedDevice-1iTu4LEm.js +1 -0
- package/dist/chunks/trustedDevice-BvYYXfd8.js +1 -0
- package/dist/chunks/tui-BVc2q4Xv.js +6 -0
- package/dist/chunks/turndown.es-Bv06VjMb.js +69 -0
- package/dist/chunks/types-CQ1wrnQ0.js +1 -0
- package/dist/chunks/types-Csi32ZXh.js +17 -0
- package/dist/chunks/types-RJTEOuIt.js +3 -0
- package/dist/chunks/udsClient-BvG_Jip0.js +1 -0
- package/dist/chunks/ultrareviewCommand-BTXAN2wP.js +3 -0
- package/dist/chunks/undercover-C_44e3oN.js +1 -0
- package/dist/chunks/undercover-DvvnEmsX.js +31 -0
- package/dist/chunks/up-D-U4wUCe.js +12 -0
- package/dist/chunks/updateCCB-C-qfLi0j.js +11 -0
- package/dist/chunks/upgrade-CGXa5Dwy.js +1 -0
- package/dist/chunks/upgrade-DTBZSxwv.js +1 -0
- package/dist/chunks/upload-BF8tf_Eo.js +1 -0
- package/dist/chunks/upstreamproxy-DcLeL2XX.js +11 -0
- package/dist/chunks/usage-BRYRRgNt.js +1 -0
- package/dist/chunks/usage-DvSTXEYY.js +1 -0
- package/dist/chunks/useKeybinding-FsOnjW6T.js +1 -0
- package/dist/chunks/useMainLoopModel-CwvuTRXn.js +1 -0
- package/dist/chunks/useManagePlugins-GmnI9K53.js +1 -0
- package/dist/chunks/useMergedTools-Dah5KDMi.js +1 -0
- package/dist/chunks/useSearchInput-BV_azHiA.js +1 -0
- package/dist/chunks/useSettingsErrors-C-j_Zt7g.js +1 -0
- package/dist/chunks/useVoice-DR69NLxp.js +1 -0
- package/dist/chunks/util-BpyJ4Bom.js +1 -0
- package/dist/chunks/utils-CrZcpypC.js +1 -0
- package/dist/chunks/v4-f1i_CNUT.js +1 -0
- package/dist/chunks/validatePlugin-vptAYuYu.js +1 -0
- package/dist/chunks/vertex-sdk-CSGw3fvU.js +9 -0
- package/dist/chunks/vim-DvOw8dfR.js +1 -0
- package/dist/chunks/voice-B3BZs53f.js +2 -0
- package/dist/chunks/voice-DXiiy8HX.js +8 -0
- package/dist/chunks/voiceModeEnabled-DA76xN1Q.js +1 -0
- package/dist/chunks/voiceModeEnabled-DIveLYGb.js +1 -0
- package/dist/chunks/voiceStreamSTT-_w1VjIOs.js +1 -0
- package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +1 -0
- package/dist/chunks/which-DqSAIvp2.js +1 -0
- package/dist/chunks/windowsPaths-C9CigqoF.js +1 -0
- package/dist/chunks/windowsPaths-swxCp7bX.js +2 -0
- package/dist/chunks/workSecret-mS2OrpxF.js +1 -0
- package/dist/chunks/workerRegistry-2_MZVih1.js +1 -0
- package/dist/chunks/worktree-CCuDwRmS.js +1 -0
- package/dist/chunks/worktreeModeEnabled-Db6b_Iy_.js +1 -0
- package/dist/chunks/worktreeModeEnabled-THQb19xR.js +1 -0
- package/dist/chunks/wrapper-BSK0MCQH.js +1 -0
- package/dist/chunks/wrapper-D5qL1aQL.js +6 -0
- package/dist/chunks/xdg-CBxMmQux.js +1 -0
- package/dist/chunks/xml-Dx--sNE1.js +1 -0
- package/dist/chunks/zod-DT6hytkp.js +1 -0
- package/dist/cli.js +1 -10978
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-80gRi2ZW.js";import{a as r,t as i}from"./dist-es-DPM0mPK5.js";var a,o=e((()=>{t(),a=class e{constructor(e,t,r,i){n(this,`nodes`,void 0),n(this,`root`,void 0),n(this,`conditions`,void 0),n(this,`results`,void 0),this.nodes=e,this.root=t,this.conditions=r,this.results=i}static from(t,n,r,i){return new e(t,n,r,i)}}})),s,c=e((()=>{t(),s=class{constructor({size:e,params:t}){n(this,`capacity`,void 0),n(this,`data`,new Map),n(this,`parameters`,[]),this.capacity=e??50,t&&(this.parameters=t)}get(e,t){let n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){let e=this.data.keys(),t=0;for(;;){let{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t=``,{parameters:n}=this;if(n.length===0)return!1;for(let r of n){let n=String(e[r]??``);if(n.includes(`|;`))return!1;t+=n+`|;`}return t}}})),l,u=e((()=>{l=class extends Error{constructor(e){super(e),this.name=`EndpointError`}}})),d=e((()=>{})),f=e((()=>{})),ee=e((()=>{})),te=e((()=>{})),ne=e((()=>{})),re=e((()=>{})),p=e((()=>{u(),d(),f(),ee(),te(),ne(),re()})),m,ie=e((()=>{m=`endpoints`}));function h(e){return typeof e!=`object`||!e?e:`ref`in e?`$${h(e.ref)}`:`fn`in e?`${e.fn}(${(e.argv||[]).map(h).join(`, `)})`:JSON.stringify(e,null,2)}var ae=e((()=>{})),oe=e((()=>{ie(),ae()})),g,_=e((()=>{g={}})),v,se=e((()=>{v=(e,t)=>e===t}));function ce(...e){for(let t of e)if(t!=null)return t}var le=e((()=>{})),ue,de=e((()=>{p(),ue=e=>{let t=e.split(`.`),n=[];for(let r of t){let t=r.indexOf(`[`);if(t!==-1){if(r.indexOf(`]`)!==r.length-1)throw new l(`Path: '${e}' does not end with ']'`);let i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new l(`Invalid array index: '${i}' in path: '${e}'`);t!==0&&n.push(r.slice(0,t)),n.push(i)}else n.push(r)}return n}})),y,fe=e((()=>{p(),de(),y=(e,t)=>ue(t).reduce((n,r)=>{if(typeof n!=`object`)throw new l(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);if(Array.isArray(n)){let e=parseInt(r);return n[e<0?n.length+e:e]}return n[r]},e)})),pe,me=e((()=>{pe=e=>e!=null})),b,x,S=e((()=>{b=RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`),x=(e,t=!1)=>{if(!t)return b.test(e);let n=e.split(`.`);for(let e of n)if(!x(e))return!1;return!0}}));function he(e,t,n){return e?t:n}var ge=e((()=>{})),C,_e=e((()=>{C=e=>!e})),w,T,E=e((()=>{w=RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`),T=e=>w.test(e)||e.startsWith(`[`)&&e.endsWith(`]`)})),D,O,ve=e((()=>{i(),E(),D={[r.HTTP]:80,[r.HTTPS]:443},O=e=>{let t=(()=>{try{if(e instanceof URL)return e;if(typeof e==`object`&&`hostname`in e){let{hostname:t,port:n,protocol:r=``,path:i=``,query:a={}}=e,o=new URL(`${r}//${t}${n?`:${n}`:``}${i}`);return o.search=Object.entries(a).map(([e,t])=>`${e}=${t}`).join(`&`),o}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;let n=t.href,{host:i,hostname:a,pathname:o,protocol:s,search:c}=t;if(c)return null;let l=s.slice(0,-1);if(!Object.values(r).includes(l))return null;let u=T(a);return{scheme:l,authority:`${i}${n.includes(`${i}:${D[l]}`)||typeof e==`string`&&e.includes(`${i}:${D[l]}`)?`:${D[l]}`:``}`,path:o,normalizedPath:o.endsWith(`/`)?o:`${o}/`,isIp:u}}}));function ye(e,t,n){if(n===1)return[e];if(e===``)return[``];let r=e.split(t);return n===0?r:r.slice(0,n-1).concat(r.slice(1).join(t))}var be=e((()=>{})),k,xe=e((()=>{k=(e,t)=>e===t})),A,Se=e((()=>{A=(e,t,n,r)=>e==null||t>=n||e.length<n||/[^\u0000-\u007f]/.test(e)?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n)})),j,Ce=e((()=>{j=e=>encodeURIComponent(e).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)})),M=e((()=>{se(),le(),fe(),me(),S(),ge(),_e(),ve(),be(),xe(),Se(),Ce()})),N,we=e((()=>{M(),N={booleanEquals:v,coalesce:ce,getAttr:y,isSet:pe,isValidHostLabel:x,ite:he,not:C,parseURL:O,split:ye,stringEquals:k,substring:A,uriEncode:j}})),P,F=e((()=>{M(),P=(e,t)=>{let n=[],{referenceRecord:r,endpointParams:i}=t,a=0;for(;a<e.length;){let t=e.indexOf(`{`,a);if(t===-1){n.push(e.slice(a));break}n.push(e.slice(a,t));let o=e.indexOf(`}`,t);if(o===-1){n.push(e.slice(t));break}e[t+1]===`{`&&e[o+1]===`}`&&(n.push(e.slice(t+1,o)),a=o+2);let s=e.substring(t+1,o);if(s.includes(`#`)){let[e,t]=s.split(`#`);n.push(y(r[e]??i[e],t))}else n.push(r[s]??i[s]);a=o+1}return n.join(``)}})),I,Te=e((()=>{I=({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e]})),L,R,z,B=e((()=>{p(),_(),we(),F(),Te(),L=(e,t,n)=>{if(typeof e==`string`)return P(e,n);if(e.fn)return z.callFunction(e,n);if(e.ref)return I(e,n);throw new l(`'${t}': ${String(e)} is not a string, function or reference.`)},R=({fn:e,argv:t},n)=>{let r=Array(t.length);for(let e=0;e<r.length;++e){let i=t[e];typeof i==`boolean`||typeof i==`number`?r[e]=i:r[e]=z.evaluateExpression(i,`arg`,n)}let i=e.indexOf(`.`);if(i!==-1){let t=g[e.slice(0,i)]?.[e.slice(i+1)];if(typeof t==`function`)return t(...r)}let a=N[e];if(typeof a==`function`)return a(...r);throw Error(`function ${e} not loaded in endpointFunctions.`)},z={evaluateExpression:L,callFunction:R}})),Ee=e((()=>{B()})),V,De=e((()=>{oe(),p(),Ee(),V=(e,t)=>{let{assign:n}=e;if(n&&n in t.referenceRecord)throw new l(`'${n}' is already defined in Reference Record.`);let r=R(e,t);t.logger?.debug?.(`${m} evaluateCondition: ${h(e)} = ${h(r)}`);let i=r===``?!0:!!r;return n==null?{result:i}:{result:i,toAssign:{name:n,value:r}}}})),Oe,ke=e((()=>{p(),B(),Oe=(e,t)=>Object.entries(e??{}).reduce((e,[n,r])=>(e[n]=r.map(e=>{let r=L(e,`Header value entry`,t);if(typeof r!=`string`)throw new l(`Header '${n}' value '${r}' is not a string`);return r}),e),{})})),H,U,W,Ae=e((()=>{p(),F(),H=(e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=W.getEndpointProperty(r,t),e),{}),U=(e,t)=>{if(Array.isArray(e))return e.map(e=>U(e,t));switch(typeof e){case`string`:return P(e,t);case`object`:if(e===null)throw new l(`Unexpected endpoint property: ${e}`);return W.getEndpointProperties(e,t);case`boolean`:return e;default:throw new l(`Unexpected endpoint property type: ${typeof e}`)}},W={getEndpointProperty:U,getEndpointProperties:H}})),G,je=e((()=>{p(),B(),G=(e,t)=>{let n=L(e,`Endpoint URL`,t);if(typeof n==`string`)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new l(`Endpoint URL must be a string, got ${typeof n}`)}})),K,q,Me=e((()=>{p(),De(),B(),ke(),Ae(),je(),K=1e8,q=(e,t)=>{let{nodes:n,root:r,results:i,conditions:a}=e,o=r,s={},c={referenceRecord:s,endpointParams:t.endpointParams,logger:t.logger};for(;o!==1&&o!==-1&&o<K;){let e=3*(Math.abs(o)-1),[t,r,i]=[n[e],n[e+1],n[e+2]],[l,u,d]=a[t],f=V({fn:l,assign:d,argv:u},c);if(f.toAssign){let{name:e,value:t}=f.toAssign;s[e]=t}o=o>=0===f.result?r:i}if(o>=K){let e=i[o-K];if(e[0]===-1){let[,t]=e;throw new l(L(t,`Error`,c))}let[t,n,r]=e;return{url:G(t,c),properties:H(n,c),headers:Oe(r??{},c)}}throw new l(`No matching endpoint.`)}})),Ne=e((()=>{})),Pe=e((()=>{o(),c(),Me(),E(),S(),_(),Ne(),p()})),J,Fe=e((()=>{J=(e,t,n)=>{if(t in e){if(e[t]===`true`)return!0;if(e[t]===`false`)return!1;throw Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}}})),Ie=e((()=>{})),Y,Le=e((()=>{(function(e){e.ENV=`env`,e.CONFIG=`shared config entry`})(Y||(Y={}))})),X=e((()=>{Fe(),Ie(),Le()})),Re,ze,Be,Ve=e((()=>{X(),Re=`AWS_USE_DUALSTACK_ENDPOINT`,ze=`use_dualstack_endpoint`,Be={environmentVariableSelector:e=>J(e,Re,Y.ENV),configFileSelector:e=>J(e,ze,Y.CONFIG),default:!1}})),He,Ue,We,Ge=e((()=>{X(),He=`AWS_USE_FIPS_ENDPOINT`,Ue=`use_fips_endpoint`,We={environmentVariableSelector:e=>J(e,He,Y.ENV),configFileSelector:e=>J(e,Ue,Y.CONFIG),default:!1}})),Ke=e((()=>{})),qe=e((()=>{})),Je=e((()=>{Ve(),Ge(),Ke(),qe()})),Ye,Xe,Ze,Qe,$e=e((()=>{Ye=`AWS_REGION`,Xe=`region`,Ze={environmentVariableSelector:e=>e[Ye],configFileSelector:e=>e[Xe],default:()=>{throw Error(`Region is missing`)}},Qe={preferredFile:`credentials`}})),Z,et,tt=e((()=>{Pe(),Z=new Set,et=(e,t=x)=>{if(!Z.has(e)&&!t(e))if(e===`*`)console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`);else throw Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else Z.add(e)}})),Q,nt=e((()=>{Q=e=>typeof e==`string`&&(e.startsWith(`fips-`)||e.endsWith(`-fips`))})),rt,it=e((()=>{nt(),rt=e=>Q(e)?[`fips-aws-global`,`aws-fips`].includes(e)?`us-east-1`:e.replace(/fips-(dkr-|prod-)?|-fips/,``):e})),$,at=e((()=>{tt(),it(),nt(),$=e=>{let{region:t,useFipsEndpoint:n}=e;if(!t)throw Error(`Region is missing`);return Object.assign(e,{region:async()=>{let e=rt(typeof t==`function`?await t():t);return et(e),e},useFipsEndpoint:async()=>Q(typeof t==`string`?t:await t())?!0:typeof n==`function`?n():Promise.resolve(!!n)})}})),ot=e((()=>{$e(),at()})),st=e((()=>{})),ct=e((()=>{})),lt=e((()=>{})),ut=e((()=>{st(),ct(),lt()})),dt=e((()=>{Je(),ot(),ut()}));export{We as a,Y as c,q as d,T as f,a as g,s as h,Ze as i,J as l,g as m,$ as n,Be as o,x as p,Qe as r,X as s,dt as t,Pe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-80gRi2ZW.js";import{i as r,r as i,t as a}from"./dist-es-DPM0mPK5.js";import{b as o,c as s,t as c,v as l}from"./protocols-CAyQOlkr.js";var u,d,f,p,m,h=e((()=>{u=(e,t)=>{let n=[];if(e&&n.push(e),t)for(let e of t)n.push(e);return n},d=(e,t)=>`${e||`anonymous`}${t&&t.length>0?` (a.k.a. ${t.join(`,`)})`:``}`,f=()=>{let e=[],t=[],n=!1,r=new Set,i=e=>e.sort((e,t)=>p[t.step]-p[e.step]||m[t.priority||`normal`]-m[e.priority||`normal`]),a=n=>{let i=!1,a=e=>{let t=u(e.name,e.aliases);if(t.includes(n)){i=!0;for(let e of t)r.delete(e);return!1}return!0};return e=e.filter(a),t=t.filter(a),i},o=n=>{let i=!1,a=e=>{if(e.middleware===n){i=!0;for(let t of u(e.name,e.aliases))r.delete(t);return!1}return!0};return e=e.filter(a),t=t.filter(a),i},s=n=>(e.forEach(e=>{n.add(e.middleware,{...e})}),t.forEach(e=>{n.addRelativeTo(e.middleware,{...e})}),n.identifyOnResolve?.(h.identifyOnResolve()),n),c=e=>{let t=[];return e.before.forEach(e=>{e.before.length===0&&e.after.length===0?t.push(e):t.push(...c(e))}),t.push(e),e.after.reverse().forEach(e=>{e.before.length===0&&e.after.length===0?t.push(e):t.push(...c(e))}),t},l=(n=!1)=>{let r=[],a=[],o={};return e.forEach(e=>{let t={...e,before:[],after:[]};for(let e of u(t.name,t.aliases))o[e]=t;r.push(t)}),t.forEach(e=>{let t={...e,before:[],after:[]};for(let e of u(t.name,t.aliases))o[e]=t;a.push(t)}),a.forEach(e=>{if(e.toMiddleware){let t=o[e.toMiddleware];if(t===void 0){if(n)return;throw Error(`${e.toMiddleware} is not found when adding ${d(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}e.relation===`after`&&t.after.push(e),e.relation===`before`&&t.before.push(e)}}),i(r).map(c).reduce((e,t)=>(e.push(...t),e),[])},h={add:(t,n={})=>{let{name:i,override:a,aliases:o}=n,s={step:`initialize`,priority:`normal`,middleware:t,...n},c=u(i,o);if(c.length>0){if(c.some(e=>r.has(e))){if(!a)throw Error(`Duplicate middleware name '${d(i,o)}'`);for(let t of c){let n=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(n===-1)continue;let r=e[n];if(r.step!==s.step||s.priority!==r.priority)throw Error(`"${d(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${d(i,o)}" middleware with ${s.priority} priority in ${s.step} step.`);e.splice(n,1)}}for(let e of c)r.add(e)}e.push(s)},addRelativeTo:(e,n)=>{let{name:i,override:a,aliases:o}=n,s={middleware:e,...n},c=u(i,o);if(c.length>0){if(c.some(e=>r.has(e))){if(!a)throw Error(`Duplicate middleware name '${d(i,o)}'`);for(let e of c){let n=t.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(n===-1)continue;let r=t[n];if(r.toMiddleware!==s.toMiddleware||r.relation!==s.relation)throw Error(`"${d(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${d(i,o)}" middleware ${s.relation} "${s.toMiddleware}" middleware.`);t.splice(n,1)}}for(let e of c)r.add(e)}t.push(s)},clone:()=>s(f()),use:e=>{e.applyToStack(h)},remove:e=>typeof e==`string`?a(e):o(e),removeByTag:n=>{let i=!1,a=e=>{let{tags:t,name:a,aliases:o}=e;if(t&&t.includes(n)){let e=u(a,o);for(let t of e)r.delete(t);return i=!0,!1}return!0};return e=e.filter(a),t=t.filter(a),i},concat:e=>{let t=s(f());return t.use(e),t.identifyOnResolve(n||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:s,identify:()=>l(!0).map(e=>{let t=e.step??e.relation+` `+e.toMiddleware;return d(e.name,e.aliases)+` - `+t}),identifyOnResolve(e){return typeof e==`boolean`&&(n=e),n},resolve:(e,t)=>{for(let n of l().map(e=>e.middleware).reverse())e=n(e,t);return n&&console.log(h.identify()),e}};return h},p={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},m={high:3,normal:2,low:1}})),g=e((()=>{h()})),_,v=e((()=>{g(),t(),_=class{constructor(e){n(this,`config`,void 0),n(this,`middlewareStack`,f()),n(this,`initConfig`,void 0),n(this,`handlers`,void 0),this.config=e;let{protocol:t,protocolSettings:r}=e;r&&typeof t==`function`&&(e.protocol=new t(r))}send(e,t,n){let r=typeof t==`function`?void 0:t,i=typeof t==`function`?t:n,a=r===void 0&&this.config.cacheMiddleware===!0,o;if(a){this.handlers||(this.handlers=new WeakMap);let t=this.handlers;t.has(e.constructor)?o=t.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(i)o(e).then(e=>i(null,e.output),e=>i(e)).catch(()=>{});else return o(e).then(e=>e.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}})),y=e((()=>{c()}));function b(e,t){if(t==null)return t;let n=o.of(e);if(n.getMergedTraits().sensitive)return x;if(n.isListSchema()){if(n.getValueSchema().getMergedTraits().sensitive)return x}else if(n.isMapSchema()){if(n.getKeySchema().getMergedTraits().sensitive||n.getValueSchema().getMergedTraits().sensitive)return x}else if(n.isStructSchema()&&typeof t==`object`){let e=t,r={};for(let[t,i]of n.structIterator())e[t]!=null&&(r[t]=b(i,e[t]));return r}return t}var x,S=e((()=>{l(),x=`***SensitiveInformation***`})),C,w,T=e((()=>{g(),a(),S(),t(),C=class{constructor(){n(this,`middlewareStack`,f()),n(this,`schema`,void 0)}static classBuilder(){return new w}resolveMiddlewareWithContext(e,t,n,{middlewareFn:r,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:c,smithyContext:l,additionalContext:u,CommandCtor:d}){for(let i of r.bind(this)(d,e,t,n))this.middlewareStack.use(i);let f=e.concat(this.middlewareStack),{logger:p}=t,m={logger:p,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:c,[i]:{commandInstance:this,...l},...u},{requestHandler:h}=t,g=n??{};return l.eventStream&&(g={isEventStream:!0,...g}),f.resolve(e=>h.handle(e.request,g),m)}},w=class{constructor(){n(this,`_init`,()=>{}),n(this,`_ep`,{}),n(this,`_middlewareFn`,()=>[]),n(this,`_commandName`,``),n(this,`_clientName`,``),n(this,`_additionalContext`,{}),n(this,`_smithyContext`,{}),n(this,`_inputFilterSensitiveLog`,void 0),n(this,`_outputFilterSensitiveLog`,void 0),n(this,`_serializer`,null),n(this,`_deserializer`,null),n(this,`_operationSchema`,void 0)}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends C{static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),n(this,`input`,void 0),n(this,`serialize`,e._serializer),n(this,`deserialize`,e._deserializer),this.input=t??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,r,i){let a=e._operationSchema,o=a?.[4]??a?.input,s=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(a?b.bind(null,o):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(a?b.bind(null,s):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}})),E=e((()=>{})),D,O=e((()=>{D=(e,t,n)=>{for(let[n,r]of Object.entries(e)){let e=async function(e,t,n){let i=new r(e);if(typeof t==`function`)this.send(i,t);else if(typeof n==`function`){if(typeof t!=`object`)throw Error(`Expected http options but got ${typeof t}`);this.send(i,t||{},n)}else return this.send(i,t)},i=(n[0].toLowerCase()+n.slice(1)).replace(/Command$/,``);t.prototype[i]=e}let{paginators:r={},waiters:i={}}=n??{};for(let[e,n]of Object.entries(r))t.prototype[e]===void 0&&(t.prototype[e]=function(e={},t,...r){return n({...t,client:this},e,...r)});for(let[e,n]of Object.entries(i))t.prototype[e]===void 0&&(t.prototype[e]=async function(e={},t,...r){let i=t;return typeof t==`number`&&(i={maxWaitTime:t}),n({...i,client:this},e,...r)})}})),k,A,j,M=e((()=>{t(),k=Symbol.hasInstance,A=class e extends Error{constructor(e){super(e.message),n(this,`$fault`,void 0),n(this,`$response`,void 0),n(this,`$retryable`,void 0),n(this,`$metadata`,void 0),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(t){if(!t)return!1;let n=t;return e.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault===`client`||n.$fault===`server`)}static[k](t){if(!t)return!1;let n=t;return this===e?e.isInstance(t):e.isInstance(t)?n.name&&this.name?this.prototype.isPrototypeOf(t)||n.name===this.name:this.prototype.isPrototypeOf(t):!1}},j=(e,t={})=>(Object.entries(t).filter(([,e])=>e!==void 0).forEach(([t,n])=>{(e[t]==null||e[t]===``)&&(e[t]=n)}),e.message=e.message||e.Message||`UnknownError`,delete e.Message,e)})),N=e((()=>{})),P,F=e((()=>{P=e=>{switch(e){case`standard`:return{retryMode:`standard`,connectionTimeout:3100};case`in-region`:return{retryMode:`standard`,connectionTimeout:1100};case`cross-region`:return{retryMode:`standard`,connectionTimeout:3100};case`mobile`:return{retryMode:`standard`,connectionTimeout:3e4};default:return{}}}})),I,L,ee=e((()=>{I=!1,L=e=>{e&&!I&&parseInt(e.substring(1,e.indexOf(`.`)))<16&&(I=!0)}})),R=e((()=>{})),z,B,V,H=e((()=>{a(),z=Object.values(r),B=e=>{let t=[];for(let n in r){let i=r[n];e[i]!==void 0&&t.push({algorithmId:()=>i,checksumConstructor:()=>e[i]})}for(let[n,r]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){e.checksumAlgorithms=e.checksumAlgorithms??{};let r=n.algorithmId(),i=n.checksumConstructor();z.includes(r)?e.checksumAlgorithms[r.toUpperCase()]=i:e.checksumAlgorithms[r]=i,t.push(n)},checksumAlgorithms(){return t}}},V=e=>{let t={};return e.checksumAlgorithms().forEach(e=>{let n=e.algorithmId();z.includes(n)&&(t[n]=e.checksumConstructor())}),t}})),U,W,G=e((()=>{U=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),W=e=>{let t={};return t.retryStrategy=e.retryStrategy(),t}})),K,q,J=e((()=>{H(),G(),K=e=>Object.assign(B(e),U(e)),q=e=>Object.assign(V(e),W(e))})),Y=e((()=>{J()})),X=e((()=>{})),Z,Q=e((()=>{Z=e=>{let t=`#text`;for(let n in e)e.hasOwnProperty(n)&&e[n][t]!==void 0?e[n]=e[n][t]:typeof e[n]==`object`&&e[n]!==null&&(e[n]=Z(e[n]));return e}})),te=e((()=>{})),$,ne=e((()=>{$=class{trace(){}debug(){}info(){}warn(){}error(){}}})),re=e((()=>{})),ie=e((()=>{})),ae=e((()=>{})),oe=e((()=>{})),se=e((()=>{v(),y(),T(),E(),O(),N(),F(),ee(),M(),R(),Y(),X(),Q(),te(),ne(),re(),ie(),ae(),oe(),s()}));export{q as a,A as c,C as d,_ as f,K as i,j as l,$ as n,L as o,Z as r,P as s,se as t,D as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./dist-es-DuAZyxJ02.js";t();export{e as fromHttp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./dist-es-DPM0mPK5.js";import{homedir as r}from"os";import{join as i,sep as a}from"path";import{createHash as o}from"crypto";import{readFile as s}from"fs/promises";import{readFile as c}from"node:fs/promises";var l,u,d,f=e((()=>{l={},u=()=>process&&process.geteuid?`${process.geteuid()}`:`DEFAULT`,d=()=>{let{HOME:e,USERPROFILE:t,HOMEPATH:n,HOMEDRIVE:i=`C:${a}`}=process.env;if(e)return e;if(t)return t;if(n)return`${i}${n}`;let o=u();return l[o]||(l[o]=r()),l[o]}})),p,m,h=e((()=>{p=`AWS_PROFILE`,m=e=>e.profile||process.env.AWS_PROFILE||`default`})),g,_=e((()=>{f(),g=e=>{let t=o(`sha1`).update(e).digest(`hex`);return i(d(),`.aws`,`sso`,`cache`,`${t}.json`)}})),v,y,b=e((()=>{_(),v={},y=async e=>{if(v[e])return v[e];let t=await s(g(e),`utf8`);return JSON.parse(t)}})),x=e((()=>{})),S,C=e((()=>{n(),x(),S=e=>Object.entries(e).filter(([e])=>{let n=e.indexOf(`.`);return n===-1?!1:Object.values(t).includes(e.substring(0,n))}).reduce((e,[n,r])=>{let i=n.indexOf(`.`),a=n.substring(0,i)===t.PROFILE?n.substring(i+1):n;return e[a]=r,e},{...e.default&&{default:e.default}})})),w,T=e((()=>{f(),w=()=>process.env.AWS_CONFIG_FILE||i(d(),`.aws`,`config`)})),E,D=e((()=>{f(),E=()=>process.env.AWS_SHARED_CREDENTIALS_FILE||i(d(),`.aws`,`credentials`)})),O,k,A,j=e((()=>{n(),x(),O=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,k=[`__proto__`,`profile __proto__`],A=e=>{let n={},r,i;for(let a of e.split(/\r?\n/)){let e=a.split(/(^|\s)[;#]/)[0].trim();if(e[0]===`[`&&e[e.length-1]===`]`){r=void 0,i=void 0;let n=e.substring(1,e.length-1),a=O.exec(n);if(a){let[,e,,n]=a;Object.values(t).includes(e)&&(r=[e,n].join(`.`))}else r=n;if(k.includes(n))throw Error(`Found invalid profile name "${n}"`)}else if(r){let t=e.indexOf(`=`);if(![0,-1].includes(t)){let[o,s]=[e.substring(0,t).trim(),e.substring(t+1).trim()];if(s===``)i=o;else{i&&a.trimStart()===a&&(i=void 0),n[r]=n[r]||{};let e=i?[i,o].join(`.`):o;n[r][e]=s}}}}return n}})),M,N,P,F=e((()=>{M={},N={},P=(e,t)=>N[e]===void 0?((!M[e]||t?.ignoreCache)&&(M[e]=c(e,`utf8`)),M[e]):N[e]})),I,L,R=e((()=>{C(),T(),D(),f(),j(),F(),x(),I=()=>({}),L=async(e={})=>{let{filepath:t=E(),configFilepath:n=w()}=e,r=d(),a=t;t.startsWith(`~/`)&&(a=i(r,t.slice(2)));let o=n;n.startsWith(`~/`)&&(o=i(r,n.slice(2)));let s=await Promise.all([P(o,{ignoreCache:e.ignoreCache}).then(A).then(S).catch(I),P(a,{ignoreCache:e.ignoreCache}).then(A).catch(I)]);return{configFile:s[0],credentialsFile:s[1]}}})),z,B=e((()=>{n(),R(),z=e=>Object.entries(e).filter(([e])=>e.startsWith(t.SSO_SESSION+`.`)).reduce((e,[t,n])=>({...e,[t.substring(t.indexOf(`.`)+1)]:n}),{})})),V,H,U=e((()=>{T(),B(),j(),F(),V=()=>({}),H=async(e={})=>P(e.configFilepath??w()).then(A).then(z).catch(V)})),W,G=e((()=>{W=(...e)=>{let t={};for(let n of e)for(let[e,r]of Object.entries(n))t[e]===void 0?t[e]=r:Object.assign(t[e],r);return t}})),K,q=e((()=>{R(),G(),K=async e=>{let t=await L(e);return W(t.configFile,t.credentialsFile)}})),J,Y=e((()=>{b(),F(),J={getFileRecord(){return N},interceptFile(e,t){N[e]=Promise.resolve(t)},getTokenRecord(){return v},interceptToken(e,t){v[e]=t}}})),X=e((()=>{})),Z=e((()=>{f(),h(),_(),b(),R(),U(),q(),Y(),X(),F()}));export{L as a,g as c,H as i,p as l,J as n,P as o,K as r,y as s,Z as t,m as u};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-80gRi2ZW.js";import{n as r,t as i}from"./dist-es-C41b_0B5.js";import{n as a,t as o}from"./dist-es-ChHe-SVL.js";import{Readable as s,Writable as c}from"node:stream";import{Agent as l,request as u}from"node:https";import d,{constants as f}from"node:http2";function p(e){let t=e&&typeof e==`object`&&`reason`in e?e.reason:void 0;if(t){if(t instanceof Error){let e=Error(`Request aborted`);return e.name=`AbortError`,e.cause=t,e}let e=Error(String(t));return e.name=`AbortError`,e}let n=Error(`Request aborted`);return n.name=`AbortError`,n}var m=e((()=>{})),h,g=e((()=>{h=[`ECONNRESET`,`EPIPE`,`ETIMEDOUT`]})),_,v=e((()=>{_=e=>{let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.join(`,`):r}return t}})),y,b=e((()=>{y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)}})),x,S,C=e((()=>{b(),x=1e3,S=(e,t,n=0)=>{if(!n)return-1;let r=r=>{let i=y.setTimeout(()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:`TimeoutError`}))},n-r),a=e=>{e?.connecting?e.on(`connect`,()=>{y.clearTimeout(i)}):y.clearTimeout(i)};e.socket?a(e.socket):e.on(`socket`,a)};return n<2e3?(r(0),0):y.setTimeout(r.bind(null,x),x)}})),w,T=e((()=>{b(),w=(e,t,n=0,r,i)=>n?y.setTimeout(()=>{let a=`@smithy/node-http-handler - [${r?`ERROR`:`WARN`}] a request has exceeded the configured ${n} ms requestTimeout.`;if(r){let n=Object.assign(Error(a),{name:`TimeoutError`,code:`ETIMEDOUT`});e.destroy(n),t(n)}else a+=` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`,i?.warn?.(a)},n):-1})),E,D,O=e((()=>{b(),E=3e3,D=(e,{keepAlive:t,keepAliveMsecs:n},r=E)=>{if(t!==!0)return-1;let i=()=>{e.socket?e.socket.setKeepAlive(t,n||0):e.on(`socket`,e=>{e.setKeepAlive(t,n||0)})};return r===0?(i(),0):y.setTimeout(i,r)}})),k,A,j=e((()=>{b(),k=3e3,A=(e,t,n=0)=>{let r=r=>{let i=n-r,a=()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:`TimeoutError`}))};e.socket?(e.socket.setTimeout(i,a),e.on(`close`,()=>e.socket?.removeListener(`timeout`,a))):e.setTimeout(i,a)};return 0<n&&n<6e3?(r(0),0):y.setTimeout(r.bind(null,n===0?0:k),k)}}));async function M(e,t,n=P,r=!1){let i=t.headers??{},a=i.Expect||i.expect,o=-1,s=!0;!r&&a===`100-continue`&&(s=await Promise.race([new Promise(e=>{o=Number(y.setTimeout(()=>e(!0),Math.max(P,n)))}),new Promise(t=>{e.on(`continue`,()=>{y.clearTimeout(o),t(!0)}),e.on(`response`,()=>{y.clearTimeout(o),t(!1)}),e.on(`error`,()=>{y.clearTimeout(o),t(!1)})})])),s&&N(e,t.body)}function N(e,t){if(t instanceof s){t.pipe(e);return}if(t){let n=Buffer.isBuffer(t);if(n||typeof t==`string`){n&&t.byteLength===0?e.end():e.end(t);return}let r=t;if(typeof r==`object`&&r.buffer&&typeof r.byteOffset==`number`&&typeof r.byteLength==`number`){e.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}e.end(Buffer.from(t));return}e.end()}var P,F=e((()=>{b(),P=6e3})),I,L,R,z,B=e((()=>{i(),a(),m(),g(),v(),C(),T(),O(),j(),b(),F(),t(),I=0,L=void 0,R=void 0,z=class e{static create(t){return typeof t?.handle==`function`?t:new e(t)}static checkSocketUsage(e,t,n=console){let{sockets:r,requests:i,maxSockets:a}=e;if(typeof a!=`number`||a===1/0||Date.now()-15e3<t)return t;if(r&&i)for(let e in r){let t=r[e]?.length??0,o=i[e]?.length??0;if(t>=a&&o>=2*a)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${t} and ${o} additional requests are enqueued.
|
|
2
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
3
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){n(this,`config`,void 0),n(this,`configProvider`,void 0),n(this,`socketWarningTimestamp`,0),n(this,`externalAgent`,!1),n(this,`metadata`,{handlerProtocol:`http/1.1`}),this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(this.resolveDefaultConfig(e))}).catch(n):t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:n,requestTimeout:i}={}){this.config||(this.config=await this.configProvider);let a=this.config,s=t.protocol===`https:`;return!s&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((c,d)=>{let f,m=[],g=async e=>{await f,m.forEach(y.clearTimeout),c(e)},v=async e=>{await f,m.forEach(y.clearTimeout),d(e)};if(n?.aborted){v(p(n));return}let b=t.headers??{},x=(b.Expect??b.expect)===`100-continue`,C=s?a.httpsAgent:a.httpAgent;x&&!this.externalAgent&&(C=new(s?l:L)({keepAlive:!1,maxSockets:1/0})),m.push(y.setTimeout(()=>{this.socketWarningTimestamp=e.checkSocketUsage(C,this.socketWarningTimestamp,a.logger)},a.socketAcquisitionWarningTimeout??(a.requestTimeout??2e3)+(a.connectionTimeout??1e3)));let T=o(t.query||{}),E;(t.username!=null||t.password!=null)&&(E=`${t.username??``}:${t.password??``}`);let O=t.path;T&&(O+=`?${T}`),t.fragment&&(O+=`#${t.fragment}`);let k=t.hostname??``;k=k[0]===`[`&&k.endsWith(`]`)?t.hostname.slice(1,-1):t.hostname;let j={headers:t.headers,host:k,method:t.method,path:O,port:t.port,agent:C,auth:E},N=(s?u:R)(j,e=>{g({response:new r({statusCode:e.statusCode||-1,reason:e.statusMessage,headers:_(e.headers),body:e})})});if(N.on(`error`,e=>{h.includes(e.code)?v(Object.assign(e,{name:`TimeoutError`})):v(e)}),n){let e=()=>{N.destroy(),v(p(n))};if(typeof n.addEventListener==`function`){let t=n;t.addEventListener(`abort`,e,{once:!0}),N.once(`close`,()=>t.removeEventListener(`abort`,e))}else n.onabort=e}let P=i??a.requestTimeout;m.push(S(N,v,a.connectionTimeout)),m.push(w(N,v,P,a.throwOnRequestTimeout,a.logger??console)),m.push(A(N,v,a.socketTimeout));let F=j.agent;typeof F==`object`&&`keepAlive`in F&&m.push(D(N,{keepAlive:F.keepAlive,keepAliveMsecs:F.keepAliveMsecs})),f=M(N,t,P,this.externalAgent).catch(e=>(m.forEach(y.clearTimeout),d(e)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:n,socketTimeout:r,socketAcquisitionWarningTimeout:i,httpAgent:a,httpsAgent:o,throwOnRequestTimeout:s,logger:c}=e||{};return{connectionTimeout:n,requestTimeout:t,socketTimeout:r,socketAcquisitionWarningTimeout:i,throwOnRequestTimeout:s,httpAgentProvider:async()=>{let{Agent:e,request:t}=await import(`node:http`);return R=t,L=e,a instanceof L||typeof a?.destroy==`function`?(this.externalAgent=!0,a):new L({keepAlive:!0,maxSockets:50,...a})},httpsAgent:o instanceof l||typeof o?.destroy==`function`?(this.externalAgent=!0,o):new l({keepAlive:!0,maxSockets:50,...o}),logger:c}}}})),V,H,U=e((()=>{t(),V=Symbol.iterator,H=class{constructor(e){n(this,`sessions`,[]),this.sessions=e??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter(t=>t!==e)}[V](){return this.sessions[Symbol.iterator]()}destroy(e){for(let t of this.sessions)t===e&&(t.destroyed||t.destroy())}}})),W,G=e((()=>{U(),t(),W=class{constructor(e){if(n(this,`config`,void 0),n(this,`sessionCache`,new Map),this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError(`maxConcurrency must be greater than zero.`)}lease(e,t){let n=this.getUrlString(e),r=this.sessionCache.get(n);if(r){let e=r.poll();if(e&&!this.config.disableConcurrency&&!t.isEventStream)return e}let i=d.connect(n);this.config.maxConcurrency&&i.settings({maxConcurrentStreams:this.config.maxConcurrency},t=>{if(t)throw Error(`Fail to set maxConcurrentStreams to `+this.config.maxConcurrency+`when creating new session for `+e.destination.toString())}),i.unref();let a=()=>{i.destroy(),this.deleteSession(n,i)};i.on(`goaway`,a),i.on(`error`,a),i.on(`frameError`,a),i.on(`close`,()=>this.deleteSession(n,i)),t.requestTimeout&&i.setTimeout(t.requestTimeout,a);let o=this.sessionCache.get(n)||new H;return o.offerLast(i),this.sessionCache.set(n,o),i}deleteSession(e,t){let n=this.sessionCache.get(e);n&&n.contains(t)&&(n.remove(t),this.sessionCache.set(e,n))}release(e,t){let n=this.getUrlString(e);this.sessionCache.get(n)?.offerLast(t)}destroy(){for(let[e,t]of this.sessionCache){for(let e of t)e.destroyed||e.destroy(),t.remove(e);this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError(`maxConcurrentStreams must be greater than zero.`);this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}}})),K,q=e((()=>{i(),a(),m(),v(),G(),F(),t(),K=class e{static create(t){return typeof t?.handle==`function`?t:new e(t)}constructor(e){n(this,`config`,void 0),n(this,`configProvider`,void 0),n(this,`metadata`,{handlerProtocol:`h2`}),n(this,`connectionManager`,new W({})),this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(e||{})}).catch(n):t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:t,requestTimeout:n,isEventStream:i}={}){this.config||(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams??!1),this.config.maxConcurrentStreams&&this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams));let{requestTimeout:a,disableConcurrentStreams:s}=this.config,c=n??a;return new Promise((n,a)=>{let l=!1,u,d=async e=>{await u,n(e)},m=async e=>{await u,a(e)};if(t?.aborted){l=!0,m(p(t));return}let{hostname:h,method:g,port:v,protocol:y,query:b}=e,x=``;(e.username!=null||e.password!=null)&&(x=`${e.username??``}:${e.password??``}@`);let S=`${y}//${x}${h}${v?`:${v}`:``}`,C={destination:new URL(S)},w=this.connectionManager.lease(C,{requestTimeout:this.config?.sessionTimeout,isEventStream:i}),T=e=>{s&&this.destroySession(w),l=!0,m(e)},E=o(b??{}),D=e.path;E&&(D+=`?${E}`),e.fragment&&(D+=`#${e.fragment}`);let O=w.request({...e.headers,[f.HTTP2_HEADER_PATH]:D,[f.HTTP2_HEADER_METHOD]:g});if(w.ref(),O.on(`response`,e=>{let t=new r({statusCode:e[`:status`]??-1,headers:_(e),body:O});l=!0,d({response:t}),s&&(w.close(),this.connectionManager.deleteSession(S,w))}),c&&O.setTimeout(c,()=>{O.close();let e=Error(`Stream timed out because of no activity for ${c} ms`);e.name=`TimeoutError`,T(e)}),t){let e=()=>{O.close(),T(p(t))};if(typeof t.addEventListener==`function`){let n=t;n.addEventListener(`abort`,e,{once:!0}),O.once(`close`,()=>n.removeEventListener(`abort`,e))}else t.onabort=e}O.on(`frameError`,(e,t,n)=>{T(Error(`Frame type id ${e} in stream id ${n} has failed with code ${t}.`))}),O.on(`error`,T),O.on(`aborted`,()=>{T(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${O.rstCode}.`))}),O.on(`close`,()=>{w.unref(),s&&w.destroy(),l||T(Error(`Unexpected error: http2 request did not get a response`))}),u=M(O,e,c)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}destroySession(e){e.destroyed||e.destroy()}}})),J,Y=e((()=>{t(),J=class extends c{constructor(...e){super(...e),n(this,`bufferedBytes`,[])}_write(e,t,n){this.bufferedBytes.push(e),n()}}}));async function X(e){let t=[],n=e.getReader(),r=!1,i=0;for(;!r;){let{done:e,value:a}=await n.read();a&&(t.push(a),i+=a.length),r=e}let a=new Uint8Array(i),o=0;for(let e of t)a.set(e,o),o+=e.length;return a}var Z,Q,$=e((()=>{Y(),Z=e=>Q(e)?X(e):new Promise((t,n)=>{let r=new J;e.pipe(r),e.on(`error`,e=>{r.end(),n(e)}),r.on(`error`,n),r.on(`finish`,function(){t(new Uint8Array(Buffer.concat(this.bufferedBytes)))})}),Q=e=>typeof ReadableStream==`function`&&e instanceof ReadableStream}));e((()=>{B(),q(),$()}))();export{I as DEFAULT_REQUEST_TIMEOUT,K as NodeHttp2Handler,z as NodeHttpHandler,Z as streamCollector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{h as t,t as n}from"./client-CPn1wQyc.js";import{o as r,t as i}from"./dist-es-CUZBYppo.js";import{n as a,r as o,t as s,u as c}from"./dist-es-fjXft-jH.js";import{promisify as l}from"node:util";import{exec as u}from"node:child_process";var d,f=e((()=>{n(),d=(e,n,r)=>{if(n.Version!==1)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(n.Expiration){let t=new Date;if(new Date(n.Expiration)<t)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let i=n.AccountId;!i&&r?.[e]?.aws_account_id&&(i=r[e].aws_account_id);let a={accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...i&&{accountId:i}};return t(a,`CREDENTIALS_PROCESS`,`w`),a}})),p,m=e((()=>{i(),s(),f(),p=async(e,t,n)=>{let i=t[e];if(t[e]){let o=i.credential_process;if(o!==void 0){let i=l(a?.getTokenRecord?.().exec??u);try{let{stdout:n}=await i(o),r;try{r=JSON.parse(n.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return d(e,r,t)}catch(e){throw new r(e.message,{logger:n})}}else throw new r(`Profile ${e} did not contain credential_process.`,{logger:n})}else throw new r(`Profile ${e} could not be found in shared credentials file.`,{logger:n})}})),h,g=e((()=>{s(),m(),h=(e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-process - fromProcess`);let n=await o(e);return p(c({profile:e.profile??t?.profile}),n,e.logger)}})),_=e((()=>{g()}));export{h as n,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./dist-es-C-1vn4OP2.js";t();export{e as fromIni};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,n,o as r,r as i,t as a}from"./dist-es-CUZBYppo.js";import{a as o,t as s,u as c}from"./dist-es-fjXft-jH.js";function l(e){try{let t=new Set(Array.from(e.match(/([A-Z_]){3,}/g)??[]));return t.delete(`CONFIG`),t.delete(`CONFIG_PREFIX_SEPARATOR`),t.delete(`ENV`),[...t].join(`, `)}catch{return e}}var u=e((()=>{})),d,f=e((()=>{a(),u(),d=(e,t)=>async()=>{try{let n=e(process.env,t);if(n===void 0)throw Error();return n}catch(n){throw new r(n.message||`Not found in ENV: ${l(e.toString())}`,{logger:t?.logger})}}})),p,m=e((()=>{a(),s(),u(),p=(e,{preferredFile:t=`config`,...n}={})=>async()=>{let i=c(n),{configFile:a,credentialsFile:s}=await o(n),u=s[i]||{},d=a[i]||{},f=t===`config`?{...u,...d}:{...d,...u};try{let n=e(f,t===`config`?a:s);if(n===void 0)throw Error();return n}catch(t){throw new r(t.message||`Not found in config files w/ profile [${i}]: ${l(e.toString())}`,{logger:n.logger})}}})),h,g,_=e((()=>{a(),h=e=>typeof e==`function`,g=e=>h(e)?async()=>await e():i(e)})),v,y=e((()=>{a(),f(),m(),_(),v=({environmentVariableSelector:e,configFileSelector:r,default:i},a={})=>{let{signingName:o,logger:s}=a;return n(t(d(e,{signingName:o,logger:s}),p(r,a),g(i)))}})),b=e((()=>{y()}));export{v as n,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import*as t from"path";import{fileURLToPath as n}from"url";var r,i,a,o=e((()=>{r=n(import.meta.url),i=t.dirname(r),a=(()=>{let e=i.split(t.sep),n=e.lastIndexOf(`dist`);if(n!==-1)return e.slice(0,n+1).join(t.sep);let r=e.lastIndexOf(`src`);return r===-1?i:e.slice(0,r).join(t.sep)})()}));export{o as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Doctor-BXb0qv6n.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./earlyInput-tRkbxFv2.js";export{e as startCapturingEarlyInput};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as e,s as t}from"./intl-Pse97ORk.js";t();var n=``,r=!1,i=null,a=null;function o(){if(!(!process.stdin.isTTY||r||process.argv.includes(`-p`)||process.argv.includes(`--print`))){r=!0,n=``;try{process.stdin.setEncoding(`utf8`),process.stdin.setRawMode(!0),process.stdin.ref(),i=()=>{let e=process.stdin.read();for(;e!==null;)typeof e==`string`&&s(e),e=process.stdin.read()},process.stdin.on(`readable`,i),a=setTimeout(()=>{r&&c()},1e4),a&&typeof a==`object`&&`unref`in a&&a.unref()}catch{r=!1}}}function s(t){let r=0;for(;r<t.length;){let i=t[r],a=i.charCodeAt(0);if(a===3){c(),process.exit(130);return}if(a===4){c();return}if(a===127||a===8){if(n.length>0){let t=e(n);n=n.slice(0,-(t.length||1))}r++;continue}if(a===27){if(r++,r>=t.length)continue;let e=t.charCodeAt(r);if(e===91){for(r++;r<t.length&&t.charCodeAt(r)>=32&&t.charCodeAt(r)<=63;)r++;r<t.length&&t.charCodeAt(r)>=64&&t.charCodeAt(r)<=126&&r++;continue}if(e===80||e===93||e===88||e===94){for(r++;r<t.length;){if(t.charCodeAt(r)===7){r++;break}if(t.charCodeAt(r)===27&&r+1<t.length&&t.charCodeAt(r+1)===92){r+=2;break}r++}continue}r<t.length&&r++;continue}if(a<32&&a!==9&&a!==10&&a!==13){r++;continue}if(a===13){n+=`
|
|
2
|
+
`,r++;continue}n+=i,r++}}function c(){if(r){r=!1,a&&(clearTimeout(a),a=null),i&&(process.stdin.removeListener(`readable`,i),i=null);try{process.stdin.unref()}catch{}}}function l(){c();let e=n.trim();return n=``,e}function u(e){n=e}export{c as i,u as n,o as r,l as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{t as r}from"./jsx-runtime-D-D469L8.js";import{lo as i,oo as a}from"./paths-BBvuDQl9.js";import{n as o,r as s}from"./analytics-DqMQntaB.js";import{GA as c,JA as l,KA as u,MS as d,PS as f,QA as p,ZA as m,aj as h,jS as g}from"./loadAgentsDir-DI1a76pd.js";import{n as _,t as v}from"./useMainLoopModel-CwvuTRXn.js";function y(e){let t=h(e);if(t!==void 0){let e=i(`userSettings`,{effortLevel:t});if(e.error)return{message:`Failed to set effort level: ${e.error.message}`}}s(`tengu_effort_command`,{effort:e});let n=u();if(n!==void 0&&n!==e){let n=process.env.CLAUDE_CODE_EFFORT_LEVEL;return t===void 0?{message:`Not applied: CLAUDE_CODE_EFFORT_LEVEL=${n} overrides effort this session, and ${e} is session-only (nothing saved)`,effortUpdate:{value:e}}:{message:`CLAUDE_CODE_EFFORT_LEVEL=${n} overrides this session — clear it and ${e} takes over`,effortUpdate:{value:e}}}let r=l(e);return{message:`Set effort level to ${e}${t===void 0?` (this session only)`:``}: ${r}`,effortUpdate:{value:e}}}function b(e,t){let n=u(),r=n===null?void 0:n??e;return r===void 0?{message:`Effort level: auto (currently ${c(t,e)})`}:{message:`Current effort level: ${r} (${l(r)})`}}function x(){let e=i(`userSettings`,{effortLevel:void 0});return e.error?{message:`Failed to set effort level: ${e.error.message}`}:(s(`tengu_effort_command`,{effort:`auto`}),u()==null?{message:`Effort level set to auto`,effortUpdate:{value:void 0}}:{message:`Cleared effort from settings, but CLAUDE_CODE_EFFORT_LEVEL=${process.env.CLAUDE_CODE_EFFORT_LEVEL} still controls this session`,effortUpdate:{value:void 0}})}function S(e){let t=e.toLowerCase();return t===`auto`||t===`unset`?x():p(t)?y(t):{message:`Invalid argument: ${e}. Valid options are: low, medium, high, max, auto`}}function C({onDone:e}){let{message:t}=b(d(e=>e.effortValue),_());return e(t),null}function w({result:e,onDone:t}){let n=f(),{effortUpdate:r,message:i}=e;return E.useEffect(()=>{r&&n(e=>({...e,effortValue:r.value})),t(i)},[n,r,i,t]),null}async function T(e,t,n){if(n=n?.trim()||``,O.includes(n)){e(`Usage: /effort [low|medium|high|xhigh|max|auto]
|
|
2
|
+
|
|
3
|
+
Effort levels:
|
|
4
|
+
- low: Quick, straightforward implementation
|
|
5
|
+
- medium: Balanced approach with standard testing
|
|
6
|
+
- high: Comprehensive implementation with extensive testing
|
|
7
|
+
- xhigh: Extended reasoning beyond high, short of max; including ChatGPT Codex models
|
|
8
|
+
- max: Maximum capability with deepest reasoning; maps to xhigh for ChatGPT Codex models
|
|
9
|
+
- auto: Use the default effort level for your model`);return}return!n||n===`current`||n===`status`?(0,D.jsx)(C,{onDone:e}):(0,D.jsx)(w,{result:S(n),onDone:e})}var E,D,O;e((()=>{E=t(n(),1),v(),o(),g(),m(),a(),D=r(),O=[`help`,`-h`,`--help`]}))();export{T as call,S as executeEffort,b as showCurrentEffort};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./classPrivateFieldSet2-EAQNhHs8.js";import{Cn as f,Ln as p,Mn as m,Tt as h,Xn as g,Yn as _,_r as v,kt as y,nn as b,un as x,vt as ee,wn as S}from"./schemas-BGAvj1T4.js";import{t as te}from"./v4-f1i_CNUT.js";import{cn as ne,jr as C,lr as re}from"./state-sIHsFpDu.js";import{Ac as ie,Dr as ae,Pr as oe,_c as se,no as ce,oo as le}from"./paths-BBvuDQl9.js";import{Ar as ue,Ci as de,G as fe,Gi as pe,HE as me,K as he,Ku as ge,Of as _e,UE as ve,Xi as ye,_r as be,_v as xe,fp as Se,kf as Ce,pp as we,qu as Te,va as Ee,vv as De,ya as Oe}from"./loadAgentsDir-DI1a76pd.js";import{Bn as ke,Vn as Ae}from"./prompt-CjFAtm3w.js";import{o as je,t as Me}from"./fileStateCache-C7-TxF8G.js";import{t as Ne}from"./QueryEngine-C_KZts4y.js";import*as w from"node:path";import{randomUUID as Pe}from"node:crypto";import{Readable as Fe,Writable as Ie}from"node:stream";te();var T={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},E={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},Le=S({_meta:m(p(),g()).nullish(),terminal:y().optional().default(!1)}),Re=S({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:y().optional().default(!1),secret:y().optional().default(!0)}),ze=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Be=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Re)}),Ve=S({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),He=_([Be.and(S({type:x(`env_var`)})),Ve.and(S({type:x(`terminal`)})),ze]),Ue=S({_meta:m(p(),g()).nullish(),methodId:p()}),We=S({_meta:m(p(),g()).nullish()}),Ge=S({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ke=S({default:y().nullish(),description:p().nullish(),title:p().nullish()}),qe=S({_meta:m(p(),g()).nullish()}),Je=S({_meta:m(p(),g()).nullish()}),Ye=S({amount:f(),currency:p()}),Xe=S({_meta:m(p(),g()).nullish(),terminalId:p()}),Ze=S({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),Qe=_([p(),f(),f(),y(),h(p())]),$e=b(_([S({content:m(p(),Qe).nullish()}).and(S({action:x(`accept`)})),S({action:x(`decline`)}),S({action:x(`cancel`)})]),S({_meta:m(p(),g()).nullish()})),et=S({_meta:m(p(),g()).nullish()}),tt=p(),nt=S({_meta:m(p(),g()).nullish(),elicitationId:tt}),rt=x(`object`),it=x(`string`),at=S({_meta:m(p(),g()).nullish()}),ot=S({_meta:m(p(),g()).nullish(),form:et.nullish(),url:at.nullish()}),st=S({const:p(),title:p()}),ct=S({_meta:m(p(),g()).nullish(),name:p(),value:p()}),lt=S({code:_([x(-32700),x(-32600),x(-32601),x(-32602),x(-32603),x(-32800),x(-32e3),x(-32002),x(-32042),f().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:g().optional(),message:p()}),ut=g(),dt=g(),ft=g(),pt=S({_meta:m(p(),g()).nullish(),readTextFile:y().optional().default(!1),writeTextFile:y().optional().default(!1)}),mt=S({_meta:m(p(),g()).nullish(),name:p(),value:p()}),ht=S({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),gt=S({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),_t=S({_meta:m(p(),g()).nullish()}),vt=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),yt=S({_meta:m(p(),g()).nullish()}),bt=S({_meta:m(p(),g()).nullish(),logout:yt.nullish()}),xt=S({_meta:m(p(),g()).nullish()}),St=S({_meta:m(p(),g()).nullish()}),Ct=S({_meta:m(p(),g()).nullish(),http:y().optional().default(!1),sse:y().optional().default(!1)}),wt=S({_meta:m(p(),g()).nullish(),headers:h(mt),name:p(),url:p()}),Tt=S({_meta:m(p(),g()).nullish(),headers:h(mt),name:p(),url:p()}),Et=S({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(ct),name:p()}),D=_([wt.and(S({type:x(`http`)})),Tt.and(S({type:x(`sse`)})),Et]),Dt=p(),Ot=S({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:Dt,name:p()}),kt=_([x(`error`),x(`warning`),x(`information`),x(`hint`)]),At=S({_meta:m(p(),g()).nullish()}),jt=S({_meta:m(p(),g()).nullish()}),Mt=S({_meta:m(p(),g()).nullish()}),Nt=S({_meta:m(p(),g()).nullish()}),Pt=S({_meta:m(p(),g()).nullish()}),Ft=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),It=S({diff:p(),uri:p()}),Lt=S({endLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:p()}),Rt=S({_meta:m(p(),g()).nullish()}),zt=S({_meta:m(p(),g()).nullish()}),Bt=S({languageId:p(),text:p(),uri:p()}),Vt=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Ht=_([x(`rejected`),x(`ignored`),x(`replaced`),x(`cancelled`)]),Ut=S({excerpts:h(Lt),uri:p()}),Wt=S({_meta:m(p(),g()).nullish()}),Gt=S({_meta:m(p(),g()).nullish()}),Kt=S({name:p(),owner:p(),remoteUrl:p()}),qt=S({_meta:m(p(),g()).nullish()}),Jt=S({_meta:m(p(),g()).nullish(),jump:Rt.nullish(),rename:Gt.nullish(),searchAndReplace:qt.nullish()}),Yt=S({id:p(),isRegex:y().nullish(),replace:p(),search:p(),uri:p()}),Xt=_([x(`automatic`),x(`diagnostic`),x(`manual`)]),Zt=S({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Qt=S({_meta:m(p(),g()).nullish(),diagnostics:At.nullish(),editHistory:Ft.nullish(),openFiles:zt.nullish(),recentFiles:Vt.nullish(),relatedSnippets:Wt.nullish(),userActions:Zt.nullish()}),$t=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),en=S({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),tn=p(),nn=_([x(`allow_once`),x(`allow_always`),x(`reject_once`),x(`reject_always`)]),rn=S({_meta:m(p(),g()).nullish(),kind:nn,name:p(),optionId:tn}),an=_([x(`high`),x(`medium`),x(`low`)]),on=_([x(`pending`),x(`in_progress`),x(`completed`)]),sn=S({_meta:m(p(),g()).nullish(),content:p(),priority:an,status:on}),cn=S({_meta:m(p(),g()).nullish(),entries:h(sn)}),O=S({character:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),ln=S({id:p(),position:O,uri:p()}),un=S({id:p(),newName:p(),position:O,uri:p()}),dn=S({action:p(),position:O,timestampMs:f(),uri:p()}),fn=_([x(`utf-16`),x(`utf-32`),x(`utf-8`)]),pn=S({_meta:m(p(),g()).nullish(),auth:Le.optional().default({terminal:!1}),elicitation:ot.nullish(),fs:pt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Jt.nullish(),positionEncodings:h(fn).optional(),terminal:y().optional().default(!1)}),mn=S({_meta:m(p(),g()).nullish(),audio:y().optional().default(!1),embeddedContext:y().optional().default(!1),image:y().optional().default(!1)}),hn=f().int().gte(0).lte(65535),gn=S({_meta:m(p(),g()).nullish(),clientCapabilities:pn.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:ht.nullish(),protocolVersion:hn}),k=S({end:O,start:O}),_n=S({message:p(),range:k,severity:kt,uri:p()}),vn=S({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:k.nullish()}),yn=S({_meta:m(p(),g()).nullish(),diagnostics:h(_n).nullish(),editHistory:h(It).nullish(),openFiles:h(vn).nullish(),recentFiles:h(Bt).nullish(),relatedSnippets:h(Ut).nullish(),userActions:h(dn).nullish()}),bn=S({newText:p(),range:k}),xn=_([S({cursorPosition:O.nullish(),edits:h(bn),id:p(),uri:p()}).and(S({kind:x(`edit`)})),ln.and(S({kind:x(`jump`)})),un.and(S({kind:x(`rename`)})),Yt.and(S({kind:x(`searchAndReplace`)}))]),Sn=S({_meta:m(p(),g()).nullish(),content:p()}),Cn=S({_meta:m(p(),g()).nullish()}),A=_([f(),p()]).nullable();S({_meta:m(p(),g()).nullish(),requestId:A});var wn=S({requestId:A}),Tn=ee([`assistant`,`user`]),j=S({_meta:m(p(),g()).nullish(),audience:h(Tn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),En=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),data:p(),mimeType:p()}),Dn=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),On=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),kn=S({_meta:m(p(),g()).nullish(),optionId:tn}),An=_([S({outcome:x(`cancelled`)}),kn.and(S({outcome:x(`selected`)}))]),jn=S({_meta:m(p(),g()).nullish(),outcome:An}),Mn=S({_meta:m(p(),g()).nullish()}),Nn=S({_meta:m(p(),g()).nullish()}),Pn=S({currentValue:y()}),Fn=p(),In=p(),Ln=_([x(`mode`),x(`model`),x(`thought_level`),p()]),M=p(),Rn=S({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:M}),zn=S({_meta:m(p(),g()).nullish(),group:Fn,name:p(),options:h(Rn)}),N=b(_([S({currentValue:M,options:_([h(Rn),h(zn)])}).and(S({type:x(`select`)})),Pn.and(S({type:x(`boolean`)}))]),S({_meta:m(p(),g()).nullish(),category:Ln.nullish(),description:p().nullish(),id:In,name:p()})),Bn=S({_meta:m(p(),g()).nullish(),configOptions:h(N)}),Vn=S({_meta:m(p(),g()).nullish()}),P=p(),Hn=S({_meta:m(p(),g()).nullish(),id:p(),sessionId:P}),Un=S({_meta:m(p(),g()).nullish(),sessionId:P}),Wn=S({_meta:m(p(),g()).nullish(),sessionId:P}),Gn=S({_meta:m(p(),g()).nullish(),sessionId:P}),Kn=S({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(ct).optional(),outputByteLimit:f().nullish(),sessionId:P}),qn=S({_meta:m(p(),g()).nullish(),sessionId:P,uri:p()}),Jn=S({_meta:m(p(),g()).nullish(),position:O,sessionId:P,uri:p(),version:f(),visibleRange:k}),Yn=S({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:P,text:p(),uri:p(),version:f()}),Xn=S({_meta:m(p(),g()).nullish(),sessionId:P,uri:p()}),Zn=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:P}),Qn=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),$n=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:P}),er=S({_meta:m(p(),g()).nullish(),limit:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p(),sessionId:P}),tr=S({_meta:m(p(),g()).nullish(),id:p(),reason:Ht.nullish(),sessionId:P}),nr=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),rr=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:P}),ir=S({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:P,title:p().nullish(),updatedAt:p().nullish()}),ar=S({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(ir)}),or=S({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),sr=S({_meta:m(p(),g()).nullish()}),F=p(),cr=S({_meta:m(p(),g()).nullish(),currentModeId:F}),lr=S({_meta:m(p(),g()).nullish(),description:p().nullish(),id:F,name:p()}),I=S({_meta:m(p(),g()).nullish(),availableModes:h(lr),currentModeId:F}),L=S({_meta:m(p(),g()).nullish(),availableModels:h(Ot),currentModelId:Dt}),ur=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish(),sessionId:P}),dr=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish()}),fr=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish(),sessionId:P}),pr=S({_meta:m(p(),g()).nullish(),configOptions:h(N).nullish(),models:L.nullish(),modes:I.nullish()}),mr=S({_meta:m(p(),g()).nullish()}),hr=S({_meta:m(p(),g()).nullish(),additionalDirectories:Mn.nullish(),close:Nn.nullish(),fork:Vn.nullish(),list:sr.nullish(),resume:mr.nullish()}),gr=b(_([S({type:x(`boolean`),value:y()}),S({value:M})]),S({_meta:m(p(),g()).nullish(),configId:In,sessionId:P})),_r=S({_meta:m(p(),g()).nullish(),configOptions:h(N)}),vr=S({_meta:m(p(),g()).nullish(),modeId:F,sessionId:P}),yr=S({_meta:m(p(),g()).nullish()}),br=S({_meta:m(p(),g()).nullish(),modelId:Dt,sessionId:P}),xr=S({_meta:m(p(),g()).nullish()}),Sr=S({_meta:m(p(),g()).nullish(),sessionId:P}),Cr=_([x(`end_turn`),x(`max_tokens`),x(`max_turn_requests`),x(`refusal`),x(`cancelled`)]),wr=_([x(`email`),x(`uri`),x(`date`),x(`date-time`)]),Tr=S({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:wr.nullish(),maxLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:h(st).nullish(),pattern:p().nullish(),title:p().nullish()}),Er=S({_meta:m(p(),g()).nullish(),context:yn.nullish(),position:O,selection:k.nullish(),sessionId:P,triggerKind:Xt,uri:p(),version:f()}),Dr=S({_meta:m(p(),g()).nullish(),suggestions:h(xn)}),Or=S({_meta:m(p(),g()).nullish(),terminalId:p()}),kr=S({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),Ar=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),jr=S({_meta:m(p(),g()).nullish(),exitStatus:kr.nullish(),output:p(),truncated:y()}),Mr=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),text:p()}),Nr=S({range:k.nullish(),text:p()}),Pr=S({_meta:m(p(),g()).nullish(),contentChanges:h(Nr),sessionId:P,uri:p(),version:f()});S({method:p(),params:_([Un,Yn,Pr,qn,Xn,Jn,Hn,tr,ut]).nullish()});var Fr=_([x(`full`),x(`incremental`)]),Ir=S({_meta:m(p(),g()).nullish(),syncKind:Fr}),Lr=S({_meta:m(p(),g()).nullish(),didChange:Ir.nullish(),didClose:jt.nullish(),didFocus:Mt.nullish(),didOpen:Nt.nullish(),didSave:Pt.nullish()}),Rr=S({_meta:m(p(),g()).nullish(),document:Lr.nullish()}),zr=S({_meta:m(p(),g()).nullish(),context:Qt.nullish(),events:Rr.nullish()}),Br=S({_meta:m(p(),g()).nullish(),auth:bt.optional().default({}),loadSession:y().optional().default(!1),mcpCapabilities:Ct.optional().default({http:!1,sse:!1}),nes:zr.nullish(),positionEncoding:fn.nullish(),promptCapabilities:mn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:hr.optional().default({})}),Vr=S({_meta:m(p(),g()).nullish(),agentCapabilities:Br.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:ht.nullish(),authMethods:h(He).optional().default([]),protocolVersion:hn}),Hr=_([S({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Ge]),Ur=S({_meta:m(p(),g()).nullish(),annotations:j.nullish(),resource:Hr}),R=_([Mr.and(S({type:x(`text`)})),Dn.and(S({type:x(`image`)})),En.and(S({type:x(`audio`)})),On.and(S({type:x(`resource_link`)})),Ur.and(S({type:x(`resource`)}))]),Wr=S({_meta:m(p(),g()).nullish(),content:R}),z=S({_meta:m(p(),g()).nullish(),content:R,messageId:p().nullish()}),Gr=S({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(R),sessionId:P}),Kr=S({anyOf:h(st)}),qr=_([Wr.and(S({type:x(`content`)})),Ze.and(S({type:x(`diff`)})),Or.and(S({type:x(`terminal`)}))]),B=p(),Jr=S({sessionId:P,toolCallId:B.nullish()}),Yr=b(_([Jr,wn]),S({elicitationId:tt,url:p().url()})),Xr=S({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),Zr=_([x(`pending`),x(`in_progress`),x(`completed`),x(`failed`)]),Qr=_([x(`read`),x(`edit`),x(`delete`),x(`move`),x(`search`),x(`execute`),x(`think`),x(`fetch`),x(`switch_mode`),x(`other`)]),$r=S({_meta:m(p(),g()).nullish(),content:h(qr).optional(),kind:Qr.optional(),locations:h(Xr).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:Zr.optional(),title:p(),toolCallId:B}),ei=S({_meta:m(p(),g()).nullish(),content:h(qr).nullish(),kind:Qr.nullish(),locations:h(Xr).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:Zr.nullish(),title:p().nullish(),toolCallId:B}),ti=S({_meta:m(p(),g()).nullish(),options:h(rn),sessionId:P,toolCall:ei}),ni=S({_meta:m(p(),g()).nullish(),hint:p()}),ri=S({_meta:m(p(),g()).nullish(),description:p(),input:ni.nullish(),name:p()}),ii=S({_meta:m(p(),g()).nullish(),availableCommands:h(ri)}),ai=_([S({enum:h(p()),type:it}),Kr]),oi=S({default:h(p()).nullish(),description:p().nullish(),items:ai,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),si=_([Tr.and(S({type:x(`string`)})),en.and(S({type:x(`number`)})),gt.and(S({type:x(`integer`)})),Ke.and(S({type:x(`boolean`)})),oi.and(S({type:x(`array`)}))]),ci=S({description:p().nullish(),properties:m(p(),si).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:rt.optional().default(`object`)}),li=b(_([b(_([Jr,wn]),S({requestedSchema:ci})).and(S({mode:x(`form`)})),Yr.and(S({mode:x(`url`)}))]),S({_meta:m(p(),g()).nullish(),message:p()})),ui=S({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([S({id:A,result:_([Vr,We,St,fr,dr,ar,ur,pr,Je,yr,_r,S({_meta:m(p(),g()).nullish(),stopReason:Cr,usage:ui.nullish(),userMessageId:p().nullish()}),xr,Sr,Dr,qe,ft])}),S({error:lt,id:A})]);var di=S({_meta:m(p(),g()).nullish(),cost:Ye.nullish(),size:f(),used:f()}),fi=_([z.and(S({sessionUpdate:x(`user_message_chunk`)})),z.and(S({sessionUpdate:x(`agent_message_chunk`)})),z.and(S({sessionUpdate:x(`agent_thought_chunk`)})),$r.and(S({sessionUpdate:x(`tool_call`)})),ei.and(S({sessionUpdate:x(`tool_call_update`)})),cn.and(S({sessionUpdate:x(`plan`)})),ii.and(S({sessionUpdate:x(`available_commands_update`)})),cr.and(S({sessionUpdate:x(`current_mode_update`)})),Bn.and(S({sessionUpdate:x(`config_option_update`)})),or.and(S({sessionUpdate:x(`session_info_update`)})),di.and(S({sessionUpdate:x(`usage_update`)}))]),pi=S({_meta:m(p(),g()).nullish(),sessionId:P,update:fi});S({method:p(),params:_([pi,nt,ut]).nullish()});var mi=S({_meta:m(p(),g()).nullish(),sessionId:P,terminalId:p()}),hi=S({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),gi=S({name:p(),uri:p()}),_i=S({_meta:m(p(),g()).nullish(),repository:Kt.nullish(),workspaceFolders:h(gi).nullish(),workspaceUri:p().nullish()});S({id:A,method:p(),params:_([gn,Ue,xt,$t,$n,vt,Zn,rr,Gn,vr,gr,Gr,br,_i,Er,Wn,dt]).nullish()});var vi=S({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:P});S({id:A,method:p(),params:_([vi,er,ti,Kn,Ar,nr,mi,Qn,li,dt]).nullish()}),_([S({id:A,result:_([S({_meta:m(p(),g()).nullish()}),Sn,jn,Xe,jr,Cn,hi,_t,$e,ft])}),S({error:lt,id:A})]),e(),d(),r(),s(),i(),o();function yi(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
|
2
|
+
`);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
|
|
3
|
+
`,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}te();var bi,V=new WeakMap,xi=class{constructor(e,t){l(this,V,void 0);let n=e(this);u(V,this,new Ei(async(e,t)=>{switch(e){case T.initialize:{let e=gn.parse(t);return n.initialize(e)}case T.session_new:{let e=$t.parse(t);return n.newSession(e)}case T.session_load:{if(!n.loadSession)throw Z.methodNotFound(e);let r=$n.parse(t);return n.loadSession(r)}case T.session_list:{if(!n.listSessions)throw Z.methodNotFound(e);let r=vt.parse(t);return n.listSessions(r)}case T.session_fork:{if(!n.unstable_forkSession)throw Z.methodNotFound(e);let r=Zn.parse(t);return n.unstable_forkSession(r)}case T.session_resume:{if(!n.unstable_resumeSession)throw Z.methodNotFound(e);let r=rr.parse(t);return n.unstable_resumeSession(r)}case T.session_close:{if(!n.unstable_closeSession)throw Z.methodNotFound(e);let r=Gn.parse(t);return n.unstable_closeSession(r)}case T.session_set_mode:{if(!n.setSessionMode)throw Z.methodNotFound(e);let r=vr.parse(t);return await n.setSessionMode(r)??{}}case T.authenticate:{let e=Ue.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=xt.parse(t);return await n.unstable_logout(r)??{}}case T.session_prompt:{let e=Gr.parse(t);return n.prompt(e)}case T.session_set_model:{if(!n.unstable_setSessionModel)throw Z.methodNotFound(e);let r=br.parse(t);return await n.unstable_setSessionModel(r)??{}}case T.session_set_config_option:{if(!n.setSessionConfigOption)throw Z.methodNotFound(e);let r=gr.parse(t);return n.setSessionConfigOption(r)}case T.nes_start:{if(!n.unstable_startNes)throw Z.methodNotFound(e);let r=_i.parse(t);return n.unstable_startNes(r)}case T.nes_suggest:{if(!n.unstable_suggestNes)throw Z.methodNotFound(e);let r=Er.parse(t);return n.unstable_suggestNes(r)}case T.nes_close:{if(!n.unstable_closeNes)throw Z.methodNotFound(e);let r=Wn.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z.methodNotFound(e)}},async(e,t)=>{switch(e){case T.session_cancel:{let e=Un.parse(t);return n.cancel(e)}case T.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=Yn.parse(t);return n.unstable_didOpenDocument(e)}case T.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Pr.parse(t);return n.unstable_didChangeDocument(e)}case T.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=qn.parse(t);return n.unstable_didCloseDocument(e)}case T.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=Xn.parse(t);return n.unstable_didSaveDocument(e)}case T.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=Jn.parse(t);return n.unstable_didFocusDocument(e)}case T.nes_accept:{if(!n.unstable_acceptNes)return;let e=Hn.parse(t);return n.unstable_acceptNes(e)}case T.nes_reject:{if(!n.unstable_rejectNes)return;let e=tr.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(V,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(V,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(V,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(V,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Si((await c(V,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(V,this))}async unstable_createElicitation(e){return await c(V,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(V,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(V,this).sendRequest(e,t)}async extNotification(e,t){return await c(V,this).sendNotification(e,t)}get signal(){return c(V,this).signal}get closed(){return c(V,this).closed}},H=new WeakMap,U=new WeakMap;bi=Symbol.asyncDispose;var Si=class{constructor(e,n,r){t(this,`id`,void 0),l(this,H,void 0),l(this,U,void 0),this.id=e,u(H,this,n),u(U,this,r)}async currentOutput(){return await c(U,this).sendRequest(E.terminal_output,{sessionId:c(H,this),terminalId:this.id})}async waitForExit(){return await c(U,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(H,this),terminalId:this.id})}async kill(){return await c(U,this).sendRequest(E.terminal_kill,{sessionId:c(H,this),terminalId:this.id})??{}}async release(){return await c(U,this).sendRequest(E.terminal_release,{sessionId:c(H,this),terminalId:this.id})??{}}async[bi](){await this.release()}},W=new WeakMap,G=new WeakMap,Ci=new WeakMap,wi=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ti=new WeakMap,Y=new WeakSet,Ei=class{constructor(e,t,r){a(this,Y),l(this,W,new Map),l(this,G,0),l(this,Ci,void 0),l(this,wi,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ti,void 0),u(Ci,this,e),u(wi,this,t),u(K,this,r),u(Ti,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Di).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ti,this)}async sendRequest(e,t){var r,i;n(Y,this,Ni).call(this);let a=(u(G,this,(r=c(G,this),i=r++,r)),i),o=new Promise((e,t)=>{c(W,this).set(a,{resolve:e,reject:t})});return await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(Y,this,Ni).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Di(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,ki).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(Y,this,X).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(Y,this,Oi).call(this,e)}}function Oi(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(W,this).values())e.reject(t);c(W,this).clear(),c(J,this).abort(t)}async function ki(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Ai).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(Y,this,ji).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Mi).call(this,e):console.error(`Invalid message`,{message:e})}async function Ai(e,t){try{return{result:await c(Ci,this).call(this,e,t)??null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof v)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}async function ji(e,t){try{return await c(wi,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof v)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}function Mi(e){let t=c(W,this).get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new Z(n,r,i))}c(W,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ni(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Oi).call(this,e)})),c(q,this)}var Z=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};ne(),ie(),le(),Ae(),je(),ve(),De(),Te(),ye(),ue(),he();var Pi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Fi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Ii(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=Fi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!Pi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Li(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ri=256;function zi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ri?t:t.slice(0,Ri-1)+`…`}function Bi(e,t){if(!t)return e;let n=w.resolve(t),r=w.resolve(e);return r.startsWith(n+w.sep)||r===n?w.relative(n,r).replaceAll(`\\`,`/`):e}function Vi(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
|
|
4
|
+
`+e+(e.endsWith(`
|
|
5
|
+
`)?``:`
|
|
6
|
+
`)+t}function Q(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let n=i?.command??`Terminal`,r=i?.description;return{title:n,kind:`execute`,content:t?[{type:`terminal`,terminalId:e.id}]:r?[{type:`content`,content:{type:`text`,text:r}}]:[]}}case`Read`:{let e=i?.file_path??`File`,t=i?.offset,r=i?.limit,a=``;return r&&r>0?a=` (${t??1} - ${(t??1)+r-1})`:t&&(a=` (from line ${t})`),{title:`Read ${e?Bi(e,n):`File`}${a}`,kind:`read`,locations:e?[{path:e,line:t??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Bi(e,n):void 0;return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:e?[{path:e}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Bi(e,n):void 0;return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:t||null,newText:r}]:[],locations:e?[{path:e}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,n=`Find`;return e&&(n+=` \`${e}\``),t&&(n+=` \`${t}\``),{title:n,kind:`search`,content:[],locations:e?[{path:e}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function Hi(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Ui(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Vi(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Vi(e.text)}:Wi(e,!1)}))}:{};case`Bash`:{let e=``,a=+!!r,o=String(t.id);if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
|
|
7
|
+
`),a=t.return_code??+!!r}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
8
|
+
`));return n?{content:[{type:`terminal`,terminalId:o}],_meta:{terminal_info:{terminal_id:o},terminal_output:{terminal_id:o,data:e},terminal_exit:{terminal_id:o,exit_code:a,signal:null}}}:e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return Ui(i??``,r)}}function Ui(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Wi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Wi(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_search_result`:return n(`${e.title} (${e.url})`);case`web_search_tool_result_error`:return n(`Error: ${e.error_code}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
|
|
9
|
+
`)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function Gi(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Ki(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5;try{for(;!r.aborted;){let s=await Gi(t,r);if(s.done||r.aborted)break;let p=s.value;if(p!=null)switch(p.type){case`system`:p.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
10
|
+
|
|
11
|
+
Compacting completed.`}}}));break;case`result`:{let t=p.usage;t&&(l.inputTokens+=t.input_tokens,l.outputTokens+=t.output_tokens,l.cachedReadTokens+=t.cache_read_input_tokens,l.cachedWriteTokens+=t.cache_creation_input_tokens);let i=p.modelUsage;if(i&&d){let e=Qi(i,d);e?.contextWindow&&(f=e.contextWindow)}let a=u??l.inputTokens+l.outputTokens+l.cachedReadTokens+l.cachedWriteTokens,o=p.total_cost_usd;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:a,size:f,cost:o==null?void 0:{amount:o,currency:`USD`}}});let s=p.subtype,m=p.is_error;if(r.aborted){c=`cancelled`;break}switch(s){case`success`:p.stop_reason===`max_tokens`&&(c=`max_tokens`),m&&(c=`end_turn`);break;case`error_during_execution`:c=p.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=Ji(p,e,i,n,{clientCapabilities:a,cwd:o});for(let e of t)await n.sessionUpdate(e);break}case`assistant`:{let t=p.message,r=p.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(e.input_tokens??0)+(e.output_tokens??0)+(e.cache_read_input_tokens??0)+(e.cache_creation_input_tokens??0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s=qi(p,e,i,n,{clientCapabilities:a,cwd:o});for(let e of s)await n.sessionUpdate(e);break}case`user`:break;case`progress`:{let t=p.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
12
|
+
|
|
13
|
+
Compacting completed.`}}});break;default:break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}function qi(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;return o?typeof o==`string`?[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:o}}}]:$(o,`assistant`,t,n,r,void 0,i):[]}function Ji(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`content_block_delta`:{let o=a.delta;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function $(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:a={sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:i.thinking??``}};break;case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:Yi(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,rawInput:e,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=Hi(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function Yi(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}async function Xi(e,t,n,r,i,a){for(let o of t){let t=o.type;if(t!==`user`&&t!==`assistant`||o.isMeta===!0)continue;let s=o.message?.content;if(!s)continue;let c=t===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=$(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a});for(let e of t)await n.sessionUpdate(e)}}}function Zi(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function Qi(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=Zi(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}function $i(e,t,n,r,i,a,o){return async(n,s,c,l,u,d)=>{let f=ta(r);if(n.name===`ExitPlanMode`)return ea(e,t,u,s,f,i,a,o);if(d!==void 0)return d;try{let e=await fe(n,s,c,l,u);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:u}}let p=Q({name:n.name,id:u,input:s},f,i),m={toolCallId:u,title:p.title,kind:p.kind,status:`pending`,rawInput:s},h=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`}];try{let n=await e.requestPermission({sessionId:t,toolCall:m,options:h});if(n.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`}};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:s}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function ea(e,t,n,r,i,a,o,s){let c=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&c.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let l=Q({name:`ExitPlanMode`,id:n,input:r},i,a),u={toolCallId:n,title:l.title,kind:l.kind,status:`pending`,rawInput:r},d=await e.requestPermission({sessionId:t,toolCall:u,options:c});if(d.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(d.outcome.outcome===`selected`&&`optionId`in d.outcome&&d.outcome.optionId!==void 0){let n=d.outcome.optionId;if(c.some(e=>e.optionId===n)&&(n===`default`||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function ta(e){if(!e)return!1;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}function na(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(ra(n,r))}else if(e.type===`resource`){let n=e.resource;n&&typeof n.text==`string`&&t.push(n.text)}}return t.filter(e=>e.length>0).join(`
|
|
14
|
+
`)}function ra(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}Se(),oe(),Ce(),e();var ia=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{fork:{},list:{},resume:{},close:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){let t=await we({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:zi(e.summary??``),updatedAt:new Date(e.lastModified).toISOString()});return{sessions:n}}async unstable_forkSession(e){let t=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async prompt(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=na(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=Pe();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==r)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController();let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Ki(e.sessionId,r,this.conn,t.queryEngine.getAbortSignal(),t.toolUseCache,this.clientCapabilities,t.cwd,()=>t.cancelled);return t.cancelled?{stopReason:`cancelled`}:{stopReason:i,usage:a?{inputTokens:a.inputTokens,outputTokens:a.outputTokens,cachedReadTokens:a.cachedReadTokens,cachedWriteTokens:a.cachedWriteTokens,totalTokens:a.inputTokens+a.outputTokens+a.cachedReadTokens+a.cachedWriteTokens}:void 0}}catch(n){if(t.cancelled)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=ga(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async setSessionConfigOption(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);if(!t.configOptions.find(t=>t.id===e.configId))throw Error(`Unknown config option: ${e.configId}`);let n=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,n),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:n}})):e.configId===`model`&&t.queryEngine.setModel(n),this.syncSessionConfigState(t,e.configId,n),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:n}:t),{configOptions:t.configOptions}}async createSession(e,t={}){se();let n=t.sessionId??Pe(),r=e.cwd;C(n),re(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=ke(),a=ge(i),o=e._meta,s=ua(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=sa(c,s,l),d=$i(this.conn,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,this.clientCapabilities,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=da(l),p={...me(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},m=await pe(r),h=new Ne({cwd:r,tools:a,commands:m,mcpClients:[],agents:[],canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Me(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),g={currentModeId:u,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},_=_e(),v=ae(),y={availableModels:_.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};h.setModel(v);let b=va(g,y),x={queryEngine:h,cancelled:!1,cancelGeneration:0,cwd:r,modes:g,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Li({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,x),{sessionId:n,models:y,modes:g,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Li({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint)return C(e.sessionId),{sessionId:e.sessionId,modes:t.modes,models:t.models,configOptions:t.configOptions};await this.teardownSession(e.sessionId)}C(e.sessionId),re(e.cwd);let n;if(de(e.sessionId))try{let t=await be(e.sessionId);t&&t.messages.length>0&&(n=xe(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let r=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:n});if(n&&n.length>0){let t=this.sessions.get(e.sessionId);t&&await Xi(e.sessionId,n,this.conn,t.toolUseCache,this.clientCapabilities,t.cwd)}return{sessionId:r.sessionId,modes:r.modes,models:r.models,configOptions:r.configOptions}}async teardownSession(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}applySessionMode(e,t){if(!oa(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async updateConfigOption(e,t,n){let r=this.sessions.get(e);r&&(this.syncSessionConfigState(r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}syncSessionConfigState(e,t,n){t===`mode`?e.modes={...e.modes,currentModeId:n}:t===`model`&&(e.models={...e.models,currentModelId:n})}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}getSetting(e){let t=ce();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},aa=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function oa(e){return aa.includes(e)}function sa(e,t,n){if(t){let t=ca(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!da(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return la(n)??`default`}function ca(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Ii(e,t)}function la(e){if(e!=null)try{return Ii(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function ua(e,t){return!!e&&Object.hasOwn(e,t)}function da(e){return fa()&&(pa()||ma(e))}function fa(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function pa(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||ha(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ma(e){try{return Ii(e)===`bypassPermissions`}catch{return!1}}function ha(e){return e===`1`||e?.toLowerCase()===`true`}function ga(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),_a(e),n}_a(e)}function _a(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}function va(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}ie(),Oe();function ya(e,t){let n=Fe.toWeb(e);return yi(Ie.toWeb(t),n)}async function ba(){se(),Ee();let e=ya(process.stdin,process.stdout),t,n=new xi(e=>(t=new ia(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{ba as runAcpAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{n as r,s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{h as o,p as s}from"./debug-UI3T040K.js";import{c,u as l}from"./oauth-CdZEzMww.js";import{r as u,t as d}from"./bundledMode-kSQejuY4.js";import{n as f,r as p,t as m}from"./which-DqSAIvp2.js";import{homedir as h}from"os";import{join as g}from"path";function _(e,t){return{cmd:p(e)??e,args:t}}var v=e((()=>{m()}));async function y(e){try{return!!await f(e)}catch{return!1}}function b(){return process.env.__CFBundleIdentifier===`com.conductor.app`}function x(){if(process.env.CURSOR_TRACE_ID||process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`cursor`))return`cursor`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`windsurf`))return`windsurf`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`antigravity`))return`antigravity`;let e=process.env.__CFBundleIdentifier?.toLowerCase();if(e?.includes(`vscodium`))return`codium`;if(e?.includes(`windsurf`))return`windsurf`;if(e?.includes(`com.google.android.studio`))return`androidstudio`;if(e){for(let t of A)if(e.includes(t))return t}if(process.env.VisualStudioVersion)return`visualstudio`;if(process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`)return process.platform,`pycharm`;if(process.env.TERM===`xterm-ghostty`)return`ghostty`;if(process.env.TERM?.includes(`kitty`))return`kitty`;if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return`tmux`;if(process.env.STY)return`screen`;if(process.env.KONSOLE_VERSION)return`konsole`;if(process.env.GNOME_TERMINAL_SERVICE)return`gnome-terminal`;if(process.env.XTERM_VERSION)return`xterm`;if(process.env.VTE_VERSION)return`vte-based`;if(process.env.TERMINATOR_UUID)return`terminator`;if(process.env.KITTY_WINDOW_ID)return`kitty`;if(process.env.ALACRITTY_LOG)return`alacritty`;if(process.env.TILIX_ID)return`tilix`;if(process.env.WT_SESSION)return`windows-terminal`;if(process.env.SESSIONNAME&&process.env.TERM===`cygwin`)return`cygwin`;if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return`conemu`;if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(S())return`ssh-session`;if(process.env.TERM){let e=process.env.TERM;return e.includes(`alacritty`)?`alacritty`:e.includes(`rxvt`)?`rxvt`:e.includes(`termite`)?`termite`:process.env.TERM}return process.stdout.isTTY?null:`non-interactive`}function S(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function C(){let e=process.env.CLAUDE_CODE_HOST_PLATFORM;return e===`win32`||e===`darwin`||e===`linux`?e:M.platform}var w,T,E,D,O,k,A,j,M,N=e((()=>{n(),l(),d(),i(),v(),o(),m(),w=t(()=>{if(s().existsSync(g(r(),`.config.json`)))return g(r(),`.config.json`);let e=`.claude${c()}.json`;return g(process.env.CLAUDE_CONFIG_DIR||h(),e)}),T=t(async()=>{try{let{default:e}=await import(`./axios-DLnc2dVy.js`);return await e.head(`http://1.1.1.1`,{signal:AbortSignal.timeout(1e3)}),!0}catch{return!1}}),E=t(async()=>{let e=[];return await y(`npm`)&&e.push(`npm`),await y(`yarn`)&&e.push(`yarn`),await y(`pnpm`)&&e.push(`pnpm`),e}),D=t(async()=>{let e=[];return await y(`bun`)&&e.push(`bun`),await y(`deno`)&&e.push(`deno`),await y(`node`)&&e.push(`node`),e}),O=t(()=>{try{return s().existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)}catch{return!1}}),k=t(()=>{try{if(!O())return!1;let{cmd:e}=_(`npm`,[]);return e.startsWith(`/mnt/c/`)}catch{return!1}}),A=[`pycharm`,`intellij`,`webstorm`,`phpstorm`,`rubymine`,`clion`,`goland`,`rider`,`datagrip`,`appcode`,`dataspell`,`aqua`,`gateway`,`fleet`,`jetbrains`,`androidstudio`],j=t(()=>{if(a(process.env.CODESPACES))return`codespaces`;if(process.env.GITPOD_WORKSPACE_ID)return`gitpod`;if(process.env.REPL_ID||process.env.REPL_SLUG)return`replit`;if(process.env.PROJECT_DOMAIN)return`glitch`;if(a(process.env.VERCEL))return`vercel`;if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return`railway`;if(a(process.env.RENDER))return`render`;if(a(process.env.NETLIFY))return`netlify`;if(process.env.DYNO)return`heroku`;if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return`fly.io`;if(a(process.env.CF_PAGES))return`cloudflare-pages`;if(process.env.DENO_DEPLOYMENT_ID)return`deno-deploy`;if(process.env.AWS_LAMBDA_FUNCTION_NAME)return`aws-lambda`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_FARGATE`)return`aws-fargate`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_EC2`)return`aws-ecs`;try{if(s().readFileSync(`/sys/hypervisor/uuid`,{encoding:`utf8`}).trim().toLowerCase().startsWith(`ec2`))return`aws-ec2`}catch{}if(process.env.K_SERVICE)return`gcp-cloud-run`;if(process.env.GOOGLE_CLOUD_PROJECT)return`gcp`;if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return`azure-app-service`;if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return`azure-functions`;if(process.env.APP_URL?.includes(`ondigitalocean.app`))return`digitalocean-app-platform`;if(process.env.SPACE_CREATOR_USER_ID)return`huggingface-spaces`;if(a(process.env.GITHUB_ACTIONS))return`github-actions`;if(a(process.env.GITLAB_CI))return`gitlab-ci`;if(process.env.CIRCLECI)return`circleci`;if(process.env.BUILDKITE)return`buildkite`;if(a(process.env.CI))return`ci`;if(process.env.KUBERNETES_SERVICE_HOST)return`kubernetes`;try{if(s().existsSync(`/.dockerenv`))return`docker`}catch{}return M.platform===`darwin`?`unknown-darwin`:M.platform===`linux`?`unknown-linux`:M.platform===`win32`?`unknown-win32`:`unknown`}),M={hasInternetAccess:T,isCI:a(process.env.CI),platform:[`win32`,`darwin`].includes(process.platform)?process.platform:`linux`,arch:process.arch,nodeVersion:process.version,terminal:x(),isSSH:S,getPackageManagers:E,getRuntimes:D,isRunningWithBun:t(u),isWslEnvironment:O,isNpmFromWindowsPath:k,isConductor:b,detectDeploymentEnvironment:j}}));export{N as a,C as i,M as n,_ as o,w as r,v as s,A as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t}from"./envLessBridgeConfig-SPEr9oqO.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,kt as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{S as o,y as s}from"./paths-BBvuDQl9.js";import{n as c,t as l}from"./lazySchema-2sOku3cX.js";import{i as u,r as d}from"./semver-Tw0AFar5.js";import{r as f,s as p}from"./bridgeEnabled-D2IykaHE.js";async function m(){let e=await s(`tengu_bridge_repl_v2_config`,_),t=v().safeParse(e);return t.success?t.data:_}async function h(){let e=await m();return e.min_version&&u(`2.6.5`,e.min_version)?`Your version of Claude Code (2.6.5) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function g(){return p()?(await m()).should_show_app_upgrade_message:!1}var _,v,y=e((()=>{a(),o(),l(),d(),f(),_={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},v=c(()=>i({init_retry_max_attempts:t().int().min(1).max(10).default(3),init_retry_base_delay_ms:t().int().min(100).default(500),init_retry_jitter_fraction:t().min(0).max(1).default(.25),init_retry_max_delay_ms:t().int().min(500).default(4e3),http_timeout_ms:t().int().min(2e3).default(1e4),uuid_dedup_buffer_size:t().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:t().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:t().min(0).max(.5).default(.1),token_refresh_buffer_ms:t().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:t().int().min(500).max(2e3).default(1500),connect_timeout_ms:t().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return u(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:r().default(!1)}))}));export{g as a,y as i,h as n,m as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./memoize-DNnuA2aU.js";import{homedir as a}from"os";import{join as o}from"path";var s=n({checkProtectedNamespace:()=>c}),c,l=t((()=>{c=()=>!1}));function u(){return o(S(),`teams`)}function d(e){let t=process.env.NODE_OPTIONS;return t?t.split(/\s+/).includes(e):!1}function f(e){if(!e)return!1;if(typeof e==`boolean`)return e;let t=e.toLowerCase().trim();return[`1`,`true`,`yes`,`on`].includes(t)}function p(e){if(e===void 0)return!1;if(typeof e==`boolean`)return!e;if(!e)return!1;let t=e.toLowerCase().trim();return[`0`,`false`,`no`,`off`].includes(t)}function m(){return f(process.env.CLAUDE_CODE_SIMPLE)||process.argv.includes(`--bare`)}function h(e){let t={};if(e)for(let n of e){let[e,...r]=n.split(`=`);if(!e||r.length===0)throw Error(`Invalid environment variable format: ${n}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);t[e]=r.join(`=`)}return t}function g(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||`us-east-1`}function _(){return process.env.CLOUD_ML_REGION||`us-east5`}function v(){return f(process.env.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR)}function y(){return process.env.USER_TYPE===`ant`&&f(process.env.COO_RUNNING_ON_HOMESPACE)}function b(){return process.env.USER_TYPE===`ant`?(l(),e(s)).checkProtectedNamespace():!1}function x(e){if(e){let t=C.find(([t])=>e.startsWith(t));if(t)return process.env[t[1]]||_()}return _()}var S,C,w=t((()=>{i(),S=r(()=>(process.env.CLAUDE_CONFIG_DIR??o(a(),`.claude`)).normalize(`NFC`),()=>process.env.CLAUDE_CONFIG_DIR),C=[[`claude-haiku-4-5`,`VERTEX_REGION_CLAUDE_HAIKU_4_5`],[`claude-3-5-haiku`,`VERTEX_REGION_CLAUDE_3_5_HAIKU`],[`claude-3-5-sonnet`,`VERTEX_REGION_CLAUDE_3_5_SONNET`],[`claude-3-7-sonnet`,`VERTEX_REGION_CLAUDE_3_7_SONNET`],[`claude-opus-4-1`,`VERTEX_REGION_CLAUDE_4_1_OPUS`],[`claude-opus-4`,`VERTEX_REGION_CLAUDE_4_0_OPUS`],[`claude-sonnet-4-6`,`VERTEX_REGION_CLAUDE_4_6_SONNET`],[`claude-sonnet-4-5`,`VERTEX_REGION_CLAUDE_4_5_SONNET`],[`claude-sonnet-4`,`VERTEX_REGION_CLAUDE_4_0_SONNET`]]}));export{x as a,m as c,b as d,y as f,u as i,p as l,v as m,S as n,d as o,h as p,_ as r,w as s,g as t,f as u};
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import{a as e,n as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./defineProperty-80gRi2ZW.js";import{d as a,s as o}from"./debug-UI3T040K.js";import{tmpdir as s}from"os";import{join as c}from"path";import{readFileSync as l,unlinkSync as u}from"fs";function d(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var f=t((()=>{})),ee=n({apps:()=>_,display:()=>g,screenshot:()=>v});function p(e){let t=Bun.spawnSync({cmd:[`osascript`,`-l`,`JavaScript`,`-e`,e],stdout:`pipe`,stderr:`pipe`});return new TextDecoder().decode(t.stdout).trim()}async function m(e){let t=Bun.spawn([`osascript`,`-e`,e],{stdout:`pipe`,stderr:`pipe`}),n=await new Response(t.stdout).text();return await t.exited,n.trim()}async function te(e){let t=Bun.spawn([`osascript`,`-l`,`JavaScript`,`-e`,e],{stdout:`pipe`,stderr:`pipe`}),n=await new Response(t.stdout).text();return await t.exited,n.trim()}async function h(e){let t=c(s(),`cu-screenshot-${Date.now()}.png`);await Bun.spawn([`screencapture`,...e,t],{stdout:`pipe`,stderr:`pipe`}).exited;try{let e=l(t);return{base64:e.toString(`base64`),width:e.readUInt32BE(16),height:e.readUInt32BE(20)}}finally{try{u(t)}catch{}}}var g,_,v,ne=t((()=>{g={getSize(e){let t=this.listAll();if(e!==void 0){let n=t.find(t=>t.displayId===e);if(n)return n}return t[0]??{width:1920,height:1080,scaleFactor:2,displayId:1}},listAll(){try{let e=p(`
|
|
2
|
+
ObjC.import("CoreGraphics");
|
|
3
|
+
var displays = $.CGDisplayCopyAllDisplayModes ? [] : [];
|
|
4
|
+
var active = $.CGGetActiveDisplayList(10, null, Ref());
|
|
5
|
+
var countRef = Ref();
|
|
6
|
+
$.CGGetActiveDisplayList(0, null, countRef);
|
|
7
|
+
var count = countRef[0];
|
|
8
|
+
var idBuf = Ref();
|
|
9
|
+
$.CGGetActiveDisplayList(count, idBuf, countRef);
|
|
10
|
+
var result = [];
|
|
11
|
+
for (var i = 0; i < count; i++) {
|
|
12
|
+
var did = idBuf[i];
|
|
13
|
+
var w = $.CGDisplayPixelsWide(did);
|
|
14
|
+
var h = $.CGDisplayPixelsHigh(did);
|
|
15
|
+
var mode = $.CGDisplayCopyDisplayMode(did);
|
|
16
|
+
var pw = $.CGDisplayModeGetPixelWidth(mode);
|
|
17
|
+
var sf = pw > 0 && w > 0 ? pw / w : 2;
|
|
18
|
+
result.push({width: w, height: h, scaleFactor: sf, displayId: did});
|
|
19
|
+
}
|
|
20
|
+
JSON.stringify(result);
|
|
21
|
+
`);return JSON.parse(e).map(e=>({width:Number(e.width),height:Number(e.height),scaleFactor:Number(e.scaleFactor),displayId:Number(e.displayId)}))}catch{try{let e=p(`
|
|
22
|
+
ObjC.import("AppKit");
|
|
23
|
+
var screens = $.NSScreen.screens;
|
|
24
|
+
var result = [];
|
|
25
|
+
for (var i = 0; i < screens.count; i++) {
|
|
26
|
+
var s = screens.objectAtIndex(i);
|
|
27
|
+
var frame = s.frame;
|
|
28
|
+
var desc = s.deviceDescription;
|
|
29
|
+
var screenNumber = desc.objectForKey($("NSScreenNumber")).intValue;
|
|
30
|
+
var backingFactor = s.backingScaleFactor;
|
|
31
|
+
result.push({
|
|
32
|
+
width: Math.round(frame.size.width),
|
|
33
|
+
height: Math.round(frame.size.height),
|
|
34
|
+
scaleFactor: backingFactor,
|
|
35
|
+
displayId: screenNumber
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
JSON.stringify(result);
|
|
39
|
+
`);return JSON.parse(e).map(e=>({width:Number(e.width),height:Number(e.height),scaleFactor:Number(e.scaleFactor),displayId:Number(e.displayId)}))}catch{return[{width:1920,height:1080,scaleFactor:2,displayId:1}]}}}},_={async prepareDisplay(e,t,n){return{activated:``,hidden:[]}},async previewHideSet(e,t){return[]},async findWindowDisplays(e){return e.map(e=>({bundleId:e,displayIds:[1]}))},async appUnderPoint(e,t){try{let n=await te(`
|
|
40
|
+
ObjC.import("CoreGraphics");
|
|
41
|
+
ObjC.import("AppKit");
|
|
42
|
+
var pt = $.CGPointMake(${e}, ${t});
|
|
43
|
+
var app = $.NSWorkspace.sharedWorkspace.frontmostApplication;
|
|
44
|
+
JSON.stringify({bundleId: app.bundleIdentifier.js, displayName: app.localizedName.js});
|
|
45
|
+
`);return JSON.parse(n)}catch{return null}},async listInstalled(){try{let e=[`/Applications`,`~/Applications`,`/System/Applications`],t=[];for(let n of e){let e=n.startsWith(`~`)?c(process.env.HOME??`~`,n.slice(1)):n,r=Bun.spawn([`bash`,`-c`,`for f in "${e}"/*.app; do [ -d "$f" ] || continue; bid=$(mdls -name kMDItemCFBundleIdentifier "$f" 2>/dev/null | sed 's/.*= "//;s/"//'); name=$(basename "$f" .app); echo "$f|$name|$bid"; done`],{stdout:`pipe`,stderr:`pipe`}),i=await new Response(r.stdout).text();await r.exited;for(let e of i.split(`
|
|
46
|
+
`).filter(Boolean)){let[n,r,i]=e.split(`|`,3);n&&r&&i&&i!==`(null)`&&t.push({bundleId:i,displayName:r,path:n})}}let n=new Set;return t.filter(e=>n.has(e.bundleId)?!1:(n.add(e.bundleId),!0))}catch{return[]}},iconDataUrl(e){return null},listRunning(){try{let e=p(`
|
|
47
|
+
var apps = Application("System Events").applicationProcesses.whose({backgroundOnly: false});
|
|
48
|
+
var result = [];
|
|
49
|
+
for (var i = 0; i < apps.length; i++) {
|
|
50
|
+
try {
|
|
51
|
+
var a = apps[i];
|
|
52
|
+
result.push({bundleId: a.bundleIdentifier(), displayName: a.name()});
|
|
53
|
+
} catch(e) {}
|
|
54
|
+
}
|
|
55
|
+
JSON.stringify(result);
|
|
56
|
+
`);return JSON.parse(e)}catch{return[]}},async open(e){await m(`tell application id "${e}" to activate`)},async unhide(e){for(let t of e)await m(`
|
|
57
|
+
tell application "System Events"
|
|
58
|
+
set visible of application process (name of application process whose bundle identifier is "${t}") to true
|
|
59
|
+
end tell
|
|
60
|
+
`)}},v={async captureExcluding(e,t,n,r,i){let a=[`-x`];return i!==void 0&&a.push(`-D`,String(i)),h(a)},async captureRegion(e,t,n,r,i,a,o,s,c){let l=[`-x`,`-R`,`${t},${n},${r},${i}`];return c!==void 0&&l.push(`-D`,String(c)),h(l)},captureWindowTarget(e){return null}}})),re=n({listWindows:()=>y});function y(){let e=Bun.spawnSync({cmd:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,b],stdout:`pipe`,stderr:`pipe`}),t=new TextDecoder().decode(e.stdout).trim();return t?t.split(`
|
|
61
|
+
`).filter(Boolean).map(e=>{let t=e.trim(),n=t.indexOf(`|`),r=t.indexOf(`|`,n+1);if(n===-1||r===-1)return null;let i=t.slice(0,n),a=Number(t.slice(n+1,r)),o=t.slice(r+1);return!i||isNaN(a)||!o?null:{hwnd:i,pid:a,title:o}}).filter(e=>e!==null):[]}var b,x=t((()=>{b=`
|
|
62
|
+
Add-Type @'
|
|
63
|
+
using System;
|
|
64
|
+
using System.Collections.Generic;
|
|
65
|
+
using System.Runtime.InteropServices;
|
|
66
|
+
using System.Text;
|
|
67
|
+
public class WinEnum {
|
|
68
|
+
public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
|
|
69
|
+
|
|
70
|
+
[DllImport("user32.dll")]
|
|
71
|
+
public static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
|
|
72
|
+
[DllImport("user32.dll")]
|
|
73
|
+
public static extern bool IsWindowVisible(IntPtr hWnd);
|
|
74
|
+
[DllImport("user32.dll", CharSet=CharSet.Unicode)]
|
|
75
|
+
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
|
|
76
|
+
[DllImport("user32.dll")]
|
|
77
|
+
public static extern int GetWindowTextLength(IntPtr hWnd);
|
|
78
|
+
[DllImport("user32.dll")]
|
|
79
|
+
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);
|
|
80
|
+
|
|
81
|
+
public static List<string> results = new List<string>();
|
|
82
|
+
|
|
83
|
+
public static void Run() {
|
|
84
|
+
results.Clear();
|
|
85
|
+
EnumWindows(delegate(IntPtr hWnd, IntPtr lParam) {
|
|
86
|
+
if (!IsWindowVisible(hWnd)) return true;
|
|
87
|
+
int len = GetWindowTextLength(hWnd);
|
|
88
|
+
if (len == 0) return true;
|
|
89
|
+
StringBuilder sb = new StringBuilder(len + 1);
|
|
90
|
+
GetWindowText(hWnd, sb, sb.Capacity);
|
|
91
|
+
string title = sb.ToString();
|
|
92
|
+
if (string.IsNullOrWhiteSpace(title)) return true;
|
|
93
|
+
uint pid = 0;
|
|
94
|
+
GetWindowThreadProcessId(hWnd, out pid);
|
|
95
|
+
results.Add(hWnd.ToInt64() + "|" + pid + "|" + title);
|
|
96
|
+
return true;
|
|
97
|
+
}, IntPtr.Zero);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
'@
|
|
101
|
+
[WinEnum]::Run()
|
|
102
|
+
[WinEnum]::results | ForEach-Object { $_ }
|
|
103
|
+
`}));function S(e){let t=e.trim();if(!t||t===`NOT_FOUND`||t===`INVALID_SIZE`)return null;let n=t.indexOf(`,`),r=t.indexOf(`,`,n+1);if(n===-1||r===-1)return null;let i=Number(t.slice(0,n)),a=Number(t.slice(n+1,r)),o=t.slice(r+1);return!i||!a||!o?null:{base64:o,width:i,height:a}}function C(e){let t=Bun.spawnSync({cmd:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,e],stdout:`pipe`,stderr:`pipe`});return new TextDecoder().decode(t.stdout).trim()}function ie(e){return S(C(`${T}\n[WinCap]::Capture('${e.replace(/'/g,`''`)}')`))}function w(e){return S(C(`${E}\n[WinCapH]::Capture([IntPtr]::new(${e}))`))}var T,E,ae=t((()=>{T=`
|
|
104
|
+
Add-Type -AssemblyName System.Drawing
|
|
105
|
+
Add-Type -ReferencedAssemblies System.Drawing @'
|
|
106
|
+
using System;
|
|
107
|
+
using System.Runtime.InteropServices;
|
|
108
|
+
using System.Drawing;
|
|
109
|
+
using System.Drawing.Imaging;
|
|
110
|
+
public class WinCap {
|
|
111
|
+
[DllImport("user32.dll", CharSet=CharSet.Unicode)]
|
|
112
|
+
public static extern IntPtr FindWindow(string c, string t);
|
|
113
|
+
[DllImport("user32.dll")]
|
|
114
|
+
public static extern bool GetWindowRect(IntPtr h, out RECT r);
|
|
115
|
+
[DllImport("user32.dll")]
|
|
116
|
+
public static extern bool PrintWindow(IntPtr h, IntPtr hdc, uint f);
|
|
117
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
118
|
+
public struct RECT { public int L, T, R, B; }
|
|
119
|
+
|
|
120
|
+
public static string Capture(string title) {
|
|
121
|
+
IntPtr hwnd = FindWindow(null, title);
|
|
122
|
+
if (hwnd == IntPtr.Zero) return "NOT_FOUND";
|
|
123
|
+
RECT r; GetWindowRect(hwnd, out r);
|
|
124
|
+
int w = r.R - r.L; int h = r.B - r.T;
|
|
125
|
+
if (w <= 0 || h <= 0) return "INVALID_SIZE";
|
|
126
|
+
Bitmap bmp = new Bitmap(w, h);
|
|
127
|
+
Graphics g = Graphics.FromImage(bmp);
|
|
128
|
+
IntPtr hdc = g.GetHdc();
|
|
129
|
+
PrintWindow(hwnd, hdc, 2);
|
|
130
|
+
g.ReleaseHdc(hdc); g.Dispose();
|
|
131
|
+
var ms = new System.IO.MemoryStream();
|
|
132
|
+
bmp.Save(ms, ImageFormat.Png);
|
|
133
|
+
bmp.Dispose();
|
|
134
|
+
return w + "," + h + "," + Convert.ToBase64String(ms.ToArray());
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
'@
|
|
138
|
+
`,E=`
|
|
139
|
+
Add-Type -AssemblyName System.Drawing
|
|
140
|
+
Add-Type -ReferencedAssemblies System.Drawing @'
|
|
141
|
+
using System;
|
|
142
|
+
using System.Runtime.InteropServices;
|
|
143
|
+
using System.Drawing;
|
|
144
|
+
using System.Drawing.Imaging;
|
|
145
|
+
public class WinCapH {
|
|
146
|
+
[DllImport("user32.dll")]
|
|
147
|
+
public static extern bool GetWindowRect(IntPtr h, out RECT r);
|
|
148
|
+
[DllImport("user32.dll")]
|
|
149
|
+
public static extern bool PrintWindow(IntPtr h, IntPtr hdc, uint f);
|
|
150
|
+
[DllImport("user32.dll")]
|
|
151
|
+
public static extern bool IsWindow(IntPtr hWnd);
|
|
152
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
153
|
+
public struct RECT { public int L, T, R, B; }
|
|
154
|
+
|
|
155
|
+
public static string Capture(IntPtr hwnd) {
|
|
156
|
+
if (!IsWindow(hwnd)) return "NOT_FOUND";
|
|
157
|
+
RECT r; GetWindowRect(hwnd, out r);
|
|
158
|
+
int w = r.R - r.L; int h = r.B - r.T;
|
|
159
|
+
if (w <= 0 || h <= 0) return "INVALID_SIZE";
|
|
160
|
+
Bitmap bmp = new Bitmap(w, h);
|
|
161
|
+
Graphics g = Graphics.FromImage(bmp);
|
|
162
|
+
IntPtr hdc = g.GetHdc();
|
|
163
|
+
PrintWindow(hwnd, hdc, 2);
|
|
164
|
+
g.ReleaseHdc(hdc); g.Dispose();
|
|
165
|
+
var ms = new System.IO.MemoryStream();
|
|
166
|
+
bmp.Save(ms, ImageFormat.Png);
|
|
167
|
+
bmp.Dispose();
|
|
168
|
+
return w + "," + h + "," + Convert.ToBase64String(ms.ToArray());
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
'@
|
|
172
|
+
`})),oe=n({apps:()=>A,display:()=>k,screenshot:()=>j});function D(e){let t=Bun.spawnSync({cmd:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,e],stdout:`pipe`,stderr:`pipe`});return new TextDecoder().decode(t.stdout).trim()}async function O(e){let t=Bun.spawn([`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,e],{stdout:`pipe`,stderr:`pipe`}),n=await new Response(t.stdout).text();return await t.exited,n.trim()}var k,A,j,se=t((()=>{x(),ae(),k={getSize(e){let t=this.listAll();if(e!==void 0){let n=t.find(t=>t.displayId===e);if(n)return n}return t[0]??{width:1920,height:1080,scaleFactor:1,displayId:0}},listAll(){try{return D(`
|
|
173
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
174
|
+
$result = @()
|
|
175
|
+
$idx = 0
|
|
176
|
+
foreach ($s in [System.Windows.Forms.Screen]::AllScreens) {
|
|
177
|
+
$result += "$($s.Bounds.Width),$($s.Bounds.Height),$idx,$($s.Primary)"
|
|
178
|
+
$idx++
|
|
179
|
+
}
|
|
180
|
+
$result -join "|"
|
|
181
|
+
`).split(`|`).filter(Boolean).map(e=>{let[t,n,r,i]=e.split(`,`);return{width:Number(t),height:Number(n),scaleFactor:1,displayId:Number(r)}})}catch{return[{width:1920,height:1080,scaleFactor:1,displayId:0}]}}},A={async prepareDisplay(e,t,n){return{activated:``,hidden:[]}},async previewHideSet(e,t){return[]},async findWindowDisplays(e){return e.map(e=>({bundleId:e,displayIds:[0]}))},async appUnderPoint(e,t){try{let n=D(`
|
|
182
|
+
Add-Type @'
|
|
183
|
+
using System;
|
|
184
|
+
using System.Runtime.InteropServices;
|
|
185
|
+
public class WinPt {
|
|
186
|
+
[StructLayout(LayoutKind.Sequential)] public struct POINT { public int X; public int Y; }
|
|
187
|
+
[DllImport("user32.dll")] public static extern IntPtr WindowFromPoint(POINT p);
|
|
188
|
+
[DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint pid);
|
|
189
|
+
}
|
|
190
|
+
'@
|
|
191
|
+
$pt = New-Object WinPt+POINT
|
|
192
|
+
$pt.X = ${e}; $pt.Y = ${t}
|
|
193
|
+
$hwnd = [WinPt]::WindowFromPoint($pt)
|
|
194
|
+
$pid = [uint32]0
|
|
195
|
+
[WinPt]::GetWindowThreadProcessId($hwnd, [ref]$pid) | Out-Null
|
|
196
|
+
$proc = Get-Process -Id $pid -ErrorAction SilentlyContinue
|
|
197
|
+
"$($proc.MainModule.FileName)|$($proc.ProcessName)"
|
|
198
|
+
`);if(!n||!n.includes(`|`))return null;let[r,i]=n.split(`|`,2);return{bundleId:r,displayName:i}}catch{return null}},async listInstalled(){try{return(await O(`
|
|
199
|
+
$apps = @()
|
|
200
|
+
$paths = @(
|
|
201
|
+
'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',
|
|
202
|
+
'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*',
|
|
203
|
+
'HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'
|
|
204
|
+
)
|
|
205
|
+
foreach ($p in $paths) {
|
|
206
|
+
Get-ItemProperty $p -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName } | ForEach-Object {
|
|
207
|
+
$apps += "$($_.DisplayName)|$($_.InstallLocation)|$($_.PSChildName)"
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
$apps | Select-Object -Unique | Select-Object -First 200
|
|
211
|
+
`)).split(`
|
|
212
|
+
`).filter(Boolean).map(e=>{let[t,n,r]=e.split(`|`,3);return{bundleId:r??t??``,displayName:t??``,path:n??``}})}catch{return[]}},iconDataUrl(e){return null},listRunning(){try{return y().map(e=>({bundleId:String(e.hwnd),displayName:e.title}))}catch{return[]}},async open(e){let t=e.replace(/'/g,`''`);await O(`
|
|
213
|
+
if (Test-Path '${t}') {
|
|
214
|
+
Start-Process '${t}'
|
|
215
|
+
} else {
|
|
216
|
+
Start-Process -FilePath '${t}' -ErrorAction SilentlyContinue
|
|
217
|
+
}`)},async unhide(e){for(let t of e)await O(`
|
|
218
|
+
Add-Type @'
|
|
219
|
+
using System;
|
|
220
|
+
using System.Runtime.InteropServices;
|
|
221
|
+
public class WinShow {
|
|
222
|
+
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmd);
|
|
223
|
+
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd);
|
|
224
|
+
}
|
|
225
|
+
'@
|
|
226
|
+
$proc = Get-Process -Name "${t}" -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
227
|
+
if ($proc) { [WinShow]::ShowWindow($proc.MainWindowHandle, 9) | Out-Null; [WinShow]::SetForegroundWindow($proc.MainWindowHandle) | Out-Null }
|
|
228
|
+
`)}},j={async captureExcluding(e,t,n,r,i){let a=await O(`
|
|
229
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
230
|
+
Add-Type -AssemblyName System.Drawing
|
|
231
|
+
$screen = if (${i??-1} -ge 0) { [System.Windows.Forms.Screen]::AllScreens[${i??0}] } else { [System.Windows.Forms.Screen]::PrimaryScreen }
|
|
232
|
+
$bounds = $screen.Bounds
|
|
233
|
+
$bmp = New-Object System.Drawing.Bitmap($bounds.Width, $bounds.Height)
|
|
234
|
+
$g = [System.Drawing.Graphics]::FromImage($bmp)
|
|
235
|
+
$g.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size)
|
|
236
|
+
$g.Dispose()
|
|
237
|
+
$ms = New-Object System.IO.MemoryStream
|
|
238
|
+
$bmp.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png)
|
|
239
|
+
$bmp.Dispose()
|
|
240
|
+
$bytes = $ms.ToArray()
|
|
241
|
+
$ms.Dispose()
|
|
242
|
+
"$($bounds.Width),$($bounds.Height)," + [Convert]::ToBase64String($bytes)
|
|
243
|
+
`),o=a.indexOf(`,`),s=a.indexOf(`,`,o+1),c=Number(a.slice(0,o)),l=Number(a.slice(o+1,s));return{base64:a.slice(s+1),width:c,height:l}},async captureRegion(e,t,n,r,i,a,o,s,c){let l=await O(`
|
|
244
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
245
|
+
Add-Type -AssemblyName System.Drawing
|
|
246
|
+
$bmp = New-Object System.Drawing.Bitmap(${r}, ${i})
|
|
247
|
+
$g = [System.Drawing.Graphics]::FromImage($bmp)
|
|
248
|
+
$g.CopyFromScreen(${t}, ${n}, 0, 0, (New-Object System.Drawing.Size(${r}, ${i})))
|
|
249
|
+
$g.Dispose()
|
|
250
|
+
$ms = New-Object System.IO.MemoryStream
|
|
251
|
+
$bmp.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png)
|
|
252
|
+
$bmp.Dispose()
|
|
253
|
+
$bytes = $ms.ToArray()
|
|
254
|
+
$ms.Dispose()
|
|
255
|
+
"${r},${i}," + [Convert]::ToBase64String($bytes)
|
|
256
|
+
`),u=l.indexOf(`,`),d=l.indexOf(`,`,u+1);return{base64:l.slice(d+1),width:r,height:i}},captureWindowTarget(e){return typeof e==`number`?w(e):ie(e)}}})),ce=n({apps:()=>I,display:()=>F,screenshot:()=>R});function M(e){let t=Bun.spawnSync({cmd:e,stdout:`pipe`,stderr:`pipe`});return new TextDecoder().decode(t.stdout).trim()}async function N(e){let t=Bun.spawn(e,{stdout:`pipe`,stderr:`pipe`}),n=await new Response(t.stdout).text();return await t.exited,n.trim()}function P(e){return Bun.spawnSync({cmd:[`which`,e],stdout:`pipe`,stderr:`pipe`}).exitCode===0}var F,I,L,R,z=t((()=>{F={getSize(e){let t=this.listAll();if(e!==void 0){let n=t.find(t=>t.displayId===e);if(n)return n}return t[0]??{width:1920,height:1080,scaleFactor:1,displayId:0}},listAll(){try{let e=M([`xrandr`,`--query`]),t=[],n=0,r=/^\S+\s+connected\s+(?:primary\s+)?(\d+)x(\d+)\+\d+\+\d+/gm,i;for(;(i=r.exec(e))!==null;)t.push({width:Number(i[1]),height:Number(i[2]),scaleFactor:1,displayId:n++});return t.length===0?[{width:1920,height:1080,scaleFactor:1,displayId:0}]:t}catch{return[{width:1920,height:1080,scaleFactor:1,displayId:0}]}}},I={async prepareDisplay(e,t,n){return{activated:``,hidden:[]}},async previewHideSet(e,t){return[]},async findWindowDisplays(e){return e.map(e=>({bundleId:e,displayIds:[0]}))},async appUnderPoint(e,t){try{let n=M([`xdotool`,`mousemove`,`--sync`,String(e),String(t),`getmouselocation`,`--shell`]).match(/WINDOW=(\d+)/);if(!n)return null;let r=n[1],i=M([`xdotool`,`getwindowpid`,r]);if(!i)return null;let a=``;try{a=M([`readlink`,`-f`,`/proc/${i}/exe`])}catch{}let o=``;try{o=M([`cat`,`/proc/${i}/comm`])}catch{}return!a&&!o?null:{bundleId:a||i,displayName:o||`unknown`}}catch{return null}},async listInstalled(){try{let e=[`/usr/share/applications`,`/usr/local/share/applications`,`${process.env.HOME}/.local/share/applications`],t=[];for(let n of e){let e;try{e=M([`find`,n,`-name`,`*.desktop`,`-maxdepth`,`1`])}catch{continue}for(let n of e.split(`
|
|
257
|
+
`).filter(Boolean))try{let e=M([`cat`,n]),r=e.match(/^Name=(.+)$/m),i=e.match(/^Exec=(.+)$/m);if(e.match(/^NoDisplay=true$/m))continue;let a=r?.[1]??``,o=i?.[1]??``;if(!a)continue;t.push({bundleId:n.split(`/`).pop()?.replace(`.desktop`,``)??``,displayName:a,path:o.split(/\s+/)[0]??``})}catch{}}return t.slice(0,200)}catch{return[]}},iconDataUrl(e){return null},listRunning(){try{if(P(`wmctrl`)){let e=M([`wmctrl`,`-l`,`-p`]),t=[];for(let n of e.split(`
|
|
258
|
+
`).filter(Boolean)){let e=n.split(/\s+/)[2];if(!e||e===`0`)continue;let r=``;try{r=M([`readlink`,`-f`,`/proc/${e}/exe`])}catch{}let i=``;try{i=M([`cat`,`/proc/${e}/comm`])}catch{}i&&t.push({bundleId:r||e,displayName:i})}let n=new Set;return t.filter(e=>n.has(e.bundleId)?!1:(n.add(e.bundleId),!0)).slice(0,50)}let e=M([`ps`,`-eo`,`pid,comm`,`--no-headers`]),t=[];for(let n of e.split(`
|
|
259
|
+
`).filter(Boolean).slice(0,50)){let e=n.trim().match(/^(\d+)\s+(.+)$/);e&&t.push({bundleId:e[1],displayName:e[2]})}return t}catch{return[]}},async open(e){try{let t=e.endsWith(`.desktop`)?e:`${e}.desktop`;if(P(`gtk-launch`)){await N([`gtk-launch`,t]);return}}catch{}await N([`xdg-open`,e])},async unhide(e){for(let t of e)try{P(`wmctrl`)&&t.startsWith(`0x`)?await N([`wmctrl`,`-i`,`-R`,t]):await N([`xdotool`,`search`,`--name`,t,`windowactivate`])}catch{}}},L=`/tmp/cu-screenshot.png`,R={async captureExcluding(e,t,n,r,i){try{await N([`scrot`,`-o`,L]);let e=await Bun.file(L).arrayBuffer(),t=Buffer.from(e).toString(`base64`),n=F.getSize(i);return{base64:t,width:n.width,height:n.height}}catch{return{base64:``,width:0,height:0}}},async captureRegion(e,t,n,r,i,a,o,s,c){try{await N([`scrot`,`-a`,`${t},${n},${r},${i}`,`-o`,L]);let e=await Bun.file(L).arrayBuffer();return{base64:Buffer.from(e).toString(`base64`),width:r,height:i}}catch{return{base64:``,width:0,height:0}}},captureWindowTarget(e){return null}}})),le=n({ComputerUseAPI:()=>V});function ue(){try{if(process.platform===`darwin`)return ne(),e(ee);if(process.platform===`win32`)return se(),e(oe);if(process.platform===`linux`)return z(),e(ce)}catch{return null}return null}var B,V,de=t((()=>{r(),B=ue(),V=class{constructor(){i(this,`apps`,B?.apps??{async prepareDisplay(){return{activated:``,hidden:[]}},async previewHideSet(){return[]},async findWindowDisplays(e){return e.map(e=>({bundleId:e,displayIds:[]}))},async appUnderPoint(){return null},async listInstalled(){return[]},iconDataUrl(){return null},listRunning(){return[]},async open(){throw Error(`@ant/computer-use-swift: macOS only`)},async unhide(){}}),i(this,`display`,B?.display??{getSize(){throw Error(`@ant/computer-use-swift: macOS only`)},listAll(){throw Error(`@ant/computer-use-swift: macOS only`)}}),i(this,`screenshot`,B?.screenshot??{async captureExcluding(){throw Error(`@ant/computer-use-swift: macOS only`)},async captureRegion(){throw Error(`@ant/computer-use-swift: macOS only`)}})}async resolvePrepareCapture(e,t,n,r,i,a){return this.screenshot.captureExcluding(e,n,r,i,a)}}}));function H(){if(U)return U;let t=(de(),e(le));return U=t.ComputerUseAPI&&typeof t.ComputerUseAPI==`function`?new t.ComputerUseAPI:t,U}var U,W=t((()=>{}));function fe(e){e?._drainMainRunLoop?.()}function G(){J++,q===void 0&&(q=setInterval(fe,1,H()),a(`[drainRunLoop] pump started`,{level:`verbose`}))}function K(){J--,J<=0&&q!==void 0&&(clearInterval(q),q=void 0,a(`[drainRunLoop] pump stopped`,{level:`verbose`}),J=0)}function pe(e){e(Error(`computer-use native call exceeded ${Y}ms`))}async function me(e){if(process.platform!==`darwin`)return e();G();let t;try{let n=e();n.catch(()=>{});let r=d();return t=setTimeout(pe,Y,r.reject),await Promise.race([n,r.promise])}finally{clearTimeout(t),K()}}var q,J,Y,X,Z,Q=t((()=>{o(),f(),W(),J=0,Y=3e4,X=G,Z=K}));function he(e){return process.platform===`darwin`?$?!0:H().hotkey?.registerEscape(e)?(X(),$=!0,a(`[cu-esc] registered`),!0):(a(`[cu-esc] registerEscape returned false`,{level:`warn`}),!1):!1}function ge(){if($)try{H().hotkey?.unregister()}finally{Z(),$=!1,a(`[cu-esc] unregistered`)}}function _e(){$&&H().hotkey?.notifyExpectedEscape()}var $,ve=t((()=>{o(),Q(),W(),$=!1}));export{me as a,H as c,re as d,f,ge as i,x as l,_e as n,Q as o,d as p,he as r,W as s,ve as t,y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{S as t,a as n,d as r,f as i,n as a,u as o,x as s}from"./esm-vIn-YV_h.js";var c,l=e((()=>{s(),a(),o(),c=class extends t{constructor(e={}){super(i(r(e,`LOGS`,`v1/logs`,{"Content-Type":`application/json`}),n))}}})),u=e((()=>{l()}));e((()=>{u()}))();export{c as OTLPLogExporter};
|